basyx-typescript-sdk 1.0.1 → 1.0.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.
@@ -26,7 +26,6 @@ export class AasDiscoveryClient {
26
26
  cursor: cursor,
27
27
  });
28
28
  const shellIds = result.result ?? [];
29
- console.log('all shellIds:', shellIds);
30
29
  return {
31
30
  success: true,
32
31
  data: { pagedResult: result.pagingMetadata, result: shellIds },
@@ -56,7 +55,6 @@ export class AasDiscoveryClient {
56
55
  aasIdentifier: encodedAasIdentifier,
57
56
  specificAssetId: specificAssetId.map(convertCoreAssetIdToApiAssetId),
58
57
  });
59
- console.log('created asset links:', result);
60
58
  return { success: true, data: result.map(convertApiAssetIdToCoreAssetId) };
61
59
  }
62
60
  catch (err) {
@@ -28,7 +28,6 @@ export class AasRegistryClient {
28
28
  assetType: encodedAssetType,
29
29
  });
30
30
  const aasDescriptors = (result.result ?? []).map(convertApiAasDescriptorToCoreAasDescriptor);
31
- console.log('all aas descriptors:', aasDescriptors);
32
31
  return {
33
32
  success: true,
34
33
  data: { pagedResult: result.pagingMetadata, result: aasDescriptors },
@@ -55,7 +54,6 @@ export class AasRegistryClient {
55
54
  const result = await apiInstance.postAssetAdministrationShellDescriptor({
56
55
  assetAdministrationShellDescriptor: convertCoreAasDescriptorToApiAasDescriptor(assetAdministrationShellDescriptor),
57
56
  });
58
- console.log('created aas descriptor:', result);
59
57
  return { success: true, data: convertApiAasDescriptorToCoreAasDescriptor(result) };
60
58
  }
61
59
  catch (err) {
@@ -159,7 +157,6 @@ export class AasRegistryClient {
159
157
  cursor: cursor,
160
158
  });
161
159
  const submodelDescriptors = (result.result ?? []).map(convertApiSubmodelDescriptorToCoreSubmodelDescriptor);
162
- console.log('all submodel descriptors:', submodelDescriptors);
163
160
  return {
164
161
  success: true,
165
162
  data: { pagedResult: result.pagingMetadata, result: submodelDescriptors },
@@ -189,12 +186,10 @@ export class AasRegistryClient {
189
186
  aasIdentifier: encodedAasIdentifier,
190
187
  submodelDescriptor: convertCoreSubmodelDescriptorToApiSubmodelDescriptor(submodelDescriptor),
191
188
  });
192
- console.log('created submodel descriptor:', result);
193
189
  return { success: true, data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(result) };
194
190
  }
195
191
  catch (err) {
196
192
  const customError = await handleApiError(err);
197
- //console.log('error during creation of submodel descriptor:', customError);
198
193
  return { success: false, error: customError };
199
194
  }
200
195
  }
@@ -920,7 +920,6 @@ export class AasRepositoryClient {
920
920
  idShortPath: idShortPath,
921
921
  submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
922
922
  });
923
- console.log('created element at specified path:', result);
924
923
  return { success: true, data: convertApiSubmodelElementToCoreSubmodelElement(result) };
925
924
  }
926
925
  catch (err) {
@@ -20,14 +20,12 @@ export class AasxFileClient {
20
20
  const result = await apiInstance.getAllAASXPackageIds({
21
21
  aasId: aasId,
22
22
  });
23
- console.log('received packages:', result);
24
23
  return {
25
24
  success: true,
26
25
  data: { result },
27
26
  };
28
27
  }
29
28
  catch (err) {
30
- console.error('Failed to fetch AASX packagees:', err);
31
29
  const customError = await handleApiError(err);
32
30
  return { success: false, error: customError };
33
31
  }
@@ -54,11 +52,9 @@ export class AasxFileClient {
54
52
  file: file,
55
53
  fileName: fileName,
56
54
  });
57
- console.log('created aasx package: ', result);
58
55
  return { success: true, data: result };
59
56
  }
60
57
  catch (err) {
61
- console.error('Failed to create AASX package:', err);
62
58
  const customError = await handleApiError(err);
63
59
  return { success: false, error: customError };
64
60
  }
@@ -80,11 +76,9 @@ export class AasxFileClient {
80
76
  const result = await apiInstance.getAASXByPackageId({
81
77
  packageId: encodedPackageId,
82
78
  });
83
- console.log('received aasx package by id: ', result);
84
79
  return { success: true, data: result };
85
80
  }
86
81
  catch (err) {
87
- console.error('Failed to fetch AASX package by id:', err);
88
82
  const customError = await handleApiError(err);
89
83
  return { success: false, error: customError };
90
84
  }
@@ -23,7 +23,6 @@ export class SubmodelRegistryClient {
23
23
  cursor: cursor,
24
24
  });
25
25
  const submodelDescriptors = (result.result ?? []).map(convertApiSubmodelDescriptorToCoreSubmodelDescriptor);
26
- console.log('all submodel descriptors:', submodelDescriptors);
27
26
  return {
28
27
  success: true,
29
28
  data: { pagedResult: result.pagingMetadata, result: submodelDescriptors },
@@ -50,7 +49,6 @@ export class SubmodelRegistryClient {
50
49
  const result = await apiInstance.postSubmodelDescriptor({
51
50
  submodelDescriptor: convertCoreSubmodelDescriptorToApiSubmodelDescriptor(submodelDescriptor),
52
51
  });
53
- console.log('created submodel descriptor:', result);
54
52
  return { success: true, data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(result) };
55
53
  }
56
54
  catch (err) {
@@ -33,7 +33,6 @@ export class SubmodelRepositoryClient {
33
33
  extent: extent,
34
34
  });
35
35
  const submodels = (result.result ?? []).map(convertApiSubmodelToCoreSubmodel);
36
- console.log('all submodels:', submodels);
37
36
  return {
38
37
  success: true,
39
38
  data: { pagedResult: result.pagingMetadata, result: submodels },
@@ -171,7 +170,6 @@ export class SubmodelRepositoryClient {
171
170
  extent: extent,
172
171
  });
173
172
  const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
174
- console.log('all submodelElements:', submodelElements);
175
173
  return {
176
174
  success: true,
177
175
  data: { pagedResult: result.pagingMetadata, result: submodelElements },
@@ -230,7 +228,6 @@ export class SubmodelRepositoryClient {
230
228
  level: level,
231
229
  extent: extent,
232
230
  });
233
- console.log('data:', result);
234
231
  return { success: true, data: convertApiSubmodelElementToCoreSubmodelElement(result) };
235
232
  }
236
233
  catch (err) {
@@ -259,7 +256,6 @@ export class SubmodelRepositoryClient {
259
256
  idShortPath: idShortPath,
260
257
  submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
261
258
  });
262
- console.log('created element at specified path:', result);
263
259
  return { success: true, data: convertApiSubmodelElementToCoreSubmodelElement(result) };
264
260
  }
265
261
  catch (err) {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  export * from './clients';
2
+ export * from './services';
2
3
  export * from './generated';
3
- export * as Models from './models';
4
+ export * from './models';
5
+ export * from './lib';
6
+ export * as Lib from './lib';
7
+ export * from './utils';
8
+ export * as Utils from './utils';
package/dist/index.js CHANGED
@@ -1,3 +1,30 @@
1
+ // ============================================================================
2
+ // Client Classes - Direct access to BaSyx API clients
3
+ // ============================================================================
1
4
  export * from './clients';
5
+ // ============================================================================
6
+ // Services - High-level orchestration services
7
+ // ============================================================================
8
+ export * from './services';
9
+ // ============================================================================
10
+ // Generated Types - OpenAPI-generated types and runtime
11
+ // ============================================================================
2
12
  export * from './generated';
3
- export * as Models from './models';
13
+ // ============================================================================
14
+ // Models - Custom models and descriptors
15
+ // ============================================================================
16
+ export * from './models';
17
+ // ============================================================================
18
+ // Library Functions - Conversion, serialization, and helper functions
19
+ // ============================================================================
20
+ // Export lib functions directly for convenience
21
+ export * from './lib';
22
+ // Also available under Lib namespace for organized imports
23
+ export * as Lib from './lib';
24
+ // ============================================================================
25
+ // Utility Functions - Helpers for working with AAS types
26
+ // ============================================================================
27
+ // Export utility functions directly for convenience
28
+ export * from './utils';
29
+ // Also available under Utils namespace for organized imports
30
+ export * as Utils from './utils';
@@ -61,6 +61,15 @@ export function base64Decode(urlSafeBase64String) {
61
61
  base64String += '=='.substring(0, 4 - incompleteFourChars);
62
62
  const encodedUriComponent = atob(base64String);
63
63
  const escapedEncodedUriComponent = escape(encodedUriComponent);
64
- const decodedString = decodeURIComponent(escapedEncodedUriComponent);
65
- return decodedString;
64
+ try {
65
+ const decodedString = decodeURIComponent(escapedEncodedUriComponent);
66
+ return decodedString;
67
+ }
68
+ catch {
69
+ // If decodeURIComponent fails, it usually means the decoded string does not contain valid percent-encoded sequences.
70
+ // This can happen if the original input to base64Encode did not require URI encoding (e.g., only contained ASCII characters).
71
+ // In such cases, we return the unescaped string directly as a fallback.
72
+ // Example: base64Decode(base64Encode("simpleASCII")) will not require URI decoding.
73
+ return unescape(escapedEncodedUriComponent);
74
+ }
66
75
  }
@@ -1,7 +1,24 @@
1
1
  import { common } from '@aas-core-works/aas-core3.0-typescript';
2
2
  import { administrativeInformationFromJsonable, assetKindFromJsonable, DeserializationError, extensionFromJsonable, langStringNameTypeFromJsonable, langStringTextTypeFromJsonable, referenceFromJsonable, specificAssetIdFromJsonable, toJsonable, } from '@aas-core-works/aas-core3.0-typescript/jsonization';
3
+ import { AssetKind } from '@aas-core-works/aas-core3.0-typescript/types';
3
4
  //import { AasRegistryService } from '../generated';
4
5
  import { AssetAdministrationShellDescriptor, SubmodelDescriptor, } from '../models/Descriptors';
6
+ /**
7
+ * Convert AssetKind enum to its JSON string representation.
8
+ * The Core library uses numeric enums (e.g., Instance = 1), but the API expects strings.
9
+ */
10
+ function assetKindToJsonable(assetKind) {
11
+ switch (assetKind) {
12
+ case AssetKind.Instance:
13
+ return 'Instance';
14
+ case AssetKind.Type:
15
+ return 'Type';
16
+ case AssetKind.NotApplicable:
17
+ return 'NotApplicable';
18
+ default:
19
+ throw new Error(`Unknown AssetKind value: ${assetKind}`);
20
+ }
21
+ }
5
22
  export function assetAdministrationShellDescriptorFromJsonable(json) {
6
23
  if (json === null) {
7
24
  return new common.Either(null, new DeserializationError('Expected a JSON object, but got null'));
@@ -108,7 +125,9 @@ export function toJsonableAssetAdministrationShellDescriptor(descriptor) {
108
125
  extensions: descriptor.extensions.map(toJsonable),
109
126
  }),
110
127
  ...(descriptor.administration !== null && { administration: toJsonable(descriptor.administration) }),
111
- ...(descriptor.assetKind !== null && { assetKind: descriptor.assetKind }),
128
+ ...(descriptor.assetKind !== null && {
129
+ assetKind: assetKindToJsonable(descriptor.assetKind),
130
+ }),
112
131
  ...(descriptor.assetType !== null && { assetType: descriptor.assetType }),
113
132
  ...(descriptor.globalAssetId !== null && { globalAssetId: descriptor.globalAssetId }),
114
133
  ...(descriptor.specificAssetIds !== null && {
@@ -0,0 +1,9 @@
1
+ export { assetAdministrationShellDescriptorFromJsonable, endpointFromJsonable, protocolInformationFromJsonable, submodelDescriptorFromJsonable, toJsonableAssetAdministrationShellDescriptor, toJsonableEndpoint, toJsonableProtocolInformation, toJsonableSecurityAttribute, toJsonableSubmodelDescriptor, } from './descriptorJsonization';
2
+ export { convertApiAasDescriptorToCoreAasDescriptor, convertApiSubmodelDescriptorToCoreSubmodelDescriptor, convertCoreAasDescriptorToApiAasDescriptor, convertCoreSubmodelDescriptorToApiSubmodelDescriptor, } from './convertAasDescriptorTypes';
3
+ export { convertApiAssetIdToCoreAssetId, convertCoreAssetIdToApiAssetId } from './convertAasDiscoveryTypes';
4
+ export { convertApiAasToCoreAas, convertApiAssetInformationToCoreAssetInformation, convertApiReferenceToCoreReference, convertCoreAasToApiAas, convertCoreAssetInformationToApiAssetInformation, convertCoreReferenceToApiReference, } from './convertAasTypes';
5
+ export { convertApiCDToCoreCD, convertCoreCDToApiCD } from './convertConceptDescriptionTypes';
6
+ export { convertApiSubmodelElementToCoreSubmodelElement, convertApiSubmodelToCoreSubmodel, convertCoreSubmodelElementToApiSubmodelElement, convertCoreSubmodelToApiSubmodel, } from './convertSubmodelTypes';
7
+ export { applyDefaults } from './apiConfig';
8
+ export { base64Decode, base64Encode } from './base64Url';
9
+ export { handleApiError } from './errorHandler';
@@ -0,0 +1,12 @@
1
+ // Descriptor Serialization/Deserialization
2
+ export { assetAdministrationShellDescriptorFromJsonable, endpointFromJsonable, protocolInformationFromJsonable, submodelDescriptorFromJsonable, toJsonableAssetAdministrationShellDescriptor, toJsonableEndpoint, toJsonableProtocolInformation, toJsonableSecurityAttribute, toJsonableSubmodelDescriptor, } from './descriptorJsonization';
3
+ // Type Converters
4
+ export { convertApiAasDescriptorToCoreAasDescriptor, convertApiSubmodelDescriptorToCoreSubmodelDescriptor, convertCoreAasDescriptorToApiAasDescriptor, convertCoreSubmodelDescriptorToApiSubmodelDescriptor, } from './convertAasDescriptorTypes';
5
+ export { convertApiAssetIdToCoreAssetId, convertCoreAssetIdToApiAssetId } from './convertAasDiscoveryTypes';
6
+ export { convertApiAasToCoreAas, convertApiAssetInformationToCoreAssetInformation, convertApiReferenceToCoreReference, convertCoreAasToApiAas, convertCoreAssetInformationToApiAssetInformation, convertCoreReferenceToApiReference, } from './convertAasTypes';
7
+ export { convertApiCDToCoreCD, convertCoreCDToApiCD } from './convertConceptDescriptionTypes';
8
+ export { convertApiSubmodelElementToCoreSubmodelElement, convertApiSubmodelToCoreSubmodel, convertCoreSubmodelElementToApiSubmodelElement, convertCoreSubmodelToApiSubmodel, } from './convertSubmodelTypes';
9
+ // Utilities
10
+ export { applyDefaults } from './apiConfig';
11
+ export { base64Decode, base64Encode } from './base64Url';
12
+ export { handleApiError } from './errorHandler';
@@ -1,2 +1,3 @@
1
1
  export * from './api';
2
2
  export * from './AssetId';
3
+ export * from './Descriptors';
@@ -1,2 +1,3 @@
1
1
  export * from './api';
2
2
  export * from './AssetId';
3
+ export * from './Descriptors';
@@ -0,0 +1,240 @@
1
+ import type { ApiResult } from '../models/api';
2
+ import { AssetAdministrationShell, Reference, Submodel } from '@aas-core-works/aas-core3.0-typescript/types';
3
+ import { Configuration } from '../generated';
4
+ import { AssetId } from '../models/AssetId';
5
+ import { AssetAdministrationShellDescriptor } from '../models/Descriptors';
6
+ export interface AasServiceConfig {
7
+ registryConfig?: Configuration;
8
+ repositoryConfig?: Configuration;
9
+ submodelRegistryConfig?: Configuration;
10
+ submodelRepositoryConfig?: Configuration;
11
+ conceptDescriptionRepositoryConfig?: Configuration;
12
+ discoveryConfig?: Configuration;
13
+ }
14
+ /**
15
+ * AasService combines and orchestrates multiple clients and services, including:
16
+ * - AasRegistryClient
17
+ * - AasRepositoryClient
18
+ * - AasDiscoveryClient
19
+ * - SubmodelService
20
+ *
21
+ * It provides higher-level functionality for working with Asset Administration Shells
22
+ * by coordinating operations across these BaSyx components, demonstrating the multi-client pattern.
23
+ */
24
+ export declare class AasService {
25
+ private registryClient;
26
+ private repositoryClient;
27
+ private discoveryClient;
28
+ private registryConfig?;
29
+ private repositoryConfig?;
30
+ private discoveryConfig?;
31
+ private submodelService;
32
+ constructor(config: AasServiceConfig);
33
+ /**
34
+ * Retrieves a list of all Asset Administration Shells.
35
+ *
36
+ * This method first attempts to fetch AAS Descriptors from the Registry,
37
+ * then uses the descriptor endpoints to fetch the actual shells.
38
+ * If a registry is not configured or fails, it falls back to fetching
39
+ * AAS directly from the Repository.
40
+ *
41
+ * @param options Object containing:
42
+ * - preferRegistry?: Whether to prefer registry over repository (default: true)
43
+ * - limit?: Maximum number of elements to retrieve
44
+ * - cursor?: Pagination cursor
45
+ * - includeSubmodels?: Whether to fetch submodels for each shell (default: false)
46
+ * - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
47
+ *
48
+ * @returns Either `{ success: true; data: { shells, source, submodels? } }` or `{ success: false; error: ... }`.
49
+ */
50
+ getAasList(options?: {
51
+ preferRegistry?: boolean;
52
+ limit?: number;
53
+ cursor?: string;
54
+ includeSubmodels?: boolean;
55
+ includeConceptDescriptions?: boolean;
56
+ }): Promise<ApiResult<{
57
+ shells: AssetAdministrationShell[];
58
+ source: 'registry' | 'repository';
59
+ submodels?: Record<string, Submodel[]>;
60
+ }, any>>;
61
+ /**
62
+ * Retrieves an Asset Administration Shell by ID.
63
+ *
64
+ * This method first attempts to fetch the descriptor from the registry
65
+ * and use its endpoint to fetch the shell. If that fails, it falls back
66
+ * to fetching directly from the repository.
67
+ *
68
+ * @param options Object containing:
69
+ * - aasIdentifier: The AAS identifier
70
+ * - useRegistryEndpoint?: Whether to try registry endpoint first (default: true)
71
+ * - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
72
+ * - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
73
+ *
74
+ * @returns Either `{ success: true; data: { shell, descriptor?, submodels? } }` or `{ success: false; error: ... }`.
75
+ */
76
+ getAasById(options: {
77
+ aasIdentifier: string;
78
+ useRegistryEndpoint?: boolean;
79
+ includeSubmodels?: boolean;
80
+ includeConceptDescriptions?: boolean;
81
+ }): Promise<ApiResult<{
82
+ shell: AssetAdministrationShell;
83
+ descriptor?: AssetAdministrationShellDescriptor;
84
+ submodels?: Submodel[];
85
+ }, any>>;
86
+ /**
87
+ * Gets the endpoint URL for an Asset Administration Shell by its identifier.
88
+ *
89
+ * If registry is configured and useRegistry is true, retrieves the endpoint
90
+ * from the descriptor's endpoint object. Otherwise, constructs the endpoint
91
+ * from the repository base path and the encoded AAS identifier.
92
+ *
93
+ * @param options Object containing:
94
+ * - aasIdentifier: The AAS identifier
95
+ * - useRegistry?: Whether to try getting endpoint from registry (default: true)
96
+ *
97
+ * @returns Either `{ success: true; data: endpointUrl }` or `{ success: false; error: ... }`.
98
+ */
99
+ getAasEndpointById(options: {
100
+ aasIdentifier: string;
101
+ useRegistry?: boolean;
102
+ }): Promise<ApiResult<string, any>>;
103
+ /**
104
+ * Retrieves an Asset Administration Shell by its endpoint URL.
105
+ *
106
+ * Extracts the base URL and base64url-encoded AAS identifier from the endpoint,
107
+ * decodes the identifier, and fetches the shell from the repository.
108
+ *
109
+ * @param options Object containing:
110
+ * - endpoint: The endpoint URL (format: http://host/shells/{base64EncodedId})
111
+ * - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
112
+ * - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
113
+ *
114
+ * @returns Either `{ success: true; data: { shell, submodels? } }` or `{ success: false; error: ... }`.
115
+ */
116
+ getAasByEndpoint(options: {
117
+ endpoint: string;
118
+ includeSubmodels?: boolean;
119
+ includeConceptDescriptions?: boolean;
120
+ }): Promise<ApiResult<{
121
+ shell: AssetAdministrationShell;
122
+ submodels?: Submodel[];
123
+ }, any>>;
124
+ /**
125
+ * Creates an Asset Administration Shell and optionally registers it in the registry.
126
+ *
127
+ * This method creates the AAS in the repository first. If registry is configured
128
+ * and registerInRegistry is true, it automatically creates a descriptor from the shell
129
+ * and registers it in the registry with the repository endpoint.
130
+ *
131
+ * @param options Object containing:
132
+ * - shell: The AAS to create
133
+ * - registerInRegistry?: Whether to register the descriptor in the registry (default: true)
134
+ *
135
+ * @returns Either `{ success: true; data: { shell, descriptor? } }` or `{ success: false; error: ... }`.
136
+ */
137
+ createAas(options: {
138
+ shell: AssetAdministrationShell;
139
+ registerInRegistry?: boolean;
140
+ }): Promise<ApiResult<{
141
+ shell: AssetAdministrationShell;
142
+ descriptor?: AssetAdministrationShellDescriptor;
143
+ }, any>>;
144
+ /**
145
+ * Updates an Asset Administration Shell and optionally updates its descriptor in the registry.
146
+ *
147
+ * This method updates the AAS in the repository. If registry is configured
148
+ * and updateInRegistry is true, it automatically creates/updates the descriptor
149
+ * in the registry with the updated shell data.
150
+ *
151
+ * @param options Object containing:
152
+ * - shell: The updated AAS
153
+ * - updateInRegistry?: Whether to update the descriptor in the registry (default: true)
154
+ *
155
+ * @returns Either `{ success: true; data: { shell, descriptor? } }` or `{ success: false; error: ... }`.
156
+ */
157
+ updateAas(options: {
158
+ shell: AssetAdministrationShell;
159
+ updateInRegistry?: boolean;
160
+ }): Promise<ApiResult<{
161
+ shell: AssetAdministrationShell;
162
+ descriptor?: AssetAdministrationShellDescriptor;
163
+ }, any>>;
164
+ /**
165
+ * Deletes an Asset Administration Shell and optionally removes it from the registry.
166
+ *
167
+ * This method removes the descriptor from the registry first (if requested),
168
+ * then deletes the AAS from the repository.
169
+ *
170
+ * @param options Object containing:
171
+ * - aasIdentifier: The AAS identifier to remove
172
+ * - deleteFromRegistry?: Whether to delete from registry (default: true)
173
+ *
174
+ * @returns Either `{ success: true; data: void }` or `{ success: false; error: ... }`.
175
+ */
176
+ deleteAas(options: {
177
+ aasIdentifier: string;
178
+ deleteFromRegistry?: boolean;
179
+ }): Promise<ApiResult<void, any>>;
180
+ /**
181
+ * Retrieves Asset Administration Shells by their asset identifiers.
182
+ *
183
+ * This method uses the discovery service to resolve asset IDs to AAS identifiers,
184
+ * then fetches the corresponding shells. If multiple AAS IDs are found for the given
185
+ * asset IDs, all matching shells are returned.
186
+ *
187
+ * @param options Object containing:
188
+ * - assetIds: Array of asset identifiers to search for
189
+ * - includeSubmodels?: Whether to fetch submodels for each shell (default: false)
190
+ * - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
191
+ *
192
+ * @returns Either `{ success: true; data: { shells, aasIds } }` or `{ success: false; error: ... }`.
193
+ */
194
+ getAasByAssetId(options: {
195
+ assetIds: AssetId[];
196
+ includeSubmodels?: boolean;
197
+ includeConceptDescriptions?: boolean;
198
+ }): Promise<ApiResult<{
199
+ shells: AssetAdministrationShell[];
200
+ aasIds: string[];
201
+ }, any>>;
202
+ /**
203
+ * Resolves a reference to retrieve the endpoints for the referenced AAS, Submodel, and SubmodelElement path.
204
+ *
205
+ * This method parses a Reference object and extracts the AAS ID, Submodel ID, and builds the path
206
+ * to the SubmodelElement if applicable. It supports ModelReferences with keys pointing to:
207
+ * - AssetAdministrationShell
208
+ * - Submodel
209
+ * - SubmodelElements (including nested elements in collections and lists)
210
+ *
211
+ * @param options Object containing:
212
+ * - reference: The Reference object to resolve
213
+ *
214
+ * @returns Either `{ success: true; data: { aasEndpoint?, submodelEndpoint?, submodelElementPath? } }` or `{ success: false; error: ... }`.
215
+ */
216
+ resolveReference(options: {
217
+ reference: Reference;
218
+ }): Promise<ApiResult<{
219
+ aasEndpoint?: string;
220
+ submodelEndpoint?: string;
221
+ submodelElementPath?: string;
222
+ }, any>>;
223
+ /**
224
+ * Helper method to create an AAS descriptor from an AssetAdministrationShell.
225
+ * Populates descriptor fields from the shell including metadata and endpoint configuration.
226
+ *
227
+ * @param shell The AssetAdministrationShell to create descriptor from
228
+ * @returns AssetAdministrationShellDescriptor with all populated fields
229
+ */
230
+ private createDescriptorFromAas;
231
+ /**
232
+ * Helper method to fetch submodels for a list of shells.
233
+ * Returns a map of shell IDs to their corresponding submodels.
234
+ *
235
+ * @param shells Array of Asset Administration Shells
236
+ * @param includeConceptDescriptions Whether to fetch concept descriptions for submodels
237
+ * @returns Record mapping shell IDs to arrays of Submodels
238
+ */
239
+ private fetchSubmodelsForShells;
240
+ }