@stackone/transport 2.18.0 → 2.19.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/index.cjs +12 -12
- package/dist/index.d.cts +21 -5
- package/dist/index.d.mts +21 -5
- package/dist/index.mjs +16 -16
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -117,6 +117,7 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
117
117
|
//#region src/cacheClient/types.d.ts
|
|
118
118
|
interface ICacheClient<ClientType = unknown> {
|
|
119
119
|
getData<T>(key: string): Promise<T | null>;
|
|
120
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
120
121
|
listData<T>({
|
|
121
122
|
partialKey,
|
|
122
123
|
limit,
|
|
@@ -133,13 +134,16 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
133
134
|
key,
|
|
134
135
|
value,
|
|
135
136
|
cacheTTL,
|
|
136
|
-
|
|
137
|
+
groupKeys,
|
|
138
|
+
groupKeyTTL
|
|
137
139
|
}: {
|
|
138
140
|
key: string;
|
|
139
141
|
value: T;
|
|
140
142
|
cacheTTL: number;
|
|
141
|
-
|
|
143
|
+
groupKeys?: string[];
|
|
144
|
+
groupKeyTTL?: number;
|
|
142
145
|
}): Promise<boolean>;
|
|
146
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
143
147
|
executeScript?<T>({
|
|
144
148
|
sha1,
|
|
145
149
|
keys,
|
|
@@ -189,17 +193,21 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
189
193
|
database
|
|
190
194
|
}: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
191
195
|
getData<T>(key: string): Promise<T | null>;
|
|
196
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
192
197
|
setData<T>({
|
|
193
198
|
key,
|
|
194
199
|
value,
|
|
195
200
|
cacheTTL,
|
|
196
|
-
|
|
201
|
+
groupKeys,
|
|
202
|
+
groupKeyTTL
|
|
197
203
|
}: {
|
|
198
204
|
key: string;
|
|
199
205
|
value: T;
|
|
200
206
|
cacheTTL: number;
|
|
201
|
-
|
|
207
|
+
groupKeys?: string[];
|
|
208
|
+
groupKeyTTL?: number;
|
|
202
209
|
}): Promise<boolean>;
|
|
210
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
203
211
|
executeScript<T>({
|
|
204
212
|
sha1,
|
|
205
213
|
keys,
|
|
@@ -944,6 +952,8 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
944
952
|
private dataStore;
|
|
945
953
|
private lockManager;
|
|
946
954
|
private expiryMap;
|
|
955
|
+
private groupMap;
|
|
956
|
+
private groupExpiryMap;
|
|
947
957
|
private evictionFrequency;
|
|
948
958
|
private staleDataThreshold;
|
|
949
959
|
private truncateThreshold;
|
|
@@ -956,14 +966,19 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
956
966
|
constructor(config?: MemoryStoreConfig<T>);
|
|
957
967
|
private initialize;
|
|
958
968
|
getData<U = T>(key: string): Promise<U | null>;
|
|
969
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
959
970
|
setData<U = T>({
|
|
960
971
|
key,
|
|
961
972
|
value,
|
|
962
|
-
cacheTTL
|
|
973
|
+
cacheTTL,
|
|
974
|
+
groupKeys,
|
|
975
|
+
groupKeyTTL
|
|
963
976
|
}: {
|
|
964
977
|
key: string;
|
|
965
978
|
value: U;
|
|
966
979
|
cacheTTL?: number;
|
|
980
|
+
groupKeys?: string[];
|
|
981
|
+
groupKeyTTL?: number;
|
|
967
982
|
}): Promise<boolean>;
|
|
968
983
|
private typeGuardBypass;
|
|
969
984
|
delete(key: string): Promise<boolean>;
|
|
@@ -972,6 +987,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
972
987
|
private stopEvictionTask;
|
|
973
988
|
private updateLastAccessedAt;
|
|
974
989
|
isReady(): boolean;
|
|
990
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
975
991
|
close(): void;
|
|
976
992
|
listData<T>({
|
|
977
993
|
partialKey,
|
package/dist/index.d.mts
CHANGED
|
@@ -116,6 +116,7 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
116
116
|
//#region src/cacheClient/types.d.ts
|
|
117
117
|
interface ICacheClient<ClientType = unknown> {
|
|
118
118
|
getData<T>(key: string): Promise<T | null>;
|
|
119
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
119
120
|
listData<T>({
|
|
120
121
|
partialKey,
|
|
121
122
|
limit,
|
|
@@ -132,13 +133,16 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
132
133
|
key,
|
|
133
134
|
value,
|
|
134
135
|
cacheTTL,
|
|
135
|
-
|
|
136
|
+
groupKeys,
|
|
137
|
+
groupKeyTTL
|
|
136
138
|
}: {
|
|
137
139
|
key: string;
|
|
138
140
|
value: T;
|
|
139
141
|
cacheTTL: number;
|
|
140
|
-
|
|
142
|
+
groupKeys?: string[];
|
|
143
|
+
groupKeyTTL?: number;
|
|
141
144
|
}): Promise<boolean>;
|
|
145
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
142
146
|
executeScript?<T>({
|
|
143
147
|
sha1,
|
|
144
148
|
keys,
|
|
@@ -188,17 +192,21 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
188
192
|
database
|
|
189
193
|
}: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
190
194
|
getData<T>(key: string): Promise<T | null>;
|
|
195
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
191
196
|
setData<T>({
|
|
192
197
|
key,
|
|
193
198
|
value,
|
|
194
199
|
cacheTTL,
|
|
195
|
-
|
|
200
|
+
groupKeys,
|
|
201
|
+
groupKeyTTL
|
|
196
202
|
}: {
|
|
197
203
|
key: string;
|
|
198
204
|
value: T;
|
|
199
205
|
cacheTTL: number;
|
|
200
|
-
|
|
206
|
+
groupKeys?: string[];
|
|
207
|
+
groupKeyTTL?: number;
|
|
201
208
|
}): Promise<boolean>;
|
|
209
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
202
210
|
executeScript<T>({
|
|
203
211
|
sha1,
|
|
204
212
|
keys,
|
|
@@ -943,6 +951,8 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
943
951
|
private dataStore;
|
|
944
952
|
private lockManager;
|
|
945
953
|
private expiryMap;
|
|
954
|
+
private groupMap;
|
|
955
|
+
private groupExpiryMap;
|
|
946
956
|
private evictionFrequency;
|
|
947
957
|
private staleDataThreshold;
|
|
948
958
|
private truncateThreshold;
|
|
@@ -955,14 +965,19 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
955
965
|
constructor(config?: MemoryStoreConfig<T>);
|
|
956
966
|
private initialize;
|
|
957
967
|
getData<U = T>(key: string): Promise<U | null>;
|
|
968
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
958
969
|
setData<U = T>({
|
|
959
970
|
key,
|
|
960
971
|
value,
|
|
961
|
-
cacheTTL
|
|
972
|
+
cacheTTL,
|
|
973
|
+
groupKeys,
|
|
974
|
+
groupKeyTTL
|
|
962
975
|
}: {
|
|
963
976
|
key: string;
|
|
964
977
|
value: U;
|
|
965
978
|
cacheTTL?: number;
|
|
979
|
+
groupKeys?: string[];
|
|
980
|
+
groupKeyTTL?: number;
|
|
966
981
|
}): Promise<boolean>;
|
|
967
982
|
private typeGuardBypass;
|
|
968
983
|
delete(key: string): Promise<boolean>;
|
|
@@ -971,6 +986,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
971
986
|
private stopEvictionTask;
|
|
972
987
|
private updateLastAccessedAt;
|
|
973
988
|
isReady(): boolean;
|
|
989
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
974
990
|
close(): void;
|
|
975
991
|
listData<T>({
|
|
976
992
|
partialKey,
|