@kurrent/kurrentdb-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +201 -0
- package/dist/Client/ServerFeatures.d.ts +17 -0
- package/dist/Client/ServerFeatures.js +56 -0
- package/dist/Client/ServerFeatures.js.map +1 -0
- package/dist/Client/discovery.d.ts +15 -0
- package/dist/Client/discovery.js +135 -0
- package/dist/Client/discovery.js.map +1 -0
- package/dist/Client/http.d.ts +19 -0
- package/dist/Client/http.js +97 -0
- package/dist/Client/http.js.map +1 -0
- package/dist/Client/index.d.ts +119 -0
- package/dist/Client/index.js +390 -0
- package/dist/Client/index.js.map +1 -0
- package/dist/Client/parseConnectionString.d.ts +23 -0
- package/dist/Client/parseConnectionString.js +238 -0
- package/dist/Client/parseConnectionString.js.map +1 -0
- package/dist/constants.d.ts +58 -0
- package/dist/constants.js +75 -0
- package/dist/constants.js.map +1 -0
- package/dist/events/binaryEvent.d.ts +16 -0
- package/dist/events/binaryEvent.js +14 -0
- package/dist/events/binaryEvent.js.map +1 -0
- package/dist/events/convertMetadata.d.ts +1 -0
- package/dist/events/convertMetadata.js +11 -0
- package/dist/events/convertMetadata.js.map +1 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.js +19 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/jsonEvent.d.ts +8 -0
- package/dist/events/jsonEvent.js +14 -0
- package/dist/events/jsonEvent.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/persistentSubscription/createPersistentSubscriptionToAll.d.ts +23 -0
- package/dist/persistentSubscription/createPersistentSubscriptionToAll.js +90 -0
- package/dist/persistentSubscription/createPersistentSubscriptionToAll.js.map +1 -0
- package/dist/persistentSubscription/createPersistentSubscriptionToStream.d.ts +17 -0
- package/dist/persistentSubscription/createPersistentSubscriptionToStream.js +49 -0
- package/dist/persistentSubscription/createPersistentSubscriptionToStream.js.map +1 -0
- package/dist/persistentSubscription/deletePersistentSubscriptionToAll.d.ts +13 -0
- package/dist/persistentSubscription/deletePersistentSubscriptionToAll.js +30 -0
- package/dist/persistentSubscription/deletePersistentSubscriptionToAll.js.map +1 -0
- package/dist/persistentSubscription/deletePersistentSubscriptionToStream.d.ts +13 -0
- package/dist/persistentSubscription/deletePersistentSubscriptionToStream.js +28 -0
- package/dist/persistentSubscription/deletePersistentSubscriptionToStream.js.map +1 -0
- package/dist/persistentSubscription/getPersistentSubscriptionToAllInfo.d.ts +13 -0
- package/dist/persistentSubscription/getPersistentSubscriptionToAllInfo.js +31 -0
- package/dist/persistentSubscription/getPersistentSubscriptionToAllInfo.js.map +1 -0
- package/dist/persistentSubscription/getPersistentSubscriptionToStreamInfo.d.ts +14 -0
- package/dist/persistentSubscription/getPersistentSubscriptionToStreamInfo.js +49 -0
- package/dist/persistentSubscription/getPersistentSubscriptionToStreamInfo.js.map +1 -0
- package/dist/persistentSubscription/index.d.ts +16 -0
- package/dist/persistentSubscription/index.js +33 -0
- package/dist/persistentSubscription/index.js.map +1 -0
- package/dist/persistentSubscription/listAllPersistentSubscriptions.d.ts +13 -0
- package/dist/persistentSubscription/listAllPersistentSubscriptions.js +42 -0
- package/dist/persistentSubscription/listAllPersistentSubscriptions.js.map +1 -0
- package/dist/persistentSubscription/listPersistentSubscriptionsToAll.d.ts +13 -0
- package/dist/persistentSubscription/listPersistentSubscriptionsToAll.js +33 -0
- package/dist/persistentSubscription/listPersistentSubscriptionsToAll.js.map +1 -0
- package/dist/persistentSubscription/listPersistentSubscriptionsToStream.d.ts +14 -0
- package/dist/persistentSubscription/listPersistentSubscriptionsToStream.js +51 -0
- package/dist/persistentSubscription/listPersistentSubscriptionsToStream.js.map +1 -0
- package/dist/persistentSubscription/replayParkedMessagesToAll.d.ts +18 -0
- package/dist/persistentSubscription/replayParkedMessagesToAll.js +36 -0
- package/dist/persistentSubscription/replayParkedMessagesToAll.js.map +1 -0
- package/dist/persistentSubscription/replayParkedMessagesToStream.d.ts +19 -0
- package/dist/persistentSubscription/replayParkedMessagesToStream.js +57 -0
- package/dist/persistentSubscription/replayParkedMessagesToStream.js.map +1 -0
- package/dist/persistentSubscription/restartPersistentSubscriptionSubsystem.d.ts +11 -0
- package/dist/persistentSubscription/restartPersistentSubscriptionSubsystem.js +30 -0
- package/dist/persistentSubscription/restartPersistentSubscriptionSubsystem.js.map +1 -0
- package/dist/persistentSubscription/subscribeToPersistentSubscriptionToAll.d.ts +20 -0
- package/dist/persistentSubscription/subscribeToPersistentSubscriptionToAll.js +38 -0
- package/dist/persistentSubscription/subscribeToPersistentSubscriptionToAll.js.map +1 -0
- package/dist/persistentSubscription/subscribeToPersistentSubscriptionToStream.d.ts +20 -0
- package/dist/persistentSubscription/subscribeToPersistentSubscriptionToStream.js +37 -0
- package/dist/persistentSubscription/subscribeToPersistentSubscriptionToStream.js.map +1 -0
- package/dist/persistentSubscription/updatePersistentSubscriptionToAll.d.ts +15 -0
- package/dist/persistentSubscription/updatePersistentSubscriptionToAll.js +53 -0
- package/dist/persistentSubscription/updatePersistentSubscriptionToAll.js.map +1 -0
- package/dist/persistentSubscription/updatePersistentSubscriptionToStream.d.ts +15 -0
- package/dist/persistentSubscription/updatePersistentSubscriptionToStream.js +49 -0
- package/dist/persistentSubscription/updatePersistentSubscriptionToStream.js.map +1 -0
- package/dist/persistentSubscription/utils/PersistentSubscriptionImpl.d.ts +18 -0
- package/dist/persistentSubscription/utils/PersistentSubscriptionImpl.js +112 -0
- package/dist/persistentSubscription/utils/PersistentSubscriptionImpl.js.map +1 -0
- package/dist/persistentSubscription/utils/mapPersistentSubscriptionInfo.d.ts +146 -0
- package/dist/persistentSubscription/utils/mapPersistentSubscriptionInfo.js +204 -0
- package/dist/persistentSubscription/utils/mapPersistentSubscriptionInfo.js.map +1 -0
- package/dist/persistentSubscription/utils/persistentSubscriptionSettings.d.ts +90 -0
- package/dist/persistentSubscription/utils/persistentSubscriptionSettings.js +39 -0
- package/dist/persistentSubscription/utils/persistentSubscriptionSettings.js.map +1 -0
- package/dist/persistentSubscription/utils/settingsToGRPC.d.ts +5 -0
- package/dist/persistentSubscription/utils/settingsToGRPC.js +49 -0
- package/dist/persistentSubscription/utils/settingsToGRPC.js.map +1 -0
- package/dist/projections/createProjection.d.ts +24 -0
- package/dist/projections/createProjection.js +48 -0
- package/dist/projections/createProjection.js.map +1 -0
- package/dist/projections/deleteProjection.d.ts +28 -0
- package/dist/projections/deleteProjection.js +33 -0
- package/dist/projections/deleteProjection.js.map +1 -0
- package/dist/projections/disableProjection.d.ts +19 -0
- package/dist/projections/disableProjection.js +34 -0
- package/dist/projections/disableProjection.js.map +1 -0
- package/dist/projections/enableProjection.d.ts +12 -0
- package/dist/projections/enableProjection.js +25 -0
- package/dist/projections/enableProjection.js.map +1 -0
- package/dist/projections/getProjectionResult.d.ts +17 -0
- package/dist/projections/getProjectionResult.js +29 -0
- package/dist/projections/getProjectionResult.js.map +1 -0
- package/dist/projections/getProjectionState.d.ts +17 -0
- package/dist/projections/getProjectionState.js +29 -0
- package/dist/projections/getProjectionState.js.map +1 -0
- package/dist/projections/getProjectionStatus.d.ts +12 -0
- package/dist/projections/getProjectionStatus.js +36 -0
- package/dist/projections/getProjectionStatus.js.map +1 -0
- package/dist/projections/index.d.ts +11 -0
- package/dist/projections/index.js +28 -0
- package/dist/projections/index.js.map +1 -0
- package/dist/projections/listProjections.d.ts +12 -0
- package/dist/projections/listProjections.js +36 -0
- package/dist/projections/listProjections.js.map +1 -0
- package/dist/projections/resetProjection.d.ts +13 -0
- package/dist/projections/resetProjection.js +25 -0
- package/dist/projections/resetProjection.js.map +1 -0
- package/dist/projections/restartSubsystem.d.ts +11 -0
- package/dist/projections/restartSubsystem.js +21 -0
- package/dist/projections/restartSubsystem.js.map +1 -0
- package/dist/projections/updateProjection.d.ts +20 -0
- package/dist/projections/updateProjection.js +34 -0
- package/dist/projections/updateProjection.js.map +1 -0
- package/dist/projections/utils/mapGrpcProjectionDetails.d.ts +3 -0
- package/dist/projections/utils/mapGrpcProjectionDetails.js +31 -0
- package/dist/projections/utils/mapGrpcProjectionDetails.js.map +1 -0
- package/dist/streams/appendToStream/append.d.ts +5 -0
- package/dist/streams/appendToStream/append.js +131 -0
- package/dist/streams/appendToStream/append.js.map +1 -0
- package/dist/streams/appendToStream/batchAppend.d.ts +5 -0
- package/dist/streams/appendToStream/batchAppend.js +145 -0
- package/dist/streams/appendToStream/batchAppend.js.map +1 -0
- package/dist/streams/appendToStream/index.d.ts +24 -0
- package/dist/streams/appendToStream/index.js +24 -0
- package/dist/streams/appendToStream/index.js.map +1 -0
- package/dist/streams/appendToStream/unpackError.d.ts +5 -0
- package/dist/streams/appendToStream/unpackError.js +54 -0
- package/dist/streams/appendToStream/unpackError.js.map +1 -0
- package/dist/streams/deleteStream.d.ts +18 -0
- package/dist/streams/deleteStream.js +51 -0
- package/dist/streams/deleteStream.js.map +1 -0
- package/dist/streams/getStreamMetadata.d.ts +27 -0
- package/dist/streams/getStreamMetadata.js +40 -0
- package/dist/streams/getStreamMetadata.js.map +1 -0
- package/dist/streams/index.d.ts +9 -0
- package/dist/streams/index.js +27 -0
- package/dist/streams/index.js.map +1 -0
- package/dist/streams/readAll.d.ts +39 -0
- package/dist/streams/readAll.js +38 -0
- package/dist/streams/readAll.js.map +1 -0
- package/dist/streams/readStream.d.ts +35 -0
- package/dist/streams/readStream.js +58 -0
- package/dist/streams/readStream.js.map +1 -0
- package/dist/streams/setStreamMetadata.d.ts +20 -0
- package/dist/streams/setStreamMetadata.js +20 -0
- package/dist/streams/setStreamMetadata.js.map +1 -0
- package/dist/streams/subscribeToAll.d.ts +30 -0
- package/dist/streams/subscribeToAll.js +89 -0
- package/dist/streams/subscribeToAll.js.map +1 -0
- package/dist/streams/subscribeToStream.d.ts +27 -0
- package/dist/streams/subscribeToStream.js +52 -0
- package/dist/streams/subscribeToStream.js.map +1 -0
- package/dist/streams/tombstoneStream.d.ts +18 -0
- package/dist/streams/tombstoneStream.js +51 -0
- package/dist/streams/tombstoneStream.js.map +1 -0
- package/dist/streams/utils/ReadStream.d.ts +14 -0
- package/dist/streams/utils/ReadStream.js +61 -0
- package/dist/streams/utils/ReadStream.js.map +1 -0
- package/dist/streams/utils/Subscription.d.ts +16 -0
- package/dist/streams/utils/Subscription.js +71 -0
- package/dist/streams/utils/Subscription.js.map +1 -0
- package/dist/streams/utils/streamMetadata.d.ts +53 -0
- package/dist/streams/utils/streamMetadata.js +77 -0
- package/dist/streams/utils/streamMetadata.js.map +1 -0
- package/dist/streams/utils/systemStreams.d.ts +20 -0
- package/dist/streams/utils/systemStreams.js +28 -0
- package/dist/streams/utils/systemStreams.js.map +1 -0
- package/dist/types/events.d.ts +157 -0
- package/dist/types/events.js +3 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +348 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/CommandError.d.ts +174 -0
- package/dist/utils/CommandError.js +403 -0
- package/dist/utils/CommandError.js.map +1 -0
- package/dist/utils/backpressuredWrite.d.ts +2 -0
- package/dist/utils/backpressuredWrite.js +50 -0
- package/dist/utils/backpressuredWrite.js.map +1 -0
- package/dist/utils/convertBridgeError.d.ts +1 -0
- package/dist/utils/convertBridgeError.js +41 -0
- package/dist/utils/convertBridgeError.js.map +1 -0
- package/dist/utils/convertGrpcEvent.d.ts +10 -0
- package/dist/utils/convertGrpcEvent.js +135 -0
- package/dist/utils/convertGrpcEvent.js.map +1 -0
- package/dist/utils/convertRustEvent.d.ts +4 -0
- package/dist/utils/convertRustEvent.js +85 -0
- package/dist/utils/convertRustEvent.js.map +1 -0
- package/dist/utils/debug.d.ts +7 -0
- package/dist/utils/debug.js +30 -0
- package/dist/utils/debug.js.map +1 -0
- package/dist/utils/filter.d.ts +44 -0
- package/dist/utils/filter.js +29 -0
- package/dist/utils/filter.js.map +1 -0
- package/dist/utils/grpcStreamIdentifier.d.ts +2 -0
- package/dist/utils/grpcStreamIdentifier.js +11 -0
- package/dist/utils/grpcStreamIdentifier.js.map +1 -0
- package/dist/utils/grpcUUID.d.ts +4 -0
- package/dist/utils/grpcUUID.js +29 -0
- package/dist/utils/grpcUUID.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +26 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/isClientCancellationError.d.ts +1 -0
- package/dist/utils/isClientCancellationError.js +13 -0
- package/dist/utils/isClientCancellationError.js.map +1 -0
- package/dist/utils/utilityTypes.d.ts +2 -0
- package/dist/utils/utilityTypes.js +3 -0
- package/dist/utils/utilityTypes.js.map +1 -0
- package/generated/cluster_grpc_pb.d.ts +211 -0
- package/generated/cluster_grpc_pb.js +247 -0
- package/generated/cluster_pb.d.ts +546 -0
- package/generated/cluster_pb.js +4357 -0
- package/generated/code_grpc_pb.js +1 -0
- package/generated/code_pb.d.ts +27 -0
- package/generated/code_pb.js +48 -0
- package/generated/gossip_grpc_pb.d.ts +42 -0
- package/generated/gossip_grpc_pb.js +45 -0
- package/generated/gossip_pb.d.ts +111 -0
- package/generated/gossip_pb.js +727 -0
- package/generated/monitoring_grpc_pb.d.ts +39 -0
- package/generated/monitoring_grpc_pb.js +44 -0
- package/generated/monitoring_pb.d.ts +52 -0
- package/generated/monitoring_pb.js +361 -0
- package/generated/operations_grpc_pb.d.ts +144 -0
- package/generated/operations_grpc_pb.js +144 -0
- package/generated/operations_pb.d.ts +151 -0
- package/generated/operations_pb.js +1050 -0
- package/generated/persistent_grpc_pb.d.ts +160 -0
- package/generated/persistent_grpc_pb.js +265 -0
- package/generated/persistent_pb.d.ts +1702 -0
- package/generated/persistent_pb.js +12340 -0
- package/generated/projections_grpc_pb.d.ts +194 -0
- package/generated/projections_grpc_pb.js +332 -0
- package/generated/projections_pb.d.ts +821 -0
- package/generated/projections_pb.js +6065 -0
- package/generated/serverfeatures_grpc_pb.d.ts +42 -0
- package/generated/serverfeatures_grpc_pb.js +45 -0
- package/generated/serverfeatures_pb.d.ts +61 -0
- package/generated/serverfeatures_pb.js +476 -0
- package/generated/shared_grpc_pb.js +1 -0
- package/generated/shared_pb.d.ts +335 -0
- package/generated/shared_pb.js +2374 -0
- package/generated/status_grpc_pb.js +1 -0
- package/generated/status_pb.d.ts +38 -0
- package/generated/status_pb.js +261 -0
- package/generated/streams_grpc_pb.d.ts +112 -0
- package/generated/streams_grpc_pb.js +180 -0
- package/generated/streams_pb.d.ts +1660 -0
- package/generated/streams_pb.js +11556 -0
- package/generated/users_grpc_pb.d.ts +158 -0
- package/generated/users_grpc_pb.js +275 -0
- package/generated/users_pb.d.ts +601 -0
- package/generated/users_pb.js +4451 -0
- package/package.json +64 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import type { Readable } from "stream";
|
|
2
|
+
import type { Client as GRPCClient, ClientOptions as GRPCClientOptions, ChannelCredentials } from "@grpc/grpc-js";
|
|
3
|
+
import { MemberInfo as GrpcMemberInfo } from "../../generated/gossip_pb";
|
|
4
|
+
import VNodeState = GrpcMemberInfo.VNodeState;
|
|
5
|
+
import type { ResolvedEvent, AllStreamResolvedEvent, EventType, PersistentSubscriptionToAllResolvedEvent, PersistentSubscriptionToStreamResolvedEvent } from "./events";
|
|
6
|
+
import type * as constants from "../constants";
|
|
7
|
+
export interface BaseOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Overwrite the default credentials.
|
|
10
|
+
*/
|
|
11
|
+
credentials?: Credentials;
|
|
12
|
+
/**
|
|
13
|
+
* Command requires a leader node.
|
|
14
|
+
*/
|
|
15
|
+
requiresLeader?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* An optional length of time (in milliseconds) to override the default deadline.
|
|
18
|
+
*/
|
|
19
|
+
deadline?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A structure referring to a potential logical record position in the KurrentDB transaction file.
|
|
23
|
+
*/
|
|
24
|
+
export type Position = {
|
|
25
|
+
commit: bigint;
|
|
26
|
+
prepare: bigint;
|
|
27
|
+
};
|
|
28
|
+
export type ReadRevision = typeof constants.START | typeof constants.END | bigint;
|
|
29
|
+
export type ReadPosition = typeof constants.START | typeof constants.END | Position;
|
|
30
|
+
/**
|
|
31
|
+
* Constants used for expected version control. The use of expected version can be a bit tricky especially when
|
|
32
|
+
* discussing assurances given by the KurrentDB server.
|
|
33
|
+
*
|
|
34
|
+
* The KurrentDB server will assure idempotency for all operations using any value in ExpectedVersion except
|
|
35
|
+
* {@link ANY}. When using {@link ANY}., the KurrentDB server will do its best to assure
|
|
36
|
+
* idempotency but will not guarantee idempotency.
|
|
37
|
+
*/
|
|
38
|
+
export type StreamState = typeof constants.ANY
|
|
39
|
+
/**
|
|
40
|
+
* The stream being written to should not yet exist. If it does exist, treats that as a concurrency problem.
|
|
41
|
+
*/
|
|
42
|
+
| typeof constants.NO_STREAM
|
|
43
|
+
/**
|
|
44
|
+
* States that the last event written to the stream should have an event number matching your expected value.
|
|
45
|
+
*/
|
|
46
|
+
| bigint;
|
|
47
|
+
export type AppendStreamState =
|
|
48
|
+
/**
|
|
49
|
+
* The stream should exist. If it or a metadata stream does not exist, treats that as a concurrency problem.
|
|
50
|
+
*/
|
|
51
|
+
typeof constants.STREAM_EXISTS
|
|
52
|
+
/**
|
|
53
|
+
* @see {@link StreamState}.
|
|
54
|
+
*/
|
|
55
|
+
| StreamState;
|
|
56
|
+
export type CurrentStreamState =
|
|
57
|
+
/**
|
|
58
|
+
* The stream being written to does not yet exist.
|
|
59
|
+
*/
|
|
60
|
+
typeof constants.NO_STREAM
|
|
61
|
+
/**
|
|
62
|
+
* The current event number of the last event written to the stream.
|
|
63
|
+
*/
|
|
64
|
+
| bigint;
|
|
65
|
+
/**
|
|
66
|
+
* Represents the direction of read operation (both from '$all' and a regular stream).
|
|
67
|
+
*/
|
|
68
|
+
export type Direction = typeof constants.FORWARDS | typeof constants.BACKWARDS;
|
|
69
|
+
export interface AppendResult {
|
|
70
|
+
/**
|
|
71
|
+
* If the append was successful. Only relevent if `throwOnAppendFailure` is set to false.
|
|
72
|
+
*/
|
|
73
|
+
success: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The current revision of the stream, to be passed as the `expectedRevision` in the next call.
|
|
76
|
+
*/
|
|
77
|
+
nextExpectedRevision: bigint;
|
|
78
|
+
/**
|
|
79
|
+
* The logical record position in the KurrentDB transaction file.
|
|
80
|
+
*/
|
|
81
|
+
position?: Position;
|
|
82
|
+
}
|
|
83
|
+
export type ProjectionStatus = typeof constants.CREATING | typeof constants.LOADING | typeof constants.LOADED | typeof constants.PREPARING | typeof constants.PREPARED | typeof constants.STARTING | typeof constants.LOADING_STOPPED | typeof constants.RUNNING | typeof constants.STOPPING | typeof constants.ABORTING | typeof constants.STOPPED | typeof constants.COMPLETED | typeof constants.ABORTED | typeof constants.FAULTED | typeof constants.DELETING;
|
|
84
|
+
export type ProcessingStatus = typeof constants.PAUSED | typeof constants.WRITING_RESULTS | typeof constants.STOPPED | "";
|
|
85
|
+
/**
|
|
86
|
+
* Provides the details for a projection.
|
|
87
|
+
*/
|
|
88
|
+
export interface ProjectionDetails {
|
|
89
|
+
/**
|
|
90
|
+
* The CoreProcessingTime.
|
|
91
|
+
*/
|
|
92
|
+
coreProcessingTime: bigint;
|
|
93
|
+
/**
|
|
94
|
+
* The projection version.
|
|
95
|
+
*/
|
|
96
|
+
version: bigint;
|
|
97
|
+
/**
|
|
98
|
+
* The Epoch.
|
|
99
|
+
*/
|
|
100
|
+
epoch: bigint;
|
|
101
|
+
/**
|
|
102
|
+
* The projection EffectiveName.
|
|
103
|
+
*/
|
|
104
|
+
effectiveName: string;
|
|
105
|
+
/**
|
|
106
|
+
* The projection WritesInProgress.
|
|
107
|
+
*/
|
|
108
|
+
writesInProgress: number;
|
|
109
|
+
/**
|
|
110
|
+
* The projection ReadsInProgress.
|
|
111
|
+
*/
|
|
112
|
+
readsInProgress: number;
|
|
113
|
+
/**
|
|
114
|
+
* The projection PartitionsCached.
|
|
115
|
+
*/
|
|
116
|
+
partitionsCached: number;
|
|
117
|
+
/**
|
|
118
|
+
* The raw status of the projection.
|
|
119
|
+
* Split into {@link projectionStatus} and {@link processingStatus} for convenience.
|
|
120
|
+
*/
|
|
121
|
+
status: string;
|
|
122
|
+
/**
|
|
123
|
+
* The current status of the projection.
|
|
124
|
+
*/
|
|
125
|
+
projectionStatus: ProjectionStatus;
|
|
126
|
+
/**
|
|
127
|
+
* The current status of the projection.
|
|
128
|
+
*/
|
|
129
|
+
processingStatus: ProcessingStatus;
|
|
130
|
+
/**
|
|
131
|
+
* The projection StateReason.
|
|
132
|
+
*/
|
|
133
|
+
stateReason: string;
|
|
134
|
+
/**
|
|
135
|
+
* The projection Name.
|
|
136
|
+
*/
|
|
137
|
+
name: string;
|
|
138
|
+
/**
|
|
139
|
+
* The projection Position.
|
|
140
|
+
*/
|
|
141
|
+
position: string;
|
|
142
|
+
/**
|
|
143
|
+
* The projection Progress.
|
|
144
|
+
*/
|
|
145
|
+
progress: number;
|
|
146
|
+
/**
|
|
147
|
+
* LastCheckpoint.
|
|
148
|
+
*/
|
|
149
|
+
lastCheckpoint: string;
|
|
150
|
+
/**
|
|
151
|
+
* The projection EventsProcessedAfterRestart.
|
|
152
|
+
*/
|
|
153
|
+
eventsProcessedAfterRestart: bigint;
|
|
154
|
+
/**
|
|
155
|
+
* The projection CheckpointStatus.
|
|
156
|
+
*/
|
|
157
|
+
checkpointStatus: string;
|
|
158
|
+
/**
|
|
159
|
+
* The projection BufferedEvents.
|
|
160
|
+
*/
|
|
161
|
+
bufferedEvents: bigint;
|
|
162
|
+
/**
|
|
163
|
+
* The projection WritePendingEventsBeforeCheckpoint.
|
|
164
|
+
*/
|
|
165
|
+
writePendingEventsBeforeCheckpoint: number;
|
|
166
|
+
/**
|
|
167
|
+
* The projection WritePendingEventsAfterCheckpoint.
|
|
168
|
+
*/
|
|
169
|
+
writePendingEventsAfterCheckpoint: number;
|
|
170
|
+
}
|
|
171
|
+
export interface DeleteResult {
|
|
172
|
+
position?: Position;
|
|
173
|
+
}
|
|
174
|
+
export type ConsumerStrategy = typeof constants.DISPATCH_TO_SINGLE | typeof constants.ROUND_ROBIN | typeof constants.PINNED;
|
|
175
|
+
export type PersistentAction = typeof constants.PARK | typeof constants.RETRY | typeof constants.SKIP | typeof constants.STOP;
|
|
176
|
+
export type NodePreference = typeof constants.RANDOM | typeof constants.FOLLOWER | typeof constants.LEADER | typeof constants.READ_ONLY_REPLICA;
|
|
177
|
+
export interface EndPoint {
|
|
178
|
+
address: string;
|
|
179
|
+
port: number;
|
|
180
|
+
}
|
|
181
|
+
export interface MemberInfo {
|
|
182
|
+
instanceId?: string;
|
|
183
|
+
timeStamp: number;
|
|
184
|
+
state: VNodeState;
|
|
185
|
+
isAlive: boolean;
|
|
186
|
+
httpEndpoint?: EndPoint;
|
|
187
|
+
}
|
|
188
|
+
export type VerifyOptions = Parameters<typeof ChannelCredentials.createSsl>[3];
|
|
189
|
+
export type GRPCClientConstructor<T extends GRPCClient> = new (address: string, credentials: ChannelCredentials, options?: Partial<GRPCClientOptions>) => T;
|
|
190
|
+
export type FilterOn = typeof constants.EVENT_TYPE | typeof constants.STREAM_NAME;
|
|
191
|
+
export interface FilterBase {
|
|
192
|
+
/**
|
|
193
|
+
* What to filter on.
|
|
194
|
+
*/
|
|
195
|
+
filterOn: FilterOn;
|
|
196
|
+
/**
|
|
197
|
+
* Sets how often the checkpointReached callback is called.
|
|
198
|
+
* Must be greater than 0.
|
|
199
|
+
*/
|
|
200
|
+
checkpointInterval: number;
|
|
201
|
+
/**
|
|
202
|
+
* A callback invoked and await when a checkpoint is reached.
|
|
203
|
+
* Set the checkpointInterval to define how often this method is called.
|
|
204
|
+
*/
|
|
205
|
+
checkpointReached?: (subscription: AllStreamSubscription, position: Position) => Promise<void> | void;
|
|
206
|
+
/**
|
|
207
|
+
* The maximum number of events that are filtered out before the page is returned
|
|
208
|
+
* Must be greater than 0, if supplied.
|
|
209
|
+
*/
|
|
210
|
+
maxSearchWindow?: number;
|
|
211
|
+
}
|
|
212
|
+
export interface RegexFilter extends FilterBase {
|
|
213
|
+
/**
|
|
214
|
+
* A regex to filter by.
|
|
215
|
+
*/
|
|
216
|
+
regex: string;
|
|
217
|
+
}
|
|
218
|
+
export interface PrefixesFilter extends FilterBase {
|
|
219
|
+
/**
|
|
220
|
+
* A list of prefixes to filter on.
|
|
221
|
+
*/
|
|
222
|
+
prefixes: string[];
|
|
223
|
+
}
|
|
224
|
+
export type Filter = RegexFilter | PrefixesFilter;
|
|
225
|
+
export interface Credentials {
|
|
226
|
+
username: string;
|
|
227
|
+
password: string;
|
|
228
|
+
}
|
|
229
|
+
export interface Certificate {
|
|
230
|
+
userCertFile: Buffer;
|
|
231
|
+
userKeyFile: Buffer;
|
|
232
|
+
}
|
|
233
|
+
export interface StreamingRead<E> extends Readable {
|
|
234
|
+
cancel(): Promise<void>;
|
|
235
|
+
addListener(event: "close", listener: () => void): this;
|
|
236
|
+
addListener(event: "data", listener: (event: E) => void): this;
|
|
237
|
+
addListener(event: "end", listener: () => void): this;
|
|
238
|
+
addListener(event: "readable", listener: () => void): this;
|
|
239
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
240
|
+
addListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
241
|
+
on(event: "close", listener: () => void): this;
|
|
242
|
+
on(event: "data", listener: (event: E) => void): this;
|
|
243
|
+
on(event: "end", listener: () => void): this;
|
|
244
|
+
on(event: "readable", listener: () => void): this;
|
|
245
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
246
|
+
on(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
247
|
+
once(event: "close", listener: () => void): this;
|
|
248
|
+
once(event: "data", listener: (event: E) => void): this;
|
|
249
|
+
once(event: "end", listener: () => void): this;
|
|
250
|
+
once(event: "readable", listener: () => void): this;
|
|
251
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
252
|
+
once(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
253
|
+
prependListener(event: "close", listener: () => void): this;
|
|
254
|
+
prependListener(event: "data", listener: (event: E) => void): this;
|
|
255
|
+
prependListener(event: "end", listener: () => void): this;
|
|
256
|
+
prependListener(event: "readable", listener: () => void): this;
|
|
257
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
258
|
+
prependListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
259
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
260
|
+
prependOnceListener(event: "data", listener: (event: E) => void): this;
|
|
261
|
+
prependOnceListener(event: "end", listener: () => void): this;
|
|
262
|
+
prependOnceListener(event: "readable", listener: () => void): this;
|
|
263
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
264
|
+
prependOnceListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
265
|
+
removeListener(event: "close", listener: () => void): this;
|
|
266
|
+
removeListener(event: "data", listener: (event: E) => void): this;
|
|
267
|
+
removeListener(event: "end", listener: () => void): this;
|
|
268
|
+
removeListener(event: "error", listener: (err: Error) => void): this;
|
|
269
|
+
removeListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
270
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<E>;
|
|
271
|
+
}
|
|
272
|
+
export interface ReadableSubscription<E> extends Readable {
|
|
273
|
+
id?: string;
|
|
274
|
+
unsubscribe(): Promise<void>;
|
|
275
|
+
addListener(event: "close", listener: () => void): this;
|
|
276
|
+
addListener(event: "data", listener: (event: E) => void): this;
|
|
277
|
+
addListener(event: "end", listener: () => void): this;
|
|
278
|
+
addListener(event: "readable", listener: () => void): this;
|
|
279
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
280
|
+
addListener(event: "confirmation", listener: () => void): this;
|
|
281
|
+
addListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
282
|
+
on(event: "close", listener: () => void): this;
|
|
283
|
+
on(event: "data", listener: (event: E) => void): this;
|
|
284
|
+
on(event: "end", listener: () => void): this;
|
|
285
|
+
on(event: "readable", listener: () => void): this;
|
|
286
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
287
|
+
on(event: "confirmation", listener: () => void): this;
|
|
288
|
+
on(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
289
|
+
once(event: "close", listener: () => void): this;
|
|
290
|
+
once(event: "data", listener: (event: E) => void): this;
|
|
291
|
+
once(event: "end", listener: () => void): this;
|
|
292
|
+
once(event: "readable", listener: () => void): this;
|
|
293
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
294
|
+
once(event: "confirmation", listener: () => void): this;
|
|
295
|
+
once(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
296
|
+
prependListener(event: "close", listener: () => void): this;
|
|
297
|
+
prependListener(event: "data", listener: (event: E) => void): this;
|
|
298
|
+
prependListener(event: "end", listener: () => void): this;
|
|
299
|
+
prependListener(event: "readable", listener: () => void): this;
|
|
300
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
301
|
+
prependListener(event: "confirmation", listener: () => void): this;
|
|
302
|
+
prependListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
303
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
304
|
+
prependOnceListener(event: "data", listener: (event: E) => void): this;
|
|
305
|
+
prependOnceListener(event: "end", listener: () => void): this;
|
|
306
|
+
prependOnceListener(event: "readable", listener: () => void): this;
|
|
307
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
308
|
+
prependOnceListener(event: "confirmation", listener: () => void): this;
|
|
309
|
+
prependOnceListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
310
|
+
removeListener(event: "close", listener: () => void): this;
|
|
311
|
+
removeListener(event: "data", listener: (event: E) => void): this;
|
|
312
|
+
removeListener(event: "end", listener: () => void): this;
|
|
313
|
+
removeListener(event: "readable", listener: () => void): this;
|
|
314
|
+
removeListener(event: "error", listener: (err: Error) => void): this;
|
|
315
|
+
removeListener(event: "confirmation", listener: () => void): this;
|
|
316
|
+
removeListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
317
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<E>;
|
|
318
|
+
}
|
|
319
|
+
export interface PersistentSubscriptionBase<E> extends ReadableSubscription<E> {
|
|
320
|
+
/**
|
|
321
|
+
* Acknowledge events as handled.
|
|
322
|
+
*/
|
|
323
|
+
ack(...events: ResolvedEvent[]): Promise<void>;
|
|
324
|
+
/**
|
|
325
|
+
* "Not Acknowledge" the event.
|
|
326
|
+
*/
|
|
327
|
+
nack(action: PersistentAction, reason: string, ...events: ResolvedEvent[]): Promise<void>;
|
|
328
|
+
}
|
|
329
|
+
export interface CatchupSubscription {
|
|
330
|
+
addListener(event: "caughtUp", listener: () => void): this;
|
|
331
|
+
addListener(event: "fellBehind", listener: () => void): this;
|
|
332
|
+
on(event: "caughtUp", listener: () => void): this;
|
|
333
|
+
on(event: "fellBehind", listener: () => void): this;
|
|
334
|
+
once(event: "caughtUp", listener: () => void): this;
|
|
335
|
+
once(event: "fellBehind", listener: () => void): this;
|
|
336
|
+
prependListener(event: "caughtUp", listener: () => void): this;
|
|
337
|
+
prependListener(event: "fellBehind", listener: () => void): this;
|
|
338
|
+
prependOnceListener(event: "caughtUp", listener: () => void): this;
|
|
339
|
+
prependOnceListener(event: "fellBehind", listener: () => void): this;
|
|
340
|
+
removeListener(event: "caughtUp", listener: () => void): this;
|
|
341
|
+
removeListener(event: "fellBehind", listener: () => void): this;
|
|
342
|
+
}
|
|
343
|
+
export type PersistentSubscriptionToStream<E extends EventType = EventType> = PersistentSubscriptionBase<PersistentSubscriptionToStreamResolvedEvent<E>>;
|
|
344
|
+
export type PersistentSubscriptionToAll = PersistentSubscriptionBase<PersistentSubscriptionToAllResolvedEvent>;
|
|
345
|
+
export type StreamSubscription<E extends EventType = EventType> = ReadableSubscription<ResolvedEvent<E>> & CatchupSubscription;
|
|
346
|
+
export type AllStreamSubscription = ReadableSubscription<AllStreamResolvedEvent> & CatchupSubscription;
|
|
347
|
+
export { VNodeState };
|
|
348
|
+
export * from "./events";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.VNodeState = void 0;
|
|
18
|
+
const gossip_pb_1 = require("../../generated/gossip_pb");
|
|
19
|
+
var VNodeState = gossip_pb_1.MemberInfo.VNodeState;
|
|
20
|
+
exports.VNodeState = VNodeState;
|
|
21
|
+
__exportStar(require("./events"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAOA,yDAAyE;AACzE,IAAO,UAAU,GAAG,sBAAc,CAAC,UAAU,CAAC;AA0frC,gCAAU;AACnB,2CAAyB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { status as StatusCode, ServiceError } from "@grpc/grpc-js";
|
|
2
|
+
import type { WrongExpectedVersion } from "../../generated/shared_pb";
|
|
3
|
+
import type { CurrentStreamState, EndPoint, AppendStreamState } from "../types";
|
|
4
|
+
export declare enum ErrorType {
|
|
5
|
+
TIMEOUT = "timeout",
|
|
6
|
+
DEADLINE_EXCEEDED = "deadline-exceeded",
|
|
7
|
+
UNAVAILABLE = "unavailable",
|
|
8
|
+
CANCELLED = "cancelled",
|
|
9
|
+
UNKNOWN = "unknown",
|
|
10
|
+
NOT_LEADER = "not-leader",
|
|
11
|
+
STREAM_NOT_FOUND = "stream-not-found",
|
|
12
|
+
NO_STREAM = "no-stream",
|
|
13
|
+
NOT_FOUND = "not-found",
|
|
14
|
+
ACCESS_DENIED = "access-denied",
|
|
15
|
+
INVALID_ARGUMENT = "invalid-argument",
|
|
16
|
+
INVALID_TRANSACTION = "invalid-transaction",
|
|
17
|
+
STREAM_DELETED = "stream-deleted",
|
|
18
|
+
SCAVENGE_NOT_FOUND = "scavenge-not-found",
|
|
19
|
+
WRONG_EXPECTED_VERSION = "wrong-expected-version",
|
|
20
|
+
MAXIMUM_APPEND_SIZE_EXCEEDED = "maximum-append-size-exceeded",
|
|
21
|
+
MISSING_REQUIRED_METADATA_PROPERTY = "missing-required-metadata-property",
|
|
22
|
+
PERSISTENT_SUBSCRIPTION_FAILED = "persistent-subscription-failed",
|
|
23
|
+
PERSISTENT_SUBSCRIPTION_DOES_NOT_EXIST = "persistent-subscription-does-not-exist",
|
|
24
|
+
PERSISTENT_SUBSCRIPTION_EXISTS = "persistent-subscription-exists",
|
|
25
|
+
PERSISTENT_SUBSCRIPTION_DROPPED = "persistent-subscription-dropped",
|
|
26
|
+
MAXIMUM_SUBSCRIBERS_REACHED = "maximum-subscribers-reached",
|
|
27
|
+
USER_NOT_FOUND = "user-not-found",
|
|
28
|
+
USER_CONFLICT = "user-conflict",
|
|
29
|
+
UNSUPPORTED = "unsupported"
|
|
30
|
+
}
|
|
31
|
+
declare abstract class CommandErrorBase extends Error {
|
|
32
|
+
abstract readonly type: ErrorType;
|
|
33
|
+
code?: StatusCode;
|
|
34
|
+
message: string;
|
|
35
|
+
_raw?: ServiceError;
|
|
36
|
+
constructor(error?: ServiceError, message?: string);
|
|
37
|
+
}
|
|
38
|
+
export declare class TimeoutError extends CommandErrorBase {
|
|
39
|
+
type: ErrorType.TIMEOUT;
|
|
40
|
+
}
|
|
41
|
+
export declare class DeadlineExceededError extends CommandErrorBase {
|
|
42
|
+
type: ErrorType.DEADLINE_EXCEEDED;
|
|
43
|
+
}
|
|
44
|
+
export declare class UnavailableError extends CommandErrorBase {
|
|
45
|
+
type: ErrorType.UNAVAILABLE;
|
|
46
|
+
}
|
|
47
|
+
export declare class CancelledError extends CommandErrorBase {
|
|
48
|
+
type: ErrorType.CANCELLED;
|
|
49
|
+
}
|
|
50
|
+
export declare class NotFoundError extends CommandErrorBase {
|
|
51
|
+
type: ErrorType.NOT_FOUND;
|
|
52
|
+
}
|
|
53
|
+
export declare class UnknownError extends CommandErrorBase {
|
|
54
|
+
type: ErrorType.UNKNOWN;
|
|
55
|
+
}
|
|
56
|
+
export declare class NotLeaderError extends CommandErrorBase {
|
|
57
|
+
type: ErrorType.NOT_LEADER;
|
|
58
|
+
leader: EndPoint;
|
|
59
|
+
constructor(error: ServiceError);
|
|
60
|
+
}
|
|
61
|
+
export declare class StreamNotFoundError extends CommandErrorBase {
|
|
62
|
+
type: ErrorType.STREAM_NOT_FOUND;
|
|
63
|
+
streamName: string;
|
|
64
|
+
static nameToString: (error?: ServiceError, streamName?: string | Uint8Array) => string;
|
|
65
|
+
constructor(error?: ServiceError, streamName?: string | Uint8Array);
|
|
66
|
+
}
|
|
67
|
+
export declare class NoStreamError extends CommandErrorBase {
|
|
68
|
+
type: ErrorType.NO_STREAM;
|
|
69
|
+
}
|
|
70
|
+
export declare class AccessDeniedError extends CommandErrorBase {
|
|
71
|
+
type: ErrorType.ACCESS_DENIED;
|
|
72
|
+
}
|
|
73
|
+
export declare class InvalidTransactionError extends CommandErrorBase {
|
|
74
|
+
type: ErrorType.INVALID_TRANSACTION;
|
|
75
|
+
}
|
|
76
|
+
export declare class StreamDeletedError extends CommandErrorBase {
|
|
77
|
+
type: ErrorType.STREAM_DELETED;
|
|
78
|
+
streamName: string;
|
|
79
|
+
static fromStreamName: (streamName: string) => StreamDeletedError;
|
|
80
|
+
constructor(error: ServiceError);
|
|
81
|
+
constructor(error: undefined, streamName: string);
|
|
82
|
+
}
|
|
83
|
+
export declare class ScavengeNotFoundError extends CommandErrorBase {
|
|
84
|
+
type: ErrorType.SCAVENGE_NOT_FOUND;
|
|
85
|
+
scavengeId: string;
|
|
86
|
+
constructor(error: ServiceError);
|
|
87
|
+
}
|
|
88
|
+
interface WrongExpectedVersionDetails {
|
|
89
|
+
streamName: string;
|
|
90
|
+
expected: AppendStreamState;
|
|
91
|
+
current: CurrentStreamState;
|
|
92
|
+
}
|
|
93
|
+
export declare class WrongExpectedVersionError extends CommandErrorBase {
|
|
94
|
+
type: ErrorType.WRONG_EXPECTED_VERSION;
|
|
95
|
+
streamName: string;
|
|
96
|
+
expectedState: AppendStreamState;
|
|
97
|
+
actualState: CurrentStreamState;
|
|
98
|
+
static fromWrongExpectedVersion: (details: WrongExpectedVersion, streamName: string) => WrongExpectedVersionError;
|
|
99
|
+
constructor(error: ServiceError);
|
|
100
|
+
constructor(error: undefined, versions: WrongExpectedVersionDetails);
|
|
101
|
+
}
|
|
102
|
+
export declare class MaxAppendSizeExceededError extends CommandErrorBase {
|
|
103
|
+
type: ErrorType.MAXIMUM_APPEND_SIZE_EXCEEDED;
|
|
104
|
+
maxAppendSize: number;
|
|
105
|
+
static fromMaxAppendSize: (maxAppendSize: number) => MaxAppendSizeExceededError;
|
|
106
|
+
constructor(error: ServiceError);
|
|
107
|
+
constructor(error: undefined, maxAppendSize: number);
|
|
108
|
+
}
|
|
109
|
+
export declare class RequiredMetadataPropertyMissingError extends CommandErrorBase {
|
|
110
|
+
type: ErrorType.MISSING_REQUIRED_METADATA_PROPERTY;
|
|
111
|
+
requiredMetadataProperties: string[];
|
|
112
|
+
constructor(error: ServiceError);
|
|
113
|
+
}
|
|
114
|
+
export declare class PersistentSubscriptionFailedError extends CommandErrorBase {
|
|
115
|
+
type: ErrorType.PERSISTENT_SUBSCRIPTION_FAILED;
|
|
116
|
+
streamName: string;
|
|
117
|
+
groupName: string;
|
|
118
|
+
reason: string;
|
|
119
|
+
constructor(error: ServiceError);
|
|
120
|
+
}
|
|
121
|
+
interface PersistentSubscriptionDoesNotExistMeta {
|
|
122
|
+
streamName: string;
|
|
123
|
+
groupName?: string;
|
|
124
|
+
}
|
|
125
|
+
export declare class PersistentSubscriptionDoesNotExistError extends CommandErrorBase {
|
|
126
|
+
type: ErrorType.PERSISTENT_SUBSCRIPTION_DOES_NOT_EXIST;
|
|
127
|
+
streamName: string;
|
|
128
|
+
groupName: string;
|
|
129
|
+
constructor(error: ServiceError);
|
|
130
|
+
constructor(error: undefined, metadata: PersistentSubscriptionDoesNotExistMeta);
|
|
131
|
+
}
|
|
132
|
+
export declare class PersistentSubscriptionExistsError extends CommandErrorBase {
|
|
133
|
+
type: ErrorType.PERSISTENT_SUBSCRIPTION_EXISTS;
|
|
134
|
+
streamName: string;
|
|
135
|
+
groupName: string;
|
|
136
|
+
constructor(error: ServiceError);
|
|
137
|
+
}
|
|
138
|
+
export declare class PersistentSubscriptionMaximumSubscribersReachedError extends CommandErrorBase {
|
|
139
|
+
type: ErrorType.MAXIMUM_SUBSCRIBERS_REACHED;
|
|
140
|
+
streamName: string;
|
|
141
|
+
groupName: string;
|
|
142
|
+
constructor(error: ServiceError);
|
|
143
|
+
}
|
|
144
|
+
export declare class PersistentSubscriptionDroppedError extends CommandErrorBase {
|
|
145
|
+
type: ErrorType.PERSISTENT_SUBSCRIPTION_DROPPED;
|
|
146
|
+
streamName: string;
|
|
147
|
+
groupName: string;
|
|
148
|
+
constructor(error: ServiceError);
|
|
149
|
+
}
|
|
150
|
+
export declare class LoginNotFoundError extends CommandErrorBase {
|
|
151
|
+
type: ErrorType.USER_NOT_FOUND;
|
|
152
|
+
LoginName: string;
|
|
153
|
+
constructor(error: ServiceError);
|
|
154
|
+
}
|
|
155
|
+
export declare class LoginConflictError extends CommandErrorBase {
|
|
156
|
+
type: ErrorType.USER_CONFLICT;
|
|
157
|
+
LoginName: string;
|
|
158
|
+
constructor(error: ServiceError);
|
|
159
|
+
}
|
|
160
|
+
export declare class UnsupportedError extends CommandErrorBase {
|
|
161
|
+
type: ErrorType.UNSUPPORTED;
|
|
162
|
+
feature: string;
|
|
163
|
+
minimumVersion: string;
|
|
164
|
+
constructor(feature: string, minimumVersion: string);
|
|
165
|
+
}
|
|
166
|
+
export declare class InvalidArgumentError extends CommandErrorBase {
|
|
167
|
+
type: ErrorType.INVALID_ARGUMENT;
|
|
168
|
+
errorMessage: string;
|
|
169
|
+
constructor(error: string);
|
|
170
|
+
}
|
|
171
|
+
export type CommandError = NotLeaderError | StreamNotFoundError | NoStreamError | AccessDeniedError | InvalidArgumentError | InvalidTransactionError | StreamDeletedError | ScavengeNotFoundError | WrongExpectedVersionError | MaxAppendSizeExceededError | RequiredMetadataPropertyMissingError | PersistentSubscriptionFailedError | PersistentSubscriptionDoesNotExistError | PersistentSubscriptionExistsError | PersistentSubscriptionDroppedError | PersistentSubscriptionMaximumSubscribersReachedError | LoginNotFoundError | LoginConflictError | TimeoutError | DeadlineExceededError | UnavailableError | CancelledError | UnknownError | UnsupportedError;
|
|
172
|
+
export declare const convertToCommandError: (error: Error) => CommandError | Error;
|
|
173
|
+
export declare const isCommandError: (error: Error) => error is CommandError;
|
|
174
|
+
export {};
|