@stackone/transport 2.17.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 +23 -5
- package/dist/index.d.mts +23 -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,
|
|
@@ -169,6 +173,7 @@ interface RedisClientConfig {
|
|
|
169
173
|
host?: string;
|
|
170
174
|
port?: number;
|
|
171
175
|
tls?: boolean;
|
|
176
|
+
keepAlive?: number;
|
|
172
177
|
reconnect?: boolean;
|
|
173
178
|
database?: number;
|
|
174
179
|
}
|
|
@@ -183,21 +188,26 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
183
188
|
host,
|
|
184
189
|
port,
|
|
185
190
|
tls,
|
|
191
|
+
keepAlive,
|
|
186
192
|
reconnect,
|
|
187
193
|
database
|
|
188
194
|
}: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
189
195
|
getData<T>(key: string): Promise<T | null>;
|
|
196
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
190
197
|
setData<T>({
|
|
191
198
|
key,
|
|
192
199
|
value,
|
|
193
200
|
cacheTTL,
|
|
194
|
-
|
|
201
|
+
groupKeys,
|
|
202
|
+
groupKeyTTL
|
|
195
203
|
}: {
|
|
196
204
|
key: string;
|
|
197
205
|
value: T;
|
|
198
206
|
cacheTTL: number;
|
|
199
|
-
|
|
207
|
+
groupKeys?: string[];
|
|
208
|
+
groupKeyTTL?: number;
|
|
200
209
|
}): Promise<boolean>;
|
|
210
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
201
211
|
executeScript<T>({
|
|
202
212
|
sha1,
|
|
203
213
|
keys,
|
|
@@ -942,6 +952,8 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
942
952
|
private dataStore;
|
|
943
953
|
private lockManager;
|
|
944
954
|
private expiryMap;
|
|
955
|
+
private groupMap;
|
|
956
|
+
private groupExpiryMap;
|
|
945
957
|
private evictionFrequency;
|
|
946
958
|
private staleDataThreshold;
|
|
947
959
|
private truncateThreshold;
|
|
@@ -954,14 +966,19 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
954
966
|
constructor(config?: MemoryStoreConfig<T>);
|
|
955
967
|
private initialize;
|
|
956
968
|
getData<U = T>(key: string): Promise<U | null>;
|
|
969
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
957
970
|
setData<U = T>({
|
|
958
971
|
key,
|
|
959
972
|
value,
|
|
960
|
-
cacheTTL
|
|
973
|
+
cacheTTL,
|
|
974
|
+
groupKeys,
|
|
975
|
+
groupKeyTTL
|
|
961
976
|
}: {
|
|
962
977
|
key: string;
|
|
963
978
|
value: U;
|
|
964
979
|
cacheTTL?: number;
|
|
980
|
+
groupKeys?: string[];
|
|
981
|
+
groupKeyTTL?: number;
|
|
965
982
|
}): Promise<boolean>;
|
|
966
983
|
private typeGuardBypass;
|
|
967
984
|
delete(key: string): Promise<boolean>;
|
|
@@ -970,6 +987,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
970
987
|
private stopEvictionTask;
|
|
971
988
|
private updateLastAccessedAt;
|
|
972
989
|
isReady(): boolean;
|
|
990
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
973
991
|
close(): void;
|
|
974
992
|
listData<T>({
|
|
975
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,
|
|
@@ -168,6 +172,7 @@ interface RedisClientConfig {
|
|
|
168
172
|
host?: string;
|
|
169
173
|
port?: number;
|
|
170
174
|
tls?: boolean;
|
|
175
|
+
keepAlive?: number;
|
|
171
176
|
reconnect?: boolean;
|
|
172
177
|
database?: number;
|
|
173
178
|
}
|
|
@@ -182,21 +187,26 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
182
187
|
host,
|
|
183
188
|
port,
|
|
184
189
|
tls,
|
|
190
|
+
keepAlive,
|
|
185
191
|
reconnect,
|
|
186
192
|
database
|
|
187
193
|
}: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
188
194
|
getData<T>(key: string): Promise<T | null>;
|
|
195
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
189
196
|
setData<T>({
|
|
190
197
|
key,
|
|
191
198
|
value,
|
|
192
199
|
cacheTTL,
|
|
193
|
-
|
|
200
|
+
groupKeys,
|
|
201
|
+
groupKeyTTL
|
|
194
202
|
}: {
|
|
195
203
|
key: string;
|
|
196
204
|
value: T;
|
|
197
205
|
cacheTTL: number;
|
|
198
|
-
|
|
206
|
+
groupKeys?: string[];
|
|
207
|
+
groupKeyTTL?: number;
|
|
199
208
|
}): Promise<boolean>;
|
|
209
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
200
210
|
executeScript<T>({
|
|
201
211
|
sha1,
|
|
202
212
|
keys,
|
|
@@ -941,6 +951,8 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
941
951
|
private dataStore;
|
|
942
952
|
private lockManager;
|
|
943
953
|
private expiryMap;
|
|
954
|
+
private groupMap;
|
|
955
|
+
private groupExpiryMap;
|
|
944
956
|
private evictionFrequency;
|
|
945
957
|
private staleDataThreshold;
|
|
946
958
|
private truncateThreshold;
|
|
@@ -953,14 +965,19 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
953
965
|
constructor(config?: MemoryStoreConfig<T>);
|
|
954
966
|
private initialize;
|
|
955
967
|
getData<U = T>(key: string): Promise<U | null>;
|
|
968
|
+
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
956
969
|
setData<U = T>({
|
|
957
970
|
key,
|
|
958
971
|
value,
|
|
959
|
-
cacheTTL
|
|
972
|
+
cacheTTL,
|
|
973
|
+
groupKeys,
|
|
974
|
+
groupKeyTTL
|
|
960
975
|
}: {
|
|
961
976
|
key: string;
|
|
962
977
|
value: U;
|
|
963
978
|
cacheTTL?: number;
|
|
979
|
+
groupKeys?: string[];
|
|
980
|
+
groupKeyTTL?: number;
|
|
964
981
|
}): Promise<boolean>;
|
|
965
982
|
private typeGuardBypass;
|
|
966
983
|
delete(key: string): Promise<boolean>;
|
|
@@ -969,6 +986,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
969
986
|
private stopEvictionTask;
|
|
970
987
|
private updateLastAccessedAt;
|
|
971
988
|
isReady(): boolean;
|
|
989
|
+
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
972
990
|
close(): void;
|
|
973
991
|
listData<T>({
|
|
974
992
|
partialKey,
|