ce-storefront 0.12.5 → 0.13.0
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/docs/sdks/auth/README.md +20 -13
- package/docs/sdks/carts/README.md +8 -3
- package/docs/sdks/catalog/README.md +6 -3
- package/docs/sdks/common/README.md +6 -3
- package/docs/sdks/customers/README.md +12 -6
- package/docs/sdks/orders/README.md +6 -3
- package/docs/sdks/shipping/README.md +15 -6
- package/esm/funcs/authGenerateOtp.d.ts +2 -1
- package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
- package/esm/funcs/authGenerateOtp.js +8 -2
- package/esm/funcs/authGenerateOtp.js.map +1 -1
- package/esm/funcs/authGetAnonymousToken.js +2 -0
- package/esm/funcs/authGetAnonymousToken.js.map +1 -1
- package/esm/funcs/authGetUserDetail.js +2 -0
- package/esm/funcs/authGetUserDetail.js.map +1 -1
- package/esm/funcs/authLoginWithEmail.js +2 -0
- package/esm/funcs/authLoginWithEmail.js.map +1 -1
- package/esm/funcs/authLoginWithPhone.js +2 -0
- package/esm/funcs/authLoginWithPhone.js.map +1 -1
- package/esm/funcs/authLoginWithWhatsapp.d.ts +2 -1
- package/esm/funcs/authLoginWithWhatsapp.d.ts.map +1 -1
- package/esm/funcs/authLoginWithWhatsapp.js +8 -2
- package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
- package/esm/funcs/authLogout.d.ts +2 -1
- package/esm/funcs/authLogout.d.ts.map +1 -1
- package/esm/funcs/authLogout.js +8 -2
- package/esm/funcs/authLogout.js.map +1 -1
- package/esm/funcs/authRefreshToken.js +2 -0
- package/esm/funcs/authRefreshToken.js.map +1 -1
- package/esm/funcs/authUpdateUser.js +2 -0
- package/esm/funcs/authUpdateUser.js.map +1 -1
- package/esm/funcs/authVerifyOtp.js +2 -0
- package/esm/funcs/authVerifyOtp.js.map +1 -1
- package/esm/funcs/cartsAddShippingMethod.js +2 -0
- package/esm/funcs/cartsAddShippingMethod.js.map +1 -1
- package/esm/funcs/cartsApplyCoupon.js +2 -0
- package/esm/funcs/cartsApplyCoupon.js.map +1 -1
- package/esm/funcs/cartsCreateCart.d.ts +2 -1
- package/esm/funcs/cartsCreateCart.d.ts.map +1 -1
- package/esm/funcs/cartsCreateCart.js +8 -2
- package/esm/funcs/cartsCreateCart.js.map +1 -1
- package/esm/funcs/cartsCreateCartAddress.js +2 -0
- package/esm/funcs/cartsCreateCartAddress.js.map +1 -1
- package/esm/funcs/cartsDeleteCart.js +2 -0
- package/esm/funcs/cartsDeleteCart.js.map +1 -1
- package/esm/funcs/cartsGetCart.js +2 -0
- package/esm/funcs/cartsGetCart.js.map +1 -1
- package/esm/funcs/cartsGetUserCart.js +2 -0
- package/esm/funcs/cartsGetUserCart.js.map +1 -1
- package/esm/funcs/cartsRedeemLoyaltyPoints.js +2 -0
- package/esm/funcs/cartsRedeemLoyaltyPoints.js.map +1 -1
- package/esm/funcs/cartsRemoveCoupon.js +2 -0
- package/esm/funcs/cartsRemoveCoupon.js.map +1 -1
- package/esm/funcs/cartsRemoveLoyaltyPoints.js +2 -0
- package/esm/funcs/cartsRemoveLoyaltyPoints.js.map +1 -1
- package/esm/funcs/cartsRemoveUserCart.js +2 -0
- package/esm/funcs/cartsRemoveUserCart.js.map +1 -1
- package/esm/funcs/cartsUpdateCart.js +2 -0
- package/esm/funcs/cartsUpdateCart.js.map +1 -1
- package/esm/funcs/catalogGetProductDetail.js +2 -0
- package/esm/funcs/catalogGetProductDetail.js.map +1 -1
- package/esm/funcs/catalogGetVariantDetail.js +2 -0
- package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
- package/esm/funcs/catalogListCategories.d.ts +2 -1
- package/esm/funcs/catalogListCategories.d.ts.map +1 -1
- package/esm/funcs/catalogListCategories.js +8 -2
- package/esm/funcs/catalogListCategories.js.map +1 -1
- package/esm/funcs/catalogListCrosssellProducts.js +2 -0
- package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
- package/esm/funcs/catalogListProductReviews.js +2 -0
- package/esm/funcs/catalogListProductReviews.js.map +1 -1
- package/esm/funcs/catalogListProductVariants.js +2 -0
- package/esm/funcs/catalogListProductVariants.js.map +1 -1
- package/esm/funcs/catalogListProducts.js +2 -0
- package/esm/funcs/catalogListProducts.js.map +1 -1
- package/esm/funcs/catalogListSimilarProducts.js +2 -0
- package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
- package/esm/funcs/catalogListSkus.js +2 -0
- package/esm/funcs/catalogListSkus.js.map +1 -1
- package/esm/funcs/catalogListUpsellProducts.js +2 -0
- package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
- package/esm/funcs/catalogSearchProducts.js +2 -0
- package/esm/funcs/catalogSearchProducts.js.map +1 -1
- package/esm/funcs/commonListCountryPincodes.d.ts +2 -1
- package/esm/funcs/commonListCountryPincodes.d.ts.map +1 -1
- package/esm/funcs/commonListCountryPincodes.js +8 -2
- package/esm/funcs/commonListCountryPincodes.js.map +1 -1
- package/esm/funcs/customersCreateAddress.js +2 -0
- package/esm/funcs/customersCreateAddress.js.map +1 -1
- package/esm/funcs/customersDeleteAddress.js +2 -0
- package/esm/funcs/customersDeleteAddress.js.map +1 -1
- package/esm/funcs/customersGetAddressDetail.js +2 -0
- package/esm/funcs/customersGetAddressDetail.js.map +1 -1
- package/esm/funcs/customersGetLoyaltyDetails.js +2 -0
- package/esm/funcs/customersGetLoyaltyDetails.js.map +1 -1
- package/esm/funcs/customersListAddresses.d.ts +2 -1
- package/esm/funcs/customersListAddresses.d.ts.map +1 -1
- package/esm/funcs/customersListAddresses.js +8 -2
- package/esm/funcs/customersListAddresses.js.map +1 -1
- package/esm/funcs/customersListUserReviews.d.ts +2 -1
- package/esm/funcs/customersListUserReviews.d.ts.map +1 -1
- package/esm/funcs/customersListUserReviews.js +8 -2
- package/esm/funcs/customersListUserReviews.js.map +1 -1
- package/esm/funcs/customersUpdateAddressDetail.js +2 -0
- package/esm/funcs/customersUpdateAddressDetail.js.map +1 -1
- package/esm/funcs/ordersCancelOrder.js +2 -0
- package/esm/funcs/ordersCancelOrder.js.map +1 -1
- package/esm/funcs/ordersCreateOrder.js +2 -0
- package/esm/funcs/ordersCreateOrder.js.map +1 -1
- package/esm/funcs/ordersGetOrderDetail.js +2 -0
- package/esm/funcs/ordersGetOrderDetail.js.map +1 -1
- package/esm/funcs/ordersGetPaymentStatus.d.ts +2 -1
- package/esm/funcs/ordersGetPaymentStatus.d.ts.map +1 -1
- package/esm/funcs/ordersGetPaymentStatus.js +8 -2
- package/esm/funcs/ordersGetPaymentStatus.js.map +1 -1
- package/esm/funcs/ordersListOrderShipments.js +2 -0
- package/esm/funcs/ordersListOrderShipments.js.map +1 -1
- package/esm/funcs/ordersListOrders.js +2 -0
- package/esm/funcs/ordersListOrders.js.map +1 -1
- package/esm/funcs/ordersRetryOrderPayment.js +2 -0
- package/esm/funcs/ordersRetryOrderPayment.js.map +1 -1
- package/esm/funcs/shippingShippingMethods.d.ts +3 -1
- package/esm/funcs/shippingShippingMethods.d.ts.map +1 -1
- package/esm/funcs/shippingShippingMethods.js +11 -6
- package/esm/funcs/shippingShippingMethods.js.map +1 -1
- package/esm/hooks/types.d.ts +2 -0
- package/esm/hooks/types.d.ts.map +1 -1
- package/esm/lib/config.d.ts +7 -3
- package/esm/lib/config.d.ts.map +1 -1
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/sdks.d.ts +1 -0
- package/esm/lib/sdks.d.ts.map +1 -1
- package/esm/lib/sdks.js +3 -3
- package/esm/lib/sdks.js.map +1 -1
- package/esm/models/components/appliedcoupon.d.ts +85 -0
- package/esm/models/components/appliedcoupon.d.ts.map +1 -0
- package/esm/models/components/appliedcoupon.js +87 -0
- package/esm/models/components/appliedcoupon.js.map +1 -0
- package/esm/models/components/appliedpromotion.d.ts +83 -0
- package/esm/models/components/appliedpromotion.d.ts.map +1 -0
- package/esm/models/components/appliedpromotion.js +90 -0
- package/esm/models/components/appliedpromotion.js.map +1 -0
- package/esm/models/components/cart.d.ts +6 -153
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +6 -161
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/generateotpwithemail.d.ts +65 -0
- package/esm/models/components/generateotpwithemail.d.ts.map +1 -0
- package/esm/models/components/generateotpwithemail.js +65 -0
- package/esm/models/components/generateotpwithemail.js.map +1 -0
- package/esm/models/components/generateotpwithphone.d.ts +98 -0
- package/esm/models/components/generateotpwithphone.d.ts.map +1 -0
- package/esm/models/components/generateotpwithphone.js +90 -0
- package/esm/models/components/generateotpwithphone.js.map +1 -0
- package/esm/models/components/index.d.ts +4 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +4 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/order.d.ts +6 -181
- package/esm/models/components/order.d.ts.map +1 -1
- package/esm/models/components/order.js +6 -185
- package/esm/models/components/order.js.map +1 -1
- package/esm/models/components/orderdetail.d.ts +6 -181
- package/esm/models/components/orderdetail.d.ts.map +1 -1
- package/esm/models/components/orderdetail.js +6 -185
- package/esm/models/components/orderdetail.js.map +1 -1
- package/esm/models/operations/generateotp.d.ts +3 -104
- package/esm/models/operations/generateotp.d.ts.map +1 -1
- package/esm/models/operations/generateotp.js +9 -72
- package/esm/models/operations/generateotp.js.map +1 -1
- package/esm/models/operations/getshippingmethods.d.ts +0 -21
- package/esm/models/operations/getshippingmethods.d.ts.map +1 -1
- package/esm/models/operations/getshippingmethods.js +0 -21
- package/esm/models/operations/getshippingmethods.js.map +1 -1
- package/esm/models/operations/updateshippingmethod.d.ts +9 -33
- package/esm/models/operations/updateshippingmethod.d.ts.map +1 -1
- package/esm/models/operations/updateshippingmethod.js +6 -27
- package/esm/models/operations/updateshippingmethod.js.map +1 -1
- package/esm/sdk/shipping.d.ts +2 -1
- package/esm/sdk/shipping.d.ts.map +1 -1
- package/esm/sdk/shipping.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/authGenerateOtp.ts +17 -2
- package/src/funcs/authGetAnonymousToken.ts +2 -0
- package/src/funcs/authGetUserDetail.ts +2 -0
- package/src/funcs/authLoginWithEmail.ts +2 -0
- package/src/funcs/authLoginWithPhone.ts +2 -0
- package/src/funcs/authLoginWithWhatsapp.ts +17 -2
- package/src/funcs/authLogout.ts +21 -2
- package/src/funcs/authRefreshToken.ts +2 -0
- package/src/funcs/authUpdateUser.ts +2 -0
- package/src/funcs/authVerifyOtp.ts +2 -0
- package/src/funcs/cartsAddShippingMethod.ts +2 -0
- package/src/funcs/cartsApplyCoupon.ts +2 -0
- package/src/funcs/cartsCreateCart.ts +21 -2
- package/src/funcs/cartsCreateCartAddress.ts +2 -0
- package/src/funcs/cartsDeleteCart.ts +2 -0
- package/src/funcs/cartsGetCart.ts +2 -0
- package/src/funcs/cartsGetUserCart.ts +2 -0
- package/src/funcs/cartsRedeemLoyaltyPoints.ts +2 -0
- package/src/funcs/cartsRemoveCoupon.ts +2 -0
- package/src/funcs/cartsRemoveLoyaltyPoints.ts +2 -0
- package/src/funcs/cartsRemoveUserCart.ts +2 -0
- package/src/funcs/cartsUpdateCart.ts +2 -0
- package/src/funcs/catalogGetProductDetail.ts +2 -0
- package/src/funcs/catalogGetVariantDetail.ts +2 -0
- package/src/funcs/catalogListCategories.ts +21 -2
- package/src/funcs/catalogListCrosssellProducts.ts +2 -0
- package/src/funcs/catalogListProductReviews.ts +2 -0
- package/src/funcs/catalogListProductVariants.ts +2 -0
- package/src/funcs/catalogListProducts.ts +2 -0
- package/src/funcs/catalogListSimilarProducts.ts +2 -0
- package/src/funcs/catalogListSkus.ts +2 -0
- package/src/funcs/catalogListUpsellProducts.ts +2 -0
- package/src/funcs/catalogSearchProducts.ts +2 -0
- package/src/funcs/commonListCountryPincodes.ts +21 -2
- package/src/funcs/customersCreateAddress.ts +2 -0
- package/src/funcs/customersDeleteAddress.ts +2 -0
- package/src/funcs/customersGetAddressDetail.ts +2 -0
- package/src/funcs/customersGetLoyaltyDetails.ts +2 -0
- package/src/funcs/customersListAddresses.ts +21 -2
- package/src/funcs/customersListUserReviews.ts +21 -2
- package/src/funcs/customersUpdateAddressDetail.ts +2 -0
- package/src/funcs/ordersCancelOrder.ts +2 -0
- package/src/funcs/ordersCreateOrder.ts +2 -0
- package/src/funcs/ordersGetOrderDetail.ts +2 -0
- package/src/funcs/ordersGetPaymentStatus.ts +21 -2
- package/src/funcs/ordersListOrderShipments.ts +2 -0
- package/src/funcs/ordersListOrders.ts +2 -0
- package/src/funcs/ordersRetryOrderPayment.ts +2 -0
- package/src/funcs/shippingShippingMethods.ts +26 -10
- package/src/hooks/types.ts +2 -0
- package/src/lib/config.ts +7 -3
- package/src/lib/sdks.ts +10 -4
- package/src/models/components/appliedcoupon.ts +139 -0
- package/src/models/components/appliedpromotion.ts +153 -0
- package/src/models/components/cart.ts +20 -265
- package/src/models/components/generateotpwithemail.ts +115 -0
- package/src/models/components/generateotpwithphone.ts +148 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/order.ts +20 -310
- package/src/models/components/orderdetail.ts +20 -319
- package/src/models/operations/generateotp.ts +15 -118
- package/src/models/operations/getshippingmethods.ts +0 -54
- package/src/models/operations/updateshippingmethod.ts +15 -69
- package/src/sdk/shipping.ts +2 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const GenerateOtpWithEmailOtpAction = {
|
|
13
|
+
Register: "register",
|
|
14
|
+
ResetPassword: "reset-password",
|
|
15
|
+
VerifyEmail: "verify-email",
|
|
16
|
+
UpdateEmail: "update-email",
|
|
17
|
+
} as const;
|
|
18
|
+
export type GenerateOtpWithEmailOtpAction = ClosedEnum<
|
|
19
|
+
typeof GenerateOtpWithEmailOtpAction
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type GenerateOtpWithEmail = {
|
|
23
|
+
channel?: "email" | undefined;
|
|
24
|
+
email: string;
|
|
25
|
+
otpAction: GenerateOtpWithEmailOtpAction;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const GenerateOtpWithEmailOtpAction$inboundSchema: z.ZodNativeEnum<
|
|
30
|
+
typeof GenerateOtpWithEmailOtpAction
|
|
31
|
+
> = z.nativeEnum(GenerateOtpWithEmailOtpAction);
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const GenerateOtpWithEmailOtpAction$outboundSchema: z.ZodNativeEnum<
|
|
35
|
+
typeof GenerateOtpWithEmailOtpAction
|
|
36
|
+
> = GenerateOtpWithEmailOtpAction$inboundSchema;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
41
|
+
*/
|
|
42
|
+
export namespace GenerateOtpWithEmailOtpAction$ {
|
|
43
|
+
/** @deprecated use `GenerateOtpWithEmailOtpAction$inboundSchema` instead. */
|
|
44
|
+
export const inboundSchema = GenerateOtpWithEmailOtpAction$inboundSchema;
|
|
45
|
+
/** @deprecated use `GenerateOtpWithEmailOtpAction$outboundSchema` instead. */
|
|
46
|
+
export const outboundSchema = GenerateOtpWithEmailOtpAction$outboundSchema;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const GenerateOtpWithEmail$inboundSchema: z.ZodType<
|
|
51
|
+
GenerateOtpWithEmail,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
unknown
|
|
54
|
+
> = z.object({
|
|
55
|
+
channel: z.literal("email").optional(),
|
|
56
|
+
email: z.string(),
|
|
57
|
+
otp_action: GenerateOtpWithEmailOtpAction$inboundSchema,
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
"otp_action": "otpAction",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export type GenerateOtpWithEmail$Outbound = {
|
|
66
|
+
channel: "email";
|
|
67
|
+
email: string;
|
|
68
|
+
otp_action: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const GenerateOtpWithEmail$outboundSchema: z.ZodType<
|
|
73
|
+
GenerateOtpWithEmail$Outbound,
|
|
74
|
+
z.ZodTypeDef,
|
|
75
|
+
GenerateOtpWithEmail
|
|
76
|
+
> = z.object({
|
|
77
|
+
channel: z.literal("email").default("email" as const),
|
|
78
|
+
email: z.string(),
|
|
79
|
+
otpAction: GenerateOtpWithEmailOtpAction$outboundSchema,
|
|
80
|
+
}).transform((v) => {
|
|
81
|
+
return remap$(v, {
|
|
82
|
+
otpAction: "otp_action",
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
89
|
+
*/
|
|
90
|
+
export namespace GenerateOtpWithEmail$ {
|
|
91
|
+
/** @deprecated use `GenerateOtpWithEmail$inboundSchema` instead. */
|
|
92
|
+
export const inboundSchema = GenerateOtpWithEmail$inboundSchema;
|
|
93
|
+
/** @deprecated use `GenerateOtpWithEmail$outboundSchema` instead. */
|
|
94
|
+
export const outboundSchema = GenerateOtpWithEmail$outboundSchema;
|
|
95
|
+
/** @deprecated use `GenerateOtpWithEmail$Outbound` instead. */
|
|
96
|
+
export type Outbound = GenerateOtpWithEmail$Outbound;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function generateOtpWithEmailToJSON(
|
|
100
|
+
generateOtpWithEmail: GenerateOtpWithEmail,
|
|
101
|
+
): string {
|
|
102
|
+
return JSON.stringify(
|
|
103
|
+
GenerateOtpWithEmail$outboundSchema.parse(generateOtpWithEmail),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function generateOtpWithEmailFromJSON(
|
|
108
|
+
jsonString: string,
|
|
109
|
+
): SafeParseResult<GenerateOtpWithEmail, SDKValidationError> {
|
|
110
|
+
return safeParse(
|
|
111
|
+
jsonString,
|
|
112
|
+
(x) => GenerateOtpWithEmail$inboundSchema.parse(JSON.parse(x)),
|
|
113
|
+
`Failed to parse 'GenerateOtpWithEmail' from JSON`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const Channel = {
|
|
13
|
+
Sms: "sms",
|
|
14
|
+
Whatsapp: "whatsapp",
|
|
15
|
+
} as const;
|
|
16
|
+
export type Channel = ClosedEnum<typeof Channel>;
|
|
17
|
+
|
|
18
|
+
export const OtpAction = {
|
|
19
|
+
Register: "register",
|
|
20
|
+
ResetPassword: "reset-password",
|
|
21
|
+
VerifyPhone: "verify-phone",
|
|
22
|
+
UpdatePhone: "update-phone",
|
|
23
|
+
} as const;
|
|
24
|
+
export type OtpAction = ClosedEnum<typeof OtpAction>;
|
|
25
|
+
|
|
26
|
+
export type GenerateOtpWithPhone = {
|
|
27
|
+
channel: Channel;
|
|
28
|
+
/**
|
|
29
|
+
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
30
|
+
*/
|
|
31
|
+
countryCode?: string | null | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* 10 digit phone number without country code.
|
|
34
|
+
*/
|
|
35
|
+
phone: string;
|
|
36
|
+
otpAction: OtpAction;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const Channel$inboundSchema: z.ZodNativeEnum<typeof Channel> = z
|
|
41
|
+
.nativeEnum(Channel);
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const Channel$outboundSchema: z.ZodNativeEnum<typeof Channel> =
|
|
45
|
+
Channel$inboundSchema;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
50
|
+
*/
|
|
51
|
+
export namespace Channel$ {
|
|
52
|
+
/** @deprecated use `Channel$inboundSchema` instead. */
|
|
53
|
+
export const inboundSchema = Channel$inboundSchema;
|
|
54
|
+
/** @deprecated use `Channel$outboundSchema` instead. */
|
|
55
|
+
export const outboundSchema = Channel$outboundSchema;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const OtpAction$inboundSchema: z.ZodNativeEnum<typeof OtpAction> = z
|
|
60
|
+
.nativeEnum(OtpAction);
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const OtpAction$outboundSchema: z.ZodNativeEnum<typeof OtpAction> =
|
|
64
|
+
OtpAction$inboundSchema;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
69
|
+
*/
|
|
70
|
+
export namespace OtpAction$ {
|
|
71
|
+
/** @deprecated use `OtpAction$inboundSchema` instead. */
|
|
72
|
+
export const inboundSchema = OtpAction$inboundSchema;
|
|
73
|
+
/** @deprecated use `OtpAction$outboundSchema` instead. */
|
|
74
|
+
export const outboundSchema = OtpAction$outboundSchema;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const GenerateOtpWithPhone$inboundSchema: z.ZodType<
|
|
79
|
+
GenerateOtpWithPhone,
|
|
80
|
+
z.ZodTypeDef,
|
|
81
|
+
unknown
|
|
82
|
+
> = z.object({
|
|
83
|
+
channel: Channel$inboundSchema,
|
|
84
|
+
country_code: z.nullable(z.string()).optional(),
|
|
85
|
+
phone: z.string(),
|
|
86
|
+
otp_action: OtpAction$inboundSchema,
|
|
87
|
+
}).transform((v) => {
|
|
88
|
+
return remap$(v, {
|
|
89
|
+
"country_code": "countryCode",
|
|
90
|
+
"otp_action": "otpAction",
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/** @internal */
|
|
95
|
+
export type GenerateOtpWithPhone$Outbound = {
|
|
96
|
+
channel: string;
|
|
97
|
+
country_code?: string | null | undefined;
|
|
98
|
+
phone: string;
|
|
99
|
+
otp_action: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** @internal */
|
|
103
|
+
export const GenerateOtpWithPhone$outboundSchema: z.ZodType<
|
|
104
|
+
GenerateOtpWithPhone$Outbound,
|
|
105
|
+
z.ZodTypeDef,
|
|
106
|
+
GenerateOtpWithPhone
|
|
107
|
+
> = z.object({
|
|
108
|
+
channel: Channel$outboundSchema,
|
|
109
|
+
countryCode: z.nullable(z.string()).optional(),
|
|
110
|
+
phone: z.string(),
|
|
111
|
+
otpAction: OtpAction$outboundSchema,
|
|
112
|
+
}).transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
countryCode: "country_code",
|
|
115
|
+
otpAction: "otp_action",
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
122
|
+
*/
|
|
123
|
+
export namespace GenerateOtpWithPhone$ {
|
|
124
|
+
/** @deprecated use `GenerateOtpWithPhone$inboundSchema` instead. */
|
|
125
|
+
export const inboundSchema = GenerateOtpWithPhone$inboundSchema;
|
|
126
|
+
/** @deprecated use `GenerateOtpWithPhone$outboundSchema` instead. */
|
|
127
|
+
export const outboundSchema = GenerateOtpWithPhone$outboundSchema;
|
|
128
|
+
/** @deprecated use `GenerateOtpWithPhone$Outbound` instead. */
|
|
129
|
+
export type Outbound = GenerateOtpWithPhone$Outbound;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function generateOtpWithPhoneToJSON(
|
|
133
|
+
generateOtpWithPhone: GenerateOtpWithPhone,
|
|
134
|
+
): string {
|
|
135
|
+
return JSON.stringify(
|
|
136
|
+
GenerateOtpWithPhone$outboundSchema.parse(generateOtpWithPhone),
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function generateOtpWithPhoneFromJSON(
|
|
141
|
+
jsonString: string,
|
|
142
|
+
): SafeParseResult<GenerateOtpWithPhone, SDKValidationError> {
|
|
143
|
+
return safeParse(
|
|
144
|
+
jsonString,
|
|
145
|
+
(x) => GenerateOtpWithPhone$inboundSchema.parse(JSON.parse(x)),
|
|
146
|
+
`Failed to parse 'GenerateOtpWithPhone' from JSON`,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export * from "./anonymoususer.js";
|
|
6
|
+
export * from "./appliedcoupon.js";
|
|
7
|
+
export * from "./appliedpromotion.js";
|
|
6
8
|
export * from "./associatedoption.js";
|
|
7
9
|
export * from "./banktransfer.js";
|
|
8
10
|
export * from "./booleanattribute.js";
|
|
@@ -23,6 +25,8 @@ export * from "./dateattribute.js";
|
|
|
23
25
|
export * from "./discountbasedpromotion.js";
|
|
24
26
|
export * from "./fixedpricepromotion.js";
|
|
25
27
|
export * from "./freegoodspromotion.js";
|
|
28
|
+
export * from "./generateotpwithemail.js";
|
|
29
|
+
export * from "./generateotpwithphone.js";
|
|
26
30
|
export * from "./item.js";
|
|
27
31
|
export * from "./juspaypaymentgatewayparams.js";
|
|
28
32
|
export * from "./juspaypaymentinfo.js";
|
|
@@ -8,6 +8,18 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
AppliedCoupon,
|
|
13
|
+
AppliedCoupon$inboundSchema,
|
|
14
|
+
AppliedCoupon$Outbound,
|
|
15
|
+
AppliedCoupon$outboundSchema,
|
|
16
|
+
} from "./appliedcoupon.js";
|
|
17
|
+
import {
|
|
18
|
+
AppliedPromotion,
|
|
19
|
+
AppliedPromotion$inboundSchema,
|
|
20
|
+
AppliedPromotion$Outbound,
|
|
21
|
+
AppliedPromotion$outboundSchema,
|
|
22
|
+
} from "./appliedpromotion.js";
|
|
11
23
|
import {
|
|
12
24
|
CustomerAddress,
|
|
13
25
|
CustomerAddress$inboundSchema,
|
|
@@ -48,54 +60,6 @@ export const PaymentStatus = {
|
|
|
48
60
|
} as const;
|
|
49
61
|
export type PaymentStatus = ClosedEnum<typeof PaymentStatus>;
|
|
50
62
|
|
|
51
|
-
export const OrderPromotionType = {
|
|
52
|
-
Discount: "discount",
|
|
53
|
-
FreeGoods: "free-goods",
|
|
54
|
-
FreeShipping: "free-shipping",
|
|
55
|
-
BuyXGetY: "buy-x-get-y",
|
|
56
|
-
VolumeBased: "volume-based",
|
|
57
|
-
} as const;
|
|
58
|
-
export type OrderPromotionType = ClosedEnum<typeof OrderPromotionType>;
|
|
59
|
-
|
|
60
|
-
export const Scope = {
|
|
61
|
-
Catalog: "catalog",
|
|
62
|
-
Global: "global",
|
|
63
|
-
} as const;
|
|
64
|
-
export type Scope = ClosedEnum<typeof Scope>;
|
|
65
|
-
|
|
66
|
-
export type OrderAppliedPromotions = {
|
|
67
|
-
promotionId: string;
|
|
68
|
-
promotionType: OrderPromotionType;
|
|
69
|
-
savings: number;
|
|
70
|
-
productId: string | null;
|
|
71
|
-
productName: string | null;
|
|
72
|
-
variantId: string | null;
|
|
73
|
-
variantName: string | null;
|
|
74
|
-
scope: Scope;
|
|
75
|
-
appliedSequence: number;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const OrderCouponType = {
|
|
79
|
-
Discount: "discount",
|
|
80
|
-
FreeGoods: "free-goods",
|
|
81
|
-
FixedPrice: "fixed-price",
|
|
82
|
-
FreeShipping: "free-shipping",
|
|
83
|
-
BuyXGetY: "buy-x-get-y",
|
|
84
|
-
VolumeBased: "volume-based",
|
|
85
|
-
AcceleratedRewards: "accelerated-rewards",
|
|
86
|
-
} as const;
|
|
87
|
-
export type OrderCouponType = ClosedEnum<typeof OrderCouponType>;
|
|
88
|
-
|
|
89
|
-
export type OrderAppliedCoupons = {
|
|
90
|
-
couponId: string;
|
|
91
|
-
couponType: OrderCouponType;
|
|
92
|
-
savings: number;
|
|
93
|
-
productId: string | null;
|
|
94
|
-
productName: string | null;
|
|
95
|
-
variantId: string | null;
|
|
96
|
-
variantName: string | null;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
63
|
export type OrderCurrency = {
|
|
100
64
|
name?: string | undefined;
|
|
101
65
|
code?: string | undefined;
|
|
@@ -157,11 +121,11 @@ export type Order = {
|
|
|
157
121
|
/**
|
|
158
122
|
* Information about the promotional offers that have been applied to the cart.
|
|
159
123
|
*/
|
|
160
|
-
appliedPromotions: Array<
|
|
124
|
+
appliedPromotions: Array<AppliedPromotion>;
|
|
161
125
|
/**
|
|
162
126
|
* This key provides details about the savings in cart after coupon have been applied to the cart.
|
|
163
127
|
*/
|
|
164
|
-
appliedCoupons: Array<
|
|
128
|
+
appliedCoupons: Array<AppliedCoupon>;
|
|
165
129
|
promotionSavings?: number | undefined;
|
|
166
130
|
couponSavings?: number | undefined;
|
|
167
131
|
otherSavings?: number | undefined;
|
|
@@ -246,256 +210,6 @@ export namespace PaymentStatus$ {
|
|
|
246
210
|
export const outboundSchema = PaymentStatus$outboundSchema;
|
|
247
211
|
}
|
|
248
212
|
|
|
249
|
-
/** @internal */
|
|
250
|
-
export const OrderPromotionType$inboundSchema: z.ZodNativeEnum<
|
|
251
|
-
typeof OrderPromotionType
|
|
252
|
-
> = z.nativeEnum(OrderPromotionType);
|
|
253
|
-
|
|
254
|
-
/** @internal */
|
|
255
|
-
export const OrderPromotionType$outboundSchema: z.ZodNativeEnum<
|
|
256
|
-
typeof OrderPromotionType
|
|
257
|
-
> = OrderPromotionType$inboundSchema;
|
|
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 OrderPromotionType$ {
|
|
264
|
-
/** @deprecated use `OrderPromotionType$inboundSchema` instead. */
|
|
265
|
-
export const inboundSchema = OrderPromotionType$inboundSchema;
|
|
266
|
-
/** @deprecated use `OrderPromotionType$outboundSchema` instead. */
|
|
267
|
-
export const outboundSchema = OrderPromotionType$outboundSchema;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/** @internal */
|
|
271
|
-
export const Scope$inboundSchema: z.ZodNativeEnum<typeof Scope> = z.nativeEnum(
|
|
272
|
-
Scope,
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
/** @internal */
|
|
276
|
-
export const Scope$outboundSchema: z.ZodNativeEnum<typeof Scope> =
|
|
277
|
-
Scope$inboundSchema;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* @internal
|
|
281
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
282
|
-
*/
|
|
283
|
-
export namespace Scope$ {
|
|
284
|
-
/** @deprecated use `Scope$inboundSchema` instead. */
|
|
285
|
-
export const inboundSchema = Scope$inboundSchema;
|
|
286
|
-
/** @deprecated use `Scope$outboundSchema` instead. */
|
|
287
|
-
export const outboundSchema = Scope$outboundSchema;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/** @internal */
|
|
291
|
-
export const OrderAppliedPromotions$inboundSchema: z.ZodType<
|
|
292
|
-
OrderAppliedPromotions,
|
|
293
|
-
z.ZodTypeDef,
|
|
294
|
-
unknown
|
|
295
|
-
> = z.object({
|
|
296
|
-
promotion_id: z.string(),
|
|
297
|
-
promotion_type: OrderPromotionType$inboundSchema,
|
|
298
|
-
savings: z.number(),
|
|
299
|
-
product_id: z.nullable(z.string()),
|
|
300
|
-
product_name: z.nullable(z.string()),
|
|
301
|
-
variant_id: z.nullable(z.string()),
|
|
302
|
-
variant_name: z.nullable(z.string()),
|
|
303
|
-
scope: Scope$inboundSchema,
|
|
304
|
-
applied_sequence: z.number().int(),
|
|
305
|
-
}).transform((v) => {
|
|
306
|
-
return remap$(v, {
|
|
307
|
-
"promotion_id": "promotionId",
|
|
308
|
-
"promotion_type": "promotionType",
|
|
309
|
-
"product_id": "productId",
|
|
310
|
-
"product_name": "productName",
|
|
311
|
-
"variant_id": "variantId",
|
|
312
|
-
"variant_name": "variantName",
|
|
313
|
-
"applied_sequence": "appliedSequence",
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
/** @internal */
|
|
318
|
-
export type OrderAppliedPromotions$Outbound = {
|
|
319
|
-
promotion_id: string;
|
|
320
|
-
promotion_type: string;
|
|
321
|
-
savings: number;
|
|
322
|
-
product_id: string | null;
|
|
323
|
-
product_name: string | null;
|
|
324
|
-
variant_id: string | null;
|
|
325
|
-
variant_name: string | null;
|
|
326
|
-
scope: string;
|
|
327
|
-
applied_sequence: number;
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
/** @internal */
|
|
331
|
-
export const OrderAppliedPromotions$outboundSchema: z.ZodType<
|
|
332
|
-
OrderAppliedPromotions$Outbound,
|
|
333
|
-
z.ZodTypeDef,
|
|
334
|
-
OrderAppliedPromotions
|
|
335
|
-
> = z.object({
|
|
336
|
-
promotionId: z.string(),
|
|
337
|
-
promotionType: OrderPromotionType$outboundSchema,
|
|
338
|
-
savings: z.number(),
|
|
339
|
-
productId: z.nullable(z.string()),
|
|
340
|
-
productName: z.nullable(z.string()),
|
|
341
|
-
variantId: z.nullable(z.string()),
|
|
342
|
-
variantName: z.nullable(z.string()),
|
|
343
|
-
scope: Scope$outboundSchema,
|
|
344
|
-
appliedSequence: z.number().int(),
|
|
345
|
-
}).transform((v) => {
|
|
346
|
-
return remap$(v, {
|
|
347
|
-
promotionId: "promotion_id",
|
|
348
|
-
promotionType: "promotion_type",
|
|
349
|
-
productId: "product_id",
|
|
350
|
-
productName: "product_name",
|
|
351
|
-
variantId: "variant_id",
|
|
352
|
-
variantName: "variant_name",
|
|
353
|
-
appliedSequence: "applied_sequence",
|
|
354
|
-
});
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* @internal
|
|
359
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
360
|
-
*/
|
|
361
|
-
export namespace OrderAppliedPromotions$ {
|
|
362
|
-
/** @deprecated use `OrderAppliedPromotions$inboundSchema` instead. */
|
|
363
|
-
export const inboundSchema = OrderAppliedPromotions$inboundSchema;
|
|
364
|
-
/** @deprecated use `OrderAppliedPromotions$outboundSchema` instead. */
|
|
365
|
-
export const outboundSchema = OrderAppliedPromotions$outboundSchema;
|
|
366
|
-
/** @deprecated use `OrderAppliedPromotions$Outbound` instead. */
|
|
367
|
-
export type Outbound = OrderAppliedPromotions$Outbound;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
export function orderAppliedPromotionsToJSON(
|
|
371
|
-
orderAppliedPromotions: OrderAppliedPromotions,
|
|
372
|
-
): string {
|
|
373
|
-
return JSON.stringify(
|
|
374
|
-
OrderAppliedPromotions$outboundSchema.parse(orderAppliedPromotions),
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export function orderAppliedPromotionsFromJSON(
|
|
379
|
-
jsonString: string,
|
|
380
|
-
): SafeParseResult<OrderAppliedPromotions, SDKValidationError> {
|
|
381
|
-
return safeParse(
|
|
382
|
-
jsonString,
|
|
383
|
-
(x) => OrderAppliedPromotions$inboundSchema.parse(JSON.parse(x)),
|
|
384
|
-
`Failed to parse 'OrderAppliedPromotions' from JSON`,
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/** @internal */
|
|
389
|
-
export const OrderCouponType$inboundSchema: z.ZodNativeEnum<
|
|
390
|
-
typeof OrderCouponType
|
|
391
|
-
> = z.nativeEnum(OrderCouponType);
|
|
392
|
-
|
|
393
|
-
/** @internal */
|
|
394
|
-
export const OrderCouponType$outboundSchema: z.ZodNativeEnum<
|
|
395
|
-
typeof OrderCouponType
|
|
396
|
-
> = OrderCouponType$inboundSchema;
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* @internal
|
|
400
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
401
|
-
*/
|
|
402
|
-
export namespace OrderCouponType$ {
|
|
403
|
-
/** @deprecated use `OrderCouponType$inboundSchema` instead. */
|
|
404
|
-
export const inboundSchema = OrderCouponType$inboundSchema;
|
|
405
|
-
/** @deprecated use `OrderCouponType$outboundSchema` instead. */
|
|
406
|
-
export const outboundSchema = OrderCouponType$outboundSchema;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/** @internal */
|
|
410
|
-
export const OrderAppliedCoupons$inboundSchema: z.ZodType<
|
|
411
|
-
OrderAppliedCoupons,
|
|
412
|
-
z.ZodTypeDef,
|
|
413
|
-
unknown
|
|
414
|
-
> = z.object({
|
|
415
|
-
coupon_id: z.string(),
|
|
416
|
-
coupon_type: OrderCouponType$inboundSchema,
|
|
417
|
-
savings: z.number(),
|
|
418
|
-
product_id: z.nullable(z.string()),
|
|
419
|
-
product_name: z.nullable(z.string()),
|
|
420
|
-
variant_id: z.nullable(z.string()),
|
|
421
|
-
variant_name: z.nullable(z.string()),
|
|
422
|
-
}).transform((v) => {
|
|
423
|
-
return remap$(v, {
|
|
424
|
-
"coupon_id": "couponId",
|
|
425
|
-
"coupon_type": "couponType",
|
|
426
|
-
"product_id": "productId",
|
|
427
|
-
"product_name": "productName",
|
|
428
|
-
"variant_id": "variantId",
|
|
429
|
-
"variant_name": "variantName",
|
|
430
|
-
});
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
/** @internal */
|
|
434
|
-
export type OrderAppliedCoupons$Outbound = {
|
|
435
|
-
coupon_id: string;
|
|
436
|
-
coupon_type: string;
|
|
437
|
-
savings: number;
|
|
438
|
-
product_id: string | null;
|
|
439
|
-
product_name: string | null;
|
|
440
|
-
variant_id: string | null;
|
|
441
|
-
variant_name: string | null;
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
/** @internal */
|
|
445
|
-
export const OrderAppliedCoupons$outboundSchema: z.ZodType<
|
|
446
|
-
OrderAppliedCoupons$Outbound,
|
|
447
|
-
z.ZodTypeDef,
|
|
448
|
-
OrderAppliedCoupons
|
|
449
|
-
> = z.object({
|
|
450
|
-
couponId: z.string(),
|
|
451
|
-
couponType: OrderCouponType$outboundSchema,
|
|
452
|
-
savings: z.number(),
|
|
453
|
-
productId: z.nullable(z.string()),
|
|
454
|
-
productName: z.nullable(z.string()),
|
|
455
|
-
variantId: z.nullable(z.string()),
|
|
456
|
-
variantName: z.nullable(z.string()),
|
|
457
|
-
}).transform((v) => {
|
|
458
|
-
return remap$(v, {
|
|
459
|
-
couponId: "coupon_id",
|
|
460
|
-
couponType: "coupon_type",
|
|
461
|
-
productId: "product_id",
|
|
462
|
-
productName: "product_name",
|
|
463
|
-
variantId: "variant_id",
|
|
464
|
-
variantName: "variant_name",
|
|
465
|
-
});
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* @internal
|
|
470
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
471
|
-
*/
|
|
472
|
-
export namespace OrderAppliedCoupons$ {
|
|
473
|
-
/** @deprecated use `OrderAppliedCoupons$inboundSchema` instead. */
|
|
474
|
-
export const inboundSchema = OrderAppliedCoupons$inboundSchema;
|
|
475
|
-
/** @deprecated use `OrderAppliedCoupons$outboundSchema` instead. */
|
|
476
|
-
export const outboundSchema = OrderAppliedCoupons$outboundSchema;
|
|
477
|
-
/** @deprecated use `OrderAppliedCoupons$Outbound` instead. */
|
|
478
|
-
export type Outbound = OrderAppliedCoupons$Outbound;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
export function orderAppliedCouponsToJSON(
|
|
482
|
-
orderAppliedCoupons: OrderAppliedCoupons,
|
|
483
|
-
): string {
|
|
484
|
-
return JSON.stringify(
|
|
485
|
-
OrderAppliedCoupons$outboundSchema.parse(orderAppliedCoupons),
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export function orderAppliedCouponsFromJSON(
|
|
490
|
-
jsonString: string,
|
|
491
|
-
): SafeParseResult<OrderAppliedCoupons, SDKValidationError> {
|
|
492
|
-
return safeParse(
|
|
493
|
-
jsonString,
|
|
494
|
-
(x) => OrderAppliedCoupons$inboundSchema.parse(JSON.parse(x)),
|
|
495
|
-
`Failed to parse 'OrderAppliedCoupons' from JSON`,
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
213
|
/** @internal */
|
|
500
214
|
export const OrderCurrency$inboundSchema: z.ZodType<
|
|
501
215
|
OrderCurrency,
|
|
@@ -671,10 +385,8 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
|
|
|
671
385
|
is_coupon_applied: z.boolean().optional(),
|
|
672
386
|
coupon_code: z.nullable(z.string()).optional(),
|
|
673
387
|
coupon_discount_amount: z.nullable(z.number()).optional(),
|
|
674
|
-
applied_promotions: z.array(
|
|
675
|
-
|
|
676
|
-
),
|
|
677
|
-
applied_coupons: z.array(z.lazy(() => OrderAppliedCoupons$inboundSchema)),
|
|
388
|
+
applied_promotions: z.array(AppliedPromotion$inboundSchema),
|
|
389
|
+
applied_coupons: z.array(AppliedCoupon$inboundSchema),
|
|
678
390
|
promotion_savings: z.number().optional(),
|
|
679
391
|
coupon_savings: z.number().optional(),
|
|
680
392
|
other_savings: z.number().optional(),
|
|
@@ -785,8 +497,8 @@ export type Order$Outbound = {
|
|
|
785
497
|
is_coupon_applied?: boolean | undefined;
|
|
786
498
|
coupon_code?: string | null | undefined;
|
|
787
499
|
coupon_discount_amount?: number | null | undefined;
|
|
788
|
-
applied_promotions: Array<
|
|
789
|
-
applied_coupons: Array<
|
|
500
|
+
applied_promotions: Array<AppliedPromotion$Outbound>;
|
|
501
|
+
applied_coupons: Array<AppliedCoupon$Outbound>;
|
|
790
502
|
promotion_savings?: number | undefined;
|
|
791
503
|
coupon_savings?: number | undefined;
|
|
792
504
|
other_savings?: number | undefined;
|
|
@@ -844,10 +556,8 @@ export const Order$outboundSchema: z.ZodType<
|
|
|
844
556
|
isCouponApplied: z.boolean().optional(),
|
|
845
557
|
couponCode: z.nullable(z.string()).optional(),
|
|
846
558
|
couponDiscountAmount: z.nullable(z.number()).optional(),
|
|
847
|
-
appliedPromotions: z.array(
|
|
848
|
-
|
|
849
|
-
),
|
|
850
|
-
appliedCoupons: z.array(z.lazy(() => OrderAppliedCoupons$outboundSchema)),
|
|
559
|
+
appliedPromotions: z.array(AppliedPromotion$outboundSchema),
|
|
560
|
+
appliedCoupons: z.array(AppliedCoupon$outboundSchema),
|
|
851
561
|
promotionSavings: z.number().optional(),
|
|
852
562
|
couponSavings: z.number().optional(),
|
|
853
563
|
otherSavings: z.number().optional(),
|