From 272de50e7d9e12fe4e70ef9c6d3cf948c40ccb50 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 21 Jul 2024 19:55:18 +0000 Subject: [PATCH 1/3] chore(Release): 3.0.0-development.64 # [3.0.0-development.64](https://github.com/FraunhoferIOSB/AASPortal/compare/v3.0.0-development.63...v3.0.0-development.64) (2024-07-21) ### Bug Fixes * add AASApiClientV1 ([4c55786](https://github.com/FraunhoferIOSB/AASPortal/commit/4c5578650e072132d451cde6e3cb1c5b0610a0b4)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ada57bb..4ff0266 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.64", "description": "Web-based visualization and control of asset administration shells.", "type": "module", "scripts": { From 34a45c3e1ee27e0097adb44b95c70068972a4f87 Mon Sep 17 00:00:00 2001 From: Ralf Aron Date: Tue, 23 Jul 2024 13:07:45 +0200 Subject: [PATCH 2/3] fix: rename append version to reader/writer --- package-lock.json | 4 ++-- .../app/packages/aas-server/aas-api-client-v1.ts | 12 ++++++------ .../app/packages/aas-server/aas-api-client-v3.ts | 16 ++++++++-------- .../src/app/packages/create-json-reader.ts | 6 +++--- .../src/app/packages/create-xml-reader.ts | 4 ++-- .../src/app/packages/file-system/aasx-package.ts | 4 ++-- .../{json-reader.ts => json-reader-v3.ts} | 2 +- .../{json-writer.ts => json-writer-v3.ts} | 2 +- .../packages/{xml-reader.ts => xml-reader-v3.ts} | 2 +- .../packages/{xml-writer.ts => xml-writer-v3.ts} | 2 +- ...son-reader.spec.ts => json-reader-v3.spec.ts} | 8 ++++---- ...son-writer.spec.ts => json-writer-v3.spec.ts} | 10 +++++----- ...{xml-reader.spec.ts => xml-reader-v3.spec.ts} | 8 ++++---- ...{xml-writer.spec.ts => xml-writer-v3.spec.ts} | 8 ++++---- 14 files changed, 44 insertions(+), 44 deletions(-) rename projects/aas-server/src/app/packages/{json-reader.ts => json-reader-v3.ts} (99%) rename projects/aas-server/src/app/packages/{json-writer.ts => json-writer-v3.ts} (99%) rename projects/aas-server/src/app/packages/{xml-reader.ts => xml-reader-v3.ts} (99%) rename projects/aas-server/src/app/packages/{xml-writer.ts => xml-writer-v3.ts} (97%) rename projects/aas-server/src/test/packages/{json-reader.spec.ts => json-reader-v3.spec.ts} (83%) rename projects/aas-server/src/test/packages/{json-writer.spec.ts => json-writer-v3.spec.ts} (81%) rename projects/aas-server/src/test/packages/{xml-reader.spec.ts => xml-reader-v3.spec.ts} (85%) rename projects/aas-server/src/test/packages/{xml-writer.spec.ts => xml-writer-v3.spec.ts} (81%) diff --git a/package-lock.json b/package-lock.json index 101650d..cd5dd7d 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/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 708ca9a..4800462 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 e062916..4f0743f 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 ff01e5b..3ac154c 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 4e0e68a..2f2d53a 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 b73caae..efb4716 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 983781e..24aa213 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 a10a177..df882eb 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 21f002d..732269a 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 811956b..370ed0b 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 d59d8a2..ffe7457 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 ede3b5f..ebb4dfc 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 15840d0..5216a5c 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 071ee77..ad8f11f 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', () => { From c0e8fc8debe881d04db93f5627207867194b6cab Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 23 Jul 2024 11:09:34 +0000 Subject: [PATCH 3/3] chore(Release): 3.0.0-development.65 # [3.0.0-development.65](https://github.com/FraunhoferIOSB/AASPortal/compare/v3.0.0-development.64...v3.0.0-development.65) (2024-07-23) ### Bug Fixes * rename append version to reader/writer ([34a45c3](https://github.com/FraunhoferIOSB/AASPortal/commit/34a45c3e1ee27e0097adb44b95c70068972a4f87)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ff0266..4d842b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aas-portal-project", - "version": "3.0.0-development.64", + "version": "3.0.0-development.65", "description": "Web-based visualization and control of asset administration shells.", "type": "module", "scripts": {