basyx-typescript-sdk 0.2.2 → 0.9.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 +5 -3
- package/bundle/index.js +17534 -857
- package/bundle/index.js.map +1 -1
- package/dist/clients/AasDiscoveryClient.d.ts +67 -0
- package/dist/clients/AasDiscoveryClient.js +115 -0
- package/dist/clients/AasRegistryClient.d.ts +163 -0
- package/dist/clients/AasRegistryClient.js +287 -0
- package/dist/clients/AasRepositoryClient.d.ts +790 -103
- package/dist/clients/AasRepositoryClient.js +1323 -215
- package/dist/clients/AasxFileClient.d.ts +81 -0
- package/dist/clients/AasxFileClient.js +148 -0
- package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +83 -0
- package/dist/clients/ConceptDescriptionRepositoryClient.js +143 -0
- package/dist/clients/SubmodelRegistryClient.d.ts +77 -0
- package/dist/clients/SubmodelRegistryClient.js +138 -0
- package/dist/clients/SubmodelRepositoryClient.d.ts +354 -0
- package/dist/clients/SubmodelRepositoryClient.js +585 -0
- package/dist/clients/index.d.ts +6 -0
- package/dist/clients/index.js +6 -0
- package/dist/generated/AasDiscoveryService/apis/AssetAdministrationShellBasicDiscoveryAPIApi.d.ts +80 -0
- package/dist/generated/AasDiscoveryService/apis/AssetAdministrationShellBasicDiscoveryAPIApi.js +156 -0
- package/dist/generated/AasDiscoveryService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/AasDiscoveryService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/AasDiscoveryService/apis/index.d.ts +2 -0
- package/dist/generated/AasDiscoveryService/apis/index.js +4 -0
- package/dist/generated/AasDiscoveryService/index.d.ts +3 -0
- package/dist/generated/AasDiscoveryService/index.js +5 -0
- package/dist/generated/AasDiscoveryService/models/index.d.ts +297 -0
- package/dist/generated/AasDiscoveryService/models/index.js +48 -0
- package/dist/generated/AasDiscoveryService/runtime.d.ts +181 -0
- package/dist/generated/AasDiscoveryService/runtime.js +326 -0
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.d.ts +139 -0
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.js +312 -0
- package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/AasRegistryService/apis/index.d.ts +2 -0
- package/dist/generated/AasRegistryService/apis/index.js +4 -0
- package/dist/generated/AasRegistryService/index.d.ts +3 -0
- package/dist/generated/AasRegistryService/index.js +5 -0
- package/dist/generated/AasRegistryService/models/index.d.ts +1070 -0
- package/dist/generated/AasRegistryService/models/index.js +151 -0
- package/dist/generated/AasRegistryService/runtime.d.ts +181 -0
- package/dist/generated/AasRegistryService/runtime.js +326 -0
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.d.ts +870 -0
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.js +1842 -0
- package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.d.ts +30 -0
- package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.js +49 -0
- package/dist/generated/AasRepositoryService/apis/index.d.ts +3 -0
- package/dist/generated/AasRepositoryService/apis/index.js +5 -0
- package/dist/generated/AasRepositoryService/index.d.ts +3 -0
- package/dist/generated/AasRepositoryService/index.js +5 -0
- package/dist/generated/AasRepositoryService/models/index.d.ts +4585 -0
- package/dist/generated/AasRepositoryService/models/index.js +221 -0
- package/dist/generated/AasRepositoryService/runtime.d.ts +181 -0
- package/dist/generated/AasRepositoryService/runtime.js +326 -0
- package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.d.ts +78 -0
- package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.js +184 -0
- package/dist/generated/AasxFileService/apis/index.d.ts +1 -0
- package/dist/generated/AasxFileService/apis/index.js +3 -0
- package/dist/generated/AasxFileService/index.d.ts +3 -0
- package/dist/generated/AasxFileService/index.js +5 -0
- package/dist/generated/AasxFileService/models/index.d.ts +80 -0
- package/dist/generated/AasxFileService/models/index.js +10 -0
- package/dist/generated/AasxFileService/runtime.d.ts +181 -0
- package/dist/generated/AasxFileService/runtime.js +326 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.d.ts +78 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.js +164 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/SerializationAPIApi.d.ts +30 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/SerializationAPIApi.js +49 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/index.d.ts +3 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/index.js +5 -0
- package/dist/generated/ConceptDescriptionRepositoryService/index.d.ts +3 -0
- package/dist/generated/ConceptDescriptionRepositoryService/index.js +5 -0
- package/dist/generated/ConceptDescriptionRepositoryService/models/index.d.ts +2869 -0
- package/dist/generated/ConceptDescriptionRepositoryService/models/index.js +209 -0
- package/dist/generated/ConceptDescriptionRepositoryService/runtime.d.ts +181 -0
- package/dist/generated/ConceptDescriptionRepositoryService/runtime.js +326 -0
- package/dist/generated/SubmodelRegistryService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/SubmodelRegistryService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.d.ts +75 -0
- package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.js +155 -0
- package/dist/generated/SubmodelRegistryService/apis/index.d.ts +2 -0
- package/dist/generated/SubmodelRegistryService/apis/index.js +4 -0
- package/dist/generated/SubmodelRegistryService/index.d.ts +3 -0
- package/dist/generated/SubmodelRegistryService/index.js +5 -0
- package/dist/generated/SubmodelRegistryService/models/index.d.ts +924 -0
- package/dist/generated/SubmodelRegistryService/models/index.js +141 -0
- package/dist/generated/SubmodelRegistryService/runtime.d.ts +181 -0
- package/dist/generated/SubmodelRegistryService/runtime.js +326 -0
- package/dist/generated/SubmodelRepositoryService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/SubmodelRepositoryService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/SubmodelRepositoryService/apis/SerializationAPIApi.d.ts +30 -0
- package/dist/generated/SubmodelRepositoryService/apis/SerializationAPIApi.js +49 -0
- package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.d.ts +802 -0
- package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.js +1572 -0
- package/dist/generated/SubmodelRepositoryService/apis/index.d.ts +3 -0
- package/dist/generated/SubmodelRepositoryService/apis/index.js +5 -0
- package/dist/generated/SubmodelRepositoryService/index.d.ts +3 -0
- package/dist/generated/SubmodelRepositoryService/index.js +5 -0
- package/dist/generated/SubmodelRepositoryService/models/index.d.ts +4623 -0
- package/dist/generated/SubmodelRepositoryService/models/index.js +221 -0
- package/dist/generated/SubmodelRepositoryService/runtime.d.ts +181 -0
- package/dist/generated/SubmodelRepositoryService/runtime.js +326 -0
- package/dist/generated/index.d.ts +8 -2
- package/dist/generated/index.js +8 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/apiConfig.d.ts +2 -0
- package/dist/lib/apiConfig.js +41 -0
- package/dist/lib/base64Url.js +4 -0
- package/dist/lib/convertAasDescriptorTypes.d.ts +34 -0
- package/dist/lib/convertAasDescriptorTypes.js +76 -0
- package/dist/lib/convertAasDiscoveryTypes.d.ts +18 -0
- package/dist/lib/convertAasDiscoveryTypes.js +39 -0
- package/dist/lib/convertAasTypes.d.ts +7 -7
- package/dist/lib/convertAasTypes.js +5 -0
- package/dist/lib/convertConceptDescriptionTypes.d.ts +18 -0
- package/dist/lib/convertConceptDescriptionTypes.js +39 -0
- package/dist/lib/convertSubmodelTypes.d.ts +34 -0
- package/dist/lib/convertSubmodelTypes.js +69 -0
- package/dist/lib/descriptorJsonization.d.ts +12 -0
- package/dist/lib/descriptorJsonization.js +172 -0
- package/dist/lib/errorHandler.d.ts +9 -0
- package/dist/lib/errorHandler.js +113 -0
- package/dist/models/Descriptors.d.ts +51 -0
- package/dist/models/Descriptors.js +56 -0
- package/dist/models/index.d.ts +0 -1
- package/dist/models/index.js +0 -1
- package/dist/utils/DescriptorUtils.d.ts +9 -0
- package/dist/utils/DescriptorUtils.js +37 -0
- package/dist/utils/KeyTypesUtil.d.ts +24 -0
- package/dist/utils/KeyTypesUtil.js +55 -0
- package/dist/utils/MultiLanguagePropertyUtils.d.ts +24 -0
- package/dist/utils/MultiLanguagePropertyUtils.js +46 -0
- package/dist/utils/ReferableUtils.d.ts +69 -0
- package/dist/utils/ReferableUtils.js +220 -0
- package/dist/utils/ReferenceUtil.d.ts +9 -0
- package/dist/utils/ReferenceUtil.js +22 -0
- package/dist/utils/SemanticIdUtils.d.ts +119 -0
- package/dist/utils/SemanticIdUtils.js +363 -0
- package/package.json +14 -11
- package/dist/generated/schemas.gen.d.ts +0 -2357
- package/dist/generated/schemas.gen.js +0 -2789
- package/dist/generated/sdk.gen.d.ts +0 -822
- package/dist/generated/sdk.gen.js +0 -2225
- package/dist/generated/types.gen.d.ts +0 -10829
- package/dist/generated/types.gen.js +0 -2
- package/dist/lib/createAasRepoClient.d.ts +0 -9
- package/dist/lib/createAasRepoClient.js +0 -15
- package/dist/models/aas-repository.d.ts +0 -65
- package/dist/models/aas-repository.js +0 -1
|
@@ -1,415 +1,1523 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AasRepositoryService } from '../generated';
|
|
2
|
+
import { applyDefaults } from '../lib/apiConfig';
|
|
2
3
|
import { base64Encode } from '../lib/base64Url';
|
|
3
4
|
import { convertApiAasToCoreAas, convertApiAssetInformationToCoreAssetInformation, convertApiReferenceToCoreReference, convertCoreAasToApiAas, convertCoreAssetInformationToApiAssetInformation, convertCoreReferenceToApiReference, } from '../lib/convertAasTypes';
|
|
4
|
-
import {
|
|
5
|
+
import { convertApiSubmodelElementToCoreSubmodelElement, convertApiSubmodelToCoreSubmodel, convertCoreSubmodelElementToApiSubmodelElement, convertCoreSubmodelToApiSubmodel, } from '../lib/convertSubmodelTypes';
|
|
6
|
+
import { handleApiError } from '../lib/errorHandler';
|
|
5
7
|
export class AasRepositoryClient {
|
|
6
8
|
/**
|
|
7
|
-
* Returns all Asset Administration Shells
|
|
9
|
+
* Returns all Asset Administration Shells
|
|
8
10
|
*
|
|
9
11
|
* @param options Object containing:
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* - cursor?: A paging cursor from previous responses
|
|
12
|
+
* - configuration: The http request options
|
|
13
|
+
* - assetIds?: A list of specific Asset identifiers
|
|
14
|
+
* - idShort?: The Asset Administration Shell’s IdShort
|
|
15
|
+
* - limit?: The maximum number of elements in the response array
|
|
16
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
16
17
|
*
|
|
17
18
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
18
19
|
*/
|
|
19
20
|
async getAllAssetAdministrationShells(options) {
|
|
20
|
-
const {
|
|
21
|
+
const { configuration, assetIds, idShort, limit, cursor } = options;
|
|
21
22
|
try {
|
|
22
|
-
const
|
|
23
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
23
24
|
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify(id)));
|
|
24
|
-
const result = await
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const shells = (result.data.result ?? []).map(convertApiAasToCoreAas);
|
|
25
|
+
const result = await apiInstance.getAllAssetAdministrationShells({
|
|
26
|
+
assetIds: encodedAssetIds,
|
|
27
|
+
idShort: idShort,
|
|
28
|
+
limit: limit,
|
|
29
|
+
cursor: cursor,
|
|
30
|
+
});
|
|
31
|
+
const shells = (result.result ?? []).map(convertApiAasToCoreAas);
|
|
32
32
|
return {
|
|
33
33
|
success: true,
|
|
34
|
-
data: {
|
|
35
|
-
pagedResult: result.data.paging_metadata,
|
|
36
|
-
result: shells,
|
|
37
|
-
},
|
|
34
|
+
data: { pagedResult: result.pagingMetadata, result: shells },
|
|
38
35
|
};
|
|
39
36
|
}
|
|
40
37
|
catch (err) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
error: err instanceof Error ? err : new Error(String(err)),
|
|
44
|
-
};
|
|
38
|
+
const customError = await handleApiError(err);
|
|
39
|
+
return { success: false, error: customError };
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
/**
|
|
48
|
-
* Creates a new Asset Administration Shell
|
|
43
|
+
* Creates a new Asset Administration Shell
|
|
49
44
|
*
|
|
50
45
|
* @param options Object containing:
|
|
51
|
-
* -
|
|
52
|
-
* - assetAdministrationShell:
|
|
53
|
-
* - headers?: Optional request headers
|
|
46
|
+
* - configuration: The http request options.
|
|
47
|
+
* - assetAdministrationShell: Asset Administration Shell object
|
|
54
48
|
*
|
|
55
49
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
56
50
|
*/
|
|
57
51
|
async postAssetAdministrationShell(options) {
|
|
58
|
-
const {
|
|
52
|
+
const { configuration, assetAdministrationShell } = options;
|
|
59
53
|
try {
|
|
60
|
-
const
|
|
61
|
-
const result = await
|
|
62
|
-
|
|
63
|
-
body: convertCoreAasToApiAas(assetAdministrationShell),
|
|
54
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
55
|
+
const result = await apiInstance.postAssetAdministrationShell({
|
|
56
|
+
assetAdministrationShell: convertCoreAasToApiAas(assetAdministrationShell),
|
|
64
57
|
});
|
|
65
|
-
|
|
66
|
-
return { success: false, error: result.error };
|
|
67
|
-
}
|
|
68
|
-
return { success: true, data: convertApiAasToCoreAas(result.data) };
|
|
58
|
+
return { success: true, data: convertApiAasToCoreAas(result) };
|
|
69
59
|
}
|
|
70
60
|
catch (err) {
|
|
71
|
-
|
|
61
|
+
const customError = await handleApiError(err);
|
|
62
|
+
return { success: false, error: customError };
|
|
72
63
|
}
|
|
73
64
|
}
|
|
74
65
|
/**
|
|
75
|
-
* Deletes an Asset Administration Shell
|
|
66
|
+
* Deletes an Asset Administration Shell
|
|
76
67
|
*
|
|
77
68
|
* @param options Object containing:
|
|
78
|
-
* -
|
|
79
|
-
* - aasIdentifier: The
|
|
80
|
-
* - headers?: Optional request headers
|
|
69
|
+
* - configuration: The http request options
|
|
70
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
81
71
|
*
|
|
82
72
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
83
73
|
*/
|
|
84
74
|
async deleteAssetAdministrationShellById(options) {
|
|
85
|
-
const {
|
|
75
|
+
const { configuration, aasIdentifier } = options;
|
|
86
76
|
try {
|
|
87
|
-
const
|
|
77
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
88
78
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
89
|
-
const result = await
|
|
90
|
-
|
|
91
|
-
path: { aasIdentifier: encodedAasIdentifier },
|
|
79
|
+
const result = await apiInstance.deleteAssetAdministrationShellById({
|
|
80
|
+
aasIdentifier: encodedAasIdentifier,
|
|
92
81
|
});
|
|
93
|
-
|
|
94
|
-
return { success: false, error: result.error };
|
|
95
|
-
}
|
|
96
|
-
return { success: true, data: result.data };
|
|
82
|
+
return { success: true, data: result };
|
|
97
83
|
}
|
|
98
84
|
catch (err) {
|
|
99
|
-
|
|
85
|
+
const customError = await handleApiError(err);
|
|
86
|
+
return { success: false, error: customError };
|
|
100
87
|
}
|
|
101
88
|
}
|
|
102
89
|
/**
|
|
103
|
-
* Returns a specific Asset Administration Shell
|
|
90
|
+
* Returns a specific Asset Administration Shell
|
|
104
91
|
*
|
|
105
92
|
* @param options Object containing:
|
|
106
|
-
* -
|
|
107
|
-
* - aasIdentifier: The unique
|
|
108
|
-
* - headers?: Optional request headers
|
|
93
|
+
* - configuration: The http request options
|
|
94
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
109
95
|
*
|
|
110
96
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
111
97
|
*/
|
|
112
98
|
async getAssetAdministrationShellById(options) {
|
|
113
|
-
const {
|
|
99
|
+
const { configuration, aasIdentifier } = options;
|
|
114
100
|
try {
|
|
115
|
-
const
|
|
101
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
116
102
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
117
|
-
const result = await
|
|
118
|
-
|
|
119
|
-
path: { aasIdentifier: encodedAasIdentifier },
|
|
103
|
+
const result = await apiInstance.getAssetAdministrationShellById({
|
|
104
|
+
aasIdentifier: encodedAasIdentifier,
|
|
120
105
|
});
|
|
121
|
-
|
|
122
|
-
// Return the complete error object with status code
|
|
123
|
-
return {
|
|
124
|
-
success: false,
|
|
125
|
-
error: result.error,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
return { success: true, data: convertApiAasToCoreAas(result.data) };
|
|
106
|
+
return { success: true, data: convertApiAasToCoreAas(result) };
|
|
129
107
|
}
|
|
130
108
|
catch (err) {
|
|
131
|
-
|
|
109
|
+
const customError = await handleApiError(err);
|
|
110
|
+
return { success: false, error: customError };
|
|
132
111
|
}
|
|
133
112
|
}
|
|
134
113
|
/**
|
|
135
|
-
* Updates an existing Asset Administration Shell
|
|
114
|
+
* Updates an existing Asset Administration Shell
|
|
136
115
|
*
|
|
137
116
|
* @param options Object containing:
|
|
138
|
-
* -
|
|
139
|
-
* - aasIdentifier: The unique
|
|
140
|
-
* - assetAdministrationShell:
|
|
141
|
-
* - headers?: Optional request headers
|
|
117
|
+
* - configuration: The http request options
|
|
118
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
119
|
+
* - assetAdministrationShell: Asset Administration Shell object
|
|
142
120
|
*
|
|
143
121
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
144
122
|
*/
|
|
145
123
|
async putAssetAdministrationShellById(options) {
|
|
146
|
-
const {
|
|
124
|
+
const { configuration, aasIdentifier, assetAdministrationShell } = options;
|
|
147
125
|
try {
|
|
148
|
-
const
|
|
126
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
149
127
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
150
|
-
const result = await
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
body: convertCoreAasToApiAas(assetAdministrationShell),
|
|
128
|
+
const result = await apiInstance.putAssetAdministrationShellById({
|
|
129
|
+
aasIdentifier: encodedAasIdentifier,
|
|
130
|
+
assetAdministrationShell: convertCoreAasToApiAas(assetAdministrationShell),
|
|
154
131
|
});
|
|
155
|
-
|
|
156
|
-
return { success: false, error: result.error };
|
|
157
|
-
}
|
|
158
|
-
return { success: true, data: result.data };
|
|
132
|
+
return { success: true, data: result ? convertApiAasToCoreAas(result) : undefined };
|
|
159
133
|
}
|
|
160
134
|
catch (err) {
|
|
161
|
-
|
|
135
|
+
const customError = await handleApiError(err);
|
|
136
|
+
return { success: false, error: customError };
|
|
162
137
|
}
|
|
163
138
|
}
|
|
164
139
|
/**
|
|
165
|
-
* Returns the
|
|
140
|
+
* Returns the Asset Information
|
|
166
141
|
*
|
|
167
142
|
* @param options Object containing:
|
|
168
|
-
* -
|
|
169
|
-
* - aasIdentifier: The unique
|
|
170
|
-
* - headers?: Optional request headers
|
|
143
|
+
* - configuration: The http request options
|
|
144
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
171
145
|
*
|
|
172
146
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
173
147
|
*/
|
|
174
148
|
async getAssetInformation(options) {
|
|
175
|
-
const {
|
|
149
|
+
const { configuration, aasIdentifier } = options;
|
|
176
150
|
try {
|
|
177
|
-
const
|
|
151
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
178
152
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
179
|
-
const result = await
|
|
180
|
-
|
|
181
|
-
path: { aasIdentifier: encodedAasIdentifier },
|
|
153
|
+
const result = await apiInstance.getAssetInformationAasRepository({
|
|
154
|
+
aasIdentifier: encodedAasIdentifier,
|
|
182
155
|
});
|
|
183
|
-
if (result.error) {
|
|
184
|
-
return { success: false, error: result.error };
|
|
185
|
-
}
|
|
186
156
|
return {
|
|
187
157
|
success: true,
|
|
188
|
-
data: convertApiAssetInformationToCoreAssetInformation(result
|
|
158
|
+
data: convertApiAssetInformationToCoreAssetInformation(result),
|
|
189
159
|
};
|
|
190
160
|
}
|
|
191
161
|
catch (err) {
|
|
192
|
-
|
|
162
|
+
const customError = await handleApiError(err);
|
|
163
|
+
return { success: false, error: customError };
|
|
193
164
|
}
|
|
194
165
|
}
|
|
195
166
|
/**
|
|
196
|
-
* Updates the
|
|
167
|
+
* Updates the Asset Information
|
|
197
168
|
*
|
|
198
169
|
* @param options Object containing:
|
|
199
|
-
* -
|
|
200
|
-
* - aasIdentifier: The unique
|
|
201
|
-
* - assetInformation:
|
|
202
|
-
* - headers?: Optional request headers
|
|
170
|
+
* - configuration: The http request options
|
|
171
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
172
|
+
* - assetInformation: Asset Information object
|
|
203
173
|
*
|
|
204
174
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
205
175
|
*/
|
|
206
176
|
async putAssetInformation(options) {
|
|
207
|
-
const {
|
|
177
|
+
const { configuration, aasIdentifier, assetInformation } = options;
|
|
208
178
|
try {
|
|
209
|
-
const
|
|
179
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
210
180
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
211
|
-
const result = await
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
body: convertCoreAssetInformationToApiAssetInformation(assetInformation),
|
|
181
|
+
const result = await apiInstance.putAssetInformationAasRepository({
|
|
182
|
+
aasIdentifier: encodedAasIdentifier,
|
|
183
|
+
assetInformation: convertCoreAssetInformationToApiAssetInformation(assetInformation),
|
|
215
184
|
});
|
|
216
|
-
|
|
217
|
-
return { success: false, error: result.error };
|
|
218
|
-
}
|
|
219
|
-
return { success: true, data: result.data };
|
|
185
|
+
return { success: true, data: result };
|
|
220
186
|
}
|
|
221
187
|
catch (err) {
|
|
222
|
-
|
|
188
|
+
const customError = await handleApiError(err);
|
|
189
|
+
return { success: false, error: customError };
|
|
223
190
|
}
|
|
224
191
|
}
|
|
225
192
|
/**
|
|
226
|
-
* Deletes the Thumbnail associated with the given AAS
|
|
193
|
+
* Deletes the Thumbnail associated with the given AAS
|
|
227
194
|
*
|
|
228
195
|
* @param options Object containing:
|
|
229
|
-
* -
|
|
230
|
-
* - aasIdentifier: The unique
|
|
231
|
-
* - headers?: Optional request headers
|
|
196
|
+
* - configuration: The http request options
|
|
197
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
232
198
|
*
|
|
233
199
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
234
200
|
*/
|
|
235
201
|
async deleteThumbnail(options) {
|
|
236
|
-
const {
|
|
202
|
+
const { configuration, aasIdentifier } = options;
|
|
237
203
|
try {
|
|
238
|
-
const
|
|
204
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
239
205
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
240
|
-
const result = await
|
|
241
|
-
|
|
242
|
-
path: { aasIdentifier: encodedAasIdentifier },
|
|
206
|
+
const result = await apiInstance.deleteThumbnailAasRepository({
|
|
207
|
+
aasIdentifier: encodedAasIdentifier,
|
|
243
208
|
});
|
|
244
|
-
|
|
245
|
-
return { success: false, error: result.error };
|
|
246
|
-
}
|
|
247
|
-
return {
|
|
248
|
-
success: true,
|
|
249
|
-
data: result.data,
|
|
250
|
-
};
|
|
209
|
+
return { success: true, data: result };
|
|
251
210
|
}
|
|
252
211
|
catch (err) {
|
|
253
|
-
|
|
212
|
+
const customError = await handleApiError(err);
|
|
213
|
+
return { success: false, error: customError };
|
|
254
214
|
}
|
|
255
215
|
}
|
|
256
216
|
/**
|
|
257
|
-
* Returns the Thumbnail associated with an AAS, if any
|
|
217
|
+
* Returns the Thumbnail associated with an AAS, if any
|
|
258
218
|
*
|
|
259
219
|
* @param options Object containing:
|
|
260
|
-
* -
|
|
261
|
-
* - aasIdentifier: The unique
|
|
262
|
-
* - headers?: Optional request headers
|
|
220
|
+
* - configuration: The http request options
|
|
221
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
263
222
|
*
|
|
264
223
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
265
224
|
*/
|
|
266
225
|
async getThumbnail(options) {
|
|
267
|
-
const {
|
|
226
|
+
const { configuration, aasIdentifier } = options;
|
|
268
227
|
try {
|
|
269
|
-
const
|
|
228
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
270
229
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
271
|
-
const result = await
|
|
272
|
-
|
|
273
|
-
path: { aasIdentifier: encodedAasIdentifier },
|
|
230
|
+
const result = await apiInstance.getThumbnailAasRepository({
|
|
231
|
+
aasIdentifier: encodedAasIdentifier,
|
|
274
232
|
});
|
|
275
|
-
|
|
276
|
-
return { success: false, error: result.error };
|
|
277
|
-
}
|
|
278
|
-
return { success: true, data: result.data };
|
|
233
|
+
return { success: true, data: result };
|
|
279
234
|
}
|
|
280
235
|
catch (err) {
|
|
281
|
-
|
|
236
|
+
const customError = await handleApiError(err);
|
|
237
|
+
return { success: false, error: customError };
|
|
282
238
|
}
|
|
283
239
|
}
|
|
284
240
|
/**
|
|
285
|
-
* Updates (or creates) the Thumbnail for the given AAS
|
|
241
|
+
* Updates (or creates) the Thumbnail for the given AAS
|
|
286
242
|
*
|
|
287
243
|
* @param options Object containing:
|
|
288
|
-
* -
|
|
289
|
-
* - aasIdentifier: The unique
|
|
290
|
-
* -
|
|
291
|
-
* -
|
|
244
|
+
* - configuration: The http request options
|
|
245
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
246
|
+
* - fileName: The name of the file
|
|
247
|
+
* - file: The file to upload
|
|
292
248
|
*
|
|
293
249
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
294
250
|
*/
|
|
295
251
|
async putThumbnail(options) {
|
|
296
|
-
const {
|
|
252
|
+
const { configuration, aasIdentifier, fileName, file } = options;
|
|
297
253
|
try {
|
|
298
|
-
const
|
|
254
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
299
255
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
300
|
-
const result = await
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
256
|
+
const result = await apiInstance.putThumbnailAasRepository({
|
|
257
|
+
aasIdentifier: encodedAasIdentifier,
|
|
258
|
+
fileName: fileName,
|
|
259
|
+
file: file,
|
|
304
260
|
});
|
|
305
|
-
|
|
306
|
-
return { success: false, error: result.error };
|
|
307
|
-
}
|
|
308
|
-
return { success: true, data: result.data };
|
|
261
|
+
return { success: true, data: result };
|
|
309
262
|
}
|
|
310
263
|
catch (err) {
|
|
311
|
-
|
|
264
|
+
const customError = await handleApiError(err);
|
|
265
|
+
return { success: false, error: customError };
|
|
312
266
|
}
|
|
313
267
|
}
|
|
314
268
|
/**
|
|
315
|
-
* Returns all submodel references
|
|
269
|
+
* Returns all submodel references
|
|
316
270
|
*
|
|
317
271
|
* @param options Object containing:
|
|
318
|
-
* -
|
|
319
|
-
* - aasIdentifier: The unique
|
|
320
|
-
* -
|
|
321
|
-
* -
|
|
322
|
-
* - cursor?: Paging cursor
|
|
272
|
+
* - configuration: The http request options
|
|
273
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
274
|
+
* - limit?: The maximum number of elements in the response array
|
|
275
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
323
276
|
*
|
|
324
277
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
325
278
|
*/
|
|
326
279
|
async getAllSubmodelReferences(options) {
|
|
327
|
-
const {
|
|
280
|
+
const { configuration, aasIdentifier, limit, cursor } = options;
|
|
328
281
|
try {
|
|
329
|
-
const
|
|
282
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
330
283
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
331
|
-
const result = await
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
284
|
+
const result = await apiInstance.getAllSubmodelReferencesAasRepository({
|
|
285
|
+
aasIdentifier: encodedAasIdentifier,
|
|
286
|
+
limit: limit,
|
|
287
|
+
cursor: cursor,
|
|
335
288
|
});
|
|
336
|
-
|
|
337
|
-
return { success: false, error: result.error };
|
|
338
|
-
}
|
|
339
|
-
const submodelReferences = (result.data.result ?? []).map(convertApiReferenceToCoreReference);
|
|
289
|
+
const submodelReferences = (result.result ?? []).map(convertApiReferenceToCoreReference);
|
|
340
290
|
return {
|
|
341
291
|
success: true,
|
|
342
292
|
data: {
|
|
343
|
-
pagedResult: result.
|
|
293
|
+
pagedResult: result.pagingMetadata,
|
|
344
294
|
result: submodelReferences,
|
|
345
295
|
},
|
|
346
296
|
};
|
|
347
297
|
}
|
|
348
298
|
catch (err) {
|
|
349
|
-
|
|
299
|
+
const customError = await handleApiError(err);
|
|
300
|
+
return { success: false, error: customError };
|
|
350
301
|
}
|
|
351
302
|
}
|
|
352
303
|
/**
|
|
353
|
-
* Creates a submodel reference at the
|
|
304
|
+
* Creates a submodel reference at the Asset Administration Shell
|
|
354
305
|
*
|
|
355
306
|
* @param options Object containing:
|
|
356
|
-
* -
|
|
357
|
-
* - aasIdentifier: The
|
|
358
|
-
* - submodelReference:
|
|
359
|
-
* - headers?: Optional request headers
|
|
307
|
+
* - configuration: The http request options
|
|
308
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
309
|
+
* - submodelReference: Reference to the Submodel
|
|
360
310
|
*
|
|
361
311
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
362
312
|
*/
|
|
363
313
|
async postSubmodelReference(options) {
|
|
364
|
-
const {
|
|
314
|
+
const { configuration, aasIdentifier, submodelReference } = options;
|
|
365
315
|
try {
|
|
366
|
-
const
|
|
316
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
367
317
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
368
|
-
const result = await
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
body: convertCoreReferenceToApiReference(submodelReference),
|
|
318
|
+
const result = await apiInstance.postSubmodelReferenceAasRepository({
|
|
319
|
+
aasIdentifier: encodedAasIdentifier,
|
|
320
|
+
reference: convertCoreReferenceToApiReference(submodelReference),
|
|
372
321
|
});
|
|
373
|
-
|
|
374
|
-
return { success: false, error: result.error };
|
|
375
|
-
}
|
|
376
|
-
return { success: true, data: convertApiReferenceToCoreReference(result.data) };
|
|
322
|
+
return { success: true, data: convertApiReferenceToCoreReference(result) };
|
|
377
323
|
}
|
|
378
324
|
catch (err) {
|
|
379
|
-
|
|
325
|
+
const customError = await handleApiError(err);
|
|
326
|
+
return { success: false, error: customError };
|
|
380
327
|
}
|
|
381
328
|
}
|
|
382
329
|
/**
|
|
383
330
|
* Deletes a submodel reference from the given AAS (does not delete the submodel itself).
|
|
384
331
|
*
|
|
385
332
|
* @param options Object containing:
|
|
386
|
-
* -
|
|
333
|
+
* - configuration: The http request options
|
|
387
334
|
* - aasIdentifier: Unique ID of the AAS
|
|
388
335
|
* - submodelIdentifier: The submodel's unique ID
|
|
389
|
-
* - headers?: Optional request headers
|
|
390
336
|
*
|
|
391
337
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
392
338
|
*/
|
|
393
339
|
async deleteSubmodelReferenceById(options) {
|
|
394
|
-
const {
|
|
340
|
+
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
395
341
|
try {
|
|
396
|
-
const
|
|
342
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
397
343
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
398
344
|
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
399
|
-
const result = await
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
345
|
+
const result = await apiInstance.deleteSubmodelReferenceAasRepository({
|
|
346
|
+
aasIdentifier: encodedAasIdentifier,
|
|
347
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
348
|
+
});
|
|
349
|
+
return { success: true, data: result };
|
|
350
|
+
}
|
|
351
|
+
catch (err) {
|
|
352
|
+
const customError = await handleApiError(err);
|
|
353
|
+
return { success: false, error: customError };
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Returns the Submodel
|
|
358
|
+
*
|
|
359
|
+
* @param options Object containing:
|
|
360
|
+
* - configuration: The http request options
|
|
361
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
362
|
+
* - submodelIdentifier: The submodel's unique ID
|
|
363
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
364
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
365
|
+
*
|
|
366
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
367
|
+
*/
|
|
368
|
+
async getSubmodelByIdAasRepository(options) {
|
|
369
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
370
|
+
try {
|
|
371
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
372
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
373
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
374
|
+
const result = await apiInstance.getSubmodelByIdAasRepository({
|
|
375
|
+
aasIdentifier: encodedAasIdentifier,
|
|
376
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
377
|
+
level: level,
|
|
378
|
+
extent: extent,
|
|
379
|
+
});
|
|
380
|
+
return { success: true, data: convertApiSubmodelToCoreSubmodel(result) };
|
|
381
|
+
}
|
|
382
|
+
catch (err) {
|
|
383
|
+
const customError = await handleApiError(err);
|
|
384
|
+
return { success: false, error: customError };
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Creates or updates the Submodel
|
|
389
|
+
*
|
|
390
|
+
* @param options Object containing:
|
|
391
|
+
* - configuration: The http request options
|
|
392
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
393
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
394
|
+
* - submodel: Submodel object
|
|
395
|
+
*
|
|
396
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
397
|
+
*/
|
|
398
|
+
async putSubmodelByIdAasRepository(options) {
|
|
399
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodel } = options;
|
|
400
|
+
try {
|
|
401
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
402
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
403
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
404
|
+
const result = await apiInstance.putSubmodelByIdAasRepository({
|
|
405
|
+
aasIdentifier: encodedAasIdentifier,
|
|
406
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
407
|
+
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
408
|
+
});
|
|
409
|
+
return { success: true, data: result ? convertApiReferenceToCoreReference(result) : undefined };
|
|
410
|
+
}
|
|
411
|
+
catch (err) {
|
|
412
|
+
const customError = await handleApiError(err);
|
|
413
|
+
return { success: false, error: customError };
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Deletes the submodel from the Asset Administration Shell and the Repository.
|
|
418
|
+
*
|
|
419
|
+
* @param options Object containing:
|
|
420
|
+
* - configuration: The http request options
|
|
421
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
422
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
423
|
+
*
|
|
424
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
425
|
+
*/
|
|
426
|
+
async deleteSubmodelByIdAasRepository(options) {
|
|
427
|
+
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
428
|
+
try {
|
|
429
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
430
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
431
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
432
|
+
const result = await apiInstance.deleteSubmodelByIdAasRepository({
|
|
433
|
+
aasIdentifier: encodedAasIdentifier,
|
|
434
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
435
|
+
});
|
|
436
|
+
return { success: true, data: result };
|
|
437
|
+
}
|
|
438
|
+
catch (err) {
|
|
439
|
+
const customError = await handleApiError(err);
|
|
440
|
+
return { success: false, error: customError };
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Updates the Submodel
|
|
445
|
+
*
|
|
446
|
+
* @param options Object containing:
|
|
447
|
+
* - configuration: The http request options
|
|
448
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
449
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
450
|
+
* - submodel: Submodel object
|
|
451
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
452
|
+
*
|
|
453
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
454
|
+
*/
|
|
455
|
+
async patchSubmodelAasRepository(options) {
|
|
456
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodel, level } = options;
|
|
457
|
+
try {
|
|
458
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
459
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
460
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
461
|
+
const result = await apiInstance.patchSubmodelAasRepository({
|
|
462
|
+
aasIdentifier: encodedAasIdentifier,
|
|
463
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
464
|
+
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
465
|
+
level: level,
|
|
466
|
+
});
|
|
467
|
+
return { success: true, data: result };
|
|
468
|
+
}
|
|
469
|
+
catch (err) {
|
|
470
|
+
const customError = await handleApiError(err);
|
|
471
|
+
return { success: false, error: customError };
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Returns the Submodel's metadata elements
|
|
476
|
+
*
|
|
477
|
+
* @param options Object containing:
|
|
478
|
+
* - configuration: The http request options
|
|
479
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
480
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
481
|
+
*
|
|
482
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
483
|
+
*/
|
|
484
|
+
async getSubmodelByIdMetadataAasRepository(options) {
|
|
485
|
+
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
486
|
+
try {
|
|
487
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
488
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
489
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
490
|
+
const result = await apiInstance.getSubmodelByIdMetadataAasRepository({
|
|
491
|
+
aasIdentifier: encodedAasIdentifier,
|
|
492
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
493
|
+
});
|
|
494
|
+
return { success: true, data: result };
|
|
495
|
+
}
|
|
496
|
+
catch (err) {
|
|
497
|
+
const customError = await handleApiError(err);
|
|
498
|
+
return { success: false, error: customError };
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Updates the metadata attributes of the Submodel
|
|
503
|
+
*
|
|
504
|
+
* @param options Object containing:
|
|
505
|
+
* - configuration: The http request options
|
|
506
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
507
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
508
|
+
* - submodelMetadata: The Submodel Metadata object
|
|
509
|
+
*
|
|
510
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
511
|
+
*/
|
|
512
|
+
async patchSubmodelByIdMetadataAasRepository(options) {
|
|
513
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelMetadata } = options;
|
|
514
|
+
try {
|
|
515
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
516
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
517
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
518
|
+
const result = await apiInstance.patchSubmodelByIdMetadataAasRepository({
|
|
519
|
+
aasIdentifier: encodedAasIdentifier,
|
|
520
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
521
|
+
submodelMetadata: submodelMetadata,
|
|
522
|
+
});
|
|
523
|
+
return { success: true, data: result };
|
|
524
|
+
}
|
|
525
|
+
catch (err) {
|
|
526
|
+
const customError = await handleApiError(err);
|
|
527
|
+
return { success: false, error: customError };
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Returns the Submodel's ValueOnly representation
|
|
532
|
+
*
|
|
533
|
+
* @param options Object containing:
|
|
534
|
+
* - configuration: The http request options
|
|
535
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
536
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
537
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
538
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
539
|
+
*
|
|
540
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
541
|
+
*/
|
|
542
|
+
async getSubmodelByIdValueOnlyAasRepository(options) {
|
|
543
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
544
|
+
try {
|
|
545
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
546
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
547
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
548
|
+
const result = await apiInstance.getSubmodelByIdValueOnlyAasRepository({
|
|
549
|
+
aasIdentifier: encodedAasIdentifier,
|
|
550
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
551
|
+
level: level,
|
|
552
|
+
extent: extent,
|
|
553
|
+
});
|
|
554
|
+
return { success: true, data: result };
|
|
555
|
+
}
|
|
556
|
+
catch (err) {
|
|
557
|
+
const customError = await handleApiError(err);
|
|
558
|
+
return { success: false, error: customError };
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Updates the values of the Submodel
|
|
563
|
+
*
|
|
564
|
+
* @param options Object containing:
|
|
565
|
+
* - configuration: The http request options
|
|
566
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
567
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
568
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
569
|
+
*
|
|
570
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
571
|
+
*/
|
|
572
|
+
async patchSubmodelByIdValueOnlyAasRepository(options) {
|
|
573
|
+
const { configuration, aasIdentifier, submodelIdentifier, body, level } = options;
|
|
574
|
+
try {
|
|
575
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
576
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
577
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
578
|
+
const result = await apiInstance.patchSubmodelByIdValueOnlyAasRepository({
|
|
579
|
+
aasIdentifier: encodedAasIdentifier,
|
|
580
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
581
|
+
body: body,
|
|
582
|
+
level: level,
|
|
583
|
+
});
|
|
584
|
+
return { success: true, data: result };
|
|
585
|
+
}
|
|
586
|
+
catch (err) {
|
|
587
|
+
const customError = await handleApiError(err);
|
|
588
|
+
return { success: false, error: customError };
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Returns the Submodel as a Reference
|
|
593
|
+
*
|
|
594
|
+
* @param options Object containing:
|
|
595
|
+
* - configuration: The http request options
|
|
596
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
597
|
+
* - submodelIdentifier: The submodel's unique ID
|
|
598
|
+
*
|
|
599
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
600
|
+
*/
|
|
601
|
+
async getSubmodelByIdReferenceAasRepository(options) {
|
|
602
|
+
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
603
|
+
try {
|
|
604
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
605
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
606
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
607
|
+
const result = await apiInstance.getSubmodelByIdReferenceAasRepository({
|
|
608
|
+
aasIdentifier: encodedAasIdentifier,
|
|
609
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
610
|
+
});
|
|
611
|
+
return { success: true, data: convertApiReferenceToCoreReference(result) };
|
|
612
|
+
}
|
|
613
|
+
catch (err) {
|
|
614
|
+
const customError = await handleApiError(err);
|
|
615
|
+
return { success: false, error: customError };
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Returns the elements of this submodel in path notation.
|
|
620
|
+
*
|
|
621
|
+
* @param options Object containing:
|
|
622
|
+
* - configuration: The http request options
|
|
623
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
624
|
+
* - submodelIdentifier: The submodel's unique ID
|
|
625
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
626
|
+
*
|
|
627
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
628
|
+
*/
|
|
629
|
+
async getSubmodelByIdPathAasRepository(options) {
|
|
630
|
+
const { configuration, aasIdentifier, submodelIdentifier, level } = options;
|
|
631
|
+
try {
|
|
632
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
633
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
634
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
635
|
+
const result = await apiInstance.getSubmodelByIdPathAasRepository({
|
|
636
|
+
aasIdentifier: encodedAasIdentifier,
|
|
637
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
638
|
+
level: level,
|
|
639
|
+
});
|
|
640
|
+
return { success: true, data: result };
|
|
641
|
+
}
|
|
642
|
+
catch (err) {
|
|
643
|
+
const customError = await handleApiError(err);
|
|
644
|
+
return { success: false, error: customError };
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Returns all submodel elements including their hierarchy
|
|
649
|
+
*
|
|
650
|
+
* @param options Object containing:
|
|
651
|
+
* - configuration: The http request options
|
|
652
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
653
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
654
|
+
* - limit?: The maximum number of elements in the response array
|
|
655
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
656
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
657
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
658
|
+
*
|
|
659
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
660
|
+
*/
|
|
661
|
+
async getAllSubmodelElementsAasRepository(options) {
|
|
662
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
663
|
+
try {
|
|
664
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
665
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
666
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
667
|
+
const result = await apiInstance.getAllSubmodelElementsAasRepository({
|
|
668
|
+
aasIdentifier: encodedAasIdentifier,
|
|
669
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
670
|
+
limit: limit,
|
|
671
|
+
cursor: cursor,
|
|
672
|
+
level: level,
|
|
673
|
+
extent: extent,
|
|
674
|
+
});
|
|
675
|
+
const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
676
|
+
return {
|
|
677
|
+
success: true,
|
|
678
|
+
data: { pagedResult: result.pagingMetadata, result: submodelElements },
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
catch (err) {
|
|
682
|
+
const customError = await handleApiError(err);
|
|
683
|
+
return { success: false, error: customError };
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Creates a new submodel element
|
|
688
|
+
*
|
|
689
|
+
* @param options Object containing:
|
|
690
|
+
* - configuration: The http request options
|
|
691
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
692
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
693
|
+
* - submodelElement: The Submodel Element object
|
|
694
|
+
*
|
|
695
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
696
|
+
*/
|
|
697
|
+
async postSubmodelElementAasRepository(options) {
|
|
698
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelElement } = options;
|
|
699
|
+
try {
|
|
700
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
701
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
702
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
703
|
+
const result = await apiInstance.postSubmodelElementAasRepository({
|
|
704
|
+
aasIdentifier: encodedAasIdentifier,
|
|
705
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
706
|
+
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
707
|
+
});
|
|
708
|
+
return { success: true, data: convertApiSubmodelElementToCoreSubmodelElement(result) };
|
|
709
|
+
}
|
|
710
|
+
catch (err) {
|
|
711
|
+
const customError = await handleApiError(err);
|
|
712
|
+
return { success: false, error: customError };
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Returns all submodel elements including their hierarchy
|
|
717
|
+
*
|
|
718
|
+
* @param options Object containing:
|
|
719
|
+
* - configuration: The http request options
|
|
720
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
721
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
722
|
+
* - limit?: The maximum number of elements in the response array
|
|
723
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
724
|
+
*
|
|
725
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
726
|
+
*/
|
|
727
|
+
async getAllSubmodelElementsMetadataAasRepository(options) {
|
|
728
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor } = options;
|
|
729
|
+
try {
|
|
730
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
731
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
732
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
733
|
+
const result = await apiInstance.getAllSubmodelElementsMetadataAasRepository({
|
|
734
|
+
aasIdentifier: encodedAasIdentifier,
|
|
735
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
736
|
+
limit: limit,
|
|
737
|
+
cursor: cursor,
|
|
738
|
+
});
|
|
739
|
+
//const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
740
|
+
const submodelElementsMetadata = result.result ?? [];
|
|
741
|
+
return {
|
|
742
|
+
success: true,
|
|
743
|
+
data: { pagedResult: result.pagingMetadata, result: submodelElementsMetadata },
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
catch (err) {
|
|
747
|
+
const customError = await handleApiError(err);
|
|
748
|
+
return { success: false, error: customError };
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Returns all submodel elements including their hierarchy in the ValueOnly representation
|
|
753
|
+
*
|
|
754
|
+
* @param options Object containing:
|
|
755
|
+
* - configuration: The http request options
|
|
756
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
757
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
758
|
+
* - limit?: The maximum number of elements in the response array
|
|
759
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
760
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
761
|
+
*
|
|
762
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
763
|
+
*/
|
|
764
|
+
async getAllSubmodelElementsValueOnlyAasRepository(options) {
|
|
765
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
766
|
+
try {
|
|
767
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
768
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
769
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
770
|
+
const result = await apiInstance.getAllSubmodelElementsValueOnlyAasRepository({
|
|
771
|
+
aasIdentifier: encodedAasIdentifier,
|
|
772
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
773
|
+
limit: limit,
|
|
774
|
+
cursor: cursor,
|
|
775
|
+
level: level,
|
|
776
|
+
});
|
|
777
|
+
//const submodelElementsValue = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
778
|
+
const submodelElementValues = result.result ?? [];
|
|
779
|
+
return {
|
|
780
|
+
success: true,
|
|
781
|
+
data: { pagedResult: result.pagingMetadata, result: submodelElementValues },
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
catch (err) {
|
|
785
|
+
const customError = await handleApiError(err);
|
|
786
|
+
return { success: false, error: customError };
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Returns all submodel elements as a list of References
|
|
791
|
+
*
|
|
792
|
+
* @param options Object containing:
|
|
793
|
+
* - configuration: The http request options
|
|
794
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
795
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
796
|
+
* - limit?: The maximum number of elements in the response array
|
|
797
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
798
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
799
|
+
*
|
|
800
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
801
|
+
*/
|
|
802
|
+
async getAllSubmodelElementsReferenceAasRepository(options) {
|
|
803
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
804
|
+
try {
|
|
805
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
806
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
807
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
808
|
+
const result = await apiInstance.getAllSubmodelElementsReferenceAasRepository({
|
|
809
|
+
aasIdentifier: encodedAasIdentifier,
|
|
810
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
811
|
+
limit: limit,
|
|
812
|
+
cursor: cursor,
|
|
813
|
+
level: level,
|
|
814
|
+
});
|
|
815
|
+
const submodelElementReferences = (result.result ?? []).map(convertApiReferenceToCoreReference);
|
|
816
|
+
return {
|
|
817
|
+
success: true,
|
|
818
|
+
data: { pagedResult: result.pagingMetadata, result: submodelElementReferences },
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
catch (err) {
|
|
822
|
+
const customError = await handleApiError(err);
|
|
823
|
+
return { success: false, error: customError };
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Returns all submodel elements including their hierarchy
|
|
828
|
+
*
|
|
829
|
+
* @param options Object containing:
|
|
830
|
+
* - configuration: The http request options
|
|
831
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
832
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
833
|
+
* - limit?: The maximum number of elements in the response array
|
|
834
|
+
* - cursor?: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
|
|
835
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
836
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
837
|
+
*
|
|
838
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
839
|
+
*/
|
|
840
|
+
async getAllSubmodelElementsPathAasRepository(options) {
|
|
841
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
842
|
+
try {
|
|
843
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
844
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
845
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
846
|
+
const result = await apiInstance.getAllSubmodelElementsPathAasRepository({
|
|
847
|
+
aasIdentifier: encodedAasIdentifier,
|
|
848
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
849
|
+
limit: limit,
|
|
850
|
+
cursor: cursor,
|
|
851
|
+
level: level,
|
|
852
|
+
extent: extent,
|
|
853
|
+
});
|
|
854
|
+
//const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
855
|
+
const submodelElements = result.result ?? [];
|
|
856
|
+
return {
|
|
857
|
+
success: true,
|
|
858
|
+
data: { pagedResult: result.pagingMetadata, result: submodelElements },
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
catch (err) {
|
|
862
|
+
const customError = await handleApiError(err);
|
|
863
|
+
return { success: false, error: customError };
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Returns a specific submodel element from the Submodel at a specified path
|
|
868
|
+
*
|
|
869
|
+
* @param options Object containing:
|
|
870
|
+
* - configuration: The http request options
|
|
871
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
872
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
873
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
874
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
875
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
876
|
+
*
|
|
877
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
878
|
+
*/
|
|
879
|
+
async getSubmodelElementByPathAasRepository(options) {
|
|
880
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
881
|
+
try {
|
|
882
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
883
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
884
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
885
|
+
const result = await apiInstance.getSubmodelElementByPathAasRepository({
|
|
886
|
+
aasIdentifier: encodedAasIdentifier,
|
|
887
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
888
|
+
idShortPath: idShortPath,
|
|
889
|
+
level: level,
|
|
890
|
+
extent: extent,
|
|
891
|
+
});
|
|
892
|
+
return { success: true, data: convertApiSubmodelElementToCoreSubmodelElement(result) };
|
|
893
|
+
}
|
|
894
|
+
catch (err) {
|
|
895
|
+
const customError = await handleApiError(err);
|
|
896
|
+
return { success: false, error: customError };
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Creates a new submodel element at a specified path within submodel elements hierarchy
|
|
901
|
+
*
|
|
902
|
+
* @param options Object containing:
|
|
903
|
+
* - configuration: The http request options.
|
|
904
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
905
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
906
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
907
|
+
* - submodelElement: SubmodelElement object
|
|
908
|
+
*
|
|
909
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
910
|
+
*/
|
|
911
|
+
async postSubmodelElementByPathAasRepository(options) {
|
|
912
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
913
|
+
try {
|
|
914
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
915
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
916
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
917
|
+
const result = await apiInstance.postSubmodelElementByPathAasRepository({
|
|
918
|
+
aasIdentifier: encodedAasIdentifier,
|
|
919
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
920
|
+
idShortPath: idShortPath,
|
|
921
|
+
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
922
|
+
});
|
|
923
|
+
console.log('created element at specified path:', result);
|
|
924
|
+
return { success: true, data: convertApiSubmodelElementToCoreSubmodelElement(result) };
|
|
925
|
+
}
|
|
926
|
+
catch (err) {
|
|
927
|
+
const customError = await handleApiError(err);
|
|
928
|
+
return { success: false, error: customError };
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Deletes a submodel element at a specified path within the submodel elements hierarchy
|
|
933
|
+
*
|
|
934
|
+
* @param options Object containing:
|
|
935
|
+
* - configuration: The http request options.
|
|
936
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
937
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
938
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
939
|
+
*
|
|
940
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
941
|
+
*/
|
|
942
|
+
async deleteSubmodelElementByPathAasRepository(options) {
|
|
943
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
944
|
+
try {
|
|
945
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
946
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
947
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
948
|
+
const result = await apiInstance.deleteSubmodelElementByPathAasRepository({
|
|
949
|
+
aasIdentifier: encodedAasIdentifier,
|
|
950
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
951
|
+
idShortPath: idShortPath,
|
|
952
|
+
});
|
|
953
|
+
return { success: true, data: result };
|
|
954
|
+
}
|
|
955
|
+
catch (err) {
|
|
956
|
+
const customError = await handleApiError(err);
|
|
957
|
+
return { success: false, error: customError };
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Updates an existing submodel element at a specified path within submodel elements hierarchy
|
|
962
|
+
*
|
|
963
|
+
* @param options Object containing:
|
|
964
|
+
* - configuration: The http request options
|
|
965
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
966
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
967
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
968
|
+
* - submodelElement: SubmodelElement object
|
|
969
|
+
*
|
|
970
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
971
|
+
*/
|
|
972
|
+
async putSubmodelElementByPathAasRepository(options) {
|
|
973
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
974
|
+
try {
|
|
975
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
976
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
977
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
978
|
+
const result = await apiInstance.putSubmodelElementByPathAasRepository({
|
|
979
|
+
aasIdentifier: encodedAasIdentifier,
|
|
980
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
981
|
+
idShortPath: idShortPath,
|
|
982
|
+
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
983
|
+
});
|
|
984
|
+
return { success: true, data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : undefined };
|
|
985
|
+
}
|
|
986
|
+
catch (err) {
|
|
987
|
+
const customError = await handleApiError(err);
|
|
988
|
+
return { success: false, error: customError };
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Updates an existing submodel element value at a specified path within submodel elements hierarchy
|
|
993
|
+
*
|
|
994
|
+
* @param options Object containing:
|
|
995
|
+
* - configuration: The http request options
|
|
996
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
997
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
998
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
999
|
+
* - submodelElement: SubmodelElement object
|
|
1000
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1001
|
+
*
|
|
1002
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1003
|
+
*/
|
|
1004
|
+
async patchSubmodelElementValueByPathAasRepository(options) {
|
|
1005
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
1006
|
+
try {
|
|
1007
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1008
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1009
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1010
|
+
const result = await apiInstance.patchSubmodelElementValueByPathAasRepository({
|
|
1011
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1012
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1013
|
+
idShortPath: idShortPath,
|
|
1014
|
+
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
1015
|
+
level: level,
|
|
1016
|
+
});
|
|
1017
|
+
return { success: true, data: result };
|
|
1018
|
+
}
|
|
1019
|
+
catch (err) {
|
|
1020
|
+
const customError = await handleApiError(err);
|
|
1021
|
+
return { success: false, error: customError };
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Returns the metadata attributes of a specific submodel element from the Submodel at a specified path
|
|
1026
|
+
*
|
|
1027
|
+
* @param options Object containing:
|
|
1028
|
+
* - configuration: The http request options
|
|
1029
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1030
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1031
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1032
|
+
*
|
|
1033
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1034
|
+
*/
|
|
1035
|
+
async getSubmodelElementByPathMetadataAasRepository(options) {
|
|
1036
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
1037
|
+
try {
|
|
1038
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1039
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1040
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1041
|
+
const result = await apiInstance.getSubmodelElementByPathMetadataAasRepository({
|
|
1042
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1043
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1044
|
+
idShortPath: idShortPath,
|
|
1045
|
+
});
|
|
1046
|
+
return { success: true, data: result };
|
|
1047
|
+
}
|
|
1048
|
+
catch (err) {
|
|
1049
|
+
const customError = await handleApiError(err);
|
|
1050
|
+
return { success: false, error: customError };
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Updates the metadata attributes of an existing submodel element value at a specified path within submodel elements hierarchy
|
|
1055
|
+
*
|
|
1056
|
+
* @param options Object containing:
|
|
1057
|
+
* - configuration: The http request options
|
|
1058
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1059
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1060
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1061
|
+
* - submodelElementMetadata: The Submodel Element Metadata object
|
|
1062
|
+
*
|
|
1063
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1064
|
+
*/
|
|
1065
|
+
async patchSubmodelElementValueByPathMetadata(options) {
|
|
1066
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
1067
|
+
try {
|
|
1068
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1069
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1070
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1071
|
+
const result = await apiInstance.patchSubmodelElementValueByPathMetadata({
|
|
1072
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1073
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1074
|
+
idShortPath: idShortPath,
|
|
1075
|
+
submodelElementMetadata: submodelElementMetadata,
|
|
1076
|
+
});
|
|
1077
|
+
return { success: true, data: result };
|
|
1078
|
+
}
|
|
1079
|
+
catch (err) {
|
|
1080
|
+
const customError = await handleApiError(err);
|
|
1081
|
+
return { success: false, error: customError };
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Returns a specific submodel element from the Submodel at a specified path in the ValueOnly representation
|
|
1086
|
+
*
|
|
1087
|
+
* @param options Object containing:
|
|
1088
|
+
* - configuration: The http request options
|
|
1089
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1090
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1091
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1092
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1093
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
1094
|
+
*
|
|
1095
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1096
|
+
*/
|
|
1097
|
+
async getSubmodelElementByPathValueOnlyAasRepository(options) {
|
|
1098
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
1099
|
+
try {
|
|
1100
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1101
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1102
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1103
|
+
const result = await apiInstance.getSubmodelElementByPathValueOnlyAasRepository({
|
|
1104
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1105
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1106
|
+
idShortPath: idShortPath,
|
|
1107
|
+
level: level,
|
|
1108
|
+
extent: extent,
|
|
1109
|
+
});
|
|
1110
|
+
return { success: true, data: result };
|
|
1111
|
+
}
|
|
1112
|
+
catch (err) {
|
|
1113
|
+
const customError = await handleApiError(err);
|
|
1114
|
+
return { success: false, error: customError };
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Updates the value of an existing submodel element value at a specified path within submodel elements hierarchy
|
|
1119
|
+
*
|
|
1120
|
+
* @param options Object containing:
|
|
1121
|
+
* - configuration: The http request options
|
|
1122
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1123
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1124
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1125
|
+
* - SubmodelElementValue: SubmodelElementValue object
|
|
1126
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1127
|
+
*
|
|
1128
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1129
|
+
*/
|
|
1130
|
+
async patchSubmodelElementValueByPathValueOnly(options) {
|
|
1131
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
1132
|
+
try {
|
|
1133
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1134
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1135
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1136
|
+
const result = await apiInstance.patchSubmodelElementValueByPathValueOnly({
|
|
1137
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1138
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1139
|
+
idShortPath: idShortPath,
|
|
1140
|
+
submodelElementValue: submodelElementValue,
|
|
1141
|
+
level: level,
|
|
1142
|
+
});
|
|
1143
|
+
return { success: true, data: result };
|
|
1144
|
+
}
|
|
1145
|
+
catch (err) {
|
|
1146
|
+
const customError = await handleApiError(err);
|
|
1147
|
+
return { success: false, error: customError };
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Returns the Reference of a specific submodel element from the Submodel at a specified path
|
|
1152
|
+
*
|
|
1153
|
+
* @param options Object containing:
|
|
1154
|
+
* - configuration: The http request options
|
|
1155
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1156
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1157
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1158
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1159
|
+
*
|
|
1160
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1161
|
+
*/
|
|
1162
|
+
async getSubmodelElementByPathReferenceAasRepository(options) {
|
|
1163
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
1164
|
+
try {
|
|
1165
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1166
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1167
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1168
|
+
const result = await apiInstance.getSubmodelElementByPathReferenceAasRepository({
|
|
1169
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1170
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1171
|
+
idShortPath: idShortPath,
|
|
1172
|
+
level: level,
|
|
1173
|
+
});
|
|
1174
|
+
return { success: true, data: convertApiReferenceToCoreReference(result) };
|
|
1175
|
+
}
|
|
1176
|
+
catch (err) {
|
|
1177
|
+
const customError = await handleApiError(err);
|
|
1178
|
+
return { success: false, error: customError };
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Returns a specific submodel element from the Submodel at a specified path in the Path notation
|
|
1183
|
+
*
|
|
1184
|
+
* @param options Object containing:
|
|
1185
|
+
* - configuration: The http request options
|
|
1186
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1187
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1188
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1189
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1190
|
+
*
|
|
1191
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1192
|
+
*/
|
|
1193
|
+
async getSubmodelElementByPathPathAasRepository(options) {
|
|
1194
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
1195
|
+
try {
|
|
1196
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1197
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1198
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1199
|
+
const result = await apiInstance.getSubmodelElementByPathPathAasRepository({
|
|
1200
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1201
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1202
|
+
idShortPath: idShortPath,
|
|
1203
|
+
level: level,
|
|
1204
|
+
});
|
|
1205
|
+
return { success: true, data: result };
|
|
1206
|
+
}
|
|
1207
|
+
catch (err) {
|
|
1208
|
+
const customError = await handleApiError(err);
|
|
1209
|
+
return { success: false, error: customError };
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Downloads file content from a specific submodel element from the Submodel at a specified path
|
|
1214
|
+
*
|
|
1215
|
+
* @param options Object containing:
|
|
1216
|
+
* - configuration: The http request options
|
|
1217
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1218
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1219
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1220
|
+
*
|
|
1221
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1222
|
+
*/
|
|
1223
|
+
async getFileByPathAasRepository(options) {
|
|
1224
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
1225
|
+
try {
|
|
1226
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1227
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1228
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1229
|
+
const result = await apiInstance.getFileByPathAasRepository({
|
|
1230
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1231
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1232
|
+
idShortPath: idShortPath,
|
|
1233
|
+
});
|
|
1234
|
+
return { success: true, data: result };
|
|
1235
|
+
}
|
|
1236
|
+
catch (err) {
|
|
1237
|
+
const customError = await handleApiError(err);
|
|
1238
|
+
return { success: false, error: customError };
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Uploads file content to an existing submodel element at a specified path within submodel elements hierarchy
|
|
1243
|
+
*
|
|
1244
|
+
* @param options Object containing:
|
|
1245
|
+
* - configuration: The http request options
|
|
1246
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1247
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1248
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1249
|
+
* - fileName: The name of the file
|
|
1250
|
+
* - file: The file to upload
|
|
1251
|
+
*
|
|
1252
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1253
|
+
*/
|
|
1254
|
+
async putFileByPathAasRepository(options) {
|
|
1255
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
1256
|
+
try {
|
|
1257
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1258
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1259
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1260
|
+
const result = await apiInstance.putFileByPathAasRepository({
|
|
1261
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1262
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1263
|
+
idShortPath: idShortPath,
|
|
1264
|
+
fileName: fileName,
|
|
1265
|
+
file: file,
|
|
1266
|
+
});
|
|
1267
|
+
return { success: true, data: result };
|
|
1268
|
+
}
|
|
1269
|
+
catch (err) {
|
|
1270
|
+
const customError = await handleApiError(err);
|
|
1271
|
+
return { success: false, error: customError };
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Deletes file content of an existing submodel element at a specified path within submodel elements hierarchy
|
|
1276
|
+
*
|
|
1277
|
+
* @param options Object containing:
|
|
1278
|
+
* - configuration: The http request options.
|
|
1279
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1280
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1281
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1282
|
+
*
|
|
1283
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1284
|
+
*/
|
|
1285
|
+
async deleteFileByPathAasRepository(options) {
|
|
1286
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
1287
|
+
try {
|
|
1288
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1289
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1290
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1291
|
+
const result = await apiInstance.deleteFileByPathAasRepository({
|
|
1292
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1293
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1294
|
+
idShortPath: idShortPath,
|
|
1295
|
+
});
|
|
1296
|
+
return { success: true, data: result };
|
|
1297
|
+
}
|
|
1298
|
+
catch (err) {
|
|
1299
|
+
const customError = await handleApiError(err);
|
|
1300
|
+
return { success: false, error: customError };
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Synchronously invokes an Operation at a specified path
|
|
1305
|
+
*
|
|
1306
|
+
* @param options Object containing:
|
|
1307
|
+
* - configuration: The http request options.
|
|
1308
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1309
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1310
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1311
|
+
* - operationRequest: Operation request object
|
|
1312
|
+
*
|
|
1313
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1314
|
+
*/
|
|
1315
|
+
async invokeOperationAasRepository(options) {
|
|
1316
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
1317
|
+
try {
|
|
1318
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1319
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1320
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1321
|
+
const result = await apiInstance.invokeOperationAasRepository({
|
|
1322
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1323
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1324
|
+
idShortPath: idShortPath,
|
|
1325
|
+
operationRequest: operationRequest,
|
|
1326
|
+
});
|
|
1327
|
+
return { success: true, data: result };
|
|
1328
|
+
}
|
|
1329
|
+
catch (err) {
|
|
1330
|
+
const customError = await handleApiError(err);
|
|
1331
|
+
return { success: false, error: customError };
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Synchronously invokes an Operation at a specified path
|
|
1336
|
+
*
|
|
1337
|
+
* @param options Object containing:
|
|
1338
|
+
* - configuration: The http request options.
|
|
1339
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1340
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1341
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1342
|
+
* - operationRequestValueOnly: OperationRequestValueOnly object
|
|
1343
|
+
*
|
|
1344
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1345
|
+
*/
|
|
1346
|
+
async invokeOperationValueOnlyAasRepository(options) {
|
|
1347
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
1348
|
+
try {
|
|
1349
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1350
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1351
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1352
|
+
const result = await apiInstance.invokeOperationValueOnlyAasRepository({
|
|
1353
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1354
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1355
|
+
idShortPath: idShortPath,
|
|
1356
|
+
operationRequestValueOnly: operationRequestValueOnly,
|
|
1357
|
+
});
|
|
1358
|
+
return { success: true, data: result };
|
|
1359
|
+
}
|
|
1360
|
+
catch (err) {
|
|
1361
|
+
const customError = await handleApiError(err);
|
|
1362
|
+
return { success: false, error: customError };
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Asynchronously invokes an Operation at a specified path
|
|
1367
|
+
*
|
|
1368
|
+
* @param options Object containing:
|
|
1369
|
+
* - configuration: The http request options.
|
|
1370
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1371
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1372
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1373
|
+
* - operationRequest: OperationRequest object
|
|
1374
|
+
*
|
|
1375
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1376
|
+
*/
|
|
1377
|
+
async invokeOperationAsyncAasRepository(options) {
|
|
1378
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
1379
|
+
try {
|
|
1380
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1381
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1382
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1383
|
+
const result = await apiInstance.invokeOperationAsyncAasRepository({
|
|
1384
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1385
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1386
|
+
idShortPath: idShortPath,
|
|
1387
|
+
operationRequest: operationRequest,
|
|
1388
|
+
});
|
|
1389
|
+
return { success: true, data: result };
|
|
1390
|
+
}
|
|
1391
|
+
catch (err) {
|
|
1392
|
+
const customError = await handleApiError(err);
|
|
1393
|
+
return { success: false, error: customError };
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Asynchronously invokes an Operation at a specified path
|
|
1398
|
+
*
|
|
1399
|
+
* @param options Object containing:
|
|
1400
|
+
* - configuration: The http request options.
|
|
1401
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
1402
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1403
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1404
|
+
* - operationRequestValueOnly: Operation request object
|
|
1405
|
+
*
|
|
1406
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1407
|
+
*/
|
|
1408
|
+
async invokeOperationAsyncValueOnlyAasRepository(options) {
|
|
1409
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
1410
|
+
try {
|
|
1411
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1412
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1413
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1414
|
+
const result = await apiInstance.invokeOperationAsyncValueOnlyAasRepository({
|
|
1415
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1416
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1417
|
+
idShortPath: idShortPath,
|
|
1418
|
+
operationRequestValueOnly: operationRequestValueOnly,
|
|
1419
|
+
});
|
|
1420
|
+
return { success: true, data: result };
|
|
1421
|
+
}
|
|
1422
|
+
catch (err) {
|
|
1423
|
+
const customError = await handleApiError(err);
|
|
1424
|
+
return { success: false, error: customError };
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Returns the Operation status of an asynchronous invoked Operation
|
|
1429
|
+
*
|
|
1430
|
+
* @param options Object containing:
|
|
1431
|
+
* - configuration: The http request options
|
|
1432
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1433
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1434
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1435
|
+
* - handleId: The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (UTF8-BASE64-URL-encoded)
|
|
1436
|
+
*
|
|
1437
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1438
|
+
*/
|
|
1439
|
+
async getOperationAsyncStatusAasRepository(options) {
|
|
1440
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, handleId } = options;
|
|
1441
|
+
try {
|
|
1442
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1443
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1444
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1445
|
+
const encodedHandleId = base64Encode(handleId);
|
|
1446
|
+
const result = await apiInstance.getOperationAsyncStatusAasRepository({
|
|
1447
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1448
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1449
|
+
idShortPath: idShortPath,
|
|
1450
|
+
handleId: encodedHandleId,
|
|
1451
|
+
});
|
|
1452
|
+
return { success: true, data: result };
|
|
1453
|
+
}
|
|
1454
|
+
catch (err) {
|
|
1455
|
+
const customError = await handleApiError(err);
|
|
1456
|
+
return { success: false, error: customError };
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Returns the Operation result of an asynchronous invoked Operation
|
|
1461
|
+
*
|
|
1462
|
+
* @param options Object containing:
|
|
1463
|
+
* - configuration: The http request options
|
|
1464
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1465
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1466
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1467
|
+
* - handleId: The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (UTF8-BASE64-URL-encoded)
|
|
1468
|
+
*
|
|
1469
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1470
|
+
*/
|
|
1471
|
+
async getOperationAsyncResultAasRepository(options) {
|
|
1472
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, handleId } = options;
|
|
1473
|
+
try {
|
|
1474
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1475
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1476
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1477
|
+
const encodedHandleId = base64Encode(handleId);
|
|
1478
|
+
const result = await apiInstance.getOperationAsyncResultAasRepository({
|
|
1479
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1480
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1481
|
+
idShortPath: idShortPath,
|
|
1482
|
+
handleId: encodedHandleId,
|
|
1483
|
+
});
|
|
1484
|
+
return { success: true, data: result };
|
|
1485
|
+
}
|
|
1486
|
+
catch (err) {
|
|
1487
|
+
const customError = await handleApiError(err);
|
|
1488
|
+
return { success: false, error: customError };
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Returns the ValueOnly notation of the Operation result of an asynchronous invoked Operation
|
|
1493
|
+
*
|
|
1494
|
+
* @param options Object containing:
|
|
1495
|
+
* - configuration: The http request options
|
|
1496
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
1497
|
+
* - submodelIdentifier: The Submodel’s unique id
|
|
1498
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1499
|
+
* - handleId: The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (UTF8-BASE64-URL-encoded)
|
|
1500
|
+
*
|
|
1501
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1502
|
+
*/
|
|
1503
|
+
async getOperationAsyncResultValueOnlyAasRepository(options) {
|
|
1504
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, handleId } = options;
|
|
1505
|
+
try {
|
|
1506
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1507
|
+
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1508
|
+
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1509
|
+
const encodedHandleId = base64Encode(handleId);
|
|
1510
|
+
const result = await apiInstance.getOperationAsyncResultValueOnlyAasRepository({
|
|
1511
|
+
aasIdentifier: encodedAasIdentifier,
|
|
1512
|
+
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1513
|
+
idShortPath: idShortPath,
|
|
1514
|
+
handleId: encodedHandleId,
|
|
405
1515
|
});
|
|
406
|
-
|
|
407
|
-
return { success: false, error: result.error };
|
|
408
|
-
}
|
|
409
|
-
return { success: true, data: result.data };
|
|
1516
|
+
return { success: true, data: result };
|
|
410
1517
|
}
|
|
411
1518
|
catch (err) {
|
|
412
|
-
|
|
1519
|
+
const customError = await handleApiError(err);
|
|
1520
|
+
return { success: false, error: customError };
|
|
413
1521
|
}
|
|
414
1522
|
}
|
|
415
1523
|
}
|