@open-dpp/dto 0.1.3 → 0.3.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/aas/administrative-information-json-schema.d.ts +1 -1
- package/dist/aas/administrative-information-json-schema.d.ts.map +1 -1
- package/dist/aas/asset-administration-shell-json-schema.d.ts +1 -1
- package/dist/aas/asset-administration-shell-json-schema.d.ts.map +1 -1
- package/dist/aas/asset-administration-shell-json-schema.js +2 -2
- package/dist/aas/asset-information-json-schema.d.ts +1 -1
- package/dist/aas/asset-information-json-schema.d.ts.map +1 -1
- package/dist/aas/asset-information-json-schema.js +3 -1
- package/dist/aas/common/basic-json-schema.d.ts +1 -1
- package/dist/aas/common/basic-json-schema.d.ts.map +1 -1
- package/dist/aas/common/basic-json-schema.js +7 -4
- package/dist/aas/common/key-json-schema.d.ts +1 -1
- package/dist/aas/common/key-json-schema.d.ts.map +1 -1
- package/dist/aas/common/language-text-json-schema.d.ts +1 -1
- package/dist/aas/common/language-text-json-schema.d.ts.map +1 -1
- package/dist/aas/common/qualifier-json-schema.d.ts +1 -1
- package/dist/aas/common/qualifier-json-schema.d.ts.map +1 -1
- package/dist/aas/common/reference-json-schema.d.ts +3 -3
- package/dist/aas/common/reference-json-schema.d.ts.map +1 -1
- package/dist/aas/concept-description-json-schema.d.ts +1 -1
- package/dist/aas/concept-description-json-schema.d.ts.map +1 -1
- package/dist/aas/dto/value-response.dto.d.ts +1 -1
- package/dist/aas/dto/value-response.dto.d.ts.map +1 -1
- package/dist/aas/embedded-data-specification-json-schema.d.ts +1 -1
- package/dist/aas/embedded-data-specification-json-schema.d.ts.map +1 -1
- package/dist/aas/enums/aas-submodel-elements.d.ts +1 -1
- package/dist/aas/enums/aas-submodel-elements.d.ts.map +1 -1
- package/dist/aas/enums/aas-submodel-elements.js +18 -18
- package/dist/aas/enums/asset-kind-enum.d.ts +1 -1
- package/dist/aas/enums/asset-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/asset-kind-enum.js +2 -2
- package/dist/aas/enums/data-type-def.d.ts +1 -1
- package/dist/aas/enums/data-type-def.d.ts.map +1 -1
- package/dist/aas/enums/data-type-def.js +30 -30
- package/dist/aas/enums/entity-type-enum.d.ts +1 -1
- package/dist/aas/enums/entity-type-enum.d.ts.map +1 -1
- package/dist/aas/enums/entity-type-enum.js +2 -2
- package/dist/aas/enums/key-types-enum.d.ts +1 -1
- package/dist/aas/enums/key-types-enum.d.ts.map +1 -1
- package/dist/aas/enums/key-types-enum.js +24 -24
- package/dist/aas/enums/language-enum.d.ts +1 -1
- package/dist/aas/enums/language-enum.d.ts.map +1 -1
- package/dist/aas/enums/language-enum.js +2 -2
- package/dist/aas/enums/modelling-kind-enum.d.ts +1 -1
- package/dist/aas/enums/modelling-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/modelling-kind-enum.js +2 -2
- package/dist/aas/enums/permission-enum.d.ts +1 -1
- package/dist/aas/enums/permission-enum.d.ts.map +1 -1
- package/dist/aas/enums/permission-enum.js +4 -4
- package/dist/aas/enums/permission-kind-enum.d.ts +1 -1
- package/dist/aas/enums/permission-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/permission-kind-enum.js +1 -1
- package/dist/aas/enums/qualifier-kind-enum.d.ts +1 -1
- package/dist/aas/enums/qualifier-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/qualifier-kind-enum.js +3 -3
- package/dist/aas/enums/reference-types-enum.d.ts +1 -1
- package/dist/aas/enums/reference-types-enum.d.ts.map +1 -1
- package/dist/aas/enums/reference-types-enum.js +2 -2
- package/dist/aas/environment-json-schema.d.ts +1 -1
- package/dist/aas/environment-json-schema.d.ts.map +1 -1
- package/dist/aas/environment-json-schema.js +3 -1
- package/dist/aas/extension-json-schema.d.ts +1 -1
- package/dist/aas/extension-json-schema.d.ts.map +1 -1
- package/dist/aas/resource-json-schema.d.ts +1 -1
- package/dist/aas/resource-json-schema.d.ts.map +1 -1
- package/dist/aas/security/access-permission-rule.dto.d.ts +1 -1
- package/dist/aas/security/access-permission-rule.dto.d.ts.map +1 -1
- package/dist/aas/security/security.dto.d.ts +1 -1
- package/dist/aas/security/security.dto.d.ts.map +1 -1
- package/dist/aas/specific-asset-id-json-schema.d.ts +1 -1
- package/dist/aas/specific-asset-id-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.js +3 -2
- package/dist/aas/submodel-base/blob-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/blob-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/entity-type-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/entity-type-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/entity-type-json-schema.js +1 -2
- package/dist/aas/submodel-base/file-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/file-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/property-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/property-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/range-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/range-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/reference-element-json-schema.d.ts +2 -2
- package/dist/aas/submodel-base/reference-element-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/relationship-element-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/relationship-element-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-base-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-base-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-base-json-schema.js +3 -1
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.js +7 -4
- package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-list-json-schema.js +7 -4
- package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-modification-schema.js +3 -1
- package/dist/aas/submodel-base/submodel-element-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-schema.js +12 -5
- package/dist/aas/submodel-base/submodel-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-json-schema.js +5 -3
- package/dist/branding/branding.dto.d.ts +2 -1
- package/dist/branding/branding.dto.d.ts.map +1 -1
- package/dist/branding/branding.dto.js +1 -0
- package/dist/index.d.ts +58 -56
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/organizations/member.dto.d.ts +1 -1
- package/dist/organizations/member.dto.d.ts.map +1 -1
- package/dist/passports/passport.dto.d.ts +25 -1
- package/dist/passports/passport.dto.d.ts.map +1 -1
- package/dist/passports/passport.dto.js +6 -4
- package/dist/shared/digital-product-document.schemas.d.ts +81 -0
- package/dist/shared/digital-product-document.schemas.d.ts.map +1 -0
- package/dist/shared/digital-product-document.schemas.js +33 -0
- package/dist/shared/filter.dto.d.ts +10 -0
- package/dist/shared/filter.dto.d.ts.map +1 -0
- package/dist/shared/filter.dto.js +8 -0
- package/dist/shared/get-all-params.dto.d.ts +17 -0
- package/dist/shared/get-all-params.dto.d.ts.map +1 -0
- package/dist/shared/get-all-params.dto.js +12 -0
- package/dist/shared/pagination.dto.d.ts +1 -2
- package/dist/shared/pagination.dto.d.ts.map +1 -1
- package/dist/shared/pagination.dto.js +0 -2
- package/dist/shared/populate.dto.d.ts +1 -1
- package/dist/shared/populate.dto.d.ts.map +1 -1
- package/dist/shared/populate.dto.js +6 -6
- package/dist/shared/table.dto.d.ts +1 -1
- package/dist/shared/table.dto.d.ts.map +1 -1
- package/dist/status/status.dto.d.ts +1 -1
- package/dist/status/status.dto.d.ts.map +1 -1
- package/dist/templates/template.dto.d.ts +25 -1
- package/dist/templates/template.dto.d.ts.map +1 -1
- package/dist/templates/template.dto.js +6 -4
- package/dist/users/create-user.dto.d.ts +1 -1
- package/dist/users/create-user.dto.d.ts.map +1 -1
- package/dist/users/set-user-role.dto.d.ts +1 -1
- package/dist/users/set-user-role.dto.d.ts.map +1 -1
- package/dist/users/set-user-role.dto.js +1 -1
- package/dist/users/user.dto.d.ts +1 -1
- package/dist/users/user.dto.d.ts.map +1 -1
- package/dist/users/user.dto.js +5 -5
- package/package.json +23 -19
- package/src/aas/aas-json-schemas.spec.ts +68 -67
- package/src/aas/administrative-information-json-schema.ts +2 -2
- package/src/aas/asset-administration-shell-json-schema.ts +32 -24
- package/src/aas/asset-information-json-schema.ts +10 -8
- package/src/aas/common/basic-json-schema.ts +18 -15
- package/src/aas/common/key-json-schema.ts +4 -4
- package/src/aas/common/language-text-json-schema.ts +4 -4
- package/src/aas/common/qualifier-json-schema.ts +5 -5
- package/src/aas/common/reference-json-schema.ts +13 -13
- package/src/aas/concept-description-json-schema.ts +7 -7
- package/src/aas/dto/value-response.dto.spec.ts +21 -15
- package/src/aas/dto/value-response.dto.ts +4 -4
- package/src/aas/embedded-data-specification-json-schema.ts +3 -3
- package/src/aas/enums/aas-submodel-elements.ts +22 -22
- package/src/aas/enums/asset-kind-enum.ts +6 -6
- package/src/aas/enums/data-type-def.ts +34 -34
- package/src/aas/enums/entity-type-enum.ts +6 -6
- package/src/aas/enums/key-types-enum.ts +28 -28
- package/src/aas/enums/language-enum.ts +6 -6
- package/src/aas/enums/modelling-kind-enum.ts +6 -6
- package/src/aas/enums/permission-enum.ts +8 -8
- package/src/aas/enums/permission-kind-enum.ts +5 -5
- package/src/aas/enums/qualifier-kind-enum.ts +7 -7
- package/src/aas/enums/reference-types-enum.ts +6 -6
- package/src/aas/environment-json-schema.ts +8 -6
- package/src/aas/extension-json-schema.ts +4 -4
- package/src/aas/resource-json-schema.ts +2 -2
- package/src/aas/security/access-permission-rule.dto.ts +12 -12
- package/src/aas/security/security.dto.ts +10 -7
- package/src/aas/specific-asset-id-json-schema.ts +3 -3
- package/src/aas/submodel-base/annotated-relationship-element-json-schema.ts +10 -10
- package/src/aas/submodel-base/blob-json-schema.ts +4 -4
- package/src/aas/submodel-base/entity-type-json-schema.ts +9 -11
- package/src/aas/submodel-base/file-json-schema.ts +11 -8
- package/src/aas/submodel-base/multi-language-property-json-schema.ts +6 -6
- package/src/aas/submodel-base/property-json-schema.ts +13 -10
- package/src/aas/submodel-base/range-json-schema.ts +5 -5
- package/src/aas/submodel-base/reference-element-json-schema.ts +13 -10
- package/src/aas/submodel-base/relationship-element-json-schema.ts +5 -5
- package/src/aas/submodel-base/submodel-base-json-schema.ts +10 -8
- package/src/aas/submodel-base/submodel-element-collection-json-schema.ts +28 -17
- package/src/aas/submodel-base/submodel-element-list-json-schema.ts +27 -20
- package/src/aas/submodel-base/submodel-element-modification-schema.ts +6 -4
- package/src/aas/submodel-base/submodel-element-schema.ts +37 -30
- package/src/aas/submodel-base/submodel-json-schema.ts +28 -25
- package/src/branding/branding.dto.ts +4 -3
- package/src/index.ts +59 -56
- package/src/organizations/member.dto.ts +8 -8
- package/src/passports/passport.dto.ts +16 -14
- package/src/shared/digital-product-document.schemas.ts +52 -0
- package/src/shared/filter.dto.ts +8 -0
- package/src/shared/get-all-params.dto.ts +12 -0
- package/src/shared/pagination.dto.ts +5 -7
- package/src/shared/populate.dto.ts +8 -11
- package/src/shared/table.dto.ts +3 -3
- package/src/status/status.dto.ts +3 -3
- package/src/templates/template.dto.ts +15 -13
- package/src/users/create-user.dto.ts +3 -3
- package/src/users/set-user-role.dto.ts +4 -4
- package/src/users/user.dto.ts +19 -19
- package/dist/shared/dpp.schemas.d.ts +0 -28
- package/dist/shared/dpp.schemas.d.ts.map +0 -1
- package/dist/shared/dpp.schemas.js +0 -13
- package/src/shared/dpp.schemas.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-user-role.dto.d.ts","sourceRoot":"","sources":["../../src/users/set-user-role.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"set-user-role.dto.d.ts","sourceRoot":"","sources":["../../src/users/set-user-role.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;iBAE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SetUserRoleDtoSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.SetUserRoleDtoSchema = zod_1.z.object({
|
|
6
|
-
role: zod_1.z.enum([
|
|
6
|
+
role: zod_1.z.enum(["admin", "user"]),
|
|
7
7
|
});
|
package/dist/users/user.dto.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.dto.d.ts","sourceRoot":"","sources":["../../src/users/user.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"user.dto.d.ts","sourceRoot":"","sources":["../../src/users/user.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,eAAO,MAAM,eAAe;;;;EAAsB,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;EAAwB,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/users/user.dto.js
CHANGED
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MemberRoleDtoEnum = exports.MemberRoleDto = exports.UserRoleDtoEnum = exports.UserRoleDto = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.UserRoleDto = {
|
|
6
|
-
ADMIN:
|
|
7
|
-
USER:
|
|
8
|
-
ANONYMOUS:
|
|
6
|
+
ADMIN: "admin", // That is the super admin over all organizations
|
|
7
|
+
USER: "user",
|
|
8
|
+
ANONYMOUS: "anonymous",
|
|
9
9
|
};
|
|
10
10
|
exports.UserRoleDtoEnum = zod_1.z.enum(exports.UserRoleDto);
|
|
11
11
|
exports.MemberRoleDto = {
|
|
12
|
-
OWNER:
|
|
13
|
-
MEMBER:
|
|
12
|
+
OWNER: "owner",
|
|
13
|
+
MEMBER: "member",
|
|
14
14
|
};
|
|
15
15
|
exports.MemberRoleDtoEnum = zod_1.z.enum(exports.MemberRoleDto);
|
package/package.json
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-dpp/dto",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
6
|
-
},
|
|
3
|
+
"version": "0.3.0",
|
|
7
4
|
"description": "",
|
|
8
|
-
"author": "",
|
|
9
|
-
"license": "ISC",
|
|
10
5
|
"keywords": [],
|
|
6
|
+
"homepage": "https://github.com/open-dpp/open-dpp#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/open-dpp/open-dpp/issues"
|
|
9
|
+
},
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"author": "",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/open-dpp/open-dpp.git",
|
|
15
|
+
"directory": "packages/dto"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./src/index.ts",
|
|
11
24
|
"exports": {
|
|
12
25
|
".": {
|
|
13
26
|
"types": "./src/index.ts",
|
|
@@ -15,13 +28,9 @@
|
|
|
15
28
|
},
|
|
16
29
|
"./package.json": "./package.json"
|
|
17
30
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"src"
|
|
24
|
-
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
25
34
|
"dependencies": {
|
|
26
35
|
"uuid": "^13.0.0",
|
|
27
36
|
"zod": "^4.3.6"
|
|
@@ -32,17 +41,12 @@
|
|
|
32
41
|
"@tsconfig/node-lts": "^24.0.0",
|
|
33
42
|
"@tsconfig/node-ts": "^23.6.1",
|
|
34
43
|
"@types/jest": "^30.0.0",
|
|
35
|
-
"eslint": "^9.38.0",
|
|
36
|
-
"globals": "^16.4.0",
|
|
37
44
|
"jest": "^30.2.0",
|
|
38
|
-
"typescript": "^5.9.3"
|
|
39
|
-
"@open-dpp/config-eslint": "0.1.3"
|
|
45
|
+
"typescript": "^5.9.3"
|
|
40
46
|
},
|
|
41
47
|
"scripts": {
|
|
42
48
|
"build": "tsc --project tsconfig.build.json",
|
|
43
49
|
"check-ts": "tsc --noEmit",
|
|
44
|
-
"lint": "eslint",
|
|
45
|
-
"lint:fix": "eslint --fix",
|
|
46
50
|
"test": "jest"
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -1,145 +1,146 @@
|
|
|
1
|
-
import { expect } from
|
|
2
|
-
import { z } from
|
|
3
|
-
import { DataTypeDef } from
|
|
1
|
+
import { expect } from "@jest/globals";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DataTypeDef } from "./enums/data-type-def";
|
|
4
4
|
|
|
5
|
-
import { SubmodelElementSchema } from
|
|
5
|
+
import { SubmodelElementSchema } from "./submodel-base/submodel-element-schema";
|
|
6
6
|
|
|
7
|
-
describe(
|
|
8
|
-
it(
|
|
7
|
+
describe("zod-schemas", () => {
|
|
8
|
+
it("should parse discriminated union correctly", () => {
|
|
9
9
|
const schema = z.object({
|
|
10
10
|
submodels: SubmodelElementSchema.array(),
|
|
11
|
-
})
|
|
11
|
+
});
|
|
12
12
|
|
|
13
13
|
const submodels = [
|
|
14
14
|
{
|
|
15
|
-
modelType:
|
|
16
|
-
idShort:
|
|
15
|
+
modelType: "Property",
|
|
16
|
+
idShort: "test",
|
|
17
17
|
valueType: DataTypeDef.Double,
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
modelType:
|
|
21
|
-
entityType:
|
|
20
|
+
modelType: "Entity",
|
|
21
|
+
entityType: "CoManagedEntity",
|
|
22
22
|
statements: [
|
|
23
23
|
{
|
|
24
|
-
modelType:
|
|
25
|
-
entityType:
|
|
24
|
+
modelType: "Entity",
|
|
25
|
+
entityType: "CoManagedEntity",
|
|
26
26
|
statements: [
|
|
27
27
|
{
|
|
28
|
-
modelType:
|
|
29
|
-
value:
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
modelType: "Property",
|
|
29
|
+
value:
|
|
30
|
+
"http://shells.smartfactory.de/aHR0cHM6Ly9zbWFydGZhY3RvcnkuZGUvc2hlbGxzLy1TUjdCYm5jSkc",
|
|
31
|
+
valueType: "xs:string",
|
|
32
|
+
category: "CONSTANT",
|
|
32
33
|
description: [
|
|
33
34
|
{
|
|
34
|
-
language:
|
|
35
|
-
text:
|
|
35
|
+
language: "en",
|
|
36
|
+
text: "URL of the application",
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
|
-
language:
|
|
39
|
-
text:
|
|
39
|
+
language: "de",
|
|
40
|
+
text: "URL der Anwendung",
|
|
40
41
|
},
|
|
41
42
|
],
|
|
42
|
-
idShort:
|
|
43
|
+
idShort: "ApplicationURL",
|
|
43
44
|
},
|
|
44
45
|
],
|
|
45
46
|
semanticId: {
|
|
46
47
|
keys: [
|
|
47
48
|
{
|
|
48
|
-
type:
|
|
49
|
-
value:
|
|
49
|
+
type: "GlobalReference",
|
|
50
|
+
value: "https://admin-shell.io/idta/HierarchicalStructures/Node/1/0",
|
|
50
51
|
},
|
|
51
52
|
],
|
|
52
|
-
type:
|
|
53
|
+
type: "ExternalReference",
|
|
53
54
|
},
|
|
54
55
|
description: [
|
|
55
56
|
{
|
|
56
|
-
language:
|
|
57
|
-
text:
|
|
57
|
+
language: "en",
|
|
58
|
+
text: "SmartFactoryKL ShellScape",
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
|
-
language:
|
|
61
|
-
text:
|
|
61
|
+
language: "de",
|
|
62
|
+
text: "SmartFactoryKL ShellScape",
|
|
62
63
|
},
|
|
63
64
|
],
|
|
64
|
-
idShort:
|
|
65
|
+
idShort: "SmartFactoryShellScape",
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
|
-
modelType:
|
|
68
|
-
entityType:
|
|
68
|
+
modelType: "Entity",
|
|
69
|
+
entityType: "CoManagedEntity",
|
|
69
70
|
statements: [
|
|
70
71
|
{
|
|
71
|
-
modelType:
|
|
72
|
-
value:
|
|
73
|
-
valueType:
|
|
74
|
-
category:
|
|
72
|
+
modelType: "Property",
|
|
73
|
+
value: "https://oncite.apps.c01.demo.oncite.io/core/productionview/#/workorder",
|
|
74
|
+
valueType: "xs:string",
|
|
75
|
+
category: "CONSTANT",
|
|
75
76
|
description: [
|
|
76
77
|
{
|
|
77
|
-
language:
|
|
78
|
-
text:
|
|
78
|
+
language: "en",
|
|
79
|
+
text: "URL of the application",
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
|
-
language:
|
|
82
|
-
text:
|
|
82
|
+
language: "de",
|
|
83
|
+
text: "URL der Anwendung",
|
|
83
84
|
},
|
|
84
85
|
],
|
|
85
|
-
idShort:
|
|
86
|
+
idShort: "ApplicationURL",
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
|
-
modelType:
|
|
89
|
-
value:
|
|
90
|
-
valueType:
|
|
91
|
-
category:
|
|
89
|
+
modelType: "Property",
|
|
90
|
+
value: "https://oncite.apps.c01.demo.oncite.io/hmi/#/workorder-list",
|
|
91
|
+
valueType: "xs:string",
|
|
92
|
+
category: "CONSTANT",
|
|
92
93
|
description: [
|
|
93
94
|
{
|
|
94
|
-
language:
|
|
95
|
-
text:
|
|
95
|
+
language: "en",
|
|
96
|
+
text: "URL of the digital production system hmi client",
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
|
-
language:
|
|
99
|
-
text:
|
|
99
|
+
language: "de",
|
|
100
|
+
text: "URL des HMI Clients des digitalen Produktionssystem",
|
|
100
101
|
},
|
|
101
102
|
],
|
|
102
|
-
idShort:
|
|
103
|
+
idShort: "HMI_Client",
|
|
103
104
|
},
|
|
104
105
|
],
|
|
105
106
|
semanticId: {
|
|
106
107
|
keys: [
|
|
107
108
|
{
|
|
108
|
-
type:
|
|
109
|
-
value:
|
|
109
|
+
type: "GlobalReference",
|
|
110
|
+
value: "https://admin-shell.io/idta/HierarchicalStructures/Node/1/0",
|
|
110
111
|
},
|
|
111
112
|
],
|
|
112
|
-
type:
|
|
113
|
+
type: "ExternalReference",
|
|
113
114
|
},
|
|
114
115
|
description: [
|
|
115
116
|
{
|
|
116
|
-
language:
|
|
117
|
-
text:
|
|
117
|
+
language: "en",
|
|
118
|
+
text: "DigitalProductionSystem (German Edge Cloud)",
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
|
-
language:
|
|
121
|
-
text:
|
|
121
|
+
language: "de",
|
|
122
|
+
text: "DigitalProductionSystem (German Edge Cloud)",
|
|
122
123
|
},
|
|
123
124
|
],
|
|
124
|
-
idShort:
|
|
125
|
+
idShort: "DigitalProductionSystem",
|
|
125
126
|
},
|
|
126
127
|
],
|
|
127
128
|
semanticId: {
|
|
128
129
|
keys: [
|
|
129
130
|
{
|
|
130
|
-
type:
|
|
131
|
-
value:
|
|
131
|
+
type: "GlobalReference",
|
|
132
|
+
value: "https://admin-shell.io/idta/HierarchicalStructures/EntryNode/1/0",
|
|
132
133
|
},
|
|
133
134
|
],
|
|
134
|
-
type:
|
|
135
|
+
type: "ExternalReference",
|
|
135
136
|
},
|
|
136
|
-
idShort:
|
|
137
|
+
idShort: "BillOfApplications",
|
|
137
138
|
},
|
|
138
|
-
]
|
|
139
|
+
];
|
|
139
140
|
|
|
140
141
|
const parsed = schema.safeParse({
|
|
141
142
|
submodels,
|
|
142
|
-
})
|
|
143
|
-
expect(parsed.success).toBeTruthy()
|
|
144
|
-
})
|
|
145
|
-
})
|
|
143
|
+
});
|
|
144
|
+
expect(parsed.success).toBeTruthy();
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { PagingMetadataDtoSchema } from
|
|
3
|
-
import { AdministrativeInformationJsonSchema } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PagingMetadataDtoSchema } from "../shared/pagination.dto";
|
|
3
|
+
import { AdministrativeInformationJsonSchema } from "./administrative-information-json-schema";
|
|
4
|
+
import {
|
|
5
|
+
AssetInformationJsonSchema,
|
|
6
|
+
AssetInformationModificationSchema,
|
|
7
|
+
} from "./asset-information-json-schema";
|
|
8
|
+
import { NameAndDescriptionModificationSchema } from "./common/basic-json-schema";
|
|
9
|
+
import { LanguageTextJsonSchema } from "./common/language-text-json-schema";
|
|
10
|
+
import { ReferenceJsonSchema } from "./common/reference-json-schema";
|
|
11
|
+
import { EmbeddedDataSpecificationJsonSchema } from "./embedded-data-specification-json-schema";
|
|
12
|
+
import { ExtensionJsonSchema } from "./extension-json-schema";
|
|
13
|
+
import { ResourceJsonSchema } from "./resource-json-schema";
|
|
14
|
+
import { SecurityDtoSchema } from "./security/security.dto";
|
|
12
15
|
|
|
13
16
|
export const AssetAdministrationShellJsonSchema = z.object({
|
|
14
|
-
id: z.string().meta({ description:
|
|
17
|
+
id: z.string().meta({ description: "Id of the AAS" }),
|
|
15
18
|
assetInformation: AssetInformationJsonSchema,
|
|
16
19
|
extensions: ExtensionJsonSchema.array().default([]),
|
|
17
20
|
category: z.nullish(z.string()),
|
|
@@ -23,30 +26,35 @@ export const AssetAdministrationShellJsonSchema = z.object({
|
|
|
23
26
|
derivedFrom: z.nullish(ResourceJsonSchema),
|
|
24
27
|
submodels: ReferenceJsonSchema.array().default([]),
|
|
25
28
|
security: SecurityDtoSchema,
|
|
26
|
-
})
|
|
29
|
+
});
|
|
27
30
|
export const AssetAdministrationShellPaginationResponseDtoSchema = z
|
|
28
31
|
.object({
|
|
29
32
|
...PagingMetadataDtoSchema.shape,
|
|
30
33
|
result: AssetAdministrationShellJsonSchema.array(),
|
|
31
34
|
})
|
|
32
|
-
.meta({ id:
|
|
35
|
+
.meta({ id: "AssetAdministrationShells" });
|
|
33
36
|
export type AssetAdministrationShellPaginationResponseDto = z.infer<
|
|
34
37
|
typeof AssetAdministrationShellPaginationResponseDtoSchema
|
|
35
|
-
|
|
38
|
+
>;
|
|
36
39
|
export const AssetAdministrationShellCreateDtoSchema = AssetAdministrationShellJsonSchema.pick({
|
|
37
40
|
displayName: true,
|
|
38
41
|
description: true,
|
|
39
|
-
})
|
|
40
|
-
export type AssetAdministrationShellCreateDto = z.input<
|
|
41
|
-
|
|
42
|
+
});
|
|
43
|
+
export type AssetAdministrationShellCreateDto = z.input<
|
|
44
|
+
typeof AssetAdministrationShellCreateDtoSchema
|
|
45
|
+
>;
|
|
46
|
+
export type AssetAdministrationShellResponseDto = z.infer<
|
|
47
|
+
typeof AssetAdministrationShellJsonSchema
|
|
48
|
+
>;
|
|
42
49
|
|
|
43
|
-
export type AssetAdministrationShellRequestDto = z.input<typeof AssetAdministrationShellJsonSchema
|
|
50
|
+
export type AssetAdministrationShellRequestDto = z.input<typeof AssetAdministrationShellJsonSchema>;
|
|
44
51
|
|
|
45
|
-
export const AssetAdministrationShellModificationSchema =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
export const AssetAdministrationShellModificationSchema =
|
|
53
|
+
NameAndDescriptionModificationSchema.extend({
|
|
54
|
+
assetInformation: AssetInformationModificationSchema.optional(),
|
|
55
|
+
security: SecurityDtoSchema.optional(),
|
|
56
|
+
});
|
|
49
57
|
|
|
50
58
|
export type AssetAdministrationShellModificationDto = z.infer<
|
|
51
59
|
typeof AssetAdministrationShellModificationSchema
|
|
52
|
-
|
|
60
|
+
>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { AssetKindEnum } from
|
|
3
|
-
import { ResourceJsonSchema } from
|
|
4
|
-
import { SpecificAssetIdJsonSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AssetKindEnum } from "./enums/asset-kind-enum";
|
|
3
|
+
import { ResourceJsonSchema } from "./resource-json-schema";
|
|
4
|
+
import { SpecificAssetIdJsonSchema } from "./specific-asset-id-json-schema";
|
|
5
5
|
|
|
6
6
|
export const AssetInformationJsonSchema = z.object({
|
|
7
7
|
assetKind: AssetKindEnum,
|
|
@@ -9,10 +9,12 @@ export const AssetInformationJsonSchema = z.object({
|
|
|
9
9
|
specificAssetIds: SpecificAssetIdJsonSchema.array().default([]),
|
|
10
10
|
assetType: z.nullish(z.string()),
|
|
11
11
|
defaultThumbnails: ResourceJsonSchema.array().default([]),
|
|
12
|
-
})
|
|
12
|
+
});
|
|
13
13
|
|
|
14
|
-
export type AssetInformationDto = z.infer<typeof AssetInformationJsonSchema
|
|
14
|
+
export type AssetInformationDto = z.infer<typeof AssetInformationJsonSchema>;
|
|
15
15
|
|
|
16
|
-
export const AssetInformationModificationSchema = AssetInformationJsonSchema.pick({
|
|
16
|
+
export const AssetInformationModificationSchema = AssetInformationJsonSchema.pick({
|
|
17
|
+
defaultThumbnails: true,
|
|
18
|
+
}).partial();
|
|
17
19
|
|
|
18
|
-
export type AssetInformationModificationDto = z.input<typeof AssetInformationModificationSchema
|
|
20
|
+
export type AssetInformationModificationDto = z.input<typeof AssetInformationModificationSchema>;
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { DataTypeDef, DataTypeDefEnum } from
|
|
3
|
-
import { LanguageTextJsonSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DataTypeDef, DataTypeDefEnum } from "../enums/data-type-def";
|
|
3
|
+
import { LanguageTextJsonSchema } from "./language-text-json-schema";
|
|
4
4
|
|
|
5
|
-
export const ValueTypeSchema = z
|
|
6
|
-
(
|
|
5
|
+
export const ValueTypeSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.overwrite((value) => {
|
|
7
8
|
// turn "positiveInteger" → "PositiveInteger"
|
|
8
|
-
let key = value
|
|
9
|
-
if (value.startsWith(
|
|
10
|
-
const raw = value.replace(/^xs:/,
|
|
11
|
-
key = raw.charAt(0).toUpperCase() + raw.slice(1)
|
|
9
|
+
let key = value;
|
|
10
|
+
if (value.startsWith("xs:")) {
|
|
11
|
+
const raw = value.replace(/^xs:/, "");
|
|
12
|
+
key = raw.charAt(0).toUpperCase() + raw.slice(1);
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
// validate against enum
|
|
15
16
|
if (!(key in DataTypeDef)) {
|
|
16
|
-
throw new Error(`Unknown number type: ${value}`)
|
|
17
|
+
throw new Error(`Unknown number type: ${value}`);
|
|
17
18
|
}
|
|
18
|
-
return key
|
|
19
|
-
}
|
|
20
|
-
|
|
19
|
+
return key;
|
|
20
|
+
})
|
|
21
|
+
.pipe(DataTypeDefEnum);
|
|
21
22
|
|
|
22
23
|
export const NameAndDescriptionModificationSchema = z.object({
|
|
23
24
|
displayName: LanguageTextJsonSchema.array().optional(),
|
|
24
25
|
description: LanguageTextJsonSchema.array().optional(),
|
|
25
|
-
})
|
|
26
|
+
});
|
|
26
27
|
|
|
27
|
-
export type NameAndDescriptionModificationDto = z.infer<
|
|
28
|
+
export type NameAndDescriptionModificationDto = z.infer<
|
|
29
|
+
typeof NameAndDescriptionModificationSchema
|
|
30
|
+
>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
import { KeyTypesEnum } from
|
|
3
|
+
import { KeyTypesEnum } from "../enums/key-types-enum";
|
|
4
4
|
|
|
5
5
|
export const KeyJsonSchema = z.object({
|
|
6
6
|
type: KeyTypesEnum,
|
|
7
7
|
value: z.string(),
|
|
8
|
-
})
|
|
8
|
+
});
|
|
9
9
|
|
|
10
|
-
export const KeyModificationSchema = KeyJsonSchema
|
|
10
|
+
export const KeyModificationSchema = KeyJsonSchema;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
import { LanguageEnum } from
|
|
3
|
+
import { LanguageEnum } from "../enums/language-enum";
|
|
4
4
|
|
|
5
5
|
export const LanguageTextJsonSchema = z.object({
|
|
6
6
|
language: LanguageEnum,
|
|
7
7
|
text: z.string(),
|
|
8
|
-
})
|
|
8
|
+
});
|
|
9
9
|
|
|
10
|
-
export type LanguageTextDto = z.infer<typeof LanguageTextJsonSchema
|
|
10
|
+
export type LanguageTextDto = z.infer<typeof LanguageTextJsonSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { QualifierKindEnum } from
|
|
3
|
-
import { ValueTypeSchema } from
|
|
4
|
-
import { ReferenceJsonSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { QualifierKindEnum } from "../enums/qualifier-kind-enum";
|
|
3
|
+
import { ValueTypeSchema } from "./basic-json-schema";
|
|
4
|
+
import { ReferenceJsonSchema } from "./reference-json-schema";
|
|
5
5
|
|
|
6
6
|
export const QualifierJsonSchema = z.object({
|
|
7
7
|
type: z.string(),
|
|
@@ -11,4 +11,4 @@ export const QualifierJsonSchema = z.object({
|
|
|
11
11
|
kind: QualifierKindEnum,
|
|
12
12
|
value: z.string().nullish(),
|
|
13
13
|
valueId: ReferenceJsonSchema.nullish(),
|
|
14
|
-
})
|
|
14
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { KeyTypesType } from
|
|
2
|
-
import type { ReferenceTypesType } from
|
|
3
|
-
import { z } from
|
|
4
|
-
import { ReferenceTypesEnum } from
|
|
5
|
-
import { KeyJsonSchema, KeyModificationSchema } from
|
|
1
|
+
import type { KeyTypesType } from "../enums/key-types-enum";
|
|
2
|
+
import type { ReferenceTypesType } from "../enums/reference-types-enum";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ReferenceTypesEnum } from "../enums/reference-types-enum";
|
|
5
|
+
import { KeyJsonSchema, KeyModificationSchema } from "./key-json-schema";
|
|
6
6
|
|
|
7
7
|
export const ReferenceJsonSchema: z.ZodType<any> = z.lazy(() =>
|
|
8
8
|
z.object({
|
|
@@ -10,18 +10,18 @@ export const ReferenceJsonSchema: z.ZodType<any> = z.lazy(() =>
|
|
|
10
10
|
referredSemanticId: ReferenceJsonSchema.nullish(),
|
|
11
11
|
keys: z.array(KeyJsonSchema),
|
|
12
12
|
}),
|
|
13
|
-
)
|
|
13
|
+
);
|
|
14
14
|
|
|
15
15
|
export interface ReferenceValue {
|
|
16
|
-
type: ReferenceTypesType
|
|
17
|
-
referredSemanticId: ReferenceValue | null
|
|
18
|
-
keys: { type: KeyTypesType
|
|
16
|
+
type: ReferenceTypesType;
|
|
17
|
+
referredSemanticId: ReferenceValue | null;
|
|
18
|
+
keys: { type: KeyTypesType; value: string }[];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface ReferenceModification {
|
|
22
|
-
type?: ReferenceTypesType
|
|
23
|
-
referredSemanticId?: ReferenceModification | null
|
|
24
|
-
keys?: { type: KeyTypesType
|
|
22
|
+
type?: ReferenceTypesType;
|
|
23
|
+
referredSemanticId?: ReferenceModification | null;
|
|
24
|
+
keys?: { type: KeyTypesType; value: string }[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const ReferenceModificationSchema: z.ZodType<ReferenceModification> = z.lazy(() =>
|
|
@@ -30,4 +30,4 @@ export const ReferenceModificationSchema: z.ZodType<ReferenceModification> = z.l
|
|
|
30
30
|
referredSemanticId: ReferenceModificationSchema.nullish(),
|
|
31
31
|
keys: z.array(KeyModificationSchema).optional(),
|
|
32
32
|
}),
|
|
33
|
-
)
|
|
33
|
+
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { AdministrativeInformationJsonSchema } from
|
|
3
|
-
import { LanguageTextJsonSchema } from
|
|
4
|
-
import { ReferenceJsonSchema } from
|
|
5
|
-
import { EmbeddedDataSpecificationJsonSchema } from
|
|
6
|
-
import { ExtensionJsonSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AdministrativeInformationJsonSchema } from "./administrative-information-json-schema";
|
|
3
|
+
import { LanguageTextJsonSchema } from "./common/language-text-json-schema";
|
|
4
|
+
import { ReferenceJsonSchema } from "./common/reference-json-schema";
|
|
5
|
+
import { EmbeddedDataSpecificationJsonSchema } from "./embedded-data-specification-json-schema";
|
|
6
|
+
import { ExtensionJsonSchema } from "./extension-json-schema";
|
|
7
7
|
|
|
8
8
|
export const ConceptDescriptionJsonSchema = z.object({
|
|
9
9
|
id: z.string(),
|
|
@@ -16,4 +16,4 @@ export const ConceptDescriptionJsonSchema = z.object({
|
|
|
16
16
|
administration: z.nullish(AdministrativeInformationJsonSchema),
|
|
17
17
|
embeddedDataSpecifications: EmbeddedDataSpecificationJsonSchema.array().default([]),
|
|
18
18
|
isCaseOf: ReferenceJsonSchema.array().default([]),
|
|
19
|
-
})
|
|
19
|
+
});
|