@s2-dev/streamstore 0.2.6 → 0.2.7
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/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/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/assignment.ts +46 -49
- package/src/models/components/output.ts +86 -80
- package/src/models/components/readresponse.ts +54 -53
- package/src/models/components/retentionpolicy.ts +21 -21
|
@@ -10,7 +10,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Explicit cell assignment, if it is owned by the account.
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type Cell = {
|
|
14
14
|
/**
|
|
15
15
|
* Explicit cell assignment, if it is owned by the account.
|
|
16
16
|
*/
|
|
@@ -20,7 +20,7 @@ export type Two = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Basin scope. It should be formatted as "{cloud}:{region}", e.g. "aws:us-east-1".
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type Scope = {
|
|
24
24
|
/**
|
|
25
25
|
* Basin scope. It should be formatted as "{cloud}:{region}", e.g. "aws:us-east-1".
|
|
26
26
|
*/
|
|
@@ -30,22 +30,22 @@ export type Assignment1 = {
|
|
|
30
30
|
/**
|
|
31
31
|
* Assignment of the basin to a cloud and region, or an explicit cell.
|
|
32
32
|
*/
|
|
33
|
-
export type Assignment =
|
|
33
|
+
export type Assignment = Scope | Cell;
|
|
34
34
|
|
|
35
35
|
/** @internal */
|
|
36
|
-
export const
|
|
36
|
+
export const Cell$inboundSchema: z.ZodType<Cell, z.ZodTypeDef, unknown> = z
|
|
37
37
|
.object({
|
|
38
38
|
cell: z.string(),
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
/** @internal */
|
|
42
|
-
export type
|
|
42
|
+
export type Cell$Outbound = {
|
|
43
43
|
cell: string;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
/** @internal */
|
|
47
|
-
export const
|
|
48
|
-
.object({
|
|
47
|
+
export const Cell$outboundSchema: z.ZodType<Cell$Outbound, z.ZodTypeDef, Cell> =
|
|
48
|
+
z.object({
|
|
49
49
|
cell: z.string(),
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -53,48 +53,45 @@ export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
|
|
|
53
53
|
* @internal
|
|
54
54
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
55
|
*/
|
|
56
|
-
export namespace
|
|
57
|
-
/** @deprecated use `
|
|
58
|
-
export const inboundSchema =
|
|
59
|
-
/** @deprecated use `
|
|
60
|
-
export const outboundSchema =
|
|
61
|
-
/** @deprecated use `
|
|
62
|
-
export type Outbound =
|
|
56
|
+
export namespace Cell$ {
|
|
57
|
+
/** @deprecated use `Cell$inboundSchema` instead. */
|
|
58
|
+
export const inboundSchema = Cell$inboundSchema;
|
|
59
|
+
/** @deprecated use `Cell$outboundSchema` instead. */
|
|
60
|
+
export const outboundSchema = Cell$outboundSchema;
|
|
61
|
+
/** @deprecated use `Cell$Outbound` instead. */
|
|
62
|
+
export type Outbound = Cell$Outbound;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
export function
|
|
66
|
-
return JSON.stringify(
|
|
65
|
+
export function cellToJSON(cell: Cell): string {
|
|
66
|
+
return JSON.stringify(Cell$outboundSchema.parse(cell));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export function
|
|
69
|
+
export function cellFromJSON(
|
|
70
70
|
jsonString: string,
|
|
71
|
-
): SafeParseResult<
|
|
71
|
+
): SafeParseResult<Cell, SDKValidationError> {
|
|
72
72
|
return safeParse(
|
|
73
73
|
jsonString,
|
|
74
|
-
(x) =>
|
|
75
|
-
`Failed to parse '
|
|
74
|
+
(x) => Cell$inboundSchema.parse(JSON.parse(x)),
|
|
75
|
+
`Failed to parse 'Cell' from JSON`,
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/** @internal */
|
|
80
|
-
export const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
> = z.object({
|
|
85
|
-
scope: z.string(),
|
|
86
|
-
});
|
|
80
|
+
export const Scope$inboundSchema: z.ZodType<Scope, z.ZodTypeDef, unknown> = z
|
|
81
|
+
.object({
|
|
82
|
+
scope: z.string(),
|
|
83
|
+
});
|
|
87
84
|
|
|
88
85
|
/** @internal */
|
|
89
|
-
export type
|
|
86
|
+
export type Scope$Outbound = {
|
|
90
87
|
scope: string;
|
|
91
88
|
};
|
|
92
89
|
|
|
93
90
|
/** @internal */
|
|
94
|
-
export const
|
|
95
|
-
|
|
91
|
+
export const Scope$outboundSchema: z.ZodType<
|
|
92
|
+
Scope$Outbound,
|
|
96
93
|
z.ZodTypeDef,
|
|
97
|
-
|
|
94
|
+
Scope
|
|
98
95
|
> = z.object({
|
|
99
96
|
scope: z.string(),
|
|
100
97
|
});
|
|
@@ -103,26 +100,26 @@ export const Assignment1$outboundSchema: z.ZodType<
|
|
|
103
100
|
* @internal
|
|
104
101
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
105
102
|
*/
|
|
106
|
-
export namespace
|
|
107
|
-
/** @deprecated use `
|
|
108
|
-
export const inboundSchema =
|
|
109
|
-
/** @deprecated use `
|
|
110
|
-
export const outboundSchema =
|
|
111
|
-
/** @deprecated use `
|
|
112
|
-
export type Outbound =
|
|
103
|
+
export namespace Scope$ {
|
|
104
|
+
/** @deprecated use `Scope$inboundSchema` instead. */
|
|
105
|
+
export const inboundSchema = Scope$inboundSchema;
|
|
106
|
+
/** @deprecated use `Scope$outboundSchema` instead. */
|
|
107
|
+
export const outboundSchema = Scope$outboundSchema;
|
|
108
|
+
/** @deprecated use `Scope$Outbound` instead. */
|
|
109
|
+
export type Outbound = Scope$Outbound;
|
|
113
110
|
}
|
|
114
111
|
|
|
115
|
-
export function
|
|
116
|
-
return JSON.stringify(
|
|
112
|
+
export function scopeToJSON(scope: Scope): string {
|
|
113
|
+
return JSON.stringify(Scope$outboundSchema.parse(scope));
|
|
117
114
|
}
|
|
118
115
|
|
|
119
|
-
export function
|
|
116
|
+
export function scopeFromJSON(
|
|
120
117
|
jsonString: string,
|
|
121
|
-
): SafeParseResult<
|
|
118
|
+
): SafeParseResult<Scope, SDKValidationError> {
|
|
122
119
|
return safeParse(
|
|
123
120
|
jsonString,
|
|
124
|
-
(x) =>
|
|
125
|
-
`Failed to parse '
|
|
121
|
+
(x) => Scope$inboundSchema.parse(JSON.parse(x)),
|
|
122
|
+
`Failed to parse 'Scope' from JSON`,
|
|
126
123
|
);
|
|
127
124
|
}
|
|
128
125
|
|
|
@@ -132,12 +129,12 @@ export const Assignment$inboundSchema: z.ZodType<
|
|
|
132
129
|
z.ZodTypeDef,
|
|
133
130
|
unknown
|
|
134
131
|
> = z.union([
|
|
135
|
-
z.lazy(() =>
|
|
136
|
-
z.lazy(() =>
|
|
132
|
+
z.lazy(() => Scope$inboundSchema),
|
|
133
|
+
z.lazy(() => Cell$inboundSchema),
|
|
137
134
|
]);
|
|
138
135
|
|
|
139
136
|
/** @internal */
|
|
140
|
-
export type Assignment$Outbound =
|
|
137
|
+
export type Assignment$Outbound = Scope$Outbound | Cell$Outbound;
|
|
141
138
|
|
|
142
139
|
/** @internal */
|
|
143
140
|
export const Assignment$outboundSchema: z.ZodType<
|
|
@@ -145,8 +142,8 @@ export const Assignment$outboundSchema: z.ZodType<
|
|
|
145
142
|
z.ZodTypeDef,
|
|
146
143
|
Assignment
|
|
147
144
|
> = z.union([
|
|
148
|
-
z.lazy(() =>
|
|
149
|
-
z.lazy(() =>
|
|
145
|
+
z.lazy(() => Scope$outboundSchema),
|
|
146
|
+
z.lazy(() => Cell$outboundSchema),
|
|
150
147
|
]);
|
|
151
148
|
|
|
152
149
|
/**
|
|
@@ -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
|
/**
|