basyx-typescript-sdk 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/bundle/index.cjs +64 -51
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +40 -27
- package/bundle/index.mjs.map +1 -1
- package/dist/clients/AasDiscoveryClient.d.ts +1 -1
- package/dist/clients/AasRepositoryClient.d.ts +1 -1
- package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +1 -1
- package/dist/clients/SubmodelRepositoryClient.d.ts +1 -1
- package/dist/lib/aas-dataformat-xml/xmlization.js +12 -12
- package/dist/lib/convertAasDiscoveryTypes.d.ts +1 -1
- package/dist/lib/convertAasDiscoveryTypes.js +2 -2
- package/dist/lib/convertAasTypes.d.ts +1 -1
- package/dist/lib/convertAasTypes.js +2 -2
- package/dist/lib/convertConceptDescriptionTypes.d.ts +1 -1
- package/dist/lib/convertConceptDescriptionTypes.js +2 -2
- package/dist/lib/convertSubmodelTypes.d.ts +1 -1
- package/dist/lib/convertSubmodelTypes.js +2 -2
- package/dist/lib/descriptorJsonization.d.ts +2 -2
- package/dist/lib/descriptorJsonization.js +3 -3
- package/dist/models/BaSyxEnvironment.d.ts +1 -1
- package/dist/models/BaSyxEnvironment.js +1 -1
- package/dist/models/Descriptors.d.ts +1 -1
- package/dist/services/AasService.d.ts +1 -1
- package/dist/services/AasService.js +1 -1
- package/dist/services/SubmodelService.d.ts +1 -1
- package/dist/services/SubmodelService.js +1 -1
- package/dist/utils/KeyTypesUtil.d.ts +1 -1
- package/dist/utils/KeyTypesUtil.js +1 -1
- package/dist/utils/MultiLanguagePropertyUtils.d.ts +1 -1
- package/dist/utils/MultiLanguagePropertyUtils.js +1 -1
- package/dist/utils/ReferableUtils.d.ts +1 -1
- package/dist/utils/ReferableUtils.js +1 -1
- package/dist/utils/ReferenceUtil.d.ts +1 -1
- package/dist/utils/SemanticIdUtils.d.ts +1 -1
- package/dist/utils/SemanticIdUtils.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -49,12 +49,12 @@ yarn add basyx-typescript-sdk
|
|
|
49
49
|
---
|
|
50
50
|
|
|
51
51
|
> [!IMPORTANT]
|
|
52
|
-
> Make sure to also install `@aas-core-works/aas-core3.
|
|
52
|
+
> Make sure to also install `@aas-core-works/aas-core3.1-typescript` in your project:
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
npm install @aas-core-works/aas-core3.
|
|
55
|
+
npm install @aas-core-works/aas-core3.1-typescript
|
|
56
56
|
# or
|
|
57
|
-
yarn add @aas-core-works/aas-core3.
|
|
57
|
+
yarn add @aas-core-works/aas-core3.1-typescript
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
## Import Styles
|
|
@@ -133,7 +133,7 @@ async function getAllShells() {
|
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
135
|
import { AasService, Configuration } from 'basyx-typescript-sdk';
|
|
136
|
-
import { AssetAdministrationShell, AssetInformation, AssetKind } from '@aas-core-works/aas-core3.
|
|
136
|
+
import { AssetAdministrationShell, AssetInformation, AssetKind } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
137
137
|
|
|
138
138
|
// Initialize service with both registry and repository
|
|
139
139
|
const service = new AasService({
|
|
@@ -245,7 +245,7 @@ if (withConceptDescriptions.success) {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
// Resolve a Reference to get endpoints for AAS, Submodel, or SubmodelElement
|
|
248
|
-
import { Reference, Key, KeyTypes, ReferenceTypes } from '@aas-core-works/aas-core3.
|
|
248
|
+
import { Reference, Key, KeyTypes, ReferenceTypes } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
249
249
|
|
|
250
250
|
// Example 1: Reference to AAS and Submodel
|
|
251
251
|
const reference1 = new Reference(
|
|
@@ -314,7 +314,7 @@ if (allWithCD.success) {
|
|
|
314
314
|
|
|
315
315
|
```typescript
|
|
316
316
|
import { SubmodelService, Configuration } from 'basyx-typescript-sdk';
|
|
317
|
-
import { Submodel, ModellingKind } from '@aas-core-works/aas-core3.
|
|
317
|
+
import { Submodel, ModellingKind } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
318
318
|
|
|
319
319
|
// Initialize service with both registry and repository
|
|
320
320
|
const service = new SubmodelService({
|
|
@@ -429,7 +429,7 @@ const byEndpointWithCD = await serviceWithCD.getSubmodelByEndpoint({
|
|
|
429
429
|
|
|
430
430
|
```typescript
|
|
431
431
|
import { getSubmodelElementByIdShort, extractEndpointHref, base64Encode } from 'basyx-typescript-sdk';
|
|
432
|
-
import { Submodel } from '@aas-core-works/aas-core3.
|
|
432
|
+
import { Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
433
433
|
|
|
434
434
|
// Get a submodel element by its idShort
|
|
435
435
|
const element = getSubmodelElementByIdShort(submodel, 'MyProperty');
|
|
@@ -447,7 +447,7 @@ const encoded = base64Encode('https://example.com/ids/aas/my-aas');
|
|
|
447
447
|
```typescript
|
|
448
448
|
import { serializeXml, deserializeXml } from 'basyx-typescript-sdk';
|
|
449
449
|
import { BaSyxEnvironment } from 'basyx-typescript-sdk';
|
|
450
|
-
import { AssetAdministrationShell, AssetInformation, AssetKind, Submodel, ModellingKind } from '@aas-core-works/aas-core3.
|
|
450
|
+
import { AssetAdministrationShell, AssetInformation, AssetKind, Submodel, ModellingKind } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
451
451
|
|
|
452
452
|
// Create an environment with AAS and Submodels
|
|
453
453
|
const environment = new BaSyxEnvironment(
|
package/bundle/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var aasCore3_1Typescript = require('@aas-core-works/aas-core3.1-typescript');
|
|
4
4
|
|
|
5
5
|
/* tslint:disable */
|
|
6
6
|
/* eslint-disable */
|
|
@@ -6381,7 +6381,8 @@ function base64Decode(urlSafeBase64String) {
|
|
|
6381
6381
|
}
|
|
6382
6382
|
|
|
6383
6383
|
/**
|
|
6384
|
-
*
|
|
6384
|
+
* --- WORK IN PROGRESS ---
|
|
6385
|
+
* Provide an implementation of the Asset Administration Shell (AAS) V3.1.
|
|
6385
6386
|
*
|
|
6386
6387
|
* @remarks
|
|
6387
6388
|
* The presented version of the Metamodel is related to the work of
|
|
@@ -6690,9 +6691,8 @@ return 3;// AssetAdministrationShell
|
|
|
6690
6691
|
* optional.
|
|
6691
6692
|
*
|
|
6692
6693
|
* Constraint `AASd-116`:
|
|
6693
|
-
* `globalAssetId` is a reserved key
|
|
6694
|
-
*
|
|
6695
|
-
* identical to {@link AssetInformation.globalAssetId}.
|
|
6694
|
+
* `globalAssetId` is a reserved key for {@link SpecificAssetId.name} with the
|
|
6695
|
+
* semantics as defined in {@link AssetInformation.globalAssetId}.
|
|
6696
6696
|
*
|
|
6697
6697
|
* **Note**:
|
|
6698
6698
|
* Constraint AASd-116 is important to enable a generic search across
|
|
@@ -6718,8 +6718,9 @@ return 3;// AssetAdministrationShell
|
|
|
6718
6718
|
// which do not provide JIT compilation of hot paths.
|
|
6719
6719
|
return 4;// AssetInformation
|
|
6720
6720
|
}/**
|
|
6721
|
-
* Denotes whether the Asset is of kind {@link AssetKind.Type}
|
|
6722
|
-
* {@link AssetKind.Instance}.
|
|
6721
|
+
* Denotes whether the Asset is of kind {@link AssetKind.Type},
|
|
6722
|
+
* {@link AssetKind.Instance}, {@link AssetKind.Role}, or
|
|
6723
|
+
* {@link AssetKind.NotApplicable}.
|
|
6723
6724
|
*/ /**
|
|
6724
6725
|
* Yield from {@link specificAssetIds} if it is set, or yield nothing.
|
|
6725
6726
|
*/*overSpecificAssetIdsOrEmpty(){if(this.specificAssetIds!==null){yield*this.specificAssetIds;}return;}/**
|
|
@@ -6757,8 +6758,9 @@ return 4;// AssetInformation
|
|
|
6757
6758
|
* @paramType T - type of the transformation result
|
|
6758
6759
|
* @paramType ContextT - type of the transformation context
|
|
6759
6760
|
*/transformWithContext(transformer,context){return transformer.transformAssetInformationWithContext(this,context);}constructor(assetKind,globalAssetId=null,specificAssetIds=null,assetType=null,defaultThumbnail=null){super();this.assetKind=assetKind;this.globalAssetId=globalAssetId;this.specificAssetIds=specificAssetIds;this.assetType=assetType;this.defaultThumbnail=defaultThumbnail;}}/**
|
|
6760
|
-
* Enumeration for denoting whether an asset is a type asset or an instance
|
|
6761
|
-
|
|
6761
|
+
* Enumeration for denoting whether an asset is a type asset or an instance
|
|
6762
|
+
* asset or is a role or whether this kind of classification is not applicable.
|
|
6763
|
+
*/let AssetKind=/*#__PURE__*/function(AssetKind){AssetKind[AssetKind["Type"]=0]="Type";AssetKind[AssetKind["Instance"]=1]="Instance";AssetKind[AssetKind["Role"]=2]="Role";AssetKind[AssetKind["NotApplicable"]=3]="NotApplicable";return AssetKind;}({});/**
|
|
6762
6764
|
* A specific asset ID describes a generic supplementary identifying attribute of the
|
|
6763
6765
|
* asset.
|
|
6764
6766
|
*
|
|
@@ -6929,8 +6931,6 @@ return 12;// MultiLanguageProperty
|
|
|
6929
6931
|
*/*overEmbeddedDataSpecificationsOrEmpty(){if(this.embeddedDataSpecifications!==null){yield*this.embeddedDataSpecifications;}return;}/**
|
|
6930
6932
|
* Yield from {@link value} if it is set, or yield nothing.
|
|
6931
6933
|
*/*overValueOrEmpty(){if(this.value!==null){yield*this.value;}return;}/**
|
|
6932
|
-
* @returns {@link category} if set or the default value otherwise.
|
|
6933
|
-
*/categoryOrDefault(){return this.category!==null?this.category:"VARIABLE";}/**
|
|
6934
6934
|
* Iterate over the instances referenced from this instance.
|
|
6935
6935
|
*
|
|
6936
6936
|
* We do not recurse into the referenced instances.
|
|
@@ -7511,11 +7511,11 @@ return 32;// ValueReferencePair
|
|
|
7511
7511
|
* We do not recurse into the referenced instances.
|
|
7512
7512
|
*
|
|
7513
7513
|
* @returns Iterator over the referenced instances
|
|
7514
|
-
*/*descendOnce(){yield this.valueId;}/**
|
|
7514
|
+
*/*descendOnce(){if(this.valueId!==null){yield this.valueId;}}/**
|
|
7515
7515
|
* Iterate recursively over the instances referenced from this instance.
|
|
7516
7516
|
*
|
|
7517
7517
|
* @returns Iterator over the referenced instances
|
|
7518
|
-
*/*descend(){yield this.valueId;yield*this.valueId.descend();}/**
|
|
7518
|
+
*/*descend(){if(this.valueId!==null){yield this.valueId;yield*this.valueId.descend();}}/**
|
|
7519
7519
|
* Dispatch `visitor` on this instance.
|
|
7520
7520
|
*
|
|
7521
7521
|
* @param visitor - to visit this instance
|
|
@@ -7539,7 +7539,7 @@ return 32;// ValueReferencePair
|
|
|
7539
7539
|
* @returns transformation of this instance
|
|
7540
7540
|
* @paramType T - type of the transformation result
|
|
7541
7541
|
* @paramType ContextT - type of the transformation context
|
|
7542
|
-
*/transformWithContext(transformer,context){return transformer.transformValueReferencePairWithContext(this,context);}constructor(value,valueId){super();this.value=value;this.valueId=valueId;}}/**
|
|
7542
|
+
*/transformWithContext(transformer,context){return transformer.transformValueReferencePairWithContext(this,context);}constructor(value,valueId=null){super();this.value=value;this.valueId=valueId;}}/**
|
|
7543
7543
|
* A set of value reference pairs.
|
|
7544
7544
|
*/class ValueList extends Class{/**
|
|
7545
7545
|
* Indicate the runtime model type of the instance.
|
|
@@ -7854,7 +7854,7 @@ function convertApiAssetIdToCoreAssetId(assetId) {
|
|
|
7854
7854
|
// then parse
|
|
7855
7855
|
assetIdStr = JSON.parse(assetIdStr);
|
|
7856
7856
|
// then jsonize
|
|
7857
|
-
const instanceOrError =
|
|
7857
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.specificAssetIdFromJsonable(assetIdStr);
|
|
7858
7858
|
if (instanceOrError.error !== null) {
|
|
7859
7859
|
throw instanceOrError.error;
|
|
7860
7860
|
}
|
|
@@ -7872,7 +7872,7 @@ function convertApiAssetIdToCoreAssetId(assetId) {
|
|
|
7872
7872
|
*/
|
|
7873
7873
|
function convertCoreAssetIdToApiAssetId(assetId) {
|
|
7874
7874
|
// first jsonize
|
|
7875
|
-
const jsonableAssetId =
|
|
7875
|
+
const jsonableAssetId = aasCore3_1Typescript.jsonization.toJsonable(assetId);
|
|
7876
7876
|
// then stringify
|
|
7877
7877
|
const assetIdStr = JSON.stringify(jsonableAssetId);
|
|
7878
7878
|
// then parse
|
|
@@ -8235,7 +8235,7 @@ function mustQualifierKindToString(value) {
|
|
|
8235
8235
|
}
|
|
8236
8236
|
return result;
|
|
8237
8237
|
}
|
|
8238
|
-
const ASSET_KIND_FROM_STRING = new Map([["Type", AssetKind.Type], ["Instance", AssetKind.Instance], ["NotApplicable", AssetKind.NotApplicable]]);
|
|
8238
|
+
const ASSET_KIND_FROM_STRING = new Map([["Type", AssetKind.Type], ["Instance", AssetKind.Instance], ["Role", AssetKind.Role], ["NotApplicable", AssetKind.NotApplicable]]);
|
|
8239
8239
|
|
|
8240
8240
|
/**
|
|
8241
8241
|
* Parse `text` as a string representation of {@link types!AssetKind}.
|
|
@@ -8247,7 +8247,7 @@ function assetKindFromString(text) {
|
|
|
8247
8247
|
const result = ASSET_KIND_FROM_STRING.get(text);
|
|
8248
8248
|
return result !== undefined ? result : null;
|
|
8249
8249
|
}
|
|
8250
|
-
const ASSET_KIND_TO_STRING = new Map([[AssetKind.Type, "Type"], [AssetKind.Instance, "Instance"], [AssetKind.NotApplicable, "NotApplicable"]]);
|
|
8250
|
+
const ASSET_KIND_TO_STRING = new Map([[AssetKind.Type, "Type"], [AssetKind.Instance, "Instance"], [AssetKind.Role, "Role"], [AssetKind.NotApplicable, "NotApplicable"]]);
|
|
8251
8251
|
|
|
8252
8252
|
/**
|
|
8253
8253
|
* Translate {@link types!AssetKind} to a string.
|
|
@@ -9899,9 +9899,6 @@ function valueReferencePairFromJsonable(jsonable) {
|
|
|
9899
9899
|
if (setter.value === null) {
|
|
9900
9900
|
return newDeserializationError("The required property 'value' is missing");
|
|
9901
9901
|
}
|
|
9902
|
-
if (setter.valueId === null) {
|
|
9903
|
-
return newDeserializationError("The required property 'valueId' is missing");
|
|
9904
|
-
}
|
|
9905
9902
|
return new Either(new ValueReferencePair(setter.value, setter.valueId), null);
|
|
9906
9903
|
}
|
|
9907
9904
|
|
|
@@ -10961,8 +10958,12 @@ class Serializer extends AbstractTransformer {
|
|
|
10961
10958
|
}
|
|
10962
10959
|
jsonable["embeddedDataSpecifications"] = embeddedDataSpecificationsArray;
|
|
10963
10960
|
}
|
|
10964
|
-
|
|
10965
|
-
|
|
10961
|
+
if (that.first !== null) {
|
|
10962
|
+
jsonable["first"] = this.transform(that.first);
|
|
10963
|
+
}
|
|
10964
|
+
if (that.second !== null) {
|
|
10965
|
+
jsonable["second"] = this.transform(that.second);
|
|
10966
|
+
}
|
|
10966
10967
|
jsonable["modelType"] = "RelationshipElement";
|
|
10967
10968
|
return jsonable;
|
|
10968
10969
|
}
|
|
@@ -11458,7 +11459,9 @@ class Serializer extends AbstractTransformer {
|
|
|
11458
11459
|
if (that.value !== null) {
|
|
11459
11460
|
jsonable["value"] = base64Encode(that.value);
|
|
11460
11461
|
}
|
|
11461
|
-
|
|
11462
|
+
if (that.contentType !== null) {
|
|
11463
|
+
jsonable["contentType"] = that.contentType;
|
|
11464
|
+
}
|
|
11462
11465
|
jsonable["modelType"] = "Blob";
|
|
11463
11466
|
return jsonable;
|
|
11464
11467
|
}
|
|
@@ -11525,7 +11528,9 @@ class Serializer extends AbstractTransformer {
|
|
|
11525
11528
|
if (that.value !== null) {
|
|
11526
11529
|
jsonable["value"] = that.value;
|
|
11527
11530
|
}
|
|
11528
|
-
|
|
11531
|
+
if (that.contentType !== null) {
|
|
11532
|
+
jsonable["contentType"] = that.contentType;
|
|
11533
|
+
}
|
|
11529
11534
|
jsonable["modelType"] = "File";
|
|
11530
11535
|
return jsonable;
|
|
11531
11536
|
}
|
|
@@ -11589,8 +11594,12 @@ class Serializer extends AbstractTransformer {
|
|
|
11589
11594
|
}
|
|
11590
11595
|
jsonable["embeddedDataSpecifications"] = embeddedDataSpecificationsArray;
|
|
11591
11596
|
}
|
|
11592
|
-
|
|
11593
|
-
|
|
11597
|
+
if (that.first !== null) {
|
|
11598
|
+
jsonable["first"] = this.transform(that.first);
|
|
11599
|
+
}
|
|
11600
|
+
if (that.second !== null) {
|
|
11601
|
+
jsonable["second"] = this.transform(that.second);
|
|
11602
|
+
}
|
|
11594
11603
|
if (that.annotations !== null) {
|
|
11595
11604
|
const annotationsArray = new Array();
|
|
11596
11605
|
for (const item of that.annotations) {
|
|
@@ -11668,7 +11677,9 @@ class Serializer extends AbstractTransformer {
|
|
|
11668
11677
|
}
|
|
11669
11678
|
jsonable["statements"] = statementsArray;
|
|
11670
11679
|
}
|
|
11671
|
-
|
|
11680
|
+
if (that.entityType !== null) {
|
|
11681
|
+
jsonable["entityType"] = mustEntityTypeToString(that.entityType);
|
|
11682
|
+
}
|
|
11672
11683
|
if (that.globalAssetId !== null) {
|
|
11673
11684
|
jsonable["globalAssetId"] = that.globalAssetId;
|
|
11674
11685
|
}
|
|
@@ -12137,7 +12148,9 @@ class Serializer extends AbstractTransformer {
|
|
|
12137
12148
|
transformValueReferencePair(that) {
|
|
12138
12149
|
const jsonable = {};
|
|
12139
12150
|
jsonable["value"] = that.value;
|
|
12140
|
-
|
|
12151
|
+
if (that.valueId !== null) {
|
|
12152
|
+
jsonable["valueId"] = this.transform(that.valueId);
|
|
12153
|
+
}
|
|
12141
12154
|
return jsonable;
|
|
12142
12155
|
}
|
|
12143
12156
|
|
|
@@ -12348,13 +12361,13 @@ function assetKindToJsonable(assetKind) {
|
|
|
12348
12361
|
}
|
|
12349
12362
|
function assetAdministrationShellDescriptorFromJsonable(json) {
|
|
12350
12363
|
if (json === null) {
|
|
12351
|
-
return new
|
|
12364
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError('Expected a JSON object, but got null'));
|
|
12352
12365
|
}
|
|
12353
12366
|
if (Array.isArray(json)) {
|
|
12354
|
-
return new
|
|
12367
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError('Expected a JSON object, but got a JSON array'));
|
|
12355
12368
|
}
|
|
12356
12369
|
if (typeof json !== 'object') {
|
|
12357
|
-
return new
|
|
12370
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError(`Expected a JSON object, but got: ${typeof json}`));
|
|
12358
12371
|
}
|
|
12359
12372
|
const obj = json;
|
|
12360
12373
|
try {
|
|
@@ -12378,21 +12391,21 @@ function assetAdministrationShellDescriptorFromJsonable(json) {
|
|
|
12378
12391
|
? obj.submodelDescriptors.map((e) => submodelDescriptorFromJsonable(e).mustValue())
|
|
12379
12392
|
: null;
|
|
12380
12393
|
const endpoints = obj.endpoints ? obj.endpoints.map(endpointFromJsonable) : null;
|
|
12381
|
-
return new
|
|
12394
|
+
return new aasCore3_1Typescript.common.Either(new AssetAdministrationShellDescriptor(obj.id, displayName, description, extensions, administration, obj.idShort ?? null, assetKind, obj.assetType ?? null, obj.globalAssetId ?? null, specificAssetIds, submodelDescriptors, endpoints), null);
|
|
12382
12395
|
}
|
|
12383
12396
|
catch (err) {
|
|
12384
|
-
return new
|
|
12397
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError(err.message));
|
|
12385
12398
|
}
|
|
12386
12399
|
}
|
|
12387
12400
|
function submodelDescriptorFromJsonable(json) {
|
|
12388
12401
|
if (json === null) {
|
|
12389
|
-
return new
|
|
12402
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError('Expected a JSON object, but got null'));
|
|
12390
12403
|
}
|
|
12391
12404
|
if (Array.isArray(json)) {
|
|
12392
|
-
return new
|
|
12405
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError('Expected a JSON object, but got a JSON array'));
|
|
12393
12406
|
}
|
|
12394
12407
|
if (typeof json !== 'object') {
|
|
12395
|
-
return new
|
|
12408
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError(`Expected a JSON object, but got: ${typeof json}`));
|
|
12396
12409
|
}
|
|
12397
12410
|
const obj = json;
|
|
12398
12411
|
try {
|
|
@@ -12414,10 +12427,10 @@ function submodelDescriptorFromJsonable(json) {
|
|
|
12414
12427
|
: null;
|
|
12415
12428
|
//const endpoints = json.endpoints?.map(endpointFromJsonable);
|
|
12416
12429
|
const endpoints = obj.endpoints.map(endpointFromJsonable);
|
|
12417
|
-
return new
|
|
12430
|
+
return new aasCore3_1Typescript.common.Either(new SubmodelDescriptor(obj.id, endpoints, administration, obj.idShort ?? null, semanticId, supplementalSemanticIds, displayName, description, extensions), null);
|
|
12418
12431
|
}
|
|
12419
12432
|
catch (err) {
|
|
12420
|
-
return new
|
|
12433
|
+
return new aasCore3_1Typescript.common.Either(null, new DeserializationError(err.message));
|
|
12421
12434
|
}
|
|
12422
12435
|
}
|
|
12423
12436
|
function endpointFromJsonable(json) {
|
|
@@ -12888,7 +12901,7 @@ function convertApiAasToCoreAas(aas) {
|
|
|
12888
12901
|
// then parse
|
|
12889
12902
|
shell = JSON.parse(shell);
|
|
12890
12903
|
// then jsonize
|
|
12891
|
-
const instanceOrError =
|
|
12904
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.assetAdministrationShellFromJsonable(shell);
|
|
12892
12905
|
if (instanceOrError.error !== null) {
|
|
12893
12906
|
throw instanceOrError.error;
|
|
12894
12907
|
}
|
|
@@ -12906,7 +12919,7 @@ function convertApiAasToCoreAas(aas) {
|
|
|
12906
12919
|
*/
|
|
12907
12920
|
function convertCoreAasToApiAas(aas) {
|
|
12908
12921
|
// first jsonize
|
|
12909
|
-
const jsonableAas =
|
|
12922
|
+
const jsonableAas = aasCore3_1Typescript.jsonization.toJsonable(aas);
|
|
12910
12923
|
// then stringify
|
|
12911
12924
|
const shell = JSON.stringify(jsonableAas);
|
|
12912
12925
|
// then parse
|
|
@@ -12925,7 +12938,7 @@ function convertApiAssetInformationToCoreAssetInformation(assetInformation) {
|
|
|
12925
12938
|
// then parse
|
|
12926
12939
|
asset = JSON.parse(asset);
|
|
12927
12940
|
// then jsonize
|
|
12928
|
-
const instanceOrError =
|
|
12941
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.assetInformationFromJsonable(asset);
|
|
12929
12942
|
if (instanceOrError.error !== null) {
|
|
12930
12943
|
throw instanceOrError.error;
|
|
12931
12944
|
}
|
|
@@ -12943,7 +12956,7 @@ function convertApiAssetInformationToCoreAssetInformation(assetInformation) {
|
|
|
12943
12956
|
*/
|
|
12944
12957
|
function convertCoreAssetInformationToApiAssetInformation(assetInformation) {
|
|
12945
12958
|
// first jsonize
|
|
12946
|
-
const jsonableAsset =
|
|
12959
|
+
const jsonableAsset = aasCore3_1Typescript.jsonization.toJsonable(assetInformation);
|
|
12947
12960
|
// then stringify
|
|
12948
12961
|
const asset = JSON.stringify(jsonableAsset);
|
|
12949
12962
|
// then parse
|
|
@@ -12962,7 +12975,7 @@ function convertApiReferenceToCoreReference(reference) {
|
|
|
12962
12975
|
// then parse
|
|
12963
12976
|
ref = JSON.parse(ref);
|
|
12964
12977
|
// then jsonize
|
|
12965
|
-
const instanceOrError =
|
|
12978
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.referenceFromJsonable(ref);
|
|
12966
12979
|
if (instanceOrError.error !== null) {
|
|
12967
12980
|
throw instanceOrError.error;
|
|
12968
12981
|
}
|
|
@@ -12980,7 +12993,7 @@ function convertApiReferenceToCoreReference(reference) {
|
|
|
12980
12993
|
*/
|
|
12981
12994
|
function convertCoreReferenceToApiReference(reference) {
|
|
12982
12995
|
// first jsonize
|
|
12983
|
-
const jsonableRef =
|
|
12996
|
+
const jsonableRef = aasCore3_1Typescript.jsonization.toJsonable(reference);
|
|
12984
12997
|
// then stringify
|
|
12985
12998
|
const ref = JSON.stringify(jsonableRef);
|
|
12986
12999
|
// then parse
|
|
@@ -12997,7 +13010,7 @@ function convertCoreReferenceToApiReference(reference) {
|
|
|
12997
13010
|
function convertApiSubmodelToCoreSubmodel(submodel) {
|
|
12998
13011
|
let submodelStr = JSON.stringify(submodel);
|
|
12999
13012
|
submodelStr = JSON.parse(submodelStr);
|
|
13000
|
-
const instanceOrError =
|
|
13013
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.submodelFromJsonable(submodelStr);
|
|
13001
13014
|
if (instanceOrError.error !== null) {
|
|
13002
13015
|
throw instanceOrError.error;
|
|
13003
13016
|
}
|
|
@@ -13014,7 +13027,7 @@ function convertApiSubmodelToCoreSubmodel(submodel) {
|
|
|
13014
13027
|
*/
|
|
13015
13028
|
function convertCoreSubmodelToApiSubmodel(submodel) {
|
|
13016
13029
|
// first jsonize
|
|
13017
|
-
const jsonableSubmodel =
|
|
13030
|
+
const jsonableSubmodel = aasCore3_1Typescript.jsonization.toJsonable(submodel);
|
|
13018
13031
|
// then stringify
|
|
13019
13032
|
const submodelStr = JSON.stringify(jsonableSubmodel);
|
|
13020
13033
|
// then parse
|
|
@@ -13031,7 +13044,7 @@ function convertApiSubmodelElementToCoreSubmodelElement(submodelElement) {
|
|
|
13031
13044
|
const submodelElementStr = JSON.stringify(submodelElement);
|
|
13032
13045
|
const submodelElementObj = JSON.parse(submodelElementStr);
|
|
13033
13046
|
//submodelElementStr = JSON.parse(submodelElementStr);
|
|
13034
|
-
const instanceOrError =
|
|
13047
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.submodelElementFromJsonable(submodelElementObj);
|
|
13035
13048
|
if (instanceOrError.error !== null) {
|
|
13036
13049
|
throw instanceOrError.error;
|
|
13037
13050
|
}
|
|
@@ -13048,7 +13061,7 @@ function convertApiSubmodelElementToCoreSubmodelElement(submodelElement) {
|
|
|
13048
13061
|
*/
|
|
13049
13062
|
function convertCoreSubmodelElementToApiSubmodelElement(submodelElement) {
|
|
13050
13063
|
// first jsonize
|
|
13051
|
-
const jsonableSubmodelElement =
|
|
13064
|
+
const jsonableSubmodelElement = aasCore3_1Typescript.jsonization.toJsonable(submodelElement);
|
|
13052
13065
|
// then stringify
|
|
13053
13066
|
const submodelElementStr = JSON.stringify(jsonableSubmodelElement);
|
|
13054
13067
|
// then parse
|
|
@@ -14724,7 +14737,7 @@ function convertApiCDToCoreCD(conceptDescription) {
|
|
|
14724
14737
|
// then parse
|
|
14725
14738
|
conceptDescriptionStr = JSON.parse(conceptDescriptionStr);
|
|
14726
14739
|
// then jsonize
|
|
14727
|
-
const instanceOrError =
|
|
14740
|
+
const instanceOrError = aasCore3_1Typescript.jsonization.conceptDescriptionFromJsonable(conceptDescriptionStr);
|
|
14728
14741
|
if (instanceOrError.error !== null) {
|
|
14729
14742
|
throw instanceOrError.error;
|
|
14730
14743
|
}
|
|
@@ -14742,7 +14755,7 @@ function convertApiCDToCoreCD(conceptDescription) {
|
|
|
14742
14755
|
*/
|
|
14743
14756
|
function convertCoreCDToApiCD(conceptDescription) {
|
|
14744
14757
|
// first jsonize
|
|
14745
|
-
const jsonableConceptDescription =
|
|
14758
|
+
const jsonableConceptDescription = aasCore3_1Typescript.jsonization.toJsonable(conceptDescription);
|
|
14746
14759
|
// then stringify
|
|
14747
14760
|
const conceptDescriptionStr = JSON.stringify(jsonableConceptDescription);
|
|
14748
14761
|
// then parse
|