basyx-typescript-sdk 1.1.2 → 2.1.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 +44 -67
- 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 +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SpecificAssetId } from '@aas-core-works/aas-core3.
|
|
1
|
+
import type { SpecificAssetId } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import type { ApiResult } from '../models/api';
|
|
3
3
|
import type { AssetId } from '../models/AssetId';
|
|
4
4
|
import { AasDiscoveryService } from '../generated';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssetAdministrationShell, AssetInformation, ISubmodelElement, Reference, Submodel } from '@aas-core-works/aas-core3.
|
|
1
|
+
import type { AssetAdministrationShell, AssetInformation, ISubmodelElement, Reference, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import type { ApiResult } from '../models/api';
|
|
3
3
|
import type { AssetId } from '../models/AssetId';
|
|
4
4
|
import { AasRepositoryService } from '../generated';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConceptDescription } from '@aas-core-works/aas-core3.
|
|
1
|
+
import type { ConceptDescription } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import type { ApiResult } from '../models/api';
|
|
3
3
|
import { ConceptDescriptionRepositoryService } from '../generated';
|
|
4
4
|
import { Configuration } from '../generated/runtime';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ISubmodelElement, Submodel } from '@aas-core-works/aas-core3.
|
|
1
|
+
import type { ISubmodelElement, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import type { ApiResult } from '../models/api';
|
|
3
3
|
import { SubmodelRepositoryService } from '../generated';
|
|
4
4
|
import { Configuration } from '../generated/runtime';
|
|
@@ -1,44 +1,29 @@
|
|
|
1
|
-
import { jsonization } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { AdministrativeInformation, AnnotatedRelationshipElement, AssetAdministrationShell, AssetInformation, AssetKind, BasicEventElement, Blob, Capability, ConceptDescription, DataSpecificationIec61360, DataTypeDefXsd, EmbeddedDataSpecification, Entity, Extension, File, Key, KeyTypes, LangStringDefinitionTypeIec61360, LangStringNameType, LangStringPreferredNameTypeIec61360, LangStringShortNameTypeIec61360, LangStringTextType, LevelType, MultiLanguageProperty, Operation, OperationVariable, Property, Qualifier, Range, Reference, ReferenceElement, ReferenceTypes, RelationshipElement, Resource, SpecificAssetId, Submodel, SubmodelElementCollection, SubmodelElementList, ValueList, ValueReferencePair, } from '@aas-core-works/aas-core3.
|
|
3
|
-
import {
|
|
1
|
+
import { jsonization } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { AdministrativeInformation, AnnotatedRelationshipElement, AssetAdministrationShell, AssetInformation, AssetKind, BasicEventElement, Blob, Capability, ConceptDescription, DataSpecificationIec61360, DataTypeDefXsd, EmbeddedDataSpecification, Entity, Extension, File, Key, KeyTypes, LangStringDefinitionTypeIec61360, LangStringNameType, LangStringPreferredNameTypeIec61360, LangStringShortNameTypeIec61360, LangStringTextType, LevelType, MultiLanguageProperty, Operation, OperationVariable, Property, Qualifier, Range, Reference, ReferenceElement, ReferenceTypes, RelationshipElement, Resource, SpecificAssetId, Submodel, SubmodelElementCollection, SubmodelElementList, ValueList, ValueReferencePair, } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
|
+
import { buildObject, buildXmlNode, parseXmlString, serializeXml as serializeXmlNode } from 'xml-sax-ts';
|
|
4
4
|
import { BaSyxEnvironment } from '../../models/BaSyxEnvironment';
|
|
5
5
|
export function serializeXml(data, namespacePrefix = 'aas') {
|
|
6
6
|
// Return empty string for empty environment
|
|
7
7
|
if (!data.assetAdministrationShells?.length && !data.submodels?.length && !data.conceptDescriptions?.length) {
|
|
8
8
|
return '';
|
|
9
9
|
}
|
|
10
|
-
const builder = new XMLBuilder({
|
|
11
|
-
ignoreAttributes: false,
|
|
12
|
-
attributeNamePrefix: '@_',
|
|
13
|
-
attributeValueProcessor: (name, val) => val,
|
|
14
|
-
format: true,
|
|
15
|
-
indentBy: ' ',
|
|
16
|
-
suppressEmptyNode: true,
|
|
17
|
-
suppressBooleanAttributes: false,
|
|
18
|
-
processEntities: false,
|
|
19
|
-
cdataPropName: '__cdata',
|
|
20
|
-
arrayNodeName: 'element',
|
|
21
|
-
suppressUnpairedNode: false,
|
|
22
|
-
unpairedTags: [],
|
|
23
|
-
tagValueProcessor: (name, val) => val,
|
|
24
|
-
});
|
|
25
10
|
// Transform and add namespace prefix to all elements
|
|
26
11
|
const envData = transformEnvironmentToXmlStructure(data);
|
|
27
12
|
const prefixedData = addNamespacePrefix(envData, namespacePrefix);
|
|
28
|
-
|
|
29
|
-
const xmlObject = {
|
|
30
|
-
'?xml': {
|
|
31
|
-
'@_version': '1.0',
|
|
32
|
-
'@_encoding': 'UTF-8',
|
|
33
|
-
},
|
|
13
|
+
const rootNode = buildXmlNode({
|
|
34
14
|
[`${namespacePrefix}:environment`]: {
|
|
35
15
|
[`@_xmlns:${namespacePrefix}`]: 'https://admin-shell.io/aas/3/1',
|
|
36
16
|
'@_xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
|
37
17
|
'@_xsi:schemaLocation': 'https://admin-shell.io/aas/3/1 AAS.xsd',
|
|
38
18
|
...prefixedData,
|
|
39
19
|
},
|
|
40
|
-
};
|
|
41
|
-
let xml =
|
|
20
|
+
});
|
|
21
|
+
let xml = serializeXmlNode(rootNode, {
|
|
22
|
+
pretty: true,
|
|
23
|
+
xmlDeclaration: true,
|
|
24
|
+
indent: ' ',
|
|
25
|
+
newline: '\n',
|
|
26
|
+
});
|
|
42
27
|
// Format the root element attributes to be on separate lines
|
|
43
28
|
const escapedPrefix = namespacePrefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
44
29
|
const regex = new RegExp(`<${escapedPrefix}:environment xmlns:${escapedPrefix}="https:\\/\\/admin-shell\\.io\\/aas\\/3\\/1" xmlns:xsi="http:\\/\\/www\\.w3\\.org\\/2001\\/XMLSchema-instance" xsi:schemaLocation="https:\\/\\/admin-shell\\.io\\/aas\\/3\\/1 AAS\\.xsd">`, 'g');
|
|
@@ -897,40 +882,14 @@ export function deserializeXml(xmlString) {
|
|
|
897
882
|
if (!xmlString || xmlString.trim() === '') {
|
|
898
883
|
return new BaSyxEnvironment();
|
|
899
884
|
}
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
parseTagValue: false,
|
|
905
|
-
trimValues: true,
|
|
906
|
-
removeNSPrefix: true, // Remove namespace prefixes like aas:
|
|
907
|
-
isArray: (name) => {
|
|
908
|
-
// Define which elements should always be treated as arrays
|
|
909
|
-
const arrayElements = [
|
|
910
|
-
'extension',
|
|
911
|
-
'langStringNameType',
|
|
912
|
-
'langStringTextType',
|
|
913
|
-
'langStringPreferredNameTypeIec61360',
|
|
914
|
-
'langStringShortNameTypeIec61360',
|
|
915
|
-
'langStringDefinitionTypeIec61360',
|
|
916
|
-
'reference',
|
|
917
|
-
'key',
|
|
918
|
-
'valueReferencePair',
|
|
919
|
-
'embeddedDataSpecification',
|
|
920
|
-
'specificAssetId',
|
|
921
|
-
'assetAdministrationShell',
|
|
922
|
-
'submodel',
|
|
923
|
-
'conceptDescription',
|
|
924
|
-
'qualifier',
|
|
925
|
-
'operationVariable',
|
|
926
|
-
];
|
|
927
|
-
return arrayElements.includes(name);
|
|
928
|
-
},
|
|
885
|
+
const rootNode = parseXmlString(xmlString);
|
|
886
|
+
const parsed = buildObject(rootNode, {
|
|
887
|
+
stripNamespaces: true,
|
|
888
|
+
arrayElements: ARRAY_ELEMENTS,
|
|
929
889
|
});
|
|
930
|
-
const parsed = parser.parse(xmlString);
|
|
931
890
|
const env = new BaSyxEnvironment();
|
|
932
891
|
// Extract the environment data
|
|
933
|
-
const envData = parsed.environment;
|
|
892
|
+
const envData = parsed.environment ?? parsed;
|
|
934
893
|
if (!envData) {
|
|
935
894
|
return env;
|
|
936
895
|
}
|
|
@@ -953,6 +912,24 @@ export function deserializeXml(xmlString) {
|
|
|
953
912
|
}
|
|
954
913
|
return env;
|
|
955
914
|
}
|
|
915
|
+
const ARRAY_ELEMENTS = new Set([
|
|
916
|
+
'extension',
|
|
917
|
+
'langStringNameType',
|
|
918
|
+
'langStringTextType',
|
|
919
|
+
'langStringPreferredNameTypeIec61360',
|
|
920
|
+
'langStringShortNameTypeIec61360',
|
|
921
|
+
'langStringDefinitionTypeIec61360',
|
|
922
|
+
'reference',
|
|
923
|
+
'key',
|
|
924
|
+
'valueReferencePair',
|
|
925
|
+
'embeddedDataSpecification',
|
|
926
|
+
'specificAssetId',
|
|
927
|
+
'assetAdministrationShell',
|
|
928
|
+
'submodel',
|
|
929
|
+
'conceptDescription',
|
|
930
|
+
'qualifier',
|
|
931
|
+
'operationVariable',
|
|
932
|
+
]);
|
|
956
933
|
function parseAssetAdministrationShell(data) {
|
|
957
934
|
return new AssetAdministrationShell(data.id, parseAssetInformation(data.assetInformation), data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
958
935
|
? data.displayName.langStringNameType.map(parseLangStringNameType)
|
|
@@ -1182,7 +1159,7 @@ function parseReferenceElement(data) {
|
|
|
1182
1159
|
: undefined, data.value ? parseReference(data.value) : undefined);
|
|
1183
1160
|
}
|
|
1184
1161
|
function parseBlob(data) {
|
|
1185
|
-
return new Blob(data.
|
|
1162
|
+
return new Blob(data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
1186
1163
|
? data.displayName.langStringNameType.map(parseLangStringNameType)
|
|
1187
1164
|
: undefined, data.description?.langStringTextType
|
|
1188
1165
|
? data.description.langStringTextType.map(parseLangStringTextType)
|
|
@@ -1190,10 +1167,10 @@ function parseBlob(data) {
|
|
|
1190
1167
|
? data.supplementalSemanticIds.reference.map(parseReference)
|
|
1191
1168
|
: undefined, data.qualifiers?.qualifier ? data.qualifiers.qualifier.map(parseQualifier) : undefined, data.embeddedDataSpecifications?.embeddedDataSpecification
|
|
1192
1169
|
? data.embeddedDataSpecifications.embeddedDataSpecification.map(parseEmbeddedDataSpecification)
|
|
1193
|
-
: undefined, data.value || undefined);
|
|
1170
|
+
: undefined, data.value || undefined, data.contentType);
|
|
1194
1171
|
}
|
|
1195
1172
|
function parseFile(data) {
|
|
1196
|
-
return new File(data.
|
|
1173
|
+
return new File(data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
1197
1174
|
? data.displayName.langStringNameType.map(parseLangStringNameType)
|
|
1198
1175
|
: undefined, data.description?.langStringTextType
|
|
1199
1176
|
? data.description.langStringTextType.map(parseLangStringTextType)
|
|
@@ -1201,13 +1178,13 @@ function parseFile(data) {
|
|
|
1201
1178
|
? data.supplementalSemanticIds.reference.map(parseReference)
|
|
1202
1179
|
: undefined, data.qualifiers?.qualifier ? data.qualifiers.qualifier.map(parseQualifier) : undefined, data.embeddedDataSpecifications?.embeddedDataSpecification
|
|
1203
1180
|
? data.embeddedDataSpecifications.embeddedDataSpecification.map(parseEmbeddedDataSpecification)
|
|
1204
|
-
: undefined, data.value || undefined);
|
|
1181
|
+
: undefined, data.value || undefined, data.contentType);
|
|
1205
1182
|
}
|
|
1206
1183
|
function parseEntity(data) {
|
|
1207
1184
|
const entityType = data.entityType
|
|
1208
1185
|
? (jsonization.entityTypeFromJsonable(data.entityType).value ?? data.entityType)
|
|
1209
1186
|
: undefined;
|
|
1210
|
-
return new Entity(
|
|
1187
|
+
return new Entity(data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
1211
1188
|
? data.displayName.langStringNameType.map(parseLangStringNameType)
|
|
1212
1189
|
: undefined, data.description?.langStringTextType
|
|
1213
1190
|
? data.description.langStringTextType.map(parseLangStringTextType)
|
|
@@ -1215,12 +1192,12 @@ function parseEntity(data) {
|
|
|
1215
1192
|
? data.supplementalSemanticIds.reference.map(parseReference)
|
|
1216
1193
|
: undefined, data.qualifiers?.qualifier ? data.qualifiers.qualifier.map(parseQualifier) : undefined, data.embeddedDataSpecifications?.embeddedDataSpecification
|
|
1217
1194
|
? data.embeddedDataSpecifications.embeddedDataSpecification.map(parseEmbeddedDataSpecification)
|
|
1218
|
-
: undefined, data.statements ? parseSubmodelElements(data.statements) : undefined, data.globalAssetId || undefined, data.specificAssetIds?.specificAssetId
|
|
1195
|
+
: undefined, data.statements ? parseSubmodelElements(data.statements) : undefined, entityType, data.globalAssetId || undefined, data.specificAssetIds?.specificAssetId
|
|
1219
1196
|
? data.specificAssetIds.specificAssetId.map(parseSpecificAssetId)
|
|
1220
1197
|
: undefined);
|
|
1221
1198
|
}
|
|
1222
1199
|
function parseRelationshipElement(data) {
|
|
1223
|
-
return new RelationshipElement(
|
|
1200
|
+
return new RelationshipElement(data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
1224
1201
|
? data.displayName.langStringNameType.map(parseLangStringNameType)
|
|
1225
1202
|
: undefined, data.description?.langStringTextType
|
|
1226
1203
|
? data.description.langStringTextType.map(parseLangStringTextType)
|
|
@@ -1228,10 +1205,10 @@ function parseRelationshipElement(data) {
|
|
|
1228
1205
|
? data.supplementalSemanticIds.reference.map(parseReference)
|
|
1229
1206
|
: undefined, data.qualifiers?.qualifier ? data.qualifiers.qualifier.map(parseQualifier) : undefined, data.embeddedDataSpecifications?.embeddedDataSpecification
|
|
1230
1207
|
? data.embeddedDataSpecifications.embeddedDataSpecification.map(parseEmbeddedDataSpecification)
|
|
1231
|
-
: undefined);
|
|
1208
|
+
: undefined, parseReference(data.first), parseReference(data.second));
|
|
1232
1209
|
}
|
|
1233
1210
|
function parseAnnotatedRelationshipElement(data) {
|
|
1234
|
-
return new AnnotatedRelationshipElement(
|
|
1211
|
+
return new AnnotatedRelationshipElement(data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
1235
1212
|
? data.displayName.langStringNameType.map(parseLangStringNameType)
|
|
1236
1213
|
: undefined, data.description?.langStringTextType
|
|
1237
1214
|
? data.description.langStringTextType.map(parseLangStringTextType)
|
|
@@ -1239,7 +1216,7 @@ function parseAnnotatedRelationshipElement(data) {
|
|
|
1239
1216
|
? data.supplementalSemanticIds.reference.map(parseReference)
|
|
1240
1217
|
: undefined, data.qualifiers?.qualifier ? data.qualifiers.qualifier.map(parseQualifier) : undefined, data.embeddedDataSpecifications?.embeddedDataSpecification
|
|
1241
1218
|
? data.embeddedDataSpecifications.embeddedDataSpecification.map(parseEmbeddedDataSpecification)
|
|
1242
|
-
: undefined, data.annotations ? parseSubmodelElements(data.annotations) : undefined);
|
|
1219
|
+
: undefined, parseReference(data.first), parseReference(data.second), data.annotations ? parseSubmodelElements(data.annotations) : undefined);
|
|
1243
1220
|
}
|
|
1244
1221
|
function parseSubmodelElementCollection(data) {
|
|
1245
1222
|
return new SubmodelElementCollection(data.extensions?.extension ? data.extensions.extension.map(parseExtension) : undefined, data.category || undefined, data.idShort || undefined, data.displayName?.langStringNameType
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpecificAssetId as CoreSpecificAssetId } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { SpecificAssetId as CoreSpecificAssetId } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import { AasDiscoveryService } from '../generated';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API SpecificAssetId to a Core Works SpecificAssetId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonization } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { SpecificAssetId as CoreSpecificAssetId } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { jsonization } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { SpecificAssetId as CoreSpecificAssetId } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API SpecificAssetId to a Core Works SpecificAssetId
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetAdministrationShell as CoreAssetAdministrationShell, AssetInformation as CoreAssetInformation, Reference as CoreReference } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { AssetAdministrationShell as CoreAssetAdministrationShell, AssetInformation as CoreAssetInformation, Reference as CoreReference } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import { AasRepositoryService } from '../generated';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API AssetAdministrationShell to a Core Works AssetAdministrationShell
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonization } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { AssetAdministrationShell as CoreAssetAdministrationShell, AssetInformation as CoreAssetInformation, Reference as CoreReference, } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { jsonization } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { AssetAdministrationShell as CoreAssetAdministrationShell, AssetInformation as CoreAssetInformation, Reference as CoreReference, } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
3
|
// import {
|
|
4
4
|
// AssetAdministrationShell as ApiAssetAdministrationShell,
|
|
5
5
|
// AssetInformation as ApiAssetInformation,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConceptDescription as CoreConceptDescription } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { ConceptDescription as CoreConceptDescription } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import { ConceptDescriptionRepositoryService } from '../generated';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API ConceptDescription to a Core Works ConceptDescription
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonization } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { ConceptDescription as CoreConceptDescription } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { jsonization } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { ConceptDescription as CoreConceptDescription } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API ConceptDescription to a Core Works ConceptDescription
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISubmodelElement as CoreSubmodelElement, Submodel as CoreSubmodel } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { ISubmodelElement as CoreSubmodelElement, Submodel as CoreSubmodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import { SubmodelRepositoryService } from '../generated';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API Submodel to a Core Works Submodel
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonization } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { Submodel as CoreSubmodel, } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { jsonization } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { Submodel as CoreSubmodel, } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an API Submodel to a Core Works Submodel
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { common } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { DeserializationError, JsonValue } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { common } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { DeserializationError, JsonValue } from '@aas-core-works/aas-core3.1-typescript/jsonization';
|
|
3
3
|
import { AssetAdministrationShellDescriptor, Endpoint, ProtocolInformation, ProtocolInformationSecurityAttributes, SubmodelDescriptor } from '../models/Descriptors';
|
|
4
4
|
export declare function assetAdministrationShellDescriptorFromJsonable(json: JsonValue): common.Either<AssetAdministrationShellDescriptor, DeserializationError>;
|
|
5
5
|
export declare function submodelDescriptorFromJsonable(json: JsonValue): common.Either<SubmodelDescriptor, DeserializationError>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { common } from '@aas-core-works/aas-core3.
|
|
2
|
-
import { administrativeInformationFromJsonable, assetKindFromJsonable, DeserializationError, extensionFromJsonable, langStringNameTypeFromJsonable, langStringTextTypeFromJsonable, referenceFromJsonable, specificAssetIdFromJsonable, toJsonable, } from '@aas-core-works/aas-core3.
|
|
3
|
-
import { AssetKind } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { common } from '@aas-core-works/aas-core3.1-typescript';
|
|
2
|
+
import { administrativeInformationFromJsonable, assetKindFromJsonable, DeserializationError, extensionFromJsonable, langStringNameTypeFromJsonable, langStringTextTypeFromJsonable, referenceFromJsonable, specificAssetIdFromJsonable, toJsonable, } from '@aas-core-works/aas-core3.1-typescript/jsonization';
|
|
3
|
+
import { AssetKind } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
4
4
|
//import { AasRegistryService } from '../generated';
|
|
5
5
|
import { AssetAdministrationShellDescriptor, SubmodelDescriptor, } from '../models/Descriptors';
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdministrativeInformation, AssetKind, Extension, LangStringNameType, LangStringTextType, Reference, SpecificAssetId } from '@aas-core-works/aas-core3.
|
|
1
|
+
import type { AdministrativeInformation, AssetKind, Extension, LangStringNameType, LangStringTextType, Reference, SpecificAssetId } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
export declare class AssetAdministrationShellDescriptor {
|
|
3
3
|
id: string;
|
|
4
4
|
displayName: Array<LangStringNameType> | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ApiResult } from '../models/api';
|
|
2
|
-
import { AssetAdministrationShell, Reference, Submodel } from '@aas-core-works/aas-core3.
|
|
2
|
+
import { AssetAdministrationShell, Reference, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
3
|
import { Configuration } from '../generated';
|
|
4
4
|
import { AssetId } from '../models/AssetId';
|
|
5
5
|
import { AssetAdministrationShellDescriptor } from '../models/Descriptors';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyTypes, ReferenceTypes, } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { KeyTypes, ReferenceTypes, } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import { AasDiscoveryClient } from '../clients/AasDiscoveryClient';
|
|
3
3
|
import { AasRegistryClient } from '../clients/AasRegistryClient';
|
|
4
4
|
import { AasRepositoryClient } from '../clients/AasRepositoryClient';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConceptDescription, Submodel } from '@aas-core-works/aas-core3.
|
|
1
|
+
import type { ConceptDescription, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import type { ApiResult } from '../models/api';
|
|
3
3
|
import { Configuration } from '../generated/runtime';
|
|
4
4
|
import { SubmodelDescriptor } from '../models/Descriptors';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelType } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { ModelType } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
import { ConceptDescriptionRepositoryClient } from '../clients/ConceptDescriptionRepositoryClient';
|
|
3
3
|
import { SubmodelRegistryClient } from '../clients/SubmodelRegistryClient';
|
|
4
4
|
import { SubmodelRepositoryClient } from '../clients/SubmodelRepositoryClient';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyTypes } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { KeyTypes } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
/**
|
|
3
3
|
* @constant {Array<Object>} keyTypes
|
|
4
4
|
* @description Enumeration of Key Types as specified in IDTA 01001-3-0-1, page 82.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyTypes } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { KeyTypes } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
/**
|
|
3
3
|
* @constant {Array<Object>} keyTypes
|
|
4
4
|
* @description Enumeration of Key Types as specified in IDTA 01001-3-0-1, page 82.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IReferable, ISubmodelElement, Submodel } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { IReferable, ISubmodelElement, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
/**
|
|
3
3
|
* Extracts the display name from a Referable object based on the specified language.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelType, } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { ModelType, } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
//export function useReferableUtils() {
|
|
3
3
|
//const { uuidV4Regex } = useIDUtils();
|
|
4
4
|
const uuidV4Regex = /^[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}$/;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISubmodelElement, Submodel } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { ISubmodelElement, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the `semanticId` of a SubmodelElement (SME) matches the given `semanticId`.
|
|
4
4
|
* The function verifies that the `semanticId` is non-empty and that the SubmodelElement
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelType, } from '@aas-core-works/aas-core3.
|
|
1
|
+
import { ModelType, } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
2
2
|
const versionRevisionRegex = /\/(\d{1,})\/(\d{1,})(\/|$)/; // This regex matches the version/revision string of a semanticId ".../version/revision"
|
|
3
3
|
/**
|
|
4
4
|
* Checks if the `semanticId` of a SubmodelElement (SME) matches the given `semanticId`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "basyx-typescript-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "BaSyx TypeScript SDK for developing applications and components for the Asset Administration Shell (AAS)",
|
|
5
5
|
"main": "bundle/index.cjs",
|
|
6
6
|
"module": "bundle/index.mjs",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"gen-aasxfileserver": "openapi-generator-cli generate -i openapi/aasxfileserver.yaml -g typescript-fetch -o src/generated/AasxFileService --additional-properties=withoutRuntimeChecks=true"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@aas-core-works/aas-core3.
|
|
40
|
+
"@aas-core-works/aas-core3.1-typescript": "^1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@aas-core-works/aas-core3.
|
|
43
|
+
"@aas-core-works/aas-core3.1-typescript": "^1.0.0",
|
|
44
44
|
"@openapitools/openapi-generator-cli": "^2.18.4",
|
|
45
45
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
46
46
|
"@types/jest": "^30.0.0",
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"typescript-eslint": "^8.21.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"
|
|
67
|
+
"xml-sax-ts": "^0.3.0"
|
|
68
68
|
}
|
|
69
69
|
}
|