@livestore/sync-s2 0.4.0 → 0.5.0-dev.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/dist/.tsbuildinfo +1 -1
- package/dist/api-schema.d.ts +19 -19
- package/dist/api-schema.d.ts.map +1 -1
- package/dist/api-schema.js +3 -3
- package/dist/api-schema.js.map +1 -1
- package/dist/api-schema.test.js +15 -10
- package/dist/api-schema.test.js.map +1 -1
- package/dist/decode.js +3 -3
- package/dist/decode.js.map +1 -1
- package/dist/http-client-generated.d.ts +337 -1051
- package/dist/http-client-generated.d.ts.map +1 -1
- package/dist/http-client-generated.js +223 -220
- package/dist/http-client-generated.js.map +1 -1
- package/dist/limits.d.ts +6 -8
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +8 -9
- package/dist/limits.js.map +1 -1
- package/dist/limits.test.js.map +1 -1
- package/dist/make-s2-url.js +4 -4
- package/dist/make-s2-url.js.map +1 -1
- package/dist/sync-provider.d.ts +3 -3
- package/dist/sync-provider.d.ts.map +1 -1
- package/dist/sync-provider.js +8 -7
- package/dist/sync-provider.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +29 -48
- package/src/api-schema.test.ts +15 -11
- package/src/api-schema.ts +3 -3
- package/src/decode.ts +3 -3
- package/src/http-client-generated.ts +166 -258
- package/src/limits.test.ts +1 -2
- package/src/limits.ts +17 -19
- package/src/make-s2-url.ts +4 -4
- package/src/sync-provider.ts +13 -12
- package/src/types.ts +1 -1
|
@@ -10,20 +10,16 @@ import {
|
|
|
10
10
|
HttpClientError,
|
|
11
11
|
HttpClientRequest,
|
|
12
12
|
HttpClientResponse,
|
|
13
|
-
type ParseResult,
|
|
14
13
|
Schema as S,
|
|
15
14
|
} from '@livestore/utils/effect'
|
|
16
15
|
|
|
17
|
-
export class ListAccessTokensParams extends S.
|
|
18
|
-
prefix: S.
|
|
19
|
-
start_after: S.
|
|
20
|
-
limit: S.
|
|
21
|
-
nullable: true,
|
|
22
|
-
default: () => 1000 as const,
|
|
23
|
-
}),
|
|
16
|
+
export class ListAccessTokensParams extends S.Class<ListAccessTokensParams>('ListAccessTokensParams')({
|
|
17
|
+
prefix: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
18
|
+
start_after: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
19
|
+
limit: S.Int.check(S.isGreaterThanOrEqualTo(0), S.isLessThanOrEqualTo(1000)).pipe(S.optional, S.withDecodingDefault(Effect.succeed(1000))),
|
|
24
20
|
}) {}
|
|
25
21
|
|
|
26
|
-
export
|
|
22
|
+
export const ResourceSet = S.Union([
|
|
27
23
|
/**
|
|
28
24
|
* Match only the resource with this exact name.
|
|
29
25
|
* Use an empty string to match no resources.
|
|
@@ -46,26 +42,26 @@ export class ResourceSet extends S.Union(
|
|
|
46
42
|
*/
|
|
47
43
|
prefix: S.String,
|
|
48
44
|
}),
|
|
49
|
-
)
|
|
45
|
+
])
|
|
50
46
|
|
|
51
47
|
export class ReadWritePermissions extends S.Class<ReadWritePermissions>('ReadWritePermissions')({
|
|
52
48
|
/**
|
|
53
49
|
* Read permission.
|
|
54
50
|
*/
|
|
55
|
-
read: S.
|
|
51
|
+
read: S.Boolean.pipe(S.optional, S.withDecodingDefault(Effect.succeed(false))),
|
|
56
52
|
/**
|
|
57
53
|
* Write permission.
|
|
58
54
|
*/
|
|
59
|
-
write: S.
|
|
55
|
+
write: S.Boolean.pipe(S.optional, S.withDecodingDefault(Effect.succeed(false))),
|
|
60
56
|
}) {}
|
|
61
57
|
|
|
62
58
|
export class PermittedOperationGroups extends S.Class<PermittedOperationGroups>('PermittedOperationGroups')({
|
|
63
|
-
account: S.
|
|
64
|
-
basin: S.
|
|
65
|
-
stream: S.
|
|
59
|
+
account: S.optional(S.NullOr(ReadWritePermissions)),
|
|
60
|
+
basin: S.optional(S.NullOr(ReadWritePermissions)),
|
|
61
|
+
stream: S.optional(S.NullOr(ReadWritePermissions)),
|
|
66
62
|
}) {}
|
|
67
63
|
|
|
68
|
-
export
|
|
64
|
+
export const Operation = S.Literals([
|
|
69
65
|
'list-basins',
|
|
70
66
|
'create-basin',
|
|
71
67
|
'delete-basin',
|
|
@@ -87,18 +83,18 @@ export class Operation extends S.Literal(
|
|
|
87
83
|
'account-metrics',
|
|
88
84
|
'basin-metrics',
|
|
89
85
|
'stream-metrics',
|
|
90
|
-
)
|
|
86
|
+
])
|
|
91
87
|
|
|
92
88
|
export class AccessTokenScope extends S.Class<AccessTokenScope>('AccessTokenScope')({
|
|
93
|
-
access_tokens: S.
|
|
94
|
-
basins: S.
|
|
95
|
-
op_groups: S.
|
|
89
|
+
access_tokens: S.optional(S.NullOr(ResourceSet)),
|
|
90
|
+
basins: S.optional(S.NullOr(ResourceSet)),
|
|
91
|
+
op_groups: S.optional(S.NullOr(PermittedOperationGroups)),
|
|
96
92
|
/**
|
|
97
93
|
* Operations allowed for the token.
|
|
98
94
|
* A union of allowed operations and groups is used as an effective set of allowed operations.
|
|
99
95
|
*/
|
|
100
|
-
ops: S.
|
|
101
|
-
streams: S.
|
|
96
|
+
ops: S.optional(S.NullOr(S.Array(Operation))),
|
|
97
|
+
streams: S.optional(S.NullOr(ResourceSet)),
|
|
102
98
|
}) {}
|
|
103
99
|
|
|
104
100
|
export class AccessTokenInfo extends S.Class<AccessTokenInfo>('AccessTokenInfo')({
|
|
@@ -106,12 +102,12 @@ export class AccessTokenInfo extends S.Class<AccessTokenInfo>('AccessTokenInfo')
|
|
|
106
102
|
* Namespace streams based on the configured stream-level scope, which must be a prefix.
|
|
107
103
|
* Stream name arguments will be automatically prefixed, and the prefix will be stripped when listing streams.
|
|
108
104
|
*/
|
|
109
|
-
auto_prefix_streams: S.
|
|
105
|
+
auto_prefix_streams: S.Boolean.pipe(S.optional, S.withDecodingDefault(Effect.succeed(false))),
|
|
110
106
|
/**
|
|
111
107
|
* Expiration time in ISO 8601 format.
|
|
112
108
|
* If not set, the expiration will be set to that of the requestor's token.
|
|
113
109
|
*/
|
|
114
|
-
expires_at: S.
|
|
110
|
+
expires_at: S.optional(S.NullOr(S.String)),
|
|
115
111
|
/**
|
|
116
112
|
* Access token ID.
|
|
117
113
|
* It must be unique to the account and between 1 and 96 bytes in length.
|
|
@@ -127,7 +123,7 @@ export class ListAccessTokensResponse extends S.Class<ListAccessTokensResponse>(
|
|
|
127
123
|
/**
|
|
128
124
|
* Matching access tokens.
|
|
129
125
|
*/
|
|
130
|
-
access_tokens: S.Array(AccessTokenInfo).
|
|
126
|
+
access_tokens: S.Array(AccessTokenInfo).check(S.isMaxLength(1000)),
|
|
131
127
|
/**
|
|
132
128
|
* Indicates that there are more access tokens that match the criteria.
|
|
133
129
|
*/
|
|
@@ -135,7 +131,7 @@ export class ListAccessTokensResponse extends S.Class<ListAccessTokensResponse>(
|
|
|
135
131
|
}) {}
|
|
136
132
|
|
|
137
133
|
export class ErrorResponse extends S.Class<ErrorResponse>('ErrorResponse')({
|
|
138
|
-
code: S.
|
|
134
|
+
code: S.optional(S.NullOr(S.String)),
|
|
139
135
|
message: S.String,
|
|
140
136
|
}) {}
|
|
141
137
|
|
|
@@ -146,18 +142,15 @@ export class IssueAccessTokenResponse extends S.Class<IssueAccessTokenResponse>(
|
|
|
146
142
|
access_token: S.String,
|
|
147
143
|
}) {}
|
|
148
144
|
|
|
149
|
-
export class ListBasinsParams extends S.
|
|
150
|
-
prefix: S.
|
|
151
|
-
start_after: S.
|
|
152
|
-
limit: S.
|
|
153
|
-
nullable: true,
|
|
154
|
-
default: () => 1000 as const,
|
|
155
|
-
}),
|
|
145
|
+
export class ListBasinsParams extends S.Class<ListBasinsParams>('ListBasinsParams')({
|
|
146
|
+
prefix: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
147
|
+
start_after: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
148
|
+
limit: S.Int.check(S.isGreaterThanOrEqualTo(0), S.isLessThanOrEqualTo(1000)).pipe(S.optional, S.withDecodingDefault(Effect.succeed(1000))),
|
|
156
149
|
}) {}
|
|
157
150
|
|
|
158
|
-
export
|
|
151
|
+
export const BasinScope = S.Literal('aws:us-east-1')
|
|
159
152
|
|
|
160
|
-
export
|
|
153
|
+
export const BasinState = S.Literals(['active', 'creating', 'deleting'])
|
|
161
154
|
|
|
162
155
|
export class BasinInfo extends S.Class<BasinInfo>('BasinInfo')({
|
|
163
156
|
/**
|
|
@@ -178,7 +171,7 @@ export class ListBasinsResponse extends S.Class<ListBasinsResponse>('ListBasinsR
|
|
|
178
171
|
/**
|
|
179
172
|
* Matching basins.
|
|
180
173
|
*/
|
|
181
|
-
basins: S.Array(BasinInfo).
|
|
174
|
+
basins: S.Array(BasinInfo).check(S.isMaxLength(1000)),
|
|
182
175
|
/**
|
|
183
176
|
* Indicates that there are more basins that match the criteria.
|
|
184
177
|
*/
|
|
@@ -190,12 +183,12 @@ export class DeleteOnEmptyConfig extends S.Class<DeleteOnEmptyConfig>('DeleteOnE
|
|
|
190
183
|
* Minimum age in seconds before an empty stream can be deleted.
|
|
191
184
|
* Set to 0 (default) to disable delete-on-empty (don't delete automatically).
|
|
192
185
|
*/
|
|
193
|
-
min_age_secs: S.
|
|
186
|
+
min_age_secs: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
194
187
|
}) {}
|
|
195
188
|
|
|
196
|
-
export
|
|
189
|
+
export const InfiniteRetention = S.Record(S.String, S.Unknown)
|
|
197
190
|
|
|
198
|
-
export
|
|
191
|
+
export const RetentionPolicy = S.Union([
|
|
199
192
|
/**
|
|
200
193
|
* Age in seconds for automatic trimming of records older than this threshold.
|
|
201
194
|
* This must be set to a value greater than 0 seconds.
|
|
@@ -207,7 +200,7 @@ export class RetentionPolicy extends S.Union(
|
|
|
207
200
|
* This must be set to a value greater than 0 seconds.
|
|
208
201
|
* (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.)
|
|
209
202
|
*/
|
|
210
|
-
age: S.Int.
|
|
203
|
+
age: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
211
204
|
}),
|
|
212
205
|
/**
|
|
213
206
|
* Retain records unless explicitly trimmed.
|
|
@@ -218,38 +211,38 @@ export class RetentionPolicy extends S.Union(
|
|
|
218
211
|
*/
|
|
219
212
|
infinite: InfiniteRetention,
|
|
220
213
|
}),
|
|
221
|
-
)
|
|
214
|
+
])
|
|
222
215
|
|
|
223
|
-
export
|
|
216
|
+
export const StorageClass = S.Literals(['standard', 'express'])
|
|
224
217
|
|
|
225
|
-
export
|
|
218
|
+
export const TimestampingMode = S.Literals(['client-prefer', 'client-require', 'arrival'])
|
|
226
219
|
|
|
227
220
|
export class TimestampingConfig extends S.Class<TimestampingConfig>('TimestampingConfig')({
|
|
228
|
-
mode: S.
|
|
221
|
+
mode: S.optional(S.NullOr(TimestampingMode)),
|
|
229
222
|
/**
|
|
230
223
|
* Allow client-specified timestamps to exceed the arrival time.
|
|
231
224
|
* If this is `false` or not set, client timestamps will be capped at the arrival time.
|
|
232
225
|
*/
|
|
233
|
-
uncapped: S.
|
|
226
|
+
uncapped: S.optional(S.NullOr(S.Boolean)),
|
|
234
227
|
}) {}
|
|
235
228
|
|
|
236
229
|
export class StreamConfig extends S.Class<StreamConfig>('StreamConfig')({
|
|
237
|
-
delete_on_empty: S.
|
|
238
|
-
retention_policy: S.
|
|
239
|
-
storage_class: S.
|
|
240
|
-
timestamping: S.
|
|
230
|
+
delete_on_empty: S.optional(S.NullOr(DeleteOnEmptyConfig)),
|
|
231
|
+
retention_policy: S.optional(S.NullOr(RetentionPolicy)),
|
|
232
|
+
storage_class: S.optional(S.NullOr(StorageClass)),
|
|
233
|
+
timestamping: S.optional(S.NullOr(TimestampingConfig)),
|
|
241
234
|
}) {}
|
|
242
235
|
|
|
243
236
|
export class BasinConfig extends S.Class<BasinConfig>('BasinConfig')({
|
|
244
237
|
/**
|
|
245
238
|
* Create stream on append if it doesn't exist, using the default stream configuration.
|
|
246
239
|
*/
|
|
247
|
-
create_stream_on_append: S.
|
|
240
|
+
create_stream_on_append: S.optional(S.NullOr(S.Boolean)),
|
|
248
241
|
/**
|
|
249
242
|
* Create stream on read if it doesn't exist, using the default stream configuration.
|
|
250
243
|
*/
|
|
251
|
-
create_stream_on_read: S.
|
|
252
|
-
default_stream_config: S.
|
|
244
|
+
create_stream_on_read: S.optional(S.NullOr(S.Boolean)),
|
|
245
|
+
default_stream_config: S.optional(S.NullOr(StreamConfig)),
|
|
253
246
|
}) {}
|
|
254
247
|
|
|
255
248
|
export class CreateBasinRequest extends S.Class<CreateBasinRequest>('CreateBasinRequest')({
|
|
@@ -259,18 +252,18 @@ export class CreateBasinRequest extends S.Class<CreateBasinRequest>('CreateBasin
|
|
|
259
252
|
* It cannot begin or end with a hyphen.
|
|
260
253
|
*/
|
|
261
254
|
basin: S.String,
|
|
262
|
-
config: S.
|
|
255
|
+
config: S.optional(S.NullOr(BasinConfig)),
|
|
263
256
|
/**
|
|
264
257
|
* Basin scope.
|
|
265
258
|
*/
|
|
266
|
-
scope: S.
|
|
259
|
+
scope: BasinScope.pipe(S.optional, S.withDecodingDefault(Effect.succeed('aws:us-east-1'))),
|
|
267
260
|
}) {}
|
|
268
261
|
|
|
269
|
-
export class CreateOrReconfigureBasinParams extends S.
|
|
270
|
-
's2-request-token': S.
|
|
262
|
+
export class CreateOrReconfigureBasinParams extends S.Class<CreateOrReconfigureBasinParams>('CreateOrReconfigureBasinParams')({
|
|
263
|
+
's2-request-token': S.optional(S.NullOr(S.String)),
|
|
271
264
|
}) {}
|
|
272
265
|
|
|
273
|
-
export
|
|
266
|
+
export const CreateOrReconfigureBasinRequest = S.Union([S.Null])
|
|
274
267
|
// export class CreateOrReconfigureBasinRequest extends S.Union(S.Null, CreateOrReconfigureBasinRequest) {}
|
|
275
268
|
|
|
276
269
|
export class DeleteOnEmptyReconfiguration extends S.Class<DeleteOnEmptyReconfiguration>('DeleteOnEmptyReconfiguration')(
|
|
@@ -279,49 +272,49 @@ export class DeleteOnEmptyReconfiguration extends S.Class<DeleteOnEmptyReconfigu
|
|
|
279
272
|
* Minimum age in seconds before an empty stream can be deleted.
|
|
280
273
|
* Set to 0 to disable delete-on-empty (don't delete automatically).
|
|
281
274
|
*/
|
|
282
|
-
min_age_secs: S.
|
|
275
|
+
min_age_secs: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
283
276
|
},
|
|
284
277
|
) {}
|
|
285
278
|
|
|
286
279
|
export class TimestampingReconfiguration extends S.Class<TimestampingReconfiguration>('TimestampingReconfiguration')({
|
|
287
|
-
mode: S.
|
|
280
|
+
mode: S.optional(S.NullOr(TimestampingMode)),
|
|
288
281
|
/**
|
|
289
282
|
* Allow client-specified timestamps to exceed the arrival time.
|
|
290
283
|
*/
|
|
291
|
-
uncapped: S.
|
|
284
|
+
uncapped: S.optional(S.NullOr(S.Boolean)),
|
|
292
285
|
}) {}
|
|
293
286
|
|
|
294
287
|
export class StreamReconfiguration extends S.Class<StreamReconfiguration>('StreamReconfiguration')({
|
|
295
|
-
delete_on_empty: S.
|
|
296
|
-
retention_policy: S.
|
|
297
|
-
storage_class: S.
|
|
298
|
-
timestamping: S.
|
|
288
|
+
delete_on_empty: S.optional(S.NullOr(DeleteOnEmptyReconfiguration)),
|
|
289
|
+
retention_policy: S.optional(S.NullOr(RetentionPolicy)),
|
|
290
|
+
storage_class: S.optional(S.NullOr(StorageClass)),
|
|
291
|
+
timestamping: S.optional(S.NullOr(TimestampingReconfiguration)),
|
|
299
292
|
}) {}
|
|
300
293
|
|
|
301
294
|
export class BasinReconfiguration extends S.Class<BasinReconfiguration>('BasinReconfiguration')({
|
|
302
295
|
/**
|
|
303
296
|
* Create a stream on append.
|
|
304
297
|
*/
|
|
305
|
-
create_stream_on_append: S.
|
|
298
|
+
create_stream_on_append: S.optional(S.NullOr(S.Boolean)),
|
|
306
299
|
/**
|
|
307
300
|
* Create a stream on read.
|
|
308
301
|
*/
|
|
309
|
-
create_stream_on_read: S.
|
|
310
|
-
default_stream_config: S.
|
|
302
|
+
create_stream_on_read: S.optional(S.NullOr(S.Boolean)),
|
|
303
|
+
default_stream_config: S.optional(S.NullOr(StreamReconfiguration)),
|
|
311
304
|
}) {}
|
|
312
305
|
|
|
313
|
-
export
|
|
306
|
+
export const AccountMetricSet = S.Literals(['active-basins', 'account-ops'])
|
|
314
307
|
|
|
315
|
-
export
|
|
308
|
+
export const TimeseriesInterval = S.Literals(['minute', 'hour', 'day'])
|
|
316
309
|
|
|
317
|
-
export class AccountMetricsParams extends S.
|
|
310
|
+
export class AccountMetricsParams extends S.Class<AccountMetricsParams>('AccountMetricsParams')({
|
|
318
311
|
set: AccountMetricSet,
|
|
319
|
-
start: S.
|
|
320
|
-
end: S.
|
|
321
|
-
interval: S.
|
|
312
|
+
start: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
313
|
+
end: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
314
|
+
interval: S.optional(S.NullOr(TimeseriesInterval)),
|
|
322
315
|
}) {}
|
|
323
316
|
|
|
324
|
-
export
|
|
317
|
+
export const MetricUnit = S.Literals(['bytes', 'operations'])
|
|
325
318
|
|
|
326
319
|
export class Scalar extends S.Class<Scalar>('Scalar')({
|
|
327
320
|
/**
|
|
@@ -375,7 +368,7 @@ export class Label extends S.Class<Label>('Label')({
|
|
|
375
368
|
values: S.Array(S.String),
|
|
376
369
|
}) {}
|
|
377
370
|
|
|
378
|
-
export
|
|
371
|
+
export const Metric = S.Union([
|
|
379
372
|
/**
|
|
380
373
|
* Single named value.
|
|
381
374
|
*/
|
|
@@ -414,7 +407,7 @@ export class Metric extends S.Union(
|
|
|
414
407
|
*/
|
|
415
408
|
label: Label,
|
|
416
409
|
}),
|
|
417
|
-
)
|
|
410
|
+
])
|
|
418
411
|
|
|
419
412
|
export class MetricSetResponse extends S.Class<MetricSetResponse>('MetricSetResponse')({
|
|
420
413
|
/**
|
|
@@ -423,38 +416,35 @@ export class MetricSetResponse extends S.Class<MetricSetResponse>('MetricSetResp
|
|
|
423
416
|
values: S.Array(Metric),
|
|
424
417
|
}) {}
|
|
425
418
|
|
|
426
|
-
export
|
|
419
|
+
export const BasinMetricSet = S.Literals([
|
|
427
420
|
'storage',
|
|
428
421
|
'append-ops',
|
|
429
422
|
'read-ops',
|
|
430
423
|
'read-throughput',
|
|
431
424
|
'append-throughput',
|
|
432
425
|
'basin-ops',
|
|
433
|
-
)
|
|
426
|
+
])
|
|
434
427
|
|
|
435
|
-
export class BasinMetricsParams extends S.
|
|
428
|
+
export class BasinMetricsParams extends S.Class<BasinMetricsParams>('BasinMetricsParams')({
|
|
436
429
|
set: BasinMetricSet,
|
|
437
|
-
start: S.
|
|
438
|
-
end: S.
|
|
439
|
-
interval: S.
|
|
430
|
+
start: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
431
|
+
end: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
432
|
+
interval: S.optional(S.NullOr(TimeseriesInterval)),
|
|
440
433
|
}) {}
|
|
441
434
|
|
|
442
|
-
export
|
|
435
|
+
export const StreamMetricSet = S.Literal('storage')
|
|
443
436
|
|
|
444
|
-
export class StreamMetricsParams extends S.
|
|
437
|
+
export class StreamMetricsParams extends S.Class<StreamMetricsParams>('StreamMetricsParams')({
|
|
445
438
|
set: StreamMetricSet,
|
|
446
|
-
start: S.
|
|
447
|
-
end: S.
|
|
448
|
-
interval: S.
|
|
439
|
+
start: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
440
|
+
end: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
441
|
+
interval: S.optional(S.NullOr(TimeseriesInterval)),
|
|
449
442
|
}) {}
|
|
450
443
|
|
|
451
|
-
export class ListStreamsParams extends S.
|
|
452
|
-
prefix: S.
|
|
453
|
-
start_after: S.
|
|
454
|
-
limit: S.
|
|
455
|
-
nullable: true,
|
|
456
|
-
default: () => 1000 as const,
|
|
457
|
-
}),
|
|
444
|
+
export class ListStreamsParams extends S.Class<ListStreamsParams>('ListStreamsParams')({
|
|
445
|
+
prefix: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
446
|
+
start_after: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
447
|
+
limit: S.Int.check(S.isGreaterThanOrEqualTo(0), S.isLessThanOrEqualTo(1000)).pipe(S.optional, S.withDecodingDefault(Effect.succeed(1000))),
|
|
458
448
|
}) {}
|
|
459
449
|
|
|
460
450
|
export class StreamInfo extends S.Class<StreamInfo>('StreamInfo')({
|
|
@@ -465,7 +455,7 @@ export class StreamInfo extends S.Class<StreamInfo>('StreamInfo')({
|
|
|
465
455
|
/**
|
|
466
456
|
* Deletion time in ISO 8601 format, if the stream is being deleted.
|
|
467
457
|
*/
|
|
468
|
-
deleted_at: S.
|
|
458
|
+
deleted_at: S.optional(S.NullOr(S.String)),
|
|
469
459
|
/**
|
|
470
460
|
* Stream name.
|
|
471
461
|
*/
|
|
@@ -480,11 +470,11 @@ export class ListStreamsResponse extends S.Class<ListStreamsResponse>('ListStrea
|
|
|
480
470
|
/**
|
|
481
471
|
* Matching streams.
|
|
482
472
|
*/
|
|
483
|
-
streams: S.Array(StreamInfo).
|
|
473
|
+
streams: S.Array(StreamInfo).check(S.isMaxLength(1000)),
|
|
484
474
|
}) {}
|
|
485
475
|
|
|
486
476
|
export class CreateStreamRequest extends S.Class<CreateStreamRequest>('CreateStreamRequest')({
|
|
487
|
-
config: S.
|
|
477
|
+
config: S.optional(S.NullOr(StreamConfig)),
|
|
488
478
|
/**
|
|
489
479
|
* Stream name that is unique to the basin.
|
|
490
480
|
* It can be between 1 and 512 bytes in length.
|
|
@@ -492,25 +482,25 @@ export class CreateStreamRequest extends S.Class<CreateStreamRequest>('CreateStr
|
|
|
492
482
|
stream: S.String,
|
|
493
483
|
}) {}
|
|
494
484
|
|
|
495
|
-
export class CreateOrReconfigureStreamParams extends S.
|
|
496
|
-
's2-request-token': S.
|
|
485
|
+
export class CreateOrReconfigureStreamParams extends S.Class<CreateOrReconfigureStreamParams>('CreateOrReconfigureStreamParams')({
|
|
486
|
+
's2-request-token': S.optional(S.NullOr(S.String)),
|
|
497
487
|
}) {}
|
|
498
488
|
|
|
499
|
-
export
|
|
489
|
+
export const CreateOrReconfigureStreamRequest = S.Union([S.Null, StreamConfig])
|
|
500
490
|
|
|
501
|
-
export
|
|
491
|
+
export const S2Format = S.Literals(['raw', 'base64'])
|
|
502
492
|
|
|
503
|
-
export
|
|
493
|
+
export const U64 = S.Int.check(S.isGreaterThanOrEqualTo(0))
|
|
504
494
|
|
|
505
|
-
export class ReadParams extends S.
|
|
506
|
-
's2-format': S.
|
|
507
|
-
seq_num: S.
|
|
508
|
-
timestamp: S.
|
|
509
|
-
tail_offset: S.
|
|
510
|
-
count: S.
|
|
511
|
-
bytes: S.
|
|
512
|
-
until: S.
|
|
513
|
-
clamp: S.
|
|
495
|
+
export class ReadParams extends S.Class<ReadParams>('ReadParams')({
|
|
496
|
+
's2-format': S.optional(S.NullOr(S2Format)),
|
|
497
|
+
seq_num: S.optional(S.NullOr(U64)),
|
|
498
|
+
timestamp: S.optional(S.NullOr(U64)),
|
|
499
|
+
tail_offset: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
500
|
+
count: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
501
|
+
bytes: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
502
|
+
until: S.optional(S.NullOr(U64)),
|
|
503
|
+
clamp: S.optional(S.NullOr(S.Boolean)),
|
|
514
504
|
}) {}
|
|
515
505
|
|
|
516
506
|
/**
|
|
@@ -518,7 +508,7 @@ export class ReadParams extends S.Struct({
|
|
|
518
508
|
*
|
|
519
509
|
* The name cannot be empty, with the exception of an S2 command record.
|
|
520
510
|
*/
|
|
521
|
-
export
|
|
511
|
+
export const Header = S.NonEmptyArray(S.String).check(S.isMinLength(2), S.isMaxLength(2))
|
|
522
512
|
|
|
523
513
|
/**
|
|
524
514
|
* Record that is durably sequenced on a stream.
|
|
@@ -527,11 +517,11 @@ export class SequencedRecord extends S.Class<SequencedRecord>('SequencedRecord')
|
|
|
527
517
|
/**
|
|
528
518
|
* Body of the record.
|
|
529
519
|
*/
|
|
530
|
-
body: S.
|
|
520
|
+
body: S.optional(S.NullOr(S.String)),
|
|
531
521
|
/**
|
|
532
522
|
* Series of name-value pairs for this record.
|
|
533
523
|
*/
|
|
534
|
-
headers: S.
|
|
524
|
+
headers: S.optional(S.NullOr(S.Array(Header))),
|
|
535
525
|
/**
|
|
536
526
|
* Sequence number assigned by the service.
|
|
537
527
|
*/
|
|
@@ -549,12 +539,12 @@ export class StreamPosition extends S.Class<StreamPosition>('StreamPosition')({
|
|
|
549
539
|
/**
|
|
550
540
|
* Sequence number assigned by the service.
|
|
551
541
|
*/
|
|
552
|
-
seq_num: S.Int.
|
|
542
|
+
seq_num: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
553
543
|
/**
|
|
554
544
|
* Timestamp, which may be client-specified or assigned by the service.
|
|
555
545
|
* If it is assigned by the service, it will represent milliseconds since Unix epoch.
|
|
556
546
|
*/
|
|
557
|
-
timestamp: S.Int.
|
|
547
|
+
timestamp: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
558
548
|
}) {}
|
|
559
549
|
|
|
560
550
|
export class ReadBatch extends S.Class<ReadBatch>('ReadBatch')({
|
|
@@ -563,7 +553,7 @@ export class ReadBatch extends S.Class<ReadBatch>('ReadBatch')({
|
|
|
563
553
|
* This can only be empty in response to a regular (non-SSE) read, if the request cannot be satisfied without violating an explicit limit.
|
|
564
554
|
*/
|
|
565
555
|
records: S.Array(SequencedRecord),
|
|
566
|
-
tail: S.
|
|
556
|
+
tail: S.optional(S.NullOr(StreamPosition)),
|
|
567
557
|
}) {}
|
|
568
558
|
|
|
569
559
|
export class TailResponse extends S.Class<TailResponse>('TailResponse')({
|
|
@@ -573,8 +563,8 @@ export class TailResponse extends S.Class<TailResponse>('TailResponse')({
|
|
|
573
563
|
tail: StreamPosition,
|
|
574
564
|
}) {}
|
|
575
565
|
|
|
576
|
-
export class AppendParams extends S.
|
|
577
|
-
's2-format': S.
|
|
566
|
+
export class AppendParams extends S.Class<AppendParams>('AppendParams')({
|
|
567
|
+
's2-format': S.optional(S.NullOr(S2Format)),
|
|
578
568
|
}) {}
|
|
579
569
|
|
|
580
570
|
/**
|
|
@@ -584,12 +574,12 @@ export class AppendRecord extends S.Class<AppendRecord>('AppendRecord')({
|
|
|
584
574
|
/**
|
|
585
575
|
* Body of the record.
|
|
586
576
|
*/
|
|
587
|
-
body: S.
|
|
577
|
+
body: S.optional(S.NullOr(S.String)),
|
|
588
578
|
/**
|
|
589
579
|
* Series of name-value pairs for this record.
|
|
590
580
|
*/
|
|
591
|
-
headers: S.
|
|
592
|
-
timestamp: S.
|
|
581
|
+
headers: S.optional(S.NullOr(S.Array(Header))),
|
|
582
|
+
timestamp: S.optional(S.NullOr(U64)),
|
|
593
583
|
}) {}
|
|
594
584
|
|
|
595
585
|
/**
|
|
@@ -599,8 +589,8 @@ export class AppendInput extends S.Class<AppendInput>('AppendInput')({
|
|
|
599
589
|
/**
|
|
600
590
|
* Enforce a fencing token, which starts out as an empty string that can be overridden by a `fence` command record.
|
|
601
591
|
*/
|
|
602
|
-
fencing_token: S.
|
|
603
|
-
match_seq_num: S.
|
|
592
|
+
fencing_token: S.optional(S.NullOr(S.String)),
|
|
593
|
+
match_seq_num: S.optional(S.NullOr(U64)),
|
|
604
594
|
/**
|
|
605
595
|
* Batch of records to append atomically, which must contain at least one record, and no more than 1000.
|
|
606
596
|
* The total size of a batch of records may not exceed 1 MiB of metered bytes.
|
|
@@ -631,7 +621,7 @@ export class AppendAck extends S.Class<AppendAck>('AppendAck')({
|
|
|
631
621
|
/**
|
|
632
622
|
* Aborted due to a failed condition.
|
|
633
623
|
*/
|
|
634
|
-
export
|
|
624
|
+
export const AppendConditionFailed = S.Union([
|
|
635
625
|
/**
|
|
636
626
|
* Fencing token did not match.
|
|
637
627
|
* The expected fencing token is returned.
|
|
@@ -652,9 +642,9 @@ export class AppendConditionFailed extends S.Union(
|
|
|
652
642
|
* Sequence number did not match the tail of the stream.
|
|
653
643
|
* The expected next sequence number is returned.
|
|
654
644
|
*/
|
|
655
|
-
seq_num_mismatch: S.Int.
|
|
645
|
+
seq_num_mismatch: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
656
646
|
}),
|
|
657
|
-
)
|
|
647
|
+
])
|
|
658
648
|
|
|
659
649
|
export const make = (
|
|
660
650
|
httpClient: HttpClient.HttpClient,
|
|
@@ -667,29 +657,29 @@ export const make = (
|
|
|
667
657
|
Effect.orElseSucceed(response.json, () => 'Unexpected status code'),
|
|
668
658
|
(description) =>
|
|
669
659
|
Effect.fail(
|
|
670
|
-
new HttpClientError.
|
|
660
|
+
new HttpClientError.StatusCodeError({
|
|
671
661
|
request: response.request,
|
|
672
662
|
response,
|
|
673
|
-
reason: 'StatusCode',
|
|
674
663
|
description: typeof description === 'string' ? description : JSON.stringify(description),
|
|
675
664
|
}),
|
|
676
665
|
),
|
|
677
666
|
)
|
|
678
667
|
const withResponse: <A, E>(
|
|
679
668
|
f: (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<A, E>,
|
|
680
|
-
) => (request: HttpClientRequest.HttpClientRequest) => Effect.Effect<any, any> =
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
Effect.flatMap(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
669
|
+
) => (request: HttpClientRequest.HttpClientRequest) => Effect.Effect<any, any> =
|
|
670
|
+
options.transformClient !== undefined
|
|
671
|
+
? (f) => (request) =>
|
|
672
|
+
Effect.flatMap(
|
|
673
|
+
Effect.flatMap(options.transformClient!(httpClient), (client) => client.execute(request)),
|
|
674
|
+
f,
|
|
675
|
+
)
|
|
676
|
+
: (f) => (request) => Effect.flatMap(httpClient.execute(request), f)
|
|
687
677
|
const decodeSuccess =
|
|
688
|
-
<A, I, R>(schema: S.
|
|
678
|
+
<A, I, R>(schema: S.Codec<A, I, R>) =>
|
|
689
679
|
(response: HttpClientResponse.HttpClientResponse) =>
|
|
690
680
|
HttpClientResponse.schemaBodyJson(schema)(response)
|
|
691
681
|
const decodeError =
|
|
692
|
-
<const Tag extends string, A, I, R>(tag: Tag, schema: S.
|
|
682
|
+
<const Tag extends string, A, I, R>(tag: Tag, schema: S.Codec<A, I, R>) =>
|
|
693
683
|
(response: HttpClientResponse.HttpClientResponse) =>
|
|
694
684
|
Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)(response), (cause) =>
|
|
695
685
|
Effect.fail(ClientError(tag, cause, response)),
|
|
@@ -716,7 +706,7 @@ export const make = (
|
|
|
716
706
|
issueAccessToken: (options) =>
|
|
717
707
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
718
708
|
HttpClientRequest.post(`/access-tokens`).pipe(
|
|
719
|
-
HttpClientRequest.
|
|
709
|
+
HttpClientRequest.bodyJsonUnsafe(options),
|
|
720
710
|
withResponse(
|
|
721
711
|
HttpClientResponse.matchStatus({
|
|
722
712
|
'2xx': decodeSuccess(IssueAccessTokenResponse),
|
|
@@ -729,7 +719,7 @@ export const make = (
|
|
|
729
719
|
),
|
|
730
720
|
revokeAccessToken: (id) =>
|
|
731
721
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
732
|
-
HttpClientRequest.
|
|
722
|
+
HttpClientRequest.delete(`/access-tokens/${id}`).pipe(
|
|
733
723
|
withResponse(
|
|
734
724
|
HttpClientResponse.matchStatus({
|
|
735
725
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -759,7 +749,7 @@ export const make = (
|
|
|
759
749
|
createBasin: (options) =>
|
|
760
750
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
761
751
|
HttpClientRequest.post(`/basins`).pipe(
|
|
762
|
-
HttpClientRequest.
|
|
752
|
+
HttpClientRequest.bodyJsonUnsafe(options),
|
|
763
753
|
withResponse(
|
|
764
754
|
HttpClientResponse.matchStatus({
|
|
765
755
|
'200': decodeSuccess(BasinInfo),
|
|
@@ -789,7 +779,7 @@ export const make = (
|
|
|
789
779
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
790
780
|
HttpClientRequest.put(`/basins/${basin}`).pipe(
|
|
791
781
|
HttpClientRequest.setHeaders({ 's2-request-token': options.params?.['s2-request-token'] ?? undefined }),
|
|
792
|
-
HttpClientRequest.
|
|
782
|
+
HttpClientRequest.bodyJsonUnsafe(options.payload),
|
|
793
783
|
withResponse(
|
|
794
784
|
HttpClientResponse.matchStatus({
|
|
795
785
|
'200': decodeSuccess(BasinInfo),
|
|
@@ -802,7 +792,7 @@ export const make = (
|
|
|
802
792
|
),
|
|
803
793
|
deleteBasin: (basin) =>
|
|
804
794
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
805
|
-
HttpClientRequest.
|
|
795
|
+
HttpClientRequest.delete(`/basins/${basin}`).pipe(
|
|
806
796
|
withResponse(
|
|
807
797
|
HttpClientResponse.matchStatus({
|
|
808
798
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -817,7 +807,7 @@ export const make = (
|
|
|
817
807
|
reconfigureBasin: (basin, options) =>
|
|
818
808
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
819
809
|
HttpClientRequest.patch(`/basins/${basin}`).pipe(
|
|
820
|
-
HttpClientRequest.
|
|
810
|
+
HttpClientRequest.bodyJsonUnsafe(options),
|
|
821
811
|
withResponse(
|
|
822
812
|
HttpClientResponse.matchStatus({
|
|
823
813
|
'2xx': decodeSuccess(BasinConfig),
|
|
@@ -903,7 +893,7 @@ export const make = (
|
|
|
903
893
|
createStream: (options) =>
|
|
904
894
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
905
895
|
HttpClientRequest.post(`/streams`).pipe(
|
|
906
|
-
HttpClientRequest.
|
|
896
|
+
HttpClientRequest.bodyJsonUnsafe(options),
|
|
907
897
|
withResponse(
|
|
908
898
|
HttpClientResponse.matchStatus({
|
|
909
899
|
'2xx': decodeSuccess(StreamInfo),
|
|
@@ -933,7 +923,7 @@ export const make = (
|
|
|
933
923
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
934
924
|
HttpClientRequest.put(`/streams/${stream}`).pipe(
|
|
935
925
|
HttpClientRequest.setHeaders({ 's2-request-token': options.params?.['s2-request-token'] ?? undefined }),
|
|
936
|
-
HttpClientRequest.
|
|
926
|
+
HttpClientRequest.bodyJsonUnsafe(options.payload),
|
|
937
927
|
withResponse(
|
|
938
928
|
HttpClientResponse.matchStatus({
|
|
939
929
|
'2xx': decodeSuccess(StreamInfo),
|
|
@@ -948,7 +938,7 @@ export const make = (
|
|
|
948
938
|
),
|
|
949
939
|
deleteStream: (stream) =>
|
|
950
940
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
951
|
-
HttpClientRequest.
|
|
941
|
+
HttpClientRequest.delete(`/streams/${stream}`).pipe(
|
|
952
942
|
withResponse(
|
|
953
943
|
HttpClientResponse.matchStatus({
|
|
954
944
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -962,7 +952,7 @@ export const make = (
|
|
|
962
952
|
reconfigureStream: (stream, options) =>
|
|
963
953
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
964
954
|
HttpClientRequest.patch(`/streams/${stream}`).pipe(
|
|
965
|
-
HttpClientRequest.
|
|
955
|
+
HttpClientRequest.bodyJsonUnsafe(options),
|
|
966
956
|
withResponse(
|
|
967
957
|
HttpClientResponse.matchStatus({
|
|
968
958
|
'2xx': decodeSuccess(StreamConfig),
|
|
@@ -1004,7 +994,7 @@ export const make = (
|
|
|
1004
994
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
1005
995
|
HttpClientRequest.post(`/streams/${stream}/records`).pipe(
|
|
1006
996
|
HttpClientRequest.setHeaders({ 's2-format': options.params?.['s2-format'] ?? undefined }),
|
|
1007
|
-
HttpClientRequest.
|
|
997
|
+
HttpClientRequest.bodyJsonUnsafe(options.payload),
|
|
1008
998
|
withResponse(
|
|
1009
999
|
HttpClientResponse.matchStatus({
|
|
1010
1000
|
'2xx': decodeSuccess(AppendAck),
|
|
@@ -1042,13 +1032,10 @@ export interface Client {
|
|
|
1042
1032
|
* List access tokens.
|
|
1043
1033
|
*/
|
|
1044
1034
|
readonly listAccessTokens: (
|
|
1045
|
-
options?: typeof ListAccessTokensParams.Encoded
|
|
1035
|
+
options?: typeof ListAccessTokensParams.Encoded,
|
|
1046
1036
|
) => Effect.Effect<
|
|
1047
1037
|
typeof ListAccessTokensResponse.Type,
|
|
1048
|
-
|
|
|
1049
|
-
| ParseResult.ParseError
|
|
1050
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1051
|
-
|
|
1038
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1052
1039
|
>
|
|
1053
1040
|
/**
|
|
1054
1041
|
* Issue a new access token.
|
|
@@ -1057,11 +1044,7 @@ export interface Client {
|
|
|
1057
1044
|
options: typeof AccessTokenInfo.Encoded,
|
|
1058
1045
|
) => Effect.Effect<
|
|
1059
1046
|
typeof IssueAccessTokenResponse.Type,
|
|
1060
|
-
|
|
|
1061
|
-
| ParseResult.ParseError
|
|
1062
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1063
|
-
|
|
1064
|
-
|
|
1047
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1065
1048
|
>
|
|
1066
1049
|
/**
|
|
1067
1050
|
* Revoke an access token.
|
|
@@ -1070,22 +1053,16 @@ export interface Client {
|
|
|
1070
1053
|
id: string,
|
|
1071
1054
|
) => Effect.Effect<
|
|
1072
1055
|
void,
|
|
1073
|
-
|
|
|
1074
|
-
| ParseResult.ParseError
|
|
1075
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1076
|
-
|
|
1056
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1077
1057
|
>
|
|
1078
1058
|
/**
|
|
1079
1059
|
* List basins.
|
|
1080
1060
|
*/
|
|
1081
1061
|
readonly listBasins: (
|
|
1082
|
-
options?: typeof ListBasinsParams.Encoded
|
|
1062
|
+
options?: typeof ListBasinsParams.Encoded,
|
|
1083
1063
|
) => Effect.Effect<
|
|
1084
1064
|
typeof ListBasinsResponse.Type,
|
|
1085
|
-
|
|
|
1086
|
-
| ParseResult.ParseError
|
|
1087
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1088
|
-
|
|
1065
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1089
1066
|
>
|
|
1090
1067
|
/**
|
|
1091
1068
|
* Create a basin.
|
|
@@ -1093,13 +1070,8 @@ export interface Client {
|
|
|
1093
1070
|
readonly createBasin: (
|
|
1094
1071
|
options: typeof CreateBasinRequest.Encoded,
|
|
1095
1072
|
) => Effect.Effect<
|
|
1096
|
-
typeof BasinInfo.Type
|
|
1097
|
-
|
|
|
1098
|
-
| ParseResult.ParseError
|
|
1099
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1073
|
+
typeof BasinInfo.Type,
|
|
1074
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1103
1075
|
>
|
|
1104
1076
|
/**
|
|
1105
1077
|
* Get basin configuration.
|
|
@@ -1108,11 +1080,7 @@ export interface Client {
|
|
|
1108
1080
|
basin: string,
|
|
1109
1081
|
) => Effect.Effect<
|
|
1110
1082
|
typeof BasinConfig.Type,
|
|
1111
|
-
|
|
|
1112
|
-
| ParseResult.ParseError
|
|
1113
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1114
|
-
|
|
1115
|
-
|
|
1083
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1116
1084
|
>
|
|
1117
1085
|
/**
|
|
1118
1086
|
* Create or reconfigure a basin.
|
|
@@ -1124,8 +1092,8 @@ export interface Client {
|
|
|
1124
1092
|
readonly payload: typeof CreateOrReconfigureBasinRequest.Encoded
|
|
1125
1093
|
},
|
|
1126
1094
|
) => Effect.Effect<
|
|
1127
|
-
typeof BasinInfo.Type
|
|
1128
|
-
HttpClientError.HttpClientError |
|
|
1095
|
+
typeof BasinInfo.Type,
|
|
1096
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1129
1097
|
>
|
|
1130
1098
|
/**
|
|
1131
1099
|
* Delete a basin.
|
|
@@ -1134,12 +1102,7 @@ export interface Client {
|
|
|
1134
1102
|
basin: string,
|
|
1135
1103
|
) => Effect.Effect<
|
|
1136
1104
|
void,
|
|
1137
|
-
|
|
|
1138
|
-
| ParseResult.ParseError
|
|
1139
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1105
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1143
1106
|
>
|
|
1144
1107
|
/**
|
|
1145
1108
|
* Reconfigure a basin.
|
|
@@ -1149,11 +1112,7 @@ export interface Client {
|
|
|
1149
1112
|
options: typeof BasinReconfiguration.Encoded,
|
|
1150
1113
|
) => Effect.Effect<
|
|
1151
1114
|
typeof BasinConfig.Type,
|
|
1152
|
-
|
|
|
1153
|
-
| ParseResult.ParseError
|
|
1154
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1155
|
-
|
|
1156
|
-
|
|
1115
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1157
1116
|
>
|
|
1158
1117
|
/**
|
|
1159
1118
|
* Account-level metrics.
|
|
@@ -1162,10 +1121,7 @@ export interface Client {
|
|
|
1162
1121
|
options: typeof AccountMetricsParams.Encoded,
|
|
1163
1122
|
) => Effect.Effect<
|
|
1164
1123
|
typeof MetricSetResponse.Type,
|
|
1165
|
-
|
|
|
1166
|
-
| ParseResult.ParseError
|
|
1167
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1168
|
-
|
|
1124
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1169
1125
|
>
|
|
1170
1126
|
/**
|
|
1171
1127
|
* Basin-level metrics.
|
|
@@ -1175,10 +1131,7 @@ export interface Client {
|
|
|
1175
1131
|
options: typeof BasinMetricsParams.Encoded,
|
|
1176
1132
|
) => Effect.Effect<
|
|
1177
1133
|
typeof MetricSetResponse.Type,
|
|
1178
|
-
|
|
|
1179
|
-
| ParseResult.ParseError
|
|
1180
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1181
|
-
|
|
1134
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1182
1135
|
>
|
|
1183
1136
|
/**
|
|
1184
1137
|
* Stream-level metrics.
|
|
@@ -1189,23 +1142,16 @@ export interface Client {
|
|
|
1189
1142
|
options: typeof StreamMetricsParams.Encoded,
|
|
1190
1143
|
) => Effect.Effect<
|
|
1191
1144
|
typeof MetricSetResponse.Type,
|
|
1192
|
-
|
|
|
1193
|
-
| ParseResult.ParseError
|
|
1194
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1195
|
-
|
|
1145
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1196
1146
|
>
|
|
1197
1147
|
/**
|
|
1198
1148
|
* List streams.
|
|
1199
1149
|
*/
|
|
1200
1150
|
readonly listStreams: (
|
|
1201
|
-
options?: typeof ListStreamsParams.Encoded
|
|
1151
|
+
options?: typeof ListStreamsParams.Encoded,
|
|
1202
1152
|
) => Effect.Effect<
|
|
1203
1153
|
typeof ListStreamsResponse.Type,
|
|
1204
|
-
|
|
|
1205
|
-
| ParseResult.ParseError
|
|
1206
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1207
|
-
|
|
1208
|
-
|
|
1154
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1209
1155
|
>
|
|
1210
1156
|
/**
|
|
1211
1157
|
* Create a stream.
|
|
@@ -1214,12 +1160,7 @@ export interface Client {
|
|
|
1214
1160
|
options: typeof CreateStreamRequest.Encoded,
|
|
1215
1161
|
) => Effect.Effect<
|
|
1216
1162
|
typeof StreamInfo.Type,
|
|
1217
|
-
|
|
|
1218
|
-
| ParseResult.ParseError
|
|
1219
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1163
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1223
1164
|
>
|
|
1224
1165
|
/**
|
|
1225
1166
|
* Get stream configuration.
|
|
@@ -1228,12 +1169,7 @@ export interface Client {
|
|
|
1228
1169
|
stream: string,
|
|
1229
1170
|
) => Effect.Effect<
|
|
1230
1171
|
typeof StreamConfig.Type,
|
|
1231
|
-
|
|
|
1232
|
-
| ParseResult.ParseError
|
|
1233
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1172
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1237
1173
|
>
|
|
1238
1174
|
/**
|
|
1239
1175
|
* Create or reconfigure a stream.
|
|
@@ -1246,12 +1182,7 @@ export interface Client {
|
|
|
1246
1182
|
},
|
|
1247
1183
|
) => Effect.Effect<
|
|
1248
1184
|
typeof StreamInfo.Type,
|
|
1249
|
-
|
|
|
1250
|
-
| ParseResult.ParseError
|
|
1251
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1185
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1255
1186
|
>
|
|
1256
1187
|
/**
|
|
1257
1188
|
* Delete a stream.
|
|
@@ -1260,11 +1191,7 @@ export interface Client {
|
|
|
1260
1191
|
stream: string,
|
|
1261
1192
|
) => Effect.Effect<
|
|
1262
1193
|
void,
|
|
1263
|
-
|
|
|
1264
|
-
| ParseResult.ParseError
|
|
1265
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1266
|
-
|
|
1267
|
-
|
|
1194
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1268
1195
|
>
|
|
1269
1196
|
/**
|
|
1270
1197
|
* Reconfigure a stream.
|
|
@@ -1274,29 +1201,20 @@ export interface Client {
|
|
|
1274
1201
|
options: typeof StreamReconfiguration.Encoded,
|
|
1275
1202
|
) => Effect.Effect<
|
|
1276
1203
|
typeof StreamConfig.Type,
|
|
1277
|
-
|
|
|
1278
|
-
| ParseResult.ParseError
|
|
1279
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1204
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1283
1205
|
>
|
|
1284
1206
|
/**
|
|
1285
1207
|
* Read records.
|
|
1286
1208
|
*/
|
|
1287
1209
|
readonly read: (
|
|
1288
1210
|
stream: string,
|
|
1289
|
-
options?: typeof ReadParams.Encoded
|
|
1211
|
+
options?: typeof ReadParams.Encoded,
|
|
1290
1212
|
) => Effect.Effect<
|
|
1291
1213
|
typeof ReadBatch.Type,
|
|
1292
1214
|
| HttpClientError.HttpClientError
|
|
1293
|
-
|
|
|
1215
|
+
| S.SchemaError
|
|
1294
1216
|
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
1217
|
| ClientError<'TailResponse', typeof TailResponse.Type>
|
|
1299
|
-
|
|
1300
1218
|
>
|
|
1301
1219
|
/**
|
|
1302
1220
|
* Append records.
|
|
@@ -1310,13 +1228,9 @@ export interface Client {
|
|
|
1310
1228
|
) => Effect.Effect<
|
|
1311
1229
|
typeof AppendAck.Type,
|
|
1312
1230
|
| HttpClientError.HttpClientError
|
|
1313
|
-
|
|
|
1231
|
+
| S.SchemaError
|
|
1314
1232
|
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
1233
|
| ClientError<'AppendConditionFailed', typeof AppendConditionFailed.Type>
|
|
1319
|
-
|
|
1320
1234
|
>
|
|
1321
1235
|
/**
|
|
1322
1236
|
* Check the tail.
|
|
@@ -1325,13 +1239,7 @@ export interface Client {
|
|
|
1325
1239
|
stream: string,
|
|
1326
1240
|
) => Effect.Effect<
|
|
1327
1241
|
typeof TailResponse.Type,
|
|
1328
|
-
|
|
|
1329
|
-
| ParseResult.ParseError
|
|
1330
|
-
| ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1242
|
+
HttpClientError.HttpClientError | S.SchemaError | ClientError<'ErrorResponse', typeof ErrorResponse.Type>
|
|
1335
1243
|
>
|
|
1336
1244
|
}
|
|
1337
1245
|
|