unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
29 lines • 1.62 kB
TypeScript
import { type Db, type IUnleashConfig, type IUnleashStores } from '../types/index.js';
import type { ValidatedEdgeTokensSchema } from '../openapi/index.js';
import type { EdgeEnvironmentsProjectsListSchema } from '../openapi/index.js';
import type { EdgeClient } from '../types/stores/edge-store.js';
import type { IUnleashServices } from './index.js';
type ReplayProtectionArgs = {
clientId: string;
nonce: string;
expiresAt: Date;
};
export declare const createTransactionalEdgeService: (db: Db, config: IUnleashConfig) => EdgeService;
export declare const createFakeEdgeService: (config: IUnleashConfig) => EdgeService;
export default class EdgeService {
private logger;
private apiTokenService;
private edgeTokenStore;
private readonly edgeMasterKey;
constructor({ edgeTokenStore }: Pick<IUnleashStores, 'edgeTokenStore'>, { apiTokenService }: Pick<IUnleashServices, 'apiTokenService'>, { getLogger, edgeMasterKey, }: Pick<IUnleashConfig, 'getLogger' | 'edgeMasterKey'>);
getValidTokens(tokens: string[]): Promise<ValidatedEdgeTokensSchema>;
notSeenBefore({ clientId, nonce, expiresAt, }: ReplayProtectionArgs): Promise<boolean>;
loadClient(clientId: string): Promise<EdgeClient | undefined>;
decryptedClientSecret(client: EdgeClient): Buffer;
saveClient(clientId: string, secret: string): Promise<void>;
getOrCreateTokens(clientId: string, tokenRequest: EdgeEnvironmentsProjectsListSchema): Promise<ValidatedEdgeTokensSchema>;
deleteExpiredNonces(): Promise<void>;
deleteAllTokens(): Promise<void>;
}
export {};
//# sourceMappingURL=edge-service.d.ts.map