@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
|
@@ -4,68 +4,86 @@
|
|
|
4
4
|
// 1) Use Effect imports from @livestore/utils/effect
|
|
5
5
|
// 2) Fixed CreateOrReconfigureBasinRequest to not be self-referencing
|
|
6
6
|
import { Data, Effect, HttpClientError, HttpClientRequest, HttpClientResponse, Schema as S, } from '@livestore/utils/effect';
|
|
7
|
-
export class ListAccessTokensParams extends S.
|
|
8
|
-
prefix: S.
|
|
9
|
-
start_after: S.
|
|
10
|
-
limit: S.
|
|
11
|
-
nullable: true,
|
|
12
|
-
default: () => 1000,
|
|
13
|
-
}),
|
|
7
|
+
export class ListAccessTokensParams extends S.Class('ListAccessTokensParams')({
|
|
8
|
+
prefix: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
9
|
+
start_after: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
10
|
+
limit: S.Int.check(S.isGreaterThanOrEqualTo(0), S.isLessThanOrEqualTo(1000)).pipe(S.optional, S.withDecodingDefault(Effect.succeed(1000))),
|
|
14
11
|
}) {
|
|
15
12
|
}
|
|
16
|
-
export
|
|
17
|
-
/**
|
|
18
|
-
* Match only the resource with this exact name.
|
|
19
|
-
* Use an empty string to match no resources.
|
|
20
|
-
*/
|
|
21
|
-
S.Struct({
|
|
13
|
+
export const ResourceSet = S.Union([
|
|
22
14
|
/**
|
|
23
15
|
* Match only the resource with this exact name.
|
|
24
16
|
* Use an empty string to match no resources.
|
|
25
17
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
S.Struct({
|
|
19
|
+
/**
|
|
20
|
+
* Match only the resource with this exact name.
|
|
21
|
+
* Use an empty string to match no resources.
|
|
22
|
+
*/
|
|
23
|
+
exact: S.String,
|
|
24
|
+
}),
|
|
33
25
|
/**
|
|
34
26
|
* Match all resources that start with this prefix.
|
|
35
27
|
* Use an empty string to match all resource.
|
|
36
28
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
S.Struct({
|
|
30
|
+
/**
|
|
31
|
+
* Match all resources that start with this prefix.
|
|
32
|
+
* Use an empty string to match all resource.
|
|
33
|
+
*/
|
|
34
|
+
prefix: S.String,
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
40
37
|
export class ReadWritePermissions extends S.Class('ReadWritePermissions')({
|
|
41
38
|
/**
|
|
42
39
|
* Read permission.
|
|
43
40
|
*/
|
|
44
|
-
read: S.
|
|
41
|
+
read: S.Boolean.pipe(S.optional, S.withDecodingDefault(Effect.succeed(false))),
|
|
45
42
|
/**
|
|
46
43
|
* Write permission.
|
|
47
44
|
*/
|
|
48
|
-
write: S.
|
|
45
|
+
write: S.Boolean.pipe(S.optional, S.withDecodingDefault(Effect.succeed(false))),
|
|
49
46
|
}) {
|
|
50
47
|
}
|
|
51
48
|
export class PermittedOperationGroups extends S.Class('PermittedOperationGroups')({
|
|
52
|
-
account: S.
|
|
53
|
-
basin: S.
|
|
54
|
-
stream: S.
|
|
55
|
-
}) {
|
|
56
|
-
}
|
|
57
|
-
export
|
|
58
|
-
|
|
49
|
+
account: S.optional(S.NullOr(ReadWritePermissions)),
|
|
50
|
+
basin: S.optional(S.NullOr(ReadWritePermissions)),
|
|
51
|
+
stream: S.optional(S.NullOr(ReadWritePermissions)),
|
|
52
|
+
}) {
|
|
53
|
+
}
|
|
54
|
+
export const Operation = S.Literals([
|
|
55
|
+
'list-basins',
|
|
56
|
+
'create-basin',
|
|
57
|
+
'delete-basin',
|
|
58
|
+
'reconfigure-basin',
|
|
59
|
+
'get-basin-config',
|
|
60
|
+
'issue-access-token',
|
|
61
|
+
'revoke-access-token',
|
|
62
|
+
'list-access-tokens',
|
|
63
|
+
'list-streams',
|
|
64
|
+
'create-stream',
|
|
65
|
+
'delete-stream',
|
|
66
|
+
'get-stream-config',
|
|
67
|
+
'reconfigure-stream',
|
|
68
|
+
'check-tail',
|
|
69
|
+
'append',
|
|
70
|
+
'read',
|
|
71
|
+
'trim',
|
|
72
|
+
'fence',
|
|
73
|
+
'account-metrics',
|
|
74
|
+
'basin-metrics',
|
|
75
|
+
'stream-metrics',
|
|
76
|
+
]);
|
|
59
77
|
export class AccessTokenScope extends S.Class('AccessTokenScope')({
|
|
60
|
-
access_tokens: S.
|
|
61
|
-
basins: S.
|
|
62
|
-
op_groups: S.
|
|
78
|
+
access_tokens: S.optional(S.NullOr(ResourceSet)),
|
|
79
|
+
basins: S.optional(S.NullOr(ResourceSet)),
|
|
80
|
+
op_groups: S.optional(S.NullOr(PermittedOperationGroups)),
|
|
63
81
|
/**
|
|
64
82
|
* Operations allowed for the token.
|
|
65
83
|
* A union of allowed operations and groups is used as an effective set of allowed operations.
|
|
66
84
|
*/
|
|
67
|
-
ops: S.
|
|
68
|
-
streams: S.
|
|
85
|
+
ops: S.optional(S.NullOr(S.Array(Operation))),
|
|
86
|
+
streams: S.optional(S.NullOr(ResourceSet)),
|
|
69
87
|
}) {
|
|
70
88
|
}
|
|
71
89
|
export class AccessTokenInfo extends S.Class('AccessTokenInfo')({
|
|
@@ -73,12 +91,12 @@ export class AccessTokenInfo extends S.Class('AccessTokenInfo')({
|
|
|
73
91
|
* Namespace streams based on the configured stream-level scope, which must be a prefix.
|
|
74
92
|
* Stream name arguments will be automatically prefixed, and the prefix will be stripped when listing streams.
|
|
75
93
|
*/
|
|
76
|
-
auto_prefix_streams: S.
|
|
94
|
+
auto_prefix_streams: S.Boolean.pipe(S.optional, S.withDecodingDefault(Effect.succeed(false))),
|
|
77
95
|
/**
|
|
78
96
|
* Expiration time in ISO 8601 format.
|
|
79
97
|
* If not set, the expiration will be set to that of the requestor's token.
|
|
80
98
|
*/
|
|
81
|
-
expires_at: S.
|
|
99
|
+
expires_at: S.optional(S.NullOr(S.String)),
|
|
82
100
|
/**
|
|
83
101
|
* Access token ID.
|
|
84
102
|
* It must be unique to the account and between 1 and 96 bytes in length.
|
|
@@ -94,7 +112,7 @@ export class ListAccessTokensResponse extends S.Class('ListAccessTokensResponse'
|
|
|
94
112
|
/**
|
|
95
113
|
* Matching access tokens.
|
|
96
114
|
*/
|
|
97
|
-
access_tokens: S.Array(AccessTokenInfo).
|
|
115
|
+
access_tokens: S.Array(AccessTokenInfo).check(S.isMaxLength(1000)),
|
|
98
116
|
/**
|
|
99
117
|
* Indicates that there are more access tokens that match the criteria.
|
|
100
118
|
*/
|
|
@@ -102,7 +120,7 @@ export class ListAccessTokensResponse extends S.Class('ListAccessTokensResponse'
|
|
|
102
120
|
}) {
|
|
103
121
|
}
|
|
104
122
|
export class ErrorResponse extends S.Class('ErrorResponse')({
|
|
105
|
-
code: S.
|
|
123
|
+
code: S.optional(S.NullOr(S.String)),
|
|
106
124
|
message: S.String,
|
|
107
125
|
}) {
|
|
108
126
|
}
|
|
@@ -113,19 +131,14 @@ export class IssueAccessTokenResponse extends S.Class('IssueAccessTokenResponse'
|
|
|
113
131
|
access_token: S.String,
|
|
114
132
|
}) {
|
|
115
133
|
}
|
|
116
|
-
export class ListBasinsParams extends S.
|
|
117
|
-
prefix: S.
|
|
118
|
-
start_after: S.
|
|
119
|
-
limit: S.
|
|
120
|
-
nullable: true,
|
|
121
|
-
default: () => 1000,
|
|
122
|
-
}),
|
|
134
|
+
export class ListBasinsParams extends S.Class('ListBasinsParams')({
|
|
135
|
+
prefix: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
136
|
+
start_after: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
137
|
+
limit: S.Int.check(S.isGreaterThanOrEqualTo(0), S.isLessThanOrEqualTo(1000)).pipe(S.optional, S.withDecodingDefault(Effect.succeed(1000))),
|
|
123
138
|
}) {
|
|
124
139
|
}
|
|
125
|
-
export
|
|
126
|
-
|
|
127
|
-
export class BasinState extends S.Literal('active', 'creating', 'deleting') {
|
|
128
|
-
}
|
|
140
|
+
export const BasinScope = S.Literal('aws:us-east-1');
|
|
141
|
+
export const BasinState = S.Literals(['active', 'creating', 'deleting']);
|
|
129
142
|
export class BasinInfo extends S.Class('BasinInfo')({
|
|
130
143
|
/**
|
|
131
144
|
* Basin name.
|
|
@@ -145,7 +158,7 @@ export class ListBasinsResponse extends S.Class('ListBasinsResponse')({
|
|
|
145
158
|
/**
|
|
146
159
|
* Matching basins.
|
|
147
160
|
*/
|
|
148
|
-
basins: S.Array(BasinInfo).
|
|
161
|
+
basins: S.Array(BasinInfo).check(S.isMaxLength(1000)),
|
|
149
162
|
/**
|
|
150
163
|
* Indicates that there are more basins that match the criteria.
|
|
151
164
|
*/
|
|
@@ -157,65 +170,62 @@ export class DeleteOnEmptyConfig extends S.Class('DeleteOnEmptyConfig')({
|
|
|
157
170
|
* Minimum age in seconds before an empty stream can be deleted.
|
|
158
171
|
* Set to 0 (default) to disable delete-on-empty (don't delete automatically).
|
|
159
172
|
*/
|
|
160
|
-
min_age_secs: S.
|
|
173
|
+
min_age_secs: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
161
174
|
}) {
|
|
162
175
|
}
|
|
163
|
-
export
|
|
164
|
-
|
|
165
|
-
export class RetentionPolicy extends S.Union(
|
|
166
|
-
/**
|
|
167
|
-
* Age in seconds for automatic trimming of records older than this threshold.
|
|
168
|
-
* This must be set to a value greater than 0 seconds.
|
|
169
|
-
* (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.)
|
|
170
|
-
*/
|
|
171
|
-
S.Struct({
|
|
176
|
+
export const InfiniteRetention = S.Record(S.String, S.Unknown);
|
|
177
|
+
export const RetentionPolicy = S.Union([
|
|
172
178
|
/**
|
|
173
179
|
* Age in seconds for automatic trimming of records older than this threshold.
|
|
174
180
|
* This must be set to a value greater than 0 seconds.
|
|
175
181
|
* (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.)
|
|
176
182
|
*/
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
S.Struct({
|
|
184
|
+
/**
|
|
185
|
+
* Age in seconds for automatic trimming of records older than this threshold.
|
|
186
|
+
* This must be set to a value greater than 0 seconds.
|
|
187
|
+
* (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.)
|
|
188
|
+
*/
|
|
189
|
+
age: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
190
|
+
}),
|
|
183
191
|
/**
|
|
184
192
|
* Retain records unless explicitly trimmed.
|
|
185
193
|
*/
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
194
|
+
S.Struct({
|
|
195
|
+
/**
|
|
196
|
+
* Retain records unless explicitly trimmed.
|
|
197
|
+
*/
|
|
198
|
+
infinite: InfiniteRetention,
|
|
199
|
+
}),
|
|
200
|
+
]);
|
|
201
|
+
export const StorageClass = S.Literals(['standard', 'express']);
|
|
202
|
+
export const TimestampingMode = S.Literals(['client-prefer', 'client-require', 'arrival']);
|
|
193
203
|
export class TimestampingConfig extends S.Class('TimestampingConfig')({
|
|
194
|
-
mode: S.
|
|
204
|
+
mode: S.optional(S.NullOr(TimestampingMode)),
|
|
195
205
|
/**
|
|
196
206
|
* Allow client-specified timestamps to exceed the arrival time.
|
|
197
207
|
* If this is `false` or not set, client timestamps will be capped at the arrival time.
|
|
198
208
|
*/
|
|
199
|
-
uncapped: S.
|
|
209
|
+
uncapped: S.optional(S.NullOr(S.Boolean)),
|
|
200
210
|
}) {
|
|
201
211
|
}
|
|
202
212
|
export class StreamConfig extends S.Class('StreamConfig')({
|
|
203
|
-
delete_on_empty: S.
|
|
204
|
-
retention_policy: S.
|
|
205
|
-
storage_class: S.
|
|
206
|
-
timestamping: S.
|
|
213
|
+
delete_on_empty: S.optional(S.NullOr(DeleteOnEmptyConfig)),
|
|
214
|
+
retention_policy: S.optional(S.NullOr(RetentionPolicy)),
|
|
215
|
+
storage_class: S.optional(S.NullOr(StorageClass)),
|
|
216
|
+
timestamping: S.optional(S.NullOr(TimestampingConfig)),
|
|
207
217
|
}) {
|
|
208
218
|
}
|
|
209
219
|
export class BasinConfig extends S.Class('BasinConfig')({
|
|
210
220
|
/**
|
|
211
221
|
* Create stream on append if it doesn't exist, using the default stream configuration.
|
|
212
222
|
*/
|
|
213
|
-
create_stream_on_append: S.
|
|
223
|
+
create_stream_on_append: S.optional(S.NullOr(S.Boolean)),
|
|
214
224
|
/**
|
|
215
225
|
* Create stream on read if it doesn't exist, using the default stream configuration.
|
|
216
226
|
*/
|
|
217
|
-
create_stream_on_read: S.
|
|
218
|
-
default_stream_config: S.
|
|
227
|
+
create_stream_on_read: S.optional(S.NullOr(S.Boolean)),
|
|
228
|
+
default_stream_config: S.optional(S.NullOr(StreamConfig)),
|
|
219
229
|
}) {
|
|
220
230
|
}
|
|
221
231
|
export class CreateBasinRequest extends S.Class('CreateBasinRequest')({
|
|
@@ -225,68 +235,64 @@ export class CreateBasinRequest extends S.Class('CreateBasinRequest')({
|
|
|
225
235
|
* It cannot begin or end with a hyphen.
|
|
226
236
|
*/
|
|
227
237
|
basin: S.String,
|
|
228
|
-
config: S.
|
|
238
|
+
config: S.optional(S.NullOr(BasinConfig)),
|
|
229
239
|
/**
|
|
230
240
|
* Basin scope.
|
|
231
241
|
*/
|
|
232
|
-
scope: S.
|
|
242
|
+
scope: BasinScope.pipe(S.optional, S.withDecodingDefault(Effect.succeed('aws:us-east-1'))),
|
|
233
243
|
}) {
|
|
234
244
|
}
|
|
235
|
-
export class CreateOrReconfigureBasinParams extends S.
|
|
236
|
-
's2-request-token': S.
|
|
245
|
+
export class CreateOrReconfigureBasinParams extends S.Class('CreateOrReconfigureBasinParams')({
|
|
246
|
+
's2-request-token': S.optional(S.NullOr(S.String)),
|
|
237
247
|
}) {
|
|
238
248
|
}
|
|
239
|
-
export
|
|
240
|
-
}
|
|
249
|
+
export const CreateOrReconfigureBasinRequest = S.Union([S.Null]);
|
|
241
250
|
// export class CreateOrReconfigureBasinRequest extends S.Union(S.Null, CreateOrReconfigureBasinRequest) {}
|
|
242
251
|
export class DeleteOnEmptyReconfiguration extends S.Class('DeleteOnEmptyReconfiguration')({
|
|
243
252
|
/**
|
|
244
253
|
* Minimum age in seconds before an empty stream can be deleted.
|
|
245
254
|
* Set to 0 to disable delete-on-empty (don't delete automatically).
|
|
246
255
|
*/
|
|
247
|
-
min_age_secs: S.
|
|
256
|
+
min_age_secs: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
248
257
|
}) {
|
|
249
258
|
}
|
|
250
259
|
export class TimestampingReconfiguration extends S.Class('TimestampingReconfiguration')({
|
|
251
|
-
mode: S.
|
|
260
|
+
mode: S.optional(S.NullOr(TimestampingMode)),
|
|
252
261
|
/**
|
|
253
262
|
* Allow client-specified timestamps to exceed the arrival time.
|
|
254
263
|
*/
|
|
255
|
-
uncapped: S.
|
|
264
|
+
uncapped: S.optional(S.NullOr(S.Boolean)),
|
|
256
265
|
}) {
|
|
257
266
|
}
|
|
258
267
|
export class StreamReconfiguration extends S.Class('StreamReconfiguration')({
|
|
259
|
-
delete_on_empty: S.
|
|
260
|
-
retention_policy: S.
|
|
261
|
-
storage_class: S.
|
|
262
|
-
timestamping: S.
|
|
268
|
+
delete_on_empty: S.optional(S.NullOr(DeleteOnEmptyReconfiguration)),
|
|
269
|
+
retention_policy: S.optional(S.NullOr(RetentionPolicy)),
|
|
270
|
+
storage_class: S.optional(S.NullOr(StorageClass)),
|
|
271
|
+
timestamping: S.optional(S.NullOr(TimestampingReconfiguration)),
|
|
263
272
|
}) {
|
|
264
273
|
}
|
|
265
274
|
export class BasinReconfiguration extends S.Class('BasinReconfiguration')({
|
|
266
275
|
/**
|
|
267
276
|
* Create a stream on append.
|
|
268
277
|
*/
|
|
269
|
-
create_stream_on_append: S.
|
|
278
|
+
create_stream_on_append: S.optional(S.NullOr(S.Boolean)),
|
|
270
279
|
/**
|
|
271
280
|
* Create a stream on read.
|
|
272
281
|
*/
|
|
273
|
-
create_stream_on_read: S.
|
|
274
|
-
default_stream_config: S.
|
|
282
|
+
create_stream_on_read: S.optional(S.NullOr(S.Boolean)),
|
|
283
|
+
default_stream_config: S.optional(S.NullOr(StreamReconfiguration)),
|
|
275
284
|
}) {
|
|
276
285
|
}
|
|
277
|
-
export
|
|
278
|
-
|
|
279
|
-
export class
|
|
280
|
-
}
|
|
281
|
-
export class AccountMetricsParams extends S.Struct({
|
|
286
|
+
export const AccountMetricSet = S.Literals(['active-basins', 'account-ops']);
|
|
287
|
+
export const TimeseriesInterval = S.Literals(['minute', 'hour', 'day']);
|
|
288
|
+
export class AccountMetricsParams extends S.Class('AccountMetricsParams')({
|
|
282
289
|
set: AccountMetricSet,
|
|
283
|
-
start: S.
|
|
284
|
-
end: S.
|
|
285
|
-
interval: S.
|
|
290
|
+
start: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
291
|
+
end: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
292
|
+
interval: S.optional(S.NullOr(TimeseriesInterval)),
|
|
286
293
|
}) {
|
|
287
294
|
}
|
|
288
|
-
export
|
|
289
|
-
}
|
|
295
|
+
export const MetricUnit = S.Literals(['bytes', 'operations']);
|
|
290
296
|
export class Scalar extends S.Class('Scalar')({
|
|
291
297
|
/**
|
|
292
298
|
* Metric name.
|
|
@@ -339,46 +345,46 @@ export class Label extends S.Class('Label')({
|
|
|
339
345
|
values: S.Array(S.String),
|
|
340
346
|
}) {
|
|
341
347
|
}
|
|
342
|
-
export
|
|
343
|
-
/**
|
|
344
|
-
* Single named value.
|
|
345
|
-
*/
|
|
346
|
-
S.Struct({
|
|
348
|
+
export const Metric = S.Union([
|
|
347
349
|
/**
|
|
348
350
|
* Single named value.
|
|
349
351
|
*/
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
S.Struct({
|
|
352
|
+
S.Struct({
|
|
353
|
+
/**
|
|
354
|
+
* Single named value.
|
|
355
|
+
*/
|
|
356
|
+
scalar: Scalar,
|
|
357
|
+
}),
|
|
357
358
|
/**
|
|
358
359
|
* Named series of `(timestamp, value)` points representing an accumulation over a specified
|
|
359
360
|
* bucket.
|
|
360
361
|
*/
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
362
|
+
S.Struct({
|
|
363
|
+
/**
|
|
364
|
+
* Named series of `(timestamp, value)` points representing an accumulation over a specified
|
|
365
|
+
* bucket.
|
|
366
|
+
*/
|
|
367
|
+
accumulation: Accumulation,
|
|
368
|
+
}),
|
|
367
369
|
/**
|
|
368
370
|
* Named series of `(timestamp, value)` points each representing an instantaneous value.
|
|
369
371
|
*/
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
S.Struct({
|
|
373
|
+
/**
|
|
374
|
+
* Named series of `(timestamp, value)` points each representing an instantaneous value.
|
|
375
|
+
*/
|
|
376
|
+
gauge: Gauge,
|
|
377
|
+
}),
|
|
376
378
|
/**
|
|
377
379
|
* Set of string labels.
|
|
378
380
|
*/
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
381
|
+
S.Struct({
|
|
382
|
+
/**
|
|
383
|
+
* Set of string labels.
|
|
384
|
+
*/
|
|
385
|
+
label: Label,
|
|
386
|
+
}),
|
|
387
|
+
]);
|
|
382
388
|
export class MetricSetResponse extends S.Class('MetricSetResponse')({
|
|
383
389
|
/**
|
|
384
390
|
* Metrics comprising the set.
|
|
@@ -386,31 +392,33 @@ export class MetricSetResponse extends S.Class('MetricSetResponse')({
|
|
|
386
392
|
values: S.Array(Metric),
|
|
387
393
|
}) {
|
|
388
394
|
}
|
|
389
|
-
export
|
|
390
|
-
|
|
391
|
-
|
|
395
|
+
export const BasinMetricSet = S.Literals([
|
|
396
|
+
'storage',
|
|
397
|
+
'append-ops',
|
|
398
|
+
'read-ops',
|
|
399
|
+
'read-throughput',
|
|
400
|
+
'append-throughput',
|
|
401
|
+
'basin-ops',
|
|
402
|
+
]);
|
|
403
|
+
export class BasinMetricsParams extends S.Class('BasinMetricsParams')({
|
|
392
404
|
set: BasinMetricSet,
|
|
393
|
-
start: S.
|
|
394
|
-
end: S.
|
|
395
|
-
interval: S.
|
|
405
|
+
start: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
406
|
+
end: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
407
|
+
interval: S.optional(S.NullOr(TimeseriesInterval)),
|
|
396
408
|
}) {
|
|
397
409
|
}
|
|
398
|
-
export
|
|
399
|
-
|
|
400
|
-
export class StreamMetricsParams extends S.Struct({
|
|
410
|
+
export const StreamMetricSet = S.Literal('storage');
|
|
411
|
+
export class StreamMetricsParams extends S.Class('StreamMetricsParams')({
|
|
401
412
|
set: StreamMetricSet,
|
|
402
|
-
start: S.
|
|
403
|
-
end: S.
|
|
404
|
-
interval: S.
|
|
413
|
+
start: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
414
|
+
end: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
415
|
+
interval: S.optional(S.NullOr(TimeseriesInterval)),
|
|
405
416
|
}) {
|
|
406
417
|
}
|
|
407
|
-
export class ListStreamsParams extends S.
|
|
408
|
-
prefix: S.
|
|
409
|
-
start_after: S.
|
|
410
|
-
limit: S.
|
|
411
|
-
nullable: true,
|
|
412
|
-
default: () => 1000,
|
|
413
|
-
}),
|
|
418
|
+
export class ListStreamsParams extends S.Class('ListStreamsParams')({
|
|
419
|
+
prefix: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
420
|
+
start_after: S.String.pipe(S.optional, S.withDecodingDefault(Effect.succeed(''))),
|
|
421
|
+
limit: S.Int.check(S.isGreaterThanOrEqualTo(0), S.isLessThanOrEqualTo(1000)).pipe(S.optional, S.withDecodingDefault(Effect.succeed(1000))),
|
|
414
422
|
}) {
|
|
415
423
|
}
|
|
416
424
|
export class StreamInfo extends S.Class('StreamInfo')({
|
|
@@ -421,7 +429,7 @@ export class StreamInfo extends S.Class('StreamInfo')({
|
|
|
421
429
|
/**
|
|
422
430
|
* Deletion time in ISO 8601 format, if the stream is being deleted.
|
|
423
431
|
*/
|
|
424
|
-
deleted_at: S.
|
|
432
|
+
deleted_at: S.optional(S.NullOr(S.String)),
|
|
425
433
|
/**
|
|
426
434
|
* Stream name.
|
|
427
435
|
*/
|
|
@@ -436,11 +444,11 @@ export class ListStreamsResponse extends S.Class('ListStreamsResponse')({
|
|
|
436
444
|
/**
|
|
437
445
|
* Matching streams.
|
|
438
446
|
*/
|
|
439
|
-
streams: S.Array(StreamInfo).
|
|
447
|
+
streams: S.Array(StreamInfo).check(S.isMaxLength(1000)),
|
|
440
448
|
}) {
|
|
441
449
|
}
|
|
442
450
|
export class CreateStreamRequest extends S.Class('CreateStreamRequest')({
|
|
443
|
-
config: S.
|
|
451
|
+
config: S.optional(S.NullOr(StreamConfig)),
|
|
444
452
|
/**
|
|
445
453
|
* Stream name that is unique to the basin.
|
|
446
454
|
* It can be between 1 and 512 bytes in length.
|
|
@@ -448,25 +456,22 @@ export class CreateStreamRequest extends S.Class('CreateStreamRequest')({
|
|
|
448
456
|
stream: S.String,
|
|
449
457
|
}) {
|
|
450
458
|
}
|
|
451
|
-
export class CreateOrReconfigureStreamParams extends S.
|
|
452
|
-
's2-request-token': S.
|
|
459
|
+
export class CreateOrReconfigureStreamParams extends S.Class('CreateOrReconfigureStreamParams')({
|
|
460
|
+
's2-request-token': S.optional(S.NullOr(S.String)),
|
|
453
461
|
}) {
|
|
454
462
|
}
|
|
455
|
-
export
|
|
456
|
-
|
|
457
|
-
export
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
bytes: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
468
|
-
until: S.optionalWith(U64, { nullable: true }),
|
|
469
|
-
clamp: S.optionalWith(S.Boolean, { nullable: true }),
|
|
463
|
+
export const CreateOrReconfigureStreamRequest = S.Union([S.Null, StreamConfig]);
|
|
464
|
+
export const S2Format = S.Literals(['raw', 'base64']);
|
|
465
|
+
export const U64 = S.Int.check(S.isGreaterThanOrEqualTo(0));
|
|
466
|
+
export class ReadParams extends S.Class('ReadParams')({
|
|
467
|
+
's2-format': S.optional(S.NullOr(S2Format)),
|
|
468
|
+
seq_num: S.optional(S.NullOr(U64)),
|
|
469
|
+
timestamp: S.optional(S.NullOr(U64)),
|
|
470
|
+
tail_offset: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
471
|
+
count: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
472
|
+
bytes: S.optional(S.NullOr(S.Int.check(S.isGreaterThanOrEqualTo(0)))),
|
|
473
|
+
until: S.optional(S.NullOr(U64)),
|
|
474
|
+
clamp: S.optional(S.NullOr(S.Boolean)),
|
|
470
475
|
}) {
|
|
471
476
|
}
|
|
472
477
|
/**
|
|
@@ -474,8 +479,7 @@ export class ReadParams extends S.Struct({
|
|
|
474
479
|
*
|
|
475
480
|
* The name cannot be empty, with the exception of an S2 command record.
|
|
476
481
|
*/
|
|
477
|
-
export
|
|
478
|
-
}
|
|
482
|
+
export const Header = S.NonEmptyArray(S.String).check(S.isMinLength(2), S.isMaxLength(2));
|
|
479
483
|
/**
|
|
480
484
|
* Record that is durably sequenced on a stream.
|
|
481
485
|
*/
|
|
@@ -483,11 +487,11 @@ export class SequencedRecord extends S.Class('SequencedRecord')({
|
|
|
483
487
|
/**
|
|
484
488
|
* Body of the record.
|
|
485
489
|
*/
|
|
486
|
-
body: S.
|
|
490
|
+
body: S.optional(S.NullOr(S.String)),
|
|
487
491
|
/**
|
|
488
492
|
* Series of name-value pairs for this record.
|
|
489
493
|
*/
|
|
490
|
-
headers: S.
|
|
494
|
+
headers: S.optional(S.NullOr(S.Array(Header))),
|
|
491
495
|
/**
|
|
492
496
|
* Sequence number assigned by the service.
|
|
493
497
|
*/
|
|
@@ -505,12 +509,12 @@ export class StreamPosition extends S.Class('StreamPosition')({
|
|
|
505
509
|
/**
|
|
506
510
|
* Sequence number assigned by the service.
|
|
507
511
|
*/
|
|
508
|
-
seq_num: S.Int.
|
|
512
|
+
seq_num: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
509
513
|
/**
|
|
510
514
|
* Timestamp, which may be client-specified or assigned by the service.
|
|
511
515
|
* If it is assigned by the service, it will represent milliseconds since Unix epoch.
|
|
512
516
|
*/
|
|
513
|
-
timestamp: S.Int.
|
|
517
|
+
timestamp: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
514
518
|
}) {
|
|
515
519
|
}
|
|
516
520
|
export class ReadBatch extends S.Class('ReadBatch')({
|
|
@@ -519,7 +523,7 @@ export class ReadBatch extends S.Class('ReadBatch')({
|
|
|
519
523
|
* This can only be empty in response to a regular (non-SSE) read, if the request cannot be satisfied without violating an explicit limit.
|
|
520
524
|
*/
|
|
521
525
|
records: S.Array(SequencedRecord),
|
|
522
|
-
tail: S.
|
|
526
|
+
tail: S.optional(S.NullOr(StreamPosition)),
|
|
523
527
|
}) {
|
|
524
528
|
}
|
|
525
529
|
export class TailResponse extends S.Class('TailResponse')({
|
|
@@ -529,8 +533,8 @@ export class TailResponse extends S.Class('TailResponse')({
|
|
|
529
533
|
tail: StreamPosition,
|
|
530
534
|
}) {
|
|
531
535
|
}
|
|
532
|
-
export class AppendParams extends S.
|
|
533
|
-
's2-format': S.
|
|
536
|
+
export class AppendParams extends S.Class('AppendParams')({
|
|
537
|
+
's2-format': S.optional(S.NullOr(S2Format)),
|
|
534
538
|
}) {
|
|
535
539
|
}
|
|
536
540
|
/**
|
|
@@ -540,12 +544,12 @@ export class AppendRecord extends S.Class('AppendRecord')({
|
|
|
540
544
|
/**
|
|
541
545
|
* Body of the record.
|
|
542
546
|
*/
|
|
543
|
-
body: S.
|
|
547
|
+
body: S.optional(S.NullOr(S.String)),
|
|
544
548
|
/**
|
|
545
549
|
* Series of name-value pairs for this record.
|
|
546
550
|
*/
|
|
547
|
-
headers: S.
|
|
548
|
-
timestamp: S.
|
|
551
|
+
headers: S.optional(S.NullOr(S.Array(Header))),
|
|
552
|
+
timestamp: S.optional(S.NullOr(U64)),
|
|
549
553
|
}) {
|
|
550
554
|
}
|
|
551
555
|
/**
|
|
@@ -555,8 +559,8 @@ export class AppendInput extends S.Class('AppendInput')({
|
|
|
555
559
|
/**
|
|
556
560
|
* Enforce a fencing token, which starts out as an empty string that can be overridden by a `fence` command record.
|
|
557
561
|
*/
|
|
558
|
-
fencing_token: S.
|
|
559
|
-
match_seq_num: S.
|
|
562
|
+
fencing_token: S.optional(S.NullOr(S.String)),
|
|
563
|
+
match_seq_num: S.optional(S.NullOr(U64)),
|
|
560
564
|
/**
|
|
561
565
|
* Batch of records to append atomically, which must contain at least one record, and no more than 1000.
|
|
562
566
|
* The total size of a batch of records may not exceed 1 MiB of metered bytes.
|
|
@@ -587,35 +591,34 @@ export class AppendAck extends S.Class('AppendAck')({
|
|
|
587
591
|
/**
|
|
588
592
|
* Aborted due to a failed condition.
|
|
589
593
|
*/
|
|
590
|
-
export
|
|
591
|
-
/**
|
|
592
|
-
* Fencing token did not match.
|
|
593
|
-
* The expected fencing token is returned.
|
|
594
|
-
*/
|
|
595
|
-
S.Struct({
|
|
594
|
+
export const AppendConditionFailed = S.Union([
|
|
596
595
|
/**
|
|
597
596
|
* Fencing token did not match.
|
|
598
597
|
* The expected fencing token is returned.
|
|
599
598
|
*/
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
599
|
+
S.Struct({
|
|
600
|
+
/**
|
|
601
|
+
* Fencing token did not match.
|
|
602
|
+
* The expected fencing token is returned.
|
|
603
|
+
*/
|
|
604
|
+
fencing_token_mismatch: S.String,
|
|
605
|
+
}),
|
|
607
606
|
/**
|
|
608
607
|
* Sequence number did not match the tail of the stream.
|
|
609
608
|
* The expected next sequence number is returned.
|
|
610
609
|
*/
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
610
|
+
S.Struct({
|
|
611
|
+
/**
|
|
612
|
+
* Sequence number did not match the tail of the stream.
|
|
613
|
+
* The expected next sequence number is returned.
|
|
614
|
+
*/
|
|
615
|
+
seq_num_mismatch: S.Int.check(S.isGreaterThanOrEqualTo(0)),
|
|
616
|
+
}),
|
|
617
|
+
]);
|
|
614
618
|
export const make = (httpClient, options = {}) => {
|
|
615
|
-
const unexpectedStatus = (response) => Effect.flatMap(Effect.orElseSucceed(response.json, () => 'Unexpected status code'), (description) => Effect.fail(new HttpClientError.
|
|
619
|
+
const unexpectedStatus = (response) => Effect.flatMap(Effect.orElseSucceed(response.json, () => 'Unexpected status code'), (description) => Effect.fail(new HttpClientError.StatusCodeError({
|
|
616
620
|
request: response.request,
|
|
617
621
|
response,
|
|
618
|
-
reason: 'StatusCode',
|
|
619
622
|
description: typeof description === 'string' ? description : JSON.stringify(description),
|
|
620
623
|
})));
|
|
621
624
|
const withResponse = options.transformClient !== undefined
|
|
@@ -639,7 +642,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
639
642
|
}))),
|
|
640
643
|
issueAccessToken: (options) =>
|
|
641
644
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
642
|
-
HttpClientRequest.post(`/access-tokens`).pipe(HttpClientRequest.
|
|
645
|
+
HttpClientRequest.post(`/access-tokens`).pipe(HttpClientRequest.bodyJsonUnsafe(options), withResponse(HttpClientResponse.matchStatus({
|
|
643
646
|
'2xx': decodeSuccess(IssueAccessTokenResponse),
|
|
644
647
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
645
648
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -648,7 +651,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
648
651
|
}))),
|
|
649
652
|
revokeAccessToken: (id) =>
|
|
650
653
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
651
|
-
HttpClientRequest.
|
|
654
|
+
HttpClientRequest.delete(`/access-tokens/${id}`).pipe(withResponse(HttpClientResponse.matchStatus({
|
|
652
655
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
653
656
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
654
657
|
'200': () => Effect.void,
|
|
@@ -668,7 +671,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
668
671
|
}))),
|
|
669
672
|
createBasin: (options) =>
|
|
670
673
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
671
|
-
HttpClientRequest.post(`/basins`).pipe(HttpClientRequest.
|
|
674
|
+
HttpClientRequest.post(`/basins`).pipe(HttpClientRequest.bodyJsonUnsafe(options), withResponse(HttpClientResponse.matchStatus({
|
|
672
675
|
'200': decodeSuccess(BasinInfo),
|
|
673
676
|
'201': decodeSuccess(BasinInfo),
|
|
674
677
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -688,7 +691,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
688
691
|
}))),
|
|
689
692
|
createOrReconfigureBasin: (basin, options) =>
|
|
690
693
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
691
|
-
HttpClientRequest.put(`/basins/${basin}`).pipe(HttpClientRequest.setHeaders({ 's2-request-token': options.params?.['s2-request-token'] ?? undefined }), HttpClientRequest.
|
|
694
|
+
HttpClientRequest.put(`/basins/${basin}`).pipe(HttpClientRequest.setHeaders({ 's2-request-token': options.params?.['s2-request-token'] ?? undefined }), HttpClientRequest.bodyJsonUnsafe(options.payload), withResponse(HttpClientResponse.matchStatus({
|
|
692
695
|
'200': decodeSuccess(BasinInfo),
|
|
693
696
|
'201': decodeSuccess(BasinInfo),
|
|
694
697
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -697,7 +700,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
697
700
|
}))),
|
|
698
701
|
deleteBasin: (basin) =>
|
|
699
702
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
700
|
-
HttpClientRequest.
|
|
703
|
+
HttpClientRequest.delete(`/basins/${basin}`).pipe(withResponse(HttpClientResponse.matchStatus({
|
|
701
704
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
702
705
|
'401': decodeError('ErrorResponse', ErrorResponse),
|
|
703
706
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -707,7 +710,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
707
710
|
}))),
|
|
708
711
|
reconfigureBasin: (basin, options) =>
|
|
709
712
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
710
|
-
HttpClientRequest.patch(`/basins/${basin}`).pipe(HttpClientRequest.
|
|
713
|
+
HttpClientRequest.patch(`/basins/${basin}`).pipe(HttpClientRequest.bodyJsonUnsafe(options), withResponse(HttpClientResponse.matchStatus({
|
|
711
714
|
'2xx': decodeSuccess(BasinConfig),
|
|
712
715
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
713
716
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -768,7 +771,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
768
771
|
}))),
|
|
769
772
|
createStream: (options) =>
|
|
770
773
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
771
|
-
HttpClientRequest.post(`/streams`).pipe(HttpClientRequest.
|
|
774
|
+
HttpClientRequest.post(`/streams`).pipe(HttpClientRequest.bodyJsonUnsafe(options), withResponse(HttpClientResponse.matchStatus({
|
|
772
775
|
'2xx': decodeSuccess(StreamInfo),
|
|
773
776
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
774
777
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -788,7 +791,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
788
791
|
}))),
|
|
789
792
|
createOrReconfigureStream: (stream, options) =>
|
|
790
793
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
791
|
-
HttpClientRequest.put(`/streams/${stream}`).pipe(HttpClientRequest.setHeaders({ 's2-request-token': options.params?.['s2-request-token'] ?? undefined }), HttpClientRequest.
|
|
794
|
+
HttpClientRequest.put(`/streams/${stream}`).pipe(HttpClientRequest.setHeaders({ 's2-request-token': options.params?.['s2-request-token'] ?? undefined }), HttpClientRequest.bodyJsonUnsafe(options.payload), withResponse(HttpClientResponse.matchStatus({
|
|
792
795
|
'2xx': decodeSuccess(StreamInfo),
|
|
793
796
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
794
797
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -799,7 +802,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
799
802
|
}))),
|
|
800
803
|
deleteStream: (stream) =>
|
|
801
804
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
802
|
-
HttpClientRequest.
|
|
805
|
+
HttpClientRequest.delete(`/streams/${stream}`).pipe(withResponse(HttpClientResponse.matchStatus({
|
|
803
806
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
804
807
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
805
808
|
'404': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -808,7 +811,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
808
811
|
}))),
|
|
809
812
|
reconfigureStream: (stream, options) =>
|
|
810
813
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
811
|
-
HttpClientRequest.patch(`/streams/${stream}`).pipe(HttpClientRequest.
|
|
814
|
+
HttpClientRequest.patch(`/streams/${stream}`).pipe(HttpClientRequest.bodyJsonUnsafe(options), withResponse(HttpClientResponse.matchStatus({
|
|
812
815
|
'2xx': decodeSuccess(StreamConfig),
|
|
813
816
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
814
817
|
'403': decodeError('ErrorResponse', ErrorResponse),
|
|
@@ -838,7 +841,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
838
841
|
}))),
|
|
839
842
|
append: (stream, options) =>
|
|
840
843
|
// @effect-diagnostics-next-line anyUnknownInErrorContext:off
|
|
841
|
-
HttpClientRequest.post(`/streams/${stream}/records`).pipe(HttpClientRequest.setHeaders({ 's2-format': options.params?.['s2-format'] ?? undefined }), HttpClientRequest.
|
|
844
|
+
HttpClientRequest.post(`/streams/${stream}/records`).pipe(HttpClientRequest.setHeaders({ 's2-format': options.params?.['s2-format'] ?? undefined }), HttpClientRequest.bodyJsonUnsafe(options.payload), withResponse(HttpClientResponse.matchStatus({
|
|
842
845
|
'2xx': decodeSuccess(AppendAck),
|
|
843
846
|
'400': decodeError('ErrorResponse', ErrorResponse),
|
|
844
847
|
'401': decodeError('ErrorResponse', ErrorResponse),
|