@moovio/sdk 0.5.1 → 0.5.2

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.
@@ -4,50 +4,386 @@
4
4
 
5
5
  import * as z from "zod";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
- import {
10
- SweepConfigStatus,
11
- SweepConfigStatus$inboundSchema,
12
- SweepConfigStatus$outboundSchema,
13
- } from "./sweepconfigstatus.js";
10
+
11
+ export const Status = {
12
+ Enabled: "enabled",
13
+ Disabled: "disabled",
14
+ } as const;
15
+ export type Status = ClosedEnum<typeof Status>;
16
+
17
+ export type PushPaymentMethodId2 = {};
18
+
19
+ export type PushPaymentMethodID = PushPaymentMethodId2 | string;
20
+
21
+ export type PullPaymentMethodId2 = {};
22
+
23
+ export type PullPaymentMethodID = PullPaymentMethodId2 | string;
24
+
25
+ export type StatementDescriptor2 = {};
26
+
27
+ export type StatementDescriptor = StatementDescriptor2 | string;
14
28
 
15
29
  export type PatchSweepConfig = {
16
- status?: SweepConfigStatus | undefined;
17
- /**
18
- * ID of the payment method.
19
- */
20
- pushPaymentMethodID?: string | undefined;
21
- /**
22
- * ID of the payment method.
23
- */
24
- pullPaymentMethodID?: string | undefined;
25
- /**
26
- * The text that appears on the banking statement. The default descriptor is a 10 character ID if an override is not set in the sweep configs statementDescriptor.
27
- */
28
- statementDescriptor?: string | undefined;
30
+ status?: Status | null | undefined;
31
+ pushPaymentMethodID?: PushPaymentMethodId2 | string | null | undefined;
32
+ pullPaymentMethodID?: PullPaymentMethodId2 | string | null | undefined;
33
+ statementDescriptor?: StatementDescriptor2 | string | null | undefined;
29
34
  minimumBalance?: string | undefined;
30
35
  };
31
36
 
37
+ /** @internal */
38
+ export const Status$inboundSchema: z.ZodNativeEnum<typeof Status> = z
39
+ .nativeEnum(Status);
40
+
41
+ /** @internal */
42
+ export const Status$outboundSchema: z.ZodNativeEnum<typeof Status> =
43
+ Status$inboundSchema;
44
+
45
+ /**
46
+ * @internal
47
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
48
+ */
49
+ export namespace Status$ {
50
+ /** @deprecated use `Status$inboundSchema` instead. */
51
+ export const inboundSchema = Status$inboundSchema;
52
+ /** @deprecated use `Status$outboundSchema` instead. */
53
+ export const outboundSchema = Status$outboundSchema;
54
+ }
55
+
56
+ /** @internal */
57
+ export const PushPaymentMethodId2$inboundSchema: z.ZodType<
58
+ PushPaymentMethodId2,
59
+ z.ZodTypeDef,
60
+ unknown
61
+ > = z.object({});
62
+
63
+ /** @internal */
64
+ export type PushPaymentMethodId2$Outbound = {};
65
+
66
+ /** @internal */
67
+ export const PushPaymentMethodId2$outboundSchema: z.ZodType<
68
+ PushPaymentMethodId2$Outbound,
69
+ z.ZodTypeDef,
70
+ PushPaymentMethodId2
71
+ > = z.object({});
72
+
73
+ /**
74
+ * @internal
75
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
76
+ */
77
+ export namespace PushPaymentMethodId2$ {
78
+ /** @deprecated use `PushPaymentMethodId2$inboundSchema` instead. */
79
+ export const inboundSchema = PushPaymentMethodId2$inboundSchema;
80
+ /** @deprecated use `PushPaymentMethodId2$outboundSchema` instead. */
81
+ export const outboundSchema = PushPaymentMethodId2$outboundSchema;
82
+ /** @deprecated use `PushPaymentMethodId2$Outbound` instead. */
83
+ export type Outbound = PushPaymentMethodId2$Outbound;
84
+ }
85
+
86
+ export function pushPaymentMethodID2ToJSON(
87
+ pushPaymentMethodId2: PushPaymentMethodId2,
88
+ ): string {
89
+ return JSON.stringify(
90
+ PushPaymentMethodId2$outboundSchema.parse(pushPaymentMethodId2),
91
+ );
92
+ }
93
+
94
+ export function pushPaymentMethodID2FromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<PushPaymentMethodId2, SDKValidationError> {
97
+ return safeParse(
98
+ jsonString,
99
+ (x) => PushPaymentMethodId2$inboundSchema.parse(JSON.parse(x)),
100
+ `Failed to parse 'PushPaymentMethodId2' from JSON`,
101
+ );
102
+ }
103
+
104
+ /** @internal */
105
+ export const PushPaymentMethodID$inboundSchema: z.ZodType<
106
+ PushPaymentMethodID,
107
+ z.ZodTypeDef,
108
+ unknown
109
+ > = z.union([z.lazy(() => PushPaymentMethodId2$inboundSchema), z.string()]);
110
+
111
+ /** @internal */
112
+ export type PushPaymentMethodID$Outbound =
113
+ | PushPaymentMethodId2$Outbound
114
+ | string;
115
+
116
+ /** @internal */
117
+ export const PushPaymentMethodID$outboundSchema: z.ZodType<
118
+ PushPaymentMethodID$Outbound,
119
+ z.ZodTypeDef,
120
+ PushPaymentMethodID
121
+ > = z.union([z.lazy(() => PushPaymentMethodId2$outboundSchema), z.string()]);
122
+
123
+ /**
124
+ * @internal
125
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
126
+ */
127
+ export namespace PushPaymentMethodID$ {
128
+ /** @deprecated use `PushPaymentMethodID$inboundSchema` instead. */
129
+ export const inboundSchema = PushPaymentMethodID$inboundSchema;
130
+ /** @deprecated use `PushPaymentMethodID$outboundSchema` instead. */
131
+ export const outboundSchema = PushPaymentMethodID$outboundSchema;
132
+ /** @deprecated use `PushPaymentMethodID$Outbound` instead. */
133
+ export type Outbound = PushPaymentMethodID$Outbound;
134
+ }
135
+
136
+ export function pushPaymentMethodIDToJSON(
137
+ pushPaymentMethodID: PushPaymentMethodID,
138
+ ): string {
139
+ return JSON.stringify(
140
+ PushPaymentMethodID$outboundSchema.parse(pushPaymentMethodID),
141
+ );
142
+ }
143
+
144
+ export function pushPaymentMethodIDFromJSON(
145
+ jsonString: string,
146
+ ): SafeParseResult<PushPaymentMethodID, SDKValidationError> {
147
+ return safeParse(
148
+ jsonString,
149
+ (x) => PushPaymentMethodID$inboundSchema.parse(JSON.parse(x)),
150
+ `Failed to parse 'PushPaymentMethodID' from JSON`,
151
+ );
152
+ }
153
+
154
+ /** @internal */
155
+ export const PullPaymentMethodId2$inboundSchema: z.ZodType<
156
+ PullPaymentMethodId2,
157
+ z.ZodTypeDef,
158
+ unknown
159
+ > = z.object({});
160
+
161
+ /** @internal */
162
+ export type PullPaymentMethodId2$Outbound = {};
163
+
164
+ /** @internal */
165
+ export const PullPaymentMethodId2$outboundSchema: z.ZodType<
166
+ PullPaymentMethodId2$Outbound,
167
+ z.ZodTypeDef,
168
+ PullPaymentMethodId2
169
+ > = z.object({});
170
+
171
+ /**
172
+ * @internal
173
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
174
+ */
175
+ export namespace PullPaymentMethodId2$ {
176
+ /** @deprecated use `PullPaymentMethodId2$inboundSchema` instead. */
177
+ export const inboundSchema = PullPaymentMethodId2$inboundSchema;
178
+ /** @deprecated use `PullPaymentMethodId2$outboundSchema` instead. */
179
+ export const outboundSchema = PullPaymentMethodId2$outboundSchema;
180
+ /** @deprecated use `PullPaymentMethodId2$Outbound` instead. */
181
+ export type Outbound = PullPaymentMethodId2$Outbound;
182
+ }
183
+
184
+ export function pullPaymentMethodID2ToJSON(
185
+ pullPaymentMethodId2: PullPaymentMethodId2,
186
+ ): string {
187
+ return JSON.stringify(
188
+ PullPaymentMethodId2$outboundSchema.parse(pullPaymentMethodId2),
189
+ );
190
+ }
191
+
192
+ export function pullPaymentMethodID2FromJSON(
193
+ jsonString: string,
194
+ ): SafeParseResult<PullPaymentMethodId2, SDKValidationError> {
195
+ return safeParse(
196
+ jsonString,
197
+ (x) => PullPaymentMethodId2$inboundSchema.parse(JSON.parse(x)),
198
+ `Failed to parse 'PullPaymentMethodId2' from JSON`,
199
+ );
200
+ }
201
+
202
+ /** @internal */
203
+ export const PullPaymentMethodID$inboundSchema: z.ZodType<
204
+ PullPaymentMethodID,
205
+ z.ZodTypeDef,
206
+ unknown
207
+ > = z.union([z.lazy(() => PullPaymentMethodId2$inboundSchema), z.string()]);
208
+
209
+ /** @internal */
210
+ export type PullPaymentMethodID$Outbound =
211
+ | PullPaymentMethodId2$Outbound
212
+ | string;
213
+
214
+ /** @internal */
215
+ export const PullPaymentMethodID$outboundSchema: z.ZodType<
216
+ PullPaymentMethodID$Outbound,
217
+ z.ZodTypeDef,
218
+ PullPaymentMethodID
219
+ > = z.union([z.lazy(() => PullPaymentMethodId2$outboundSchema), z.string()]);
220
+
221
+ /**
222
+ * @internal
223
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
224
+ */
225
+ export namespace PullPaymentMethodID$ {
226
+ /** @deprecated use `PullPaymentMethodID$inboundSchema` instead. */
227
+ export const inboundSchema = PullPaymentMethodID$inboundSchema;
228
+ /** @deprecated use `PullPaymentMethodID$outboundSchema` instead. */
229
+ export const outboundSchema = PullPaymentMethodID$outboundSchema;
230
+ /** @deprecated use `PullPaymentMethodID$Outbound` instead. */
231
+ export type Outbound = PullPaymentMethodID$Outbound;
232
+ }
233
+
234
+ export function pullPaymentMethodIDToJSON(
235
+ pullPaymentMethodID: PullPaymentMethodID,
236
+ ): string {
237
+ return JSON.stringify(
238
+ PullPaymentMethodID$outboundSchema.parse(pullPaymentMethodID),
239
+ );
240
+ }
241
+
242
+ export function pullPaymentMethodIDFromJSON(
243
+ jsonString: string,
244
+ ): SafeParseResult<PullPaymentMethodID, SDKValidationError> {
245
+ return safeParse(
246
+ jsonString,
247
+ (x) => PullPaymentMethodID$inboundSchema.parse(JSON.parse(x)),
248
+ `Failed to parse 'PullPaymentMethodID' from JSON`,
249
+ );
250
+ }
251
+
252
+ /** @internal */
253
+ export const StatementDescriptor2$inboundSchema: z.ZodType<
254
+ StatementDescriptor2,
255
+ z.ZodTypeDef,
256
+ unknown
257
+ > = z.object({});
258
+
259
+ /** @internal */
260
+ export type StatementDescriptor2$Outbound = {};
261
+
262
+ /** @internal */
263
+ export const StatementDescriptor2$outboundSchema: z.ZodType<
264
+ StatementDescriptor2$Outbound,
265
+ z.ZodTypeDef,
266
+ StatementDescriptor2
267
+ > = z.object({});
268
+
269
+ /**
270
+ * @internal
271
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
272
+ */
273
+ export namespace StatementDescriptor2$ {
274
+ /** @deprecated use `StatementDescriptor2$inboundSchema` instead. */
275
+ export const inboundSchema = StatementDescriptor2$inboundSchema;
276
+ /** @deprecated use `StatementDescriptor2$outboundSchema` instead. */
277
+ export const outboundSchema = StatementDescriptor2$outboundSchema;
278
+ /** @deprecated use `StatementDescriptor2$Outbound` instead. */
279
+ export type Outbound = StatementDescriptor2$Outbound;
280
+ }
281
+
282
+ export function statementDescriptor2ToJSON(
283
+ statementDescriptor2: StatementDescriptor2,
284
+ ): string {
285
+ return JSON.stringify(
286
+ StatementDescriptor2$outboundSchema.parse(statementDescriptor2),
287
+ );
288
+ }
289
+
290
+ export function statementDescriptor2FromJSON(
291
+ jsonString: string,
292
+ ): SafeParseResult<StatementDescriptor2, SDKValidationError> {
293
+ return safeParse(
294
+ jsonString,
295
+ (x) => StatementDescriptor2$inboundSchema.parse(JSON.parse(x)),
296
+ `Failed to parse 'StatementDescriptor2' from JSON`,
297
+ );
298
+ }
299
+
300
+ /** @internal */
301
+ export const StatementDescriptor$inboundSchema: z.ZodType<
302
+ StatementDescriptor,
303
+ z.ZodTypeDef,
304
+ unknown
305
+ > = z.union([z.lazy(() => StatementDescriptor2$inboundSchema), z.string()]);
306
+
307
+ /** @internal */
308
+ export type StatementDescriptor$Outbound =
309
+ | StatementDescriptor2$Outbound
310
+ | string;
311
+
312
+ /** @internal */
313
+ export const StatementDescriptor$outboundSchema: z.ZodType<
314
+ StatementDescriptor$Outbound,
315
+ z.ZodTypeDef,
316
+ StatementDescriptor
317
+ > = z.union([z.lazy(() => StatementDescriptor2$outboundSchema), z.string()]);
318
+
319
+ /**
320
+ * @internal
321
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
322
+ */
323
+ export namespace StatementDescriptor$ {
324
+ /** @deprecated use `StatementDescriptor$inboundSchema` instead. */
325
+ export const inboundSchema = StatementDescriptor$inboundSchema;
326
+ /** @deprecated use `StatementDescriptor$outboundSchema` instead. */
327
+ export const outboundSchema = StatementDescriptor$outboundSchema;
328
+ /** @deprecated use `StatementDescriptor$Outbound` instead. */
329
+ export type Outbound = StatementDescriptor$Outbound;
330
+ }
331
+
332
+ export function statementDescriptorToJSON(
333
+ statementDescriptor: StatementDescriptor,
334
+ ): string {
335
+ return JSON.stringify(
336
+ StatementDescriptor$outboundSchema.parse(statementDescriptor),
337
+ );
338
+ }
339
+
340
+ export function statementDescriptorFromJSON(
341
+ jsonString: string,
342
+ ): SafeParseResult<StatementDescriptor, SDKValidationError> {
343
+ return safeParse(
344
+ jsonString,
345
+ (x) => StatementDescriptor$inboundSchema.parse(JSON.parse(x)),
346
+ `Failed to parse 'StatementDescriptor' from JSON`,
347
+ );
348
+ }
349
+
32
350
  /** @internal */
33
351
  export const PatchSweepConfig$inboundSchema: z.ZodType<
34
352
  PatchSweepConfig,
35
353
  z.ZodTypeDef,
36
354
  unknown
37
355
  > = z.object({
38
- status: SweepConfigStatus$inboundSchema.optional(),
39
- pushPaymentMethodID: z.string().optional(),
40
- pullPaymentMethodID: z.string().optional(),
41
- statementDescriptor: z.string().optional(),
356
+ status: z.nullable(Status$inboundSchema).optional(),
357
+ pushPaymentMethodID: z.nullable(
358
+ z.union([z.lazy(() => PushPaymentMethodId2$inboundSchema), z.string()]),
359
+ ).optional(),
360
+ pullPaymentMethodID: z.nullable(
361
+ z.union([z.lazy(() => PullPaymentMethodId2$inboundSchema), z.string()]),
362
+ ).optional(),
363
+ statementDescriptor: z.nullable(
364
+ z.union([z.lazy(() => StatementDescriptor2$inboundSchema), z.string()]),
365
+ ).optional(),
42
366
  minimumBalance: z.string().optional(),
43
367
  });
44
368
 
45
369
  /** @internal */
46
370
  export type PatchSweepConfig$Outbound = {
47
- status?: string | undefined;
48
- pushPaymentMethodID?: string | undefined;
49
- pullPaymentMethodID?: string | undefined;
50
- statementDescriptor?: string | undefined;
371
+ status?: string | null | undefined;
372
+ pushPaymentMethodID?:
373
+ | PushPaymentMethodId2$Outbound
374
+ | string
375
+ | null
376
+ | undefined;
377
+ pullPaymentMethodID?:
378
+ | PullPaymentMethodId2$Outbound
379
+ | string
380
+ | null
381
+ | undefined;
382
+ statementDescriptor?:
383
+ | StatementDescriptor2$Outbound
384
+ | string
385
+ | null
386
+ | undefined;
51
387
  minimumBalance?: string | undefined;
52
388
  };
53
389
 
@@ -57,10 +393,16 @@ export const PatchSweepConfig$outboundSchema: z.ZodType<
57
393
  z.ZodTypeDef,
58
394
  PatchSweepConfig
59
395
  > = z.object({
60
- status: SweepConfigStatus$outboundSchema.optional(),
61
- pushPaymentMethodID: z.string().optional(),
62
- pullPaymentMethodID: z.string().optional(),
63
- statementDescriptor: z.string().optional(),
396
+ status: z.nullable(Status$outboundSchema).optional(),
397
+ pushPaymentMethodID: z.nullable(
398
+ z.union([z.lazy(() => PushPaymentMethodId2$outboundSchema), z.string()]),
399
+ ).optional(),
400
+ pullPaymentMethodID: z.nullable(
401
+ z.union([z.lazy(() => PullPaymentMethodId2$outboundSchema), z.string()]),
402
+ ).optional(),
403
+ statementDescriptor: z.nullable(
404
+ z.union([z.lazy(() => StatementDescriptor2$outboundSchema), z.string()]),
405
+ ).optional(),
64
406
  minimumBalance: z.string().optional(),
65
407
  });
66
408