@ferricstore/ferricstore 0.1.6 → 0.1.7
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 +219 -8
- package/dist/index.cjs +14576 -4786
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1639 -868
- package/dist/index.d.ts +1639 -868
- package/dist/index.js +14609 -4827
- package/dist/index.js.map +1 -1
- package/docs/api/assets/hierarchy.js +1 -1
- package/docs/api/assets/navigation.js +1 -1
- package/docs/api/assets/search.js +1 -1
- package/docs/api/classes/BitmapStore.html +2 -2
- package/docs/api/classes/BloomFilterStore.html +4 -2
- package/docs/api/classes/ClaimHydrationError.html +38 -0
- package/docs/api/classes/ConnectionClosedError.html +37 -0
- package/docs/api/classes/CountMinSketchStore.html +3 -2
- package/docs/api/classes/CuckooFilterStore.html +3 -2
- package/docs/api/classes/FerricStoreClient.html +204 -146
- package/docs/api/classes/FerricStoreError.html +1 -1
- package/docs/api/classes/FlowAlreadyExistsError.html +2 -2
- package/docs/api/classes/FlowBatchError.html +39 -0
- package/docs/api/classes/FlowNotFoundError.html +2 -2
- package/docs/api/classes/FlowWrongStateError.html +2 -2
- package/docs/api/classes/GeoStore.html +4 -2
- package/docs/api/classes/HashStore.html +2 -2
- package/docs/api/classes/HyperLogLogStore.html +3 -2
- package/docs/api/classes/InvalidCommandError.html +2 -2
- package/docs/api/classes/KeyValueStore.html +2 -2
- package/docs/api/classes/LeaseRenewalError.html +34 -0
- package/docs/api/classes/ListStore.html +6 -2
- package/docs/api/classes/LockHeldError.html +2 -2
- package/docs/api/classes/LockNotOwnedError.html +2 -2
- package/docs/api/classes/NativeAdapter.html +4 -2
- package/docs/api/classes/OverloadedError.html +2 -2
- package/docs/api/classes/Queue.html +2 -2
- package/docs/api/classes/QueueClient.html +2 -2
- package/docs/api/classes/QueueCompletionError.html +35 -0
- package/docs/api/classes/QueueWorker.html +2 -2
- package/docs/api/classes/ReconnectingExecutor.html +8 -2
- package/docs/api/classes/RequestTimeoutError.html +38 -0
- package/docs/api/classes/RerouteError.html +36 -0
- package/docs/api/classes/RoutingTopology.html +2 -2
- package/docs/api/classes/SetStore.html +4 -2
- package/docs/api/classes/SortedSetStore.html +3 -2
- package/docs/api/classes/StaleLeaseError.html +2 -2
- package/docs/api/classes/StreamStore.html +2 -2
- package/docs/api/classes/TDigestStore.html +2 -2
- package/docs/api/classes/TopKStore.html +6 -2
- package/docs/api/classes/TopologyNativeAdapterPool.html +7 -2
- package/docs/api/classes/Workflow.html +4 -2
- package/docs/api/classes/WorkflowClient.html +2 -2
- package/docs/api/classes/WorkflowContext.html +2 -2
- package/docs/api/classes/WorkflowFlowCommands.html +3 -2
- package/docs/api/classes/WorkflowWorker.html +2 -2
- package/docs/api/functions/classifyServerError.html +1 -1
- package/docs/api/functions/complete.html +1 -1
- package/docs/api/functions/fail.html +1 -1
- package/docs/api/functions/isOutcome.html +1 -0
- package/docs/api/functions/isReconnectableClosedConnectionError.html +1 -1
- package/docs/api/functions/mapException.html +1 -1
- package/docs/api/functions/retry.html +1 -1
- package/docs/api/functions/transition.html +1 -1
- package/docs/api/hierarchy.html +1 -1
- package/docs/api/index.html +151 -11
- package/docs/api/interfaces/AdminListOptions.html +4 -0
- package/docs/api/interfaces/ApprovalListOptions.html +6 -0
- package/docs/api/interfaces/ApprovalRequestOptions.html +11 -0
- package/docs/api/interfaces/AttributeQueryOptions.html +5 -0
- package/docs/api/interfaces/AutoBatchOptions.html +3 -2
- package/docs/api/interfaces/BackpressurePolicy.html +2 -2
- package/docs/api/interfaces/BudgetCommitOptions.html +3 -0
- package/docs/api/interfaces/BudgetReserveOptions.html +5 -0
- package/docs/api/interfaces/CancelOptions.html +12 -6
- package/docs/api/interfaces/ChildSpec.html +2 -2
- package/docs/api/interfaces/CircuitOpenOptions.html +4 -0
- package/docs/api/interfaces/ClaimDueOptions.html +4 -2
- package/docs/api/interfaces/ClaimHydrationItem.html +3 -0
- package/docs/api/interfaces/ClaimedItem.html +4 -3
- package/docs/api/interfaces/CommandExecutor.html +7 -2
- package/docs/api/interfaces/CompleteJobsAndClaimJobsResult.html +11 -0
- package/docs/api/interfaces/CompleteManyOptions.html +14 -0
- package/docs/api/interfaces/CompleteOptions.html +4 -2
- package/docs/api/interfaces/CompleteOutcome.html +4 -2
- package/docs/api/interfaces/CountMinMergeOptions.html +2 -2
- package/docs/api/interfaces/CreateItem.html +3 -2
- package/docs/api/interfaces/CreateManyOptions.html +10 -2
- package/docs/api/interfaces/CreateOptions.html +6 -2
- package/docs/api/interfaces/EffectCompensateOptions.html +7 -0
- package/docs/api/interfaces/EffectConfirmOptions.html +7 -0
- package/docs/api/interfaces/EffectFailOptions.html +8 -0
- package/docs/api/interfaces/EffectReserveOptions.html +8 -0
- package/docs/api/interfaces/EffectStatusOptions.html +5 -0
- package/docs/api/interfaces/ExecutePipelineOptions.html +6 -2
- package/docs/api/interfaces/ExtendLeaseOptions.html +7 -0
- package/docs/api/interfaces/FailOptions.html +4 -2
- package/docs/api/interfaces/FailOutcome.html +4 -2
- package/docs/api/interfaces/FencedItem.html +2 -2
- package/docs/api/interfaces/FerricStoreClientFromUrlOptions.html +6 -2
- package/docs/api/interfaces/FerricStoreClientOptions.html +6 -2
- package/docs/api/interfaces/FetchOrComputeFencedResult.html +9 -0
- package/docs/api/interfaces/FetchOrComputeHitResult.html +6 -0
- package/docs/api/interfaces/FetchOrComputeLegacyResult.html +9 -0
- package/docs/api/interfaces/FlowBatchCompletedItem.html +3 -0
- package/docs/api/interfaces/FlowPolicyOptions.html +6 -2
- package/docs/api/interfaces/FlowRecord.html +3 -2
- package/docs/api/interfaces/FlowStatePolicy.html +2 -2
- package/docs/api/interfaces/FlowStatsOptions.html +6 -0
- package/docs/api/interfaces/GeoMember.html +2 -2
- package/docs/api/interfaces/GovernanceLedgerOptions.html +6 -0
- package/docs/api/interfaces/HistoryOptions.html +16 -0
- package/docs/api/interfaces/InvocationCreateOptions.html +2 -2
- package/docs/api/interfaces/KeyInfo.html +2 -2
- package/docs/api/interfaces/LeaseMutationOptions.html +14 -0
- package/docs/api/interfaces/LimitAmountOptions.html +4 -0
- package/docs/api/interfaces/LimitLeaseOptions.html +6 -0
- package/docs/api/interfaces/LimitListOptions.html +5 -0
- package/docs/api/interfaces/LimitReleaseOptions.html +4 -0
- package/docs/api/interfaces/MutateOptions.html +4 -2
- package/docs/api/interfaces/NamedValueMutation.html +4 -2
- package/docs/api/interfaces/NativeAdapterOptions.html +21 -9
- package/docs/api/interfaces/NativeClientOptions.html +43 -0
- package/docs/api/interfaces/NativeProtocolEvent.html +5 -0
- package/docs/api/interfaces/ProtocolCommand.html +2 -2
- package/docs/api/interfaces/QueueOptions.html +2 -2
- package/docs/api/interfaces/QueueWorkerResult.html +2 -2
- package/docs/api/interfaces/RangeLimit.html +2 -2
- package/docs/api/interfaces/RateLimitResult.html +2 -2
- package/docs/api/interfaces/ReadOptions.html +2 -2
- package/docs/api/interfaces/ReclaimOptions.html +4 -2
- package/docs/api/interfaces/ReconnectOptions.html +8 -2
- package/docs/api/interfaces/RequestContext.html +2 -2
- package/docs/api/interfaces/RequestContextOptions.html +2 -2
- package/docs/api/interfaces/RetryOptions.html +4 -2
- package/docs/api/interfaces/RetryOutcome.html +4 -2
- package/docs/api/interfaces/RetryPolicy.html +2 -2
- package/docs/api/interfaces/RoutingEndpoint.html +2 -2
- package/docs/api/interfaces/RoutingRoute.html +2 -2
- package/docs/api/interfaces/RunStepsItem.html +3 -0
- package/docs/api/interfaces/RunStepsManyOptions.html +11 -0
- package/docs/api/interfaces/ScanOptions.html +4 -2
- package/docs/api/interfaces/ScheduleFireDueOptions.html +5 -0
- package/docs/api/interfaces/ScheduleListOptions.html +9 -0
- package/docs/api/interfaces/ScheduleOptions.html +16 -0
- package/docs/api/interfaces/SearchOptions.html +2 -2
- package/docs/api/interfaces/StartAndClaimOptions.html +17 -0
- package/docs/api/interfaces/StateOptions.html +2 -2
- package/docs/api/interfaces/StateRegistration.html +2 -2
- package/docs/api/interfaces/StepContinueOptions.html +20 -0
- package/docs/api/interfaces/StoreCommandClient.html +3 -2
- package/docs/api/interfaces/TDigestCreateOptions.html +2 -2
- package/docs/api/interfaces/TDigestMergeOptions.html +2 -2
- package/docs/api/interfaces/TopologyNativeAdapterOptions.html +39 -0
- package/docs/api/interfaces/TransitionOptions.html +4 -2
- package/docs/api/interfaces/TransitionOutcome.html +4 -2
- package/docs/api/interfaces/ValueConfig.html +2 -2
- package/docs/api/interfaces/WorkerConfig.html +23 -2
- package/docs/api/interfaces/WorkflowOptions.html +2 -2
- package/docs/api/interfaces/WorkflowWorkerResult.html +2 -2
- package/docs/api/interfaces/XReadStream.html +2 -2
- package/docs/api/interfaces/ZAddMember.html +2 -2
- package/docs/api/media/kv-store.ts +2 -2
- package/docs/api/modules.html +1 -1
- package/docs/api/types/BackoffKind.html +1 -1
- package/docs/api/types/CollectionScanOptions.html +2 -0
- package/docs/api/types/Command.html +1 -1
- package/docs/api/types/CommandArgument.html +1 -1
- package/docs/api/types/ConnectionRequestDisposition.html +2 -0
- package/docs/api/types/EndpointPolicy.html +2 -1
- package/docs/api/types/ExceptionPolicy.html +1 -1
- package/docs/api/types/ExpiryCondition.html +1 -0
- package/docs/api/types/FencingToken.html +2 -0
- package/docs/api/types/FetchOrComputeComputeResult.html +1 -0
- package/docs/api/types/FetchOrComputeResult.html +1 -0
- package/docs/api/types/FlowAdminRecord.html +1 -0
- package/docs/api/types/FlowStateMode.html +1 -1
- package/docs/api/types/FlowStatePolicyLike.html +1 -1
- package/docs/api/types/GeoAddOptions.html +2 -0
- package/docs/api/types/GetExOptions.html +2 -0
- package/docs/api/types/HashScanResult.html +2 -0
- package/docs/api/types/IntegerReply.html +2 -0
- package/docs/api/types/ManagementPairs.html +1 -1
- package/docs/api/types/MaxActiveMs.html +1 -0
- package/docs/api/types/Outcome.html +1 -1
- package/docs/api/types/QueueBatchHandler.html +1 -1
- package/docs/api/types/QueueHandler.html +1 -1
- package/docs/api/types/QueueJob.html +1 -1
- package/docs/api/types/RequestDisposition.html +1 -0
- package/docs/api/types/SearchStateMeta.html +1 -1
- package/docs/api/types/SetOptions.html +2 -0
- package/docs/api/types/SetScanResult.html +2 -0
- package/docs/api/types/SortedSetScanResult.html +2 -0
- package/docs/api/types/StateMeta.html +1 -1
- package/docs/api/types/StateMetaValue.html +1 -1
- package/docs/api/types/TopKReserveOptions.html +1 -0
- package/docs/api/types/WorkerProfile.html +1 -1
- package/docs/api/types/WorkerRefillStrategy.html +1 -0
- package/docs/api/types/WorkflowHandler.html +1 -1
- package/docs/api/types/ZAddOptions.html +2 -0
- package/docs/api/variables/COMMAND_OPCODES.html +1 -1
- package/docs/api/variables/COMPACT_RESPONSE_OPCODES.html +2 -0
- package/docs/python-parity.md +12 -6
- package/package.json +5 -1
- package/docs/api/classes/JsonStore.html +0 -15
- package/docs/api/interfaces/FetchOrComputeResult.html +0 -6
- package/docs/api/interfaces/GeoAddOptions.html +0 -4
- package/docs/api/interfaces/GetExOptions.html +0 -6
- package/docs/api/interfaces/JsonSetOptions.html +0 -3
- package/docs/api/interfaces/SetOptions.html +0 -9
- package/docs/api/interfaces/TopKReserveOptions.html +0 -4
- package/docs/api/interfaces/ZAddOptions.html +0 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ConnectionOptions } from 'node:tls';
|
|
2
2
|
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
3
3
|
|
|
4
|
+
declare class FerricStoreError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
readonly raw: unknown;
|
|
7
|
+
constructor(message: string, options?: {
|
|
8
|
+
raw?: unknown;
|
|
9
|
+
cause?: unknown;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
type RequestDisposition = "unsent" | "possibly_sent";
|
|
13
|
+
/** Connection closure annotated with whether the current request may have reached the server. */
|
|
14
|
+
declare class ConnectionClosedError extends FerricStoreError {
|
|
15
|
+
readonly code = "connection_closed";
|
|
16
|
+
readonly requestDisposition: RequestDisposition;
|
|
17
|
+
constructor(requestDisposition: RequestDisposition, options?: {
|
|
18
|
+
raw?: unknown;
|
|
19
|
+
cause?: unknown;
|
|
20
|
+
message?: string;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** Request timeout annotated with whether the request may have reached the server. */
|
|
24
|
+
declare class RequestTimeoutError extends FerricStoreError {
|
|
25
|
+
readonly code = "request_timeout";
|
|
26
|
+
readonly requestDisposition: RequestDisposition;
|
|
27
|
+
readonly timeoutMs: number;
|
|
28
|
+
constructor(timeoutMs: number, requestDisposition: RequestDisposition, options?: {
|
|
29
|
+
raw?: unknown;
|
|
30
|
+
cause?: unknown;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
declare class FlowNotFoundError extends FerricStoreError {
|
|
34
|
+
readonly code = "flow_not_found";
|
|
35
|
+
}
|
|
36
|
+
declare class FlowWrongStateError extends FerricStoreError {
|
|
37
|
+
readonly code = "flow_wrong_state";
|
|
38
|
+
}
|
|
39
|
+
declare class StaleLeaseError extends FerricStoreError {
|
|
40
|
+
readonly code = "stale_lease";
|
|
41
|
+
}
|
|
42
|
+
declare class FlowAlreadyExistsError extends FerricStoreError {
|
|
43
|
+
readonly code = "flow_already_exists";
|
|
44
|
+
}
|
|
45
|
+
declare class LockHeldError extends FerricStoreError {
|
|
46
|
+
readonly code = "lock_held";
|
|
47
|
+
}
|
|
48
|
+
declare class LockNotOwnedError extends FerricStoreError {
|
|
49
|
+
readonly code = "lock_not_owned";
|
|
50
|
+
}
|
|
51
|
+
declare class InvalidCommandError extends FerricStoreError {
|
|
52
|
+
readonly code = "invalid_command";
|
|
53
|
+
}
|
|
54
|
+
declare class OverloadedError extends FerricStoreError {
|
|
55
|
+
readonly code = "overloaded";
|
|
56
|
+
readonly retryAfterMs: number | undefined;
|
|
57
|
+
readonly reason: string | undefined;
|
|
58
|
+
constructor(message: string, options?: {
|
|
59
|
+
raw?: unknown;
|
|
60
|
+
cause?: unknown;
|
|
61
|
+
retryAfterMs?: number;
|
|
62
|
+
reason?: string;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** The contacted endpoint cannot serve this route and topology should be refreshed. */
|
|
66
|
+
declare class RerouteError extends FerricStoreError {
|
|
67
|
+
readonly code = "reroute";
|
|
68
|
+
}
|
|
69
|
+
declare function classifyServerError(message: string, raw?: unknown, cause?: unknown, status?: number | string): FerricStoreError;
|
|
70
|
+
declare function mapException(error: unknown): unknown;
|
|
71
|
+
|
|
4
72
|
interface Codec<T = unknown> {
|
|
5
73
|
encode(value: T | null | undefined): Buffer;
|
|
6
74
|
decode(value: Buffer | null | undefined): T | null;
|
|
@@ -14,18 +82,26 @@ declare class JsonCodec<T = unknown> implements Codec<T> {
|
|
|
14
82
|
decode(value: Buffer | null | undefined): T | null;
|
|
15
83
|
}
|
|
16
84
|
|
|
17
|
-
type CommandArgument = string | Buffer | number | boolean | Record<string, unknown> | null | undefined;
|
|
85
|
+
type CommandArgument = string | Buffer | number | bigint | boolean | readonly CommandArgument[] | Record<string, unknown> | null | undefined;
|
|
18
86
|
type Command = readonly CommandArgument[];
|
|
19
87
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
88
|
+
interface ExecutePipelineOptions {
|
|
89
|
+
/** @internal Earlier command indexes that must settle before each individual fallback command starts. */
|
|
90
|
+
fallbackDependencies?: readonly (readonly number[])[];
|
|
91
|
+
/** Maximum concurrent requests when a native pipeline is unavailable. Defaults to 64. */
|
|
92
|
+
fallbackConcurrency?: number;
|
|
93
|
+
/** Preserve command execution order when a native pipeline is unavailable. */
|
|
94
|
+
ordered?: boolean;
|
|
95
|
+
throwOnItemError?: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
23
98
|
interface RoutingEndpoint {
|
|
24
99
|
readonly node: string;
|
|
25
100
|
readonly host: string;
|
|
26
101
|
readonly nativePort: number;
|
|
27
102
|
readonly nativeTlsPort?: number;
|
|
28
103
|
}
|
|
104
|
+
|
|
29
105
|
interface RoutingRoute {
|
|
30
106
|
readonly shard: number;
|
|
31
107
|
readonly laneId: number;
|
|
@@ -42,35 +118,137 @@ declare class RoutingTopology {
|
|
|
42
118
|
private constructor();
|
|
43
119
|
static empty(): RoutingTopology;
|
|
44
120
|
static build(payload: unknown): RoutingTopology;
|
|
45
|
-
static slotForKey(key: string | Buffer
|
|
46
|
-
routeKey(key: string | Buffer
|
|
121
|
+
static slotForKey(key: string | Buffer): number;
|
|
122
|
+
routeKey(key: string | Buffer): RoutingRoute;
|
|
47
123
|
}
|
|
124
|
+
|
|
125
|
+
/** Trust policy for endpoints learned from SHARDS topology responses. */
|
|
126
|
+
type EndpointPolicy = "seed_hosts" | "any" | "none" | {
|
|
127
|
+
readonly allowHosts: readonly string[];
|
|
128
|
+
};
|
|
129
|
+
|
|
48
130
|
declare class TopologyNativeAdapterPool implements CommandExecutor {
|
|
49
131
|
private readonly adapterOptions;
|
|
50
|
-
private readonly
|
|
51
|
-
private
|
|
52
|
-
private readonly
|
|
53
|
-
private
|
|
132
|
+
private readonly seedAdapterOptions;
|
|
133
|
+
private closed;
|
|
134
|
+
private readonly adapterRegistry;
|
|
135
|
+
private closePromise?;
|
|
136
|
+
private readonly endpointTrust;
|
|
137
|
+
private readonly seedUrlByEndpointKey;
|
|
54
138
|
private readonly seedUrls;
|
|
55
139
|
private readonly tls;
|
|
56
|
-
private readonly
|
|
140
|
+
private readonly topologyConcurrency;
|
|
141
|
+
private readonly pipelineExecutor;
|
|
142
|
+
private readonly scatterExecutor;
|
|
57
143
|
private readonly warmConnections;
|
|
144
|
+
private eventRefreshPromise?;
|
|
145
|
+
private lastSuccessfulRefreshKey?;
|
|
146
|
+
private refreshPromise?;
|
|
147
|
+
private refreshRequested;
|
|
58
148
|
private topologyValue;
|
|
59
149
|
private constructor();
|
|
60
|
-
static fromUrls(urls: readonly string[], options?:
|
|
150
|
+
static fromUrls(urls: readonly string[], options?: TopologyNativeAdapterOptions): Promise<TopologyNativeAdapterPool>;
|
|
61
151
|
get topology(): RoutingTopology;
|
|
152
|
+
private requestTopologyRefresh;
|
|
153
|
+
private drainTopologyRefreshRequests;
|
|
62
154
|
refreshTopology(): Promise<RoutingTopology>;
|
|
155
|
+
private loadTopology;
|
|
63
156
|
route(key: string | Buffer$1): RoutingRoute;
|
|
64
157
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
158
|
+
executeCommandArgs(args: readonly CommandArgument[]): Promise<unknown>;
|
|
65
159
|
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
160
|
+
executeFusedPipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[] | undefined>;
|
|
161
|
+
private refreshAndCanRetrySafeReroute;
|
|
162
|
+
private executePipelineOnRoute;
|
|
163
|
+
private executeSplitPipeline;
|
|
66
164
|
close(): Promise<void>;
|
|
67
165
|
private routeData;
|
|
68
|
-
private
|
|
166
|
+
private executeOnRoute;
|
|
69
167
|
private controlAdapter;
|
|
70
|
-
private
|
|
168
|
+
private adapterForSeedUrl;
|
|
71
169
|
private adapterForEndpoint;
|
|
72
|
-
private
|
|
73
|
-
private
|
|
170
|
+
private adapterForCurrentRoute;
|
|
171
|
+
private retireRemovedAdapters;
|
|
172
|
+
private refreshCandidates;
|
|
173
|
+
private assertOpen;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface CommandExecutor {
|
|
177
|
+
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
178
|
+
/** Execute an already-built command without a JavaScript variadic-call limit. */
|
|
179
|
+
executeCommandArgs?(args: readonly CommandArgument[]): Promise<unknown>;
|
|
180
|
+
executePipeline?(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
181
|
+
/**
|
|
182
|
+
* Execute all commands in one native transport request. Returning undefined
|
|
183
|
+
* guarantees that no command was submitted, so the caller may fall back.
|
|
184
|
+
*/
|
|
185
|
+
executeFusedPipeline?(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[] | undefined>;
|
|
186
|
+
refreshTopology?(): Promise<RoutingTopology>;
|
|
187
|
+
route?(key: string | Buffer): Promise<RoutingRoute> | RoutingRoute;
|
|
188
|
+
close?(): Promise<void> | void;
|
|
189
|
+
}
|
|
190
|
+
interface NativeProtocolEvent {
|
|
191
|
+
readonly flags: number;
|
|
192
|
+
readonly laneId: number;
|
|
193
|
+
readonly opcode: number;
|
|
194
|
+
readonly value: unknown;
|
|
195
|
+
}
|
|
196
|
+
interface NativeAdapterOptions {
|
|
197
|
+
clientName?: string;
|
|
198
|
+
connectTimeoutMs?: number;
|
|
199
|
+
/** Cancels connection, STARTUP, or AUTH while the native adapter is being created. */
|
|
200
|
+
signal?: AbortSignal;
|
|
201
|
+
heartbeatIntervalMs?: number;
|
|
202
|
+
keepAlive?: boolean;
|
|
203
|
+
keepAliveInitialDelayMs?: number;
|
|
204
|
+
/** Maximum source bytes buffered across chunked responses, including final assembly. */
|
|
205
|
+
maxChunkBytes?: number;
|
|
206
|
+
/** Maximum source frames buffered across chunked responses, including final assembly. */
|
|
207
|
+
maxChunkFrames?: number;
|
|
208
|
+
/** Maximum body bytes declared by any single native frame. */
|
|
209
|
+
maxFrameBytes?: number;
|
|
210
|
+
/** Maximum decoded response body bytes, including all chunks. */
|
|
211
|
+
maxResponseBytes?: number;
|
|
212
|
+
/** Maximum correlated control requests awaiting responses on one native connection. */
|
|
213
|
+
maxPendingControlRequests?: number;
|
|
214
|
+
/** Maximum requests waiting locally for native flow-control credit. */
|
|
215
|
+
maxQueuedRequests?: number;
|
|
216
|
+
/** Maximum encoded request bytes waiting locally for socket backpressure. */
|
|
217
|
+
maxQueuedWriteBytes?: number;
|
|
218
|
+
/** Native management events requested during STARTUP. */
|
|
219
|
+
events?: readonly string[];
|
|
220
|
+
/** Non-blocking callback for unsolicited native management frames. */
|
|
221
|
+
onEvent?: (event: NativeProtocolEvent) => unknown;
|
|
222
|
+
protocolLanes?: number;
|
|
223
|
+
timeoutMs?: number;
|
|
224
|
+
username?: string;
|
|
225
|
+
password?: string;
|
|
226
|
+
tlsOptions?: ConnectionOptions;
|
|
227
|
+
}
|
|
228
|
+
interface TopologyNativeAdapterOptions extends NativeAdapterOptions {
|
|
229
|
+
/** Learned endpoint trust policy; defaults to exact seeds plus `trustedHosts`. */
|
|
230
|
+
endpointPolicy?: EndpointPolicy;
|
|
231
|
+
endpointValidator?: (endpoint: RoutingEndpoint) => boolean | void;
|
|
232
|
+
/** Additional learned hosts allowed by the default `seed_hosts` policy. */
|
|
233
|
+
trustedHosts?: readonly string[];
|
|
234
|
+
/** Maximum concurrent per-route fan-out operations; defaults to 16. */
|
|
235
|
+
topologyConcurrency?: number;
|
|
236
|
+
warmConnections?: boolean;
|
|
237
|
+
}
|
|
238
|
+
/** Options accepted by FerricStoreClient.fromUrl(s), including client-side HA and reconnect policy. */
|
|
239
|
+
interface NativeClientOptions extends TopologyNativeAdapterOptions {
|
|
240
|
+
autoReconnect?: boolean | ReconnectOptions;
|
|
241
|
+
haRouting?: boolean;
|
|
242
|
+
seeds?: readonly string[];
|
|
243
|
+
}
|
|
244
|
+
interface ReconnectOptions {
|
|
245
|
+
/** Base delay after a failed reconnect attempt. Defaults to 25ms. */
|
|
246
|
+
baseDelayMs?: number;
|
|
247
|
+
/** Percentage of positive random jitter added to reconnect delays. Defaults to 20. */
|
|
248
|
+
jitterPct?: number;
|
|
249
|
+
/** Maximum reconnect delay. Defaults to 1,000ms. */
|
|
250
|
+
maxDelayMs?: number;
|
|
251
|
+
maxRetries?: number;
|
|
74
252
|
}
|
|
75
253
|
|
|
76
254
|
declare const COMMAND_OPCODES: {
|
|
@@ -213,604 +391,454 @@ declare const COMMAND_OPCODES: {
|
|
|
213
391
|
readonly "FERRICSTORE.METRICS": 783;
|
|
214
392
|
readonly "FERRICSTORE.BLOBGC": 784;
|
|
215
393
|
};
|
|
394
|
+
/** Direct compact response kinds advertised by the FerricStore native protocol. */
|
|
395
|
+
declare const COMPACT_RESPONSE_OPCODES: {
|
|
396
|
+
readonly flow_claim_jobs_v1: readonly [515];
|
|
397
|
+
readonly flow_record_list_v1: readonly [526, 535, 536, 537, 538, 539, 541];
|
|
398
|
+
readonly flow_record_v1: readonly [514];
|
|
399
|
+
readonly kv_get_v1: readonly [257];
|
|
400
|
+
readonly kv_mget_v1: readonly [260, 524];
|
|
401
|
+
readonly ok_list_v1: readonly [258, 261, 527, 528, 530, 531, 532];
|
|
402
|
+
readonly pipeline_v1: readonly [14];
|
|
403
|
+
};
|
|
216
404
|
interface ProtocolCommand {
|
|
217
405
|
readonly opcode: number;
|
|
218
406
|
readonly payload: unknown;
|
|
219
407
|
readonly flags?: number;
|
|
220
408
|
readonly laneId?: number;
|
|
409
|
+
/** @internal Correlated compact claim shape used to decode a direct response without guessing. */
|
|
410
|
+
readonly compactClaimMode?: CompactClaimMode;
|
|
411
|
+
/** @internal Correlated compact claim shapes for native pipeline response items. */
|
|
412
|
+
readonly pipelineClaimModes?: readonly (CompactClaimMode | undefined)[];
|
|
413
|
+
/** @internal Parsed routing metadata retained when a command uses COMMAND_EXEC. */
|
|
414
|
+
readonly routing?: ProtocolRoutingHints;
|
|
415
|
+
/** @internal Server-side blocking duration used to derive a safe response timeout. */
|
|
416
|
+
readonly serverBlockMs?: number;
|
|
417
|
+
}
|
|
418
|
+
type CompactClaimMode = "base" | "attrs" | "state" | "stateAttrs";
|
|
419
|
+
interface ProtocolRoutingHints {
|
|
420
|
+
readonly flowPartitionKey?: unknown;
|
|
421
|
+
readonly flowPartitionKeys?: readonly unknown[];
|
|
221
422
|
}
|
|
222
423
|
|
|
223
|
-
interface CommandExecutor {
|
|
224
|
-
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
225
|
-
executePipeline?(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
226
|
-
refreshTopology?(): Promise<RoutingTopology>;
|
|
227
|
-
route?(key: string | Buffer$1): Promise<RoutingRoute> | RoutingRoute;
|
|
228
|
-
close?(): Promise<void> | void;
|
|
229
|
-
}
|
|
230
|
-
interface ExecutePipelineOptions {
|
|
231
|
-
throwOnItemError?: boolean;
|
|
232
|
-
}
|
|
233
|
-
interface NativeAdapterOptions {
|
|
234
|
-
autoReconnect?: boolean | ReconnectOptions;
|
|
235
|
-
clientName?: string;
|
|
236
|
-
connectTimeoutMs?: number;
|
|
237
|
-
endpointPolicy?: EndpointPolicy;
|
|
238
|
-
endpointValidator?: (endpoint: RoutingEndpoint) => boolean | void;
|
|
239
|
-
haRouting?: boolean;
|
|
240
|
-
heartbeatIntervalMs?: number;
|
|
241
|
-
keepAlive?: boolean;
|
|
242
|
-
keepAliveInitialDelayMs?: number;
|
|
243
|
-
maxChunkBytes?: number;
|
|
244
|
-
protocolLanes?: number;
|
|
245
|
-
seeds?: readonly string[];
|
|
246
|
-
timeoutMs?: number;
|
|
247
|
-
trustedHosts?: readonly string[];
|
|
248
|
-
username?: string;
|
|
249
|
-
password?: string;
|
|
250
|
-
tlsOptions?: tls.ConnectionOptions;
|
|
251
|
-
warmConnections?: boolean;
|
|
252
|
-
}
|
|
253
|
-
interface ReconnectOptions {
|
|
254
|
-
maxRetries?: number;
|
|
255
|
-
}
|
|
256
424
|
declare class NativeAdapter implements CommandExecutor {
|
|
257
425
|
private readonly socket;
|
|
258
426
|
private readonly pending;
|
|
259
|
-
private readonly
|
|
260
|
-
private readonly
|
|
261
|
-
private
|
|
427
|
+
private readonly flowControl;
|
|
428
|
+
private readonly closedWaiters;
|
|
429
|
+
private readonly chunkAssembler;
|
|
262
430
|
private closed;
|
|
263
|
-
private
|
|
264
|
-
private
|
|
265
|
-
private
|
|
266
|
-
private
|
|
267
|
-
private readonly
|
|
268
|
-
private
|
|
269
|
-
private
|
|
270
|
-
private
|
|
431
|
+
private protocolLanes;
|
|
432
|
+
private maxPipelineCommands;
|
|
433
|
+
private maxRequestFrameBytes;
|
|
434
|
+
private pendingControlRequests;
|
|
435
|
+
private readonly maxPendingControlRequests;
|
|
436
|
+
private readonly heartbeat;
|
|
437
|
+
private readonly heartbeatIntervalMs;
|
|
438
|
+
private readonly responseHandler;
|
|
439
|
+
private readonly requestScheduler;
|
|
271
440
|
private readonly timeoutMs;
|
|
441
|
+
private draining;
|
|
442
|
+
private readonly writeQueue;
|
|
272
443
|
private constructor();
|
|
273
444
|
static fromUrl(url: string, options?: NativeAdapterOptions): Promise<NativeAdapter>;
|
|
445
|
+
/** @internal Closed and GOAWAY-draining adapters must not receive new work. */
|
|
446
|
+
get isUnavailable(): boolean;
|
|
274
447
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
448
|
+
executeCommandArgs(args: readonly CommandArgument[]): Promise<unknown>;
|
|
449
|
+
/** @internal Execute raw command arguments on a topology-selected lane. */
|
|
450
|
+
executeCommandOnLane(args: readonly CommandArgument[], laneId: number): Promise<unknown>;
|
|
275
451
|
executeProtocolCommand(command: ProtocolCommand, laneId?: number): Promise<unknown>;
|
|
276
452
|
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
453
|
+
/** @internal Attempt one physical pipeline request without splitting or fallback. */
|
|
454
|
+
executeFusedPipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[] | undefined>;
|
|
455
|
+
/** @internal Attempt one physical pipeline request on a topology-selected lane. */
|
|
456
|
+
executeFusedPipelineOnLane(commands: readonly Command[], laneId: number | undefined, options?: ExecutePipelineOptions): Promise<unknown[] | undefined>;
|
|
457
|
+
/** @internal Execute an ordered pipeline on a topology-selected lane. */
|
|
458
|
+
executePipelineOnLane(commands: readonly Command[], laneId: number | undefined, options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
277
459
|
close(): Promise<void>;
|
|
278
460
|
private startup;
|
|
279
|
-
private auth;
|
|
280
461
|
private request;
|
|
281
|
-
private
|
|
282
|
-
private
|
|
283
|
-
private
|
|
284
|
-
private
|
|
285
|
-
private handleFrame;
|
|
462
|
+
private waitForCreditAndSend;
|
|
463
|
+
private sendAcquiredRequest;
|
|
464
|
+
private timeoutPending;
|
|
465
|
+
private finishDrainIfIdle;
|
|
286
466
|
private failAll;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
private
|
|
467
|
+
/** @internal Gracefully stop new requests and close after correlated requests settle. */
|
|
468
|
+
retire(): Promise<void>;
|
|
469
|
+
private beginDraining;
|
|
470
|
+
private resolveClosedWaiters;
|
|
471
|
+
private takePending;
|
|
472
|
+
private applyFlowControlLimits;
|
|
473
|
+
private applyStartupLimits;
|
|
290
474
|
}
|
|
475
|
+
|
|
291
476
|
declare class ReconnectingExecutor implements CommandExecutor {
|
|
292
477
|
private readonly createExecutor;
|
|
478
|
+
private readonly baseDelayMs;
|
|
293
479
|
private closed;
|
|
480
|
+
private closePromise?;
|
|
481
|
+
private readonly jitterPct;
|
|
482
|
+
private readonly maxDelayMs;
|
|
294
483
|
private readonly maxRetries;
|
|
484
|
+
private readonly retryAbortController;
|
|
295
485
|
private executorPromise;
|
|
296
486
|
private reconnectPromise?;
|
|
297
|
-
constructor(createExecutor: () => Promise<CommandExecutor>, options?: ReconnectOptions);
|
|
487
|
+
constructor(createExecutor: (signal?: AbortSignal) => Promise<CommandExecutor>, options?: ReconnectOptions);
|
|
298
488
|
executeCommand(...args: CommandArgument[]): Promise<unknown>;
|
|
489
|
+
executeCommandArgs(args: readonly CommandArgument[]): Promise<unknown>;
|
|
490
|
+
ready(): Promise<void>;
|
|
299
491
|
executePipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
492
|
+
executeFusedPipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[] | undefined>;
|
|
300
493
|
refreshTopology(): Promise<RoutingTopology>;
|
|
301
494
|
route(key: string | Buffer$1): Promise<RoutingRoute>;
|
|
302
495
|
close(): Promise<void>;
|
|
303
496
|
private withReconnect;
|
|
497
|
+
private waitBeforeReconnect;
|
|
304
498
|
private reconnect;
|
|
305
499
|
}
|
|
306
500
|
declare function isReconnectableClosedConnectionError(error: unknown): boolean;
|
|
307
501
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
502
|
+
type ExceptionPolicy = "retry" | "fail" | "raise";
|
|
503
|
+
type BackoffKind = "fixed" | "linear" | "exponential";
|
|
504
|
+
type WorkerProfile = "latency" | "throughput";
|
|
505
|
+
type WorkerRefillStrategy = "continuous" | "wave";
|
|
506
|
+
interface RetryPolicy {
|
|
507
|
+
maxRetries?: number;
|
|
508
|
+
backoff?: BackoffKind | string;
|
|
509
|
+
baseMs?: number;
|
|
510
|
+
maxMs?: number;
|
|
511
|
+
jitterPct?: number;
|
|
512
|
+
exhaustedTo?: string;
|
|
311
513
|
}
|
|
312
|
-
interface
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
nx?: boolean;
|
|
318
|
-
xx?: boolean;
|
|
319
|
-
get?: boolean;
|
|
320
|
-
keepTtl?: boolean;
|
|
514
|
+
interface BackpressurePolicy {
|
|
515
|
+
maxRetries?: number;
|
|
516
|
+
baseDelayMs?: number;
|
|
517
|
+
maxDelayMs?: number;
|
|
518
|
+
jitterPct?: number;
|
|
321
519
|
}
|
|
322
|
-
interface
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
exat?: number;
|
|
326
|
-
pxat?: number;
|
|
327
|
-
persist?: boolean;
|
|
520
|
+
interface ValueConfig {
|
|
521
|
+
valueMaxBytes?: number;
|
|
522
|
+
localCache?: boolean;
|
|
328
523
|
}
|
|
329
|
-
interface
|
|
330
|
-
|
|
331
|
-
|
|
524
|
+
interface WorkerConfig {
|
|
525
|
+
profile?: WorkerProfile;
|
|
526
|
+
/** Alias for concurrency when concurrency is omitted. */
|
|
527
|
+
workers?: number;
|
|
528
|
+
/** Maximum simultaneously running per-job handlers and claim credit. */
|
|
529
|
+
concurrency?: number;
|
|
530
|
+
/** Refill free per-job slots continuously or wait for the current wave. Defaults to continuous in run(). */
|
|
531
|
+
refillStrategy?: WorkerRefillStrategy;
|
|
532
|
+
/** Additional slot-refill coalescing delay in milliseconds. Zero still coalesces one event-loop turn. */
|
|
533
|
+
refillDelayMs?: number;
|
|
534
|
+
/** Pipeline batchable completions with replacement claims when routes match. Defaults to true. */
|
|
535
|
+
fuseCompleteClaim?: boolean;
|
|
536
|
+
/** Claim and terminal mutation batch size, capped at the server Flow limit of 1,000. */
|
|
537
|
+
batchSize?: number;
|
|
538
|
+
leaseMs?: number;
|
|
539
|
+
/** Automatically extend leases while handlers run. Defaults to true. */
|
|
540
|
+
leaseRenewal?: boolean;
|
|
541
|
+
/** Lease-renewal interval in milliseconds. Defaults to half of leaseMs. */
|
|
542
|
+
leaseRenewIntervalMs?: number;
|
|
543
|
+
priority?: number;
|
|
544
|
+
nowMs?: number;
|
|
545
|
+
partitionKey?: string;
|
|
546
|
+
partitionKeys?: string[];
|
|
547
|
+
reclaimExpired?: boolean;
|
|
548
|
+
reclaimRatio?: number;
|
|
549
|
+
claimPayload?: boolean;
|
|
550
|
+
claimValues?: string[];
|
|
551
|
+
/** Include Flow attributes in compact worker claims. Defaults to false. */
|
|
552
|
+
claimAttributes?: boolean;
|
|
553
|
+
valueMaxBytes?: number;
|
|
554
|
+
blockMs?: number;
|
|
555
|
+
/** Maximum server block interval while signal is present, bounding safe shutdown latency. */
|
|
556
|
+
abortPollMs?: number;
|
|
557
|
+
idleSleepMs?: number;
|
|
558
|
+
maxIdleSleepMs?: number;
|
|
559
|
+
exceptionPolicy?: ExceptionPolicy;
|
|
560
|
+
/** Persist handler Error.stack for diagnostics. Defaults to false because stacks can expose paths or secrets. */
|
|
561
|
+
includeErrorStack?: boolean;
|
|
562
|
+
/** Maximum asynchronous terminal batches; non-finite values use the worker-mode default. */
|
|
563
|
+
completeAsyncDepth?: number;
|
|
564
|
+
completeIndependent?: boolean;
|
|
565
|
+
/** Maximum sequential non-blocking claims performed by one runOnce call. */
|
|
566
|
+
claimDrainBatches?: number;
|
|
567
|
+
signal?: AbortSignal;
|
|
568
|
+
worker?: string;
|
|
332
569
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
570
|
+
|
|
571
|
+
type MaxActiveMs = number | "infinity";
|
|
572
|
+
/** An exact Flow fencing token; bigint is used beyond JavaScript's safe integer range. */
|
|
573
|
+
type FencingToken = number | bigint;
|
|
574
|
+
interface ChildSpec {
|
|
575
|
+
id: string;
|
|
576
|
+
type: string;
|
|
577
|
+
payload?: unknown;
|
|
578
|
+
partitionKey?: string;
|
|
579
|
+
values?: Record<string, unknown>;
|
|
580
|
+
valueRefs?: Record<string, string>;
|
|
336
581
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
582
|
+
type StateMetaValue = string | number | boolean | Buffer;
|
|
583
|
+
type StateMeta = Record<string, StateMetaValue>;
|
|
584
|
+
interface CreateItem {
|
|
585
|
+
id: string;
|
|
586
|
+
payload?: unknown;
|
|
587
|
+
partitionKey?: string;
|
|
588
|
+
attributes?: Record<string, CommandArgument>;
|
|
589
|
+
values?: Record<string, unknown>;
|
|
590
|
+
valueRefs?: Record<string, string>;
|
|
591
|
+
stateMeta?: StateMeta;
|
|
343
592
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
593
|
+
/** @internal */
|
|
594
|
+
declare const CLAIMED_ITEM_WIRE: unique symbol;
|
|
595
|
+
/** @internal */
|
|
596
|
+
interface ClaimedItemWire {
|
|
597
|
+
id: Buffer;
|
|
598
|
+
partitionKey?: Buffer | null;
|
|
599
|
+
leaseToken: Buffer;
|
|
600
|
+
fencingToken: FencingToken;
|
|
347
601
|
}
|
|
348
|
-
interface
|
|
349
|
-
key: string;
|
|
602
|
+
interface ClaimedItem<TPayload = unknown> {
|
|
350
603
|
id: string;
|
|
604
|
+
leaseToken: Buffer;
|
|
605
|
+
fencingToken: FencingToken;
|
|
606
|
+
partitionKey?: string;
|
|
607
|
+
/** Present when supplied by a full response or known compact-claim context. */
|
|
608
|
+
type?: string;
|
|
609
|
+
state: string;
|
|
610
|
+
runState?: string;
|
|
611
|
+
payload?: TPayload | null;
|
|
612
|
+
attributes?: Record<string, unknown>;
|
|
613
|
+
/** @internal */
|
|
614
|
+
[CLAIMED_ITEM_WIRE]?: ClaimedItemWire;
|
|
351
615
|
}
|
|
352
|
-
interface
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
interface GeoAddOptions {
|
|
358
|
-
nx?: boolean;
|
|
359
|
-
xx?: boolean;
|
|
360
|
-
ch?: boolean;
|
|
616
|
+
interface FencedItem {
|
|
617
|
+
id: string;
|
|
618
|
+
fencingToken: FencingToken;
|
|
619
|
+
leaseToken?: Buffer;
|
|
620
|
+
partitionKey?: string;
|
|
361
621
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
exists(...keys: string[]): Promise<number>;
|
|
369
|
-
mget<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
370
|
-
mset(entries: Record<string, unknown> | [string, unknown][]): Promise<boolean>;
|
|
371
|
-
msetnx(entries: Record<string, unknown> | [string, unknown][]): Promise<boolean>;
|
|
372
|
-
incr(key: string): Promise<number>;
|
|
373
|
-
decr(key: string): Promise<number>;
|
|
374
|
-
incrby(key: string, increment: number): Promise<number>;
|
|
375
|
-
decrby(key: string, decrement: number): Promise<number>;
|
|
376
|
-
incrbyfloat(key: string, increment: number): Promise<string>;
|
|
377
|
-
append(key: string, value: unknown): Promise<number>;
|
|
378
|
-
strlen(key: string): Promise<number>;
|
|
379
|
-
getset<T = unknown>(key: string, value: unknown): Promise<T | null>;
|
|
380
|
-
getdel<T = unknown>(key: string): Promise<T | null>;
|
|
381
|
-
getex<T = unknown>(key: string, options?: GetExOptions): Promise<T | null>;
|
|
382
|
-
setnx(key: string, value: unknown): Promise<boolean>;
|
|
383
|
-
setex(key: string, seconds: number, value: unknown): Promise<boolean>;
|
|
384
|
-
psetex(key: string, milliseconds: number, value: unknown): Promise<boolean>;
|
|
385
|
-
getrange(key: string, start: number, end: number): Promise<Buffer | string | unknown>;
|
|
386
|
-
setrange(key: string, offset: number, value: unknown): Promise<number>;
|
|
387
|
-
expire(key: string, seconds: number): Promise<boolean>;
|
|
388
|
-
pexpire(key: string, milliseconds: number): Promise<boolean>;
|
|
389
|
-
expireat(key: string, unixSeconds: number): Promise<boolean>;
|
|
390
|
-
pexpireat(key: string, unixMilliseconds: number): Promise<boolean>;
|
|
391
|
-
ttl(key: string): Promise<number>;
|
|
392
|
-
pttl(key: string): Promise<number>;
|
|
393
|
-
persist(key: string): Promise<boolean>;
|
|
394
|
-
expiretime(key: string): Promise<number>;
|
|
395
|
-
pexpiretime(key: string): Promise<number>;
|
|
396
|
-
type(key: string): Promise<string>;
|
|
397
|
-
unlink(...keys: string[]): Promise<number>;
|
|
398
|
-
rename(key: string, newKey: string): Promise<boolean>;
|
|
399
|
-
renamenx(key: string, newKey: string): Promise<boolean>;
|
|
400
|
-
copy(source: string, destination: string, options?: {
|
|
401
|
-
replace?: boolean;
|
|
402
|
-
}): Promise<boolean>;
|
|
403
|
-
randomkey(): Promise<string | null>;
|
|
404
|
-
keys(pattern: string): Promise<unknown[]>;
|
|
405
|
-
scan(cursor: string | number, options?: ScanOptions): Promise<unknown>;
|
|
406
|
-
dbsize(): Promise<number>;
|
|
407
|
-
flushdb(mode?: "ASYNC" | "SYNC"): Promise<boolean>;
|
|
408
|
-
flushall(mode?: "ASYNC" | "SYNC"): Promise<boolean>;
|
|
409
|
-
objectEncoding(key: string): Promise<string | null>;
|
|
410
|
-
objectHelp(): Promise<unknown[]>;
|
|
411
|
-
objectFreq(key: string): Promise<number>;
|
|
412
|
-
objectIdleTime(key: string): Promise<number>;
|
|
413
|
-
objectRefcount(key: string): Promise<number>;
|
|
414
|
-
wait(numReplicas: number, timeoutMs: number): Promise<number>;
|
|
415
|
-
waitAof(numLocal: number, numReplicas: number, timeoutMs: number): Promise<unknown[]>;
|
|
416
|
-
memoryUsage(key: string): Promise<number>;
|
|
622
|
+
interface RateLimitResult {
|
|
623
|
+
status: string;
|
|
624
|
+
count: number;
|
|
625
|
+
remaining: number;
|
|
626
|
+
resetMs: number;
|
|
627
|
+
allowed: boolean;
|
|
417
628
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
hgetall(key: string): Promise<unknown>;
|
|
426
|
-
hexists(key: string, field: string): Promise<boolean>;
|
|
427
|
-
hkeys(key: string): Promise<unknown[]>;
|
|
428
|
-
hvals<T = unknown>(key: string): Promise<(T | null)[]>;
|
|
429
|
-
hlen(key: string): Promise<number>;
|
|
430
|
-
hincrby(key: string, field: string, increment: number): Promise<number>;
|
|
431
|
-
hincrbyfloat(key: string, field: string, increment: number): Promise<string>;
|
|
432
|
-
hsetnx(key: string, field: string, value: unknown): Promise<boolean>;
|
|
433
|
-
hstrlen(key: string, field: string): Promise<number>;
|
|
434
|
-
hrandfield(key: string, count?: number, withValues?: boolean): Promise<unknown>;
|
|
435
|
-
hscan(key: string, cursor: string | number, options?: ScanOptions): Promise<unknown>;
|
|
436
|
-
hexpire(key: string, seconds: number, fields: string[]): Promise<unknown[]>;
|
|
437
|
-
httl(key: string, fields: string[]): Promise<unknown[]>;
|
|
438
|
-
hpersist(key: string, fields: string[]): Promise<unknown[]>;
|
|
439
|
-
hpexpire(key: string, milliseconds: number, fields: string[]): Promise<unknown[]>;
|
|
440
|
-
hpttl(key: string, fields: string[]): Promise<unknown[]>;
|
|
441
|
-
hexpiretime(key: string, fields: string[]): Promise<unknown[]>;
|
|
442
|
-
hgetdel<T = unknown>(key: string, fields: string[]): Promise<(T | null)[]>;
|
|
443
|
-
hgetex<T = unknown>(key: string, fields: string[], options?: GetExOptions): Promise<(T | null)[]>;
|
|
444
|
-
hsetex(key: string, seconds: number, entries: Record<string, unknown> | [string, unknown][]): Promise<number>;
|
|
629
|
+
interface KeyInfo {
|
|
630
|
+
type: string;
|
|
631
|
+
valueSize: number;
|
|
632
|
+
ttlMs: number;
|
|
633
|
+
hotCacheStatus: string;
|
|
634
|
+
lastWriteShard: number;
|
|
635
|
+
raw: Record<string, unknown>;
|
|
445
636
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
637
|
+
interface FetchOrComputeHitResult<T = unknown> {
|
|
638
|
+
readonly computeMode: "hit";
|
|
639
|
+
readonly hit: true;
|
|
640
|
+
readonly shouldCompute: false;
|
|
641
|
+
readonly status: "hit";
|
|
642
|
+
readonly value: T | null;
|
|
643
|
+
}
|
|
644
|
+
interface FetchOrComputeLegacyResult {
|
|
645
|
+
/** Opaque application hint echoed for the process elected to compute. */
|
|
646
|
+
readonly computeHint: Buffer;
|
|
647
|
+
readonly computeMode: "legacy";
|
|
648
|
+
/** Explicit null distinguishes a legacy tokenless lease from an omitted token. */
|
|
649
|
+
readonly computeToken: null;
|
|
650
|
+
readonly hit: false;
|
|
651
|
+
readonly shouldCompute: true;
|
|
652
|
+
readonly status: "compute";
|
|
653
|
+
}
|
|
654
|
+
interface FetchOrComputeFencedResult {
|
|
655
|
+
/** Opaque application hint echoed for the process elected to compute. */
|
|
656
|
+
readonly computeHint: Buffer;
|
|
657
|
+
readonly computeMode: "fenced";
|
|
658
|
+
/** Fencing token required when publishing the computed result or error. */
|
|
659
|
+
readonly computeToken: Buffer;
|
|
660
|
+
readonly hit: false;
|
|
661
|
+
readonly shouldCompute: true;
|
|
662
|
+
readonly status: "compute";
|
|
663
|
+
}
|
|
664
|
+
type FetchOrComputeComputeResult = FetchOrComputeLegacyResult | FetchOrComputeFencedResult;
|
|
665
|
+
type FetchOrComputeResult<T = unknown> = FetchOrComputeHitResult<T> | FetchOrComputeComputeResult;
|
|
666
|
+
interface FlowRecord<TPayload = unknown> {
|
|
667
|
+
id: string;
|
|
668
|
+
type: string;
|
|
669
|
+
state: string;
|
|
670
|
+
partitionKey: string;
|
|
671
|
+
runState?: string;
|
|
672
|
+
payload?: TPayload | null;
|
|
673
|
+
leaseToken: Buffer;
|
|
674
|
+
fencingToken: FencingToken;
|
|
675
|
+
version: number;
|
|
676
|
+
parentFlowId?: string;
|
|
677
|
+
rootFlowId?: string;
|
|
678
|
+
correlationId?: string;
|
|
679
|
+
maxActiveMs?: number;
|
|
680
|
+
valueRefs?: Record<string, unknown>;
|
|
681
|
+
values?: Record<string, unknown>;
|
|
682
|
+
valueSizes?: Record<string, unknown>;
|
|
683
|
+
valueOmitted?: Record<string, unknown>;
|
|
684
|
+
valueMissing?: Record<string, unknown>;
|
|
685
|
+
attributes?: Record<string, unknown>;
|
|
686
|
+
stateMeta?: Record<string, unknown>;
|
|
687
|
+
indexedStateMeta?: string;
|
|
688
|
+
raw?: unknown;
|
|
475
689
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
scard(key: string): Promise<number>;
|
|
485
|
-
srandmember<T = unknown>(key: string, count?: number): Promise<T | (T | null)[] | null>;
|
|
486
|
-
spop<T = unknown>(key: string, count?: number): Promise<T | (T | null)[] | null>;
|
|
487
|
-
sdiff<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
488
|
-
sinter<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
489
|
-
sunion<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
490
|
-
sdiffstore(destination: string, keys: string[]): Promise<number>;
|
|
491
|
-
sinterstore(destination: string, keys: string[]): Promise<number>;
|
|
492
|
-
sunionstore(destination: string, keys: string[]): Promise<number>;
|
|
493
|
-
sintercard(keys: string[], limit?: number): Promise<number>;
|
|
494
|
-
smove(source: string, destination: string, member: unknown): Promise<boolean>;
|
|
495
|
-
sscan(key: string, cursor: string | number, options?: ScanOptions): Promise<unknown>;
|
|
690
|
+
|
|
691
|
+
type FlowAdminRecord = Record<string, unknown>;
|
|
692
|
+
interface FlowStatsOptions {
|
|
693
|
+
state?: string;
|
|
694
|
+
partitionKey?: string;
|
|
695
|
+
count?: number;
|
|
696
|
+
attributes?: Record<string, CommandArgument>;
|
|
697
|
+
consistentProjection?: boolean;
|
|
496
698
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
zrank(key: string, member: unknown): Promise<number | null>;
|
|
503
|
-
zrevrank(key: string, member: unknown): Promise<number | null>;
|
|
504
|
-
zrange(key: string, start: number, stop: number, options?: {
|
|
505
|
-
withScores?: boolean;
|
|
506
|
-
}): Promise<unknown[]>;
|
|
507
|
-
zrevrange(key: string, start: number, stop: number, options?: {
|
|
508
|
-
withScores?: boolean;
|
|
509
|
-
}): Promise<unknown[]>;
|
|
510
|
-
zcard(key: string): Promise<number>;
|
|
511
|
-
zrem(key: string, ...members: unknown[]): Promise<number>;
|
|
512
|
-
zincrby(key: string, increment: number, member: unknown): Promise<string>;
|
|
513
|
-
zcount(key: string, min: string | number, max: string | number): Promise<number>;
|
|
514
|
-
zpopmin(key: string, count?: number): Promise<unknown[]>;
|
|
515
|
-
zpopmax(key: string, count?: number): Promise<unknown[]>;
|
|
516
|
-
zrandmember(key: string, count?: number, withScores?: boolean): Promise<unknown>;
|
|
517
|
-
zmscore(key: string, members: unknown[]): Promise<unknown[]>;
|
|
518
|
-
zrangebyscore(key: string, min: string | number, max: string | number, options?: {
|
|
519
|
-
withScores?: boolean;
|
|
520
|
-
limit?: RangeLimit;
|
|
521
|
-
}): Promise<unknown[]>;
|
|
522
|
-
zrevrangebyscore(key: string, max: string | number, min: string | number, options?: {
|
|
523
|
-
withScores?: boolean;
|
|
524
|
-
limit?: RangeLimit;
|
|
525
|
-
}): Promise<unknown[]>;
|
|
526
|
-
zscan(key: string, cursor: string | number, options?: ScanOptions): Promise<unknown>;
|
|
699
|
+
interface AttributeQueryOptions {
|
|
700
|
+
state?: string;
|
|
701
|
+
partitionKey?: string;
|
|
702
|
+
count?: number;
|
|
703
|
+
consistentProjection?: boolean;
|
|
527
704
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
count?: number;
|
|
545
|
-
blockMs?: number;
|
|
546
|
-
noack?: boolean;
|
|
547
|
-
}): Promise<unknown>;
|
|
548
|
-
xack(key: string, group: string, ...ids: string[]): Promise<number>;
|
|
705
|
+
interface ScheduleOptions {
|
|
706
|
+
target: Record<string, unknown>;
|
|
707
|
+
kind?: string;
|
|
708
|
+
atMs?: number;
|
|
709
|
+
delayMs?: number;
|
|
710
|
+
startAtMs?: number;
|
|
711
|
+
everyMs?: number;
|
|
712
|
+
cron?: string;
|
|
713
|
+
timezone?: string;
|
|
714
|
+
overlapPolicy?: string;
|
|
715
|
+
overlapRetryMs?: number;
|
|
716
|
+
maxFires?: number;
|
|
717
|
+
endAtMs?: number;
|
|
718
|
+
overwrite?: boolean;
|
|
719
|
+
nowMs?: number;
|
|
720
|
+
extraOptions?: Record<string, CommandArgument>;
|
|
549
721
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
722
|
+
interface ScheduleListOptions {
|
|
723
|
+
kind?: string;
|
|
724
|
+
state?: string;
|
|
725
|
+
timezone?: string;
|
|
726
|
+
targetType?: string;
|
|
727
|
+
fromMs?: number;
|
|
728
|
+
toMs?: number;
|
|
729
|
+
count?: number;
|
|
730
|
+
rev?: boolean;
|
|
558
731
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
pfmerge(destination: string, ...sources: string[]): Promise<boolean>;
|
|
732
|
+
interface ScheduleFireDueOptions {
|
|
733
|
+
nowMs?: number;
|
|
734
|
+
worker?: string;
|
|
735
|
+
blockMs?: number;
|
|
736
|
+
limit?: number;
|
|
565
737
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
geosearchstore(destination: string, source: string, args: CommandArgument[]): Promise<number>;
|
|
738
|
+
interface EffectReserveOptions {
|
|
739
|
+
partitionKey?: string;
|
|
740
|
+
leaseToken?: Buffer;
|
|
741
|
+
fencingToken?: FencingToken;
|
|
742
|
+
operationDigest: string;
|
|
743
|
+
idempotencyKey?: string;
|
|
744
|
+
governanceScope?: string;
|
|
745
|
+
nowMs?: number;
|
|
575
746
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
747
|
+
interface EffectStatusOptions {
|
|
748
|
+
partitionKey?: string;
|
|
749
|
+
leaseToken?: Buffer;
|
|
750
|
+
fencingToken?: FencingToken;
|
|
751
|
+
nowMs?: number;
|
|
581
752
|
}
|
|
582
|
-
interface
|
|
583
|
-
|
|
753
|
+
interface EffectConfirmOptions extends EffectStatusOptions {
|
|
754
|
+
externalId?: string;
|
|
755
|
+
latencyMs?: number;
|
|
756
|
+
}
|
|
757
|
+
interface EffectFailOptions extends EffectStatusOptions {
|
|
758
|
+
error?: string;
|
|
759
|
+
reason?: string;
|
|
760
|
+
latencyMs?: number;
|
|
761
|
+
}
|
|
762
|
+
interface EffectCompensateOptions extends EffectStatusOptions {
|
|
763
|
+
externalId?: string;
|
|
764
|
+
reason?: string;
|
|
765
|
+
}
|
|
766
|
+
interface ApprovalRequestOptions {
|
|
767
|
+
flowId: string;
|
|
768
|
+
scope: string;
|
|
769
|
+
reason?: string;
|
|
770
|
+
requestedBy?: string;
|
|
771
|
+
assignees?: readonly string[];
|
|
772
|
+
policyHash?: string;
|
|
773
|
+
policyVersion?: string | number;
|
|
774
|
+
timeoutMs?: number;
|
|
775
|
+
expiresAtMs?: number;
|
|
776
|
+
nowMs?: number;
|
|
584
777
|
}
|
|
585
|
-
interface
|
|
586
|
-
|
|
778
|
+
interface ApprovalListOptions {
|
|
779
|
+
status?: string;
|
|
780
|
+
scope?: string;
|
|
781
|
+
partitionKey?: string;
|
|
782
|
+
flowId?: string;
|
|
783
|
+
limit?: number;
|
|
587
784
|
}
|
|
588
|
-
interface
|
|
589
|
-
|
|
785
|
+
interface CircuitOpenOptions {
|
|
786
|
+
openMs?: number;
|
|
787
|
+
failureThreshold?: number;
|
|
788
|
+
nowMs?: number;
|
|
590
789
|
}
|
|
591
|
-
interface
|
|
592
|
-
|
|
593
|
-
|
|
790
|
+
interface BudgetReserveOptions {
|
|
791
|
+
limit?: number;
|
|
792
|
+
windowMs?: number;
|
|
793
|
+
reservationId?: string;
|
|
794
|
+
nowMs?: number;
|
|
594
795
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
reserve(key: string, errorRate: number, capacity: number): Promise<boolean>;
|
|
599
|
-
add(key: string, element: unknown): Promise<boolean>;
|
|
600
|
-
madd(key: string, ...elements: unknown[]): Promise<number[]>;
|
|
601
|
-
exists(key: string, element: unknown): Promise<boolean>;
|
|
602
|
-
mexists(key: string, ...elements: unknown[]): Promise<number[]>;
|
|
603
|
-
card(key: string): Promise<number>;
|
|
604
|
-
info(key: string): Promise<unknown[]>;
|
|
796
|
+
interface BudgetCommitOptions {
|
|
797
|
+
usage?: Record<string, unknown>;
|
|
798
|
+
nowMs?: number;
|
|
605
799
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
add(key: string, element: unknown): Promise<boolean>;
|
|
611
|
-
addnx(key: string, element: unknown): Promise<boolean>;
|
|
612
|
-
del(key: string, element: unknown): Promise<boolean>;
|
|
613
|
-
exists(key: string, element: unknown): Promise<boolean>;
|
|
614
|
-
mexists(key: string, ...elements: unknown[]): Promise<number[]>;
|
|
615
|
-
count(key: string, element: unknown): Promise<number>;
|
|
616
|
-
info(key: string): Promise<unknown[]>;
|
|
800
|
+
interface AdminListOptions {
|
|
801
|
+
scope?: string;
|
|
802
|
+
partitionKey?: string;
|
|
803
|
+
limit?: number;
|
|
617
804
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
constructor(client: StoreCommandClient);
|
|
621
|
-
initByDim(key: string, width: number, depth: number): Promise<boolean>;
|
|
622
|
-
initByProb(key: string, error: number, probability: number): Promise<boolean>;
|
|
623
|
-
incrBy(key: string, entries: [unknown, number][]): Promise<number[]>;
|
|
624
|
-
query(key: string, ...items: unknown[]): Promise<number[]>;
|
|
625
|
-
merge(destination: string, sources: string[], options?: CountMinMergeOptions): Promise<boolean>;
|
|
626
|
-
info(key: string): Promise<unknown[]>;
|
|
805
|
+
interface LimitListOptions extends AdminListOptions {
|
|
806
|
+
nowMs?: number;
|
|
627
807
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
incrBy<T = unknown>(key: string, entries: [unknown, number][]): Promise<(T | null)[]>;
|
|
634
|
-
query(key: string, ...elements: unknown[]): Promise<number[]>;
|
|
635
|
-
list<T = unknown>(key: string, options?: {
|
|
636
|
-
withCount?: boolean;
|
|
637
|
-
}): Promise<(T | number | null)[]>;
|
|
638
|
-
info(key: string): Promise<unknown[]>;
|
|
639
|
-
}
|
|
640
|
-
declare class TDigestStore {
|
|
641
|
-
private readonly client;
|
|
642
|
-
constructor(client: StoreCommandClient);
|
|
643
|
-
create(key: string, options?: TDigestCreateOptions): Promise<boolean>;
|
|
644
|
-
add(key: string, ...values: number[]): Promise<boolean>;
|
|
645
|
-
reset(key: string): Promise<boolean>;
|
|
646
|
-
quantile(key: string, ...quantiles: number[]): Promise<string[]>;
|
|
647
|
-
cdf(key: string, ...values: number[]): Promise<string[]>;
|
|
648
|
-
rank(key: string, ...values: number[]): Promise<number[]>;
|
|
649
|
-
revrank(key: string, ...values: number[]): Promise<number[]>;
|
|
650
|
-
byrank(key: string, ...ranks: number[]): Promise<string[]>;
|
|
651
|
-
byrevrank(key: string, ...ranks: number[]): Promise<string[]>;
|
|
652
|
-
trimmedMean(key: string, low: number, high: number): Promise<string>;
|
|
653
|
-
min(key: string): Promise<string>;
|
|
654
|
-
max(key: string): Promise<string>;
|
|
655
|
-
info(key: string): Promise<unknown[]>;
|
|
656
|
-
merge(destination: string, sources: string[], options?: TDigestMergeOptions): Promise<boolean>;
|
|
657
|
-
}
|
|
658
|
-
declare class JsonStore {
|
|
659
|
-
private readonly client;
|
|
660
|
-
constructor(client: StoreCommandClient);
|
|
661
|
-
set(key: string, path: string, value: unknown, options?: JsonSetOptions): Promise<boolean>;
|
|
662
|
-
get<T = unknown>(key: string, paths?: string | string[]): Promise<T | null>;
|
|
663
|
-
del(key: string, path?: string): Promise<number>;
|
|
664
|
-
numIncrBy(key: string, path: string, value: number): Promise<string>;
|
|
665
|
-
type(key: string, path?: string): Promise<string | null>;
|
|
666
|
-
strlen(key: string, path?: string): Promise<number | null>;
|
|
667
|
-
objKeys(key: string, path?: string): Promise<unknown[]>;
|
|
668
|
-
objLen(key: string, path?: string): Promise<number>;
|
|
669
|
-
arrAppend(key: string, path: string, ...values: unknown[]): Promise<number>;
|
|
670
|
-
arrLen(key: string, path?: string): Promise<number>;
|
|
671
|
-
toggle(key: string, path: string): Promise<number>;
|
|
672
|
-
clear(key: string, path?: string): Promise<number>;
|
|
673
|
-
mget<T = unknown>(keys: string[], path: string): Promise<(T | null)[]>;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
type ExceptionPolicy = "retry" | "fail" | "raise";
|
|
677
|
-
type BackoffKind = "fixed" | "linear" | "exponential";
|
|
678
|
-
type WorkerProfile = "latency" | "throughput";
|
|
679
|
-
interface RetryPolicy {
|
|
680
|
-
maxRetries?: number;
|
|
681
|
-
backoff?: BackoffKind | string;
|
|
682
|
-
baseMs?: number;
|
|
683
|
-
maxMs?: number;
|
|
684
|
-
jitterPct?: number;
|
|
685
|
-
exhaustedTo?: string;
|
|
686
|
-
}
|
|
687
|
-
interface BackpressurePolicy {
|
|
688
|
-
maxRetries?: number;
|
|
689
|
-
baseDelayMs?: number;
|
|
690
|
-
maxDelayMs?: number;
|
|
691
|
-
jitterPct?: number;
|
|
692
|
-
}
|
|
693
|
-
interface ValueConfig {
|
|
694
|
-
valueMaxBytes?: number;
|
|
695
|
-
localCache?: boolean;
|
|
696
|
-
}
|
|
697
|
-
interface WorkerConfig {
|
|
698
|
-
profile?: WorkerProfile;
|
|
699
|
-
workers?: number;
|
|
700
|
-
concurrency?: number;
|
|
701
|
-
batchSize?: number;
|
|
702
|
-
leaseMs?: number;
|
|
703
|
-
priority?: number;
|
|
808
|
+
interface LimitLeaseOptions {
|
|
809
|
+
shardId: number;
|
|
810
|
+
amount: number;
|
|
811
|
+
ttlMs: number;
|
|
812
|
+
limit?: number;
|
|
704
813
|
nowMs?: number;
|
|
705
|
-
partitionKey?: string;
|
|
706
|
-
partitionKeys?: string[];
|
|
707
|
-
reclaimExpired?: boolean;
|
|
708
|
-
reclaimRatio?: number;
|
|
709
|
-
claimPayload?: boolean;
|
|
710
|
-
claimValues?: string[];
|
|
711
|
-
valueMaxBytes?: number;
|
|
712
|
-
blockMs?: number;
|
|
713
|
-
idleSleepMs?: number;
|
|
714
|
-
maxIdleSleepMs?: number;
|
|
715
|
-
exceptionPolicy?: ExceptionPolicy;
|
|
716
|
-
completeAsyncDepth?: number;
|
|
717
|
-
completeIndependent?: boolean;
|
|
718
|
-
claimDrainBatches?: number;
|
|
719
|
-
signal?: AbortSignal;
|
|
720
|
-
worker?: string;
|
|
721
|
-
}
|
|
722
|
-
interface ChildSpec {
|
|
723
|
-
id: string;
|
|
724
|
-
type: string;
|
|
725
|
-
payload?: unknown;
|
|
726
|
-
partitionKey?: string;
|
|
727
|
-
values?: Record<string, unknown>;
|
|
728
|
-
valueRefs?: Record<string, string>;
|
|
729
814
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
payload?: unknown;
|
|
735
|
-
partitionKey?: string;
|
|
736
|
-
values?: Record<string, unknown>;
|
|
737
|
-
valueRefs?: Record<string, string>;
|
|
738
|
-
stateMeta?: StateMeta;
|
|
815
|
+
interface LimitAmountOptions {
|
|
816
|
+
shardId: number;
|
|
817
|
+
amount: number;
|
|
818
|
+
nowMs?: number;
|
|
739
819
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
id: Buffer;
|
|
745
|
-
partitionKey?: Buffer | null;
|
|
746
|
-
leaseToken: Buffer;
|
|
747
|
-
fencingToken: number;
|
|
820
|
+
interface LimitReleaseOptions {
|
|
821
|
+
shardId: number;
|
|
822
|
+
reservationIds: readonly string[];
|
|
823
|
+
amount?: number;
|
|
748
824
|
}
|
|
749
|
-
interface
|
|
750
|
-
id: string;
|
|
751
|
-
leaseToken: Buffer;
|
|
752
|
-
fencingToken: number;
|
|
825
|
+
interface GovernanceLedgerOptions {
|
|
753
826
|
partitionKey?: string;
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
attributes?: Record<string, unknown>;
|
|
759
|
-
/** @internal */
|
|
760
|
-
[CLAIMED_ITEM_WIRE]?: ClaimedItemWire;
|
|
761
|
-
}
|
|
762
|
-
interface FencedItem {
|
|
763
|
-
id: string;
|
|
764
|
-
fencingToken: number;
|
|
765
|
-
leaseToken?: Buffer;
|
|
766
|
-
partitionKey?: string;
|
|
767
|
-
}
|
|
768
|
-
interface RateLimitResult {
|
|
769
|
-
status: string;
|
|
770
|
-
count: number;
|
|
771
|
-
remaining: number;
|
|
772
|
-
resetMs: number;
|
|
773
|
-
allowed: boolean;
|
|
774
|
-
}
|
|
775
|
-
interface KeyInfo {
|
|
776
|
-
type: string;
|
|
777
|
-
valueSize: number;
|
|
778
|
-
ttlMs: number;
|
|
779
|
-
hotCacheStatus: string;
|
|
780
|
-
lastWriteShard: number;
|
|
781
|
-
raw: Record<string, unknown>;
|
|
827
|
+
limit?: number;
|
|
828
|
+
fromMs?: number;
|
|
829
|
+
toMs?: number;
|
|
830
|
+
rev?: boolean;
|
|
782
831
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
hit: boolean;
|
|
788
|
-
shouldCompute: boolean;
|
|
832
|
+
|
|
833
|
+
interface FlowBatchCompletedItem {
|
|
834
|
+
readonly index: number;
|
|
835
|
+
readonly value: unknown;
|
|
789
836
|
}
|
|
790
|
-
interface
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
state: string;
|
|
794
|
-
partitionKey: string;
|
|
795
|
-
runState?: string;
|
|
796
|
-
payload?: TPayload | null;
|
|
797
|
-
leaseToken: Buffer;
|
|
798
|
-
fencingToken: number;
|
|
799
|
-
version: number;
|
|
800
|
-
parentFlowId?: string;
|
|
801
|
-
rootFlowId?: string;
|
|
802
|
-
correlationId?: string;
|
|
803
|
-
valueRefs?: Record<string, unknown>;
|
|
804
|
-
values?: Record<string, unknown>;
|
|
805
|
-
valueSizes?: Record<string, unknown>;
|
|
806
|
-
valueOmitted?: Record<string, unknown>;
|
|
807
|
-
valueMissing?: Record<string, unknown>;
|
|
808
|
-
attributes?: Record<string, unknown>;
|
|
809
|
-
stateMeta?: Record<string, unknown>;
|
|
810
|
-
indexedStateMeta?: string;
|
|
811
|
-
raw?: unknown;
|
|
837
|
+
interface ClaimHydrationItem {
|
|
838
|
+
readonly index: number;
|
|
839
|
+
readonly record: FlowRecord;
|
|
812
840
|
}
|
|
813
|
-
|
|
841
|
+
/** A legacy compact claim leased jobs successfully, but one or more fallback reads failed. */
|
|
814
842
|
interface AutoBatchOptions {
|
|
815
843
|
enabled?: boolean;
|
|
816
844
|
maxCommands?: number;
|
|
@@ -821,9 +849,13 @@ interface FerricStoreClientOptions {
|
|
|
821
849
|
autoBatch?: boolean | AutoBatchOptions;
|
|
822
850
|
codec?: Codec;
|
|
823
851
|
backpressure?: BackpressurePolicy;
|
|
852
|
+
/** Maximum items per Flow `*_MANY` server request. Must match `flow_max_batch_items`; defaults to 1,000. */
|
|
853
|
+
flowManyBatchLimit?: number;
|
|
854
|
+
/** Maximum concurrent FLOW.GET fallbacks for legacy compact full-claim responses. Defaults to 16. */
|
|
855
|
+
legacyClaimHydrationConcurrency?: number;
|
|
824
856
|
}
|
|
825
857
|
interface FerricStoreClientFromUrlOptions extends FerricStoreClientOptions {
|
|
826
|
-
nativeOptions?:
|
|
858
|
+
nativeOptions?: NativeClientOptions;
|
|
827
859
|
reconnect?: boolean | ReconnectOptions;
|
|
828
860
|
}
|
|
829
861
|
interface CreateOptions {
|
|
@@ -839,6 +871,10 @@ interface CreateOptions {
|
|
|
839
871
|
priority?: number;
|
|
840
872
|
idempotent?: boolean;
|
|
841
873
|
retentionTtlMs?: number;
|
|
874
|
+
/** Maximum active lifetime from creation, or "infinity" to disable a type policy timeout. */
|
|
875
|
+
maxActiveMs?: MaxActiveMs;
|
|
876
|
+
/** Attribute values stored on the Flow and available to configured attribute indexes. */
|
|
877
|
+
attributes?: Record<string, CommandArgument>;
|
|
842
878
|
values?: Record<string, unknown>;
|
|
843
879
|
valueRefs?: Record<string, string>;
|
|
844
880
|
stateMeta?: StateMeta;
|
|
@@ -847,6 +883,28 @@ interface CreateOptions {
|
|
|
847
883
|
interface CreateManyOptions extends Omit<CreateOptions, "payload" | "partitionKey" | "returnRecord"> {
|
|
848
884
|
partitionKey?: string;
|
|
849
885
|
independent?: boolean;
|
|
886
|
+
/** Maximum auto-partition batches sent concurrently. Defaults to 8. */
|
|
887
|
+
autoPartitionConcurrency?: number;
|
|
888
|
+
/** Maximum items per auto-partition request, capped by the client's `flowManyBatchLimit`. */
|
|
889
|
+
autoPartitionBatchSize?: number;
|
|
890
|
+
}
|
|
891
|
+
interface StartAndClaimOptions {
|
|
892
|
+
type: string;
|
|
893
|
+
initialState: string;
|
|
894
|
+
worker: string;
|
|
895
|
+
leaseMs?: number;
|
|
896
|
+
payload?: unknown;
|
|
897
|
+
partitionKey?: string;
|
|
898
|
+
parentFlowId?: string;
|
|
899
|
+
rootFlowId?: string;
|
|
900
|
+
correlationId?: string;
|
|
901
|
+
nowMs?: number;
|
|
902
|
+
priority?: number;
|
|
903
|
+
retentionTtlMs?: number;
|
|
904
|
+
attributes?: Record<string, CommandArgument>;
|
|
905
|
+
stateMeta?: StateMeta;
|
|
906
|
+
values?: Record<string, unknown>;
|
|
907
|
+
valueRefs?: Record<string, string>;
|
|
850
908
|
}
|
|
851
909
|
interface ClaimDueOptions {
|
|
852
910
|
state?: string;
|
|
@@ -864,9 +922,38 @@ interface ClaimDueOptions {
|
|
|
864
922
|
jobOnly?: boolean;
|
|
865
923
|
payload?: boolean;
|
|
866
924
|
payloadMaxBytes?: number;
|
|
867
|
-
values?: string[];
|
|
925
|
+
values?: readonly string[];
|
|
868
926
|
valueMaxBytes?: number;
|
|
869
927
|
includeState?: boolean;
|
|
928
|
+
/** Include Flow attributes in compact job-only claims. Defaults to false to minimize wire size. */
|
|
929
|
+
includeAttributes?: boolean;
|
|
930
|
+
}
|
|
931
|
+
interface CompleteManyOptions {
|
|
932
|
+
result?: unknown;
|
|
933
|
+
payload?: unknown;
|
|
934
|
+
values?: Record<string, unknown>;
|
|
935
|
+
valueRefs?: Record<string, string>;
|
|
936
|
+
dropValues?: string[];
|
|
937
|
+
overrideValues?: string[];
|
|
938
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
939
|
+
attributesDelete?: string[];
|
|
940
|
+
stateMeta?: StateMeta;
|
|
941
|
+
ttlMs?: number;
|
|
942
|
+
nowMs?: number;
|
|
943
|
+
independent?: boolean;
|
|
944
|
+
returnOkOnSuccess?: boolean;
|
|
945
|
+
}
|
|
946
|
+
interface CompleteJobsAndClaimJobsResult {
|
|
947
|
+
/** Raw FLOW.COMPLETE_MANY result, retained even when an item failed. */
|
|
948
|
+
readonly completion: unknown;
|
|
949
|
+
/** Any replacement leases returned by the claim half of the operation. */
|
|
950
|
+
readonly claimed: (FlowRecord | ClaimedItem)[];
|
|
951
|
+
/** Completion validation failure; replacement leases must still be handled. */
|
|
952
|
+
readonly completionError?: Error;
|
|
953
|
+
/** Claim command failure after the completion command was submitted. */
|
|
954
|
+
readonly claimError?: Error;
|
|
955
|
+
/** True when both commands shared one ordered transport pipeline. */
|
|
956
|
+
readonly fused: boolean;
|
|
870
957
|
}
|
|
871
958
|
interface ReclaimOptions extends Omit<ClaimDueOptions, "state" | "states" | "blockMs" | "reclaimExpired" | "reclaimRatio" | "includeState"> {
|
|
872
959
|
state?: "running";
|
|
@@ -883,6 +970,10 @@ interface FlowPolicyOptions {
|
|
|
883
970
|
retry?: RetryPolicy;
|
|
884
971
|
states?: Record<string, FlowStatePolicyLike>;
|
|
885
972
|
retentionTtlMs?: number;
|
|
973
|
+
/** Type-level maximum active lifetime for newly created Flows. */
|
|
974
|
+
maxActiveMs?: MaxActiveMs;
|
|
975
|
+
/** Type-level attribute names projected for FLOW.SEARCH. An empty array clears the index list. */
|
|
976
|
+
indexedAttributes?: readonly string[];
|
|
886
977
|
indexedStateMeta?: string;
|
|
887
978
|
}
|
|
888
979
|
interface RequestContext {
|
|
@@ -904,13 +995,23 @@ interface MutateOptions {
|
|
|
904
995
|
valueRefs?: Record<string, string>;
|
|
905
996
|
dropValues?: string[];
|
|
906
997
|
overrideValues?: string[];
|
|
998
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
999
|
+
attributesDelete?: string[];
|
|
907
1000
|
stateMeta?: StateMeta;
|
|
908
1001
|
nowMs?: number;
|
|
909
1002
|
returnRecord?: boolean;
|
|
910
1003
|
}
|
|
911
1004
|
interface LeaseMutationOptions extends MutateOptions {
|
|
912
1005
|
leaseToken: Buffer;
|
|
913
|
-
fencingToken:
|
|
1006
|
+
fencingToken: FencingToken;
|
|
1007
|
+
}
|
|
1008
|
+
interface ExtendLeaseOptions {
|
|
1009
|
+
leaseToken: Buffer;
|
|
1010
|
+
fencingToken: FencingToken;
|
|
1011
|
+
leaseMs: number;
|
|
1012
|
+
partitionKey?: string;
|
|
1013
|
+
nowMs?: number;
|
|
1014
|
+
returnOkOnSuccess?: boolean;
|
|
914
1015
|
}
|
|
915
1016
|
interface TransitionOptions extends LeaseMutationOptions {
|
|
916
1017
|
fromState: string;
|
|
@@ -918,6 +1019,31 @@ interface TransitionOptions extends LeaseMutationOptions {
|
|
|
918
1019
|
runAtMs?: number;
|
|
919
1020
|
priority?: number;
|
|
920
1021
|
}
|
|
1022
|
+
interface StepContinueOptions extends Omit<LeaseMutationOptions, "returnRecord"> {
|
|
1023
|
+
fromState: string;
|
|
1024
|
+
toState: string;
|
|
1025
|
+
leaseMs?: number;
|
|
1026
|
+
worker?: string;
|
|
1027
|
+
returnJob?: boolean;
|
|
1028
|
+
/** Flow type to retain when returnJob requests a compact response. */
|
|
1029
|
+
type?: string;
|
|
1030
|
+
}
|
|
1031
|
+
interface RunStepsItem {
|
|
1032
|
+
id: string;
|
|
1033
|
+
partitionKey?: string;
|
|
1034
|
+
}
|
|
1035
|
+
interface RunStepsManyOptions {
|
|
1036
|
+
type: string;
|
|
1037
|
+
states?: readonly string[];
|
|
1038
|
+
steps?: number;
|
|
1039
|
+
worker: string;
|
|
1040
|
+
leaseMs?: number;
|
|
1041
|
+
nowMs?: number;
|
|
1042
|
+
payload?: unknown;
|
|
1043
|
+
result?: unknown;
|
|
1044
|
+
partitionKey?: string;
|
|
1045
|
+
retentionTtlMs?: number;
|
|
1046
|
+
}
|
|
921
1047
|
interface CompleteOptions extends LeaseMutationOptions {
|
|
922
1048
|
result?: unknown;
|
|
923
1049
|
ttlMs?: number;
|
|
@@ -930,37 +1056,615 @@ interface FailOptions extends LeaseMutationOptions {
|
|
|
930
1056
|
error?: unknown;
|
|
931
1057
|
ttlMs?: number;
|
|
932
1058
|
}
|
|
933
|
-
interface CancelOptions {
|
|
934
|
-
fencingToken:
|
|
935
|
-
leaseToken?: Buffer;
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
1059
|
+
interface CancelOptions extends Omit<MutateOptions, "payload"> {
|
|
1060
|
+
fencingToken: FencingToken;
|
|
1061
|
+
leaseToken?: Buffer;
|
|
1062
|
+
reason?: unknown;
|
|
1063
|
+
ttlMs?: number;
|
|
1064
|
+
}
|
|
1065
|
+
interface ReadOptions {
|
|
1066
|
+
partitionKey?: string;
|
|
1067
|
+
count?: number;
|
|
1068
|
+
fromMs?: number;
|
|
1069
|
+
toMs?: number;
|
|
1070
|
+
rev?: boolean;
|
|
1071
|
+
state?: string;
|
|
1072
|
+
terminalOnly?: boolean;
|
|
1073
|
+
includeCold?: boolean;
|
|
1074
|
+
consistentProjection?: boolean;
|
|
1075
|
+
}
|
|
1076
|
+
interface HistoryOptions {
|
|
1077
|
+
partitionKey?: string;
|
|
1078
|
+
count?: number;
|
|
1079
|
+
fromEvent?: string;
|
|
1080
|
+
toEvent?: string;
|
|
1081
|
+
fromMs?: number;
|
|
1082
|
+
toMs?: number;
|
|
1083
|
+
fromVersion?: number;
|
|
1084
|
+
toVersion?: number;
|
|
1085
|
+
rev?: boolean;
|
|
1086
|
+
event?: string;
|
|
1087
|
+
worker?: string;
|
|
1088
|
+
includeCold?: boolean;
|
|
1089
|
+
consistentProjection?: boolean;
|
|
1090
|
+
values?: boolean;
|
|
1091
|
+
payloadMaxBytes?: number;
|
|
1092
|
+
}
|
|
1093
|
+
type SearchStateMeta = StateMeta | Record<string, StateMeta>;
|
|
1094
|
+
interface SearchOptions extends ReadOptions {
|
|
1095
|
+
attributes?: Record<string, CommandArgument>;
|
|
1096
|
+
stateMeta?: SearchStateMeta;
|
|
1097
|
+
}
|
|
1098
|
+
type ManagementPairs = Record<string, CommandArgument>;
|
|
1099
|
+
|
|
1100
|
+
declare class ClaimHydrationError extends FerricStoreError {
|
|
1101
|
+
readonly code = "flow_claim_hydration_partial";
|
|
1102
|
+
readonly claimed: readonly ClaimedItem[];
|
|
1103
|
+
readonly failedIndex: number;
|
|
1104
|
+
readonly hydratedItems: readonly ClaimHydrationItem[];
|
|
1105
|
+
constructor(cause: unknown, claimed: readonly ClaimedItem[], hydratedItems: readonly ClaimHydrationItem[], failedIndex: number);
|
|
1106
|
+
}
|
|
1107
|
+
/** A chunked independent Flow operation failed after zero or more item results were confirmed. */
|
|
1108
|
+
declare class FlowBatchError extends FerricStoreError {
|
|
1109
|
+
readonly code = "flow_batch_partial";
|
|
1110
|
+
readonly completed: number;
|
|
1111
|
+
readonly completedItems: readonly FlowBatchCompletedItem[];
|
|
1112
|
+
readonly operation: string;
|
|
1113
|
+
constructor(operation: string, cause: unknown, completedItems: readonly FlowBatchCompletedItem[]);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
declare class FerricStoreClientBase {
|
|
1117
|
+
readonly executor: CommandExecutor;
|
|
1118
|
+
readonly codec: Codec;
|
|
1119
|
+
readonly backpressure: Required<BackpressurePolicy>;
|
|
1120
|
+
readonly flowManyBatchLimit: number;
|
|
1121
|
+
readonly legacyClaimHydrationConcurrency: number;
|
|
1122
|
+
private readonly closeAbortController;
|
|
1123
|
+
private closePromise?;
|
|
1124
|
+
constructor(executor: CommandExecutor, options?: FerricStoreClientOptions);
|
|
1125
|
+
command(...args: CommandArgument[]): Promise<unknown>;
|
|
1126
|
+
/** Execute an already-built command without a JavaScript variadic-call limit. */
|
|
1127
|
+
commandArgs(args: readonly CommandArgument[]): Promise<unknown>;
|
|
1128
|
+
pipeline(commands: readonly Command[], options?: ExecutePipelineOptions): Promise<unknown[]>;
|
|
1129
|
+
close(): Promise<void>;
|
|
1130
|
+
protected get closeSignal(): AbortSignal;
|
|
1131
|
+
refreshTopology(): Promise<RoutingTopology>;
|
|
1132
|
+
route(key: string | Buffer$1): Promise<RoutingRoute>;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
/** Cluster, FerricStore administration, telemetry, and invocation commands. */
|
|
1136
|
+
declare class FerricStoreAdministrationClient extends FerricStoreClientBase {
|
|
1137
|
+
clusterHealth(): Promise<Record<string, unknown>>;
|
|
1138
|
+
clusterStats(): Promise<Record<string, unknown>>;
|
|
1139
|
+
clusterKeyslot(key: string): Promise<number>;
|
|
1140
|
+
clusterSlots(): Promise<unknown>;
|
|
1141
|
+
clusterStatus(): Promise<Record<string, unknown>>;
|
|
1142
|
+
clusterRole(): Promise<unknown>;
|
|
1143
|
+
clusterJoin(node: string, options?: {
|
|
1144
|
+
replace?: boolean;
|
|
1145
|
+
}): Promise<boolean>;
|
|
1146
|
+
clusterLeave(): Promise<boolean>;
|
|
1147
|
+
clusterFailover(shardIndex: number, targetNode: string): Promise<boolean>;
|
|
1148
|
+
clusterPromote(node: string): Promise<boolean>;
|
|
1149
|
+
clusterDemote(node: string): Promise<boolean>;
|
|
1150
|
+
ferricstoreConfig(...args: CommandArgument[]): Promise<unknown>;
|
|
1151
|
+
ferricstoreHotness(...args: CommandArgument[]): Promise<Record<string, unknown>>;
|
|
1152
|
+
ferricstoreMetrics(...args: CommandArgument[]): Promise<string>;
|
|
1153
|
+
ferricstoreBlobgc(...args: CommandArgument[]): Promise<unknown>;
|
|
1154
|
+
ferricstoreDoctor(...args: CommandArgument[]): Promise<unknown>;
|
|
1155
|
+
capabilities(): Promise<Record<string, unknown>>;
|
|
1156
|
+
ensureNamespace(prefix: string, attrs?: ManagementPairs): Promise<unknown>;
|
|
1157
|
+
getNamespace(prefix: string): Promise<unknown>;
|
|
1158
|
+
listNamespaces(): Promise<unknown>;
|
|
1159
|
+
deleteNamespace(prefix: string): Promise<unknown>;
|
|
1160
|
+
setQuota(namespace: string, quotaSpec?: ManagementPairs): Promise<unknown>;
|
|
1161
|
+
getQuota(namespace: string): Promise<unknown>;
|
|
1162
|
+
quotaUsage(namespace: string): Promise<unknown>;
|
|
1163
|
+
clusterInfo(): Promise<Record<string, unknown>>;
|
|
1164
|
+
namespaceUsage(prefix: string): Promise<Record<string, unknown>>;
|
|
1165
|
+
flowQuery(attrs?: ManagementPairs): Promise<unknown[]>;
|
|
1166
|
+
flowHistory(id: string, attrs?: ManagementPairs): Promise<unknown[]>;
|
|
1167
|
+
invocationDefinitionPut(definition: Record<string, unknown> | string, options?: RequestContextOptions): Promise<unknown>;
|
|
1168
|
+
invocationDefinitionGet(name: string, options?: RequestContextOptions): Promise<unknown>;
|
|
1169
|
+
invocationDefinitionList(options?: RequestContextOptions): Promise<unknown[]>;
|
|
1170
|
+
invocationCreate(name: string, attrs: Record<string, unknown>, options?: InvocationCreateOptions): Promise<unknown>;
|
|
1171
|
+
invocationGet(id: string, options?: RequestContextOptions): Promise<unknown>;
|
|
1172
|
+
invocationPartitionList(name: string, options?: RequestContextOptions & {
|
|
1173
|
+
scope?: string;
|
|
1174
|
+
}): Promise<unknown[]>;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
declare class KeyValueStore {
|
|
1178
|
+
private readonly client;
|
|
1179
|
+
constructor(client: StoreCommandClient);
|
|
1180
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
1181
|
+
set(key: string, value: unknown, options?: SetOptions): Promise<unknown>;
|
|
1182
|
+
del(keys: readonly string[]): Promise<number>;
|
|
1183
|
+
del(key: string, ...keys: string[]): Promise<number>;
|
|
1184
|
+
exists(keys: readonly string[]): Promise<number>;
|
|
1185
|
+
exists(key: string, ...keys: string[]): Promise<number>;
|
|
1186
|
+
mget<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
1187
|
+
mset(entries: Record<string, unknown> | [string, unknown][]): Promise<boolean>;
|
|
1188
|
+
msetnx(entries: Record<string, unknown> | [string, unknown][]): Promise<boolean>;
|
|
1189
|
+
incr(key: string): Promise<IntegerReply>;
|
|
1190
|
+
decr(key: string): Promise<IntegerReply>;
|
|
1191
|
+
incrby(key: string, increment: number | bigint): Promise<IntegerReply>;
|
|
1192
|
+
decrby(key: string, decrement: number | bigint): Promise<IntegerReply>;
|
|
1193
|
+
incrbyfloat(key: string, increment: number): Promise<string>;
|
|
1194
|
+
append(key: string, value: unknown): Promise<number>;
|
|
1195
|
+
strlen(key: string): Promise<number>;
|
|
1196
|
+
getset<T = unknown>(key: string, value: unknown): Promise<T | null>;
|
|
1197
|
+
getdel<T = unknown>(key: string): Promise<T | null>;
|
|
1198
|
+
getex<T = unknown>(key: string, options?: GetExOptions): Promise<T | null>;
|
|
1199
|
+
setnx(key: string, value: unknown): Promise<boolean>;
|
|
1200
|
+
setex(key: string, seconds: number, value: unknown): Promise<boolean>;
|
|
1201
|
+
psetex(key: string, milliseconds: number, value: unknown): Promise<boolean>;
|
|
1202
|
+
getrange(key: string, start: number, end: number): Promise<Buffer | string | unknown>;
|
|
1203
|
+
setrange(key: string, offset: number, value: unknown): Promise<number>;
|
|
1204
|
+
expire(key: string, seconds: number, condition?: ExpiryCondition): Promise<boolean>;
|
|
1205
|
+
pexpire(key: string, milliseconds: number, condition?: ExpiryCondition): Promise<boolean>;
|
|
1206
|
+
expireat(key: string, unixSeconds: number, condition?: ExpiryCondition): Promise<boolean>;
|
|
1207
|
+
pexpireat(key: string, unixMilliseconds: number, condition?: ExpiryCondition): Promise<boolean>;
|
|
1208
|
+
ttl(key: string): Promise<IntegerReply>;
|
|
1209
|
+
pttl(key: string): Promise<IntegerReply>;
|
|
1210
|
+
persist(key: string): Promise<boolean>;
|
|
1211
|
+
expiretime(key: string): Promise<IntegerReply>;
|
|
1212
|
+
pexpiretime(key: string): Promise<IntegerReply>;
|
|
1213
|
+
type(key: string): Promise<string>;
|
|
1214
|
+
unlink(keys: readonly string[]): Promise<number>;
|
|
1215
|
+
unlink(key: string, ...keys: string[]): Promise<number>;
|
|
1216
|
+
rename(key: string, newKey: string): Promise<boolean>;
|
|
1217
|
+
renamenx(key: string, newKey: string): Promise<boolean>;
|
|
1218
|
+
copy(source: string, destination: string, options?: {
|
|
1219
|
+
replace?: boolean;
|
|
1220
|
+
}): Promise<boolean>;
|
|
1221
|
+
randomkey(): Promise<string | null>;
|
|
1222
|
+
keys(pattern: string): Promise<string[]>;
|
|
1223
|
+
scan(cursor: string | number, options?: ScanOptions): Promise<[string, string[]]>;
|
|
1224
|
+
dbsize(): Promise<number>;
|
|
1225
|
+
flushdb(mode?: "ASYNC" | "SYNC"): Promise<boolean>;
|
|
1226
|
+
flushall(mode?: "ASYNC" | "SYNC"): Promise<boolean>;
|
|
1227
|
+
objectEncoding(key: string): Promise<string | null>;
|
|
1228
|
+
objectHelp(): Promise<unknown[]>;
|
|
1229
|
+
objectFreq(key: string): Promise<number>;
|
|
1230
|
+
objectIdleTime(key: string): Promise<number>;
|
|
1231
|
+
objectRefcount(key: string): Promise<number>;
|
|
1232
|
+
wait(numReplicas: number, timeoutMs: number): Promise<number>;
|
|
1233
|
+
waitAof(numLocal: number, numReplicas: number, timeoutMs: number): Promise<[IntegerReply, IntegerReply]>;
|
|
1234
|
+
memoryUsage(key: string): Promise<number | null>;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
declare class GeoStore {
|
|
1238
|
+
private readonly client;
|
|
1239
|
+
constructor(client: StoreCommandClient);
|
|
1240
|
+
geoadd(key: string, members: GeoMember[], options?: GeoAddOptions): Promise<number>;
|
|
1241
|
+
geopos(key: string, member: unknown, ...members: unknown[]): Promise<([string, string] | null)[]>;
|
|
1242
|
+
geoposMany(key: string, members: readonly unknown[]): Promise<([string, string] | null)[]>;
|
|
1243
|
+
geodist(key: string, member1: unknown, member2: unknown, unit?: "m" | "km" | "mi" | "ft"): Promise<string | null>;
|
|
1244
|
+
geohash(key: string, member: unknown, ...members: unknown[]): Promise<(string | null)[]>;
|
|
1245
|
+
geohashMany(key: string, members: readonly unknown[]): Promise<(string | null)[]>;
|
|
1246
|
+
geosearch(key: string, args: CommandArgument[]): Promise<unknown[]>;
|
|
1247
|
+
geosearchstore(destination: string, source: string, args: CommandArgument[]): Promise<number>;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
declare class ListStore {
|
|
1251
|
+
private readonly client;
|
|
1252
|
+
constructor(client: StoreCommandClient);
|
|
1253
|
+
lpush(key: string, element: unknown, ...elements: unknown[]): Promise<number>;
|
|
1254
|
+
lpushMany(key: string, elements: readonly unknown[]): Promise<number>;
|
|
1255
|
+
rpush(key: string, element: unknown, ...elements: unknown[]): Promise<number>;
|
|
1256
|
+
rpushMany(key: string, elements: readonly unknown[]): Promise<number>;
|
|
1257
|
+
lpop<T = unknown>(key: string, count?: number): Promise<T | (T | null)[] | null>;
|
|
1258
|
+
rpop<T = unknown>(key: string, count?: number): Promise<T | (T | null)[] | null>;
|
|
1259
|
+
lrange<T = unknown>(key: string, start: number, stop: number): Promise<(T | null)[]>;
|
|
1260
|
+
llen(key: string): Promise<number>;
|
|
1261
|
+
lindex<T = unknown>(key: string, index: number): Promise<T | null>;
|
|
1262
|
+
lset(key: string, index: number, element: unknown): Promise<boolean>;
|
|
1263
|
+
lrem(key: string, count: number, element: unknown): Promise<number>;
|
|
1264
|
+
ltrim(key: string, start: number, stop: number): Promise<boolean>;
|
|
1265
|
+
lpos(key: string, element: unknown, options?: {
|
|
1266
|
+
rank?: number;
|
|
1267
|
+
count?: number;
|
|
1268
|
+
maxlen?: number;
|
|
1269
|
+
}): Promise<number | number[] | null>;
|
|
1270
|
+
linsert(key: string, where: "BEFORE" | "AFTER", pivot: unknown, element: unknown): Promise<number>;
|
|
1271
|
+
lmove<T = unknown>(source: string, destination: string, from: "LEFT" | "RIGHT", to: "LEFT" | "RIGHT"): Promise<T | null>;
|
|
1272
|
+
rpoplpush<T = unknown>(source: string, destination: string): Promise<T | null>;
|
|
1273
|
+
lpushx(key: string, element: unknown, ...elements: unknown[]): Promise<number>;
|
|
1274
|
+
lpushxMany(key: string, elements: readonly unknown[]): Promise<number>;
|
|
1275
|
+
rpushx(key: string, element: unknown, ...elements: unknown[]): Promise<number>;
|
|
1276
|
+
rpushxMany(key: string, elements: readonly unknown[]): Promise<number>;
|
|
1277
|
+
blpop(keys: string[], timeoutSeconds: number): Promise<unknown>;
|
|
1278
|
+
brpop(keys: string[], timeoutSeconds: number): Promise<unknown>;
|
|
1279
|
+
blmove<T = unknown>(source: string, destination: string, from: "LEFT" | "RIGHT", to: "LEFT" | "RIGHT", timeoutSeconds: number): Promise<T | null>;
|
|
1280
|
+
blmpop(timeoutSeconds: number, keys: string[], from: "LEFT" | "RIGHT", options?: {
|
|
1281
|
+
count?: number;
|
|
1282
|
+
}): Promise<unknown>;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
declare class SortedSetStore {
|
|
1286
|
+
private readonly client;
|
|
1287
|
+
constructor(client: StoreCommandClient);
|
|
1288
|
+
zadd(key: string, members: ZAddMember[], options?: ZAddOptions): Promise<number>;
|
|
1289
|
+
zscore(key: string, member: unknown): Promise<string | null>;
|
|
1290
|
+
zrank(key: string, member: unknown): Promise<number | null>;
|
|
1291
|
+
zrevrank(key: string, member: unknown): Promise<number | null>;
|
|
1292
|
+
zrange(key: string, start: number, stop: number, options?: {
|
|
1293
|
+
withScores?: boolean;
|
|
1294
|
+
}): Promise<unknown[]>;
|
|
1295
|
+
zrevrange(key: string, start: number, stop: number, options?: {
|
|
1296
|
+
withScores?: boolean;
|
|
1297
|
+
}): Promise<unknown[]>;
|
|
1298
|
+
zcard(key: string): Promise<number>;
|
|
1299
|
+
zrem(key: string, member: unknown, ...members: unknown[]): Promise<number>;
|
|
1300
|
+
zremMany(key: string, members: readonly unknown[]): Promise<number>;
|
|
1301
|
+
zincrby(key: string, increment: number, member: unknown): Promise<string>;
|
|
1302
|
+
zcount(key: string, min: string | number, max: string | number): Promise<number>;
|
|
1303
|
+
zpopmin(key: string, count?: number): Promise<unknown[]>;
|
|
1304
|
+
zpopmax(key: string, count?: number): Promise<unknown[]>;
|
|
1305
|
+
zrandmember<T = unknown>(key: string): Promise<T | null>;
|
|
1306
|
+
zrandmember<T = unknown>(key: string, count: number, withScores?: false): Promise<(T | null)[]>;
|
|
1307
|
+
zrandmember(key: string, count: number, withScores: boolean): Promise<unknown[]>;
|
|
1308
|
+
zmscore(key: string, members: unknown[]): Promise<(string | null)[]>;
|
|
1309
|
+
zrangebyscore(key: string, min: string | number, max: string | number, options?: {
|
|
1310
|
+
withScores?: boolean;
|
|
1311
|
+
limit?: RangeLimit;
|
|
1312
|
+
}): Promise<unknown[]>;
|
|
1313
|
+
zrevrangebyscore(key: string, max: string | number, min: string | number, options?: {
|
|
1314
|
+
withScores?: boolean;
|
|
1315
|
+
limit?: RangeLimit;
|
|
1316
|
+
}): Promise<unknown[]>;
|
|
1317
|
+
zscan<T = unknown>(key: string, cursor: string | number, options?: CollectionScanOptions): Promise<SortedSetScanResult<T>>;
|
|
1318
|
+
}
|
|
1319
|
+
declare class StreamStore {
|
|
1320
|
+
private readonly client;
|
|
1321
|
+
constructor(client: StoreCommandClient);
|
|
1322
|
+
xadd(key: string, id: string, fields: Record<string, unknown> | [string, unknown][]): Promise<unknown>;
|
|
1323
|
+
xlen(key: string): Promise<number>;
|
|
1324
|
+
xrange(key: string, start?: string, end?: string, count?: number): Promise<unknown[]>;
|
|
1325
|
+
xrevrange(key: string, end?: string, start?: string, count?: number): Promise<unknown[]>;
|
|
1326
|
+
xread(streams: XReadStream[], options?: {
|
|
1327
|
+
count?: number;
|
|
1328
|
+
blockMs?: number;
|
|
1329
|
+
}): Promise<unknown>;
|
|
1330
|
+
xtrim(key: string, strategy: "MAXLEN" | "MINID", threshold: string | number, approximate?: boolean): Promise<number>;
|
|
1331
|
+
xdel(key: string, ids: readonly string[]): Promise<number>;
|
|
1332
|
+
xdel(key: string, id: string, ...ids: string[]): Promise<number>;
|
|
1333
|
+
xinfoStream(key: string): Promise<unknown>;
|
|
1334
|
+
xgroupCreate(key: string, group: string, id: string, mkstream?: boolean): Promise<boolean>;
|
|
1335
|
+
xreadgroup(group: string, consumer: string, streams: XReadStream[], options?: {
|
|
1336
|
+
count?: number;
|
|
1337
|
+
blockMs?: number;
|
|
1338
|
+
noack?: boolean;
|
|
1339
|
+
}): Promise<unknown>;
|
|
1340
|
+
xack(key: string, group: string, ids: readonly string[]): Promise<number>;
|
|
1341
|
+
xack(key: string, group: string, id: string, ...ids: string[]): Promise<number>;
|
|
1342
|
+
}
|
|
1343
|
+
declare class BitmapStore {
|
|
1344
|
+
private readonly client;
|
|
1345
|
+
constructor(client: StoreCommandClient);
|
|
1346
|
+
setbit(key: string, offset: number, value: 0 | 1): Promise<number>;
|
|
1347
|
+
getbit(key: string, offset: number): Promise<number>;
|
|
1348
|
+
bitcount(key: string): Promise<number>;
|
|
1349
|
+
bitcount(key: string, start: number, end: number, unit?: "BYTE" | "BIT"): Promise<number>;
|
|
1350
|
+
bitpos(key: string, bit: 0 | 1): Promise<number>;
|
|
1351
|
+
bitpos(key: string, bit: 0 | 1, start: number): Promise<number>;
|
|
1352
|
+
bitpos(key: string, bit: 0 | 1, start: number, end: number, unit?: "BYTE" | "BIT"): Promise<number>;
|
|
1353
|
+
bitop(operation: "AND" | "OR" | "XOR" | "NOT", destination: string, keys: readonly string[]): Promise<number>;
|
|
1354
|
+
bitop(operation: "AND" | "OR" | "XOR" | "NOT", destination: string, ...keys: string[]): Promise<number>;
|
|
1355
|
+
}
|
|
1356
|
+
declare class HyperLogLogStore {
|
|
1357
|
+
private readonly client;
|
|
1358
|
+
constructor(client: StoreCommandClient);
|
|
1359
|
+
pfadd(key: string, ...elements: unknown[]): Promise<number>;
|
|
1360
|
+
pfaddMany(key: string, elements: readonly unknown[]): Promise<number>;
|
|
1361
|
+
pfcount(keys: readonly string[]): Promise<IntegerReply>;
|
|
1362
|
+
pfcount(key: string, ...keys: string[]): Promise<IntegerReply>;
|
|
1363
|
+
pfmerge(destination: string, sources: readonly string[]): Promise<boolean>;
|
|
1364
|
+
pfmerge(destination: string, source: string, ...sources: string[]): Promise<boolean>;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
declare class SetStore {
|
|
1368
|
+
private readonly client;
|
|
1369
|
+
constructor(client: StoreCommandClient);
|
|
1370
|
+
sadd(key: string, member: unknown, ...members: unknown[]): Promise<number>;
|
|
1371
|
+
saddMany(key: string, members: readonly unknown[]): Promise<number>;
|
|
1372
|
+
srem(key: string, member: unknown, ...members: unknown[]): Promise<number>;
|
|
1373
|
+
sremMany(key: string, members: readonly unknown[]): Promise<number>;
|
|
1374
|
+
smembers<T = unknown>(key: string): Promise<(T | null)[]>;
|
|
1375
|
+
sismember(key: string, member: unknown): Promise<boolean>;
|
|
1376
|
+
smismember(key: string, members: unknown[]): Promise<number[]>;
|
|
1377
|
+
scard(key: string): Promise<number>;
|
|
1378
|
+
srandmember<T = unknown>(key: string, count?: number): Promise<T | (T | null)[] | null>;
|
|
1379
|
+
spop<T = unknown>(key: string, count?: number): Promise<T | (T | null)[] | null>;
|
|
1380
|
+
sdiff<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
1381
|
+
sinter<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
1382
|
+
sunion<T = unknown>(keys: string[]): Promise<(T | null)[]>;
|
|
1383
|
+
sdiffstore(destination: string, keys: string[]): Promise<number>;
|
|
1384
|
+
sinterstore(destination: string, keys: string[]): Promise<number>;
|
|
1385
|
+
sunionstore(destination: string, keys: string[]): Promise<number>;
|
|
1386
|
+
sintercard(keys: string[], limit?: number): Promise<number>;
|
|
1387
|
+
smove(source: string, destination: string, member: unknown): Promise<boolean>;
|
|
1388
|
+
sscan<T = unknown>(key: string, cursor: string | number, options?: CollectionScanOptions): Promise<SetScanResult<T>>;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
interface StoreCommandClient {
|
|
1392
|
+
readonly codec: Codec;
|
|
1393
|
+
command(...args: CommandArgument[]): Promise<unknown>;
|
|
1394
|
+
commandArgs?(args: readonly CommandArgument[]): Promise<unknown>;
|
|
1395
|
+
}
|
|
1396
|
+
/** An exact integer reply: safe values are numbers and larger int64 values are bigints. */
|
|
1397
|
+
type IntegerReply = number | bigint;
|
|
1398
|
+
/** Flat field/value pairs returned with a scan cursor. */
|
|
1399
|
+
type HashScanResult<T = unknown> = [cursor: string, entries: (string | T | null)[]];
|
|
1400
|
+
/** Decoded set members returned with a scan cursor. */
|
|
1401
|
+
type SetScanResult<T = unknown> = [cursor: string, members: (T | null)[]];
|
|
1402
|
+
/** Flat member/score pairs returned with a scan cursor. */
|
|
1403
|
+
type SortedSetScanResult<T = unknown> = [cursor: string, entries: (T | null | string)[]];
|
|
1404
|
+
/** SET accepts one condition and at most one expiry mode. */
|
|
1405
|
+
type SetOptions = {
|
|
1406
|
+
get?: boolean;
|
|
1407
|
+
} & ({
|
|
1408
|
+
nx?: boolean;
|
|
1409
|
+
xx?: false;
|
|
1410
|
+
} | {
|
|
1411
|
+
nx?: false;
|
|
1412
|
+
xx?: boolean;
|
|
1413
|
+
}) & ({
|
|
1414
|
+
ex?: never;
|
|
1415
|
+
px?: never;
|
|
1416
|
+
exat?: never;
|
|
1417
|
+
pxat?: never;
|
|
1418
|
+
keepTtl?: boolean;
|
|
1419
|
+
} | {
|
|
1420
|
+
ex?: number;
|
|
1421
|
+
px?: never;
|
|
1422
|
+
exat?: never;
|
|
1423
|
+
pxat?: never;
|
|
1424
|
+
keepTtl?: false;
|
|
1425
|
+
} | {
|
|
1426
|
+
ex?: never;
|
|
1427
|
+
px?: number;
|
|
1428
|
+
exat?: never;
|
|
1429
|
+
pxat?: never;
|
|
1430
|
+
keepTtl?: false;
|
|
1431
|
+
} | {
|
|
1432
|
+
ex?: never;
|
|
1433
|
+
px?: never;
|
|
1434
|
+
exat?: number;
|
|
1435
|
+
pxat?: never;
|
|
1436
|
+
keepTtl?: false;
|
|
1437
|
+
} | {
|
|
1438
|
+
ex?: never;
|
|
1439
|
+
px?: never;
|
|
1440
|
+
exat?: never;
|
|
1441
|
+
pxat?: number;
|
|
1442
|
+
keepTtl?: false;
|
|
1443
|
+
});
|
|
1444
|
+
/** GETEX/HGETEX accept at most one expiry mutation. */
|
|
1445
|
+
type GetExOptions = {
|
|
1446
|
+
ex?: never;
|
|
1447
|
+
px?: never;
|
|
1448
|
+
exat?: never;
|
|
1449
|
+
pxat?: never;
|
|
1450
|
+
persist?: false;
|
|
1451
|
+
} | {
|
|
1452
|
+
ex: number;
|
|
1453
|
+
px?: never;
|
|
1454
|
+
exat?: never;
|
|
1455
|
+
pxat?: never;
|
|
1456
|
+
persist?: false;
|
|
1457
|
+
} | {
|
|
1458
|
+
ex?: never;
|
|
1459
|
+
px: number;
|
|
1460
|
+
exat?: never;
|
|
1461
|
+
pxat?: never;
|
|
1462
|
+
persist?: false;
|
|
1463
|
+
} | {
|
|
1464
|
+
ex?: never;
|
|
1465
|
+
px?: never;
|
|
1466
|
+
exat: number;
|
|
1467
|
+
pxat?: never;
|
|
1468
|
+
persist?: false;
|
|
1469
|
+
} | {
|
|
1470
|
+
ex?: never;
|
|
1471
|
+
px?: never;
|
|
1472
|
+
exat?: never;
|
|
1473
|
+
pxat: number;
|
|
1474
|
+
persist?: false;
|
|
1475
|
+
} | {
|
|
1476
|
+
ex?: never;
|
|
1477
|
+
px?: never;
|
|
1478
|
+
exat?: never;
|
|
1479
|
+
pxat?: never;
|
|
1480
|
+
persist: true;
|
|
1481
|
+
};
|
|
1482
|
+
interface ScanOptions {
|
|
1483
|
+
match?: string;
|
|
1484
|
+
count?: number;
|
|
1485
|
+
/** Filter keys by the server-reported data type. */
|
|
1486
|
+
type?: string;
|
|
1487
|
+
}
|
|
1488
|
+
/** MATCH/COUNT options supported by collection-specific scan commands. */
|
|
1489
|
+
type CollectionScanOptions = Omit<ScanOptions, "type">;
|
|
1490
|
+
type ExpiryCondition = "NX" | "XX" | "GT" | "LT";
|
|
1491
|
+
interface ZAddMember {
|
|
1492
|
+
score: number;
|
|
1493
|
+
member: unknown;
|
|
1494
|
+
}
|
|
1495
|
+
/** ZADD condition and comparison flags must form a valid server grammar. */
|
|
1496
|
+
type ZAddOptions = {
|
|
1497
|
+
ch?: boolean;
|
|
1498
|
+
} & ({
|
|
1499
|
+
nx?: boolean;
|
|
1500
|
+
xx?: false;
|
|
1501
|
+
gt?: false;
|
|
1502
|
+
lt?: false;
|
|
1503
|
+
} | ({
|
|
1504
|
+
nx?: false;
|
|
1505
|
+
xx?: boolean;
|
|
1506
|
+
} & ({
|
|
1507
|
+
gt?: boolean;
|
|
1508
|
+
lt?: false;
|
|
1509
|
+
} | {
|
|
1510
|
+
gt?: false;
|
|
1511
|
+
lt?: boolean;
|
|
1512
|
+
})));
|
|
1513
|
+
interface RangeLimit {
|
|
1514
|
+
offset: number;
|
|
1515
|
+
count: number;
|
|
1516
|
+
}
|
|
1517
|
+
interface XReadStream {
|
|
1518
|
+
key: string;
|
|
1519
|
+
id: string;
|
|
1520
|
+
}
|
|
1521
|
+
interface GeoMember {
|
|
1522
|
+
longitude: number;
|
|
1523
|
+
latitude: number;
|
|
1524
|
+
member: unknown;
|
|
1525
|
+
}
|
|
1526
|
+
/** GEOADD NX and XX are mutually exclusive. */
|
|
1527
|
+
type GeoAddOptions = {
|
|
1528
|
+
ch?: boolean;
|
|
1529
|
+
} & ({
|
|
1530
|
+
nx?: boolean;
|
|
1531
|
+
xx?: false;
|
|
1532
|
+
} | {
|
|
1533
|
+
nx?: false;
|
|
1534
|
+
xx?: boolean;
|
|
1535
|
+
});
|
|
1536
|
+
declare class HashStore {
|
|
1537
|
+
private readonly client;
|
|
1538
|
+
constructor(client: StoreCommandClient);
|
|
1539
|
+
hset(key: string, entries: Record<string, unknown> | [string, unknown][]): Promise<number>;
|
|
1540
|
+
hget<T = unknown>(key: string, field: string): Promise<T | null>;
|
|
1541
|
+
hdel(key: string, fields: readonly string[]): Promise<number>;
|
|
1542
|
+
hdel(key: string, field: string, ...fields: string[]): Promise<number>;
|
|
1543
|
+
hmget<T = unknown>(key: string, fields: string[]): Promise<(T | null)[]>;
|
|
1544
|
+
hgetall<T = unknown>(key: string): Promise<Record<string, T | null>>;
|
|
1545
|
+
hexists(key: string, field: string): Promise<boolean>;
|
|
1546
|
+
hkeys(key: string): Promise<string[]>;
|
|
1547
|
+
hvals<T = unknown>(key: string): Promise<(T | null)[]>;
|
|
1548
|
+
hlen(key: string): Promise<number>;
|
|
1549
|
+
hincrby(key: string, field: string, increment: number | bigint): Promise<IntegerReply>;
|
|
1550
|
+
hincrbyfloat(key: string, field: string, increment: number): Promise<string>;
|
|
1551
|
+
hsetnx(key: string, field: string, value: unknown): Promise<boolean>;
|
|
1552
|
+
hstrlen(key: string, field: string): Promise<number>;
|
|
1553
|
+
hrandfield(key: string): Promise<string | null>;
|
|
1554
|
+
hrandfield(key: string, count: number, withValues?: false): Promise<string[]>;
|
|
1555
|
+
hrandfield<T = unknown>(key: string, count: number, withValues: true): Promise<(string | T | null)[]>;
|
|
1556
|
+
hrandfield<T = unknown>(key: string, count: number, withValues: boolean): Promise<string[] | (string | T | null)[]>;
|
|
1557
|
+
hscan<T = unknown>(key: string, cursor: string | number, options?: CollectionScanOptions): Promise<HashScanResult<T>>;
|
|
1558
|
+
hexpire(key: string, seconds: number, fields: string[]): Promise<number[]>;
|
|
1559
|
+
httl(key: string, fields: string[]): Promise<IntegerReply[]>;
|
|
1560
|
+
hpersist(key: string, fields: string[]): Promise<number[]>;
|
|
1561
|
+
hpexpire(key: string, milliseconds: number, fields: string[]): Promise<number[]>;
|
|
1562
|
+
hpttl(key: string, fields: string[]): Promise<IntegerReply[]>;
|
|
1563
|
+
hexpiretime(key: string, fields: string[]): Promise<IntegerReply[]>;
|
|
1564
|
+
hgetdel<T = unknown>(key: string, fields: string[]): Promise<(T | null)[]>;
|
|
1565
|
+
hgetex<T = unknown>(key: string, fields: string[], options?: GetExOptions): Promise<(T | null)[]>;
|
|
1566
|
+
hsetex(key: string, seconds: number, entries: Record<string, unknown> | [string, unknown][]): Promise<number>;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
type TopKReserveOptions = {
|
|
1570
|
+
width?: never;
|
|
1571
|
+
depth?: never;
|
|
1572
|
+
decay?: never;
|
|
1573
|
+
} | {
|
|
1574
|
+
width: number;
|
|
1575
|
+
depth: number;
|
|
1576
|
+
decay: number;
|
|
1577
|
+
};
|
|
1578
|
+
interface CountMinMergeOptions {
|
|
1579
|
+
weights?: readonly (number | bigint)[];
|
|
1580
|
+
}
|
|
1581
|
+
interface TDigestCreateOptions {
|
|
1582
|
+
compression?: number;
|
|
1583
|
+
}
|
|
1584
|
+
interface TDigestMergeOptions extends TDigestCreateOptions {
|
|
1585
|
+
override?: boolean;
|
|
1586
|
+
}
|
|
1587
|
+
declare class BloomFilterStore {
|
|
1588
|
+
private readonly client;
|
|
1589
|
+
constructor(client: StoreCommandClient);
|
|
1590
|
+
reserve(key: string, errorRate: number, capacity: number): Promise<boolean>;
|
|
1591
|
+
add(key: string, element: unknown): Promise<boolean>;
|
|
1592
|
+
madd(key: string, element: unknown, ...elements: unknown[]): Promise<number[]>;
|
|
1593
|
+
maddMany(key: string, elements: readonly unknown[]): Promise<number[]>;
|
|
1594
|
+
exists(key: string, element: unknown): Promise<boolean>;
|
|
1595
|
+
mexists(key: string, element: unknown, ...elements: unknown[]): Promise<number[]>;
|
|
1596
|
+
mexistsMany(key: string, elements: readonly unknown[]): Promise<number[]>;
|
|
1597
|
+
card(key: string): Promise<IntegerReply>;
|
|
1598
|
+
info(key: string): Promise<unknown[]>;
|
|
1599
|
+
}
|
|
1600
|
+
declare class CuckooFilterStore {
|
|
1601
|
+
private readonly client;
|
|
1602
|
+
constructor(client: StoreCommandClient);
|
|
1603
|
+
reserve(key: string, capacity: number): Promise<boolean>;
|
|
1604
|
+
add(key: string, element: unknown): Promise<boolean>;
|
|
1605
|
+
addnx(key: string, element: unknown): Promise<boolean>;
|
|
1606
|
+
del(key: string, element: unknown): Promise<boolean>;
|
|
1607
|
+
exists(key: string, element: unknown): Promise<boolean>;
|
|
1608
|
+
mexists(key: string, element: unknown, ...elements: unknown[]): Promise<number[]>;
|
|
1609
|
+
mexistsMany(key: string, elements: readonly unknown[]): Promise<number[]>;
|
|
1610
|
+
count(key: string, element: unknown): Promise<IntegerReply>;
|
|
1611
|
+
info(key: string): Promise<unknown[]>;
|
|
942
1612
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1613
|
+
declare class CountMinSketchStore {
|
|
1614
|
+
private readonly client;
|
|
1615
|
+
constructor(client: StoreCommandClient);
|
|
1616
|
+
initByDim(key: string, width: number, depth: number): Promise<boolean>;
|
|
1617
|
+
initByProb(key: string, error: number, probability: number): Promise<boolean>;
|
|
1618
|
+
incrBy(key: string, entries: [unknown, number | bigint][]): Promise<IntegerReply[]>;
|
|
1619
|
+
query(key: string, item: unknown, ...items: unknown[]): Promise<IntegerReply[]>;
|
|
1620
|
+
queryMany(key: string, items: readonly unknown[]): Promise<IntegerReply[]>;
|
|
1621
|
+
merge(destination: string, sources: readonly string[], options?: CountMinMergeOptions): Promise<boolean>;
|
|
1622
|
+
info(key: string): Promise<unknown[]>;
|
|
953
1623
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1624
|
+
declare class TopKStore {
|
|
1625
|
+
private readonly client;
|
|
1626
|
+
constructor(client: StoreCommandClient);
|
|
1627
|
+
reserve(key: string, k: number, options?: TopKReserveOptions): Promise<boolean>;
|
|
1628
|
+
add<T = unknown>(key: string, element: unknown, ...elements: unknown[]): Promise<(T | null)[]>;
|
|
1629
|
+
addMany<T = unknown>(key: string, elements: readonly unknown[]): Promise<(T | null)[]>;
|
|
1630
|
+
incrBy<T = unknown>(key: string, entries: [unknown, number | bigint][]): Promise<(T | null)[]>;
|
|
1631
|
+
query(key: string, element: unknown, ...elements: unknown[]): Promise<number[]>;
|
|
1632
|
+
queryMany(key: string, elements: readonly unknown[]): Promise<number[]>;
|
|
1633
|
+
count(key: string, element: unknown, ...elements: unknown[]): Promise<IntegerReply[]>;
|
|
1634
|
+
countMany(key: string, elements: readonly unknown[]): Promise<IntegerReply[]>;
|
|
1635
|
+
list<T = unknown>(key: string, options?: {
|
|
1636
|
+
withCount?: boolean;
|
|
1637
|
+
}): Promise<(T | IntegerReply | null)[]>;
|
|
1638
|
+
info(key: string): Promise<unknown[]>;
|
|
958
1639
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
readonly
|
|
1640
|
+
declare class TDigestStore {
|
|
1641
|
+
private readonly client;
|
|
1642
|
+
constructor(client: StoreCommandClient);
|
|
1643
|
+
create(key: string, options?: TDigestCreateOptions): Promise<boolean>;
|
|
1644
|
+
add(key: string, values: readonly number[]): Promise<boolean>;
|
|
1645
|
+
add(key: string, value: number, ...values: number[]): Promise<boolean>;
|
|
1646
|
+
reset(key: string): Promise<boolean>;
|
|
1647
|
+
quantile(key: string, quantiles: readonly number[]): Promise<string[]>;
|
|
1648
|
+
quantile(key: string, quantile: number, ...quantiles: number[]): Promise<string[]>;
|
|
1649
|
+
cdf(key: string, values: readonly number[]): Promise<string[]>;
|
|
1650
|
+
cdf(key: string, value: number, ...values: number[]): Promise<string[]>;
|
|
1651
|
+
rank(key: string, values: readonly number[]): Promise<IntegerReply[]>;
|
|
1652
|
+
rank(key: string, value: number, ...values: number[]): Promise<IntegerReply[]>;
|
|
1653
|
+
revrank(key: string, values: readonly number[]): Promise<IntegerReply[]>;
|
|
1654
|
+
revrank(key: string, value: number, ...values: number[]): Promise<IntegerReply[]>;
|
|
1655
|
+
byrank(key: string, ranks: readonly number[]): Promise<string[]>;
|
|
1656
|
+
byrank(key: string, rank: number, ...ranks: number[]): Promise<string[]>;
|
|
1657
|
+
byrevrank(key: string, ranks: readonly number[]): Promise<string[]>;
|
|
1658
|
+
byrevrank(key: string, rank: number, ...ranks: number[]): Promise<string[]>;
|
|
1659
|
+
trimmedMean(key: string, low: number, high: number): Promise<string>;
|
|
1660
|
+
min(key: string): Promise<string>;
|
|
1661
|
+
max(key: string): Promise<string>;
|
|
1662
|
+
info(key: string): Promise<unknown[]>;
|
|
1663
|
+
merge(destination: string, sources: string[], options?: TDigestMergeOptions): Promise<boolean>;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
declare class FerricStoreClientCore extends FerricStoreAdministrationClient {
|
|
1667
|
+
protected extendLeaseOkResponseSupport?: boolean | "probing";
|
|
964
1668
|
readonly bitmap: BitmapStore;
|
|
965
1669
|
readonly bloom: BloomFilterStore;
|
|
966
1670
|
readonly cms: CountMinSketchStore;
|
|
@@ -968,7 +1672,6 @@ declare class FerricStoreClient {
|
|
|
968
1672
|
readonly geo: GeoStore;
|
|
969
1673
|
readonly hash: HashStore;
|
|
970
1674
|
readonly hyperloglog: HyperLogLogStore;
|
|
971
|
-
readonly json: JsonStore;
|
|
972
1675
|
readonly kv: KeyValueStore;
|
|
973
1676
|
readonly lists: ListStore;
|
|
974
1677
|
readonly sets: SetStore;
|
|
@@ -977,13 +1680,6 @@ declare class FerricStoreClient {
|
|
|
977
1680
|
readonly topk: TopKStore;
|
|
978
1681
|
readonly zset: SortedSetStore;
|
|
979
1682
|
constructor(executor: CommandExecutor, options?: FerricStoreClientOptions);
|
|
980
|
-
static fromUrl(url: string, options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
981
|
-
static fromUrls(urls: readonly string[], options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
982
|
-
command(...args: CommandArgument[]): Promise<unknown>;
|
|
983
|
-
pipeline(commands: readonly Command[]): Promise<unknown[]>;
|
|
984
|
-
close(): Promise<void>;
|
|
985
|
-
refreshTopology(): Promise<RoutingTopology>;
|
|
986
|
-
route(key: string | Buffer): Promise<RoutingRoute>;
|
|
987
1683
|
ping(message?: CommandArgument): Promise<unknown>;
|
|
988
1684
|
echo(message: CommandArgument): Promise<unknown>;
|
|
989
1685
|
serverInfo(section?: string): Promise<string>;
|
|
@@ -1010,7 +1706,7 @@ declare class FerricStoreClient {
|
|
|
1010
1706
|
clientList(options?: {
|
|
1011
1707
|
type?: string;
|
|
1012
1708
|
}): Promise<string>;
|
|
1013
|
-
clientTracking(
|
|
1709
|
+
clientTracking(_mode: "ON" | "OFF", _options?: {
|
|
1014
1710
|
redirect?: number;
|
|
1015
1711
|
prefixes?: string[];
|
|
1016
1712
|
bcast?: boolean;
|
|
@@ -1018,7 +1714,7 @@ declare class FerricStoreClient {
|
|
|
1018
1714
|
optout?: boolean;
|
|
1019
1715
|
noloop?: boolean;
|
|
1020
1716
|
}): Promise<boolean>;
|
|
1021
|
-
clientCaching(
|
|
1717
|
+
clientCaching(_mode: "YES" | "NO"): Promise<boolean>;
|
|
1022
1718
|
clientTrackingInfo(): Promise<unknown>;
|
|
1023
1719
|
clientGetRedir(): Promise<number>;
|
|
1024
1720
|
save(): Promise<boolean>;
|
|
@@ -1057,119 +1753,156 @@ declare class FerricStoreClient {
|
|
|
1057
1753
|
}): Promise<FetchOrComputeResult<T>>;
|
|
1058
1754
|
fetchOrComputeResult(key: string, value: unknown, options: {
|
|
1059
1755
|
ttlMs: number;
|
|
1756
|
+
computeToken: Buffer$1 | null;
|
|
1060
1757
|
}): Promise<boolean>;
|
|
1061
|
-
fetchOrComputeError(key: string, message: string
|
|
1062
|
-
|
|
1063
|
-
clusterStats(): Promise<Record<string, unknown>>;
|
|
1064
|
-
clusterKeyslot(key: string): Promise<number>;
|
|
1065
|
-
clusterSlots(): Promise<unknown>;
|
|
1066
|
-
clusterStatus(): Promise<Record<string, unknown>>;
|
|
1067
|
-
clusterRole(): Promise<unknown>;
|
|
1068
|
-
clusterJoin(node: string, options?: {
|
|
1069
|
-
replace?: boolean;
|
|
1758
|
+
fetchOrComputeError(key: string, message: string, options: {
|
|
1759
|
+
computeToken: Buffer$1 | null;
|
|
1070
1760
|
}): Promise<boolean>;
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
}): Promise<FlowRecord | Buffer | unknown>;
|
|
1104
|
-
enqueueMany(items: CreateItem[], options: CreateManyOptions): Promise<unknown[] | unknown>;
|
|
1105
|
-
createMany(partitionKey: string | undefined, items: CreateItem[], options: CreateManyOptions): Promise<unknown[] | unknown>;
|
|
1106
|
-
valuePut(value: unknown, options?: {
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
/** @internal Administrative and governance commands kept off the primary Flow client surface. */
|
|
1764
|
+
declare class FerricStoreManagementClient extends FerricStoreClientCore {
|
|
1765
|
+
stats(type: string, options?: FlowStatsOptions): Promise<FlowAdminRecord>;
|
|
1766
|
+
countByState(type: string, state: string, options?: Omit<FlowStatsOptions, "state" | "count">): Promise<number>;
|
|
1767
|
+
attributes(type: string, options?: AttributeQueryOptions): Promise<FlowAdminRecord[]>;
|
|
1768
|
+
attributeValues(type: string, attribute: string, options?: AttributeQueryOptions): Promise<FlowAdminRecord[]>;
|
|
1769
|
+
scheduleCreate(id: string, options: ScheduleOptions): Promise<FlowAdminRecord>;
|
|
1770
|
+
scheduleGet(id: string, options?: {
|
|
1771
|
+
nowMs?: number;
|
|
1772
|
+
}): Promise<FlowAdminRecord | null>;
|
|
1773
|
+
scheduleFire(id: string, options?: {
|
|
1774
|
+
nowMs?: number;
|
|
1775
|
+
}): Promise<FlowAdminRecord>;
|
|
1776
|
+
schedulePause(id: string, options?: {
|
|
1777
|
+
nowMs?: number;
|
|
1778
|
+
}): Promise<FlowAdminRecord>;
|
|
1779
|
+
scheduleResume(id: string, options?: {
|
|
1780
|
+
nowMs?: number;
|
|
1781
|
+
}): Promise<FlowAdminRecord>;
|
|
1782
|
+
scheduleDelete(id: string, options?: {
|
|
1783
|
+
nowMs?: number;
|
|
1784
|
+
}): Promise<FlowAdminRecord>;
|
|
1785
|
+
scheduleFireDue(options?: ScheduleFireDueOptions): Promise<FlowAdminRecord>;
|
|
1786
|
+
scheduleList(options?: ScheduleListOptions): Promise<FlowAdminRecord[]>;
|
|
1787
|
+
private scheduleStatus;
|
|
1788
|
+
effectReserve(id: string, effectKey: string, effectType: string, options: EffectReserveOptions): Promise<FlowAdminRecord>;
|
|
1789
|
+
effectConfirm(id: string, effectKey: string, options?: EffectConfirmOptions): Promise<FlowAdminRecord>;
|
|
1790
|
+
effectFail(id: string, effectKey: string, options?: EffectFailOptions): Promise<FlowAdminRecord>;
|
|
1791
|
+
effectCompensate(id: string, effectKey: string, options?: EffectCompensateOptions): Promise<FlowAdminRecord>;
|
|
1792
|
+
effectGet(id: string, effectKey: string, options?: {
|
|
1107
1793
|
partitionKey?: string;
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1794
|
+
}): Promise<FlowAdminRecord | null>;
|
|
1795
|
+
private effectStatus;
|
|
1796
|
+
approvalRequest(id: string, options: ApprovalRequestOptions): Promise<FlowAdminRecord>;
|
|
1797
|
+
approvalApprove(id: string, options: {
|
|
1798
|
+
approver: string;
|
|
1799
|
+
reason?: string;
|
|
1112
1800
|
nowMs?: number;
|
|
1113
|
-
}): Promise<
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1801
|
+
}): Promise<FlowAdminRecord>;
|
|
1802
|
+
approvalReject(id: string, options: {
|
|
1803
|
+
approver: string;
|
|
1804
|
+
reason?: string;
|
|
1805
|
+
nowMs?: number;
|
|
1806
|
+
}): Promise<FlowAdminRecord>;
|
|
1807
|
+
private approvalStatus;
|
|
1808
|
+
approvalGet(id: string): Promise<FlowAdminRecord | null>;
|
|
1809
|
+
approvalList(options?: ApprovalListOptions): Promise<FlowAdminRecord[]>;
|
|
1810
|
+
governanceOverview(options?: ApprovalListOptions): Promise<FlowAdminRecord>;
|
|
1811
|
+
circuitOpen(scope: string, options?: CircuitOpenOptions): Promise<FlowAdminRecord>;
|
|
1812
|
+
circuitClose(scope: string, options?: {
|
|
1813
|
+
nowMs?: number;
|
|
1814
|
+
}): Promise<FlowAdminRecord>;
|
|
1815
|
+
circuitGet(scope: string): Promise<FlowAdminRecord | null>;
|
|
1816
|
+
budgetReserve(scope: string, amount: number, options?: BudgetReserveOptions): Promise<FlowAdminRecord>;
|
|
1817
|
+
budgetCommit(scope: string, reservationId: string, actualAmount: number, options?: BudgetCommitOptions): Promise<FlowAdminRecord>;
|
|
1818
|
+
budgetRelease(scope: string, reservationId: string, options?: {
|
|
1819
|
+
nowMs?: number;
|
|
1820
|
+
}): Promise<FlowAdminRecord>;
|
|
1821
|
+
budgetGet(scope: string): Promise<FlowAdminRecord | null>;
|
|
1822
|
+
budgetList(options?: AdminListOptions): Promise<FlowAdminRecord[]>;
|
|
1823
|
+
limitLease(scope: string, options: LimitLeaseOptions): Promise<FlowAdminRecord>;
|
|
1824
|
+
limitSpend(scope: string, options: LimitAmountOptions): Promise<FlowAdminRecord>;
|
|
1825
|
+
limitRelease(scope: string, options: LimitReleaseOptions): Promise<FlowAdminRecord>;
|
|
1826
|
+
limitGet(scope: string, options?: {
|
|
1827
|
+
nowMs?: number;
|
|
1828
|
+
}): Promise<FlowAdminRecord | null>;
|
|
1829
|
+
limitList(options?: LimitListOptions): Promise<FlowAdminRecord[]>;
|
|
1830
|
+
governanceLedger(id: string, options?: GovernanceLedgerOptions): Promise<FlowAdminRecord[]>;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
/** @internal Read, policy, and shared Flow helpers kept off the primary implementation module. */
|
|
1834
|
+
declare class FerricStoreFlowSupportClient extends FerricStoreManagementClient {
|
|
1835
|
+
rewind(id: string, options?: {
|
|
1119
1836
|
partitionKey?: string;
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
transitionTo?: string;
|
|
1123
|
-
runAtMs?: number;
|
|
1837
|
+
toEvent?: string;
|
|
1838
|
+
expectState?: string;
|
|
1124
1839
|
nowMs?: number;
|
|
1125
|
-
|
|
1840
|
+
returnRecord?: boolean;
|
|
1841
|
+
}): Promise<FlowRecord | Buffer$1 | unknown>;
|
|
1842
|
+
get<TPayload = unknown>(id: string, options?: {
|
|
1843
|
+
partitionKey?: string;
|
|
1844
|
+
full?: boolean;
|
|
1845
|
+
payload?: boolean;
|
|
1846
|
+
payloadMaxBytes?: number;
|
|
1847
|
+
values?: readonly string[];
|
|
1848
|
+
valueMaxBytes?: number;
|
|
1849
|
+
}): Promise<FlowRecord<TPayload> | undefined>;
|
|
1850
|
+
list(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1851
|
+
search(type: string, options?: SearchOptions): Promise<FlowRecord[]>;
|
|
1852
|
+
terminals(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1853
|
+
failures(type: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1854
|
+
byParent(parentFlowId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1855
|
+
byRoot(rootFlowId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1856
|
+
byCorrelation(correlationId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1857
|
+
info(type: string): Promise<Record<string, unknown>>;
|
|
1858
|
+
stuck(type: string, options?: {
|
|
1859
|
+
partitionKey?: string;
|
|
1860
|
+
count?: number;
|
|
1861
|
+
olderThanMs?: number;
|
|
1862
|
+
nowMs?: number;
|
|
1863
|
+
}): Promise<FlowRecord[]>;
|
|
1864
|
+
history(id: string, options?: HistoryOptions): Promise<unknown[]>;
|
|
1865
|
+
spawnChildren(parentId: string, children: ChildSpec[], options?: {
|
|
1866
|
+
groupId?: string;
|
|
1867
|
+
partitionKey?: string;
|
|
1868
|
+
leaseToken?: Buffer$1;
|
|
1869
|
+
fencingToken?: FencingToken;
|
|
1870
|
+
wait?: string;
|
|
1871
|
+
waitState?: string;
|
|
1872
|
+
success?: string;
|
|
1873
|
+
failure?: string;
|
|
1874
|
+
fromState?: string;
|
|
1875
|
+
nowMs?: number;
|
|
1876
|
+
onChildFailed?: string;
|
|
1877
|
+
onParentClosed?: string;
|
|
1878
|
+
maxActiveMs?: MaxActiveMs;
|
|
1126
1879
|
values?: Record<string, unknown>;
|
|
1127
1880
|
valueRefs?: Record<string, string>;
|
|
1128
|
-
dropValues?: string[];
|
|
1129
|
-
overrideValues?: string[];
|
|
1130
1881
|
}): Promise<unknown>;
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1882
|
+
installPolicy(type: string, options?: FlowPolicyOptions): Promise<unknown>;
|
|
1883
|
+
policyGet(type: string, options?: {
|
|
1884
|
+
state?: string;
|
|
1885
|
+
}): Promise<Record<string, unknown>>;
|
|
1886
|
+
retentionCleanup(): Promise<Record<string, unknown>>;
|
|
1887
|
+
protected executeProducerWrite(args: CommandArgument[]): Promise<unknown>;
|
|
1888
|
+
protected recordOrGet(response: unknown, id: string, partitionKey: string | undefined): Promise<FlowRecord>;
|
|
1889
|
+
protected records(values: unknown[]): FlowRecord[];
|
|
1890
|
+
protected recordsOrResponse(value: unknown): unknown[] | unknown;
|
|
1891
|
+
protected flowManyLimitError(operation: string): Error;
|
|
1892
|
+
protected executeIndependentManyChunks<T>(operation: string, items: readonly T[], capture: (item: T) => T, execute: (batchItems: T[]) => Promise<unknown[] | unknown>): Promise<unknown[]>;
|
|
1893
|
+
private indexQuery;
|
|
1894
|
+
protected appendPartitionOptions(args: CommandArgument[], options: {
|
|
1139
1895
|
partitionKey?: string;
|
|
1140
|
-
|
|
1141
|
-
}):
|
|
1896
|
+
partitionKeys?: string[];
|
|
1897
|
+
}): void;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
declare class FerricStoreMutationClient extends FerricStoreFlowSupportClient {
|
|
1142
1901
|
transition(id: string, options: TransitionOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
1143
1902
|
complete(id: string, options: CompleteOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
1144
|
-
completeMany(partitionKey: string | undefined, items: ClaimedItem[], options?:
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
values?: Record<string, unknown>;
|
|
1148
|
-
valueRefs?: Record<string, string>;
|
|
1149
|
-
dropValues?: string[];
|
|
1150
|
-
overrideValues?: string[];
|
|
1151
|
-
stateMeta?: StateMeta;
|
|
1152
|
-
ttlMs?: number;
|
|
1153
|
-
nowMs?: number;
|
|
1154
|
-
independent?: boolean;
|
|
1155
|
-
returnOkOnSuccess?: boolean;
|
|
1156
|
-
}): Promise<unknown[] | unknown>;
|
|
1157
|
-
completeJobs(jobs: ClaimedItem[], options?: Parameters<FerricStoreClient["completeMany"]>[2]): Promise<unknown[] | unknown>;
|
|
1158
|
-
transitionMany(partitionKey: string | undefined, options: {
|
|
1159
|
-
fromState: string;
|
|
1160
|
-
toState: string;
|
|
1161
|
-
items: FencedItem[];
|
|
1162
|
-
payload?: unknown;
|
|
1163
|
-
values?: Record<string, unknown>;
|
|
1164
|
-
valueRefs?: Record<string, string>;
|
|
1165
|
-
dropValues?: string[];
|
|
1166
|
-
overrideValues?: string[];
|
|
1167
|
-
stateMeta?: StateMeta;
|
|
1168
|
-
runAtMs?: number;
|
|
1169
|
-
nowMs?: number;
|
|
1170
|
-
priority?: number;
|
|
1171
|
-
independent?: boolean;
|
|
1172
|
-
}): Promise<unknown[] | unknown>;
|
|
1903
|
+
completeMany(partitionKey: string | undefined, items: ClaimedItem[], options?: CompleteManyOptions): Promise<unknown[] | unknown>;
|
|
1904
|
+
protected completeManyRequest(partitionKey: string | undefined, items: ClaimedItem[], options: CompleteManyOptions): CommandArgument[];
|
|
1905
|
+
completeJobs(jobs: ClaimedItem[], options?: CompleteManyOptions): Promise<unknown[] | unknown>;
|
|
1173
1906
|
retry(id: string, options: RetryOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
1174
1907
|
retryMany(partitionKey: string | undefined, items: ClaimedItem[], options?: {
|
|
1175
1908
|
error?: unknown;
|
|
@@ -1178,10 +1911,13 @@ declare class FerricStoreClient {
|
|
|
1178
1911
|
valueRefs?: Record<string, string>;
|
|
1179
1912
|
dropValues?: string[];
|
|
1180
1913
|
overrideValues?: string[];
|
|
1914
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
1915
|
+
attributesDelete?: string[];
|
|
1181
1916
|
stateMeta?: StateMeta;
|
|
1182
1917
|
runAtMs?: number;
|
|
1183
1918
|
nowMs?: number;
|
|
1184
1919
|
independent?: boolean;
|
|
1920
|
+
returnOkOnSuccess?: boolean;
|
|
1185
1921
|
}): Promise<unknown[] | unknown>;
|
|
1186
1922
|
fail(id: string, options: FailOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
1187
1923
|
failMany(partitionKey: string | undefined, items: ClaimedItem[], options?: {
|
|
@@ -1191,121 +1927,113 @@ declare class FerricStoreClient {
|
|
|
1191
1927
|
valueRefs?: Record<string, string>;
|
|
1192
1928
|
dropValues?: string[];
|
|
1193
1929
|
overrideValues?: string[];
|
|
1930
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
1931
|
+
attributesDelete?: string[];
|
|
1194
1932
|
stateMeta?: StateMeta;
|
|
1195
1933
|
ttlMs?: number;
|
|
1196
1934
|
nowMs?: number;
|
|
1197
1935
|
independent?: boolean;
|
|
1936
|
+
returnOkOnSuccess?: boolean;
|
|
1198
1937
|
}): Promise<unknown[] | unknown>;
|
|
1199
1938
|
cancel(id: string, options: CancelOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
1200
1939
|
cancelMany(partitionKey: string | undefined, items: FencedItem[], options?: {
|
|
1201
1940
|
reason?: unknown;
|
|
1941
|
+
values?: Record<string, unknown>;
|
|
1942
|
+
valueRefs?: Record<string, string>;
|
|
1943
|
+
dropValues?: string[];
|
|
1944
|
+
overrideValues?: string[];
|
|
1945
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
1946
|
+
attributesDelete?: string[];
|
|
1202
1947
|
stateMeta?: StateMeta;
|
|
1203
1948
|
ttlMs?: number;
|
|
1204
1949
|
nowMs?: number;
|
|
1205
1950
|
independent?: boolean;
|
|
1206
1951
|
}): Promise<unknown[] | unknown>;
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
declare class FerricStoreClaimClient extends FerricStoreMutationClient {
|
|
1955
|
+
claimDue(type: string, options: ClaimDueOptions): Promise<(FlowRecord | ClaimedItem)[]>;
|
|
1956
|
+
private claimDueRequest;
|
|
1957
|
+
private claimDueResponse;
|
|
1958
|
+
claimJobs(type: string, options: Omit<ClaimDueOptions, "jobOnly">): Promise<ClaimedItem[]>;
|
|
1959
|
+
reclaim(type: string, options: ReclaimOptions): Promise<(FlowRecord | ClaimedItem)[]>;
|
|
1960
|
+
private claimedItems;
|
|
1961
|
+
extendLease(id: string, options: ExtendLeaseOptions & {
|
|
1962
|
+
readonly returnOkOnSuccess: true;
|
|
1963
|
+
}): Promise<boolean>;
|
|
1964
|
+
extendLease(id: string, options: ExtendLeaseOptions & {
|
|
1965
|
+
readonly returnOkOnSuccess?: false;
|
|
1966
|
+
}): Promise<FlowRecord>;
|
|
1967
|
+
extendLease(id: string, options: ExtendLeaseOptions): Promise<FlowRecord | boolean>;
|
|
1968
|
+
/**
|
|
1969
|
+
* Complete leased jobs and claim replacements through one ordered pipeline
|
|
1970
|
+
* when both commands can use the same route. Item errors are returned beside
|
|
1971
|
+
* any newly leased jobs so callers cannot accidentally discard those leases.
|
|
1972
|
+
*/
|
|
1973
|
+
completeJobsAndClaimJobs(jobs: ClaimedItem[], type: string, claimOptions: ClaimDueOptions, completeOptions?: Omit<CompleteManyOptions, "returnOkOnSuccess">): Promise<CompleteJobsAndClaimJobsResult>;
|
|
1974
|
+
completeFlowsAndClaimFlows(jobs: ClaimedItem[], type: string, claimOptions: ClaimDueOptions, completeOptions?: Omit<CompleteManyOptions, "returnOkOnSuccess">): Promise<CompleteJobsAndClaimJobsResult>;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
/** Producer-oriented Flow commands, separated from mutation and claim APIs. */
|
|
1978
|
+
declare class FerricStoreProducerClient extends FerricStoreClaimClient {
|
|
1979
|
+
create(id: string, options: CreateOptions): Promise<FlowRecord | Buffer | unknown>;
|
|
1980
|
+
enqueue(id: string, options: Omit<CreateOptions, "state"> & {
|
|
1981
|
+
state?: string;
|
|
1213
1982
|
}): Promise<FlowRecord | Buffer | unknown>;
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
byParent(parentFlowId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1223
|
-
byRoot(rootFlowId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1224
|
-
byCorrelation(correlationId: string, options?: ReadOptions): Promise<FlowRecord[]>;
|
|
1225
|
-
info(type: string): Promise<Record<string, unknown>>;
|
|
1226
|
-
stuck(type: string, options?: {
|
|
1983
|
+
enqueueMany(items: CreateItem[], options: CreateManyOptions): Promise<unknown[] | unknown>;
|
|
1984
|
+
createMany(partitionKey: string | undefined, items: CreateItem[], options: CreateManyOptions): Promise<unknown[] | unknown>;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
declare class FerricStoreClient extends FerricStoreProducerClient {
|
|
1988
|
+
static fromUrl(url: string, options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
1989
|
+
static fromUrls(urls: readonly string[], options?: FerricStoreClientFromUrlOptions): Promise<FerricStoreClient>;
|
|
1990
|
+
valuePut(value: unknown, options?: {
|
|
1227
1991
|
partitionKey?: string;
|
|
1228
|
-
|
|
1229
|
-
|
|
1992
|
+
ownerFlowId?: string;
|
|
1993
|
+
name?: string;
|
|
1994
|
+
override?: boolean;
|
|
1995
|
+
ttlMs?: number;
|
|
1230
1996
|
nowMs?: number;
|
|
1231
|
-
}): Promise<
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
count?: number;
|
|
1235
|
-
fromEvent?: string;
|
|
1236
|
-
rev?: boolean;
|
|
1997
|
+
}): Promise<unknown>;
|
|
1998
|
+
valueMGet(refs: string[], options?: {
|
|
1999
|
+
maxBytes?: number;
|
|
1237
2000
|
}): Promise<unknown[]>;
|
|
1238
|
-
|
|
1239
|
-
|
|
2001
|
+
signal(id: string, options: {
|
|
2002
|
+
signal: string;
|
|
1240
2003
|
partitionKey?: string;
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
success?: string;
|
|
1246
|
-
failure?: string;
|
|
1247
|
-
fromState?: string;
|
|
2004
|
+
idempotencyKey?: string;
|
|
2005
|
+
ifState?: string | string[];
|
|
2006
|
+
transitionTo?: string;
|
|
2007
|
+
runAtMs?: number;
|
|
1248
2008
|
nowMs?: number;
|
|
1249
|
-
|
|
1250
|
-
onParentClosed?: string;
|
|
2009
|
+
priority?: number;
|
|
1251
2010
|
values?: Record<string, unknown>;
|
|
1252
2011
|
valueRefs?: Record<string, string>;
|
|
2012
|
+
dropValues?: string[];
|
|
2013
|
+
overrideValues?: string[];
|
|
1253
2014
|
}): Promise<unknown>;
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
}
|
|
1275
|
-
declare class FlowNotFoundError extends FerricStoreError {
|
|
1276
|
-
readonly code = "flow_not_found";
|
|
1277
|
-
}
|
|
1278
|
-
declare class FlowWrongStateError extends FerricStoreError {
|
|
1279
|
-
readonly code = "flow_wrong_state";
|
|
1280
|
-
}
|
|
1281
|
-
declare class StaleLeaseError extends FerricStoreError {
|
|
1282
|
-
readonly code = "stale_lease";
|
|
1283
|
-
}
|
|
1284
|
-
declare class FlowAlreadyExistsError extends FerricStoreError {
|
|
1285
|
-
readonly code = "flow_already_exists";
|
|
1286
|
-
}
|
|
1287
|
-
declare class LockHeldError extends FerricStoreError {
|
|
1288
|
-
readonly code = "lock_held";
|
|
1289
|
-
}
|
|
1290
|
-
declare class LockNotOwnedError extends FerricStoreError {
|
|
1291
|
-
readonly code = "lock_not_owned";
|
|
1292
|
-
}
|
|
1293
|
-
declare class InvalidCommandError extends FerricStoreError {
|
|
1294
|
-
readonly code = "invalid_command";
|
|
1295
|
-
}
|
|
1296
|
-
declare class OverloadedError extends FerricStoreError {
|
|
1297
|
-
readonly code = "overloaded";
|
|
1298
|
-
readonly retryAfterMs: number | undefined;
|
|
1299
|
-
readonly reason: string | undefined;
|
|
1300
|
-
constructor(message: string, options?: {
|
|
1301
|
-
raw?: unknown;
|
|
1302
|
-
cause?: unknown;
|
|
1303
|
-
retryAfterMs?: number;
|
|
1304
|
-
reason?: string;
|
|
1305
|
-
});
|
|
2015
|
+
flowSignal(id: string, options: Parameters<FerricStoreClient["signal"]>[1]): Promise<unknown>;
|
|
2016
|
+
startAndClaim(id: string, options: StartAndClaimOptions): Promise<FlowRecord>;
|
|
2017
|
+
stepContinue(id: string, options: StepContinueOptions): Promise<FlowRecord | ClaimedItem>;
|
|
2018
|
+
runStepsMany(items: readonly (string | RunStepsItem)[], options: RunStepsManyOptions): Promise<unknown>;
|
|
2019
|
+
transitionMany(partitionKey: string | undefined, options: {
|
|
2020
|
+
fromState: string;
|
|
2021
|
+
toState: string;
|
|
2022
|
+
items: FencedItem[];
|
|
2023
|
+
payload?: unknown;
|
|
2024
|
+
values?: Record<string, unknown>;
|
|
2025
|
+
valueRefs?: Record<string, string>;
|
|
2026
|
+
dropValues?: string[];
|
|
2027
|
+
overrideValues?: string[];
|
|
2028
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
2029
|
+
attributesDelete?: string[];
|
|
2030
|
+
stateMeta?: StateMeta;
|
|
2031
|
+
runAtMs?: number;
|
|
2032
|
+
nowMs?: number;
|
|
2033
|
+
priority?: number;
|
|
2034
|
+
independent?: boolean;
|
|
2035
|
+
}): Promise<unknown[] | unknown>;
|
|
1306
2036
|
}
|
|
1307
|
-
declare function classifyServerError(message: string, raw?: unknown, cause?: unknown): FerricStoreError;
|
|
1308
|
-
declare function mapException(error: unknown): unknown;
|
|
1309
2037
|
|
|
1310
2038
|
type Outcome = TransitionOutcome | CompleteOutcome | RetryOutcome | FailOutcome;
|
|
1311
2039
|
interface NamedValueMutation {
|
|
@@ -1313,6 +2041,8 @@ interface NamedValueMutation {
|
|
|
1313
2041
|
valueRefs?: Record<string, string>;
|
|
1314
2042
|
dropValues?: string[];
|
|
1315
2043
|
overrideValues?: string[];
|
|
2044
|
+
attributesMerge?: Record<string, CommandArgument>;
|
|
2045
|
+
attributesDelete?: string[];
|
|
1316
2046
|
stateMeta?: StateMeta;
|
|
1317
2047
|
}
|
|
1318
2048
|
interface TransitionOutcome extends NamedValueMutation {
|
|
@@ -1344,6 +2074,40 @@ declare function transition(toState: string, options?: Omit<TransitionOutcome, "
|
|
|
1344
2074
|
declare function complete(options?: Omit<CompleteOutcome, "kind">): CompleteOutcome;
|
|
1345
2075
|
declare function retry(options?: Omit<RetryOutcome, "kind">): RetryOutcome;
|
|
1346
2076
|
declare function fail(options?: Omit<FailOutcome, "kind">): FailOutcome;
|
|
2077
|
+
declare function isOutcome(value: unknown): value is Outcome;
|
|
2078
|
+
|
|
2079
|
+
/** Raised when a worker loses the ability to renew a claimed job's lease. */
|
|
2080
|
+
declare class LeaseRenewalError extends Error {
|
|
2081
|
+
constructor(cause: unknown);
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
declare class QueueWorker {
|
|
2085
|
+
readonly queue: Queue;
|
|
2086
|
+
readonly options: WorkerConfig;
|
|
2087
|
+
private readonly pendingCompletions;
|
|
2088
|
+
constructor(queue: Queue, options: WorkerConfig);
|
|
2089
|
+
runOnce(handler: QueueHandler): Promise<QueueWorkerResult>;
|
|
2090
|
+
private runHandlerClaimOnce;
|
|
2091
|
+
runBatchOnce(handler: QueueBatchHandler): Promise<QueueWorkerResult>;
|
|
2092
|
+
runBatchOnceForPartitionKeys(handler: QueueBatchHandler, partitionKeys: readonly string[], options?: {
|
|
2093
|
+
readonly claimCredit?: number;
|
|
2094
|
+
}): Promise<QueueWorkerResult>;
|
|
2095
|
+
flush(): Promise<number>;
|
|
2096
|
+
private runBatchOnceWithClaim;
|
|
2097
|
+
run(handler: QueueHandler): Promise<void>;
|
|
2098
|
+
private runContinuously;
|
|
2099
|
+
private claimJobs;
|
|
2100
|
+
private applyJob;
|
|
2101
|
+
private applyContinuousJob;
|
|
2102
|
+
private guardContinuousJob;
|
|
2103
|
+
private flushCompletions;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
/** Async terminal-write failure with the number of durable successes drained first. */
|
|
2107
|
+
declare class QueueCompletionError extends Error {
|
|
2108
|
+
readonly completed: number;
|
|
2109
|
+
constructor(cause: unknown, completed: number);
|
|
2110
|
+
}
|
|
1347
2111
|
|
|
1348
2112
|
type QueueJob = FlowRecord | ClaimedItem;
|
|
1349
2113
|
type QueueHandler = (job: QueueJob) => Promise<unknown> | unknown;
|
|
@@ -1371,6 +2135,7 @@ declare class Queue {
|
|
|
1371
2135
|
readonly defaultWorker: string;
|
|
1372
2136
|
constructor(client: FerricStoreClient, options: QueueOptions);
|
|
1373
2137
|
enqueue(id: string, options?: {
|
|
2138
|
+
attributes?: Record<string, CommandArgument>;
|
|
1374
2139
|
payload?: unknown;
|
|
1375
2140
|
partitionKey?: string;
|
|
1376
2141
|
runAtMs?: number;
|
|
@@ -1378,45 +2143,93 @@ declare class Queue {
|
|
|
1378
2143
|
priority?: number;
|
|
1379
2144
|
idempotent?: boolean;
|
|
1380
2145
|
retentionTtlMs?: number;
|
|
2146
|
+
maxActiveMs?: MaxActiveMs;
|
|
1381
2147
|
values?: Record<string, unknown>;
|
|
1382
2148
|
valueRefs?: Record<string, string>;
|
|
1383
2149
|
stateMeta?: StateMeta;
|
|
1384
2150
|
returnRecord?: boolean;
|
|
1385
2151
|
}): Promise<FlowRecord | Buffer | unknown>;
|
|
1386
2152
|
enqueueMany(items: CreateItem[], options?: {
|
|
2153
|
+
attributes?: Record<string, CommandArgument>;
|
|
1387
2154
|
partitionKey?: string;
|
|
2155
|
+
autoPartitionBatchSize?: number;
|
|
2156
|
+
autoPartitionConcurrency?: number;
|
|
1388
2157
|
runAtMs?: number;
|
|
1389
2158
|
nowMs?: number;
|
|
1390
2159
|
priority?: number;
|
|
1391
2160
|
idempotent?: boolean;
|
|
1392
2161
|
independent?: boolean;
|
|
1393
2162
|
retentionTtlMs?: number;
|
|
2163
|
+
maxActiveMs?: MaxActiveMs;
|
|
1394
2164
|
values?: Record<string, unknown>;
|
|
1395
2165
|
valueRefs?: Record<string, string>;
|
|
1396
2166
|
stateMeta?: StateMeta;
|
|
1397
2167
|
}): Promise<unknown[] | unknown>;
|
|
1398
2168
|
worker(options?: WorkerConfig): QueueWorker;
|
|
1399
2169
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
readonly
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
2170
|
+
|
|
2171
|
+
declare class WorkflowContext {
|
|
2172
|
+
readonly workflow: Workflow;
|
|
2173
|
+
readonly job: FlowRecord | ClaimedItem;
|
|
2174
|
+
readonly stateName: string;
|
|
2175
|
+
readonly flow: WorkflowFlowCommands;
|
|
2176
|
+
private readonly leaseJob;
|
|
2177
|
+
private readonly valueCache;
|
|
2178
|
+
constructor(workflow: Workflow, job: FlowRecord | ClaimedItem, stateName: string, leaseJob?: ClaimedItem);
|
|
2179
|
+
get client(): FerricStoreClient;
|
|
2180
|
+
get id(): string;
|
|
2181
|
+
get type(): string;
|
|
2182
|
+
get state(): string;
|
|
2183
|
+
get logicalState(): string;
|
|
2184
|
+
get partitionKey(): string | undefined;
|
|
2185
|
+
get payload(): unknown;
|
|
2186
|
+
get values(): Record<string, unknown>;
|
|
2187
|
+
get stateMeta(): Record<string, unknown>;
|
|
2188
|
+
get indexedStateMeta(): string | undefined;
|
|
2189
|
+
get valueRefs(): Record<string, unknown>;
|
|
2190
|
+
get leaseToken(): Buffer;
|
|
2191
|
+
get fencingToken(): FencingToken;
|
|
2192
|
+
get version(): number;
|
|
2193
|
+
get parentFlowId(): string | undefined;
|
|
2194
|
+
get rootFlowId(): string | undefined;
|
|
2195
|
+
get correlationId(): string | undefined;
|
|
2196
|
+
value(name: string, defaultValue?: unknown, options?: {
|
|
2197
|
+
localCache?: boolean;
|
|
2198
|
+
}): Promise<unknown>;
|
|
2199
|
+
valueMany(names: string[], options?: {
|
|
2200
|
+
localCache?: boolean;
|
|
2201
|
+
}): Promise<Record<string, unknown>>;
|
|
2202
|
+
private valueMaxBytes;
|
|
2203
|
+
}
|
|
2204
|
+
declare class WorkflowFlowCommands {
|
|
2205
|
+
private readonly ctx;
|
|
2206
|
+
constructor(ctx: WorkflowContext);
|
|
2207
|
+
get(id?: string, options?: {
|
|
2208
|
+
partitionKey?: string;
|
|
2209
|
+
full?: boolean;
|
|
2210
|
+
}): Promise<FlowRecord | undefined>;
|
|
2211
|
+
history(id?: string, options?: Parameters<FerricStoreClient["history"]>[1]): Promise<unknown[]>;
|
|
2212
|
+
create(id: string, options?: Omit<Parameters<FerricStoreClient["create"]>[1], "type"> & {
|
|
2213
|
+
type?: string;
|
|
2214
|
+
}): Promise<FlowRecord | Buffer | unknown>;
|
|
2215
|
+
transition(toState: string, options?: Partial<Omit<Parameters<FerricStoreClient["transition"]>[1], "toState" | "fromState" | "leaseToken" | "fencingToken">> & {
|
|
2216
|
+
fromState?: string;
|
|
2217
|
+
}): Promise<FlowRecord | Buffer | unknown>;
|
|
2218
|
+
stepContinue(toState: string, options?: Partial<Omit<StepContinueOptions, "toState" | "fromState" | "leaseToken" | "fencingToken">> & {
|
|
2219
|
+
fromState?: string;
|
|
2220
|
+
}): Promise<FlowRecord | ClaimedItem>;
|
|
2221
|
+
complete(options?: Partial<Omit<Parameters<FerricStoreClient["complete"]>[1], "leaseToken" | "fencingToken">>): Promise<FlowRecord | Buffer | unknown>;
|
|
2222
|
+
retry(options?: Partial<Omit<Parameters<FerricStoreClient["retry"]>[1], "leaseToken" | "fencingToken">>): Promise<FlowRecord | Buffer | unknown>;
|
|
2223
|
+
fail(options?: Partial<Omit<Parameters<FerricStoreClient["fail"]>[1], "leaseToken" | "fencingToken">>): Promise<FlowRecord | Buffer | unknown>;
|
|
2224
|
+
signal(signal: string, options?: Omit<Parameters<FerricStoreClient["signal"]>[1], "signal">): Promise<unknown>;
|
|
2225
|
+
putValue(name: string, value: unknown, options?: Parameters<FerricStoreClient["valuePut"]>[1]): Promise<unknown>;
|
|
2226
|
+
value(name: string, defaultValue?: unknown, options?: {
|
|
2227
|
+
localCache?: boolean;
|
|
2228
|
+
}): Promise<unknown>;
|
|
2229
|
+
values(names: string[], options?: {
|
|
2230
|
+
localCache?: boolean;
|
|
2231
|
+
}): Promise<Record<string, unknown>>;
|
|
2232
|
+
spawnChildren(children: ChildSpec[], options?: Parameters<FerricStoreClient["spawnChildren"]>[2]): Promise<unknown>;
|
|
1420
2233
|
}
|
|
1421
2234
|
|
|
1422
2235
|
type WorkflowHandler = (ctx: WorkflowContext) => Promise<Outcome | void | unknown> | Outcome | void | unknown;
|
|
@@ -1425,7 +2238,7 @@ interface StateOptions {
|
|
|
1425
2238
|
leaseMs?: number;
|
|
1426
2239
|
claimPayload?: boolean;
|
|
1427
2240
|
claimRecord?: boolean;
|
|
1428
|
-
claimValues?: string[];
|
|
2241
|
+
claimValues?: readonly string[];
|
|
1429
2242
|
valueMaxBytes?: number;
|
|
1430
2243
|
exceptionPolicy?: ExceptionPolicy;
|
|
1431
2244
|
retryPolicy?: RetryPolicy;
|
|
@@ -1444,18 +2257,19 @@ interface WorkflowWorkerResult {
|
|
|
1444
2257
|
emptyClaims: number;
|
|
1445
2258
|
}
|
|
1446
2259
|
interface StateRegistration {
|
|
1447
|
-
claimValues?: string[];
|
|
1448
|
-
claimPayload: boolean;
|
|
1449
|
-
claimRecord: boolean;
|
|
1450
|
-
exceptionPolicy: ExceptionPolicy;
|
|
1451
|
-
handler: WorkflowHandler;
|
|
1452
|
-
leaseMs: number;
|
|
1453
|
-
mode?: FlowStateMode;
|
|
1454
|
-
name: string;
|
|
1455
|
-
returnRecord: boolean;
|
|
1456
|
-
retryPolicy?: RetryPolicy
|
|
1457
|
-
valueMaxBytes?: number;
|
|
2260
|
+
readonly claimValues?: readonly string[];
|
|
2261
|
+
readonly claimPayload: boolean;
|
|
2262
|
+
readonly claimRecord: boolean;
|
|
2263
|
+
readonly exceptionPolicy: ExceptionPolicy;
|
|
2264
|
+
readonly handler: WorkflowHandler;
|
|
2265
|
+
readonly leaseMs: number;
|
|
2266
|
+
readonly mode?: FlowStateMode;
|
|
2267
|
+
readonly name: string;
|
|
2268
|
+
readonly returnRecord: boolean;
|
|
2269
|
+
readonly retryPolicy?: Readonly<RetryPolicy>;
|
|
2270
|
+
readonly valueMaxBytes?: number;
|
|
1458
2271
|
}
|
|
2272
|
+
|
|
1459
2273
|
declare class WorkflowClient {
|
|
1460
2274
|
readonly flow: FerricStoreClient;
|
|
1461
2275
|
constructor(flow: FerricStoreClient);
|
|
@@ -1473,6 +2287,7 @@ declare class Workflow {
|
|
|
1473
2287
|
constructor(client: FerricStoreClient, options: WorkflowOptions);
|
|
1474
2288
|
state(name: string, handler: WorkflowHandler, options?: StateOptions): this;
|
|
1475
2289
|
start(id: string, options?: {
|
|
2290
|
+
attributes?: Record<string, CommandArgument>;
|
|
1476
2291
|
payload?: unknown;
|
|
1477
2292
|
state?: string;
|
|
1478
2293
|
partitionKey?: string;
|
|
@@ -1484,19 +2299,26 @@ declare class Workflow {
|
|
|
1484
2299
|
priority?: number;
|
|
1485
2300
|
idempotent?: boolean;
|
|
1486
2301
|
retentionTtlMs?: number;
|
|
2302
|
+
maxActiveMs?: MaxActiveMs;
|
|
1487
2303
|
values?: Record<string, unknown>;
|
|
1488
2304
|
valueRefs?: Record<string, string>;
|
|
1489
2305
|
stateMeta?: StateMeta;
|
|
1490
2306
|
returnRecord?: boolean;
|
|
1491
2307
|
}): Promise<FlowRecord | Buffer | unknown>;
|
|
2308
|
+
startAndClaim(id: string, options: Omit<StartAndClaimOptions, "type" | "initialState"> & {
|
|
2309
|
+
initialState?: string;
|
|
2310
|
+
}): Promise<FlowRecord>;
|
|
2311
|
+
runStepsMany(items: readonly (string | RunStepsItem)[], options: Omit<RunStepsManyOptions, "type">): Promise<unknown>;
|
|
1492
2312
|
startMany(items: {
|
|
1493
2313
|
id: string;
|
|
1494
2314
|
payload?: unknown;
|
|
1495
2315
|
partitionKey?: string;
|
|
2316
|
+
attributes?: Record<string, CommandArgument>;
|
|
1496
2317
|
values?: Record<string, unknown>;
|
|
1497
2318
|
valueRefs?: Record<string, string>;
|
|
1498
2319
|
stateMeta?: StateMeta;
|
|
1499
2320
|
}[], options?: {
|
|
2321
|
+
attributes?: Record<string, CommandArgument>;
|
|
1500
2322
|
state?: string;
|
|
1501
2323
|
partitionKey?: string;
|
|
1502
2324
|
runAtMs?: number;
|
|
@@ -1505,6 +2327,7 @@ declare class Workflow {
|
|
|
1505
2327
|
idempotent?: boolean;
|
|
1506
2328
|
independent?: boolean;
|
|
1507
2329
|
retentionTtlMs?: number;
|
|
2330
|
+
maxActiveMs?: MaxActiveMs;
|
|
1508
2331
|
values?: Record<string, unknown>;
|
|
1509
2332
|
valueRefs?: Record<string, string>;
|
|
1510
2333
|
stateMeta?: StateMeta;
|
|
@@ -1519,65 +2342,6 @@ declare class Workflow {
|
|
|
1519
2342
|
stateNames(): string[];
|
|
1520
2343
|
stateRegistration(name: string): StateRegistration | undefined;
|
|
1521
2344
|
}
|
|
1522
|
-
declare class WorkflowContext {
|
|
1523
|
-
readonly workflow: Workflow;
|
|
1524
|
-
readonly job: FlowRecord | ClaimedItem;
|
|
1525
|
-
readonly stateName: string;
|
|
1526
|
-
readonly flow: WorkflowFlowCommands;
|
|
1527
|
-
private readonly valueCache;
|
|
1528
|
-
constructor(workflow: Workflow, job: FlowRecord | ClaimedItem, stateName: string);
|
|
1529
|
-
get client(): FerricStoreClient;
|
|
1530
|
-
get id(): string;
|
|
1531
|
-
get type(): string;
|
|
1532
|
-
get state(): string;
|
|
1533
|
-
get logicalState(): string;
|
|
1534
|
-
get partitionKey(): string | undefined;
|
|
1535
|
-
get payload(): unknown;
|
|
1536
|
-
get values(): Record<string, unknown>;
|
|
1537
|
-
get stateMeta(): Record<string, unknown>;
|
|
1538
|
-
get indexedStateMeta(): string | undefined;
|
|
1539
|
-
get valueRefs(): Record<string, unknown>;
|
|
1540
|
-
get leaseToken(): Buffer;
|
|
1541
|
-
get fencingToken(): number;
|
|
1542
|
-
get version(): number;
|
|
1543
|
-
get parentFlowId(): string | undefined;
|
|
1544
|
-
get rootFlowId(): string | undefined;
|
|
1545
|
-
get correlationId(): string | undefined;
|
|
1546
|
-
value(name: string, defaultValue?: unknown, options?: {
|
|
1547
|
-
localCache?: boolean;
|
|
1548
|
-
}): Promise<unknown>;
|
|
1549
|
-
valueMany(names: string[], options?: {
|
|
1550
|
-
localCache?: boolean;
|
|
1551
|
-
}): Promise<Record<string, unknown>>;
|
|
1552
|
-
private valueMaxBytes;
|
|
1553
|
-
}
|
|
1554
|
-
declare class WorkflowFlowCommands {
|
|
1555
|
-
private readonly ctx;
|
|
1556
|
-
constructor(ctx: WorkflowContext);
|
|
1557
|
-
get(id?: string, options?: {
|
|
1558
|
-
partitionKey?: string;
|
|
1559
|
-
full?: boolean;
|
|
1560
|
-
}): Promise<FlowRecord | undefined>;
|
|
1561
|
-
history(id?: string, options?: Parameters<FerricStoreClient["history"]>[1]): Promise<unknown[]>;
|
|
1562
|
-
create(id: string, options?: Omit<Parameters<FerricStoreClient["create"]>[1], "type"> & {
|
|
1563
|
-
type?: string;
|
|
1564
|
-
}): Promise<FlowRecord | Buffer | unknown>;
|
|
1565
|
-
transition(toState: string, options?: Partial<Omit<Parameters<FerricStoreClient["transition"]>[1], "toState" | "fromState" | "leaseToken" | "fencingToken">> & {
|
|
1566
|
-
fromState?: string;
|
|
1567
|
-
}): Promise<FlowRecord | Buffer | unknown>;
|
|
1568
|
-
complete(options?: Partial<Omit<Parameters<FerricStoreClient["complete"]>[1], "leaseToken" | "fencingToken">>): Promise<FlowRecord | Buffer | unknown>;
|
|
1569
|
-
retry(options?: Partial<Omit<Parameters<FerricStoreClient["retry"]>[1], "leaseToken" | "fencingToken">>): Promise<FlowRecord | Buffer | unknown>;
|
|
1570
|
-
fail(options?: Partial<Omit<Parameters<FerricStoreClient["fail"]>[1], "leaseToken" | "fencingToken">>): Promise<FlowRecord | Buffer | unknown>;
|
|
1571
|
-
signal(signal: string, options?: Omit<Parameters<FerricStoreClient["signal"]>[1], "signal">): Promise<unknown>;
|
|
1572
|
-
putValue(name: string, value: unknown, options?: Parameters<FerricStoreClient["valuePut"]>[1]): Promise<unknown>;
|
|
1573
|
-
value(name: string, defaultValue?: unknown, options?: {
|
|
1574
|
-
localCache?: boolean;
|
|
1575
|
-
}): Promise<unknown>;
|
|
1576
|
-
values(names: string[], options?: {
|
|
1577
|
-
localCache?: boolean;
|
|
1578
|
-
}): Promise<Record<string, unknown>>;
|
|
1579
|
-
spawnChildren(children: ChildSpec[], options?: Parameters<FerricStoreClient["spawnChildren"]>[2]): Promise<unknown>;
|
|
1580
|
-
}
|
|
1581
2345
|
declare class WorkflowWorker {
|
|
1582
2346
|
readonly workflow: Workflow;
|
|
1583
2347
|
readonly options: WorkerConfig & {
|
|
@@ -1588,8 +2352,15 @@ declare class WorkflowWorker {
|
|
|
1588
2352
|
});
|
|
1589
2353
|
runOnce(): Promise<WorkflowWorkerResult>;
|
|
1590
2354
|
run(): Promise<void>;
|
|
2355
|
+
private runInWaves;
|
|
2356
|
+
private runContinuously;
|
|
2357
|
+
private resolveStates;
|
|
2358
|
+
private claimState;
|
|
1591
2359
|
private applyJob;
|
|
1592
2360
|
private applyHandlerError;
|
|
1593
2361
|
}
|
|
1594
2362
|
|
|
1595
|
-
|
|
2363
|
+
/** @deprecated Use RequestDisposition; retained for source compatibility. */
|
|
2364
|
+
type ConnectionRequestDisposition = RequestDisposition;
|
|
2365
|
+
|
|
2366
|
+
export { type AdminListOptions, type ApprovalListOptions, type ApprovalRequestOptions, type AttributeQueryOptions, type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, type BudgetCommitOptions, type BudgetReserveOptions, COMMAND_OPCODES, COMPACT_RESPONSE_OPCODES, type CancelOptions, type ChildSpec, type CircuitOpenOptions, type ClaimDueOptions, ClaimHydrationError, type ClaimHydrationItem, type ClaimedItem, type Codec, type CollectionScanOptions, type Command, type CommandArgument, type CommandExecutor, type CompleteJobsAndClaimJobsResult, type CompleteManyOptions, type CompleteOptions, type CompleteOutcome, ConnectionClosedError, type ConnectionRequestDisposition, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type EffectCompensateOptions, type EffectConfirmOptions, type EffectFailOptions, type EffectReserveOptions, type EffectStatusOptions, type EndpointPolicy, type ExceptionPolicy, type ExecutePipelineOptions, type ExpiryCondition, type ExtendLeaseOptions, type FailOptions, type FailOutcome, type FencedItem, type FencingToken, FerricStoreClient, type FerricStoreClientFromUrlOptions, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeComputeResult, type FetchOrComputeFencedResult, type FetchOrComputeHitResult, type FetchOrComputeLegacyResult, type FetchOrComputeResult, type FlowAdminRecord, FlowAlreadyExistsError, type FlowBatchCompletedItem, FlowBatchError, FlowNotFoundError, type FlowPolicyOptions, type FlowRecord, type FlowStateMode, type FlowStatePolicy, type FlowStatePolicyLike, type FlowStatsOptions, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, type GovernanceLedgerOptions, type HashScanResult, HashStore, type HistoryOptions, HyperLogLogStore, type IntegerReply, InvalidCommandError, type InvocationCreateOptions, JsonCodec, type KeyInfo, KeyValueStore, type LeaseMutationOptions, LeaseRenewalError, type LimitAmountOptions, type LimitLeaseOptions, type LimitListOptions, type LimitReleaseOptions, ListStore, LockHeldError, LockNotOwnedError, type ManagementPairs, type MaxActiveMs, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type NativeClientOptions, type NativeProtocolEvent, type Outcome, OverloadedError, type ProtocolCommand, Queue, type QueueBatchHandler, QueueClient, QueueCompletionError, 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 RequestDisposition, RequestTimeoutError, RerouteError, type RetryOptions, type RetryOutcome, type RetryPolicy, type RoutingEndpoint, type RoutingRoute, RoutingTopology, type RunStepsItem, type RunStepsManyOptions, type ScanOptions, type ScheduleFireDueOptions, type ScheduleListOptions, type ScheduleOptions, type SearchOptions, type SearchStateMeta, type SetOptions, type SetScanResult, SetStore, type SortedSetScanResult, SortedSetStore, StaleLeaseError, type StartAndClaimOptions, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StepContinueOptions, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, type TopologyNativeAdapterOptions, TopologyNativeAdapterPool, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, type WorkerRefillStrategy, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, isOutcome, isReconnectableClosedConnectionError, mapException, retry, transition };
|