@commercelayer/demo-store-types 3.0.0 → 4.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/countries.d.ts +3 -2
- package/dist/json/countries.js +6 -1
- package/dist/test/data.js +1 -2
- package/package.json +5 -5
package/dist/json/countries.d.ts
CHANGED
|
@@ -21,9 +21,10 @@ type RawDataCountrySchema = z.ZodObject<{
|
|
|
21
21
|
*
|
|
22
22
|
* Market is an **optional** attribute. If you don't specify any market, then the country will be presented with a non-shoppable experience (no price, no availability, no cart).
|
|
23
23
|
* @see https://github.com/commercelayer/demo-store#4-choose-the-countries-where-youre-going-to-sell
|
|
24
|
-
* @example
|
|
24
|
+
* @example "id:vlGRmhpEeg"
|
|
25
|
+
* @example "code:europe"
|
|
25
26
|
*/
|
|
26
|
-
market: z.ZodOptional<z.ZodNumber
|
|
27
|
+
market: z.ZodOptional<z.ZodUnion<[z.ZodType<`id:${string}` | `code:${string}`, z.ZodTypeDef, `id:${string}` | `code:${string}`>, z.ZodNumber]>>;
|
|
27
28
|
/**
|
|
28
29
|
* Reference to the `catalogs` id
|
|
29
30
|
*
|
package/dist/json/countries.js
CHANGED
|
@@ -5,7 +5,12 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const rawDataCountry_schema = zod_1.z.object({
|
|
6
6
|
name: zod_1.z.string(),
|
|
7
7
|
code: zod_1.z.string(),
|
|
8
|
-
market: zod_1.z
|
|
8
|
+
market: zod_1.z
|
|
9
|
+
.custom((val) => {
|
|
10
|
+
return typeof val === 'string' ? /^id:|code:/.test(val) : false;
|
|
11
|
+
})
|
|
12
|
+
.or(zod_1.z.number())
|
|
13
|
+
.optional(),
|
|
9
14
|
catalog: zod_1.z.string(),
|
|
10
15
|
languages: zod_1.z.string().array().min(1),
|
|
11
16
|
region: zod_1.z.string()
|
package/dist/test/data.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.testJsonData =
|
|
38
|
+
exports.testJsonData = testJsonData;
|
|
39
39
|
const at_1 = __importDefault(require("lodash/at"));
|
|
40
40
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
41
41
|
const set_1 = __importDefault(require("lodash/set"));
|
|
@@ -89,4 +89,3 @@ function testJsonData(path) {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
exports.testJsonData = testJsonData;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/demo-store-types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.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.
|
|
11
|
+
"@types/lodash": "^4.17.9",
|
|
12
12
|
"lodash": "^4.17.21",
|
|
13
13
|
"uvu": "^0.5.6",
|
|
14
|
-
"zod": "^3.
|
|
14
|
+
"zod": "^3.23.8"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"typescript": "^5.
|
|
17
|
+
"typescript": "^5.6.2"
|
|
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": "b989407d5715ea4d1832021e7ea345984d13a5b6"
|
|
29
29
|
}
|