@ferricstore/ferricstore 0.1.4 → 0.1.6
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 +56 -1
- package/dist/index.cjs +1320 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +282 -9
- package/dist/index.d.ts +282 -9
- package/dist/index.js +1317 -45
- 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 +25 -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 +4 -2
- 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/classes/Workflow.html +3 -2
- package/docs/api/classes/WorkflowClient.html +2 -2
- package/docs/api/classes/WorkflowContext.html +2 -2
- package/docs/api/classes/WorkflowFlowCommands.html +2 -2
- package/docs/api/classes/WorkflowWorker.html +2 -2
- package/docs/api/functions/isReconnectableClosedConnectionError.html +1 -1
- package/docs/api/hierarchy.html +1 -1
- package/docs/api/index.html +21 -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 +2 -2
- package/docs/api/interfaces/FerricStoreClientOptions.html +2 -2
- package/docs/api/interfaces/FetchOrComputeResult.html +2 -2
- package/docs/api/interfaces/FlowPolicyOptions.html +7 -0
- package/docs/api/interfaces/FlowRecord.html +2 -2
- package/docs/api/interfaces/FlowStatePolicy.html +3 -0
- package/docs/api/interfaces/InvocationCreateOptions.html +4 -0
- 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 +8 -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 -2
- package/docs/api/interfaces/RequestContext.html +4 -0
- package/docs/api/interfaces/RequestContextOptions.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/StateOptions.html +3 -2
- package/docs/api/interfaces/StateRegistration.html +3 -2
- 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/interfaces/WorkflowOptions.html +2 -2
- package/docs/api/interfaces/WorkflowWorkerResult.html +2 -2
- 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/FlowStateMode.html +1 -0
- package/docs/api/types/FlowStatePolicyLike.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/types/WorkflowHandler.html +1 -1
- 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.ts
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,12 +14,217 @@ 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 {
|
|
@@ -28,15 +234,21 @@ interface NativeAdapterOptions {
|
|
|
28
234
|
autoReconnect?: boolean | ReconnectOptions;
|
|
29
235
|
clientName?: string;
|
|
30
236
|
connectTimeoutMs?: number;
|
|
237
|
+
endpointPolicy?: EndpointPolicy;
|
|
238
|
+
endpointValidator?: (endpoint: RoutingEndpoint) => boolean | void;
|
|
239
|
+
haRouting?: boolean;
|
|
31
240
|
heartbeatIntervalMs?: number;
|
|
32
241
|
keepAlive?: boolean;
|
|
33
242
|
keepAliveInitialDelayMs?: number;
|
|
34
243
|
maxChunkBytes?: number;
|
|
35
244
|
protocolLanes?: number;
|
|
245
|
+
seeds?: readonly string[];
|
|
36
246
|
timeoutMs?: number;
|
|
247
|
+
trustedHosts?: readonly string[];
|
|
37
248
|
username?: string;
|
|
38
249
|
password?: string;
|
|
39
250
|
tlsOptions?: tls.ConnectionOptions;
|
|
251
|
+
warmConnections?: boolean;
|
|
40
252
|
}
|
|
41
253
|
interface ReconnectOptions {
|
|
42
254
|
maxRetries?: number;
|
|
@@ -60,6 +272,7 @@ declare class NativeAdapter implements CommandExecutor {
|
|
|
60
272
|
private constructor();
|
|
61
273
|
static fromUrl(url: string, options?: NativeAdapterOptions): Promise<NativeAdapter>;
|
|
62
274
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
275
|
+
executeProtocolCommand(command: ProtocolCommand, laneId?: number): Promise<unknown>;
|
|
63
276
|
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
64
277
|
close(): Promise<void>;
|
|
65
278
|
private startup;
|
|
@@ -84,6 +297,8 @@ declare class ReconnectingExecutor implements CommandExecutor {
|
|
|
84
297
|
constructor(createExecutor: () => Promise<CommandExecutor>, options?: ReconnectOptions);
|
|
85
298
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
86
299
|
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
300
|
+
refreshTopology(): Promise<RoutingTopology>;
|
|
301
|
+
route(key: string | Buffer$1): Promise<RoutingRoute>;
|
|
87
302
|
close(): Promise<void>;
|
|
88
303
|
private withReconnect;
|
|
89
304
|
private reconnect;
|
|
@@ -522,7 +737,9 @@ interface CreateItem {
|
|
|
522
737
|
valueRefs?: Record<string, string>;
|
|
523
738
|
stateMeta?: StateMeta;
|
|
524
739
|
}
|
|
740
|
+
/** @internal */
|
|
525
741
|
declare const CLAIMED_ITEM_WIRE: unique symbol;
|
|
742
|
+
/** @internal */
|
|
526
743
|
interface ClaimedItemWire {
|
|
527
744
|
id: Buffer;
|
|
528
745
|
partitionKey?: Buffer | null;
|
|
@@ -539,6 +756,7 @@ interface ClaimedItem<TPayload = unknown> {
|
|
|
539
756
|
runState?: string;
|
|
540
757
|
payload?: TPayload | null;
|
|
541
758
|
attributes?: Record<string, unknown>;
|
|
759
|
+
/** @internal */
|
|
542
760
|
[CLAIMED_ITEM_WIRE]?: ClaimedItemWire;
|
|
543
761
|
}
|
|
544
762
|
interface FencedItem {
|
|
@@ -653,6 +871,32 @@ interface ClaimDueOptions {
|
|
|
653
871
|
interface ReclaimOptions extends Omit<ClaimDueOptions, "state" | "states" | "blockMs" | "reclaimExpired" | "reclaimRatio" | "includeState"> {
|
|
654
872
|
state?: "running";
|
|
655
873
|
}
|
|
874
|
+
type FlowStateMode = "fifo" | "parallel";
|
|
875
|
+
interface FlowStatePolicy {
|
|
876
|
+
mode?: FlowStateMode;
|
|
877
|
+
retry?: RetryPolicy;
|
|
878
|
+
}
|
|
879
|
+
type FlowStatePolicyLike = FlowStatePolicy | RetryPolicy;
|
|
880
|
+
interface FlowPolicyOptions {
|
|
881
|
+
state?: string;
|
|
882
|
+
mode?: FlowStateMode;
|
|
883
|
+
retry?: RetryPolicy;
|
|
884
|
+
states?: Record<string, FlowStatePolicyLike>;
|
|
885
|
+
retentionTtlMs?: number;
|
|
886
|
+
indexedStateMeta?: string;
|
|
887
|
+
}
|
|
888
|
+
interface RequestContext {
|
|
889
|
+
subject?: string;
|
|
890
|
+
tenant?: string;
|
|
891
|
+
scopes?: string | readonly string[];
|
|
892
|
+
}
|
|
893
|
+
interface RequestContextOptions {
|
|
894
|
+
requestContext?: RequestContext;
|
|
895
|
+
}
|
|
896
|
+
interface InvocationCreateOptions extends RequestContextOptions {
|
|
897
|
+
context?: Record<string, unknown>;
|
|
898
|
+
idempotencyKey?: string;
|
|
899
|
+
}
|
|
656
900
|
interface MutateOptions {
|
|
657
901
|
partitionKey?: string;
|
|
658
902
|
payload?: unknown;
|
|
@@ -707,6 +951,12 @@ interface ReadOptions {
|
|
|
707
951
|
includeCold?: boolean;
|
|
708
952
|
consistentProjection?: boolean;
|
|
709
953
|
}
|
|
954
|
+
type SearchStateMeta = StateMeta | Record<string, StateMeta>;
|
|
955
|
+
interface SearchOptions extends ReadOptions {
|
|
956
|
+
attributes?: Record<string, CommandArgument>;
|
|
957
|
+
stateMeta?: SearchStateMeta;
|
|
958
|
+
}
|
|
959
|
+
type ManagementPairs = Record<string, CommandArgument>;
|
|
710
960
|
declare class FerricStoreClient {
|
|
711
961
|
readonly executor: CommandExecutor;
|
|
712
962
|
readonly codec: Codec;
|
|
@@ -728,9 +978,12 @@ declare class FerricStoreClient {
|
|
|
728
978
|
readonly zset: SortedSetStore;
|
|
729
979
|
constructor(executor: CommandExecutor, options?: FerricStoreClientOptions);
|
|
730
980
|
static fromUrl(url: string, options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
981
|
+
static fromUrls(urls: readonly string[], options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
731
982
|
command(...args: CommandArgument[]): Promise<unknown>;
|
|
732
983
|
pipeline(commands: readonly Command[]): Promise<unknown[]>;
|
|
733
984
|
close(): Promise<void>;
|
|
985
|
+
refreshTopology(): Promise<RoutingTopology>;
|
|
986
|
+
route(key: string | Buffer): Promise<RoutingRoute>;
|
|
734
987
|
ping(message?: CommandArgument): Promise<unknown>;
|
|
735
988
|
echo(message: CommandArgument): Promise<unknown>;
|
|
736
989
|
serverInfo(section?: string): Promise<string>;
|
|
@@ -777,10 +1030,11 @@ declare class FerricStoreClient {
|
|
|
777
1030
|
pubsubChannels(pattern?: string): Promise<unknown[]>;
|
|
778
1031
|
pubsubNumSub(...channels: string[]): Promise<unknown[]>;
|
|
779
1032
|
pubsubNumPat(): Promise<number>;
|
|
780
|
-
aclSetUser(username: string, rules: string[]): Promise<boolean>;
|
|
1033
|
+
aclSetUser(username: string, rules: string | readonly string[]): Promise<boolean>;
|
|
781
1034
|
aclDelUser(...usernames: string[]): Promise<number>;
|
|
782
1035
|
aclGetUser(username: string): Promise<unknown>;
|
|
783
1036
|
aclList(): Promise<unknown[]>;
|
|
1037
|
+
aclListUsers(): Promise<unknown[]>;
|
|
784
1038
|
aclWhoami(): Promise<string>;
|
|
785
1039
|
aclSave(): Promise<boolean>;
|
|
786
1040
|
aclLoad(): Promise<boolean>;
|
|
@@ -823,6 +1077,26 @@ declare class FerricStoreClient {
|
|
|
823
1077
|
ferricstoreMetrics(...args: CommandArgument[]): Promise<Record<string, unknown>>;
|
|
824
1078
|
ferricstoreBlobgc(...args: CommandArgument[]): Promise<unknown>;
|
|
825
1079
|
ferricstoreDoctor(...args: CommandArgument[]): Promise<unknown>;
|
|
1080
|
+
capabilities(): Promise<Record<string, unknown>>;
|
|
1081
|
+
ensureNamespace(prefix: string, attrs?: ManagementPairs): Promise<unknown>;
|
|
1082
|
+
getNamespace(prefix: string): Promise<unknown>;
|
|
1083
|
+
listNamespaces(): Promise<unknown>;
|
|
1084
|
+
deleteNamespace(prefix: string): Promise<unknown>;
|
|
1085
|
+
setQuota(namespace: string, quotaSpec?: ManagementPairs): Promise<unknown>;
|
|
1086
|
+
getQuota(namespace: string): Promise<unknown>;
|
|
1087
|
+
quotaUsage(namespace: string): Promise<unknown>;
|
|
1088
|
+
clusterInfo(): Promise<Record<string, unknown>>;
|
|
1089
|
+
namespaceUsage(prefix: string): Promise<Record<string, unknown>>;
|
|
1090
|
+
flowQuery(attrs?: ManagementPairs): Promise<unknown[]>;
|
|
1091
|
+
flowHistory(id: string, attrs?: ManagementPairs): Promise<unknown[]>;
|
|
1092
|
+
invocationDefinitionPut(definition: Record<string, unknown> | string, options?: RequestContextOptions): Promise<unknown>;
|
|
1093
|
+
invocationDefinitionGet(name: string, options?: RequestContextOptions): Promise<unknown>;
|
|
1094
|
+
invocationDefinitionList(options?: RequestContextOptions): Promise<unknown[]>;
|
|
1095
|
+
invocationCreate(name: string, attrs: Record<string, unknown>, options?: InvocationCreateOptions): Promise<unknown>;
|
|
1096
|
+
invocationGet(id: string, options?: RequestContextOptions): Promise<unknown>;
|
|
1097
|
+
invocationPartitionList(name: string, options?: RequestContextOptions & {
|
|
1098
|
+
scope?: string;
|
|
1099
|
+
}): Promise<unknown[]>;
|
|
826
1100
|
create(id: string, options: CreateOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
827
1101
|
enqueue(id: string, options: Omit<CreateOptions, "state"> & {
|
|
828
1102
|
state?: string;
|
|
@@ -942,6 +1216,7 @@ declare class FerricStoreClient {
|
|
|
942
1216
|
full?: boolean;
|
|
943
1217
|
}): Promise<FlowRecord<TPayload> | undefined>;
|
|
944
1218
|
list(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1219
|
+
search(type: string, options?: SearchOptions): Promise<FlowRecord[]>;
|
|
945
1220
|
terminals(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
946
1221
|
failures(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
947
1222
|
byParent(parentFlowId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
@@ -976,12 +1251,7 @@ declare class FerricStoreClient {
|
|
|
976
1251
|
values?: Record<string, unknown>;
|
|
977
1252
|
valueRefs?: Record<string, string>;
|
|
978
1253
|
}): Promise<unknown>;
|
|
979
|
-
installPolicy(type: string, options?:
|
|
980
|
-
state?: string;
|
|
981
|
-
retry?: RetryPolicy;
|
|
982
|
-
retentionTtlMs?: number;
|
|
983
|
-
indexedStateMeta?: string;
|
|
984
|
-
}): Promise<unknown>;
|
|
1254
|
+
installPolicy(type: string, options?: FlowPolicyOptions): Promise<unknown>;
|
|
985
1255
|
policyGet(type: string, options?: {
|
|
986
1256
|
state?: string;
|
|
987
1257
|
}): Promise<Record<string, unknown>>;
|
|
@@ -1151,6 +1421,7 @@ declare class QueueWorker {
|
|
|
1151
1421
|
|
|
1152
1422
|
type WorkflowHandler = (ctx: WorkflowContext) => Promise<Outcome | void | unknown> | Outcome | void | unknown;
|
|
1153
1423
|
interface StateOptions {
|
|
1424
|
+
mode?: FlowStateMode;
|
|
1154
1425
|
leaseMs?: number;
|
|
1155
1426
|
claimPayload?: boolean;
|
|
1156
1427
|
claimRecord?: boolean;
|
|
@@ -1179,6 +1450,7 @@ interface StateRegistration {
|
|
|
1179
1450
|
exceptionPolicy: ExceptionPolicy;
|
|
1180
1451
|
handler: WorkflowHandler;
|
|
1181
1452
|
leaseMs: number;
|
|
1453
|
+
mode?: FlowStateMode;
|
|
1182
1454
|
name: string;
|
|
1183
1455
|
returnRecord: boolean;
|
|
1184
1456
|
retryPolicy?: RetryPolicy;
|
|
@@ -1243,6 +1515,7 @@ declare class Workflow {
|
|
|
1243
1515
|
worker(options?: WorkerConfig & {
|
|
1244
1516
|
states?: string[];
|
|
1245
1517
|
}): WorkflowWorker;
|
|
1518
|
+
installPolicy(options?: Omit<FlowPolicyOptions, "mode" | "state" | "states">): Promise<unknown>;
|
|
1246
1519
|
stateNames(): string[];
|
|
1247
1520
|
stateRegistration(name: string): StateRegistration | undefined;
|
|
1248
1521
|
}
|
|
@@ -1319,4 +1592,4 @@ declare class WorkflowWorker {
|
|
|
1319
1592
|
private applyHandlerError;
|
|
1320
1593
|
}
|
|
1321
1594
|
|
|
1322
|
-
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 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 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 ReconnectOptions, ReconnectingExecutor, 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, isReconnectableClosedConnectionError, mapException, retry, transition };
|
|
1595
|
+
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 FlowPolicyOptions, type FlowRecord, type FlowStateMode, type FlowStatePolicy, type FlowStatePolicyLike, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, HashStore, HyperLogLogStore, InvalidCommandError, type InvocationCreateOptions, 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 RequestContext, type RequestContextOptions, 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 };
|