ce-storefront 0.18.0 → 0.18.1
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 +4 -2
- package/docs/sdks/customers/README.md +85 -0
- package/esm/funcs/customersListSavedPaymentMethods.d.ts +26 -0
- package/esm/funcs/customersListSavedPaymentMethods.d.ts.map +1 -0
- package/esm/funcs/customersListSavedPaymentMethods.js +95 -0
- package/esm/funcs/customersListSavedPaymentMethods.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/index.d.ts +1 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +1 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/savedpaymentmethod.d.ts +260 -0
- package/esm/models/components/savedpaymentmethod.d.ts.map +1 -0
- package/esm/models/components/savedpaymentmethod.js +385 -0
- package/esm/models/components/savedpaymentmethod.js.map +1 -0
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/listsavedpaymentmethods.d.ts +90 -0
- package/esm/models/operations/listsavedpaymentmethods.d.ts.map +1 -0
- package/esm/models/operations/listsavedpaymentmethods.js +105 -0
- package/esm/models/operations/listsavedpaymentmethods.js.map +1 -0
- package/esm/sdk/customers.d.ts +15 -0
- package/esm/sdk/customers.d.ts.map +1 -1
- package/esm/sdk/customers.js +18 -0
- package/esm/sdk/customers.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/customersListSavedPaymentMethods.ts +190 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +1 -0
- package/src/models/components/savedpaymentmethod.ts +668 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listsavedpaymentmethods.ts +225 -0
- package/src/sdk/customers.ts +26 -0
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type UpiCollect = {
|
|
12
|
+
count?: number | undefined;
|
|
13
|
+
lastUsed?: string | undefined;
|
|
14
|
+
vpa?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type Metadata = {
|
|
18
|
+
mobileNumber?: string | undefined;
|
|
19
|
+
deviceId?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type SubDetails = {
|
|
23
|
+
lastUsed?: string | undefined;
|
|
24
|
+
currentBalance?: string | undefined;
|
|
25
|
+
lastRefreshed?: string | undefined;
|
|
26
|
+
paymentMethod?: string | undefined;
|
|
27
|
+
paymentMethodType?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type Wallet = {
|
|
31
|
+
linked?: string | undefined;
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
metadata?: Metadata | undefined;
|
|
34
|
+
wallet?: string | undefined;
|
|
35
|
+
gatewayReferenceId?: string | undefined;
|
|
36
|
+
lastRefreshed?: string | undefined;
|
|
37
|
+
subDetails?: SubDetails | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type SavedPaymentMethodMetadata = {
|
|
41
|
+
originMerchantId?: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type Card = {
|
|
45
|
+
cardSubType?: string | undefined;
|
|
46
|
+
extendedCardType?: string | undefined;
|
|
47
|
+
cardGlobalFingerprint?: string | undefined;
|
|
48
|
+
nickname?: string | undefined;
|
|
49
|
+
providerCategory?: string | undefined;
|
|
50
|
+
vaultProvider?: string | undefined;
|
|
51
|
+
cardReference?: string | undefined;
|
|
52
|
+
cardType?: string | undefined;
|
|
53
|
+
metadata?: SavedPaymentMethodMetadata | undefined;
|
|
54
|
+
cardIssuer?: string | undefined;
|
|
55
|
+
cardToken?: string | undefined;
|
|
56
|
+
cardExpMonth?: string | undefined;
|
|
57
|
+
provider?: string | undefined;
|
|
58
|
+
cardSubTypeCategory?: string | undefined;
|
|
59
|
+
expired?: boolean | undefined;
|
|
60
|
+
cardFingerprint?: string | undefined;
|
|
61
|
+
tokenizeSupport?: boolean | undefined;
|
|
62
|
+
juspayBankCode?: string | undefined;
|
|
63
|
+
cardExpYear?: string | undefined;
|
|
64
|
+
nameOnCard?: string | undefined;
|
|
65
|
+
countryCode?: string | undefined;
|
|
66
|
+
cardNumber?: string | undefined;
|
|
67
|
+
cardIsin?: string | undefined;
|
|
68
|
+
cardBrand?: string | undefined;
|
|
69
|
+
cardIssuerCountry?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/SavedPaymentMethod} - API reference for the SavedPaymentMethod schema
|
|
74
|
+
*/
|
|
75
|
+
export type SavedPaymentMethod = {
|
|
76
|
+
upiCollect?: Array<UpiCollect> | undefined;
|
|
77
|
+
wallet?: Array<Wallet> | undefined;
|
|
78
|
+
card?: Array<Card> | undefined;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @internal */
|
|
82
|
+
export const UpiCollect$inboundSchema: z.ZodType<
|
|
83
|
+
UpiCollect,
|
|
84
|
+
z.ZodTypeDef,
|
|
85
|
+
unknown
|
|
86
|
+
> = z.object({
|
|
87
|
+
count: z.number().int().optional(),
|
|
88
|
+
last_used: z.string().optional(),
|
|
89
|
+
vpa: z.string().optional(),
|
|
90
|
+
}).transform((v) => {
|
|
91
|
+
return remap$(v, {
|
|
92
|
+
"last_used": "lastUsed",
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
/** @internal */
|
|
97
|
+
export type UpiCollect$Outbound = {
|
|
98
|
+
count?: number | undefined;
|
|
99
|
+
last_used?: string | undefined;
|
|
100
|
+
vpa?: string | undefined;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
export const UpiCollect$outboundSchema: z.ZodType<
|
|
105
|
+
UpiCollect$Outbound,
|
|
106
|
+
z.ZodTypeDef,
|
|
107
|
+
UpiCollect
|
|
108
|
+
> = z.object({
|
|
109
|
+
count: z.number().int().optional(),
|
|
110
|
+
lastUsed: z.string().optional(),
|
|
111
|
+
vpa: z.string().optional(),
|
|
112
|
+
}).transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
lastUsed: "last_used",
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
121
|
+
*/
|
|
122
|
+
export namespace UpiCollect$ {
|
|
123
|
+
/** @deprecated use `UpiCollect$inboundSchema` instead. */
|
|
124
|
+
export const inboundSchema = UpiCollect$inboundSchema;
|
|
125
|
+
/** @deprecated use `UpiCollect$outboundSchema` instead. */
|
|
126
|
+
export const outboundSchema = UpiCollect$outboundSchema;
|
|
127
|
+
/** @deprecated use `UpiCollect$Outbound` instead. */
|
|
128
|
+
export type Outbound = UpiCollect$Outbound;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function upiCollectToJSON(upiCollect: UpiCollect): string {
|
|
132
|
+
return JSON.stringify(UpiCollect$outboundSchema.parse(upiCollect));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function upiCollectFromJSON(
|
|
136
|
+
jsonString: string,
|
|
137
|
+
): SafeParseResult<UpiCollect, SDKValidationError> {
|
|
138
|
+
return safeParse(
|
|
139
|
+
jsonString,
|
|
140
|
+
(x) => UpiCollect$inboundSchema.parse(JSON.parse(x)),
|
|
141
|
+
`Failed to parse 'UpiCollect' from JSON`,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** @internal */
|
|
146
|
+
export const Metadata$inboundSchema: z.ZodType<
|
|
147
|
+
Metadata,
|
|
148
|
+
z.ZodTypeDef,
|
|
149
|
+
unknown
|
|
150
|
+
> = z.object({
|
|
151
|
+
"mobile_Number ": z.string().optional(),
|
|
152
|
+
"device_Id ": z.string().optional(),
|
|
153
|
+
}).transform((v) => {
|
|
154
|
+
return remap$(v, {
|
|
155
|
+
"mobile_Number ": "mobileNumber",
|
|
156
|
+
"device_Id ": "deviceId",
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
/** @internal */
|
|
161
|
+
export type Metadata$Outbound = {
|
|
162
|
+
"mobile_Number "?: string | undefined;
|
|
163
|
+
"device_Id "?: string | undefined;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/** @internal */
|
|
167
|
+
export const Metadata$outboundSchema: z.ZodType<
|
|
168
|
+
Metadata$Outbound,
|
|
169
|
+
z.ZodTypeDef,
|
|
170
|
+
Metadata
|
|
171
|
+
> = z.object({
|
|
172
|
+
mobileNumber: z.string().optional(),
|
|
173
|
+
deviceId: z.string().optional(),
|
|
174
|
+
}).transform((v) => {
|
|
175
|
+
return remap$(v, {
|
|
176
|
+
mobileNumber: "mobile_Number ",
|
|
177
|
+
deviceId: "device_Id ",
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @internal
|
|
183
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
184
|
+
*/
|
|
185
|
+
export namespace Metadata$ {
|
|
186
|
+
/** @deprecated use `Metadata$inboundSchema` instead. */
|
|
187
|
+
export const inboundSchema = Metadata$inboundSchema;
|
|
188
|
+
/** @deprecated use `Metadata$outboundSchema` instead. */
|
|
189
|
+
export const outboundSchema = Metadata$outboundSchema;
|
|
190
|
+
/** @deprecated use `Metadata$Outbound` instead. */
|
|
191
|
+
export type Outbound = Metadata$Outbound;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function metadataToJSON(metadata: Metadata): string {
|
|
195
|
+
return JSON.stringify(Metadata$outboundSchema.parse(metadata));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function metadataFromJSON(
|
|
199
|
+
jsonString: string,
|
|
200
|
+
): SafeParseResult<Metadata, SDKValidationError> {
|
|
201
|
+
return safeParse(
|
|
202
|
+
jsonString,
|
|
203
|
+
(x) => Metadata$inboundSchema.parse(JSON.parse(x)),
|
|
204
|
+
`Failed to parse 'Metadata' from JSON`,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** @internal */
|
|
209
|
+
export const SubDetails$inboundSchema: z.ZodType<
|
|
210
|
+
SubDetails,
|
|
211
|
+
z.ZodTypeDef,
|
|
212
|
+
unknown
|
|
213
|
+
> = z.object({
|
|
214
|
+
"last_Used ": z.string().optional(),
|
|
215
|
+
"current_Balance ": z.string().optional(),
|
|
216
|
+
"last_Refreshed ": z.string().optional(),
|
|
217
|
+
"payment_Method ": z.string().optional(),
|
|
218
|
+
"payment_Method_Type ": z.string().optional(),
|
|
219
|
+
}).transform((v) => {
|
|
220
|
+
return remap$(v, {
|
|
221
|
+
"last_Used ": "lastUsed",
|
|
222
|
+
"current_Balance ": "currentBalance",
|
|
223
|
+
"last_Refreshed ": "lastRefreshed",
|
|
224
|
+
"payment_Method ": "paymentMethod",
|
|
225
|
+
"payment_Method_Type ": "paymentMethodType",
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
/** @internal */
|
|
230
|
+
export type SubDetails$Outbound = {
|
|
231
|
+
"last_Used "?: string | undefined;
|
|
232
|
+
"current_Balance "?: string | undefined;
|
|
233
|
+
"last_Refreshed "?: string | undefined;
|
|
234
|
+
"payment_Method "?: string | undefined;
|
|
235
|
+
"payment_Method_Type "?: string | undefined;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/** @internal */
|
|
239
|
+
export const SubDetails$outboundSchema: z.ZodType<
|
|
240
|
+
SubDetails$Outbound,
|
|
241
|
+
z.ZodTypeDef,
|
|
242
|
+
SubDetails
|
|
243
|
+
> = z.object({
|
|
244
|
+
lastUsed: z.string().optional(),
|
|
245
|
+
currentBalance: z.string().optional(),
|
|
246
|
+
lastRefreshed: z.string().optional(),
|
|
247
|
+
paymentMethod: z.string().optional(),
|
|
248
|
+
paymentMethodType: z.string().optional(),
|
|
249
|
+
}).transform((v) => {
|
|
250
|
+
return remap$(v, {
|
|
251
|
+
lastUsed: "last_Used ",
|
|
252
|
+
currentBalance: "current_Balance ",
|
|
253
|
+
lastRefreshed: "last_Refreshed ",
|
|
254
|
+
paymentMethod: "payment_Method ",
|
|
255
|
+
paymentMethodType: "payment_Method_Type ",
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @internal
|
|
261
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
262
|
+
*/
|
|
263
|
+
export namespace SubDetails$ {
|
|
264
|
+
/** @deprecated use `SubDetails$inboundSchema` instead. */
|
|
265
|
+
export const inboundSchema = SubDetails$inboundSchema;
|
|
266
|
+
/** @deprecated use `SubDetails$outboundSchema` instead. */
|
|
267
|
+
export const outboundSchema = SubDetails$outboundSchema;
|
|
268
|
+
/** @deprecated use `SubDetails$Outbound` instead. */
|
|
269
|
+
export type Outbound = SubDetails$Outbound;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function subDetailsToJSON(subDetails: SubDetails): string {
|
|
273
|
+
return JSON.stringify(SubDetails$outboundSchema.parse(subDetails));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function subDetailsFromJSON(
|
|
277
|
+
jsonString: string,
|
|
278
|
+
): SafeParseResult<SubDetails, SDKValidationError> {
|
|
279
|
+
return safeParse(
|
|
280
|
+
jsonString,
|
|
281
|
+
(x) => SubDetails$inboundSchema.parse(JSON.parse(x)),
|
|
282
|
+
`Failed to parse 'SubDetails' from JSON`,
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** @internal */
|
|
287
|
+
export const Wallet$inboundSchema: z.ZodType<Wallet, z.ZodTypeDef, unknown> = z
|
|
288
|
+
.object({
|
|
289
|
+
"linked ": z.string().optional(),
|
|
290
|
+
"id ": z.string().optional(),
|
|
291
|
+
"metadata ": z.lazy(() => Metadata$inboundSchema).optional(),
|
|
292
|
+
"wallet ": z.string().optional(),
|
|
293
|
+
"gateway_reference_id ": z.string().optional(),
|
|
294
|
+
"last_refreshed ": z.string().optional(),
|
|
295
|
+
"sub_details ": z.lazy(() => SubDetails$inboundSchema).optional(),
|
|
296
|
+
}).transform((v) => {
|
|
297
|
+
return remap$(v, {
|
|
298
|
+
"linked ": "linked",
|
|
299
|
+
"id ": "id",
|
|
300
|
+
"metadata ": "metadata",
|
|
301
|
+
"wallet ": "wallet",
|
|
302
|
+
"gateway_reference_id ": "gatewayReferenceId",
|
|
303
|
+
"last_refreshed ": "lastRefreshed",
|
|
304
|
+
"sub_details ": "subDetails",
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
/** @internal */
|
|
309
|
+
export type Wallet$Outbound = {
|
|
310
|
+
"linked "?: string | undefined;
|
|
311
|
+
"id "?: string | undefined;
|
|
312
|
+
"metadata "?: Metadata$Outbound | undefined;
|
|
313
|
+
"wallet "?: string | undefined;
|
|
314
|
+
"gateway_reference_id "?: string | undefined;
|
|
315
|
+
"last_refreshed "?: string | undefined;
|
|
316
|
+
"sub_details "?: SubDetails$Outbound | undefined;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/** @internal */
|
|
320
|
+
export const Wallet$outboundSchema: z.ZodType<
|
|
321
|
+
Wallet$Outbound,
|
|
322
|
+
z.ZodTypeDef,
|
|
323
|
+
Wallet
|
|
324
|
+
> = z.object({
|
|
325
|
+
linked: z.string().optional(),
|
|
326
|
+
id: z.string().optional(),
|
|
327
|
+
metadata: z.lazy(() => Metadata$outboundSchema).optional(),
|
|
328
|
+
wallet: z.string().optional(),
|
|
329
|
+
gatewayReferenceId: z.string().optional(),
|
|
330
|
+
lastRefreshed: z.string().optional(),
|
|
331
|
+
subDetails: z.lazy(() => SubDetails$outboundSchema).optional(),
|
|
332
|
+
}).transform((v) => {
|
|
333
|
+
return remap$(v, {
|
|
334
|
+
linked: "linked ",
|
|
335
|
+
id: "id ",
|
|
336
|
+
metadata: "metadata ",
|
|
337
|
+
wallet: "wallet ",
|
|
338
|
+
gatewayReferenceId: "gateway_reference_id ",
|
|
339
|
+
lastRefreshed: "last_refreshed ",
|
|
340
|
+
subDetails: "sub_details ",
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* @internal
|
|
346
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
347
|
+
*/
|
|
348
|
+
export namespace Wallet$ {
|
|
349
|
+
/** @deprecated use `Wallet$inboundSchema` instead. */
|
|
350
|
+
export const inboundSchema = Wallet$inboundSchema;
|
|
351
|
+
/** @deprecated use `Wallet$outboundSchema` instead. */
|
|
352
|
+
export const outboundSchema = Wallet$outboundSchema;
|
|
353
|
+
/** @deprecated use `Wallet$Outbound` instead. */
|
|
354
|
+
export type Outbound = Wallet$Outbound;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function walletToJSON(wallet: Wallet): string {
|
|
358
|
+
return JSON.stringify(Wallet$outboundSchema.parse(wallet));
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export function walletFromJSON(
|
|
362
|
+
jsonString: string,
|
|
363
|
+
): SafeParseResult<Wallet, SDKValidationError> {
|
|
364
|
+
return safeParse(
|
|
365
|
+
jsonString,
|
|
366
|
+
(x) => Wallet$inboundSchema.parse(JSON.parse(x)),
|
|
367
|
+
`Failed to parse 'Wallet' from JSON`,
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** @internal */
|
|
372
|
+
export const SavedPaymentMethodMetadata$inboundSchema: z.ZodType<
|
|
373
|
+
SavedPaymentMethodMetadata,
|
|
374
|
+
z.ZodTypeDef,
|
|
375
|
+
unknown
|
|
376
|
+
> = z.object({
|
|
377
|
+
origin_merchant_id: z.string().optional(),
|
|
378
|
+
}).transform((v) => {
|
|
379
|
+
return remap$(v, {
|
|
380
|
+
"origin_merchant_id": "originMerchantId",
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
/** @internal */
|
|
385
|
+
export type SavedPaymentMethodMetadata$Outbound = {
|
|
386
|
+
origin_merchant_id?: string | undefined;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
/** @internal */
|
|
390
|
+
export const SavedPaymentMethodMetadata$outboundSchema: z.ZodType<
|
|
391
|
+
SavedPaymentMethodMetadata$Outbound,
|
|
392
|
+
z.ZodTypeDef,
|
|
393
|
+
SavedPaymentMethodMetadata
|
|
394
|
+
> = z.object({
|
|
395
|
+
originMerchantId: z.string().optional(),
|
|
396
|
+
}).transform((v) => {
|
|
397
|
+
return remap$(v, {
|
|
398
|
+
originMerchantId: "origin_merchant_id",
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @internal
|
|
404
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
405
|
+
*/
|
|
406
|
+
export namespace SavedPaymentMethodMetadata$ {
|
|
407
|
+
/** @deprecated use `SavedPaymentMethodMetadata$inboundSchema` instead. */
|
|
408
|
+
export const inboundSchema = SavedPaymentMethodMetadata$inboundSchema;
|
|
409
|
+
/** @deprecated use `SavedPaymentMethodMetadata$outboundSchema` instead. */
|
|
410
|
+
export const outboundSchema = SavedPaymentMethodMetadata$outboundSchema;
|
|
411
|
+
/** @deprecated use `SavedPaymentMethodMetadata$Outbound` instead. */
|
|
412
|
+
export type Outbound = SavedPaymentMethodMetadata$Outbound;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export function savedPaymentMethodMetadataToJSON(
|
|
416
|
+
savedPaymentMethodMetadata: SavedPaymentMethodMetadata,
|
|
417
|
+
): string {
|
|
418
|
+
return JSON.stringify(
|
|
419
|
+
SavedPaymentMethodMetadata$outboundSchema.parse(savedPaymentMethodMetadata),
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export function savedPaymentMethodMetadataFromJSON(
|
|
424
|
+
jsonString: string,
|
|
425
|
+
): SafeParseResult<SavedPaymentMethodMetadata, SDKValidationError> {
|
|
426
|
+
return safeParse(
|
|
427
|
+
jsonString,
|
|
428
|
+
(x) => SavedPaymentMethodMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
429
|
+
`Failed to parse 'SavedPaymentMethodMetadata' from JSON`,
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/** @internal */
|
|
434
|
+
export const Card$inboundSchema: z.ZodType<Card, z.ZodTypeDef, unknown> = z
|
|
435
|
+
.object({
|
|
436
|
+
card_sub_type: z.string().optional(),
|
|
437
|
+
extended_card_type: z.string().optional(),
|
|
438
|
+
card_global_fingerprint: z.string().optional(),
|
|
439
|
+
nickname: z.string().optional(),
|
|
440
|
+
provider_category: z.string().optional(),
|
|
441
|
+
vault_provider: z.string().optional(),
|
|
442
|
+
card_reference: z.string().optional(),
|
|
443
|
+
card_type: z.string().optional(),
|
|
444
|
+
metadata: z.lazy(() => SavedPaymentMethodMetadata$inboundSchema).optional(),
|
|
445
|
+
card_issuer: z.string().optional(),
|
|
446
|
+
card_token: z.string().optional(),
|
|
447
|
+
card_exp_month: z.string().optional(),
|
|
448
|
+
provider: z.string().optional(),
|
|
449
|
+
card_sub_type_category: z.string().optional(),
|
|
450
|
+
expired: z.boolean().optional(),
|
|
451
|
+
card_fingerprint: z.string().optional(),
|
|
452
|
+
tokenize_support: z.boolean().optional(),
|
|
453
|
+
juspay_bank_code: z.string().optional(),
|
|
454
|
+
card_exp_year: z.string().optional(),
|
|
455
|
+
name_on_card: z.string().optional(),
|
|
456
|
+
country_code: z.string().optional(),
|
|
457
|
+
card_number: z.string().optional(),
|
|
458
|
+
card_isin: z.string().optional(),
|
|
459
|
+
card_brand: z.string().optional(),
|
|
460
|
+
card_issuer_country: z.string().optional(),
|
|
461
|
+
}).transform((v) => {
|
|
462
|
+
return remap$(v, {
|
|
463
|
+
"card_sub_type": "cardSubType",
|
|
464
|
+
"extended_card_type": "extendedCardType",
|
|
465
|
+
"card_global_fingerprint": "cardGlobalFingerprint",
|
|
466
|
+
"provider_category": "providerCategory",
|
|
467
|
+
"vault_provider": "vaultProvider",
|
|
468
|
+
"card_reference": "cardReference",
|
|
469
|
+
"card_type": "cardType",
|
|
470
|
+
"card_issuer": "cardIssuer",
|
|
471
|
+
"card_token": "cardToken",
|
|
472
|
+
"card_exp_month": "cardExpMonth",
|
|
473
|
+
"card_sub_type_category": "cardSubTypeCategory",
|
|
474
|
+
"card_fingerprint": "cardFingerprint",
|
|
475
|
+
"tokenize_support": "tokenizeSupport",
|
|
476
|
+
"juspay_bank_code": "juspayBankCode",
|
|
477
|
+
"card_exp_year": "cardExpYear",
|
|
478
|
+
"name_on_card": "nameOnCard",
|
|
479
|
+
"country_code": "countryCode",
|
|
480
|
+
"card_number": "cardNumber",
|
|
481
|
+
"card_isin": "cardIsin",
|
|
482
|
+
"card_brand": "cardBrand",
|
|
483
|
+
"card_issuer_country": "cardIssuerCountry",
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
/** @internal */
|
|
488
|
+
export type Card$Outbound = {
|
|
489
|
+
card_sub_type?: string | undefined;
|
|
490
|
+
extended_card_type?: string | undefined;
|
|
491
|
+
card_global_fingerprint?: string | undefined;
|
|
492
|
+
nickname?: string | undefined;
|
|
493
|
+
provider_category?: string | undefined;
|
|
494
|
+
vault_provider?: string | undefined;
|
|
495
|
+
card_reference?: string | undefined;
|
|
496
|
+
card_type?: string | undefined;
|
|
497
|
+
metadata?: SavedPaymentMethodMetadata$Outbound | undefined;
|
|
498
|
+
card_issuer?: string | undefined;
|
|
499
|
+
card_token?: string | undefined;
|
|
500
|
+
card_exp_month?: string | undefined;
|
|
501
|
+
provider?: string | undefined;
|
|
502
|
+
card_sub_type_category?: string | undefined;
|
|
503
|
+
expired?: boolean | undefined;
|
|
504
|
+
card_fingerprint?: string | undefined;
|
|
505
|
+
tokenize_support?: boolean | undefined;
|
|
506
|
+
juspay_bank_code?: string | undefined;
|
|
507
|
+
card_exp_year?: string | undefined;
|
|
508
|
+
name_on_card?: string | undefined;
|
|
509
|
+
country_code?: string | undefined;
|
|
510
|
+
card_number?: string | undefined;
|
|
511
|
+
card_isin?: string | undefined;
|
|
512
|
+
card_brand?: string | undefined;
|
|
513
|
+
card_issuer_country?: string | undefined;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
/** @internal */
|
|
517
|
+
export const Card$outboundSchema: z.ZodType<Card$Outbound, z.ZodTypeDef, Card> =
|
|
518
|
+
z.object({
|
|
519
|
+
cardSubType: z.string().optional(),
|
|
520
|
+
extendedCardType: z.string().optional(),
|
|
521
|
+
cardGlobalFingerprint: z.string().optional(),
|
|
522
|
+
nickname: z.string().optional(),
|
|
523
|
+
providerCategory: z.string().optional(),
|
|
524
|
+
vaultProvider: z.string().optional(),
|
|
525
|
+
cardReference: z.string().optional(),
|
|
526
|
+
cardType: z.string().optional(),
|
|
527
|
+
metadata: z.lazy(() => SavedPaymentMethodMetadata$outboundSchema)
|
|
528
|
+
.optional(),
|
|
529
|
+
cardIssuer: z.string().optional(),
|
|
530
|
+
cardToken: z.string().optional(),
|
|
531
|
+
cardExpMonth: z.string().optional(),
|
|
532
|
+
provider: z.string().optional(),
|
|
533
|
+
cardSubTypeCategory: z.string().optional(),
|
|
534
|
+
expired: z.boolean().optional(),
|
|
535
|
+
cardFingerprint: z.string().optional(),
|
|
536
|
+
tokenizeSupport: z.boolean().optional(),
|
|
537
|
+
juspayBankCode: z.string().optional(),
|
|
538
|
+
cardExpYear: z.string().optional(),
|
|
539
|
+
nameOnCard: z.string().optional(),
|
|
540
|
+
countryCode: z.string().optional(),
|
|
541
|
+
cardNumber: z.string().optional(),
|
|
542
|
+
cardIsin: z.string().optional(),
|
|
543
|
+
cardBrand: z.string().optional(),
|
|
544
|
+
cardIssuerCountry: z.string().optional(),
|
|
545
|
+
}).transform((v) => {
|
|
546
|
+
return remap$(v, {
|
|
547
|
+
cardSubType: "card_sub_type",
|
|
548
|
+
extendedCardType: "extended_card_type",
|
|
549
|
+
cardGlobalFingerprint: "card_global_fingerprint",
|
|
550
|
+
providerCategory: "provider_category",
|
|
551
|
+
vaultProvider: "vault_provider",
|
|
552
|
+
cardReference: "card_reference",
|
|
553
|
+
cardType: "card_type",
|
|
554
|
+
cardIssuer: "card_issuer",
|
|
555
|
+
cardToken: "card_token",
|
|
556
|
+
cardExpMonth: "card_exp_month",
|
|
557
|
+
cardSubTypeCategory: "card_sub_type_category",
|
|
558
|
+
cardFingerprint: "card_fingerprint",
|
|
559
|
+
tokenizeSupport: "tokenize_support",
|
|
560
|
+
juspayBankCode: "juspay_bank_code",
|
|
561
|
+
cardExpYear: "card_exp_year",
|
|
562
|
+
nameOnCard: "name_on_card",
|
|
563
|
+
countryCode: "country_code",
|
|
564
|
+
cardNumber: "card_number",
|
|
565
|
+
cardIsin: "card_isin",
|
|
566
|
+
cardBrand: "card_brand",
|
|
567
|
+
cardIssuerCountry: "card_issuer_country",
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* @internal
|
|
573
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
574
|
+
*/
|
|
575
|
+
export namespace Card$ {
|
|
576
|
+
/** @deprecated use `Card$inboundSchema` instead. */
|
|
577
|
+
export const inboundSchema = Card$inboundSchema;
|
|
578
|
+
/** @deprecated use `Card$outboundSchema` instead. */
|
|
579
|
+
export const outboundSchema = Card$outboundSchema;
|
|
580
|
+
/** @deprecated use `Card$Outbound` instead. */
|
|
581
|
+
export type Outbound = Card$Outbound;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export function cardToJSON(card: Card): string {
|
|
585
|
+
return JSON.stringify(Card$outboundSchema.parse(card));
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export function cardFromJSON(
|
|
589
|
+
jsonString: string,
|
|
590
|
+
): SafeParseResult<Card, SDKValidationError> {
|
|
591
|
+
return safeParse(
|
|
592
|
+
jsonString,
|
|
593
|
+
(x) => Card$inboundSchema.parse(JSON.parse(x)),
|
|
594
|
+
`Failed to parse 'Card' from JSON`,
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/** @internal */
|
|
599
|
+
export const SavedPaymentMethod$inboundSchema: z.ZodType<
|
|
600
|
+
SavedPaymentMethod,
|
|
601
|
+
z.ZodTypeDef,
|
|
602
|
+
unknown
|
|
603
|
+
> = z.object({
|
|
604
|
+
UPI_COLLECT: z.array(z.lazy(() => UpiCollect$inboundSchema)).optional(),
|
|
605
|
+
WALLET: z.array(z.lazy(() => Wallet$inboundSchema)).optional(),
|
|
606
|
+
CARD: z.array(z.lazy(() => Card$inboundSchema)).optional(),
|
|
607
|
+
}).transform((v) => {
|
|
608
|
+
return remap$(v, {
|
|
609
|
+
"UPI_COLLECT": "upiCollect",
|
|
610
|
+
"WALLET": "wallet",
|
|
611
|
+
"CARD": "card",
|
|
612
|
+
});
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
/** @internal */
|
|
616
|
+
export type SavedPaymentMethod$Outbound = {
|
|
617
|
+
UPI_COLLECT?: Array<UpiCollect$Outbound> | undefined;
|
|
618
|
+
WALLET?: Array<Wallet$Outbound> | undefined;
|
|
619
|
+
CARD?: Array<Card$Outbound> | undefined;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
/** @internal */
|
|
623
|
+
export const SavedPaymentMethod$outboundSchema: z.ZodType<
|
|
624
|
+
SavedPaymentMethod$Outbound,
|
|
625
|
+
z.ZodTypeDef,
|
|
626
|
+
SavedPaymentMethod
|
|
627
|
+
> = z.object({
|
|
628
|
+
upiCollect: z.array(z.lazy(() => UpiCollect$outboundSchema)).optional(),
|
|
629
|
+
wallet: z.array(z.lazy(() => Wallet$outboundSchema)).optional(),
|
|
630
|
+
card: z.array(z.lazy(() => Card$outboundSchema)).optional(),
|
|
631
|
+
}).transform((v) => {
|
|
632
|
+
return remap$(v, {
|
|
633
|
+
upiCollect: "UPI_COLLECT",
|
|
634
|
+
wallet: "WALLET",
|
|
635
|
+
card: "CARD",
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* @internal
|
|
641
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
642
|
+
*/
|
|
643
|
+
export namespace SavedPaymentMethod$ {
|
|
644
|
+
/** @deprecated use `SavedPaymentMethod$inboundSchema` instead. */
|
|
645
|
+
export const inboundSchema = SavedPaymentMethod$inboundSchema;
|
|
646
|
+
/** @deprecated use `SavedPaymentMethod$outboundSchema` instead. */
|
|
647
|
+
export const outboundSchema = SavedPaymentMethod$outboundSchema;
|
|
648
|
+
/** @deprecated use `SavedPaymentMethod$Outbound` instead. */
|
|
649
|
+
export type Outbound = SavedPaymentMethod$Outbound;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export function savedPaymentMethodToJSON(
|
|
653
|
+
savedPaymentMethod: SavedPaymentMethod,
|
|
654
|
+
): string {
|
|
655
|
+
return JSON.stringify(
|
|
656
|
+
SavedPaymentMethod$outboundSchema.parse(savedPaymentMethod),
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export function savedPaymentMethodFromJSON(
|
|
661
|
+
jsonString: string,
|
|
662
|
+
): SafeParseResult<SavedPaymentMethod, SDKValidationError> {
|
|
663
|
+
return safeParse(
|
|
664
|
+
jsonString,
|
|
665
|
+
(x) => SavedPaymentMethod$inboundSchema.parse(JSON.parse(x)),
|
|
666
|
+
`Failed to parse 'SavedPaymentMethod' from JSON`,
|
|
667
|
+
);
|
|
668
|
+
}
|
|
@@ -33,6 +33,7 @@ export * from "./listordershipments.js";
|
|
|
33
33
|
export * from "./listproductreviews.js";
|
|
34
34
|
export * from "./listproducts.js";
|
|
35
35
|
export * from "./listproductvariants.js";
|
|
36
|
+
export * from "./listsavedpaymentmethods.js";
|
|
36
37
|
export * from "./listsimilarproducts.js";
|
|
37
38
|
export * from "./listskus.js";
|
|
38
39
|
export * from "./listupsellproducts.js";
|