diff --git a/package-lock.json b/package-lock.json index 101650d9..cd5dd7d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aas-portal-project", - "version": "3.0.0-development.61", + "version": "3.0.0-development.64", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aas-portal-project", - "version": "3.0.0-development.61", + "version": "3.0.0-development.64", "license": "Apache-2.0", "workspaces": [ "projects/fhg-jest", diff --git a/package.json b/package.json index ada57bb0..4d842b01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aas-portal-project", - "version": "3.0.0-development.63", + "version": "3.0.0-development.65", "description": "Web-based visualization and control of asset administration shells.", "type": "module", "scripts": { diff --git a/projects/aas-server/src/app/packages/aas-server/aas-api-client-v1.ts b/projects/aas-server/src/app/packages/aas-server/aas-api-client-v1.ts index 708ca9a1..48004628 100644 --- a/projects/aas-server/src/app/packages/aas-server/aas-api-client-v1.ts +++ b/projects/aas-server/src/app/packages/aas-server/aas-api-client-v1.ts @@ -21,7 +21,7 @@ import { import { encodeBase64Url } from '../../convert.js'; import { AASApiClient } from './aas-api-client.js'; import { Logger } from '../../logging/logger.js'; -import { JsonWriter } from '../json-writer.js'; +import { JsonWriterV3 } from '../json-writer-v3.js'; import * as aasv2 from '../../types/aas-v2.js'; import { JsonReaderV2 } from '../json-reader-v2.js'; @@ -201,21 +201,21 @@ export class AASApiClientV1 extends AASApiClient { private async putShellAsync(shell: aas.AssetAdministrationShell): Promise { const aasId = encodeBase64Url(shell.id); - return await this.message.put(this.resolve(`shells/${aasId}`), new JsonWriter().convert(shell)); + return await this.message.put(this.resolve(`shells/${aasId}`), new JsonWriterV3().convert(shell)); } private async putSubmodelAsync(aasId: string, submodel: aas.Submodel): Promise { const smId = encodeBase64Url(submodel.id); return await this.message.put( this.resolve(`shells/${aasId}/submodels/${smId}`), - new JsonWriter().convert(submodel), + new JsonWriterV3().convert(submodel), ); } private async postSubmodelAsync(aasId: string, submodel: aas.Submodel): Promise { return await this.message.post( this.resolve(`submodels?aasIdentifier=${aasId}`), - new JsonWriter().convert(submodel), + new JsonWriterV3().convert(submodel), ); } @@ -231,7 +231,7 @@ export class AASApiClientV1 extends AASApiClient { const path = getIdShortPath(submodelElement); return await this.message.put( this.resolve(`submodels/${smId}/submodel-elements/${path}`), - new JsonWriter().convert(submodelElement), + new JsonWriterV3().convert(submodelElement), ); } @@ -243,7 +243,7 @@ export class AASApiClientV1 extends AASApiClient { const path = getIdShortPath(submodelElement); return await this.message.post( this.resolve(`submodels/${smId}/submodel-elements/${path}`), - new JsonWriter().convert(submodelElement), + new JsonWriterV3().convert(submodelElement), ); } diff --git a/projects/aas-server/src/app/packages/aas-server/aas-api-client-v3.ts b/projects/aas-server/src/app/packages/aas-server/aas-api-client-v3.ts index e0629162..4f0743f6 100644 --- a/projects/aas-server/src/app/packages/aas-server/aas-api-client-v3.ts +++ b/projects/aas-server/src/app/packages/aas-server/aas-api-client-v3.ts @@ -12,8 +12,8 @@ import { createReadStream } from 'fs'; import { encodeBase64Url } from '../../convert.js'; import { AASApiClient } from './aas-api-client.js'; import { Logger } from '../../logging/logger.js'; -import { JsonReader } from '../json-reader.js'; -import { JsonWriter } from '../json-writer.js'; +import { JsonReaderV3 } from '../json-reader-v3.js'; +import { JsonWriterV3 } from '../json-writer-v3.js'; import { ERRORS } from '../../errors.js'; import { aas, @@ -104,7 +104,7 @@ export class AASApiClientV3 extends AASApiClient { conceptDescriptions: pagedResult.result, }; - return new JsonReader(sourceEnv).readEnvironment(); + return new JsonReaderV3(sourceEnv).readEnvironment(); } public override getThumbnailAsync(id: string): Promise { @@ -240,21 +240,21 @@ export class AASApiClientV3 extends AASApiClient { private async putShellAsync(shell: aas.AssetAdministrationShell): Promise { const aasId = encodeBase64Url(shell.id); - return await this.message.put(this.resolve(`shells/${aasId}`), new JsonWriter().convert(shell)); + return await this.message.put(this.resolve(`shells/${aasId}`), new JsonWriterV3().convert(shell)); } private async putSubmodelAsync(aasId: string, submodel: aas.Submodel): Promise { const smId = encodeBase64Url(submodel.id); return await this.message.put( this.resolve(`shells/${aasId}/submodels/${smId}`), - new JsonWriter().convert(submodel), + new JsonWriterV3().convert(submodel), ); } private async postSubmodelAsync(aasId: string, submodel: aas.Submodel): Promise { return await this.message.post( this.resolve(`submodels?aasIdentifier=${aasId}`), - new JsonWriter().convert(submodel), + new JsonWriterV3().convert(submodel), ); } @@ -270,7 +270,7 @@ export class AASApiClientV3 extends AASApiClient { const path = getIdShortPath(submodelElement); return await this.message.put( this.resolve(`submodels/${smId}/submodel-elements/${path}`), - new JsonWriter().convert(submodelElement), + new JsonWriterV3().convert(submodelElement), ); } @@ -282,7 +282,7 @@ export class AASApiClientV3 extends AASApiClient { const path = getIdShortPath(submodelElement); return await this.message.post( this.resolve(`submodels/${smId}/submodel-elements/${path}`), - new JsonWriter().convert(submodelElement), + new JsonWriterV3().convert(submodelElement), ); } diff --git a/projects/aas-server/src/app/packages/create-json-reader.ts b/projects/aas-server/src/app/packages/create-json-reader.ts index ff01e5bf..3ac154ce 100644 --- a/projects/aas-server/src/app/packages/create-json-reader.ts +++ b/projects/aas-server/src/app/packages/create-json-reader.ts @@ -9,7 +9,7 @@ import { aas } from 'aas-core'; import { AASReader } from './aas-reader.js'; import { JsonReaderV2 } from './json-reader-v2.js'; -import { JsonReader } from './json-reader.js'; +import { JsonReaderV3 } from './json-reader-v3.js'; import * as aasV2 from '../types/aas-v2.js'; export function createJsonReader(data: object): AASReader { @@ -18,11 +18,11 @@ export function createJsonReader(data: object): AASReader { } if (isEnvironment(data)) { - return new JsonReader(data); + return new JsonReaderV3(data); } if (isSubmodelElement(data)) { - return new JsonReader(); + return new JsonReaderV3(); } if (isSubmodelElementV2(data)) { diff --git a/projects/aas-server/src/app/packages/create-xml-reader.ts b/projects/aas-server/src/app/packages/create-xml-reader.ts index 4e0e68a4..2f2d53a7 100644 --- a/projects/aas-server/src/app/packages/create-xml-reader.ts +++ b/projects/aas-server/src/app/packages/create-xml-reader.ts @@ -11,7 +11,7 @@ import { AASReader } from './aas-reader.js'; import { HTMLDocumentElement } from '../types/html-document-element.js'; import { XmlReaderV1 } from './xml-reader-v1.js'; import { XmlReaderV2 } from './xml-reader-v2.js'; -import { XmlReader } from './xml-reader.js'; +import { XmlReaderV3 } from './xml-reader-v3.js'; export function createXmlReader(xml: string): AASReader { const document = new DOMParser().parseFromString(xml); @@ -27,7 +27,7 @@ export function createXmlReader(xml: string): AASReader { } if (uri === 'https://admin-shell.io/aas/3/0') { - return new XmlReader(document); + return new XmlReaderV3(document); } } 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 b73caae6..efb47167 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 @@ -21,7 +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'; +import { XmlWriterV3 } from '../xml-writer-v3.js'; export class AasxPackage extends AASPackage { private readonly file: string; @@ -73,7 +73,7 @@ export class AasxPackage extends AASPackage { } public override async setEnvironmentAsync(env: aas.Environment): Promise { - const writer = new XmlWriter(); + const writer = new XmlWriterV3(); const xml = writer.write(env); const path = await this.getOriginNameAsync(); (await this.zip).file(path, xml, { compression: 'DEFLATE' }); diff --git a/projects/aas-server/src/app/packages/json-reader.ts b/projects/aas-server/src/app/packages/json-reader-v3.ts similarity index 99% rename from projects/aas-server/src/app/packages/json-reader.ts rename to projects/aas-server/src/app/packages/json-reader-v3.ts index 983781ee..24aa213d 100644 --- a/projects/aas-server/src/app/packages/json-reader.ts +++ b/projects/aas-server/src/app/packages/json-reader-v3.ts @@ -11,7 +11,7 @@ import { aas, determineType, extensionToMimeType, isIdentifiable } from 'aas-cor import cloneDeep from 'lodash-es/cloneDeep.js'; import { encodeBase64Url } from '../convert.js'; -export class JsonReader extends AASReader { +export class JsonReaderV3 extends AASReader { private readonly origin: aas.Environment; public constructor(origin?: aas.Environment | string) { diff --git a/projects/aas-server/src/app/packages/json-writer.ts b/projects/aas-server/src/app/packages/json-writer-v3.ts similarity index 99% rename from projects/aas-server/src/app/packages/json-writer.ts rename to projects/aas-server/src/app/packages/json-writer-v3.ts index a10a1775..df882ebd 100644 --- a/projects/aas-server/src/app/packages/json-writer.ts +++ b/projects/aas-server/src/app/packages/json-writer-v3.ts @@ -11,7 +11,7 @@ import { aas, extensionToMimeType } from 'aas-core'; import { AASWriter } from './aas-writer.js'; /** */ -export class JsonWriter extends AASWriter { +export class JsonWriterV3 extends AASWriter { public override write(env: aas.Environment): string { const data: aas.Environment = { assetAdministrationShells: this.writeAssetAdministrationShells(env), diff --git a/projects/aas-server/src/app/packages/xml-reader.ts b/projects/aas-server/src/app/packages/xml-reader-v3.ts similarity index 99% rename from projects/aas-server/src/app/packages/xml-reader.ts rename to projects/aas-server/src/app/packages/xml-reader-v3.ts index 21f002d5..732269a3 100644 --- a/projects/aas-server/src/app/packages/xml-reader.ts +++ b/projects/aas-server/src/app/packages/xml-reader-v3.ts @@ -12,7 +12,7 @@ import { DOMParser } from '@xmldom/xmldom'; import { AASReader } from './aas-reader.js'; import { HTMLDocumentElement } from '../types/html-document-element.js'; -export class XmlReader extends AASReader { +export class XmlReaderV3 extends AASReader { private readonly select: XPathSelect; private readonly document: Document; diff --git a/projects/aas-server/src/app/packages/xml-writer.ts b/projects/aas-server/src/app/packages/xml-writer-v3.ts similarity index 97% rename from projects/aas-server/src/app/packages/xml-writer.ts rename to projects/aas-server/src/app/packages/xml-writer-v3.ts index 811956b3..370ed0b9 100644 --- a/projects/aas-server/src/app/packages/xml-writer.ts +++ b/projects/aas-server/src/app/packages/xml-writer-v3.ts @@ -11,7 +11,7 @@ import camelCase from 'lodash-es/camelCase.js'; import { DOMImplementation, XMLSerializer } from '@xmldom/xmldom'; import { AASWriter } from './aas-writer.js'; -export class XmlWriter extends AASWriter { +export class XmlWriterV3 extends AASWriter { private readonly document: Document; public constructor() { diff --git a/projects/aas-server/src/test/packages/json-reader.spec.ts b/projects/aas-server/src/test/packages/json-reader-v3.spec.ts similarity index 83% rename from projects/aas-server/src/test/packages/json-reader.spec.ts rename to projects/aas-server/src/test/packages/json-reader-v3.spec.ts index d59d8a23..ffe7457f 100644 --- a/projects/aas-server/src/test/packages/json-reader.spec.ts +++ b/projects/aas-server/src/test/packages/json-reader-v3.spec.ts @@ -7,17 +7,17 @@ *****************************************************************************/ import { readFile } from 'fs/promises'; -import { JsonReader } from '../../app/packages/json-reader.js'; +import { JsonReaderV3 } from '../../app/packages/json-reader-v3.js'; import { resolve } from 'path/posix'; import { describe, beforeEach, it, expect } from '@jest/globals'; -describe('JsonReader', function () { - let reader: JsonReader; +describe('JsonReaderV3', function () { + let reader: JsonReaderV3; let json: string; beforeEach(async function () { json = (await readFile(resolve('./src/test/assets/aas-example.json'))).toString(); - reader = new JsonReader(json); + reader = new JsonReaderV3(json); }); it('should be created', function () { diff --git a/projects/aas-server/src/test/packages/json-writer.spec.ts b/projects/aas-server/src/test/packages/json-writer-v3.spec.ts similarity index 81% rename from projects/aas-server/src/test/packages/json-writer.spec.ts rename to projects/aas-server/src/test/packages/json-writer-v3.spec.ts index ede3b5fc..ebb4dfc4 100644 --- a/projects/aas-server/src/test/packages/json-writer.spec.ts +++ b/projects/aas-server/src/test/packages/json-writer-v3.spec.ts @@ -6,16 +6,16 @@ * *****************************************************************************/ -import { JsonWriter } from '../../app/packages/json-writer.js'; +import { JsonWriterV3 } from '../../app/packages/json-writer-v3.js'; import env from '../assets/aas-environment.js'; import { describe, beforeEach, it, expect } from '@jest/globals'; describe('JsonWriter', function () { describe('writeEnvironment', function () { - let writer: JsonWriter; + let writer: JsonWriterV3; beforeEach(() => { - writer = new JsonWriter(); + writer = new JsonWriterV3(); }); it('writes an AAS environment', () => { @@ -24,10 +24,10 @@ describe('JsonWriter', function () { }); describe('write', () => { - let writer: JsonWriter; + let writer: JsonWriterV3; beforeEach(() => { - writer = new JsonWriter(); + writer = new JsonWriterV3(); }); it('does not support writing an AAS', () => { diff --git a/projects/aas-server/src/test/packages/xml-reader.spec.ts b/projects/aas-server/src/test/packages/xml-reader-v3.spec.ts similarity index 85% rename from projects/aas-server/src/test/packages/xml-reader.spec.ts rename to projects/aas-server/src/test/packages/xml-reader-v3.spec.ts index 15840d0c..5216a5c4 100644 --- a/projects/aas-server/src/test/packages/xml-reader.spec.ts +++ b/projects/aas-server/src/test/packages/xml-reader-v3.spec.ts @@ -9,10 +9,10 @@ import { describe, beforeAll, beforeEach, it, expect } from '@jest/globals'; import { readFile } from 'fs/promises'; import { resolve } from 'path/posix'; -import { XmlReader } from '../../app/packages/xml-reader.js'; +import { XmlReaderV3 } from '../../app/packages/xml-reader-v3.js'; -describe('XmlReader', function () { - let reader: XmlReader; +describe('XmlReaderV3', function () { + let reader: XmlReaderV3; let xml: string; let path: string; @@ -22,7 +22,7 @@ describe('XmlReader', function () { }); beforeEach(function () { - reader = new XmlReader(xml); + reader = new XmlReaderV3(xml); }); it('should be created', function () { diff --git a/projects/aas-server/src/test/packages/xml-writer.spec.ts b/projects/aas-server/src/test/packages/xml-writer-v3.spec.ts similarity index 81% rename from projects/aas-server/src/test/packages/xml-writer.spec.ts rename to projects/aas-server/src/test/packages/xml-writer-v3.spec.ts index 071ee77f..ad8f11f4 100644 --- a/projects/aas-server/src/test/packages/xml-writer.spec.ts +++ b/projects/aas-server/src/test/packages/xml-writer-v3.spec.ts @@ -8,13 +8,13 @@ import { describe, beforeEach, it, expect } from '@jest/globals'; import env from '../assets/aas-environment.js'; -import { XmlWriter } from '../../app/packages/xml-writer.js'; +import { XmlWriterV3 } from '../../app/packages/xml-writer-v3.js'; -describe('XmlWriter', () => { - let writer: XmlWriter; +describe('XmlWriterV3', () => { + let writer: XmlWriterV3; beforeEach(() => { - writer = new XmlWriter(); + writer = new XmlWriterV3(); }); describe('writeEnvironment', () => {