From 2d4b2aae795454104010969501ca34ad56d75bed Mon Sep 17 00:00:00 2001 From: Ralf Aron Date: Fri, 22 Mar 2024 08:17:34 +0100 Subject: [PATCH] fix; aas types updated --- package-lock.json | 964 ++++++++++++++---- package.json | 2 +- .../submodel-template/submodel-template.ts | 2 +- .../opertation-call-form.component.spec.ts | 33 +- .../edit-element-form.component.ts | 6 +- .../aas/edit-element-form.component.spec.ts | 2 - .../src/app/aas-provider/aas-provider.ts | 14 +- .../src/app/packages/aas-package.ts | 14 +- .../packages/aas-server/aas-server-package.ts | 10 +- .../packages/file-system/aasx-directory.ts | 2 +- .../app/packages/file-system/aasx-package.ts | 27 +- .../src/app/packages/json-reader-v2.ts | 10 +- .../src/app/packages/json-reader.ts | 31 +- .../src/app/packages/json-writer-v2.ts | 7 +- .../src/app/packages/json-writer.ts | 11 +- .../src/app/packages/opcua/opcua-package.ts | 8 +- .../src/app/packages/opcua/opcua-reader.ts | 7 +- .../src/app/packages/opcua/opcua.ts | 2 +- .../src/app/packages/xml-reader-v1.ts | 17 +- .../aas-server/src/app/packages/xml-reader.ts | 32 +- .../src/app/packages/xml-reader_v2.ts | 17 +- .../aas-server/src/app/packages/xml-writer.ts | 37 +- .../src/app/template/template-scan.ts | 2 +- .../src/app/template/template-storage.ts | 2 +- projects/aas-server/src/app/types/aas-v2.ts | 11 +- projects/common/src/lib/aas.ts | 350 ++++--- projects/common/src/lib/document.ts | 30 +- 27 files changed, 1123 insertions(+), 527 deletions(-) diff --git a/package-lock.json b/package-lock.json index f9b8875d..c0cc1565 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aas-portal-project", - "version": "3.0.0-development.26", + "version": "3.0.0-development.39", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "aas-portal-project", - "version": "3.0.0-development.26", + "version": "3.0.0-development.39", "license": "Apache-2.0", "workspaces": [ "./projects/common", @@ -118,7 +118,7 @@ "semantic-release": "^23.0.2", "supertest": "^6.3.4", "ts-jest": "^29.1.2", - "ts-node": "^10.9.2", + "tsx": "^4.7.1", "typescript": "^5.2.2" } }, @@ -2572,6 +2572,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -2584,6 +2586,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -6303,25 +6307,33 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsoa/cli": { "version": "6.0.1", @@ -7849,6 +7861,8 @@ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=0.4.0" } @@ -8047,7 +8061,9 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/argparse": { "version": "1.0.10", @@ -8197,15 +8213,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, "node_modules/axobject-query": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", @@ -10059,7 +10066,9 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/critters": { "version": "0.0.20", @@ -10520,6 +10529,8 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=0.3.1" } @@ -12175,6 +12186,7 @@ "version": "1.15.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "dev": true, "funding": [ { "type": "individual", @@ -12425,6 +12437,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -25161,6 +25185,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve-url-loader": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz", @@ -27507,6 +27540,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -27628,6 +27663,431 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/tsx": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", + "integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==", + "dev": true, + "dependencies": { + "esbuild": "~0.19.10", + "get-tsconfig": "^4.7.2" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, "node_modules/tsyringe": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.8.0.tgz", @@ -28017,7 +28477,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", @@ -29400,6 +29862,8 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=6" } @@ -29483,108 +29947,26 @@ "jszip": "^3.10.1", "lodash-es": "^4.17.21", "lowdb": "^7.0.1", - "mongoose": "^8.0.3", + "mongoose": "^8.1.2", "morgan": "^1.10.0", "multer": "^1.4.5-lts.1", - "mysql2": "^3.7.0", - "node-opcua": "^2.119.2", - "node-opcua-client-crawler": "^2.119.2", - "nodemailer": "^6.9.8", + "mysql2": "^3.9.1", + "node-opcua": "^2.120.0", + "node-opcua-client-crawler": "^2.120.0", + "nodemailer": "^6.9.9", "reflect-metadata": "^0.2.1", "swagger-ui-express": "^5.0.0", "tslib": "^2.6.2", - "tsoa": "^6.0.0", + "tsoa": "^6.0.1", "tsyringe": "^4.8.0", - "uuid": "^8.3.2", - "webdav": "^4.10.0", + "uuid": "^9.0.1", + "webdav": "^5.3.2", "winston": "^3.11.0", - "winston-daily-rotate-file": "^4.7.1", + "winston-daily-rotate-file": "^5.0.0", "ws": "^8.16.0", "xpath": "^0.0.34" } }, - "projects/aas-server/node_modules/hot-patcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hot-patcher/-/hot-patcher-1.0.0.tgz", - "integrity": "sha512-3H8VH0PreeNsKMZw16nTHbUp4YoHCnPlawpsPXGJUR4qENDynl79b6Xk9CIFvLcH1qungBsCuzKcWyzoPPalTw==" - }, - "projects/aas-server/node_modules/layerr": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/layerr/-/layerr-0.1.2.tgz", - "integrity": "sha512-ob5kTd9H3S4GOG2nVXyQhOu9O8nBgP555XxWPkJI0tR0JeRilfyTp8WtPdIJHLXBmHMSdEq5+KMxiYABeScsIQ==" - }, - "projects/aas-server/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "projects/aas-server/node_modules/object-hash": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", - "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==", - "engines": { - "node": ">= 6" - } - }, - "projects/aas-server/node_modules/url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" - }, - "projects/aas-server/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "projects/aas-server/node_modules/webdav": { - "version": "4.11.3", - "resolved": "https://registry.npmjs.org/webdav/-/webdav-4.11.3.tgz", - "integrity": "sha512-NIuREBXYo5xb+zB4zy502snynbhugWjepg5Oke0ByEb7J/Ofmbk+JgFYM+sZdnKG3+XQ87rictDIF+SHUJkwlg==", - "dependencies": { - "axios": "^0.27.2", - "base-64": "^1.0.0", - "byte-length": "^1.0.2", - "fast-xml-parser": "^4.2.4", - "he": "^1.2.0", - "hot-patcher": "^1.0.0", - "layerr": "^0.1.2", - "md5": "^2.3.0", - "minimatch": "^5.1.0", - "nested-property": "^4.0.0", - "path-posix": "^1.0.0", - "url-join": "^4.0.1", - "url-parse": "^1.5.10" - }, - "engines": { - "node": ">=10" - } - }, - "projects/aas-server/node_modules/winston-daily-rotate-file": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.7.1.tgz", - "integrity": "sha512-7LGPiYGBPNyGHLn9z33i96zx/bd71pjBn9tqQzO3I4Tayv94WPmBNwKC7CO1wPHdP9uvu+Md/1nr6VSH9h0iaA==", - "dependencies": { - "file-stream-rotator": "^0.6.1", - "object-hash": "^2.0.1", - "triple-beam": "^1.3.0", - "winston-transport": "^4.4.0" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "winston": "^3" - } - }, "projects/common": { "version": "3.0.0", "license": "Apache-2.0", @@ -31263,6 +31645,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -31272,6 +31656,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -33827,25 +34213,33 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "@tsoa/cli": { "version": "6.0.1", @@ -35067,90 +35461,24 @@ "jszip": "^3.10.1", "lodash-es": "^4.17.21", "lowdb": "^7.0.1", - "mongoose": "^8.0.3", + "mongoose": "^8.1.2", "morgan": "^1.10.0", "multer": "^1.4.5-lts.1", - "mysql2": "^3.7.0", - "node-opcua": "^2.119.2", - "node-opcua-client-crawler": "^2.119.2", - "nodemailer": "^6.9.8", + "mysql2": "^3.9.1", + "node-opcua": "^2.120.0", + "node-opcua-client-crawler": "^2.120.0", + "nodemailer": "^6.9.9", "reflect-metadata": "^0.2.1", "swagger-ui-express": "^5.0.0", "tslib": "^2.6.2", - "tsoa": "^6.0.0", + "tsoa": "^6.0.1", "tsyringe": "^4.8.0", - "uuid": "^8.3.2", - "webdav": "^4.10.0", + "uuid": "^9.0.1", + "webdav": "^5.3.2", "winston": "^3.11.0", - "winston-daily-rotate-file": "^4.7.1", + "winston-daily-rotate-file": "^5.0.0", "ws": "^8.16.0", "xpath": "^0.0.34" - }, - "dependencies": { - "hot-patcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hot-patcher/-/hot-patcher-1.0.0.tgz", - "integrity": "sha512-3H8VH0PreeNsKMZw16nTHbUp4YoHCnPlawpsPXGJUR4qENDynl79b6Xk9CIFvLcH1qungBsCuzKcWyzoPPalTw==" - }, - "layerr": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/layerr/-/layerr-0.1.2.tgz", - "integrity": "sha512-ob5kTd9H3S4GOG2nVXyQhOu9O8nBgP555XxWPkJI0tR0JeRilfyTp8WtPdIJHLXBmHMSdEq5+KMxiYABeScsIQ==" - }, - "minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "object-hash": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", - "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==" - }, - "url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "webdav": { - "version": "4.11.3", - "resolved": "https://registry.npmjs.org/webdav/-/webdav-4.11.3.tgz", - "integrity": "sha512-NIuREBXYo5xb+zB4zy502snynbhugWjepg5Oke0ByEb7J/Ofmbk+JgFYM+sZdnKG3+XQ87rictDIF+SHUJkwlg==", - "requires": { - "axios": "^0.27.2", - "base-64": "^1.0.0", - "byte-length": "^1.0.2", - "fast-xml-parser": "^4.2.4", - "he": "^1.2.0", - "hot-patcher": "^1.0.0", - "layerr": "^0.1.2", - "md5": "^2.3.0", - "minimatch": "^5.1.0", - "nested-property": "^4.0.0", - "path-posix": "^1.0.0", - "url-join": "^4.0.1", - "url-parse": "^1.5.10" - } - }, - "winston-daily-rotate-file": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.7.1.tgz", - "integrity": "sha512-7LGPiYGBPNyGHLn9z33i96zx/bd71pjBn9tqQzO3I4Tayv94WPmBNwKC7CO1wPHdP9uvu+Md/1nr6VSH9h0iaA==", - "requires": { - "file-stream-rotator": "^0.6.1", - "object-hash": "^2.0.1", - "triple-beam": "^1.3.0", - "winston-transport": "^4.4.0" - } - } } }, "abbrev": { @@ -35192,7 +35520,9 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "adjust-sourcemap-loader": { "version": "4.0.0", @@ -35335,7 +35665,9 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "argparse": { "version": "1.0.10", @@ -35447,15 +35779,6 @@ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, - "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, "axobject-query": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", @@ -36828,7 +37151,9 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "critters": { "version": "0.0.20", @@ -37146,7 +37471,9 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "diff-sequences": { "version": "29.6.3", @@ -38360,7 +38687,8 @@ "follow-redirects": { "version": "1.15.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "dev": true }, "for-each": { "version": "0.3.3", @@ -38531,6 +38859,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -47942,6 +48279,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve-url-loader": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz", @@ -49644,6 +49987,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -49720,6 +50065,211 @@ "yargs": "^17.0.0" } }, + "tsx": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", + "integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==", + "dev": true, + "requires": { + "esbuild": "~0.19.10", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.2" + }, + "dependencies": { + "@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + } + } + }, "tsyringe": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.8.0.tgz", @@ -49982,7 +50532,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.2.0", @@ -50868,7 +51420,9 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "yocto-queue": { "version": "0.1.0", diff --git a/package.json b/package.json index 2d40f228..f3e704a5 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "semantic-release": "^23.0.2", "supertest": "^6.3.4", "ts-jest": "^29.1.2", - "ts-node": "^10.9.2", + "tsx": "^4.7.1", "typescript": "^5.2.2" } } diff --git a/projects/aas-lib/src/lib/submodel-template/submodel-template.ts b/projects/aas-lib/src/lib/submodel-template/submodel-template.ts index b7030503..5a7878ee 100644 --- a/projects/aas-lib/src/lib/submodel-template/submodel-template.ts +++ b/projects/aas-lib/src/lib/submodel-template/submodel-template.ts @@ -47,7 +47,7 @@ const semanticIdMap = new Map([ [CustomerFeedback, CustomerFeedback], ]); -export function resolveSemanticId(value: aas.HasSemantic | aas.Reference | string): string | undefined { +export function resolveSemanticId(value: aas.HasSemantics | aas.Reference | string): string | undefined { let semanticId: string | undefined; if (value) { if (typeof value === 'string') { diff --git a/projects/aas-lib/src/test/aas-tree/opertation-call-form.component.spec.ts b/projects/aas-lib/src/test/aas-tree/opertation-call-form.component.spec.ts index 03eb12ad..444d0d7b 100644 --- a/projects/aas-lib/src/test/aas-tree/opertation-call-form.component.spec.ts +++ b/projects/aas-lib/src/test/aas-tree/opertation-call-form.component.spec.ts @@ -29,10 +29,7 @@ describe('OperationCallFormComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [OperationCallFormComponent], - providers: [ - NgbModal, - NgbActiveModal - ], + providers: [NgbModal, NgbActiveModal], imports: [ HttpClientTestingModule, CommonModule, @@ -41,10 +38,10 @@ describe('OperationCallFormComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateFakeLoader - } - }) - ] + useClass: TranslateFakeLoader, + }, + }), + ], }); api = TestBed.inject(AASTreeApiService); @@ -56,14 +53,13 @@ describe('OperationCallFormComponent', () => { operation = { category: 'CONSTANT', - kind: 'Instance', methodId: '123', modelType: 'Operation', idShort: 'convert', objectId: 'abc', inputVariables: [], inoutputVariables: [], - outputVariables: [] + outputVariables: [], }; }); @@ -79,7 +75,7 @@ describe('OperationCallFormComponent', () => { (resultOp.inputVariables![0].value as aas.Property).value = 'Hello World!'; (resultOp.outputVariables![0].value as aas.Property).value = 'Hello World!'.toUpperCase(); - spyOn(api, 'invoke').and.returnValue(new Promise((result) => result(resultOp))) + spyOn(api, 'invoke').and.returnValue(new Promise(result => result(resultOp))); component.document = document; component.operation = operation; component.inputVariables[0].value = 'Hello World!'; @@ -98,7 +94,7 @@ describe('OperationCallFormComponent', () => { (resultOp.inputVariables![0].value as aas.Property).value = 'false'; (resultOp.outputVariables![0].value as aas.Property).value = 'true'; - spyOn(api, 'invoke').and.returnValue(new Promise((result) => result(resultOp))) + spyOn(api, 'invoke').and.returnValue(new Promise(result => result(resultOp))); component.document = document; component.operation = operation; component.inputVariables[0].value = false; @@ -117,7 +113,7 @@ describe('OperationCallFormComponent', () => { (resultOp.inputVariables![0].value as aas.Property).value = '42'; (resultOp.outputVariables![0].value as aas.Property).value = '43'; - spyOn(api, 'invoke').and.returnValue(new Promise((result) => result(resultOp))) + spyOn(api, 'invoke').and.returnValue(new Promise(result => result(resultOp))); component.document = document; component.operation = operation; component.inputVariables[0].value = '42'; @@ -154,7 +150,7 @@ describe('OperationCallFormComponent', () => { operation.outputVariables = [createVariable('out', 'xs:int', 0)]; const dummy = cloneDeep(operation); - spyOn(api, 'invoke').and.returnValue(new Promise((result) => result(dummy))) + spyOn(api, 'invoke').and.returnValue(new Promise(result => result(dummy))); component.document = document; component.operation = operation; @@ -166,15 +162,14 @@ describe('OperationCallFormComponent', () => { expect(component.canCall).toBeTrue(); }); - function createVariable(name: string, valueType?: aas.DataTypeDefXsd, value?: any): aas.OperationVariable { + function createVariable(name: string, valueType?: aas.DataTypeDefXsd, value?: unknown): aas.OperationVariable { return { value: { modelType: 'Property', idShort: name, - kind: 'Instance', valueType: valueType, - value: convertToString(value) - } as aas.Property + value: convertToString(value), + } as aas.Property, }; } -}); \ No newline at end of file +}); diff --git a/projects/aas-portal/src/app/aas/edit-element-form/edit-element-form.component.ts b/projects/aas-portal/src/app/aas/edit-element-form/edit-element-form.component.ts index 4e7ca01e..35ffff3e 100644 --- a/projects/aas-portal/src/app/aas/edit-element-form/edit-element-form.component.ts +++ b/projects/aas-portal/src/app/aas/edit-element-form/edit-element-form.component.ts @@ -187,9 +187,9 @@ export class EditElementFormComponent { private initMultiLanguageProperty(): void { const multiLangProperty = this.element as aas.MultiLanguageProperty; - this.langStrings = multiLangProperty.value.map( - (item, index) => ({ ...item, selected: false, index }) as LangStringRow, - ); + this.langStrings = multiLangProperty.value + ? multiLangProperty.value.map((item, index) => ({ ...item, selected: false, index }) as LangStringRow) + : []; this.langStrings.push({ language: '', text: '', selected: false, index: -1 }); } diff --git a/projects/aas-portal/src/test/aas/edit-element-form.component.spec.ts b/projects/aas-portal/src/test/aas/edit-element-form.component.spec.ts index b1c6ee34..4efc367d 100644 --- a/projects/aas-portal/src/test/aas/edit-element-form.component.spec.ts +++ b/projects/aas-portal/src/test/aas/edit-element-form.component.spec.ts @@ -59,7 +59,6 @@ describe('EditElementFormComponent', () => { idShort: 'Text', modelType: 'Property', category: 'CONSTANT', - kind: 'Instance', valueType: 'xs:string', }; @@ -127,7 +126,6 @@ describe('EditElementFormComponent', () => { idShort: 'A multi language property', modelType: 'MultiLanguageProperty', category: 'CONSTANT', - kind: 'Instance', value: [{ language: 'de', text: 'Hallo Welt!' }], }; diff --git a/projects/aas-server/src/app/aas-provider/aas-provider.ts b/projects/aas-server/src/app/aas-provider/aas-provider.ts index ab0edb99..6cc795a5 100644 --- a/projects/aas-server/src/app/aas-provider/aas-provider.ts +++ b/projects/aas-server/src/app/aas-provider/aas-provider.ts @@ -93,7 +93,7 @@ export class AASProvider { try { await resource.openAsync(); if (!document.content) { - document.content = await resource.createPackage(document.address).readEnvironmentAsync(); + document.content = await resource.createPackage(document.address).getEnvironmentAsync(); } return document; @@ -108,7 +108,7 @@ export class AASProvider { const resource = this.resourceFactory.create(endpoint); try { await resource.openAsync(); - return await resource.createPackage(document.address).readEnvironmentAsync(); + return await resource.createPackage(document.address).getEnvironmentAsync(); } finally { await resource.closeAsync(); } @@ -141,7 +141,7 @@ export class AASProvider { await resource.openAsync(); const pkg = resource.createPackage(document.address); if (!document.content) { - document.content = await pkg.readEnvironmentAsync(); + document.content = await pkg.getEnvironmentAsync(); } const dataElement: aas.DataElement | undefined = selectElement(document.content, smId, path); @@ -253,10 +253,10 @@ export class AASProvider { await resource.openAsync(); const pkg = resource.createPackage(document.address); if (!document.content) { - document.content = await pkg.readEnvironmentAsync(); + document.content = await pkg.getEnvironmentAsync(); } - return await pkg.commitDocumentAsync(document, content); + return await pkg.setEnvironmentAsync(content, document.content); } finally { await resource.closeAsync(); } @@ -421,7 +421,7 @@ export class AASProvider { const document = await this.index.get(message.endpoint, message.id); const resource = this.resourceFactory.create(endpoint); await resource.openAsync(); - const env = await resource.createPackage(document.address).readEnvironmentAsync(); + const env = await resource.createPackage(document.address).getEnvironmentAsync(); return resource.createSubscription(client, message, env); } @@ -574,7 +574,7 @@ export class AASProvider { const resource = this.resourceFactory.create(endpoint); try { await resource.openAsync(); - return await resource.createPackage(document.address).readEnvironmentAsync(); + return await resource.createPackage(document.address).getEnvironmentAsync(); } finally { await resource.closeAsync(); } diff --git a/projects/aas-server/src/app/packages/aas-package.ts b/projects/aas-server/src/app/packages/aas-package.ts index aa2ffe1f..d3d95b6f 100644 --- a/projects/aas-server/src/app/packages/aas-package.ts +++ b/projects/aas-server/src/app/packages/aas-package.ts @@ -36,15 +36,17 @@ export abstract class AASPackage { */ public abstract openReadStreamAsync(env: aas.Environment, file: aas.File): Promise; + /** + * Gets the AAS environment from the package. + * */ + public abstract getEnvironmentAsync(): Promise; + /** * Applies the state of the source document into the destination document. - * @param source The source document. - * @param content The new document content. + * @param env The new AAS environment. + * @param reference The previous state. */ - public abstract commitDocumentAsync(source: AASDocument, content: aas.Environment): Promise; - - /** Reads the AAS environment. */ - public abstract readEnvironmentAsync(): Promise; + public abstract setEnvironmentAsync(env: aas.Environment, reference?: aas.Environment): Promise; protected normalize(path: string): string { path = path.replace(/\\/g, '/'); diff --git a/projects/aas-server/src/app/packages/aas-server/aas-server-package.ts b/projects/aas-server/src/app/packages/aas-server/aas-server-package.ts index cc168667..67efe8c2 100644 --- a/projects/aas-server/src/app/packages/aas-server/aas-server-package.ts +++ b/projects/aas-server/src/app/packages/aas-server/aas-server-package.ts @@ -64,16 +64,16 @@ export class AASServerPackage extends AASPackage { return document; } - public override async readEnvironmentAsync(): Promise { + public override async getEnvironmentAsync(): Promise { return await this.server.readEnvironmentAsync(this.idShort); } - public async commitDocumentAsync(target: AASDocument, content: aas.Environment): Promise { + public async setEnvironmentAsync(content: aas.Environment, reference?: aas.Environment): Promise { let messages: string[] | undefined; - if (target.content && content) { - const diffs = await diffAsync(content, target.content); + if (reference && content) { + const diffs = await diffAsync(content, reference); if (diffs.length > 0) { - messages = await this.server.commitAsync(content, target.content, diffs); + messages = await this.server.commitAsync(content, reference, diffs); } } diff --git a/projects/aas-server/src/app/packages/file-system/aasx-directory.ts b/projects/aas-server/src/app/packages/file-system/aasx-directory.ts index 8db3b5a7..3d51a681 100644 --- a/projects/aas-server/src/app/packages/file-system/aasx-directory.ts +++ b/projects/aas-server/src/app/packages/file-system/aasx-directory.ts @@ -42,7 +42,7 @@ export class AasxDirectory extends AASResource { public override readonly version = ''; - public readonly readOnly = true; + public readonly readOnly = false; public readonly onlineReady = false; diff --git a/projects/aas-server/src/app/packages/file-system/aasx-package.ts b/projects/aas-server/src/app/packages/file-system/aasx-package.ts index 7c1fc23a..7497d60d 100644 --- a/projects/aas-server/src/app/packages/file-system/aasx-package.ts +++ b/projects/aas-server/src/app/packages/file-system/aasx-package.ts @@ -6,6 +6,7 @@ * *****************************************************************************/ +import fs from 'fs'; import { basename, extname } from 'path/posix'; import jszip from 'jszip'; import xpath from 'xpath'; @@ -20,6 +21,7 @@ import { AASReader } from '../aas-reader.js'; import { ImageProcessing } from '../../image-processing.js'; import { createXmlReader } from '../create-xml-reader.js'; import { createJsonReader } from '../create-json-reader.js'; +import { XmlWriter } from '../xml-writer.js'; export class AasxPackage extends AASPackage { private readonly file: string; @@ -65,15 +67,20 @@ export class AasxPackage extends AASPackage { return document; } - public override async readEnvironmentAsync(): Promise { + public override async getEnvironmentAsync(): Promise { return (await this.createReaderAsync()).readEnvironment(); } - public commitDocumentAsync(): Promise { - throw new Error('Method not implemented.'); + public override async setEnvironmentAsync(env: aas.Environment): Promise { + const writer = new XmlWriter(); + const xml = writer.write(env); + const path = await this.getOriginNameAsync(); + (await this.zip).file(path, xml, { compression: 'DEFLATE' }); + await this.saveAsync(); + return [`${this.file} successfully written.`]; } - public async openReadStreamAsync(_: aas.Environment, file: aas.File): Promise { + public override async openReadStreamAsync(_: aas.Environment, file: aas.File): Promise { if (!file.value) { throw new Error('Invalid operation.'); } @@ -87,7 +94,7 @@ export class AasxPackage extends AASPackage { return stream; } - public async getThumbnailAsync(): Promise { + public override async getThumbnailAsync(): Promise { let stream: NodeJS.ReadableStream | undefined; const relationships = await this.getRelationshipsAsync('_rels/.rels'); for (const relationship of relationships) { @@ -177,6 +184,16 @@ export class AasxPackage extends AASPackage { return (await file.async(contentType)) as string; } + private async saveAsync(): Promise { + const zip = await this.zip; + await new Promise((resolve, reject) => { + zip.generateNodeStream({ type: 'nodebuffer', streamFiles: true }) + .pipe(fs.createWriteStream(this.file)) + .on('finish', () => resolve()) + .on('error', error => reject(error)); + }); + } + private getContentType(fileName: string): jszip.OutputType { let contentType: jszip.OutputType; const extension = this.getExtension(fileName); diff --git a/projects/aas-server/src/app/packages/json-reader-v2.ts b/projects/aas-server/src/app/packages/json-reader-v2.ts index 91d8ea1c..dd7721ec 100644 --- a/projects/aas-server/src/app/packages/json-reader-v2.ts +++ b/projects/aas-server/src/app/packages/json-reader-v2.ts @@ -449,8 +449,8 @@ export class JsonReaderV2 extends AASReader { return this.readDataTypeDefXsd(source.dataObjectType?.name) as aas.DataTypeDefXsd; } - private readHasSemantic(source: aasv2.HasSemantic): aas.HasSemantic { - const hasSemantic: aas.HasSemantic = {}; + private readHasSemantic(source: aasv2.HasSemantic): aas.HasSemantics { + const hasSemantic: aas.HasSemantics = {}; if (source.semanticId) { hasSemantic.semanticId = this.readReference(source.semanticId); } @@ -657,7 +657,7 @@ export class JsonReaderV2 extends AASReader { } if (source.levelType) { - iec61360.levelType = source.levelType; + iec61360.levelType = { ...source.levelType }; } if (source.shortName) { @@ -804,7 +804,7 @@ export class JsonReaderV2 extends AASReader { } } - private readDataTypeIEC61360(source: string): aas.DataTypeIEC61360 { + private readDataTypeIEC61360(source: string): aas.DataTypeIec61360 { switch (source) { case 'DATE': return 'DATE'; @@ -837,7 +837,7 @@ export class JsonReaderV2 extends AASReader { case 'TIMESTAMP': return 'TIMESTAMP'; default: - return source as aas.DataTypeIEC61360; + return source as aas.DataTypeIec61360; } } } diff --git a/projects/aas-server/src/app/packages/json-reader.ts b/projects/aas-server/src/app/packages/json-reader.ts index 2bfc0a3f..61913009 100644 --- a/projects/aas-server/src/app/packages/json-reader.ts +++ b/projects/aas-server/src/app/packages/json-reader.ts @@ -249,7 +249,6 @@ export class JsonReader extends AASReader { return { ...this.readReferable(source, ancestors), ...this.readHasSemantic(source), - ...this.readHasKind(source), ...this.readHasDataSpecification(source), ...this.readQualifiable(source), }; @@ -447,8 +446,8 @@ export class JsonReader extends AASReader { entity.globalAssetId = source.globalAssetId; } - if (source.specificAssetId) { - entity.specificAssetId = this.readSpecificAssetId(source.specificAssetId); + if (source.specificAssetIds) { + entity.specificAssetIds = source.specificAssetIds.map(item => this.readSpecificAssetId(item)); } return entity; @@ -555,8 +554,8 @@ export class JsonReader extends AASReader { return range; } - private readHasSemantic(source: aas.HasSemantic): aas.HasSemantic { - const hasSemantic: aas.HasSemantic = {}; + private readHasSemantic(source: aas.HasSemantics): aas.HasSemantics { + const hasSemantic: aas.HasSemantics = {}; if (source.semanticId && source.semanticId.keys.length > 0) { hasSemantic.semanticId = this.readReference(source.semanticId); } @@ -648,7 +647,7 @@ export class JsonReader extends AASReader { } if (source.category) { - referable.category = source.category as aas.Category; + referable.category = source.category; } if (source.description) { @@ -711,9 +710,9 @@ export class JsonReader extends AASReader { } private readEmbeddedDatSpecification(source: aas.EmbeddedDataSpecification): aas.EmbeddedDataSpecification { - if (!source.dataSpecification) { - throw new Error('EmbeddedDataSpecification.dataSpecification'); - } + const dataSpecification = source.dataSpecification + ? this.readReference(source.dataSpecification) + : ({ type: 'ModelReference', keys: [] } as aas.Reference); if (!source.dataSpecificationContent) { throw new Error('EmbeddedDataSpecification.dataSpecificationContent'); @@ -734,7 +733,7 @@ export class JsonReader extends AASReader { } const specification: aas.EmbeddedDataSpecification = { - dataSpecification: this.readReference(source.dataSpecification), + dataSpecification, dataSpecificationContent, }; @@ -742,13 +741,9 @@ export class JsonReader extends AASReader { } private readDataSpecificationIEC61360(source: aas.DataSpecificationIec61360): aas.DataSpecificationIec61360 { - if (!source.preferredName) { - throw new Error(`DataSpecificationIec61360.preferredName`); - } - const iec61360: aas.DataSpecificationIec61360 = { modelType: source.modelType, - preferredName: source.preferredName, + preferredName: source.preferredName ? source.preferredName.map(item => this.readLangString(item)) : [], }; if (source.dataType) { @@ -756,7 +751,7 @@ export class JsonReader extends AASReader { } if (source.definition) { - iec61360.definition = source.definition; + iec61360.definition = source.definition.map(item => this.readLangString(item)); } if (source.levelType) { @@ -821,4 +816,8 @@ export class JsonReader extends AASReader { return { value: source.value, valueId: this.readReference(source.valueId) }; } + + private readLangString(source: aas.LangString): aas.LangString { + return { language: source.language, text: source.text } as aas.LangString; + } } diff --git a/projects/aas-server/src/app/packages/json-writer-v2.ts b/projects/aas-server/src/app/packages/json-writer-v2.ts index 16ee0e81..c6877afb 100644 --- a/projects/aas-server/src/app/packages/json-writer-v2.ts +++ b/projects/aas-server/src/app/packages/json-writer-v2.ts @@ -327,7 +327,6 @@ export class JsonWriterV2 extends AASWriter { ...this.writeHasSemantic(source), ...this.writeHasDataSpecification(source), ...this.writeQualifiable(source), - ...this.writeHasKind(source), }; } @@ -489,17 +488,17 @@ export class JsonWriterV2 extends AASWriter { }; } - private writeDataTypeIEC61360(source: aas.DataTypeIEC61360): aasv2.DataTypeIEC61360 { + private writeDataTypeIEC61360(source: aas.DataTypeIec61360): aasv2.DataTypeIec61360 { switch (source) { case 'IRDI': case 'IRI': return 'URL'; default: - return source as aasv2.DataTypeIEC61360; + return source as aasv2.DataTypeIec61360; } } - private writeHasSemantic(source: aas.HasSemantic): aasv2.HasSemantic { + private writeHasSemantic(source: aas.HasSemantics): aasv2.HasSemantic { const hasSemantic: aasv2.HasSemantic = {}; if (source.semanticId) { hasSemantic.semanticId = this.writeReference(source.semanticId); diff --git a/projects/aas-server/src/app/packages/json-writer.ts b/projects/aas-server/src/app/packages/json-writer.ts index 8a14a61a..b57a57aa 100644 --- a/projects/aas-server/src/app/packages/json-writer.ts +++ b/projects/aas-server/src/app/packages/json-writer.ts @@ -223,7 +223,6 @@ export class JsonWriter extends AASWriter { return { ...this.writeReferable(source), ...this.writeHasSemantic(source), - ...this.writeHasKind(source), ...this.writeHasDataSpecification(source), ...this.writeQualifiable(source), }; @@ -405,8 +404,8 @@ export class JsonWriter extends AASWriter { entity.globalAssetId = source.globalAssetId; } - if (source.specificAssetId) { - entity.specificAssetId = this.writeSpecificAssetId(source.specificAssetId); + if (source.specificAssetIds) { + entity.specificAssetIds = source.specificAssetIds.map(item => this.writeSpecificAssetId(item)); } return entity; @@ -502,8 +501,8 @@ export class JsonWriter extends AASWriter { return range; } - private writeHasSemantic(source: aas.HasSemantic): aas.HasSemantic { - const hasSemantic: aas.HasSemantic = {}; + private writeHasSemantic(source: aas.HasSemantics): aas.HasSemantics { + const hasSemantic: aas.HasSemantics = {}; if (source.semanticId) { hasSemantic.semanticId = this.writeReference(source.semanticId); } @@ -562,7 +561,7 @@ export class JsonWriter extends AASWriter { const referable: aas.Referable = { idShort: source.idShort, modelType: source.modelType }; if (source.category) { - referable.category = source.category as aas.Category; + referable.category = source.category; } if (source.description) { diff --git a/projects/aas-server/src/app/packages/opcua/opcua-package.ts b/projects/aas-server/src/app/packages/opcua/opcua-package.ts index 3cea6712..555466bb 100644 --- a/projects/aas-server/src/app/packages/opcua/opcua-package.ts +++ b/projects/aas-server/src/app/packages/opcua/opcua-package.ts @@ -55,18 +55,18 @@ export class OpcuaPackage extends AASPackage { return document; } - public override async readEnvironmentAsync(): Promise { + public override async getEnvironmentAsync(): Promise { const component = await this.crawlAsync(); const reader = new OpcuaReader(this.logger, component, this.dataTypes); return await reader.readEnvironment(); } - public getThumbnailAsync(): Promise { + public override setEnvironmentAsync(): Promise { return Promise.reject(new Error('Not implemented.')); } - public commitDocumentAsync(): Promise { - throw new Error('Method not implemented.'); + public override getThumbnailAsync(): Promise { + return Promise.reject(new Error('Not implemented.')); } public async openReadStreamAsync(_: aas.Environment, file: aas.File): Promise { diff --git a/projects/aas-server/src/app/packages/opcua/opcua-reader.ts b/projects/aas-server/src/app/packages/opcua/opcua-reader.ts index f7506206..a5e045c0 100644 --- a/projects/aas-server/src/app/packages/opcua/opcua-reader.ts +++ b/projects/aas-server/src/app/packages/opcua/opcua-reader.ts @@ -440,7 +440,6 @@ export class OpcuaReader extends AASReader { const value: aas.Property = { modelType: 'Property', idShort: argument.name!, - kind: 'Instance', valueType: this.dataTypes.get(argument.dataType), }; @@ -516,7 +515,7 @@ export class OpcuaReader extends AASReader { return referable; } - private readHasSemantic(component: OPCUAComponent): aas.HasSemantic { + private readHasSemantic(component: OPCUAComponent): aas.HasSemantics { const semanticId = this.readReference(component, 'SemanticId'); return semanticId ? { semanticId } : {}; } @@ -621,7 +620,7 @@ export class OpcuaReader extends AASReader { throw new Error(`Unexpected value type: expected string or number, actual ${typeof value}`); } - private readCategory(component: OPCUAComponent, propertyName: string): aas.Category | undefined { + private readCategory(component: OPCUAComponent, propertyName: string): string | undefined { const property = this.findProperty(component, propertyName); if (!property) { return undefined; @@ -633,7 +632,7 @@ export class OpcuaReader extends AASReader { } if (typeof value === 'string') { - return value as aas.Category; + return value; } if (typeof value === 'number') { diff --git a/projects/aas-server/src/app/packages/opcua/opcua.ts b/projects/aas-server/src/app/packages/opcua/opcua.ts index f42d5604..86da60fc 100644 --- a/projects/aas-server/src/app/packages/opcua/opcua.ts +++ b/projects/aas-server/src/app/packages/opcua/opcua.ts @@ -48,7 +48,7 @@ export type AASTypeDefinition = export interface AssetInformation { kind: aas.AssetKind; globalAssetId: aas.Reference; - category?: aas.Category; + category?: string; billOfMaterial?: aas.Reference[]; specificAssetId?: aas.Reference[]; } diff --git a/projects/aas-server/src/app/packages/xml-reader-v1.ts b/projects/aas-server/src/app/packages/xml-reader-v1.ts index cd4c47cf..b167f38e 100644 --- a/projects/aas-server/src/app/packages/xml-reader-v1.ts +++ b/projects/aas-server/src/app/packages/xml-reader-v1.ts @@ -6,7 +6,7 @@ * *****************************************************************************/ -import { aas, determineType } from 'common'; +import { aas, determineType, toBoolean } from 'common'; import { useNamespaces, XPathSelect } from 'xpath'; import { DOMParser } from '@xmldom/xmldom'; import { AASReader } from './aas-reader.js'; @@ -350,7 +350,7 @@ export class XmlReaderV1 extends AASReader { referable.parent = parent; } - const category = this.selectNode('./aas:category', node)?.textContent as aas.Category | undefined; + const category = this.selectNode('./aas:category', node)?.textContent; if (category) { referable.category = category; } @@ -358,7 +358,7 @@ export class XmlReaderV1 extends AASReader { return referable; } - private readHaSemantic(node: Node): aas.HasSemantic { + private readHaSemantic(node: Node): aas.HasSemantics { const semanticId = this.readReference('./aas:semanticId', node); return semanticId ? { semanticId } : {}; } @@ -437,7 +437,7 @@ export class XmlReaderV1 extends AASReader { dataSpecification.symbol = symbol; } - const dataType = this.selectNode(`./${this.iec61360}:dataType`, node)?.textContent as aas.DataTypeIEC61360; + const dataType = this.selectNode(`./${this.iec61360}:dataType`, node)?.textContent as aas.DataTypeIec61360; if (dataType) { dataSpecification.dataType = dataType; } @@ -462,9 +462,14 @@ export class XmlReaderV1 extends AASReader { dataSpecification.value = value; } - const levelType = this.selectNode(`./${this.iec61360}:levelType`, node)?.textContent as aas.LevelType; + const levelType = this.selectNode(`./${this.iec61360}:levelType`, node); if (levelType) { - dataSpecification.levelType = levelType; + dataSpecification.levelType = { + min: toBoolean(this.selectNode('./min', levelType)!.textContent), + max: toBoolean(this.selectNode('./max', levelType)!.textContent), + nom: toBoolean(this.selectNode('./nom', levelType)!.textContent), + typ: toBoolean(this.selectNode('./typ', levelType)!.textContent), + }; } return dataSpecification; diff --git a/projects/aas-server/src/app/packages/xml-reader.ts b/projects/aas-server/src/app/packages/xml-reader.ts index 5f11737d..e7ffdf32 100644 --- a/projects/aas-server/src/app/packages/xml-reader.ts +++ b/projects/aas-server/src/app/packages/xml-reader.ts @@ -6,7 +6,7 @@ * *****************************************************************************/ -import { aas, determineType } from 'common'; +import { aas, determineType, toBoolean } from 'common'; import { useNamespaces, XPathSelect } from 'xpath'; import { DOMParser } from '@xmldom/xmldom'; import { AASReader } from './aas-reader.js'; @@ -412,7 +412,7 @@ export class XmlReader extends AASReader { const list: aas.SubmodelElementList = { ...base, value: this.readCollectionValue(node, parent ? this.createReference(parent, base) : undefined), - typeValueListElement: this.getTextContent('./aas:typeValueListElement', node) as aas.AasSubmodelElements, + typeValueListElement: this.getTextContent('./aas:typeValueListElement', node) as aas.AASSubmodelElements, }; return list; @@ -569,7 +569,7 @@ export class XmlReader extends AASReader { referable.parent = parent; } - const category = this.selectTextContent('./aas:category', node) as aas.Category | undefined; + const category = this.selectTextContent('./aas:category', node); if (category) { referable.category = category; } @@ -600,7 +600,7 @@ export class XmlReader extends AASReader { return extension; } - private readHasSemantic(node: Node): aas.HasSemantic { + private readHasSemantic(node: Node): aas.HasSemantics { const semanticId = this.readReference(this.selectNode('./aas:semanticId', node)); return semanticId ? { semanticId } : {}; } @@ -634,9 +634,9 @@ export class XmlReader extends AASReader { } private readEmbeddedDataSpecification(node: Node): aas.EmbeddedDataSpecification { - const dataSpecification = this.readReference(this.selectNode('./aas:dataSpecification', node)); + let dataSpecification = this.readReference(this.selectNode('./aas:dataSpecification', node)); if (!dataSpecification) { - throw new Error('EmbeddedDataSpecification.dataSpecification'); + dataSpecification = { type: 'ModelReference', keys: [] }; } const dataSpecificationContent = this.readDataSpecificationContent(node); @@ -697,7 +697,7 @@ export class XmlReader extends AASReader { dataSpecification.symbol = symbol; } - const dataType = this.selectTextContent('./aas:dataType', node) as aas.DataTypeIEC61360; + const dataType = this.selectTextContent('./aas:dataType', node) as aas.DataTypeIec61360; if (dataType) { dataSpecification.dataType = dataType; } @@ -722,9 +722,14 @@ export class XmlReader extends AASReader { dataSpecification.value = value; } - const levelType = this.selectTextContent('./aas:levelType', node) as aas.LevelType; + const levelType = this.selectNode('./aas:levelType', node); if (levelType) { - dataSpecification.levelType = levelType; + dataSpecification.levelType = { + min: toBoolean(this.getTextContent('./min', levelType)), + max: toBoolean(this.getTextContent('./max', levelType)), + nom: toBoolean(this.getTextContent('./nom', levelType)), + typ: toBoolean(this.getTextContent('./typ', levelType)), + }; } return dataSpecification; @@ -904,15 +909,6 @@ export class XmlReader extends AASReader { return value; } - private getNode(query: string, node: Node): Node { - const result = this.select(query, node, true); - if (!result) { - throw new Error(`Query '${query}' returns no result.`); - } - - return result as Node; - } - private selectNodes(query: string, node: Node): Node[] { return this.select(query, node) as Node[]; } diff --git a/projects/aas-server/src/app/packages/xml-reader_v2.ts b/projects/aas-server/src/app/packages/xml-reader_v2.ts index a80033ac..c0b54a3a 100644 --- a/projects/aas-server/src/app/packages/xml-reader_v2.ts +++ b/projects/aas-server/src/app/packages/xml-reader_v2.ts @@ -6,7 +6,7 @@ * *****************************************************************************/ -import { aas, determineType } from 'common'; +import { aas, determineType, toBoolean } from 'common'; import { useNamespaces, XPathSelect } from 'xpath'; import { DOMParser } from '@xmldom/xmldom'; import { AASReader } from './aas-reader.js'; @@ -350,7 +350,7 @@ export class XmlReaderV2 extends AASReader { referable.parent = parent; } - const category = this.selectNode('./aas:category', node)?.textContent as aas.Category | undefined; + const category = this.selectNode('./aas:category', node)?.textContent; if (category) { referable.category = category; } @@ -358,7 +358,7 @@ export class XmlReaderV2 extends AASReader { return referable; } - private readHaSemantic(node: Node): aas.HasSemantic { + private readHaSemantic(node: Node): aas.HasSemantics { const semanticId = this.readReference('./aas:semanticId', node); return semanticId ? { semanticId } : {}; } @@ -437,7 +437,7 @@ export class XmlReaderV2 extends AASReader { dataSpecification.symbol = symbol; } - const dataType = this.selectNode(`./${this.iec61360}:dataType`, node)?.textContent as aas.DataTypeIEC61360; + const dataType = this.selectNode(`./${this.iec61360}:dataType`, node)?.textContent as aas.DataTypeIec61360; if (dataType) { dataSpecification.dataType = dataType; } @@ -462,9 +462,14 @@ export class XmlReaderV2 extends AASReader { dataSpecification.value = value; } - const levelType = this.selectNode(`./${this.iec61360}:levelType`, node)?.textContent as aas.LevelType; + const levelType = this.selectNode(`./${this.iec61360}:levelType`, node); if (levelType) { - dataSpecification.levelType = levelType; + dataSpecification.levelType = { + min: toBoolean(this.selectNode('./min', levelType)!.textContent), + max: toBoolean(this.selectNode('./max', levelType)!.textContent), + nom: toBoolean(this.selectNode('./nom', levelType)!.textContent), + typ: toBoolean(this.selectNode('./typ', levelType)!.textContent), + }; } return dataSpecification; diff --git a/projects/aas-server/src/app/packages/xml-writer.ts b/projects/aas-server/src/app/packages/xml-writer.ts index bf0c6833..7c5b8191 100644 --- a/projects/aas-server/src/app/packages/xml-writer.ts +++ b/projects/aas-server/src/app/packages/xml-writer.ts @@ -6,7 +6,7 @@ * *****************************************************************************/ -import { aas } from 'common'; +import { aas, convertToString } from 'common'; import { camelCase } from 'lodash-es'; import { DOMImplementation, XMLSerializer } from '@xmldom/xmldom'; import { AASWriter } from './aas-writer.js'; @@ -70,7 +70,7 @@ export class XmlWriter extends AASWriter { this.writeTextNode(node, 'name', extension.name); if (extension.refersTo) { - this.writeReference(extension.refersTo, this.appendChild(node, 'refersTo')); + extension.refersTo.forEach(item => this.writeReference(item, this.appendChild(node, 'refersTo'))); } } @@ -153,7 +153,14 @@ export class XmlWriter extends AASWriter { this.writeTextNode(node, 'valueFormat', content.valueFormat); this.writeTextNode(node, 'value', content.value); - this.writeTextNode(node, 'levelType', content.levelType); + + if (content.levelType) { + const levelType = this.appendChild(node, 'levelType'); + this.writeTextNode(levelType, 'min', convertToString(content.levelType.min)); + this.writeTextNode(levelType, 'max', convertToString(content.levelType.max)); + this.writeTextNode(levelType, 'nom', convertToString(content.levelType.nom)); + this.writeTextNode(levelType, 'typ', convertToString(content.levelType.typ)); + } } private writeEmbeddedDataSpecification(embeddedDataSpecification: aas.EmbeddedDataSpecification, node: Node): void { @@ -192,13 +199,16 @@ export class XmlWriter extends AASWriter { } } - private writeHasSemantic(hasSemantic: aas.HasSemantic, node: Node): void { + private writeHasSemantic(hasSemantic: aas.HasSemantics, node: Node): void { if (hasSemantic.semanticId) { this.writeReference(hasSemantic.semanticId, this.appendChild(node, 'semanticId')); } if (hasSemantic.supplementalSemanticIds) { - this.writeReference(hasSemantic.supplementalSemanticIds, this.appendChild(node, 'supplementalSemanticIds')); + const child = this.appendChild(node, 'supplementalSemanticIds'); + hasSemantic.supplementalSemanticIds.forEach(item => + this.writeReference(item, this.appendChild(child, 'reference')), + ); } } @@ -279,7 +289,6 @@ export class XmlWriter extends AASWriter { private writeSubmodelElement(submodelElement: aas.SubmodelElement, node: Node): void { this.writeReferable(submodelElement, node); - this.writeHasKind(submodelElement, node); this.writeHasSemantic(submodelElement, node); this.writeQualifiable(submodelElement, node); this.writeHasDataSpecification(submodelElement, node); @@ -332,7 +341,6 @@ export class XmlWriter extends AASWriter { private writeDataElement(dataElement: aas.DataElement, node: Node): void { this.writeReferable(dataElement, node); - this.writeHasKind(dataElement, node); this.writeHasSemantic(dataElement, node); this.writeQualifiable(dataElement, node); this.writeHasDataSpecification(dataElement, node); @@ -362,9 +370,11 @@ export class XmlWriter extends AASWriter { private writeAnnotatedRelationshipElement(relationship: aas.AnnotatedRelationshipElement, node: Node) { this.writeRelationshipElement(relationship, node); - const annotationsNode = this.appendChild(node, 'annotations'); - for (const annotation of relationship.annotations) { - this.writeDataElement(annotation, this.appendChild(annotationsNode, camelCase(annotation.modelType))); + if (relationship.annotations) { + const annotationsNode = this.appendChild(node, 'annotations'); + for (const annotation of relationship.annotations) { + this.writeDataElement(annotation, this.appendChild(annotationsNode, camelCase(annotation.modelType))); + } } } @@ -395,8 +405,11 @@ export class XmlWriter extends AASWriter { this.writeTextNode(node, 'entityType', entity.entityType); this.writeTextNode(node, 'globalAssetId', entity.globalAssetId); - if (entity.specificAssetId) { - this.writeSpecificAssetId(entity.specificAssetId, this.appendChild(node, 'specificAssetId')); + if (entity.specificAssetIds) { + const child = this.appendChild(node, 'specificAssetIds'); + entity.specificAssetIds.forEach(item => + this.writeSpecificAssetId(item, this.appendChild(child, 'specificAssetId')), + ); } if (entity.statements) { diff --git a/projects/aas-server/src/app/template/template-scan.ts b/projects/aas-server/src/app/template/template-scan.ts index 215d66e0..edbf687d 100644 --- a/projects/aas-server/src/app/template/template-scan.ts +++ b/projects/aas-server/src/app/template/template-scan.ts @@ -129,7 +129,7 @@ export class TemplateScan { source = new AasxDirectory(this.logger, this.fileStorage, this.url); await source.openAsync(); const pkg = source.createPackage(file); - const submodel = (await pkg.readEnvironmentAsync()).submodels[0]; + const submodel = (await pkg.getEnvironmentAsync()).submodels[0]; return { modelType: submodel.modelType, idShort: submodel.idShort, diff --git a/projects/aas-server/src/app/template/template-storage.ts b/projects/aas-server/src/app/template/template-storage.ts index a42b2727..8612825c 100644 --- a/projects/aas-server/src/app/template/template-storage.ts +++ b/projects/aas-server/src/app/template/template-storage.ts @@ -86,7 +86,7 @@ export class TemplateStorage { source = new AasxDirectory(this.logger, this.fileStorage, this.url); await source.openAsync(); const pkg = source.createPackage(file); - return await pkg.readEnvironmentAsync(); + return await pkg.getEnvironmentAsync(); } finally { await source?.closeAsync(); } diff --git a/projects/aas-server/src/app/types/aas-v2.ts b/projects/aas-server/src/app/types/aas-v2.ts index 85437dae..e700da25 100644 --- a/projects/aas-server/src/app/types/aas-v2.ts +++ b/projects/aas-server/src/app/types/aas-v2.ts @@ -106,7 +106,7 @@ export type DataTypeDefXsd = /** Enumeration of simple data types for a IEC61360 concept description * using the data specification template DataSpecificationIec61360 */ -export type DataTypeIEC61360 = +export type DataTypeIec61360 = | 'DATE' | 'STRING' | 'STRING_TRANSLATABLE' @@ -238,7 +238,7 @@ export interface DataSpecificationIec61360Content extends DataSpecificationConte unitId?: Reference; sourceOfDefinition?: string; symbol?: string; - dataType?: DataTypeIEC61360; + dataType?: DataTypeIec61360; definition?: LangString[]; valueFormat?: string; valueList?: ValueList; @@ -246,7 +246,12 @@ export interface DataSpecificationIec61360Content extends DataSpecificationConte levelType?: LevelType; } -export type LevelType = 'Max' | 'Min' | 'Nom' | 'Typ'; +export interface LevelType { + max: boolean; + min: boolean; + nom: boolean; + typ: boolean; +} /** Content of data specification template for concept descriptions for physical units * conformant to IEC 61360. */ diff --git a/projects/common/src/lib/aas.ts b/projects/common/src/lib/aas.ts index c6fa9f91..a3703ea0 100644 --- a/projects/common/src/lib/aas.ts +++ b/projects/common/src/lib/aas.ts @@ -6,7 +6,7 @@ * *****************************************************************************/ -export type AasSubmodelElements = +export type AASSubmodelElements = | 'AnnotatedRelationshipElement' | 'BasicEventElement' | 'Blob' @@ -25,79 +25,7 @@ export type AasSubmodelElements = | 'SubmodelElementCollection' | 'SubmodelElementList'; -export interface AdministrativeInformation extends HasDataSpecification { - version?: string; - revision?: string; - creator?: Reference; - template?: string; -} - -export interface AnnotatedRelationshipElement extends RelationshipElement { - annotations: DataElement[]; -} - -export interface AssetAdministrationShell extends Identifiable, HasDataSpecification { - derivedFrom?: Reference; - assetInformation: AssetInformation; - submodels?: Reference[]; -} - -export interface AssetInformation { - assetKind: AssetKind; - globalAssetId?: string; - specificAssetIds?: SpecificAssetId[]; - assetType?: string; - defaultThumbnail?: Resource; -} - -export type AssetKind = 'Type' | 'NotApplicable' | 'Instance'; - -export interface BasicEventElement extends EventElement { - observed: Reference; - direction: Direction; - state: StateOfEvent; - messageTopic?: string; - messageBroker?: Reference; - lastUpdate?: string; - minInterval?: string; - maxInterval?: string; -} - -export interface Blob extends DataElement { - contentType: string; - value?: string; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface Capability extends SubmodelElement {} - -export interface ConceptDescription extends Identifiable, HasDataSpecification { - isCaseOf?: Reference[]; -} - -export interface DataElement extends SubmodelElement { - /** OPC UA */ - nodeId?: string; -} - -export interface DataSpecificationContent { - modelType: ModelType; -} - -export interface DataSpecificationIec61360 extends DataSpecificationContent { - preferredName: LangString[]; - shortName?: LangString[]; - unit?: string; - unitId?: Reference; - sourceOfDefinition?: string; - symbol?: string; - dataType?: DataTypeIEC61360; - definition?: LangString[]; - valueFormat?: string; - valueList?: ValueList; - value?: string; - levelType?: LevelType; -} +export type AssetKind = 'Instance' | 'NotApplicable' | 'Type'; export type DataTypeDefXsd = | 'xs:anyURI' @@ -131,7 +59,7 @@ export type DataTypeDefXsd = | 'xs:unsignedLong' | 'xs:unsignedShort'; -export type DataTypeIEC61360 = +export type DataTypeIec61360 = | 'BLOB' | 'BOOLEAN' | 'DATE' @@ -154,45 +82,173 @@ export type DataTypeIEC61360 = export type Direction = 'input' | 'output'; +export type EntityType = 'CoManagedEntity' | 'SelfManagedEntity'; + +export type KeyTypes = + | 'AnnotatedRelationshipElement' + | 'AssetAdministrationShell' + | 'BasicEventElement' + | 'Blob' + | 'Capability' + | 'ConceptDescription' + | 'DataElement' + | 'Entity' + | 'EventElement' + | 'File' + | 'FragmentReference' + | 'GlobalReference' + | 'Identifiable' + | 'MultiLanguageProperty' + | 'Operation' + | 'Property' + | 'Range' + | 'Referable' + | 'ReferenceElement' + | 'RelationshipElement' + | 'Submodel' + | 'SubmodelElement' + | 'SubmodelElementCollection' + | 'SubmodelElementList'; + +export type ModelType = + | 'AnnotatedRelationshipElement' + | 'AssetAdministrationShell' + | 'BasicEventElement' + | 'Blob' + | 'Capability' + | 'ConceptDescription' + | 'DataSpecificationIec61360' + | 'Entity' + | 'File' + | 'MultiLanguageProperty' + | 'Operation' + | 'Property' + | 'Range' + | 'ReferenceElement' + | 'RelationshipElement' + | 'Submodel' + | 'SubmodelElementCollection' + | 'SubmodelElementList'; + +export type ModellingKind = 'Instance' | 'Template'; + +export type QualifierKind = 'ConceptQualifier' | 'TemplateQualifier' | 'ValueQualifier'; + +export type ReferenceTypes = 'ExternalReference' | 'ModelReference'; + +export type StateOfEvent = 'off' | 'on'; + +export interface LangString { + language: string; + text: string; +} + +export interface AdministrativeInformation extends HasDataSpecification { + creator?: Reference; + revision?: string; + templateId?: string; + version?: string; +} + +export interface AnnotatedRelationshipElement extends RelationshipElement { + annotations?: DataElement[]; +} + +export interface AssetAdministrationShell extends HasDataSpecification, Identifiable { + assetInformation: AssetInformation; + derivedFrom?: Reference; + submodels?: Reference[]; +} + +export interface AssetInformation { + assetKind: AssetKind; + assetType?: string; + defaultThumbnail?: Resource; + globalAssetId?: string; + specificAssetIds?: SpecificAssetId[]; +} + +export interface BasicEventElement extends EventElement { + direction: Direction; + lastUpdate?: string; + maxInterval?: string; + messageBroker?: Reference; + messageTopic?: string; + minInterval?: string; + observed: Reference; + state: StateOfEvent; +} + +export interface Blob extends DataElement { + contentType: string; + value?: string; +} + +export type Capability = SubmodelElement; + +export interface ConceptDescription extends HasDataSpecification, Identifiable { + isCaseOf?: Reference[]; +} + +export interface DataElement extends SubmodelElement { + nodeId?: string; +} + +export interface DataSpecificationContent { + modelType: ModelType; +} + +export interface DataSpecificationIec61360 extends DataSpecificationContent { + dataType?: DataTypeIec61360; + definition?: LangString[]; + levelType?: LevelType; + preferredName: LangString[]; + shortName?: LangString[]; + sourceOfDefinition?: string; + symbol?: string; + unit?: string; + unitId?: Reference; + value?: string; + valueFormat?: string; + valueList?: ValueList; +} + export interface EmbeddedDataSpecification { dataSpecification: Reference; dataSpecificationContent: DataSpecificationContent; } export interface Entity extends SubmodelElement { - statements?: SubmodelElement[]; entityType: EntityType; globalAssetId?: string; - specificAssetId?: SpecificAssetId; + specificAssetIds?: SpecificAssetId[]; + statements?: SubmodelElement[]; } -export type EntityType = 'CoManagedEntity' | 'SelfManagedEntity'; - export interface Environment { assetAdministrationShells: AssetAdministrationShell[]; - submodels: Submodel[]; conceptDescriptions: ConceptDescription[]; + submodels: Submodel[]; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface EventElement extends SubmodelElement {} +export type EventElement = SubmodelElement; -export interface EventPayload extends SubmodelElement { - source: Reference; - sourceSemanticId?: Reference; +export interface EventPayload { observableReference: Reference; observableSemanticId?: Reference; - topic?: string; + payload?: string; + source: Reference; + sourceSemanticId?: Reference; subjectId?: Reference; timeStamp: string; - payload?: string; + topic?: string; } -export interface Extension extends HasSemantic { +export interface Extension extends HasSemantics { name: string; - valueType?: DataTypeDefXsd; + refersTo?: Reference[]; value?: string; - refersTo?: Reference; + valueType?: DataTypeDefXsd; } export interface File extends DataElement { @@ -212,9 +268,9 @@ export interface HasKind { kind?: ModellingKind; } -export interface HasSemantic { +export interface HasSemantics { semanticId?: Reference; - supplementalSemanticIds?: Reference; + supplementalSemanticIds?: Reference[]; } export interface Identifiable extends Referable { @@ -227,74 +283,24 @@ export interface Key { value: string; } -export type KeyTypes = - | 'AnnotatedRelationshipElement' - | 'AssetAdministrationShell' - | 'BasicEventElement' - | 'Blob' - | 'Capability' - | 'ConceptDescription' - | 'DataElement' - | 'Entity' - | 'EventElement' - | 'File' - | 'FragmentReference' - | 'GlobalReference' - | 'Identifiable' - | 'MultiLanguageProperty' - | 'Operation' - | 'Property' - | 'Range' - | 'Referable' - | 'ReferenceElement' - | 'RelationshipElement' - | 'Submodel' - | 'SubmodelElement' - | 'SubmodelElementCollection' - | 'SubmodelElementList'; - -export interface LangString { - language: string; - text: string; +export interface LevelType { + max: boolean; + min: boolean; + nom: boolean; + typ: boolean; } -export type LevelType = 'Max' | 'Min' | 'Nom' | 'Typ'; - -export type ModelType = - | 'AnnotatedRelationshipElement' - | 'AssetAdministrationShell' - | 'BasicEventElement' - | 'Blob' - | 'Capability' - | 'ConceptDescription' - | 'DataSpecificationIec61360' - | 'Entity' - | 'File' - | 'MultiLanguageProperty' - | 'Operation' - | 'Property' - | 'Range' - | 'ReferenceElement' - | 'RelationshipElement' - | 'Submodel' - | 'SubmodelElementCollection' - | 'SubmodelElementList'; - -export type ModellingKind = 'Template' | 'Instance'; - export interface MultiLanguageProperty extends DataElement { - value: LangString[]; + value?: LangString[]; valueId?: Reference; } export interface Operation extends SubmodelElement { - inputVariables?: OperationVariable[]; - outputVariables?: OperationVariable[]; inoutputVariables?: OperationVariable[]; - /** The node ID of the operation node. */ + inputVariables?: OperationVariable[]; methodId?: string; - /** The node ID of the operation submodel element. */ objectId?: string; + outputVariables?: OperationVariable[]; } export interface OperationVariable { @@ -302,79 +308,69 @@ export interface OperationVariable { } export interface Property extends DataElement { - valueType: DataTypeDefXsd; value?: string; valueId?: Reference; + valueType: DataTypeDefXsd; } export interface Qualifiable { qualifiers?: Qualifier[]; } -export interface Qualifier extends HasSemantic { +export interface Qualifier extends HasSemantics { kind?: QualifierKind; type: string; - valueType: DataTypeDefXsd; value?: string; valueId?: Reference; + valueType: DataTypeDefXsd; } -export type QualifierKind = 'ConceptQualifier' | 'TemplateQualifier' | 'ValueQualifier'; - export interface Range extends DataElement { - valueType: DataTypeDefXsd; - min?: string; max?: string; + min?: string; + valueType: DataTypeDefXsd; } -/** Metainformation if SubmodelElement is DataElement */ -export type Category = 'CONSTANT' | 'PARAMETER' | 'VARIABLE'; - export interface Referable extends HasExtensions { - idShort: string; - modelType: ModelType; category?: string; - displayName?: LangString[]; description?: LangString[]; - /** For internal use. */ + displayName?: LangString[]; + idShort: string; + modelType: ModelType; parent?: Reference; } export interface Reference { - type: ReferenceTypes; - referredSemanticId?: Reference; keys: Key[]; + referredSemanticId?: Reference; + type: ReferenceTypes; } export interface ReferenceElement extends DataElement { value?: Reference; } -export type ReferenceTypes = 'ExternalReference' | 'ModelReference'; - export interface RelationshipElement extends SubmodelElement { first: Reference; second: Reference; } export interface Resource { - path: string; contentType?: string; + path: string; } -export interface SpecificAssetId extends HasSemantic { +export interface SpecificAssetId extends HasSemantics { + externalSubjectId?: Reference; name: string; value: string; - externalSubjectId?: Reference; } -export type StateOfEvent = 'on' | 'off'; - -export interface Submodel extends Identifiable, HasKind, HasSemantic, Qualifiable, HasDataSpecification { +export interface Submodel extends Qualifiable, HasKind, HasSemantics, HasDataSpecification, Identifiable { submodelElements?: SubmodelElement[]; } -export interface SubmodelElement extends Referable, HasKind, HasSemantic, Qualifiable, HasDataSpecification {} +export interface SubmodelElement extends Qualifiable, HasDataSpecification, HasSemantics, Referable {} export interface SubmodelElementCollection extends SubmodelElement { value?: SubmodelElement[]; @@ -383,9 +379,9 @@ export interface SubmodelElementCollection extends SubmodelElement { export interface SubmodelElementList extends SubmodelElement { orderRelevant?: boolean; semanticIdListElement?: Reference; - typeValueListElement: AasSubmodelElements; - valueTypeListElement?: DataTypeDefXsd; + typeValueListElement: AASSubmodelElements; value?: SubmodelElement[]; + valueTypeListElement?: DataTypeDefXsd; } export interface ValueList { diff --git a/projects/common/src/lib/document.ts b/projects/common/src/lib/document.ts index 34a4f2fd..f54bc57c 100644 --- a/projects/common/src/lib/document.ts +++ b/projects/common/src/lib/document.ts @@ -471,7 +471,7 @@ export function isDeepEqual(a?: aas.Environment, b?: aas.Environment): boolean { return true; } - function equalHasSemantic(a: aas.HasSemantic, b: aas.HasSemantic): boolean { + function equalHasSemantic(a: aas.HasSemantics, b: aas.HasSemantics): boolean { return equalReference(a.semanticId, b.semanticId); } @@ -577,11 +577,7 @@ export function isDeepEqual(a?: aas.Environment, b?: aas.Environment): boolean { function equalSubmodelElement(a: aas.SubmodelElement, b: aas.SubmodelElement): boolean { return ( - equalReferable(a, b) && - equalHasDataSpecification(a, b) && - equalHasSemantic(a, b) && - equalQualifiable(a, b) && - equalHasKind(a, b) + equalReferable(a, b) && equalHasDataSpecification(a, b) && equalHasSemantic(a, b) && equalQualifiable(a, b) ); } @@ -651,11 +647,29 @@ export function isDeepEqual(a?: aas.Environment, b?: aas.Environment): boolean { equalSubmodelElement(a, b) && a.entityType == b.entityType && a.globalAssetId === b.globalAssetId && - equalSpecificAssetId(a.specificAssetId, b.specificAssetId) && + equalSpecificAssetIds(a.specificAssetIds, b.specificAssetIds) && queueReferables(a.statements, b.statements) ); } + function equalSpecificAssetIds(a?: aas.SpecificAssetId[], b?: aas.SpecificAssetId[]): boolean { + if (a === b) { + return true; + } + + if (!a || !b || a.length != b.length) { + return false; + } + + for (let i = 0, n = a.length; i < n; i++) { + if (!equalSpecificAssetId(a[i], b[i])) { + return false; + } + } + + return true; + } + function equalSpecificAssetId(a?: aas.SpecificAssetId, b?: aas.SpecificAssetId): boolean { return ( a === b || @@ -956,7 +970,7 @@ export function getIEC61360Content( } } } else { - const semanticId = (referable as aas.HasSemantic).semanticId; + const semanticId = (referable as aas.HasSemantics).semanticId; if (semanticId) { const conceptDescription = selectReferable(env, semanticId); if (conceptDescription) {