@authhero/adapter-interfaces 0.83.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-interfaces.d.ts +30 -0
- package/package.json +1 -1
|
@@ -14540,6 +14540,35 @@ export declare function parseUserId(user_id: string): {
|
|
|
14540
14540
|
connection: string;
|
|
14541
14541
|
id: string;
|
|
14542
14542
|
};
|
|
14543
|
+
export interface CacheItem<T = any> {
|
|
14544
|
+
value: T;
|
|
14545
|
+
expiresAt?: Date;
|
|
14546
|
+
}
|
|
14547
|
+
export interface CacheAdapter {
|
|
14548
|
+
/**
|
|
14549
|
+
* Get a value from the cache
|
|
14550
|
+
* @param key The cache key
|
|
14551
|
+
* @returns The cached value or null if not found or expired
|
|
14552
|
+
*/
|
|
14553
|
+
get<T = any>(key: string): Promise<T | null>;
|
|
14554
|
+
/**
|
|
14555
|
+
* Set a value in the cache
|
|
14556
|
+
* @param key The cache key
|
|
14557
|
+
* @param value The value to cache
|
|
14558
|
+
* @param ttlSeconds Time to live in seconds (optional)
|
|
14559
|
+
*/
|
|
14560
|
+
set<T = any>(key: string, value: T, ttlSeconds?: number): Promise<void>;
|
|
14561
|
+
/**
|
|
14562
|
+
* Delete a value from the cache
|
|
14563
|
+
* @param key The cache key
|
|
14564
|
+
* @returns True if the key existed and was deleted, false otherwise
|
|
14565
|
+
*/
|
|
14566
|
+
delete(key: string): Promise<boolean>;
|
|
14567
|
+
/**
|
|
14568
|
+
* Clear all items from the cache
|
|
14569
|
+
*/
|
|
14570
|
+
clear(): Promise<void>;
|
|
14571
|
+
}
|
|
14543
14572
|
export interface ListCodesResponse extends Totals {
|
|
14544
14573
|
codes: Code[];
|
|
14545
14574
|
}
|
|
@@ -14739,6 +14768,7 @@ export interface UserRolesAdapter {
|
|
|
14739
14768
|
export interface DataAdapters {
|
|
14740
14769
|
applications: ApplicationsAdapter;
|
|
14741
14770
|
branding: BrandingAdapter;
|
|
14771
|
+
cache?: CacheAdapter;
|
|
14742
14772
|
clients: ClientsAdapter;
|
|
14743
14773
|
codes: CodesAdapter;
|
|
14744
14774
|
connections: ConnectionsAdapter;
|