UNPKG

2.31 kBTypeScriptView Raw
1import { Cache, IsolationStrategy } from '../cache';
2import { Destination } from './destination-service-types';
3import { DestinationsByType } from './destination-accessor-types';
4/**
5 * Calculates a cache key based on the jwt and destination name for the given isolation strategy.
6 * Cache keys for strategies are non-overlapping, i.e. using a cache key for strategy [[IsolationStrategy.Tenant]]
7 * will not result in a cache hit for a destination that has been cached with strategy [[IsolationStrategy.Tenant_User]].
8 * @param decodedJwt - The decoded JWT of the current request.
9 * @param destinationName - The name of the destination.
10 * @param isolationStrategy - The strategy used to isolate cache entries.
11 * @returns The cache key.
12 * @hidden
13 */
14export declare function getDestinationCacheKeyStrict(decodedJwt: Record<string, any>, destinationName: string, isolationStrategy?: IsolationStrategy): string | undefined;
15/**
16 * @deprecated Since v1.52.0. Use [[getDestinationCacheKeyStrict]] instead.
17 * Calculates a cache key based on the jwt and destination name for the given isolation strategy.
18 * Cache keys for strategies are non-overlapping, i.e. using a cache key for strategy [[IsolationStrategy.Tenant]]
19 * will not result in a cache hit for a destination that has been cached with strategy [[IsolationStrategy.Tenant_User]].
20 * @param decodedJwt - The decoded JWT of the current request.
21 * @param destinationName - The name of the destination.
22 * @param isolationStrategy - The strategy used to isolate cache entries.
23 * @returns The cache key.
24 * @hidden
25 */
26export declare function getDestinationCacheKey(decodedJwt: Record<string, any>, destinationName: string, isolationStrategy: IsolationStrategy): string;
27export declare const destinationCache: {
28 retrieveDestinationFromCache: (decodedJwt: Record<string, any>, name: string, isolation: IsolationStrategy) => Destination | undefined;
29 cacheRetrievedDestination: (decodedJwt: Record<string, any>, destination: Destination, isolation: IsolationStrategy) => void;
30 cacheRetrievedDestinations: (decodedJwt: Record<string, any>, retrievedDestinations: DestinationsByType, isolation: IsolationStrategy) => void;
31 clear: () => void;
32 getCacheInstance: () => Cache<Destination>;
33};
34//# sourceMappingURL=destination-cache.d.ts.map
\No newline at end of file