ce-storefront 0.7.0 → 0.7.2

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/booleanattribute.d.ts +46 -0
  4. package/esm/models/components/booleanattribute.d.ts.map +1 -0
  5. package/esm/models/components/booleanattribute.js +39 -0
  6. package/esm/models/components/booleanattribute.js.map +1 -0
  7. package/esm/models/components/colorattribute.d.ts +73 -0
  8. package/esm/models/components/colorattribute.d.ts.map +1 -0
  9. package/esm/models/components/colorattribute.js +67 -0
  10. package/esm/models/components/colorattribute.js.map +1 -0
  11. package/esm/models/components/dateattribute.d.ts +46 -0
  12. package/esm/models/components/dateattribute.d.ts.map +1 -0
  13. package/esm/models/components/dateattribute.js +39 -0
  14. package/esm/models/components/dateattribute.js.map +1 -0
  15. package/esm/models/components/index.d.ts +7 -0
  16. package/esm/models/components/index.d.ts.map +1 -1
  17. package/esm/models/components/index.js +7 -0
  18. package/esm/models/components/index.js.map +1 -1
  19. package/esm/models/components/multiselectattribute.d.ts +46 -0
  20. package/esm/models/components/multiselectattribute.d.ts.map +1 -0
  21. package/esm/models/components/multiselectattribute.js +39 -0
  22. package/esm/models/components/multiselectattribute.js.map +1 -0
  23. package/esm/models/components/numberattribute.d.ts +46 -0
  24. package/esm/models/components/numberattribute.d.ts.map +1 -0
  25. package/esm/models/components/numberattribute.js +39 -0
  26. package/esm/models/components/numberattribute.js.map +1 -0
  27. package/esm/models/components/productattribute.d.ts +11 -315
  28. package/esm/models/components/productattribute.d.ts.map +1 -1
  29. package/esm/models/components/productattribute.js +25 -237
  30. package/esm/models/components/productattribute.js.map +1 -1
  31. package/esm/models/components/singleselectattribute.d.ts +46 -0
  32. package/esm/models/components/singleselectattribute.d.ts.map +1 -0
  33. package/esm/models/components/singleselectattribute.js +39 -0
  34. package/esm/models/components/singleselectattribute.js.map +1 -0
  35. package/esm/models/components/textattribute.d.ts +46 -0
  36. package/esm/models/components/textattribute.d.ts.map +1 -0
  37. package/esm/models/components/textattribute.js +39 -0
  38. package/esm/models/components/textattribute.js.map +1 -0
  39. package/esm/models/components/variantoption.d.ts +13 -13
  40. package/esm/models/components/variantoption.d.ts.map +1 -1
  41. package/esm/models/components/variantoption.js +13 -14
  42. package/esm/models/components/variantoption.js.map +1 -1
  43. package/esm/models/operations/listproducts.d.ts.map +1 -1
  44. package/esm/models/operations/listproducts.js +11 -7
  45. package/esm/models/operations/listproducts.js.map +1 -1
  46. package/jsr.json +1 -1
  47. package/package.json +1 -1
  48. package/src/lib/config.ts +2 -2
  49. package/src/models/components/booleanattribute.ts +91 -0
  50. package/src/models/components/colorattribute.ts +142 -0
  51. package/src/models/components/dateattribute.ts +87 -0
  52. package/src/models/components/index.ts +7 -0
  53. package/src/models/components/multiselectattribute.ts +91 -0
  54. package/src/models/components/numberattribute.ts +89 -0
  55. package/src/models/components/productattribute.ts +68 -596
  56. package/src/models/components/singleselectattribute.ts +91 -0
  57. package/src/models/components/textattribute.ts +87 -0
  58. package/src/models/components/variantoption.ts +27 -20
  59. package/src/models/operations/listproducts.ts +38 -34
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * Attribute for single-select values
12
+ */
13
+ export type SingleSelectAttribute = {
14
+ id: string;
15
+ name: string;
16
+ /**
17
+ * A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
18
+ */
19
+ key: string;
20
+ type: string;
21
+ /**
22
+ * For single-select attributes
23
+ */
24
+ value: string;
25
+ };
26
+
27
+ /** @internal */
28
+ export const SingleSelectAttribute$inboundSchema: z.ZodType<
29
+ SingleSelectAttribute,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ id: z.string(),
34
+ name: z.string(),
35
+ key: z.string(),
36
+ type: z.string(),
37
+ value: z.string(),
38
+ });
39
+
40
+ /** @internal */
41
+ export type SingleSelectAttribute$Outbound = {
42
+ id: string;
43
+ name: string;
44
+ key: string;
45
+ type: string;
46
+ value: string;
47
+ };
48
+
49
+ /** @internal */
50
+ export const SingleSelectAttribute$outboundSchema: z.ZodType<
51
+ SingleSelectAttribute$Outbound,
52
+ z.ZodTypeDef,
53
+ SingleSelectAttribute
54
+ > = z.object({
55
+ id: z.string(),
56
+ name: z.string(),
57
+ key: z.string(),
58
+ type: z.string(),
59
+ value: z.string(),
60
+ });
61
+
62
+ /**
63
+ * @internal
64
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
65
+ */
66
+ export namespace SingleSelectAttribute$ {
67
+ /** @deprecated use `SingleSelectAttribute$inboundSchema` instead. */
68
+ export const inboundSchema = SingleSelectAttribute$inboundSchema;
69
+ /** @deprecated use `SingleSelectAttribute$outboundSchema` instead. */
70
+ export const outboundSchema = SingleSelectAttribute$outboundSchema;
71
+ /** @deprecated use `SingleSelectAttribute$Outbound` instead. */
72
+ export type Outbound = SingleSelectAttribute$Outbound;
73
+ }
74
+
75
+ export function singleSelectAttributeToJSON(
76
+ singleSelectAttribute: SingleSelectAttribute,
77
+ ): string {
78
+ return JSON.stringify(
79
+ SingleSelectAttribute$outboundSchema.parse(singleSelectAttribute),
80
+ );
81
+ }
82
+
83
+ export function singleSelectAttributeFromJSON(
84
+ jsonString: string,
85
+ ): SafeParseResult<SingleSelectAttribute, SDKValidationError> {
86
+ return safeParse(
87
+ jsonString,
88
+ (x) => SingleSelectAttribute$inboundSchema.parse(JSON.parse(x)),
89
+ `Failed to parse 'SingleSelectAttribute' from JSON`,
90
+ );
91
+ }
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * Attribute for text values
12
+ */
13
+ export type TextAttribute = {
14
+ id: string;
15
+ name: string;
16
+ /**
17
+ * A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
18
+ */
19
+ key: string;
20
+ type: string;
21
+ /**
22
+ * For text attributes
23
+ */
24
+ value: string;
25
+ };
26
+
27
+ /** @internal */
28
+ export const TextAttribute$inboundSchema: z.ZodType<
29
+ TextAttribute,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ id: z.string(),
34
+ name: z.string(),
35
+ key: z.string(),
36
+ type: z.string(),
37
+ value: z.string(),
38
+ });
39
+
40
+ /** @internal */
41
+ export type TextAttribute$Outbound = {
42
+ id: string;
43
+ name: string;
44
+ key: string;
45
+ type: string;
46
+ value: string;
47
+ };
48
+
49
+ /** @internal */
50
+ export const TextAttribute$outboundSchema: z.ZodType<
51
+ TextAttribute$Outbound,
52
+ z.ZodTypeDef,
53
+ TextAttribute
54
+ > = z.object({
55
+ id: z.string(),
56
+ name: z.string(),
57
+ key: z.string(),
58
+ type: z.string(),
59
+ value: z.string(),
60
+ });
61
+
62
+ /**
63
+ * @internal
64
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
65
+ */
66
+ export namespace TextAttribute$ {
67
+ /** @deprecated use `TextAttribute$inboundSchema` instead. */
68
+ export const inboundSchema = TextAttribute$inboundSchema;
69
+ /** @deprecated use `TextAttribute$outboundSchema` instead. */
70
+ export const outboundSchema = TextAttribute$outboundSchema;
71
+ /** @deprecated use `TextAttribute$Outbound` instead. */
72
+ export type Outbound = TextAttribute$Outbound;
73
+ }
74
+
75
+ export function textAttributeToJSON(textAttribute: TextAttribute): string {
76
+ return JSON.stringify(TextAttribute$outboundSchema.parse(textAttribute));
77
+ }
78
+
79
+ export function textAttributeFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<TextAttribute, SDKValidationError> {
82
+ return safeParse(
83
+ jsonString,
84
+ (x) => TextAttribute$inboundSchema.parse(JSON.parse(x)),
85
+ `Failed to parse 'TextAttribute' from JSON`,
86
+ );
87
+ }
@@ -16,7 +16,7 @@ export type Type = ClosedEnum<typeof Type>;
16
16
 
17
17
  export type Two = {};
18
18
 
19
- export type Value = Two | string;
19
+ export type VariantOptionValue = Two | string;
20
20
 
21
21
  export type VariantOption = {
22
22
  /**
@@ -107,43 +107,50 @@ export function twoFromJSON(
107
107
  }
108
108
 
109
109
  /** @internal */
110
- export const Value$inboundSchema: z.ZodType<Value, z.ZodTypeDef, unknown> = z
111
- .union([z.lazy(() => Two$inboundSchema), z.string()]);
110
+ export const VariantOptionValue$inboundSchema: z.ZodType<
111
+ VariantOptionValue,
112
+ z.ZodTypeDef,
113
+ unknown
114
+ > = z.union([z.lazy(() => Two$inboundSchema), z.string()]);
112
115
 
113
116
  /** @internal */
114
- export type Value$Outbound = Two$Outbound | string;
117
+ export type VariantOptionValue$Outbound = Two$Outbound | string;
115
118
 
116
119
  /** @internal */
117
- export const Value$outboundSchema: z.ZodType<
118
- Value$Outbound,
120
+ export const VariantOptionValue$outboundSchema: z.ZodType<
121
+ VariantOptionValue$Outbound,
119
122
  z.ZodTypeDef,
120
- Value
123
+ VariantOptionValue
121
124
  > = z.union([z.lazy(() => Two$outboundSchema), z.string()]);
122
125
 
123
126
  /**
124
127
  * @internal
125
128
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
126
129
  */
127
- export namespace Value$ {
128
- /** @deprecated use `Value$inboundSchema` instead. */
129
- export const inboundSchema = Value$inboundSchema;
130
- /** @deprecated use `Value$outboundSchema` instead. */
131
- export const outboundSchema = Value$outboundSchema;
132
- /** @deprecated use `Value$Outbound` instead. */
133
- export type Outbound = Value$Outbound;
130
+ export namespace VariantOptionValue$ {
131
+ /** @deprecated use `VariantOptionValue$inboundSchema` instead. */
132
+ export const inboundSchema = VariantOptionValue$inboundSchema;
133
+ /** @deprecated use `VariantOptionValue$outboundSchema` instead. */
134
+ export const outboundSchema = VariantOptionValue$outboundSchema;
135
+ /** @deprecated use `VariantOptionValue$Outbound` instead. */
136
+ export type Outbound = VariantOptionValue$Outbound;
134
137
  }
135
138
 
136
- export function valueToJSON(value: Value): string {
137
- return JSON.stringify(Value$outboundSchema.parse(value));
139
+ export function variantOptionValueToJSON(
140
+ variantOptionValue: VariantOptionValue,
141
+ ): string {
142
+ return JSON.stringify(
143
+ VariantOptionValue$outboundSchema.parse(variantOptionValue),
144
+ );
138
145
  }
139
146
 
140
- export function valueFromJSON(
147
+ export function variantOptionValueFromJSON(
141
148
  jsonString: string,
142
- ): SafeParseResult<Value, SDKValidationError> {
149
+ ): SafeParseResult<VariantOptionValue, SDKValidationError> {
143
150
  return safeParse(
144
151
  jsonString,
145
- (x) => Value$inboundSchema.parse(JSON.parse(x)),
146
- `Failed to parse 'Value' from JSON`,
152
+ (x) => VariantOptionValue$inboundSchema.parse(JSON.parse(x)),
153
+ `Failed to parse 'VariantOptionValue' from JSON`,
147
154
  );
148
155
  }
149
156
 
@@ -54,19 +54,21 @@ export const ListProductsRequest$inboundSchema: z.ZodType<
54
54
  ListProductsRequest,
55
55
  z.ZodTypeDef,
56
56
  unknown
57
- > = z.object({
58
- page: z.number().optional(),
59
- limit: z.number().int().optional(),
60
- sort_by: z.string().optional(),
61
- category_id: z.array(z.string()).optional(),
62
- customer_group_id: z.string().optional(),
63
- }).transform((v) => {
64
- return remap$(v, {
65
- "sort_by": "sortBy",
66
- "category_id": "categoryId",
67
- "customer_group_id": "customerGroupId",
57
+ > = z
58
+ .object({
59
+ page: z.number().optional(),
60
+ limit: z.number().int().optional(),
61
+ sort_by: z.string().optional(),
62
+ category_id: z.array(z.string()).optional(),
63
+ customer_group_id: z.string().optional(),
64
+ })
65
+ .transform((v) => {
66
+ return remap$(v, {
67
+ sort_by: "sortBy",
68
+ category_id: "categoryId",
69
+ customer_group_id: "customerGroupId",
70
+ });
68
71
  });
69
- });
70
72
 
71
73
  /** @internal */
72
74
  export type ListProductsRequest$Outbound = {
@@ -82,19 +84,21 @@ export const ListProductsRequest$outboundSchema: z.ZodType<
82
84
  ListProductsRequest$Outbound,
83
85
  z.ZodTypeDef,
84
86
  ListProductsRequest
85
- > = z.object({
86
- page: z.number().optional(),
87
- limit: z.number().int().optional(),
88
- sortBy: z.string().optional(),
89
- categoryId: z.array(z.string()).optional(),
90
- customerGroupId: z.string().optional(),
91
- }).transform((v) => {
92
- return remap$(v, {
93
- sortBy: "sort_by",
94
- categoryId: "category_id",
95
- customerGroupId: "customer_group_id",
87
+ > = z
88
+ .object({
89
+ page: z.number().optional(),
90
+ limit: z.number().int().optional(),
91
+ sortBy: z.string().optional(),
92
+ categoryId: z.array(z.string()).optional(),
93
+ customerGroupId: z.string().optional(),
94
+ })
95
+ .transform((v) => {
96
+ return remap$(v, {
97
+ sortBy: "sort_by",
98
+ categoryId: "category_id",
99
+ customerGroupId: "customer_group_id",
100
+ });
96
101
  });
97
- });
98
102
 
99
103
  /**
100
104
  * @internal
@@ -110,20 +114,20 @@ export namespace ListProductsRequest$ {
110
114
  }
111
115
 
112
116
  export function listProductsRequestToJSON(
113
- listProductsRequest: ListProductsRequest,
117
+ listProductsRequest: ListProductsRequest
114
118
  ): string {
115
119
  return JSON.stringify(
116
- ListProductsRequest$outboundSchema.parse(listProductsRequest),
120
+ ListProductsRequest$outboundSchema.parse(listProductsRequest)
117
121
  );
118
122
  }
119
123
 
120
124
  export function listProductsRequestFromJSON(
121
- jsonString: string,
125
+ jsonString: string
122
126
  ): SafeParseResult<ListProductsRequest, SDKValidationError> {
123
127
  return safeParse(
124
128
  jsonString,
125
129
  (x) => ListProductsRequest$inboundSchema.parse(JSON.parse(x)),
126
- `Failed to parse 'ListProductsRequest' from JSON`,
130
+ `Failed to parse 'ListProductsRequest' from JSON`
127
131
  );
128
132
  }
129
133
 
@@ -168,12 +172,12 @@ export function contentToJSON(content: Content): string {
168
172
  }
169
173
 
170
174
  export function contentFromJSON(
171
- jsonString: string,
175
+ jsonString: string
172
176
  ): SafeParseResult<Content, SDKValidationError> {
173
177
  return safeParse(
174
178
  jsonString,
175
179
  (x) => Content$inboundSchema.parse(JSON.parse(x)),
176
- `Failed to parse 'Content' from JSON`,
180
+ `Failed to parse 'Content' from JSON`
177
181
  );
178
182
  }
179
183
 
@@ -220,19 +224,19 @@ export namespace ListProductsResponseBody$ {
220
224
  }
221
225
 
222
226
  export function listProductsResponseBodyToJSON(
223
- listProductsResponseBody: ListProductsResponseBody,
227
+ listProductsResponseBody: ListProductsResponseBody
224
228
  ): string {
225
229
  return JSON.stringify(
226
- ListProductsResponseBody$outboundSchema.parse(listProductsResponseBody),
230
+ ListProductsResponseBody$outboundSchema.parse(listProductsResponseBody)
227
231
  );
228
232
  }
229
233
 
230
234
  export function listProductsResponseBodyFromJSON(
231
- jsonString: string,
235
+ jsonString: string
232
236
  ): SafeParseResult<ListProductsResponseBody, SDKValidationError> {
233
237
  return safeParse(
234
238
  jsonString,
235
239
  (x) => ListProductsResponseBody$inboundSchema.parse(JSON.parse(x)),
236
- `Failed to parse 'ListProductsResponseBody' from JSON`,
240
+ `Failed to parse 'ListProductsResponseBody' from JSON`
237
241
  );
238
242
  }