ce-storefront 0.16.0 → 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 (59) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/components/cart.d.ts +0 -11
  4. package/esm/models/components/cart.d.ts.map +1 -1
  5. package/esm/models/components/cart.js +0 -21
  6. package/esm/models/components/cart.js.map +1 -1
  7. package/esm/models/components/fulfillmentitem.d.ts +40 -0
  8. package/esm/models/components/fulfillmentitem.d.ts.map +1 -0
  9. package/esm/models/components/fulfillmentitem.js +54 -0
  10. package/esm/models/components/fulfillmentitem.js.map +1 -0
  11. package/esm/models/components/fulfillmentiteminput.d.ts +36 -0
  12. package/esm/models/components/fulfillmentiteminput.d.ts.map +1 -0
  13. package/esm/models/components/fulfillmentiteminput.js +46 -0
  14. package/esm/models/components/fulfillmentiteminput.js.map +1 -0
  15. package/esm/models/components/fulfillmentpreference.d.ts +2 -2
  16. package/esm/models/components/fulfillmentpreference.js +2 -2
  17. package/esm/models/components/index.d.ts +2 -1
  18. package/esm/models/components/index.d.ts.map +1 -1
  19. package/esm/models/components/index.js +2 -1
  20. package/esm/models/components/index.js.map +1 -1
  21. package/esm/models/components/order.d.ts +0 -11
  22. package/esm/models/components/order.d.ts.map +1 -1
  23. package/esm/models/components/order.js +0 -21
  24. package/esm/models/components/order.js.map +1 -1
  25. package/esm/models/components/orderdetail.d.ts +0 -11
  26. package/esm/models/components/orderdetail.d.ts.map +1 -1
  27. package/esm/models/components/orderdetail.js +0 -21
  28. package/esm/models/components/orderdetail.js.map +1 -1
  29. package/esm/models/components/partialcollectanddelivery.d.ts +24 -112
  30. package/esm/models/components/partialcollectanddelivery.d.ts.map +1 -1
  31. package/esm/models/components/partialcollectanddelivery.js +28 -136
  32. package/esm/models/components/partialcollectanddelivery.js.map +1 -1
  33. package/esm/models/components/partialcollectanddeliveryinput.d.ts +24 -104
  34. package/esm/models/components/partialcollectanddeliveryinput.d.ts.map +1 -1
  35. package/esm/models/components/partialcollectanddeliveryinput.js +28 -118
  36. package/esm/models/components/partialcollectanddeliveryinput.js.map +1 -1
  37. package/esm/models/operations/updatefulfillmentpreference.d.ts +4 -4
  38. package/esm/models/operations/updatefulfillmentpreference.d.ts.map +1 -1
  39. package/esm/models/operations/updatefulfillmentpreference.js +4 -4
  40. package/esm/models/operations/updatefulfillmentpreference.js.map +1 -1
  41. package/examples/package-lock.json +1 -1
  42. package/jsr.json +1 -1
  43. package/package.json +1 -1
  44. package/src/lib/config.ts +2 -2
  45. package/src/models/components/cart.ts +0 -35
  46. package/src/models/components/fulfillmentitem.ts +98 -0
  47. package/src/models/components/fulfillmentiteminput.ts +88 -0
  48. package/src/models/components/fulfillmentpreference.ts +4 -4
  49. package/src/models/components/index.ts +2 -1
  50. package/src/models/components/order.ts +0 -35
  51. package/src/models/components/orderdetail.ts +0 -35
  52. package/src/models/components/partialcollectanddelivery.ts +66 -249
  53. package/src/models/components/partialcollectanddeliveryinput.ts +58 -264
  54. package/src/models/operations/updatefulfillmentpreference.ts +8 -8
  55. package/esm/models/components/fulfillmenttype.d.ts +0 -37
  56. package/esm/models/components/fulfillmenttype.d.ts.map +0 -1
  57. package/esm/models/components/fulfillmenttype.js +0 -28
  58. package/esm/models/components/fulfillmenttype.js.map +0 -1
  59. package/src/models/components/fulfillmenttype.ts +0 -40
@@ -0,0 +1,88 @@
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
+
11
+ /**
12
+ * @see {@link https://llm-docs.commercengine.io/schemas/FulfillmentItem} - API reference for the FulfillmentItem schema
13
+ */
14
+ export type FulfillmentItemInput = {
15
+ productId: string;
16
+ variantId: string | null;
17
+ quantity: number;
18
+ };
19
+
20
+ /** @internal */
21
+ export const FulfillmentItemInput$inboundSchema: z.ZodType<
22
+ FulfillmentItemInput,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ product_id: z.string(),
27
+ variant_id: z.nullable(z.string()),
28
+ quantity: z.number().int(),
29
+ }).transform((v) => {
30
+ return remap$(v, {
31
+ "product_id": "productId",
32
+ "variant_id": "variantId",
33
+ });
34
+ });
35
+
36
+ /** @internal */
37
+ export type FulfillmentItemInput$Outbound = {
38
+ product_id: string;
39
+ variant_id: string | null;
40
+ quantity: number;
41
+ };
42
+
43
+ /** @internal */
44
+ export const FulfillmentItemInput$outboundSchema: z.ZodType<
45
+ FulfillmentItemInput$Outbound,
46
+ z.ZodTypeDef,
47
+ FulfillmentItemInput
48
+ > = z.object({
49
+ productId: z.string(),
50
+ variantId: z.nullable(z.string()),
51
+ quantity: z.number().int(),
52
+ }).transform((v) => {
53
+ return remap$(v, {
54
+ productId: "product_id",
55
+ variantId: "variant_id",
56
+ });
57
+ });
58
+
59
+ /**
60
+ * @internal
61
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
62
+ */
63
+ export namespace FulfillmentItemInput$ {
64
+ /** @deprecated use `FulfillmentItemInput$inboundSchema` instead. */
65
+ export const inboundSchema = FulfillmentItemInput$inboundSchema;
66
+ /** @deprecated use `FulfillmentItemInput$outboundSchema` instead. */
67
+ export const outboundSchema = FulfillmentItemInput$outboundSchema;
68
+ /** @deprecated use `FulfillmentItemInput$Outbound` instead. */
69
+ export type Outbound = FulfillmentItemInput$Outbound;
70
+ }
71
+
72
+ export function fulfillmentItemInputToJSON(
73
+ fulfillmentItemInput: FulfillmentItemInput,
74
+ ): string {
75
+ return JSON.stringify(
76
+ FulfillmentItemInput$outboundSchema.parse(fulfillmentItemInput),
77
+ );
78
+ }
79
+
80
+ export function fulfillmentItemInputFromJSON(
81
+ jsonString: string,
82
+ ): SafeParseResult<FulfillmentItemInput, SDKValidationError> {
83
+ return safeParse(
84
+ jsonString,
85
+ (x) => FulfillmentItemInput$inboundSchema.parse(JSON.parse(x)),
86
+ `Failed to parse 'FulfillmentItemInput' from JSON`,
87
+ );
88
+ }
@@ -29,8 +29,8 @@ import {
29
29
  * @see {@link https://llm-docs.commercengine.io/schemas/FulfillmentPreference} - API reference for the FulfillmentPreference schema
30
30
  */
31
31
  export type FulfillmentPreference =
32
- | CollectInStoreFulfillment
33
32
  | PartialCollectAndDelivery
33
+ | CollectInStoreFulfillment
34
34
  | DeliveryFulfillment;
35
35
 
36
36
  /** @internal */
@@ -39,15 +39,15 @@ export const FulfillmentPreference$inboundSchema: z.ZodType<
39
39
  z.ZodTypeDef,
40
40
  unknown
41
41
  > = z.union([
42
- CollectInStoreFulfillment$inboundSchema,
43
42
  PartialCollectAndDelivery$inboundSchema,
43
+ CollectInStoreFulfillment$inboundSchema,
44
44
  DeliveryFulfillment$inboundSchema,
45
45
  ]);
46
46
 
47
47
  /** @internal */
48
48
  export type FulfillmentPreference$Outbound =
49
- | CollectInStoreFulfillment$Outbound
50
49
  | PartialCollectAndDelivery$Outbound
50
+ | CollectInStoreFulfillment$Outbound
51
51
  | DeliveryFulfillment$Outbound;
52
52
 
53
53
  /** @internal */
@@ -56,8 +56,8 @@ export const FulfillmentPreference$outboundSchema: z.ZodType<
56
56
  z.ZodTypeDef,
57
57
  FulfillmentPreference
58
58
  > = z.union([
59
- CollectInStoreFulfillment$outboundSchema,
60
59
  PartialCollectAndDelivery$outboundSchema,
60
+ CollectInStoreFulfillment$outboundSchema,
61
61
  DeliveryFulfillment$outboundSchema,
62
62
  ]);
63
63
 
@@ -28,8 +28,9 @@ export * from "./deliveryfulfillment.js";
28
28
  export * from "./discountbasedpromotion.js";
29
29
  export * from "./fixedpricepromotion.js";
30
30
  export * from "./freegoodspromotion.js";
31
+ export * from "./fulfillmentitem.js";
32
+ export * from "./fulfillmentiteminput.js";
31
33
  export * from "./fulfillmentpreference.js";
32
- export * from "./fulfillmenttype.js";
33
34
  export * from "./generateotpwithemail.js";
34
35
  export * from "./generateotpwithphone.js";
35
36
  export * from "./item.js";
@@ -32,11 +32,6 @@ import {
32
32
  FulfillmentPreference$Outbound,
33
33
  FulfillmentPreference$outboundSchema,
34
34
  } from "./fulfillmentpreference.js";
35
- import {
36
- FulfillmentType,
37
- FulfillmentType$inboundSchema,
38
- FulfillmentType$outboundSchema,
39
- } from "./fulfillmenttype.js";
40
35
  import {
41
36
  OrderItem,
42
37
  OrderItem$inboundSchema,
@@ -154,12 +149,7 @@ export type Order = {
154
149
  shippingTaxRate?: number | undefined;
155
150
  shippingTaxAmount?: number | undefined;
156
151
  shippingAmountIncludingTax?: number | undefined;
157
- fulfillmentType?: FulfillmentType | undefined;
158
152
  fulfillmentPreference?: FulfillmentPreference | undefined;
159
- shippingProviderId?: string | null | undefined;
160
- shippingProviderName?: string | null | undefined;
161
- courierCompanyId?: string | null | undefined;
162
- courierCompanyName?: string | null | undefined;
163
153
  estimatedDeliveryDays?: number | null | undefined;
164
154
  handlingChargeExcludingTax?: number | undefined;
165
155
  handlingChargeTaxAmount?: number | undefined;
@@ -423,12 +413,7 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
423
413
  shipping_tax_rate: z.number().optional(),
424
414
  shipping_tax_amount: z.number().optional(),
425
415
  shipping_amount_including_tax: z.number().optional(),
426
- fulfillment_type: FulfillmentType$inboundSchema.optional(),
427
416
  fulfillment_preference: FulfillmentPreference$inboundSchema.optional(),
428
- shipping_provider_id: z.nullable(z.string()).optional(),
429
- shipping_provider_name: z.nullable(z.string()).optional(),
430
- courier_company_id: z.nullable(z.string()).optional(),
431
- courier_company_name: z.nullable(z.string()).optional(),
432
417
  estimated_delivery_days: z.nullable(z.number().int()).optional(),
433
418
  handling_charge_excluding_tax: z.number().optional(),
434
419
  handling_charge_tax_amount: z.number().optional(),
@@ -479,12 +464,7 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
479
464
  "shipping_tax_rate": "shippingTaxRate",
480
465
  "shipping_tax_amount": "shippingTaxAmount",
481
466
  "shipping_amount_including_tax": "shippingAmountIncludingTax",
482
- "fulfillment_type": "fulfillmentType",
483
467
  "fulfillment_preference": "fulfillmentPreference",
484
- "shipping_provider_id": "shippingProviderId",
485
- "shipping_provider_name": "shippingProviderName",
486
- "courier_company_id": "courierCompanyId",
487
- "courier_company_name": "courierCompanyName",
488
468
  "estimated_delivery_days": "estimatedDeliveryDays",
489
469
  "handling_charge_excluding_tax": "handlingChargeExcludingTax",
490
470
  "handling_charge_tax_amount": "handlingChargeTaxAmount",
@@ -535,12 +515,7 @@ export type Order$Outbound = {
535
515
  shipping_tax_rate?: number | undefined;
536
516
  shipping_tax_amount?: number | undefined;
537
517
  shipping_amount_including_tax?: number | undefined;
538
- fulfillment_type?: string | undefined;
539
518
  fulfillment_preference?: FulfillmentPreference$Outbound | undefined;
540
- shipping_provider_id?: string | null | undefined;
541
- shipping_provider_name?: string | null | undefined;
542
- courier_company_id?: string | null | undefined;
543
- courier_company_name?: string | null | undefined;
544
519
  estimated_delivery_days?: number | null | undefined;
545
520
  handling_charge_excluding_tax?: number | undefined;
546
521
  handling_charge_tax_amount?: number | undefined;
@@ -597,12 +572,7 @@ export const Order$outboundSchema: z.ZodType<
597
572
  shippingTaxRate: z.number().optional(),
598
573
  shippingTaxAmount: z.number().optional(),
599
574
  shippingAmountIncludingTax: z.number().optional(),
600
- fulfillmentType: FulfillmentType$outboundSchema.optional(),
601
575
  fulfillmentPreference: FulfillmentPreference$outboundSchema.optional(),
602
- shippingProviderId: z.nullable(z.string()).optional(),
603
- shippingProviderName: z.nullable(z.string()).optional(),
604
- courierCompanyId: z.nullable(z.string()).optional(),
605
- courierCompanyName: z.nullable(z.string()).optional(),
606
576
  estimatedDeliveryDays: z.nullable(z.number().int()).optional(),
607
577
  handlingChargeExcludingTax: z.number().optional(),
608
578
  handlingChargeTaxAmount: z.number().optional(),
@@ -653,12 +623,7 @@ export const Order$outboundSchema: z.ZodType<
653
623
  shippingTaxRate: "shipping_tax_rate",
654
624
  shippingTaxAmount: "shipping_tax_amount",
655
625
  shippingAmountIncludingTax: "shipping_amount_including_tax",
656
- fulfillmentType: "fulfillment_type",
657
626
  fulfillmentPreference: "fulfillment_preference",
658
- shippingProviderId: "shipping_provider_id",
659
- shippingProviderName: "shipping_provider_name",
660
- courierCompanyId: "courier_company_id",
661
- courierCompanyName: "courier_company_name",
662
627
  estimatedDeliveryDays: "estimated_delivery_days",
663
628
  handlingChargeExcludingTax: "handling_charge_excluding_tax",
664
629
  handlingChargeTaxAmount: "handling_charge_tax_amount",
@@ -32,11 +32,6 @@ import {
32
32
  FulfillmentPreference$Outbound,
33
33
  FulfillmentPreference$outboundSchema,
34
34
  } from "./fulfillmentpreference.js";
35
- import {
36
- FulfillmentType,
37
- FulfillmentType$inboundSchema,
38
- FulfillmentType$outboundSchema,
39
- } from "./fulfillmenttype.js";
40
35
  import {
41
36
  OrderItem,
42
37
  OrderItem$inboundSchema,
@@ -162,12 +157,7 @@ export type OrderDetail = {
162
157
  shippingTaxRate?: number | undefined;
163
158
  shippingTaxAmount?: number | undefined;
164
159
  shippingAmountIncludingTax?: number | undefined;
165
- fulfillmentType?: FulfillmentType | undefined;
166
160
  fulfillmentPreference?: FulfillmentPreference | undefined;
167
- shippingProviderId?: string | null | undefined;
168
- shippingProviderName?: string | null | undefined;
169
- courierCompanyId?: string | null | undefined;
170
- courierCompanyName?: string | null | undefined;
171
161
  estimatedDeliveryDays?: number | null | undefined;
172
162
  handlingChargeExcludingTax?: number | undefined;
173
163
  handlingChargeTaxAmount?: number | undefined;
@@ -445,12 +435,7 @@ export const OrderDetail$inboundSchema: z.ZodType<
445
435
  shipping_tax_rate: z.number().optional(),
446
436
  shipping_tax_amount: z.number().optional(),
447
437
  shipping_amount_including_tax: z.number().optional(),
448
- fulfillment_type: FulfillmentType$inboundSchema.optional(),
449
438
  fulfillment_preference: FulfillmentPreference$inboundSchema.optional(),
450
- shipping_provider_id: z.nullable(z.string()).optional(),
451
- shipping_provider_name: z.nullable(z.string()).optional(),
452
- courier_company_id: z.nullable(z.string()).optional(),
453
- courier_company_name: z.nullable(z.string()).optional(),
454
439
  estimated_delivery_days: z.nullable(z.number().int()).optional(),
455
440
  handling_charge_excluding_tax: z.number().optional(),
456
441
  handling_charge_tax_amount: z.number().optional(),
@@ -502,12 +487,7 @@ export const OrderDetail$inboundSchema: z.ZodType<
502
487
  "shipping_tax_rate": "shippingTaxRate",
503
488
  "shipping_tax_amount": "shippingTaxAmount",
504
489
  "shipping_amount_including_tax": "shippingAmountIncludingTax",
505
- "fulfillment_type": "fulfillmentType",
506
490
  "fulfillment_preference": "fulfillmentPreference",
507
- "shipping_provider_id": "shippingProviderId",
508
- "shipping_provider_name": "shippingProviderName",
509
- "courier_company_id": "courierCompanyId",
510
- "courier_company_name": "courierCompanyName",
511
491
  "estimated_delivery_days": "estimatedDeliveryDays",
512
492
  "handling_charge_excluding_tax": "handlingChargeExcludingTax",
513
493
  "handling_charge_tax_amount": "handlingChargeTaxAmount",
@@ -558,12 +538,7 @@ export type OrderDetail$Outbound = {
558
538
  shipping_tax_rate?: number | undefined;
559
539
  shipping_tax_amount?: number | undefined;
560
540
  shipping_amount_including_tax?: number | undefined;
561
- fulfillment_type?: string | undefined;
562
541
  fulfillment_preference?: FulfillmentPreference$Outbound | undefined;
563
- shipping_provider_id?: string | null | undefined;
564
- shipping_provider_name?: string | null | undefined;
565
- courier_company_id?: string | null | undefined;
566
- courier_company_name?: string | null | undefined;
567
542
  estimated_delivery_days?: number | null | undefined;
568
543
  handling_charge_excluding_tax?: number | undefined;
569
544
  handling_charge_tax_amount?: number | undefined;
@@ -623,12 +598,7 @@ export const OrderDetail$outboundSchema: z.ZodType<
623
598
  shippingTaxRate: z.number().optional(),
624
599
  shippingTaxAmount: z.number().optional(),
625
600
  shippingAmountIncludingTax: z.number().optional(),
626
- fulfillmentType: FulfillmentType$outboundSchema.optional(),
627
601
  fulfillmentPreference: FulfillmentPreference$outboundSchema.optional(),
628
- shippingProviderId: z.nullable(z.string()).optional(),
629
- shippingProviderName: z.nullable(z.string()).optional(),
630
- courierCompanyId: z.nullable(z.string()).optional(),
631
- courierCompanyName: z.nullable(z.string()).optional(),
632
602
  estimatedDeliveryDays: z.nullable(z.number().int()).optional(),
633
603
  handlingChargeExcludingTax: z.number().optional(),
634
604
  handlingChargeTaxAmount: z.number().optional(),
@@ -680,12 +650,7 @@ export const OrderDetail$outboundSchema: z.ZodType<
680
650
  shippingTaxRate: "shipping_tax_rate",
681
651
  shippingTaxAmount: "shipping_tax_amount",
682
652
  shippingAmountIncludingTax: "shipping_amount_including_tax",
683
- fulfillmentType: "fulfillment_type",
684
653
  fulfillmentPreference: "fulfillment_preference",
685
- shippingProviderId: "shipping_provider_id",
686
- shippingProviderName: "shipping_provider_name",
687
- courierCompanyId: "courier_company_id",
688
- courierCompanyName: "courier_company_name",
689
654
  estimatedDeliveryDays: "estimated_delivery_days",
690
655
  handlingChargeExcludingTax: "handling_charge_excluding_tax",
691
656
  handlingChargeTaxAmount: "handling_charge_tax_amount",