@s2-dev/streamstore 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/assignment.d.ts +28 -28
- package/models/components/assignment.d.ts.map +1 -1
- package/models/components/assignment.js +36 -36
- package/models/components/assignment.js.map +1 -1
- package/models/components/formatoption.d.ts +28 -0
- package/models/components/formatoption.d.ts.map +1 -0
- package/models/components/formatoption.js +60 -0
- package/models/components/formatoption.js.map +1 -0
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/output.d.ts +41 -41
- package/models/components/output.d.ts.map +1 -1
- package/models/components/output.js +53 -53
- package/models/components/output.js.map +1 -1
- package/models/components/readresponse.d.ts +28 -28
- package/models/components/readresponse.d.ts.map +1 -1
- package/models/components/readresponse.js +36 -35
- package/models/components/readresponse.js.map +1 -1
- package/models/components/retentionpolicy.d.ts +17 -17
- package/models/components/retentionpolicy.js +18 -18
- package/models/operations/append.d.ts +4 -30
- package/models/operations/append.d.ts.map +1 -1
- package/models/operations/append.js +5 -25
- package/models/operations/append.js.map +1 -1
- package/models/operations/read.d.ts +4 -30
- package/models/operations/read.d.ts.map +1 -1
- package/models/operations/read.js +5 -24
- package/models/operations/read.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/assignment.ts +46 -49
- package/src/models/components/formatoption.ts +31 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/output.ts +86 -80
- package/src/models/components/readresponse.ts +54 -53
- package/src/models/components/retentionpolicy.ts +21 -21
- package/src/models/operations/append.ts +6 -32
- package/src/models/operations/read.ts +6 -31
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
* @remarks
|
|
21
21
|
* If returned in a streaming read session, this will be a terminal reply.
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type NextSeqNum = {
|
|
24
24
|
/**
|
|
25
25
|
* Sequence number for the next record on this stream, in case the requested `start_seq_num` was larger.
|
|
26
26
|
*
|
|
@@ -37,7 +37,7 @@ export type Three = {
|
|
|
37
37
|
* If returned in a streaming read session, this will be a terminal reply, to signal that there is uncertainty about whether some records may be omitted.
|
|
38
38
|
* The client can re-establish the session starting at this sequence number.
|
|
39
39
|
*/
|
|
40
|
-
export type
|
|
40
|
+
export type FirstSeqNum = {
|
|
41
41
|
/**
|
|
42
42
|
* Sequence number for the first record on this stream, in case the requested `start_seq_num` is smaller.
|
|
43
43
|
*
|
|
@@ -55,7 +55,7 @@ export type Output2 = {
|
|
|
55
55
|
* This batch can be empty only if a `ReadLimit` was provided in the associated read request, but the first record
|
|
56
56
|
* that could have been returned would violate the limit.
|
|
57
57
|
*/
|
|
58
|
-
export type
|
|
58
|
+
export type Batch = {
|
|
59
59
|
/**
|
|
60
60
|
* A batch of sequenced records.
|
|
61
61
|
*/
|
|
@@ -65,28 +65,31 @@ export type Output1 = {
|
|
|
65
65
|
/**
|
|
66
66
|
* Reply which can be a batch of records, or a sequence number if the request could not be satisfied.
|
|
67
67
|
*/
|
|
68
|
-
export type Output =
|
|
68
|
+
export type Output = Batch | FirstSeqNum | NextSeqNum;
|
|
69
69
|
|
|
70
70
|
/** @internal */
|
|
71
|
-
export const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
export const NextSeqNum$inboundSchema: z.ZodType<
|
|
72
|
+
NextSeqNum,
|
|
73
|
+
z.ZodTypeDef,
|
|
74
|
+
unknown
|
|
75
|
+
> = z.object({
|
|
76
|
+
next_seq_num: z.number().int(),
|
|
77
|
+
}).transform((v) => {
|
|
78
|
+
return remap$(v, {
|
|
79
|
+
"next_seq_num": "nextSeqNum",
|
|
78
80
|
});
|
|
81
|
+
});
|
|
79
82
|
|
|
80
83
|
/** @internal */
|
|
81
|
-
export type
|
|
84
|
+
export type NextSeqNum$Outbound = {
|
|
82
85
|
next_seq_num: number;
|
|
83
86
|
};
|
|
84
87
|
|
|
85
88
|
/** @internal */
|
|
86
|
-
export const
|
|
87
|
-
|
|
89
|
+
export const NextSeqNum$outboundSchema: z.ZodType<
|
|
90
|
+
NextSeqNum$Outbound,
|
|
88
91
|
z.ZodTypeDef,
|
|
89
|
-
|
|
92
|
+
NextSeqNum
|
|
90
93
|
> = z.object({
|
|
91
94
|
nextSeqNum: z.number().int(),
|
|
92
95
|
}).transform((v) => {
|
|
@@ -99,49 +102,52 @@ export const Three$outboundSchema: z.ZodType<
|
|
|
99
102
|
* @internal
|
|
100
103
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
101
104
|
*/
|
|
102
|
-
export namespace
|
|
103
|
-
/** @deprecated use `
|
|
104
|
-
export const inboundSchema =
|
|
105
|
-
/** @deprecated use `
|
|
106
|
-
export const outboundSchema =
|
|
107
|
-
/** @deprecated use `
|
|
108
|
-
export type Outbound =
|
|
105
|
+
export namespace NextSeqNum$ {
|
|
106
|
+
/** @deprecated use `NextSeqNum$inboundSchema` instead. */
|
|
107
|
+
export const inboundSchema = NextSeqNum$inboundSchema;
|
|
108
|
+
/** @deprecated use `NextSeqNum$outboundSchema` instead. */
|
|
109
|
+
export const outboundSchema = NextSeqNum$outboundSchema;
|
|
110
|
+
/** @deprecated use `NextSeqNum$Outbound` instead. */
|
|
111
|
+
export type Outbound = NextSeqNum$Outbound;
|
|
109
112
|
}
|
|
110
113
|
|
|
111
|
-
export function
|
|
112
|
-
return JSON.stringify(
|
|
114
|
+
export function nextSeqNumToJSON(nextSeqNum: NextSeqNum): string {
|
|
115
|
+
return JSON.stringify(NextSeqNum$outboundSchema.parse(nextSeqNum));
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
export function
|
|
118
|
+
export function nextSeqNumFromJSON(
|
|
116
119
|
jsonString: string,
|
|
117
|
-
): SafeParseResult<
|
|
120
|
+
): SafeParseResult<NextSeqNum, SDKValidationError> {
|
|
118
121
|
return safeParse(
|
|
119
122
|
jsonString,
|
|
120
|
-
(x) =>
|
|
121
|
-
`Failed to parse '
|
|
123
|
+
(x) => NextSeqNum$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'NextSeqNum' from JSON`,
|
|
122
125
|
);
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
/** @internal */
|
|
126
|
-
export const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
export const FirstSeqNum$inboundSchema: z.ZodType<
|
|
130
|
+
FirstSeqNum,
|
|
131
|
+
z.ZodTypeDef,
|
|
132
|
+
unknown
|
|
133
|
+
> = z.object({
|
|
134
|
+
first_seq_num: z.number().int(),
|
|
135
|
+
}).transform((v) => {
|
|
136
|
+
return remap$(v, {
|
|
137
|
+
"first_seq_num": "firstSeqNum",
|
|
133
138
|
});
|
|
139
|
+
});
|
|
134
140
|
|
|
135
141
|
/** @internal */
|
|
136
|
-
export type
|
|
142
|
+
export type FirstSeqNum$Outbound = {
|
|
137
143
|
first_seq_num: number;
|
|
138
144
|
};
|
|
139
145
|
|
|
140
146
|
/** @internal */
|
|
141
|
-
export const
|
|
142
|
-
|
|
147
|
+
export const FirstSeqNum$outboundSchema: z.ZodType<
|
|
148
|
+
FirstSeqNum$Outbound,
|
|
143
149
|
z.ZodTypeDef,
|
|
144
|
-
|
|
150
|
+
FirstSeqNum
|
|
145
151
|
> = z.object({
|
|
146
152
|
firstSeqNum: z.number().int(),
|
|
147
153
|
}).transform((v) => {
|
|
@@ -154,45 +160,45 @@ export const Output2$outboundSchema: z.ZodType<
|
|
|
154
160
|
* @internal
|
|
155
161
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
156
162
|
*/
|
|
157
|
-
export namespace
|
|
158
|
-
/** @deprecated use `
|
|
159
|
-
export const inboundSchema =
|
|
160
|
-
/** @deprecated use `
|
|
161
|
-
export const outboundSchema =
|
|
162
|
-
/** @deprecated use `
|
|
163
|
-
export type Outbound =
|
|
163
|
+
export namespace FirstSeqNum$ {
|
|
164
|
+
/** @deprecated use `FirstSeqNum$inboundSchema` instead. */
|
|
165
|
+
export const inboundSchema = FirstSeqNum$inboundSchema;
|
|
166
|
+
/** @deprecated use `FirstSeqNum$outboundSchema` instead. */
|
|
167
|
+
export const outboundSchema = FirstSeqNum$outboundSchema;
|
|
168
|
+
/** @deprecated use `FirstSeqNum$Outbound` instead. */
|
|
169
|
+
export type Outbound = FirstSeqNum$Outbound;
|
|
164
170
|
}
|
|
165
171
|
|
|
166
|
-
export function
|
|
167
|
-
return JSON.stringify(
|
|
172
|
+
export function firstSeqNumToJSON(firstSeqNum: FirstSeqNum): string {
|
|
173
|
+
return JSON.stringify(FirstSeqNum$outboundSchema.parse(firstSeqNum));
|
|
168
174
|
}
|
|
169
175
|
|
|
170
|
-
export function
|
|
176
|
+
export function firstSeqNumFromJSON(
|
|
171
177
|
jsonString: string,
|
|
172
|
-
): SafeParseResult<
|
|
178
|
+
): SafeParseResult<FirstSeqNum, SDKValidationError> {
|
|
173
179
|
return safeParse(
|
|
174
180
|
jsonString,
|
|
175
|
-
(x) =>
|
|
176
|
-
`Failed to parse '
|
|
181
|
+
(x) => FirstSeqNum$inboundSchema.parse(JSON.parse(x)),
|
|
182
|
+
`Failed to parse 'FirstSeqNum' from JSON`,
|
|
177
183
|
);
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
/** @internal */
|
|
181
|
-
export const
|
|
182
|
-
|
|
187
|
+
export const Batch$inboundSchema: z.ZodType<Batch, z.ZodTypeDef, unknown> = z
|
|
188
|
+
.object({
|
|
183
189
|
batch: SequencedRecordBatch$inboundSchema,
|
|
184
190
|
});
|
|
185
191
|
|
|
186
192
|
/** @internal */
|
|
187
|
-
export type
|
|
193
|
+
export type Batch$Outbound = {
|
|
188
194
|
batch: SequencedRecordBatch$Outbound;
|
|
189
195
|
};
|
|
190
196
|
|
|
191
197
|
/** @internal */
|
|
192
|
-
export const
|
|
193
|
-
|
|
198
|
+
export const Batch$outboundSchema: z.ZodType<
|
|
199
|
+
Batch$Outbound,
|
|
194
200
|
z.ZodTypeDef,
|
|
195
|
-
|
|
201
|
+
Batch
|
|
196
202
|
> = z.object({
|
|
197
203
|
batch: SequencedRecordBatch$outboundSchema,
|
|
198
204
|
});
|
|
@@ -201,42 +207,42 @@ export const Output1$outboundSchema: z.ZodType<
|
|
|
201
207
|
* @internal
|
|
202
208
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
203
209
|
*/
|
|
204
|
-
export namespace
|
|
205
|
-
/** @deprecated use `
|
|
206
|
-
export const inboundSchema =
|
|
207
|
-
/** @deprecated use `
|
|
208
|
-
export const outboundSchema =
|
|
209
|
-
/** @deprecated use `
|
|
210
|
-
export type Outbound =
|
|
210
|
+
export namespace Batch$ {
|
|
211
|
+
/** @deprecated use `Batch$inboundSchema` instead. */
|
|
212
|
+
export const inboundSchema = Batch$inboundSchema;
|
|
213
|
+
/** @deprecated use `Batch$outboundSchema` instead. */
|
|
214
|
+
export const outboundSchema = Batch$outboundSchema;
|
|
215
|
+
/** @deprecated use `Batch$Outbound` instead. */
|
|
216
|
+
export type Outbound = Batch$Outbound;
|
|
211
217
|
}
|
|
212
218
|
|
|
213
|
-
export function
|
|
214
|
-
return JSON.stringify(
|
|
219
|
+
export function batchToJSON(batch: Batch): string {
|
|
220
|
+
return JSON.stringify(Batch$outboundSchema.parse(batch));
|
|
215
221
|
}
|
|
216
222
|
|
|
217
|
-
export function
|
|
223
|
+
export function batchFromJSON(
|
|
218
224
|
jsonString: string,
|
|
219
|
-
): SafeParseResult<
|
|
225
|
+
): SafeParseResult<Batch, SDKValidationError> {
|
|
220
226
|
return safeParse(
|
|
221
227
|
jsonString,
|
|
222
|
-
(x) =>
|
|
223
|
-
`Failed to parse '
|
|
228
|
+
(x) => Batch$inboundSchema.parse(JSON.parse(x)),
|
|
229
|
+
`Failed to parse 'Batch' from JSON`,
|
|
224
230
|
);
|
|
225
231
|
}
|
|
226
232
|
|
|
227
233
|
/** @internal */
|
|
228
234
|
export const Output$inboundSchema: z.ZodType<Output, z.ZodTypeDef, unknown> = z
|
|
229
235
|
.union([
|
|
230
|
-
z.lazy(() =>
|
|
231
|
-
z.lazy(() =>
|
|
232
|
-
z.lazy(() =>
|
|
236
|
+
z.lazy(() => Batch$inboundSchema),
|
|
237
|
+
z.lazy(() => FirstSeqNum$inboundSchema),
|
|
238
|
+
z.lazy(() => NextSeqNum$inboundSchema),
|
|
233
239
|
]);
|
|
234
240
|
|
|
235
241
|
/** @internal */
|
|
236
242
|
export type Output$Outbound =
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
|
|
|
243
|
+
| Batch$Outbound
|
|
244
|
+
| FirstSeqNum$Outbound
|
|
245
|
+
| NextSeqNum$Outbound;
|
|
240
246
|
|
|
241
247
|
/** @internal */
|
|
242
248
|
export const Output$outboundSchema: z.ZodType<
|
|
@@ -244,9 +250,9 @@ export const Output$outboundSchema: z.ZodType<
|
|
|
244
250
|
z.ZodTypeDef,
|
|
245
251
|
Output
|
|
246
252
|
> = z.union([
|
|
247
|
-
z.lazy(() =>
|
|
248
|
-
z.lazy(() =>
|
|
249
|
-
z.lazy(() =>
|
|
253
|
+
z.lazy(() => Batch$outboundSchema),
|
|
254
|
+
z.lazy(() => FirstSeqNum$outboundSchema),
|
|
255
|
+
z.lazy(() => NextSeqNum$outboundSchema),
|
|
250
256
|
]);
|
|
251
257
|
|
|
252
258
|
/**
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
Output$outboundSchema,
|
|
14
14
|
} from "./output.js";
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type ErrorT = {
|
|
17
17
|
data: string;
|
|
18
18
|
event: string;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export type
|
|
21
|
+
export type ReadResponseOutput = {
|
|
22
22
|
/**
|
|
23
23
|
* Reply which can be a batch of records, or a sequence number if the request could not be satisfied.
|
|
24
24
|
*/
|
|
@@ -26,29 +26,26 @@ export type ReadResponse1 = {
|
|
|
26
26
|
event: string;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export type ReadResponse =
|
|
29
|
+
export type ReadResponse = ReadResponseOutput | ErrorT;
|
|
30
30
|
|
|
31
31
|
/** @internal */
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
data: z.string(),
|
|
38
|
-
event: z.string(),
|
|
39
|
-
});
|
|
32
|
+
export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
|
|
33
|
+
.object({
|
|
34
|
+
data: z.string(),
|
|
35
|
+
event: z.string(),
|
|
36
|
+
});
|
|
40
37
|
|
|
41
38
|
/** @internal */
|
|
42
|
-
export type
|
|
39
|
+
export type ErrorT$Outbound = {
|
|
43
40
|
data: string;
|
|
44
41
|
event: string;
|
|
45
42
|
};
|
|
46
43
|
|
|
47
44
|
/** @internal */
|
|
48
|
-
export const
|
|
49
|
-
|
|
45
|
+
export const ErrorT$outboundSchema: z.ZodType<
|
|
46
|
+
ErrorT$Outbound,
|
|
50
47
|
z.ZodTypeDef,
|
|
51
|
-
|
|
48
|
+
ErrorT
|
|
52
49
|
> = z.object({
|
|
53
50
|
data: z.string(),
|
|
54
51
|
event: z.string(),
|
|
@@ -58,32 +55,32 @@ export const ReadResponse2$outboundSchema: z.ZodType<
|
|
|
58
55
|
* @internal
|
|
59
56
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
60
57
|
*/
|
|
61
|
-
export namespace
|
|
62
|
-
/** @deprecated use `
|
|
63
|
-
export const inboundSchema =
|
|
64
|
-
/** @deprecated use `
|
|
65
|
-
export const outboundSchema =
|
|
66
|
-
/** @deprecated use `
|
|
67
|
-
export type Outbound =
|
|
58
|
+
export namespace ErrorT$ {
|
|
59
|
+
/** @deprecated use `ErrorT$inboundSchema` instead. */
|
|
60
|
+
export const inboundSchema = ErrorT$inboundSchema;
|
|
61
|
+
/** @deprecated use `ErrorT$outboundSchema` instead. */
|
|
62
|
+
export const outboundSchema = ErrorT$outboundSchema;
|
|
63
|
+
/** @deprecated use `ErrorT$Outbound` instead. */
|
|
64
|
+
export type Outbound = ErrorT$Outbound;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
export function
|
|
71
|
-
return JSON.stringify(
|
|
67
|
+
export function errorToJSON(errorT: ErrorT): string {
|
|
68
|
+
return JSON.stringify(ErrorT$outboundSchema.parse(errorT));
|
|
72
69
|
}
|
|
73
70
|
|
|
74
|
-
export function
|
|
71
|
+
export function errorFromJSON(
|
|
75
72
|
jsonString: string,
|
|
76
|
-
): SafeParseResult<
|
|
73
|
+
): SafeParseResult<ErrorT, SDKValidationError> {
|
|
77
74
|
return safeParse(
|
|
78
75
|
jsonString,
|
|
79
|
-
(x) =>
|
|
80
|
-
`Failed to parse '
|
|
76
|
+
(x) => ErrorT$inboundSchema.parse(JSON.parse(x)),
|
|
77
|
+
`Failed to parse 'ErrorT' from JSON`,
|
|
81
78
|
);
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
/** @internal */
|
|
85
|
-
export const
|
|
86
|
-
|
|
82
|
+
export const ReadResponseOutput$inboundSchema: z.ZodType<
|
|
83
|
+
ReadResponseOutput,
|
|
87
84
|
z.ZodTypeDef,
|
|
88
85
|
unknown
|
|
89
86
|
> = z.object({
|
|
@@ -102,16 +99,16 @@ export const ReadResponse1$inboundSchema: z.ZodType<
|
|
|
102
99
|
});
|
|
103
100
|
|
|
104
101
|
/** @internal */
|
|
105
|
-
export type
|
|
102
|
+
export type ReadResponseOutput$Outbound = {
|
|
106
103
|
data: Output$Outbound;
|
|
107
104
|
event: string;
|
|
108
105
|
};
|
|
109
106
|
|
|
110
107
|
/** @internal */
|
|
111
|
-
export const
|
|
112
|
-
|
|
108
|
+
export const ReadResponseOutput$outboundSchema: z.ZodType<
|
|
109
|
+
ReadResponseOutput$Outbound,
|
|
113
110
|
z.ZodTypeDef,
|
|
114
|
-
|
|
111
|
+
ReadResponseOutput
|
|
115
112
|
> = z.object({
|
|
116
113
|
data: Output$outboundSchema,
|
|
117
114
|
event: z.string(),
|
|
@@ -121,26 +118,30 @@ export const ReadResponse1$outboundSchema: z.ZodType<
|
|
|
121
118
|
* @internal
|
|
122
119
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
123
120
|
*/
|
|
124
|
-
export namespace
|
|
125
|
-
/** @deprecated use `
|
|
126
|
-
export const inboundSchema =
|
|
127
|
-
/** @deprecated use `
|
|
128
|
-
export const outboundSchema =
|
|
129
|
-
/** @deprecated use `
|
|
130
|
-
export type Outbound =
|
|
121
|
+
export namespace ReadResponseOutput$ {
|
|
122
|
+
/** @deprecated use `ReadResponseOutput$inboundSchema` instead. */
|
|
123
|
+
export const inboundSchema = ReadResponseOutput$inboundSchema;
|
|
124
|
+
/** @deprecated use `ReadResponseOutput$outboundSchema` instead. */
|
|
125
|
+
export const outboundSchema = ReadResponseOutput$outboundSchema;
|
|
126
|
+
/** @deprecated use `ReadResponseOutput$Outbound` instead. */
|
|
127
|
+
export type Outbound = ReadResponseOutput$Outbound;
|
|
131
128
|
}
|
|
132
129
|
|
|
133
|
-
export function
|
|
134
|
-
|
|
130
|
+
export function readResponseOutputToJSON(
|
|
131
|
+
readResponseOutput: ReadResponseOutput,
|
|
132
|
+
): string {
|
|
133
|
+
return JSON.stringify(
|
|
134
|
+
ReadResponseOutput$outboundSchema.parse(readResponseOutput),
|
|
135
|
+
);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
export function
|
|
138
|
+
export function readResponseOutputFromJSON(
|
|
138
139
|
jsonString: string,
|
|
139
|
-
): SafeParseResult<
|
|
140
|
+
): SafeParseResult<ReadResponseOutput, SDKValidationError> {
|
|
140
141
|
return safeParse(
|
|
141
142
|
jsonString,
|
|
142
|
-
(x) =>
|
|
143
|
-
`Failed to parse '
|
|
143
|
+
(x) => ReadResponseOutput$inboundSchema.parse(JSON.parse(x)),
|
|
144
|
+
`Failed to parse 'ReadResponseOutput' from JSON`,
|
|
144
145
|
);
|
|
145
146
|
}
|
|
146
147
|
|
|
@@ -150,14 +151,14 @@ export const ReadResponse$inboundSchema: z.ZodType<
|
|
|
150
151
|
z.ZodTypeDef,
|
|
151
152
|
unknown
|
|
152
153
|
> = z.union([
|
|
153
|
-
z.lazy(() =>
|
|
154
|
-
z.lazy(() =>
|
|
154
|
+
z.lazy(() => ReadResponseOutput$inboundSchema),
|
|
155
|
+
z.lazy(() => ErrorT$inboundSchema),
|
|
155
156
|
]);
|
|
156
157
|
|
|
157
158
|
/** @internal */
|
|
158
159
|
export type ReadResponse$Outbound =
|
|
159
|
-
|
|
|
160
|
-
|
|
|
160
|
+
| ReadResponseOutput$Outbound
|
|
161
|
+
| ErrorT$Outbound;
|
|
161
162
|
|
|
162
163
|
/** @internal */
|
|
163
164
|
export const ReadResponse$outboundSchema: z.ZodType<
|
|
@@ -165,8 +166,8 @@ export const ReadResponse$outboundSchema: z.ZodType<
|
|
|
165
166
|
z.ZodTypeDef,
|
|
166
167
|
ReadResponse
|
|
167
168
|
> = z.union([
|
|
168
|
-
z.lazy(() =>
|
|
169
|
-
z.lazy(() =>
|
|
169
|
+
z.lazy(() => ReadResponseOutput$outboundSchema),
|
|
170
|
+
z.lazy(() => ErrorT$outboundSchema),
|
|
170
171
|
]);
|
|
171
172
|
|
|
172
173
|
/**
|
|
@@ -13,7 +13,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
13
13
|
* @remarks
|
|
14
14
|
* If set to 0, the stream will have infinite retention.
|
|
15
15
|
*/
|
|
16
|
-
export type
|
|
16
|
+
export type Age = {
|
|
17
17
|
/**
|
|
18
18
|
* Age in seconds for automatic trimming of records older than this threshold.
|
|
19
19
|
*
|
|
@@ -29,21 +29,21 @@ export type One = {
|
|
|
29
29
|
* @remarks
|
|
30
30
|
* If unspecified, the default is to retain records for 7 days.
|
|
31
31
|
*/
|
|
32
|
-
export type RetentionPolicy =
|
|
32
|
+
export type RetentionPolicy = Age;
|
|
33
33
|
|
|
34
34
|
/** @internal */
|
|
35
|
-
export const
|
|
35
|
+
export const Age$inboundSchema: z.ZodType<Age, z.ZodTypeDef, unknown> = z
|
|
36
36
|
.object({
|
|
37
37
|
age: z.number().int(),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
41
|
-
export type
|
|
41
|
+
export type Age$Outbound = {
|
|
42
42
|
age: number;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/** @internal */
|
|
46
|
-
export const
|
|
46
|
+
export const Age$outboundSchema: z.ZodType<Age$Outbound, z.ZodTypeDef, Age> = z
|
|
47
47
|
.object({
|
|
48
48
|
age: z.number().int(),
|
|
49
49
|
});
|
|
@@ -52,26 +52,26 @@ export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
|
|
|
52
52
|
* @internal
|
|
53
53
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
54
54
|
*/
|
|
55
|
-
export namespace
|
|
56
|
-
/** @deprecated use `
|
|
57
|
-
export const inboundSchema =
|
|
58
|
-
/** @deprecated use `
|
|
59
|
-
export const outboundSchema =
|
|
60
|
-
/** @deprecated use `
|
|
61
|
-
export type Outbound =
|
|
55
|
+
export namespace Age$ {
|
|
56
|
+
/** @deprecated use `Age$inboundSchema` instead. */
|
|
57
|
+
export const inboundSchema = Age$inboundSchema;
|
|
58
|
+
/** @deprecated use `Age$outboundSchema` instead. */
|
|
59
|
+
export const outboundSchema = Age$outboundSchema;
|
|
60
|
+
/** @deprecated use `Age$Outbound` instead. */
|
|
61
|
+
export type Outbound = Age$Outbound;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export function
|
|
65
|
-
return JSON.stringify(
|
|
64
|
+
export function ageToJSON(age: Age): string {
|
|
65
|
+
return JSON.stringify(Age$outboundSchema.parse(age));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
export function
|
|
68
|
+
export function ageFromJSON(
|
|
69
69
|
jsonString: string,
|
|
70
|
-
): SafeParseResult<
|
|
70
|
+
): SafeParseResult<Age, SDKValidationError> {
|
|
71
71
|
return safeParse(
|
|
72
72
|
jsonString,
|
|
73
|
-
(x) =>
|
|
74
|
-
`Failed to parse '
|
|
73
|
+
(x) => Age$inboundSchema.parse(JSON.parse(x)),
|
|
74
|
+
`Failed to parse 'Age' from JSON`,
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -80,17 +80,17 @@ export const RetentionPolicy$inboundSchema: z.ZodType<
|
|
|
80
80
|
RetentionPolicy,
|
|
81
81
|
z.ZodTypeDef,
|
|
82
82
|
unknown
|
|
83
|
-
> = z.lazy(() =>
|
|
83
|
+
> = z.lazy(() => Age$inboundSchema);
|
|
84
84
|
|
|
85
85
|
/** @internal */
|
|
86
|
-
export type RetentionPolicy$Outbound =
|
|
86
|
+
export type RetentionPolicy$Outbound = Age$Outbound;
|
|
87
87
|
|
|
88
88
|
/** @internal */
|
|
89
89
|
export const RetentionPolicy$outboundSchema: z.ZodType<
|
|
90
90
|
RetentionPolicy$Outbound,
|
|
91
91
|
z.ZodTypeDef,
|
|
92
92
|
RetentionPolicy
|
|
93
|
-
> = z.lazy(() =>
|
|
93
|
+
> = z.lazy(() => Age$outboundSchema);
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* @internal
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
9
|
import * as components from "../components/index.js";
|
|
11
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -17,19 +16,13 @@ export const AppendServerList = [
|
|
|
17
16
|
"https://{basin}.b.aws.s2.dev/v1alpha",
|
|
18
17
|
] as const;
|
|
19
18
|
|
|
20
|
-
export const Header1 = {
|
|
21
|
-
Json: "json",
|
|
22
|
-
JsonBinsafe: "json-binsafe",
|
|
23
|
-
} as const;
|
|
24
|
-
export type Header1 = ClosedEnum<typeof Header1>;
|
|
25
|
-
|
|
26
19
|
/**
|
|
27
20
|
* json: utf-8 plaintext data.
|
|
28
21
|
*
|
|
29
22
|
* @remarks
|
|
30
23
|
* json-binsafe: base64 encoded binary data.
|
|
31
24
|
*/
|
|
32
|
-
export type HeaderS2Format =
|
|
25
|
+
export type HeaderS2Format = components.FormatOption;
|
|
33
26
|
|
|
34
27
|
export type AppendRequest = {
|
|
35
28
|
/**
|
|
@@ -38,7 +31,7 @@ export type AppendRequest = {
|
|
|
38
31
|
* @remarks
|
|
39
32
|
* json-binsafe: base64 encoded binary data.
|
|
40
33
|
*/
|
|
41
|
-
s2Format?:
|
|
34
|
+
s2Format?: components.FormatOption | undefined;
|
|
42
35
|
/**
|
|
43
36
|
* Name of the stream.
|
|
44
37
|
*/
|
|
@@ -46,31 +39,12 @@ export type AppendRequest = {
|
|
|
46
39
|
appendInput: components.AppendInput;
|
|
47
40
|
};
|
|
48
41
|
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const Header1$inboundSchema: z.ZodNativeEnum<typeof Header1> = z
|
|
51
|
-
.nativeEnum(Header1);
|
|
52
|
-
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const Header1$outboundSchema: z.ZodNativeEnum<typeof Header1> =
|
|
55
|
-
Header1$inboundSchema;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @internal
|
|
59
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
60
|
-
*/
|
|
61
|
-
export namespace Header1$ {
|
|
62
|
-
/** @deprecated use `Header1$inboundSchema` instead. */
|
|
63
|
-
export const inboundSchema = Header1$inboundSchema;
|
|
64
|
-
/** @deprecated use `Header1$outboundSchema` instead. */
|
|
65
|
-
export const outboundSchema = Header1$outboundSchema;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
42
|
/** @internal */
|
|
69
43
|
export const HeaderS2Format$inboundSchema: z.ZodType<
|
|
70
44
|
HeaderS2Format,
|
|
71
45
|
z.ZodTypeDef,
|
|
72
46
|
unknown
|
|
73
|
-
> =
|
|
47
|
+
> = components.FormatOption$inboundSchema;
|
|
74
48
|
|
|
75
49
|
/** @internal */
|
|
76
50
|
export type HeaderS2Format$Outbound = string;
|
|
@@ -80,7 +54,7 @@ export const HeaderS2Format$outboundSchema: z.ZodType<
|
|
|
80
54
|
HeaderS2Format$Outbound,
|
|
81
55
|
z.ZodTypeDef,
|
|
82
56
|
HeaderS2Format
|
|
83
|
-
> =
|
|
57
|
+
> = components.FormatOption$outboundSchema;
|
|
84
58
|
|
|
85
59
|
/**
|
|
86
60
|
* @internal
|
|
@@ -115,7 +89,7 @@ export const AppendRequest$inboundSchema: z.ZodType<
|
|
|
115
89
|
z.ZodTypeDef,
|
|
116
90
|
unknown
|
|
117
91
|
> = z.object({
|
|
118
|
-
"s2-format":
|
|
92
|
+
"s2-format": components.FormatOption$inboundSchema.optional(),
|
|
119
93
|
stream: z.string(),
|
|
120
94
|
AppendInput: components.AppendInput$inboundSchema,
|
|
121
95
|
}).transform((v) => {
|
|
@@ -138,7 +112,7 @@ export const AppendRequest$outboundSchema: z.ZodType<
|
|
|
138
112
|
z.ZodTypeDef,
|
|
139
113
|
AppendRequest
|
|
140
114
|
> = z.object({
|
|
141
|
-
s2Format:
|
|
115
|
+
s2Format: components.FormatOption$outboundSchema.optional(),
|
|
142
116
|
stream: z.string(),
|
|
143
117
|
appendInput: components.AppendInput$outboundSchema,
|
|
144
118
|
}).transform((v) => {
|