@tonytang99/integration-canonical 1.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/README.md +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/product.d.ts +63 -0
- package/dist/product.d.ts.map +1 -0
- package/dist/product.js +19 -0
- package/dist/product.js.map +1 -0
- package/package.json +25 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./product"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MoneySchema: z.ZodObject<{
|
|
3
|
+
amount: z.ZodNumber;
|
|
4
|
+
currency: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
amount: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
}, {
|
|
9
|
+
amount: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const CanonicalProductSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
sku: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
price: z.ZodObject<{
|
|
17
|
+
amount: z.ZodNumber;
|
|
18
|
+
currency: z.ZodString;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
amount: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
}, {
|
|
23
|
+
amount: number;
|
|
24
|
+
currency: string;
|
|
25
|
+
}>;
|
|
26
|
+
inventory: z.ZodObject<{
|
|
27
|
+
quantity: z.ZodNumber;
|
|
28
|
+
tracked: z.ZodBoolean;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
quantity: number;
|
|
31
|
+
tracked: boolean;
|
|
32
|
+
}, {
|
|
33
|
+
quantity: number;
|
|
34
|
+
tracked: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
id: string;
|
|
38
|
+
sku: string;
|
|
39
|
+
name: string;
|
|
40
|
+
price: {
|
|
41
|
+
amount: number;
|
|
42
|
+
currency: string;
|
|
43
|
+
};
|
|
44
|
+
inventory: {
|
|
45
|
+
quantity: number;
|
|
46
|
+
tracked: boolean;
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
id: string;
|
|
50
|
+
sku: string;
|
|
51
|
+
name: string;
|
|
52
|
+
price: {
|
|
53
|
+
amount: number;
|
|
54
|
+
currency: string;
|
|
55
|
+
};
|
|
56
|
+
inventory: {
|
|
57
|
+
quantity: number;
|
|
58
|
+
tracked: boolean;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
export type Money = z.infer<typeof MoneySchema>;
|
|
62
|
+
export type CanonicalProduct = z.infer<typeof CanonicalProductSchema>;
|
|
63
|
+
//# sourceMappingURL=product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../src/product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW;;;;;;;;;EAGtB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjC,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/product.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CanonicalProductSchema = exports.MoneySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.MoneySchema = zod_1.z.object({
|
|
6
|
+
amount: zod_1.z.number().int(),
|
|
7
|
+
currency: zod_1.z.string().length(3),
|
|
8
|
+
});
|
|
9
|
+
exports.CanonicalProductSchema = zod_1.z.object({
|
|
10
|
+
id: zod_1.z.string(),
|
|
11
|
+
sku: zod_1.z.string(),
|
|
12
|
+
name: zod_1.z.string(),
|
|
13
|
+
price: exports.MoneySchema,
|
|
14
|
+
inventory: zod_1.z.object({
|
|
15
|
+
quantity: zod_1.z.number().int(),
|
|
16
|
+
tracked: zod_1.z.boolean(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../src/product.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACxB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,mBAAW;IAClB,SAAS,EAAE,OAAC,CAAC,MAAM,CAAC;QAClB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QAC1B,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;KACrB,CAAC;CACH,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tonytang99/integration-canonical",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Canonical data models for integration platform",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"prepublishOnly": "npm run build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["integration", "canonical", "schema"],
|
|
14
|
+
"author": "tonytang99",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"zod": "^3.22.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"typescript": "^5.2.0"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
}
|
|
25
|
+
}
|