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.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/booleanattribute.d.ts +46 -0
- package/esm/models/components/booleanattribute.d.ts.map +1 -0
- package/esm/models/components/booleanattribute.js +39 -0
- package/esm/models/components/booleanattribute.js.map +1 -0
- package/esm/models/components/colorattribute.d.ts +73 -0
- package/esm/models/components/colorattribute.d.ts.map +1 -0
- package/esm/models/components/colorattribute.js +67 -0
- package/esm/models/components/colorattribute.js.map +1 -0
- package/esm/models/components/dateattribute.d.ts +46 -0
- package/esm/models/components/dateattribute.d.ts.map +1 -0
- package/esm/models/components/dateattribute.js +39 -0
- package/esm/models/components/dateattribute.js.map +1 -0
- package/esm/models/components/index.d.ts +7 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +7 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/multiselectattribute.d.ts +46 -0
- package/esm/models/components/multiselectattribute.d.ts.map +1 -0
- package/esm/models/components/multiselectattribute.js +39 -0
- package/esm/models/components/multiselectattribute.js.map +1 -0
- package/esm/models/components/numberattribute.d.ts +46 -0
- package/esm/models/components/numberattribute.d.ts.map +1 -0
- package/esm/models/components/numberattribute.js +39 -0
- package/esm/models/components/numberattribute.js.map +1 -0
- package/esm/models/components/productattribute.d.ts +11 -315
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +25 -237
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/singleselectattribute.d.ts +46 -0
- package/esm/models/components/singleselectattribute.d.ts.map +1 -0
- package/esm/models/components/singleselectattribute.js +39 -0
- package/esm/models/components/singleselectattribute.js.map +1 -0
- package/esm/models/components/textattribute.d.ts +46 -0
- package/esm/models/components/textattribute.d.ts.map +1 -0
- package/esm/models/components/textattribute.js +39 -0
- package/esm/models/components/textattribute.js.map +1 -0
- package/esm/models/components/variantoption.d.ts +13 -13
- package/esm/models/components/variantoption.d.ts.map +1 -1
- package/esm/models/components/variantoption.js +13 -14
- package/esm/models/components/variantoption.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +11 -7
- package/esm/models/operations/listproducts.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/booleanattribute.ts +91 -0
- package/src/models/components/colorattribute.ts +142 -0
- package/src/models/components/dateattribute.ts +87 -0
- package/src/models/components/index.ts +7 -0
- package/src/models/components/multiselectattribute.ts +91 -0
- package/src/models/components/numberattribute.ts +89 -0
- package/src/models/components/productattribute.ts +68 -596
- package/src/models/components/singleselectattribute.ts +91 -0
- package/src/models/components/textattribute.ts +87 -0
- package/src/models/components/variantoption.ts +27 -20
- 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
|
|
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
|
|
111
|
-
|
|
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
|
|
117
|
+
export type VariantOptionValue$Outbound = Two$Outbound | string;
|
|
115
118
|
|
|
116
119
|
/** @internal */
|
|
117
|
-
export const
|
|
118
|
-
|
|
120
|
+
export const VariantOptionValue$outboundSchema: z.ZodType<
|
|
121
|
+
VariantOptionValue$Outbound,
|
|
119
122
|
z.ZodTypeDef,
|
|
120
|
-
|
|
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
|
|
128
|
-
/** @deprecated use `
|
|
129
|
-
export const inboundSchema =
|
|
130
|
-
/** @deprecated use `
|
|
131
|
-
export const outboundSchema =
|
|
132
|
-
/** @deprecated use `
|
|
133
|
-
export type 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
|
|
137
|
-
|
|
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
|
|
147
|
+
export function variantOptionValueFromJSON(
|
|
141
148
|
jsonString: string,
|
|
142
|
-
): SafeParseResult<
|
|
149
|
+
): SafeParseResult<VariantOptionValue, SDKValidationError> {
|
|
143
150
|
return safeParse(
|
|
144
151
|
jsonString,
|
|
145
|
-
(x) =>
|
|
146
|
-
`Failed to parse '
|
|
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
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
}
|