basyx-typescript-sdk 2.2.3 → 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 +2854 -2052
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +2854 -2052
- 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/aas-dataformat-xml/xmlization.js +1 -1
- 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 +23 -12
- 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 { SubmodelRepositoryService } from '../generated'; // Updated import
|
|
2
|
+
import { RequiredError } from '../generated/runtime';
|
|
2
3
|
import { applyDefaults } from '../lib/apiConfig';
|
|
3
4
|
import { base64Encode } from '../lib/base64Url';
|
|
4
5
|
import { convertApiSubmodelElementToCoreSubmodelElement, convertApiSubmodelToCoreSubmodel, convertCoreSubmodelElementToApiSubmodelElement, convertCoreSubmodelToApiSubmodel, } from '../lib/convertSubmodelTypes';
|
|
5
6
|
import { handleApiError } from '../lib/errorHandler';
|
|
6
7
|
//import { SubmodelElement } from 'src/generated/SubmodelRepositoryService';
|
|
7
8
|
export class SubmodelRepositoryClient {
|
|
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 Submodels
|
|
10
32
|
*
|
|
@@ -13,7 +35,7 @@ export class SubmodelRepositoryClient {
|
|
|
13
35
|
* - semanticId?: The value of the semantic id reference
|
|
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
|
* - level?: Determines the structural depth of the respective resource content
|
|
18
40
|
* - extent?: Determines to which extent the resource is being serialized
|
|
19
41
|
*
|
|
@@ -23,8 +45,8 @@ export class SubmodelRepositoryClient {
|
|
|
23
45
|
const { configuration, semanticId, idShort, limit, cursor, level, extent } = options;
|
|
24
46
|
try {
|
|
25
47
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
26
|
-
const encodedSemanticId = semanticId ? base64Encode(
|
|
27
|
-
const
|
|
48
|
+
const encodedSemanticId = semanticId ? base64Encode(semanticId) : undefined;
|
|
49
|
+
const response = await apiInstance.getAllSubmodelsRaw({
|
|
28
50
|
semanticId: encodedSemanticId,
|
|
29
51
|
idShort: idShort,
|
|
30
52
|
limit: limit,
|
|
@@ -32,47 +54,78 @@ export class SubmodelRepositoryClient {
|
|
|
32
54
|
level: level,
|
|
33
55
|
extent: extent,
|
|
34
56
|
});
|
|
57
|
+
const result = await response.value();
|
|
35
58
|
const submodels = (result.result ?? []).map(convertApiSubmodelToCoreSubmodel);
|
|
36
59
|
return {
|
|
37
60
|
success: true,
|
|
38
|
-
data: { pagedResult: result.
|
|
61
|
+
data: { pagedResult: result.paging_metadata, result: submodels },
|
|
62
|
+
statusCode: response.raw.status,
|
|
39
63
|
};
|
|
40
64
|
}
|
|
41
65
|
catch (err) {
|
|
42
66
|
const customError = await handleApiError(err);
|
|
43
|
-
return {
|
|
67
|
+
return {
|
|
68
|
+
success: false,
|
|
69
|
+
error: customError,
|
|
70
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
71
|
+
};
|
|
44
72
|
}
|
|
45
73
|
}
|
|
46
74
|
/**
|
|
47
75
|
* Returns all Submodels in metadata representation
|
|
76
|
+
*
|
|
77
|
+
* @param options Object containing:
|
|
78
|
+
* - configuration: The http request options
|
|
79
|
+
* - semanticId?: The value of the semantic id reference
|
|
80
|
+
* - idShort?: The Asset Administration Shell's IdShort
|
|
81
|
+
* - limit?: The maximum number of elements in the response array
|
|
82
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
83
|
+
*
|
|
84
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
48
85
|
*/
|
|
49
86
|
async getAllSubmodelsMetadata(options) {
|
|
50
87
|
const { configuration, semanticId, idShort, limit, cursor } = options;
|
|
51
88
|
try {
|
|
52
89
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
53
|
-
const encodedSemanticId = semanticId ? base64Encode(
|
|
54
|
-
const
|
|
90
|
+
const encodedSemanticId = semanticId ? base64Encode(semanticId) : undefined;
|
|
91
|
+
const response = await apiInstance.getAllSubmodelsMetadataRaw({
|
|
55
92
|
semanticId: encodedSemanticId,
|
|
56
93
|
idShort: idShort,
|
|
57
94
|
limit: limit,
|
|
58
95
|
cursor: cursor,
|
|
59
96
|
});
|
|
60
|
-
|
|
97
|
+
const result = await response.value();
|
|
98
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
61
99
|
}
|
|
62
100
|
catch (err) {
|
|
63
101
|
const customError = await handleApiError(err);
|
|
64
|
-
return {
|
|
102
|
+
return {
|
|
103
|
+
success: false,
|
|
104
|
+
error: customError,
|
|
105
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
106
|
+
};
|
|
65
107
|
}
|
|
66
108
|
}
|
|
67
109
|
/**
|
|
68
110
|
* Returns all Submodels in value-only representation
|
|
111
|
+
*
|
|
112
|
+
* @param options Object containing:
|
|
113
|
+
* - configuration: The http request options
|
|
114
|
+
* - semanticId?: The value of the semantic id reference
|
|
115
|
+
* - idShort?: The Asset Administration Shell's IdShort
|
|
116
|
+
* - limit?: The maximum number of elements in the response array
|
|
117
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
118
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
119
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
120
|
+
*
|
|
121
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
69
122
|
*/
|
|
70
123
|
async getAllSubmodelsValueOnly(options) {
|
|
71
124
|
const { configuration, semanticId, idShort, limit, cursor, level, extent } = options;
|
|
72
125
|
try {
|
|
73
126
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
74
|
-
const encodedSemanticId = semanticId ? base64Encode(
|
|
75
|
-
const
|
|
127
|
+
const encodedSemanticId = semanticId ? base64Encode(semanticId) : undefined;
|
|
128
|
+
const response = await apiInstance.getAllSubmodelsValueOnlyRaw({
|
|
76
129
|
semanticId: encodedSemanticId,
|
|
77
130
|
idShort: idShort,
|
|
78
131
|
limit: limit,
|
|
@@ -80,55 +133,90 @@ export class SubmodelRepositoryClient {
|
|
|
80
133
|
level: level,
|
|
81
134
|
extent: extent,
|
|
82
135
|
});
|
|
83
|
-
|
|
136
|
+
const result = await response.value();
|
|
137
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
84
138
|
}
|
|
85
139
|
catch (err) {
|
|
86
140
|
const customError = await handleApiError(err);
|
|
87
|
-
return {
|
|
141
|
+
return {
|
|
142
|
+
success: false,
|
|
143
|
+
error: customError,
|
|
144
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
145
|
+
};
|
|
88
146
|
}
|
|
89
147
|
}
|
|
90
148
|
/**
|
|
91
149
|
* Returns references to all Submodels
|
|
150
|
+
*
|
|
151
|
+
* @param options Object containing:
|
|
152
|
+
* - configuration: The http request options
|
|
153
|
+
* - semanticId?: The value of the semantic id reference
|
|
154
|
+
* - idShort?: The Asset Administration Shell's IdShort
|
|
155
|
+
* - limit?: The maximum number of elements in the response array
|
|
156
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
157
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
158
|
+
*
|
|
159
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
92
160
|
*/
|
|
93
161
|
async getAllSubmodelsReference(options) {
|
|
94
162
|
const { configuration, semanticId, idShort, limit, cursor, level } = options;
|
|
95
163
|
try {
|
|
96
164
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
97
|
-
const encodedSemanticId = semanticId ? base64Encode(
|
|
98
|
-
const
|
|
165
|
+
const encodedSemanticId = semanticId ? base64Encode(semanticId) : undefined;
|
|
166
|
+
const response = await apiInstance.getAllSubmodelsReferenceRaw({
|
|
99
167
|
semanticId: encodedSemanticId,
|
|
100
168
|
idShort: idShort,
|
|
101
169
|
limit: limit,
|
|
102
170
|
cursor: cursor,
|
|
103
171
|
level: level,
|
|
104
172
|
});
|
|
105
|
-
|
|
173
|
+
const result = await response.value();
|
|
174
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
106
175
|
}
|
|
107
176
|
catch (err) {
|
|
108
177
|
const customError = await handleApiError(err);
|
|
109
|
-
return {
|
|
178
|
+
return {
|
|
179
|
+
success: false,
|
|
180
|
+
error: customError,
|
|
181
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
182
|
+
};
|
|
110
183
|
}
|
|
111
184
|
}
|
|
112
185
|
/**
|
|
113
186
|
* Returns paths of all Submodels
|
|
187
|
+
*
|
|
188
|
+
* @param options Object containing:
|
|
189
|
+
* - configuration: The http request options
|
|
190
|
+
* - semanticId?: The value of the semantic id reference
|
|
191
|
+
* - idShort?: The Asset Administration Shell's IdShort
|
|
192
|
+
* - limit?: The maximum number of elements in the response array
|
|
193
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
194
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
195
|
+
*
|
|
196
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
114
197
|
*/
|
|
115
198
|
async getAllSubmodelsPath(options) {
|
|
116
199
|
const { configuration, semanticId, idShort, limit, cursor, level } = options;
|
|
117
200
|
try {
|
|
118
201
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
119
|
-
const encodedSemanticId = semanticId ? base64Encode(
|
|
120
|
-
const
|
|
202
|
+
const encodedSemanticId = semanticId ? base64Encode(semanticId) : undefined;
|
|
203
|
+
const response = await apiInstance.getAllSubmodelsPathRaw({
|
|
121
204
|
semanticId: encodedSemanticId,
|
|
122
205
|
idShort: idShort,
|
|
123
206
|
limit: limit,
|
|
124
207
|
cursor: cursor,
|
|
125
208
|
level: level,
|
|
126
209
|
});
|
|
127
|
-
|
|
210
|
+
const result = await response.value();
|
|
211
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
128
212
|
}
|
|
129
213
|
catch (err) {
|
|
130
214
|
const customError = await handleApiError(err);
|
|
131
|
-
return {
|
|
215
|
+
return {
|
|
216
|
+
success: false,
|
|
217
|
+
error: customError,
|
|
218
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
219
|
+
};
|
|
132
220
|
}
|
|
133
221
|
}
|
|
134
222
|
/**
|
|
@@ -144,14 +232,23 @@ export class SubmodelRepositoryClient {
|
|
|
144
232
|
const { configuration, submodel } = options;
|
|
145
233
|
try {
|
|
146
234
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
147
|
-
const
|
|
235
|
+
const response = await apiInstance.postSubmodelRaw({
|
|
148
236
|
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
149
237
|
});
|
|
150
|
-
|
|
238
|
+
const result = await response.value();
|
|
239
|
+
return {
|
|
240
|
+
success: true,
|
|
241
|
+
data: convertApiSubmodelToCoreSubmodel(result),
|
|
242
|
+
statusCode: response.raw.status,
|
|
243
|
+
};
|
|
151
244
|
}
|
|
152
245
|
catch (err) {
|
|
153
246
|
const customError = await handleApiError(err);
|
|
154
|
-
return {
|
|
247
|
+
return {
|
|
248
|
+
success: false,
|
|
249
|
+
error: customError,
|
|
250
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
251
|
+
};
|
|
155
252
|
}
|
|
156
253
|
}
|
|
157
254
|
/**
|
|
@@ -167,15 +264,20 @@ export class SubmodelRepositoryClient {
|
|
|
167
264
|
const { configuration, submodelIdentifier } = options;
|
|
168
265
|
try {
|
|
169
266
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
170
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
171
|
-
const
|
|
267
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
268
|
+
const response = await apiInstance.deleteSubmodelByIdRaw({
|
|
172
269
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
173
270
|
});
|
|
174
|
-
|
|
271
|
+
const result = await response.value();
|
|
272
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
175
273
|
}
|
|
176
274
|
catch (err) {
|
|
177
275
|
const customError = await handleApiError(err);
|
|
178
|
-
return {
|
|
276
|
+
return {
|
|
277
|
+
success: false,
|
|
278
|
+
error: customError,
|
|
279
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
280
|
+
};
|
|
179
281
|
}
|
|
180
282
|
}
|
|
181
283
|
/**
|
|
@@ -193,54 +295,86 @@ export class SubmodelRepositoryClient {
|
|
|
193
295
|
const { configuration, submodelIdentifier, level, extent } = options;
|
|
194
296
|
try {
|
|
195
297
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
196
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
197
|
-
const
|
|
298
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
299
|
+
const response = await apiInstance.getSubmodelByIdRaw({
|
|
198
300
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
199
301
|
level: level,
|
|
200
302
|
extent: extent,
|
|
201
303
|
});
|
|
202
|
-
|
|
304
|
+
const result = await response.value();
|
|
305
|
+
return {
|
|
306
|
+
success: true,
|
|
307
|
+
data: convertApiSubmodelToCoreSubmodel(result),
|
|
308
|
+
statusCode: response.raw.status,
|
|
309
|
+
};
|
|
203
310
|
}
|
|
204
311
|
catch (err) {
|
|
205
312
|
const customError = await handleApiError(err);
|
|
206
|
-
return {
|
|
313
|
+
return {
|
|
314
|
+
success: false,
|
|
315
|
+
error: customError,
|
|
316
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
317
|
+
};
|
|
207
318
|
}
|
|
208
319
|
}
|
|
209
320
|
/**
|
|
210
321
|
* Returns a specific Submodel in reference representation
|
|
322
|
+
*
|
|
323
|
+
* @param options Object containing:
|
|
324
|
+
* - configuration: The http request options
|
|
325
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
326
|
+
*
|
|
327
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
211
328
|
*/
|
|
212
329
|
async getSubmodelByIdReference(options) {
|
|
213
330
|
const { configuration, submodelIdentifier } = options;
|
|
214
331
|
try {
|
|
215
332
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
216
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
217
|
-
const
|
|
333
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
334
|
+
const response = await apiInstance.getSubmodelByIdReferenceRaw({
|
|
218
335
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
219
336
|
});
|
|
220
|
-
|
|
337
|
+
const result = await response.value();
|
|
338
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
221
339
|
}
|
|
222
340
|
catch (err) {
|
|
223
341
|
const customError = await handleApiError(err);
|
|
224
|
-
return {
|
|
342
|
+
return {
|
|
343
|
+
success: false,
|
|
344
|
+
error: customError,
|
|
345
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
346
|
+
};
|
|
225
347
|
}
|
|
226
348
|
}
|
|
227
349
|
/**
|
|
228
350
|
* Returns a specific Submodel in path representation
|
|
351
|
+
*
|
|
352
|
+
* @param options Object containing:
|
|
353
|
+
* - configuration: The http request options
|
|
354
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
355
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
356
|
+
*
|
|
357
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
229
358
|
*/
|
|
230
359
|
async getSubmodelByIdPath(options) {
|
|
231
360
|
const { configuration, submodelIdentifier, level } = options;
|
|
232
361
|
try {
|
|
233
362
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
234
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
235
|
-
const
|
|
363
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
364
|
+
const response = await apiInstance.getSubmodelByIdPathRaw({
|
|
236
365
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
237
366
|
level: level,
|
|
238
367
|
});
|
|
239
|
-
|
|
368
|
+
const result = await response.value();
|
|
369
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
240
370
|
}
|
|
241
371
|
catch (err) {
|
|
242
372
|
const customError = await handleApiError(err);
|
|
243
|
-
return {
|
|
373
|
+
return {
|
|
374
|
+
success: false,
|
|
375
|
+
error: customError,
|
|
376
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
377
|
+
};
|
|
244
378
|
}
|
|
245
379
|
}
|
|
246
380
|
/**
|
|
@@ -257,36 +391,61 @@ export class SubmodelRepositoryClient {
|
|
|
257
391
|
const { configuration, submodelIdentifier, submodel } = options;
|
|
258
392
|
try {
|
|
259
393
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
260
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
261
|
-
const
|
|
394
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
395
|
+
const response = await apiInstance.putSubmodelByIdRaw({
|
|
262
396
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
263
397
|
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
264
398
|
});
|
|
265
|
-
|
|
399
|
+
if (response.raw.status === 204) {
|
|
400
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
401
|
+
}
|
|
402
|
+
const result = await response.value();
|
|
403
|
+
return {
|
|
404
|
+
success: true,
|
|
405
|
+
data: result ? convertApiSubmodelToCoreSubmodel(result) : undefined,
|
|
406
|
+
statusCode: response.raw.status,
|
|
407
|
+
};
|
|
266
408
|
}
|
|
267
409
|
catch (err) {
|
|
268
410
|
const customError = await handleApiError(err);
|
|
269
|
-
return {
|
|
411
|
+
return {
|
|
412
|
+
success: false,
|
|
413
|
+
error: customError,
|
|
414
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
415
|
+
};
|
|
270
416
|
}
|
|
271
417
|
}
|
|
272
418
|
/**
|
|
273
419
|
* Updates an existing Submodel partially
|
|
420
|
+
*
|
|
421
|
+
* @param options Object containing:
|
|
422
|
+
* - configuration: The http request options
|
|
423
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
424
|
+
* - submodel: Submodel object
|
|
425
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
426
|
+
*
|
|
427
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
274
428
|
*/
|
|
275
429
|
async patchSubmodelById(options) {
|
|
276
430
|
const { configuration, submodelIdentifier, submodel, level } = options;
|
|
277
431
|
try {
|
|
278
432
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
279
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
280
|
-
const
|
|
433
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
434
|
+
const response = await apiInstance.patchSubmodelByIdRaw({
|
|
281
435
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
282
436
|
submodel: convertCoreSubmodelToApiSubmodel(submodel),
|
|
283
437
|
level: level,
|
|
284
438
|
});
|
|
285
|
-
|
|
439
|
+
const result = await response.value();
|
|
440
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
286
441
|
}
|
|
287
442
|
catch (err) {
|
|
288
443
|
const customError = await handleApiError(err);
|
|
289
|
-
return {
|
|
444
|
+
return {
|
|
445
|
+
success: false,
|
|
446
|
+
error: customError,
|
|
447
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
448
|
+
};
|
|
290
449
|
}
|
|
291
450
|
}
|
|
292
451
|
/**
|
|
@@ -296,7 +455,7 @@ export class SubmodelRepositoryClient {
|
|
|
296
455
|
* - configuration: The http request options
|
|
297
456
|
* - submodelIdentifier: The Submodel’s unique id
|
|
298
457
|
* - limit?: The maximum number of elements in the response array
|
|
299
|
-
* - cursor?: A server-generated identifier retrieved from
|
|
458
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
300
459
|
* - level?: Determines the structural depth of the respective resource content
|
|
301
460
|
* - extent?: Determines to which extent the resource is being serialized
|
|
302
461
|
*
|
|
@@ -306,107 +465,169 @@ export class SubmodelRepositoryClient {
|
|
|
306
465
|
const { configuration, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
307
466
|
try {
|
|
308
467
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
309
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
310
|
-
const
|
|
468
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
469
|
+
const response = await apiInstance.getAllSubmodelElementsRaw({
|
|
311
470
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
312
471
|
limit: limit,
|
|
313
472
|
cursor: cursor,
|
|
314
473
|
level: level,
|
|
315
474
|
extent: extent,
|
|
316
475
|
});
|
|
476
|
+
const result = await response.value();
|
|
317
477
|
const submodelElements = (result.result ?? []).map(convertApiSubmodelElementToCoreSubmodelElement);
|
|
318
478
|
return {
|
|
319
479
|
success: true,
|
|
320
|
-
data: { pagedResult: result.
|
|
480
|
+
data: { pagedResult: result.paging_metadata, result: submodelElements },
|
|
481
|
+
statusCode: response.raw.status,
|
|
321
482
|
};
|
|
322
483
|
}
|
|
323
484
|
catch (err) {
|
|
324
485
|
const customError = await handleApiError(err);
|
|
325
|
-
return {
|
|
486
|
+
return {
|
|
487
|
+
success: false,
|
|
488
|
+
error: customError,
|
|
489
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
490
|
+
};
|
|
326
491
|
}
|
|
327
492
|
}
|
|
328
493
|
/**
|
|
329
494
|
* Returns all submodel elements in metadata representation
|
|
495
|
+
*
|
|
496
|
+
* @param options Object containing:
|
|
497
|
+
* - configuration: The http request options
|
|
498
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
499
|
+
* - limit?: The maximum number of elements in the response array
|
|
500
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
501
|
+
*
|
|
502
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
330
503
|
*/
|
|
331
504
|
async getAllSubmodelElementsMetadata(options) {
|
|
332
505
|
const { configuration, submodelIdentifier, limit, cursor } = options;
|
|
333
506
|
try {
|
|
334
507
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
335
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
336
|
-
const
|
|
508
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
509
|
+
const response = await apiInstance.getAllSubmodelElementsMetadataSubmodelRepoRaw({
|
|
337
510
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
338
511
|
limit: limit,
|
|
339
512
|
cursor: cursor,
|
|
340
513
|
});
|
|
341
|
-
|
|
514
|
+
const result = await response.value();
|
|
515
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
342
516
|
}
|
|
343
517
|
catch (err) {
|
|
344
518
|
const customError = await handleApiError(err);
|
|
345
|
-
return {
|
|
519
|
+
return {
|
|
520
|
+
success: false,
|
|
521
|
+
error: customError,
|
|
522
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
523
|
+
};
|
|
346
524
|
}
|
|
347
525
|
}
|
|
348
526
|
/**
|
|
349
527
|
* Returns all submodel elements in value-only representation
|
|
528
|
+
*
|
|
529
|
+
* @param options Object containing:
|
|
530
|
+
* - configuration: The http request options
|
|
531
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
532
|
+
* - limit?: The maximum number of elements in the response array
|
|
533
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
534
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
535
|
+
* - extent?: Determines to which extent the resource is being serialized
|
|
536
|
+
*
|
|
537
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
350
538
|
*/
|
|
351
539
|
async getAllSubmodelElementsValueOnly(options) {
|
|
352
540
|
const { configuration, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
353
541
|
try {
|
|
354
542
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
355
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
356
|
-
const
|
|
543
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
544
|
+
const response = await apiInstance.getAllSubmodelElementsValueOnlySubmodelRepoRaw({
|
|
357
545
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
358
546
|
limit: limit,
|
|
359
547
|
cursor: cursor,
|
|
360
548
|
level: level,
|
|
361
549
|
extent: extent,
|
|
362
550
|
});
|
|
363
|
-
|
|
551
|
+
const result = await response.value();
|
|
552
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
364
553
|
}
|
|
365
554
|
catch (err) {
|
|
366
555
|
const customError = await handleApiError(err);
|
|
367
|
-
return {
|
|
556
|
+
return {
|
|
557
|
+
success: false,
|
|
558
|
+
error: customError,
|
|
559
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
560
|
+
};
|
|
368
561
|
}
|
|
369
562
|
}
|
|
370
563
|
/**
|
|
371
564
|
* Returns references to all submodel elements
|
|
565
|
+
*
|
|
566
|
+
* @param options Object containing:
|
|
567
|
+
* - configuration: The http request options
|
|
568
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
569
|
+
* - limit?: The maximum number of elements in the response array
|
|
570
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
571
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
572
|
+
*
|
|
573
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
372
574
|
*/
|
|
373
575
|
async getAllSubmodelElementsReference(options) {
|
|
374
576
|
const { configuration, submodelIdentifier, limit, cursor, level } = options;
|
|
375
577
|
try {
|
|
376
578
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
377
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
378
|
-
const
|
|
579
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
580
|
+
const response = await apiInstance.getAllSubmodelElementsReferenceSubmodelRepoRaw({
|
|
379
581
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
380
582
|
limit: limit,
|
|
381
583
|
cursor: cursor,
|
|
382
584
|
level: level,
|
|
383
585
|
});
|
|
384
|
-
|
|
586
|
+
const result = await response.value();
|
|
587
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
385
588
|
}
|
|
386
589
|
catch (err) {
|
|
387
590
|
const customError = await handleApiError(err);
|
|
388
|
-
return {
|
|
591
|
+
return {
|
|
592
|
+
success: false,
|
|
593
|
+
error: customError,
|
|
594
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
595
|
+
};
|
|
389
596
|
}
|
|
390
597
|
}
|
|
391
598
|
/**
|
|
392
599
|
* Returns paths of all submodel elements
|
|
600
|
+
*
|
|
601
|
+
* @param options Object containing:
|
|
602
|
+
* - configuration: The http request options
|
|
603
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
604
|
+
* - limit?: The maximum number of elements in the response array
|
|
605
|
+
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
606
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
607
|
+
*
|
|
608
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
393
609
|
*/
|
|
394
610
|
async getAllSubmodelElementsPath(options) {
|
|
395
611
|
const { configuration, submodelIdentifier, limit, cursor, level } = options;
|
|
396
612
|
try {
|
|
397
613
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
398
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
399
|
-
const
|
|
614
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
615
|
+
const response = await apiInstance.getAllSubmodelElementsPathSubmodelRepoRaw({
|
|
400
616
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
401
617
|
limit: limit,
|
|
402
618
|
cursor: cursor,
|
|
403
619
|
level: level,
|
|
404
620
|
});
|
|
405
|
-
|
|
621
|
+
const result = await response.value();
|
|
622
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
406
623
|
}
|
|
407
624
|
catch (err) {
|
|
408
625
|
const customError = await handleApiError(err);
|
|
409
|
-
return {
|
|
626
|
+
return {
|
|
627
|
+
success: false,
|
|
628
|
+
error: customError,
|
|
629
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
630
|
+
};
|
|
410
631
|
}
|
|
411
632
|
}
|
|
412
633
|
/**
|
|
@@ -422,16 +643,25 @@ export class SubmodelRepositoryClient {
|
|
|
422
643
|
const { configuration, submodelIdentifier, submodelElement } = options;
|
|
423
644
|
try {
|
|
424
645
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
425
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
426
|
-
const
|
|
646
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
647
|
+
const response = await apiInstance.postSubmodelElementSubmodelRepoRaw({
|
|
427
648
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
428
649
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
429
650
|
});
|
|
430
|
-
|
|
651
|
+
const result = await response.value();
|
|
652
|
+
return {
|
|
653
|
+
success: true,
|
|
654
|
+
data: convertApiSubmodelElementToCoreSubmodelElement(result),
|
|
655
|
+
statusCode: response.raw.status,
|
|
656
|
+
};
|
|
431
657
|
}
|
|
432
658
|
catch (err) {
|
|
433
659
|
const customError = await handleApiError(err);
|
|
434
|
-
return {
|
|
660
|
+
return {
|
|
661
|
+
success: false,
|
|
662
|
+
error: customError,
|
|
663
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
664
|
+
};
|
|
435
665
|
}
|
|
436
666
|
}
|
|
437
667
|
/**
|
|
@@ -450,76 +680,122 @@ export class SubmodelRepositoryClient {
|
|
|
450
680
|
const { configuration, submodelIdentifier, idShortPath, level, extent } = options;
|
|
451
681
|
try {
|
|
452
682
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
453
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
454
|
-
const
|
|
683
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
684
|
+
const response = await apiInstance.getSubmodelElementByPathSubmodelRepoRaw({
|
|
455
685
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
456
686
|
idShortPath: idShortPath,
|
|
457
687
|
level: level,
|
|
458
688
|
extent: extent,
|
|
459
689
|
});
|
|
460
|
-
|
|
690
|
+
const result = await response.value();
|
|
691
|
+
return {
|
|
692
|
+
success: true,
|
|
693
|
+
data: convertApiSubmodelElementToCoreSubmodelElement(result),
|
|
694
|
+
statusCode: response.raw.status,
|
|
695
|
+
};
|
|
461
696
|
}
|
|
462
697
|
catch (err) {
|
|
463
698
|
const customError = await handleApiError(err);
|
|
464
|
-
return {
|
|
699
|
+
return {
|
|
700
|
+
success: false,
|
|
701
|
+
error: customError,
|
|
702
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
703
|
+
};
|
|
465
704
|
}
|
|
466
705
|
}
|
|
467
706
|
/**
|
|
468
707
|
* Returns metadata attributes of a specific submodel element
|
|
708
|
+
*
|
|
709
|
+
* @param options Object containing:
|
|
710
|
+
* - configuration: The http request options
|
|
711
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
712
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
713
|
+
*
|
|
714
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
469
715
|
*/
|
|
470
716
|
async getSubmodelElementByPathMetadata(options) {
|
|
471
717
|
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
472
718
|
try {
|
|
473
719
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
474
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
475
|
-
const
|
|
720
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
721
|
+
const response = await apiInstance.getSubmodelElementByPathMetadataSubmodelRepoRaw({
|
|
476
722
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
477
723
|
idShortPath: idShortPath,
|
|
478
724
|
});
|
|
479
|
-
|
|
725
|
+
const result = await response.value();
|
|
726
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
480
727
|
}
|
|
481
728
|
catch (err) {
|
|
482
729
|
const customError = await handleApiError(err);
|
|
483
|
-
return {
|
|
730
|
+
return {
|
|
731
|
+
success: false,
|
|
732
|
+
error: customError,
|
|
733
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
734
|
+
};
|
|
484
735
|
}
|
|
485
736
|
}
|
|
486
737
|
/**
|
|
487
738
|
* Returns a specific submodel element in reference representation
|
|
739
|
+
*
|
|
740
|
+
* @param options Object containing:
|
|
741
|
+
* - configuration: The http request options
|
|
742
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
743
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
744
|
+
*
|
|
745
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
488
746
|
*/
|
|
489
747
|
async getSubmodelElementByPathReference(options) {
|
|
490
748
|
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
491
749
|
try {
|
|
492
750
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
493
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
494
|
-
const
|
|
751
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
752
|
+
const response = await apiInstance.getSubmodelElementByPathReferenceSubmodelRepoRaw({
|
|
495
753
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
496
754
|
idShortPath: idShortPath,
|
|
497
755
|
});
|
|
498
|
-
|
|
756
|
+
const result = await response.value();
|
|
757
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
499
758
|
}
|
|
500
759
|
catch (err) {
|
|
501
760
|
const customError = await handleApiError(err);
|
|
502
|
-
return {
|
|
761
|
+
return {
|
|
762
|
+
success: false,
|
|
763
|
+
error: customError,
|
|
764
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
765
|
+
};
|
|
503
766
|
}
|
|
504
767
|
}
|
|
505
768
|
/**
|
|
506
769
|
* Returns a specific submodel element in path representation
|
|
770
|
+
*
|
|
771
|
+
* @param options Object containing:
|
|
772
|
+
* - configuration: The http request options
|
|
773
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
774
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
775
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
776
|
+
*
|
|
777
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
507
778
|
*/
|
|
508
779
|
async getSubmodelElementByPathPath(options) {
|
|
509
780
|
const { configuration, submodelIdentifier, idShortPath, level } = options;
|
|
510
781
|
try {
|
|
511
782
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
512
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
513
|
-
const
|
|
783
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
784
|
+
const response = await apiInstance.getSubmodelElementByPathPathSubmodelRepoRaw({
|
|
514
785
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
515
786
|
idShortPath: idShortPath,
|
|
516
787
|
level: level,
|
|
517
788
|
});
|
|
518
|
-
|
|
789
|
+
const result = await response.value();
|
|
790
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
519
791
|
}
|
|
520
792
|
catch (err) {
|
|
521
793
|
const customError = await handleApiError(err);
|
|
522
|
-
return {
|
|
794
|
+
return {
|
|
795
|
+
success: false,
|
|
796
|
+
error: customError,
|
|
797
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
798
|
+
};
|
|
523
799
|
}
|
|
524
800
|
}
|
|
525
801
|
/**
|
|
@@ -537,17 +813,26 @@ export class SubmodelRepositoryClient {
|
|
|
537
813
|
const { configuration, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
538
814
|
try {
|
|
539
815
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
540
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
541
|
-
const
|
|
816
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
817
|
+
const response = await apiInstance.postSubmodelElementByPathSubmodelRepoRaw({
|
|
542
818
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
543
819
|
idShortPath: idShortPath,
|
|
544
820
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
545
821
|
});
|
|
546
|
-
|
|
822
|
+
const result = await response.value();
|
|
823
|
+
return {
|
|
824
|
+
success: true,
|
|
825
|
+
data: convertApiSubmodelElementToCoreSubmodelElement(result),
|
|
826
|
+
statusCode: response.raw.status,
|
|
827
|
+
};
|
|
547
828
|
}
|
|
548
829
|
catch (err) {
|
|
549
830
|
const customError = await handleApiError(err);
|
|
550
|
-
return {
|
|
831
|
+
return {
|
|
832
|
+
success: false,
|
|
833
|
+
error: customError,
|
|
834
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
835
|
+
};
|
|
551
836
|
}
|
|
552
837
|
}
|
|
553
838
|
/**
|
|
@@ -564,16 +849,21 @@ export class SubmodelRepositoryClient {
|
|
|
564
849
|
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
565
850
|
try {
|
|
566
851
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
567
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
568
|
-
const
|
|
852
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
853
|
+
const response = await apiInstance.deleteSubmodelElementByPathSubmodelRepoRaw({
|
|
569
854
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
570
855
|
idShortPath: idShortPath,
|
|
571
856
|
});
|
|
572
|
-
|
|
857
|
+
const result = await response.value();
|
|
858
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
573
859
|
}
|
|
574
860
|
catch (err) {
|
|
575
861
|
const customError = await handleApiError(err);
|
|
576
|
-
return {
|
|
862
|
+
return {
|
|
863
|
+
success: false,
|
|
864
|
+
error: customError,
|
|
865
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
866
|
+
};
|
|
577
867
|
}
|
|
578
868
|
}
|
|
579
869
|
/**
|
|
@@ -592,39 +882,65 @@ export class SubmodelRepositoryClient {
|
|
|
592
882
|
const { configuration, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
593
883
|
try {
|
|
594
884
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
595
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
596
|
-
const
|
|
885
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
886
|
+
const response = await apiInstance.putSubmodelElementByPathSubmodelRepoRaw({
|
|
597
887
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
598
888
|
idShortPath: idShortPath,
|
|
599
889
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
600
890
|
level: level,
|
|
601
891
|
});
|
|
602
|
-
|
|
892
|
+
if (response.raw.status === 204) {
|
|
893
|
+
return { success: true, data: undefined, statusCode: response.raw.status };
|
|
894
|
+
}
|
|
895
|
+
const result = await response.value();
|
|
896
|
+
return {
|
|
897
|
+
success: true,
|
|
898
|
+
data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : undefined,
|
|
899
|
+
statusCode: response.raw.status,
|
|
900
|
+
};
|
|
603
901
|
}
|
|
604
902
|
catch (err) {
|
|
605
903
|
const customError = await handleApiError(err);
|
|
606
|
-
return {
|
|
904
|
+
return {
|
|
905
|
+
success: false,
|
|
906
|
+
error: customError,
|
|
907
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
908
|
+
};
|
|
607
909
|
}
|
|
608
910
|
}
|
|
609
911
|
/**
|
|
610
912
|
* Updates values of an existing submodel element at a specified path
|
|
913
|
+
*
|
|
914
|
+
* @param options Object containing:
|
|
915
|
+
* - configuration: The http request options
|
|
916
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
917
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
918
|
+
* - submodelElement: SubmodelElement object
|
|
919
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
920
|
+
*
|
|
921
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
611
922
|
*/
|
|
612
923
|
async patchSubmodelElementByPath(options) {
|
|
613
924
|
const { configuration, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
614
925
|
try {
|
|
615
926
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
616
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
617
|
-
const
|
|
927
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
928
|
+
const response = await apiInstance.patchSubmodelElementByPathSubmodelRepoRaw({
|
|
618
929
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
619
930
|
idShortPath: idShortPath,
|
|
620
931
|
submodelElement: convertCoreSubmodelElementToApiSubmodelElement(submodelElement),
|
|
621
932
|
level: level,
|
|
622
933
|
});
|
|
623
|
-
|
|
934
|
+
const result = await response.value();
|
|
935
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
624
936
|
}
|
|
625
937
|
catch (err) {
|
|
626
938
|
const customError = await handleApiError(err);
|
|
627
|
-
return {
|
|
939
|
+
return {
|
|
940
|
+
success: false,
|
|
941
|
+
error: customError,
|
|
942
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
943
|
+
};
|
|
628
944
|
}
|
|
629
945
|
}
|
|
630
946
|
/**
|
|
@@ -640,35 +956,53 @@ export class SubmodelRepositoryClient {
|
|
|
640
956
|
const { configuration, submodelIdentifier } = options;
|
|
641
957
|
try {
|
|
642
958
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
643
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
644
|
-
const
|
|
959
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
960
|
+
const response = await apiInstance.getSubmodelByIdMetadataRaw({
|
|
645
961
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
646
962
|
});
|
|
647
|
-
|
|
963
|
+
const result = await response.value();
|
|
964
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
648
965
|
}
|
|
649
966
|
catch (err) {
|
|
650
967
|
const customError = await handleApiError(err);
|
|
651
|
-
return {
|
|
968
|
+
return {
|
|
969
|
+
success: false,
|
|
970
|
+
error: customError,
|
|
971
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
972
|
+
};
|
|
652
973
|
}
|
|
653
974
|
}
|
|
654
975
|
/**
|
|
655
976
|
* Updates metadata attributes of an existing Submodel
|
|
977
|
+
*
|
|
978
|
+
* @param options Object containing:
|
|
979
|
+
* - configuration: The http request options
|
|
980
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
981
|
+
* - submodelMetadata: SubmodelMetadata object
|
|
982
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
983
|
+
*
|
|
984
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
656
985
|
*/
|
|
657
986
|
async patchSubmodelByIdMetadata(options) {
|
|
658
987
|
const { configuration, submodelIdentifier, submodelMetadata, level } = options;
|
|
659
988
|
try {
|
|
660
989
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
661
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
662
|
-
const
|
|
990
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
991
|
+
const response = await apiInstance.patchSubmodelByIdMetadataRaw({
|
|
663
992
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
664
993
|
submodelMetadata: submodelMetadata,
|
|
665
994
|
level: level,
|
|
666
995
|
});
|
|
667
|
-
|
|
996
|
+
const result = await response.value();
|
|
997
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
668
998
|
}
|
|
669
999
|
catch (err) {
|
|
670
1000
|
const customError = await handleApiError(err);
|
|
671
|
-
return {
|
|
1001
|
+
return {
|
|
1002
|
+
success: false,
|
|
1003
|
+
error: customError,
|
|
1004
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1005
|
+
};
|
|
672
1006
|
}
|
|
673
1007
|
}
|
|
674
1008
|
/**
|
|
@@ -686,44 +1020,55 @@ export class SubmodelRepositoryClient {
|
|
|
686
1020
|
const { configuration, submodelIdentifier, level, extent } = options;
|
|
687
1021
|
try {
|
|
688
1022
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
689
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
690
|
-
const
|
|
1023
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1024
|
+
const response = await apiInstance.getSubmodelByIdValueOnlyRaw({
|
|
691
1025
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
692
1026
|
level: level,
|
|
693
1027
|
extent: extent,
|
|
694
1028
|
});
|
|
695
|
-
|
|
1029
|
+
const result = await response.value();
|
|
1030
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
696
1031
|
}
|
|
697
1032
|
catch (err) {
|
|
698
1033
|
const customError = await handleApiError(err);
|
|
699
|
-
return {
|
|
1034
|
+
return {
|
|
1035
|
+
success: false,
|
|
1036
|
+
error: customError,
|
|
1037
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1038
|
+
};
|
|
700
1039
|
}
|
|
701
1040
|
}
|
|
702
1041
|
/**
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
1042
|
+
* Updates the values of an existing Submodel
|
|
1043
|
+
*
|
|
1044
|
+
* @param options Object containing:
|
|
1045
|
+
* - configuration: The http request options
|
|
1046
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1047
|
+
* - body: Value-only payload object
|
|
1048
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1049
|
+
*
|
|
1050
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1051
|
+
*/
|
|
712
1052
|
async patchSubmodelByIdValueOnly(options) {
|
|
713
1053
|
const { configuration, submodelIdentifier, body, level } = options;
|
|
714
1054
|
try {
|
|
715
1055
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
716
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
717
|
-
const
|
|
1056
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1057
|
+
const response = await apiInstance.patchSubmodelByIdValueOnlyRaw({
|
|
718
1058
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
719
1059
|
body: body,
|
|
720
1060
|
level: level,
|
|
721
1061
|
});
|
|
722
|
-
|
|
1062
|
+
const result = await response.value();
|
|
1063
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
723
1064
|
}
|
|
724
1065
|
catch (err) {
|
|
725
1066
|
const customError = await handleApiError(err);
|
|
726
|
-
return {
|
|
1067
|
+
return {
|
|
1068
|
+
success: false,
|
|
1069
|
+
error: customError,
|
|
1070
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1071
|
+
};
|
|
727
1072
|
}
|
|
728
1073
|
}
|
|
729
1074
|
/**
|
|
@@ -742,127 +1087,188 @@ export class SubmodelRepositoryClient {
|
|
|
742
1087
|
const { configuration, submodelIdentifier, idShortPath, level, extent } = options;
|
|
743
1088
|
try {
|
|
744
1089
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
745
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
746
|
-
const
|
|
1090
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1091
|
+
const response = await apiInstance.getSubmodelElementByPathValueOnlySubmodelRepoRaw({
|
|
747
1092
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
748
1093
|
idShortPath: idShortPath,
|
|
749
1094
|
level: level,
|
|
750
1095
|
extent: extent,
|
|
751
1096
|
});
|
|
752
|
-
|
|
1097
|
+
const result = await response.value();
|
|
1098
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
753
1099
|
}
|
|
754
1100
|
catch (err) {
|
|
755
1101
|
const customError = await handleApiError(err);
|
|
756
|
-
return {
|
|
1102
|
+
return {
|
|
1103
|
+
success: false,
|
|
1104
|
+
error: customError,
|
|
1105
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1106
|
+
};
|
|
757
1107
|
}
|
|
758
1108
|
}
|
|
759
1109
|
/**
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1110
|
+
* Updates the value of an existing SubmodelElement
|
|
1111
|
+
*
|
|
1112
|
+
* @param options Object containing:
|
|
1113
|
+
* - configuration: The http request options
|
|
1114
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1115
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1116
|
+
* - submodelElementValue: SubmodelElementValue object
|
|
1117
|
+
* - level?: Determines the structural depth of the respective resource content
|
|
1118
|
+
*
|
|
1119
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1120
|
+
*/
|
|
771
1121
|
async patchSubmodelElementByPathValueOnly(options) {
|
|
772
1122
|
const { configuration, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
773
1123
|
try {
|
|
774
1124
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
775
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
776
|
-
const
|
|
1125
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1126
|
+
const response = await apiInstance.patchSubmodelElementByPathValueOnlySubmodelRepoRaw({
|
|
777
1127
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
778
1128
|
idShortPath: idShortPath,
|
|
779
1129
|
submodelElementValue: submodelElementValue,
|
|
780
1130
|
level: level,
|
|
781
1131
|
});
|
|
782
|
-
|
|
1132
|
+
const result = await response.value();
|
|
1133
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
783
1134
|
}
|
|
784
1135
|
catch (err) {
|
|
785
1136
|
const customError = await handleApiError(err);
|
|
786
|
-
return {
|
|
1137
|
+
return {
|
|
1138
|
+
success: false,
|
|
1139
|
+
error: customError,
|
|
1140
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1141
|
+
};
|
|
787
1142
|
}
|
|
788
1143
|
}
|
|
789
1144
|
/**
|
|
790
1145
|
* Updates metadata attributes of an existing SubmodelElement
|
|
1146
|
+
*
|
|
1147
|
+
* @param options Object containing:
|
|
1148
|
+
* - configuration: The http request options
|
|
1149
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1150
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1151
|
+
* - submodelElementMetadata: SubmodelElementMetadata object
|
|
1152
|
+
*
|
|
1153
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
791
1154
|
*/
|
|
792
1155
|
async patchSubmodelElementByPathMetadata(options) {
|
|
793
1156
|
const { configuration, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
794
1157
|
try {
|
|
795
1158
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
796
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
797
|
-
const
|
|
1159
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1160
|
+
const response = await apiInstance.patchSubmodelElementByPathMetadataSubmodelRepoRaw({
|
|
798
1161
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
799
1162
|
idShortPath: idShortPath,
|
|
800
1163
|
submodelElementMetadata: submodelElementMetadata,
|
|
801
1164
|
});
|
|
802
|
-
|
|
1165
|
+
const result = await response.value();
|
|
1166
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
803
1167
|
}
|
|
804
1168
|
catch (err) {
|
|
805
1169
|
const customError = await handleApiError(err);
|
|
806
|
-
return {
|
|
1170
|
+
return {
|
|
1171
|
+
success: false,
|
|
1172
|
+
error: customError,
|
|
1173
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1174
|
+
};
|
|
807
1175
|
}
|
|
808
1176
|
}
|
|
809
1177
|
/**
|
|
810
1178
|
* Returns file content for a submodel element at a specified path
|
|
1179
|
+
*
|
|
1180
|
+
* @param options Object containing:
|
|
1181
|
+
* - configuration: The http request options
|
|
1182
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1183
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1184
|
+
*
|
|
1185
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
811
1186
|
*/
|
|
812
1187
|
async getFileByPath(options) {
|
|
813
1188
|
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
814
1189
|
try {
|
|
815
1190
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
816
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
817
|
-
const
|
|
1191
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1192
|
+
const response = await apiInstance.getFileByPathSubmodelRepoRaw({
|
|
818
1193
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
819
1194
|
idShortPath: idShortPath,
|
|
820
1195
|
});
|
|
821
|
-
|
|
1196
|
+
const result = await response.value();
|
|
1197
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
822
1198
|
}
|
|
823
1199
|
catch (err) {
|
|
824
1200
|
const customError = await handleApiError(err);
|
|
825
|
-
return {
|
|
1201
|
+
return {
|
|
1202
|
+
success: false,
|
|
1203
|
+
error: customError,
|
|
1204
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1205
|
+
};
|
|
826
1206
|
}
|
|
827
1207
|
}
|
|
828
1208
|
/**
|
|
829
1209
|
* Updates file content for a submodel element at a specified path
|
|
1210
|
+
*
|
|
1211
|
+
* @param options Object containing:
|
|
1212
|
+
* - configuration: The http request options
|
|
1213
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1214
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1215
|
+
* - fileName?: Name of the uploaded file
|
|
1216
|
+
* - file?: File content
|
|
1217
|
+
*
|
|
1218
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
830
1219
|
*/
|
|
831
1220
|
async putFileByPath(options) {
|
|
832
1221
|
const { configuration, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
833
1222
|
try {
|
|
834
1223
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
835
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
836
|
-
const
|
|
1224
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1225
|
+
const response = await apiInstance.putFileByPathSubmodelRepoRaw({
|
|
837
1226
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
838
1227
|
idShortPath: idShortPath,
|
|
839
1228
|
fileName: fileName,
|
|
840
1229
|
file: file,
|
|
841
1230
|
});
|
|
842
|
-
|
|
1231
|
+
const result = await response.value();
|
|
1232
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
843
1233
|
}
|
|
844
1234
|
catch (err) {
|
|
845
1235
|
const customError = await handleApiError(err);
|
|
846
|
-
return {
|
|
1236
|
+
return {
|
|
1237
|
+
success: false,
|
|
1238
|
+
error: customError,
|
|
1239
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1240
|
+
};
|
|
847
1241
|
}
|
|
848
1242
|
}
|
|
849
1243
|
/**
|
|
850
1244
|
* Deletes file content of an existing submodel element at a specified path
|
|
1245
|
+
*
|
|
1246
|
+
* @param options Object containing:
|
|
1247
|
+
* - configuration: The http request options
|
|
1248
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1249
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1250
|
+
*
|
|
1251
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
851
1252
|
*/
|
|
852
1253
|
async deleteFileByPath(options) {
|
|
853
1254
|
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
854
1255
|
try {
|
|
855
1256
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
856
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
857
|
-
const
|
|
1257
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1258
|
+
const response = await apiInstance.deleteFileByPathSubmodelRepoRaw({
|
|
858
1259
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
859
1260
|
idShortPath: idShortPath,
|
|
860
1261
|
});
|
|
861
|
-
|
|
1262
|
+
const result = await response.value();
|
|
1263
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
862
1264
|
}
|
|
863
1265
|
catch (err) {
|
|
864
1266
|
const customError = await handleApiError(err);
|
|
865
|
-
return {
|
|
1267
|
+
return {
|
|
1268
|
+
success: false,
|
|
1269
|
+
error: customError,
|
|
1270
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1271
|
+
};
|
|
866
1272
|
}
|
|
867
1273
|
}
|
|
868
1274
|
/**
|
|
@@ -881,18 +1287,23 @@ export class SubmodelRepositoryClient {
|
|
|
881
1287
|
const { configuration, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
882
1288
|
try {
|
|
883
1289
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
884
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
885
|
-
const
|
|
1290
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1291
|
+
const response = await apiInstance.invokeOperationSubmodelRepoRaw({
|
|
886
1292
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
887
1293
|
idShortPath: idShortPath,
|
|
888
1294
|
operationRequest: operationRequest,
|
|
889
1295
|
//async: async,
|
|
890
1296
|
});
|
|
891
|
-
|
|
1297
|
+
const result = await response.value();
|
|
1298
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
892
1299
|
}
|
|
893
1300
|
catch (err) {
|
|
894
1301
|
const customError = await handleApiError(err);
|
|
895
|
-
return {
|
|
1302
|
+
return {
|
|
1303
|
+
success: false,
|
|
1304
|
+
error: customError,
|
|
1305
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1306
|
+
};
|
|
896
1307
|
}
|
|
897
1308
|
}
|
|
898
1309
|
/**
|
|
@@ -911,19 +1322,24 @@ export class SubmodelRepositoryClient {
|
|
|
911
1322
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
912
1323
|
try {
|
|
913
1324
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
914
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
915
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
916
|
-
const
|
|
1325
|
+
const encodedAasIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1326
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1327
|
+
const response = await apiInstance.invokeOperationValueOnlyRaw({
|
|
917
1328
|
aasIdentifier: encodedAasIdentifier,
|
|
918
1329
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
919
1330
|
idShortPath: idShortPath,
|
|
920
1331
|
operationRequestValueOnly: operationRequestValueOnly,
|
|
921
1332
|
});
|
|
922
|
-
|
|
1333
|
+
const result = await response.value();
|
|
1334
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
923
1335
|
}
|
|
924
1336
|
catch (err) {
|
|
925
1337
|
const customError = await handleApiError(err);
|
|
926
|
-
return {
|
|
1338
|
+
return {
|
|
1339
|
+
success: false,
|
|
1340
|
+
error: customError,
|
|
1341
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1342
|
+
};
|
|
927
1343
|
}
|
|
928
1344
|
}
|
|
929
1345
|
/**
|
|
@@ -941,17 +1357,22 @@ export class SubmodelRepositoryClient {
|
|
|
941
1357
|
const { configuration, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
942
1358
|
try {
|
|
943
1359
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
944
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
945
|
-
const
|
|
1360
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1361
|
+
const response = await apiInstance.invokeOperationAsyncRaw({
|
|
946
1362
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
947
1363
|
idShortPath: idShortPath,
|
|
948
1364
|
operationRequest: operationRequest,
|
|
949
1365
|
});
|
|
950
|
-
|
|
1366
|
+
const result = await response.value();
|
|
1367
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
951
1368
|
}
|
|
952
1369
|
catch (err) {
|
|
953
1370
|
const customError = await handleApiError(err);
|
|
954
|
-
return {
|
|
1371
|
+
return {
|
|
1372
|
+
success: false,
|
|
1373
|
+
error: customError,
|
|
1374
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1375
|
+
};
|
|
955
1376
|
}
|
|
956
1377
|
}
|
|
957
1378
|
/**
|
|
@@ -970,113 +1391,180 @@ export class SubmodelRepositoryClient {
|
|
|
970
1391
|
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
971
1392
|
try {
|
|
972
1393
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
973
|
-
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
974
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
975
|
-
const
|
|
1394
|
+
const encodedAasIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(aasIdentifier, 'aasIdentifier'));
|
|
1395
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1396
|
+
const response = await apiInstance.invokeOperationAsyncValueOnlyRaw({
|
|
976
1397
|
aasIdentifier: encodedAasIdentifier,
|
|
977
1398
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
978
1399
|
idShortPath: idShortPath,
|
|
979
1400
|
operationRequestValueOnly: operationRequestValueOnly,
|
|
980
1401
|
});
|
|
981
|
-
|
|
1402
|
+
const result = await response.value();
|
|
1403
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
982
1404
|
}
|
|
983
1405
|
catch (err) {
|
|
984
1406
|
const customError = await handleApiError(err);
|
|
985
|
-
return {
|
|
1407
|
+
return {
|
|
1408
|
+
success: false,
|
|
1409
|
+
error: customError,
|
|
1410
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1411
|
+
};
|
|
986
1412
|
}
|
|
987
1413
|
}
|
|
988
1414
|
/**
|
|
989
1415
|
* Returns status of an asynchronously invoked operation
|
|
1416
|
+
*
|
|
1417
|
+
* @param options Object containing:
|
|
1418
|
+
* - configuration: The http request options
|
|
1419
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1420
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1421
|
+
* - handleId: Identifier of the asynchronous invocation handle
|
|
1422
|
+
*
|
|
1423
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
990
1424
|
*/
|
|
991
1425
|
async getOperationAsyncStatus(options) {
|
|
992
1426
|
const { configuration, submodelIdentifier, idShortPath, handleId } = options;
|
|
993
1427
|
try {
|
|
994
1428
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
995
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
996
|
-
const
|
|
1429
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1430
|
+
const response = await apiInstance.getOperationAsyncStatusRaw({
|
|
997
1431
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
998
1432
|
idShortPath: idShortPath,
|
|
999
1433
|
handleId: handleId,
|
|
1000
1434
|
});
|
|
1001
|
-
|
|
1435
|
+
const result = await response.value();
|
|
1436
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1002
1437
|
}
|
|
1003
1438
|
catch (err) {
|
|
1004
1439
|
const customError = await handleApiError(err);
|
|
1005
|
-
return {
|
|
1440
|
+
return {
|
|
1441
|
+
success: false,
|
|
1442
|
+
error: customError,
|
|
1443
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1444
|
+
};
|
|
1006
1445
|
}
|
|
1007
1446
|
}
|
|
1008
1447
|
/**
|
|
1009
1448
|
* Returns result of an asynchronously invoked operation
|
|
1449
|
+
*
|
|
1450
|
+
* @param options Object containing:
|
|
1451
|
+
* - configuration: The http request options
|
|
1452
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1453
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1454
|
+
* - handleId: Identifier of the asynchronous invocation handle
|
|
1455
|
+
*
|
|
1456
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1010
1457
|
*/
|
|
1011
1458
|
async getOperationAsyncResult(options) {
|
|
1012
1459
|
const { configuration, submodelIdentifier, idShortPath, handleId } = options;
|
|
1013
1460
|
try {
|
|
1014
1461
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
1015
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1016
|
-
const
|
|
1462
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1463
|
+
const response = await apiInstance.getOperationAsyncResultRaw({
|
|
1017
1464
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1018
1465
|
idShortPath: idShortPath,
|
|
1019
1466
|
handleId: handleId,
|
|
1020
1467
|
});
|
|
1021
|
-
|
|
1468
|
+
const result = await response.value();
|
|
1469
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1022
1470
|
}
|
|
1023
1471
|
catch (err) {
|
|
1024
1472
|
const customError = await handleApiError(err);
|
|
1025
|
-
return {
|
|
1473
|
+
return {
|
|
1474
|
+
success: false,
|
|
1475
|
+
error: customError,
|
|
1476
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1477
|
+
};
|
|
1026
1478
|
}
|
|
1027
1479
|
}
|
|
1028
1480
|
/**
|
|
1029
1481
|
* Returns result of an asynchronously invoked operation in value-only representation
|
|
1482
|
+
*
|
|
1483
|
+
* @param options Object containing:
|
|
1484
|
+
* - configuration: The http request options
|
|
1485
|
+
* - submodelIdentifier: The Submodel's unique id
|
|
1486
|
+
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
1487
|
+
* - handleId: Identifier of the asynchronous invocation handle
|
|
1488
|
+
*
|
|
1489
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1030
1490
|
*/
|
|
1031
1491
|
async getOperationAsyncResultValueOnly(options) {
|
|
1032
1492
|
const { configuration, submodelIdentifier, idShortPath, handleId } = options;
|
|
1033
1493
|
try {
|
|
1034
1494
|
const apiInstance = new SubmodelRepositoryService.SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
1035
|
-
const encodedSubmodelIdentifier = base64Encode(submodelIdentifier);
|
|
1036
|
-
const
|
|
1495
|
+
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, 'submodelIdentifier'));
|
|
1496
|
+
const response = await apiInstance.getOperationAsyncResultValueOnlyRaw({
|
|
1037
1497
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
1038
1498
|
idShortPath: idShortPath,
|
|
1039
1499
|
handleId: handleId,
|
|
1040
1500
|
});
|
|
1041
|
-
|
|
1501
|
+
const result = await response.value();
|
|
1502
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1042
1503
|
}
|
|
1043
1504
|
catch (err) {
|
|
1044
1505
|
const customError = await handleApiError(err);
|
|
1045
|
-
return {
|
|
1506
|
+
return {
|
|
1507
|
+
success: false,
|
|
1508
|
+
error: customError,
|
|
1509
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1510
|
+
};
|
|
1046
1511
|
}
|
|
1047
1512
|
}
|
|
1048
1513
|
/**
|
|
1049
1514
|
* Returns an appropriate serialization based on the specified format
|
|
1515
|
+
*
|
|
1516
|
+
* @param options Object containing:
|
|
1517
|
+
* - configuration: The http request options
|
|
1518
|
+
* - aasIds?: Asset Administration Shell IDs
|
|
1519
|
+
* - submodelIds?: Submodel IDs
|
|
1520
|
+
* - includeConceptDescriptions?: Whether to include referenced ConceptDescriptions in the serialization result
|
|
1521
|
+
*
|
|
1522
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1050
1523
|
*/
|
|
1051
1524
|
async generateSerializationByIds(options) {
|
|
1052
1525
|
const { configuration, aasIds, submodelIds, includeConceptDescriptions } = options;
|
|
1053
1526
|
try {
|
|
1054
1527
|
const apiInstance = new SubmodelRepositoryService.SerializationAPIApi(applyDefaults(configuration));
|
|
1055
|
-
const
|
|
1528
|
+
const response = await apiInstance.generateSerializationByIdsRaw({
|
|
1056
1529
|
aasIds: aasIds,
|
|
1057
1530
|
submodelIds: submodelIds,
|
|
1058
1531
|
includeConceptDescriptions: includeConceptDescriptions,
|
|
1059
1532
|
});
|
|
1060
|
-
|
|
1533
|
+
const result = await response.value();
|
|
1534
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1061
1535
|
}
|
|
1062
1536
|
catch (err) {
|
|
1063
1537
|
const customError = await handleApiError(err);
|
|
1064
|
-
return {
|
|
1538
|
+
return {
|
|
1539
|
+
success: false,
|
|
1540
|
+
error: customError,
|
|
1541
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1542
|
+
};
|
|
1065
1543
|
}
|
|
1066
1544
|
}
|
|
1067
1545
|
/**
|
|
1068
1546
|
* Returns the self-describing information of a network resource (ServiceDescription)
|
|
1547
|
+
*
|
|
1548
|
+
* @param options Object containing:
|
|
1549
|
+
* - configuration: The http request options
|
|
1550
|
+
*
|
|
1551
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
1069
1552
|
*/
|
|
1070
1553
|
async getSelfDescription(options) {
|
|
1071
1554
|
const { configuration } = options;
|
|
1072
1555
|
try {
|
|
1073
1556
|
const apiInstance = new SubmodelRepositoryService.DescriptionAPIApi(applyDefaults(configuration));
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1557
|
+
const response = await apiInstance.getSelfDescriptionRaw();
|
|
1558
|
+
const result = await response.value();
|
|
1559
|
+
return { success: true, data: result, statusCode: response.raw.status };
|
|
1076
1560
|
}
|
|
1077
1561
|
catch (err) {
|
|
1078
1562
|
const customError = await handleApiError(err);
|
|
1079
|
-
return {
|
|
1563
|
+
return {
|
|
1564
|
+
success: false,
|
|
1565
|
+
error: customError,
|
|
1566
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
1567
|
+
};
|
|
1080
1568
|
}
|
|
1081
1569
|
}
|
|
1082
1570
|
}
|