@MappedSuperclass
@FilterDef(
name = "tenantFilter",
parameters = @ParamDef(name = "tenantId", type = String.class)
)
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
import { Injectable, Scope } from '@nestjs/common';
import { DataSource, EntityManager, QueryRunner } from 'typeorm';
@Injectable({ scope: Scope.REQUEST })
export class TransactionContext {
private queryRunner?: QueryRunner;
import { SetMetadata } from '@nestjs/common';
export const CACHEABLE_KEY = 'cacheable:options';
export type VaryDimension = 'user' | 'tenant' | 'query';
const STORAGE_KEY = "auth.refreshToken";
let accessToken = null;
let refreshToken = localStorage.getItem(STORAGE_KEY);
const listeners = new Set();
class EmailDedupService
DEFAULT_TTL = 5.minutes.to_i
def self.claim(fingerprint, ttl: DEFAULT_TTL)
key = "email_dedup:#{fingerprint}"
# Atomic set-if-absent with expiry; returns true only for the first caller.