dub 0.46.8 → 0.46.9
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/RUNTIMES.md +26 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/security.js +1 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/components/leadcreatedevent.d.ts +122 -0
- package/dist/commonjs/models/components/leadcreatedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/leadcreatedevent.js +120 -1
- package/dist/commonjs/models/components/leadcreatedevent.js.map +1 -1
- package/dist/commonjs/models/components/leadevent.d.ts +122 -0
- package/dist/commonjs/models/components/leadevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/leadevent.js +117 -1
- package/dist/commonjs/models/components/leadevent.js.map +1 -1
- package/dist/commonjs/models/components/salecreatedevent.d.ts +122 -0
- package/dist/commonjs/models/components/salecreatedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/salecreatedevent.js +120 -1
- package/dist/commonjs/models/components/salecreatedevent.js.map +1 -1
- package/dist/commonjs/models/components/saleevent.d.ts +122 -0
- package/dist/commonjs/models/components/saleevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/saleevent.js +118 -1
- package/dist/commonjs/models/components/saleevent.js.map +1 -1
- package/dist/commonjs/models/operations/createcustomer.d.ts +123 -0
- package/dist/commonjs/models/operations/createcustomer.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createcustomer.js +119 -1
- package/dist/commonjs/models/operations/createcustomer.js.map +1 -1
- package/dist/commonjs/models/operations/getcustomer.d.ts +123 -0
- package/dist/commonjs/models/operations/getcustomer.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getcustomer.js +119 -1
- package/dist/commonjs/models/operations/getcustomer.js.map +1 -1
- package/dist/commonjs/models/operations/getcustomers.d.ts +123 -0
- package/dist/commonjs/models/operations/getcustomers.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getcustomers.js +115 -1
- package/dist/commonjs/models/operations/getcustomers.js.map +1 -1
- package/dist/commonjs/models/operations/updatecustomer.d.ts +123 -0
- package/dist/commonjs/models/operations/updatecustomer.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatecustomer.js +119 -1
- package/dist/commonjs/models/operations/updatecustomer.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/security.js +1 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/components/leadcreatedevent.d.ts +122 -0
- package/dist/esm/models/components/leadcreatedevent.d.ts.map +1 -1
- package/dist/esm/models/components/leadcreatedevent.js +114 -0
- package/dist/esm/models/components/leadcreatedevent.js.map +1 -1
- package/dist/esm/models/components/leadevent.d.ts +122 -0
- package/dist/esm/models/components/leadevent.d.ts.map +1 -1
- package/dist/esm/models/components/leadevent.js +111 -0
- package/dist/esm/models/components/leadevent.js.map +1 -1
- package/dist/esm/models/components/salecreatedevent.d.ts +122 -0
- package/dist/esm/models/components/salecreatedevent.d.ts.map +1 -1
- package/dist/esm/models/components/salecreatedevent.js +114 -0
- package/dist/esm/models/components/salecreatedevent.js.map +1 -1
- package/dist/esm/models/components/saleevent.d.ts +122 -0
- package/dist/esm/models/components/saleevent.d.ts.map +1 -1
- package/dist/esm/models/components/saleevent.js +112 -0
- package/dist/esm/models/components/saleevent.js.map +1 -1
- package/dist/esm/models/operations/createcustomer.d.ts +123 -0
- package/dist/esm/models/operations/createcustomer.d.ts.map +1 -1
- package/dist/esm/models/operations/createcustomer.js +114 -0
- package/dist/esm/models/operations/createcustomer.js.map +1 -1
- package/dist/esm/models/operations/getcustomer.d.ts +123 -0
- package/dist/esm/models/operations/getcustomer.d.ts.map +1 -1
- package/dist/esm/models/operations/getcustomer.js +114 -0
- package/dist/esm/models/operations/getcustomer.js.map +1 -1
- package/dist/esm/models/operations/getcustomers.d.ts +123 -0
- package/dist/esm/models/operations/getcustomers.d.ts.map +1 -1
- package/dist/esm/models/operations/getcustomers.js +110 -0
- package/dist/esm/models/operations/getcustomers.js.map +1 -1
- package/dist/esm/models/operations/updatecustomer.d.ts +123 -0
- package/dist/esm/models/operations/updatecustomer.d.ts.map +1 -1
- package/dist/esm/models/operations/updatecustomer.js +114 -0
- package/dist/esm/models/operations/updatecustomer.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +1 -1
- package/src/models/components/leadcreatedevent.ts +220 -0
- package/src/models/components/leadevent.ts +200 -0
- package/src/models/components/salecreatedevent.ts +220 -0
- package/src/models/components/saleevent.ts +216 -0
- package/src/models/operations/createcustomer.ts +219 -0
- package/src/models/operations/getcustomer.ts +219 -0
- package/src/models/operations/getcustomers.ts +203 -0
- package/src/models/operations/updatecustomer.ts +219 -0
|
@@ -4,6 +4,7 @@
|
|
|
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
10
|
|
|
@@ -30,6 +31,35 @@ export type Link = {
|
|
|
30
31
|
programId: string | null;
|
|
31
32
|
};
|
|
32
33
|
|
|
34
|
+
export type Partner = {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
email: string;
|
|
38
|
+
image?: string | null | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Type = {
|
|
42
|
+
Percentage: "percentage",
|
|
43
|
+
Flat: "flat",
|
|
44
|
+
} as const;
|
|
45
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
46
|
+
|
|
47
|
+
export const GetCustomersInterval = {
|
|
48
|
+
Month: "month",
|
|
49
|
+
Year: "year",
|
|
50
|
+
} as const;
|
|
51
|
+
export type GetCustomersInterval = ClosedEnum<typeof GetCustomersInterval>;
|
|
52
|
+
|
|
53
|
+
export type Discount = {
|
|
54
|
+
id: string;
|
|
55
|
+
couponId: string | null;
|
|
56
|
+
couponTestId: string | null;
|
|
57
|
+
amount: number;
|
|
58
|
+
type: Type;
|
|
59
|
+
duration: number | null;
|
|
60
|
+
interval: GetCustomersInterval | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
33
63
|
export type ResponseBody = {
|
|
34
64
|
/**
|
|
35
65
|
* The unique identifier of the customer in Dub.
|
|
@@ -60,6 +90,8 @@ export type ResponseBody = {
|
|
|
60
90
|
*/
|
|
61
91
|
createdAt: string;
|
|
62
92
|
link?: Link | null | undefined;
|
|
93
|
+
partner?: Partner | null | undefined;
|
|
94
|
+
discount?: Discount | null | undefined;
|
|
63
95
|
};
|
|
64
96
|
|
|
65
97
|
/** @internal */
|
|
@@ -118,6 +150,171 @@ export function linkFromJSON(
|
|
|
118
150
|
);
|
|
119
151
|
}
|
|
120
152
|
|
|
153
|
+
/** @internal */
|
|
154
|
+
export const Partner$inboundSchema: z.ZodType<Partner, z.ZodTypeDef, unknown> =
|
|
155
|
+
z.object({
|
|
156
|
+
id: z.string(),
|
|
157
|
+
name: z.string(),
|
|
158
|
+
email: z.string(),
|
|
159
|
+
image: z.nullable(z.string()).optional(),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
/** @internal */
|
|
163
|
+
export type Partner$Outbound = {
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
email: string;
|
|
167
|
+
image?: string | null | undefined;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/** @internal */
|
|
171
|
+
export const Partner$outboundSchema: z.ZodType<
|
|
172
|
+
Partner$Outbound,
|
|
173
|
+
z.ZodTypeDef,
|
|
174
|
+
Partner
|
|
175
|
+
> = z.object({
|
|
176
|
+
id: z.string(),
|
|
177
|
+
name: z.string(),
|
|
178
|
+
email: z.string(),
|
|
179
|
+
image: z.nullable(z.string()).optional(),
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @internal
|
|
184
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
185
|
+
*/
|
|
186
|
+
export namespace Partner$ {
|
|
187
|
+
/** @deprecated use `Partner$inboundSchema` instead. */
|
|
188
|
+
export const inboundSchema = Partner$inboundSchema;
|
|
189
|
+
/** @deprecated use `Partner$outboundSchema` instead. */
|
|
190
|
+
export const outboundSchema = Partner$outboundSchema;
|
|
191
|
+
/** @deprecated use `Partner$Outbound` instead. */
|
|
192
|
+
export type Outbound = Partner$Outbound;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function partnerToJSON(partner: Partner): string {
|
|
196
|
+
return JSON.stringify(Partner$outboundSchema.parse(partner));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function partnerFromJSON(
|
|
200
|
+
jsonString: string,
|
|
201
|
+
): SafeParseResult<Partner, SDKValidationError> {
|
|
202
|
+
return safeParse(
|
|
203
|
+
jsonString,
|
|
204
|
+
(x) => Partner$inboundSchema.parse(JSON.parse(x)),
|
|
205
|
+
`Failed to parse 'Partner' from JSON`,
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** @internal */
|
|
210
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
211
|
+
Type,
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
/** @internal */
|
|
215
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
216
|
+
Type$inboundSchema;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @internal
|
|
220
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
221
|
+
*/
|
|
222
|
+
export namespace Type$ {
|
|
223
|
+
/** @deprecated use `Type$inboundSchema` instead. */
|
|
224
|
+
export const inboundSchema = Type$inboundSchema;
|
|
225
|
+
/** @deprecated use `Type$outboundSchema` instead. */
|
|
226
|
+
export const outboundSchema = Type$outboundSchema;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** @internal */
|
|
230
|
+
export const GetCustomersInterval$inboundSchema: z.ZodNativeEnum<
|
|
231
|
+
typeof GetCustomersInterval
|
|
232
|
+
> = z.nativeEnum(GetCustomersInterval);
|
|
233
|
+
|
|
234
|
+
/** @internal */
|
|
235
|
+
export const GetCustomersInterval$outboundSchema: z.ZodNativeEnum<
|
|
236
|
+
typeof GetCustomersInterval
|
|
237
|
+
> = GetCustomersInterval$inboundSchema;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @internal
|
|
241
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
242
|
+
*/
|
|
243
|
+
export namespace GetCustomersInterval$ {
|
|
244
|
+
/** @deprecated use `GetCustomersInterval$inboundSchema` instead. */
|
|
245
|
+
export const inboundSchema = GetCustomersInterval$inboundSchema;
|
|
246
|
+
/** @deprecated use `GetCustomersInterval$outboundSchema` instead. */
|
|
247
|
+
export const outboundSchema = GetCustomersInterval$outboundSchema;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** @internal */
|
|
251
|
+
export const Discount$inboundSchema: z.ZodType<
|
|
252
|
+
Discount,
|
|
253
|
+
z.ZodTypeDef,
|
|
254
|
+
unknown
|
|
255
|
+
> = z.object({
|
|
256
|
+
id: z.string(),
|
|
257
|
+
couponId: z.nullable(z.string()),
|
|
258
|
+
couponTestId: z.nullable(z.string()),
|
|
259
|
+
amount: z.number(),
|
|
260
|
+
type: Type$inboundSchema,
|
|
261
|
+
duration: z.nullable(z.number()),
|
|
262
|
+
interval: z.nullable(GetCustomersInterval$inboundSchema),
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
/** @internal */
|
|
266
|
+
export type Discount$Outbound = {
|
|
267
|
+
id: string;
|
|
268
|
+
couponId: string | null;
|
|
269
|
+
couponTestId: string | null;
|
|
270
|
+
amount: number;
|
|
271
|
+
type: string;
|
|
272
|
+
duration: number | null;
|
|
273
|
+
interval: string | null;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
/** @internal */
|
|
277
|
+
export const Discount$outboundSchema: z.ZodType<
|
|
278
|
+
Discount$Outbound,
|
|
279
|
+
z.ZodTypeDef,
|
|
280
|
+
Discount
|
|
281
|
+
> = z.object({
|
|
282
|
+
id: z.string(),
|
|
283
|
+
couponId: z.nullable(z.string()),
|
|
284
|
+
couponTestId: z.nullable(z.string()),
|
|
285
|
+
amount: z.number(),
|
|
286
|
+
type: Type$outboundSchema,
|
|
287
|
+
duration: z.nullable(z.number()),
|
|
288
|
+
interval: z.nullable(GetCustomersInterval$outboundSchema),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @internal
|
|
293
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
294
|
+
*/
|
|
295
|
+
export namespace Discount$ {
|
|
296
|
+
/** @deprecated use `Discount$inboundSchema` instead. */
|
|
297
|
+
export const inboundSchema = Discount$inboundSchema;
|
|
298
|
+
/** @deprecated use `Discount$outboundSchema` instead. */
|
|
299
|
+
export const outboundSchema = Discount$outboundSchema;
|
|
300
|
+
/** @deprecated use `Discount$Outbound` instead. */
|
|
301
|
+
export type Outbound = Discount$Outbound;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function discountToJSON(discount: Discount): string {
|
|
305
|
+
return JSON.stringify(Discount$outboundSchema.parse(discount));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function discountFromJSON(
|
|
309
|
+
jsonString: string,
|
|
310
|
+
): SafeParseResult<Discount, SDKValidationError> {
|
|
311
|
+
return safeParse(
|
|
312
|
+
jsonString,
|
|
313
|
+
(x) => Discount$inboundSchema.parse(JSON.parse(x)),
|
|
314
|
+
`Failed to parse 'Discount' from JSON`,
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
121
318
|
/** @internal */
|
|
122
319
|
export const ResponseBody$inboundSchema: z.ZodType<
|
|
123
320
|
ResponseBody,
|
|
@@ -132,6 +329,8 @@ export const ResponseBody$inboundSchema: z.ZodType<
|
|
|
132
329
|
country: z.nullable(z.string()).optional(),
|
|
133
330
|
createdAt: z.string(),
|
|
134
331
|
link: z.nullable(z.lazy(() => Link$inboundSchema)).optional(),
|
|
332
|
+
partner: z.nullable(z.lazy(() => Partner$inboundSchema)).optional(),
|
|
333
|
+
discount: z.nullable(z.lazy(() => Discount$inboundSchema)).optional(),
|
|
135
334
|
});
|
|
136
335
|
|
|
137
336
|
/** @internal */
|
|
@@ -144,6 +343,8 @@ export type ResponseBody$Outbound = {
|
|
|
144
343
|
country?: string | null | undefined;
|
|
145
344
|
createdAt: string;
|
|
146
345
|
link?: Link$Outbound | null | undefined;
|
|
346
|
+
partner?: Partner$Outbound | null | undefined;
|
|
347
|
+
discount?: Discount$Outbound | null | undefined;
|
|
147
348
|
};
|
|
148
349
|
|
|
149
350
|
/** @internal */
|
|
@@ -160,6 +361,8 @@ export const ResponseBody$outboundSchema: z.ZodType<
|
|
|
160
361
|
country: z.nullable(z.string()).optional(),
|
|
161
362
|
createdAt: z.string(),
|
|
162
363
|
link: z.nullable(z.lazy(() => Link$outboundSchema)).optional(),
|
|
364
|
+
partner: z.nullable(z.lazy(() => Partner$outboundSchema)).optional(),
|
|
365
|
+
discount: z.nullable(z.lazy(() => Discount$outboundSchema)).optional(),
|
|
163
366
|
});
|
|
164
367
|
|
|
165
368
|
/**
|
|
@@ -5,6 +5,7 @@
|
|
|
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";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
|
|
@@ -58,6 +59,35 @@ export type UpdateCustomerLink = {
|
|
|
58
59
|
programId: string | null;
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
export type UpdateCustomerPartner = {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
email: string;
|
|
66
|
+
image?: string | null | undefined;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const UpdateCustomerType = {
|
|
70
|
+
Percentage: "percentage",
|
|
71
|
+
Flat: "flat",
|
|
72
|
+
} as const;
|
|
73
|
+
export type UpdateCustomerType = ClosedEnum<typeof UpdateCustomerType>;
|
|
74
|
+
|
|
75
|
+
export const UpdateCustomerInterval = {
|
|
76
|
+
Month: "month",
|
|
77
|
+
Year: "year",
|
|
78
|
+
} as const;
|
|
79
|
+
export type UpdateCustomerInterval = ClosedEnum<typeof UpdateCustomerInterval>;
|
|
80
|
+
|
|
81
|
+
export type UpdateCustomerDiscount = {
|
|
82
|
+
id: string;
|
|
83
|
+
couponId: string | null;
|
|
84
|
+
couponTestId: string | null;
|
|
85
|
+
amount: number;
|
|
86
|
+
type: UpdateCustomerType;
|
|
87
|
+
duration: number | null;
|
|
88
|
+
interval: UpdateCustomerInterval | null;
|
|
89
|
+
};
|
|
90
|
+
|
|
61
91
|
/**
|
|
62
92
|
* The customer was updated.
|
|
63
93
|
*/
|
|
@@ -91,6 +121,8 @@ export type UpdateCustomerResponseBody = {
|
|
|
91
121
|
*/
|
|
92
122
|
createdAt: string;
|
|
93
123
|
link?: UpdateCustomerLink | null | undefined;
|
|
124
|
+
partner?: UpdateCustomerPartner | null | undefined;
|
|
125
|
+
discount?: UpdateCustomerDiscount | null | undefined;
|
|
94
126
|
};
|
|
95
127
|
|
|
96
128
|
/** @internal */
|
|
@@ -288,6 +320,183 @@ export function updateCustomerLinkFromJSON(
|
|
|
288
320
|
);
|
|
289
321
|
}
|
|
290
322
|
|
|
323
|
+
/** @internal */
|
|
324
|
+
export const UpdateCustomerPartner$inboundSchema: z.ZodType<
|
|
325
|
+
UpdateCustomerPartner,
|
|
326
|
+
z.ZodTypeDef,
|
|
327
|
+
unknown
|
|
328
|
+
> = z.object({
|
|
329
|
+
id: z.string(),
|
|
330
|
+
name: z.string(),
|
|
331
|
+
email: z.string(),
|
|
332
|
+
image: z.nullable(z.string()).optional(),
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
/** @internal */
|
|
336
|
+
export type UpdateCustomerPartner$Outbound = {
|
|
337
|
+
id: string;
|
|
338
|
+
name: string;
|
|
339
|
+
email: string;
|
|
340
|
+
image?: string | null | undefined;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/** @internal */
|
|
344
|
+
export const UpdateCustomerPartner$outboundSchema: z.ZodType<
|
|
345
|
+
UpdateCustomerPartner$Outbound,
|
|
346
|
+
z.ZodTypeDef,
|
|
347
|
+
UpdateCustomerPartner
|
|
348
|
+
> = z.object({
|
|
349
|
+
id: z.string(),
|
|
350
|
+
name: z.string(),
|
|
351
|
+
email: z.string(),
|
|
352
|
+
image: z.nullable(z.string()).optional(),
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @internal
|
|
357
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
358
|
+
*/
|
|
359
|
+
export namespace UpdateCustomerPartner$ {
|
|
360
|
+
/** @deprecated use `UpdateCustomerPartner$inboundSchema` instead. */
|
|
361
|
+
export const inboundSchema = UpdateCustomerPartner$inboundSchema;
|
|
362
|
+
/** @deprecated use `UpdateCustomerPartner$outboundSchema` instead. */
|
|
363
|
+
export const outboundSchema = UpdateCustomerPartner$outboundSchema;
|
|
364
|
+
/** @deprecated use `UpdateCustomerPartner$Outbound` instead. */
|
|
365
|
+
export type Outbound = UpdateCustomerPartner$Outbound;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function updateCustomerPartnerToJSON(
|
|
369
|
+
updateCustomerPartner: UpdateCustomerPartner,
|
|
370
|
+
): string {
|
|
371
|
+
return JSON.stringify(
|
|
372
|
+
UpdateCustomerPartner$outboundSchema.parse(updateCustomerPartner),
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export function updateCustomerPartnerFromJSON(
|
|
377
|
+
jsonString: string,
|
|
378
|
+
): SafeParseResult<UpdateCustomerPartner, SDKValidationError> {
|
|
379
|
+
return safeParse(
|
|
380
|
+
jsonString,
|
|
381
|
+
(x) => UpdateCustomerPartner$inboundSchema.parse(JSON.parse(x)),
|
|
382
|
+
`Failed to parse 'UpdateCustomerPartner' from JSON`,
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** @internal */
|
|
387
|
+
export const UpdateCustomerType$inboundSchema: z.ZodNativeEnum<
|
|
388
|
+
typeof UpdateCustomerType
|
|
389
|
+
> = z.nativeEnum(UpdateCustomerType);
|
|
390
|
+
|
|
391
|
+
/** @internal */
|
|
392
|
+
export const UpdateCustomerType$outboundSchema: z.ZodNativeEnum<
|
|
393
|
+
typeof UpdateCustomerType
|
|
394
|
+
> = UpdateCustomerType$inboundSchema;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* @internal
|
|
398
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
399
|
+
*/
|
|
400
|
+
export namespace UpdateCustomerType$ {
|
|
401
|
+
/** @deprecated use `UpdateCustomerType$inboundSchema` instead. */
|
|
402
|
+
export const inboundSchema = UpdateCustomerType$inboundSchema;
|
|
403
|
+
/** @deprecated use `UpdateCustomerType$outboundSchema` instead. */
|
|
404
|
+
export const outboundSchema = UpdateCustomerType$outboundSchema;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** @internal */
|
|
408
|
+
export const UpdateCustomerInterval$inboundSchema: z.ZodNativeEnum<
|
|
409
|
+
typeof UpdateCustomerInterval
|
|
410
|
+
> = z.nativeEnum(UpdateCustomerInterval);
|
|
411
|
+
|
|
412
|
+
/** @internal */
|
|
413
|
+
export const UpdateCustomerInterval$outboundSchema: z.ZodNativeEnum<
|
|
414
|
+
typeof UpdateCustomerInterval
|
|
415
|
+
> = UpdateCustomerInterval$inboundSchema;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* @internal
|
|
419
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
420
|
+
*/
|
|
421
|
+
export namespace UpdateCustomerInterval$ {
|
|
422
|
+
/** @deprecated use `UpdateCustomerInterval$inboundSchema` instead. */
|
|
423
|
+
export const inboundSchema = UpdateCustomerInterval$inboundSchema;
|
|
424
|
+
/** @deprecated use `UpdateCustomerInterval$outboundSchema` instead. */
|
|
425
|
+
export const outboundSchema = UpdateCustomerInterval$outboundSchema;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** @internal */
|
|
429
|
+
export const UpdateCustomerDiscount$inboundSchema: z.ZodType<
|
|
430
|
+
UpdateCustomerDiscount,
|
|
431
|
+
z.ZodTypeDef,
|
|
432
|
+
unknown
|
|
433
|
+
> = z.object({
|
|
434
|
+
id: z.string(),
|
|
435
|
+
couponId: z.nullable(z.string()),
|
|
436
|
+
couponTestId: z.nullable(z.string()),
|
|
437
|
+
amount: z.number(),
|
|
438
|
+
type: UpdateCustomerType$inboundSchema,
|
|
439
|
+
duration: z.nullable(z.number()),
|
|
440
|
+
interval: z.nullable(UpdateCustomerInterval$inboundSchema),
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
/** @internal */
|
|
444
|
+
export type UpdateCustomerDiscount$Outbound = {
|
|
445
|
+
id: string;
|
|
446
|
+
couponId: string | null;
|
|
447
|
+
couponTestId: string | null;
|
|
448
|
+
amount: number;
|
|
449
|
+
type: string;
|
|
450
|
+
duration: number | null;
|
|
451
|
+
interval: string | null;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
/** @internal */
|
|
455
|
+
export const UpdateCustomerDiscount$outboundSchema: z.ZodType<
|
|
456
|
+
UpdateCustomerDiscount$Outbound,
|
|
457
|
+
z.ZodTypeDef,
|
|
458
|
+
UpdateCustomerDiscount
|
|
459
|
+
> = z.object({
|
|
460
|
+
id: z.string(),
|
|
461
|
+
couponId: z.nullable(z.string()),
|
|
462
|
+
couponTestId: z.nullable(z.string()),
|
|
463
|
+
amount: z.number(),
|
|
464
|
+
type: UpdateCustomerType$outboundSchema,
|
|
465
|
+
duration: z.nullable(z.number()),
|
|
466
|
+
interval: z.nullable(UpdateCustomerInterval$outboundSchema),
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* @internal
|
|
471
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
472
|
+
*/
|
|
473
|
+
export namespace UpdateCustomerDiscount$ {
|
|
474
|
+
/** @deprecated use `UpdateCustomerDiscount$inboundSchema` instead. */
|
|
475
|
+
export const inboundSchema = UpdateCustomerDiscount$inboundSchema;
|
|
476
|
+
/** @deprecated use `UpdateCustomerDiscount$outboundSchema` instead. */
|
|
477
|
+
export const outboundSchema = UpdateCustomerDiscount$outboundSchema;
|
|
478
|
+
/** @deprecated use `UpdateCustomerDiscount$Outbound` instead. */
|
|
479
|
+
export type Outbound = UpdateCustomerDiscount$Outbound;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export function updateCustomerDiscountToJSON(
|
|
483
|
+
updateCustomerDiscount: UpdateCustomerDiscount,
|
|
484
|
+
): string {
|
|
485
|
+
return JSON.stringify(
|
|
486
|
+
UpdateCustomerDiscount$outboundSchema.parse(updateCustomerDiscount),
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export function updateCustomerDiscountFromJSON(
|
|
491
|
+
jsonString: string,
|
|
492
|
+
): SafeParseResult<UpdateCustomerDiscount, SDKValidationError> {
|
|
493
|
+
return safeParse(
|
|
494
|
+
jsonString,
|
|
495
|
+
(x) => UpdateCustomerDiscount$inboundSchema.parse(JSON.parse(x)),
|
|
496
|
+
`Failed to parse 'UpdateCustomerDiscount' from JSON`,
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
|
|
291
500
|
/** @internal */
|
|
292
501
|
export const UpdateCustomerResponseBody$inboundSchema: z.ZodType<
|
|
293
502
|
UpdateCustomerResponseBody,
|
|
@@ -302,6 +511,10 @@ export const UpdateCustomerResponseBody$inboundSchema: z.ZodType<
|
|
|
302
511
|
country: z.nullable(z.string()).optional(),
|
|
303
512
|
createdAt: z.string(),
|
|
304
513
|
link: z.nullable(z.lazy(() => UpdateCustomerLink$inboundSchema)).optional(),
|
|
514
|
+
partner: z.nullable(z.lazy(() => UpdateCustomerPartner$inboundSchema))
|
|
515
|
+
.optional(),
|
|
516
|
+
discount: z.nullable(z.lazy(() => UpdateCustomerDiscount$inboundSchema))
|
|
517
|
+
.optional(),
|
|
305
518
|
});
|
|
306
519
|
|
|
307
520
|
/** @internal */
|
|
@@ -314,6 +527,8 @@ export type UpdateCustomerResponseBody$Outbound = {
|
|
|
314
527
|
country?: string | null | undefined;
|
|
315
528
|
createdAt: string;
|
|
316
529
|
link?: UpdateCustomerLink$Outbound | null | undefined;
|
|
530
|
+
partner?: UpdateCustomerPartner$Outbound | null | undefined;
|
|
531
|
+
discount?: UpdateCustomerDiscount$Outbound | null | undefined;
|
|
317
532
|
};
|
|
318
533
|
|
|
319
534
|
/** @internal */
|
|
@@ -330,6 +545,10 @@ export const UpdateCustomerResponseBody$outboundSchema: z.ZodType<
|
|
|
330
545
|
country: z.nullable(z.string()).optional(),
|
|
331
546
|
createdAt: z.string(),
|
|
332
547
|
link: z.nullable(z.lazy(() => UpdateCustomerLink$outboundSchema)).optional(),
|
|
548
|
+
partner: z.nullable(z.lazy(() => UpdateCustomerPartner$outboundSchema))
|
|
549
|
+
.optional(),
|
|
550
|
+
discount: z.nullable(z.lazy(() => UpdateCustomerDiscount$outboundSchema))
|
|
551
|
+
.optional(),
|
|
333
552
|
});
|
|
334
553
|
|
|
335
554
|
/**
|