@ferricstore/ferricstore 0.1.3 → 0.1.5
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/README.md +37 -1
- package/dist/index.cjs +1264 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +277 -6
- package/dist/index.d.ts +277 -6
- package/dist/index.js +1259 -36
- package/dist/index.js.map +1 -1
- package/docs/api/assets/hierarchy.js +1 -1
- package/docs/api/assets/highlight.css +6 -6
- package/docs/api/assets/navigation.js +1 -1
- package/docs/api/assets/search.js +1 -1
- package/docs/api/classes/FerricStoreClient.html +19 -2
- package/docs/api/classes/FerricStoreError.html +3 -3
- package/docs/api/classes/FlowAlreadyExistsError.html +3 -3
- package/docs/api/classes/FlowNotFoundError.html +3 -3
- package/docs/api/classes/FlowWrongStateError.html +3 -3
- package/docs/api/classes/InvalidCommandError.html +3 -3
- package/docs/api/classes/LockHeldError.html +3 -3
- package/docs/api/classes/LockNotOwnedError.html +3 -3
- package/docs/api/classes/NativeAdapter.html +3 -2
- package/docs/api/classes/OverloadedError.html +3 -3
- package/docs/api/classes/ReconnectingExecutor.html +7 -0
- package/docs/api/classes/RoutingTopology.html +9 -0
- package/docs/api/classes/StaleLeaseError.html +3 -3
- package/docs/api/classes/TopologyNativeAdapterPool.html +8 -0
- package/docs/api/functions/isReconnectableClosedConnectionError.html +1 -0
- package/docs/api/hierarchy.html +1 -1
- package/docs/api/index.html +16 -7
- package/docs/api/interfaces/AutoBatchOptions.html +2 -2
- package/docs/api/interfaces/CancelOptions.html +2 -2
- package/docs/api/interfaces/ClaimDueOptions.html +2 -2
- package/docs/api/interfaces/ClaimedItem.html +2 -3
- package/docs/api/interfaces/CommandExecutor.html +4 -2
- package/docs/api/interfaces/CompleteOptions.html +2 -2
- package/docs/api/interfaces/CompleteOutcome.html +1 -1
- package/docs/api/interfaces/CreateManyOptions.html +2 -2
- package/docs/api/interfaces/CreateOptions.html +2 -2
- package/docs/api/interfaces/ExecutePipelineOptions.html +2 -2
- package/docs/api/interfaces/FailOptions.html +2 -2
- package/docs/api/interfaces/FailOutcome.html +1 -1
- package/docs/api/interfaces/FencedItem.html +2 -2
- package/docs/api/interfaces/FerricStoreClientFromUrlOptions.html +6 -0
- package/docs/api/interfaces/FerricStoreClientOptions.html +2 -2
- package/docs/api/interfaces/FetchOrComputeResult.html +2 -2
- package/docs/api/interfaces/FlowRecord.html +2 -2
- package/docs/api/interfaces/KeyInfo.html +2 -2
- package/docs/api/interfaces/MutateOptions.html +2 -2
- package/docs/api/interfaces/NamedValueMutation.html +1 -1
- package/docs/api/interfaces/NativeAdapterOptions.html +12 -2
- package/docs/api/interfaces/ProtocolCommand.html +5 -0
- package/docs/api/interfaces/RateLimitResult.html +2 -2
- package/docs/api/interfaces/ReadOptions.html +2 -2
- package/docs/api/interfaces/ReclaimOptions.html +2 -2
- package/docs/api/interfaces/ReconnectOptions.html +2 -0
- package/docs/api/interfaces/RetryOptions.html +2 -2
- package/docs/api/interfaces/RetryOutcome.html +1 -1
- package/docs/api/interfaces/RoutingEndpoint.html +5 -0
- package/docs/api/interfaces/RoutingRoute.html +7 -0
- package/docs/api/interfaces/SearchOptions.html +12 -0
- package/docs/api/interfaces/TDigestCreateOptions.html +1 -1
- package/docs/api/interfaces/TDigestMergeOptions.html +1 -1
- package/docs/api/interfaces/TransitionOptions.html +2 -2
- package/docs/api/interfaces/TransitionOutcome.html +1 -1
- package/docs/api/modules.html +1 -1
- package/docs/api/types/CommandArgument.html +1 -1
- package/docs/api/types/EndpointPolicy.html +1 -0
- package/docs/api/types/ManagementPairs.html +1 -0
- package/docs/api/types/QueueBatchHandler.html +1 -1
- package/docs/api/types/QueueHandler.html +1 -1
- package/docs/api/types/QueueJob.html +1 -0
- package/docs/api/types/SearchStateMeta.html +1 -0
- package/docs/api/variables/COMMAND_OPCODES.html +1 -0
- package/docs/python-parity.md +4 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import tls from 'node:tls';
|
|
2
|
+
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
2
3
|
|
|
3
4
|
interface Codec<T = unknown> {
|
|
4
5
|
encode(value: T | null | undefined): Buffer;
|
|
@@ -13,26 +14,244 @@ declare class JsonCodec<T = unknown> implements Codec<T> {
|
|
|
13
14
|
decode(value: Buffer | null | undefined): T | null;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
type CommandArgument = string | Buffer | number | boolean | null | undefined;
|
|
17
|
+
type CommandArgument = string | Buffer | number | boolean | Record<string, unknown> | null | undefined;
|
|
17
18
|
type Command = readonly CommandArgument[];
|
|
18
19
|
|
|
20
|
+
type EndpointPolicy = "seed_hosts" | "any" | "none" | {
|
|
21
|
+
readonly allowHosts: readonly string[];
|
|
22
|
+
};
|
|
23
|
+
interface RoutingEndpoint {
|
|
24
|
+
readonly node: string;
|
|
25
|
+
readonly host: string;
|
|
26
|
+
readonly nativePort: number;
|
|
27
|
+
readonly nativeTlsPort?: number;
|
|
28
|
+
}
|
|
29
|
+
interface RoutingRoute {
|
|
30
|
+
readonly shard: number;
|
|
31
|
+
readonly laneId: number;
|
|
32
|
+
readonly endpointKey: string;
|
|
33
|
+
readonly endpoint: RoutingEndpoint;
|
|
34
|
+
readonly leaderNode: string;
|
|
35
|
+
readonly slot?: number;
|
|
36
|
+
}
|
|
37
|
+
declare class RoutingTopology {
|
|
38
|
+
readonly routeEpoch: number;
|
|
39
|
+
readonly shardCount: number;
|
|
40
|
+
readonly slots: readonly (RoutingRoute | undefined)[];
|
|
41
|
+
readonly endpoints: ReadonlyMap<string, RoutingEndpoint>;
|
|
42
|
+
private constructor();
|
|
43
|
+
static empty(): RoutingTopology;
|
|
44
|
+
static build(payload: unknown): RoutingTopology;
|
|
45
|
+
static slotForKey(key: string | Buffer$1): number;
|
|
46
|
+
routeKey(key: string | Buffer$1): RoutingRoute;
|
|
47
|
+
}
|
|
48
|
+
declare class TopologyNativeAdapterPool implements CommandExecutor {
|
|
49
|
+
private readonly adapterOptions;
|
|
50
|
+
private readonly adapters;
|
|
51
|
+
private readonly endpointPolicy;
|
|
52
|
+
private readonly endpointValidator?;
|
|
53
|
+
private readonly seedEndpointKeys;
|
|
54
|
+
private readonly seedUrls;
|
|
55
|
+
private readonly tls;
|
|
56
|
+
private readonly trustedHosts;
|
|
57
|
+
private readonly warmConnections;
|
|
58
|
+
private topologyValue;
|
|
59
|
+
private constructor();
|
|
60
|
+
static fromUrls(urls: readonly string[], options?: NativeAdapterOptions): Promise<TopologyNativeAdapterPool>;
|
|
61
|
+
get topology(): RoutingTopology;
|
|
62
|
+
refreshTopology(): Promise<RoutingTopology>;
|
|
63
|
+
route(key: string | Buffer$1): RoutingRoute;
|
|
64
|
+
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
65
|
+
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
66
|
+
close(): Promise<void>;
|
|
67
|
+
private routeData;
|
|
68
|
+
private singleRouteForCommands;
|
|
69
|
+
private controlAdapter;
|
|
70
|
+
private adapterForUrl;
|
|
71
|
+
private adapterForEndpoint;
|
|
72
|
+
private validateEndpoint;
|
|
73
|
+
private refreshCandidateUrls;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare const COMMAND_OPCODES: {
|
|
77
|
+
readonly HELLO: 1;
|
|
78
|
+
readonly AUTH: 2;
|
|
79
|
+
readonly PING: 3;
|
|
80
|
+
readonly "CLIENT.SETNAME": 4;
|
|
81
|
+
readonly "CLIENT.INFO": 5;
|
|
82
|
+
readonly ROUTE: 6;
|
|
83
|
+
readonly SHARDS: 7;
|
|
84
|
+
readonly BACKPRESSURE: 8;
|
|
85
|
+
readonly QUIT: 9;
|
|
86
|
+
readonly GOAWAY: 10;
|
|
87
|
+
readonly OPTIONS: 11;
|
|
88
|
+
readonly STARTUP: 12;
|
|
89
|
+
readonly WINDOW_UPDATE: 13;
|
|
90
|
+
readonly PIPELINE: 14;
|
|
91
|
+
readonly ROUTE_BATCH: 15;
|
|
92
|
+
readonly EVENT: 16;
|
|
93
|
+
readonly SUBSCRIBE_EVENTS: 17;
|
|
94
|
+
readonly UNSUBSCRIBE_EVENTS: 18;
|
|
95
|
+
readonly COMMAND_EXEC: 256;
|
|
96
|
+
readonly GET: 257;
|
|
97
|
+
readonly SET: 258;
|
|
98
|
+
readonly DEL: 259;
|
|
99
|
+
readonly MGET: 260;
|
|
100
|
+
readonly MSET: 261;
|
|
101
|
+
readonly CAS: 262;
|
|
102
|
+
readonly LOCK: 263;
|
|
103
|
+
readonly UNLOCK: 264;
|
|
104
|
+
readonly EXTEND: 265;
|
|
105
|
+
readonly "RATELIMIT.ADD": 266;
|
|
106
|
+
readonly FETCH_OR_COMPUTE: 267;
|
|
107
|
+
readonly FETCH_OR_COMPUTE_RESULT: 268;
|
|
108
|
+
readonly FETCH_OR_COMPUTE_ERROR: 269;
|
|
109
|
+
readonly HSET: 272;
|
|
110
|
+
readonly HGET: 273;
|
|
111
|
+
readonly HMGET: 274;
|
|
112
|
+
readonly HGETALL: 275;
|
|
113
|
+
readonly LPUSH: 288;
|
|
114
|
+
readonly RPUSH: 289;
|
|
115
|
+
readonly LPOP: 290;
|
|
116
|
+
readonly RPOP: 291;
|
|
117
|
+
readonly LRANGE: 292;
|
|
118
|
+
readonly SADD: 304;
|
|
119
|
+
readonly SREM: 305;
|
|
120
|
+
readonly SMEMBERS: 306;
|
|
121
|
+
readonly SISMEMBER: 307;
|
|
122
|
+
readonly ZADD: 320;
|
|
123
|
+
readonly ZREM: 321;
|
|
124
|
+
readonly ZRANGE: 322;
|
|
125
|
+
readonly ZSCORE: 323;
|
|
126
|
+
readonly "FLOW.CREATE": 513;
|
|
127
|
+
readonly "FLOW.GET": 514;
|
|
128
|
+
readonly "FLOW.CLAIM_DUE": 515;
|
|
129
|
+
readonly "FLOW.COMPLETE": 516;
|
|
130
|
+
readonly "FLOW.TRANSITION": 517;
|
|
131
|
+
readonly "FLOW.RETRY": 518;
|
|
132
|
+
readonly "FLOW.FAIL": 519;
|
|
133
|
+
readonly "FLOW.CANCEL": 520;
|
|
134
|
+
readonly "FLOW.EXTEND_LEASE": 521;
|
|
135
|
+
readonly "FLOW.HISTORY": 522;
|
|
136
|
+
readonly "FLOW.VALUE.PUT": 523;
|
|
137
|
+
readonly "FLOW.VALUE.MGET": 524;
|
|
138
|
+
readonly "FLOW.SIGNAL": 525;
|
|
139
|
+
readonly "FLOW.LIST": 526;
|
|
140
|
+
readonly "FLOW.CREATE_MANY": 527;
|
|
141
|
+
readonly "FLOW.COMPLETE_MANY": 528;
|
|
142
|
+
readonly "FLOW.TRANSITION_MANY": 529;
|
|
143
|
+
readonly "FLOW.RETRY_MANY": 530;
|
|
144
|
+
readonly "FLOW.FAIL_MANY": 531;
|
|
145
|
+
readonly "FLOW.CANCEL_MANY": 532;
|
|
146
|
+
readonly "FLOW.RECLAIM": 533;
|
|
147
|
+
readonly "FLOW.REWIND": 534;
|
|
148
|
+
readonly "FLOW.TERMINALS": 535;
|
|
149
|
+
readonly "FLOW.FAILURES": 536;
|
|
150
|
+
readonly "FLOW.BY_PARENT": 537;
|
|
151
|
+
readonly "FLOW.BY_ROOT": 538;
|
|
152
|
+
readonly "FLOW.BY_CORRELATION": 539;
|
|
153
|
+
readonly "FLOW.INFO": 540;
|
|
154
|
+
readonly "FLOW.STUCK": 541;
|
|
155
|
+
readonly "FLOW.POLICY.SET": 542;
|
|
156
|
+
readonly "FLOW.POLICY.GET": 543;
|
|
157
|
+
readonly "FLOW.SPAWN_CHILDREN": 544;
|
|
158
|
+
readonly "FLOW.RETENTION_CLEANUP": 545;
|
|
159
|
+
readonly "FLOW.STEP_CONTINUE": 546;
|
|
160
|
+
readonly "FLOW.START_AND_CLAIM": 547;
|
|
161
|
+
readonly "FLOW.RUN_STEPS_MANY": 548;
|
|
162
|
+
readonly "FLOW.SCHEDULE.CREATE": 549;
|
|
163
|
+
readonly "FLOW.SCHEDULE.GET": 550;
|
|
164
|
+
readonly "FLOW.SCHEDULE.DELETE": 551;
|
|
165
|
+
readonly "FLOW.SCHEDULE.FIRE_DUE": 552;
|
|
166
|
+
readonly "FLOW.SCHEDULE.LIST": 553;
|
|
167
|
+
readonly "FLOW.SCHEDULE.FIRE": 554;
|
|
168
|
+
readonly "FLOW.SCHEDULE.PAUSE": 555;
|
|
169
|
+
readonly "FLOW.SCHEDULE.RESUME": 556;
|
|
170
|
+
readonly "FLOW.STATS": 557;
|
|
171
|
+
readonly "FLOW.ATTRIBUTES": 558;
|
|
172
|
+
readonly "FLOW.ATTRIBUTE_VALUES": 559;
|
|
173
|
+
readonly "FLOW.SEARCH": 560;
|
|
174
|
+
readonly "FLOW.EFFECT.RESERVE": 576;
|
|
175
|
+
readonly "FLOW.EFFECT.CONFIRM": 577;
|
|
176
|
+
readonly "FLOW.EFFECT.FAIL": 578;
|
|
177
|
+
readonly "FLOW.EFFECT.COMPENSATE": 579;
|
|
178
|
+
readonly "FLOW.EFFECT.GET": 580;
|
|
179
|
+
readonly "FLOW.GOVERNANCE.LEDGER": 581;
|
|
180
|
+
readonly "FLOW.APPROVAL.REQUEST": 582;
|
|
181
|
+
readonly "FLOW.APPROVAL.APPROVE": 583;
|
|
182
|
+
readonly "FLOW.APPROVAL.REJECT": 584;
|
|
183
|
+
readonly "FLOW.APPROVAL.GET": 585;
|
|
184
|
+
readonly "FLOW.CIRCUIT.OPEN": 586;
|
|
185
|
+
readonly "FLOW.CIRCUIT.CLOSE": 587;
|
|
186
|
+
readonly "FLOW.CIRCUIT.GET": 588;
|
|
187
|
+
readonly "FLOW.BUDGET.RESERVE": 589;
|
|
188
|
+
readonly "FLOW.BUDGET.GET": 590;
|
|
189
|
+
readonly "FLOW.LIMIT.LEASE": 591;
|
|
190
|
+
readonly "FLOW.LIMIT.SPEND": 592;
|
|
191
|
+
readonly "FLOW.LIMIT.RELEASE": 593;
|
|
192
|
+
readonly "FLOW.LIMIT.GET": 594;
|
|
193
|
+
readonly "FLOW.APPROVAL.LIST": 595;
|
|
194
|
+
readonly "FLOW.GOVERNANCE.OVERVIEW": 596;
|
|
195
|
+
readonly "FLOW.BUDGET.LIST": 597;
|
|
196
|
+
readonly "FLOW.LIMIT.LIST": 598;
|
|
197
|
+
readonly "FLOW.BUDGET.COMMIT": 599;
|
|
198
|
+
readonly "FLOW.BUDGET.RELEASE": 600;
|
|
199
|
+
readonly "CLUSTER.HEALTH": 769;
|
|
200
|
+
readonly "CLUSTER.STATS": 770;
|
|
201
|
+
readonly "CLUSTER.KEYSLOT": 771;
|
|
202
|
+
readonly "CLUSTER.SLOTS": 772;
|
|
203
|
+
readonly "CLUSTER.STATUS": 773;
|
|
204
|
+
readonly "CLUSTER.JOIN": 774;
|
|
205
|
+
readonly "CLUSTER.LEAVE": 775;
|
|
206
|
+
readonly "CLUSTER.FAILOVER": 776;
|
|
207
|
+
readonly "CLUSTER.PROMOTE": 777;
|
|
208
|
+
readonly "CLUSTER.DEMOTE": 778;
|
|
209
|
+
readonly "CLUSTER.ROLE": 779;
|
|
210
|
+
readonly "FERRICSTORE.KEY_INFO": 780;
|
|
211
|
+
readonly "FERRICSTORE.CONFIG": 781;
|
|
212
|
+
readonly "FERRICSTORE.HOTNESS": 782;
|
|
213
|
+
readonly "FERRICSTORE.METRICS": 783;
|
|
214
|
+
readonly "FERRICSTORE.BLOBGC": 784;
|
|
215
|
+
};
|
|
216
|
+
interface ProtocolCommand {
|
|
217
|
+
readonly opcode: number;
|
|
218
|
+
readonly payload: unknown;
|
|
219
|
+
readonly flags?: number;
|
|
220
|
+
readonly laneId?: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
19
223
|
interface CommandExecutor {
|
|
20
224
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
21
225
|
executePipeline?(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
226
|
+
refreshTopology?(): Promise<RoutingTopology>;
|
|
227
|
+
route?(key: string | Buffer$1): Promise<RoutingRoute> | RoutingRoute;
|
|
22
228
|
close?(): Promise<void> | void;
|
|
23
229
|
}
|
|
24
230
|
interface ExecutePipelineOptions {
|
|
25
231
|
throwOnItemError?: boolean;
|
|
26
232
|
}
|
|
27
233
|
interface NativeAdapterOptions {
|
|
234
|
+
autoReconnect?: boolean | ReconnectOptions;
|
|
28
235
|
clientName?: string;
|
|
29
236
|
connectTimeoutMs?: number;
|
|
237
|
+
endpointPolicy?: EndpointPolicy;
|
|
238
|
+
endpointValidator?: (endpoint: RoutingEndpoint) => boolean | void;
|
|
239
|
+
haRouting?: boolean;
|
|
240
|
+
heartbeatIntervalMs?: number;
|
|
241
|
+
keepAlive?: boolean;
|
|
242
|
+
keepAliveInitialDelayMs?: number;
|
|
30
243
|
maxChunkBytes?: number;
|
|
31
244
|
protocolLanes?: number;
|
|
245
|
+
seeds?: readonly string[];
|
|
32
246
|
timeoutMs?: number;
|
|
247
|
+
trustedHosts?: readonly string[];
|
|
33
248
|
username?: string;
|
|
34
249
|
password?: string;
|
|
35
250
|
tlsOptions?: tls.ConnectionOptions;
|
|
251
|
+
warmConnections?: boolean;
|
|
252
|
+
}
|
|
253
|
+
interface ReconnectOptions {
|
|
254
|
+
maxRetries?: number;
|
|
36
255
|
}
|
|
37
256
|
declare class NativeAdapter implements CommandExecutor {
|
|
38
257
|
private readonly socket;
|
|
@@ -45,15 +264,23 @@ declare class NativeAdapter implements CommandExecutor {
|
|
|
45
264
|
private readonly maxChunkBytes;
|
|
46
265
|
private requestId;
|
|
47
266
|
private readonly protocolLanes;
|
|
267
|
+
private readonly heartbeatIntervalMs?;
|
|
268
|
+
private heartbeatInFlight;
|
|
269
|
+
private heartbeatTimer?;
|
|
270
|
+
private lastActivityMs;
|
|
48
271
|
private readonly timeoutMs;
|
|
49
272
|
private constructor();
|
|
50
273
|
static fromUrl(url: string, options?: NativeAdapterOptions): Promise<NativeAdapter>;
|
|
51
274
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
275
|
+
executeProtocolCommand(command: ProtocolCommand, laneId?: number): Promise<unknown>;
|
|
52
276
|
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
53
277
|
close(): Promise<void>;
|
|
54
278
|
private startup;
|
|
55
279
|
private auth;
|
|
56
280
|
private request;
|
|
281
|
+
private startHeartbeat;
|
|
282
|
+
private stopHeartbeat;
|
|
283
|
+
private sendHeartbeat;
|
|
57
284
|
private onData;
|
|
58
285
|
private handleFrame;
|
|
59
286
|
private failAll;
|
|
@@ -61,6 +288,22 @@ declare class NativeAdapter implements CommandExecutor {
|
|
|
61
288
|
private nextRequestId;
|
|
62
289
|
private assignLane;
|
|
63
290
|
}
|
|
291
|
+
declare class ReconnectingExecutor implements CommandExecutor {
|
|
292
|
+
private readonly createExecutor;
|
|
293
|
+
private closed;
|
|
294
|
+
private readonly maxRetries;
|
|
295
|
+
private executorPromise;
|
|
296
|
+
private reconnectPromise?;
|
|
297
|
+
constructor(createExecutor: () => Promise<CommandExecutor>, options?: ReconnectOptions);
|
|
298
|
+
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
299
|
+
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
300
|
+
refreshTopology(): Promise<RoutingTopology>;
|
|
301
|
+
route(key: string | Buffer$1): Promise<RoutingRoute>;
|
|
302
|
+
close(): Promise<void>;
|
|
303
|
+
private withReconnect;
|
|
304
|
+
private reconnect;
|
|
305
|
+
}
|
|
306
|
+
declare function isReconnectableClosedConnectionError(error: unknown): boolean;
|
|
64
307
|
|
|
65
308
|
interface StoreCommandClient {
|
|
66
309
|
readonly codec: Codec;
|
|
@@ -494,7 +737,9 @@ interface CreateItem {
|
|
|
494
737
|
valueRefs?: Record<string, string>;
|
|
495
738
|
stateMeta?: StateMeta;
|
|
496
739
|
}
|
|
740
|
+
/** @internal */
|
|
497
741
|
declare const CLAIMED_ITEM_WIRE: unique symbol;
|
|
742
|
+
/** @internal */
|
|
498
743
|
interface ClaimedItemWire {
|
|
499
744
|
id: Buffer;
|
|
500
745
|
partitionKey?: Buffer | null;
|
|
@@ -511,6 +756,7 @@ interface ClaimedItem<TPayload = unknown> {
|
|
|
511
756
|
runState?: string;
|
|
512
757
|
payload?: TPayload | null;
|
|
513
758
|
attributes?: Record<string, unknown>;
|
|
759
|
+
/** @internal */
|
|
514
760
|
[CLAIMED_ITEM_WIRE]?: ClaimedItemWire;
|
|
515
761
|
}
|
|
516
762
|
interface FencedItem {
|
|
@@ -576,6 +822,10 @@ interface FerricStoreClientOptions {
|
|
|
576
822
|
codec?: Codec;
|
|
577
823
|
backpressure?: BackpressurePolicy;
|
|
578
824
|
}
|
|
825
|
+
interface FerricStoreClientFromUrlOptions extends FerricStoreClientOptions {
|
|
826
|
+
nativeOptions?: NativeAdapterOptions;
|
|
827
|
+
reconnect?: boolean | ReconnectOptions;
|
|
828
|
+
}
|
|
579
829
|
interface CreateOptions {
|
|
580
830
|
type: string;
|
|
581
831
|
state?: string;
|
|
@@ -675,6 +925,12 @@ interface ReadOptions {
|
|
|
675
925
|
includeCold?: boolean;
|
|
676
926
|
consistentProjection?: boolean;
|
|
677
927
|
}
|
|
928
|
+
type SearchStateMeta = StateMeta | Record<string, StateMeta>;
|
|
929
|
+
interface SearchOptions extends ReadOptions {
|
|
930
|
+
attributes?: Record<string, CommandArgument>;
|
|
931
|
+
stateMeta?: SearchStateMeta;
|
|
932
|
+
}
|
|
933
|
+
type ManagementPairs = Record<string, CommandArgument>;
|
|
678
934
|
declare class FerricStoreClient {
|
|
679
935
|
readonly executor: CommandExecutor;
|
|
680
936
|
readonly codec: Codec;
|
|
@@ -695,12 +951,13 @@ declare class FerricStoreClient {
|
|
|
695
951
|
readonly topk: TopKStore;
|
|
696
952
|
readonly zset: SortedSetStore;
|
|
697
953
|
constructor(executor: CommandExecutor, options?: FerricStoreClientOptions);
|
|
698
|
-
static fromUrl(url: string, options?:
|
|
699
|
-
|
|
700
|
-
}): Promise<FerricStoreClient>;
|
|
954
|
+
static fromUrl(url: string, options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
955
|
+
static fromUrls(urls: readonly string[], options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
701
956
|
command(...args: CommandArgument[]): Promise<unknown>;
|
|
702
957
|
pipeline(commands: readonly Command[]): Promise<unknown[]>;
|
|
703
958
|
close(): Promise<void>;
|
|
959
|
+
refreshTopology(): Promise<RoutingTopology>;
|
|
960
|
+
route(key: string | Buffer): Promise<RoutingRoute>;
|
|
704
961
|
ping(message?: CommandArgument): Promise<unknown>;
|
|
705
962
|
echo(message: CommandArgument): Promise<unknown>;
|
|
706
963
|
serverInfo(section?: string): Promise<string>;
|
|
@@ -747,10 +1004,11 @@ declare class FerricStoreClient {
|
|
|
747
1004
|
pubsubChannels(pattern?: string): Promise<unknown[]>;
|
|
748
1005
|
pubsubNumSub(...channels: string[]): Promise<unknown[]>;
|
|
749
1006
|
pubsubNumPat(): Promise<number>;
|
|
750
|
-
aclSetUser(username: string, rules: string[]): Promise<boolean>;
|
|
1007
|
+
aclSetUser(username: string, rules: string | readonly string[]): Promise<boolean>;
|
|
751
1008
|
aclDelUser(...usernames: string[]): Promise<number>;
|
|
752
1009
|
aclGetUser(username: string): Promise<unknown>;
|
|
753
1010
|
aclList(): Promise<unknown[]>;
|
|
1011
|
+
aclListUsers(): Promise<unknown[]>;
|
|
754
1012
|
aclWhoami(): Promise<string>;
|
|
755
1013
|
aclSave(): Promise<boolean>;
|
|
756
1014
|
aclLoad(): Promise<boolean>;
|
|
@@ -793,6 +1051,18 @@ declare class FerricStoreClient {
|
|
|
793
1051
|
ferricstoreMetrics(...args: CommandArgument[]): Promise<Record<string, unknown>>;
|
|
794
1052
|
ferricstoreBlobgc(...args: CommandArgument[]): Promise<unknown>;
|
|
795
1053
|
ferricstoreDoctor(...args: CommandArgument[]): Promise<unknown>;
|
|
1054
|
+
capabilities(): Promise<Record<string, unknown>>;
|
|
1055
|
+
ensureNamespace(prefix: string, attrs?: ManagementPairs): Promise<unknown>;
|
|
1056
|
+
getNamespace(prefix: string): Promise<unknown>;
|
|
1057
|
+
listNamespaces(): Promise<unknown>;
|
|
1058
|
+
deleteNamespace(prefix: string): Promise<unknown>;
|
|
1059
|
+
setQuota(namespace: string, quotaSpec?: ManagementPairs): Promise<unknown>;
|
|
1060
|
+
getQuota(namespace: string): Promise<unknown>;
|
|
1061
|
+
quotaUsage(namespace: string): Promise<unknown>;
|
|
1062
|
+
clusterInfo(): Promise<Record<string, unknown>>;
|
|
1063
|
+
namespaceUsage(prefix: string): Promise<Record<string, unknown>>;
|
|
1064
|
+
flowQuery(attrs?: ManagementPairs): Promise<unknown[]>;
|
|
1065
|
+
flowHistory(id: string, attrs?: ManagementPairs): Promise<unknown[]>;
|
|
796
1066
|
create(id: string, options: CreateOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
797
1067
|
enqueue(id: string, options: Omit<CreateOptions, "state"> & {
|
|
798
1068
|
state?: string;
|
|
@@ -912,6 +1182,7 @@ declare class FerricStoreClient {
|
|
|
912
1182
|
full?: boolean;
|
|
913
1183
|
}): Promise<FlowRecord<TPayload> | undefined>;
|
|
914
1184
|
list(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1185
|
+
search(type: string, options?: SearchOptions): Promise<FlowRecord[]>;
|
|
915
1186
|
terminals(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
916
1187
|
failures(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
917
1188
|
byParent(parentFlowId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
@@ -1289,4 +1560,4 @@ declare class WorkflowWorker {
|
|
|
1289
1560
|
private applyHandlerError;
|
|
1290
1561
|
}
|
|
1291
1562
|
|
|
1292
|
-
export { type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, type CancelOptions, type ChildSpec, type ClaimDueOptions, type ClaimedItem, type Codec, type Command, type CommandArgument, type CommandExecutor, type CompleteOptions, type CompleteOutcome, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type ExceptionPolicy, type ExecutePipelineOptions, type FailOptions, type FailOutcome, type FencedItem, FerricStoreClient, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeResult, FlowAlreadyExistsError, FlowNotFoundError, type FlowRecord, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, HashStore, HyperLogLogStore, InvalidCommandError, JsonCodec, type JsonSetOptions, JsonStore, type KeyInfo, KeyValueStore, ListStore, LockHeldError, LockNotOwnedError, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type Outcome, OverloadedError, Queue, type QueueBatchHandler, QueueClient, type QueueHandler, type QueueOptions, QueueWorker, type QueueWorkerResult, type RangeLimit, type RateLimitResult, RawCodec, type ReadOptions, type ReclaimOptions, type RetryOptions, type RetryOutcome, type RetryPolicy, type ScanOptions, type SetOptions, SetStore, SortedSetStore, StaleLeaseError, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, mapException, retry, transition };
|
|
1563
|
+
export { type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, COMMAND_OPCODES, type CancelOptions, type ChildSpec, type ClaimDueOptions, type ClaimedItem, type Codec, type Command, type CommandArgument, type CommandExecutor, type CompleteOptions, type CompleteOutcome, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type EndpointPolicy, type ExceptionPolicy, type ExecutePipelineOptions, type FailOptions, type FailOutcome, type FencedItem, FerricStoreClient, type FerricStoreClientFromUrlOptions, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeResult, FlowAlreadyExistsError, FlowNotFoundError, type FlowRecord, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, HashStore, HyperLogLogStore, InvalidCommandError, JsonCodec, type JsonSetOptions, JsonStore, type KeyInfo, KeyValueStore, ListStore, LockHeldError, LockNotOwnedError, type ManagementPairs, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type Outcome, OverloadedError, type ProtocolCommand, Queue, type QueueBatchHandler, QueueClient, type QueueHandler, type QueueJob, type QueueOptions, QueueWorker, type QueueWorkerResult, type RangeLimit, type RateLimitResult, RawCodec, type ReadOptions, type ReclaimOptions, type ReconnectOptions, ReconnectingExecutor, type RetryOptions, type RetryOutcome, type RetryPolicy, type RoutingEndpoint, type RoutingRoute, RoutingTopology, type ScanOptions, type SearchOptions, type SearchStateMeta, type SetOptions, SetStore, SortedSetStore, StaleLeaseError, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, TopologyNativeAdapterPool, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, isReconnectableClosedConnectionError, mapException, retry, transition };
|