UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

56 lines 2.04 kB
//#region src/libs/kv/cache-keys.d.ts declare const HTTP_STATIC_PREFIX = "http:static:"; declare const cacheKeys: { /** * Generate cache keys for collection schema + migration metadata. */ readonly collection: { readonly schema: (collectionKey: string) => string; }; /** * Generate cache keys for rate limiting (used by rate limiter middleware) */ readonly rateLimit: { readonly ip: (ip: string) => string; readonly user: (userId: string | number) => string; readonly client: (clientId: string | number) => string; readonly record: (key: string) => string; }; /** * Generate cache keys for authentication */ readonly auth: { readonly user: (userId: string | number, namespaceToken: string, tenantKey?: string | null) => string; /** * Cache key for refresh token existence */ readonly refresh: (token: string) => string; }; /** * Generate namespace keys for token-based invalidation/versioning. */ readonly namespace: { readonly token: (namespace: string) => string; }; /** * Generate cache keys for HTTP responses (used by cache middleware) */ readonly http: { readonly response: (hash: string) => string; readonly tags: { readonly clientLocales: "client-locales"; readonly clientMedia: "client-media"; readonly clientDocuments: "client-documents"; readonly clientDocumentsCollection: (collectionKey: string) => string; }; readonly static: { readonly clientLocales: "http:static:client-locales"; readonly clientMediaSingle: (id: string | number, tenantKey?: string | null) => `${typeof HTTP_STATIC_PREFIX}client-media:${string}`; }; }; }; type HttpStaticValue<T> = T extends ((...args: infer _A) => infer R) ? R : T; type HttpStaticValues = { [K in keyof typeof cacheKeys.http.static]: HttpStaticValue<(typeof cacheKeys.http.static)[K]> }[keyof typeof cacheKeys.http.static]; //#endregion export { HttpStaticValues, cacheKeys as default }; //# sourceMappingURL=cache-keys.d.mts.map