basyx-typescript-sdk 2.2.2 → 2.2.3

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 CHANGED
@@ -1,6 +1,6 @@
1
- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/eclipse-basyx/basyx-typescript-sdk/publish.yml)
1
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/eclipse-basyx/basyx-typescript-sdk/build-sdk.yml)
2
2
  ![NPM Downloads](https://img.shields.io/npm/dw/basyx-typescript-sdk)
3
- ![NPM Version](https://img.shields.io/npm/v/basyx-typescript-sdk)
3
+ [![NPM Version](https://img.shields.io/npm/v/basyx-typescript-sdk)](https://www.npmjs.com/package/basyx-typescript-sdk)
4
4
  ![GitHub License](https://img.shields.io/github/license/eclipse-basyx/basyx-typescript-sdk)
5
5
 
6
6
  # basyx-typescript-sdk
@@ -10,6 +10,7 @@ BaSyx TypeScript SDK for developing applications and components for the Asset Ad
10
10
  ## Features
11
11
 
12
12
  High-level orchestration services:
13
+
13
14
  - **AasService**: Unified API for AAS operations across registry and repository
14
15
  - Create, read, update, delete AAS with automatic registry synchronization
15
16
  - Fetch AAS with their submodels in a single call
@@ -20,6 +21,7 @@ High-level orchestration services:
20
21
  - Automatic fallback to repository when registry unavailable
21
22
 
22
23
  Clients for the AAS API components:
24
+
23
25
  - AAS Repository
24
26
  - Submodel Repository
25
27
  - Concept Description Repository
@@ -29,6 +31,7 @@ Clients for the AAS API components:
29
31
  - AASX File Service
30
32
 
31
33
  Utility functions for working with AAS data:
34
+
32
35
  - Utils for Descriptors
33
36
  - Utils for KeyTypes
34
37
  - Utils for MultiLanguageProperties
@@ -41,20 +44,38 @@ Utility functions for working with AAS data:
41
44
  ```bash
42
45
  npm install basyx-typescript-sdk
43
46
  # or
44
- yarn add basyx-typescript-sdk
47
+ pnpm add basyx-typescript-sdk
45
48
  ```
46
49
 
47
50
  > See https://www.npmjs.com/package/basyx-typescript-sdk
48
51
 
49
52
  ---
50
53
 
51
- > [!IMPORTANT]
52
- > Make sure to also install `@aas-core-works/aas-core3.1-typescript` in your project:
54
+ > [!IMPORTANT] Make sure to also install `@aas-core-works/aas-core3.1-typescript` in your project:
53
55
 
54
56
  ```bash
55
57
  npm install @aas-core-works/aas-core3.1-typescript
56
58
  # or
57
- yarn add @aas-core-works/aas-core3.1-typescript
59
+ pnpm add @aas-core-works/aas-core3.1-typescript
60
+ ```
61
+
62
+ ## Development
63
+
64
+ ```bash
65
+ pnpm install
66
+ pnpm format:check
67
+ pnpm lint:check
68
+ pnpm type-check
69
+ pnpm build
70
+ pnpm bundle
71
+ pnpm test
72
+ pnpm verify:compat
73
+ ```
74
+
75
+ Use `.nvmrc` to align local Node.js with CI:
76
+
77
+ ```bash
78
+ nvm use
58
79
  ```
59
80
 
60
81
  ## Import Styles
@@ -92,12 +113,7 @@ const encoded = Lib.base64Encode('my-id');
92
113
 
93
114
  ```typescript
94
115
  // Combine direct and namespaced imports
95
- import {
96
- AasService,
97
- Configuration,
98
- Utils,
99
- base64Encode
100
- } from 'basyx-typescript-sdk';
116
+ import { AasService, Configuration, Utils, base64Encode } from 'basyx-typescript-sdk';
101
117
 
102
118
  // Use directly imported functions
103
119
  const id = base64Encode('my-id');
@@ -114,18 +130,18 @@ const element = Utils.getSubmodelElementByIdShort(submodel, 'myElement');
114
130
  import { AasRepositoryClient, Configuration } from 'basyx-typescript-sdk';
115
131
 
116
132
  async function getAllShells() {
117
- const client = new AasRepositoryClient();
118
- const configuration = new Configuration({
119
- basePath: 'http://localhost:8081',
120
- });
121
-
122
- const response = await client.getAllAssetAdministrationShells({ configuration });
123
-
124
- if (response.success) {
125
- console.log('Shells:', response.data.result);
126
- } else {
127
- console.error('Error:', response.error);
128
- }
133
+ const client = new AasRepositoryClient();
134
+ const configuration = new Configuration({
135
+ basePath: 'http://localhost:8081',
136
+ });
137
+
138
+ const response = await client.getAllAssetAdministrationShells({ configuration });
139
+
140
+ if (response.success) {
141
+ console.log('Shells:', response.data.result);
142
+ } else {
143
+ console.error('Error:', response.error);
144
+ }
129
145
  }
130
146
  ```
131
147
 
@@ -137,56 +153,56 @@ import { AssetAdministrationShell, AssetInformation, AssetKind } from '@aas-core
137
153
 
138
154
  // Initialize service with both registry and repository
139
155
  const service = new AasService({
140
- registryConfig: new Configuration({ basePath: 'http://localhost:8084' }),
141
- repositoryConfig: new Configuration({ basePath: 'http://localhost:8081' }),
142
- // Optional: Separate configs for submodel services (used when includeSubmodels is enabled)
143
- // If not provided, falls back to using registryConfig/repositoryConfig for submodels
144
- // In typical BaSyx deployments, submodel services run on different ports:
145
- submodelRegistryConfig: new Configuration({ basePath: 'http://localhost:8083' }),
146
- submodelRepositoryConfig: new Configuration({ basePath: 'http://localhost:8081' }),
147
- // Optional: Discovery service config (used for asset ID lookups)
148
- discoveryConfig: new Configuration({ basePath: 'http://localhost:8086' }),
156
+ registryConfig: new Configuration({ basePath: 'http://localhost:8084' }),
157
+ repositoryConfig: new Configuration({ basePath: 'http://localhost:8081' }),
158
+ // Optional: Separate configs for submodel services (used when includeSubmodels is enabled)
159
+ // If not provided, falls back to using registryConfig/repositoryConfig for submodels
160
+ // In typical BaSyx deployments, submodel services run on different ports:
161
+ submodelRegistryConfig: new Configuration({ basePath: 'http://localhost:8083' }),
162
+ submodelRepositoryConfig: new Configuration({ basePath: 'http://localhost:8081' }),
163
+ // Optional: Discovery service config (used for asset ID lookups)
164
+ discoveryConfig: new Configuration({ basePath: 'http://localhost:8086' }),
149
165
  });
150
166
 
151
167
  // Create a new AAS (automatically registers in registry)
152
168
  const shell = new AssetAdministrationShell(
153
- 'https://example.com/ids/aas/my-aas',
154
- new AssetInformation(AssetKind.Instance)
169
+ 'https://example.com/ids/aas/my-aas',
170
+ new AssetInformation(AssetKind.Instance)
155
171
  );
156
172
 
157
173
  const createResult = await service.createAas({ shell });
158
174
  if (createResult.success) {
159
- console.log('Created AAS:', createResult.data.shell);
175
+ console.log('Created AAS:', createResult.data.shell);
160
176
  }
161
177
 
162
178
  // Get AAS list from registry with automatic endpoint resolution
163
179
  const listResult = await service.getAasList();
164
180
  if (listResult.success) {
165
- console.log('All shells:', listResult.data.shells);
181
+ console.log('All shells:', listResult.data.shells);
166
182
  }
167
183
 
168
184
  // Get AAS by ID (uses registry endpoint if available)
169
- const getResult = await service.getAasById({
170
- aasIdentifier: 'https://example.com/ids/aas/my-aas'
185
+ const getResult = await service.getAasById({
186
+ aasIdentifier: 'https://example.com/ids/aas/my-aas',
171
187
  });
172
188
 
173
189
  // Get AAS with its submodels in a single call
174
190
  const withSubmodels = await service.getAasById({
175
- aasIdentifier: 'https://example.com/ids/aas/my-aas',
176
- includeSubmodels: true
191
+ aasIdentifier: 'https://example.com/ids/aas/my-aas',
192
+ includeSubmodels: true,
177
193
  });
178
194
  if (withSubmodels.success) {
179
- console.log('Shell:', withSubmodels.data.shell);
180
- console.log('Submodels:', withSubmodels.data.submodels); // Array of submodels
195
+ console.log('Shell:', withSubmodels.data.shell);
196
+ console.log('Submodels:', withSubmodels.data.submodels); // Array of submodels
181
197
  }
182
198
 
183
199
  // Get all AAS with their submodels
184
200
  const allWithSubmodels = await service.getAasList({ includeSubmodels: true });
185
201
  if (allWithSubmodels.success) {
186
- allWithSubmodels.data.shells.forEach((shell, index) => {
187
- console.log(`Shell ${index}:`, shell.id);
188
- console.log(`Submodels:`, allWithSubmodels.data.submodels?.[shell.id]);
189
- });
202
+ allWithSubmodels.data.shells.forEach((shell, index) => {
203
+ console.log(`Shell ${index}:`, shell.id);
204
+ console.log(`Submodels:`, allWithSubmodels.data.submodels?.[shell.id]);
205
+ });
190
206
  }
191
207
 
192
208
  // Update AAS (updates both repository and registry)
@@ -195,118 +211,109 @@ const updateResult = await service.updateAas({ shell });
195
211
 
196
212
  // Get endpoint for an AAS
197
213
  const endpointResult = await service.getAasEndpointById({
198
- aasIdentifier: 'https://example.com/ids/aas/my-aas'
214
+ aasIdentifier: 'https://example.com/ids/aas/my-aas',
199
215
  });
200
216
 
201
217
  // Get AAS directly by endpoint URL
202
218
  const byEndpointResult = await service.getAasByEndpoint({
203
- endpoint: 'http://localhost:8081/shells/encoded-id'
219
+ endpoint: 'http://localhost:8081/shells/encoded-id',
204
220
  });
205
221
 
206
222
  // Delete AAS (removes from both registry and repository)
207
- await service.deleteAas({
208
- aasIdentifier: 'https://example.com/ids/aas/my-aas'
223
+ await service.deleteAas({
224
+ aasIdentifier: 'https://example.com/ids/aas/my-aas',
209
225
  });
210
226
 
211
227
  // Find AAS by asset IDs using discovery service
212
228
  const assetIds = [
213
- { name: 'serialNumber', value: '12345' },
214
- { name: 'deviceId', value: 'device-001' },
229
+ { name: 'serialNumber', value: '12345' },
230
+ { name: 'deviceId', value: 'device-001' },
215
231
  ];
216
232
 
217
- const byAssetIdResult = await service.getAasByAssetId({
218
- assetIds,
219
- includeSubmodels: true // Optionally include submodels
233
+ const byAssetIdResult = await service.getAasByAssetId({
234
+ assetIds,
235
+ includeSubmodels: true, // Optionally include submodels
220
236
  });
221
237
  if (byAssetIdResult.success) {
222
- console.log('Found AAS IDs:', byAssetIdResult.data.aasIds);
223
- console.log('Found shells:', byAssetIdResult.data.shells);
224
- // If multiple AAS match the asset IDs, all are returned
238
+ console.log('Found AAS IDs:', byAssetIdResult.data.aasIds);
239
+ console.log('Found shells:', byAssetIdResult.data.shells);
240
+ // If multiple AAS match the asset IDs, all are returned
225
241
  }
226
242
 
227
243
  // Fetch AAS with submodels and their concept descriptions
228
244
  const serviceWithCD = new AasService({
229
- registryConfig: new Configuration({ basePath: 'http://localhost:8084' }),
230
- repositoryConfig: new Configuration({ basePath: 'http://localhost:8081' }),
231
- submodelRegistryConfig: new Configuration({ basePath: 'http://localhost:8085' }),
232
- submodelRepositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
233
- conceptDescriptionRepositoryConfig: new Configuration({ basePath: 'http://localhost:8083' }),
245
+ registryConfig: new Configuration({ basePath: 'http://localhost:8084' }),
246
+ repositoryConfig: new Configuration({ basePath: 'http://localhost:8081' }),
247
+ submodelRegistryConfig: new Configuration({ basePath: 'http://localhost:8085' }),
248
+ submodelRepositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
249
+ conceptDescriptionRepositoryConfig: new Configuration({ basePath: 'http://localhost:8083' }),
234
250
  });
235
251
 
236
252
  const withConceptDescriptions = await serviceWithCD.getAasById({
237
- aasIdentifier: 'https://example.com/ids/aas/my-aas',
238
- includeSubmodels: true,
239
- includeConceptDescriptions: true,
253
+ aasIdentifier: 'https://example.com/ids/aas/my-aas',
254
+ includeSubmodels: true,
255
+ includeConceptDescriptions: true,
240
256
  });
241
257
  if (withConceptDescriptions.success) {
242
- console.log('Shell:', withConceptDescriptions.data.shell);
243
- console.log('Submodels with CDs:', withConceptDescriptions.data.submodels);
244
- // Concept descriptions are fetched for all semantic IDs in submodels and their elements
258
+ console.log('Shell:', withConceptDescriptions.data.shell);
259
+ console.log('Submodels with CDs:', withConceptDescriptions.data.submodels);
260
+ // Concept descriptions are fetched for all semantic IDs in submodels and their elements
245
261
  }
246
262
 
247
263
  // Resolve a Reference to get endpoints for AAS, Submodel, or SubmodelElement
248
264
  import { Reference, Key, KeyTypes, ReferenceTypes } from '@aas-core-works/aas-core3.1-typescript/types';
249
265
 
250
266
  // Example 1: Reference to AAS and Submodel
251
- const reference1 = new Reference(
252
- ReferenceTypes.ModelReference,
253
- [
254
- new Key(KeyTypes.AssetAdministrationShell, 'https://example.com/ids/aas/my-aas'),
255
- new Key(KeyTypes.Submodel, 'https://example.com/ids/sm/my-submodel'),
256
- ]
257
- );
267
+ const reference1 = new Reference(ReferenceTypes.ModelReference, [
268
+ new Key(KeyTypes.AssetAdministrationShell, 'https://example.com/ids/aas/my-aas'),
269
+ new Key(KeyTypes.Submodel, 'https://example.com/ids/sm/my-submodel'),
270
+ ]);
258
271
 
259
272
  const resolved1 = await service.resolveReference({ reference: reference1 });
260
273
  if (resolved1.success) {
261
- console.log('AAS Endpoint:', resolved1.data.aasEndpoint);
262
- // e.g., 'http://localhost:8081/shells/encoded-aas-id'
263
- console.log('Submodel Endpoint:', resolved1.data.submodelEndpoint);
264
- // e.g., 'http://localhost:8082/submodels/encoded-sm-id'
274
+ console.log('AAS Endpoint:', resolved1.data.aasEndpoint);
275
+ // e.g., 'http://localhost:8081/shells/encoded-aas-id'
276
+ console.log('Submodel Endpoint:', resolved1.data.submodelEndpoint);
277
+ // e.g., 'http://localhost:8082/submodels/encoded-sm-id'
265
278
  }
266
279
 
267
280
  // Example 2: Reference to a specific SubmodelElement
268
- const reference2 = new Reference(
269
- ReferenceTypes.ModelReference,
270
- [
271
- new Key(KeyTypes.AssetAdministrationShell, 'https://example.com/ids/aas/my-aas'),
272
- new Key(KeyTypes.Submodel, 'https://example.com/ids/sm/my-submodel'),
273
- new Key(KeyTypes.Property, 'MyProperty'),
274
- ]
275
- );
281
+ const reference2 = new Reference(ReferenceTypes.ModelReference, [
282
+ new Key(KeyTypes.AssetAdministrationShell, 'https://example.com/ids/aas/my-aas'),
283
+ new Key(KeyTypes.Submodel, 'https://example.com/ids/sm/my-submodel'),
284
+ new Key(KeyTypes.Property, 'MyProperty'),
285
+ ]);
276
286
 
277
287
  const resolved2 = await service.resolveReference({ reference: reference2 });
278
288
  if (resolved2.success) {
279
- console.log('SubmodelElement Path:', resolved2.data.submodelElementPath);
280
- // e.g., 'http://localhost:8082/submodels/encoded-sm-id/submodel-elements/MyProperty'
289
+ console.log('SubmodelElement Path:', resolved2.data.submodelElementPath);
290
+ // e.g., 'http://localhost:8082/submodels/encoded-sm-id/submodel-elements/MyProperty'
281
291
  }
282
292
 
283
293
  // Example 3: Reference to nested SubmodelElements
284
- const reference3 = new Reference(
285
- ReferenceTypes.ModelReference,
286
- [
287
- new Key(KeyTypes.Submodel, 'https://example.com/ids/sm/my-submodel'),
288
- new Key(KeyTypes.SubmodelElementCollection, 'MyCollection'),
289
- new Key(KeyTypes.Property, 'NestedProperty'),
290
- ]
291
- );
294
+ const reference3 = new Reference(ReferenceTypes.ModelReference, [
295
+ new Key(KeyTypes.Submodel, 'https://example.com/ids/sm/my-submodel'),
296
+ new Key(KeyTypes.SubmodelElementCollection, 'MyCollection'),
297
+ new Key(KeyTypes.Property, 'NestedProperty'),
298
+ ]);
292
299
 
293
300
  const resolved3 = await service.resolveReference({ reference: reference3 });
294
301
  if (resolved3.success) {
295
- console.log('SubmodelElement Path:', resolved3.data.submodelElementPath);
296
- // e.g., 'http://localhost:8082/submodels/encoded-sm-id/submodel-elements/MyCollection.NestedProperty'
302
+ console.log('SubmodelElement Path:', resolved3.data.submodelElementPath);
303
+ // e.g., 'http://localhost:8082/submodels/encoded-sm-id/submodel-elements/MyCollection.NestedProperty'
297
304
  }
298
305
 
299
306
  // Fetch all AAS with submodels and concept descriptions
300
307
  const allWithCD = await serviceWithCD.getAasList({
301
- includeSubmodels: true,
302
- includeConceptDescriptions: true,
308
+ includeSubmodels: true,
309
+ includeConceptDescriptions: true,
303
310
  });
304
311
  if (allWithCD.success) {
305
- allWithCD.data.shells.forEach((shell) => {
306
- console.log('Shell:', shell.id);
307
- console.log('Submodels:', allWithCD.data.submodels?.[shell.id]);
308
- // Concept descriptions are available through the submodel service
309
- });
312
+ allWithCD.data.shells.forEach((shell) => {
313
+ console.log('Shell:', shell.id);
314
+ console.log('Submodels:', allWithCD.data.submodels?.[shell.id]);
315
+ // Concept descriptions are available through the submodel service
316
+ });
310
317
  }
311
318
  ```
312
319
 
@@ -318,43 +325,43 @@ import { Submodel, ModellingKind } from '@aas-core-works/aas-core3.1-typescript/
318
325
 
319
326
  // Initialize service with both registry and repository
320
327
  const service = new SubmodelService({
321
- registryConfig: new Configuration({ basePath: 'http://localhost:8085' }),
322
- repositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
328
+ registryConfig: new Configuration({ basePath: 'http://localhost:8085' }),
329
+ repositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
323
330
  });
324
331
 
325
332
  // Create a new Submodel (automatically registers in registry)
326
333
  const submodel = new Submodel(
327
- 'https://example.com/ids/sm/my-submodel',
328
- null, // extensions
329
- null, // category
330
- 'MySubmodel', // idShort
331
- null, // displayName
332
- null, // description
333
- null, // administration
334
- ModellingKind.Instance
334
+ 'https://example.com/ids/sm/my-submodel',
335
+ null, // extensions
336
+ null, // category
337
+ 'MySubmodel', // idShort
338
+ null, // displayName
339
+ null, // description
340
+ null, // administration
341
+ ModellingKind.Instance
335
342
  );
336
343
 
337
344
  const createResult = await service.createSubmodel({ submodel });
338
345
  if (createResult.success) {
339
- console.log('Created Submodel:', createResult.data.submodel);
340
- console.log('Registry Descriptor:', createResult.data.descriptor);
346
+ console.log('Created Submodel:', createResult.data.submodel);
347
+ console.log('Registry Descriptor:', createResult.data.descriptor);
341
348
  }
342
349
 
343
350
  // Get Submodel list from registry with automatic endpoint resolution
344
351
  const listResult = await service.getSubmodelList({ preferRegistry: true });
345
352
  if (listResult.success) {
346
- console.log('All submodels:', listResult.data.submodels);
347
- console.log('Fetched from:', listResult.data.source); // 'registry' or 'repository'
353
+ console.log('All submodels:', listResult.data.submodels);
354
+ console.log('Fetched from:', listResult.data.source); // 'registry' or 'repository'
348
355
  }
349
356
 
350
357
  // Get Submodel by ID (uses registry endpoint if available)
351
358
  const getResult = await service.getSubmodelById({
352
- submodelIdentifier: 'https://example.com/ids/sm/my-submodel',
353
- useRegistryEndpoint: true
359
+ submodelIdentifier: 'https://example.com/ids/sm/my-submodel',
360
+ useRegistryEndpoint: true,
354
361
  });
355
362
  if (getResult.success) {
356
- console.log('Submodel:', getResult.data.submodel);
357
- console.log('Descriptor:', getResult.data.descriptor);
363
+ console.log('Submodel:', getResult.data.submodel);
364
+ console.log('Descriptor:', getResult.data.descriptor);
358
365
  }
359
366
 
360
367
  // Update Submodel (updates both repository and registry)
@@ -363,25 +370,25 @@ const updateResult = await service.updateSubmodel({ submodel });
363
370
 
364
371
  // Get endpoint for a Submodel
365
372
  const endpointResult = await service.getSubmodelEndpointById({
366
- submodelIdentifier: 'https://example.com/ids/sm/my-submodel'
373
+ submodelIdentifier: 'https://example.com/ids/sm/my-submodel',
367
374
  });
368
375
  if (endpointResult.success) {
369
- console.log('Endpoint:', endpointResult.data);
376
+ console.log('Endpoint:', endpointResult.data);
370
377
  }
371
378
 
372
379
  // Get Submodel directly by endpoint URL
373
380
  const byEndpointResult = await service.getSubmodelByEndpoint({
374
- endpoint: 'http://localhost:8082/submodels/encoded-id'
381
+ endpoint: 'http://localhost:8082/submodels/encoded-id',
375
382
  });
376
383
 
377
384
  // Delete Submodel (removes from both registry and repository)
378
385
  await service.deleteSubmodel({
379
- submodelIdentifier: 'https://example.com/ids/sm/my-submodel'
386
+ submodelIdentifier: 'https://example.com/ids/sm/my-submodel',
380
387
  });
381
388
 
382
389
  // Service works with only repository (no registry)
383
390
  const repoOnlyService = new SubmodelService({
384
- repositoryConfig: new Configuration({ basePath: 'http://localhost:8082' })
391
+ repositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
385
392
  });
386
393
 
387
394
  const repoList = await repoOnlyService.getSubmodelList();
@@ -389,39 +396,39 @@ const repoList = await repoOnlyService.getSubmodelList();
389
396
 
390
397
  // Fetch submodels with concept descriptions
391
398
  const serviceWithCD = new SubmodelService({
392
- registryConfig: new Configuration({ basePath: 'http://localhost:8085' }),
393
- repositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
394
- conceptDescriptionRepositoryConfig: new Configuration({ basePath: 'http://localhost:8083' }),
399
+ registryConfig: new Configuration({ basePath: 'http://localhost:8085' }),
400
+ repositoryConfig: new Configuration({ basePath: 'http://localhost:8082' }),
401
+ conceptDescriptionRepositoryConfig: new Configuration({ basePath: 'http://localhost:8083' }),
395
402
  });
396
403
 
397
404
  // Get submodel with its concept descriptions
398
405
  const withCD = await serviceWithCD.getSubmodelById({
399
- submodelIdentifier: 'https://example.com/ids/sm/my-submodel',
400
- includeConceptDescriptions: true,
406
+ submodelIdentifier: 'https://example.com/ids/sm/my-submodel',
407
+ includeConceptDescriptions: true,
401
408
  });
402
409
  if (withCD.success) {
403
- console.log('Submodel:', withCD.data.submodel);
404
- console.log('Concept Descriptions:', withCD.data.conceptDescriptions);
405
- // conceptDescriptions array contains all unique CDs referenced by:
406
- // - The submodel's semanticId
407
- // - All submodel elements' semanticId properties (recursively through collections, lists, entities)
410
+ console.log('Submodel:', withCD.data.submodel);
411
+ console.log('Concept Descriptions:', withCD.data.conceptDescriptions);
412
+ // conceptDescriptions array contains all unique CDs referenced by:
413
+ // - The submodel's semanticId
414
+ // - All submodel elements' semanticId properties (recursively through collections, lists, entities)
408
415
  }
409
416
 
410
417
  // Get all submodels with concept descriptions
411
418
  const listWithCD = await serviceWithCD.getSubmodelList({
412
- preferRegistry: false,
413
- includeConceptDescriptions: true,
419
+ preferRegistry: false,
420
+ includeConceptDescriptions: true,
414
421
  });
415
422
  if (listWithCD.success) {
416
- console.log('Submodels:', listWithCD.data.submodels);
417
- console.log('All Concept Descriptions:', listWithCD.data.conceptDescriptions);
418
- // Concept descriptions are deduplicated across all submodels
423
+ console.log('Submodels:', listWithCD.data.submodels);
424
+ console.log('All Concept Descriptions:', listWithCD.data.conceptDescriptions);
425
+ // Concept descriptions are deduplicated across all submodels
419
426
  }
420
427
 
421
428
  // Get submodel by endpoint with concept descriptions
422
429
  const byEndpointWithCD = await serviceWithCD.getSubmodelByEndpoint({
423
- endpoint: 'http://localhost:8082/submodels/encoded-id',
424
- includeConceptDescriptions: true,
430
+ endpoint: 'http://localhost:8082/submodels/encoded-id',
431
+ includeConceptDescriptions: true,
425
432
  });
426
433
  ```
427
434
 
@@ -447,29 +454,30 @@ const encoded = base64Encode('https://example.com/ids/aas/my-aas');
447
454
  ```typescript
448
455
  import { serializeXml, deserializeXml } from 'basyx-typescript-sdk';
449
456
  import { BaSyxEnvironment } from 'basyx-typescript-sdk';
450
- import { AssetAdministrationShell, AssetInformation, AssetKind, Submodel, ModellingKind } from '@aas-core-works/aas-core3.1-typescript/types';
457
+ import {
458
+ AssetAdministrationShell,
459
+ AssetInformation,
460
+ AssetKind,
461
+ Submodel,
462
+ ModellingKind,
463
+ } from '@aas-core-works/aas-core3.1-typescript/types';
451
464
 
452
465
  // Create an environment with AAS and Submodels
453
466
  const environment = new BaSyxEnvironment(
454
- [
455
- new AssetAdministrationShell(
456
- 'https://example.com/ids/aas/my-aas',
457
- new AssetInformation(AssetKind.Instance)
458
- )
459
- ],
460
- [
461
- new Submodel(
462
- 'https://example.com/ids/sm/my-submodel',
463
- null,
464
- null,
465
- 'MySubmodel',
466
- null,
467
- null,
468
- null,
469
- ModellingKind.Instance
470
- )
471
- ],
472
- [] // conceptDescriptions
467
+ [new AssetAdministrationShell('https://example.com/ids/aas/my-aas', new AssetInformation(AssetKind.Instance))],
468
+ [
469
+ new Submodel(
470
+ 'https://example.com/ids/sm/my-submodel',
471
+ null,
472
+ null,
473
+ 'MySubmodel',
474
+ null,
475
+ null,
476
+ null,
477
+ ModellingKind.Instance
478
+ ),
479
+ ],
480
+ [] // conceptDescriptions
473
481
  );
474
482
 
475
483
  // Serialize to XML string