ce-storefront 0.3.5 → 0.3.7

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 (158) hide show
  1. package/esm/lib/config.d.ts +3 -3
  2. package/esm/lib/config.js +3 -3
  3. package/esm/models/components/analyticsevent.d.ts +8 -8
  4. package/esm/models/components/analyticsevent.d.ts.map +1 -1
  5. package/esm/models/components/analyticsevent.js +12 -12
  6. package/esm/models/components/analyticsevent.js.map +1 -1
  7. package/esm/models/components/associatedoption.d.ts +125 -0
  8. package/esm/models/components/associatedoption.d.ts.map +1 -0
  9. package/esm/models/components/associatedoption.js +107 -0
  10. package/esm/models/components/associatedoption.js.map +1 -0
  11. package/esm/models/components/bundleproduct.d.ts +236 -0
  12. package/esm/models/components/bundleproduct.d.ts.map +1 -0
  13. package/esm/models/components/bundleproduct.js +262 -0
  14. package/esm/models/components/bundleproduct.js.map +1 -0
  15. package/esm/models/components/bundleproductdetail.d.ts +265 -0
  16. package/esm/models/components/bundleproductdetail.d.ts.map +1 -0
  17. package/esm/models/components/bundleproductdetail.js +288 -0
  18. package/esm/models/components/bundleproductdetail.js.map +1 -0
  19. package/esm/models/components/cart.d.ts +15 -15
  20. package/esm/models/components/cart.d.ts.map +1 -1
  21. package/esm/models/components/cart.js +15 -15
  22. package/esm/models/components/cart.js.map +1 -1
  23. package/esm/models/components/discountbasedpromotion.d.ts +0 -2
  24. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  25. package/esm/models/components/discountbasedpromotion.js +0 -4
  26. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  27. package/esm/models/components/fixedpricepromotion.d.ts +0 -2
  28. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  29. package/esm/models/components/fixedpricepromotion.js +0 -4
  30. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  31. package/esm/models/components/freegoodspromotion.d.ts +0 -5
  32. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  33. package/esm/models/components/freegoodspromotion.js +0 -4
  34. package/esm/models/components/freegoodspromotion.js.map +1 -1
  35. package/esm/models/components/index.d.ts +8 -6
  36. package/esm/models/components/index.d.ts.map +1 -1
  37. package/esm/models/components/index.js +8 -6
  38. package/esm/models/components/index.js.map +1 -1
  39. package/esm/models/components/productattribute.d.ts +97 -64
  40. package/esm/models/components/productattribute.d.ts.map +1 -1
  41. package/esm/models/components/productattribute.js +67 -128
  42. package/esm/models/components/productattribute.js.map +1 -1
  43. package/esm/models/components/productcategory.d.ts +2 -2
  44. package/esm/models/components/productcategory.d.ts.map +1 -1
  45. package/esm/models/components/productcategory.js +2 -2
  46. package/esm/models/components/productcategory.js.map +1 -1
  47. package/esm/models/components/productdetail.d.ts +16 -188
  48. package/esm/models/components/productdetail.d.ts.map +1 -1
  49. package/esm/models/components/productdetail.js +26 -228
  50. package/esm/models/components/productdetail.js.map +1 -1
  51. package/esm/models/components/productlistresponse.d.ts +49 -3
  52. package/esm/models/components/productlistresponse.d.ts.map +1 -1
  53. package/esm/models/components/productlistresponse.js +65 -3
  54. package/esm/models/components/productlistresponse.js.map +1 -1
  55. package/esm/models/components/productshipping.d.ts +13 -15
  56. package/esm/models/components/productshipping.d.ts.map +1 -1
  57. package/esm/models/components/productshipping.js +14 -18
  58. package/esm/models/components/productshipping.js.map +1 -1
  59. package/esm/models/components/{promotion.d.ts → promotiondetail.d.ts} +29 -29
  60. package/esm/models/components/promotiondetail.d.ts.map +1 -0
  61. package/esm/models/components/{promotion.js → promotiondetail.js} +29 -29
  62. package/esm/models/components/promotiondetail.js.map +1 -0
  63. package/esm/models/components/seo.d.ts +6 -6
  64. package/esm/models/components/seo.d.ts.map +1 -1
  65. package/esm/models/components/seo.js +6 -19
  66. package/esm/models/components/seo.js.map +1 -1
  67. package/esm/models/components/{product.d.ts → singleproduct.d.ts} +52 -75
  68. package/esm/models/components/singleproduct.d.ts.map +1 -0
  69. package/esm/models/components/{product.js → singleproduct.js} +37 -95
  70. package/esm/models/components/singleproduct.js.map +1 -0
  71. package/esm/models/components/singleproductdetail.d.ts +159 -0
  72. package/esm/models/components/singleproductdetail.d.ts.map +1 -0
  73. package/esm/models/components/singleproductdetail.js +156 -0
  74. package/esm/models/components/singleproductdetail.js.map +1 -0
  75. package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +59 -48
  76. package/esm/models/components/sku.d.ts.map +1 -0
  77. package/esm/models/components/{skuinfo.js → sku.js} +67 -57
  78. package/esm/models/components/sku.js.map +1 -0
  79. package/esm/models/components/variant.d.ts +42 -72
  80. package/esm/models/components/variant.d.ts.map +1 -1
  81. package/esm/models/components/variant.js +39 -82
  82. package/esm/models/components/variant.js.map +1 -1
  83. package/esm/models/components/variantdetail.d.ts +101 -68
  84. package/esm/models/components/variantdetail.d.ts.map +1 -1
  85. package/esm/models/components/variantdetail.js +99 -71
  86. package/esm/models/components/variantdetail.js.map +1 -1
  87. package/esm/models/components/variantoption.d.ts +118 -0
  88. package/esm/models/components/variantoption.d.ts.map +1 -0
  89. package/esm/models/components/variantoption.js +114 -0
  90. package/esm/models/components/variantoption.js.map +1 -0
  91. package/esm/models/components/volumebasedpromotion.d.ts +0 -5
  92. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  93. package/esm/models/components/volumebasedpromotion.js +0 -4
  94. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  95. package/esm/models/operations/getpromotions.d.ts +2 -2
  96. package/esm/models/operations/getpromotions.d.ts.map +1 -1
  97. package/esm/models/operations/getpromotions.js +2 -2
  98. package/esm/models/operations/getpromotions.js.map +1 -1
  99. package/esm/models/operations/getskus.d.ts +2 -2
  100. package/esm/models/operations/getskus.d.ts.map +1 -1
  101. package/esm/models/operations/getskus.js +2 -2
  102. package/esm/models/operations/getskus.js.map +1 -1
  103. package/esm/models/operations/getwishtlist.d.ts +2 -2
  104. package/esm/models/operations/getwishtlist.d.ts.map +1 -1
  105. package/esm/models/operations/getwishtlist.js +2 -2
  106. package/esm/models/operations/getwishtlist.js.map +1 -1
  107. package/jsr.json +1 -1
  108. package/package.json +1 -1
  109. package/src/lib/config.ts +3 -3
  110. package/src/models/components/analyticsevent.ts +16 -15
  111. package/src/models/components/associatedoption.ts +217 -0
  112. package/src/models/components/bundleproduct.ts +501 -0
  113. package/src/models/components/bundleproductdetail.ts +567 -0
  114. package/src/models/components/cart.ts +24 -24
  115. package/src/models/components/discountbasedpromotion.ts +0 -6
  116. package/src/models/components/fixedpricepromotion.ts +0 -6
  117. package/src/models/components/freegoodspromotion.ts +0 -9
  118. package/src/models/components/index.ts +8 -6
  119. package/src/models/components/productattribute.ts +162 -188
  120. package/src/models/components/productcategory.ts +4 -4
  121. package/src/models/components/productdetail.ts +52 -475
  122. package/src/models/components/productlistresponse.ts +147 -9
  123. package/src/models/components/productshipping.ts +27 -33
  124. package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
  125. package/src/models/components/seo.ts +12 -25
  126. package/src/models/components/singleproduct.ts +269 -0
  127. package/src/models/components/singleproductdetail.ts +339 -0
  128. package/src/models/components/sku.ts +252 -0
  129. package/src/models/components/variant.ts +81 -170
  130. package/src/models/components/variantdetail.ts +189 -168
  131. package/src/models/components/variantoption.ts +214 -0
  132. package/src/models/components/volumebasedpromotion.ts +0 -9
  133. package/src/models/operations/getpromotions.ts +4 -4
  134. package/src/models/operations/getskus.ts +4 -4
  135. package/src/models/operations/getwishtlist.ts +4 -4
  136. package/esm/models/components/product.d.ts.map +0 -1
  137. package/esm/models/components/product.js.map +0 -1
  138. package/esm/models/components/productbundleitem.d.ts +0 -47
  139. package/esm/models/components/productbundleitem.d.ts.map +0 -1
  140. package/esm/models/components/productbundleitem.js +0 -66
  141. package/esm/models/components/productbundleitem.js.map +0 -1
  142. package/esm/models/components/productpackaging.d.ts +0 -68
  143. package/esm/models/components/productpackaging.d.ts.map +0 -1
  144. package/esm/models/components/productpackaging.js +0 -88
  145. package/esm/models/components/productpackaging.js.map +0 -1
  146. package/esm/models/components/promotion.d.ts.map +0 -1
  147. package/esm/models/components/promotion.js.map +0 -1
  148. package/esm/models/components/saleschannel.d.ts +0 -39
  149. package/esm/models/components/saleschannel.d.ts.map +0 -1
  150. package/esm/models/components/saleschannel.js +0 -53
  151. package/esm/models/components/saleschannel.js.map +0 -1
  152. package/esm/models/components/skuinfo.d.ts.map +0 -1
  153. package/esm/models/components/skuinfo.js.map +0 -1
  154. package/src/models/components/product.ts +0 -363
  155. package/src/models/components/productbundleitem.ts +0 -127
  156. package/src/models/components/productpackaging.ts +0 -162
  157. package/src/models/components/saleschannel.ts +0 -96
  158. package/src/models/components/skuinfo.ts +0 -237
@@ -3,57 +3,62 @@ import { ClosedEnum } from "../../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../../types/fp.js";
4
4
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
5
  import { ProductAttribute, ProductAttribute$Outbound } from "./productattribute.js";
6
- import { ProductBundleItem, ProductBundleItem$Outbound } from "./productbundleitem.js";
7
6
  import { ProductImage, ProductImage$Outbound } from "./productimage.js";
8
7
  import { ProductPricing, ProductPricing$Outbound } from "./productpricing.js";
9
8
  import { ProductPromotion, ProductPromotion$Outbound } from "./productpromotion.js";
10
- import { ProductShipping, ProductShipping$Outbound } from "./productshipping.js";
11
9
  import { ProductSubscription, ProductSubscription$Outbound } from "./productsubscription.js";
12
10
  import { Variant, Variant$Outbound } from "./variant.js";
11
+ import { VariantOption, VariantOption$Outbound } from "./variantoption.js";
13
12
  export declare const ProductType: {
14
13
  readonly Physical: "physical";
15
14
  readonly Digital: "digital";
16
15
  readonly Bundle: "bundle";
17
16
  };
18
17
  export type ProductType = ClosedEnum<typeof ProductType>;
19
- export type VariantOptions = {
20
- optionName?: string | undefined;
21
- optionValue?: Array<string> | undefined;
22
- };
23
- export type Product = {
18
+ export type SingleProduct = {
24
19
  /**
25
20
  * The ULID of the product
26
21
  */
27
- id?: string | undefined;
28
- name?: string | undefined;
22
+ id: string;
23
+ sku?: string | undefined;
24
+ name: string;
25
+ slug: string;
29
26
  shortDescription?: string | undefined;
30
- productType?: ProductType | undefined;
27
+ productType: ProductType;
31
28
  active?: boolean | undefined;
32
- sku?: string | undefined;
29
+ /**
30
+ * Indicates whether the product has stock available
31
+ */
33
32
  stockAvailable?: boolean | undefined;
34
- isFeatured?: boolean | undefined;
33
+ /**
34
+ * Indicates whether this item is associated with any active (product-specific) coupons
35
+ */
35
36
  onOffer?: boolean | undefined;
37
+ /**
38
+ * Indicates whether the product has any subscription plans avaialble
39
+ */
36
40
  onSubscription?: boolean | undefined;
41
+ /**
42
+ * Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion
43
+ */
37
44
  onPromotion?: boolean | undefined;
38
- hasVariant?: boolean | undefined;
39
45
  /**
40
- * this will be used if has_variant is true, to auto set default values.
46
+ * Indicates whether the product has variants
41
47
  */
42
- variantOptions?: Array<VariantOptions> | null | undefined;
43
- attributes?: Array<ProductAttribute> | undefined;
44
- images?: Array<ProductImage> | undefined;
45
- pricing?: ProductPricing | undefined;
46
- shipping?: ProductShipping | undefined;
48
+ hasVariant?: boolean | undefined;
47
49
  tags?: Array<string> | null | undefined;
48
50
  categoryIds?: Array<string> | undefined;
49
51
  reviewsRatingSum?: number | undefined;
50
52
  reviewsCount?: number | undefined;
51
- hsnCode?: string | undefined;
52
- createdAt?: Date | undefined;
53
- modifiedAt?: Date | undefined;
54
- promotion?: Array<ProductPromotion> | undefined;
53
+ attributes?: Array<ProductAttribute> | undefined;
54
+ pricing?: ProductPricing | undefined;
55
+ /**
56
+ * this will be used if has_variant is true, to auto set default values.
57
+ */
58
+ variantOptions?: Array<VariantOption> | null | undefined;
59
+ promotion?: ProductPromotion | null | undefined;
60
+ images?: Array<ProductImage> | undefined;
55
61
  subscription?: Array<ProductSubscription> | undefined;
56
- bundleItems?: Array<ProductBundleItem> | undefined;
57
62
  variants?: Array<Variant> | undefined;
58
63
  };
59
64
  /** @internal */
@@ -79,75 +84,47 @@ export declare namespace ProductType$ {
79
84
  }>;
80
85
  }
81
86
  /** @internal */
82
- export declare const VariantOptions$inboundSchema: z.ZodType<VariantOptions, z.ZodTypeDef, unknown>;
83
- /** @internal */
84
- export type VariantOptions$Outbound = {
85
- option_name?: string | undefined;
86
- option_value?: Array<string> | undefined;
87
- };
88
- /** @internal */
89
- export declare const VariantOptions$outboundSchema: z.ZodType<VariantOptions$Outbound, z.ZodTypeDef, VariantOptions>;
90
- /**
91
- * @internal
92
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
93
- */
94
- export declare namespace VariantOptions$ {
95
- /** @deprecated use `VariantOptions$inboundSchema` instead. */
96
- const inboundSchema: z.ZodType<VariantOptions, z.ZodTypeDef, unknown>;
97
- /** @deprecated use `VariantOptions$outboundSchema` instead. */
98
- const outboundSchema: z.ZodType<VariantOptions$Outbound, z.ZodTypeDef, VariantOptions>;
99
- /** @deprecated use `VariantOptions$Outbound` instead. */
100
- type Outbound = VariantOptions$Outbound;
101
- }
102
- export declare function variantOptionsToJSON(variantOptions: VariantOptions): string;
103
- export declare function variantOptionsFromJSON(jsonString: string): SafeParseResult<VariantOptions, SDKValidationError>;
104
- /** @internal */
105
- export declare const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown>;
87
+ export declare const SingleProduct$inboundSchema: z.ZodType<SingleProduct, z.ZodTypeDef, unknown>;
106
88
  /** @internal */
107
- export type Product$Outbound = {
108
- id?: string | undefined;
109
- name?: string | undefined;
89
+ export type SingleProduct$Outbound = {
90
+ id: string;
91
+ sku?: string | undefined;
92
+ name: string;
93
+ slug: string;
110
94
  short_description?: string | undefined;
111
- product_type?: string | undefined;
95
+ product_type: string;
112
96
  active: boolean;
113
- sku?: string | undefined;
114
97
  stock_available: boolean;
115
- is_featured: boolean;
116
98
  on_offer: boolean;
117
99
  on_subscription: boolean;
118
100
  on_promotion: boolean;
119
101
  has_variant: boolean;
120
- variant_options?: Array<VariantOptions$Outbound> | null | undefined;
121
- attributes?: Array<ProductAttribute$Outbound> | undefined;
122
- images?: Array<ProductImage$Outbound> | undefined;
123
- pricing?: ProductPricing$Outbound | undefined;
124
- shipping?: ProductShipping$Outbound | undefined;
125
102
  tags?: Array<string> | null | undefined;
126
103
  category_ids?: Array<string> | undefined;
127
104
  reviews_rating_sum?: number | undefined;
128
105
  reviews_count?: number | undefined;
129
- hsn_code?: string | undefined;
130
- created_at?: string | undefined;
131
- modified_at?: string | undefined;
132
- promotion?: Array<ProductPromotion$Outbound> | undefined;
106
+ attributes?: Array<ProductAttribute$Outbound> | undefined;
107
+ pricing?: ProductPricing$Outbound | undefined;
108
+ variant_options?: Array<VariantOption$Outbound> | null | undefined;
109
+ promotion?: ProductPromotion$Outbound | null | undefined;
110
+ images?: Array<ProductImage$Outbound> | undefined;
133
111
  subscription?: Array<ProductSubscription$Outbound> | undefined;
134
- bundle_items?: Array<ProductBundleItem$Outbound> | undefined;
135
112
  variants?: Array<Variant$Outbound> | undefined;
136
113
  };
137
114
  /** @internal */
138
- export declare const Product$outboundSchema: z.ZodType<Product$Outbound, z.ZodTypeDef, Product>;
115
+ export declare const SingleProduct$outboundSchema: z.ZodType<SingleProduct$Outbound, z.ZodTypeDef, SingleProduct>;
139
116
  /**
140
117
  * @internal
141
118
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
142
119
  */
143
- export declare namespace Product$ {
144
- /** @deprecated use `Product$inboundSchema` instead. */
145
- const inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown>;
146
- /** @deprecated use `Product$outboundSchema` instead. */
147
- const outboundSchema: z.ZodType<Product$Outbound, z.ZodTypeDef, Product>;
148
- /** @deprecated use `Product$Outbound` instead. */
149
- type Outbound = Product$Outbound;
120
+ export declare namespace SingleProduct$ {
121
+ /** @deprecated use `SingleProduct$inboundSchema` instead. */
122
+ const inboundSchema: z.ZodType<SingleProduct, z.ZodTypeDef, unknown>;
123
+ /** @deprecated use `SingleProduct$outboundSchema` instead. */
124
+ const outboundSchema: z.ZodType<SingleProduct$Outbound, z.ZodTypeDef, SingleProduct>;
125
+ /** @deprecated use `SingleProduct$Outbound` instead. */
126
+ type Outbound = SingleProduct$Outbound;
150
127
  }
151
- export declare function productToJSON(product: Product): string;
152
- export declare function productFromJSON(jsonString: string): SafeParseResult<Product, SDKValidationError>;
153
- //# sourceMappingURL=product.d.ts.map
128
+ export declare function singleProductToJSON(singleProduct: SingleProduct): string;
129
+ export declare function singleProductFromJSON(jsonString: string): SafeParseResult<SingleProduct, SDKValidationError>;
130
+ //# sourceMappingURL=singleproduct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleproduct.d.ts","sourceRoot":"","sources":["../../../src/models/components/singleproduct.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,gBAAgB,EAEhB,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EAEZ,qBAAqB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EAEd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAEhB,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EAEnB,4BAA4B,EAE7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,OAAO,EAEP,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EAEb,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,WAAW;;;;CAId,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD,MAAM,MA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S,CAAC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,GAAG,SAAS,CAAC;IAC1D,OAAO,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC9C,eAAe,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACnE,SAAS,CAAC,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,CAAC;IACzD,MAAM,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC;IAClD,YAAY,CAAC,EAAE,KAAK,CAAC,4BAA4B,CAAC,GAAG,SAAS,CAAC;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,OAAO,CAClD,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,aAAa,CAuCb,CAAC;AAEH;;;GAGG;AACH,yBAAiB,cAAc,CAAC;IAC9B,6DAA6D;IACtD,MAAM,aAAa,iDAA8B,CAAC;IACzD,8DAA8D;IACvD,MAAM,cAAc,gEAA+B,CAAC;IAC3D,wDAAwD;IACxD,KAAY,QAAQ,GAAG,sBAAsB,CAAC;CAC/C;AAED,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAExE;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAMpD"}
@@ -5,13 +5,12 @@ import * as z from "zod";
5
5
  import { remap as remap$ } from "../../lib/primitives.js";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
7
  import { ProductAttribute$inboundSchema, ProductAttribute$outboundSchema, } from "./productattribute.js";
8
- import { ProductBundleItem$inboundSchema, ProductBundleItem$outboundSchema, } from "./productbundleitem.js";
9
8
  import { ProductImage$inboundSchema, ProductImage$outboundSchema, } from "./productimage.js";
10
9
  import { ProductPricing$inboundSchema, ProductPricing$outboundSchema, } from "./productpricing.js";
11
10
  import { ProductPromotion$inboundSchema, ProductPromotion$outboundSchema, } from "./productpromotion.js";
12
- import { ProductShipping$inboundSchema, ProductShipping$outboundSchema, } from "./productshipping.js";
13
11
  import { ProductSubscription$inboundSchema, ProductSubscription$outboundSchema, } from "./productsubscription.js";
14
12
  import { Variant$inboundSchema, Variant$outboundSchema, } from "./variant.js";
13
+ import { VariantOption$inboundSchema, VariantOption$outboundSchema, } from "./variantoption.js";
15
14
  export const ProductType = {
16
15
  Physical: "physical",
17
16
  Digital: "digital",
@@ -34,157 +33,100 @@ export var ProductType$;
34
33
  ProductType$.outboundSchema = ProductType$outboundSchema;
35
34
  })(ProductType$ || (ProductType$ = {}));
36
35
  /** @internal */
37
- export const VariantOptions$inboundSchema = z.object({
38
- option_name: z.string().optional(),
39
- option_value: z.array(z.string()).optional(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- "option_name": "optionName",
43
- "option_value": "optionValue",
44
- });
45
- });
46
- /** @internal */
47
- export const VariantOptions$outboundSchema = z.object({
48
- optionName: z.string().optional(),
49
- optionValue: z.array(z.string()).optional(),
50
- }).transform((v) => {
51
- return remap$(v, {
52
- optionName: "option_name",
53
- optionValue: "option_value",
54
- });
55
- });
56
- /**
57
- * @internal
58
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
59
- */
60
- export var VariantOptions$;
61
- (function (VariantOptions$) {
62
- /** @deprecated use `VariantOptions$inboundSchema` instead. */
63
- VariantOptions$.inboundSchema = VariantOptions$inboundSchema;
64
- /** @deprecated use `VariantOptions$outboundSchema` instead. */
65
- VariantOptions$.outboundSchema = VariantOptions$outboundSchema;
66
- })(VariantOptions$ || (VariantOptions$ = {}));
67
- export function variantOptionsToJSON(variantOptions) {
68
- return JSON.stringify(VariantOptions$outboundSchema.parse(variantOptions));
69
- }
70
- export function variantOptionsFromJSON(jsonString) {
71
- return safeParse(jsonString, (x) => VariantOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VariantOptions' from JSON`);
72
- }
73
- /** @internal */
74
- export const Product$inboundSchema = z.object({
75
- id: z.string().optional(),
76
- name: z.string().optional(),
36
+ export const SingleProduct$inboundSchema = z.object({
37
+ id: z.string(),
38
+ sku: z.string().optional(),
39
+ name: z.string(),
40
+ slug: z.string(),
77
41
  short_description: z.string().optional(),
78
- product_type: ProductType$inboundSchema.optional(),
42
+ product_type: ProductType$inboundSchema,
79
43
  active: z.boolean().default(true),
80
- sku: z.string().optional(),
81
44
  stock_available: z.boolean().default(true),
82
- is_featured: z.boolean().default(false),
83
45
  on_offer: z.boolean().default(false),
84
46
  on_subscription: z.boolean().default(false),
85
47
  on_promotion: z.boolean().default(false),
86
48
  has_variant: z.boolean().default(false),
87
- variant_options: z.nullable(z.array(z.lazy(() => VariantOptions$inboundSchema))).optional(),
88
- attributes: z.array(ProductAttribute$inboundSchema).optional(),
89
- images: z.array(ProductImage$inboundSchema).optional(),
90
- pricing: ProductPricing$inboundSchema.optional(),
91
- shipping: ProductShipping$inboundSchema.optional(),
92
49
  tags: z.nullable(z.array(z.string())).optional(),
93
50
  category_ids: z.array(z.string()).optional(),
94
51
  reviews_rating_sum: z.number().optional(),
95
52
  reviews_count: z.number().int().optional(),
96
- hsn_code: z.string().optional(),
97
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
98
- modified_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
99
- promotion: z.array(ProductPromotion$inboundSchema).optional(),
53
+ attributes: z.array(ProductAttribute$inboundSchema).optional(),
54
+ pricing: ProductPricing$inboundSchema.optional(),
55
+ variant_options: z.nullable(z.array(VariantOption$inboundSchema)).optional(),
56
+ promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
57
+ images: z.array(ProductImage$inboundSchema).optional(),
100
58
  subscription: z.array(ProductSubscription$inboundSchema).optional(),
101
- bundle_items: z.array(ProductBundleItem$inboundSchema).optional(),
102
59
  variants: z.array(Variant$inboundSchema).optional(),
103
60
  }).transform((v) => {
104
61
  return remap$(v, {
105
62
  "short_description": "shortDescription",
106
63
  "product_type": "productType",
107
64
  "stock_available": "stockAvailable",
108
- "is_featured": "isFeatured",
109
65
  "on_offer": "onOffer",
110
66
  "on_subscription": "onSubscription",
111
67
  "on_promotion": "onPromotion",
112
68
  "has_variant": "hasVariant",
113
- "variant_options": "variantOptions",
114
69
  "category_ids": "categoryIds",
115
70
  "reviews_rating_sum": "reviewsRatingSum",
116
71
  "reviews_count": "reviewsCount",
117
- "hsn_code": "hsnCode",
118
- "created_at": "createdAt",
119
- "modified_at": "modifiedAt",
120
- "bundle_items": "bundleItems",
72
+ "variant_options": "variantOptions",
121
73
  });
122
74
  });
123
75
  /** @internal */
124
- export const Product$outboundSchema = z.object({
125
- id: z.string().optional(),
126
- name: z.string().optional(),
76
+ export const SingleProduct$outboundSchema = z.object({
77
+ id: z.string(),
78
+ sku: z.string().optional(),
79
+ name: z.string(),
80
+ slug: z.string(),
127
81
  shortDescription: z.string().optional(),
128
- productType: ProductType$outboundSchema.optional(),
82
+ productType: ProductType$outboundSchema,
129
83
  active: z.boolean().default(true),
130
- sku: z.string().optional(),
131
84
  stockAvailable: z.boolean().default(true),
132
- isFeatured: z.boolean().default(false),
133
85
  onOffer: z.boolean().default(false),
134
86
  onSubscription: z.boolean().default(false),
135
87
  onPromotion: z.boolean().default(false),
136
88
  hasVariant: z.boolean().default(false),
137
- variantOptions: z.nullable(z.array(z.lazy(() => VariantOptions$outboundSchema))).optional(),
138
- attributes: z.array(ProductAttribute$outboundSchema).optional(),
139
- images: z.array(ProductImage$outboundSchema).optional(),
140
- pricing: ProductPricing$outboundSchema.optional(),
141
- shipping: ProductShipping$outboundSchema.optional(),
142
89
  tags: z.nullable(z.array(z.string())).optional(),
143
90
  categoryIds: z.array(z.string()).optional(),
144
91
  reviewsRatingSum: z.number().optional(),
145
92
  reviewsCount: z.number().int().optional(),
146
- hsnCode: z.string().optional(),
147
- createdAt: z.date().transform(v => v.toISOString()).optional(),
148
- modifiedAt: z.date().transform(v => v.toISOString()).optional(),
149
- promotion: z.array(ProductPromotion$outboundSchema).optional(),
93
+ attributes: z.array(ProductAttribute$outboundSchema).optional(),
94
+ pricing: ProductPricing$outboundSchema.optional(),
95
+ variantOptions: z.nullable(z.array(VariantOption$outboundSchema)).optional(),
96
+ promotion: z.nullable(ProductPromotion$outboundSchema).optional(),
97
+ images: z.array(ProductImage$outboundSchema).optional(),
150
98
  subscription: z.array(ProductSubscription$outboundSchema).optional(),
151
- bundleItems: z.array(ProductBundleItem$outboundSchema).optional(),
152
99
  variants: z.array(Variant$outboundSchema).optional(),
153
100
  }).transform((v) => {
154
101
  return remap$(v, {
155
102
  shortDescription: "short_description",
156
103
  productType: "product_type",
157
104
  stockAvailable: "stock_available",
158
- isFeatured: "is_featured",
159
105
  onOffer: "on_offer",
160
106
  onSubscription: "on_subscription",
161
107
  onPromotion: "on_promotion",
162
108
  hasVariant: "has_variant",
163
- variantOptions: "variant_options",
164
109
  categoryIds: "category_ids",
165
110
  reviewsRatingSum: "reviews_rating_sum",
166
111
  reviewsCount: "reviews_count",
167
- hsnCode: "hsn_code",
168
- createdAt: "created_at",
169
- modifiedAt: "modified_at",
170
- bundleItems: "bundle_items",
112
+ variantOptions: "variant_options",
171
113
  });
172
114
  });
173
115
  /**
174
116
  * @internal
175
117
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
176
118
  */
177
- export var Product$;
178
- (function (Product$) {
179
- /** @deprecated use `Product$inboundSchema` instead. */
180
- Product$.inboundSchema = Product$inboundSchema;
181
- /** @deprecated use `Product$outboundSchema` instead. */
182
- Product$.outboundSchema = Product$outboundSchema;
183
- })(Product$ || (Product$ = {}));
184
- export function productToJSON(product) {
185
- return JSON.stringify(Product$outboundSchema.parse(product));
119
+ export var SingleProduct$;
120
+ (function (SingleProduct$) {
121
+ /** @deprecated use `SingleProduct$inboundSchema` instead. */
122
+ SingleProduct$.inboundSchema = SingleProduct$inboundSchema;
123
+ /** @deprecated use `SingleProduct$outboundSchema` instead. */
124
+ SingleProduct$.outboundSchema = SingleProduct$outboundSchema;
125
+ })(SingleProduct$ || (SingleProduct$ = {}));
126
+ export function singleProductToJSON(singleProduct) {
127
+ return JSON.stringify(SingleProduct$outboundSchema.parse(singleProduct));
186
128
  }
187
- export function productFromJSON(jsonString) {
188
- return safeParse(jsonString, (x) => Product$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Product' from JSON`);
129
+ export function singleProductFromJSON(jsonString) {
130
+ return safeParse(jsonString, (x) => SingleProduct$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SingleProduct' from JSON`);
189
131
  }
190
- //# sourceMappingURL=product.js.map
132
+ //# sourceMappingURL=singleproduct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleproduct.js","sourceRoot":"","sources":["../../../src/models/components/singleproduct.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,EAEL,8BAA8B,EAE9B,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,0BAA0B,EAE1B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,4BAA4B,EAE5B,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,8BAA8B,EAE9B,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,iCAAiC,EAEjC,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,qBAAqB,EAErB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,2BAA2B,EAE3B,4BAA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Ac,KAAd,cAAc,QAO9B;AAED,MAAM,UAAU,mBAAmB,CAAC,aAA4B;IAC9D,OAAO,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACvD,2CAA2C,CAC5C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,159 @@
1
+ import * as z from "zod";
2
+ import { ClosedEnum } from "../../types/enums.js";
3
+ import { Result as SafeParseResult } from "../../types/fp.js";
4
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ import { ProductAttribute, ProductAttribute$Outbound } from "./productattribute.js";
6
+ import { ProductImage, ProductImage$Outbound } from "./productimage.js";
7
+ import { ProductPricing, ProductPricing$Outbound } from "./productpricing.js";
8
+ import { ProductPromotion, ProductPromotion$Outbound } from "./productpromotion.js";
9
+ import { ProductShipping, ProductShipping$Outbound } from "./productshipping.js";
10
+ import { ProductSubscription, ProductSubscription$Outbound } from "./productsubscription.js";
11
+ import { ProductVideo, ProductVideo$Outbound } from "./productvideo.js";
12
+ import { Seo, Seo$Outbound } from "./seo.js";
13
+ import { Variant, Variant$Outbound } from "./variant.js";
14
+ import { VariantOption, VariantOption$Outbound } from "./variantoption.js";
15
+ export declare const SingleProductDetailProductType: {
16
+ readonly Physical: "physical";
17
+ readonly Digital: "digital";
18
+ readonly Bundle: "bundle";
19
+ };
20
+ export type SingleProductDetailProductType = ClosedEnum<typeof SingleProductDetailProductType>;
21
+ export type SingleProductDetail = {
22
+ /**
23
+ * The ULID of the product
24
+ */
25
+ id: string;
26
+ sku?: string | undefined;
27
+ name: string;
28
+ slug: string;
29
+ shortDescription?: string | undefined;
30
+ productType: SingleProductDetailProductType;
31
+ active?: boolean | undefined;
32
+ /**
33
+ * Indicates whether the product has stock available
34
+ */
35
+ stockAvailable?: boolean | undefined;
36
+ /**
37
+ * Indicates whether this item is associated with any active (product-specific) coupons
38
+ */
39
+ onOffer?: boolean | undefined;
40
+ /**
41
+ * Indicates whether the product has any subscription plans avaialble
42
+ */
43
+ onSubscription?: boolean | undefined;
44
+ /**
45
+ * Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion
46
+ */
47
+ onPromotion?: boolean | undefined;
48
+ /**
49
+ * Indicates whether the product has variants
50
+ */
51
+ hasVariant?: boolean | undefined;
52
+ tags?: Array<string> | null | undefined;
53
+ categoryIds?: Array<string> | undefined;
54
+ reviewsRatingSum?: number | undefined;
55
+ reviewsCount?: number | undefined;
56
+ attributes?: Array<ProductAttribute> | undefined;
57
+ pricing?: ProductPricing | undefined;
58
+ /**
59
+ * this will be used if has_variant is true, to auto set default values.
60
+ */
61
+ variantOptions?: Array<VariantOption> | null | undefined;
62
+ promotion?: ProductPromotion | null | undefined;
63
+ images?: Array<ProductImage> | undefined;
64
+ subscription?: Array<ProductSubscription> | undefined;
65
+ variants?: Array<Variant> | undefined;
66
+ description?: string | undefined;
67
+ hsnCode?: string | undefined;
68
+ videos?: Array<ProductVideo> | undefined;
69
+ shipping?: ProductShipping | null | undefined;
70
+ /**
71
+ * An array of product ULIDs
72
+ */
73
+ upsellingProductIds?: Array<string> | undefined;
74
+ /**
75
+ * An array of product ULIDs
76
+ */
77
+ crosssellingProductIds?: Array<string> | undefined;
78
+ seo?: Seo | undefined;
79
+ metadata?: {
80
+ [k: string]: string;
81
+ } | undefined;
82
+ };
83
+ /** @internal */
84
+ export declare const SingleProductDetailProductType$inboundSchema: z.ZodNativeEnum<typeof SingleProductDetailProductType>;
85
+ /** @internal */
86
+ export declare const SingleProductDetailProductType$outboundSchema: z.ZodNativeEnum<typeof SingleProductDetailProductType>;
87
+ /**
88
+ * @internal
89
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
90
+ */
91
+ export declare namespace SingleProductDetailProductType$ {
92
+ /** @deprecated use `SingleProductDetailProductType$inboundSchema` instead. */
93
+ const inboundSchema: z.ZodNativeEnum<{
94
+ readonly Physical: "physical";
95
+ readonly Digital: "digital";
96
+ readonly Bundle: "bundle";
97
+ }>;
98
+ /** @deprecated use `SingleProductDetailProductType$outboundSchema` instead. */
99
+ const outboundSchema: z.ZodNativeEnum<{
100
+ readonly Physical: "physical";
101
+ readonly Digital: "digital";
102
+ readonly Bundle: "bundle";
103
+ }>;
104
+ }
105
+ /** @internal */
106
+ export declare const SingleProductDetail$inboundSchema: z.ZodType<SingleProductDetail, z.ZodTypeDef, unknown>;
107
+ /** @internal */
108
+ export type SingleProductDetail$Outbound = {
109
+ id: string;
110
+ sku?: string | undefined;
111
+ name: string;
112
+ slug: string;
113
+ short_description?: string | undefined;
114
+ product_type: string;
115
+ active: boolean;
116
+ stock_available: boolean;
117
+ on_offer: boolean;
118
+ on_subscription: boolean;
119
+ on_promotion: boolean;
120
+ has_variant: boolean;
121
+ tags?: Array<string> | null | undefined;
122
+ category_ids?: Array<string> | undefined;
123
+ reviews_rating_sum?: number | undefined;
124
+ reviews_count?: number | undefined;
125
+ attributes?: Array<ProductAttribute$Outbound> | undefined;
126
+ pricing?: ProductPricing$Outbound | undefined;
127
+ variant_options?: Array<VariantOption$Outbound> | null | undefined;
128
+ promotion?: ProductPromotion$Outbound | null | undefined;
129
+ images?: Array<ProductImage$Outbound> | undefined;
130
+ subscription?: Array<ProductSubscription$Outbound> | undefined;
131
+ variants?: Array<Variant$Outbound> | undefined;
132
+ description?: string | undefined;
133
+ hsn_code?: string | undefined;
134
+ videos?: Array<ProductVideo$Outbound> | undefined;
135
+ shipping?: ProductShipping$Outbound | null | undefined;
136
+ upselling_product_ids?: Array<string> | undefined;
137
+ crossselling_product_ids?: Array<string> | undefined;
138
+ seo?: Seo$Outbound | undefined;
139
+ metadata?: {
140
+ [k: string]: string;
141
+ } | undefined;
142
+ };
143
+ /** @internal */
144
+ export declare const SingleProductDetail$outboundSchema: z.ZodType<SingleProductDetail$Outbound, z.ZodTypeDef, SingleProductDetail>;
145
+ /**
146
+ * @internal
147
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
148
+ */
149
+ export declare namespace SingleProductDetail$ {
150
+ /** @deprecated use `SingleProductDetail$inboundSchema` instead. */
151
+ const inboundSchema: z.ZodType<SingleProductDetail, z.ZodTypeDef, unknown>;
152
+ /** @deprecated use `SingleProductDetail$outboundSchema` instead. */
153
+ const outboundSchema: z.ZodType<SingleProductDetail$Outbound, z.ZodTypeDef, SingleProductDetail>;
154
+ /** @deprecated use `SingleProductDetail$Outbound` instead. */
155
+ type Outbound = SingleProductDetail$Outbound;
156
+ }
157
+ export declare function singleProductDetailToJSON(singleProductDetail: SingleProductDetail): string;
158
+ export declare function singleProductDetailFromJSON(jsonString: string): SafeParseResult<SingleProductDetail, SDKValidationError>;
159
+ //# sourceMappingURL=singleproductdetail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleproductdetail.d.ts","sourceRoot":"","sources":["../../../src/models/components/singleproductdetail.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,gBAAgB,EAEhB,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EAEZ,qBAAqB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EAEd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAEhB,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAA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