@commercelayer/demo-store-types 2.3.0 → 3.0.0
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/dist/json/products.d.ts +175 -41
- package/dist/test/data.js +1 -2
- package/package.json +5 -5
package/dist/json/products.d.ts
CHANGED
|
@@ -185,47 +185,181 @@ export declare const rawDataProducts_schema: z.ZodArray<z.ZodObject<{
|
|
|
185
185
|
* ]
|
|
186
186
|
*/
|
|
187
187
|
details: z.ZodOptional<z.ZodArray<DetailSchema>>;
|
|
188
|
-
}, "passthrough", z.ZodTypeAny, {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
188
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
189
|
+
/**
|
|
190
|
+
* The **product code** identifies the base product
|
|
191
|
+
*
|
|
192
|
+
* A master product or base product is a non-sellable product that represents a group of similar or related products.
|
|
193
|
+
*
|
|
194
|
+
* For example, a clothing retailer may have a master product for each type of clothing item, such as "men's t-shirts" or "women's dresses".
|
|
195
|
+
* Each of these master products would contain multiple variations, such as different sizes, colors, and styles.
|
|
196
|
+
*/
|
|
197
|
+
productCode: z.ZodString;
|
|
198
|
+
/**
|
|
199
|
+
* The **variant code** identifies a variation product
|
|
200
|
+
*
|
|
201
|
+
* A variation product is a product that is part of a group of similar or related products,
|
|
202
|
+
* and it is identified by specific attributes or characteristics that distinguish it from the other products in the group (color, material, size, etc.).
|
|
203
|
+
*
|
|
204
|
+
* The `variantCode`, in Demo Store, is used for grouping similar products in the listing page.
|
|
205
|
+
* Usually a different `variantCode` corresponds to a different product image.
|
|
206
|
+
*/
|
|
207
|
+
variantCode: z.ZodString;
|
|
208
|
+
/**
|
|
209
|
+
* The **sku** is a **unique identifier**, meaning *Stock Keeping Unit*.
|
|
210
|
+
*
|
|
211
|
+
* This is the stock unit in a warehouse used to track availability and stock variations of an item to be sold.
|
|
212
|
+
* SKUs can be a variant of any item (e.g., Medium or Large size of a jogger pant).
|
|
213
|
+
*
|
|
214
|
+
* An SKU usually consists of letters and numbers (either EAN code, UPC, or any other code format) like "LSLEEVMM000000FFFFFFMXXX".
|
|
215
|
+
* SKU refers to an item's details, including variants data (e.g., a T-shirt, Red color, Nike brand, 0.5g, XL size).
|
|
216
|
+
* An SKU identifies each product item's characteristics such as manufacturer name, brand name, style, color, weight, and size.
|
|
217
|
+
*/
|
|
218
|
+
sku: z.ZodString;
|
|
219
|
+
/**
|
|
220
|
+
* The product URL slug
|
|
221
|
+
*
|
|
222
|
+
* The slug is the part of a URL that identifies a particular page on a website in an easy-to-read form.
|
|
223
|
+
*
|
|
224
|
+
* It should always start with a forward slash (`/`).
|
|
225
|
+
* @example "/white-apron-with-black-logo/APRONXXXFFFFFF000000XXXX"
|
|
226
|
+
*/
|
|
227
|
+
slug: z.ZodEffects<z.ZodString>;
|
|
228
|
+
/**
|
|
229
|
+
* The localized product name
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* {
|
|
233
|
+
* "it": "Maglietta Grigia",
|
|
234
|
+
* "en-US": "Gray T-Shirt"
|
|
235
|
+
* }
|
|
236
|
+
*/
|
|
237
|
+
name: LocalizedFieldSchema<z.ZodString>;
|
|
238
|
+
/**
|
|
239
|
+
* The localized product description
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* {
|
|
243
|
+
* "it": "Descrizione"
|
|
244
|
+
* "en-US": "Description",
|
|
245
|
+
* }
|
|
246
|
+
*/
|
|
247
|
+
description: LocalizedFieldSchema<z.ZodString>;
|
|
248
|
+
/**
|
|
249
|
+
* A carousel of image URLs that represent the product
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* [
|
|
253
|
+
* "https://res.cloudinary.com/commercelayer/image/upload/f_auto,b_white/demo-store/skus/TSHIRTMSB0B0B2000000LXXX_FLAT.png"
|
|
254
|
+
* ]
|
|
255
|
+
*/
|
|
256
|
+
images: z.ZodArray<z.ZodString>;
|
|
257
|
+
/**
|
|
258
|
+
* Additional product details
|
|
259
|
+
*
|
|
260
|
+
* This attribute is presented as accordion just below the "Add to cart" button.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* [
|
|
264
|
+
* {
|
|
265
|
+
* "title": {
|
|
266
|
+
* "en": "Details"
|
|
267
|
+
* },
|
|
268
|
+
* "content": {
|
|
269
|
+
* "en": "Content here."
|
|
270
|
+
* }
|
|
271
|
+
* }
|
|
272
|
+
* ]
|
|
273
|
+
*/
|
|
274
|
+
details: z.ZodOptional<z.ZodArray<DetailSchema>>;
|
|
275
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
276
|
+
/**
|
|
277
|
+
* The **product code** identifies the base product
|
|
278
|
+
*
|
|
279
|
+
* A master product or base product is a non-sellable product that represents a group of similar or related products.
|
|
280
|
+
*
|
|
281
|
+
* For example, a clothing retailer may have a master product for each type of clothing item, such as "men's t-shirts" or "women's dresses".
|
|
282
|
+
* Each of these master products would contain multiple variations, such as different sizes, colors, and styles.
|
|
283
|
+
*/
|
|
284
|
+
productCode: z.ZodString;
|
|
285
|
+
/**
|
|
286
|
+
* The **variant code** identifies a variation product
|
|
287
|
+
*
|
|
288
|
+
* A variation product is a product that is part of a group of similar or related products,
|
|
289
|
+
* and it is identified by specific attributes or characteristics that distinguish it from the other products in the group (color, material, size, etc.).
|
|
290
|
+
*
|
|
291
|
+
* The `variantCode`, in Demo Store, is used for grouping similar products in the listing page.
|
|
292
|
+
* Usually a different `variantCode` corresponds to a different product image.
|
|
293
|
+
*/
|
|
294
|
+
variantCode: z.ZodString;
|
|
295
|
+
/**
|
|
296
|
+
* The **sku** is a **unique identifier**, meaning *Stock Keeping Unit*.
|
|
297
|
+
*
|
|
298
|
+
* This is the stock unit in a warehouse used to track availability and stock variations of an item to be sold.
|
|
299
|
+
* SKUs can be a variant of any item (e.g., Medium or Large size of a jogger pant).
|
|
300
|
+
*
|
|
301
|
+
* An SKU usually consists of letters and numbers (either EAN code, UPC, or any other code format) like "LSLEEVMM000000FFFFFFMXXX".
|
|
302
|
+
* SKU refers to an item's details, including variants data (e.g., a T-shirt, Red color, Nike brand, 0.5g, XL size).
|
|
303
|
+
* An SKU identifies each product item's characteristics such as manufacturer name, brand name, style, color, weight, and size.
|
|
304
|
+
*/
|
|
305
|
+
sku: z.ZodString;
|
|
306
|
+
/**
|
|
307
|
+
* The product URL slug
|
|
308
|
+
*
|
|
309
|
+
* The slug is the part of a URL that identifies a particular page on a website in an easy-to-read form.
|
|
310
|
+
*
|
|
311
|
+
* It should always start with a forward slash (`/`).
|
|
312
|
+
* @example "/white-apron-with-black-logo/APRONXXXFFFFFF000000XXXX"
|
|
313
|
+
*/
|
|
314
|
+
slug: z.ZodEffects<z.ZodString>;
|
|
315
|
+
/**
|
|
316
|
+
* The localized product name
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* {
|
|
320
|
+
* "it": "Maglietta Grigia",
|
|
321
|
+
* "en-US": "Gray T-Shirt"
|
|
322
|
+
* }
|
|
323
|
+
*/
|
|
324
|
+
name: LocalizedFieldSchema<z.ZodString>;
|
|
325
|
+
/**
|
|
326
|
+
* The localized product description
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* {
|
|
330
|
+
* "it": "Descrizione"
|
|
331
|
+
* "en-US": "Description",
|
|
332
|
+
* }
|
|
333
|
+
*/
|
|
334
|
+
description: LocalizedFieldSchema<z.ZodString>;
|
|
335
|
+
/**
|
|
336
|
+
* A carousel of image URLs that represent the product
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* [
|
|
340
|
+
* "https://res.cloudinary.com/commercelayer/image/upload/f_auto,b_white/demo-store/skus/TSHIRTMSB0B0B2000000LXXX_FLAT.png"
|
|
341
|
+
* ]
|
|
342
|
+
*/
|
|
343
|
+
images: z.ZodArray<z.ZodString>;
|
|
344
|
+
/**
|
|
345
|
+
* Additional product details
|
|
346
|
+
*
|
|
347
|
+
* This attribute is presented as accordion just below the "Add to cart" button.
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* [
|
|
351
|
+
* {
|
|
352
|
+
* "title": {
|
|
353
|
+
* "en": "Details"
|
|
354
|
+
* },
|
|
355
|
+
* "content": {
|
|
356
|
+
* "en": "Content here."
|
|
357
|
+
* }
|
|
358
|
+
* }
|
|
359
|
+
* ]
|
|
360
|
+
*/
|
|
361
|
+
details: z.ZodOptional<z.ZodArray<DetailSchema>>;
|
|
362
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
229
363
|
/**
|
|
230
364
|
* Product
|
|
231
365
|
*
|
package/dist/test/data.js
CHANGED
|
@@ -45,8 +45,7 @@ const assert_1 = require("uvu/assert");
|
|
|
45
45
|
const __1 = require("..");
|
|
46
46
|
function importJson(...paths) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
|
|
49
|
-
return (yield (_a = (0, path_1.resolve)(...paths), Promise.resolve().then(() => __importStar(require(_a))))).default;
|
|
48
|
+
return (yield Promise.resolve(`${(0, path_1.resolve)(...paths)}`).then(s => __importStar(require(s)))).default;
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
function green(test) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/demo-store-types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Demo Store types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@types/lodash": "^4.14.
|
|
11
|
+
"@types/lodash": "^4.14.202",
|
|
12
12
|
"lodash": "^4.17.21",
|
|
13
13
|
"uvu": "^0.5.6",
|
|
14
|
-
"zod": "^3.
|
|
14
|
+
"zod": "^3.22.4"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"typescript": "^
|
|
17
|
+
"typescript": "^5.3.3"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"ts:check": "tsc --noEmit",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "92098b0f4a6031ba61353a48c29b69f0f7937c1a"
|
|
29
29
|
}
|