ce-storefront 0.3.9 → 0.3.11

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 (208) hide show
  1. package/docs/sdks/auth/README.md +2 -0
  2. package/docs/sdks/carts/README.md +22 -12
  3. package/docs/sdks/cestorefrontuser/README.md +30 -2
  4. package/docs/sdks/checkout/README.md +4 -0
  5. package/esm/funcs/cartsAddItem.js +1 -1
  6. package/esm/funcs/cartsAddItem.js.map +1 -1
  7. package/esm/lib/config.d.ts +2 -2
  8. package/esm/lib/config.js +2 -2
  9. package/esm/lib/config.js.map +1 -1
  10. package/esm/models/components/anonymoususer.d.ts +14 -14
  11. package/esm/models/components/anonymoususer.d.ts.map +1 -1
  12. package/esm/models/components/anonymoususer.js +14 -14
  13. package/esm/models/components/anonymoususer.js.map +1 -1
  14. package/esm/models/components/associatedoption.d.ts +4 -102
  15. package/esm/models/components/associatedoption.d.ts.map +1 -1
  16. package/esm/models/components/associatedoption.js +4 -82
  17. package/esm/models/components/associatedoption.js.map +1 -1
  18. package/esm/models/components/bundleproduct.d.ts +48 -48
  19. package/esm/models/components/bundleproduct.d.ts.map +1 -1
  20. package/esm/models/components/bundleproduct.js +46 -50
  21. package/esm/models/components/bundleproduct.js.map +1 -1
  22. package/esm/models/components/bundleproductdetail.d.ts +66 -66
  23. package/esm/models/components/bundleproductdetail.d.ts.map +1 -1
  24. package/esm/models/components/bundleproductdetail.js +62 -66
  25. package/esm/models/components/bundleproductdetail.js.map +1 -1
  26. package/esm/models/components/coloroption.d.ts +72 -0
  27. package/esm/models/components/coloroption.d.ts.map +1 -0
  28. package/esm/models/components/coloroption.js +62 -0
  29. package/esm/models/components/coloroption.js.map +1 -0
  30. package/esm/models/components/currency.d.ts +6 -6
  31. package/esm/models/components/currency.d.ts.map +1 -1
  32. package/esm/models/components/currency.js +6 -6
  33. package/esm/models/components/currency.js.map +1 -1
  34. package/esm/models/components/index.d.ts +3 -1
  35. package/esm/models/components/index.d.ts.map +1 -1
  36. package/esm/models/components/index.js +3 -1
  37. package/esm/models/components/index.js.map +1 -1
  38. package/esm/models/components/notificationpreferences.d.ts +6 -6
  39. package/esm/models/components/notificationpreferences.d.ts.map +1 -1
  40. package/esm/models/components/notificationpreferences.js +6 -6
  41. package/esm/models/components/notificationpreferences.js.map +1 -1
  42. package/esm/models/components/pagination.d.ts +8 -8
  43. package/esm/models/components/pagination.d.ts.map +1 -1
  44. package/esm/models/components/pagination.js +8 -8
  45. package/esm/models/components/pagination.js.map +1 -1
  46. package/esm/models/components/productattribute.d.ts +2 -2
  47. package/esm/models/components/productattribute.d.ts.map +1 -1
  48. package/esm/models/components/productattribute.js +2 -2
  49. package/esm/models/components/productattribute.js.map +1 -1
  50. package/esm/models/components/productcategory.d.ts +20 -20
  51. package/esm/models/components/productcategory.d.ts.map +1 -1
  52. package/esm/models/components/productcategory.js +20 -20
  53. package/esm/models/components/productcategory.js.map +1 -1
  54. package/esm/models/components/productdetail.d.ts +2 -14
  55. package/esm/models/components/productdetail.d.ts.map +1 -1
  56. package/esm/models/components/productdetail.js +4 -18
  57. package/esm/models/components/productdetail.js.map +1 -1
  58. package/esm/models/components/productimage.d.ts +14 -14
  59. package/esm/models/components/productimage.d.ts.map +1 -1
  60. package/esm/models/components/productimage.js +14 -14
  61. package/esm/models/components/productimage.js.map +1 -1
  62. package/esm/models/components/productpricing.d.ts +4 -4
  63. package/esm/models/components/productpricing.d.ts.map +1 -1
  64. package/esm/models/components/productpricing.js +4 -4
  65. package/esm/models/components/productpricing.js.map +1 -1
  66. package/esm/models/components/productshipping.d.ts +12 -12
  67. package/esm/models/components/productshipping.d.ts.map +1 -1
  68. package/esm/models/components/productshipping.js +12 -12
  69. package/esm/models/components/productshipping.js.map +1 -1
  70. package/esm/models/components/productvideo.d.ts +16 -16
  71. package/esm/models/components/productvideo.d.ts.map +1 -1
  72. package/esm/models/components/productvideo.js +16 -16
  73. package/esm/models/components/productvideo.js.map +1 -1
  74. package/esm/models/components/seo.d.ts +8 -8
  75. package/esm/models/components/seo.d.ts.map +1 -1
  76. package/esm/models/components/seo.js +8 -8
  77. package/esm/models/components/seo.js.map +1 -1
  78. package/esm/models/components/singleproduct.d.ts +18 -18
  79. package/esm/models/components/singleproduct.d.ts.map +1 -1
  80. package/esm/models/components/singleproduct.js +18 -18
  81. package/esm/models/components/singleproduct.js.map +1 -1
  82. package/esm/models/components/singleproductdetail.d.ts +36 -36
  83. package/esm/models/components/singleproductdetail.d.ts.map +1 -1
  84. package/esm/models/components/singleproductdetail.js +34 -34
  85. package/esm/models/components/singleproductdetail.js.map +1 -1
  86. package/esm/models/components/singleselectoption.d.ts +42 -0
  87. package/esm/models/components/singleselectoption.d.ts.map +1 -0
  88. package/esm/models/components/singleselectoption.js +35 -0
  89. package/esm/models/components/singleselectoption.js.map +1 -0
  90. package/esm/models/components/sku.d.ts +30 -30
  91. package/esm/models/components/sku.d.ts.map +1 -1
  92. package/esm/models/components/sku.js +28 -30
  93. package/esm/models/components/sku.js.map +1 -1
  94. package/esm/models/components/updatecartitem.d.ts +45 -0
  95. package/esm/models/components/updatecartitem.d.ts.map +1 -0
  96. package/esm/models/components/updatecartitem.js +46 -0
  97. package/esm/models/components/updatecartitem.js.map +1 -0
  98. package/esm/models/components/user.d.ts +116 -26
  99. package/esm/models/components/user.d.ts.map +1 -1
  100. package/esm/models/components/user.js +104 -30
  101. package/esm/models/components/user.js.map +1 -1
  102. package/esm/models/components/variant.d.ts +15 -12
  103. package/esm/models/components/variant.d.ts.map +1 -1
  104. package/esm/models/components/variant.js +12 -12
  105. package/esm/models/components/variant.js.map +1 -1
  106. package/esm/models/components/variantdetail.d.ts +41 -38
  107. package/esm/models/components/variantdetail.d.ts.map +1 -1
  108. package/esm/models/components/variantdetail.js +36 -36
  109. package/esm/models/components/variantdetail.js.map +1 -1
  110. package/esm/models/components/variantoption.d.ts +34 -26
  111. package/esm/models/components/variantoption.d.ts.map +1 -1
  112. package/esm/models/components/variantoption.js +32 -45
  113. package/esm/models/components/variantoption.js.map +1 -1
  114. package/esm/models/operations/getcrosssell.d.ts +6 -6
  115. package/esm/models/operations/getcrosssell.d.ts.map +1 -1
  116. package/esm/models/operations/getcrosssell.js +6 -6
  117. package/esm/models/operations/getcrosssell.js.map +1 -1
  118. package/esm/models/operations/getproductscategories.d.ts +4 -4
  119. package/esm/models/operations/getproductscategories.d.ts.map +1 -1
  120. package/esm/models/operations/getproductscategories.js +4 -4
  121. package/esm/models/operations/getproductscategories.js.map +1 -1
  122. package/esm/models/operations/getproductsidreviews.d.ts +4 -4
  123. package/esm/models/operations/getproductsidreviews.d.ts.map +1 -1
  124. package/esm/models/operations/getproductsidreviews.js +4 -4
  125. package/esm/models/operations/getproductsidreviews.js.map +1 -1
  126. package/esm/models/operations/getsimilar.d.ts +6 -6
  127. package/esm/models/operations/getsimilar.d.ts.map +1 -1
  128. package/esm/models/operations/getsimilar.js +6 -6
  129. package/esm/models/operations/getsimilar.js.map +1 -1
  130. package/esm/models/operations/getskus.d.ts +4 -4
  131. package/esm/models/operations/getskus.d.ts.map +1 -1
  132. package/esm/models/operations/getskus.js +4 -4
  133. package/esm/models/operations/getskus.js.map +1 -1
  134. package/esm/models/operations/getupsell.d.ts +6 -6
  135. package/esm/models/operations/getupsell.d.ts.map +1 -1
  136. package/esm/models/operations/getupsell.js +6 -6
  137. package/esm/models/operations/getupsell.js.map +1 -1
  138. package/esm/models/operations/postauthanonymous.d.ts +12 -12
  139. package/esm/models/operations/postauthanonymous.d.ts.map +1 -1
  140. package/esm/models/operations/postauthanonymous.js +12 -12
  141. package/esm/models/operations/postauthanonymous.js.map +1 -1
  142. package/esm/models/operations/postauthgenerateotp.d.ts +2 -2
  143. package/esm/models/operations/postauthgenerateotp.d.ts.map +1 -1
  144. package/esm/models/operations/postauthgenerateotp.js +2 -2
  145. package/esm/models/operations/postauthgenerateotp.js.map +1 -1
  146. package/esm/models/operations/postcartaddress.d.ts +8 -8
  147. package/esm/models/operations/postcartaddress.d.ts.map +1 -1
  148. package/esm/models/operations/postcartaddress.js +8 -12
  149. package/esm/models/operations/postcartaddress.js.map +1 -1
  150. package/esm/models/operations/postcartitemid.d.ts +2 -35
  151. package/esm/models/operations/postcartitemid.d.ts.map +1 -1
  152. package/esm/models/operations/postcartitemid.js +4 -49
  153. package/esm/models/operations/postcartitemid.js.map +1 -1
  154. package/esm/models/operations/postcartsid.d.ts +5 -31
  155. package/esm/models/operations/postcartsid.d.ts.map +1 -1
  156. package/esm/models/operations/postcartsid.js +2 -41
  157. package/esm/models/operations/postcartsid.js.map +1 -1
  158. package/esm/models/operations/postproductsidreviews.d.ts +4 -4
  159. package/esm/models/operations/postproductsidreviews.d.ts.map +1 -1
  160. package/esm/models/operations/postproductsidreviews.js +4 -4
  161. package/esm/models/operations/postproductsidreviews.js.map +1 -1
  162. package/jsr.json +1 -1
  163. package/package.json +1 -1
  164. package/src/funcs/cartsAddItem.ts +1 -1
  165. package/src/lib/config.ts +2 -2
  166. package/src/models/components/anonymoususer.ts +28 -28
  167. package/src/models/components/associatedoption.ts +19 -164
  168. package/src/models/components/bundleproduct.ts +92 -99
  169. package/src/models/components/bundleproductdetail.ts +124 -131
  170. package/src/models/components/coloroption.ts +144 -0
  171. package/src/models/components/currency.ts +12 -12
  172. package/src/models/components/index.ts +3 -1
  173. package/src/models/components/notificationpreferences.ts +12 -12
  174. package/src/models/components/pagination.ts +16 -16
  175. package/src/models/components/productattribute.ts +4 -4
  176. package/src/models/components/productcategory.ts +40 -40
  177. package/src/models/components/productdetail.ts +7 -37
  178. package/src/models/components/productimage.ts +28 -28
  179. package/src/models/components/productpricing.ts +8 -8
  180. package/src/models/components/productshipping.ts +24 -24
  181. package/src/models/components/productvideo.ts +32 -32
  182. package/src/models/components/seo.ts +16 -16
  183. package/src/models/components/singleproduct.ts +36 -36
  184. package/src/models/components/singleproductdetail.ts +68 -68
  185. package/src/models/components/singleselectoption.ts +83 -0
  186. package/src/models/components/sku.ts +56 -61
  187. package/src/models/components/updatecartitem.ts +93 -0
  188. package/src/models/components/user.ts +199 -56
  189. package/src/models/components/variant.ts +27 -24
  190. package/src/models/components/variantdetail.ts +75 -72
  191. package/src/models/components/variantoption.ts +54 -61
  192. package/src/models/operations/getcrosssell.ts +12 -12
  193. package/src/models/operations/getproductscategories.ts +8 -8
  194. package/src/models/operations/getproductsidreviews.ts +8 -8
  195. package/src/models/operations/getsimilar.ts +12 -12
  196. package/src/models/operations/getskus.ts +8 -8
  197. package/src/models/operations/getupsell.ts +12 -12
  198. package/src/models/operations/postauthanonymous.ts +24 -24
  199. package/src/models/operations/postauthgenerateotp.ts +4 -4
  200. package/src/models/operations/postcartaddress.ts +16 -23
  201. package/src/models/operations/postcartitemid.ts +6 -94
  202. package/src/models/operations/postcartsid.ts +7 -72
  203. package/src/models/operations/postproductsidreviews.ts +8 -8
  204. package/esm/models/components/userinput.d.ts +0 -63
  205. package/esm/models/components/userinput.d.ts.map +0 -1
  206. package/esm/models/components/userinput.js +0 -61
  207. package/esm/models/components/userinput.js.map +0 -1
  208. package/src/models/components/userinput.ts +0 -130
@@ -35,9 +35,9 @@ export type GetUpSellResponseBody = {
35
35
  /**
36
36
  * Masssage
37
37
  */
38
- message?: string | undefined;
39
- success?: boolean | undefined;
40
- content?: components.ProductListResponse | undefined;
38
+ message: string;
39
+ success: boolean;
40
+ content: components.ProductListResponse;
41
41
  };
42
42
 
43
43
  /** @internal */
@@ -119,16 +119,16 @@ export const GetUpSellResponseBody$inboundSchema: z.ZodType<
119
119
  z.ZodTypeDef,
120
120
  unknown
121
121
  > = z.object({
122
- message: z.string().optional(),
123
- success: z.boolean().optional(),
124
- content: components.ProductListResponse$inboundSchema.optional(),
122
+ message: z.string(),
123
+ success: z.boolean(),
124
+ content: components.ProductListResponse$inboundSchema,
125
125
  });
126
126
 
127
127
  /** @internal */
128
128
  export type GetUpSellResponseBody$Outbound = {
129
- message?: string | undefined;
130
- success?: boolean | undefined;
131
- content?: components.ProductListResponse$Outbound | undefined;
129
+ message: string;
130
+ success: boolean;
131
+ content: components.ProductListResponse$Outbound;
132
132
  };
133
133
 
134
134
  /** @internal */
@@ -137,9 +137,9 @@ export const GetUpSellResponseBody$outboundSchema: z.ZodType<
137
137
  z.ZodTypeDef,
138
138
  GetUpSellResponseBody
139
139
  > = z.object({
140
- message: z.string().optional(),
141
- success: z.boolean().optional(),
142
- content: components.ProductListResponse$outboundSchema.optional(),
140
+ message: z.string(),
141
+ success: z.boolean(),
142
+ content: components.ProductListResponse$outboundSchema,
143
143
  });
144
144
 
145
145
  /**
@@ -17,15 +17,15 @@ export type PostAuthAnonymousSecurity = {
17
17
  * An object containing the response content.
18
18
  */
19
19
  export type PostAuthAnonymousContent = {
20
- user?: components.AnonymousUser | undefined;
20
+ user: components.AnonymousUser;
21
21
  /**
22
22
  * It is a string-based token utilized for authentication and authorization.
23
23
  */
24
- accessToken?: string | undefined;
24
+ accessToken: string;
25
25
  /**
26
26
  * It is a string-based token designed for refreshing the user's access token.
27
27
  */
28
- refreshToken?: string | undefined;
28
+ refreshToken: string;
29
29
  };
30
30
 
31
31
  /**
@@ -35,15 +35,15 @@ export type PostAuthAnonymousResponseBody = {
35
35
  /**
36
36
  * A string containing a descriptive message related to the success or failure of the anonymous user creation or authentication.
37
37
  */
38
- message?: string | undefined;
38
+ message: string;
39
39
  /**
40
40
  * A boolean value indicates the success or failure of the anonymous user operation.`true` for success `false` for failure.
41
41
  */
42
- success?: boolean | undefined;
42
+ success: boolean;
43
43
  /**
44
44
  * An object containing the response content.
45
45
  */
46
- content?: PostAuthAnonymousContent | undefined;
46
+ content: PostAuthAnonymousContent;
47
47
  };
48
48
 
49
49
  /** @internal */
@@ -114,9 +114,9 @@ export const PostAuthAnonymousContent$inboundSchema: z.ZodType<
114
114
  z.ZodTypeDef,
115
115
  unknown
116
116
  > = z.object({
117
- user: components.AnonymousUser$inboundSchema.optional(),
118
- access_token: z.string().optional(),
119
- refresh_token: z.string().optional(),
117
+ user: components.AnonymousUser$inboundSchema,
118
+ access_token: z.string(),
119
+ refresh_token: z.string(),
120
120
  }).transform((v) => {
121
121
  return remap$(v, {
122
122
  "access_token": "accessToken",
@@ -126,9 +126,9 @@ export const PostAuthAnonymousContent$inboundSchema: z.ZodType<
126
126
 
127
127
  /** @internal */
128
128
  export type PostAuthAnonymousContent$Outbound = {
129
- user?: components.AnonymousUser$Outbound | undefined;
130
- access_token?: string | undefined;
131
- refresh_token?: string | undefined;
129
+ user: components.AnonymousUser$Outbound;
130
+ access_token: string;
131
+ refresh_token: string;
132
132
  };
133
133
 
134
134
  /** @internal */
@@ -137,9 +137,9 @@ export const PostAuthAnonymousContent$outboundSchema: z.ZodType<
137
137
  z.ZodTypeDef,
138
138
  PostAuthAnonymousContent
139
139
  > = z.object({
140
- user: components.AnonymousUser$outboundSchema.optional(),
141
- accessToken: z.string().optional(),
142
- refreshToken: z.string().optional(),
140
+ user: components.AnonymousUser$outboundSchema,
141
+ accessToken: z.string(),
142
+ refreshToken: z.string(),
143
143
  }).transform((v) => {
144
144
  return remap$(v, {
145
145
  accessToken: "access_token",
@@ -184,16 +184,16 @@ export const PostAuthAnonymousResponseBody$inboundSchema: z.ZodType<
184
184
  z.ZodTypeDef,
185
185
  unknown
186
186
  > = z.object({
187
- message: z.string().optional(),
188
- success: z.boolean().optional(),
189
- content: z.lazy(() => PostAuthAnonymousContent$inboundSchema).optional(),
187
+ message: z.string(),
188
+ success: z.boolean(),
189
+ content: z.lazy(() => PostAuthAnonymousContent$inboundSchema),
190
190
  });
191
191
 
192
192
  /** @internal */
193
193
  export type PostAuthAnonymousResponseBody$Outbound = {
194
- message?: string | undefined;
195
- success?: boolean | undefined;
196
- content?: PostAuthAnonymousContent$Outbound | undefined;
194
+ message: string;
195
+ success: boolean;
196
+ content: PostAuthAnonymousContent$Outbound;
197
197
  };
198
198
 
199
199
  /** @internal */
@@ -202,9 +202,9 @@ export const PostAuthAnonymousResponseBody$outboundSchema: z.ZodType<
202
202
  z.ZodTypeDef,
203
203
  PostAuthAnonymousResponseBody
204
204
  > = z.object({
205
- message: z.string().optional(),
206
- success: z.boolean().optional(),
207
- content: z.lazy(() => PostAuthAnonymousContent$outboundSchema).optional(),
205
+ message: z.string(),
206
+ success: z.boolean(),
207
+ content: z.lazy(() => PostAuthAnonymousContent$outboundSchema),
208
208
  });
209
209
 
210
210
  /**
@@ -55,7 +55,7 @@ export type PostAuthGenerateOtpRequestBody = {
55
55
  * A string representing the email address.
56
56
  */
57
57
  email?: string | undefined;
58
- otpAction?: PostAuthGenerateOtpOtpAction | undefined;
58
+ otpAction: PostAuthGenerateOtpOtpAction;
59
59
  };
60
60
 
61
61
  /**
@@ -140,7 +140,7 @@ export const PostAuthGenerateOtpRequestBody$inboundSchema: z.ZodType<
140
140
  country_code: z.string().optional(),
141
141
  phone: z.string().optional(),
142
142
  email: z.string().optional(),
143
- otp_action: PostAuthGenerateOtpOtpAction$inboundSchema.optional(),
143
+ otp_action: PostAuthGenerateOtpOtpAction$inboundSchema,
144
144
  }).transform((v) => {
145
145
  return remap$(v, {
146
146
  "country_code": "countryCode",
@@ -154,7 +154,7 @@ export type PostAuthGenerateOtpRequestBody$Outbound = {
154
154
  country_code?: string | undefined;
155
155
  phone?: string | undefined;
156
156
  email?: string | undefined;
157
- otp_action?: string | undefined;
157
+ otp_action: string;
158
158
  };
159
159
 
160
160
  /** @internal */
@@ -167,7 +167,7 @@ export const PostAuthGenerateOtpRequestBody$outboundSchema: z.ZodType<
167
167
  countryCode: z.string().optional(),
168
168
  phone: z.string().optional(),
169
169
  email: z.string().optional(),
170
- otpAction: PostAuthGenerateOtpOtpAction$outboundSchema.optional(),
170
+ otpAction: PostAuthGenerateOtpOtpAction$outboundSchema,
171
171
  }).transform((v) => {
172
172
  return remap$(v, {
173
173
  countryCode: "country_code",
@@ -14,8 +14,8 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
14
  */
15
15
  export type GuestUser = {
16
16
  cartId: string;
17
- billingAddress?: components.CustomerAddressInput | null | undefined;
18
- shippingAddress?: components.CustomerAddressInput | null | undefined;
17
+ billingAddress: components.CustomerAddressInput | null;
18
+ shippingAddress: components.CustomerAddressInput | null;
19
19
  };
20
20
 
21
21
  /**
@@ -23,8 +23,8 @@ export type GuestUser = {
23
23
  */
24
24
  export type RegisteredUser = {
25
25
  cartId: string;
26
- billingAddressId?: string | undefined;
27
- shippingAddressId?: string | undefined;
26
+ billingAddressId: string;
27
+ shippingAddressId: string;
28
28
  };
29
29
 
30
30
  /**
@@ -55,10 +55,8 @@ export const GuestUser$inboundSchema: z.ZodType<
55
55
  unknown
56
56
  > = z.object({
57
57
  cart_id: z.string(),
58
- billing_address: z.nullable(components.CustomerAddressInput$inboundSchema)
59
- .optional(),
60
- shipping_address: z.nullable(components.CustomerAddressInput$inboundSchema)
61
- .optional(),
58
+ billing_address: z.nullable(components.CustomerAddressInput$inboundSchema),
59
+ shipping_address: z.nullable(components.CustomerAddressInput$inboundSchema),
62
60
  }).transform((v) => {
63
61
  return remap$(v, {
64
62
  "cart_id": "cartId",
@@ -70,11 +68,8 @@ export const GuestUser$inboundSchema: z.ZodType<
70
68
  /** @internal */
71
69
  export type GuestUser$Outbound = {
72
70
  cart_id: string;
73
- billing_address?: components.CustomerAddressInput$Outbound | null | undefined;
74
- shipping_address?:
75
- | components.CustomerAddressInput$Outbound
76
- | null
77
- | undefined;
71
+ billing_address: components.CustomerAddressInput$Outbound | null;
72
+ shipping_address: components.CustomerAddressInput$Outbound | null;
78
73
  };
79
74
 
80
75
  /** @internal */
@@ -84,10 +79,8 @@ export const GuestUser$outboundSchema: z.ZodType<
84
79
  GuestUser
85
80
  > = z.object({
86
81
  cartId: z.string(),
87
- billingAddress: z.nullable(components.CustomerAddressInput$outboundSchema)
88
- .optional(),
89
- shippingAddress: z.nullable(components.CustomerAddressInput$outboundSchema)
90
- .optional(),
82
+ billingAddress: z.nullable(components.CustomerAddressInput$outboundSchema),
83
+ shippingAddress: z.nullable(components.CustomerAddressInput$outboundSchema),
91
84
  }).transform((v) => {
92
85
  return remap$(v, {
93
86
  cartId: "cart_id",
@@ -130,8 +123,8 @@ export const RegisteredUser$inboundSchema: z.ZodType<
130
123
  unknown
131
124
  > = z.object({
132
125
  cart_id: z.string(),
133
- billing_address_id: z.string().optional(),
134
- shipping_address_id: z.string().optional(),
126
+ billing_address_id: z.string(),
127
+ shipping_address_id: z.string(),
135
128
  }).transform((v) => {
136
129
  return remap$(v, {
137
130
  "cart_id": "cartId",
@@ -143,8 +136,8 @@ export const RegisteredUser$inboundSchema: z.ZodType<
143
136
  /** @internal */
144
137
  export type RegisteredUser$Outbound = {
145
138
  cart_id: string;
146
- billing_address_id?: string | undefined;
147
- shipping_address_id?: string | undefined;
139
+ billing_address_id: string;
140
+ shipping_address_id: string;
148
141
  };
149
142
 
150
143
  /** @internal */
@@ -154,8 +147,8 @@ export const RegisteredUser$outboundSchema: z.ZodType<
154
147
  RegisteredUser
155
148
  > = z.object({
156
149
  cartId: z.string(),
157
- billingAddressId: z.string().optional(),
158
- shippingAddressId: z.string().optional(),
150
+ billingAddressId: z.string(),
151
+ shippingAddressId: z.string(),
159
152
  }).transform((v) => {
160
153
  return remap$(v, {
161
154
  cartId: "cart_id",
@@ -9,20 +9,12 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import * as components from "../components/index.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
- export type PostCartItemIdAddToCartItem = {
13
- productId: string;
14
- sku: string;
15
- quantity: number;
16
- onSubscription?: boolean | undefined;
17
- subscriptionPlan?: string | null | undefined;
18
- };
19
-
20
12
  export type PostCartItemIdRequest = {
21
13
  /**
22
14
  * cart id
23
15
  */
24
16
  id: string;
25
- requestBody: PostCartItemIdAddToCartItem;
17
+ updateCartItem: components.UpdateCartItem;
26
18
  };
27
19
 
28
20
  export type PostCartItemIdContent = {
@@ -41,86 +33,6 @@ export type PostCartItemIdResponseBody = {
41
33
  content?: PostCartItemIdContent | undefined;
42
34
  };
43
35
 
44
- /** @internal */
45
- export const PostCartItemIdAddToCartItem$inboundSchema: z.ZodType<
46
- PostCartItemIdAddToCartItem,
47
- z.ZodTypeDef,
48
- unknown
49
- > = z.object({
50
- product_id: z.string(),
51
- sku: z.string(),
52
- quantity: z.number().int(),
53
- on_subscription: z.boolean().default(false),
54
- subscription_plan: z.nullable(z.string()).optional(),
55
- }).transform((v) => {
56
- return remap$(v, {
57
- "product_id": "productId",
58
- "on_subscription": "onSubscription",
59
- "subscription_plan": "subscriptionPlan",
60
- });
61
- });
62
-
63
- /** @internal */
64
- export type PostCartItemIdAddToCartItem$Outbound = {
65
- product_id: string;
66
- sku: string;
67
- quantity: number;
68
- on_subscription: boolean;
69
- subscription_plan?: string | null | undefined;
70
- };
71
-
72
- /** @internal */
73
- export const PostCartItemIdAddToCartItem$outboundSchema: z.ZodType<
74
- PostCartItemIdAddToCartItem$Outbound,
75
- z.ZodTypeDef,
76
- PostCartItemIdAddToCartItem
77
- > = z.object({
78
- productId: z.string(),
79
- sku: z.string(),
80
- quantity: z.number().int(),
81
- onSubscription: z.boolean().default(false),
82
- subscriptionPlan: z.nullable(z.string()).optional(),
83
- }).transform((v) => {
84
- return remap$(v, {
85
- productId: "product_id",
86
- onSubscription: "on_subscription",
87
- subscriptionPlan: "subscription_plan",
88
- });
89
- });
90
-
91
- /**
92
- * @internal
93
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
94
- */
95
- export namespace PostCartItemIdAddToCartItem$ {
96
- /** @deprecated use `PostCartItemIdAddToCartItem$inboundSchema` instead. */
97
- export const inboundSchema = PostCartItemIdAddToCartItem$inboundSchema;
98
- /** @deprecated use `PostCartItemIdAddToCartItem$outboundSchema` instead. */
99
- export const outboundSchema = PostCartItemIdAddToCartItem$outboundSchema;
100
- /** @deprecated use `PostCartItemIdAddToCartItem$Outbound` instead. */
101
- export type Outbound = PostCartItemIdAddToCartItem$Outbound;
102
- }
103
-
104
- export function postCartItemIdAddToCartItemToJSON(
105
- postCartItemIdAddToCartItem: PostCartItemIdAddToCartItem,
106
- ): string {
107
- return JSON.stringify(
108
- PostCartItemIdAddToCartItem$outboundSchema.parse(
109
- postCartItemIdAddToCartItem,
110
- ),
111
- );
112
- }
113
-
114
- export function postCartItemIdAddToCartItemFromJSON(
115
- jsonString: string,
116
- ): SafeParseResult<PostCartItemIdAddToCartItem, SDKValidationError> {
117
- return safeParse(
118
- jsonString,
119
- (x) => PostCartItemIdAddToCartItem$inboundSchema.parse(JSON.parse(x)),
120
- `Failed to parse 'PostCartItemIdAddToCartItem' from JSON`,
121
- );
122
- }
123
-
124
36
  /** @internal */
125
37
  export const PostCartItemIdRequest$inboundSchema: z.ZodType<
126
38
  PostCartItemIdRequest,
@@ -128,17 +40,17 @@ export const PostCartItemIdRequest$inboundSchema: z.ZodType<
128
40
  unknown
129
41
  > = z.object({
130
42
  id: z.string(),
131
- RequestBody: z.lazy(() => PostCartItemIdAddToCartItem$inboundSchema),
43
+ UpdateCartItem: components.UpdateCartItem$inboundSchema,
132
44
  }).transform((v) => {
133
45
  return remap$(v, {
134
- "RequestBody": "requestBody",
46
+ "UpdateCartItem": "updateCartItem",
135
47
  });
136
48
  });
137
49
 
138
50
  /** @internal */
139
51
  export type PostCartItemIdRequest$Outbound = {
140
52
  id: string;
141
- RequestBody: PostCartItemIdAddToCartItem$Outbound;
53
+ UpdateCartItem: components.UpdateCartItem$Outbound;
142
54
  };
143
55
 
144
56
  /** @internal */
@@ -148,10 +60,10 @@ export const PostCartItemIdRequest$outboundSchema: z.ZodType<
148
60
  PostCartItemIdRequest
149
61
  > = z.object({
150
62
  id: z.string(),
151
- requestBody: z.lazy(() => PostCartItemIdAddToCartItem$outboundSchema),
63
+ updateCartItem: components.UpdateCartItem$outboundSchema,
152
64
  }).transform((v) => {
153
65
  return remap$(v, {
154
- requestBody: "RequestBody",
66
+ updateCartItem: "UpdateCartItem",
155
67
  });
156
68
  });
157
69
 
@@ -3,20 +3,16 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import * as components from "../components/index.js";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
10
 
12
- export type Items = {
13
- productId?: string | undefined;
14
- sku?: string | undefined;
15
- quantity?: number | undefined;
16
- };
17
-
18
11
  export type PostCartsIdRequestBody = {
19
- items?: Array<Items> | undefined;
12
+ /**
13
+ * Schema for updating a cart item, including adding, removing, or adjusting the quantity of a product or variant.
14
+ */
15
+ items: components.UpdateCartItem;
20
16
  };
21
17
 
22
18
  export type PostCartsIdContent = {
@@ -35,79 +31,18 @@ export type PostCartsIdResponseBody = {
35
31
  content?: PostCartsIdContent | undefined;
36
32
  };
37
33
 
38
- /** @internal */
39
- export const Items$inboundSchema: z.ZodType<Items, z.ZodTypeDef, unknown> = z
40
- .object({
41
- product_id: z.string().optional(),
42
- sku: z.string().optional(),
43
- quantity: z.number().int().optional(),
44
- }).transform((v) => {
45
- return remap$(v, {
46
- "product_id": "productId",
47
- });
48
- });
49
-
50
- /** @internal */
51
- export type Items$Outbound = {
52
- product_id?: string | undefined;
53
- sku?: string | undefined;
54
- quantity?: number | undefined;
55
- };
56
-
57
- /** @internal */
58
- export const Items$outboundSchema: z.ZodType<
59
- Items$Outbound,
60
- z.ZodTypeDef,
61
- Items
62
- > = z.object({
63
- productId: z.string().optional(),
64
- sku: z.string().optional(),
65
- quantity: z.number().int().optional(),
66
- }).transform((v) => {
67
- return remap$(v, {
68
- productId: "product_id",
69
- });
70
- });
71
-
72
- /**
73
- * @internal
74
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
75
- */
76
- export namespace Items$ {
77
- /** @deprecated use `Items$inboundSchema` instead. */
78
- export const inboundSchema = Items$inboundSchema;
79
- /** @deprecated use `Items$outboundSchema` instead. */
80
- export const outboundSchema = Items$outboundSchema;
81
- /** @deprecated use `Items$Outbound` instead. */
82
- export type Outbound = Items$Outbound;
83
- }
84
-
85
- export function itemsToJSON(items: Items): string {
86
- return JSON.stringify(Items$outboundSchema.parse(items));
87
- }
88
-
89
- export function itemsFromJSON(
90
- jsonString: string,
91
- ): SafeParseResult<Items, SDKValidationError> {
92
- return safeParse(
93
- jsonString,
94
- (x) => Items$inboundSchema.parse(JSON.parse(x)),
95
- `Failed to parse 'Items' from JSON`,
96
- );
97
- }
98
-
99
34
  /** @internal */
100
35
  export const PostCartsIdRequestBody$inboundSchema: z.ZodType<
101
36
  PostCartsIdRequestBody,
102
37
  z.ZodTypeDef,
103
38
  unknown
104
39
  > = z.object({
105
- items: z.array(z.lazy(() => Items$inboundSchema)).optional(),
40
+ items: components.UpdateCartItem$inboundSchema,
106
41
  });
107
42
 
108
43
  /** @internal */
109
44
  export type PostCartsIdRequestBody$Outbound = {
110
- items?: Array<Items$Outbound> | undefined;
45
+ items: components.UpdateCartItem$Outbound;
111
46
  };
112
47
 
113
48
  /** @internal */
@@ -116,7 +51,7 @@ export const PostCartsIdRequestBody$outboundSchema: z.ZodType<
116
51
  z.ZodTypeDef,
117
52
  PostCartsIdRequestBody
118
53
  > = z.object({
119
- items: z.array(z.lazy(() => Items$outboundSchema)).optional(),
54
+ items: components.UpdateCartItem$outboundSchema,
120
55
  });
121
56
 
122
57
  /**
@@ -21,8 +21,8 @@ export type PostProductsIdReviewsRequest = {
21
21
  * Success response
22
22
  */
23
23
  export type PostProductsIdReviewsResponseBody = {
24
- message?: string | undefined;
25
- success?: boolean | undefined;
24
+ message: string;
25
+ success: boolean;
26
26
  };
27
27
 
28
28
  /** @internal */
@@ -100,14 +100,14 @@ export const PostProductsIdReviewsResponseBody$inboundSchema: z.ZodType<
100
100
  z.ZodTypeDef,
101
101
  unknown
102
102
  > = z.object({
103
- message: z.string().optional(),
104
- success: z.boolean().optional(),
103
+ message: z.string(),
104
+ success: z.boolean(),
105
105
  });
106
106
 
107
107
  /** @internal */
108
108
  export type PostProductsIdReviewsResponseBody$Outbound = {
109
- message?: string | undefined;
110
- success?: boolean | undefined;
109
+ message: string;
110
+ success: boolean;
111
111
  };
112
112
 
113
113
  /** @internal */
@@ -116,8 +116,8 @@ export const PostProductsIdReviewsResponseBody$outboundSchema: z.ZodType<
116
116
  z.ZodTypeDef,
117
117
  PostProductsIdReviewsResponseBody
118
118
  > = z.object({
119
- message: z.string().optional(),
120
- success: z.boolean().optional(),
119
+ message: z.string(),
120
+ success: z.boolean(),
121
121
  });
122
122
 
123
123
  /**
@@ -1,63 +0,0 @@
1
- import * as z from "zod";
2
- import { Result as SafeParseResult } from "../../types/fp.js";
3
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
- import { NotificationPreferences, NotificationPreferences$Outbound } from "./notificationpreferences.js";
5
- export type UserInput = {
6
- /**
7
- * User’s first name.
8
- */
9
- firstName?: string | undefined;
10
- /**
11
- * User’s last name.
12
- */
13
- lastName?: string | undefined;
14
- /**
15
- * User’s email I’d.
16
- */
17
- email?: string | undefined;
18
- /**
19
- * 10 digit phone number without country code.
20
- */
21
- phone?: string | undefined;
22
- /**
23
- * Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
24
- *
25
- * @remarks
26
- * Use this key along with phone. Not necessary for email.
27
- */
28
- countryCode?: string | undefined;
29
- /**
30
- * Set channel preferences for each type of
31
- */
32
- notificationPreferences?: NotificationPreferences | undefined;
33
- loginMethods?: Array<string> | undefined;
34
- };
35
- /** @internal */
36
- export declare const UserInput$inboundSchema: z.ZodType<UserInput, z.ZodTypeDef, unknown>;
37
- /** @internal */
38
- export type UserInput$Outbound = {
39
- first_name?: string | undefined;
40
- last_name?: string | undefined;
41
- email?: string | undefined;
42
- phone?: string | undefined;
43
- country_code?: string | undefined;
44
- notification_preferences?: NotificationPreferences$Outbound | undefined;
45
- login_methods?: Array<string> | undefined;
46
- };
47
- /** @internal */
48
- export declare const UserInput$outboundSchema: z.ZodType<UserInput$Outbound, z.ZodTypeDef, UserInput>;
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 declare namespace UserInput$ {
54
- /** @deprecated use `UserInput$inboundSchema` instead. */
55
- const inboundSchema: z.ZodType<UserInput, z.ZodTypeDef, unknown>;
56
- /** @deprecated use `UserInput$outboundSchema` instead. */
57
- const outboundSchema: z.ZodType<UserInput$Outbound, z.ZodTypeDef, UserInput>;
58
- /** @deprecated use `UserInput$Outbound` instead. */
59
- type Outbound = UserInput$Outbound;
60
- }
61
- export declare function userInputToJSON(userInput: UserInput): string;
62
- export declare function userInputFromJSON(jsonString: string): SafeParseResult<UserInput, SDKValidationError>;
63
- //# sourceMappingURL=userinput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"userinput.d.ts","sourceRoot":"","sources":["../../../src/models/components/userinput.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,uBAAuB,EAEvB,gCAAgC,EAEjC,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;OAEG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC9D,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,SAAS,EACT,CAAC,CAAC,UAAU,EACZ,OAAO,CAiBP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,wBAAwB,CAAC,EAAE,gCAAgC,GAAG,SAAS,CAAC;IACxE,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAC9C,kBAAkB,EAClB,CAAC,CAAC,UAAU,EACZ,SAAS,CAiBT,CAAC;AAEH;;;GAGG;AACH,yBAAiB,UAAU,CAAC;IAC1B,yDAAyD;IAClD,MAAM,aAAa,6CAA0B,CAAC;IACrD,0DAA0D;IACnD,MAAM,cAAc,wDAA2B,CAAC;IACvD,oDAAoD;IACpD,KAAY,QAAQ,GAAG,kBAAkB,CAAC;CAC3C;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAMhD"}