basyx-typescript-sdk 2.2.4 → 2.2.5
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 +115 -0
- package/bundle/index.cjs +2479 -1814
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +2479 -1814
- package/bundle/index.mjs.map +1 -1
- package/dist/clients/AasDiscoveryClient.d.ts +3 -2
- package/dist/clients/AasDiscoveryClient.js +78 -20
- package/dist/clients/AasRegistryClient.d.ts +4 -2
- package/dist/clients/AasRegistryClient.js +153 -45
- package/dist/clients/AasRepositoryClient.d.ts +73 -16
- package/dist/clients/AasRepositoryClient.js +682 -263
- package/dist/clients/AasxFileClient.d.ts +18 -0
- package/dist/clients/AasxFileClient.js +100 -25
- package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +3 -1
- package/dist/clients/ConceptDescriptionRepositoryClient.js +93 -29
- package/dist/clients/SubmodelRegistryClient.d.ts +3 -1
- package/dist/clients/SubmodelRegistryClient.js +91 -21
- package/dist/clients/SubmodelRepositoryClient.d.ts +229 -22
- package/dist/clients/SubmodelRepositoryClient.js +689 -201
- package/dist/generated/AasDiscoveryService/models/index.d.ts +2 -2
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.d.ts +1 -1
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.js +1 -1
- package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/AasRegistryService/index.d.ts +1 -1
- package/dist/generated/AasRegistryService/index.js +1 -1
- package/dist/generated/AasRegistryService/models/index.d.ts +3 -3
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.d.ts +3 -3
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.js +1 -1
- package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.d.ts +1 -1
- package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.js +1 -1
- package/dist/generated/AasRepositoryService/index.d.ts +1 -1
- package/dist/generated/AasRepositoryService/index.js +1 -1
- package/dist/generated/AasRepositoryService/models/index.d.ts +7 -7
- package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.d.ts +5 -3
- package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.js +6 -0
- package/dist/generated/AasxFileService/apis/DescriptionAPIApi.d.ts +26 -0
- package/dist/generated/AasxFileService/apis/DescriptionAPIApi.js +40 -0
- package/dist/generated/AasxFileService/apis/index.d.ts +1 -0
- package/dist/generated/AasxFileService/apis/index.js +1 -0
- package/dist/generated/AasxFileService/models/index.d.ts +45 -0
- package/dist/generated/ConceptDescriptionRepositoryService/models/index.d.ts +2 -2
- package/dist/generated/SubmodelRegistryService/models/index.d.ts +2 -2
- package/dist/generated/SubmodelRepositoryService/models/index.d.ts +9 -9
- package/dist/generated/runtime.js +7 -0
- package/dist/lib/errorHandler.js +13 -2
- package/dist/models/api.d.ts +4 -2
- package/dist/services/AasService.d.ts +21 -1
- package/dist/services/AasService.js +114 -26
- package/dist/services/SubmodelService.d.ts +21 -1
- package/dist/services/SubmodelService.js +119 -21
- package/package.json +14 -3
- package/dist/generated/AasRegistryService/runtime.d.ts +0 -181
- package/dist/generated/AasRegistryService/runtime.js +0 -326
- package/dist/generated/AasRepositoryService/runtime.d.ts +0 -181
- package/dist/generated/AasRepositoryService/runtime.js +0 -326
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { AasRepositoryService } from '../generated';
|
|
2
|
+
import { RequiredError } from '../generated/runtime';
|
|
2
3
|
import { applyDefaults } from '../lib/apiConfig';
|
|
3
4
|
import { base64Encode } from '../lib/base64Url';
|
|
4
5
|
import { convertApiAasToCoreAas, convertApiAssetInformationToCoreAssetInformation, convertApiReferenceToCoreReference, convertCoreAasToApiAas, convertCoreAssetInformationToApiAssetInformation, convertCoreReferenceToApiReference, } from '../lib/convertAasTypes';
|
|
5
6
|
import { convertApiSubmodelElementToCoreSubmodelElement, convertApiSubmodelToCoreSubmodel, convertCoreSubmodelElementToApiSubmodelElement, convertCoreSubmodelToApiSubmodel, } from '../lib/convertSubmodelTypes';
|
|
6
7
|
import { handleApiError } from '../lib/errorHandler';
|
|
7
8
|
export class AasRepositoryClient {
|
|
9
|
+
static requireIdentifier(value, field) {
|
|
10
|
+
if (value === null || value === undefined || value.trim() === '') {
|
|
11
|
+
throw new RequiredError(field, `Required parameter "${field}" was null, undefined, or empty.`);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
static extractStatusCode(err, parsedError) {
|
|
16
|
+
const responseStatus = err?.response?.status;
|
|
17
|
+
if (typeof responseStatus === 'number') {
|
|
18
|
+
return responseStatus;
|
|
19
|
+
}
|
|
20
|
+
if (err instanceof RequiredError || err?.name === 'RequiredError') {
|
|
21
|
+
return 400;
|
|
22
|
+
}
|
|
23
|
+
const code = parsedError?.messages?.[0]?.code;
|
|
24
|
+
if (!code) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const parsedCode = Number.parseInt(code, 10);
|
|
28
|
+
return Number.isNaN(parsedCode) ? undefined : parsedCode;
|
|
29
|
+
}
|
|
8
30
|
/**
|
|
9
31
|
* Returns all Asset Administration Shells
|
|
10
32
|
*
|
|
@@ -13,7 +35,7 @@ export class AasRepositoryClient {
|
|
|
13
35
|
* - assetIds?: A list of specific Asset identifiers
|
|
14
36
|
* - idShort?: The Asset Administration Shell’s IdShort
|
|
15
37
|
* - limit?: The maximum number of elements in the response array
|
|
16
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
38
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
17
39
|
*
|
|
18
40
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
19
41
|
*/
|
|
@@ -22,21 +44,27 @@ export class AasRepositoryClient {
|
|
|
22
44
|
try {
|
|
23
45
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
24
46
|
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify(id)));
|
|
25
|
-
const
|
|
47
|
+
const response = await apiInstance.getAllAssetAdministrationShellsRaw({
|
|
26
48
|
assetIds: encodedAssetIds,
|
|
27
49
|
idShort: idShort,
|
|
28
50
|
limit: limit,
|
|
29
51
|
cursor: cursor,
|
|
30
52
|
});
|
|
53
|
+
const result = await response.value();
|
|
31
54
|
const shells = (result.result ?? []).map(convertApiAasToCoreAas);
|
|
32
55
|
return {
|
|
33
56
|
success: true,
|
|
34
|
-
data: { pagedResult: result.
|
|
57
|
+
data: { pagedResult: result.paging_metadata, result: shells },
|
|
58
|
+
statusCode: response.raw.status,
|
|
35
59
|
};
|
|
36
60
|
}
|
|
37
61
|
catch (err) {
|
|
38
62
|
const customError = await handleApiError(err);
|
|
39
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
success: false,
|
|
65
|
+
error: customError,
|
|
66
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
67
|
+
};
|
|
40
68
|
}
|
|
41
69
|
}
|
|
42
70
|
/**
|
|
@@ -47,7 +75,7 @@ export class AasRepositoryClient {
|
|
|
47
75
|
* - assetIds?: A list of specific Asset identifiers
|
|
48
76
|
* - idShort?: The Asset Administration Shell’s IdShort
|
|
49
77
|
* - limit?: The maximum number of elements in the response array
|
|
50
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
78
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
51
79
|
*
|
|
52
80
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
53
81
|
*/
|
|
@@ -56,21 +84,27 @@ export class AasRepositoryClient {
|
|
|
56
84
|
try {
|
|
57
85
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
58
86
|
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify(id)));
|
|
59
|
-
const
|
|
87
|
+
const response = await apiInstance.getAllAssetAdministrationShellsReferenceRaw({
|
|
60
88
|
assetIds: encodedAssetIds,
|
|
61
89
|
idShort: idShort,
|
|
62
90
|
limit: limit,
|
|
63
91
|
cursor: cursor,
|
|
64
92
|
});
|
|
93
|
+
const result = await response.value();
|
|
65
94
|
const shellReferences = (result.result ?? []).map(convertApiReferenceToCoreReference);
|
|
66
95
|
return {
|
|
67
96
|
success: true,
|
|
68
|
-
data: { pagedResult: result.
|
|
97
|
+
data: { pagedResult: result.paging_metadata, result: shellReferences },
|
|
98
|
+
statusCode: response.raw.status,
|
|
69
99
|
};
|
|
70
100
|
}
|
|
71
101
|
catch (err) {
|
|
72
102
|
const customError = await handleApiError(err);
|
|
73
|
-
return {
|
|
103
|
+
return {
|
|
104
|
+
success: false,
|
|
105
|
+
error: customError,
|
|
106
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
107
|
+
};
|
|
74
108
|
}
|
|
75
109
|
}
|
|
76
110
|
/**
|
|
@@ -86,14 +120,19 @@ export class AasRepositoryClient {
|
|
|
86
120
|
const { configuration, assetAdministrationShell } = options;
|
|
87
121
|
try {
|
|
88
122
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
89
|
-
const
|
|
123
|
+
const response = await apiInstance.postAssetAdministrationShellRaw({
|
|
90
124
|
assetAdministrationShell: convertCoreAasToApiAas(assetAdministrationShell),
|
|
91
125
|
});
|
|
92
|
-
|
|
126
|
+
const result = await response.value();
|
|
127
|
+
return { success: true, data: convertApiAasToCoreAas(result), statusCode: response.raw.status };
|
|
93
128
|
}
|
|
94
129
|
catch (err) {
|
|
95
130
|
const customError = await handleApiError(err);
|
|
96
|
-
return {
|
|
131
|
+
return {
|
|
132
|
+
success: false,
|
|
133
|
+
error: customError,
|
|
134
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
135
|
+
};
|
|
97
136
|
}
|
|
98
137
|
}
|
|
99
138
|
/**
|
|
@@ -109,15 +148,20 @@ export class AasRepositoryClient {
|
|
|
109
148
|
const { configuration, aasIdentifier } = options;
|
|
110
149
|
try {
|
|
111
150
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
112
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
113
|
-
const
|
|
151
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
152
|
+
const response = await apiInstance.deleteAssetAdministrationShellByIdRaw({
|
|
114
153
|
aasIdentifier: encodedAasIdentifier,
|
|
115
154
|
});
|
|
116
|
-
|
|
155
|
+
const result = await response.value();
|
|
156
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
117
157
|
}
|
|
118
158
|
catch (err) {
|
|
119
159
|
const customError = await handleApiError(err);
|
|
120
|
-
return {
|
|
160
|
+
return {
|
|
161
|
+
success: false,
|
|
162
|
+
error: customError,
|
|
163
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
164
|
+
};
|
|
121
165
|
}
|
|
122
166
|
}
|
|
123
167
|
/**
|
|
@@ -133,15 +177,20 @@ export class AasRepositoryClient {
|
|
|
133
177
|
const { configuration, aasIdentifier } = options;
|
|
134
178
|
try {
|
|
135
179
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
136
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
137
|
-
const
|
|
180
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
181
|
+
const response = await apiInstance.getAssetAdministrationShellByIdRaw({
|
|
138
182
|
aasIdentifier: encodedAasIdentifier,
|
|
139
183
|
});
|
|
140
|
-
|
|
184
|
+
const result = await response.value();
|
|
185
|
+
return { success: true, data: convertApiAasToCoreAas(result), statusCode: response.raw.status };
|
|
141
186
|
}
|
|
142
187
|
catch (err) {
|
|
143
188
|
const customError = await handleApiError(err);
|
|
144
|
-
return {
|
|
189
|
+
return {
|
|
190
|
+
success: false,
|
|
191
|
+
error: customError,
|
|
192
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
193
|
+
};
|
|
145
194
|
}
|
|
146
195
|
}
|
|
147
196
|
/**
|
|
@@ -158,16 +207,61 @@ export class AasRepositoryClient {
|
|
|
158
207
|
const { configuration, aasIdentifier, assetAdministrationShell } = options;
|
|
159
208
|
try {
|
|
160
209
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
161
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
162
|
-
const
|
|
210
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
211
|
+
const response = await apiInstance.putAssetAdministrationShellByIdRaw({
|
|
163
212
|
aasIdentifier: encodedAasIdentifier,
|
|
164
213
|
assetAdministrationShell: convertCoreAasToApiAas(assetAdministrationShell),
|
|
165
214
|
});
|
|
166
|
-
|
|
215
|
+
if (response.raw.status === 204) {
|
|
216
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
217
|
+
}
|
|
218
|
+
const result = await response.value();
|
|
219
|
+
return {
|
|
220
|
+
success: true,
|
|
221
|
+
data: result ? convertApiAasToCoreAas(result) : undefined,
|
|
222
|
+
statusCode: response.raw.status,
|
|
223
|
+
};
|
|
167
224
|
}
|
|
168
225
|
catch (err) {
|
|
169
226
|
const customError = await handleApiError(err);
|
|
170
|
-
return {
|
|
227
|
+
return {
|
|
228
|
+
success: false,
|
|
229
|
+
error: customError,
|
|
230
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Returns a specific Asset Administration Shell in reference representation
|
|
236
|
+
*
|
|
237
|
+
* @param options Object containing:
|
|
238
|
+
* - configuration: The http request options
|
|
239
|
+
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
240
|
+
*
|
|
241
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
242
|
+
*/
|
|
243
|
+
async getAssetAdministrationShellByIdReferenceAasRepository(options) {
|
|
244
|
+
const { configuration, aasIdentifier } = options;
|
|
245
|
+
try {
|
|
246
|
+
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
247
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
248
|
+
const response = await apiInstance.getAssetAdministrationShellByIdReferenceAasRepositoryRaw({
|
|
249
|
+
aasIdentifier: encodedAasIdentifier,
|
|
250
|
+
});
|
|
251
|
+
const result = await response.value();
|
|
252
|
+
return {
|
|
253
|
+
success: true,
|
|
254
|
+
data: convertApiReferenceToCoreReference(result),
|
|
255
|
+
statusCode: response.raw.status,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
catch (err) {
|
|
259
|
+
const customError = await handleApiError(err);
|
|
260
|
+
return {
|
|
261
|
+
success: false,
|
|
262
|
+
error: customError,
|
|
263
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
264
|
+
};
|
|
171
265
|
}
|
|
172
266
|
}
|
|
173
267
|
/**
|
|
@@ -179,22 +273,28 @@ export class AasRepositoryClient {
|
|
|
179
273
|
*
|
|
180
274
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
181
275
|
*/
|
|
182
|
-
async
|
|
276
|
+
async getAssetInformationAasRepository(options) {
|
|
183
277
|
const { configuration, aasIdentifier } = options;
|
|
184
278
|
try {
|
|
185
279
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
186
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
187
|
-
const
|
|
280
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
281
|
+
const response = await apiInstance.getAssetInformationAasRepositoryRaw({
|
|
188
282
|
aasIdentifier: encodedAasIdentifier,
|
|
189
283
|
});
|
|
284
|
+
const result = await response.value();
|
|
190
285
|
return {
|
|
191
286
|
success: true,
|
|
192
287
|
data: convertApiAssetInformationToCoreAssetInformation(result),
|
|
288
|
+
statusCode: response.raw.status,
|
|
193
289
|
};
|
|
194
290
|
}
|
|
195
291
|
catch (err) {
|
|
196
292
|
const customError = await handleApiError(err);
|
|
197
|
-
return {
|
|
293
|
+
return {
|
|
294
|
+
success: false,
|
|
295
|
+
error: customError,
|
|
296
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
297
|
+
};
|
|
198
298
|
}
|
|
199
299
|
}
|
|
200
300
|
/**
|
|
@@ -207,20 +307,25 @@ export class AasRepositoryClient {
|
|
|
207
307
|
*
|
|
208
308
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
209
309
|
*/
|
|
210
|
-
async
|
|
310
|
+
async putAssetInformationAasRepository(options) {
|
|
211
311
|
const { configuration, aasIdentifier, assetInformation } = options;
|
|
212
312
|
try {
|
|
213
313
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
214
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
215
|
-
const
|
|
314
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
315
|
+
const response = await apiInstance.putAssetInformationAasRepositoryRaw({
|
|
216
316
|
aasIdentifier: encodedAasIdentifier,
|
|
217
317
|
assetInformation: convertCoreAssetInformationToApiAssetInformation(assetInformation),
|
|
218
318
|
});
|
|
219
|
-
|
|
319
|
+
const result = await response.value();
|
|
320
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
220
321
|
}
|
|
221
322
|
catch (err) {
|
|
222
323
|
const customError = await handleApiError(err);
|
|
223
|
-
return {
|
|
324
|
+
return {
|
|
325
|
+
success: false,
|
|
326
|
+
error: customError,
|
|
327
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
328
|
+
};
|
|
224
329
|
}
|
|
225
330
|
}
|
|
226
331
|
/**
|
|
@@ -232,19 +337,27 @@ export class AasRepositoryClient {
|
|
|
232
337
|
*
|
|
233
338
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
234
339
|
*/
|
|
235
|
-
async
|
|
340
|
+
async deleteThumbnailAasRepository(options) {
|
|
236
341
|
const { configuration, aasIdentifier } = options;
|
|
237
342
|
try {
|
|
238
343
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
239
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
240
|
-
const
|
|
344
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
345
|
+
const response = await apiInstance.deleteThumbnailAasRepositoryRaw({
|
|
241
346
|
aasIdentifier: encodedAasIdentifier,
|
|
242
347
|
});
|
|
243
|
-
|
|
348
|
+
if (response.raw.status === 204) {
|
|
349
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
350
|
+
}
|
|
351
|
+
const result = await response.value();
|
|
352
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
244
353
|
}
|
|
245
354
|
catch (err) {
|
|
246
355
|
const customError = await handleApiError(err);
|
|
247
|
-
return {
|
|
356
|
+
return {
|
|
357
|
+
success: false,
|
|
358
|
+
error: customError,
|
|
359
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
360
|
+
};
|
|
248
361
|
}
|
|
249
362
|
}
|
|
250
363
|
/**
|
|
@@ -256,19 +369,24 @@ export class AasRepositoryClient {
|
|
|
256
369
|
*
|
|
257
370
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
258
371
|
*/
|
|
259
|
-
async
|
|
372
|
+
async getThumbnailAasRepository(options) {
|
|
260
373
|
const { configuration, aasIdentifier } = options;
|
|
261
374
|
try {
|
|
262
375
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
263
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
264
|
-
const
|
|
376
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
377
|
+
const response = await apiInstance.getThumbnailAasRepositoryRaw({
|
|
265
378
|
aasIdentifier: encodedAasIdentifier,
|
|
266
379
|
});
|
|
267
|
-
|
|
380
|
+
const result = await response.value();
|
|
381
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
268
382
|
}
|
|
269
383
|
catch (err) {
|
|
270
384
|
const customError = await handleApiError(err);
|
|
271
|
-
return {
|
|
385
|
+
return {
|
|
386
|
+
success: false,
|
|
387
|
+
error: customError,
|
|
388
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
389
|
+
};
|
|
272
390
|
}
|
|
273
391
|
}
|
|
274
392
|
/**
|
|
@@ -282,21 +400,26 @@ export class AasRepositoryClient {
|
|
|
282
400
|
*
|
|
283
401
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
284
402
|
*/
|
|
285
|
-
async
|
|
403
|
+
async putThumbnailAasRepository(options) {
|
|
286
404
|
const { configuration, aasIdentifier, fileName, file } = options;
|
|
287
405
|
try {
|
|
288
406
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
289
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
290
|
-
const
|
|
407
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
408
|
+
const response = await apiInstance.putThumbnailAasRepositoryRaw({
|
|
291
409
|
aasIdentifier: encodedAasIdentifier,
|
|
292
410
|
fileName: fileName,
|
|
293
411
|
file: file,
|
|
294
412
|
});
|
|
295
|
-
|
|
413
|
+
const result = await response.value();
|
|
414
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
296
415
|
}
|
|
297
416
|
catch (err) {
|
|
298
417
|
const customError = await handleApiError(err);
|
|
299
|
-
return {
|
|
418
|
+
return {
|
|
419
|
+
success: false,
|
|
420
|
+
error: customError,
|
|
421
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
422
|
+
};
|
|
300
423
|
}
|
|
301
424
|
}
|
|
302
425
|
/**
|
|
@@ -306,32 +429,38 @@ export class AasRepositoryClient {
|
|
|
306
429
|
* - configuration: The http request options
|
|
307
430
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
308
431
|
* - limit?: The maximum number of elements in the response array
|
|
309
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
432
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
310
433
|
*
|
|
311
434
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
312
435
|
*/
|
|
313
|
-
async
|
|
436
|
+
async getAllSubmodelReferencesAasRepository(options) {
|
|
314
437
|
const { configuration, aasIdentifier, limit, cursor } = options;
|
|
315
438
|
try {
|
|
316
439
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
317
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
318
|
-
const
|
|
440
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
441
|
+
const response = await apiInstance.getAllSubmodelReferencesAasRepositoryRaw({
|
|
319
442
|
aasIdentifier: encodedAasIdentifier,
|
|
320
443
|
limit: limit,
|
|
321
444
|
cursor: cursor,
|
|
322
445
|
});
|
|
446
|
+
const result = await response.value();
|
|
323
447
|
const submodelReferences = (result.result ?? []).map(convertApiReferenceToCoreReference);
|
|
324
448
|
return {
|
|
325
449
|
success: true,
|
|
326
450
|
data: {
|
|
327
|
-
pagedResult: result.
|
|
451
|
+
pagedResult: result.paging_metadata,
|
|
328
452
|
result: submodelReferences,
|
|
329
453
|
},
|
|
454
|
+
statusCode: response.raw.status,
|
|
330
455
|
};
|
|
331
456
|
}
|
|
332
457
|
catch (err) {
|
|
333
458
|
const customError = await handleApiError(err);
|
|
334
|
-
return {
|
|
459
|
+
return {
|
|
460
|
+
success: false,
|
|
461
|
+
error: customError,
|
|
462
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
463
|
+
};
|
|
335
464
|
}
|
|
336
465
|
}
|
|
337
466
|
/**
|
|
@@ -344,20 +473,25 @@ export class AasRepositoryClient {
|
|
|
344
473
|
*
|
|
345
474
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
346
475
|
*/
|
|
347
|
-
async
|
|
476
|
+
async postSubmodelReferenceAasRepository(options) {
|
|
348
477
|
const { configuration, aasIdentifier, submodelReference } = options;
|
|
349
478
|
try {
|
|
350
479
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
351
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
352
|
-
const
|
|
480
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
481
|
+
const response = await apiInstance.postSubmodelReferenceAasRepositoryRaw({
|
|
353
482
|
aasIdentifier: encodedAasIdentifier,
|
|
354
483
|
reference: convertCoreReferenceToApiReference(submodelReference),
|
|
355
484
|
});
|
|
356
|
-
|
|
485
|
+
const result = await response.value();
|
|
486
|
+
return { success: true, data: convertApiReferenceToCoreReference(result), statusCode: response.raw.status };
|
|
357
487
|
}
|
|
358
488
|
catch (err) {
|
|
359
489
|
const customError = await handleApiError(err);
|
|
360
|
-
return {
|
|
490
|
+
return {
|
|
491
|
+
success: false,
|
|
492
|
+
error: customError,
|
|
493
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
494
|
+
};
|
|
361
495
|
}
|
|
362
496
|
}
|
|
363
497
|
/**
|
|
@@ -370,23 +504,52 @@ export class AasRepositoryClient {
|
|
|
370
504
|
*
|
|
371
505
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
372
506
|
*/
|
|
373
|
-
async
|
|
507
|
+
async deleteSubmodelReferenceAasRepository(options) {
|
|
374
508
|
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
375
509
|
try {
|
|
376
510
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
377
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
378
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
379
|
-
const
|
|
511
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
512
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
513
|
+
const response = await apiInstance.deleteSubmodelReferenceAasRepositoryRaw({
|
|
380
514
|
aasIdentifier: encodedAasIdentifier,
|
|
381
515
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
382
516
|
});
|
|
383
|
-
|
|
517
|
+
const result = await response.value();
|
|
518
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
384
519
|
}
|
|
385
520
|
catch (err) {
|
|
386
521
|
const customError = await handleApiError(err);
|
|
387
|
-
return {
|
|
522
|
+
return {
|
|
523
|
+
success: false,
|
|
524
|
+
error: customError,
|
|
525
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
526
|
+
};
|
|
388
527
|
}
|
|
389
528
|
}
|
|
529
|
+
async getAssetInformation(options) {
|
|
530
|
+
return this.getAssetInformationAasRepository(options);
|
|
531
|
+
}
|
|
532
|
+
async putAssetInformation(options) {
|
|
533
|
+
return this.putAssetInformationAasRepository(options);
|
|
534
|
+
}
|
|
535
|
+
async deleteThumbnail(options) {
|
|
536
|
+
return this.deleteThumbnailAasRepository(options);
|
|
537
|
+
}
|
|
538
|
+
async getThumbnail(options) {
|
|
539
|
+
return this.getThumbnailAasRepository(options);
|
|
540
|
+
}
|
|
541
|
+
async putThumbnail(options) {
|
|
542
|
+
return this.putThumbnailAasRepository(options);
|
|
543
|
+
}
|
|
544
|
+
async getAllSubmodelReferences(options) {
|
|
545
|
+
return this.getAllSubmodelReferencesAasRepository(options);
|
|
546
|
+
}
|
|
547
|
+
async postSubmodelReference(options) {
|
|
548
|
+
return this.postSubmodelReferenceAasRepository(options);
|
|
549
|
+
}
|
|
550
|
+
async deleteSubmodelReferenceById(options) {
|
|
551
|
+
return this.deleteSubmodelReferenceAasRepository(options);
|
|
552
|
+
}
|
|
390
553
|
/**
|
|
391
554
|
* Returns the Submodel
|
|
392
555
|
*
|
|
@@ -403,19 +566,24 @@ export class AasRepositoryClient {
|
|
|
403
566
|
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
404
567
|
try {
|
|
405
568
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
406
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
407
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
408
|
-
const
|
|
569
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
570
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
571
|
+
const response = await apiInstance.getSubmodelByIdAasRepositoryRaw({
|
|
409
572
|
aasIdentifier: encodedAasIdentifier,
|
|
410
573
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
411
574
|
level: level,
|
|
412
575
|
extent: extent,
|
|
413
576
|
});
|
|
414
|
-
|
|
577
|
+
const result = await response.value();
|
|
578
|
+
return { success: true, data: convertApiSubmodelToCoreSubmodel(result), statusCode: response.raw.status };
|
|
415
579
|
}
|
|
416
580
|
catch (err) {
|
|
417
581
|
const customError = await handleApiError(err);
|
|
418
|
-
return {
|
|
582
|
+
return {
|
|
583
|
+
success: false,
|
|
584
|
+
error: customError,
|
|
585
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
586
|
+
};
|
|
419
587
|
}
|
|
420
588
|
}
|
|
421
589
|
/**
|
|
@@ -433,18 +601,44 @@ export class AasRepositoryClient {
|
|
|
433
601
|
const { configuration, aasIdentifier, submodelIdentifier, submodel } = options;
|
|
434
602
|
try {
|
|
435
603
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
436
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
437
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
438
|
-
const
|
|
604
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
605
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
606
|
+
const response = await apiInstance.putSubmodelByIdAasRepositoryRaw({
|
|
439
607
|
aasIdentifier: encodedAasIdentifier,
|
|
440
608
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
441
609
|
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
442
610
|
});
|
|
443
|
-
|
|
611
|
+
if (response.raw.status === 204) {
|
|
612
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
613
|
+
}
|
|
614
|
+
if (response.raw.status === 201) {
|
|
615
|
+
try {
|
|
616
|
+
const createdSubmodel = await response.value();
|
|
617
|
+
return {
|
|
618
|
+
success: true,
|
|
619
|
+
data: createdSubmodel ? convertApiSubmodelToCoreSubmodel(createdSubmodel) : undefined,
|
|
620
|
+
statusCode: response.raw.status,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
catch {
|
|
624
|
+
// Some servers acknowledge creation with an empty or non-JSON body.
|
|
625
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
const result = await response.value();
|
|
629
|
+
return {
|
|
630
|
+
success: true,
|
|
631
|
+
data: result ? convertApiSubmodelToCoreSubmodel(result) : undefined,
|
|
632
|
+
statusCode: response.raw.status,
|
|
633
|
+
};
|
|
444
634
|
}
|
|
445
635
|
catch (err) {
|
|
446
636
|
const customError = await handleApiError(err);
|
|
447
|
-
return {
|
|
637
|
+
return {
|
|
638
|
+
success: false,
|
|
639
|
+
error: customError,
|
|
640
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
641
|
+
};
|
|
448
642
|
}
|
|
449
643
|
}
|
|
450
644
|
/**
|
|
@@ -461,17 +655,22 @@ export class AasRepositoryClient {
|
|
|
461
655
|
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
462
656
|
try {
|
|
463
657
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
464
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
465
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
466
|
-
const
|
|
658
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
659
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
660
|
+
const response = await apiInstance.deleteSubmodelByIdAasRepositoryRaw({
|
|
467
661
|
aasIdentifier: encodedAasIdentifier,
|
|
468
662
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
469
663
|
});
|
|
470
|
-
|
|
664
|
+
const result = await response.value();
|
|
665
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
471
666
|
}
|
|
472
667
|
catch (err) {
|
|
473
668
|
const customError = await handleApiError(err);
|
|
474
|
-
return {
|
|
669
|
+
return {
|
|
670
|
+
success: false,
|
|
671
|
+
error: customError,
|
|
672
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
673
|
+
};
|
|
475
674
|
}
|
|
476
675
|
}
|
|
477
676
|
/**
|
|
@@ -490,19 +689,24 @@ export class AasRepositoryClient {
|
|
|
490
689
|
const { configuration, aasIdentifier, submodelIdentifier, submodel, level } = options;
|
|
491
690
|
try {
|
|
492
691
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
493
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
494
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
495
|
-
const
|
|
692
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
693
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
694
|
+
const response = await apiInstance.patchSubmodelAasRepositoryRaw({
|
|
496
695
|
aasIdentifier: encodedAasIdentifier,
|
|
497
696
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
498
697
|
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
499
698
|
level: level,
|
|
500
699
|
});
|
|
501
|
-
|
|
700
|
+
const result = await response.value();
|
|
701
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
502
702
|
}
|
|
503
703
|
catch (err) {
|
|
504
704
|
const customError = await handleApiError(err);
|
|
505
|
-
return {
|
|
705
|
+
return {
|
|
706
|
+
success: false,
|
|
707
|
+
error: customError,
|
|
708
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
709
|
+
};
|
|
506
710
|
}
|
|
507
711
|
}
|
|
508
712
|
/**
|
|
@@ -519,17 +723,22 @@ export class AasRepositoryClient {
|
|
|
519
723
|
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
520
724
|
try {
|
|
521
725
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
522
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
523
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
524
|
-
const
|
|
726
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
727
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
728
|
+
const response = await apiInstance.getSubmodelByIdMetadataAasRepositoryRaw({
|
|
525
729
|
aasIdentifier: encodedAasIdentifier,
|
|
526
730
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
527
731
|
});
|
|
528
|
-
|
|
732
|
+
const result = await response.value();
|
|
733
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
529
734
|
}
|
|
530
735
|
catch (err) {
|
|
531
736
|
const customError = await handleApiError(err);
|
|
532
|
-
return {
|
|
737
|
+
return {
|
|
738
|
+
success: false,
|
|
739
|
+
error: customError,
|
|
740
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
741
|
+
};
|
|
533
742
|
}
|
|
534
743
|
}
|
|
535
744
|
/**
|
|
@@ -547,18 +756,23 @@ export class AasRepositoryClient {
|
|
|
547
756
|
const { configuration, aasIdentifier, submodelIdentifier, submodelMetadata } = options;
|
|
548
757
|
try {
|
|
549
758
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
550
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
551
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
552
|
-
const
|
|
759
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
760
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
761
|
+
const response = await apiInstance.patchSubmodelByIdMetadataAasRepositoryRaw({
|
|
553
762
|
aasIdentifier: encodedAasIdentifier,
|
|
554
763
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
555
764
|
submodelMetadata: submodelMetadata,
|
|
556
765
|
});
|
|
557
|
-
|
|
766
|
+
const result = await response.value();
|
|
767
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
558
768
|
}
|
|
559
769
|
catch (err) {
|
|
560
770
|
const customError = await handleApiError(err);
|
|
561
|
-
return {
|
|
771
|
+
return {
|
|
772
|
+
success: false,
|
|
773
|
+
error: customError,
|
|
774
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
775
|
+
};
|
|
562
776
|
}
|
|
563
777
|
}
|
|
564
778
|
/**
|
|
@@ -577,19 +791,24 @@ export class AasRepositoryClient {
|
|
|
577
791
|
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
578
792
|
try {
|
|
579
793
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
580
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
581
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
582
|
-
const
|
|
794
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
795
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
796
|
+
const response = await apiInstance.getSubmodelByIdValueOnlyAasRepositoryRaw({
|
|
583
797
|
aasIdentifier: encodedAasIdentifier,
|
|
584
798
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
585
799
|
level: level,
|
|
586
800
|
extent: extent,
|
|
587
801
|
});
|
|
588
|
-
|
|
802
|
+
const result = await response.value();
|
|
803
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
589
804
|
}
|
|
590
805
|
catch (err) {
|
|
591
806
|
const customError = await handleApiError(err);
|
|
592
|
-
return {
|
|
807
|
+
return {
|
|
808
|
+
success: false,
|
|
809
|
+
error: customError,
|
|
810
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
811
|
+
};
|
|
593
812
|
}
|
|
594
813
|
}
|
|
595
814
|
/**
|
|
@@ -607,19 +826,24 @@ export class AasRepositoryClient {
|
|
|
607
826
|
const { configuration, aasIdentifier, submodelIdentifier, body, level } = options;
|
|
608
827
|
try {
|
|
609
828
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
610
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
611
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
612
|
-
const
|
|
829
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
830
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
831
|
+
const response = await apiInstance.patchSubmodelByIdValueOnlyAasRepositoryRaw({
|
|
613
832
|
aasIdentifier: encodedAasIdentifier,
|
|
614
833
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
615
834
|
body: body,
|
|
616
835
|
level: level,
|
|
617
836
|
});
|
|
618
|
-
|
|
837
|
+
const result = await response.value();
|
|
838
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
619
839
|
}
|
|
620
840
|
catch (err) {
|
|
621
841
|
const customError = await handleApiError(err);
|
|
622
|
-
return {
|
|
842
|
+
return {
|
|
843
|
+
success: false,
|
|
844
|
+
error: customError,
|
|
845
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
846
|
+
};
|
|
623
847
|
}
|
|
624
848
|
}
|
|
625
849
|
/**
|
|
@@ -636,17 +860,22 @@ export class AasRepositoryClient {
|
|
|
636
860
|
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
637
861
|
try {
|
|
638
862
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
639
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
640
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
641
|
-
const
|
|
863
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
864
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
865
|
+
const response = await apiInstance.getSubmodelByIdReferenceAasRepositoryRaw({
|
|
642
866
|
aasIdentifier: encodedAasIdentifier,
|
|
643
867
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
644
868
|
});
|
|
645
|
-
|
|
869
|
+
const result = await response.value();
|
|
870
|
+
return { success: true, data: convertApiReferenceToCoreReference(result), statusCode: response.raw.status };
|
|
646
871
|
}
|
|
647
872
|
catch (err) {
|
|
648
873
|
const customError = await handleApiError(err);
|
|
649
|
-
return {
|
|
874
|
+
return {
|
|
875
|
+
success: false,
|
|
876
|
+
error: customError,
|
|
877
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
878
|
+
};
|
|
650
879
|
}
|
|
651
880
|
}
|
|
652
881
|
/**
|
|
@@ -664,18 +893,23 @@ export class AasRepositoryClient {
|
|
|
664
893
|
const { configuration, aasIdentifier, submodelIdentifier, level } = options;
|
|
665
894
|
try {
|
|
666
895
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
667
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
668
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
669
|
-
const
|
|
896
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
897
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
898
|
+
const response = await apiInstance.getSubmodelByIdPathAasRepositoryRaw({
|
|
670
899
|
aasIdentifier: encodedAasIdentifier,
|
|
671
900
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
672
901
|
level: level,
|
|
673
902
|
});
|
|
674
|
-
|
|
903
|
+
const result = await response.value();
|
|
904
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
675
905
|
}
|
|
676
906
|
catch (err) {
|
|
677
907
|
const customError = await handleApiError(err);
|
|
678
|
-
return {
|
|
908
|
+
return {
|
|
909
|
+
success: false,
|
|
910
|
+
error: customError,
|
|
911
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
912
|
+
};
|
|
679
913
|
}
|
|
680
914
|
}
|
|
681
915
|
/**
|
|
@@ -686,7 +920,7 @@ export class AasRepositoryClient {
|
|
|
686
920
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
687
921
|
* - submodelIdentifier: The Submodel’s unique id
|
|
688
922
|
* - limit?: The maximum number of elements in the response array
|
|
689
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
923
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
690
924
|
* - level?: Determines the structural depth of the respective resource content
|
|
691
925
|
* - extent?: Determines to which extent the resource is being serialized
|
|
692
926
|
*
|
|
@@ -696,9 +930,9 @@ export class AasRepositoryClient {
|
|
|
696
930
|
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
697
931
|
try {
|
|
698
932
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
699
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
700
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
701
|
-
const
|
|
933
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
934
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
935
|
+
const response = await apiInstance.getAllSubmodelElementsAasRepositoryRaw({
|
|
702
936
|
aasIdentifier: encodedAasIdentifier,
|
|
703
937
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
704
938
|
limit: limit,
|
|
@@ -706,15 +940,21 @@ export class AasRepositoryClient {
|
|
|
706
940
|
level: level,
|
|
707
941
|
extent: extent,
|
|
708
942
|
});
|
|
943
|
+
const result = await response.value();
|
|
709
944
|
const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
710
945
|
return {
|
|
711
946
|
success: true,
|
|
712
|
-
data: { pagedResult: result.
|
|
947
|
+
data: { pagedResult: result.paging_metadata, result: submodelElements },
|
|
948
|
+
statusCode: response.raw.status,
|
|
713
949
|
};
|
|
714
950
|
}
|
|
715
951
|
catch (err) {
|
|
716
952
|
const customError = await handleApiError(err);
|
|
717
|
-
return {
|
|
953
|
+
return {
|
|
954
|
+
success: false,
|
|
955
|
+
error: customError,
|
|
956
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
957
|
+
};
|
|
718
958
|
}
|
|
719
959
|
}
|
|
720
960
|
/**
|
|
@@ -732,18 +972,27 @@ export class AasRepositoryClient {
|
|
|
732
972
|
const { configuration, aasIdentifier, submodelIdentifier, submodelElement } = options;
|
|
733
973
|
try {
|
|
734
974
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
735
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
736
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
737
|
-
const
|
|
975
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
976
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
977
|
+
const response = await apiInstance.postSubmodelElementAasRepositoryRaw({
|
|
738
978
|
aasIdentifier: encodedAasIdentifier,
|
|
739
979
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
740
980
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
741
981
|
});
|
|
742
|
-
|
|
982
|
+
const result = await response.value();
|
|
983
|
+
return {
|
|
984
|
+
success: true,
|
|
985
|
+
data: convertApiSubmodelElementToCoreSubmodelElement(result),
|
|
986
|
+
statusCode: response.raw.status,
|
|
987
|
+
};
|
|
743
988
|
}
|
|
744
989
|
catch (err) {
|
|
745
990
|
const customError = await handleApiError(err);
|
|
746
|
-
return {
|
|
991
|
+
return {
|
|
992
|
+
success: false,
|
|
993
|
+
error: customError,
|
|
994
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
995
|
+
};
|
|
747
996
|
}
|
|
748
997
|
}
|
|
749
998
|
/**
|
|
@@ -754,7 +1003,7 @@ export class AasRepositoryClient {
|
|
|
754
1003
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
755
1004
|
* - submodelIdentifier: The Submodel’s unique id
|
|
756
1005
|
* - limit?: The maximum number of elements in the response array
|
|
757
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
1006
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
758
1007
|
*
|
|
759
1008
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
760
1009
|
*/
|
|
@@ -762,24 +1011,30 @@ export class AasRepositoryClient {
|
|
|
762
1011
|
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor } = options;
|
|
763
1012
|
try {
|
|
764
1013
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
765
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
766
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
767
|
-
const
|
|
1014
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1015
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1016
|
+
const response = await apiInstance.getAllSubmodelElementsMetadataAasRepositoryRaw({
|
|
768
1017
|
aasIdentifier: encodedAasIdentifier,
|
|
769
1018
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
770
1019
|
limit: limit,
|
|
771
1020
|
cursor: cursor,
|
|
772
1021
|
});
|
|
1022
|
+
const result = await response.value();
|
|
773
1023
|
//const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
774
1024
|
const submodelElementsMetadata = result.result ?? [];
|
|
775
1025
|
return {
|
|
776
1026
|
success: true,
|
|
777
|
-
data: { pagedResult: result.
|
|
1027
|
+
data: { pagedResult: result.paging_metadata, result: submodelElementsMetadata },
|
|
1028
|
+
statusCode: response.raw.status,
|
|
778
1029
|
};
|
|
779
1030
|
}
|
|
780
1031
|
catch (err) {
|
|
781
1032
|
const customError = await handleApiError(err);
|
|
782
|
-
return {
|
|
1033
|
+
return {
|
|
1034
|
+
success: false,
|
|
1035
|
+
error: customError,
|
|
1036
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1037
|
+
};
|
|
783
1038
|
}
|
|
784
1039
|
}
|
|
785
1040
|
/**
|
|
@@ -790,7 +1045,7 @@ export class AasRepositoryClient {
|
|
|
790
1045
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
791
1046
|
* - submodelIdentifier: The Submodel’s unique id
|
|
792
1047
|
* - limit?: The maximum number of elements in the response array
|
|
793
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
1048
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
794
1049
|
* - level?: Determines the structural depth of the respective resource content
|
|
795
1050
|
*
|
|
796
1051
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
@@ -799,25 +1054,31 @@ export class AasRepositoryClient {
|
|
|
799
1054
|
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
800
1055
|
try {
|
|
801
1056
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
802
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
803
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
804
|
-
const
|
|
1057
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1058
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1059
|
+
const response = await apiInstance.getAllSubmodelElementsValueOnlyAasRepositoryRaw({
|
|
805
1060
|
aasIdentifier: encodedAasIdentifier,
|
|
806
1061
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
807
1062
|
limit: limit,
|
|
808
1063
|
cursor: cursor,
|
|
809
1064
|
level: level,
|
|
810
1065
|
});
|
|
1066
|
+
const result = await response.value();
|
|
811
1067
|
//const submodelElementsValue = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
812
1068
|
const submodelElementValues = result.result ?? [];
|
|
813
1069
|
return {
|
|
814
1070
|
success: true,
|
|
815
|
-
data: { pagedResult: result.
|
|
1071
|
+
data: { pagedResult: result.paging_metadata, result: submodelElementValues },
|
|
1072
|
+
statusCode: response.raw.status,
|
|
816
1073
|
};
|
|
817
1074
|
}
|
|
818
1075
|
catch (err) {
|
|
819
1076
|
const customError = await handleApiError(err);
|
|
820
|
-
return {
|
|
1077
|
+
return {
|
|
1078
|
+
success: false,
|
|
1079
|
+
error: customError,
|
|
1080
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1081
|
+
};
|
|
821
1082
|
}
|
|
822
1083
|
}
|
|
823
1084
|
/**
|
|
@@ -828,7 +1089,7 @@ export class AasRepositoryClient {
|
|
|
828
1089
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
829
1090
|
* - submodelIdentifier: The Submodel’s unique id
|
|
830
1091
|
* - limit?: The maximum number of elements in the response array
|
|
831
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
1092
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
832
1093
|
* - level?: Determines the structural depth of the respective resource content
|
|
833
1094
|
*
|
|
834
1095
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
@@ -837,24 +1098,30 @@ export class AasRepositoryClient {
|
|
|
837
1098
|
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
838
1099
|
try {
|
|
839
1100
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
840
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
841
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
842
|
-
const
|
|
1101
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1102
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1103
|
+
const response = await apiInstance.getAllSubmodelElementsReferenceAasRepositoryRaw({
|
|
843
1104
|
aasIdentifier: encodedAasIdentifier,
|
|
844
1105
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
845
1106
|
limit: limit,
|
|
846
1107
|
cursor: cursor,
|
|
847
1108
|
level: level,
|
|
848
1109
|
});
|
|
1110
|
+
const result = await response.value();
|
|
849
1111
|
const submodelElementReferences = (result.result ?? []).map(convertApiReferenceToCoreReference);
|
|
850
1112
|
return {
|
|
851
1113
|
success: true,
|
|
852
|
-
data: { pagedResult: result.
|
|
1114
|
+
data: { pagedResult: result.paging_metadata, result: submodelElementReferences },
|
|
1115
|
+
statusCode: response.raw.status,
|
|
853
1116
|
};
|
|
854
1117
|
}
|
|
855
1118
|
catch (err) {
|
|
856
1119
|
const customError = await handleApiError(err);
|
|
857
|
-
return {
|
|
1120
|
+
return {
|
|
1121
|
+
success: false,
|
|
1122
|
+
error: customError,
|
|
1123
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1124
|
+
};
|
|
858
1125
|
}
|
|
859
1126
|
}
|
|
860
1127
|
/**
|
|
@@ -865,7 +1132,7 @@ export class AasRepositoryClient {
|
|
|
865
1132
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
866
1133
|
* - submodelIdentifier: The Submodel’s unique id
|
|
867
1134
|
* - limit?: The maximum number of elements in the response array
|
|
868
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
1135
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
869
1136
|
* - level?: Determines the structural depth of the respective resource content
|
|
870
1137
|
* - extent?: Determines to which extent the resource is being serialized
|
|
871
1138
|
*
|
|
@@ -875,9 +1142,9 @@ export class AasRepositoryClient {
|
|
|
875
1142
|
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
876
1143
|
try {
|
|
877
1144
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
878
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
879
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
880
|
-
const
|
|
1145
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1146
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1147
|
+
const response = await apiInstance.getAllSubmodelElementsPathAasRepositoryRaw({
|
|
881
1148
|
aasIdentifier: encodedAasIdentifier,
|
|
882
1149
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
883
1150
|
limit: limit,
|
|
@@ -885,16 +1152,22 @@ export class AasRepositoryClient {
|
|
|
885
1152
|
level: level,
|
|
886
1153
|
extent: extent,
|
|
887
1154
|
});
|
|
1155
|
+
const result = await response.value();
|
|
888
1156
|
//const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
889
1157
|
const submodelElements = result.result ?? [];
|
|
890
1158
|
return {
|
|
891
1159
|
success: true,
|
|
892
|
-
data: { pagedResult: result.
|
|
1160
|
+
data: { pagedResult: result.paging_metadata, result: submodelElements },
|
|
1161
|
+
statusCode: response.raw.status,
|
|
893
1162
|
};
|
|
894
1163
|
}
|
|
895
1164
|
catch (err) {
|
|
896
1165
|
const customError = await handleApiError(err);
|
|
897
|
-
return {
|
|
1166
|
+
return {
|
|
1167
|
+
success: false,
|
|
1168
|
+
error: customError,
|
|
1169
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1170
|
+
};
|
|
898
1171
|
}
|
|
899
1172
|
}
|
|
900
1173
|
/**
|
|
@@ -914,20 +1187,29 @@ export class AasRepositoryClient {
|
|
|
914
1187
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
915
1188
|
try {
|
|
916
1189
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
917
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
918
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
919
|
-
const
|
|
1190
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1191
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1192
|
+
const response = await apiInstance.getSubmodelElementByPathAasRepositoryRaw({
|
|
920
1193
|
aasIdentifier: encodedAasIdentifier,
|
|
921
1194
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
922
1195
|
idShortPath: idShortPath,
|
|
923
1196
|
level: level,
|
|
924
1197
|
extent: extent,
|
|
925
1198
|
});
|
|
926
|
-
|
|
1199
|
+
const result = await response.value();
|
|
1200
|
+
return {
|
|
1201
|
+
success: true,
|
|
1202
|
+
data: convertApiSubmodelElementToCoreSubmodelElement(result),
|
|
1203
|
+
statusCode: response.raw.status,
|
|
1204
|
+
};
|
|
927
1205
|
}
|
|
928
1206
|
catch (err) {
|
|
929
1207
|
const customError = await handleApiError(err);
|
|
930
|
-
return {
|
|
1208
|
+
return {
|
|
1209
|
+
success: false,
|
|
1210
|
+
error: customError,
|
|
1211
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1212
|
+
};
|
|
931
1213
|
}
|
|
932
1214
|
}
|
|
933
1215
|
/**
|
|
@@ -946,19 +1228,28 @@ export class AasRepositoryClient {
|
|
|
946
1228
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
947
1229
|
try {
|
|
948
1230
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
949
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
950
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
951
|
-
const
|
|
1231
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1232
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1233
|
+
const response = await apiInstance.postSubmodelElementByPathAasRepositoryRaw({
|
|
952
1234
|
aasIdentifier: encodedAasIdentifier,
|
|
953
1235
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
954
1236
|
idShortPath: idShortPath,
|
|
955
1237
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
956
1238
|
});
|
|
957
|
-
|
|
1239
|
+
const result = await response.value();
|
|
1240
|
+
return {
|
|
1241
|
+
success: true,
|
|
1242
|
+
data: convertApiSubmodelElementToCoreSubmodelElement(result),
|
|
1243
|
+
statusCode: response.raw.status,
|
|
1244
|
+
};
|
|
958
1245
|
}
|
|
959
1246
|
catch (err) {
|
|
960
1247
|
const customError = await handleApiError(err);
|
|
961
|
-
return {
|
|
1248
|
+
return {
|
|
1249
|
+
success: false,
|
|
1250
|
+
error: customError,
|
|
1251
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1252
|
+
};
|
|
962
1253
|
}
|
|
963
1254
|
}
|
|
964
1255
|
/**
|
|
@@ -976,18 +1267,23 @@ export class AasRepositoryClient {
|
|
|
976
1267
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
977
1268
|
try {
|
|
978
1269
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
979
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
980
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
981
|
-
const
|
|
1270
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1271
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1272
|
+
const response = await apiInstance.deleteSubmodelElementByPathAasRepositoryRaw({
|
|
982
1273
|
aasIdentifier: encodedAasIdentifier,
|
|
983
1274
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
984
1275
|
idShortPath: idShortPath,
|
|
985
1276
|
});
|
|
986
|
-
|
|
1277
|
+
const result = await response.value();
|
|
1278
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
987
1279
|
}
|
|
988
1280
|
catch (err) {
|
|
989
1281
|
const customError = await handleApiError(err);
|
|
990
|
-
return {
|
|
1282
|
+
return {
|
|
1283
|
+
success: false,
|
|
1284
|
+
error: customError,
|
|
1285
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1286
|
+
};
|
|
991
1287
|
}
|
|
992
1288
|
}
|
|
993
1289
|
/**
|
|
@@ -1006,19 +1302,47 @@ export class AasRepositoryClient {
|
|
|
1006
1302
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
1007
1303
|
try {
|
|
1008
1304
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1009
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1010
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1011
|
-
const
|
|
1305
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1306
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1307
|
+
const response = await apiInstance.putSubmodelElementByPathAasRepositoryRaw({
|
|
1012
1308
|
aasIdentifier: encodedAasIdentifier,
|
|
1013
1309
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1014
1310
|
idShortPath: idShortPath,
|
|
1015
1311
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
1016
1312
|
});
|
|
1017
|
-
|
|
1313
|
+
if (response.raw.status === 204) {
|
|
1314
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
1315
|
+
}
|
|
1316
|
+
if (response.raw.status === 201) {
|
|
1317
|
+
try {
|
|
1318
|
+
const createdSubmodelElement = await response.value();
|
|
1319
|
+
return {
|
|
1320
|
+
success: true,
|
|
1321
|
+
data: createdSubmodelElement
|
|
1322
|
+
? convertApiSubmodelElementToCoreSubmodelElement(createdSubmodelElement)
|
|
1323
|
+
: undefined,
|
|
1324
|
+
statusCode: response.raw.status,
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
catch {
|
|
1328
|
+
// Some servers acknowledge creation with an empty or non-JSON body.
|
|
1329
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
const result = await response.value();
|
|
1333
|
+
return {
|
|
1334
|
+
success: true,
|
|
1335
|
+
data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : undefined,
|
|
1336
|
+
statusCode: response.raw.status,
|
|
1337
|
+
};
|
|
1018
1338
|
}
|
|
1019
1339
|
catch (err) {
|
|
1020
1340
|
const customError = await handleApiError(err);
|
|
1021
|
-
return {
|
|
1341
|
+
return {
|
|
1342
|
+
success: false,
|
|
1343
|
+
error: customError,
|
|
1344
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1345
|
+
};
|
|
1022
1346
|
}
|
|
1023
1347
|
}
|
|
1024
1348
|
/**
|
|
@@ -1038,20 +1362,25 @@ export class AasRepositoryClient {
|
|
|
1038
1362
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
1039
1363
|
try {
|
|
1040
1364
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1041
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1042
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1043
|
-
const
|
|
1365
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1366
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1367
|
+
const response = await apiInstance.patchSubmodelElementValueByPathAasRepositoryRaw({
|
|
1044
1368
|
aasIdentifier: encodedAasIdentifier,
|
|
1045
1369
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1046
1370
|
idShortPath: idShortPath,
|
|
1047
1371
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
1048
1372
|
level: level,
|
|
1049
1373
|
});
|
|
1050
|
-
|
|
1374
|
+
const result = await response.value();
|
|
1375
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1051
1376
|
}
|
|
1052
1377
|
catch (err) {
|
|
1053
1378
|
const customError = await handleApiError(err);
|
|
1054
|
-
return {
|
|
1379
|
+
return {
|
|
1380
|
+
success: false,
|
|
1381
|
+
error: customError,
|
|
1382
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1383
|
+
};
|
|
1055
1384
|
}
|
|
1056
1385
|
}
|
|
1057
1386
|
/**
|
|
@@ -1069,18 +1398,23 @@ export class AasRepositoryClient {
|
|
|
1069
1398
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
1070
1399
|
try {
|
|
1071
1400
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1072
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1073
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1074
|
-
const
|
|
1401
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1402
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1403
|
+
const response = await apiInstance.getSubmodelElementByPathMetadataAasRepositoryRaw({
|
|
1075
1404
|
aasIdentifier: encodedAasIdentifier,
|
|
1076
1405
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1077
1406
|
idShortPath: idShortPath,
|
|
1078
1407
|
});
|
|
1079
|
-
|
|
1408
|
+
const result = await response.value();
|
|
1409
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1080
1410
|
}
|
|
1081
1411
|
catch (err) {
|
|
1082
1412
|
const customError = await handleApiError(err);
|
|
1083
|
-
return {
|
|
1413
|
+
return {
|
|
1414
|
+
success: false,
|
|
1415
|
+
error: customError,
|
|
1416
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1417
|
+
};
|
|
1084
1418
|
}
|
|
1085
1419
|
}
|
|
1086
1420
|
/**
|
|
@@ -1099,19 +1433,24 @@ export class AasRepositoryClient {
|
|
|
1099
1433
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
1100
1434
|
try {
|
|
1101
1435
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1102
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1103
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1104
|
-
const
|
|
1436
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1437
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1438
|
+
const response = await apiInstance.patchSubmodelElementValueByPathMetadataRaw({
|
|
1105
1439
|
aasIdentifier: encodedAasIdentifier,
|
|
1106
1440
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1107
1441
|
idShortPath: idShortPath,
|
|
1108
1442
|
submodelElementMetadata: submodelElementMetadata,
|
|
1109
1443
|
});
|
|
1110
|
-
|
|
1444
|
+
const result = await response.value();
|
|
1445
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1111
1446
|
}
|
|
1112
1447
|
catch (err) {
|
|
1113
1448
|
const customError = await handleApiError(err);
|
|
1114
|
-
return {
|
|
1449
|
+
return {
|
|
1450
|
+
success: false,
|
|
1451
|
+
error: customError,
|
|
1452
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1453
|
+
};
|
|
1115
1454
|
}
|
|
1116
1455
|
}
|
|
1117
1456
|
/**
|
|
@@ -1131,20 +1470,25 @@ export class AasRepositoryClient {
|
|
|
1131
1470
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
1132
1471
|
try {
|
|
1133
1472
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1134
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1135
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1136
|
-
const
|
|
1473
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1474
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1475
|
+
const response = await apiInstance.getSubmodelElementByPathValueOnlyAasRepositoryRaw({
|
|
1137
1476
|
aasIdentifier: encodedAasIdentifier,
|
|
1138
1477
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1139
1478
|
idShortPath: idShortPath,
|
|
1140
1479
|
level: level,
|
|
1141
1480
|
extent: extent,
|
|
1142
1481
|
});
|
|
1143
|
-
|
|
1482
|
+
const result = await response.value();
|
|
1483
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1144
1484
|
}
|
|
1145
1485
|
catch (err) {
|
|
1146
1486
|
const customError = await handleApiError(err);
|
|
1147
|
-
return {
|
|
1487
|
+
return {
|
|
1488
|
+
success: false,
|
|
1489
|
+
error: customError,
|
|
1490
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1491
|
+
};
|
|
1148
1492
|
}
|
|
1149
1493
|
}
|
|
1150
1494
|
/**
|
|
@@ -1164,20 +1508,25 @@ export class AasRepositoryClient {
|
|
|
1164
1508
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
1165
1509
|
try {
|
|
1166
1510
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1167
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1168
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1169
|
-
const
|
|
1511
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1512
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1513
|
+
const response = await apiInstance.patchSubmodelElementValueByPathValueOnlyRaw({
|
|
1170
1514
|
aasIdentifier: encodedAasIdentifier,
|
|
1171
1515
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1172
1516
|
idShortPath: idShortPath,
|
|
1173
1517
|
submodelElementValue: submodelElementValue,
|
|
1174
1518
|
level: level,
|
|
1175
1519
|
});
|
|
1176
|
-
|
|
1520
|
+
const result = await response.value();
|
|
1521
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1177
1522
|
}
|
|
1178
1523
|
catch (err) {
|
|
1179
1524
|
const customError = await handleApiError(err);
|
|
1180
|
-
return {
|
|
1525
|
+
return {
|
|
1526
|
+
success: false,
|
|
1527
|
+
error: customError,
|
|
1528
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1529
|
+
};
|
|
1181
1530
|
}
|
|
1182
1531
|
}
|
|
1183
1532
|
/**
|
|
@@ -1196,19 +1545,24 @@ export class AasRepositoryClient {
|
|
|
1196
1545
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
1197
1546
|
try {
|
|
1198
1547
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1199
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1200
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1201
|
-
const
|
|
1548
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1549
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1550
|
+
const response = await apiInstance.getSubmodelElementByPathReferenceAasRepositoryRaw({
|
|
1202
1551
|
aasIdentifier: encodedAasIdentifier,
|
|
1203
1552
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1204
1553
|
idShortPath: idShortPath,
|
|
1205
1554
|
level: level,
|
|
1206
1555
|
});
|
|
1207
|
-
|
|
1556
|
+
const result = await response.value();
|
|
1557
|
+
return { success: true, data: convertApiReferenceToCoreReference(result), statusCode: response.raw.status };
|
|
1208
1558
|
}
|
|
1209
1559
|
catch (err) {
|
|
1210
1560
|
const customError = await handleApiError(err);
|
|
1211
|
-
return {
|
|
1561
|
+
return {
|
|
1562
|
+
success: false,
|
|
1563
|
+
error: customError,
|
|
1564
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1565
|
+
};
|
|
1212
1566
|
}
|
|
1213
1567
|
}
|
|
1214
1568
|
/**
|
|
@@ -1227,19 +1581,24 @@ export class AasRepositoryClient {
|
|
|
1227
1581
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
1228
1582
|
try {
|
|
1229
1583
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1230
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1231
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1232
|
-
const
|
|
1584
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1585
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1586
|
+
const response = await apiInstance.getSubmodelElementByPathPathAasRepositoryRaw({
|
|
1233
1587
|
aasIdentifier: encodedAasIdentifier,
|
|
1234
1588
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1235
1589
|
idShortPath: idShortPath,
|
|
1236
1590
|
level: level,
|
|
1237
1591
|
});
|
|
1238
|
-
|
|
1592
|
+
const result = await response.value();
|
|
1593
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1239
1594
|
}
|
|
1240
1595
|
catch (err) {
|
|
1241
1596
|
const customError = await handleApiError(err);
|
|
1242
|
-
return {
|
|
1597
|
+
return {
|
|
1598
|
+
success: false,
|
|
1599
|
+
error: customError,
|
|
1600
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1601
|
+
};
|
|
1243
1602
|
}
|
|
1244
1603
|
}
|
|
1245
1604
|
/**
|
|
@@ -1257,18 +1616,23 @@ export class AasRepositoryClient {
|
|
|
1257
1616
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
1258
1617
|
try {
|
|
1259
1618
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1260
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1261
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1262
|
-
const
|
|
1619
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1620
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1621
|
+
const response = await apiInstance.getFileByPathAasRepositoryRaw({
|
|
1263
1622
|
aasIdentifier: encodedAasIdentifier,
|
|
1264
1623
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1265
1624
|
idShortPath: idShortPath,
|
|
1266
1625
|
});
|
|
1267
|
-
|
|
1626
|
+
const result = await response.value();
|
|
1627
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1268
1628
|
}
|
|
1269
1629
|
catch (err) {
|
|
1270
1630
|
const customError = await handleApiError(err);
|
|
1271
|
-
return {
|
|
1631
|
+
return {
|
|
1632
|
+
success: false,
|
|
1633
|
+
error: customError,
|
|
1634
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1635
|
+
};
|
|
1272
1636
|
}
|
|
1273
1637
|
}
|
|
1274
1638
|
/**
|
|
@@ -1288,20 +1652,25 @@ export class AasRepositoryClient {
|
|
|
1288
1652
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
1289
1653
|
try {
|
|
1290
1654
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1291
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1292
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1293
|
-
const
|
|
1655
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1656
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1657
|
+
const response = await apiInstance.putFileByPathAasRepositoryRaw({
|
|
1294
1658
|
aasIdentifier: encodedAasIdentifier,
|
|
1295
1659
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1296
1660
|
idShortPath: idShortPath,
|
|
1297
1661
|
fileName: fileName,
|
|
1298
1662
|
file: file,
|
|
1299
1663
|
});
|
|
1300
|
-
|
|
1664
|
+
const result = await response.value();
|
|
1665
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1301
1666
|
}
|
|
1302
1667
|
catch (err) {
|
|
1303
1668
|
const customError = await handleApiError(err);
|
|
1304
|
-
return {
|
|
1669
|
+
return {
|
|
1670
|
+
success: false,
|
|
1671
|
+
error: customError,
|
|
1672
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1673
|
+
};
|
|
1305
1674
|
}
|
|
1306
1675
|
}
|
|
1307
1676
|
/**
|
|
@@ -1319,18 +1688,23 @@ export class AasRepositoryClient {
|
|
|
1319
1688
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
1320
1689
|
try {
|
|
1321
1690
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1322
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1323
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1324
|
-
const
|
|
1691
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1692
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1693
|
+
const response = await apiInstance.deleteFileByPathAasRepositoryRaw({
|
|
1325
1694
|
aasIdentifier: encodedAasIdentifier,
|
|
1326
1695
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1327
1696
|
idShortPath: idShortPath,
|
|
1328
1697
|
});
|
|
1329
|
-
|
|
1698
|
+
const result = await response.value();
|
|
1699
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1330
1700
|
}
|
|
1331
1701
|
catch (err) {
|
|
1332
1702
|
const customError = await handleApiError(err);
|
|
1333
|
-
return {
|
|
1703
|
+
return {
|
|
1704
|
+
success: false,
|
|
1705
|
+
error: customError,
|
|
1706
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1707
|
+
};
|
|
1334
1708
|
}
|
|
1335
1709
|
}
|
|
1336
1710
|
/**
|
|
@@ -1349,19 +1723,24 @@ export class AasRepositoryClient {
|
|
|
1349
1723
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
1350
1724
|
try {
|
|
1351
1725
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1352
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1353
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1354
|
-
const
|
|
1726
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1727
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1728
|
+
const response = await apiInstance.invokeOperationAasRepositoryRaw({
|
|
1355
1729
|
aasIdentifier: encodedAasIdentifier,
|
|
1356
1730
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1357
1731
|
idShortPath: idShortPath,
|
|
1358
1732
|
operationRequest: operationRequest,
|
|
1359
1733
|
});
|
|
1360
|
-
|
|
1734
|
+
const result = await response.value();
|
|
1735
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1361
1736
|
}
|
|
1362
1737
|
catch (err) {
|
|
1363
1738
|
const customError = await handleApiError(err);
|
|
1364
|
-
return {
|
|
1739
|
+
return {
|
|
1740
|
+
success: false,
|
|
1741
|
+
error: customError,
|
|
1742
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1743
|
+
};
|
|
1365
1744
|
}
|
|
1366
1745
|
}
|
|
1367
1746
|
/**
|
|
@@ -1380,19 +1759,24 @@ export class AasRepositoryClient {
|
|
|
1380
1759
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
1381
1760
|
try {
|
|
1382
1761
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1383
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1384
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1385
|
-
const
|
|
1762
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1763
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1764
|
+
const response = await apiInstance.invokeOperationValueOnlyAasRepositoryRaw({
|
|
1386
1765
|
aasIdentifier: encodedAasIdentifier,
|
|
1387
1766
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1388
1767
|
idShortPath: idShortPath,
|
|
1389
1768
|
operationRequestValueOnly: operationRequestValueOnly,
|
|
1390
1769
|
});
|
|
1391
|
-
|
|
1770
|
+
const result = await response.value();
|
|
1771
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1392
1772
|
}
|
|
1393
1773
|
catch (err) {
|
|
1394
1774
|
const customError = await handleApiError(err);
|
|
1395
|
-
return {
|
|
1775
|
+
return {
|
|
1776
|
+
success: false,
|
|
1777
|
+
error: customError,
|
|
1778
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1779
|
+
};
|
|
1396
1780
|
}
|
|
1397
1781
|
}
|
|
1398
1782
|
/**
|
|
@@ -1411,19 +1795,24 @@ export class AasRepositoryClient {
|
|
|
1411
1795
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
1412
1796
|
try {
|
|
1413
1797
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1414
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1415
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1416
|
-
const
|
|
1798
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1799
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1800
|
+
const response = await apiInstance.invokeOperationAsyncAasRepositoryRaw({
|
|
1417
1801
|
aasIdentifier: encodedAasIdentifier,
|
|
1418
1802
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1419
1803
|
idShortPath: idShortPath,
|
|
1420
1804
|
operationRequest: operationRequest,
|
|
1421
1805
|
});
|
|
1422
|
-
|
|
1806
|
+
const result = await response.value();
|
|
1807
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1423
1808
|
}
|
|
1424
1809
|
catch (err) {
|
|
1425
1810
|
const customError = await handleApiError(err);
|
|
1426
|
-
return {
|
|
1811
|
+
return {
|
|
1812
|
+
success: false,
|
|
1813
|
+
error: customError,
|
|
1814
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1815
|
+
};
|
|
1427
1816
|
}
|
|
1428
1817
|
}
|
|
1429
1818
|
/**
|
|
@@ -1442,19 +1831,24 @@ export class AasRepositoryClient {
|
|
|
1442
1831
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
1443
1832
|
try {
|
|
1444
1833
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1445
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1446
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1447
|
-
const
|
|
1834
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1835
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1836
|
+
const response = await apiInstance.invokeOperationAsyncValueOnlyAasRepositoryRaw({
|
|
1448
1837
|
aasIdentifier: encodedAasIdentifier,
|
|
1449
1838
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1450
1839
|
idShortPath: idShortPath,
|
|
1451
1840
|
operationRequestValueOnly: operationRequestValueOnly,
|
|
1452
1841
|
});
|
|
1453
|
-
|
|
1842
|
+
const result = await response.value();
|
|
1843
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1454
1844
|
}
|
|
1455
1845
|
catch (err) {
|
|
1456
1846
|
const customError = await handleApiError(err);
|
|
1457
|
-
return {
|
|
1847
|
+
return {
|
|
1848
|
+
success: false,
|
|
1849
|
+
error: customError,
|
|
1850
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1851
|
+
};
|
|
1458
1852
|
}
|
|
1459
1853
|
}
|
|
1460
1854
|
/**
|
|
@@ -1473,20 +1867,25 @@ export class AasRepositoryClient {
|
|
|
1473
1867
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, handleId } = options;
|
|
1474
1868
|
try {
|
|
1475
1869
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1476
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1477
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1478
|
-
const encodedHandleId = base64Encode(handleId);
|
|
1479
|
-
const
|
|
1870
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1871
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1872
|
+
const encodedHandleId = base64Encode(AasRepositoryClient.requireIdentifier(handleId, 'handleId'));
|
|
1873
|
+
const response = await apiInstance.getOperationAsyncStatusAasRepositoryRaw({
|
|
1480
1874
|
aasIdentifier: encodedAasIdentifier,
|
|
1481
1875
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1482
1876
|
idShortPath: idShortPath,
|
|
1483
1877
|
handleId: encodedHandleId,
|
|
1484
1878
|
});
|
|
1485
|
-
|
|
1879
|
+
const result = await response.value();
|
|
1880
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1486
1881
|
}
|
|
1487
1882
|
catch (err) {
|
|
1488
1883
|
const customError = await handleApiError(err);
|
|
1489
|
-
return {
|
|
1884
|
+
return {
|
|
1885
|
+
success: false,
|
|
1886
|
+
error: customError,
|
|
1887
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1888
|
+
};
|
|
1490
1889
|
}
|
|
1491
1890
|
}
|
|
1492
1891
|
/**
|
|
@@ -1505,20 +1904,25 @@ export class AasRepositoryClient {
|
|
|
1505
1904
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, handleId } = options;
|
|
1506
1905
|
try {
|
|
1507
1906
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1508
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1509
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1510
|
-
const encodedHandleId = base64Encode(handleId);
|
|
1511
|
-
const
|
|
1907
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1908
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1909
|
+
const encodedHandleId = base64Encode(AasRepositoryClient.requireIdentifier(handleId, 'handleId'));
|
|
1910
|
+
const response = await apiInstance.getOperationAsyncResultAasRepositoryRaw({
|
|
1512
1911
|
aasIdentifier: encodedAasIdentifier,
|
|
1513
1912
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1514
1913
|
idShortPath: idShortPath,
|
|
1515
1914
|
handleId: encodedHandleId,
|
|
1516
1915
|
});
|
|
1517
|
-
|
|
1916
|
+
const result = await response.value();
|
|
1917
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1518
1918
|
}
|
|
1519
1919
|
catch (err) {
|
|
1520
1920
|
const customError = await handleApiError(err);
|
|
1521
|
-
return {
|
|
1921
|
+
return {
|
|
1922
|
+
success: false,
|
|
1923
|
+
error: customError,
|
|
1924
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1925
|
+
};
|
|
1522
1926
|
}
|
|
1523
1927
|
}
|
|
1524
1928
|
/**
|
|
@@ -1537,20 +1941,25 @@ export class AasRepositoryClient {
|
|
|
1537
1941
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, handleId } = options;
|
|
1538
1942
|
try {
|
|
1539
1943
|
const apiInstance = new AasRepositoryService.AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
1540
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
1541
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1542
|
-
const encodedHandleId = base64Encode(handleId);
|
|
1543
|
-
const
|
|
1944
|
+
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1945
|
+
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1946
|
+
const encodedHandleId = base64Encode(AasRepositoryClient.requireIdentifier(handleId, 'handleId'));
|
|
1947
|
+
const response = await apiInstance.getOperationAsyncResultValueOnlyAasRepositoryRaw({
|
|
1544
1948
|
aasIdentifier: encodedAasIdentifier,
|
|
1545
1949
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1546
1950
|
idShortPath: idShortPath,
|
|
1547
1951
|
handleId: encodedHandleId,
|
|
1548
1952
|
});
|
|
1549
|
-
|
|
1953
|
+
const result = await response.value();
|
|
1954
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1550
1955
|
}
|
|
1551
1956
|
catch (err) {
|
|
1552
1957
|
const customError = await handleApiError(err);
|
|
1553
|
-
return {
|
|
1958
|
+
return {
|
|
1959
|
+
success: false,
|
|
1960
|
+
error: customError,
|
|
1961
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1962
|
+
};
|
|
1554
1963
|
}
|
|
1555
1964
|
}
|
|
1556
1965
|
/**
|
|
@@ -1568,16 +1977,21 @@ export class AasRepositoryClient {
|
|
|
1568
1977
|
const { configuration, aasIds, submodelIds, includeConceptDescriptions } = options;
|
|
1569
1978
|
try {
|
|
1570
1979
|
const apiInstance = new AasRepositoryService.SerializationAPIApi(applyDefaults(configuration));
|
|
1571
|
-
const
|
|
1980
|
+
const response = await apiInstance.generateSerializationByIdsRaw({
|
|
1572
1981
|
aasIds: aasIds,
|
|
1573
1982
|
submodelIds: submodelIds,
|
|
1574
1983
|
includeConceptDescriptions: includeConceptDescriptions,
|
|
1575
1984
|
});
|
|
1576
|
-
|
|
1985
|
+
const result = await response.value();
|
|
1986
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1577
1987
|
}
|
|
1578
1988
|
catch (err) {
|
|
1579
1989
|
const customError = await handleApiError(err);
|
|
1580
|
-
return {
|
|
1990
|
+
return {
|
|
1991
|
+
success: false,
|
|
1992
|
+
error: customError,
|
|
1993
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
1994
|
+
};
|
|
1581
1995
|
}
|
|
1582
1996
|
}
|
|
1583
1997
|
/**
|
|
@@ -1592,12 +2006,17 @@ export class AasRepositoryClient {
|
|
|
1592
2006
|
const { configuration } = options;
|
|
1593
2007
|
try {
|
|
1594
2008
|
const apiInstance = new AasRepositoryService.DescriptionAPIApi(applyDefaults(configuration));
|
|
1595
|
-
const
|
|
1596
|
-
|
|
2009
|
+
const response = await apiInstance.getSelfDescriptionRaw();
|
|
2010
|
+
const result = await response.value();
|
|
2011
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1597
2012
|
}
|
|
1598
2013
|
catch (err) {
|
|
1599
2014
|
const customError = await handleApiError(err);
|
|
1600
|
-
return {
|
|
2015
|
+
return {
|
|
2016
|
+
success: false,
|
|
2017
|
+
error: customError,
|
|
2018
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
2019
|
+
};
|
|
1601
2020
|
}
|
|
1602
2021
|
}
|
|
1603
2022
|
}
|