ce-storefront 0.2.4 → 0.2.6
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 +7 -2
- package/RUNTIMES.md +27 -1
- package/docs/sdks/cestorefrontreviews/README.md +2 -2
- package/docs/sdks/paymentsapi/README.md +90 -0
- package/funcs/analyticsTrack.js +4 -4
- package/funcs/analyticsTrack.js.map +1 -1
- package/funcs/authGenerateOtp.js +4 -4
- package/funcs/authGenerateOtp.js.map +1 -1
- package/funcs/authLoginAnonymously.js +5 -5
- package/funcs/authLoginAnonymously.js.map +1 -1
- package/funcs/authLoginWithEmail.js +4 -4
- package/funcs/authLoginWithEmail.js.map +1 -1
- package/funcs/authLoginWithPassword.js +4 -4
- package/funcs/authLoginWithPassword.js.map +1 -1
- package/funcs/authLoginWithPhone.js +4 -4
- package/funcs/authLoginWithPhone.js.map +1 -1
- package/funcs/authLoginWithWhatsapp.js +4 -4
- package/funcs/authLoginWithWhatsapp.js.map +1 -1
- package/funcs/authRefreshToken.js +4 -4
- package/funcs/authRefreshToken.js.map +1 -1
- package/funcs/authRegisterWithEmail.js +4 -4
- package/funcs/authRegisterWithEmail.js.map +1 -1
- package/funcs/authRegisterWithPassword.js +4 -4
- package/funcs/authRegisterWithPassword.js.map +1 -1
- package/funcs/authRegisterWithPhone.js +4 -4
- package/funcs/authRegisterWithPhone.js.map +1 -1
- package/funcs/authRegisterWithWhatsapp.js +4 -4
- package/funcs/authRegisterWithWhatsapp.js.map +1 -1
- package/funcs/authUserAddProfileImage.js +4 -4
- package/funcs/authUserAddProfileImage.js.map +1 -1
- package/funcs/authUserChangePassword.js +4 -4
- package/funcs/authUserChangePassword.js.map +1 -1
- package/funcs/authUserDeactivateAccount.js +4 -4
- package/funcs/authUserDeactivateAccount.js.map +1 -1
- package/funcs/authUserDeleteProfileImage.js +4 -4
- package/funcs/authUserDeleteProfileImage.js.map +1 -1
- package/funcs/authUserForgotPassword.js +4 -4
- package/funcs/authUserForgotPassword.js.map +1 -1
- package/funcs/authUserGet.js +4 -4
- package/funcs/authUserGet.js.map +1 -1
- package/funcs/authUserGetProfileImage.js +4 -4
- package/funcs/authUserGetProfileImage.js.map +1 -1
- package/funcs/authUserLogout.js +4 -4
- package/funcs/authUserLogout.js.map +1 -1
- package/funcs/authUserResetPassword.js +4 -4
- package/funcs/authUserResetPassword.js.map +1 -1
- package/funcs/authUserUpdate.js +4 -4
- package/funcs/authUserUpdate.js.map +1 -1
- package/funcs/authUserUpdateProfileImage.js +4 -4
- package/funcs/authUserUpdateProfileImage.js.map +1 -1
- package/funcs/authVerifyEmailPhone.js +4 -4
- package/funcs/authVerifyEmailPhone.js.map +1 -1
- package/funcs/authVerifyOtp.js +4 -4
- package/funcs/authVerifyOtp.js.map +1 -1
- package/funcs/campaignsNewsletterSubscribe.js +4 -4
- package/funcs/campaignsNewsletterSubscribe.js.map +1 -1
- package/funcs/cartsAddItem.js +4 -4
- package/funcs/cartsAddItem.js.map +1 -1
- package/funcs/cartsCreate.js +4 -4
- package/funcs/cartsCreate.js.map +1 -1
- package/funcs/cartsDelete.js +4 -4
- package/funcs/cartsDelete.js.map +1 -1
- package/funcs/cartsGet.js +4 -4
- package/funcs/cartsGet.js.map +1 -1
- package/funcs/catalogCategoriesList.js +4 -4
- package/funcs/catalogCategoriesList.js.map +1 -1
- package/funcs/catalogProductsGet.js +4 -4
- package/funcs/catalogProductsGet.js.map +1 -1
- package/funcs/catalogProductsGetCrossSells.js +4 -4
- package/funcs/catalogProductsGetCrossSells.js.map +1 -1
- package/funcs/catalogProductsGetSimilar.js +4 -4
- package/funcs/catalogProductsGetSimilar.js.map +1 -1
- package/funcs/catalogProductsGetUpsells.js +4 -4
- package/funcs/catalogProductsGetUpsells.js.map +1 -1
- package/funcs/catalogProductsList.js +4 -4
- package/funcs/catalogProductsList.js.map +1 -1
- package/funcs/catalogProductsReviewsCreate.js +4 -4
- package/funcs/catalogProductsReviewsCreate.js.map +1 -1
- package/funcs/catalogProductsReviewsList.d.ts +2 -2
- package/funcs/catalogProductsReviewsList.js +6 -6
- package/funcs/catalogProductsReviewsList.js.map +1 -1
- package/funcs/catalogProductsVariantsGet.js +4 -4
- package/funcs/catalogProductsVariantsGet.js.map +1 -1
- package/funcs/catalogProductsVariantsList.js +4 -4
- package/funcs/catalogProductsVariantsList.js.map +1 -1
- package/funcs/catalogSkusList.js +4 -4
- package/funcs/catalogSkusList.js.map +1 -1
- package/funcs/checkoutApplyCoupon.js +4 -4
- package/funcs/checkoutApplyCoupon.js.map +1 -1
- package/funcs/checkoutRedeemGiftCard.js +4 -4
- package/funcs/checkoutRedeemGiftCard.js.map +1 -1
- package/funcs/checkoutRedeemLoyaltyPoints.js +4 -4
- package/funcs/checkoutRedeemLoyaltyPoints.js.map +1 -1
- package/funcs/checkoutRemoveCoupon.js +4 -4
- package/funcs/checkoutRemoveCoupon.js.map +1 -1
- package/funcs/checkoutRemoveCreditBalance.js +4 -4
- package/funcs/checkoutRemoveCreditBalance.js.map +1 -1
- package/funcs/checkoutRemoveLoyaltyPoints.js +4 -4
- package/funcs/checkoutRemoveLoyaltyPoints.js.map +1 -1
- package/funcs/checkoutUpdateAddress.js +4 -4
- package/funcs/checkoutUpdateAddress.js.map +1 -1
- package/funcs/checkoutUseCreditBalance.js +4 -4
- package/funcs/checkoutUseCreditBalance.js.map +1 -1
- package/funcs/customersAPIGetCustomersId.js +4 -4
- package/funcs/customersAPIGetCustomersId.js.map +1 -1
- package/funcs/customersAPIGetRecommendedProducts.js +4 -4
- package/funcs/customersAPIGetRecommendedProducts.js.map +1 -1
- package/funcs/customersAPIPostCustomers.js +4 -4
- package/funcs/customersAPIPostCustomers.js.map +1 -1
- package/funcs/customersAPIPutCustomersId.js +4 -4
- package/funcs/customersAPIPutCustomersId.js.map +1 -1
- package/funcs/customersAddressesAdd.js +4 -4
- package/funcs/customersAddressesAdd.js.map +1 -1
- package/funcs/customersAddressesDelete.js +4 -4
- package/funcs/customersAddressesDelete.js.map +1 -1
- package/funcs/customersAddressesGet.js +4 -4
- package/funcs/customersAddressesGet.js.map +1 -1
- package/funcs/customersAddressesList.js +4 -4
- package/funcs/customersAddressesList.js.map +1 -1
- package/funcs/customersAddressesUpdate.js +4 -4
- package/funcs/customersAddressesUpdate.js.map +1 -1
- package/funcs/customersLoyaltyGet.js +4 -4
- package/funcs/customersLoyaltyGet.js.map +1 -1
- package/funcs/customersLoyaltyListActivities.js +4 -4
- package/funcs/customersLoyaltyListActivities.js.map +1 -1
- package/funcs/customersReviewsList.js +4 -4
- package/funcs/customersReviewsList.js.map +1 -1
- package/funcs/offersCouponsList.js +4 -4
- package/funcs/offersCouponsList.js.map +1 -1
- package/funcs/offersPromotionsList.js +4 -4
- package/funcs/offersPromotionsList.js.map +1 -1
- package/funcs/ordersCancel.js +4 -4
- package/funcs/ordersCancel.js.map +1 -1
- package/funcs/ordersCreate.js +4 -4
- package/funcs/ordersCreate.js.map +1 -1
- package/funcs/ordersGet.js +4 -4
- package/funcs/ordersGet.js.map +1 -1
- package/funcs/ordersList.js +4 -4
- package/funcs/ordersList.js.map +1 -1
- package/funcs/ordersPaymentsList.js +4 -4
- package/funcs/ordersPaymentsList.js.map +1 -1
- package/funcs/ordersRefundsList.js +4 -4
- package/funcs/ordersRefundsList.js.map +1 -1
- package/funcs/ordersRetryPayment.js +4 -4
- package/funcs/ordersRetryPayment.js.map +1 -1
- package/funcs/ordersShipmentsList.js +4 -4
- package/funcs/ordersShipmentsList.js.map +1 -1
- package/funcs/paymentsAPIPostPaymentsSession.d.ts +15 -0
- package/funcs/paymentsAPIPostPaymentsSession.d.ts.map +1 -0
- package/funcs/paymentsAPIPostPaymentsSession.js +96 -0
- package/funcs/paymentsAPIPostPaymentsSession.js.map +1 -0
- package/funcs/paymentsGenerateHash.js +4 -4
- package/funcs/paymentsGenerateHash.js.map +1 -1
- package/funcs/paymentsGetMethods.js +4 -4
- package/funcs/paymentsGetMethods.js.map +1 -1
- package/funcs/shippingCheckPincodeServiceability.js +4 -4
- package/funcs/shippingCheckPincodeServiceability.js.map +1 -1
- package/funcs/userNotificationPreferencesCreate.js +4 -4
- package/funcs/userNotificationPreferencesCreate.js.map +1 -1
- package/funcs/userNotificationPreferencesGet.js +4 -4
- package/funcs/userNotificationPreferencesGet.js.map +1 -1
- package/funcs/userNotificationPreferencesUpdate.js +4 -4
- package/funcs/userNotificationPreferencesUpdate.js.map +1 -1
- package/funcs/utilsGetCountries.js +4 -4
- package/funcs/utilsGetCountries.js.map +1 -1
- package/funcs/utilsGetPincodes.js +4 -4
- package/funcs/utilsGetPincodes.js.map +1 -1
- package/funcs/utilsGetStates.js +4 -4
- package/funcs/utilsGetStates.js.map +1 -1
- package/funcs/wishlistAdd.js +4 -4
- package/funcs/wishlistAdd.js.map +1 -1
- package/funcs/wishlistDelete.js +4 -4
- package/funcs/wishlistDelete.js.map +1 -1
- package/funcs/wishlistGet.js +4 -4
- package/funcs/wishlistGet.js.map +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +6 -7
- package/lib/config.js.map +1 -1
- package/lib/encodings.js +18 -19
- package/lib/encodings.js.map +1 -1
- package/lib/http.js +1 -2
- package/lib/http.js.map +1 -1
- package/lib/matchers.js +5 -6
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.js +1 -1
- package/lib/primitives.js.map +1 -1
- package/lib/retries.js +3 -4
- package/lib/retries.js.map +1 -1
- package/lib/sdks.js +15 -16
- package/lib/sdks.js.map +1 -1
- package/lib/security.js +2 -2
- package/lib/security.js.map +1 -1
- package/lib/url.js +1 -1
- package/lib/url.js.map +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/paymentsessionresponse.d.ts +146 -0
- package/models/components/paymentsessionresponse.d.ts.map +1 -0
- package/models/components/paymentsessionresponse.js +195 -0
- package/models/components/paymentsessionresponse.js.map +1 -0
- package/models/errors/httpclienterrors.js +2 -2
- package/models/errors/httpclienterrors.js.map +1 -1
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/postorder.d.ts +15 -0
- package/models/operations/postorder.d.ts.map +1 -1
- package/models/operations/postorder.js +12 -0
- package/models/operations/postorder.js.map +1 -1
- package/models/operations/postpaymentssession.d.ts +120 -0
- package/models/operations/postpaymentssession.d.ts.map +1 -0
- package/models/operations/postpaymentssession.js +161 -0
- package/models/operations/postpaymentssession.js.map +1 -0
- package/package.json +1 -1
- package/sdk/auth.js +1 -2
- package/sdk/auth.js.map +1 -1
- package/sdk/campaigns.js +1 -2
- package/sdk/campaigns.js.map +1 -1
- package/sdk/catalog.js +3 -6
- package/sdk/catalog.js.map +1 -1
- package/sdk/cestorefrontreviews.d.ts +2 -2
- package/sdk/cestorefrontreviews.js +2 -2
- package/sdk/customers.js +3 -6
- package/sdk/customers.js.map +1 -1
- package/sdk/offers.js +2 -4
- package/sdk/offers.js.map +1 -1
- package/sdk/orders.js +3 -6
- package/sdk/orders.js.map +1 -1
- package/sdk/paymentsapi.d.ts +12 -0
- package/sdk/paymentsapi.d.ts.map +1 -0
- package/sdk/paymentsapi.js +22 -0
- package/sdk/paymentsapi.js.map +1 -0
- package/sdk/products.js +2 -4
- package/sdk/products.js.map +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +19 -30
- package/sdk/sdk.js.map +1 -1
- package/sdk/user.js +1 -2
- package/sdk/user.js.map +1 -1
- package/src/funcs/catalogProductsReviewsList.ts +2 -2
- package/src/funcs/paymentsAPIPostPaymentsSession.ts +125 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +1 -1
- package/src/models/components/index.ts +1 -0
- package/src/models/components/paymentsessionresponse.ts +322 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/postorder.ts +27 -0
- package/src/models/operations/postpaymentssession.ts +254 -0
- package/src/sdk/cestorefrontreviews.ts +2 -2
- package/src/sdk/paymentsapi.ts +27 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,254 @@
|
|
|
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 * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export const Action = {
|
|
14
|
+
PaymentPage: "paymentPage",
|
|
15
|
+
PaymentManagement: "paymentManagement",
|
|
16
|
+
} as const;
|
|
17
|
+
export type Action = ClosedEnum<typeof Action>;
|
|
18
|
+
|
|
19
|
+
export type PostPaymentsSessionRequestBody = {
|
|
20
|
+
orderId: string;
|
|
21
|
+
action: Action;
|
|
22
|
+
/**
|
|
23
|
+
* A Payment Return URL is a specific URL to which users are redirected after completing a payment process.
|
|
24
|
+
*/
|
|
25
|
+
returnUrl: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type PostPaymentsSessionContent = {
|
|
29
|
+
paymentSession?: components.PaymentSessionResponse | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* OK
|
|
34
|
+
*/
|
|
35
|
+
export type PostPaymentsSessionResponseBody = {
|
|
36
|
+
message?: string | undefined;
|
|
37
|
+
success?: boolean | undefined;
|
|
38
|
+
content?: PostPaymentsSessionContent | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const Action$inboundSchema: z.ZodNativeEnum<typeof Action> = z
|
|
43
|
+
.nativeEnum(Action);
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const Action$outboundSchema: z.ZodNativeEnum<typeof Action> =
|
|
47
|
+
Action$inboundSchema;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace Action$ {
|
|
54
|
+
/** @deprecated use `Action$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = Action$inboundSchema;
|
|
56
|
+
/** @deprecated use `Action$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = Action$outboundSchema;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const PostPaymentsSessionRequestBody$inboundSchema: z.ZodType<
|
|
62
|
+
PostPaymentsSessionRequestBody,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
unknown
|
|
65
|
+
> = z.object({
|
|
66
|
+
order_id: z.string(),
|
|
67
|
+
action: Action$inboundSchema,
|
|
68
|
+
return_url: z.string(),
|
|
69
|
+
}).transform((v) => {
|
|
70
|
+
return remap$(v, {
|
|
71
|
+
"order_id": "orderId",
|
|
72
|
+
"return_url": "returnUrl",
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export type PostPaymentsSessionRequestBody$Outbound = {
|
|
78
|
+
order_id: string;
|
|
79
|
+
action: string;
|
|
80
|
+
return_url: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const PostPaymentsSessionRequestBody$outboundSchema: z.ZodType<
|
|
85
|
+
PostPaymentsSessionRequestBody$Outbound,
|
|
86
|
+
z.ZodTypeDef,
|
|
87
|
+
PostPaymentsSessionRequestBody
|
|
88
|
+
> = z.object({
|
|
89
|
+
orderId: z.string(),
|
|
90
|
+
action: Action$outboundSchema,
|
|
91
|
+
returnUrl: z.string(),
|
|
92
|
+
}).transform((v) => {
|
|
93
|
+
return remap$(v, {
|
|
94
|
+
orderId: "order_id",
|
|
95
|
+
returnUrl: "return_url",
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
102
|
+
*/
|
|
103
|
+
export namespace PostPaymentsSessionRequestBody$ {
|
|
104
|
+
/** @deprecated use `PostPaymentsSessionRequestBody$inboundSchema` instead. */
|
|
105
|
+
export const inboundSchema = PostPaymentsSessionRequestBody$inboundSchema;
|
|
106
|
+
/** @deprecated use `PostPaymentsSessionRequestBody$outboundSchema` instead. */
|
|
107
|
+
export const outboundSchema = PostPaymentsSessionRequestBody$outboundSchema;
|
|
108
|
+
/** @deprecated use `PostPaymentsSessionRequestBody$Outbound` instead. */
|
|
109
|
+
export type Outbound = PostPaymentsSessionRequestBody$Outbound;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function postPaymentsSessionRequestBodyToJSON(
|
|
113
|
+
postPaymentsSessionRequestBody: PostPaymentsSessionRequestBody,
|
|
114
|
+
): string {
|
|
115
|
+
return JSON.stringify(
|
|
116
|
+
PostPaymentsSessionRequestBody$outboundSchema.parse(
|
|
117
|
+
postPaymentsSessionRequestBody,
|
|
118
|
+
),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function postPaymentsSessionRequestBodyFromJSON(
|
|
123
|
+
jsonString: string,
|
|
124
|
+
): SafeParseResult<PostPaymentsSessionRequestBody, SDKValidationError> {
|
|
125
|
+
return safeParse(
|
|
126
|
+
jsonString,
|
|
127
|
+
(x) => PostPaymentsSessionRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
128
|
+
`Failed to parse 'PostPaymentsSessionRequestBody' from JSON`,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** @internal */
|
|
133
|
+
export const PostPaymentsSessionContent$inboundSchema: z.ZodType<
|
|
134
|
+
PostPaymentsSessionContent,
|
|
135
|
+
z.ZodTypeDef,
|
|
136
|
+
unknown
|
|
137
|
+
> = z.object({
|
|
138
|
+
payment_session: components.PaymentSessionResponse$inboundSchema.optional(),
|
|
139
|
+
}).transform((v) => {
|
|
140
|
+
return remap$(v, {
|
|
141
|
+
"payment_session": "paymentSession",
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
/** @internal */
|
|
146
|
+
export type PostPaymentsSessionContent$Outbound = {
|
|
147
|
+
payment_session?: components.PaymentSessionResponse$Outbound | undefined;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/** @internal */
|
|
151
|
+
export const PostPaymentsSessionContent$outboundSchema: z.ZodType<
|
|
152
|
+
PostPaymentsSessionContent$Outbound,
|
|
153
|
+
z.ZodTypeDef,
|
|
154
|
+
PostPaymentsSessionContent
|
|
155
|
+
> = z.object({
|
|
156
|
+
paymentSession: components.PaymentSessionResponse$outboundSchema.optional(),
|
|
157
|
+
}).transform((v) => {
|
|
158
|
+
return remap$(v, {
|
|
159
|
+
paymentSession: "payment_session",
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @internal
|
|
165
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
166
|
+
*/
|
|
167
|
+
export namespace PostPaymentsSessionContent$ {
|
|
168
|
+
/** @deprecated use `PostPaymentsSessionContent$inboundSchema` instead. */
|
|
169
|
+
export const inboundSchema = PostPaymentsSessionContent$inboundSchema;
|
|
170
|
+
/** @deprecated use `PostPaymentsSessionContent$outboundSchema` instead. */
|
|
171
|
+
export const outboundSchema = PostPaymentsSessionContent$outboundSchema;
|
|
172
|
+
/** @deprecated use `PostPaymentsSessionContent$Outbound` instead. */
|
|
173
|
+
export type Outbound = PostPaymentsSessionContent$Outbound;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function postPaymentsSessionContentToJSON(
|
|
177
|
+
postPaymentsSessionContent: PostPaymentsSessionContent,
|
|
178
|
+
): string {
|
|
179
|
+
return JSON.stringify(
|
|
180
|
+
PostPaymentsSessionContent$outboundSchema.parse(postPaymentsSessionContent),
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function postPaymentsSessionContentFromJSON(
|
|
185
|
+
jsonString: string,
|
|
186
|
+
): SafeParseResult<PostPaymentsSessionContent, SDKValidationError> {
|
|
187
|
+
return safeParse(
|
|
188
|
+
jsonString,
|
|
189
|
+
(x) => PostPaymentsSessionContent$inboundSchema.parse(JSON.parse(x)),
|
|
190
|
+
`Failed to parse 'PostPaymentsSessionContent' from JSON`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** @internal */
|
|
195
|
+
export const PostPaymentsSessionResponseBody$inboundSchema: z.ZodType<
|
|
196
|
+
PostPaymentsSessionResponseBody,
|
|
197
|
+
z.ZodTypeDef,
|
|
198
|
+
unknown
|
|
199
|
+
> = z.object({
|
|
200
|
+
message: z.string().optional(),
|
|
201
|
+
success: z.boolean().optional(),
|
|
202
|
+
content: z.lazy(() => PostPaymentsSessionContent$inboundSchema).optional(),
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
/** @internal */
|
|
206
|
+
export type PostPaymentsSessionResponseBody$Outbound = {
|
|
207
|
+
message?: string | undefined;
|
|
208
|
+
success?: boolean | undefined;
|
|
209
|
+
content?: PostPaymentsSessionContent$Outbound | undefined;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/** @internal */
|
|
213
|
+
export const PostPaymentsSessionResponseBody$outboundSchema: z.ZodType<
|
|
214
|
+
PostPaymentsSessionResponseBody$Outbound,
|
|
215
|
+
z.ZodTypeDef,
|
|
216
|
+
PostPaymentsSessionResponseBody
|
|
217
|
+
> = z.object({
|
|
218
|
+
message: z.string().optional(),
|
|
219
|
+
success: z.boolean().optional(),
|
|
220
|
+
content: z.lazy(() => PostPaymentsSessionContent$outboundSchema).optional(),
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @internal
|
|
225
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
226
|
+
*/
|
|
227
|
+
export namespace PostPaymentsSessionResponseBody$ {
|
|
228
|
+
/** @deprecated use `PostPaymentsSessionResponseBody$inboundSchema` instead. */
|
|
229
|
+
export const inboundSchema = PostPaymentsSessionResponseBody$inboundSchema;
|
|
230
|
+
/** @deprecated use `PostPaymentsSessionResponseBody$outboundSchema` instead. */
|
|
231
|
+
export const outboundSchema = PostPaymentsSessionResponseBody$outboundSchema;
|
|
232
|
+
/** @deprecated use `PostPaymentsSessionResponseBody$Outbound` instead. */
|
|
233
|
+
export type Outbound = PostPaymentsSessionResponseBody$Outbound;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export function postPaymentsSessionResponseBodyToJSON(
|
|
237
|
+
postPaymentsSessionResponseBody: PostPaymentsSessionResponseBody,
|
|
238
|
+
): string {
|
|
239
|
+
return JSON.stringify(
|
|
240
|
+
PostPaymentsSessionResponseBody$outboundSchema.parse(
|
|
241
|
+
postPaymentsSessionResponseBody,
|
|
242
|
+
),
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function postPaymentsSessionResponseBodyFromJSON(
|
|
247
|
+
jsonString: string,
|
|
248
|
+
): SafeParseResult<PostPaymentsSessionResponseBody, SDKValidationError> {
|
|
249
|
+
return safeParse(
|
|
250
|
+
jsonString,
|
|
251
|
+
(x) => PostPaymentsSessionResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
252
|
+
`Failed to parse 'PostPaymentsSessionResponseBody' from JSON`,
|
|
253
|
+
);
|
|
254
|
+
}
|
|
@@ -10,10 +10,10 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
10
10
|
|
|
11
11
|
export class CeStorefrontReviews extends ClientSDK {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* List all product reviews
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
*
|
|
16
|
+
* List of reviews for a specified product. The reviews are returned sorted by submission date, with the most recent reviews appearing first. You can filter the reviews by rating, reviewer, or date for more detailed analysis.
|
|
17
17
|
*/
|
|
18
18
|
async list(
|
|
19
19
|
request: operations.GetProductsIdReviewsRequest,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { paymentsAPIPostPaymentsSession } from "../funcs/paymentsAPIPostPaymentsSession.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class PaymentsAPI extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Create payment session
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Create payment session
|
|
16
|
+
*/
|
|
17
|
+
async postPaymentsSession(
|
|
18
|
+
request: operations.PostPaymentsSessionRequestBody,
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): Promise<operations.PostPaymentsSessionResponseBody> {
|
|
21
|
+
return unwrapAsync(paymentsAPIPostPaymentsSession(
|
|
22
|
+
this,
|
|
23
|
+
request,
|
|
24
|
+
options,
|
|
25
|
+
));
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { CustomersAPI } from "./customersapi.js";
|
|
|
14
14
|
import { Offers } from "./offers.js";
|
|
15
15
|
import { Orders } from "./orders.js";
|
|
16
16
|
import { Payments } from "./payments.js";
|
|
17
|
+
import { PaymentsAPI } from "./paymentsapi.js";
|
|
17
18
|
import { Shipping } from "./shipping.js";
|
|
18
19
|
import { User } from "./user.js";
|
|
19
20
|
import { Utils } from "./utils.js";
|
|
@@ -75,6 +76,11 @@ export class CeStorefront extends ClientSDK {
|
|
|
75
76
|
return (this._user ??= new User(this._options));
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
private _paymentsAPI?: PaymentsAPI;
|
|
80
|
+
get paymentsAPI(): PaymentsAPI {
|
|
81
|
+
return (this._paymentsAPI ??= new PaymentsAPI(this._options));
|
|
82
|
+
}
|
|
83
|
+
|
|
78
84
|
private _payments?: Payments;
|
|
79
85
|
get payments(): Payments {
|
|
80
86
|
return (this._payments ??= new Payments(this._options));
|