@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.
Files changed (44) hide show
  1. package/README.md +0 -3
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +3 -3
  4. package/lib/config.js +3 -3
  5. package/models/components/assignment.d.ts +28 -28
  6. package/models/components/assignment.d.ts.map +1 -1
  7. package/models/components/assignment.js +36 -36
  8. package/models/components/assignment.js.map +1 -1
  9. package/models/components/formatoption.d.ts +28 -0
  10. package/models/components/formatoption.d.ts.map +1 -0
  11. package/models/components/formatoption.js +60 -0
  12. package/models/components/formatoption.js.map +1 -0
  13. package/models/components/index.d.ts +1 -0
  14. package/models/components/index.d.ts.map +1 -1
  15. package/models/components/index.js +1 -0
  16. package/models/components/index.js.map +1 -1
  17. package/models/components/output.d.ts +41 -41
  18. package/models/components/output.d.ts.map +1 -1
  19. package/models/components/output.js +53 -53
  20. package/models/components/output.js.map +1 -1
  21. package/models/components/readresponse.d.ts +28 -28
  22. package/models/components/readresponse.d.ts.map +1 -1
  23. package/models/components/readresponse.js +36 -35
  24. package/models/components/readresponse.js.map +1 -1
  25. package/models/components/retentionpolicy.d.ts +17 -17
  26. package/models/components/retentionpolicy.js +18 -18
  27. package/models/operations/append.d.ts +4 -30
  28. package/models/operations/append.d.ts.map +1 -1
  29. package/models/operations/append.js +5 -25
  30. package/models/operations/append.js.map +1 -1
  31. package/models/operations/read.d.ts +4 -30
  32. package/models/operations/read.d.ts.map +1 -1
  33. package/models/operations/read.js +5 -24
  34. package/models/operations/read.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/lib/config.ts +3 -3
  37. package/src/models/components/assignment.ts +46 -49
  38. package/src/models/components/formatoption.ts +31 -0
  39. package/src/models/components/index.ts +1 -0
  40. package/src/models/components/output.ts +86 -80
  41. package/src/models/components/readresponse.ts +54 -53
  42. package/src/models/components/retentionpolicy.ts +21 -21
  43. package/src/models/operations/append.ts +6 -32
  44. 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 Three = {
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 Output2 = {
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 Output1 = {
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 = Output1 | Output2 | Three;
68
+ export type Output = Batch | FirstSeqNum | NextSeqNum;
69
69
 
70
70
  /** @internal */
71
- export const Three$inboundSchema: z.ZodType<Three, z.ZodTypeDef, unknown> = z
72
- .object({
73
- next_seq_num: z.number().int(),
74
- }).transform((v) => {
75
- return remap$(v, {
76
- "next_seq_num": "nextSeqNum",
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 Three$Outbound = {
84
+ export type NextSeqNum$Outbound = {
82
85
  next_seq_num: number;
83
86
  };
84
87
 
85
88
  /** @internal */
86
- export const Three$outboundSchema: z.ZodType<
87
- Three$Outbound,
89
+ export const NextSeqNum$outboundSchema: z.ZodType<
90
+ NextSeqNum$Outbound,
88
91
  z.ZodTypeDef,
89
- Three
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 Three$ {
103
- /** @deprecated use `Three$inboundSchema` instead. */
104
- export const inboundSchema = Three$inboundSchema;
105
- /** @deprecated use `Three$outboundSchema` instead. */
106
- export const outboundSchema = Three$outboundSchema;
107
- /** @deprecated use `Three$Outbound` instead. */
108
- export type Outbound = Three$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 threeToJSON(three: Three): string {
112
- return JSON.stringify(Three$outboundSchema.parse(three));
114
+ export function nextSeqNumToJSON(nextSeqNum: NextSeqNum): string {
115
+ return JSON.stringify(NextSeqNum$outboundSchema.parse(nextSeqNum));
113
116
  }
114
117
 
115
- export function threeFromJSON(
118
+ export function nextSeqNumFromJSON(
116
119
  jsonString: string,
117
- ): SafeParseResult<Three, SDKValidationError> {
120
+ ): SafeParseResult<NextSeqNum, SDKValidationError> {
118
121
  return safeParse(
119
122
  jsonString,
120
- (x) => Three$inboundSchema.parse(JSON.parse(x)),
121
- `Failed to parse 'Three' from JSON`,
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 Output2$inboundSchema: z.ZodType<Output2, z.ZodTypeDef, unknown> =
127
- z.object({
128
- first_seq_num: z.number().int(),
129
- }).transform((v) => {
130
- return remap$(v, {
131
- "first_seq_num": "firstSeqNum",
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 Output2$Outbound = {
142
+ export type FirstSeqNum$Outbound = {
137
143
  first_seq_num: number;
138
144
  };
139
145
 
140
146
  /** @internal */
141
- export const Output2$outboundSchema: z.ZodType<
142
- Output2$Outbound,
147
+ export const FirstSeqNum$outboundSchema: z.ZodType<
148
+ FirstSeqNum$Outbound,
143
149
  z.ZodTypeDef,
144
- Output2
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 Output2$ {
158
- /** @deprecated use `Output2$inboundSchema` instead. */
159
- export const inboundSchema = Output2$inboundSchema;
160
- /** @deprecated use `Output2$outboundSchema` instead. */
161
- export const outboundSchema = Output2$outboundSchema;
162
- /** @deprecated use `Output2$Outbound` instead. */
163
- export type Outbound = Output2$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 output2ToJSON(output2: Output2): string {
167
- return JSON.stringify(Output2$outboundSchema.parse(output2));
172
+ export function firstSeqNumToJSON(firstSeqNum: FirstSeqNum): string {
173
+ return JSON.stringify(FirstSeqNum$outboundSchema.parse(firstSeqNum));
168
174
  }
169
175
 
170
- export function output2FromJSON(
176
+ export function firstSeqNumFromJSON(
171
177
  jsonString: string,
172
- ): SafeParseResult<Output2, SDKValidationError> {
178
+ ): SafeParseResult<FirstSeqNum, SDKValidationError> {
173
179
  return safeParse(
174
180
  jsonString,
175
- (x) => Output2$inboundSchema.parse(JSON.parse(x)),
176
- `Failed to parse 'Output2' from JSON`,
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 Output1$inboundSchema: z.ZodType<Output1, z.ZodTypeDef, unknown> =
182
- z.object({
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 Output1$Outbound = {
193
+ export type Batch$Outbound = {
188
194
  batch: SequencedRecordBatch$Outbound;
189
195
  };
190
196
 
191
197
  /** @internal */
192
- export const Output1$outboundSchema: z.ZodType<
193
- Output1$Outbound,
198
+ export const Batch$outboundSchema: z.ZodType<
199
+ Batch$Outbound,
194
200
  z.ZodTypeDef,
195
- Output1
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 Output1$ {
205
- /** @deprecated use `Output1$inboundSchema` instead. */
206
- export const inboundSchema = Output1$inboundSchema;
207
- /** @deprecated use `Output1$outboundSchema` instead. */
208
- export const outboundSchema = Output1$outboundSchema;
209
- /** @deprecated use `Output1$Outbound` instead. */
210
- export type Outbound = Output1$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 output1ToJSON(output1: Output1): string {
214
- return JSON.stringify(Output1$outboundSchema.parse(output1));
219
+ export function batchToJSON(batch: Batch): string {
220
+ return JSON.stringify(Batch$outboundSchema.parse(batch));
215
221
  }
216
222
 
217
- export function output1FromJSON(
223
+ export function batchFromJSON(
218
224
  jsonString: string,
219
- ): SafeParseResult<Output1, SDKValidationError> {
225
+ ): SafeParseResult<Batch, SDKValidationError> {
220
226
  return safeParse(
221
227
  jsonString,
222
- (x) => Output1$inboundSchema.parse(JSON.parse(x)),
223
- `Failed to parse 'Output1' from JSON`,
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(() => Output1$inboundSchema),
231
- z.lazy(() => Output2$inboundSchema),
232
- z.lazy(() => Three$inboundSchema),
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
- | Output1$Outbound
238
- | Output2$Outbound
239
- | Three$Outbound;
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(() => Output1$outboundSchema),
248
- z.lazy(() => Output2$outboundSchema),
249
- z.lazy(() => Three$outboundSchema),
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 ReadResponse2 = {
16
+ export type ErrorT = {
17
17
  data: string;
18
18
  event: string;
19
19
  };
20
20
 
21
- export type ReadResponse1 = {
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 = ReadResponse1 | ReadResponse2;
29
+ export type ReadResponse = ReadResponseOutput | ErrorT;
30
30
 
31
31
  /** @internal */
32
- export const ReadResponse2$inboundSchema: z.ZodType<
33
- ReadResponse2,
34
- z.ZodTypeDef,
35
- unknown
36
- > = z.object({
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 ReadResponse2$Outbound = {
39
+ export type ErrorT$Outbound = {
43
40
  data: string;
44
41
  event: string;
45
42
  };
46
43
 
47
44
  /** @internal */
48
- export const ReadResponse2$outboundSchema: z.ZodType<
49
- ReadResponse2$Outbound,
45
+ export const ErrorT$outboundSchema: z.ZodType<
46
+ ErrorT$Outbound,
50
47
  z.ZodTypeDef,
51
- ReadResponse2
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 ReadResponse2$ {
62
- /** @deprecated use `ReadResponse2$inboundSchema` instead. */
63
- export const inboundSchema = ReadResponse2$inboundSchema;
64
- /** @deprecated use `ReadResponse2$outboundSchema` instead. */
65
- export const outboundSchema = ReadResponse2$outboundSchema;
66
- /** @deprecated use `ReadResponse2$Outbound` instead. */
67
- export type Outbound = ReadResponse2$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 readResponse2ToJSON(readResponse2: ReadResponse2): string {
71
- return JSON.stringify(ReadResponse2$outboundSchema.parse(readResponse2));
67
+ export function errorToJSON(errorT: ErrorT): string {
68
+ return JSON.stringify(ErrorT$outboundSchema.parse(errorT));
72
69
  }
73
70
 
74
- export function readResponse2FromJSON(
71
+ export function errorFromJSON(
75
72
  jsonString: string,
76
- ): SafeParseResult<ReadResponse2, SDKValidationError> {
73
+ ): SafeParseResult<ErrorT, SDKValidationError> {
77
74
  return safeParse(
78
75
  jsonString,
79
- (x) => ReadResponse2$inboundSchema.parse(JSON.parse(x)),
80
- `Failed to parse 'ReadResponse2' from JSON`,
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 ReadResponse1$inboundSchema: z.ZodType<
86
- ReadResponse1,
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 ReadResponse1$Outbound = {
102
+ export type ReadResponseOutput$Outbound = {
106
103
  data: Output$Outbound;
107
104
  event: string;
108
105
  };
109
106
 
110
107
  /** @internal */
111
- export const ReadResponse1$outboundSchema: z.ZodType<
112
- ReadResponse1$Outbound,
108
+ export const ReadResponseOutput$outboundSchema: z.ZodType<
109
+ ReadResponseOutput$Outbound,
113
110
  z.ZodTypeDef,
114
- ReadResponse1
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 ReadResponse1$ {
125
- /** @deprecated use `ReadResponse1$inboundSchema` instead. */
126
- export const inboundSchema = ReadResponse1$inboundSchema;
127
- /** @deprecated use `ReadResponse1$outboundSchema` instead. */
128
- export const outboundSchema = ReadResponse1$outboundSchema;
129
- /** @deprecated use `ReadResponse1$Outbound` instead. */
130
- export type Outbound = ReadResponse1$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 readResponse1ToJSON(readResponse1: ReadResponse1): string {
134
- return JSON.stringify(ReadResponse1$outboundSchema.parse(readResponse1));
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 readResponse1FromJSON(
138
+ export function readResponseOutputFromJSON(
138
139
  jsonString: string,
139
- ): SafeParseResult<ReadResponse1, SDKValidationError> {
140
+ ): SafeParseResult<ReadResponseOutput, SDKValidationError> {
140
141
  return safeParse(
141
142
  jsonString,
142
- (x) => ReadResponse1$inboundSchema.parse(JSON.parse(x)),
143
- `Failed to parse 'ReadResponse1' from JSON`,
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(() => ReadResponse1$inboundSchema),
154
- z.lazy(() => ReadResponse2$inboundSchema),
154
+ z.lazy(() => ReadResponseOutput$inboundSchema),
155
+ z.lazy(() => ErrorT$inboundSchema),
155
156
  ]);
156
157
 
157
158
  /** @internal */
158
159
  export type ReadResponse$Outbound =
159
- | ReadResponse1$Outbound
160
- | ReadResponse2$Outbound;
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(() => ReadResponse1$outboundSchema),
169
- z.lazy(() => ReadResponse2$outboundSchema),
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 One = {
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 = One;
32
+ export type RetentionPolicy = Age;
33
33
 
34
34
  /** @internal */
35
- export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
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 One$Outbound = {
41
+ export type Age$Outbound = {
42
42
  age: number;
43
43
  };
44
44
 
45
45
  /** @internal */
46
- export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
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 One$ {
56
- /** @deprecated use `One$inboundSchema` instead. */
57
- export const inboundSchema = One$inboundSchema;
58
- /** @deprecated use `One$outboundSchema` instead. */
59
- export const outboundSchema = One$outboundSchema;
60
- /** @deprecated use `One$Outbound` instead. */
61
- export type Outbound = One$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 oneToJSON(one: One): string {
65
- return JSON.stringify(One$outboundSchema.parse(one));
64
+ export function ageToJSON(age: Age): string {
65
+ return JSON.stringify(Age$outboundSchema.parse(age));
66
66
  }
67
67
 
68
- export function oneFromJSON(
68
+ export function ageFromJSON(
69
69
  jsonString: string,
70
- ): SafeParseResult<One, SDKValidationError> {
70
+ ): SafeParseResult<Age, SDKValidationError> {
71
71
  return safeParse(
72
72
  jsonString,
73
- (x) => One$inboundSchema.parse(JSON.parse(x)),
74
- `Failed to parse 'One' from JSON`,
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(() => One$inboundSchema);
83
+ > = z.lazy(() => Age$inboundSchema);
84
84
 
85
85
  /** @internal */
86
- export type RetentionPolicy$Outbound = One$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(() => One$outboundSchema);
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 = Header1;
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?: Header1 | undefined;
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
- > = Header1$inboundSchema;
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
- > = Header1$outboundSchema;
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": Header1$inboundSchema.optional(),
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: Header1$outboundSchema.optional(),
115
+ s2Format: components.FormatOption$outboundSchema.optional(),
142
116
  stream: z.string(),
143
117
  appendInput: components.AppendInput$outboundSchema,
144
118
  }).transform((v) => {