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
@@ -6,6 +6,12 @@ import * as z from "zod";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ BundleProduct,
11
+ BundleProduct$inboundSchema,
12
+ BundleProduct$Outbound,
13
+ BundleProduct$outboundSchema,
14
+ } from "./bundleproduct.js";
9
15
  import {
10
16
  Pagination,
11
17
  Pagination$inboundSchema,
@@ -13,33 +19,147 @@ import {
13
19
  Pagination$outboundSchema,
14
20
  } from "./pagination.js";
15
21
  import {
16
- Product,
17
- Product$inboundSchema,
18
- Product$Outbound,
19
- Product$outboundSchema,
20
- } from "./product.js";
22
+ SingleProduct,
23
+ SingleProduct$inboundSchema,
24
+ SingleProduct$Outbound,
25
+ SingleProduct$outboundSchema,
26
+ } from "./singleproduct.js";
27
+
28
+ export type Products =
29
+ | (SingleProduct & { productType: "physical" })
30
+ | (SingleProduct & { productType: "digital" })
31
+ | (BundleProduct & { productType: "bundle" });
21
32
 
22
33
  export type ProductListResponse = {
23
- products?: Array<Product> | undefined;
34
+ products?:
35
+ | Array<
36
+ | (SingleProduct & { productType: "physical" })
37
+ | (SingleProduct & { productType: "digital" })
38
+ | (BundleProduct & { productType: "bundle" })
39
+ >
40
+ | undefined;
24
41
  /**
25
42
  * pagination metadata structure
26
43
  */
27
44
  pagination?: Pagination | undefined;
28
45
  };
29
46
 
47
+ /** @internal */
48
+ export const Products$inboundSchema: z.ZodType<
49
+ Products,
50
+ z.ZodTypeDef,
51
+ unknown
52
+ > = z.union([
53
+ SingleProduct$inboundSchema.and(
54
+ z.object({ product_type: z.literal("physical") }).transform((v) => ({
55
+ productType: v.product_type,
56
+ })),
57
+ ),
58
+ SingleProduct$inboundSchema.and(
59
+ z.object({ product_type: z.literal("digital") }).transform((v) => ({
60
+ productType: v.product_type,
61
+ })),
62
+ ),
63
+ BundleProduct$inboundSchema.and(
64
+ z.object({ product_type: z.literal("bundle") }).transform((v) => ({
65
+ productType: v.product_type,
66
+ })),
67
+ ),
68
+ ]);
69
+
70
+ /** @internal */
71
+ export type Products$Outbound =
72
+ | (SingleProduct$Outbound & { product_type: "physical" })
73
+ | (SingleProduct$Outbound & { product_type: "digital" })
74
+ | (BundleProduct$Outbound & { product_type: "bundle" });
75
+
76
+ /** @internal */
77
+ export const Products$outboundSchema: z.ZodType<
78
+ Products$Outbound,
79
+ z.ZodTypeDef,
80
+ Products
81
+ > = z.union([
82
+ SingleProduct$outboundSchema.and(
83
+ z.object({ productType: z.literal("physical") }).transform((v) => ({
84
+ product_type: v.productType,
85
+ })),
86
+ ),
87
+ SingleProduct$outboundSchema.and(
88
+ z.object({ productType: z.literal("digital") }).transform((v) => ({
89
+ product_type: v.productType,
90
+ })),
91
+ ),
92
+ BundleProduct$outboundSchema.and(
93
+ z.object({ productType: z.literal("bundle") }).transform((v) => ({
94
+ product_type: v.productType,
95
+ })),
96
+ ),
97
+ ]);
98
+
99
+ /**
100
+ * @internal
101
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
102
+ */
103
+ export namespace Products$ {
104
+ /** @deprecated use `Products$inboundSchema` instead. */
105
+ export const inboundSchema = Products$inboundSchema;
106
+ /** @deprecated use `Products$outboundSchema` instead. */
107
+ export const outboundSchema = Products$outboundSchema;
108
+ /** @deprecated use `Products$Outbound` instead. */
109
+ export type Outbound = Products$Outbound;
110
+ }
111
+
112
+ export function productsToJSON(products: Products): string {
113
+ return JSON.stringify(Products$outboundSchema.parse(products));
114
+ }
115
+
116
+ export function productsFromJSON(
117
+ jsonString: string,
118
+ ): SafeParseResult<Products, SDKValidationError> {
119
+ return safeParse(
120
+ jsonString,
121
+ (x) => Products$inboundSchema.parse(JSON.parse(x)),
122
+ `Failed to parse 'Products' from JSON`,
123
+ );
124
+ }
125
+
30
126
  /** @internal */
31
127
  export const ProductListResponse$inboundSchema: z.ZodType<
32
128
  ProductListResponse,
33
129
  z.ZodTypeDef,
34
130
  unknown
35
131
  > = z.object({
36
- products: z.array(Product$inboundSchema).optional(),
132
+ products: z.array(
133
+ z.union([
134
+ SingleProduct$inboundSchema.and(
135
+ z.object({ product_type: z.literal("physical") }).transform((v) => ({
136
+ productType: v.product_type,
137
+ })),
138
+ ),
139
+ SingleProduct$inboundSchema.and(
140
+ z.object({ product_type: z.literal("digital") }).transform((v) => ({
141
+ productType: v.product_type,
142
+ })),
143
+ ),
144
+ BundleProduct$inboundSchema.and(
145
+ z.object({ product_type: z.literal("bundle") }).transform((v) => ({
146
+ productType: v.product_type,
147
+ })),
148
+ ),
149
+ ]),
150
+ ).optional(),
37
151
  pagination: Pagination$inboundSchema.optional(),
38
152
  });
39
153
 
40
154
  /** @internal */
41
155
  export type ProductListResponse$Outbound = {
42
- products?: Array<Product$Outbound> | undefined;
156
+ products?:
157
+ | Array<
158
+ | (SingleProduct$Outbound & { product_type: "physical" })
159
+ | (SingleProduct$Outbound & { product_type: "digital" })
160
+ | (BundleProduct$Outbound & { product_type: "bundle" })
161
+ >
162
+ | undefined;
43
163
  pagination?: Pagination$Outbound | undefined;
44
164
  };
45
165
 
@@ -49,7 +169,25 @@ export const ProductListResponse$outboundSchema: z.ZodType<
49
169
  z.ZodTypeDef,
50
170
  ProductListResponse
51
171
  > = z.object({
52
- products: z.array(Product$outboundSchema).optional(),
172
+ products: z.array(
173
+ z.union([
174
+ SingleProduct$outboundSchema.and(
175
+ z.object({ productType: z.literal("physical") }).transform((v) => ({
176
+ product_type: v.productType,
177
+ })),
178
+ ),
179
+ SingleProduct$outboundSchema.and(
180
+ z.object({ productType: z.literal("digital") }).transform((v) => ({
181
+ product_type: v.productType,
182
+ })),
183
+ ),
184
+ BundleProduct$outboundSchema.and(
185
+ z.object({ productType: z.literal("bundle") }).transform((v) => ({
186
+ product_type: v.productType,
187
+ })),
188
+ ),
189
+ ]),
190
+ ).optional(),
53
191
  pagination: Pagination$outboundSchema.optional(),
54
192
  });
55
193
 
@@ -9,15 +9,14 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  export type ProductShipping = {
12
- additionalCost?: number | undefined;
12
+ additionalCost?: number | null | undefined;
13
13
  shippingPriceIncludingTax?: boolean | undefined;
14
- availabilityDescription?: string | undefined;
14
+ availabilityDescription?: string | null | undefined;
15
15
  shipsInternationally?: boolean | undefined;
16
- midCode?: string | undefined;
17
- countryOfOrigin?: string | undefined;
18
- taxRegion?: string | undefined;
19
- taxType?: string | undefined;
20
- taxRate?: number | undefined;
16
+ midCode?: string | null | undefined;
17
+ countryOfOrigin?: string | null | undefined;
18
+ taxType?: string | null | undefined;
19
+ taxRate?: number | null | undefined;
21
20
  };
22
21
 
23
22
  /** @internal */
@@ -26,15 +25,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
26
25
  z.ZodTypeDef,
27
26
  unknown
28
27
  > = z.object({
29
- additional_cost: z.number().optional(),
28
+ additional_cost: z.nullable(z.number()).optional(),
30
29
  shipping_price_including_tax: z.boolean().optional(),
31
- availability_description: z.string().optional(),
32
- ships_internationally: z.boolean().optional(),
33
- mid_code: z.string().optional(),
34
- country_of_origin: z.string().default("India"),
35
- tax_region: z.string().optional(),
36
- tax_type: z.string().optional(),
37
- tax_rate: z.number().optional(),
30
+ availability_description: z.nullable(z.string()).optional(),
31
+ ships_internationally: z.boolean().default(false),
32
+ mid_code: z.nullable(z.string()).optional(),
33
+ country_of_origin: z.nullable(z.string().default("India")),
34
+ tax_type: z.nullable(z.string()).optional(),
35
+ tax_rate: z.nullable(z.number()).optional(),
38
36
  }).transform((v) => {
39
37
  return remap$(v, {
40
38
  "additional_cost": "additionalCost",
@@ -43,7 +41,6 @@ export const ProductShipping$inboundSchema: z.ZodType<
43
41
  "ships_internationally": "shipsInternationally",
44
42
  "mid_code": "midCode",
45
43
  "country_of_origin": "countryOfOrigin",
46
- "tax_region": "taxRegion",
47
44
  "tax_type": "taxType",
48
45
  "tax_rate": "taxRate",
49
46
  });
@@ -51,15 +48,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
51
48
 
52
49
  /** @internal */
53
50
  export type ProductShipping$Outbound = {
54
- additional_cost?: number | undefined;
51
+ additional_cost?: number | null | undefined;
55
52
  shipping_price_including_tax?: boolean | undefined;
56
- availability_description?: string | undefined;
57
- ships_internationally?: boolean | undefined;
58
- mid_code?: string | undefined;
59
- country_of_origin: string;
60
- tax_region?: string | undefined;
61
- tax_type?: string | undefined;
62
- tax_rate?: number | undefined;
53
+ availability_description?: string | null | undefined;
54
+ ships_internationally: boolean;
55
+ mid_code?: string | null | undefined;
56
+ country_of_origin: string | null;
57
+ tax_type?: string | null | undefined;
58
+ tax_rate?: number | null | undefined;
63
59
  };
64
60
 
65
61
  /** @internal */
@@ -68,15 +64,14 @@ export const ProductShipping$outboundSchema: z.ZodType<
68
64
  z.ZodTypeDef,
69
65
  ProductShipping
70
66
  > = z.object({
71
- additionalCost: z.number().optional(),
67
+ additionalCost: z.nullable(z.number()).optional(),
72
68
  shippingPriceIncludingTax: z.boolean().optional(),
73
- availabilityDescription: z.string().optional(),
74
- shipsInternationally: z.boolean().optional(),
75
- midCode: z.string().optional(),
76
- countryOfOrigin: z.string().default("India"),
77
- taxRegion: z.string().optional(),
78
- taxType: z.string().optional(),
79
- taxRate: z.number().optional(),
69
+ availabilityDescription: z.nullable(z.string()).optional(),
70
+ shipsInternationally: z.boolean().default(false),
71
+ midCode: z.nullable(z.string()).optional(),
72
+ countryOfOrigin: z.nullable(z.string().default("India")),
73
+ taxType: z.nullable(z.string()).optional(),
74
+ taxRate: z.nullable(z.number()).optional(),
80
75
  }).transform((v) => {
81
76
  return remap$(v, {
82
77
  additionalCost: "additional_cost",
@@ -85,7 +80,6 @@ export const ProductShipping$outboundSchema: z.ZodType<
85
80
  shipsInternationally: "ships_internationally",
86
81
  midCode: "mid_code",
87
82
  countryOfOrigin: "country_of_origin",
88
- taxRegion: "tax_region",
89
83
  taxType: "tax_type",
90
84
  taxRate: "tax_rate",
91
85
  });
@@ -17,18 +17,18 @@ export const PromotionType = {
17
17
  } as const;
18
18
  export type PromotionType = ClosedEnum<typeof PromotionType>;
19
19
 
20
- export type PromotionDetails = {};
20
+ export type PromotionDetailDetails = {};
21
21
 
22
22
  /**
23
23
  * promotion model
24
24
  */
25
- export type Promotion = {
25
+ export type PromotionDetail = {
26
26
  id?: string | undefined;
27
27
  name?: string | undefined;
28
28
  description?: string | undefined;
29
29
  promotionType?: PromotionType | undefined;
30
30
  tags?: Array<string> | undefined;
31
- details?: PromotionDetails | undefined;
31
+ details?: PromotionDetailDetails | undefined;
32
32
  hasRedemptionLimit?: boolean | undefined;
33
33
  redemptionLimit?: number | undefined;
34
34
  redemptionCount?: number | undefined;
@@ -64,56 +64,56 @@ export namespace PromotionType$ {
64
64
  }
65
65
 
66
66
  /** @internal */
67
- export const PromotionDetails$inboundSchema: z.ZodType<
68
- PromotionDetails,
67
+ export const PromotionDetailDetails$inboundSchema: z.ZodType<
68
+ PromotionDetailDetails,
69
69
  z.ZodTypeDef,
70
70
  unknown
71
71
  > = z.object({});
72
72
 
73
73
  /** @internal */
74
- export type PromotionDetails$Outbound = {};
74
+ export type PromotionDetailDetails$Outbound = {};
75
75
 
76
76
  /** @internal */
77
- export const PromotionDetails$outboundSchema: z.ZodType<
78
- PromotionDetails$Outbound,
77
+ export const PromotionDetailDetails$outboundSchema: z.ZodType<
78
+ PromotionDetailDetails$Outbound,
79
79
  z.ZodTypeDef,
80
- PromotionDetails
80
+ PromotionDetailDetails
81
81
  > = z.object({});
82
82
 
83
83
  /**
84
84
  * @internal
85
85
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
86
86
  */
87
- export namespace PromotionDetails$ {
88
- /** @deprecated use `PromotionDetails$inboundSchema` instead. */
89
- export const inboundSchema = PromotionDetails$inboundSchema;
90
- /** @deprecated use `PromotionDetails$outboundSchema` instead. */
91
- export const outboundSchema = PromotionDetails$outboundSchema;
92
- /** @deprecated use `PromotionDetails$Outbound` instead. */
93
- export type Outbound = PromotionDetails$Outbound;
87
+ export namespace PromotionDetailDetails$ {
88
+ /** @deprecated use `PromotionDetailDetails$inboundSchema` instead. */
89
+ export const inboundSchema = PromotionDetailDetails$inboundSchema;
90
+ /** @deprecated use `PromotionDetailDetails$outboundSchema` instead. */
91
+ export const outboundSchema = PromotionDetailDetails$outboundSchema;
92
+ /** @deprecated use `PromotionDetailDetails$Outbound` instead. */
93
+ export type Outbound = PromotionDetailDetails$Outbound;
94
94
  }
95
95
 
96
- export function promotionDetailsToJSON(
97
- promotionDetails: PromotionDetails,
96
+ export function promotionDetailDetailsToJSON(
97
+ promotionDetailDetails: PromotionDetailDetails,
98
98
  ): string {
99
99
  return JSON.stringify(
100
- PromotionDetails$outboundSchema.parse(promotionDetails),
100
+ PromotionDetailDetails$outboundSchema.parse(promotionDetailDetails),
101
101
  );
102
102
  }
103
103
 
104
- export function promotionDetailsFromJSON(
104
+ export function promotionDetailDetailsFromJSON(
105
105
  jsonString: string,
106
- ): SafeParseResult<PromotionDetails, SDKValidationError> {
106
+ ): SafeParseResult<PromotionDetailDetails, SDKValidationError> {
107
107
  return safeParse(
108
108
  jsonString,
109
- (x) => PromotionDetails$inboundSchema.parse(JSON.parse(x)),
110
- `Failed to parse 'PromotionDetails' from JSON`,
109
+ (x) => PromotionDetailDetails$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'PromotionDetailDetails' from JSON`,
111
111
  );
112
112
  }
113
113
 
114
114
  /** @internal */
115
- export const Promotion$inboundSchema: z.ZodType<
116
- Promotion,
115
+ export const PromotionDetail$inboundSchema: z.ZodType<
116
+ PromotionDetail,
117
117
  z.ZodTypeDef,
118
118
  unknown
119
119
  > = z.object({
@@ -122,7 +122,7 @@ export const Promotion$inboundSchema: z.ZodType<
122
122
  description: z.string().optional(),
123
123
  promotion_type: PromotionType$inboundSchema.optional(),
124
124
  tags: z.array(z.string()).optional(),
125
- details: z.lazy(() => PromotionDetails$inboundSchema).optional(),
125
+ details: z.lazy(() => PromotionDetailDetails$inboundSchema).optional(),
126
126
  has_redemption_limit: z.boolean().optional(),
127
127
  redemption_limit: z.number().int().optional(),
128
128
  redemption_count: z.number().int().optional(),
@@ -157,13 +157,13 @@ export const Promotion$inboundSchema: z.ZodType<
157
157
  });
158
158
 
159
159
  /** @internal */
160
- export type Promotion$Outbound = {
160
+ export type PromotionDetail$Outbound = {
161
161
  id?: string | undefined;
162
162
  name?: string | undefined;
163
163
  description?: string | undefined;
164
164
  promotion_type?: string | undefined;
165
165
  tags?: Array<string> | undefined;
166
- details?: PromotionDetails$Outbound | undefined;
166
+ details?: PromotionDetailDetails$Outbound | undefined;
167
167
  has_redemption_limit?: boolean | undefined;
168
168
  redemption_limit?: number | undefined;
169
169
  redemption_count?: number | undefined;
@@ -178,17 +178,17 @@ export type Promotion$Outbound = {
178
178
  };
179
179
 
180
180
  /** @internal */
181
- export const Promotion$outboundSchema: z.ZodType<
182
- Promotion$Outbound,
181
+ export const PromotionDetail$outboundSchema: z.ZodType<
182
+ PromotionDetail$Outbound,
183
183
  z.ZodTypeDef,
184
- Promotion
184
+ PromotionDetail
185
185
  > = z.object({
186
186
  id: z.string().optional(),
187
187
  name: z.string().optional(),
188
188
  description: z.string().optional(),
189
189
  promotionType: PromotionType$outboundSchema.optional(),
190
190
  tags: z.array(z.string()).optional(),
191
- details: z.lazy(() => PromotionDetails$outboundSchema).optional(),
191
+ details: z.lazy(() => PromotionDetailDetails$outboundSchema).optional(),
192
192
  hasRedemptionLimit: z.boolean().optional(),
193
193
  redemptionLimit: z.number().int().optional(),
194
194
  redemptionCount: z.number().int().optional(),
@@ -221,25 +221,27 @@ export const Promotion$outboundSchema: z.ZodType<
221
221
  * @internal
222
222
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
223
223
  */
224
- export namespace Promotion$ {
225
- /** @deprecated use `Promotion$inboundSchema` instead. */
226
- export const inboundSchema = Promotion$inboundSchema;
227
- /** @deprecated use `Promotion$outboundSchema` instead. */
228
- export const outboundSchema = Promotion$outboundSchema;
229
- /** @deprecated use `Promotion$Outbound` instead. */
230
- export type Outbound = Promotion$Outbound;
224
+ export namespace PromotionDetail$ {
225
+ /** @deprecated use `PromotionDetail$inboundSchema` instead. */
226
+ export const inboundSchema = PromotionDetail$inboundSchema;
227
+ /** @deprecated use `PromotionDetail$outboundSchema` instead. */
228
+ export const outboundSchema = PromotionDetail$outboundSchema;
229
+ /** @deprecated use `PromotionDetail$Outbound` instead. */
230
+ export type Outbound = PromotionDetail$Outbound;
231
231
  }
232
232
 
233
- export function promotionToJSON(promotion: Promotion): string {
234
- return JSON.stringify(Promotion$outboundSchema.parse(promotion));
233
+ export function promotionDetailToJSON(
234
+ promotionDetail: PromotionDetail,
235
+ ): string {
236
+ return JSON.stringify(PromotionDetail$outboundSchema.parse(promotionDetail));
235
237
  }
236
238
 
237
- export function promotionFromJSON(
239
+ export function promotionDetailFromJSON(
238
240
  jsonString: string,
239
- ): SafeParseResult<Promotion, SDKValidationError> {
241
+ ): SafeParseResult<PromotionDetail, SDKValidationError> {
240
242
  return safeParse(
241
243
  jsonString,
242
- (x) => Promotion$inboundSchema.parse(JSON.parse(x)),
243
- `Failed to parse 'Promotion' from JSON`,
244
+ (x) => PromotionDetail$inboundSchema.parse(JSON.parse(x)),
245
+ `Failed to parse 'PromotionDetail' from JSON`,
244
246
  );
245
247
  }
@@ -3,54 +3,41 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
9
 
11
10
  export type Seo = {
12
- metaTitle?: string | undefined;
13
- metaDescription?: string | undefined;
14
- metaKeywords?: Array<string> | undefined;
15
11
  slug?: string | undefined;
12
+ title?: string | undefined;
13
+ description?: string | undefined;
14
+ keywords?: Array<string> | undefined;
16
15
  };
17
16
 
18
17
  /** @internal */
19
18
  export const Seo$inboundSchema: z.ZodType<Seo, z.ZodTypeDef, unknown> = z
20
19
  .object({
21
- meta_title: z.string().optional(),
22
- meta_description: z.string().optional(),
23
- meta_keywords: z.array(z.string()).optional(),
24
20
  slug: z.string().optional(),
25
- }).transform((v) => {
26
- return remap$(v, {
27
- "meta_title": "metaTitle",
28
- "meta_description": "metaDescription",
29
- "meta_keywords": "metaKeywords",
30
- });
21
+ title: z.string().optional(),
22
+ description: z.string().optional(),
23
+ keywords: z.array(z.string()).optional(),
31
24
  });
32
25
 
33
26
  /** @internal */
34
27
  export type Seo$Outbound = {
35
- meta_title?: string | undefined;
36
- meta_description?: string | undefined;
37
- meta_keywords?: Array<string> | undefined;
38
28
  slug?: string | undefined;
29
+ title?: string | undefined;
30
+ description?: string | undefined;
31
+ keywords?: Array<string> | undefined;
39
32
  };
40
33
 
41
34
  /** @internal */
42
35
  export const Seo$outboundSchema: z.ZodType<Seo$Outbound, z.ZodTypeDef, Seo> = z
43
36
  .object({
44
- metaTitle: z.string().optional(),
45
- metaDescription: z.string().optional(),
46
- metaKeywords: z.array(z.string()).optional(),
47
37
  slug: z.string().optional(),
48
- }).transform((v) => {
49
- return remap$(v, {
50
- metaTitle: "meta_title",
51
- metaDescription: "meta_description",
52
- metaKeywords: "meta_keywords",
53
- });
38
+ title: z.string().optional(),
39
+ description: z.string().optional(),
40
+ keywords: z.array(z.string()).optional(),
54
41
  });
55
42
 
56
43
  /**