@streamsy/core 0.2.1 → 0.5.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/LICENSE +21 -0
- package/README.md +176 -0
- package/dist/cursor-generator-DySXZ93b.js +12 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.js +3 -0
- package/dist/http-x2IjDHvw.js +67 -0
- package/dist/index-C26ncp7Y.d.ts +533 -0
- package/dist/index.d.ts +3 -1054
- package/dist/index.js +118 -3875
- package/dist/internal/index.d.ts +20 -0
- package/dist/internal/index.js +3 -0
- package/dist/layer-DJ-c63nY.js +340 -0
- package/dist/layer-DyezIxJT.js +645 -0
- package/dist/owner-BWQ2KvC_.js +35 -0
- package/dist/owner-records-BV5Un5R0.d.ts +2941 -0
- package/dist/owner-records-C0p8jeC1.js +4 -0
- package/dist/program-DXUjw5B2.js +797 -0
- package/dist/protocol/index.d.ts +6 -0
- package/dist/protocol/index.js +15 -0
- package/dist/remote/index.d.ts +21 -0
- package/dist/remote/index.js +424 -0
- package/dist/rolldown-runtime-D8jQpDG7.js +12 -0
- package/dist/streamsy-DJMArv09.js +846 -0
- package/dist/testing/index.d.ts +36 -0
- package/dist/testing/index.js +752 -0
- package/package.json +50 -13
|
@@ -0,0 +1,2941 @@
|
|
|
1
|
+
import { Context, Data, Effect, Option, Schema, Stream } from "effect";
|
|
2
|
+
declare const StorageFault_base: Schema.Class<StorageFault, Schema.TaggedStruct<"StorageFault", {
|
|
3
|
+
readonly operation: Schema.String;
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
readonly retryable: Schema.Boolean;
|
|
6
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
|
+
declare class StorageFault extends StorageFault_base {}
|
|
9
|
+
declare const EncodeFault_base: Schema.Class<EncodeFault, Schema.TaggedStruct<"EncodeFault", {
|
|
10
|
+
readonly message: Schema.String;
|
|
11
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
12
|
+
}>, import("effect/Cause").YieldableError>;
|
|
13
|
+
declare class EncodeFault extends EncodeFault_base {}
|
|
14
|
+
declare const DecodeFault_base: Schema.Class<DecodeFault, Schema.TaggedStruct<"DecodeFault", {
|
|
15
|
+
readonly message: Schema.String;
|
|
16
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
17
|
+
}>, import("effect/Cause").YieldableError>;
|
|
18
|
+
declare class DecodeFault extends DecodeFault_base {}
|
|
19
|
+
declare const TransportFault_base: Schema.Class<TransportFault, Schema.TaggedStruct<"TransportFault", {
|
|
20
|
+
readonly operation: Schema.String;
|
|
21
|
+
readonly reason: Schema.Literals<readonly ["request", "response", "decode", "configuration"]>;
|
|
22
|
+
/** HTTP status of the response, when available. */
|
|
23
|
+
readonly status: Schema.optionalKey<Schema.Int>;
|
|
24
|
+
readonly message: Schema.String;
|
|
25
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
26
|
+
}>, import("effect/Cause").YieldableError>;
|
|
27
|
+
/** Failures of the remote boundary; protocol rejections have their own typed errors. */
|
|
28
|
+
declare class TransportFault extends TransportFault_base {
|
|
29
|
+
/** Failed requests, 429s and 5xx responses can succeed later. */
|
|
30
|
+
get retryable(): boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const StreamsFault: Schema.Union<readonly [typeof StorageFault, typeof TransportFault]>;
|
|
33
|
+
type StreamsFault = typeof StreamsFault.Type;
|
|
34
|
+
/** A storage or transport failure, as opposed to a protocol rejection. */
|
|
35
|
+
declare const isStreamsFault: <I>(input: I) => input is I & (StorageFault | TransportFault);
|
|
36
|
+
/** A storage or transport failure that can succeed later. */
|
|
37
|
+
declare const isRetryableFault: (error: unknown) => error is StreamsFault;
|
|
38
|
+
declare const StreamId: Schema.brand<Schema.String, "StreamId">;
|
|
39
|
+
declare const Offset: Schema.brand<Schema.String, "Offset">;
|
|
40
|
+
declare const ProducerId: Schema.brand<Schema.String, "ProducerId">;
|
|
41
|
+
declare const StreamConfig: Schema.Struct<{
|
|
42
|
+
readonly contentType: Schema.String;
|
|
43
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
44
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
45
|
+
readonly createdAt: Schema.Finite;
|
|
46
|
+
}>;
|
|
47
|
+
declare const StreamLifecycle: Schema.Struct<{
|
|
48
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
49
|
+
readonly closed: Schema.Boolean;
|
|
50
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
51
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
52
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
53
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
54
|
+
readonly softDeleted: Schema.Boolean;
|
|
55
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
56
|
+
}>;
|
|
57
|
+
declare const StreamRecord: Schema.Struct<{
|
|
58
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
59
|
+
readonly config: Schema.Struct<{
|
|
60
|
+
readonly contentType: Schema.String;
|
|
61
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
62
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
63
|
+
readonly createdAt: Schema.Finite;
|
|
64
|
+
}>;
|
|
65
|
+
readonly lifecycle: Schema.Struct<{
|
|
66
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
67
|
+
readonly closed: Schema.Boolean;
|
|
68
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
69
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
70
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
71
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
72
|
+
readonly softDeleted: Schema.Boolean;
|
|
73
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
74
|
+
}>;
|
|
75
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
76
|
+
}>;
|
|
77
|
+
declare const StoredMessage: Schema.Struct<{
|
|
78
|
+
readonly offset: Schema.brand<Schema.String, "Offset">;
|
|
79
|
+
readonly timestamp: Schema.Finite;
|
|
80
|
+
readonly data: Schema.Uint8Array;
|
|
81
|
+
}>;
|
|
82
|
+
declare const ProducerState: Schema.Struct<{
|
|
83
|
+
readonly epoch: Schema.Finite;
|
|
84
|
+
readonly lastSeq: Schema.Finite;
|
|
85
|
+
}>;
|
|
86
|
+
declare const MessageWindow: Schema.Struct<{
|
|
87
|
+
readonly after: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
88
|
+
readonly until: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
89
|
+
readonly limit: Schema.optionalKey<Schema.Finite>;
|
|
90
|
+
}>;
|
|
91
|
+
declare const ChangeSnapshot: Schema.Struct<{
|
|
92
|
+
readonly present: Schema.Boolean;
|
|
93
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
94
|
+
readonly closed: Schema.Boolean;
|
|
95
|
+
readonly softDeleted: Schema.Boolean;
|
|
96
|
+
}>;
|
|
97
|
+
type StreamId = typeof StreamId.Type;
|
|
98
|
+
type Offset = typeof Offset.Type;
|
|
99
|
+
type ProducerId = typeof ProducerId.Type;
|
|
100
|
+
interface StreamConfig extends Schema.Schema.Type<typeof StreamConfig> {}
|
|
101
|
+
interface StreamLifecycle extends Schema.Schema.Type<typeof StreamLifecycle> {}
|
|
102
|
+
interface StreamRecord extends Schema.Schema.Type<typeof StreamRecord> {}
|
|
103
|
+
interface StoredMessage extends Schema.Schema.Type<typeof StoredMessage> {}
|
|
104
|
+
interface ProducerState extends Schema.Schema.Type<typeof ProducerState> {}
|
|
105
|
+
interface MessageWindow extends Schema.Schema.Type<typeof MessageWindow> {}
|
|
106
|
+
interface ChangeSnapshot extends Schema.Schema.Type<typeof ChangeSnapshot> {}
|
|
107
|
+
declare const RecordPatch: Schema.Struct<{
|
|
108
|
+
readonly currentOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
109
|
+
readonly config: Schema.optionalKey<Schema.Struct<{
|
|
110
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
111
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
112
|
+
}>>;
|
|
113
|
+
readonly lifecycle: Schema.optionalKey<Schema.Struct<{
|
|
114
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
115
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
116
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
117
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
118
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
119
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
120
|
+
readonly closed: Schema.optionalKey<Schema.Boolean>;
|
|
121
|
+
readonly softDeleted: Schema.optionalKey<Schema.Boolean>;
|
|
122
|
+
}>>;
|
|
123
|
+
readonly clear: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["ttlSeconds", "expiresAt", "expiresAtMs", "lastSeq"]>>>;
|
|
124
|
+
}>;
|
|
125
|
+
interface RecordPatch extends Schema.Schema.Type<typeof RecordPatch> {}
|
|
126
|
+
/** Private pure-policy input, promoted to protocol options in Batch 3. */
|
|
127
|
+
interface CreateOptions {
|
|
128
|
+
readonly contentType?: string;
|
|
129
|
+
readonly ttlSeconds?: number;
|
|
130
|
+
readonly expiresAt?: string;
|
|
131
|
+
readonly closed?: boolean;
|
|
132
|
+
readonly forkedFrom?: string;
|
|
133
|
+
readonly forkOffset?: string;
|
|
134
|
+
readonly forkSubOffset?: number;
|
|
135
|
+
readonly initialData?: Uint8Array;
|
|
136
|
+
}
|
|
137
|
+
interface ProducerOptions {
|
|
138
|
+
readonly producerId: string;
|
|
139
|
+
readonly producerEpoch: number;
|
|
140
|
+
readonly producerSeq: number;
|
|
141
|
+
}
|
|
142
|
+
interface AppendOptions {
|
|
143
|
+
readonly data: Uint8Array;
|
|
144
|
+
readonly contentType: string;
|
|
145
|
+
readonly seq?: string;
|
|
146
|
+
readonly producer?: ProducerOptions;
|
|
147
|
+
readonly close?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Optimistic-concurrency precondition: append only if the stream's tail
|
|
150
|
+
* offset still equals this offset. On mismatch the append fails with a
|
|
151
|
+
* `conflict`/`expected-offset` result carrying the actual tail, and no
|
|
152
|
+
* state (messages, close flag, producer state) is changed. `ZERO_OFFSET`
|
|
153
|
+
* means "append only if the stream is still empty". Streamsy extension to
|
|
154
|
+
* the Durable Streams protocol.
|
|
155
|
+
*/
|
|
156
|
+
readonly expectedOffset?: string;
|
|
157
|
+
}
|
|
158
|
+
/** Append options for a typed address. The address supplies the body and its content type. */
|
|
159
|
+
type AppendCallOptions = Omit<AppendOptions, "data" | "contentType">;
|
|
160
|
+
interface ReadOptions {
|
|
161
|
+
offset?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Options for one transport-neutral read/wait operation. `readNext` returns
|
|
165
|
+
* available messages immediately or waits once for a stream change, timeout,
|
|
166
|
+
* or cancellation. HTTP live modes decide whether to invoke it once or repeat
|
|
167
|
+
* it; they are intentionally not part of this protocol contract.
|
|
168
|
+
*/
|
|
169
|
+
interface ReadNextOptions {
|
|
170
|
+
offset: string;
|
|
171
|
+
cursor?: string;
|
|
172
|
+
}
|
|
173
|
+
declare const StreamNotFound_base: Schema.Class<StreamNotFound, Schema.TaggedStruct<"StreamNotFound", {
|
|
174
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
175
|
+
}>, import("effect/Cause").YieldableError>;
|
|
176
|
+
/** Protocol rejections. Optional create reasons reflect the public HTTP wire's loss of detail. */
|
|
177
|
+
declare class StreamNotFound extends StreamNotFound_base {
|
|
178
|
+
get message(): string;
|
|
179
|
+
}
|
|
180
|
+
declare const StreamGone_base: Schema.Class<StreamGone, Schema.TaggedStruct<"StreamGone", {
|
|
181
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
182
|
+
}>, import("effect/Cause").YieldableError>;
|
|
183
|
+
declare class StreamGone extends StreamGone_base {
|
|
184
|
+
get message(): string;
|
|
185
|
+
}
|
|
186
|
+
declare const StreamClosed_base: Schema.Class<StreamClosed, Schema.TaggedStruct<"StreamClosed", {
|
|
187
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
188
|
+
readonly offset: Schema.String;
|
|
189
|
+
}>, import("effect/Cause").YieldableError>;
|
|
190
|
+
declare class StreamClosed extends StreamClosed_base {
|
|
191
|
+
get message(): string;
|
|
192
|
+
}
|
|
193
|
+
declare const OffsetMismatch_base: Schema.Class<OffsetMismatch, Schema.TaggedStruct<"OffsetMismatch", {
|
|
194
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
195
|
+
readonly expected: Schema.String;
|
|
196
|
+
readonly actual: Schema.String;
|
|
197
|
+
}>, import("effect/Cause").YieldableError>;
|
|
198
|
+
declare class OffsetMismatch extends OffsetMismatch_base {
|
|
199
|
+
get message(): string;
|
|
200
|
+
}
|
|
201
|
+
declare const AppendConflict_base: Schema.Class<AppendConflict, Schema.TaggedStruct<"AppendConflict", {
|
|
202
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
203
|
+
readonly message: Schema.String;
|
|
204
|
+
}>, import("effect/Cause").YieldableError>;
|
|
205
|
+
declare class AppendConflict extends AppendConflict_base {}
|
|
206
|
+
declare const StreamBusy_base: Schema.Class<StreamBusy, Schema.TaggedStruct<"StreamBusy", {
|
|
207
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
208
|
+
}>, import("effect/Cause").YieldableError>;
|
|
209
|
+
declare class StreamBusy extends StreamBusy_base {
|
|
210
|
+
get message(): string;
|
|
211
|
+
}
|
|
212
|
+
declare const StaleEpoch_base: Schema.Class<StaleEpoch, Schema.TaggedStruct<"StaleEpoch", {
|
|
213
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
214
|
+
readonly currentEpoch: Schema.Finite;
|
|
215
|
+
}>, import("effect/Cause").YieldableError>;
|
|
216
|
+
declare class StaleEpoch extends StaleEpoch_base {
|
|
217
|
+
get message(): string;
|
|
218
|
+
}
|
|
219
|
+
declare const ProducerGap_base: Schema.Class<ProducerGap, Schema.TaggedStruct<"ProducerGap", {
|
|
220
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
221
|
+
readonly expectedSeq: Schema.Finite;
|
|
222
|
+
readonly receivedSeq: Schema.Finite;
|
|
223
|
+
}>, import("effect/Cause").YieldableError>;
|
|
224
|
+
declare class ProducerGap extends ProducerGap_base {
|
|
225
|
+
get message(): string;
|
|
226
|
+
}
|
|
227
|
+
declare const InvalidEpochSeq_base: Schema.Class<InvalidEpochSeq, Schema.TaggedStruct<"InvalidEpochSeq", {
|
|
228
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
229
|
+
}>, import("effect/Cause").YieldableError>;
|
|
230
|
+
declare class InvalidEpochSeq extends InvalidEpochSeq_base {
|
|
231
|
+
get message(): string;
|
|
232
|
+
}
|
|
233
|
+
declare const InvalidAppendRequest_base: Schema.Class<InvalidAppendRequest, Schema.TaggedStruct<"InvalidAppendRequest", {
|
|
234
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
235
|
+
readonly message: Schema.String;
|
|
236
|
+
}>, import("effect/Cause").YieldableError>;
|
|
237
|
+
declare class InvalidAppendRequest extends InvalidAppendRequest_base {}
|
|
238
|
+
declare const CreateConflict_base: Schema.Class<CreateConflict, Schema.TaggedStruct<"CreateConflict", {
|
|
239
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
240
|
+
readonly reason: Schema.optionalKey<Schema.Literals<readonly ["config-mismatch", "soft-deleted", "fork-content-type", "fork-source-soft-deleted"]>>;
|
|
241
|
+
readonly message: Schema.String;
|
|
242
|
+
}>, import("effect/Cause").YieldableError>;
|
|
243
|
+
declare class CreateConflict extends CreateConflict_base {}
|
|
244
|
+
declare const ForkSourceNotFound_base: Schema.Class<ForkSourceNotFound, Schema.TaggedStruct<"ForkSourceNotFound", {
|
|
245
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
246
|
+
readonly source: Schema.brand<Schema.String, "StreamId">;
|
|
247
|
+
}>, import("effect/Cause").YieldableError>;
|
|
248
|
+
declare class ForkSourceNotFound extends ForkSourceNotFound_base {
|
|
249
|
+
get message(): string;
|
|
250
|
+
}
|
|
251
|
+
declare const InvalidForkRequest_base: Schema.Class<InvalidForkRequest, Schema.TaggedStruct<"InvalidForkRequest", {
|
|
252
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
253
|
+
readonly message: Schema.String;
|
|
254
|
+
}>, import("effect/Cause").YieldableError>;
|
|
255
|
+
declare class InvalidForkRequest extends InvalidForkRequest_base {}
|
|
256
|
+
declare const NotSupported_base: Schema.Class<NotSupported, Schema.TaggedStruct<"NotSupported", {
|
|
257
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
258
|
+
readonly feature: Schema.String;
|
|
259
|
+
}>, import("effect/Cause").YieldableError>;
|
|
260
|
+
declare class NotSupported extends NotSupported_base {
|
|
261
|
+
get message(): string;
|
|
262
|
+
}
|
|
263
|
+
type CreateConflictReason = NonNullable<CreateConflict["reason"]>;
|
|
264
|
+
type HeadError = StreamNotFound | StreamGone;
|
|
265
|
+
declare const InvalidReadRequest_base: Schema.Class<InvalidReadRequest, Schema.TaggedStruct<"InvalidReadRequest", {
|
|
266
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
267
|
+
readonly message: Schema.String;
|
|
268
|
+
}>, import("effect/Cause").YieldableError>;
|
|
269
|
+
declare class InvalidReadRequest extends InvalidReadRequest_base {}
|
|
270
|
+
type ReadError = StreamNotFound | StreamGone | InvalidReadRequest;
|
|
271
|
+
type ReadNextError = ReadError | NotSupported;
|
|
272
|
+
type CreateError = CreateConflict | ForkSourceNotFound | InvalidForkRequest | NotSupported;
|
|
273
|
+
/**
|
|
274
|
+
* Append rejections that any call can get, whatever its options. The memory and
|
|
275
|
+
* storage hosts never answer `NotSupported`; the remote client does when the server
|
|
276
|
+
* or its own capabilities refuse a feature.
|
|
277
|
+
*/
|
|
278
|
+
type AppendBaseError = StreamNotFound | StreamGone | StreamClosed | StreamBusy | AppendConflict | NotSupported;
|
|
279
|
+
type AppendError = AppendBaseError | InvalidAppendRequest | OffsetMismatch | StaleEpoch | ProducerGap | InvalidEpochSeq;
|
|
280
|
+
/**
|
|
281
|
+
* The append rejections that call options `O` make possible. `OffsetMismatch`
|
|
282
|
+
* needs `expectedOffset`, and the producer rejections need `producer`. An option
|
|
283
|
+
* that may be set counts as set.
|
|
284
|
+
*/
|
|
285
|
+
type AppendErrorFor<O> = AppendBaseError | (true extends MaySet<O, "expectedOffset"> ? OffsetMismatch : never) | (true extends MaySet<O, "producer"> ? StaleEpoch | ProducerGap : never);
|
|
286
|
+
/** Whether options `O` may hold a value for `K`. A union holds it if any member may. */
|
|
287
|
+
type MaySet<O, K extends PropertyKey> = O extends unknown ? K extends keyof O ? [Exclude<O[K], undefined>] extends [never] ? false : true : false : never;
|
|
288
|
+
type RemoveError = StreamNotFound | StreamGone | StreamBusy;
|
|
289
|
+
type ProtocolError = HeadError | ReadNextError | CreateError | AppendError | RemoveError;
|
|
290
|
+
/** The HTTP edge answers every protocol rejection through one mapper, so it needs one guard. */
|
|
291
|
+
declare const isProtocolError: (error: {
|
|
292
|
+
readonly _tag: string;
|
|
293
|
+
}) => error is ProtocolError;
|
|
294
|
+
/** Payload-only messages exposed by the public protocol; storage owns offsets and timestamps. */
|
|
295
|
+
interface ReadMessage {
|
|
296
|
+
readonly data: Uint8Array;
|
|
297
|
+
}
|
|
298
|
+
type CreateResult = {
|
|
299
|
+
readonly _tag: "Created";
|
|
300
|
+
readonly nextOffset: string;
|
|
301
|
+
readonly contentType: string;
|
|
302
|
+
readonly closed: boolean;
|
|
303
|
+
} | {
|
|
304
|
+
readonly _tag: "Exists";
|
|
305
|
+
readonly nextOffset: string;
|
|
306
|
+
readonly contentType: string;
|
|
307
|
+
readonly closed: boolean;
|
|
308
|
+
};
|
|
309
|
+
type AppendResult = {
|
|
310
|
+
readonly _tag: "Appended";
|
|
311
|
+
/** Tail after this write; an after-exclusive read cursor. */ readonly offset: string;
|
|
312
|
+
readonly producerEpoch?: number;
|
|
313
|
+
readonly producerSeq?: number;
|
|
314
|
+
readonly closed: boolean;
|
|
315
|
+
} | {
|
|
316
|
+
readonly _tag: "Duplicate";
|
|
317
|
+
/** Current tail at acknowledgement, at or after the original write. */ readonly offset: string;
|
|
318
|
+
readonly producerEpoch: number;
|
|
319
|
+
readonly producerSeq: number;
|
|
320
|
+
readonly closed: boolean;
|
|
321
|
+
};
|
|
322
|
+
/** Constructors and matchers for the protocol results above. */
|
|
323
|
+
declare const CreateResult: {
|
|
324
|
+
readonly $is: <Tag extends "Created" | "Exists">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
325
|
+
readonly _tag: "Created";
|
|
326
|
+
readonly nextOffset: string;
|
|
327
|
+
readonly contentType: string;
|
|
328
|
+
readonly closed: boolean;
|
|
329
|
+
}, {
|
|
330
|
+
readonly _tag: Tag;
|
|
331
|
+
}> | Extract<{
|
|
332
|
+
readonly _tag: "Exists";
|
|
333
|
+
readonly nextOffset: string;
|
|
334
|
+
readonly contentType: string;
|
|
335
|
+
readonly closed: boolean;
|
|
336
|
+
}, {
|
|
337
|
+
readonly _tag: Tag;
|
|
338
|
+
}>;
|
|
339
|
+
readonly $match: {
|
|
340
|
+
<Cases extends { readonly [Tag in "Created" | "Exists"]: (args: Extract<CreateResult, {
|
|
341
|
+
readonly _tag: Tag;
|
|
342
|
+
}>) => any; }>(cases: Cases): (value: CreateResult) => import("effect/Unify").Unify<ReturnType<Cases["Created" | "Exists"]>>;
|
|
343
|
+
<Cases extends { readonly [Tag in "Created" | "Exists"]: (args: Extract<CreateResult, {
|
|
344
|
+
readonly _tag: Tag;
|
|
345
|
+
}>) => any; }>(value: CreateResult, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Created" | "Exists"]>>;
|
|
346
|
+
};
|
|
347
|
+
readonly Created: Data.TaggedEnum.ConstructorFrom<{
|
|
348
|
+
readonly _tag: "Created";
|
|
349
|
+
readonly nextOffset: string;
|
|
350
|
+
readonly contentType: string;
|
|
351
|
+
readonly closed: boolean;
|
|
352
|
+
}, "_tag">;
|
|
353
|
+
readonly Exists: Data.TaggedEnum.ConstructorFrom<{
|
|
354
|
+
readonly _tag: "Exists";
|
|
355
|
+
readonly nextOffset: string;
|
|
356
|
+
readonly contentType: string;
|
|
357
|
+
readonly closed: boolean;
|
|
358
|
+
}, "_tag">;
|
|
359
|
+
};
|
|
360
|
+
declare const AppendResult: {
|
|
361
|
+
readonly $is: <Tag extends "Appended" | "Duplicate">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
362
|
+
readonly _tag: "Appended";
|
|
363
|
+
/** Tail after this write; an after-exclusive read cursor. */ readonly offset: string;
|
|
364
|
+
readonly producerEpoch?: number;
|
|
365
|
+
readonly producerSeq?: number;
|
|
366
|
+
readonly closed: boolean;
|
|
367
|
+
}, {
|
|
368
|
+
readonly _tag: Tag;
|
|
369
|
+
}> | Extract<{
|
|
370
|
+
readonly _tag: "Duplicate";
|
|
371
|
+
/** Current tail at acknowledgement, at or after the original write. */ readonly offset: string;
|
|
372
|
+
readonly producerEpoch: number;
|
|
373
|
+
readonly producerSeq: number;
|
|
374
|
+
readonly closed: boolean;
|
|
375
|
+
}, {
|
|
376
|
+
readonly _tag: Tag;
|
|
377
|
+
}>;
|
|
378
|
+
readonly $match: {
|
|
379
|
+
<Cases extends { readonly [Tag in "Appended" | "Duplicate"]: (args: Extract<AppendResult, {
|
|
380
|
+
readonly _tag: Tag;
|
|
381
|
+
}>) => any; }>(cases: Cases): (value: AppendResult) => import("effect/Unify").Unify<ReturnType<Cases["Appended" | "Duplicate"]>>;
|
|
382
|
+
<Cases extends { readonly [Tag in "Appended" | "Duplicate"]: (args: Extract<AppendResult, {
|
|
383
|
+
readonly _tag: Tag;
|
|
384
|
+
}>) => any; }>(value: AppendResult, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Appended" | "Duplicate"]>>;
|
|
385
|
+
};
|
|
386
|
+
readonly Appended: Data.TaggedEnum.ConstructorFrom<{
|
|
387
|
+
readonly _tag: "Appended";
|
|
388
|
+
/** Tail after this write; an after-exclusive read cursor. */ readonly offset: string;
|
|
389
|
+
readonly producerEpoch?: number;
|
|
390
|
+
readonly producerSeq?: number;
|
|
391
|
+
readonly closed: boolean;
|
|
392
|
+
}, "_tag">;
|
|
393
|
+
readonly Duplicate: Data.TaggedEnum.ConstructorFrom<{
|
|
394
|
+
readonly _tag: "Duplicate";
|
|
395
|
+
/** Current tail at acknowledgement, at or after the original write. */ readonly offset: string;
|
|
396
|
+
readonly producerEpoch: number;
|
|
397
|
+
readonly producerSeq: number;
|
|
398
|
+
readonly closed: boolean;
|
|
399
|
+
}, "_tag">;
|
|
400
|
+
};
|
|
401
|
+
interface ReadResult {
|
|
402
|
+
readonly contentType: string;
|
|
403
|
+
readonly messages: ReadonlyArray<ReadMessage>;
|
|
404
|
+
readonly nextOffset: string;
|
|
405
|
+
readonly upToDate: boolean;
|
|
406
|
+
readonly closed: boolean;
|
|
407
|
+
}
|
|
408
|
+
interface ReadNextResult extends ReadResult {
|
|
409
|
+
readonly cursor: string;
|
|
410
|
+
readonly timedOut: boolean;
|
|
411
|
+
}
|
|
412
|
+
interface HeadResult {
|
|
413
|
+
readonly contentType: string;
|
|
414
|
+
readonly nextOffset: string;
|
|
415
|
+
readonly ttlSeconds?: number;
|
|
416
|
+
readonly expiresAt?: string;
|
|
417
|
+
readonly closed: boolean;
|
|
418
|
+
}
|
|
419
|
+
interface Reader<E = StorageFault> {
|
|
420
|
+
readonly head: (id: StreamId) => Effect.Effect<HeadResult, HeadError | E>;
|
|
421
|
+
readonly read: (id: StreamId, options?: ReadOptions) => Effect.Effect<ReadResult, ReadError | E>;
|
|
422
|
+
readonly readNext: (id: StreamId, options: ReadNextOptions) => Effect.Effect<ReadNextResult, ReadNextError | E>;
|
|
423
|
+
}
|
|
424
|
+
interface Writer<E = StorageFault> {
|
|
425
|
+
readonly create: (id: StreamId, options?: CreateOptions) => Effect.Effect<CreateResult, CreateError | E>;
|
|
426
|
+
readonly fork: (id: StreamId, source: StreamId, options?: Omit<CreateOptions, "forkedFrom">) => Effect.Effect<CreateResult, CreateError | E>;
|
|
427
|
+
readonly append: (id: StreamId, options: AppendOptions) => Effect.Effect<AppendResult, AppendError | E>;
|
|
428
|
+
readonly remove: (id: StreamId) => Effect.Effect<void, RemoveError | E>;
|
|
429
|
+
}
|
|
430
|
+
declare const StreamsReader_base: Context.ServiceClass<StreamsReader, "@streamsy/core/StreamsReader", Reader<StorageFault | TransportFault>>;
|
|
431
|
+
declare class StreamsReader extends StreamsReader_base {}
|
|
432
|
+
declare const StreamsWriter_base: Context.ServiceClass<StreamsWriter, "@streamsy/core/StreamsWriter", Writer<StorageFault | TransportFault>>;
|
|
433
|
+
declare class StreamsWriter extends StreamsWriter_base {}
|
|
434
|
+
declare const StorageCapabilities: Schema.Struct<{
|
|
435
|
+
readonly fork: Schema.Literals<readonly ["none", "copy", "chain"]>;
|
|
436
|
+
readonly atomicScope: Schema.Literals<readonly ["stream", "store"]>;
|
|
437
|
+
readonly wake: Schema.Literals<readonly ["poll", "push"]>;
|
|
438
|
+
readonly expiryIndex: Schema.Literals<readonly ["lazy", "indexed"]>;
|
|
439
|
+
}>;
|
|
440
|
+
interface StorageCapabilities extends Schema.Schema.Type<typeof StorageCapabilities> {}
|
|
441
|
+
declare const ProducerPrecondition: Schema.Struct<{
|
|
442
|
+
readonly producerId: Schema.brand<Schema.String, "ProducerId">;
|
|
443
|
+
readonly expected: Schema.Option<Schema.Struct<{
|
|
444
|
+
readonly epoch: Schema.Finite;
|
|
445
|
+
readonly lastSeq: Schema.Finite;
|
|
446
|
+
}>>;
|
|
447
|
+
readonly next: Schema.Struct<{
|
|
448
|
+
readonly epoch: Schema.Finite;
|
|
449
|
+
readonly lastSeq: Schema.Finite;
|
|
450
|
+
}>;
|
|
451
|
+
}>;
|
|
452
|
+
declare const Operation: Schema.Union<readonly [Schema.TaggedStruct<"Create", {
|
|
453
|
+
readonly record: Schema.Struct<{
|
|
454
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
455
|
+
readonly config: Schema.Struct<{
|
|
456
|
+
readonly contentType: Schema.String;
|
|
457
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
458
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
459
|
+
readonly createdAt: Schema.Finite;
|
|
460
|
+
}>;
|
|
461
|
+
readonly lifecycle: Schema.Struct<{
|
|
462
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
463
|
+
readonly closed: Schema.Boolean;
|
|
464
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
465
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
466
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
467
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
468
|
+
readonly softDeleted: Schema.Boolean;
|
|
469
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
470
|
+
}>;
|
|
471
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
472
|
+
}>;
|
|
473
|
+
readonly initialMessages: Schema.$Array<Schema.Struct<{
|
|
474
|
+
readonly offset: Schema.brand<Schema.String, "Offset">;
|
|
475
|
+
readonly timestamp: Schema.Finite;
|
|
476
|
+
readonly data: Schema.Uint8Array;
|
|
477
|
+
}>>;
|
|
478
|
+
readonly forkSource: Schema.optionalKey<Schema.Struct<{
|
|
479
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
480
|
+
readonly liveAtOffset: Schema.brand<Schema.String, "Offset">;
|
|
481
|
+
}>>;
|
|
482
|
+
}>, Schema.TaggedStruct<"Append", {
|
|
483
|
+
readonly streamId: Schema.brand<Schema.String, "StreamId">;
|
|
484
|
+
readonly messages: Schema.$Array<Schema.Struct<{
|
|
485
|
+
readonly offset: Schema.brand<Schema.String, "Offset">;
|
|
486
|
+
readonly timestamp: Schema.Finite;
|
|
487
|
+
readonly data: Schema.Uint8Array;
|
|
488
|
+
}>>;
|
|
489
|
+
readonly patch: Schema.Struct<{
|
|
490
|
+
readonly currentOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
491
|
+
readonly config: Schema.optionalKey<Schema.Struct<{
|
|
492
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
493
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
494
|
+
}>>;
|
|
495
|
+
readonly lifecycle: Schema.optionalKey<Schema.Struct<{
|
|
496
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
497
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
498
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
499
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
500
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
501
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
502
|
+
readonly closed: Schema.optionalKey<Schema.Boolean>;
|
|
503
|
+
readonly softDeleted: Schema.optionalKey<Schema.Boolean>;
|
|
504
|
+
}>>;
|
|
505
|
+
readonly clear: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["ttlSeconds", "expiresAt", "expiresAtMs", "lastSeq"]>>>;
|
|
506
|
+
}>;
|
|
507
|
+
readonly expectedOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
508
|
+
readonly expectedClosed: Schema.optionalKey<Schema.Boolean>;
|
|
509
|
+
readonly producer: Schema.optionalKey<Schema.Struct<{
|
|
510
|
+
readonly producerId: Schema.brand<Schema.String, "ProducerId">;
|
|
511
|
+
readonly expected: Schema.Option<Schema.Struct<{
|
|
512
|
+
readonly epoch: Schema.Finite;
|
|
513
|
+
readonly lastSeq: Schema.Finite;
|
|
514
|
+
}>>;
|
|
515
|
+
readonly next: Schema.Struct<{
|
|
516
|
+
readonly epoch: Schema.Finite;
|
|
517
|
+
readonly lastSeq: Schema.Finite;
|
|
518
|
+
}>;
|
|
519
|
+
}>>;
|
|
520
|
+
}>, Schema.TaggedStruct<"Delete", {
|
|
521
|
+
readonly streamId: Schema.brand<Schema.String, "StreamId">;
|
|
522
|
+
readonly reason: Schema.Literals<readonly ["delete", "expiry"]>;
|
|
523
|
+
readonly expectedExpiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
524
|
+
}>]>;
|
|
525
|
+
declare const Mutation: Schema.Struct<{
|
|
526
|
+
readonly operations: Schema.NonEmptyArray<Schema.Union<readonly [Schema.TaggedStruct<"Create", {
|
|
527
|
+
readonly record: Schema.Struct<{
|
|
528
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
529
|
+
readonly config: Schema.Struct<{
|
|
530
|
+
readonly contentType: Schema.String;
|
|
531
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
532
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
533
|
+
readonly createdAt: Schema.Finite;
|
|
534
|
+
}>;
|
|
535
|
+
readonly lifecycle: Schema.Struct<{
|
|
536
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
537
|
+
readonly closed: Schema.Boolean;
|
|
538
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
539
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
540
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
541
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
542
|
+
readonly softDeleted: Schema.Boolean;
|
|
543
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
544
|
+
}>;
|
|
545
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
546
|
+
}>;
|
|
547
|
+
readonly initialMessages: Schema.$Array<Schema.Struct<{
|
|
548
|
+
readonly offset: Schema.brand<Schema.String, "Offset">;
|
|
549
|
+
readonly timestamp: Schema.Finite;
|
|
550
|
+
readonly data: Schema.Uint8Array;
|
|
551
|
+
}>>;
|
|
552
|
+
readonly forkSource: Schema.optionalKey<Schema.Struct<{
|
|
553
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
554
|
+
readonly liveAtOffset: Schema.brand<Schema.String, "Offset">;
|
|
555
|
+
}>>;
|
|
556
|
+
}>, Schema.TaggedStruct<"Append", {
|
|
557
|
+
readonly streamId: Schema.brand<Schema.String, "StreamId">;
|
|
558
|
+
readonly messages: Schema.$Array<Schema.Struct<{
|
|
559
|
+
readonly offset: Schema.brand<Schema.String, "Offset">;
|
|
560
|
+
readonly timestamp: Schema.Finite;
|
|
561
|
+
readonly data: Schema.Uint8Array;
|
|
562
|
+
}>>;
|
|
563
|
+
readonly patch: Schema.Struct<{
|
|
564
|
+
readonly currentOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
565
|
+
readonly config: Schema.optionalKey<Schema.Struct<{
|
|
566
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
567
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
568
|
+
}>>;
|
|
569
|
+
readonly lifecycle: Schema.optionalKey<Schema.Struct<{
|
|
570
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
571
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
572
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
573
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
574
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
575
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
576
|
+
readonly closed: Schema.optionalKey<Schema.Boolean>;
|
|
577
|
+
readonly softDeleted: Schema.optionalKey<Schema.Boolean>;
|
|
578
|
+
}>>;
|
|
579
|
+
readonly clear: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["ttlSeconds", "expiresAt", "expiresAtMs", "lastSeq"]>>>;
|
|
580
|
+
}>;
|
|
581
|
+
readonly expectedOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
582
|
+
readonly expectedClosed: Schema.optionalKey<Schema.Boolean>;
|
|
583
|
+
readonly producer: Schema.optionalKey<Schema.Struct<{
|
|
584
|
+
readonly producerId: Schema.brand<Schema.String, "ProducerId">;
|
|
585
|
+
readonly expected: Schema.Option<Schema.Struct<{
|
|
586
|
+
readonly epoch: Schema.Finite;
|
|
587
|
+
readonly lastSeq: Schema.Finite;
|
|
588
|
+
}>>;
|
|
589
|
+
readonly next: Schema.Struct<{
|
|
590
|
+
readonly epoch: Schema.Finite;
|
|
591
|
+
readonly lastSeq: Schema.Finite;
|
|
592
|
+
}>;
|
|
593
|
+
}>>;
|
|
594
|
+
}>, Schema.TaggedStruct<"Delete", {
|
|
595
|
+
readonly streamId: Schema.brand<Schema.String, "StreamId">;
|
|
596
|
+
readonly reason: Schema.Literals<readonly ["delete", "expiry"]>;
|
|
597
|
+
readonly expectedExpiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
598
|
+
}>]>>;
|
|
599
|
+
}>;
|
|
600
|
+
declare const OperationResult: Schema.Union<readonly [Schema.TaggedStruct<"Created", {
|
|
601
|
+
readonly record: Schema.Struct<{
|
|
602
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
603
|
+
readonly config: Schema.Struct<{
|
|
604
|
+
readonly contentType: Schema.String;
|
|
605
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
606
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
607
|
+
readonly createdAt: Schema.Finite;
|
|
608
|
+
}>;
|
|
609
|
+
readonly lifecycle: Schema.Struct<{
|
|
610
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
611
|
+
readonly closed: Schema.Boolean;
|
|
612
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
613
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
614
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
615
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
616
|
+
readonly softDeleted: Schema.Boolean;
|
|
617
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
618
|
+
}>;
|
|
619
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
620
|
+
}>;
|
|
621
|
+
}>, Schema.TaggedStruct<"Appended", {
|
|
622
|
+
readonly record: Schema.Struct<{
|
|
623
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
624
|
+
readonly config: Schema.Struct<{
|
|
625
|
+
readonly contentType: Schema.String;
|
|
626
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
627
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
628
|
+
readonly createdAt: Schema.Finite;
|
|
629
|
+
}>;
|
|
630
|
+
readonly lifecycle: Schema.Struct<{
|
|
631
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
632
|
+
readonly closed: Schema.Boolean;
|
|
633
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
634
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
635
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
636
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
637
|
+
readonly softDeleted: Schema.Boolean;
|
|
638
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
639
|
+
}>;
|
|
640
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
641
|
+
}>;
|
|
642
|
+
}>, Schema.TaggedStruct<"Purged", {
|
|
643
|
+
readonly record: Schema.Struct<{
|
|
644
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
645
|
+
readonly config: Schema.Struct<{
|
|
646
|
+
readonly contentType: Schema.String;
|
|
647
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
648
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
649
|
+
readonly createdAt: Schema.Finite;
|
|
650
|
+
}>;
|
|
651
|
+
readonly lifecycle: Schema.Struct<{
|
|
652
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
653
|
+
readonly closed: Schema.Boolean;
|
|
654
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
655
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
656
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
657
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
658
|
+
readonly softDeleted: Schema.Boolean;
|
|
659
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
660
|
+
}>;
|
|
661
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
662
|
+
}>;
|
|
663
|
+
}>, Schema.TaggedStruct<"SoftDeleted", {
|
|
664
|
+
readonly record: Schema.Struct<{
|
|
665
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
666
|
+
readonly config: Schema.Struct<{
|
|
667
|
+
readonly contentType: Schema.String;
|
|
668
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
669
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
670
|
+
readonly createdAt: Schema.Finite;
|
|
671
|
+
}>;
|
|
672
|
+
readonly lifecycle: Schema.Struct<{
|
|
673
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
674
|
+
readonly closed: Schema.Boolean;
|
|
675
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
676
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
677
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
678
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
679
|
+
readonly softDeleted: Schema.Boolean;
|
|
680
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
681
|
+
}>;
|
|
682
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
683
|
+
}>;
|
|
684
|
+
}>]>;
|
|
685
|
+
/** The success channel of a storage mutation contains only applied operation results. */
|
|
686
|
+
declare const MutationApplied: Schema.TaggedStruct<"Applied", {
|
|
687
|
+
readonly results: Schema.NonEmptyArray<Schema.Union<readonly [Schema.TaggedStruct<"Created", {
|
|
688
|
+
readonly record: Schema.Struct<{
|
|
689
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
690
|
+
readonly config: Schema.Struct<{
|
|
691
|
+
readonly contentType: Schema.String;
|
|
692
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
693
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
694
|
+
readonly createdAt: Schema.Finite;
|
|
695
|
+
}>;
|
|
696
|
+
readonly lifecycle: Schema.Struct<{
|
|
697
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
698
|
+
readonly closed: Schema.Boolean;
|
|
699
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
700
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
701
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
702
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
703
|
+
readonly softDeleted: Schema.Boolean;
|
|
704
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
705
|
+
}>;
|
|
706
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
707
|
+
}>;
|
|
708
|
+
}>, Schema.TaggedStruct<"Appended", {
|
|
709
|
+
readonly record: Schema.Struct<{
|
|
710
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
711
|
+
readonly config: Schema.Struct<{
|
|
712
|
+
readonly contentType: Schema.String;
|
|
713
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
714
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
715
|
+
readonly createdAt: Schema.Finite;
|
|
716
|
+
}>;
|
|
717
|
+
readonly lifecycle: Schema.Struct<{
|
|
718
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
719
|
+
readonly closed: Schema.Boolean;
|
|
720
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
721
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
722
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
723
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
724
|
+
readonly softDeleted: Schema.Boolean;
|
|
725
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
726
|
+
}>;
|
|
727
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
728
|
+
}>;
|
|
729
|
+
}>, Schema.TaggedStruct<"Purged", {
|
|
730
|
+
readonly record: Schema.Struct<{
|
|
731
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
732
|
+
readonly config: Schema.Struct<{
|
|
733
|
+
readonly contentType: Schema.String;
|
|
734
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
735
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
736
|
+
readonly createdAt: Schema.Finite;
|
|
737
|
+
}>;
|
|
738
|
+
readonly lifecycle: Schema.Struct<{
|
|
739
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
740
|
+
readonly closed: Schema.Boolean;
|
|
741
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
742
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
743
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
744
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
745
|
+
readonly softDeleted: Schema.Boolean;
|
|
746
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
747
|
+
}>;
|
|
748
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
749
|
+
}>;
|
|
750
|
+
}>, Schema.TaggedStruct<"SoftDeleted", {
|
|
751
|
+
readonly record: Schema.Struct<{
|
|
752
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
753
|
+
readonly config: Schema.Struct<{
|
|
754
|
+
readonly contentType: Schema.String;
|
|
755
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
756
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
757
|
+
readonly createdAt: Schema.Finite;
|
|
758
|
+
}>;
|
|
759
|
+
readonly lifecycle: Schema.Struct<{
|
|
760
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
761
|
+
readonly closed: Schema.Boolean;
|
|
762
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
763
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
764
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
765
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
766
|
+
readonly softDeleted: Schema.Boolean;
|
|
767
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
768
|
+
}>;
|
|
769
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
770
|
+
}>;
|
|
771
|
+
}>]>>;
|
|
772
|
+
}>;
|
|
773
|
+
declare const MutationRejected_base: Schema.Class<MutationRejected, Schema.TaggedStruct<"MutationRejected", {
|
|
774
|
+
readonly index: Schema.Finite;
|
|
775
|
+
readonly reason: Schema.Literals<readonly ["offset", "closed", "producer", "exists", "not-found", "gone", "fork-source-gone", "expiry-mismatch"]>;
|
|
776
|
+
readonly record: Schema.Option<Schema.Struct<{
|
|
777
|
+
readonly id: Schema.brand<Schema.String, "StreamId">;
|
|
778
|
+
readonly config: Schema.Struct<{
|
|
779
|
+
readonly contentType: Schema.String;
|
|
780
|
+
readonly ttlSeconds: Schema.optionalKey<Schema.Finite>;
|
|
781
|
+
readonly expiresAt: Schema.optionalKey<Schema.String>;
|
|
782
|
+
readonly createdAt: Schema.Finite;
|
|
783
|
+
}>;
|
|
784
|
+
readonly lifecycle: Schema.Struct<{
|
|
785
|
+
readonly lastSeq: Schema.optionalKey<Schema.String>;
|
|
786
|
+
readonly closed: Schema.Boolean;
|
|
787
|
+
readonly closedAt: Schema.optionalKey<Schema.Finite>;
|
|
788
|
+
readonly forkedFrom: Schema.optionalKey<Schema.brand<Schema.String, "StreamId">>;
|
|
789
|
+
readonly forkOffset: Schema.optionalKey<Schema.brand<Schema.String, "Offset">>;
|
|
790
|
+
readonly forkSubOffset: Schema.optionalKey<Schema.Finite>;
|
|
791
|
+
readonly softDeleted: Schema.Boolean;
|
|
792
|
+
readonly expiresAtMs: Schema.optionalKey<Schema.Finite>;
|
|
793
|
+
}>;
|
|
794
|
+
readonly currentOffset: Schema.brand<Schema.String, "Offset">;
|
|
795
|
+
}>>;
|
|
796
|
+
}>, import("effect/Cause").YieldableError>;
|
|
797
|
+
declare class MutationRejected extends MutationRejected_base {}
|
|
798
|
+
type ProducerPrecondition = typeof ProducerPrecondition.Type;
|
|
799
|
+
type Operation = typeof Operation.Type;
|
|
800
|
+
type Mutation = typeof Mutation.Type;
|
|
801
|
+
type OperationResult = typeof OperationResult.Type;
|
|
802
|
+
type MutationApplied = typeof MutationApplied.Type;
|
|
803
|
+
/**
|
|
804
|
+
* Constructors and matchers for the storage values above. They build plain
|
|
805
|
+
* objects and do not validate; storage decodes at its own boundary.
|
|
806
|
+
*/
|
|
807
|
+
declare const Operations: {
|
|
808
|
+
readonly $is: <Tag extends "Append" | "Create" | "Delete">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
809
|
+
readonly _tag: "Create";
|
|
810
|
+
readonly record: {
|
|
811
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
812
|
+
readonly config: {
|
|
813
|
+
readonly contentType: string;
|
|
814
|
+
readonly ttlSeconds?: number | undefined;
|
|
815
|
+
readonly expiresAt?: string | undefined;
|
|
816
|
+
readonly createdAt: number;
|
|
817
|
+
};
|
|
818
|
+
readonly lifecycle: {
|
|
819
|
+
readonly lastSeq?: string | undefined;
|
|
820
|
+
readonly closed: boolean;
|
|
821
|
+
readonly closedAt?: number | undefined;
|
|
822
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
823
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
824
|
+
readonly forkSubOffset?: number | undefined;
|
|
825
|
+
readonly softDeleted: boolean;
|
|
826
|
+
readonly expiresAtMs?: number | undefined;
|
|
827
|
+
};
|
|
828
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
829
|
+
};
|
|
830
|
+
readonly initialMessages: readonly {
|
|
831
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
832
|
+
readonly timestamp: number;
|
|
833
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
834
|
+
}[];
|
|
835
|
+
readonly forkSource?: {
|
|
836
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
837
|
+
readonly liveAtOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
838
|
+
} | undefined;
|
|
839
|
+
}, {
|
|
840
|
+
readonly _tag: Tag;
|
|
841
|
+
}> | Extract<{
|
|
842
|
+
readonly _tag: "Append";
|
|
843
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
844
|
+
readonly messages: readonly {
|
|
845
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
846
|
+
readonly timestamp: number;
|
|
847
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
848
|
+
}[];
|
|
849
|
+
readonly patch: {
|
|
850
|
+
readonly currentOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
851
|
+
readonly config?: {
|
|
852
|
+
readonly ttlSeconds?: number | undefined;
|
|
853
|
+
readonly expiresAt?: string | undefined;
|
|
854
|
+
} | undefined;
|
|
855
|
+
readonly lifecycle?: {
|
|
856
|
+
readonly lastSeq?: string | undefined;
|
|
857
|
+
readonly closedAt?: number | undefined;
|
|
858
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
859
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
860
|
+
readonly forkSubOffset?: number | undefined;
|
|
861
|
+
readonly expiresAtMs?: number | undefined;
|
|
862
|
+
readonly closed?: boolean | undefined;
|
|
863
|
+
readonly softDeleted?: boolean | undefined;
|
|
864
|
+
} | undefined;
|
|
865
|
+
readonly clear?: readonly ("expiresAt" | "expiresAtMs" | "lastSeq" | "ttlSeconds")[] | undefined;
|
|
866
|
+
};
|
|
867
|
+
readonly expectedOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
868
|
+
readonly expectedClosed?: boolean | undefined;
|
|
869
|
+
readonly producer?: {
|
|
870
|
+
readonly producerId: string & import("effect/Brand").Brand<"ProducerId">;
|
|
871
|
+
readonly expected: import("effect/Option").Option<{
|
|
872
|
+
readonly epoch: number;
|
|
873
|
+
readonly lastSeq: number;
|
|
874
|
+
}>;
|
|
875
|
+
readonly next: {
|
|
876
|
+
readonly epoch: number;
|
|
877
|
+
readonly lastSeq: number;
|
|
878
|
+
};
|
|
879
|
+
} | undefined;
|
|
880
|
+
}, {
|
|
881
|
+
readonly _tag: Tag;
|
|
882
|
+
}> | Extract<{
|
|
883
|
+
readonly _tag: "Delete";
|
|
884
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
885
|
+
readonly reason: "delete" | "expiry";
|
|
886
|
+
readonly expectedExpiresAtMs?: number | undefined;
|
|
887
|
+
}, {
|
|
888
|
+
readonly _tag: Tag;
|
|
889
|
+
}>;
|
|
890
|
+
readonly $match: {
|
|
891
|
+
<Cases extends { readonly [Tag in "Append" | "Create" | "Delete"]: (args: Extract<{
|
|
892
|
+
readonly _tag: "Create";
|
|
893
|
+
readonly record: {
|
|
894
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
895
|
+
readonly config: {
|
|
896
|
+
readonly contentType: string;
|
|
897
|
+
readonly ttlSeconds?: number | undefined;
|
|
898
|
+
readonly expiresAt?: string | undefined;
|
|
899
|
+
readonly createdAt: number;
|
|
900
|
+
};
|
|
901
|
+
readonly lifecycle: {
|
|
902
|
+
readonly lastSeq?: string | undefined;
|
|
903
|
+
readonly closed: boolean;
|
|
904
|
+
readonly closedAt?: number | undefined;
|
|
905
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
906
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
907
|
+
readonly forkSubOffset?: number | undefined;
|
|
908
|
+
readonly softDeleted: boolean;
|
|
909
|
+
readonly expiresAtMs?: number | undefined;
|
|
910
|
+
};
|
|
911
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
912
|
+
};
|
|
913
|
+
readonly initialMessages: readonly {
|
|
914
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
915
|
+
readonly timestamp: number;
|
|
916
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
917
|
+
}[];
|
|
918
|
+
readonly forkSource?: {
|
|
919
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
920
|
+
readonly liveAtOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
921
|
+
} | undefined;
|
|
922
|
+
} | {
|
|
923
|
+
readonly _tag: "Append";
|
|
924
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
925
|
+
readonly messages: readonly {
|
|
926
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
927
|
+
readonly timestamp: number;
|
|
928
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
929
|
+
}[];
|
|
930
|
+
readonly patch: {
|
|
931
|
+
readonly currentOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
932
|
+
readonly config?: {
|
|
933
|
+
readonly ttlSeconds?: number | undefined;
|
|
934
|
+
readonly expiresAt?: string | undefined;
|
|
935
|
+
} | undefined;
|
|
936
|
+
readonly lifecycle?: {
|
|
937
|
+
readonly lastSeq?: string | undefined;
|
|
938
|
+
readonly closedAt?: number | undefined;
|
|
939
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
940
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
941
|
+
readonly forkSubOffset?: number | undefined;
|
|
942
|
+
readonly expiresAtMs?: number | undefined;
|
|
943
|
+
readonly closed?: boolean | undefined;
|
|
944
|
+
readonly softDeleted?: boolean | undefined;
|
|
945
|
+
} | undefined;
|
|
946
|
+
readonly clear?: readonly ("expiresAt" | "expiresAtMs" | "lastSeq" | "ttlSeconds")[] | undefined;
|
|
947
|
+
};
|
|
948
|
+
readonly expectedOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
949
|
+
readonly expectedClosed?: boolean | undefined;
|
|
950
|
+
readonly producer?: {
|
|
951
|
+
readonly producerId: string & import("effect/Brand").Brand<"ProducerId">;
|
|
952
|
+
readonly expected: import("effect/Option").Option<{
|
|
953
|
+
readonly epoch: number;
|
|
954
|
+
readonly lastSeq: number;
|
|
955
|
+
}>;
|
|
956
|
+
readonly next: {
|
|
957
|
+
readonly epoch: number;
|
|
958
|
+
readonly lastSeq: number;
|
|
959
|
+
};
|
|
960
|
+
} | undefined;
|
|
961
|
+
} | {
|
|
962
|
+
readonly _tag: "Delete";
|
|
963
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
964
|
+
readonly reason: "delete" | "expiry";
|
|
965
|
+
readonly expectedExpiresAtMs?: number | undefined;
|
|
966
|
+
}, {
|
|
967
|
+
readonly _tag: Tag;
|
|
968
|
+
}>) => any; }>(cases: Cases): (value: {
|
|
969
|
+
readonly _tag: "Create";
|
|
970
|
+
readonly record: {
|
|
971
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
972
|
+
readonly config: {
|
|
973
|
+
readonly contentType: string;
|
|
974
|
+
readonly ttlSeconds?: number | undefined;
|
|
975
|
+
readonly expiresAt?: string | undefined;
|
|
976
|
+
readonly createdAt: number;
|
|
977
|
+
};
|
|
978
|
+
readonly lifecycle: {
|
|
979
|
+
readonly lastSeq?: string | undefined;
|
|
980
|
+
readonly closed: boolean;
|
|
981
|
+
readonly closedAt?: number | undefined;
|
|
982
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
983
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
984
|
+
readonly forkSubOffset?: number | undefined;
|
|
985
|
+
readonly softDeleted: boolean;
|
|
986
|
+
readonly expiresAtMs?: number | undefined;
|
|
987
|
+
};
|
|
988
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
989
|
+
};
|
|
990
|
+
readonly initialMessages: readonly {
|
|
991
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
992
|
+
readonly timestamp: number;
|
|
993
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
994
|
+
}[];
|
|
995
|
+
readonly forkSource?: {
|
|
996
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
997
|
+
readonly liveAtOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
998
|
+
} | undefined;
|
|
999
|
+
} | {
|
|
1000
|
+
readonly _tag: "Append";
|
|
1001
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1002
|
+
readonly messages: readonly {
|
|
1003
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1004
|
+
readonly timestamp: number;
|
|
1005
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1006
|
+
}[];
|
|
1007
|
+
readonly patch: {
|
|
1008
|
+
readonly currentOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1009
|
+
readonly config?: {
|
|
1010
|
+
readonly ttlSeconds?: number | undefined;
|
|
1011
|
+
readonly expiresAt?: string | undefined;
|
|
1012
|
+
} | undefined;
|
|
1013
|
+
readonly lifecycle?: {
|
|
1014
|
+
readonly lastSeq?: string | undefined;
|
|
1015
|
+
readonly closedAt?: number | undefined;
|
|
1016
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1017
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1018
|
+
readonly forkSubOffset?: number | undefined;
|
|
1019
|
+
readonly expiresAtMs?: number | undefined;
|
|
1020
|
+
readonly closed?: boolean | undefined;
|
|
1021
|
+
readonly softDeleted?: boolean | undefined;
|
|
1022
|
+
} | undefined;
|
|
1023
|
+
readonly clear?: readonly ("expiresAt" | "expiresAtMs" | "lastSeq" | "ttlSeconds")[] | undefined;
|
|
1024
|
+
};
|
|
1025
|
+
readonly expectedOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1026
|
+
readonly expectedClosed?: boolean | undefined;
|
|
1027
|
+
readonly producer?: {
|
|
1028
|
+
readonly producerId: string & import("effect/Brand").Brand<"ProducerId">;
|
|
1029
|
+
readonly expected: import("effect/Option").Option<{
|
|
1030
|
+
readonly epoch: number;
|
|
1031
|
+
readonly lastSeq: number;
|
|
1032
|
+
}>;
|
|
1033
|
+
readonly next: {
|
|
1034
|
+
readonly epoch: number;
|
|
1035
|
+
readonly lastSeq: number;
|
|
1036
|
+
};
|
|
1037
|
+
} | undefined;
|
|
1038
|
+
} | {
|
|
1039
|
+
readonly _tag: "Delete";
|
|
1040
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1041
|
+
readonly reason: "delete" | "expiry";
|
|
1042
|
+
readonly expectedExpiresAtMs?: number | undefined;
|
|
1043
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["Append" | "Create" | "Delete"]>>;
|
|
1044
|
+
<Cases extends { readonly [Tag in "Append" | "Create" | "Delete"]: (args: Extract<{
|
|
1045
|
+
readonly _tag: "Create";
|
|
1046
|
+
readonly record: {
|
|
1047
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1048
|
+
readonly config: {
|
|
1049
|
+
readonly contentType: string;
|
|
1050
|
+
readonly ttlSeconds?: number | undefined;
|
|
1051
|
+
readonly expiresAt?: string | undefined;
|
|
1052
|
+
readonly createdAt: number;
|
|
1053
|
+
};
|
|
1054
|
+
readonly lifecycle: {
|
|
1055
|
+
readonly lastSeq?: string | undefined;
|
|
1056
|
+
readonly closed: boolean;
|
|
1057
|
+
readonly closedAt?: number | undefined;
|
|
1058
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1059
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1060
|
+
readonly forkSubOffset?: number | undefined;
|
|
1061
|
+
readonly softDeleted: boolean;
|
|
1062
|
+
readonly expiresAtMs?: number | undefined;
|
|
1063
|
+
};
|
|
1064
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1065
|
+
};
|
|
1066
|
+
readonly initialMessages: readonly {
|
|
1067
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1068
|
+
readonly timestamp: number;
|
|
1069
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1070
|
+
}[];
|
|
1071
|
+
readonly forkSource?: {
|
|
1072
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1073
|
+
readonly liveAtOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1074
|
+
} | undefined;
|
|
1075
|
+
} | {
|
|
1076
|
+
readonly _tag: "Append";
|
|
1077
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1078
|
+
readonly messages: readonly {
|
|
1079
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1080
|
+
readonly timestamp: number;
|
|
1081
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1082
|
+
}[];
|
|
1083
|
+
readonly patch: {
|
|
1084
|
+
readonly currentOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1085
|
+
readonly config?: {
|
|
1086
|
+
readonly ttlSeconds?: number | undefined;
|
|
1087
|
+
readonly expiresAt?: string | undefined;
|
|
1088
|
+
} | undefined;
|
|
1089
|
+
readonly lifecycle?: {
|
|
1090
|
+
readonly lastSeq?: string | undefined;
|
|
1091
|
+
readonly closedAt?: number | undefined;
|
|
1092
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1093
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1094
|
+
readonly forkSubOffset?: number | undefined;
|
|
1095
|
+
readonly expiresAtMs?: number | undefined;
|
|
1096
|
+
readonly closed?: boolean | undefined;
|
|
1097
|
+
readonly softDeleted?: boolean | undefined;
|
|
1098
|
+
} | undefined;
|
|
1099
|
+
readonly clear?: readonly ("expiresAt" | "expiresAtMs" | "lastSeq" | "ttlSeconds")[] | undefined;
|
|
1100
|
+
};
|
|
1101
|
+
readonly expectedOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1102
|
+
readonly expectedClosed?: boolean | undefined;
|
|
1103
|
+
readonly producer?: {
|
|
1104
|
+
readonly producerId: string & import("effect/Brand").Brand<"ProducerId">;
|
|
1105
|
+
readonly expected: import("effect/Option").Option<{
|
|
1106
|
+
readonly epoch: number;
|
|
1107
|
+
readonly lastSeq: number;
|
|
1108
|
+
}>;
|
|
1109
|
+
readonly next: {
|
|
1110
|
+
readonly epoch: number;
|
|
1111
|
+
readonly lastSeq: number;
|
|
1112
|
+
};
|
|
1113
|
+
} | undefined;
|
|
1114
|
+
} | {
|
|
1115
|
+
readonly _tag: "Delete";
|
|
1116
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1117
|
+
readonly reason: "delete" | "expiry";
|
|
1118
|
+
readonly expectedExpiresAtMs?: number | undefined;
|
|
1119
|
+
}, {
|
|
1120
|
+
readonly _tag: Tag;
|
|
1121
|
+
}>) => any; }>(value: {
|
|
1122
|
+
readonly _tag: "Create";
|
|
1123
|
+
readonly record: {
|
|
1124
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1125
|
+
readonly config: {
|
|
1126
|
+
readonly contentType: string;
|
|
1127
|
+
readonly ttlSeconds?: number | undefined;
|
|
1128
|
+
readonly expiresAt?: string | undefined;
|
|
1129
|
+
readonly createdAt: number;
|
|
1130
|
+
};
|
|
1131
|
+
readonly lifecycle: {
|
|
1132
|
+
readonly lastSeq?: string | undefined;
|
|
1133
|
+
readonly closed: boolean;
|
|
1134
|
+
readonly closedAt?: number | undefined;
|
|
1135
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1136
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1137
|
+
readonly forkSubOffset?: number | undefined;
|
|
1138
|
+
readonly softDeleted: boolean;
|
|
1139
|
+
readonly expiresAtMs?: number | undefined;
|
|
1140
|
+
};
|
|
1141
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1142
|
+
};
|
|
1143
|
+
readonly initialMessages: readonly {
|
|
1144
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1145
|
+
readonly timestamp: number;
|
|
1146
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1147
|
+
}[];
|
|
1148
|
+
readonly forkSource?: {
|
|
1149
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1150
|
+
readonly liveAtOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1151
|
+
} | undefined;
|
|
1152
|
+
} | {
|
|
1153
|
+
readonly _tag: "Append";
|
|
1154
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1155
|
+
readonly messages: readonly {
|
|
1156
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1157
|
+
readonly timestamp: number;
|
|
1158
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1159
|
+
}[];
|
|
1160
|
+
readonly patch: {
|
|
1161
|
+
readonly currentOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1162
|
+
readonly config?: {
|
|
1163
|
+
readonly ttlSeconds?: number | undefined;
|
|
1164
|
+
readonly expiresAt?: string | undefined;
|
|
1165
|
+
} | undefined;
|
|
1166
|
+
readonly lifecycle?: {
|
|
1167
|
+
readonly lastSeq?: string | undefined;
|
|
1168
|
+
readonly closedAt?: number | undefined;
|
|
1169
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1170
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1171
|
+
readonly forkSubOffset?: number | undefined;
|
|
1172
|
+
readonly expiresAtMs?: number | undefined;
|
|
1173
|
+
readonly closed?: boolean | undefined;
|
|
1174
|
+
readonly softDeleted?: boolean | undefined;
|
|
1175
|
+
} | undefined;
|
|
1176
|
+
readonly clear?: readonly ("expiresAt" | "expiresAtMs" | "lastSeq" | "ttlSeconds")[] | undefined;
|
|
1177
|
+
};
|
|
1178
|
+
readonly expectedOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1179
|
+
readonly expectedClosed?: boolean | undefined;
|
|
1180
|
+
readonly producer?: {
|
|
1181
|
+
readonly producerId: string & import("effect/Brand").Brand<"ProducerId">;
|
|
1182
|
+
readonly expected: import("effect/Option").Option<{
|
|
1183
|
+
readonly epoch: number;
|
|
1184
|
+
readonly lastSeq: number;
|
|
1185
|
+
}>;
|
|
1186
|
+
readonly next: {
|
|
1187
|
+
readonly epoch: number;
|
|
1188
|
+
readonly lastSeq: number;
|
|
1189
|
+
};
|
|
1190
|
+
} | undefined;
|
|
1191
|
+
} | {
|
|
1192
|
+
readonly _tag: "Delete";
|
|
1193
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1194
|
+
readonly reason: "delete" | "expiry";
|
|
1195
|
+
readonly expectedExpiresAtMs?: number | undefined;
|
|
1196
|
+
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Append" | "Create" | "Delete"]>>;
|
|
1197
|
+
};
|
|
1198
|
+
readonly Append: Data.TaggedEnum.ConstructorFrom<{
|
|
1199
|
+
readonly _tag: "Append";
|
|
1200
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1201
|
+
readonly messages: readonly {
|
|
1202
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1203
|
+
readonly timestamp: number;
|
|
1204
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1205
|
+
}[];
|
|
1206
|
+
readonly patch: {
|
|
1207
|
+
readonly currentOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1208
|
+
readonly config?: {
|
|
1209
|
+
readonly ttlSeconds?: number | undefined;
|
|
1210
|
+
readonly expiresAt?: string | undefined;
|
|
1211
|
+
} | undefined;
|
|
1212
|
+
readonly lifecycle?: {
|
|
1213
|
+
readonly lastSeq?: string | undefined;
|
|
1214
|
+
readonly closedAt?: number | undefined;
|
|
1215
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1216
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1217
|
+
readonly forkSubOffset?: number | undefined;
|
|
1218
|
+
readonly expiresAtMs?: number | undefined;
|
|
1219
|
+
readonly closed?: boolean | undefined;
|
|
1220
|
+
readonly softDeleted?: boolean | undefined;
|
|
1221
|
+
} | undefined;
|
|
1222
|
+
readonly clear?: readonly ("expiresAt" | "expiresAtMs" | "lastSeq" | "ttlSeconds")[] | undefined;
|
|
1223
|
+
};
|
|
1224
|
+
readonly expectedOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1225
|
+
readonly expectedClosed?: boolean | undefined;
|
|
1226
|
+
readonly producer?: {
|
|
1227
|
+
readonly producerId: string & import("effect/Brand").Brand<"ProducerId">;
|
|
1228
|
+
readonly expected: import("effect/Option").Option<{
|
|
1229
|
+
readonly epoch: number;
|
|
1230
|
+
readonly lastSeq: number;
|
|
1231
|
+
}>;
|
|
1232
|
+
readonly next: {
|
|
1233
|
+
readonly epoch: number;
|
|
1234
|
+
readonly lastSeq: number;
|
|
1235
|
+
};
|
|
1236
|
+
} | undefined;
|
|
1237
|
+
}, "_tag">;
|
|
1238
|
+
readonly Create: Data.TaggedEnum.ConstructorFrom<{
|
|
1239
|
+
readonly _tag: "Create";
|
|
1240
|
+
readonly record: {
|
|
1241
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1242
|
+
readonly config: {
|
|
1243
|
+
readonly contentType: string;
|
|
1244
|
+
readonly ttlSeconds?: number | undefined;
|
|
1245
|
+
readonly expiresAt?: string | undefined;
|
|
1246
|
+
readonly createdAt: number;
|
|
1247
|
+
};
|
|
1248
|
+
readonly lifecycle: {
|
|
1249
|
+
readonly lastSeq?: string | undefined;
|
|
1250
|
+
readonly closed: boolean;
|
|
1251
|
+
readonly closedAt?: number | undefined;
|
|
1252
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1253
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1254
|
+
readonly forkSubOffset?: number | undefined;
|
|
1255
|
+
readonly softDeleted: boolean;
|
|
1256
|
+
readonly expiresAtMs?: number | undefined;
|
|
1257
|
+
};
|
|
1258
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1259
|
+
};
|
|
1260
|
+
readonly initialMessages: readonly {
|
|
1261
|
+
readonly offset: string & import("effect/Brand").Brand<"Offset">;
|
|
1262
|
+
readonly timestamp: number;
|
|
1263
|
+
readonly data: Uint8Array<ArrayBufferLike>;
|
|
1264
|
+
}[];
|
|
1265
|
+
readonly forkSource?: {
|
|
1266
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1267
|
+
readonly liveAtOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1268
|
+
} | undefined;
|
|
1269
|
+
}, "_tag">;
|
|
1270
|
+
readonly Delete: Data.TaggedEnum.ConstructorFrom<{
|
|
1271
|
+
readonly _tag: "Delete";
|
|
1272
|
+
readonly streamId: string & import("effect/Brand").Brand<"StreamId">;
|
|
1273
|
+
readonly reason: "delete" | "expiry";
|
|
1274
|
+
readonly expectedExpiresAtMs?: number | undefined;
|
|
1275
|
+
}, "_tag">;
|
|
1276
|
+
};
|
|
1277
|
+
declare const OperationResults: {
|
|
1278
|
+
readonly $is: <Tag extends "Appended" | "Created" | "Purged" | "SoftDeleted">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
1279
|
+
readonly _tag: "Created";
|
|
1280
|
+
readonly record: {
|
|
1281
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1282
|
+
readonly config: {
|
|
1283
|
+
readonly contentType: string;
|
|
1284
|
+
readonly ttlSeconds?: number | undefined;
|
|
1285
|
+
readonly expiresAt?: string | undefined;
|
|
1286
|
+
readonly createdAt: number;
|
|
1287
|
+
};
|
|
1288
|
+
readonly lifecycle: {
|
|
1289
|
+
readonly lastSeq?: string | undefined;
|
|
1290
|
+
readonly closed: boolean;
|
|
1291
|
+
readonly closedAt?: number | undefined;
|
|
1292
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1293
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1294
|
+
readonly forkSubOffset?: number | undefined;
|
|
1295
|
+
readonly softDeleted: boolean;
|
|
1296
|
+
readonly expiresAtMs?: number | undefined;
|
|
1297
|
+
};
|
|
1298
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1299
|
+
};
|
|
1300
|
+
}, {
|
|
1301
|
+
readonly _tag: Tag;
|
|
1302
|
+
}> | Extract<{
|
|
1303
|
+
readonly _tag: "Appended";
|
|
1304
|
+
readonly record: {
|
|
1305
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1306
|
+
readonly config: {
|
|
1307
|
+
readonly contentType: string;
|
|
1308
|
+
readonly ttlSeconds?: number | undefined;
|
|
1309
|
+
readonly expiresAt?: string | undefined;
|
|
1310
|
+
readonly createdAt: number;
|
|
1311
|
+
};
|
|
1312
|
+
readonly lifecycle: {
|
|
1313
|
+
readonly lastSeq?: string | undefined;
|
|
1314
|
+
readonly closed: boolean;
|
|
1315
|
+
readonly closedAt?: number | undefined;
|
|
1316
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1317
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1318
|
+
readonly forkSubOffset?: number | undefined;
|
|
1319
|
+
readonly softDeleted: boolean;
|
|
1320
|
+
readonly expiresAtMs?: number | undefined;
|
|
1321
|
+
};
|
|
1322
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1323
|
+
};
|
|
1324
|
+
}, {
|
|
1325
|
+
readonly _tag: Tag;
|
|
1326
|
+
}> | Extract<{
|
|
1327
|
+
readonly _tag: "Purged";
|
|
1328
|
+
readonly record: {
|
|
1329
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1330
|
+
readonly config: {
|
|
1331
|
+
readonly contentType: string;
|
|
1332
|
+
readonly ttlSeconds?: number | undefined;
|
|
1333
|
+
readonly expiresAt?: string | undefined;
|
|
1334
|
+
readonly createdAt: number;
|
|
1335
|
+
};
|
|
1336
|
+
readonly lifecycle: {
|
|
1337
|
+
readonly lastSeq?: string | undefined;
|
|
1338
|
+
readonly closed: boolean;
|
|
1339
|
+
readonly closedAt?: number | undefined;
|
|
1340
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1341
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1342
|
+
readonly forkSubOffset?: number | undefined;
|
|
1343
|
+
readonly softDeleted: boolean;
|
|
1344
|
+
readonly expiresAtMs?: number | undefined;
|
|
1345
|
+
};
|
|
1346
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1347
|
+
};
|
|
1348
|
+
}, {
|
|
1349
|
+
readonly _tag: Tag;
|
|
1350
|
+
}> | Extract<{
|
|
1351
|
+
readonly _tag: "SoftDeleted";
|
|
1352
|
+
readonly record: {
|
|
1353
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1354
|
+
readonly config: {
|
|
1355
|
+
readonly contentType: string;
|
|
1356
|
+
readonly ttlSeconds?: number | undefined;
|
|
1357
|
+
readonly expiresAt?: string | undefined;
|
|
1358
|
+
readonly createdAt: number;
|
|
1359
|
+
};
|
|
1360
|
+
readonly lifecycle: {
|
|
1361
|
+
readonly lastSeq?: string | undefined;
|
|
1362
|
+
readonly closed: boolean;
|
|
1363
|
+
readonly closedAt?: number | undefined;
|
|
1364
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1365
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1366
|
+
readonly forkSubOffset?: number | undefined;
|
|
1367
|
+
readonly softDeleted: boolean;
|
|
1368
|
+
readonly expiresAtMs?: number | undefined;
|
|
1369
|
+
};
|
|
1370
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1371
|
+
};
|
|
1372
|
+
}, {
|
|
1373
|
+
readonly _tag: Tag;
|
|
1374
|
+
}>;
|
|
1375
|
+
readonly $match: {
|
|
1376
|
+
<Cases extends { readonly [Tag in "Appended" | "Created" | "Purged" | "SoftDeleted"]: (args: Extract<{
|
|
1377
|
+
readonly _tag: "Created";
|
|
1378
|
+
readonly record: {
|
|
1379
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1380
|
+
readonly config: {
|
|
1381
|
+
readonly contentType: string;
|
|
1382
|
+
readonly ttlSeconds?: number | undefined;
|
|
1383
|
+
readonly expiresAt?: string | undefined;
|
|
1384
|
+
readonly createdAt: number;
|
|
1385
|
+
};
|
|
1386
|
+
readonly lifecycle: {
|
|
1387
|
+
readonly lastSeq?: string | undefined;
|
|
1388
|
+
readonly closed: boolean;
|
|
1389
|
+
readonly closedAt?: number | undefined;
|
|
1390
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1391
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1392
|
+
readonly forkSubOffset?: number | undefined;
|
|
1393
|
+
readonly softDeleted: boolean;
|
|
1394
|
+
readonly expiresAtMs?: number | undefined;
|
|
1395
|
+
};
|
|
1396
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1397
|
+
};
|
|
1398
|
+
} | {
|
|
1399
|
+
readonly _tag: "Appended";
|
|
1400
|
+
readonly record: {
|
|
1401
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1402
|
+
readonly config: {
|
|
1403
|
+
readonly contentType: string;
|
|
1404
|
+
readonly ttlSeconds?: number | undefined;
|
|
1405
|
+
readonly expiresAt?: string | undefined;
|
|
1406
|
+
readonly createdAt: number;
|
|
1407
|
+
};
|
|
1408
|
+
readonly lifecycle: {
|
|
1409
|
+
readonly lastSeq?: string | undefined;
|
|
1410
|
+
readonly closed: boolean;
|
|
1411
|
+
readonly closedAt?: number | undefined;
|
|
1412
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1413
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1414
|
+
readonly forkSubOffset?: number | undefined;
|
|
1415
|
+
readonly softDeleted: boolean;
|
|
1416
|
+
readonly expiresAtMs?: number | undefined;
|
|
1417
|
+
};
|
|
1418
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1419
|
+
};
|
|
1420
|
+
} | {
|
|
1421
|
+
readonly _tag: "Purged";
|
|
1422
|
+
readonly record: {
|
|
1423
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1424
|
+
readonly config: {
|
|
1425
|
+
readonly contentType: string;
|
|
1426
|
+
readonly ttlSeconds?: number | undefined;
|
|
1427
|
+
readonly expiresAt?: string | undefined;
|
|
1428
|
+
readonly createdAt: number;
|
|
1429
|
+
};
|
|
1430
|
+
readonly lifecycle: {
|
|
1431
|
+
readonly lastSeq?: string | undefined;
|
|
1432
|
+
readonly closed: boolean;
|
|
1433
|
+
readonly closedAt?: number | undefined;
|
|
1434
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1435
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1436
|
+
readonly forkSubOffset?: number | undefined;
|
|
1437
|
+
readonly softDeleted: boolean;
|
|
1438
|
+
readonly expiresAtMs?: number | undefined;
|
|
1439
|
+
};
|
|
1440
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1441
|
+
};
|
|
1442
|
+
} | {
|
|
1443
|
+
readonly _tag: "SoftDeleted";
|
|
1444
|
+
readonly record: {
|
|
1445
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1446
|
+
readonly config: {
|
|
1447
|
+
readonly contentType: string;
|
|
1448
|
+
readonly ttlSeconds?: number | undefined;
|
|
1449
|
+
readonly expiresAt?: string | undefined;
|
|
1450
|
+
readonly createdAt: number;
|
|
1451
|
+
};
|
|
1452
|
+
readonly lifecycle: {
|
|
1453
|
+
readonly lastSeq?: string | undefined;
|
|
1454
|
+
readonly closed: boolean;
|
|
1455
|
+
readonly closedAt?: number | undefined;
|
|
1456
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1457
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1458
|
+
readonly forkSubOffset?: number | undefined;
|
|
1459
|
+
readonly softDeleted: boolean;
|
|
1460
|
+
readonly expiresAtMs?: number | undefined;
|
|
1461
|
+
};
|
|
1462
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1463
|
+
};
|
|
1464
|
+
}, {
|
|
1465
|
+
readonly _tag: Tag;
|
|
1466
|
+
}>) => any; }>(cases: Cases): (value: {
|
|
1467
|
+
readonly _tag: "Created";
|
|
1468
|
+
readonly record: {
|
|
1469
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1470
|
+
readonly config: {
|
|
1471
|
+
readonly contentType: string;
|
|
1472
|
+
readonly ttlSeconds?: number | undefined;
|
|
1473
|
+
readonly expiresAt?: string | undefined;
|
|
1474
|
+
readonly createdAt: number;
|
|
1475
|
+
};
|
|
1476
|
+
readonly lifecycle: {
|
|
1477
|
+
readonly lastSeq?: string | undefined;
|
|
1478
|
+
readonly closed: boolean;
|
|
1479
|
+
readonly closedAt?: number | undefined;
|
|
1480
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1481
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1482
|
+
readonly forkSubOffset?: number | undefined;
|
|
1483
|
+
readonly softDeleted: boolean;
|
|
1484
|
+
readonly expiresAtMs?: number | undefined;
|
|
1485
|
+
};
|
|
1486
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1487
|
+
};
|
|
1488
|
+
} | {
|
|
1489
|
+
readonly _tag: "Appended";
|
|
1490
|
+
readonly record: {
|
|
1491
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1492
|
+
readonly config: {
|
|
1493
|
+
readonly contentType: string;
|
|
1494
|
+
readonly ttlSeconds?: number | undefined;
|
|
1495
|
+
readonly expiresAt?: string | undefined;
|
|
1496
|
+
readonly createdAt: number;
|
|
1497
|
+
};
|
|
1498
|
+
readonly lifecycle: {
|
|
1499
|
+
readonly lastSeq?: string | undefined;
|
|
1500
|
+
readonly closed: boolean;
|
|
1501
|
+
readonly closedAt?: number | undefined;
|
|
1502
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1503
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1504
|
+
readonly forkSubOffset?: number | undefined;
|
|
1505
|
+
readonly softDeleted: boolean;
|
|
1506
|
+
readonly expiresAtMs?: number | undefined;
|
|
1507
|
+
};
|
|
1508
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1509
|
+
};
|
|
1510
|
+
} | {
|
|
1511
|
+
readonly _tag: "Purged";
|
|
1512
|
+
readonly record: {
|
|
1513
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1514
|
+
readonly config: {
|
|
1515
|
+
readonly contentType: string;
|
|
1516
|
+
readonly ttlSeconds?: number | undefined;
|
|
1517
|
+
readonly expiresAt?: string | undefined;
|
|
1518
|
+
readonly createdAt: number;
|
|
1519
|
+
};
|
|
1520
|
+
readonly lifecycle: {
|
|
1521
|
+
readonly lastSeq?: string | undefined;
|
|
1522
|
+
readonly closed: boolean;
|
|
1523
|
+
readonly closedAt?: number | undefined;
|
|
1524
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1525
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1526
|
+
readonly forkSubOffset?: number | undefined;
|
|
1527
|
+
readonly softDeleted: boolean;
|
|
1528
|
+
readonly expiresAtMs?: number | undefined;
|
|
1529
|
+
};
|
|
1530
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1531
|
+
};
|
|
1532
|
+
} | {
|
|
1533
|
+
readonly _tag: "SoftDeleted";
|
|
1534
|
+
readonly record: {
|
|
1535
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1536
|
+
readonly config: {
|
|
1537
|
+
readonly contentType: string;
|
|
1538
|
+
readonly ttlSeconds?: number | undefined;
|
|
1539
|
+
readonly expiresAt?: string | undefined;
|
|
1540
|
+
readonly createdAt: number;
|
|
1541
|
+
};
|
|
1542
|
+
readonly lifecycle: {
|
|
1543
|
+
readonly lastSeq?: string | undefined;
|
|
1544
|
+
readonly closed: boolean;
|
|
1545
|
+
readonly closedAt?: number | undefined;
|
|
1546
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1547
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1548
|
+
readonly forkSubOffset?: number | undefined;
|
|
1549
|
+
readonly softDeleted: boolean;
|
|
1550
|
+
readonly expiresAtMs?: number | undefined;
|
|
1551
|
+
};
|
|
1552
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1553
|
+
};
|
|
1554
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["Appended" | "Created" | "Purged" | "SoftDeleted"]>>;
|
|
1555
|
+
<Cases extends { readonly [Tag in "Appended" | "Created" | "Purged" | "SoftDeleted"]: (args: Extract<{
|
|
1556
|
+
readonly _tag: "Created";
|
|
1557
|
+
readonly record: {
|
|
1558
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1559
|
+
readonly config: {
|
|
1560
|
+
readonly contentType: string;
|
|
1561
|
+
readonly ttlSeconds?: number | undefined;
|
|
1562
|
+
readonly expiresAt?: string | undefined;
|
|
1563
|
+
readonly createdAt: number;
|
|
1564
|
+
};
|
|
1565
|
+
readonly lifecycle: {
|
|
1566
|
+
readonly lastSeq?: string | undefined;
|
|
1567
|
+
readonly closed: boolean;
|
|
1568
|
+
readonly closedAt?: number | undefined;
|
|
1569
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1570
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1571
|
+
readonly forkSubOffset?: number | undefined;
|
|
1572
|
+
readonly softDeleted: boolean;
|
|
1573
|
+
readonly expiresAtMs?: number | undefined;
|
|
1574
|
+
};
|
|
1575
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1576
|
+
};
|
|
1577
|
+
} | {
|
|
1578
|
+
readonly _tag: "Appended";
|
|
1579
|
+
readonly record: {
|
|
1580
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1581
|
+
readonly config: {
|
|
1582
|
+
readonly contentType: string;
|
|
1583
|
+
readonly ttlSeconds?: number | undefined;
|
|
1584
|
+
readonly expiresAt?: string | undefined;
|
|
1585
|
+
readonly createdAt: number;
|
|
1586
|
+
};
|
|
1587
|
+
readonly lifecycle: {
|
|
1588
|
+
readonly lastSeq?: string | undefined;
|
|
1589
|
+
readonly closed: boolean;
|
|
1590
|
+
readonly closedAt?: number | undefined;
|
|
1591
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1592
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1593
|
+
readonly forkSubOffset?: number | undefined;
|
|
1594
|
+
readonly softDeleted: boolean;
|
|
1595
|
+
readonly expiresAtMs?: number | undefined;
|
|
1596
|
+
};
|
|
1597
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1598
|
+
};
|
|
1599
|
+
} | {
|
|
1600
|
+
readonly _tag: "Purged";
|
|
1601
|
+
readonly record: {
|
|
1602
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1603
|
+
readonly config: {
|
|
1604
|
+
readonly contentType: string;
|
|
1605
|
+
readonly ttlSeconds?: number | undefined;
|
|
1606
|
+
readonly expiresAt?: string | undefined;
|
|
1607
|
+
readonly createdAt: number;
|
|
1608
|
+
};
|
|
1609
|
+
readonly lifecycle: {
|
|
1610
|
+
readonly lastSeq?: string | undefined;
|
|
1611
|
+
readonly closed: boolean;
|
|
1612
|
+
readonly closedAt?: number | undefined;
|
|
1613
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1614
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1615
|
+
readonly forkSubOffset?: number | undefined;
|
|
1616
|
+
readonly softDeleted: boolean;
|
|
1617
|
+
readonly expiresAtMs?: number | undefined;
|
|
1618
|
+
};
|
|
1619
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1620
|
+
};
|
|
1621
|
+
} | {
|
|
1622
|
+
readonly _tag: "SoftDeleted";
|
|
1623
|
+
readonly record: {
|
|
1624
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1625
|
+
readonly config: {
|
|
1626
|
+
readonly contentType: string;
|
|
1627
|
+
readonly ttlSeconds?: number | undefined;
|
|
1628
|
+
readonly expiresAt?: string | undefined;
|
|
1629
|
+
readonly createdAt: number;
|
|
1630
|
+
};
|
|
1631
|
+
readonly lifecycle: {
|
|
1632
|
+
readonly lastSeq?: string | undefined;
|
|
1633
|
+
readonly closed: boolean;
|
|
1634
|
+
readonly closedAt?: number | undefined;
|
|
1635
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1636
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1637
|
+
readonly forkSubOffset?: number | undefined;
|
|
1638
|
+
readonly softDeleted: boolean;
|
|
1639
|
+
readonly expiresAtMs?: number | undefined;
|
|
1640
|
+
};
|
|
1641
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1642
|
+
};
|
|
1643
|
+
}, {
|
|
1644
|
+
readonly _tag: Tag;
|
|
1645
|
+
}>) => any; }>(value: {
|
|
1646
|
+
readonly _tag: "Created";
|
|
1647
|
+
readonly record: {
|
|
1648
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1649
|
+
readonly config: {
|
|
1650
|
+
readonly contentType: string;
|
|
1651
|
+
readonly ttlSeconds?: number | undefined;
|
|
1652
|
+
readonly expiresAt?: string | undefined;
|
|
1653
|
+
readonly createdAt: number;
|
|
1654
|
+
};
|
|
1655
|
+
readonly lifecycle: {
|
|
1656
|
+
readonly lastSeq?: string | undefined;
|
|
1657
|
+
readonly closed: boolean;
|
|
1658
|
+
readonly closedAt?: number | undefined;
|
|
1659
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1660
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1661
|
+
readonly forkSubOffset?: number | undefined;
|
|
1662
|
+
readonly softDeleted: boolean;
|
|
1663
|
+
readonly expiresAtMs?: number | undefined;
|
|
1664
|
+
};
|
|
1665
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1666
|
+
};
|
|
1667
|
+
} | {
|
|
1668
|
+
readonly _tag: "Appended";
|
|
1669
|
+
readonly record: {
|
|
1670
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1671
|
+
readonly config: {
|
|
1672
|
+
readonly contentType: string;
|
|
1673
|
+
readonly ttlSeconds?: number | undefined;
|
|
1674
|
+
readonly expiresAt?: string | undefined;
|
|
1675
|
+
readonly createdAt: number;
|
|
1676
|
+
};
|
|
1677
|
+
readonly lifecycle: {
|
|
1678
|
+
readonly lastSeq?: string | undefined;
|
|
1679
|
+
readonly closed: boolean;
|
|
1680
|
+
readonly closedAt?: number | undefined;
|
|
1681
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1682
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1683
|
+
readonly forkSubOffset?: number | undefined;
|
|
1684
|
+
readonly softDeleted: boolean;
|
|
1685
|
+
readonly expiresAtMs?: number | undefined;
|
|
1686
|
+
};
|
|
1687
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1688
|
+
};
|
|
1689
|
+
} | {
|
|
1690
|
+
readonly _tag: "Purged";
|
|
1691
|
+
readonly record: {
|
|
1692
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1693
|
+
readonly config: {
|
|
1694
|
+
readonly contentType: string;
|
|
1695
|
+
readonly ttlSeconds?: number | undefined;
|
|
1696
|
+
readonly expiresAt?: string | undefined;
|
|
1697
|
+
readonly createdAt: number;
|
|
1698
|
+
};
|
|
1699
|
+
readonly lifecycle: {
|
|
1700
|
+
readonly lastSeq?: string | undefined;
|
|
1701
|
+
readonly closed: boolean;
|
|
1702
|
+
readonly closedAt?: number | undefined;
|
|
1703
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1704
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1705
|
+
readonly forkSubOffset?: number | undefined;
|
|
1706
|
+
readonly softDeleted: boolean;
|
|
1707
|
+
readonly expiresAtMs?: number | undefined;
|
|
1708
|
+
};
|
|
1709
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1710
|
+
};
|
|
1711
|
+
} | {
|
|
1712
|
+
readonly _tag: "SoftDeleted";
|
|
1713
|
+
readonly record: {
|
|
1714
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1715
|
+
readonly config: {
|
|
1716
|
+
readonly contentType: string;
|
|
1717
|
+
readonly ttlSeconds?: number | undefined;
|
|
1718
|
+
readonly expiresAt?: string | undefined;
|
|
1719
|
+
readonly createdAt: number;
|
|
1720
|
+
};
|
|
1721
|
+
readonly lifecycle: {
|
|
1722
|
+
readonly lastSeq?: string | undefined;
|
|
1723
|
+
readonly closed: boolean;
|
|
1724
|
+
readonly closedAt?: number | undefined;
|
|
1725
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1726
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1727
|
+
readonly forkSubOffset?: number | undefined;
|
|
1728
|
+
readonly softDeleted: boolean;
|
|
1729
|
+
readonly expiresAtMs?: number | undefined;
|
|
1730
|
+
};
|
|
1731
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1732
|
+
};
|
|
1733
|
+
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Appended" | "Created" | "Purged" | "SoftDeleted"]>>;
|
|
1734
|
+
};
|
|
1735
|
+
readonly Appended: Data.TaggedEnum.ConstructorFrom<{
|
|
1736
|
+
readonly _tag: "Appended";
|
|
1737
|
+
readonly record: {
|
|
1738
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1739
|
+
readonly config: {
|
|
1740
|
+
readonly contentType: string;
|
|
1741
|
+
readonly ttlSeconds?: number | undefined;
|
|
1742
|
+
readonly expiresAt?: string | undefined;
|
|
1743
|
+
readonly createdAt: number;
|
|
1744
|
+
};
|
|
1745
|
+
readonly lifecycle: {
|
|
1746
|
+
readonly lastSeq?: string | undefined;
|
|
1747
|
+
readonly closed: boolean;
|
|
1748
|
+
readonly closedAt?: number | undefined;
|
|
1749
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1750
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1751
|
+
readonly forkSubOffset?: number | undefined;
|
|
1752
|
+
readonly softDeleted: boolean;
|
|
1753
|
+
readonly expiresAtMs?: number | undefined;
|
|
1754
|
+
};
|
|
1755
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1756
|
+
};
|
|
1757
|
+
}, "_tag">;
|
|
1758
|
+
readonly Created: Data.TaggedEnum.ConstructorFrom<{
|
|
1759
|
+
readonly _tag: "Created";
|
|
1760
|
+
readonly record: {
|
|
1761
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1762
|
+
readonly config: {
|
|
1763
|
+
readonly contentType: string;
|
|
1764
|
+
readonly ttlSeconds?: number | undefined;
|
|
1765
|
+
readonly expiresAt?: string | undefined;
|
|
1766
|
+
readonly createdAt: number;
|
|
1767
|
+
};
|
|
1768
|
+
readonly lifecycle: {
|
|
1769
|
+
readonly lastSeq?: string | undefined;
|
|
1770
|
+
readonly closed: boolean;
|
|
1771
|
+
readonly closedAt?: number | undefined;
|
|
1772
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1773
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1774
|
+
readonly forkSubOffset?: number | undefined;
|
|
1775
|
+
readonly softDeleted: boolean;
|
|
1776
|
+
readonly expiresAtMs?: number | undefined;
|
|
1777
|
+
};
|
|
1778
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1779
|
+
};
|
|
1780
|
+
}, "_tag">;
|
|
1781
|
+
readonly Purged: Data.TaggedEnum.ConstructorFrom<{
|
|
1782
|
+
readonly _tag: "Purged";
|
|
1783
|
+
readonly record: {
|
|
1784
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1785
|
+
readonly config: {
|
|
1786
|
+
readonly contentType: string;
|
|
1787
|
+
readonly ttlSeconds?: number | undefined;
|
|
1788
|
+
readonly expiresAt?: string | undefined;
|
|
1789
|
+
readonly createdAt: number;
|
|
1790
|
+
};
|
|
1791
|
+
readonly lifecycle: {
|
|
1792
|
+
readonly lastSeq?: string | undefined;
|
|
1793
|
+
readonly closed: boolean;
|
|
1794
|
+
readonly closedAt?: number | undefined;
|
|
1795
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1796
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1797
|
+
readonly forkSubOffset?: number | undefined;
|
|
1798
|
+
readonly softDeleted: boolean;
|
|
1799
|
+
readonly expiresAtMs?: number | undefined;
|
|
1800
|
+
};
|
|
1801
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1802
|
+
};
|
|
1803
|
+
}, "_tag">;
|
|
1804
|
+
readonly SoftDeleted: Data.TaggedEnum.ConstructorFrom<{
|
|
1805
|
+
readonly _tag: "SoftDeleted";
|
|
1806
|
+
readonly record: {
|
|
1807
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1808
|
+
readonly config: {
|
|
1809
|
+
readonly contentType: string;
|
|
1810
|
+
readonly ttlSeconds?: number | undefined;
|
|
1811
|
+
readonly expiresAt?: string | undefined;
|
|
1812
|
+
readonly createdAt: number;
|
|
1813
|
+
};
|
|
1814
|
+
readonly lifecycle: {
|
|
1815
|
+
readonly lastSeq?: string | undefined;
|
|
1816
|
+
readonly closed: boolean;
|
|
1817
|
+
readonly closedAt?: number | undefined;
|
|
1818
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1819
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1820
|
+
readonly forkSubOffset?: number | undefined;
|
|
1821
|
+
readonly softDeleted: boolean;
|
|
1822
|
+
readonly expiresAtMs?: number | undefined;
|
|
1823
|
+
};
|
|
1824
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1825
|
+
};
|
|
1826
|
+
}, "_tag">;
|
|
1827
|
+
};
|
|
1828
|
+
declare const Mutations: {
|
|
1829
|
+
readonly $is: <Tag extends "Applied">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
1830
|
+
readonly _tag: "Applied";
|
|
1831
|
+
readonly results: readonly [{
|
|
1832
|
+
readonly _tag: "Created";
|
|
1833
|
+
readonly record: {
|
|
1834
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1835
|
+
readonly config: {
|
|
1836
|
+
readonly contentType: string;
|
|
1837
|
+
readonly ttlSeconds?: number | undefined;
|
|
1838
|
+
readonly expiresAt?: string | undefined;
|
|
1839
|
+
readonly createdAt: number;
|
|
1840
|
+
};
|
|
1841
|
+
readonly lifecycle: {
|
|
1842
|
+
readonly lastSeq?: string | undefined;
|
|
1843
|
+
readonly closed: boolean;
|
|
1844
|
+
readonly closedAt?: number | undefined;
|
|
1845
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1846
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1847
|
+
readonly forkSubOffset?: number | undefined;
|
|
1848
|
+
readonly softDeleted: boolean;
|
|
1849
|
+
readonly expiresAtMs?: number | undefined;
|
|
1850
|
+
};
|
|
1851
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1852
|
+
};
|
|
1853
|
+
} | {
|
|
1854
|
+
readonly _tag: "Appended";
|
|
1855
|
+
readonly record: {
|
|
1856
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1857
|
+
readonly config: {
|
|
1858
|
+
readonly contentType: string;
|
|
1859
|
+
readonly ttlSeconds?: number | undefined;
|
|
1860
|
+
readonly expiresAt?: string | undefined;
|
|
1861
|
+
readonly createdAt: number;
|
|
1862
|
+
};
|
|
1863
|
+
readonly lifecycle: {
|
|
1864
|
+
readonly lastSeq?: string | undefined;
|
|
1865
|
+
readonly closed: boolean;
|
|
1866
|
+
readonly closedAt?: number | undefined;
|
|
1867
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1868
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1869
|
+
readonly forkSubOffset?: number | undefined;
|
|
1870
|
+
readonly softDeleted: boolean;
|
|
1871
|
+
readonly expiresAtMs?: number | undefined;
|
|
1872
|
+
};
|
|
1873
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1874
|
+
};
|
|
1875
|
+
} | {
|
|
1876
|
+
readonly _tag: "Purged";
|
|
1877
|
+
readonly record: {
|
|
1878
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1879
|
+
readonly config: {
|
|
1880
|
+
readonly contentType: string;
|
|
1881
|
+
readonly ttlSeconds?: number | undefined;
|
|
1882
|
+
readonly expiresAt?: string | undefined;
|
|
1883
|
+
readonly createdAt: number;
|
|
1884
|
+
};
|
|
1885
|
+
readonly lifecycle: {
|
|
1886
|
+
readonly lastSeq?: string | undefined;
|
|
1887
|
+
readonly closed: boolean;
|
|
1888
|
+
readonly closedAt?: number | undefined;
|
|
1889
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1890
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1891
|
+
readonly forkSubOffset?: number | undefined;
|
|
1892
|
+
readonly softDeleted: boolean;
|
|
1893
|
+
readonly expiresAtMs?: number | undefined;
|
|
1894
|
+
};
|
|
1895
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1896
|
+
};
|
|
1897
|
+
} | {
|
|
1898
|
+
readonly _tag: "SoftDeleted";
|
|
1899
|
+
readonly record: {
|
|
1900
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1901
|
+
readonly config: {
|
|
1902
|
+
readonly contentType: string;
|
|
1903
|
+
readonly ttlSeconds?: number | undefined;
|
|
1904
|
+
readonly expiresAt?: string | undefined;
|
|
1905
|
+
readonly createdAt: number;
|
|
1906
|
+
};
|
|
1907
|
+
readonly lifecycle: {
|
|
1908
|
+
readonly lastSeq?: string | undefined;
|
|
1909
|
+
readonly closed: boolean;
|
|
1910
|
+
readonly closedAt?: number | undefined;
|
|
1911
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1912
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1913
|
+
readonly forkSubOffset?: number | undefined;
|
|
1914
|
+
readonly softDeleted: boolean;
|
|
1915
|
+
readonly expiresAtMs?: number | undefined;
|
|
1916
|
+
};
|
|
1917
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1918
|
+
};
|
|
1919
|
+
}, ...({
|
|
1920
|
+
readonly _tag: "Created";
|
|
1921
|
+
readonly record: {
|
|
1922
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1923
|
+
readonly config: {
|
|
1924
|
+
readonly contentType: string;
|
|
1925
|
+
readonly ttlSeconds?: number | undefined;
|
|
1926
|
+
readonly expiresAt?: string | undefined;
|
|
1927
|
+
readonly createdAt: number;
|
|
1928
|
+
};
|
|
1929
|
+
readonly lifecycle: {
|
|
1930
|
+
readonly lastSeq?: string | undefined;
|
|
1931
|
+
readonly closed: boolean;
|
|
1932
|
+
readonly closedAt?: number | undefined;
|
|
1933
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1934
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1935
|
+
readonly forkSubOffset?: number | undefined;
|
|
1936
|
+
readonly softDeleted: boolean;
|
|
1937
|
+
readonly expiresAtMs?: number | undefined;
|
|
1938
|
+
};
|
|
1939
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1940
|
+
};
|
|
1941
|
+
} | {
|
|
1942
|
+
readonly _tag: "Appended";
|
|
1943
|
+
readonly record: {
|
|
1944
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1945
|
+
readonly config: {
|
|
1946
|
+
readonly contentType: string;
|
|
1947
|
+
readonly ttlSeconds?: number | undefined;
|
|
1948
|
+
readonly expiresAt?: string | undefined;
|
|
1949
|
+
readonly createdAt: number;
|
|
1950
|
+
};
|
|
1951
|
+
readonly lifecycle: {
|
|
1952
|
+
readonly lastSeq?: string | undefined;
|
|
1953
|
+
readonly closed: boolean;
|
|
1954
|
+
readonly closedAt?: number | undefined;
|
|
1955
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1956
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1957
|
+
readonly forkSubOffset?: number | undefined;
|
|
1958
|
+
readonly softDeleted: boolean;
|
|
1959
|
+
readonly expiresAtMs?: number | undefined;
|
|
1960
|
+
};
|
|
1961
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1962
|
+
};
|
|
1963
|
+
} | {
|
|
1964
|
+
readonly _tag: "Purged";
|
|
1965
|
+
readonly record: {
|
|
1966
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1967
|
+
readonly config: {
|
|
1968
|
+
readonly contentType: string;
|
|
1969
|
+
readonly ttlSeconds?: number | undefined;
|
|
1970
|
+
readonly expiresAt?: string | undefined;
|
|
1971
|
+
readonly createdAt: number;
|
|
1972
|
+
};
|
|
1973
|
+
readonly lifecycle: {
|
|
1974
|
+
readonly lastSeq?: string | undefined;
|
|
1975
|
+
readonly closed: boolean;
|
|
1976
|
+
readonly closedAt?: number | undefined;
|
|
1977
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
1978
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
1979
|
+
readonly forkSubOffset?: number | undefined;
|
|
1980
|
+
readonly softDeleted: boolean;
|
|
1981
|
+
readonly expiresAtMs?: number | undefined;
|
|
1982
|
+
};
|
|
1983
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
1984
|
+
};
|
|
1985
|
+
} | {
|
|
1986
|
+
readonly _tag: "SoftDeleted";
|
|
1987
|
+
readonly record: {
|
|
1988
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
1989
|
+
readonly config: {
|
|
1990
|
+
readonly contentType: string;
|
|
1991
|
+
readonly ttlSeconds?: number | undefined;
|
|
1992
|
+
readonly expiresAt?: string | undefined;
|
|
1993
|
+
readonly createdAt: number;
|
|
1994
|
+
};
|
|
1995
|
+
readonly lifecycle: {
|
|
1996
|
+
readonly lastSeq?: string | undefined;
|
|
1997
|
+
readonly closed: boolean;
|
|
1998
|
+
readonly closedAt?: number | undefined;
|
|
1999
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2000
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2001
|
+
readonly forkSubOffset?: number | undefined;
|
|
2002
|
+
readonly softDeleted: boolean;
|
|
2003
|
+
readonly expiresAtMs?: number | undefined;
|
|
2004
|
+
};
|
|
2005
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2006
|
+
};
|
|
2007
|
+
})[]];
|
|
2008
|
+
}, {
|
|
2009
|
+
readonly _tag: Tag;
|
|
2010
|
+
}>;
|
|
2011
|
+
readonly $match: {
|
|
2012
|
+
<Cases extends { readonly [Tag in "Applied"]: (args: Extract<{
|
|
2013
|
+
readonly _tag: "Applied";
|
|
2014
|
+
readonly results: readonly [{
|
|
2015
|
+
readonly _tag: "Created";
|
|
2016
|
+
readonly record: {
|
|
2017
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2018
|
+
readonly config: {
|
|
2019
|
+
readonly contentType: string;
|
|
2020
|
+
readonly ttlSeconds?: number | undefined;
|
|
2021
|
+
readonly expiresAt?: string | undefined;
|
|
2022
|
+
readonly createdAt: number;
|
|
2023
|
+
};
|
|
2024
|
+
readonly lifecycle: {
|
|
2025
|
+
readonly lastSeq?: string | undefined;
|
|
2026
|
+
readonly closed: boolean;
|
|
2027
|
+
readonly closedAt?: number | undefined;
|
|
2028
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2029
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2030
|
+
readonly forkSubOffset?: number | undefined;
|
|
2031
|
+
readonly softDeleted: boolean;
|
|
2032
|
+
readonly expiresAtMs?: number | undefined;
|
|
2033
|
+
};
|
|
2034
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2035
|
+
};
|
|
2036
|
+
} | {
|
|
2037
|
+
readonly _tag: "Appended";
|
|
2038
|
+
readonly record: {
|
|
2039
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2040
|
+
readonly config: {
|
|
2041
|
+
readonly contentType: string;
|
|
2042
|
+
readonly ttlSeconds?: number | undefined;
|
|
2043
|
+
readonly expiresAt?: string | undefined;
|
|
2044
|
+
readonly createdAt: number;
|
|
2045
|
+
};
|
|
2046
|
+
readonly lifecycle: {
|
|
2047
|
+
readonly lastSeq?: string | undefined;
|
|
2048
|
+
readonly closed: boolean;
|
|
2049
|
+
readonly closedAt?: number | undefined;
|
|
2050
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2051
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2052
|
+
readonly forkSubOffset?: number | undefined;
|
|
2053
|
+
readonly softDeleted: boolean;
|
|
2054
|
+
readonly expiresAtMs?: number | undefined;
|
|
2055
|
+
};
|
|
2056
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2057
|
+
};
|
|
2058
|
+
} | {
|
|
2059
|
+
readonly _tag: "Purged";
|
|
2060
|
+
readonly record: {
|
|
2061
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2062
|
+
readonly config: {
|
|
2063
|
+
readonly contentType: string;
|
|
2064
|
+
readonly ttlSeconds?: number | undefined;
|
|
2065
|
+
readonly expiresAt?: string | undefined;
|
|
2066
|
+
readonly createdAt: number;
|
|
2067
|
+
};
|
|
2068
|
+
readonly lifecycle: {
|
|
2069
|
+
readonly lastSeq?: string | undefined;
|
|
2070
|
+
readonly closed: boolean;
|
|
2071
|
+
readonly closedAt?: number | undefined;
|
|
2072
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2073
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2074
|
+
readonly forkSubOffset?: number | undefined;
|
|
2075
|
+
readonly softDeleted: boolean;
|
|
2076
|
+
readonly expiresAtMs?: number | undefined;
|
|
2077
|
+
};
|
|
2078
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2079
|
+
};
|
|
2080
|
+
} | {
|
|
2081
|
+
readonly _tag: "SoftDeleted";
|
|
2082
|
+
readonly record: {
|
|
2083
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2084
|
+
readonly config: {
|
|
2085
|
+
readonly contentType: string;
|
|
2086
|
+
readonly ttlSeconds?: number | undefined;
|
|
2087
|
+
readonly expiresAt?: string | undefined;
|
|
2088
|
+
readonly createdAt: number;
|
|
2089
|
+
};
|
|
2090
|
+
readonly lifecycle: {
|
|
2091
|
+
readonly lastSeq?: string | undefined;
|
|
2092
|
+
readonly closed: boolean;
|
|
2093
|
+
readonly closedAt?: number | undefined;
|
|
2094
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2095
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2096
|
+
readonly forkSubOffset?: number | undefined;
|
|
2097
|
+
readonly softDeleted: boolean;
|
|
2098
|
+
readonly expiresAtMs?: number | undefined;
|
|
2099
|
+
};
|
|
2100
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2101
|
+
};
|
|
2102
|
+
}, ...({
|
|
2103
|
+
readonly _tag: "Created";
|
|
2104
|
+
readonly record: {
|
|
2105
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2106
|
+
readonly config: {
|
|
2107
|
+
readonly contentType: string;
|
|
2108
|
+
readonly ttlSeconds?: number | undefined;
|
|
2109
|
+
readonly expiresAt?: string | undefined;
|
|
2110
|
+
readonly createdAt: number;
|
|
2111
|
+
};
|
|
2112
|
+
readonly lifecycle: {
|
|
2113
|
+
readonly lastSeq?: string | undefined;
|
|
2114
|
+
readonly closed: boolean;
|
|
2115
|
+
readonly closedAt?: number | undefined;
|
|
2116
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2117
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2118
|
+
readonly forkSubOffset?: number | undefined;
|
|
2119
|
+
readonly softDeleted: boolean;
|
|
2120
|
+
readonly expiresAtMs?: number | undefined;
|
|
2121
|
+
};
|
|
2122
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2123
|
+
};
|
|
2124
|
+
} | {
|
|
2125
|
+
readonly _tag: "Appended";
|
|
2126
|
+
readonly record: {
|
|
2127
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2128
|
+
readonly config: {
|
|
2129
|
+
readonly contentType: string;
|
|
2130
|
+
readonly ttlSeconds?: number | undefined;
|
|
2131
|
+
readonly expiresAt?: string | undefined;
|
|
2132
|
+
readonly createdAt: number;
|
|
2133
|
+
};
|
|
2134
|
+
readonly lifecycle: {
|
|
2135
|
+
readonly lastSeq?: string | undefined;
|
|
2136
|
+
readonly closed: boolean;
|
|
2137
|
+
readonly closedAt?: number | undefined;
|
|
2138
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2139
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2140
|
+
readonly forkSubOffset?: number | undefined;
|
|
2141
|
+
readonly softDeleted: boolean;
|
|
2142
|
+
readonly expiresAtMs?: number | undefined;
|
|
2143
|
+
};
|
|
2144
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2145
|
+
};
|
|
2146
|
+
} | {
|
|
2147
|
+
readonly _tag: "Purged";
|
|
2148
|
+
readonly record: {
|
|
2149
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2150
|
+
readonly config: {
|
|
2151
|
+
readonly contentType: string;
|
|
2152
|
+
readonly ttlSeconds?: number | undefined;
|
|
2153
|
+
readonly expiresAt?: string | undefined;
|
|
2154
|
+
readonly createdAt: number;
|
|
2155
|
+
};
|
|
2156
|
+
readonly lifecycle: {
|
|
2157
|
+
readonly lastSeq?: string | undefined;
|
|
2158
|
+
readonly closed: boolean;
|
|
2159
|
+
readonly closedAt?: number | undefined;
|
|
2160
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2161
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2162
|
+
readonly forkSubOffset?: number | undefined;
|
|
2163
|
+
readonly softDeleted: boolean;
|
|
2164
|
+
readonly expiresAtMs?: number | undefined;
|
|
2165
|
+
};
|
|
2166
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2167
|
+
};
|
|
2168
|
+
} | {
|
|
2169
|
+
readonly _tag: "SoftDeleted";
|
|
2170
|
+
readonly record: {
|
|
2171
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2172
|
+
readonly config: {
|
|
2173
|
+
readonly contentType: string;
|
|
2174
|
+
readonly ttlSeconds?: number | undefined;
|
|
2175
|
+
readonly expiresAt?: string | undefined;
|
|
2176
|
+
readonly createdAt: number;
|
|
2177
|
+
};
|
|
2178
|
+
readonly lifecycle: {
|
|
2179
|
+
readonly lastSeq?: string | undefined;
|
|
2180
|
+
readonly closed: boolean;
|
|
2181
|
+
readonly closedAt?: number | undefined;
|
|
2182
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2183
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2184
|
+
readonly forkSubOffset?: number | undefined;
|
|
2185
|
+
readonly softDeleted: boolean;
|
|
2186
|
+
readonly expiresAtMs?: number | undefined;
|
|
2187
|
+
};
|
|
2188
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2189
|
+
};
|
|
2190
|
+
})[]];
|
|
2191
|
+
}, {
|
|
2192
|
+
readonly _tag: Tag;
|
|
2193
|
+
}>) => any; }>(cases: Cases): (value: {
|
|
2194
|
+
readonly _tag: "Applied";
|
|
2195
|
+
readonly results: readonly [{
|
|
2196
|
+
readonly _tag: "Created";
|
|
2197
|
+
readonly record: {
|
|
2198
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2199
|
+
readonly config: {
|
|
2200
|
+
readonly contentType: string;
|
|
2201
|
+
readonly ttlSeconds?: number | undefined;
|
|
2202
|
+
readonly expiresAt?: string | undefined;
|
|
2203
|
+
readonly createdAt: number;
|
|
2204
|
+
};
|
|
2205
|
+
readonly lifecycle: {
|
|
2206
|
+
readonly lastSeq?: string | undefined;
|
|
2207
|
+
readonly closed: boolean;
|
|
2208
|
+
readonly closedAt?: number | undefined;
|
|
2209
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2210
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2211
|
+
readonly forkSubOffset?: number | undefined;
|
|
2212
|
+
readonly softDeleted: boolean;
|
|
2213
|
+
readonly expiresAtMs?: number | undefined;
|
|
2214
|
+
};
|
|
2215
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2216
|
+
};
|
|
2217
|
+
} | {
|
|
2218
|
+
readonly _tag: "Appended";
|
|
2219
|
+
readonly record: {
|
|
2220
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2221
|
+
readonly config: {
|
|
2222
|
+
readonly contentType: string;
|
|
2223
|
+
readonly ttlSeconds?: number | undefined;
|
|
2224
|
+
readonly expiresAt?: string | undefined;
|
|
2225
|
+
readonly createdAt: number;
|
|
2226
|
+
};
|
|
2227
|
+
readonly lifecycle: {
|
|
2228
|
+
readonly lastSeq?: string | undefined;
|
|
2229
|
+
readonly closed: boolean;
|
|
2230
|
+
readonly closedAt?: number | undefined;
|
|
2231
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2232
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2233
|
+
readonly forkSubOffset?: number | undefined;
|
|
2234
|
+
readonly softDeleted: boolean;
|
|
2235
|
+
readonly expiresAtMs?: number | undefined;
|
|
2236
|
+
};
|
|
2237
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2238
|
+
};
|
|
2239
|
+
} | {
|
|
2240
|
+
readonly _tag: "Purged";
|
|
2241
|
+
readonly record: {
|
|
2242
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2243
|
+
readonly config: {
|
|
2244
|
+
readonly contentType: string;
|
|
2245
|
+
readonly ttlSeconds?: number | undefined;
|
|
2246
|
+
readonly expiresAt?: string | undefined;
|
|
2247
|
+
readonly createdAt: number;
|
|
2248
|
+
};
|
|
2249
|
+
readonly lifecycle: {
|
|
2250
|
+
readonly lastSeq?: string | undefined;
|
|
2251
|
+
readonly closed: boolean;
|
|
2252
|
+
readonly closedAt?: number | undefined;
|
|
2253
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2254
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2255
|
+
readonly forkSubOffset?: number | undefined;
|
|
2256
|
+
readonly softDeleted: boolean;
|
|
2257
|
+
readonly expiresAtMs?: number | undefined;
|
|
2258
|
+
};
|
|
2259
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2260
|
+
};
|
|
2261
|
+
} | {
|
|
2262
|
+
readonly _tag: "SoftDeleted";
|
|
2263
|
+
readonly record: {
|
|
2264
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2265
|
+
readonly config: {
|
|
2266
|
+
readonly contentType: string;
|
|
2267
|
+
readonly ttlSeconds?: number | undefined;
|
|
2268
|
+
readonly expiresAt?: string | undefined;
|
|
2269
|
+
readonly createdAt: number;
|
|
2270
|
+
};
|
|
2271
|
+
readonly lifecycle: {
|
|
2272
|
+
readonly lastSeq?: string | undefined;
|
|
2273
|
+
readonly closed: boolean;
|
|
2274
|
+
readonly closedAt?: number | undefined;
|
|
2275
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2276
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2277
|
+
readonly forkSubOffset?: number | undefined;
|
|
2278
|
+
readonly softDeleted: boolean;
|
|
2279
|
+
readonly expiresAtMs?: number | undefined;
|
|
2280
|
+
};
|
|
2281
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2282
|
+
};
|
|
2283
|
+
}, ...({
|
|
2284
|
+
readonly _tag: "Created";
|
|
2285
|
+
readonly record: {
|
|
2286
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2287
|
+
readonly config: {
|
|
2288
|
+
readonly contentType: string;
|
|
2289
|
+
readonly ttlSeconds?: number | undefined;
|
|
2290
|
+
readonly expiresAt?: string | undefined;
|
|
2291
|
+
readonly createdAt: number;
|
|
2292
|
+
};
|
|
2293
|
+
readonly lifecycle: {
|
|
2294
|
+
readonly lastSeq?: string | undefined;
|
|
2295
|
+
readonly closed: boolean;
|
|
2296
|
+
readonly closedAt?: number | undefined;
|
|
2297
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2298
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2299
|
+
readonly forkSubOffset?: number | undefined;
|
|
2300
|
+
readonly softDeleted: boolean;
|
|
2301
|
+
readonly expiresAtMs?: number | undefined;
|
|
2302
|
+
};
|
|
2303
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2304
|
+
};
|
|
2305
|
+
} | {
|
|
2306
|
+
readonly _tag: "Appended";
|
|
2307
|
+
readonly record: {
|
|
2308
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2309
|
+
readonly config: {
|
|
2310
|
+
readonly contentType: string;
|
|
2311
|
+
readonly ttlSeconds?: number | undefined;
|
|
2312
|
+
readonly expiresAt?: string | undefined;
|
|
2313
|
+
readonly createdAt: number;
|
|
2314
|
+
};
|
|
2315
|
+
readonly lifecycle: {
|
|
2316
|
+
readonly lastSeq?: string | undefined;
|
|
2317
|
+
readonly closed: boolean;
|
|
2318
|
+
readonly closedAt?: number | undefined;
|
|
2319
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2320
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2321
|
+
readonly forkSubOffset?: number | undefined;
|
|
2322
|
+
readonly softDeleted: boolean;
|
|
2323
|
+
readonly expiresAtMs?: number | undefined;
|
|
2324
|
+
};
|
|
2325
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2326
|
+
};
|
|
2327
|
+
} | {
|
|
2328
|
+
readonly _tag: "Purged";
|
|
2329
|
+
readonly record: {
|
|
2330
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2331
|
+
readonly config: {
|
|
2332
|
+
readonly contentType: string;
|
|
2333
|
+
readonly ttlSeconds?: number | undefined;
|
|
2334
|
+
readonly expiresAt?: string | undefined;
|
|
2335
|
+
readonly createdAt: number;
|
|
2336
|
+
};
|
|
2337
|
+
readonly lifecycle: {
|
|
2338
|
+
readonly lastSeq?: string | undefined;
|
|
2339
|
+
readonly closed: boolean;
|
|
2340
|
+
readonly closedAt?: number | undefined;
|
|
2341
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2342
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2343
|
+
readonly forkSubOffset?: number | undefined;
|
|
2344
|
+
readonly softDeleted: boolean;
|
|
2345
|
+
readonly expiresAtMs?: number | undefined;
|
|
2346
|
+
};
|
|
2347
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2348
|
+
};
|
|
2349
|
+
} | {
|
|
2350
|
+
readonly _tag: "SoftDeleted";
|
|
2351
|
+
readonly record: {
|
|
2352
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2353
|
+
readonly config: {
|
|
2354
|
+
readonly contentType: string;
|
|
2355
|
+
readonly ttlSeconds?: number | undefined;
|
|
2356
|
+
readonly expiresAt?: string | undefined;
|
|
2357
|
+
readonly createdAt: number;
|
|
2358
|
+
};
|
|
2359
|
+
readonly lifecycle: {
|
|
2360
|
+
readonly lastSeq?: string | undefined;
|
|
2361
|
+
readonly closed: boolean;
|
|
2362
|
+
readonly closedAt?: number | undefined;
|
|
2363
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2364
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2365
|
+
readonly forkSubOffset?: number | undefined;
|
|
2366
|
+
readonly softDeleted: boolean;
|
|
2367
|
+
readonly expiresAtMs?: number | undefined;
|
|
2368
|
+
};
|
|
2369
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2370
|
+
};
|
|
2371
|
+
})[]];
|
|
2372
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["Applied"]>>;
|
|
2373
|
+
<Cases extends { readonly [Tag in "Applied"]: (args: Extract<{
|
|
2374
|
+
readonly _tag: "Applied";
|
|
2375
|
+
readonly results: readonly [{
|
|
2376
|
+
readonly _tag: "Created";
|
|
2377
|
+
readonly record: {
|
|
2378
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2379
|
+
readonly config: {
|
|
2380
|
+
readonly contentType: string;
|
|
2381
|
+
readonly ttlSeconds?: number | undefined;
|
|
2382
|
+
readonly expiresAt?: string | undefined;
|
|
2383
|
+
readonly createdAt: number;
|
|
2384
|
+
};
|
|
2385
|
+
readonly lifecycle: {
|
|
2386
|
+
readonly lastSeq?: string | undefined;
|
|
2387
|
+
readonly closed: boolean;
|
|
2388
|
+
readonly closedAt?: number | undefined;
|
|
2389
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2390
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2391
|
+
readonly forkSubOffset?: number | undefined;
|
|
2392
|
+
readonly softDeleted: boolean;
|
|
2393
|
+
readonly expiresAtMs?: number | undefined;
|
|
2394
|
+
};
|
|
2395
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2396
|
+
};
|
|
2397
|
+
} | {
|
|
2398
|
+
readonly _tag: "Appended";
|
|
2399
|
+
readonly record: {
|
|
2400
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2401
|
+
readonly config: {
|
|
2402
|
+
readonly contentType: string;
|
|
2403
|
+
readonly ttlSeconds?: number | undefined;
|
|
2404
|
+
readonly expiresAt?: string | undefined;
|
|
2405
|
+
readonly createdAt: number;
|
|
2406
|
+
};
|
|
2407
|
+
readonly lifecycle: {
|
|
2408
|
+
readonly lastSeq?: string | undefined;
|
|
2409
|
+
readonly closed: boolean;
|
|
2410
|
+
readonly closedAt?: number | undefined;
|
|
2411
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2412
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2413
|
+
readonly forkSubOffset?: number | undefined;
|
|
2414
|
+
readonly softDeleted: boolean;
|
|
2415
|
+
readonly expiresAtMs?: number | undefined;
|
|
2416
|
+
};
|
|
2417
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2418
|
+
};
|
|
2419
|
+
} | {
|
|
2420
|
+
readonly _tag: "Purged";
|
|
2421
|
+
readonly record: {
|
|
2422
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2423
|
+
readonly config: {
|
|
2424
|
+
readonly contentType: string;
|
|
2425
|
+
readonly ttlSeconds?: number | undefined;
|
|
2426
|
+
readonly expiresAt?: string | undefined;
|
|
2427
|
+
readonly createdAt: number;
|
|
2428
|
+
};
|
|
2429
|
+
readonly lifecycle: {
|
|
2430
|
+
readonly lastSeq?: string | undefined;
|
|
2431
|
+
readonly closed: boolean;
|
|
2432
|
+
readonly closedAt?: number | undefined;
|
|
2433
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2434
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2435
|
+
readonly forkSubOffset?: number | undefined;
|
|
2436
|
+
readonly softDeleted: boolean;
|
|
2437
|
+
readonly expiresAtMs?: number | undefined;
|
|
2438
|
+
};
|
|
2439
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2440
|
+
};
|
|
2441
|
+
} | {
|
|
2442
|
+
readonly _tag: "SoftDeleted";
|
|
2443
|
+
readonly record: {
|
|
2444
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2445
|
+
readonly config: {
|
|
2446
|
+
readonly contentType: string;
|
|
2447
|
+
readonly ttlSeconds?: number | undefined;
|
|
2448
|
+
readonly expiresAt?: string | undefined;
|
|
2449
|
+
readonly createdAt: number;
|
|
2450
|
+
};
|
|
2451
|
+
readonly lifecycle: {
|
|
2452
|
+
readonly lastSeq?: string | undefined;
|
|
2453
|
+
readonly closed: boolean;
|
|
2454
|
+
readonly closedAt?: number | undefined;
|
|
2455
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2456
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2457
|
+
readonly forkSubOffset?: number | undefined;
|
|
2458
|
+
readonly softDeleted: boolean;
|
|
2459
|
+
readonly expiresAtMs?: number | undefined;
|
|
2460
|
+
};
|
|
2461
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2462
|
+
};
|
|
2463
|
+
}, ...({
|
|
2464
|
+
readonly _tag: "Created";
|
|
2465
|
+
readonly record: {
|
|
2466
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2467
|
+
readonly config: {
|
|
2468
|
+
readonly contentType: string;
|
|
2469
|
+
readonly ttlSeconds?: number | undefined;
|
|
2470
|
+
readonly expiresAt?: string | undefined;
|
|
2471
|
+
readonly createdAt: number;
|
|
2472
|
+
};
|
|
2473
|
+
readonly lifecycle: {
|
|
2474
|
+
readonly lastSeq?: string | undefined;
|
|
2475
|
+
readonly closed: boolean;
|
|
2476
|
+
readonly closedAt?: number | undefined;
|
|
2477
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2478
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2479
|
+
readonly forkSubOffset?: number | undefined;
|
|
2480
|
+
readonly softDeleted: boolean;
|
|
2481
|
+
readonly expiresAtMs?: number | undefined;
|
|
2482
|
+
};
|
|
2483
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2484
|
+
};
|
|
2485
|
+
} | {
|
|
2486
|
+
readonly _tag: "Appended";
|
|
2487
|
+
readonly record: {
|
|
2488
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2489
|
+
readonly config: {
|
|
2490
|
+
readonly contentType: string;
|
|
2491
|
+
readonly ttlSeconds?: number | undefined;
|
|
2492
|
+
readonly expiresAt?: string | undefined;
|
|
2493
|
+
readonly createdAt: number;
|
|
2494
|
+
};
|
|
2495
|
+
readonly lifecycle: {
|
|
2496
|
+
readonly lastSeq?: string | undefined;
|
|
2497
|
+
readonly closed: boolean;
|
|
2498
|
+
readonly closedAt?: number | undefined;
|
|
2499
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2500
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2501
|
+
readonly forkSubOffset?: number | undefined;
|
|
2502
|
+
readonly softDeleted: boolean;
|
|
2503
|
+
readonly expiresAtMs?: number | undefined;
|
|
2504
|
+
};
|
|
2505
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2506
|
+
};
|
|
2507
|
+
} | {
|
|
2508
|
+
readonly _tag: "Purged";
|
|
2509
|
+
readonly record: {
|
|
2510
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2511
|
+
readonly config: {
|
|
2512
|
+
readonly contentType: string;
|
|
2513
|
+
readonly ttlSeconds?: number | undefined;
|
|
2514
|
+
readonly expiresAt?: string | undefined;
|
|
2515
|
+
readonly createdAt: number;
|
|
2516
|
+
};
|
|
2517
|
+
readonly lifecycle: {
|
|
2518
|
+
readonly lastSeq?: string | undefined;
|
|
2519
|
+
readonly closed: boolean;
|
|
2520
|
+
readonly closedAt?: number | undefined;
|
|
2521
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2522
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2523
|
+
readonly forkSubOffset?: number | undefined;
|
|
2524
|
+
readonly softDeleted: boolean;
|
|
2525
|
+
readonly expiresAtMs?: number | undefined;
|
|
2526
|
+
};
|
|
2527
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2528
|
+
};
|
|
2529
|
+
} | {
|
|
2530
|
+
readonly _tag: "SoftDeleted";
|
|
2531
|
+
readonly record: {
|
|
2532
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2533
|
+
readonly config: {
|
|
2534
|
+
readonly contentType: string;
|
|
2535
|
+
readonly ttlSeconds?: number | undefined;
|
|
2536
|
+
readonly expiresAt?: string | undefined;
|
|
2537
|
+
readonly createdAt: number;
|
|
2538
|
+
};
|
|
2539
|
+
readonly lifecycle: {
|
|
2540
|
+
readonly lastSeq?: string | undefined;
|
|
2541
|
+
readonly closed: boolean;
|
|
2542
|
+
readonly closedAt?: number | undefined;
|
|
2543
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2544
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2545
|
+
readonly forkSubOffset?: number | undefined;
|
|
2546
|
+
readonly softDeleted: boolean;
|
|
2547
|
+
readonly expiresAtMs?: number | undefined;
|
|
2548
|
+
};
|
|
2549
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2550
|
+
};
|
|
2551
|
+
})[]];
|
|
2552
|
+
}, {
|
|
2553
|
+
readonly _tag: Tag;
|
|
2554
|
+
}>) => any; }>(value: {
|
|
2555
|
+
readonly _tag: "Applied";
|
|
2556
|
+
readonly results: readonly [{
|
|
2557
|
+
readonly _tag: "Created";
|
|
2558
|
+
readonly record: {
|
|
2559
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2560
|
+
readonly config: {
|
|
2561
|
+
readonly contentType: string;
|
|
2562
|
+
readonly ttlSeconds?: number | undefined;
|
|
2563
|
+
readonly expiresAt?: string | undefined;
|
|
2564
|
+
readonly createdAt: number;
|
|
2565
|
+
};
|
|
2566
|
+
readonly lifecycle: {
|
|
2567
|
+
readonly lastSeq?: string | undefined;
|
|
2568
|
+
readonly closed: boolean;
|
|
2569
|
+
readonly closedAt?: number | undefined;
|
|
2570
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2571
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2572
|
+
readonly forkSubOffset?: number | undefined;
|
|
2573
|
+
readonly softDeleted: boolean;
|
|
2574
|
+
readonly expiresAtMs?: number | undefined;
|
|
2575
|
+
};
|
|
2576
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2577
|
+
};
|
|
2578
|
+
} | {
|
|
2579
|
+
readonly _tag: "Appended";
|
|
2580
|
+
readonly record: {
|
|
2581
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2582
|
+
readonly config: {
|
|
2583
|
+
readonly contentType: string;
|
|
2584
|
+
readonly ttlSeconds?: number | undefined;
|
|
2585
|
+
readonly expiresAt?: string | undefined;
|
|
2586
|
+
readonly createdAt: number;
|
|
2587
|
+
};
|
|
2588
|
+
readonly lifecycle: {
|
|
2589
|
+
readonly lastSeq?: string | undefined;
|
|
2590
|
+
readonly closed: boolean;
|
|
2591
|
+
readonly closedAt?: number | undefined;
|
|
2592
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2593
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2594
|
+
readonly forkSubOffset?: number | undefined;
|
|
2595
|
+
readonly softDeleted: boolean;
|
|
2596
|
+
readonly expiresAtMs?: number | undefined;
|
|
2597
|
+
};
|
|
2598
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2599
|
+
};
|
|
2600
|
+
} | {
|
|
2601
|
+
readonly _tag: "Purged";
|
|
2602
|
+
readonly record: {
|
|
2603
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2604
|
+
readonly config: {
|
|
2605
|
+
readonly contentType: string;
|
|
2606
|
+
readonly ttlSeconds?: number | undefined;
|
|
2607
|
+
readonly expiresAt?: string | undefined;
|
|
2608
|
+
readonly createdAt: number;
|
|
2609
|
+
};
|
|
2610
|
+
readonly lifecycle: {
|
|
2611
|
+
readonly lastSeq?: string | undefined;
|
|
2612
|
+
readonly closed: boolean;
|
|
2613
|
+
readonly closedAt?: number | undefined;
|
|
2614
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2615
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2616
|
+
readonly forkSubOffset?: number | undefined;
|
|
2617
|
+
readonly softDeleted: boolean;
|
|
2618
|
+
readonly expiresAtMs?: number | undefined;
|
|
2619
|
+
};
|
|
2620
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2621
|
+
};
|
|
2622
|
+
} | {
|
|
2623
|
+
readonly _tag: "SoftDeleted";
|
|
2624
|
+
readonly record: {
|
|
2625
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2626
|
+
readonly config: {
|
|
2627
|
+
readonly contentType: string;
|
|
2628
|
+
readonly ttlSeconds?: number | undefined;
|
|
2629
|
+
readonly expiresAt?: string | undefined;
|
|
2630
|
+
readonly createdAt: number;
|
|
2631
|
+
};
|
|
2632
|
+
readonly lifecycle: {
|
|
2633
|
+
readonly lastSeq?: string | undefined;
|
|
2634
|
+
readonly closed: boolean;
|
|
2635
|
+
readonly closedAt?: number | undefined;
|
|
2636
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2637
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2638
|
+
readonly forkSubOffset?: number | undefined;
|
|
2639
|
+
readonly softDeleted: boolean;
|
|
2640
|
+
readonly expiresAtMs?: number | undefined;
|
|
2641
|
+
};
|
|
2642
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2643
|
+
};
|
|
2644
|
+
}, ...({
|
|
2645
|
+
readonly _tag: "Created";
|
|
2646
|
+
readonly record: {
|
|
2647
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2648
|
+
readonly config: {
|
|
2649
|
+
readonly contentType: string;
|
|
2650
|
+
readonly ttlSeconds?: number | undefined;
|
|
2651
|
+
readonly expiresAt?: string | undefined;
|
|
2652
|
+
readonly createdAt: number;
|
|
2653
|
+
};
|
|
2654
|
+
readonly lifecycle: {
|
|
2655
|
+
readonly lastSeq?: string | undefined;
|
|
2656
|
+
readonly closed: boolean;
|
|
2657
|
+
readonly closedAt?: number | undefined;
|
|
2658
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2659
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2660
|
+
readonly forkSubOffset?: number | undefined;
|
|
2661
|
+
readonly softDeleted: boolean;
|
|
2662
|
+
readonly expiresAtMs?: number | undefined;
|
|
2663
|
+
};
|
|
2664
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2665
|
+
};
|
|
2666
|
+
} | {
|
|
2667
|
+
readonly _tag: "Appended";
|
|
2668
|
+
readonly record: {
|
|
2669
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2670
|
+
readonly config: {
|
|
2671
|
+
readonly contentType: string;
|
|
2672
|
+
readonly ttlSeconds?: number | undefined;
|
|
2673
|
+
readonly expiresAt?: string | undefined;
|
|
2674
|
+
readonly createdAt: number;
|
|
2675
|
+
};
|
|
2676
|
+
readonly lifecycle: {
|
|
2677
|
+
readonly lastSeq?: string | undefined;
|
|
2678
|
+
readonly closed: boolean;
|
|
2679
|
+
readonly closedAt?: number | undefined;
|
|
2680
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2681
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2682
|
+
readonly forkSubOffset?: number | undefined;
|
|
2683
|
+
readonly softDeleted: boolean;
|
|
2684
|
+
readonly expiresAtMs?: number | undefined;
|
|
2685
|
+
};
|
|
2686
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2687
|
+
};
|
|
2688
|
+
} | {
|
|
2689
|
+
readonly _tag: "Purged";
|
|
2690
|
+
readonly record: {
|
|
2691
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2692
|
+
readonly config: {
|
|
2693
|
+
readonly contentType: string;
|
|
2694
|
+
readonly ttlSeconds?: number | undefined;
|
|
2695
|
+
readonly expiresAt?: string | undefined;
|
|
2696
|
+
readonly createdAt: number;
|
|
2697
|
+
};
|
|
2698
|
+
readonly lifecycle: {
|
|
2699
|
+
readonly lastSeq?: string | undefined;
|
|
2700
|
+
readonly closed: boolean;
|
|
2701
|
+
readonly closedAt?: number | undefined;
|
|
2702
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2703
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2704
|
+
readonly forkSubOffset?: number | undefined;
|
|
2705
|
+
readonly softDeleted: boolean;
|
|
2706
|
+
readonly expiresAtMs?: number | undefined;
|
|
2707
|
+
};
|
|
2708
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2709
|
+
};
|
|
2710
|
+
} | {
|
|
2711
|
+
readonly _tag: "SoftDeleted";
|
|
2712
|
+
readonly record: {
|
|
2713
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2714
|
+
readonly config: {
|
|
2715
|
+
readonly contentType: string;
|
|
2716
|
+
readonly ttlSeconds?: number | undefined;
|
|
2717
|
+
readonly expiresAt?: string | undefined;
|
|
2718
|
+
readonly createdAt: number;
|
|
2719
|
+
};
|
|
2720
|
+
readonly lifecycle: {
|
|
2721
|
+
readonly lastSeq?: string | undefined;
|
|
2722
|
+
readonly closed: boolean;
|
|
2723
|
+
readonly closedAt?: number | undefined;
|
|
2724
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2725
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2726
|
+
readonly forkSubOffset?: number | undefined;
|
|
2727
|
+
readonly softDeleted: boolean;
|
|
2728
|
+
readonly expiresAtMs?: number | undefined;
|
|
2729
|
+
};
|
|
2730
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2731
|
+
};
|
|
2732
|
+
})[]];
|
|
2733
|
+
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Applied"]>>;
|
|
2734
|
+
};
|
|
2735
|
+
readonly Applied: Data.TaggedEnum.ConstructorFrom<{
|
|
2736
|
+
readonly _tag: "Applied";
|
|
2737
|
+
readonly results: readonly [{
|
|
2738
|
+
readonly _tag: "Created";
|
|
2739
|
+
readonly record: {
|
|
2740
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2741
|
+
readonly config: {
|
|
2742
|
+
readonly contentType: string;
|
|
2743
|
+
readonly ttlSeconds?: number | undefined;
|
|
2744
|
+
readonly expiresAt?: string | undefined;
|
|
2745
|
+
readonly createdAt: number;
|
|
2746
|
+
};
|
|
2747
|
+
readonly lifecycle: {
|
|
2748
|
+
readonly lastSeq?: string | undefined;
|
|
2749
|
+
readonly closed: boolean;
|
|
2750
|
+
readonly closedAt?: number | undefined;
|
|
2751
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2752
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2753
|
+
readonly forkSubOffset?: number | undefined;
|
|
2754
|
+
readonly softDeleted: boolean;
|
|
2755
|
+
readonly expiresAtMs?: number | undefined;
|
|
2756
|
+
};
|
|
2757
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2758
|
+
};
|
|
2759
|
+
} | {
|
|
2760
|
+
readonly _tag: "Appended";
|
|
2761
|
+
readonly record: {
|
|
2762
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2763
|
+
readonly config: {
|
|
2764
|
+
readonly contentType: string;
|
|
2765
|
+
readonly ttlSeconds?: number | undefined;
|
|
2766
|
+
readonly expiresAt?: string | undefined;
|
|
2767
|
+
readonly createdAt: number;
|
|
2768
|
+
};
|
|
2769
|
+
readonly lifecycle: {
|
|
2770
|
+
readonly lastSeq?: string | undefined;
|
|
2771
|
+
readonly closed: boolean;
|
|
2772
|
+
readonly closedAt?: number | undefined;
|
|
2773
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2774
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2775
|
+
readonly forkSubOffset?: number | undefined;
|
|
2776
|
+
readonly softDeleted: boolean;
|
|
2777
|
+
readonly expiresAtMs?: number | undefined;
|
|
2778
|
+
};
|
|
2779
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2780
|
+
};
|
|
2781
|
+
} | {
|
|
2782
|
+
readonly _tag: "Purged";
|
|
2783
|
+
readonly record: {
|
|
2784
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2785
|
+
readonly config: {
|
|
2786
|
+
readonly contentType: string;
|
|
2787
|
+
readonly ttlSeconds?: number | undefined;
|
|
2788
|
+
readonly expiresAt?: string | undefined;
|
|
2789
|
+
readonly createdAt: number;
|
|
2790
|
+
};
|
|
2791
|
+
readonly lifecycle: {
|
|
2792
|
+
readonly lastSeq?: string | undefined;
|
|
2793
|
+
readonly closed: boolean;
|
|
2794
|
+
readonly closedAt?: number | undefined;
|
|
2795
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2796
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2797
|
+
readonly forkSubOffset?: number | undefined;
|
|
2798
|
+
readonly softDeleted: boolean;
|
|
2799
|
+
readonly expiresAtMs?: number | undefined;
|
|
2800
|
+
};
|
|
2801
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2802
|
+
};
|
|
2803
|
+
} | {
|
|
2804
|
+
readonly _tag: "SoftDeleted";
|
|
2805
|
+
readonly record: {
|
|
2806
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2807
|
+
readonly config: {
|
|
2808
|
+
readonly contentType: string;
|
|
2809
|
+
readonly ttlSeconds?: number | undefined;
|
|
2810
|
+
readonly expiresAt?: string | undefined;
|
|
2811
|
+
readonly createdAt: number;
|
|
2812
|
+
};
|
|
2813
|
+
readonly lifecycle: {
|
|
2814
|
+
readonly lastSeq?: string | undefined;
|
|
2815
|
+
readonly closed: boolean;
|
|
2816
|
+
readonly closedAt?: number | undefined;
|
|
2817
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2818
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2819
|
+
readonly forkSubOffset?: number | undefined;
|
|
2820
|
+
readonly softDeleted: boolean;
|
|
2821
|
+
readonly expiresAtMs?: number | undefined;
|
|
2822
|
+
};
|
|
2823
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2824
|
+
};
|
|
2825
|
+
}, ...({
|
|
2826
|
+
readonly _tag: "Created";
|
|
2827
|
+
readonly record: {
|
|
2828
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2829
|
+
readonly config: {
|
|
2830
|
+
readonly contentType: string;
|
|
2831
|
+
readonly ttlSeconds?: number | undefined;
|
|
2832
|
+
readonly expiresAt?: string | undefined;
|
|
2833
|
+
readonly createdAt: number;
|
|
2834
|
+
};
|
|
2835
|
+
readonly lifecycle: {
|
|
2836
|
+
readonly lastSeq?: string | undefined;
|
|
2837
|
+
readonly closed: boolean;
|
|
2838
|
+
readonly closedAt?: number | undefined;
|
|
2839
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2840
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2841
|
+
readonly forkSubOffset?: number | undefined;
|
|
2842
|
+
readonly softDeleted: boolean;
|
|
2843
|
+
readonly expiresAtMs?: number | undefined;
|
|
2844
|
+
};
|
|
2845
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2846
|
+
};
|
|
2847
|
+
} | {
|
|
2848
|
+
readonly _tag: "Appended";
|
|
2849
|
+
readonly record: {
|
|
2850
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2851
|
+
readonly config: {
|
|
2852
|
+
readonly contentType: string;
|
|
2853
|
+
readonly ttlSeconds?: number | undefined;
|
|
2854
|
+
readonly expiresAt?: string | undefined;
|
|
2855
|
+
readonly createdAt: number;
|
|
2856
|
+
};
|
|
2857
|
+
readonly lifecycle: {
|
|
2858
|
+
readonly lastSeq?: string | undefined;
|
|
2859
|
+
readonly closed: boolean;
|
|
2860
|
+
readonly closedAt?: number | undefined;
|
|
2861
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2862
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2863
|
+
readonly forkSubOffset?: number | undefined;
|
|
2864
|
+
readonly softDeleted: boolean;
|
|
2865
|
+
readonly expiresAtMs?: number | undefined;
|
|
2866
|
+
};
|
|
2867
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2868
|
+
};
|
|
2869
|
+
} | {
|
|
2870
|
+
readonly _tag: "Purged";
|
|
2871
|
+
readonly record: {
|
|
2872
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2873
|
+
readonly config: {
|
|
2874
|
+
readonly contentType: string;
|
|
2875
|
+
readonly ttlSeconds?: number | undefined;
|
|
2876
|
+
readonly expiresAt?: string | undefined;
|
|
2877
|
+
readonly createdAt: number;
|
|
2878
|
+
};
|
|
2879
|
+
readonly lifecycle: {
|
|
2880
|
+
readonly lastSeq?: string | undefined;
|
|
2881
|
+
readonly closed: boolean;
|
|
2882
|
+
readonly closedAt?: number | undefined;
|
|
2883
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2884
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2885
|
+
readonly forkSubOffset?: number | undefined;
|
|
2886
|
+
readonly softDeleted: boolean;
|
|
2887
|
+
readonly expiresAtMs?: number | undefined;
|
|
2888
|
+
};
|
|
2889
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2890
|
+
};
|
|
2891
|
+
} | {
|
|
2892
|
+
readonly _tag: "SoftDeleted";
|
|
2893
|
+
readonly record: {
|
|
2894
|
+
readonly id: string & import("effect/Brand").Brand<"StreamId">;
|
|
2895
|
+
readonly config: {
|
|
2896
|
+
readonly contentType: string;
|
|
2897
|
+
readonly ttlSeconds?: number | undefined;
|
|
2898
|
+
readonly expiresAt?: string | undefined;
|
|
2899
|
+
readonly createdAt: number;
|
|
2900
|
+
};
|
|
2901
|
+
readonly lifecycle: {
|
|
2902
|
+
readonly lastSeq?: string | undefined;
|
|
2903
|
+
readonly closed: boolean;
|
|
2904
|
+
readonly closedAt?: number | undefined;
|
|
2905
|
+
readonly forkedFrom?: (string & import("effect/Brand").Brand<"StreamId">) | undefined;
|
|
2906
|
+
readonly forkOffset?: (string & import("effect/Brand").Brand<"Offset">) | undefined;
|
|
2907
|
+
readonly forkSubOffset?: number | undefined;
|
|
2908
|
+
readonly softDeleted: boolean;
|
|
2909
|
+
readonly expiresAtMs?: number | undefined;
|
|
2910
|
+
};
|
|
2911
|
+
readonly currentOffset: string & import("effect/Brand").Brand<"Offset">;
|
|
2912
|
+
};
|
|
2913
|
+
})[]];
|
|
2914
|
+
}, "_tag">;
|
|
2915
|
+
};
|
|
2916
|
+
interface StorageShape {
|
|
2917
|
+
readonly capabilities: StorageCapabilities;
|
|
2918
|
+
readonly record: (id: StreamId) => Effect.Effect<Option.Option<StreamRecord>, StorageFault>;
|
|
2919
|
+
readonly messages: (id: StreamId, window: MessageWindow) => Effect.Effect<ReadonlyArray<StoredMessage>, StorageFault>;
|
|
2920
|
+
readonly producer: (id: StreamId, producerId: ProducerId) => Effect.Effect<Option.Option<ProducerState>, StorageFault>;
|
|
2921
|
+
readonly mutate: (mutation: Mutation) => Effect.Effect<MutationApplied, MutationRejected | StorageFault>;
|
|
2922
|
+
readonly changes: (id: StreamId) => Stream.Stream<ChangeSnapshot, StorageFault>;
|
|
2923
|
+
readonly nextExpiry: Effect.Effect<Option.Option<{
|
|
2924
|
+
readonly at: number;
|
|
2925
|
+
readonly streamId: StreamId;
|
|
2926
|
+
}>, StorageFault>;
|
|
2927
|
+
}
|
|
2928
|
+
declare const Storage_base: Context.ServiceClass<Storage, "@streamsy/core/Storage", StorageShape>;
|
|
2929
|
+
declare class Storage extends Storage_base {}
|
|
2930
|
+
/**
|
|
2931
|
+
* Encoded records on the storage owner, for the projection checkpoint store.
|
|
2932
|
+
* Calls inside `CommitBoundary.withTransaction` join that transaction.
|
|
2933
|
+
*/
|
|
2934
|
+
interface OwnerRecordsApi {
|
|
2935
|
+
readonly read: (key: string) => Effect.Effect<Option.Option<string>, StorageFault>;
|
|
2936
|
+
readonly write: (key: string, encoded: string) => Effect.Effect<void, StorageFault>;
|
|
2937
|
+
readonly remove: (key: string) => Effect.Effect<void, StorageFault>;
|
|
2938
|
+
}
|
|
2939
|
+
declare const OwnerRecords_base: Context.ServiceClass<OwnerRecords, "@streamsy/core/internal/OwnerRecords", OwnerRecordsApi>;
|
|
2940
|
+
declare class OwnerRecords extends OwnerRecords_base {}
|
|
2941
|
+
export { ProducerOptions as $, CreateConflictReason as A, ProducerGap as B, ReadNextResult as C, AppendError as D, AppendConflict as E, InvalidEpochSeq as F, StaleEpoch as G, ReadError as H, InvalidForkRequest as I, StreamGone as J, StreamBusy as K, InvalidReadRequest as L, ForkSourceNotFound as M, HeadError as N, AppendErrorFor as O, InvalidAppendRequest as P, AppendOptions as Q, NotSupported as R, ReadMessage as S, AppendBaseError as T, ReadNextError as U, ProtocolError as V, RemoveError as W, isProtocolError as X, StreamNotFound as Y, AppendCallOptions as Z, StreamsWriter as _, StreamsFault as _t, Mutation as a, Offset as at, CreateResult as b, isStreamsFault as bt, Mutations as c, RecordPatch as ct, OperationResults as d, StreamId as dt, ReadNextOptions as et, Operations as f, StreamLifecycle as ft, StreamsReader as g, StorageFault as gt, Reader as h, EncodeFault as ht, StorageShape as i, MessageWindow as it, CreateError as j, CreateConflict as k, Operation as l, StoredMessage as lt, StorageCapabilities as m, DecodeFault as mt, OwnerRecordsApi as n, CreateOptions as nt, MutationApplied as o, ProducerId as ot, ProducerPrecondition as p, StreamRecord as pt, StreamClosed as q, Storage as r, ChangeSnapshot as rt, MutationRejected as s, ProducerState as st, OwnerRecords as t, ReadOptions as tt, OperationResult as u, StreamConfig as ut, Writer as v, TransportFault as vt, ReadResult as w, HeadResult as x, AppendResult as y, isRetryableFault as yt, OffsetMismatch as z };
|