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.
Files changed (255) hide show
  1. package/README.md +7 -2
  2. package/RUNTIMES.md +27 -1
  3. package/docs/sdks/cestorefrontreviews/README.md +2 -2
  4. package/docs/sdks/paymentsapi/README.md +90 -0
  5. package/funcs/analyticsTrack.js +4 -4
  6. package/funcs/analyticsTrack.js.map +1 -1
  7. package/funcs/authGenerateOtp.js +4 -4
  8. package/funcs/authGenerateOtp.js.map +1 -1
  9. package/funcs/authLoginAnonymously.js +5 -5
  10. package/funcs/authLoginAnonymously.js.map +1 -1
  11. package/funcs/authLoginWithEmail.js +4 -4
  12. package/funcs/authLoginWithEmail.js.map +1 -1
  13. package/funcs/authLoginWithPassword.js +4 -4
  14. package/funcs/authLoginWithPassword.js.map +1 -1
  15. package/funcs/authLoginWithPhone.js +4 -4
  16. package/funcs/authLoginWithPhone.js.map +1 -1
  17. package/funcs/authLoginWithWhatsapp.js +4 -4
  18. package/funcs/authLoginWithWhatsapp.js.map +1 -1
  19. package/funcs/authRefreshToken.js +4 -4
  20. package/funcs/authRefreshToken.js.map +1 -1
  21. package/funcs/authRegisterWithEmail.js +4 -4
  22. package/funcs/authRegisterWithEmail.js.map +1 -1
  23. package/funcs/authRegisterWithPassword.js +4 -4
  24. package/funcs/authRegisterWithPassword.js.map +1 -1
  25. package/funcs/authRegisterWithPhone.js +4 -4
  26. package/funcs/authRegisterWithPhone.js.map +1 -1
  27. package/funcs/authRegisterWithWhatsapp.js +4 -4
  28. package/funcs/authRegisterWithWhatsapp.js.map +1 -1
  29. package/funcs/authUserAddProfileImage.js +4 -4
  30. package/funcs/authUserAddProfileImage.js.map +1 -1
  31. package/funcs/authUserChangePassword.js +4 -4
  32. package/funcs/authUserChangePassword.js.map +1 -1
  33. package/funcs/authUserDeactivateAccount.js +4 -4
  34. package/funcs/authUserDeactivateAccount.js.map +1 -1
  35. package/funcs/authUserDeleteProfileImage.js +4 -4
  36. package/funcs/authUserDeleteProfileImage.js.map +1 -1
  37. package/funcs/authUserForgotPassword.js +4 -4
  38. package/funcs/authUserForgotPassword.js.map +1 -1
  39. package/funcs/authUserGet.js +4 -4
  40. package/funcs/authUserGet.js.map +1 -1
  41. package/funcs/authUserGetProfileImage.js +4 -4
  42. package/funcs/authUserGetProfileImage.js.map +1 -1
  43. package/funcs/authUserLogout.js +4 -4
  44. package/funcs/authUserLogout.js.map +1 -1
  45. package/funcs/authUserResetPassword.js +4 -4
  46. package/funcs/authUserResetPassword.js.map +1 -1
  47. package/funcs/authUserUpdate.js +4 -4
  48. package/funcs/authUserUpdate.js.map +1 -1
  49. package/funcs/authUserUpdateProfileImage.js +4 -4
  50. package/funcs/authUserUpdateProfileImage.js.map +1 -1
  51. package/funcs/authVerifyEmailPhone.js +4 -4
  52. package/funcs/authVerifyEmailPhone.js.map +1 -1
  53. package/funcs/authVerifyOtp.js +4 -4
  54. package/funcs/authVerifyOtp.js.map +1 -1
  55. package/funcs/campaignsNewsletterSubscribe.js +4 -4
  56. package/funcs/campaignsNewsletterSubscribe.js.map +1 -1
  57. package/funcs/cartsAddItem.js +4 -4
  58. package/funcs/cartsAddItem.js.map +1 -1
  59. package/funcs/cartsCreate.js +4 -4
  60. package/funcs/cartsCreate.js.map +1 -1
  61. package/funcs/cartsDelete.js +4 -4
  62. package/funcs/cartsDelete.js.map +1 -1
  63. package/funcs/cartsGet.js +4 -4
  64. package/funcs/cartsGet.js.map +1 -1
  65. package/funcs/catalogCategoriesList.js +4 -4
  66. package/funcs/catalogCategoriesList.js.map +1 -1
  67. package/funcs/catalogProductsGet.js +4 -4
  68. package/funcs/catalogProductsGet.js.map +1 -1
  69. package/funcs/catalogProductsGetCrossSells.js +4 -4
  70. package/funcs/catalogProductsGetCrossSells.js.map +1 -1
  71. package/funcs/catalogProductsGetSimilar.js +4 -4
  72. package/funcs/catalogProductsGetSimilar.js.map +1 -1
  73. package/funcs/catalogProductsGetUpsells.js +4 -4
  74. package/funcs/catalogProductsGetUpsells.js.map +1 -1
  75. package/funcs/catalogProductsList.js +4 -4
  76. package/funcs/catalogProductsList.js.map +1 -1
  77. package/funcs/catalogProductsReviewsCreate.js +4 -4
  78. package/funcs/catalogProductsReviewsCreate.js.map +1 -1
  79. package/funcs/catalogProductsReviewsList.d.ts +2 -2
  80. package/funcs/catalogProductsReviewsList.js +6 -6
  81. package/funcs/catalogProductsReviewsList.js.map +1 -1
  82. package/funcs/catalogProductsVariantsGet.js +4 -4
  83. package/funcs/catalogProductsVariantsGet.js.map +1 -1
  84. package/funcs/catalogProductsVariantsList.js +4 -4
  85. package/funcs/catalogProductsVariantsList.js.map +1 -1
  86. package/funcs/catalogSkusList.js +4 -4
  87. package/funcs/catalogSkusList.js.map +1 -1
  88. package/funcs/checkoutApplyCoupon.js +4 -4
  89. package/funcs/checkoutApplyCoupon.js.map +1 -1
  90. package/funcs/checkoutRedeemGiftCard.js +4 -4
  91. package/funcs/checkoutRedeemGiftCard.js.map +1 -1
  92. package/funcs/checkoutRedeemLoyaltyPoints.js +4 -4
  93. package/funcs/checkoutRedeemLoyaltyPoints.js.map +1 -1
  94. package/funcs/checkoutRemoveCoupon.js +4 -4
  95. package/funcs/checkoutRemoveCoupon.js.map +1 -1
  96. package/funcs/checkoutRemoveCreditBalance.js +4 -4
  97. package/funcs/checkoutRemoveCreditBalance.js.map +1 -1
  98. package/funcs/checkoutRemoveLoyaltyPoints.js +4 -4
  99. package/funcs/checkoutRemoveLoyaltyPoints.js.map +1 -1
  100. package/funcs/checkoutUpdateAddress.js +4 -4
  101. package/funcs/checkoutUpdateAddress.js.map +1 -1
  102. package/funcs/checkoutUseCreditBalance.js +4 -4
  103. package/funcs/checkoutUseCreditBalance.js.map +1 -1
  104. package/funcs/customersAPIGetCustomersId.js +4 -4
  105. package/funcs/customersAPIGetCustomersId.js.map +1 -1
  106. package/funcs/customersAPIGetRecommendedProducts.js +4 -4
  107. package/funcs/customersAPIGetRecommendedProducts.js.map +1 -1
  108. package/funcs/customersAPIPostCustomers.js +4 -4
  109. package/funcs/customersAPIPostCustomers.js.map +1 -1
  110. package/funcs/customersAPIPutCustomersId.js +4 -4
  111. package/funcs/customersAPIPutCustomersId.js.map +1 -1
  112. package/funcs/customersAddressesAdd.js +4 -4
  113. package/funcs/customersAddressesAdd.js.map +1 -1
  114. package/funcs/customersAddressesDelete.js +4 -4
  115. package/funcs/customersAddressesDelete.js.map +1 -1
  116. package/funcs/customersAddressesGet.js +4 -4
  117. package/funcs/customersAddressesGet.js.map +1 -1
  118. package/funcs/customersAddressesList.js +4 -4
  119. package/funcs/customersAddressesList.js.map +1 -1
  120. package/funcs/customersAddressesUpdate.js +4 -4
  121. package/funcs/customersAddressesUpdate.js.map +1 -1
  122. package/funcs/customersLoyaltyGet.js +4 -4
  123. package/funcs/customersLoyaltyGet.js.map +1 -1
  124. package/funcs/customersLoyaltyListActivities.js +4 -4
  125. package/funcs/customersLoyaltyListActivities.js.map +1 -1
  126. package/funcs/customersReviewsList.js +4 -4
  127. package/funcs/customersReviewsList.js.map +1 -1
  128. package/funcs/offersCouponsList.js +4 -4
  129. package/funcs/offersCouponsList.js.map +1 -1
  130. package/funcs/offersPromotionsList.js +4 -4
  131. package/funcs/offersPromotionsList.js.map +1 -1
  132. package/funcs/ordersCancel.js +4 -4
  133. package/funcs/ordersCancel.js.map +1 -1
  134. package/funcs/ordersCreate.js +4 -4
  135. package/funcs/ordersCreate.js.map +1 -1
  136. package/funcs/ordersGet.js +4 -4
  137. package/funcs/ordersGet.js.map +1 -1
  138. package/funcs/ordersList.js +4 -4
  139. package/funcs/ordersList.js.map +1 -1
  140. package/funcs/ordersPaymentsList.js +4 -4
  141. package/funcs/ordersPaymentsList.js.map +1 -1
  142. package/funcs/ordersRefundsList.js +4 -4
  143. package/funcs/ordersRefundsList.js.map +1 -1
  144. package/funcs/ordersRetryPayment.js +4 -4
  145. package/funcs/ordersRetryPayment.js.map +1 -1
  146. package/funcs/ordersShipmentsList.js +4 -4
  147. package/funcs/ordersShipmentsList.js.map +1 -1
  148. package/funcs/paymentsAPIPostPaymentsSession.d.ts +15 -0
  149. package/funcs/paymentsAPIPostPaymentsSession.d.ts.map +1 -0
  150. package/funcs/paymentsAPIPostPaymentsSession.js +96 -0
  151. package/funcs/paymentsAPIPostPaymentsSession.js.map +1 -0
  152. package/funcs/paymentsGenerateHash.js +4 -4
  153. package/funcs/paymentsGenerateHash.js.map +1 -1
  154. package/funcs/paymentsGetMethods.js +4 -4
  155. package/funcs/paymentsGetMethods.js.map +1 -1
  156. package/funcs/shippingCheckPincodeServiceability.js +4 -4
  157. package/funcs/shippingCheckPincodeServiceability.js.map +1 -1
  158. package/funcs/userNotificationPreferencesCreate.js +4 -4
  159. package/funcs/userNotificationPreferencesCreate.js.map +1 -1
  160. package/funcs/userNotificationPreferencesGet.js +4 -4
  161. package/funcs/userNotificationPreferencesGet.js.map +1 -1
  162. package/funcs/userNotificationPreferencesUpdate.js +4 -4
  163. package/funcs/userNotificationPreferencesUpdate.js.map +1 -1
  164. package/funcs/utilsGetCountries.js +4 -4
  165. package/funcs/utilsGetCountries.js.map +1 -1
  166. package/funcs/utilsGetPincodes.js +4 -4
  167. package/funcs/utilsGetPincodes.js.map +1 -1
  168. package/funcs/utilsGetStates.js +4 -4
  169. package/funcs/utilsGetStates.js.map +1 -1
  170. package/funcs/wishlistAdd.js +4 -4
  171. package/funcs/wishlistAdd.js.map +1 -1
  172. package/funcs/wishlistDelete.js +4 -4
  173. package/funcs/wishlistDelete.js.map +1 -1
  174. package/funcs/wishlistGet.js +4 -4
  175. package/funcs/wishlistGet.js.map +1 -1
  176. package/lib/config.d.ts +3 -3
  177. package/lib/config.js +6 -7
  178. package/lib/config.js.map +1 -1
  179. package/lib/encodings.js +18 -19
  180. package/lib/encodings.js.map +1 -1
  181. package/lib/http.js +1 -2
  182. package/lib/http.js.map +1 -1
  183. package/lib/matchers.js +5 -6
  184. package/lib/matchers.js.map +1 -1
  185. package/lib/primitives.js +1 -1
  186. package/lib/primitives.js.map +1 -1
  187. package/lib/retries.js +3 -4
  188. package/lib/retries.js.map +1 -1
  189. package/lib/sdks.js +15 -16
  190. package/lib/sdks.js.map +1 -1
  191. package/lib/security.js +2 -2
  192. package/lib/security.js.map +1 -1
  193. package/lib/url.js +1 -1
  194. package/lib/url.js.map +1 -1
  195. package/models/components/index.d.ts +1 -0
  196. package/models/components/index.d.ts.map +1 -1
  197. package/models/components/index.js +1 -0
  198. package/models/components/index.js.map +1 -1
  199. package/models/components/paymentsessionresponse.d.ts +146 -0
  200. package/models/components/paymentsessionresponse.d.ts.map +1 -0
  201. package/models/components/paymentsessionresponse.js +195 -0
  202. package/models/components/paymentsessionresponse.js.map +1 -0
  203. package/models/errors/httpclienterrors.js +2 -2
  204. package/models/errors/httpclienterrors.js.map +1 -1
  205. package/models/operations/index.d.ts +1 -0
  206. package/models/operations/index.d.ts.map +1 -1
  207. package/models/operations/index.js +1 -0
  208. package/models/operations/index.js.map +1 -1
  209. package/models/operations/postorder.d.ts +15 -0
  210. package/models/operations/postorder.d.ts.map +1 -1
  211. package/models/operations/postorder.js +12 -0
  212. package/models/operations/postorder.js.map +1 -1
  213. package/models/operations/postpaymentssession.d.ts +120 -0
  214. package/models/operations/postpaymentssession.d.ts.map +1 -0
  215. package/models/operations/postpaymentssession.js +161 -0
  216. package/models/operations/postpaymentssession.js.map +1 -0
  217. package/package.json +1 -1
  218. package/sdk/auth.js +1 -2
  219. package/sdk/auth.js.map +1 -1
  220. package/sdk/campaigns.js +1 -2
  221. package/sdk/campaigns.js.map +1 -1
  222. package/sdk/catalog.js +3 -6
  223. package/sdk/catalog.js.map +1 -1
  224. package/sdk/cestorefrontreviews.d.ts +2 -2
  225. package/sdk/cestorefrontreviews.js +2 -2
  226. package/sdk/customers.js +3 -6
  227. package/sdk/customers.js.map +1 -1
  228. package/sdk/offers.js +2 -4
  229. package/sdk/offers.js.map +1 -1
  230. package/sdk/orders.js +3 -6
  231. package/sdk/orders.js.map +1 -1
  232. package/sdk/paymentsapi.d.ts +12 -0
  233. package/sdk/paymentsapi.d.ts.map +1 -0
  234. package/sdk/paymentsapi.js +22 -0
  235. package/sdk/paymentsapi.js.map +1 -0
  236. package/sdk/products.js +2 -4
  237. package/sdk/products.js.map +1 -1
  238. package/sdk/sdk.d.ts +3 -0
  239. package/sdk/sdk.d.ts.map +1 -1
  240. package/sdk/sdk.js +19 -30
  241. package/sdk/sdk.js.map +1 -1
  242. package/sdk/user.js +1 -2
  243. package/sdk/user.js.map +1 -1
  244. package/src/funcs/catalogProductsReviewsList.ts +2 -2
  245. package/src/funcs/paymentsAPIPostPaymentsSession.ts +125 -0
  246. package/src/lib/config.ts +3 -3
  247. package/src/lib/security.ts +1 -1
  248. package/src/models/components/index.ts +1 -0
  249. package/src/models/components/paymentsessionresponse.ts +322 -0
  250. package/src/models/operations/index.ts +1 -0
  251. package/src/models/operations/postorder.ts +27 -0
  252. package/src/models/operations/postpaymentssession.ts +254 -0
  253. package/src/sdk/cestorefrontreviews.ts +2 -2
  254. package/src/sdk/paymentsapi.ts +27 -0
  255. 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
- * Retrieve product reviews
13
+ * List all product reviews
14
14
  *
15
15
  * @remarks
16
- * Retrieves a 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.
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));