ce-storefront 0.15.31 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +0 -1
  2. package/RUNTIMES.md +6 -6
  3. package/esm/funcs/authGenerateOtp.js +1 -1
  4. package/esm/funcs/authGenerateOtp.js.map +1 -1
  5. package/esm/funcs/authGetUserDetail.js +1 -1
  6. package/esm/funcs/authGetUserDetail.js.map +1 -1
  7. package/esm/funcs/authLoginWithEmail.js +1 -1
  8. package/esm/funcs/authLoginWithEmail.js.map +1 -1
  9. package/esm/funcs/authLoginWithPhone.js +1 -1
  10. package/esm/funcs/authLoginWithPhone.js.map +1 -1
  11. package/esm/funcs/authLoginWithWhatsapp.js +1 -1
  12. package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
  13. package/esm/funcs/authLogout.js +1 -1
  14. package/esm/funcs/authLogout.js.map +1 -1
  15. package/esm/funcs/authRefreshToken.js +1 -1
  16. package/esm/funcs/authRefreshToken.js.map +1 -1
  17. package/esm/funcs/authUpdateUser.js +1 -1
  18. package/esm/funcs/authUpdateUser.js.map +1 -1
  19. package/esm/funcs/authVerifyOtp.js +1 -1
  20. package/esm/funcs/authVerifyOtp.js.map +1 -1
  21. package/esm/funcs/cartsAddShippingMethod.js +1 -1
  22. package/esm/funcs/cartsAddShippingMethod.js.map +1 -1
  23. package/esm/funcs/cartsApplyCoupon.js +1 -1
  24. package/esm/funcs/cartsApplyCoupon.js.map +1 -1
  25. package/esm/funcs/cartsCreateCart.js +1 -1
  26. package/esm/funcs/cartsCreateCart.js.map +1 -1
  27. package/esm/funcs/cartsCreateCartAddress.js +1 -1
  28. package/esm/funcs/cartsCreateCartAddress.js.map +1 -1
  29. package/esm/funcs/cartsDeleteCart.js +1 -1
  30. package/esm/funcs/cartsDeleteCart.js.map +1 -1
  31. package/esm/funcs/cartsGetCart.js +1 -1
  32. package/esm/funcs/cartsGetCart.js.map +1 -1
  33. package/esm/funcs/cartsGetUserCart.js +1 -1
  34. package/esm/funcs/cartsGetUserCart.js.map +1 -1
  35. package/esm/funcs/cartsRedeemLoyaltyPoints.js +1 -1
  36. package/esm/funcs/cartsRedeemLoyaltyPoints.js.map +1 -1
  37. package/esm/funcs/cartsRemoveCoupon.js +1 -1
  38. package/esm/funcs/cartsRemoveCoupon.js.map +1 -1
  39. package/esm/funcs/cartsRemoveLoyaltyPoints.js +1 -1
  40. package/esm/funcs/cartsRemoveLoyaltyPoints.js.map +1 -1
  41. package/esm/funcs/cartsRemoveUserCart.js +1 -1
  42. package/esm/funcs/cartsRemoveUserCart.js.map +1 -1
  43. package/esm/funcs/cartsUpdateCart.js +1 -1
  44. package/esm/funcs/cartsUpdateCart.js.map +1 -1
  45. package/esm/funcs/cartsUpdateFulfillmentPreference.js +1 -1
  46. package/esm/funcs/cartsUpdateFulfillmentPreference.js.map +1 -1
  47. package/esm/funcs/catalogGetProductDetail.js +1 -1
  48. package/esm/funcs/catalogGetProductDetail.js.map +1 -1
  49. package/esm/funcs/catalogGetVariantDetail.js +1 -1
  50. package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
  51. package/esm/funcs/catalogListCategories.js +1 -1
  52. package/esm/funcs/catalogListCategories.js.map +1 -1
  53. package/esm/funcs/catalogListCrosssellProducts.js +1 -1
  54. package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
  55. package/esm/funcs/catalogListProductReviews.js +1 -1
  56. package/esm/funcs/catalogListProductReviews.js.map +1 -1
  57. package/esm/funcs/catalogListProductVariants.js +1 -1
  58. package/esm/funcs/catalogListProductVariants.js.map +1 -1
  59. package/esm/funcs/catalogListProducts.js +1 -1
  60. package/esm/funcs/catalogListProducts.js.map +1 -1
  61. package/esm/funcs/catalogListSimilarProducts.js +1 -1
  62. package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
  63. package/esm/funcs/catalogListSkus.js +1 -1
  64. package/esm/funcs/catalogListSkus.js.map +1 -1
  65. package/esm/funcs/catalogListUpsellProducts.js +1 -1
  66. package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
  67. package/esm/funcs/catalogSearchProducts.js +1 -1
  68. package/esm/funcs/catalogSearchProducts.js.map +1 -1
  69. package/esm/funcs/commonListCountryPincodes.js +1 -1
  70. package/esm/funcs/commonListCountryPincodes.js.map +1 -1
  71. package/esm/funcs/customersCreateAddress.js +1 -1
  72. package/esm/funcs/customersCreateAddress.js.map +1 -1
  73. package/esm/funcs/customersDeleteAddress.js +1 -1
  74. package/esm/funcs/customersDeleteAddress.js.map +1 -1
  75. package/esm/funcs/customersGetAddressDetail.js +1 -1
  76. package/esm/funcs/customersGetAddressDetail.js.map +1 -1
  77. package/esm/funcs/customersGetLoyaltyDetails.js +1 -1
  78. package/esm/funcs/customersGetLoyaltyDetails.js.map +1 -1
  79. package/esm/funcs/customersListAddresses.js +1 -1
  80. package/esm/funcs/customersListAddresses.js.map +1 -1
  81. package/esm/funcs/customersListUserReviews.js +1 -1
  82. package/esm/funcs/customersListUserReviews.js.map +1 -1
  83. package/esm/funcs/customersUpdateAddressDetail.js +1 -1
  84. package/esm/funcs/customersUpdateAddressDetail.js.map +1 -1
  85. package/esm/funcs/ordersCancelOrder.js +1 -1
  86. package/esm/funcs/ordersCancelOrder.js.map +1 -1
  87. package/esm/funcs/ordersCreateOrder.js +1 -1
  88. package/esm/funcs/ordersCreateOrder.js.map +1 -1
  89. package/esm/funcs/ordersGetOrderDetail.js +1 -1
  90. package/esm/funcs/ordersGetOrderDetail.js.map +1 -1
  91. package/esm/funcs/ordersGetPaymentStatus.js +1 -1
  92. package/esm/funcs/ordersGetPaymentStatus.js.map +1 -1
  93. package/esm/funcs/ordersListOrderShipments.js +1 -1
  94. package/esm/funcs/ordersListOrderShipments.js.map +1 -1
  95. package/esm/funcs/ordersListOrders.js +1 -1
  96. package/esm/funcs/ordersListOrders.js.map +1 -1
  97. package/esm/funcs/ordersRetryOrderPayment.js +1 -1
  98. package/esm/funcs/ordersRetryOrderPayment.js.map +1 -1
  99. package/esm/funcs/shippingCheckServiceability.js +1 -1
  100. package/esm/funcs/shippingCheckServiceability.js.map +1 -1
  101. package/esm/funcs/shippingFulfillmentOptions.js +1 -1
  102. package/esm/funcs/shippingFulfillmentOptions.js.map +1 -1
  103. package/esm/funcs/shippingShippingMethods.js +1 -1
  104. package/esm/funcs/shippingShippingMethods.js.map +1 -1
  105. package/esm/lib/config.d.ts +3 -3
  106. package/esm/lib/config.js +3 -3
  107. package/esm/lib/config.js.map +1 -1
  108. package/esm/models/components/cart.d.ts +3 -8
  109. package/esm/models/components/cart.d.ts.map +1 -1
  110. package/esm/models/components/cart.js +5 -16
  111. package/esm/models/components/cart.js.map +1 -1
  112. package/esm/models/components/deliveryfulfillment.d.ts +8 -0
  113. package/esm/models/components/deliveryfulfillment.d.ts.map +1 -1
  114. package/esm/models/components/deliveryfulfillment.js +16 -0
  115. package/esm/models/components/deliveryfulfillment.js.map +1 -1
  116. package/esm/models/components/fulfillmentitem.d.ts +40 -0
  117. package/esm/models/components/fulfillmentitem.d.ts.map +1 -0
  118. package/esm/models/components/fulfillmentitem.js +54 -0
  119. package/esm/models/components/fulfillmentitem.js.map +1 -0
  120. package/esm/models/components/fulfillmentiteminput.d.ts +36 -0
  121. package/esm/models/components/fulfillmentiteminput.d.ts.map +1 -0
  122. package/esm/models/components/fulfillmentiteminput.js +46 -0
  123. package/esm/models/components/fulfillmentiteminput.js.map +1 -0
  124. package/esm/models/components/fulfillmentpreference.d.ts +16 -19
  125. package/esm/models/components/fulfillmentpreference.d.ts.map +1 -1
  126. package/esm/models/components/fulfillmentpreference.js +20 -9
  127. package/esm/models/components/fulfillmentpreference.js.map +1 -1
  128. package/esm/models/components/index.d.ts +3 -0
  129. package/esm/models/components/index.d.ts.map +1 -1
  130. package/esm/models/components/index.js +3 -0
  131. package/esm/models/components/index.js.map +1 -1
  132. package/esm/models/components/order.d.ts +3 -8
  133. package/esm/models/components/order.d.ts.map +1 -1
  134. package/esm/models/components/order.js +5 -16
  135. package/esm/models/components/order.js.map +1 -1
  136. package/esm/models/components/orderdetail.d.ts +3 -8
  137. package/esm/models/components/orderdetail.d.ts.map +1 -1
  138. package/esm/models/components/orderdetail.js +5 -16
  139. package/esm/models/components/orderdetail.js.map +1 -1
  140. package/esm/models/components/partialcollectanddelivery.d.ts +32 -57
  141. package/esm/models/components/partialcollectanddelivery.d.ts.map +1 -1
  142. package/esm/models/components/partialcollectanddelivery.js +44 -74
  143. package/esm/models/components/partialcollectanddelivery.js.map +1 -1
  144. package/esm/models/components/partialcollectanddeliveryinput.d.ts +93 -0
  145. package/esm/models/components/partialcollectanddeliveryinput.d.ts.map +1 -0
  146. package/esm/models/components/partialcollectanddeliveryinput.js +121 -0
  147. package/esm/models/components/partialcollectanddeliveryinput.js.map +1 -0
  148. package/esm/models/components/variantoption.d.ts +4 -4
  149. package/esm/models/components/variantoption.d.ts.map +1 -1
  150. package/esm/models/components/variantoption.js +4 -4
  151. package/esm/models/components/variantoption.js.map +1 -1
  152. package/esm/models/operations/getfulfillmentoptions.d.ts +27 -1
  153. package/esm/models/operations/getfulfillmentoptions.d.ts.map +1 -1
  154. package/esm/models/operations/getfulfillmentoptions.js +21 -2
  155. package/esm/models/operations/getfulfillmentoptions.js.map +1 -1
  156. package/esm/models/operations/updatefulfillmentpreference.d.ts +4 -4
  157. package/esm/models/operations/updatefulfillmentpreference.d.ts.map +1 -1
  158. package/esm/models/operations/updatefulfillmentpreference.js +4 -4
  159. package/esm/models/operations/updatefulfillmentpreference.js.map +1 -1
  160. package/examples/package-lock.json +1 -1
  161. package/jsr.json +1 -1
  162. package/package.json +1 -1
  163. package/src/funcs/authGenerateOtp.ts +1 -1
  164. package/src/funcs/authGetUserDetail.ts +1 -1
  165. package/src/funcs/authLoginWithEmail.ts +1 -1
  166. package/src/funcs/authLoginWithPhone.ts +1 -1
  167. package/src/funcs/authLoginWithWhatsapp.ts +1 -1
  168. package/src/funcs/authLogout.ts +1 -1
  169. package/src/funcs/authRefreshToken.ts +1 -1
  170. package/src/funcs/authUpdateUser.ts +1 -1
  171. package/src/funcs/authVerifyOtp.ts +1 -1
  172. package/src/funcs/cartsAddShippingMethod.ts +1 -1
  173. package/src/funcs/cartsApplyCoupon.ts +1 -1
  174. package/src/funcs/cartsCreateCart.ts +1 -1
  175. package/src/funcs/cartsCreateCartAddress.ts +1 -1
  176. package/src/funcs/cartsDeleteCart.ts +1 -1
  177. package/src/funcs/cartsGetCart.ts +1 -1
  178. package/src/funcs/cartsGetUserCart.ts +1 -1
  179. package/src/funcs/cartsRedeemLoyaltyPoints.ts +1 -1
  180. package/src/funcs/cartsRemoveCoupon.ts +1 -1
  181. package/src/funcs/cartsRemoveLoyaltyPoints.ts +1 -1
  182. package/src/funcs/cartsRemoveUserCart.ts +1 -1
  183. package/src/funcs/cartsUpdateCart.ts +1 -1
  184. package/src/funcs/cartsUpdateFulfillmentPreference.ts +1 -1
  185. package/src/funcs/catalogGetProductDetail.ts +1 -1
  186. package/src/funcs/catalogGetVariantDetail.ts +1 -1
  187. package/src/funcs/catalogListCategories.ts +1 -1
  188. package/src/funcs/catalogListCrosssellProducts.ts +1 -1
  189. package/src/funcs/catalogListProductReviews.ts +1 -1
  190. package/src/funcs/catalogListProductVariants.ts +1 -1
  191. package/src/funcs/catalogListProducts.ts +1 -1
  192. package/src/funcs/catalogListSimilarProducts.ts +1 -1
  193. package/src/funcs/catalogListSkus.ts +1 -1
  194. package/src/funcs/catalogListUpsellProducts.ts +1 -1
  195. package/src/funcs/catalogSearchProducts.ts +1 -1
  196. package/src/funcs/commonListCountryPincodes.ts +1 -1
  197. package/src/funcs/customersCreateAddress.ts +1 -1
  198. package/src/funcs/customersDeleteAddress.ts +1 -1
  199. package/src/funcs/customersGetAddressDetail.ts +1 -1
  200. package/src/funcs/customersGetLoyaltyDetails.ts +1 -1
  201. package/src/funcs/customersListAddresses.ts +1 -1
  202. package/src/funcs/customersListUserReviews.ts +1 -1
  203. package/src/funcs/customersUpdateAddressDetail.ts +1 -1
  204. package/src/funcs/ordersCancelOrder.ts +1 -1
  205. package/src/funcs/ordersCreateOrder.ts +1 -1
  206. package/src/funcs/ordersGetOrderDetail.ts +1 -1
  207. package/src/funcs/ordersGetPaymentStatus.ts +1 -1
  208. package/src/funcs/ordersListOrderShipments.ts +1 -1
  209. package/src/funcs/ordersListOrders.ts +1 -1
  210. package/src/funcs/ordersRetryOrderPayment.ts +1 -1
  211. package/src/funcs/shippingCheckServiceability.ts +1 -1
  212. package/src/funcs/shippingFulfillmentOptions.ts +1 -1
  213. package/src/funcs/shippingShippingMethods.ts +1 -1
  214. package/src/lib/config.ts +3 -3
  215. package/src/models/components/cart.ts +12 -24
  216. package/src/models/components/deliveryfulfillment.ts +24 -0
  217. package/src/models/components/fulfillmentitem.ts +98 -0
  218. package/src/models/components/fulfillmentiteminput.ts +88 -0
  219. package/src/models/components/fulfillmentpreference.ts +69 -15
  220. package/src/models/components/index.ts +3 -0
  221. package/src/models/components/order.ts +12 -24
  222. package/src/models/components/orderdetail.ts +12 -24
  223. package/src/models/components/partialcollectanddelivery.ts +98 -134
  224. package/src/models/components/partialcollectanddeliveryinput.ts +266 -0
  225. package/src/models/components/variantoption.ts +8 -8
  226. package/src/models/operations/getfulfillmentoptions.ts +33 -4
  227. package/src/models/operations/updatefulfillmentpreference.ts +8 -8
  228. package/docs/sdks/cestorefront/README.md +0 -10
@@ -26,6 +26,12 @@ import {
26
26
  CustomerAddress$Outbound,
27
27
  CustomerAddress$outboundSchema,
28
28
  } from "./customeraddress.js";
29
+ import {
30
+ FulfillmentPreference,
31
+ FulfillmentPreference$inboundSchema,
32
+ FulfillmentPreference$Outbound,
33
+ FulfillmentPreference$outboundSchema,
34
+ } from "./fulfillmentpreference.js";
29
35
  import {
30
36
  OrderItem,
31
37
  OrderItem$inboundSchema,
@@ -151,10 +157,7 @@ export type OrderDetail = {
151
157
  shippingTaxRate?: number | undefined;
152
158
  shippingTaxAmount?: number | undefined;
153
159
  shippingAmountIncludingTax?: number | undefined;
154
- shippingProviderId?: string | null | undefined;
155
- shippingProviderName?: string | null | undefined;
156
- courierCompanyId?: string | null | undefined;
157
- courierCompanyName?: string | null | undefined;
160
+ fulfillmentPreference?: FulfillmentPreference | undefined;
158
161
  estimatedDeliveryDays?: number | null | undefined;
159
162
  handlingChargeExcludingTax?: number | undefined;
160
163
  handlingChargeTaxAmount?: number | undefined;
@@ -432,10 +435,7 @@ export const OrderDetail$inboundSchema: z.ZodType<
432
435
  shipping_tax_rate: z.number().optional(),
433
436
  shipping_tax_amount: z.number().optional(),
434
437
  shipping_amount_including_tax: z.number().optional(),
435
- shipping_provider_id: z.nullable(z.string()).optional(),
436
- shipping_provider_name: z.nullable(z.string()).optional(),
437
- courier_company_id: z.nullable(z.string()).optional(),
438
- courier_company_name: z.nullable(z.string()).optional(),
438
+ fulfillment_preference: FulfillmentPreference$inboundSchema.optional(),
439
439
  estimated_delivery_days: z.nullable(z.number().int()).optional(),
440
440
  handling_charge_excluding_tax: z.number().optional(),
441
441
  handling_charge_tax_amount: z.number().optional(),
@@ -487,10 +487,7 @@ export const OrderDetail$inboundSchema: z.ZodType<
487
487
  "shipping_tax_rate": "shippingTaxRate",
488
488
  "shipping_tax_amount": "shippingTaxAmount",
489
489
  "shipping_amount_including_tax": "shippingAmountIncludingTax",
490
- "shipping_provider_id": "shippingProviderId",
491
- "shipping_provider_name": "shippingProviderName",
492
- "courier_company_id": "courierCompanyId",
493
- "courier_company_name": "courierCompanyName",
490
+ "fulfillment_preference": "fulfillmentPreference",
494
491
  "estimated_delivery_days": "estimatedDeliveryDays",
495
492
  "handling_charge_excluding_tax": "handlingChargeExcludingTax",
496
493
  "handling_charge_tax_amount": "handlingChargeTaxAmount",
@@ -541,10 +538,7 @@ export type OrderDetail$Outbound = {
541
538
  shipping_tax_rate?: number | undefined;
542
539
  shipping_tax_amount?: number | undefined;
543
540
  shipping_amount_including_tax?: number | undefined;
544
- shipping_provider_id?: string | null | undefined;
545
- shipping_provider_name?: string | null | undefined;
546
- courier_company_id?: string | null | undefined;
547
- courier_company_name?: string | null | undefined;
541
+ fulfillment_preference?: FulfillmentPreference$Outbound | undefined;
548
542
  estimated_delivery_days?: number | null | undefined;
549
543
  handling_charge_excluding_tax?: number | undefined;
550
544
  handling_charge_tax_amount?: number | undefined;
@@ -604,10 +598,7 @@ export const OrderDetail$outboundSchema: z.ZodType<
604
598
  shippingTaxRate: z.number().optional(),
605
599
  shippingTaxAmount: z.number().optional(),
606
600
  shippingAmountIncludingTax: z.number().optional(),
607
- shippingProviderId: z.nullable(z.string()).optional(),
608
- shippingProviderName: z.nullable(z.string()).optional(),
609
- courierCompanyId: z.nullable(z.string()).optional(),
610
- courierCompanyName: z.nullable(z.string()).optional(),
601
+ fulfillmentPreference: FulfillmentPreference$outboundSchema.optional(),
611
602
  estimatedDeliveryDays: z.nullable(z.number().int()).optional(),
612
603
  handlingChargeExcludingTax: z.number().optional(),
613
604
  handlingChargeTaxAmount: z.number().optional(),
@@ -659,10 +650,7 @@ export const OrderDetail$outboundSchema: z.ZodType<
659
650
  shippingTaxRate: "shipping_tax_rate",
660
651
  shippingTaxAmount: "shipping_tax_amount",
661
652
  shippingAmountIncludingTax: "shipping_amount_including_tax",
662
- shippingProviderId: "shipping_provider_id",
663
- shippingProviderName: "shipping_provider_name",
664
- courierCompanyId: "courier_company_id",
665
- courierCompanyName: "courier_company_name",
653
+ fulfillmentPreference: "fulfillment_preference",
666
654
  estimatedDeliveryDays: "estimated_delivery_days",
667
655
  handlingChargeExcludingTax: "handling_charge_excluding_tax",
668
656
  handlingChargeTaxAmount: "handling_charge_tax_amount",
@@ -8,28 +8,23 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import {
11
- CustomerAddressInput,
12
- CustomerAddressInput$inboundSchema,
13
- CustomerAddressInput$Outbound,
14
- CustomerAddressInput$outboundSchema,
15
- } from "./customeraddressinput.js";
11
+ FulfillmentItem,
12
+ FulfillmentItem$inboundSchema,
13
+ FulfillmentItem$Outbound,
14
+ FulfillmentItem$outboundSchema,
15
+ } from "./fulfillmentitem.js";
16
16
 
17
- export type Pickup = {
18
- productId: string;
19
- variantId: string | null;
20
- quantity: number;
17
+ export type PartialCollectAndDeliveryCollectInStore = {
18
+ pickupLocationId?: string | undefined;
19
+ items?: Array<FulfillmentItem> | undefined;
21
20
  };
22
21
 
23
22
  export type Delivery = {
24
- productId: string;
25
- variantId: string | null;
26
- quantity: number;
27
- };
28
-
29
- export type Preferences = {
30
- pickup: Array<Pickup>;
31
- delivery: Array<Delivery>;
32
- shippingAddress: CustomerAddressInput | null;
23
+ shippingProviderId: string | null;
24
+ shippingProviderName: string | null;
25
+ courierCompanyId?: string | null | undefined;
26
+ courierCompanyName?: string | null | undefined;
27
+ items: Array<FulfillmentItem>;
33
28
  };
34
29
 
35
30
  /**
@@ -37,42 +32,41 @@ export type Preferences = {
37
32
  */
38
33
  export type PartialCollectAndDelivery = {
39
34
  fulfillmentType?: "partial-collect-and-delivery" | undefined;
40
- preferences: Preferences;
35
+ collectInStore: PartialCollectAndDeliveryCollectInStore;
36
+ delivery: Delivery;
41
37
  };
42
38
 
43
39
  /** @internal */
44
- export const Pickup$inboundSchema: z.ZodType<Pickup, z.ZodTypeDef, unknown> = z
45
- .object({
46
- product_id: z.string(),
47
- variant_id: z.nullable(z.string()),
48
- quantity: z.number().int(),
49
- }).transform((v) => {
50
- return remap$(v, {
51
- "product_id": "productId",
52
- "variant_id": "variantId",
53
- });
40
+ export const PartialCollectAndDeliveryCollectInStore$inboundSchema: z.ZodType<
41
+ PartialCollectAndDeliveryCollectInStore,
42
+ z.ZodTypeDef,
43
+ unknown
44
+ > = z.object({
45
+ pickup_location_id: z.string().optional(),
46
+ items: z.array(FulfillmentItem$inboundSchema).optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ "pickup_location_id": "pickupLocationId",
54
50
  });
51
+ });
55
52
 
56
53
  /** @internal */
57
- export type Pickup$Outbound = {
58
- product_id: string;
59
- variant_id: string | null;
60
- quantity: number;
54
+ export type PartialCollectAndDeliveryCollectInStore$Outbound = {
55
+ pickup_location_id?: string | undefined;
56
+ items?: Array<FulfillmentItem$Outbound> | undefined;
61
57
  };
62
58
 
63
59
  /** @internal */
64
- export const Pickup$outboundSchema: z.ZodType<
65
- Pickup$Outbound,
60
+ export const PartialCollectAndDeliveryCollectInStore$outboundSchema: z.ZodType<
61
+ PartialCollectAndDeliveryCollectInStore$Outbound,
66
62
  z.ZodTypeDef,
67
- Pickup
63
+ PartialCollectAndDeliveryCollectInStore
68
64
  > = z.object({
69
- productId: z.string(),
70
- variantId: z.nullable(z.string()),
71
- quantity: z.number().int(),
65
+ pickupLocationId: z.string().optional(),
66
+ items: z.array(FulfillmentItem$outboundSchema).optional(),
72
67
  }).transform((v) => {
73
68
  return remap$(v, {
74
- productId: "product_id",
75
- variantId: "variant_id",
69
+ pickupLocationId: "pickup_location_id",
76
70
  });
77
71
  });
78
72
 
@@ -80,26 +74,41 @@ export const Pickup$outboundSchema: z.ZodType<
80
74
  * @internal
81
75
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
82
76
  */
83
- export namespace Pickup$ {
84
- /** @deprecated use `Pickup$inboundSchema` instead. */
85
- export const inboundSchema = Pickup$inboundSchema;
86
- /** @deprecated use `Pickup$outboundSchema` instead. */
87
- export const outboundSchema = Pickup$outboundSchema;
88
- /** @deprecated use `Pickup$Outbound` instead. */
89
- export type Outbound = Pickup$Outbound;
77
+ export namespace PartialCollectAndDeliveryCollectInStore$ {
78
+ /** @deprecated use `PartialCollectAndDeliveryCollectInStore$inboundSchema` instead. */
79
+ export const inboundSchema =
80
+ PartialCollectAndDeliveryCollectInStore$inboundSchema;
81
+ /** @deprecated use `PartialCollectAndDeliveryCollectInStore$outboundSchema` instead. */
82
+ export const outboundSchema =
83
+ PartialCollectAndDeliveryCollectInStore$outboundSchema;
84
+ /** @deprecated use `PartialCollectAndDeliveryCollectInStore$Outbound` instead. */
85
+ export type Outbound = PartialCollectAndDeliveryCollectInStore$Outbound;
90
86
  }
91
87
 
92
- export function pickupToJSON(pickup: Pickup): string {
93
- return JSON.stringify(Pickup$outboundSchema.parse(pickup));
88
+ export function partialCollectAndDeliveryCollectInStoreToJSON(
89
+ partialCollectAndDeliveryCollectInStore:
90
+ PartialCollectAndDeliveryCollectInStore,
91
+ ): string {
92
+ return JSON.stringify(
93
+ PartialCollectAndDeliveryCollectInStore$outboundSchema.parse(
94
+ partialCollectAndDeliveryCollectInStore,
95
+ ),
96
+ );
94
97
  }
95
98
 
96
- export function pickupFromJSON(
99
+ export function partialCollectAndDeliveryCollectInStoreFromJSON(
97
100
  jsonString: string,
98
- ): SafeParseResult<Pickup, SDKValidationError> {
101
+ ): SafeParseResult<
102
+ PartialCollectAndDeliveryCollectInStore,
103
+ SDKValidationError
104
+ > {
99
105
  return safeParse(
100
106
  jsonString,
101
- (x) => Pickup$inboundSchema.parse(JSON.parse(x)),
102
- `Failed to parse 'Pickup' from JSON`,
107
+ (x) =>
108
+ PartialCollectAndDeliveryCollectInStore$inboundSchema.parse(
109
+ JSON.parse(x),
110
+ ),
111
+ `Failed to parse 'PartialCollectAndDeliveryCollectInStore' from JSON`,
103
112
  );
104
113
  }
105
114
 
@@ -109,21 +118,27 @@ export const Delivery$inboundSchema: z.ZodType<
109
118
  z.ZodTypeDef,
110
119
  unknown
111
120
  > = z.object({
112
- product_id: z.string(),
113
- variant_id: z.nullable(z.string()),
114
- quantity: z.number().int(),
121
+ shipping_provider_id: z.nullable(z.string()),
122
+ shipping_provider_name: z.nullable(z.string()),
123
+ courier_company_id: z.nullable(z.string()).optional(),
124
+ courier_company_name: z.nullable(z.string()).optional(),
125
+ items: z.array(FulfillmentItem$inboundSchema),
115
126
  }).transform((v) => {
116
127
  return remap$(v, {
117
- "product_id": "productId",
118
- "variant_id": "variantId",
128
+ "shipping_provider_id": "shippingProviderId",
129
+ "shipping_provider_name": "shippingProviderName",
130
+ "courier_company_id": "courierCompanyId",
131
+ "courier_company_name": "courierCompanyName",
119
132
  });
120
133
  });
121
134
 
122
135
  /** @internal */
123
136
  export type Delivery$Outbound = {
124
- product_id: string;
125
- variant_id: string | null;
126
- quantity: number;
137
+ shipping_provider_id: string | null;
138
+ shipping_provider_name: string | null;
139
+ courier_company_id?: string | null | undefined;
140
+ courier_company_name?: string | null | undefined;
141
+ items: Array<FulfillmentItem$Outbound>;
127
142
  };
128
143
 
129
144
  /** @internal */
@@ -132,13 +147,17 @@ export const Delivery$outboundSchema: z.ZodType<
132
147
  z.ZodTypeDef,
133
148
  Delivery
134
149
  > = z.object({
135
- productId: z.string(),
136
- variantId: z.nullable(z.string()),
137
- quantity: z.number().int(),
150
+ shippingProviderId: z.nullable(z.string()),
151
+ shippingProviderName: z.nullable(z.string()),
152
+ courierCompanyId: z.nullable(z.string()).optional(),
153
+ courierCompanyName: z.nullable(z.string()).optional(),
154
+ items: z.array(FulfillmentItem$outboundSchema),
138
155
  }).transform((v) => {
139
156
  return remap$(v, {
140
- productId: "product_id",
141
- variantId: "variant_id",
157
+ shippingProviderId: "shipping_provider_id",
158
+ shippingProviderName: "shipping_provider_name",
159
+ courierCompanyId: "courier_company_id",
160
+ courierCompanyName: "courier_company_name",
142
161
  });
143
162
  });
144
163
 
@@ -169,70 +188,6 @@ export function deliveryFromJSON(
169
188
  );
170
189
  }
171
190
 
172
- /** @internal */
173
- export const Preferences$inboundSchema: z.ZodType<
174
- Preferences,
175
- z.ZodTypeDef,
176
- unknown
177
- > = z.object({
178
- pickup: z.array(z.lazy(() => Pickup$inboundSchema)),
179
- delivery: z.array(z.lazy(() => Delivery$inboundSchema)),
180
- shipping_address: z.nullable(CustomerAddressInput$inboundSchema),
181
- }).transform((v) => {
182
- return remap$(v, {
183
- "shipping_address": "shippingAddress",
184
- });
185
- });
186
-
187
- /** @internal */
188
- export type Preferences$Outbound = {
189
- pickup: Array<Pickup$Outbound>;
190
- delivery: Array<Delivery$Outbound>;
191
- shipping_address: CustomerAddressInput$Outbound | null;
192
- };
193
-
194
- /** @internal */
195
- export const Preferences$outboundSchema: z.ZodType<
196
- Preferences$Outbound,
197
- z.ZodTypeDef,
198
- Preferences
199
- > = z.object({
200
- pickup: z.array(z.lazy(() => Pickup$outboundSchema)),
201
- delivery: z.array(z.lazy(() => Delivery$outboundSchema)),
202
- shippingAddress: z.nullable(CustomerAddressInput$outboundSchema),
203
- }).transform((v) => {
204
- return remap$(v, {
205
- shippingAddress: "shipping_address",
206
- });
207
- });
208
-
209
- /**
210
- * @internal
211
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
212
- */
213
- export namespace Preferences$ {
214
- /** @deprecated use `Preferences$inboundSchema` instead. */
215
- export const inboundSchema = Preferences$inboundSchema;
216
- /** @deprecated use `Preferences$outboundSchema` instead. */
217
- export const outboundSchema = Preferences$outboundSchema;
218
- /** @deprecated use `Preferences$Outbound` instead. */
219
- export type Outbound = Preferences$Outbound;
220
- }
221
-
222
- export function preferencesToJSON(preferences: Preferences): string {
223
- return JSON.stringify(Preferences$outboundSchema.parse(preferences));
224
- }
225
-
226
- export function preferencesFromJSON(
227
- jsonString: string,
228
- ): SafeParseResult<Preferences, SDKValidationError> {
229
- return safeParse(
230
- jsonString,
231
- (x) => Preferences$inboundSchema.parse(JSON.parse(x)),
232
- `Failed to parse 'Preferences' from JSON`,
233
- );
234
- }
235
-
236
191
  /** @internal */
237
192
  export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
238
193
  PartialCollectAndDelivery,
@@ -242,17 +197,22 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
242
197
  fulfillment_type: z.literal("partial-collect-and-delivery").default(
243
198
  "partial-collect-and-delivery",
244
199
  ).optional(),
245
- preferences: z.lazy(() => Preferences$inboundSchema),
200
+ "collect-in-store": z.lazy(() =>
201
+ PartialCollectAndDeliveryCollectInStore$inboundSchema
202
+ ),
203
+ delivery: z.lazy(() => Delivery$inboundSchema),
246
204
  }).transform((v) => {
247
205
  return remap$(v, {
248
206
  "fulfillment_type": "fulfillmentType",
207
+ "collect-in-store": "collectInStore",
249
208
  });
250
209
  });
251
210
 
252
211
  /** @internal */
253
212
  export type PartialCollectAndDelivery$Outbound = {
254
213
  fulfillment_type: "partial-collect-and-delivery";
255
- preferences: Preferences$Outbound;
214
+ "collect-in-store": PartialCollectAndDeliveryCollectInStore$Outbound;
215
+ delivery: Delivery$Outbound;
256
216
  };
257
217
 
258
218
  /** @internal */
@@ -264,10 +224,14 @@ export const PartialCollectAndDelivery$outboundSchema: z.ZodType<
264
224
  fulfillmentType: z.literal("partial-collect-and-delivery").default(
265
225
  "partial-collect-and-delivery" as const,
266
226
  ),
267
- preferences: z.lazy(() => Preferences$outboundSchema),
227
+ collectInStore: z.lazy(() =>
228
+ PartialCollectAndDeliveryCollectInStore$outboundSchema
229
+ ),
230
+ delivery: z.lazy(() => Delivery$outboundSchema),
268
231
  }).transform((v) => {
269
232
  return remap$(v, {
270
233
  fulfillmentType: "fulfillment_type",
234
+ collectInStore: "collect-in-store",
271
235
  });
272
236
  });
273
237
 
@@ -0,0 +1,266 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ FulfillmentItemInput,
12
+ FulfillmentItemInput$inboundSchema,
13
+ FulfillmentItemInput$Outbound,
14
+ FulfillmentItemInput$outboundSchema,
15
+ } from "./fulfillmentiteminput.js";
16
+
17
+ export type PartialCollectAndDeliveryCollectInStoreInput = {
18
+ pickupLocationId?: string | undefined;
19
+ items?: Array<FulfillmentItemInput> | undefined;
20
+ };
21
+
22
+ export type PartialCollectAndDeliveryDelivery = {
23
+ shippingProviderId: string | null;
24
+ courierCompanyId?: string | null | undefined;
25
+ items: Array<FulfillmentItemInput>;
26
+ };
27
+
28
+ /**
29
+ * @see {@link https://llm-docs.commercengine.io/schemas/PartialCollectAndDelivery} - API reference for the PartialCollectAndDelivery schema
30
+ */
31
+ export type PartialCollectAndDeliveryInput = {
32
+ fulfillmentType?: "partial-collect-and-delivery" | undefined;
33
+ collectInStore: PartialCollectAndDeliveryCollectInStoreInput;
34
+ delivery: PartialCollectAndDeliveryDelivery;
35
+ };
36
+
37
+ /** @internal */
38
+ export const PartialCollectAndDeliveryCollectInStoreInput$inboundSchema:
39
+ z.ZodType<
40
+ PartialCollectAndDeliveryCollectInStoreInput,
41
+ z.ZodTypeDef,
42
+ unknown
43
+ > = z.object({
44
+ pickup_location_id: z.string().optional(),
45
+ items: z.array(FulfillmentItemInput$inboundSchema).optional(),
46
+ }).transform((v) => {
47
+ return remap$(v, {
48
+ "pickup_location_id": "pickupLocationId",
49
+ });
50
+ });
51
+
52
+ /** @internal */
53
+ export type PartialCollectAndDeliveryCollectInStoreInput$Outbound = {
54
+ pickup_location_id?: string | undefined;
55
+ items?: Array<FulfillmentItemInput$Outbound> | undefined;
56
+ };
57
+
58
+ /** @internal */
59
+ export const PartialCollectAndDeliveryCollectInStoreInput$outboundSchema:
60
+ z.ZodType<
61
+ PartialCollectAndDeliveryCollectInStoreInput$Outbound,
62
+ z.ZodTypeDef,
63
+ PartialCollectAndDeliveryCollectInStoreInput
64
+ > = z.object({
65
+ pickupLocationId: z.string().optional(),
66
+ items: z.array(FulfillmentItemInput$outboundSchema).optional(),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ pickupLocationId: "pickup_location_id",
70
+ });
71
+ });
72
+
73
+ /**
74
+ * @internal
75
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
76
+ */
77
+ export namespace PartialCollectAndDeliveryCollectInStoreInput$ {
78
+ /** @deprecated use `PartialCollectAndDeliveryCollectInStoreInput$inboundSchema` instead. */
79
+ export const inboundSchema =
80
+ PartialCollectAndDeliveryCollectInStoreInput$inboundSchema;
81
+ /** @deprecated use `PartialCollectAndDeliveryCollectInStoreInput$outboundSchema` instead. */
82
+ export const outboundSchema =
83
+ PartialCollectAndDeliveryCollectInStoreInput$outboundSchema;
84
+ /** @deprecated use `PartialCollectAndDeliveryCollectInStoreInput$Outbound` instead. */
85
+ export type Outbound = PartialCollectAndDeliveryCollectInStoreInput$Outbound;
86
+ }
87
+
88
+ export function partialCollectAndDeliveryCollectInStoreInputToJSON(
89
+ partialCollectAndDeliveryCollectInStoreInput:
90
+ PartialCollectAndDeliveryCollectInStoreInput,
91
+ ): string {
92
+ return JSON.stringify(
93
+ PartialCollectAndDeliveryCollectInStoreInput$outboundSchema.parse(
94
+ partialCollectAndDeliveryCollectInStoreInput,
95
+ ),
96
+ );
97
+ }
98
+
99
+ export function partialCollectAndDeliveryCollectInStoreInputFromJSON(
100
+ jsonString: string,
101
+ ): SafeParseResult<
102
+ PartialCollectAndDeliveryCollectInStoreInput,
103
+ SDKValidationError
104
+ > {
105
+ return safeParse(
106
+ jsonString,
107
+ (x) =>
108
+ PartialCollectAndDeliveryCollectInStoreInput$inboundSchema.parse(
109
+ JSON.parse(x),
110
+ ),
111
+ `Failed to parse 'PartialCollectAndDeliveryCollectInStoreInput' from JSON`,
112
+ );
113
+ }
114
+
115
+ /** @internal */
116
+ export const PartialCollectAndDeliveryDelivery$inboundSchema: z.ZodType<
117
+ PartialCollectAndDeliveryDelivery,
118
+ z.ZodTypeDef,
119
+ unknown
120
+ > = z.object({
121
+ shipping_provider_id: z.nullable(z.string()),
122
+ courier_company_id: z.nullable(z.string()).optional(),
123
+ items: z.array(FulfillmentItemInput$inboundSchema),
124
+ }).transform((v) => {
125
+ return remap$(v, {
126
+ "shipping_provider_id": "shippingProviderId",
127
+ "courier_company_id": "courierCompanyId",
128
+ });
129
+ });
130
+
131
+ /** @internal */
132
+ export type PartialCollectAndDeliveryDelivery$Outbound = {
133
+ shipping_provider_id: string | null;
134
+ courier_company_id?: string | null | undefined;
135
+ items: Array<FulfillmentItemInput$Outbound>;
136
+ };
137
+
138
+ /** @internal */
139
+ export const PartialCollectAndDeliveryDelivery$outboundSchema: z.ZodType<
140
+ PartialCollectAndDeliveryDelivery$Outbound,
141
+ z.ZodTypeDef,
142
+ PartialCollectAndDeliveryDelivery
143
+ > = z.object({
144
+ shippingProviderId: z.nullable(z.string()),
145
+ courierCompanyId: z.nullable(z.string()).optional(),
146
+ items: z.array(FulfillmentItemInput$outboundSchema),
147
+ }).transform((v) => {
148
+ return remap$(v, {
149
+ shippingProviderId: "shipping_provider_id",
150
+ courierCompanyId: "courier_company_id",
151
+ });
152
+ });
153
+
154
+ /**
155
+ * @internal
156
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
157
+ */
158
+ export namespace PartialCollectAndDeliveryDelivery$ {
159
+ /** @deprecated use `PartialCollectAndDeliveryDelivery$inboundSchema` instead. */
160
+ export const inboundSchema = PartialCollectAndDeliveryDelivery$inboundSchema;
161
+ /** @deprecated use `PartialCollectAndDeliveryDelivery$outboundSchema` instead. */
162
+ export const outboundSchema =
163
+ PartialCollectAndDeliveryDelivery$outboundSchema;
164
+ /** @deprecated use `PartialCollectAndDeliveryDelivery$Outbound` instead. */
165
+ export type Outbound = PartialCollectAndDeliveryDelivery$Outbound;
166
+ }
167
+
168
+ export function partialCollectAndDeliveryDeliveryToJSON(
169
+ partialCollectAndDeliveryDelivery: PartialCollectAndDeliveryDelivery,
170
+ ): string {
171
+ return JSON.stringify(
172
+ PartialCollectAndDeliveryDelivery$outboundSchema.parse(
173
+ partialCollectAndDeliveryDelivery,
174
+ ),
175
+ );
176
+ }
177
+
178
+ export function partialCollectAndDeliveryDeliveryFromJSON(
179
+ jsonString: string,
180
+ ): SafeParseResult<PartialCollectAndDeliveryDelivery, SDKValidationError> {
181
+ return safeParse(
182
+ jsonString,
183
+ (x) => PartialCollectAndDeliveryDelivery$inboundSchema.parse(JSON.parse(x)),
184
+ `Failed to parse 'PartialCollectAndDeliveryDelivery' from JSON`,
185
+ );
186
+ }
187
+
188
+ /** @internal */
189
+ export const PartialCollectAndDeliveryInput$inboundSchema: z.ZodType<
190
+ PartialCollectAndDeliveryInput,
191
+ z.ZodTypeDef,
192
+ unknown
193
+ > = z.object({
194
+ fulfillment_type: z.literal("partial-collect-and-delivery").default(
195
+ "partial-collect-and-delivery",
196
+ ).optional(),
197
+ "collect-in-store": z.lazy(() =>
198
+ PartialCollectAndDeliveryCollectInStoreInput$inboundSchema
199
+ ),
200
+ delivery: z.lazy(() => PartialCollectAndDeliveryDelivery$inboundSchema),
201
+ }).transform((v) => {
202
+ return remap$(v, {
203
+ "fulfillment_type": "fulfillmentType",
204
+ "collect-in-store": "collectInStore",
205
+ });
206
+ });
207
+
208
+ /** @internal */
209
+ export type PartialCollectAndDeliveryInput$Outbound = {
210
+ fulfillment_type: "partial-collect-and-delivery";
211
+ "collect-in-store": PartialCollectAndDeliveryCollectInStoreInput$Outbound;
212
+ delivery: PartialCollectAndDeliveryDelivery$Outbound;
213
+ };
214
+
215
+ /** @internal */
216
+ export const PartialCollectAndDeliveryInput$outboundSchema: z.ZodType<
217
+ PartialCollectAndDeliveryInput$Outbound,
218
+ z.ZodTypeDef,
219
+ PartialCollectAndDeliveryInput
220
+ > = z.object({
221
+ fulfillmentType: z.literal("partial-collect-and-delivery").default(
222
+ "partial-collect-and-delivery" as const,
223
+ ),
224
+ collectInStore: z.lazy(() =>
225
+ PartialCollectAndDeliveryCollectInStoreInput$outboundSchema
226
+ ),
227
+ delivery: z.lazy(() => PartialCollectAndDeliveryDelivery$outboundSchema),
228
+ }).transform((v) => {
229
+ return remap$(v, {
230
+ fulfillmentType: "fulfillment_type",
231
+ collectInStore: "collect-in-store",
232
+ });
233
+ });
234
+
235
+ /**
236
+ * @internal
237
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
238
+ */
239
+ export namespace PartialCollectAndDeliveryInput$ {
240
+ /** @deprecated use `PartialCollectAndDeliveryInput$inboundSchema` instead. */
241
+ export const inboundSchema = PartialCollectAndDeliveryInput$inboundSchema;
242
+ /** @deprecated use `PartialCollectAndDeliveryInput$outboundSchema` instead. */
243
+ export const outboundSchema = PartialCollectAndDeliveryInput$outboundSchema;
244
+ /** @deprecated use `PartialCollectAndDeliveryInput$Outbound` instead. */
245
+ export type Outbound = PartialCollectAndDeliveryInput$Outbound;
246
+ }
247
+
248
+ export function partialCollectAndDeliveryInputToJSON(
249
+ partialCollectAndDeliveryInput: PartialCollectAndDeliveryInput,
250
+ ): string {
251
+ return JSON.stringify(
252
+ PartialCollectAndDeliveryInput$outboundSchema.parse(
253
+ partialCollectAndDeliveryInput,
254
+ ),
255
+ );
256
+ }
257
+
258
+ export function partialCollectAndDeliveryInputFromJSON(
259
+ jsonString: string,
260
+ ): SafeParseResult<PartialCollectAndDeliveryInput, SDKValidationError> {
261
+ return safeParse(
262
+ jsonString,
263
+ (x) => PartialCollectAndDeliveryInput$inboundSchema.parse(JSON.parse(x)),
264
+ `Failed to parse 'PartialCollectAndDeliveryInput' from JSON`,
265
+ );
266
+ }