basyx-typescript-sdk 2.2.5 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/bundle/index.cjs +1181 -511
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +1181 -511
- package/bundle/index.mjs.map +1 -1
- package/dist/clients/AasDiscoveryClient.d.ts +9 -3
- package/dist/clients/AasDiscoveryClient.js +28 -9
- package/dist/clients/AasRegistryClient.d.ts +28 -8
- package/dist/clients/AasRegistryClient.js +63 -21
- package/dist/clients/AasRepositoryClient.d.ts +170 -56
- package/dist/clients/AasRepositoryClient.js +385 -136
- package/dist/clients/AasxFileClient.d.ts +11 -3
- package/dist/clients/AasxFileClient.js +27 -11
- package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +11 -3
- package/dist/clients/ConceptDescriptionRepositoryClient.js +40 -12
- package/dist/clients/SubmodelRegistryClient.d.ts +11 -3
- package/dist/clients/SubmodelRegistryClient.js +28 -8
- package/dist/clients/SubmodelRepositoryClient.d.ts +108 -34
- package/dist/clients/SubmodelRepositoryClient.js +262 -106
- package/dist/lib/apiConfig.d.ts +2 -1
- package/dist/lib/apiConfig.js +27 -2
- package/dist/lib/conditionalRequests.d.ts +28 -0
- package/dist/lib/conditionalRequests.js +55 -0
- package/dist/models/api.d.ts +38 -2
- package/dist/services/AasService.d.ts +13 -3
- package/dist/services/AasService.js +45 -7
- package/dist/services/SubmodelService.d.ts +13 -3
- package/dist/services/SubmodelService.js +49 -7
- package/package.json +1 -1
package/bundle/index.mjs
CHANGED
|
@@ -5062,7 +5062,7 @@ var AasxFileService_exports = /* @__PURE__ */ __exportAll({
|
|
|
5062
5062
|
});
|
|
5063
5063
|
//#endregion
|
|
5064
5064
|
//#region dist/lib/apiConfig.js
|
|
5065
|
-
function applyDefaults(configuration) {
|
|
5065
|
+
function applyDefaults(configuration, conditionalHeaders) {
|
|
5066
5066
|
const options = {
|
|
5067
5067
|
basePath: configuration.basePath || void 0,
|
|
5068
5068
|
fetchApi: configuration.fetchApi || getDefaultFetchApi(),
|
|
@@ -5072,7 +5072,7 @@ function applyDefaults(configuration) {
|
|
|
5072
5072
|
password: configuration.password || void 0,
|
|
5073
5073
|
apiKey: configuration.apiKey || void 0,
|
|
5074
5074
|
accessToken: configuration.accessToken || void 0,
|
|
5075
|
-
headers: configuration.headers || void 0,
|
|
5075
|
+
headers: withConditionalHeaders(configuration.headers || void 0, conditionalHeaders),
|
|
5076
5076
|
credentials: configuration.credentials || void 0
|
|
5077
5077
|
};
|
|
5078
5078
|
const ConfigurationCtor = configuration.constructor;
|
|
@@ -5081,6 +5081,23 @@ function applyDefaults(configuration) {
|
|
|
5081
5081
|
function getDefaultFetchApi() {
|
|
5082
5082
|
return fetch.bind(globalThis);
|
|
5083
5083
|
}
|
|
5084
|
+
/**
|
|
5085
|
+
* Adds `If-Match` and `If-None-Match` to the configured headers. A passed condition replaces a configured header of
|
|
5086
|
+
* the same name regardless of its case; without conditions the configured headers are returned unchanged.
|
|
5087
|
+
*/
|
|
5088
|
+
function withConditionalHeaders(headers, conditionalHeaders) {
|
|
5089
|
+
const conditions = {
|
|
5090
|
+
"If-Match": conditionalHeaders?.ifMatch,
|
|
5091
|
+
"If-None-Match": conditionalHeaders?.ifNoneMatch
|
|
5092
|
+
};
|
|
5093
|
+
const names = Object.keys(conditions).filter((name) => conditions[name]);
|
|
5094
|
+
if (names.length === 0) return headers;
|
|
5095
|
+
const lowerCaseNames = names.map((name) => name.toLowerCase());
|
|
5096
|
+
const merged = {};
|
|
5097
|
+
for (const [name, value] of Object.entries(headers ?? {})) if (!lowerCaseNames.includes(name.toLowerCase())) merged[name] = value;
|
|
5098
|
+
for (const name of names) merged[name] = conditions[name];
|
|
5099
|
+
return merged;
|
|
5100
|
+
}
|
|
5084
5101
|
//#endregion
|
|
5085
5102
|
//#region dist/lib/base64Url.js
|
|
5086
5103
|
/**
|
|
@@ -5138,6 +5155,58 @@ function base64Decode(urlSafeBase64String) {
|
|
|
5138
5155
|
}
|
|
5139
5156
|
}
|
|
5140
5157
|
//#endregion
|
|
5158
|
+
//#region dist/lib/conditionalRequests.js
|
|
5159
|
+
function getErrorResponse(err) {
|
|
5160
|
+
return err?.response;
|
|
5161
|
+
}
|
|
5162
|
+
/**
|
|
5163
|
+
* Returns the `ETag` header of a response, or `undefined` if the server sent none.
|
|
5164
|
+
* The entity tag is opaque and returned unchanged.
|
|
5165
|
+
*/
|
|
5166
|
+
function getEtag(response) {
|
|
5167
|
+
const headers = response?.headers;
|
|
5168
|
+
if (typeof headers?.get !== "function") return;
|
|
5169
|
+
return headers.get("ETag") ?? void 0;
|
|
5170
|
+
}
|
|
5171
|
+
/**
|
|
5172
|
+
* Returns the conditional request fields of a failed request: the `ETag` of the error response and the flags for
|
|
5173
|
+
* `412 Precondition Failed` and `428 Precondition Required`. Fields that do not apply are omitted.
|
|
5174
|
+
*/
|
|
5175
|
+
function getConditionalErrorFields(err) {
|
|
5176
|
+
const response = getErrorResponse(err);
|
|
5177
|
+
const etag = getEtag(response);
|
|
5178
|
+
return {
|
|
5179
|
+
...etag !== void 0 && { etag },
|
|
5180
|
+
...response?.status === 412 && { preconditionFailed: true },
|
|
5181
|
+
...response?.status === 428 && { preconditionRequired: true }
|
|
5182
|
+
};
|
|
5183
|
+
}
|
|
5184
|
+
/**
|
|
5185
|
+
* Returns the conditional request fields of a failed {@link ApiResult}, so that a composite operation can pass them on.
|
|
5186
|
+
*/
|
|
5187
|
+
function pickConditionalErrorFields(result) {
|
|
5188
|
+
return {
|
|
5189
|
+
...result.etag !== void 0 && { etag: result.etag },
|
|
5190
|
+
...result.preconditionFailed && { preconditionFailed: true },
|
|
5191
|
+
...result.preconditionRequired && { preconditionRequired: true }
|
|
5192
|
+
};
|
|
5193
|
+
}
|
|
5194
|
+
/**
|
|
5195
|
+
* Returns the {@link NotModifiedResult} for a `304 Not Modified` answer to a read with `ifNoneMatch`, or `undefined`
|
|
5196
|
+
* for any other error.
|
|
5197
|
+
*/
|
|
5198
|
+
function getNotModifiedResult(err, ifNoneMatch) {
|
|
5199
|
+
const response = getErrorResponse(err);
|
|
5200
|
+
if (!ifNoneMatch || response?.status !== 304) return;
|
|
5201
|
+
const etag = getEtag(response);
|
|
5202
|
+
return {
|
|
5203
|
+
success: true,
|
|
5204
|
+
notModified: true,
|
|
5205
|
+
statusCode: 304,
|
|
5206
|
+
...etag !== void 0 && { etag }
|
|
5207
|
+
};
|
|
5208
|
+
}
|
|
5209
|
+
//#endregion
|
|
5141
5210
|
//#region node_modules/.pnpm/@aas-core-works+aas-core3.1-typescript@1.0.0/node_modules/@aas-core-works/aas-core3.1-typescript/dist/lib/esm/common.js
|
|
5142
5211
|
/**
|
|
5143
5212
|
* Provide common functions shared among the modules.
|
|
@@ -25995,7 +26064,10 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
25995
26064
|
const { configuration, assetIds, limit, cursor } = options;
|
|
25996
26065
|
try {
|
|
25997
26066
|
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
25998
|
-
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify(
|
|
26067
|
+
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify({
|
|
26068
|
+
name: id.name,
|
|
26069
|
+
value: id.value
|
|
26070
|
+
})));
|
|
25999
26071
|
const response = await apiInstance.getAllAssetAdministrationShellIdsByAssetLinkRaw({
|
|
26000
26072
|
assetIds: encodedAssetIds,
|
|
26001
26073
|
limit,
|
|
@@ -26009,14 +26081,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26009
26081
|
pagedResult: result.paging_metadata,
|
|
26010
26082
|
result: shellIds
|
|
26011
26083
|
},
|
|
26012
|
-
statusCode: response.raw.status
|
|
26084
|
+
statusCode: response.raw.status,
|
|
26085
|
+
etag: getEtag(response.raw)
|
|
26013
26086
|
};
|
|
26014
26087
|
} catch (err) {
|
|
26015
26088
|
const customError = await handleApiError(err);
|
|
26016
26089
|
return {
|
|
26017
26090
|
success: false,
|
|
26018
26091
|
error: customError,
|
|
26019
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26092
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26093
|
+
...getConditionalErrorFields(err)
|
|
26020
26094
|
};
|
|
26021
26095
|
}
|
|
26022
26096
|
}
|
|
@@ -26027,13 +26101,14 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26027
26101
|
* - configuration: The http request options.
|
|
26028
26102
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
26029
26103
|
* - specificAssetId: A set of specific asset identifiers
|
|
26104
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26030
26105
|
*
|
|
26031
26106
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26032
26107
|
*/
|
|
26033
26108
|
async postAllAssetLinksById(options) {
|
|
26034
|
-
const { configuration, aasIdentifier, specificAssetId } = options;
|
|
26109
|
+
const { configuration, aasIdentifier, specificAssetId, ifMatch } = options;
|
|
26035
26110
|
try {
|
|
26036
|
-
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
26111
|
+
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26037
26112
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
26038
26113
|
const response = await apiInstance.postAllAssetLinksByIdRaw({
|
|
26039
26114
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26042,14 +26117,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26042
26117
|
return {
|
|
26043
26118
|
success: true,
|
|
26044
26119
|
data: (await response.value()).map(convertApiAssetIdToCoreAssetId),
|
|
26045
|
-
statusCode: response.raw.status
|
|
26120
|
+
statusCode: response.raw.status,
|
|
26121
|
+
etag: getEtag(response.raw)
|
|
26046
26122
|
};
|
|
26047
26123
|
} catch (err) {
|
|
26048
26124
|
const customError = await handleApiError(err);
|
|
26049
26125
|
return {
|
|
26050
26126
|
success: false,
|
|
26051
26127
|
error: customError,
|
|
26052
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26128
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26129
|
+
...getConditionalErrorFields(err)
|
|
26053
26130
|
};
|
|
26054
26131
|
}
|
|
26055
26132
|
}
|
|
@@ -26059,26 +26136,29 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26059
26136
|
* @param options Object containing:
|
|
26060
26137
|
* - configuration: The http request options
|
|
26061
26138
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
26139
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26062
26140
|
*
|
|
26063
26141
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26064
26142
|
*/
|
|
26065
26143
|
async deleteAllAssetLinksById(options) {
|
|
26066
|
-
const { configuration, aasIdentifier } = options;
|
|
26144
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
26067
26145
|
try {
|
|
26068
|
-
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
26146
|
+
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26069
26147
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
26070
26148
|
const response = await apiInstance.deleteAllAssetLinksByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26071
26149
|
return {
|
|
26072
26150
|
success: true,
|
|
26073
26151
|
data: await response.value(),
|
|
26074
|
-
statusCode: response.raw.status
|
|
26152
|
+
statusCode: response.raw.status,
|
|
26153
|
+
etag: getEtag(response.raw)
|
|
26075
26154
|
};
|
|
26076
26155
|
} catch (err) {
|
|
26077
26156
|
const customError = await handleApiError(err);
|
|
26078
26157
|
return {
|
|
26079
26158
|
success: false,
|
|
26080
26159
|
error: customError,
|
|
26081
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26160
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26161
|
+
...getConditionalErrorFields(err)
|
|
26082
26162
|
};
|
|
26083
26163
|
}
|
|
26084
26164
|
}
|
|
@@ -26088,26 +26168,31 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26088
26168
|
* @param options Object containing:
|
|
26089
26169
|
* - configuration: The http request options
|
|
26090
26170
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
26171
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26091
26172
|
*
|
|
26092
26173
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26093
26174
|
*/
|
|
26094
26175
|
async getAllAssetLinksById(options) {
|
|
26095
|
-
const { configuration, aasIdentifier } = options;
|
|
26176
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
26096
26177
|
try {
|
|
26097
|
-
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
26178
|
+
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26098
26179
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
26099
26180
|
const response = await apiInstance.getAllAssetLinksByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26100
26181
|
return {
|
|
26101
26182
|
success: true,
|
|
26102
26183
|
data: (await response.value()).map(convertApiAssetIdToCoreAssetId),
|
|
26103
|
-
statusCode: response.raw.status
|
|
26184
|
+
statusCode: response.raw.status,
|
|
26185
|
+
etag: getEtag(response.raw)
|
|
26104
26186
|
};
|
|
26105
26187
|
} catch (err) {
|
|
26188
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26189
|
+
if (notModified) return notModified;
|
|
26106
26190
|
const customError = await handleApiError(err);
|
|
26107
26191
|
return {
|
|
26108
26192
|
success: false,
|
|
26109
26193
|
error: customError,
|
|
26110
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26194
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26195
|
+
...getConditionalErrorFields(err)
|
|
26111
26196
|
};
|
|
26112
26197
|
}
|
|
26113
26198
|
}
|
|
@@ -26141,14 +26226,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26141
26226
|
pagedResult: result.paging_metadata,
|
|
26142
26227
|
result: shellIds
|
|
26143
26228
|
},
|
|
26144
|
-
statusCode: response.raw.status
|
|
26229
|
+
statusCode: response.raw.status,
|
|
26230
|
+
etag: getEtag(response.raw)
|
|
26145
26231
|
};
|
|
26146
26232
|
} catch (err) {
|
|
26147
26233
|
const customError = await handleApiError(err);
|
|
26148
26234
|
return {
|
|
26149
26235
|
success: false,
|
|
26150
26236
|
error: customError,
|
|
26151
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26237
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26238
|
+
...getConditionalErrorFields(err)
|
|
26152
26239
|
};
|
|
26153
26240
|
}
|
|
26154
26241
|
}
|
|
@@ -26167,14 +26254,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26167
26254
|
return {
|
|
26168
26255
|
success: true,
|
|
26169
26256
|
data: await response.value(),
|
|
26170
|
-
statusCode: response.raw.status
|
|
26257
|
+
statusCode: response.raw.status,
|
|
26258
|
+
etag: getEtag(response.raw)
|
|
26171
26259
|
};
|
|
26172
26260
|
} catch (err) {
|
|
26173
26261
|
const customError = await handleApiError(err);
|
|
26174
26262
|
return {
|
|
26175
26263
|
success: false,
|
|
26176
26264
|
error: customError,
|
|
26177
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26265
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26266
|
+
...getConditionalErrorFields(err)
|
|
26178
26267
|
};
|
|
26179
26268
|
}
|
|
26180
26269
|
}
|
|
@@ -26463,14 +26552,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26463
26552
|
pagedResult: result.paging_metadata,
|
|
26464
26553
|
result: aasDescriptors
|
|
26465
26554
|
},
|
|
26466
|
-
statusCode: response.raw.status
|
|
26555
|
+
statusCode: response.raw.status,
|
|
26556
|
+
etag: getEtag(response.raw)
|
|
26467
26557
|
};
|
|
26468
26558
|
} catch (err) {
|
|
26469
26559
|
const customError = await handleApiError(err);
|
|
26470
26560
|
return {
|
|
26471
26561
|
success: false,
|
|
26472
26562
|
error: customError,
|
|
26473
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26563
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26564
|
+
...getConditionalErrorFields(err)
|
|
26474
26565
|
};
|
|
26475
26566
|
}
|
|
26476
26567
|
}
|
|
@@ -26490,14 +26581,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26490
26581
|
return {
|
|
26491
26582
|
success: true,
|
|
26492
26583
|
data: convertApiAasDescriptorToCoreAasDescriptor(await response.value()),
|
|
26493
|
-
statusCode: response.raw.status
|
|
26584
|
+
statusCode: response.raw.status,
|
|
26585
|
+
etag: getEtag(response.raw)
|
|
26494
26586
|
};
|
|
26495
26587
|
} catch (err) {
|
|
26496
26588
|
const customError = await handleApiError(err);
|
|
26497
26589
|
return {
|
|
26498
26590
|
success: false,
|
|
26499
26591
|
error: customError,
|
|
26500
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26592
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26593
|
+
...getConditionalErrorFields(err)
|
|
26501
26594
|
};
|
|
26502
26595
|
}
|
|
26503
26596
|
}
|
|
@@ -26507,26 +26600,29 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26507
26600
|
* @param options Object containing:
|
|
26508
26601
|
* - configuration: The http request options
|
|
26509
26602
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26603
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26510
26604
|
*
|
|
26511
26605
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26512
26606
|
*/
|
|
26513
26607
|
async deleteAssetAdministrationShellDescriptorById(options) {
|
|
26514
|
-
const { configuration, aasIdentifier } = options;
|
|
26608
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
26515
26609
|
try {
|
|
26516
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26610
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26517
26611
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26518
26612
|
const response = await apiInstance.deleteAssetAdministrationShellDescriptorByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26519
26613
|
return {
|
|
26520
26614
|
success: true,
|
|
26521
26615
|
data: await response.value(),
|
|
26522
|
-
statusCode: response.raw.status
|
|
26616
|
+
statusCode: response.raw.status,
|
|
26617
|
+
etag: getEtag(response.raw)
|
|
26523
26618
|
};
|
|
26524
26619
|
} catch (err) {
|
|
26525
26620
|
const customError = await handleApiError(err);
|
|
26526
26621
|
return {
|
|
26527
26622
|
success: false,
|
|
26528
26623
|
error: customError,
|
|
26529
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26624
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26625
|
+
...getConditionalErrorFields(err)
|
|
26530
26626
|
};
|
|
26531
26627
|
}
|
|
26532
26628
|
}
|
|
@@ -26536,26 +26632,31 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26536
26632
|
* @param options Object containing:
|
|
26537
26633
|
* - configuration: The http request options
|
|
26538
26634
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26635
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26539
26636
|
*
|
|
26540
26637
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26541
26638
|
*/
|
|
26542
26639
|
async getAssetAdministrationShellDescriptorById(options) {
|
|
26543
|
-
const { configuration, aasIdentifier } = options;
|
|
26640
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
26544
26641
|
try {
|
|
26545
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26642
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26546
26643
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26547
26644
|
const response = await apiInstance.getAssetAdministrationShellDescriptorByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26548
26645
|
return {
|
|
26549
26646
|
success: true,
|
|
26550
26647
|
data: convertApiAasDescriptorToCoreAasDescriptor(await response.value()),
|
|
26551
|
-
statusCode: response.raw.status
|
|
26648
|
+
statusCode: response.raw.status,
|
|
26649
|
+
etag: getEtag(response.raw)
|
|
26552
26650
|
};
|
|
26553
26651
|
} catch (err) {
|
|
26652
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26653
|
+
if (notModified) return notModified;
|
|
26554
26654
|
const customError = await handleApiError(err);
|
|
26555
26655
|
return {
|
|
26556
26656
|
success: false,
|
|
26557
26657
|
error: customError,
|
|
26558
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26658
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26659
|
+
...getConditionalErrorFields(err)
|
|
26559
26660
|
};
|
|
26560
26661
|
}
|
|
26561
26662
|
}
|
|
@@ -26566,13 +26667,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26566
26667
|
* - configuration: The http request options
|
|
26567
26668
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26568
26669
|
* - assetAdministrationShellDescriptor: Asset Administration Shell Descriptor object
|
|
26670
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26671
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
26569
26672
|
*
|
|
26570
26673
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26571
26674
|
*/
|
|
26572
26675
|
async putAssetAdministrationShellDescriptorById(options) {
|
|
26573
|
-
const { configuration, aasIdentifier, assetAdministrationShellDescriptor } = options;
|
|
26676
|
+
const { configuration, aasIdentifier, assetAdministrationShellDescriptor, ifMatch, ifNoneMatch } = options;
|
|
26574
26677
|
try {
|
|
26575
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration
|
|
26678
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, {
|
|
26679
|
+
ifMatch,
|
|
26680
|
+
ifNoneMatch
|
|
26681
|
+
}));
|
|
26576
26682
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26577
26683
|
const response = await apiInstance.putAssetAdministrationShellDescriptorByIdRaw({
|
|
26578
26684
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26581,20 +26687,23 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26581
26687
|
if (response.raw.status === 204) return {
|
|
26582
26688
|
success: true,
|
|
26583
26689
|
data: void 0,
|
|
26584
|
-
statusCode: response.raw.status
|
|
26690
|
+
statusCode: response.raw.status,
|
|
26691
|
+
etag: getEtag(response.raw)
|
|
26585
26692
|
};
|
|
26586
26693
|
const result = await response.value();
|
|
26587
26694
|
return {
|
|
26588
26695
|
success: true,
|
|
26589
26696
|
data: result ? convertApiAasDescriptorToCoreAasDescriptor(result) : void 0,
|
|
26590
|
-
statusCode: response.raw.status
|
|
26697
|
+
statusCode: response.raw.status,
|
|
26698
|
+
etag: getEtag(response.raw)
|
|
26591
26699
|
};
|
|
26592
26700
|
} catch (err) {
|
|
26593
26701
|
const customError = await handleApiError(err);
|
|
26594
26702
|
return {
|
|
26595
26703
|
success: false,
|
|
26596
26704
|
error: customError,
|
|
26597
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26705
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26706
|
+
...getConditionalErrorFields(err)
|
|
26598
26707
|
};
|
|
26599
26708
|
}
|
|
26600
26709
|
}
|
|
@@ -26606,13 +26715,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26606
26715
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26607
26716
|
* - limit?: The maximum number of elements in the response array
|
|
26608
26717
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
26718
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26609
26719
|
*
|
|
26610
26720
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26611
26721
|
*/
|
|
26612
26722
|
async getAllSubmodelDescriptorsThroughSuperpath(options) {
|
|
26613
|
-
const { configuration, aasIdentifier, limit, cursor } = options;
|
|
26723
|
+
const { configuration, aasIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
26614
26724
|
try {
|
|
26615
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26725
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26616
26726
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26617
26727
|
const response = await apiInstance.getAllSubmodelDescriptorsThroughSuperpathRaw({
|
|
26618
26728
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26627,14 +26737,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26627
26737
|
pagedResult: result.paging_metadata,
|
|
26628
26738
|
result: submodelDescriptors
|
|
26629
26739
|
},
|
|
26630
|
-
statusCode: response.raw.status
|
|
26740
|
+
statusCode: response.raw.status,
|
|
26741
|
+
etag: getEtag(response.raw)
|
|
26631
26742
|
};
|
|
26632
26743
|
} catch (err) {
|
|
26744
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26745
|
+
if (notModified) return notModified;
|
|
26633
26746
|
const customError = await handleApiError(err);
|
|
26634
26747
|
return {
|
|
26635
26748
|
success: false,
|
|
26636
26749
|
error: customError,
|
|
26637
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26750
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26751
|
+
...getConditionalErrorFields(err)
|
|
26638
26752
|
};
|
|
26639
26753
|
}
|
|
26640
26754
|
}
|
|
@@ -26645,13 +26759,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26645
26759
|
* - configuration: The http request options.
|
|
26646
26760
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26647
26761
|
* - submodelDescriptor: Submodel Descriptor object
|
|
26762
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26648
26763
|
*
|
|
26649
26764
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26650
26765
|
*/
|
|
26651
26766
|
async postSubmodelDescriptorThroughSuperpath(options) {
|
|
26652
|
-
const { configuration, aasIdentifier, submodelDescriptor } = options;
|
|
26767
|
+
const { configuration, aasIdentifier, submodelDescriptor, ifMatch } = options;
|
|
26653
26768
|
try {
|
|
26654
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26769
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26655
26770
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26656
26771
|
const response = await apiInstance.postSubmodelDescriptorThroughSuperpathRaw({
|
|
26657
26772
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26660,14 +26775,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26660
26775
|
return {
|
|
26661
26776
|
success: true,
|
|
26662
26777
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
26663
|
-
statusCode: response.raw.status
|
|
26778
|
+
statusCode: response.raw.status,
|
|
26779
|
+
etag: getEtag(response.raw)
|
|
26664
26780
|
};
|
|
26665
26781
|
} catch (err) {
|
|
26666
26782
|
const customError = await handleApiError(err);
|
|
26667
26783
|
return {
|
|
26668
26784
|
success: false,
|
|
26669
26785
|
error: customError,
|
|
26670
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26786
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26787
|
+
...getConditionalErrorFields(err)
|
|
26671
26788
|
};
|
|
26672
26789
|
}
|
|
26673
26790
|
}
|
|
@@ -26678,13 +26795,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26678
26795
|
* - configuration: The http request options
|
|
26679
26796
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26680
26797
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
26798
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26681
26799
|
*
|
|
26682
26800
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26683
26801
|
*/
|
|
26684
26802
|
async getSubmodelDescriptorByIdThroughSuperpath(options) {
|
|
26685
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
26803
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifNoneMatch } = options;
|
|
26686
26804
|
try {
|
|
26687
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26805
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26688
26806
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26689
26807
|
const encodedSubmodelIdentifier = base64Encode(AasRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
26690
26808
|
const response = await apiInstance.getSubmodelDescriptorByIdThroughSuperpathRaw({
|
|
@@ -26694,14 +26812,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26694
26812
|
return {
|
|
26695
26813
|
success: true,
|
|
26696
26814
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
26697
|
-
statusCode: response.raw.status
|
|
26815
|
+
statusCode: response.raw.status,
|
|
26816
|
+
etag: getEtag(response.raw)
|
|
26698
26817
|
};
|
|
26699
26818
|
} catch (err) {
|
|
26819
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26820
|
+
if (notModified) return notModified;
|
|
26700
26821
|
const customError = await handleApiError(err);
|
|
26701
26822
|
return {
|
|
26702
26823
|
success: false,
|
|
26703
26824
|
error: customError,
|
|
26704
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26825
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26826
|
+
...getConditionalErrorFields(err)
|
|
26705
26827
|
};
|
|
26706
26828
|
}
|
|
26707
26829
|
}
|
|
@@ -26712,13 +26834,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26712
26834
|
* - configuration: The http request options
|
|
26713
26835
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26714
26836
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
26837
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26715
26838
|
*
|
|
26716
26839
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26717
26840
|
*/
|
|
26718
26841
|
async deleteSubmodelDescriptorByIdThroughSuperpath(options) {
|
|
26719
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
26842
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifMatch } = options;
|
|
26720
26843
|
try {
|
|
26721
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26844
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26722
26845
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26723
26846
|
const encodedSubmodelIdentifier = base64Encode(AasRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
26724
26847
|
const response = await apiInstance.deleteSubmodelDescriptorByIdThroughSuperpathRaw({
|
|
@@ -26728,14 +26851,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26728
26851
|
return {
|
|
26729
26852
|
success: true,
|
|
26730
26853
|
data: await response.value(),
|
|
26731
|
-
statusCode: response.raw.status
|
|
26854
|
+
statusCode: response.raw.status,
|
|
26855
|
+
etag: getEtag(response.raw)
|
|
26732
26856
|
};
|
|
26733
26857
|
} catch (err) {
|
|
26734
26858
|
const customError = await handleApiError(err);
|
|
26735
26859
|
return {
|
|
26736
26860
|
success: false,
|
|
26737
26861
|
error: customError,
|
|
26738
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26862
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26863
|
+
...getConditionalErrorFields(err)
|
|
26739
26864
|
};
|
|
26740
26865
|
}
|
|
26741
26866
|
}
|
|
@@ -26747,13 +26872,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26747
26872
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26748
26873
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
26749
26874
|
* - submodelDescriptor: Submodel Descriptor object
|
|
26875
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26876
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
26750
26877
|
*
|
|
26751
26878
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26752
26879
|
*/
|
|
26753
26880
|
async putSubmodelDescriptorByIdThroughSuperpath(options) {
|
|
26754
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodelDescriptor } = options;
|
|
26881
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelDescriptor, ifMatch, ifNoneMatch } = options;
|
|
26755
26882
|
try {
|
|
26756
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration
|
|
26883
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, {
|
|
26884
|
+
ifMatch,
|
|
26885
|
+
ifNoneMatch
|
|
26886
|
+
}));
|
|
26757
26887
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26758
26888
|
const encodedSubmodelIdentifier = base64Encode(AasRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
26759
26889
|
const response = await apiInstance.putSubmodelDescriptorByIdThroughSuperpathRaw({
|
|
@@ -26764,20 +26894,23 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26764
26894
|
if (response.raw.status === 204) return {
|
|
26765
26895
|
success: true,
|
|
26766
26896
|
data: void 0,
|
|
26767
|
-
statusCode: response.raw.status
|
|
26897
|
+
statusCode: response.raw.status,
|
|
26898
|
+
etag: getEtag(response.raw)
|
|
26768
26899
|
};
|
|
26769
26900
|
const result = await response.value();
|
|
26770
26901
|
return {
|
|
26771
26902
|
success: true,
|
|
26772
26903
|
data: result ? convertApiSubmodelDescriptorToCoreSubmodelDescriptor(result) : void 0,
|
|
26773
|
-
statusCode: response.raw.status
|
|
26904
|
+
statusCode: response.raw.status,
|
|
26905
|
+
etag: getEtag(response.raw)
|
|
26774
26906
|
};
|
|
26775
26907
|
} catch (err) {
|
|
26776
26908
|
const customError = await handleApiError(err);
|
|
26777
26909
|
return {
|
|
26778
26910
|
success: false,
|
|
26779
26911
|
error: customError,
|
|
26780
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26912
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26913
|
+
...getConditionalErrorFields(err)
|
|
26781
26914
|
};
|
|
26782
26915
|
}
|
|
26783
26916
|
}
|
|
@@ -26796,14 +26929,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26796
26929
|
return {
|
|
26797
26930
|
success: true,
|
|
26798
26931
|
data: await response.value(),
|
|
26799
|
-
statusCode: response.raw.status
|
|
26932
|
+
statusCode: response.raw.status,
|
|
26933
|
+
etag: getEtag(response.raw)
|
|
26800
26934
|
};
|
|
26801
26935
|
} catch (err) {
|
|
26802
26936
|
const customError = await handleApiError(err);
|
|
26803
26937
|
return {
|
|
26804
26938
|
success: false,
|
|
26805
26939
|
error: customError,
|
|
26806
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26940
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26941
|
+
...getConditionalErrorFields(err)
|
|
26807
26942
|
};
|
|
26808
26943
|
}
|
|
26809
26944
|
}
|
|
@@ -26996,14 +27131,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
26996
27131
|
pagedResult: result.paging_metadata,
|
|
26997
27132
|
result: shells
|
|
26998
27133
|
},
|
|
26999
|
-
statusCode: response.raw.status
|
|
27134
|
+
statusCode: response.raw.status,
|
|
27135
|
+
etag: getEtag(response.raw)
|
|
27000
27136
|
};
|
|
27001
27137
|
} catch (err) {
|
|
27002
27138
|
const customError = await handleApiError(err);
|
|
27003
27139
|
return {
|
|
27004
27140
|
success: false,
|
|
27005
27141
|
error: customError,
|
|
27006
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27142
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27143
|
+
...getConditionalErrorFields(err)
|
|
27007
27144
|
};
|
|
27008
27145
|
}
|
|
27009
27146
|
}
|
|
@@ -27038,14 +27175,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27038
27175
|
pagedResult: result.paging_metadata,
|
|
27039
27176
|
result: shellReferences
|
|
27040
27177
|
},
|
|
27041
|
-
statusCode: response.raw.status
|
|
27178
|
+
statusCode: response.raw.status,
|
|
27179
|
+
etag: getEtag(response.raw)
|
|
27042
27180
|
};
|
|
27043
27181
|
} catch (err) {
|
|
27044
27182
|
const customError = await handleApiError(err);
|
|
27045
27183
|
return {
|
|
27046
27184
|
success: false,
|
|
27047
27185
|
error: customError,
|
|
27048
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27186
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27187
|
+
...getConditionalErrorFields(err)
|
|
27049
27188
|
};
|
|
27050
27189
|
}
|
|
27051
27190
|
}
|
|
@@ -27065,14 +27204,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27065
27204
|
return {
|
|
27066
27205
|
success: true,
|
|
27067
27206
|
data: convertApiAasToCoreAas(await response.value()),
|
|
27068
|
-
statusCode: response.raw.status
|
|
27207
|
+
statusCode: response.raw.status,
|
|
27208
|
+
etag: getEtag(response.raw)
|
|
27069
27209
|
};
|
|
27070
27210
|
} catch (err) {
|
|
27071
27211
|
const customError = await handleApiError(err);
|
|
27072
27212
|
return {
|
|
27073
27213
|
success: false,
|
|
27074
27214
|
error: customError,
|
|
27075
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27215
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27216
|
+
...getConditionalErrorFields(err)
|
|
27076
27217
|
};
|
|
27077
27218
|
}
|
|
27078
27219
|
}
|
|
@@ -27082,26 +27223,29 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27082
27223
|
* @param options Object containing:
|
|
27083
27224
|
* - configuration: The http request options
|
|
27084
27225
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27226
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27085
27227
|
*
|
|
27086
27228
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27087
27229
|
*/
|
|
27088
27230
|
async deleteAssetAdministrationShellById(options) {
|
|
27089
|
-
const { configuration, aasIdentifier } = options;
|
|
27231
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
27090
27232
|
try {
|
|
27091
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27233
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27092
27234
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27093
27235
|
const response = await apiInstance.deleteAssetAdministrationShellByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27094
27236
|
return {
|
|
27095
27237
|
success: true,
|
|
27096
27238
|
data: await response.value(),
|
|
27097
|
-
statusCode: response.raw.status
|
|
27239
|
+
statusCode: response.raw.status,
|
|
27240
|
+
etag: getEtag(response.raw)
|
|
27098
27241
|
};
|
|
27099
27242
|
} catch (err) {
|
|
27100
27243
|
const customError = await handleApiError(err);
|
|
27101
27244
|
return {
|
|
27102
27245
|
success: false,
|
|
27103
27246
|
error: customError,
|
|
27104
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27247
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27248
|
+
...getConditionalErrorFields(err)
|
|
27105
27249
|
};
|
|
27106
27250
|
}
|
|
27107
27251
|
}
|
|
@@ -27111,26 +27255,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27111
27255
|
* @param options Object containing:
|
|
27112
27256
|
* - configuration: The http request options
|
|
27113
27257
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27258
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27114
27259
|
*
|
|
27115
27260
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27116
27261
|
*/
|
|
27117
27262
|
async getAssetAdministrationShellById(options) {
|
|
27118
|
-
const { configuration, aasIdentifier } = options;
|
|
27263
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27119
27264
|
try {
|
|
27120
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27265
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27121
27266
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27122
27267
|
const response = await apiInstance.getAssetAdministrationShellByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27123
27268
|
return {
|
|
27124
27269
|
success: true,
|
|
27125
27270
|
data: convertApiAasToCoreAas(await response.value()),
|
|
27126
|
-
statusCode: response.raw.status
|
|
27271
|
+
statusCode: response.raw.status,
|
|
27272
|
+
etag: getEtag(response.raw)
|
|
27127
27273
|
};
|
|
27128
27274
|
} catch (err) {
|
|
27275
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27276
|
+
if (notModified) return notModified;
|
|
27129
27277
|
const customError = await handleApiError(err);
|
|
27130
27278
|
return {
|
|
27131
27279
|
success: false,
|
|
27132
27280
|
error: customError,
|
|
27133
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27281
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27282
|
+
...getConditionalErrorFields(err)
|
|
27134
27283
|
};
|
|
27135
27284
|
}
|
|
27136
27285
|
}
|
|
@@ -27141,13 +27290,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27141
27290
|
* - configuration: The http request options
|
|
27142
27291
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27143
27292
|
* - assetAdministrationShell: Asset Administration Shell object
|
|
27293
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27294
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27144
27295
|
*
|
|
27145
27296
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27146
27297
|
*/
|
|
27147
27298
|
async putAssetAdministrationShellById(options) {
|
|
27148
|
-
const { configuration, aasIdentifier, assetAdministrationShell } = options;
|
|
27299
|
+
const { configuration, aasIdentifier, assetAdministrationShell, ifMatch, ifNoneMatch } = options;
|
|
27149
27300
|
try {
|
|
27150
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27301
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27302
|
+
ifMatch,
|
|
27303
|
+
ifNoneMatch
|
|
27304
|
+
}));
|
|
27151
27305
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27152
27306
|
const response = await apiInstance.putAssetAdministrationShellByIdRaw({
|
|
27153
27307
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27156,20 +27310,23 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27156
27310
|
if (response.raw.status === 204) return {
|
|
27157
27311
|
success: true,
|
|
27158
27312
|
data: void 0,
|
|
27159
|
-
statusCode: response.raw.status
|
|
27313
|
+
statusCode: response.raw.status,
|
|
27314
|
+
etag: getEtag(response.raw)
|
|
27160
27315
|
};
|
|
27161
27316
|
const result = await response.value();
|
|
27162
27317
|
return {
|
|
27163
27318
|
success: true,
|
|
27164
27319
|
data: result ? convertApiAasToCoreAas(result) : void 0,
|
|
27165
|
-
statusCode: response.raw.status
|
|
27320
|
+
statusCode: response.raw.status,
|
|
27321
|
+
etag: getEtag(response.raw)
|
|
27166
27322
|
};
|
|
27167
27323
|
} catch (err) {
|
|
27168
27324
|
const customError = await handleApiError(err);
|
|
27169
27325
|
return {
|
|
27170
27326
|
success: false,
|
|
27171
27327
|
error: customError,
|
|
27172
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27328
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27329
|
+
...getConditionalErrorFields(err)
|
|
27173
27330
|
};
|
|
27174
27331
|
}
|
|
27175
27332
|
}
|
|
@@ -27179,26 +27336,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27179
27336
|
* @param options Object containing:
|
|
27180
27337
|
* - configuration: The http request options
|
|
27181
27338
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27339
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27182
27340
|
*
|
|
27183
27341
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27184
27342
|
*/
|
|
27185
27343
|
async getAssetAdministrationShellByIdReferenceAasRepository(options) {
|
|
27186
|
-
const { configuration, aasIdentifier } = options;
|
|
27344
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27187
27345
|
try {
|
|
27188
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27346
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27189
27347
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27190
27348
|
const response = await apiInstance.getAssetAdministrationShellByIdReferenceAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27191
27349
|
return {
|
|
27192
27350
|
success: true,
|
|
27193
27351
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
27194
|
-
statusCode: response.raw.status
|
|
27352
|
+
statusCode: response.raw.status,
|
|
27353
|
+
etag: getEtag(response.raw)
|
|
27195
27354
|
};
|
|
27196
27355
|
} catch (err) {
|
|
27356
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27357
|
+
if (notModified) return notModified;
|
|
27197
27358
|
const customError = await handleApiError(err);
|
|
27198
27359
|
return {
|
|
27199
27360
|
success: false,
|
|
27200
27361
|
error: customError,
|
|
27201
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27362
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27363
|
+
...getConditionalErrorFields(err)
|
|
27202
27364
|
};
|
|
27203
27365
|
}
|
|
27204
27366
|
}
|
|
@@ -27208,26 +27370,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27208
27370
|
* @param options Object containing:
|
|
27209
27371
|
* - configuration: The http request options
|
|
27210
27372
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27373
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27211
27374
|
*
|
|
27212
27375
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27213
27376
|
*/
|
|
27214
27377
|
async getAssetInformationAasRepository(options) {
|
|
27215
|
-
const { configuration, aasIdentifier } = options;
|
|
27378
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27216
27379
|
try {
|
|
27217
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27380
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27218
27381
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27219
27382
|
const response = await apiInstance.getAssetInformationAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27220
27383
|
return {
|
|
27221
27384
|
success: true,
|
|
27222
27385
|
data: convertApiAssetInformationToCoreAssetInformation(await response.value()),
|
|
27223
|
-
statusCode: response.raw.status
|
|
27386
|
+
statusCode: response.raw.status,
|
|
27387
|
+
etag: getEtag(response.raw)
|
|
27224
27388
|
};
|
|
27225
27389
|
} catch (err) {
|
|
27390
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27391
|
+
if (notModified) return notModified;
|
|
27226
27392
|
const customError = await handleApiError(err);
|
|
27227
27393
|
return {
|
|
27228
27394
|
success: false,
|
|
27229
27395
|
error: customError,
|
|
27230
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27396
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27397
|
+
...getConditionalErrorFields(err)
|
|
27231
27398
|
};
|
|
27232
27399
|
}
|
|
27233
27400
|
}
|
|
@@ -27238,13 +27405,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27238
27405
|
* - configuration: The http request options
|
|
27239
27406
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27240
27407
|
* - assetInformation: Asset Information object
|
|
27408
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27409
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27241
27410
|
*
|
|
27242
27411
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27243
27412
|
*/
|
|
27244
27413
|
async putAssetInformationAasRepository(options) {
|
|
27245
|
-
const { configuration, aasIdentifier, assetInformation } = options;
|
|
27414
|
+
const { configuration, aasIdentifier, assetInformation, ifMatch, ifNoneMatch } = options;
|
|
27246
27415
|
try {
|
|
27247
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27416
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27417
|
+
ifMatch,
|
|
27418
|
+
ifNoneMatch
|
|
27419
|
+
}));
|
|
27248
27420
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27249
27421
|
const response = await apiInstance.putAssetInformationAasRepositoryRaw({
|
|
27250
27422
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27253,14 +27425,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27253
27425
|
return {
|
|
27254
27426
|
success: true,
|
|
27255
27427
|
data: await response.value(),
|
|
27256
|
-
statusCode: response.raw.status
|
|
27428
|
+
statusCode: response.raw.status,
|
|
27429
|
+
etag: getEtag(response.raw)
|
|
27257
27430
|
};
|
|
27258
27431
|
} catch (err) {
|
|
27259
27432
|
const customError = await handleApiError(err);
|
|
27260
27433
|
return {
|
|
27261
27434
|
success: false,
|
|
27262
27435
|
error: customError,
|
|
27263
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27436
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27437
|
+
...getConditionalErrorFields(err)
|
|
27264
27438
|
};
|
|
27265
27439
|
}
|
|
27266
27440
|
}
|
|
@@ -27270,31 +27444,35 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27270
27444
|
* @param options Object containing:
|
|
27271
27445
|
* - configuration: The http request options
|
|
27272
27446
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27447
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27273
27448
|
*
|
|
27274
27449
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27275
27450
|
*/
|
|
27276
27451
|
async deleteThumbnailAasRepository(options) {
|
|
27277
|
-
const { configuration, aasIdentifier } = options;
|
|
27452
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
27278
27453
|
try {
|
|
27279
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27454
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27280
27455
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27281
27456
|
const response = await apiInstance.deleteThumbnailAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27282
27457
|
if (response.raw.status === 204) return {
|
|
27283
27458
|
success: true,
|
|
27284
27459
|
data: void 0,
|
|
27285
|
-
statusCode: response.raw.status
|
|
27460
|
+
statusCode: response.raw.status,
|
|
27461
|
+
etag: getEtag(response.raw)
|
|
27286
27462
|
};
|
|
27287
27463
|
return {
|
|
27288
27464
|
success: true,
|
|
27289
27465
|
data: await response.value(),
|
|
27290
|
-
statusCode: response.raw.status
|
|
27466
|
+
statusCode: response.raw.status,
|
|
27467
|
+
etag: getEtag(response.raw)
|
|
27291
27468
|
};
|
|
27292
27469
|
} catch (err) {
|
|
27293
27470
|
const customError = await handleApiError(err);
|
|
27294
27471
|
return {
|
|
27295
27472
|
success: false,
|
|
27296
27473
|
error: customError,
|
|
27297
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27474
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27475
|
+
...getConditionalErrorFields(err)
|
|
27298
27476
|
};
|
|
27299
27477
|
}
|
|
27300
27478
|
}
|
|
@@ -27304,26 +27482,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27304
27482
|
* @param options Object containing:
|
|
27305
27483
|
* - configuration: The http request options
|
|
27306
27484
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27485
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27307
27486
|
*
|
|
27308
27487
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27309
27488
|
*/
|
|
27310
27489
|
async getThumbnailAasRepository(options) {
|
|
27311
|
-
const { configuration, aasIdentifier } = options;
|
|
27490
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27312
27491
|
try {
|
|
27313
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27492
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27314
27493
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27315
27494
|
const response = await apiInstance.getThumbnailAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27316
27495
|
return {
|
|
27317
27496
|
success: true,
|
|
27318
27497
|
data: await response.value(),
|
|
27319
|
-
statusCode: response.raw.status
|
|
27498
|
+
statusCode: response.raw.status,
|
|
27499
|
+
etag: getEtag(response.raw)
|
|
27320
27500
|
};
|
|
27321
27501
|
} catch (err) {
|
|
27502
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27503
|
+
if (notModified) return notModified;
|
|
27322
27504
|
const customError = await handleApiError(err);
|
|
27323
27505
|
return {
|
|
27324
27506
|
success: false,
|
|
27325
27507
|
error: customError,
|
|
27326
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27508
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27509
|
+
...getConditionalErrorFields(err)
|
|
27327
27510
|
};
|
|
27328
27511
|
}
|
|
27329
27512
|
}
|
|
@@ -27335,13 +27518,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27335
27518
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27336
27519
|
* - fileName: The name of the file
|
|
27337
27520
|
* - file: The file to upload
|
|
27521
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27522
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27338
27523
|
*
|
|
27339
27524
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27340
27525
|
*/
|
|
27341
27526
|
async putThumbnailAasRepository(options) {
|
|
27342
|
-
const { configuration, aasIdentifier, fileName, file } = options;
|
|
27527
|
+
const { configuration, aasIdentifier, fileName, file, ifMatch, ifNoneMatch } = options;
|
|
27343
27528
|
try {
|
|
27344
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27529
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27530
|
+
ifMatch,
|
|
27531
|
+
ifNoneMatch
|
|
27532
|
+
}));
|
|
27345
27533
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27346
27534
|
const response = await apiInstance.putThumbnailAasRepositoryRaw({
|
|
27347
27535
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27351,14 +27539,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27351
27539
|
return {
|
|
27352
27540
|
success: true,
|
|
27353
27541
|
data: await response.value(),
|
|
27354
|
-
statusCode: response.raw.status
|
|
27542
|
+
statusCode: response.raw.status,
|
|
27543
|
+
etag: getEtag(response.raw)
|
|
27355
27544
|
};
|
|
27356
27545
|
} catch (err) {
|
|
27357
27546
|
const customError = await handleApiError(err);
|
|
27358
27547
|
return {
|
|
27359
27548
|
success: false,
|
|
27360
27549
|
error: customError,
|
|
27361
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27550
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27551
|
+
...getConditionalErrorFields(err)
|
|
27362
27552
|
};
|
|
27363
27553
|
}
|
|
27364
27554
|
}
|
|
@@ -27370,13 +27560,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27370
27560
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27371
27561
|
* - limit?: The maximum number of elements in the response array
|
|
27372
27562
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
27563
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27373
27564
|
*
|
|
27374
27565
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27375
27566
|
*/
|
|
27376
27567
|
async getAllSubmodelReferencesAasRepository(options) {
|
|
27377
|
-
const { configuration, aasIdentifier, limit, cursor } = options;
|
|
27568
|
+
const { configuration, aasIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
27378
27569
|
try {
|
|
27379
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27570
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27380
27571
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27381
27572
|
const response = await apiInstance.getAllSubmodelReferencesAasRepositoryRaw({
|
|
27382
27573
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27391,14 +27582,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27391
27582
|
pagedResult: result.paging_metadata,
|
|
27392
27583
|
result: submodelReferences
|
|
27393
27584
|
},
|
|
27394
|
-
statusCode: response.raw.status
|
|
27585
|
+
statusCode: response.raw.status,
|
|
27586
|
+
etag: getEtag(response.raw)
|
|
27395
27587
|
};
|
|
27396
27588
|
} catch (err) {
|
|
27589
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27590
|
+
if (notModified) return notModified;
|
|
27397
27591
|
const customError = await handleApiError(err);
|
|
27398
27592
|
return {
|
|
27399
27593
|
success: false,
|
|
27400
27594
|
error: customError,
|
|
27401
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27595
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27596
|
+
...getConditionalErrorFields(err)
|
|
27402
27597
|
};
|
|
27403
27598
|
}
|
|
27404
27599
|
}
|
|
@@ -27409,13 +27604,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27409
27604
|
* - configuration: The http request options
|
|
27410
27605
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27411
27606
|
* - submodelReference: Reference to the Submodel
|
|
27607
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27412
27608
|
*
|
|
27413
27609
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27414
27610
|
*/
|
|
27415
27611
|
async postSubmodelReferenceAasRepository(options) {
|
|
27416
|
-
const { configuration, aasIdentifier, submodelReference } = options;
|
|
27612
|
+
const { configuration, aasIdentifier, submodelReference, ifMatch } = options;
|
|
27417
27613
|
try {
|
|
27418
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27614
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27419
27615
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27420
27616
|
const response = await apiInstance.postSubmodelReferenceAasRepositoryRaw({
|
|
27421
27617
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27424,14 +27620,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27424
27620
|
return {
|
|
27425
27621
|
success: true,
|
|
27426
27622
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
27427
|
-
statusCode: response.raw.status
|
|
27623
|
+
statusCode: response.raw.status,
|
|
27624
|
+
etag: getEtag(response.raw)
|
|
27428
27625
|
};
|
|
27429
27626
|
} catch (err) {
|
|
27430
27627
|
const customError = await handleApiError(err);
|
|
27431
27628
|
return {
|
|
27432
27629
|
success: false,
|
|
27433
27630
|
error: customError,
|
|
27434
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27631
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27632
|
+
...getConditionalErrorFields(err)
|
|
27435
27633
|
};
|
|
27436
27634
|
}
|
|
27437
27635
|
}
|
|
@@ -27442,13 +27640,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27442
27640
|
* - configuration: The http request options
|
|
27443
27641
|
* - aasIdentifier: Unique ID of the AAS
|
|
27444
27642
|
* - submodelIdentifier: The submodel's unique ID
|
|
27643
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27445
27644
|
*
|
|
27446
27645
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27447
27646
|
*/
|
|
27448
27647
|
async deleteSubmodelReferenceAasRepository(options) {
|
|
27449
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
27648
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifMatch } = options;
|
|
27450
27649
|
try {
|
|
27451
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27650
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27452
27651
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27453
27652
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27454
27653
|
const response = await apiInstance.deleteSubmodelReferenceAasRepositoryRaw({
|
|
@@ -27458,14 +27657,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27458
27657
|
return {
|
|
27459
27658
|
success: true,
|
|
27460
27659
|
data: await response.value(),
|
|
27461
|
-
statusCode: response.raw.status
|
|
27660
|
+
statusCode: response.raw.status,
|
|
27661
|
+
etag: getEtag(response.raw)
|
|
27462
27662
|
};
|
|
27463
27663
|
} catch (err) {
|
|
27464
27664
|
const customError = await handleApiError(err);
|
|
27465
27665
|
return {
|
|
27466
27666
|
success: false,
|
|
27467
27667
|
error: customError,
|
|
27468
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27668
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27669
|
+
...getConditionalErrorFields(err)
|
|
27469
27670
|
};
|
|
27470
27671
|
}
|
|
27471
27672
|
}
|
|
@@ -27502,13 +27703,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27502
27703
|
* - submodelIdentifier: The submodel's unique ID
|
|
27503
27704
|
* - level?: Determines the structural depth of the respective resource content
|
|
27504
27705
|
* - extent?: Determines to which extent the resource is being serialized
|
|
27706
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27505
27707
|
*
|
|
27506
27708
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27507
27709
|
*/
|
|
27508
27710
|
async getSubmodelByIdAasRepository(options) {
|
|
27509
|
-
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
27711
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
27510
27712
|
try {
|
|
27511
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27713
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27512
27714
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27513
27715
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27514
27716
|
const response = await apiInstance.getSubmodelByIdAasRepositoryRaw({
|
|
@@ -27520,14 +27722,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27520
27722
|
return {
|
|
27521
27723
|
success: true,
|
|
27522
27724
|
data: convertApiSubmodelToCoreSubmodel(await response.value()),
|
|
27523
|
-
statusCode: response.raw.status
|
|
27725
|
+
statusCode: response.raw.status,
|
|
27726
|
+
etag: getEtag(response.raw)
|
|
27524
27727
|
};
|
|
27525
27728
|
} catch (err) {
|
|
27729
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27730
|
+
if (notModified) return notModified;
|
|
27526
27731
|
const customError = await handleApiError(err);
|
|
27527
27732
|
return {
|
|
27528
27733
|
success: false,
|
|
27529
27734
|
error: customError,
|
|
27530
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27735
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27736
|
+
...getConditionalErrorFields(err)
|
|
27531
27737
|
};
|
|
27532
27738
|
}
|
|
27533
27739
|
}
|
|
@@ -27539,13 +27745,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27539
27745
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27540
27746
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27541
27747
|
* - submodel: Submodel object
|
|
27748
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27749
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27542
27750
|
*
|
|
27543
27751
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27544
27752
|
*/
|
|
27545
27753
|
async putSubmodelByIdAasRepository(options) {
|
|
27546
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodel } = options;
|
|
27754
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodel, ifMatch, ifNoneMatch } = options;
|
|
27547
27755
|
try {
|
|
27548
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27756
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27757
|
+
ifMatch,
|
|
27758
|
+
ifNoneMatch
|
|
27759
|
+
}));
|
|
27549
27760
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27550
27761
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27551
27762
|
const response = await apiInstance.putSubmodelByIdAasRepositoryRaw({
|
|
@@ -27556,34 +27767,39 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27556
27767
|
if (response.raw.status === 204) return {
|
|
27557
27768
|
success: true,
|
|
27558
27769
|
data: void 0,
|
|
27559
|
-
statusCode: response.raw.status
|
|
27770
|
+
statusCode: response.raw.status,
|
|
27771
|
+
etag: getEtag(response.raw)
|
|
27560
27772
|
};
|
|
27561
27773
|
if (response.raw.status === 201) try {
|
|
27562
27774
|
const createdSubmodel = await response.value();
|
|
27563
27775
|
return {
|
|
27564
27776
|
success: true,
|
|
27565
27777
|
data: createdSubmodel ? convertApiSubmodelToCoreSubmodel(createdSubmodel) : void 0,
|
|
27566
|
-
statusCode: response.raw.status
|
|
27778
|
+
statusCode: response.raw.status,
|
|
27779
|
+
etag: getEtag(response.raw)
|
|
27567
27780
|
};
|
|
27568
27781
|
} catch {
|
|
27569
27782
|
return {
|
|
27570
27783
|
success: true,
|
|
27571
27784
|
data: void 0,
|
|
27572
|
-
statusCode: response.raw.status
|
|
27785
|
+
statusCode: response.raw.status,
|
|
27786
|
+
etag: getEtag(response.raw)
|
|
27573
27787
|
};
|
|
27574
27788
|
}
|
|
27575
27789
|
const result = await response.value();
|
|
27576
27790
|
return {
|
|
27577
27791
|
success: true,
|
|
27578
27792
|
data: result ? convertApiSubmodelToCoreSubmodel(result) : void 0,
|
|
27579
|
-
statusCode: response.raw.status
|
|
27793
|
+
statusCode: response.raw.status,
|
|
27794
|
+
etag: getEtag(response.raw)
|
|
27580
27795
|
};
|
|
27581
27796
|
} catch (err) {
|
|
27582
27797
|
const customError = await handleApiError(err);
|
|
27583
27798
|
return {
|
|
27584
27799
|
success: false,
|
|
27585
27800
|
error: customError,
|
|
27586
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27801
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27802
|
+
...getConditionalErrorFields(err)
|
|
27587
27803
|
};
|
|
27588
27804
|
}
|
|
27589
27805
|
}
|
|
@@ -27594,13 +27810,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27594
27810
|
* - configuration: The http request options
|
|
27595
27811
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27596
27812
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27813
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27597
27814
|
*
|
|
27598
27815
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27599
27816
|
*/
|
|
27600
27817
|
async deleteSubmodelByIdAasRepository(options) {
|
|
27601
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
27818
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifMatch } = options;
|
|
27602
27819
|
try {
|
|
27603
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27820
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27604
27821
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27605
27822
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27606
27823
|
const response = await apiInstance.deleteSubmodelByIdAasRepositoryRaw({
|
|
@@ -27610,14 +27827,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27610
27827
|
return {
|
|
27611
27828
|
success: true,
|
|
27612
27829
|
data: await response.value(),
|
|
27613
|
-
statusCode: response.raw.status
|
|
27830
|
+
statusCode: response.raw.status,
|
|
27831
|
+
etag: getEtag(response.raw)
|
|
27614
27832
|
};
|
|
27615
27833
|
} catch (err) {
|
|
27616
27834
|
const customError = await handleApiError(err);
|
|
27617
27835
|
return {
|
|
27618
27836
|
success: false,
|
|
27619
27837
|
error: customError,
|
|
27620
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27838
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27839
|
+
...getConditionalErrorFields(err)
|
|
27621
27840
|
};
|
|
27622
27841
|
}
|
|
27623
27842
|
}
|
|
@@ -27630,13 +27849,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27630
27849
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27631
27850
|
* - submodel: Submodel object
|
|
27632
27851
|
* - level?: Determines the structural depth of the respective resource content
|
|
27852
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27633
27853
|
*
|
|
27634
27854
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27635
27855
|
*/
|
|
27636
27856
|
async patchSubmodelAasRepository(options) {
|
|
27637
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodel, level } = options;
|
|
27857
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodel, level, ifMatch } = options;
|
|
27638
27858
|
try {
|
|
27639
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27859
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27640
27860
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27641
27861
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27642
27862
|
const response = await apiInstance.patchSubmodelAasRepositoryRaw({
|
|
@@ -27648,14 +27868,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27648
27868
|
return {
|
|
27649
27869
|
success: true,
|
|
27650
27870
|
data: await response.value(),
|
|
27651
|
-
statusCode: response.raw.status
|
|
27871
|
+
statusCode: response.raw.status,
|
|
27872
|
+
etag: getEtag(response.raw)
|
|
27652
27873
|
};
|
|
27653
27874
|
} catch (err) {
|
|
27654
27875
|
const customError = await handleApiError(err);
|
|
27655
27876
|
return {
|
|
27656
27877
|
success: false,
|
|
27657
27878
|
error: customError,
|
|
27658
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27879
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27880
|
+
...getConditionalErrorFields(err)
|
|
27659
27881
|
};
|
|
27660
27882
|
}
|
|
27661
27883
|
}
|
|
@@ -27666,13 +27888,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27666
27888
|
* - configuration: The http request options
|
|
27667
27889
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27668
27890
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27891
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27669
27892
|
*
|
|
27670
27893
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27671
27894
|
*/
|
|
27672
27895
|
async getSubmodelByIdMetadataAasRepository(options) {
|
|
27673
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
27896
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifNoneMatch } = options;
|
|
27674
27897
|
try {
|
|
27675
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27898
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27676
27899
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27677
27900
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27678
27901
|
const response = await apiInstance.getSubmodelByIdMetadataAasRepositoryRaw({
|
|
@@ -27682,14 +27905,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27682
27905
|
return {
|
|
27683
27906
|
success: true,
|
|
27684
27907
|
data: await response.value(),
|
|
27685
|
-
statusCode: response.raw.status
|
|
27908
|
+
statusCode: response.raw.status,
|
|
27909
|
+
etag: getEtag(response.raw)
|
|
27686
27910
|
};
|
|
27687
27911
|
} catch (err) {
|
|
27912
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27913
|
+
if (notModified) return notModified;
|
|
27688
27914
|
const customError = await handleApiError(err);
|
|
27689
27915
|
return {
|
|
27690
27916
|
success: false,
|
|
27691
27917
|
error: customError,
|
|
27692
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27918
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27919
|
+
...getConditionalErrorFields(err)
|
|
27693
27920
|
};
|
|
27694
27921
|
}
|
|
27695
27922
|
}
|
|
@@ -27701,13 +27928,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27701
27928
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27702
27929
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27703
27930
|
* - submodelMetadata: The Submodel Metadata object
|
|
27931
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27704
27932
|
*
|
|
27705
27933
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27706
27934
|
*/
|
|
27707
27935
|
async patchSubmodelByIdMetadataAasRepository(options) {
|
|
27708
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodelMetadata } = options;
|
|
27936
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelMetadata, ifMatch } = options;
|
|
27709
27937
|
try {
|
|
27710
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27938
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27711
27939
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27712
27940
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27713
27941
|
const response = await apiInstance.patchSubmodelByIdMetadataAasRepositoryRaw({
|
|
@@ -27718,14 +27946,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27718
27946
|
return {
|
|
27719
27947
|
success: true,
|
|
27720
27948
|
data: await response.value(),
|
|
27721
|
-
statusCode: response.raw.status
|
|
27949
|
+
statusCode: response.raw.status,
|
|
27950
|
+
etag: getEtag(response.raw)
|
|
27722
27951
|
};
|
|
27723
27952
|
} catch (err) {
|
|
27724
27953
|
const customError = await handleApiError(err);
|
|
27725
27954
|
return {
|
|
27726
27955
|
success: false,
|
|
27727
27956
|
error: customError,
|
|
27728
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27957
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27958
|
+
...getConditionalErrorFields(err)
|
|
27729
27959
|
};
|
|
27730
27960
|
}
|
|
27731
27961
|
}
|
|
@@ -27738,13 +27968,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27738
27968
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27739
27969
|
* - level?: Determines the structural depth of the respective resource content
|
|
27740
27970
|
* - extent?: Determines to which extent the resource is being serialized
|
|
27971
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27741
27972
|
*
|
|
27742
27973
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27743
27974
|
*/
|
|
27744
27975
|
async getSubmodelByIdValueOnlyAasRepository(options) {
|
|
27745
|
-
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
27976
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
27746
27977
|
try {
|
|
27747
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27978
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27748
27979
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27749
27980
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27750
27981
|
const response = await apiInstance.getSubmodelByIdValueOnlyAasRepositoryRaw({
|
|
@@ -27756,14 +27987,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27756
27987
|
return {
|
|
27757
27988
|
success: true,
|
|
27758
27989
|
data: await response.value(),
|
|
27759
|
-
statusCode: response.raw.status
|
|
27990
|
+
statusCode: response.raw.status,
|
|
27991
|
+
etag: getEtag(response.raw)
|
|
27760
27992
|
};
|
|
27761
27993
|
} catch (err) {
|
|
27994
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27995
|
+
if (notModified) return notModified;
|
|
27762
27996
|
const customError = await handleApiError(err);
|
|
27763
27997
|
return {
|
|
27764
27998
|
success: false,
|
|
27765
27999
|
error: customError,
|
|
27766
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28000
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28001
|
+
...getConditionalErrorFields(err)
|
|
27767
28002
|
};
|
|
27768
28003
|
}
|
|
27769
28004
|
}
|
|
@@ -27775,13 +28010,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27775
28010
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27776
28011
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27777
28012
|
* - level?: Determines the structural depth of the respective resource content
|
|
28013
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27778
28014
|
*
|
|
27779
28015
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27780
28016
|
*/
|
|
27781
28017
|
async patchSubmodelByIdValueOnlyAasRepository(options) {
|
|
27782
|
-
const { configuration, aasIdentifier, submodelIdentifier, body, level } = options;
|
|
28018
|
+
const { configuration, aasIdentifier, submodelIdentifier, body, level, ifMatch } = options;
|
|
27783
28019
|
try {
|
|
27784
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28020
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27785
28021
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27786
28022
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27787
28023
|
const response = await apiInstance.patchSubmodelByIdValueOnlyAasRepositoryRaw({
|
|
@@ -27793,14 +28029,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27793
28029
|
return {
|
|
27794
28030
|
success: true,
|
|
27795
28031
|
data: await response.value(),
|
|
27796
|
-
statusCode: response.raw.status
|
|
28032
|
+
statusCode: response.raw.status,
|
|
28033
|
+
etag: getEtag(response.raw)
|
|
27797
28034
|
};
|
|
27798
28035
|
} catch (err) {
|
|
27799
28036
|
const customError = await handleApiError(err);
|
|
27800
28037
|
return {
|
|
27801
28038
|
success: false,
|
|
27802
28039
|
error: customError,
|
|
27803
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28040
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28041
|
+
...getConditionalErrorFields(err)
|
|
27804
28042
|
};
|
|
27805
28043
|
}
|
|
27806
28044
|
}
|
|
@@ -27811,13 +28049,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27811
28049
|
* - configuration: The http request options
|
|
27812
28050
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27813
28051
|
* - submodelIdentifier: The submodel's unique ID
|
|
28052
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27814
28053
|
*
|
|
27815
28054
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27816
28055
|
*/
|
|
27817
28056
|
async getSubmodelByIdReferenceAasRepository(options) {
|
|
27818
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
28057
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifNoneMatch } = options;
|
|
27819
28058
|
try {
|
|
27820
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28059
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27821
28060
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27822
28061
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27823
28062
|
const response = await apiInstance.getSubmodelByIdReferenceAasRepositoryRaw({
|
|
@@ -27827,14 +28066,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27827
28066
|
return {
|
|
27828
28067
|
success: true,
|
|
27829
28068
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
27830
|
-
statusCode: response.raw.status
|
|
28069
|
+
statusCode: response.raw.status,
|
|
28070
|
+
etag: getEtag(response.raw)
|
|
27831
28071
|
};
|
|
27832
28072
|
} catch (err) {
|
|
28073
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28074
|
+
if (notModified) return notModified;
|
|
27833
28075
|
const customError = await handleApiError(err);
|
|
27834
28076
|
return {
|
|
27835
28077
|
success: false,
|
|
27836
28078
|
error: customError,
|
|
27837
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28079
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28080
|
+
...getConditionalErrorFields(err)
|
|
27838
28081
|
};
|
|
27839
28082
|
}
|
|
27840
28083
|
}
|
|
@@ -27846,13 +28089,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27846
28089
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27847
28090
|
* - submodelIdentifier: The submodel's unique ID
|
|
27848
28091
|
* - level?: Determines the structural depth of the respective resource content
|
|
28092
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27849
28093
|
*
|
|
27850
28094
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27851
28095
|
*/
|
|
27852
28096
|
async getSubmodelByIdPathAasRepository(options) {
|
|
27853
|
-
const { configuration, aasIdentifier, submodelIdentifier, level } = options;
|
|
28097
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, ifNoneMatch } = options;
|
|
27854
28098
|
try {
|
|
27855
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28099
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27856
28100
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27857
28101
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27858
28102
|
const response = await apiInstance.getSubmodelByIdPathAasRepositoryRaw({
|
|
@@ -27863,14 +28107,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27863
28107
|
return {
|
|
27864
28108
|
success: true,
|
|
27865
28109
|
data: await response.value(),
|
|
27866
|
-
statusCode: response.raw.status
|
|
28110
|
+
statusCode: response.raw.status,
|
|
28111
|
+
etag: getEtag(response.raw)
|
|
27867
28112
|
};
|
|
27868
28113
|
} catch (err) {
|
|
28114
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28115
|
+
if (notModified) return notModified;
|
|
27869
28116
|
const customError = await handleApiError(err);
|
|
27870
28117
|
return {
|
|
27871
28118
|
success: false,
|
|
27872
28119
|
error: customError,
|
|
27873
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28120
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28121
|
+
...getConditionalErrorFields(err)
|
|
27874
28122
|
};
|
|
27875
28123
|
}
|
|
27876
28124
|
}
|
|
@@ -27885,13 +28133,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27885
28133
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
27886
28134
|
* - level?: Determines the structural depth of the respective resource content
|
|
27887
28135
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28136
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27888
28137
|
*
|
|
27889
28138
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27890
28139
|
*/
|
|
27891
28140
|
async getAllSubmodelElementsAasRepository(options) {
|
|
27892
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
28141
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
27893
28142
|
try {
|
|
27894
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28143
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27895
28144
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27896
28145
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27897
28146
|
const response = await apiInstance.getAllSubmodelElementsAasRepositoryRaw({
|
|
@@ -27910,14 +28159,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27910
28159
|
pagedResult: result.paging_metadata,
|
|
27911
28160
|
result: submodelElements
|
|
27912
28161
|
},
|
|
27913
|
-
statusCode: response.raw.status
|
|
28162
|
+
statusCode: response.raw.status,
|
|
28163
|
+
etag: getEtag(response.raw)
|
|
27914
28164
|
};
|
|
27915
28165
|
} catch (err) {
|
|
28166
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28167
|
+
if (notModified) return notModified;
|
|
27916
28168
|
const customError = await handleApiError(err);
|
|
27917
28169
|
return {
|
|
27918
28170
|
success: false,
|
|
27919
28171
|
error: customError,
|
|
27920
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28172
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28173
|
+
...getConditionalErrorFields(err)
|
|
27921
28174
|
};
|
|
27922
28175
|
}
|
|
27923
28176
|
}
|
|
@@ -27929,13 +28182,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27929
28182
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27930
28183
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27931
28184
|
* - submodelElement: The Submodel Element object
|
|
28185
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27932
28186
|
*
|
|
27933
28187
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27934
28188
|
*/
|
|
27935
28189
|
async postSubmodelElementAasRepository(options) {
|
|
27936
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodelElement } = options;
|
|
28190
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelElement, ifMatch } = options;
|
|
27937
28191
|
try {
|
|
27938
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28192
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27939
28193
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27940
28194
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27941
28195
|
const response = await apiInstance.postSubmodelElementAasRepositoryRaw({
|
|
@@ -27946,14 +28200,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27946
28200
|
return {
|
|
27947
28201
|
success: true,
|
|
27948
28202
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
27949
|
-
statusCode: response.raw.status
|
|
28203
|
+
statusCode: response.raw.status,
|
|
28204
|
+
etag: getEtag(response.raw)
|
|
27950
28205
|
};
|
|
27951
28206
|
} catch (err) {
|
|
27952
28207
|
const customError = await handleApiError(err);
|
|
27953
28208
|
return {
|
|
27954
28209
|
success: false,
|
|
27955
28210
|
error: customError,
|
|
27956
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28211
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28212
|
+
...getConditionalErrorFields(err)
|
|
27957
28213
|
};
|
|
27958
28214
|
}
|
|
27959
28215
|
}
|
|
@@ -27966,13 +28222,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27966
28222
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27967
28223
|
* - limit?: The maximum number of elements in the response array
|
|
27968
28224
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28225
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27969
28226
|
*
|
|
27970
28227
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27971
28228
|
*/
|
|
27972
28229
|
async getAllSubmodelElementsMetadataAasRepository(options) {
|
|
27973
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor } = options;
|
|
28230
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
27974
28231
|
try {
|
|
27975
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28232
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27976
28233
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27977
28234
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27978
28235
|
const response = await apiInstance.getAllSubmodelElementsMetadataAasRepositoryRaw({
|
|
@@ -27989,14 +28246,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27989
28246
|
pagedResult: result.paging_metadata,
|
|
27990
28247
|
result: submodelElementsMetadata
|
|
27991
28248
|
},
|
|
27992
|
-
statusCode: response.raw.status
|
|
28249
|
+
statusCode: response.raw.status,
|
|
28250
|
+
etag: getEtag(response.raw)
|
|
27993
28251
|
};
|
|
27994
28252
|
} catch (err) {
|
|
28253
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28254
|
+
if (notModified) return notModified;
|
|
27995
28255
|
const customError = await handleApiError(err);
|
|
27996
28256
|
return {
|
|
27997
28257
|
success: false,
|
|
27998
28258
|
error: customError,
|
|
27999
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28259
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28260
|
+
...getConditionalErrorFields(err)
|
|
28000
28261
|
};
|
|
28001
28262
|
}
|
|
28002
28263
|
}
|
|
@@ -28010,13 +28271,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28010
28271
|
* - limit?: The maximum number of elements in the response array
|
|
28011
28272
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28012
28273
|
* - level?: Determines the structural depth of the respective resource content
|
|
28274
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28013
28275
|
*
|
|
28014
28276
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28015
28277
|
*/
|
|
28016
28278
|
async getAllSubmodelElementsValueOnlyAasRepository(options) {
|
|
28017
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
28279
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
28018
28280
|
try {
|
|
28019
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28281
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28020
28282
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28021
28283
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28022
28284
|
const response = await apiInstance.getAllSubmodelElementsValueOnlyAasRepositoryRaw({
|
|
@@ -28034,14 +28296,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28034
28296
|
pagedResult: result.paging_metadata,
|
|
28035
28297
|
result: submodelElementValues
|
|
28036
28298
|
},
|
|
28037
|
-
statusCode: response.raw.status
|
|
28299
|
+
statusCode: response.raw.status,
|
|
28300
|
+
etag: getEtag(response.raw)
|
|
28038
28301
|
};
|
|
28039
28302
|
} catch (err) {
|
|
28303
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28304
|
+
if (notModified) return notModified;
|
|
28040
28305
|
const customError = await handleApiError(err);
|
|
28041
28306
|
return {
|
|
28042
28307
|
success: false,
|
|
28043
28308
|
error: customError,
|
|
28044
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28309
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28310
|
+
...getConditionalErrorFields(err)
|
|
28045
28311
|
};
|
|
28046
28312
|
}
|
|
28047
28313
|
}
|
|
@@ -28055,13 +28321,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28055
28321
|
* - limit?: The maximum number of elements in the response array
|
|
28056
28322
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28057
28323
|
* - level?: Determines the structural depth of the respective resource content
|
|
28324
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28058
28325
|
*
|
|
28059
28326
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28060
28327
|
*/
|
|
28061
28328
|
async getAllSubmodelElementsReferenceAasRepository(options) {
|
|
28062
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
28329
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
28063
28330
|
try {
|
|
28064
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28331
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28065
28332
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28066
28333
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28067
28334
|
const response = await apiInstance.getAllSubmodelElementsReferenceAasRepositoryRaw({
|
|
@@ -28079,14 +28346,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28079
28346
|
pagedResult: result.paging_metadata,
|
|
28080
28347
|
result: submodelElementReferences
|
|
28081
28348
|
},
|
|
28082
|
-
statusCode: response.raw.status
|
|
28349
|
+
statusCode: response.raw.status,
|
|
28350
|
+
etag: getEtag(response.raw)
|
|
28083
28351
|
};
|
|
28084
28352
|
} catch (err) {
|
|
28353
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28354
|
+
if (notModified) return notModified;
|
|
28085
28355
|
const customError = await handleApiError(err);
|
|
28086
28356
|
return {
|
|
28087
28357
|
success: false,
|
|
28088
28358
|
error: customError,
|
|
28089
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28359
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28360
|
+
...getConditionalErrorFields(err)
|
|
28090
28361
|
};
|
|
28091
28362
|
}
|
|
28092
28363
|
}
|
|
@@ -28101,13 +28372,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28101
28372
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28102
28373
|
* - level?: Determines the structural depth of the respective resource content
|
|
28103
28374
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28375
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28104
28376
|
*
|
|
28105
28377
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28106
28378
|
*/
|
|
28107
28379
|
async getAllSubmodelElementsPathAasRepository(options) {
|
|
28108
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
28380
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
28109
28381
|
try {
|
|
28110
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28382
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28111
28383
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28112
28384
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28113
28385
|
const response = await apiInstance.getAllSubmodelElementsPathAasRepositoryRaw({
|
|
@@ -28126,14 +28398,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28126
28398
|
pagedResult: result.paging_metadata,
|
|
28127
28399
|
result: submodelElements
|
|
28128
28400
|
},
|
|
28129
|
-
statusCode: response.raw.status
|
|
28401
|
+
statusCode: response.raw.status,
|
|
28402
|
+
etag: getEtag(response.raw)
|
|
28130
28403
|
};
|
|
28131
28404
|
} catch (err) {
|
|
28405
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28406
|
+
if (notModified) return notModified;
|
|
28132
28407
|
const customError = await handleApiError(err);
|
|
28133
28408
|
return {
|
|
28134
28409
|
success: false,
|
|
28135
28410
|
error: customError,
|
|
28136
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28411
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28412
|
+
...getConditionalErrorFields(err)
|
|
28137
28413
|
};
|
|
28138
28414
|
}
|
|
28139
28415
|
}
|
|
@@ -28147,13 +28423,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28147
28423
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28148
28424
|
* - level?: Determines the structural depth of the respective resource content
|
|
28149
28425
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28426
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28150
28427
|
*
|
|
28151
28428
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28152
28429
|
*/
|
|
28153
28430
|
async getSubmodelElementByPathAasRepository(options) {
|
|
28154
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
28431
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
28155
28432
|
try {
|
|
28156
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28433
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28157
28434
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28158
28435
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28159
28436
|
const response = await apiInstance.getSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28166,14 +28443,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28166
28443
|
return {
|
|
28167
28444
|
success: true,
|
|
28168
28445
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
28169
|
-
statusCode: response.raw.status
|
|
28446
|
+
statusCode: response.raw.status,
|
|
28447
|
+
etag: getEtag(response.raw)
|
|
28170
28448
|
};
|
|
28171
28449
|
} catch (err) {
|
|
28450
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28451
|
+
if (notModified) return notModified;
|
|
28172
28452
|
const customError = await handleApiError(err);
|
|
28173
28453
|
return {
|
|
28174
28454
|
success: false,
|
|
28175
28455
|
error: customError,
|
|
28176
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28456
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28457
|
+
...getConditionalErrorFields(err)
|
|
28177
28458
|
};
|
|
28178
28459
|
}
|
|
28179
28460
|
}
|
|
@@ -28186,13 +28467,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28186
28467
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28187
28468
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28188
28469
|
* - submodelElement: SubmodelElement object
|
|
28470
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28189
28471
|
*
|
|
28190
28472
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28191
28473
|
*/
|
|
28192
28474
|
async postSubmodelElementByPathAasRepository(options) {
|
|
28193
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
28475
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, ifMatch } = options;
|
|
28194
28476
|
try {
|
|
28195
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28477
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28196
28478
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28197
28479
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28198
28480
|
const response = await apiInstance.postSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28204,14 +28486,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28204
28486
|
return {
|
|
28205
28487
|
success: true,
|
|
28206
28488
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
28207
|
-
statusCode: response.raw.status
|
|
28489
|
+
statusCode: response.raw.status,
|
|
28490
|
+
etag: getEtag(response.raw)
|
|
28208
28491
|
};
|
|
28209
28492
|
} catch (err) {
|
|
28210
28493
|
const customError = await handleApiError(err);
|
|
28211
28494
|
return {
|
|
28212
28495
|
success: false,
|
|
28213
28496
|
error: customError,
|
|
28214
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28497
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28498
|
+
...getConditionalErrorFields(err)
|
|
28215
28499
|
};
|
|
28216
28500
|
}
|
|
28217
28501
|
}
|
|
@@ -28223,13 +28507,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28223
28507
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28224
28508
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28225
28509
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28510
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28226
28511
|
*
|
|
28227
28512
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28228
28513
|
*/
|
|
28229
28514
|
async deleteSubmodelElementByPathAasRepository(options) {
|
|
28230
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
28515
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
28231
28516
|
try {
|
|
28232
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28517
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28233
28518
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28234
28519
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28235
28520
|
const response = await apiInstance.deleteSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28240,14 +28525,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28240
28525
|
return {
|
|
28241
28526
|
success: true,
|
|
28242
28527
|
data: await response.value(),
|
|
28243
|
-
statusCode: response.raw.status
|
|
28528
|
+
statusCode: response.raw.status,
|
|
28529
|
+
etag: getEtag(response.raw)
|
|
28244
28530
|
};
|
|
28245
28531
|
} catch (err) {
|
|
28246
28532
|
const customError = await handleApiError(err);
|
|
28247
28533
|
return {
|
|
28248
28534
|
success: false,
|
|
28249
28535
|
error: customError,
|
|
28250
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28536
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28537
|
+
...getConditionalErrorFields(err)
|
|
28251
28538
|
};
|
|
28252
28539
|
}
|
|
28253
28540
|
}
|
|
@@ -28260,13 +28547,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28260
28547
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28261
28548
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28262
28549
|
* - submodelElement: SubmodelElement object
|
|
28550
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28551
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
28263
28552
|
*
|
|
28264
28553
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28265
28554
|
*/
|
|
28266
28555
|
async putSubmodelElementByPathAasRepository(options) {
|
|
28267
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
28556
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, ifMatch, ifNoneMatch } = options;
|
|
28268
28557
|
try {
|
|
28269
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
28558
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
28559
|
+
ifMatch,
|
|
28560
|
+
ifNoneMatch
|
|
28561
|
+
}));
|
|
28270
28562
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28271
28563
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28272
28564
|
const response = await apiInstance.putSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28278,34 +28570,39 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28278
28570
|
if (response.raw.status === 204) return {
|
|
28279
28571
|
success: true,
|
|
28280
28572
|
data: void 0,
|
|
28281
|
-
statusCode: response.raw.status
|
|
28573
|
+
statusCode: response.raw.status,
|
|
28574
|
+
etag: getEtag(response.raw)
|
|
28282
28575
|
};
|
|
28283
28576
|
if (response.raw.status === 201) try {
|
|
28284
28577
|
const createdSubmodelElement = await response.value();
|
|
28285
28578
|
return {
|
|
28286
28579
|
success: true,
|
|
28287
28580
|
data: createdSubmodelElement ? convertApiSubmodelElementToCoreSubmodelElement(createdSubmodelElement) : void 0,
|
|
28288
|
-
statusCode: response.raw.status
|
|
28581
|
+
statusCode: response.raw.status,
|
|
28582
|
+
etag: getEtag(response.raw)
|
|
28289
28583
|
};
|
|
28290
28584
|
} catch {
|
|
28291
28585
|
return {
|
|
28292
28586
|
success: true,
|
|
28293
28587
|
data: void 0,
|
|
28294
|
-
statusCode: response.raw.status
|
|
28588
|
+
statusCode: response.raw.status,
|
|
28589
|
+
etag: getEtag(response.raw)
|
|
28295
28590
|
};
|
|
28296
28591
|
}
|
|
28297
28592
|
const result = await response.value();
|
|
28298
28593
|
return {
|
|
28299
28594
|
success: true,
|
|
28300
28595
|
data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : void 0,
|
|
28301
|
-
statusCode: response.raw.status
|
|
28596
|
+
statusCode: response.raw.status,
|
|
28597
|
+
etag: getEtag(response.raw)
|
|
28302
28598
|
};
|
|
28303
28599
|
} catch (err) {
|
|
28304
28600
|
const customError = await handleApiError(err);
|
|
28305
28601
|
return {
|
|
28306
28602
|
success: false,
|
|
28307
28603
|
error: customError,
|
|
28308
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28604
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28605
|
+
...getConditionalErrorFields(err)
|
|
28309
28606
|
};
|
|
28310
28607
|
}
|
|
28311
28608
|
}
|
|
@@ -28319,13 +28616,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28319
28616
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28320
28617
|
* - submodelElement: SubmodelElement object
|
|
28321
28618
|
* - level?: Determines the structural depth of the respective resource content
|
|
28619
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28322
28620
|
*
|
|
28323
28621
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28324
28622
|
*/
|
|
28325
28623
|
async patchSubmodelElementValueByPathAasRepository(options) {
|
|
28326
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
28624
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, level, ifMatch } = options;
|
|
28327
28625
|
try {
|
|
28328
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28626
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28329
28627
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28330
28628
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28331
28629
|
const response = await apiInstance.patchSubmodelElementValueByPathAasRepositoryRaw({
|
|
@@ -28338,14 +28636,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28338
28636
|
return {
|
|
28339
28637
|
success: true,
|
|
28340
28638
|
data: await response.value(),
|
|
28341
|
-
statusCode: response.raw.status
|
|
28639
|
+
statusCode: response.raw.status,
|
|
28640
|
+
etag: getEtag(response.raw)
|
|
28342
28641
|
};
|
|
28343
28642
|
} catch (err) {
|
|
28344
28643
|
const customError = await handleApiError(err);
|
|
28345
28644
|
return {
|
|
28346
28645
|
success: false,
|
|
28347
28646
|
error: customError,
|
|
28348
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28647
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28648
|
+
...getConditionalErrorFields(err)
|
|
28349
28649
|
};
|
|
28350
28650
|
}
|
|
28351
28651
|
}
|
|
@@ -28357,13 +28657,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28357
28657
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28358
28658
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28359
28659
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28660
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28360
28661
|
*
|
|
28361
28662
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28362
28663
|
*/
|
|
28363
28664
|
async getSubmodelElementByPathMetadataAasRepository(options) {
|
|
28364
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
28665
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
28365
28666
|
try {
|
|
28366
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28667
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28367
28668
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28368
28669
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28369
28670
|
const response = await apiInstance.getSubmodelElementByPathMetadataAasRepositoryRaw({
|
|
@@ -28374,14 +28675,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28374
28675
|
return {
|
|
28375
28676
|
success: true,
|
|
28376
28677
|
data: await response.value(),
|
|
28377
|
-
statusCode: response.raw.status
|
|
28678
|
+
statusCode: response.raw.status,
|
|
28679
|
+
etag: getEtag(response.raw)
|
|
28378
28680
|
};
|
|
28379
28681
|
} catch (err) {
|
|
28682
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28683
|
+
if (notModified) return notModified;
|
|
28380
28684
|
const customError = await handleApiError(err);
|
|
28381
28685
|
return {
|
|
28382
28686
|
success: false,
|
|
28383
28687
|
error: customError,
|
|
28384
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28688
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28689
|
+
...getConditionalErrorFields(err)
|
|
28385
28690
|
};
|
|
28386
28691
|
}
|
|
28387
28692
|
}
|
|
@@ -28394,13 +28699,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28394
28699
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28395
28700
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28396
28701
|
* - submodelElementMetadata: The Submodel Element Metadata object
|
|
28702
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28397
28703
|
*
|
|
28398
28704
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28399
28705
|
*/
|
|
28400
28706
|
async patchSubmodelElementValueByPathMetadata(options) {
|
|
28401
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
28707
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementMetadata, ifMatch } = options;
|
|
28402
28708
|
try {
|
|
28403
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28709
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28404
28710
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28405
28711
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28406
28712
|
const response = await apiInstance.patchSubmodelElementValueByPathMetadataRaw({
|
|
@@ -28412,14 +28718,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28412
28718
|
return {
|
|
28413
28719
|
success: true,
|
|
28414
28720
|
data: await response.value(),
|
|
28415
|
-
statusCode: response.raw.status
|
|
28721
|
+
statusCode: response.raw.status,
|
|
28722
|
+
etag: getEtag(response.raw)
|
|
28416
28723
|
};
|
|
28417
28724
|
} catch (err) {
|
|
28418
28725
|
const customError = await handleApiError(err);
|
|
28419
28726
|
return {
|
|
28420
28727
|
success: false,
|
|
28421
28728
|
error: customError,
|
|
28422
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28729
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28730
|
+
...getConditionalErrorFields(err)
|
|
28423
28731
|
};
|
|
28424
28732
|
}
|
|
28425
28733
|
}
|
|
@@ -28433,13 +28741,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28433
28741
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28434
28742
|
* - level?: Determines the structural depth of the respective resource content
|
|
28435
28743
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28744
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28436
28745
|
*
|
|
28437
28746
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28438
28747
|
*/
|
|
28439
28748
|
async getSubmodelElementByPathValueOnlyAasRepository(options) {
|
|
28440
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
28749
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
28441
28750
|
try {
|
|
28442
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28751
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28443
28752
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28444
28753
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28445
28754
|
const response = await apiInstance.getSubmodelElementByPathValueOnlyAasRepositoryRaw({
|
|
@@ -28452,14 +28761,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28452
28761
|
return {
|
|
28453
28762
|
success: true,
|
|
28454
28763
|
data: await response.value(),
|
|
28455
|
-
statusCode: response.raw.status
|
|
28764
|
+
statusCode: response.raw.status,
|
|
28765
|
+
etag: getEtag(response.raw)
|
|
28456
28766
|
};
|
|
28457
28767
|
} catch (err) {
|
|
28768
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28769
|
+
if (notModified) return notModified;
|
|
28458
28770
|
const customError = await handleApiError(err);
|
|
28459
28771
|
return {
|
|
28460
28772
|
success: false,
|
|
28461
28773
|
error: customError,
|
|
28462
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28774
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28775
|
+
...getConditionalErrorFields(err)
|
|
28463
28776
|
};
|
|
28464
28777
|
}
|
|
28465
28778
|
}
|
|
@@ -28473,13 +28786,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28473
28786
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28474
28787
|
* - SubmodelElementValue: SubmodelElementValue object
|
|
28475
28788
|
* - level?: Determines the structural depth of the respective resource content
|
|
28789
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28476
28790
|
*
|
|
28477
28791
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28478
28792
|
*/
|
|
28479
28793
|
async patchSubmodelElementValueByPathValueOnly(options) {
|
|
28480
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
28794
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementValue, level, ifMatch } = options;
|
|
28481
28795
|
try {
|
|
28482
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28796
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28483
28797
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28484
28798
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28485
28799
|
const response = await apiInstance.patchSubmodelElementValueByPathValueOnlyRaw({
|
|
@@ -28492,14 +28806,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28492
28806
|
return {
|
|
28493
28807
|
success: true,
|
|
28494
28808
|
data: await response.value(),
|
|
28495
|
-
statusCode: response.raw.status
|
|
28809
|
+
statusCode: response.raw.status,
|
|
28810
|
+
etag: getEtag(response.raw)
|
|
28496
28811
|
};
|
|
28497
28812
|
} catch (err) {
|
|
28498
28813
|
const customError = await handleApiError(err);
|
|
28499
28814
|
return {
|
|
28500
28815
|
success: false,
|
|
28501
28816
|
error: customError,
|
|
28502
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28817
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28818
|
+
...getConditionalErrorFields(err)
|
|
28503
28819
|
};
|
|
28504
28820
|
}
|
|
28505
28821
|
}
|
|
@@ -28512,13 +28828,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28512
28828
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28513
28829
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28514
28830
|
* - level?: Determines the structural depth of the respective resource content
|
|
28831
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28515
28832
|
*
|
|
28516
28833
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28517
28834
|
*/
|
|
28518
28835
|
async getSubmodelElementByPathReferenceAasRepository(options) {
|
|
28519
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
28836
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, ifNoneMatch } = options;
|
|
28520
28837
|
try {
|
|
28521
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28838
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28522
28839
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28523
28840
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28524
28841
|
const response = await apiInstance.getSubmodelElementByPathReferenceAasRepositoryRaw({
|
|
@@ -28530,14 +28847,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28530
28847
|
return {
|
|
28531
28848
|
success: true,
|
|
28532
28849
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
28533
|
-
statusCode: response.raw.status
|
|
28850
|
+
statusCode: response.raw.status,
|
|
28851
|
+
etag: getEtag(response.raw)
|
|
28534
28852
|
};
|
|
28535
28853
|
} catch (err) {
|
|
28854
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28855
|
+
if (notModified) return notModified;
|
|
28536
28856
|
const customError = await handleApiError(err);
|
|
28537
28857
|
return {
|
|
28538
28858
|
success: false,
|
|
28539
28859
|
error: customError,
|
|
28540
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28860
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28861
|
+
...getConditionalErrorFields(err)
|
|
28541
28862
|
};
|
|
28542
28863
|
}
|
|
28543
28864
|
}
|
|
@@ -28550,13 +28871,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28550
28871
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28551
28872
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28552
28873
|
* - level?: Determines the structural depth of the respective resource content
|
|
28874
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28553
28875
|
*
|
|
28554
28876
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28555
28877
|
*/
|
|
28556
28878
|
async getSubmodelElementByPathPathAasRepository(options) {
|
|
28557
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
28879
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, ifNoneMatch } = options;
|
|
28558
28880
|
try {
|
|
28559
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28881
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28560
28882
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28561
28883
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28562
28884
|
const response = await apiInstance.getSubmodelElementByPathPathAasRepositoryRaw({
|
|
@@ -28568,14 +28890,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28568
28890
|
return {
|
|
28569
28891
|
success: true,
|
|
28570
28892
|
data: await response.value(),
|
|
28571
|
-
statusCode: response.raw.status
|
|
28893
|
+
statusCode: response.raw.status,
|
|
28894
|
+
etag: getEtag(response.raw)
|
|
28572
28895
|
};
|
|
28573
28896
|
} catch (err) {
|
|
28897
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28898
|
+
if (notModified) return notModified;
|
|
28574
28899
|
const customError = await handleApiError(err);
|
|
28575
28900
|
return {
|
|
28576
28901
|
success: false,
|
|
28577
28902
|
error: customError,
|
|
28578
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28903
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28904
|
+
...getConditionalErrorFields(err)
|
|
28579
28905
|
};
|
|
28580
28906
|
}
|
|
28581
28907
|
}
|
|
@@ -28587,13 +28913,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28587
28913
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28588
28914
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28589
28915
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28916
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28590
28917
|
*
|
|
28591
28918
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28592
28919
|
*/
|
|
28593
28920
|
async getFileByPathAasRepository(options) {
|
|
28594
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
28921
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
28595
28922
|
try {
|
|
28596
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28923
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28597
28924
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28598
28925
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28599
28926
|
const response = await apiInstance.getFileByPathAasRepositoryRaw({
|
|
@@ -28604,14 +28931,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28604
28931
|
return {
|
|
28605
28932
|
success: true,
|
|
28606
28933
|
data: await response.value(),
|
|
28607
|
-
statusCode: response.raw.status
|
|
28934
|
+
statusCode: response.raw.status,
|
|
28935
|
+
etag: getEtag(response.raw)
|
|
28608
28936
|
};
|
|
28609
28937
|
} catch (err) {
|
|
28938
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28939
|
+
if (notModified) return notModified;
|
|
28610
28940
|
const customError = await handleApiError(err);
|
|
28611
28941
|
return {
|
|
28612
28942
|
success: false,
|
|
28613
28943
|
error: customError,
|
|
28614
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28944
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28945
|
+
...getConditionalErrorFields(err)
|
|
28615
28946
|
};
|
|
28616
28947
|
}
|
|
28617
28948
|
}
|
|
@@ -28625,13 +28956,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28625
28956
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28626
28957
|
* - fileName: The name of the file
|
|
28627
28958
|
* - file: The file to upload
|
|
28959
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28960
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
28628
28961
|
*
|
|
28629
28962
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28630
28963
|
*/
|
|
28631
28964
|
async putFileByPathAasRepository(options) {
|
|
28632
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
28965
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, fileName, file, ifMatch, ifNoneMatch } = options;
|
|
28633
28966
|
try {
|
|
28634
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
28967
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
28968
|
+
ifMatch,
|
|
28969
|
+
ifNoneMatch
|
|
28970
|
+
}));
|
|
28635
28971
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28636
28972
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28637
28973
|
const response = await apiInstance.putFileByPathAasRepositoryRaw({
|
|
@@ -28644,14 +28980,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28644
28980
|
return {
|
|
28645
28981
|
success: true,
|
|
28646
28982
|
data: await response.value(),
|
|
28647
|
-
statusCode: response.raw.status
|
|
28983
|
+
statusCode: response.raw.status,
|
|
28984
|
+
etag: getEtag(response.raw)
|
|
28648
28985
|
};
|
|
28649
28986
|
} catch (err) {
|
|
28650
28987
|
const customError = await handleApiError(err);
|
|
28651
28988
|
return {
|
|
28652
28989
|
success: false,
|
|
28653
28990
|
error: customError,
|
|
28654
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28991
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28992
|
+
...getConditionalErrorFields(err)
|
|
28655
28993
|
};
|
|
28656
28994
|
}
|
|
28657
28995
|
}
|
|
@@ -28663,13 +29001,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28663
29001
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28664
29002
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28665
29003
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
29004
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28666
29005
|
*
|
|
28667
29006
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28668
29007
|
*/
|
|
28669
29008
|
async deleteFileByPathAasRepository(options) {
|
|
28670
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
29009
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
28671
29010
|
try {
|
|
28672
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29011
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28673
29012
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28674
29013
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28675
29014
|
const response = await apiInstance.deleteFileByPathAasRepositoryRaw({
|
|
@@ -28680,14 +29019,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28680
29019
|
return {
|
|
28681
29020
|
success: true,
|
|
28682
29021
|
data: await response.value(),
|
|
28683
|
-
statusCode: response.raw.status
|
|
29022
|
+
statusCode: response.raw.status,
|
|
29023
|
+
etag: getEtag(response.raw)
|
|
28684
29024
|
};
|
|
28685
29025
|
} catch (err) {
|
|
28686
29026
|
const customError = await handleApiError(err);
|
|
28687
29027
|
return {
|
|
28688
29028
|
success: false,
|
|
28689
29029
|
error: customError,
|
|
28690
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29030
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29031
|
+
...getConditionalErrorFields(err)
|
|
28691
29032
|
};
|
|
28692
29033
|
}
|
|
28693
29034
|
}
|
|
@@ -28700,13 +29041,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28700
29041
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28701
29042
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28702
29043
|
* - operationRequest: Operation request object
|
|
29044
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28703
29045
|
*
|
|
28704
29046
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28705
29047
|
*/
|
|
28706
29048
|
async invokeOperationAasRepository(options) {
|
|
28707
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
29049
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
28708
29050
|
try {
|
|
28709
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29051
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28710
29052
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28711
29053
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28712
29054
|
const response = await apiInstance.invokeOperationAasRepositoryRaw({
|
|
@@ -28718,14 +29060,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28718
29060
|
return {
|
|
28719
29061
|
success: true,
|
|
28720
29062
|
data: await response.value(),
|
|
28721
|
-
statusCode: response.raw.status
|
|
29063
|
+
statusCode: response.raw.status,
|
|
29064
|
+
etag: getEtag(response.raw)
|
|
28722
29065
|
};
|
|
28723
29066
|
} catch (err) {
|
|
28724
29067
|
const customError = await handleApiError(err);
|
|
28725
29068
|
return {
|
|
28726
29069
|
success: false,
|
|
28727
29070
|
error: customError,
|
|
28728
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29071
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29072
|
+
...getConditionalErrorFields(err)
|
|
28729
29073
|
};
|
|
28730
29074
|
}
|
|
28731
29075
|
}
|
|
@@ -28738,13 +29082,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28738
29082
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28739
29083
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28740
29084
|
* - operationRequestValueOnly: OperationRequestValueOnly object
|
|
29085
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28741
29086
|
*
|
|
28742
29087
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28743
29088
|
*/
|
|
28744
29089
|
async invokeOperationValueOnlyAasRepository(options) {
|
|
28745
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
29090
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
28746
29091
|
try {
|
|
28747
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29092
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28748
29093
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28749
29094
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28750
29095
|
const response = await apiInstance.invokeOperationValueOnlyAasRepositoryRaw({
|
|
@@ -28756,14 +29101,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28756
29101
|
return {
|
|
28757
29102
|
success: true,
|
|
28758
29103
|
data: await response.value(),
|
|
28759
|
-
statusCode: response.raw.status
|
|
29104
|
+
statusCode: response.raw.status,
|
|
29105
|
+
etag: getEtag(response.raw)
|
|
28760
29106
|
};
|
|
28761
29107
|
} catch (err) {
|
|
28762
29108
|
const customError = await handleApiError(err);
|
|
28763
29109
|
return {
|
|
28764
29110
|
success: false,
|
|
28765
29111
|
error: customError,
|
|
28766
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29112
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29113
|
+
...getConditionalErrorFields(err)
|
|
28767
29114
|
};
|
|
28768
29115
|
}
|
|
28769
29116
|
}
|
|
@@ -28776,13 +29123,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28776
29123
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28777
29124
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28778
29125
|
* - operationRequest: OperationRequest object
|
|
29126
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28779
29127
|
*
|
|
28780
29128
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28781
29129
|
*/
|
|
28782
29130
|
async invokeOperationAsyncAasRepository(options) {
|
|
28783
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
29131
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
28784
29132
|
try {
|
|
28785
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29133
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28786
29134
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28787
29135
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28788
29136
|
const response = await apiInstance.invokeOperationAsyncAasRepositoryRaw({
|
|
@@ -28794,14 +29142,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28794
29142
|
return {
|
|
28795
29143
|
success: true,
|
|
28796
29144
|
data: await response.value(),
|
|
28797
|
-
statusCode: response.raw.status
|
|
29145
|
+
statusCode: response.raw.status,
|
|
29146
|
+
etag: getEtag(response.raw)
|
|
28798
29147
|
};
|
|
28799
29148
|
} catch (err) {
|
|
28800
29149
|
const customError = await handleApiError(err);
|
|
28801
29150
|
return {
|
|
28802
29151
|
success: false,
|
|
28803
29152
|
error: customError,
|
|
28804
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29153
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29154
|
+
...getConditionalErrorFields(err)
|
|
28805
29155
|
};
|
|
28806
29156
|
}
|
|
28807
29157
|
}
|
|
@@ -28814,13 +29164,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28814
29164
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28815
29165
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28816
29166
|
* - operationRequestValueOnly: Operation request object
|
|
29167
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28817
29168
|
*
|
|
28818
29169
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28819
29170
|
*/
|
|
28820
29171
|
async invokeOperationAsyncValueOnlyAasRepository(options) {
|
|
28821
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
29172
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
28822
29173
|
try {
|
|
28823
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29174
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28824
29175
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28825
29176
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28826
29177
|
const response = await apiInstance.invokeOperationAsyncValueOnlyAasRepositoryRaw({
|
|
@@ -28832,14 +29183,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28832
29183
|
return {
|
|
28833
29184
|
success: true,
|
|
28834
29185
|
data: await response.value(),
|
|
28835
|
-
statusCode: response.raw.status
|
|
29186
|
+
statusCode: response.raw.status,
|
|
29187
|
+
etag: getEtag(response.raw)
|
|
28836
29188
|
};
|
|
28837
29189
|
} catch (err) {
|
|
28838
29190
|
const customError = await handleApiError(err);
|
|
28839
29191
|
return {
|
|
28840
29192
|
success: false,
|
|
28841
29193
|
error: customError,
|
|
28842
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29194
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29195
|
+
...getConditionalErrorFields(err)
|
|
28843
29196
|
};
|
|
28844
29197
|
}
|
|
28845
29198
|
}
|
|
@@ -28871,14 +29224,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28871
29224
|
return {
|
|
28872
29225
|
success: true,
|
|
28873
29226
|
data: await response.value(),
|
|
28874
|
-
statusCode: response.raw.status
|
|
29227
|
+
statusCode: response.raw.status,
|
|
29228
|
+
etag: getEtag(response.raw)
|
|
28875
29229
|
};
|
|
28876
29230
|
} catch (err) {
|
|
28877
29231
|
const customError = await handleApiError(err);
|
|
28878
29232
|
return {
|
|
28879
29233
|
success: false,
|
|
28880
29234
|
error: customError,
|
|
28881
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29235
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29236
|
+
...getConditionalErrorFields(err)
|
|
28882
29237
|
};
|
|
28883
29238
|
}
|
|
28884
29239
|
}
|
|
@@ -28910,14 +29265,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28910
29265
|
return {
|
|
28911
29266
|
success: true,
|
|
28912
29267
|
data: await response.value(),
|
|
28913
|
-
statusCode: response.raw.status
|
|
29268
|
+
statusCode: response.raw.status,
|
|
29269
|
+
etag: getEtag(response.raw)
|
|
28914
29270
|
};
|
|
28915
29271
|
} catch (err) {
|
|
28916
29272
|
const customError = await handleApiError(err);
|
|
28917
29273
|
return {
|
|
28918
29274
|
success: false,
|
|
28919
29275
|
error: customError,
|
|
28920
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29276
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29277
|
+
...getConditionalErrorFields(err)
|
|
28921
29278
|
};
|
|
28922
29279
|
}
|
|
28923
29280
|
}
|
|
@@ -28949,14 +29306,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28949
29306
|
return {
|
|
28950
29307
|
success: true,
|
|
28951
29308
|
data: await response.value(),
|
|
28952
|
-
statusCode: response.raw.status
|
|
29309
|
+
statusCode: response.raw.status,
|
|
29310
|
+
etag: getEtag(response.raw)
|
|
28953
29311
|
};
|
|
28954
29312
|
} catch (err) {
|
|
28955
29313
|
const customError = await handleApiError(err);
|
|
28956
29314
|
return {
|
|
28957
29315
|
success: false,
|
|
28958
29316
|
error: customError,
|
|
28959
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29317
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29318
|
+
...getConditionalErrorFields(err)
|
|
28960
29319
|
};
|
|
28961
29320
|
}
|
|
28962
29321
|
}
|
|
@@ -28982,14 +29341,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28982
29341
|
return {
|
|
28983
29342
|
success: true,
|
|
28984
29343
|
data: await response.value(),
|
|
28985
|
-
statusCode: response.raw.status
|
|
29344
|
+
statusCode: response.raw.status,
|
|
29345
|
+
etag: getEtag(response.raw)
|
|
28986
29346
|
};
|
|
28987
29347
|
} catch (err) {
|
|
28988
29348
|
const customError = await handleApiError(err);
|
|
28989
29349
|
return {
|
|
28990
29350
|
success: false,
|
|
28991
29351
|
error: customError,
|
|
28992
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29352
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29353
|
+
...getConditionalErrorFields(err)
|
|
28993
29354
|
};
|
|
28994
29355
|
}
|
|
28995
29356
|
}
|
|
@@ -29008,14 +29369,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
29008
29369
|
return {
|
|
29009
29370
|
success: true,
|
|
29010
29371
|
data: await response.value(),
|
|
29011
|
-
statusCode: response.raw.status
|
|
29372
|
+
statusCode: response.raw.status,
|
|
29373
|
+
etag: getEtag(response.raw)
|
|
29012
29374
|
};
|
|
29013
29375
|
} catch (err) {
|
|
29014
29376
|
const customError = await handleApiError(err);
|
|
29015
29377
|
return {
|
|
29016
29378
|
success: false,
|
|
29017
29379
|
error: customError,
|
|
29018
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29380
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29381
|
+
...getConditionalErrorFields(err)
|
|
29019
29382
|
};
|
|
29020
29383
|
}
|
|
29021
29384
|
}
|
|
@@ -29065,14 +29428,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29065
29428
|
pagedResult: payload.paging_metadata,
|
|
29066
29429
|
result
|
|
29067
29430
|
},
|
|
29068
|
-
statusCode: response.raw.status
|
|
29431
|
+
statusCode: response.raw.status,
|
|
29432
|
+
etag: getEtag(response.raw)
|
|
29069
29433
|
};
|
|
29070
29434
|
} catch (err) {
|
|
29071
29435
|
const customError = await handleApiError(err);
|
|
29072
29436
|
return {
|
|
29073
29437
|
success: false,
|
|
29074
29438
|
error: customError,
|
|
29075
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29439
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29440
|
+
...getConditionalErrorFields(err)
|
|
29076
29441
|
};
|
|
29077
29442
|
}
|
|
29078
29443
|
}
|
|
@@ -29098,14 +29463,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29098
29463
|
return {
|
|
29099
29464
|
success: true,
|
|
29100
29465
|
data: await response.value(),
|
|
29101
|
-
statusCode: response.raw.status
|
|
29466
|
+
statusCode: response.raw.status,
|
|
29467
|
+
etag: getEtag(response.raw)
|
|
29102
29468
|
};
|
|
29103
29469
|
} catch (err) {
|
|
29104
29470
|
const customError = await handleApiError(err);
|
|
29105
29471
|
return {
|
|
29106
29472
|
success: false,
|
|
29107
29473
|
error: customError,
|
|
29108
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29474
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29475
|
+
...getConditionalErrorFields(err)
|
|
29109
29476
|
};
|
|
29110
29477
|
}
|
|
29111
29478
|
}
|
|
@@ -29115,26 +29482,31 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29115
29482
|
* @param options Object containing:
|
|
29116
29483
|
* - configuration: The http request options
|
|
29117
29484
|
* - packageId: The package Id (UTF8-BASE64-URL-encoded)
|
|
29485
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29118
29486
|
*
|
|
29119
29487
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29120
29488
|
*/
|
|
29121
29489
|
async getAASXByPackageId(options) {
|
|
29122
|
-
const { configuration, packageId } = options;
|
|
29490
|
+
const { configuration, packageId, ifNoneMatch } = options;
|
|
29123
29491
|
try {
|
|
29124
|
-
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration));
|
|
29492
|
+
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
29125
29493
|
const encodedPackageId = base64Encode(AasxFileClient.requireIdentifier(packageId, "packageId"));
|
|
29126
29494
|
const response = await apiInstance.getAASXByPackageIdRaw({ packageId: encodedPackageId });
|
|
29127
29495
|
return {
|
|
29128
29496
|
success: true,
|
|
29129
29497
|
data: await response.value(),
|
|
29130
|
-
statusCode: response.raw.status
|
|
29498
|
+
statusCode: response.raw.status,
|
|
29499
|
+
etag: getEtag(response.raw)
|
|
29131
29500
|
};
|
|
29132
29501
|
} catch (err) {
|
|
29502
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
29503
|
+
if (notModified) return notModified;
|
|
29133
29504
|
const customError = await handleApiError(err);
|
|
29134
29505
|
return {
|
|
29135
29506
|
success: false,
|
|
29136
29507
|
error: customError,
|
|
29137
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29508
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29509
|
+
...getConditionalErrorFields(err)
|
|
29138
29510
|
};
|
|
29139
29511
|
}
|
|
29140
29512
|
}
|
|
@@ -29147,13 +29519,18 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29147
29519
|
* - aasIds?: A list of Asset Administration Shells' unique ids
|
|
29148
29520
|
* - file: The file to upload
|
|
29149
29521
|
* - fileName: The name of the file
|
|
29522
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29523
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
29150
29524
|
*
|
|
29151
29525
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29152
29526
|
*/
|
|
29153
29527
|
async putAASXByPackageId(options) {
|
|
29154
|
-
const { configuration, packageId, aasIds, file, fileName } = options;
|
|
29528
|
+
const { configuration, packageId, aasIds, file, fileName, ifMatch, ifNoneMatch } = options;
|
|
29155
29529
|
try {
|
|
29156
|
-
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration
|
|
29530
|
+
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration, {
|
|
29531
|
+
ifMatch,
|
|
29532
|
+
ifNoneMatch
|
|
29533
|
+
}));
|
|
29157
29534
|
const encodedPackageId = base64Encode(AasxFileClient.requireIdentifier(packageId, "packageId"));
|
|
29158
29535
|
const response = await apiInstance.putAASXByPackageIdRaw({
|
|
29159
29536
|
packageId: encodedPackageId,
|
|
@@ -29164,14 +29541,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29164
29541
|
return {
|
|
29165
29542
|
success: true,
|
|
29166
29543
|
data: await response.value(),
|
|
29167
|
-
statusCode: response.raw.status
|
|
29544
|
+
statusCode: response.raw.status,
|
|
29545
|
+
etag: getEtag(response.raw)
|
|
29168
29546
|
};
|
|
29169
29547
|
} catch (err) {
|
|
29170
29548
|
const customError = await handleApiError(err);
|
|
29171
29549
|
return {
|
|
29172
29550
|
success: false,
|
|
29173
29551
|
error: customError,
|
|
29174
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29552
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29553
|
+
...getConditionalErrorFields(err)
|
|
29175
29554
|
};
|
|
29176
29555
|
}
|
|
29177
29556
|
}
|
|
@@ -29181,26 +29560,29 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29181
29560
|
* @param options Object containing:
|
|
29182
29561
|
* - configuration: The http request options.
|
|
29183
29562
|
* - packageId: The package Id (UTF8-BASE64-URL-encoded)
|
|
29563
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29184
29564
|
*
|
|
29185
29565
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29186
29566
|
*/
|
|
29187
29567
|
async deleteAASXByPackageId(options) {
|
|
29188
|
-
const { configuration, packageId } = options;
|
|
29568
|
+
const { configuration, packageId, ifMatch } = options;
|
|
29189
29569
|
try {
|
|
29190
|
-
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration));
|
|
29570
|
+
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29191
29571
|
const encodedPackageId = base64Encode(AasxFileClient.requireIdentifier(packageId, "packageId"));
|
|
29192
29572
|
const response = await apiInstance.deleteAASXByPackageIdRaw({ packageId: encodedPackageId });
|
|
29193
29573
|
return {
|
|
29194
29574
|
success: true,
|
|
29195
29575
|
data: await response.value(),
|
|
29196
|
-
statusCode: response.raw.status
|
|
29576
|
+
statusCode: response.raw.status,
|
|
29577
|
+
etag: getEtag(response.raw)
|
|
29197
29578
|
};
|
|
29198
29579
|
} catch (err) {
|
|
29199
29580
|
const customError = await handleApiError(err);
|
|
29200
29581
|
return {
|
|
29201
29582
|
success: false,
|
|
29202
29583
|
error: customError,
|
|
29203
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29584
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29585
|
+
...getConditionalErrorFields(err)
|
|
29204
29586
|
};
|
|
29205
29587
|
}
|
|
29206
29588
|
}
|
|
@@ -29219,14 +29601,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29219
29601
|
return {
|
|
29220
29602
|
success: true,
|
|
29221
29603
|
data: await response.value(),
|
|
29222
|
-
statusCode: response.raw.status
|
|
29604
|
+
statusCode: response.raw.status,
|
|
29605
|
+
etag: getEtag(response.raw)
|
|
29223
29606
|
};
|
|
29224
29607
|
} catch (err) {
|
|
29225
29608
|
const customError = await handleApiError(err);
|
|
29226
29609
|
return {
|
|
29227
29610
|
success: false,
|
|
29228
29611
|
error: customError,
|
|
29229
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29612
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29613
|
+
...getConditionalErrorFields(err)
|
|
29230
29614
|
};
|
|
29231
29615
|
}
|
|
29232
29616
|
}
|
|
@@ -29283,26 +29667,31 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29283
29667
|
* @param options Object containing:
|
|
29284
29668
|
* - configuration: The http request options
|
|
29285
29669
|
* - cdIdentifier: The Concept Description’s unique id
|
|
29670
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29286
29671
|
*
|
|
29287
29672
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29288
29673
|
*/
|
|
29289
29674
|
async getConceptDescriptionById(options) {
|
|
29290
|
-
const { configuration, cdIdentifier } = options;
|
|
29675
|
+
const { configuration, cdIdentifier, ifNoneMatch } = options;
|
|
29291
29676
|
try {
|
|
29292
|
-
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration));
|
|
29677
|
+
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
29293
29678
|
const encodedCdIdentifier = base64Encode(ConceptDescriptionRepositoryClient.requireIdentifier(cdIdentifier, "cdIdentifier"));
|
|
29294
29679
|
const response = await apiInstance.getConceptDescriptionByIdRaw({ cdIdentifier: encodedCdIdentifier });
|
|
29295
29680
|
return {
|
|
29296
29681
|
success: true,
|
|
29297
29682
|
data: convertApiCDToCoreCD(await response.value()),
|
|
29298
|
-
statusCode: response.raw.status
|
|
29683
|
+
statusCode: response.raw.status,
|
|
29684
|
+
etag: getEtag(response.raw)
|
|
29299
29685
|
};
|
|
29300
29686
|
} catch (err) {
|
|
29687
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
29688
|
+
if (notModified) return notModified;
|
|
29301
29689
|
const customError = await handleApiError(err);
|
|
29302
29690
|
return {
|
|
29303
29691
|
success: false,
|
|
29304
29692
|
error: customError,
|
|
29305
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29693
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29694
|
+
...getConditionalErrorFields(err)
|
|
29306
29695
|
};
|
|
29307
29696
|
}
|
|
29308
29697
|
}
|
|
@@ -29312,26 +29701,29 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29312
29701
|
* @param options Object containing:
|
|
29313
29702
|
* - configuration: The http request options
|
|
29314
29703
|
* - cdIdentifier: The Concept Description’s unique id
|
|
29704
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29315
29705
|
*
|
|
29316
29706
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29317
29707
|
*/
|
|
29318
29708
|
async deleteConceptDescriptionById(options) {
|
|
29319
|
-
const { configuration, cdIdentifier } = options;
|
|
29709
|
+
const { configuration, cdIdentifier, ifMatch } = options;
|
|
29320
29710
|
try {
|
|
29321
|
-
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration));
|
|
29711
|
+
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29322
29712
|
const encodedCdIdentifier = base64Encode(ConceptDescriptionRepositoryClient.requireIdentifier(cdIdentifier, "cdIdentifier"));
|
|
29323
29713
|
const response = await apiInstance.deleteConceptDescriptionByIdRaw({ cdIdentifier: encodedCdIdentifier });
|
|
29324
29714
|
return {
|
|
29325
29715
|
success: true,
|
|
29326
29716
|
data: await response.value(),
|
|
29327
|
-
statusCode: response.raw.status
|
|
29717
|
+
statusCode: response.raw.status,
|
|
29718
|
+
etag: getEtag(response.raw)
|
|
29328
29719
|
};
|
|
29329
29720
|
} catch (err) {
|
|
29330
29721
|
const customError = await handleApiError(err);
|
|
29331
29722
|
return {
|
|
29332
29723
|
success: false,
|
|
29333
29724
|
error: customError,
|
|
29334
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29725
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29726
|
+
...getConditionalErrorFields(err)
|
|
29335
29727
|
};
|
|
29336
29728
|
}
|
|
29337
29729
|
}
|
|
@@ -29342,13 +29734,18 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29342
29734
|
* - configuration: The http request options
|
|
29343
29735
|
* - cdIdentifier: The Concept Description’s unique id
|
|
29344
29736
|
* - conceptDescription: Concept Description object
|
|
29737
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29738
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
29345
29739
|
*
|
|
29346
29740
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29347
29741
|
*/
|
|
29348
29742
|
async putConceptDescriptionById(options) {
|
|
29349
|
-
const { configuration, cdIdentifier, conceptDescription } = options;
|
|
29743
|
+
const { configuration, cdIdentifier, conceptDescription, ifMatch, ifNoneMatch } = options;
|
|
29350
29744
|
try {
|
|
29351
|
-
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration
|
|
29745
|
+
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration, {
|
|
29746
|
+
ifMatch,
|
|
29747
|
+
ifNoneMatch
|
|
29748
|
+
}));
|
|
29352
29749
|
const encodedCdIdentifier = base64Encode(ConceptDescriptionRepositoryClient.requireIdentifier(cdIdentifier, "cdIdentifier"));
|
|
29353
29750
|
const response = await apiInstance.putConceptDescriptionByIdRaw({
|
|
29354
29751
|
cdIdentifier: encodedCdIdentifier,
|
|
@@ -29357,20 +29754,23 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29357
29754
|
if (response.raw.status === 204) return {
|
|
29358
29755
|
success: true,
|
|
29359
29756
|
data: void 0,
|
|
29360
|
-
statusCode: response.raw.status
|
|
29757
|
+
statusCode: response.raw.status,
|
|
29758
|
+
etag: getEtag(response.raw)
|
|
29361
29759
|
};
|
|
29362
29760
|
const result = await response.value();
|
|
29363
29761
|
return {
|
|
29364
29762
|
success: true,
|
|
29365
29763
|
data: result ? convertApiCDToCoreCD(result) : void 0,
|
|
29366
|
-
statusCode: response.raw.status
|
|
29764
|
+
statusCode: response.raw.status,
|
|
29765
|
+
etag: getEtag(response.raw)
|
|
29367
29766
|
};
|
|
29368
29767
|
} catch (err) {
|
|
29369
29768
|
const customError = await handleApiError(err);
|
|
29370
29769
|
return {
|
|
29371
29770
|
success: false,
|
|
29372
29771
|
error: customError,
|
|
29373
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29772
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29773
|
+
...getConditionalErrorFields(err)
|
|
29374
29774
|
};
|
|
29375
29775
|
}
|
|
29376
29776
|
}
|
|
@@ -29408,14 +29808,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29408
29808
|
pagedResult: result.paging_metadata,
|
|
29409
29809
|
result: conceptDescriptions
|
|
29410
29810
|
},
|
|
29411
|
-
statusCode: response.raw.status
|
|
29811
|
+
statusCode: response.raw.status,
|
|
29812
|
+
etag: getEtag(response.raw)
|
|
29412
29813
|
};
|
|
29413
29814
|
} catch (err) {
|
|
29414
29815
|
const customError = await handleApiError(err);
|
|
29415
29816
|
return {
|
|
29416
29817
|
success: false,
|
|
29417
29818
|
error: customError,
|
|
29418
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29819
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29820
|
+
...getConditionalErrorFields(err)
|
|
29419
29821
|
};
|
|
29420
29822
|
}
|
|
29421
29823
|
}
|
|
@@ -29435,14 +29837,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29435
29837
|
return {
|
|
29436
29838
|
success: true,
|
|
29437
29839
|
data: convertApiCDToCoreCD(await response.value()),
|
|
29438
|
-
statusCode: response.raw.status
|
|
29840
|
+
statusCode: response.raw.status,
|
|
29841
|
+
etag: getEtag(response.raw)
|
|
29439
29842
|
};
|
|
29440
29843
|
} catch (err) {
|
|
29441
29844
|
const customError = await handleApiError(err);
|
|
29442
29845
|
return {
|
|
29443
29846
|
success: false,
|
|
29444
29847
|
error: customError,
|
|
29445
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29848
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29849
|
+
...getConditionalErrorFields(err)
|
|
29446
29850
|
};
|
|
29447
29851
|
}
|
|
29448
29852
|
}
|
|
@@ -29468,14 +29872,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29468
29872
|
return {
|
|
29469
29873
|
success: true,
|
|
29470
29874
|
data: await response.value(),
|
|
29471
|
-
statusCode: response.raw.status
|
|
29875
|
+
statusCode: response.raw.status,
|
|
29876
|
+
etag: getEtag(response.raw)
|
|
29472
29877
|
};
|
|
29473
29878
|
} catch (err) {
|
|
29474
29879
|
const customError = await handleApiError(err);
|
|
29475
29880
|
return {
|
|
29476
29881
|
success: false,
|
|
29477
29882
|
error: customError,
|
|
29478
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29883
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29884
|
+
...getConditionalErrorFields(err)
|
|
29479
29885
|
};
|
|
29480
29886
|
}
|
|
29481
29887
|
}
|
|
@@ -29494,14 +29900,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29494
29900
|
return {
|
|
29495
29901
|
success: true,
|
|
29496
29902
|
data: await response.value(),
|
|
29497
|
-
statusCode: response.raw.status
|
|
29903
|
+
statusCode: response.raw.status,
|
|
29904
|
+
etag: getEtag(response.raw)
|
|
29498
29905
|
};
|
|
29499
29906
|
} catch (err) {
|
|
29500
29907
|
const customError = await handleApiError(err);
|
|
29501
29908
|
return {
|
|
29502
29909
|
success: false,
|
|
29503
29910
|
error: customError,
|
|
29504
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29911
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29912
|
+
...getConditionalErrorFields(err)
|
|
29505
29913
|
};
|
|
29506
29914
|
}
|
|
29507
29915
|
}
|
|
@@ -29547,14 +29955,16 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29547
29955
|
pagedResult: result.paging_metadata,
|
|
29548
29956
|
result: submodelDescriptors
|
|
29549
29957
|
},
|
|
29550
|
-
statusCode: response.raw.status
|
|
29958
|
+
statusCode: response.raw.status,
|
|
29959
|
+
etag: getEtag(response.raw)
|
|
29551
29960
|
};
|
|
29552
29961
|
} catch (err) {
|
|
29553
29962
|
const customError = await handleApiError(err);
|
|
29554
29963
|
return {
|
|
29555
29964
|
success: false,
|
|
29556
29965
|
error: customError,
|
|
29557
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
29966
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
29967
|
+
...getConditionalErrorFields(err)
|
|
29558
29968
|
};
|
|
29559
29969
|
}
|
|
29560
29970
|
}
|
|
@@ -29574,14 +29984,16 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29574
29984
|
return {
|
|
29575
29985
|
success: true,
|
|
29576
29986
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
29577
|
-
statusCode: response.raw.status
|
|
29987
|
+
statusCode: response.raw.status,
|
|
29988
|
+
etag: getEtag(response.raw)
|
|
29578
29989
|
};
|
|
29579
29990
|
} catch (err) {
|
|
29580
29991
|
const customError = await handleApiError(err);
|
|
29581
29992
|
return {
|
|
29582
29993
|
success: false,
|
|
29583
29994
|
error: customError,
|
|
29584
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
29995
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
29996
|
+
...getConditionalErrorFields(err)
|
|
29585
29997
|
};
|
|
29586
29998
|
}
|
|
29587
29999
|
}
|
|
@@ -29591,26 +30003,29 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29591
30003
|
* @param options Object containing:
|
|
29592
30004
|
* - configuration: The http request options
|
|
29593
30005
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
30006
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29594
30007
|
*
|
|
29595
30008
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29596
30009
|
*/
|
|
29597
30010
|
async deleteSubmodelDescriptorById(options) {
|
|
29598
|
-
const { configuration, submodelIdentifier } = options;
|
|
30011
|
+
const { configuration, submodelIdentifier, ifMatch } = options;
|
|
29599
30012
|
try {
|
|
29600
|
-
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration));
|
|
30013
|
+
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29601
30014
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29602
30015
|
const response = await apiInstance.deleteSubmodelDescriptorByIdRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
29603
30016
|
return {
|
|
29604
30017
|
success: true,
|
|
29605
30018
|
data: await response.value(),
|
|
29606
|
-
statusCode: response.raw.status
|
|
30019
|
+
statusCode: response.raw.status,
|
|
30020
|
+
etag: getEtag(response.raw)
|
|
29607
30021
|
};
|
|
29608
30022
|
} catch (err) {
|
|
29609
30023
|
const customError = await handleApiError(err);
|
|
29610
30024
|
return {
|
|
29611
30025
|
success: false,
|
|
29612
30026
|
error: customError,
|
|
29613
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30027
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30028
|
+
...getConditionalErrorFields(err)
|
|
29614
30029
|
};
|
|
29615
30030
|
}
|
|
29616
30031
|
}
|
|
@@ -29620,26 +30035,31 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29620
30035
|
* @param options Object containing:
|
|
29621
30036
|
* - configuration: The http request options
|
|
29622
30037
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
30038
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29623
30039
|
*
|
|
29624
30040
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29625
30041
|
*/
|
|
29626
30042
|
async getSubmodelDescriptorById(options) {
|
|
29627
|
-
const { configuration, submodelIdentifier } = options;
|
|
30043
|
+
const { configuration, submodelIdentifier, ifNoneMatch } = options;
|
|
29628
30044
|
try {
|
|
29629
|
-
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration));
|
|
30045
|
+
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
29630
30046
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29631
30047
|
const response = await apiInstance.getSubmodelDescriptorByIdRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
29632
30048
|
return {
|
|
29633
30049
|
success: true,
|
|
29634
30050
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
29635
|
-
statusCode: response.raw.status
|
|
30051
|
+
statusCode: response.raw.status,
|
|
30052
|
+
etag: getEtag(response.raw)
|
|
29636
30053
|
};
|
|
29637
30054
|
} catch (err) {
|
|
30055
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30056
|
+
if (notModified) return notModified;
|
|
29638
30057
|
const customError = await handleApiError(err);
|
|
29639
30058
|
return {
|
|
29640
30059
|
success: false,
|
|
29641
30060
|
error: customError,
|
|
29642
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30061
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30062
|
+
...getConditionalErrorFields(err)
|
|
29643
30063
|
};
|
|
29644
30064
|
}
|
|
29645
30065
|
}
|
|
@@ -29650,13 +30070,18 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29650
30070
|
* - configuration: The http request options
|
|
29651
30071
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
29652
30072
|
* - submodelDescriptor: Submodel Descriptor object
|
|
30073
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30074
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
29653
30075
|
*
|
|
29654
30076
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29655
30077
|
*/
|
|
29656
30078
|
async putSubmodelDescriptorById(options) {
|
|
29657
|
-
const { configuration, submodelIdentifier, submodelDescriptor } = options;
|
|
30079
|
+
const { configuration, submodelIdentifier, submodelDescriptor, ifMatch, ifNoneMatch } = options;
|
|
29658
30080
|
try {
|
|
29659
|
-
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration
|
|
30081
|
+
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration, {
|
|
30082
|
+
ifMatch,
|
|
30083
|
+
ifNoneMatch
|
|
30084
|
+
}));
|
|
29660
30085
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29661
30086
|
const response = await apiInstance.putSubmodelDescriptorByIdRaw({
|
|
29662
30087
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -29665,20 +30090,23 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29665
30090
|
if (response.raw.status === 204) return {
|
|
29666
30091
|
success: true,
|
|
29667
30092
|
data: void 0,
|
|
29668
|
-
statusCode: response.raw.status
|
|
30093
|
+
statusCode: response.raw.status,
|
|
30094
|
+
etag: getEtag(response.raw)
|
|
29669
30095
|
};
|
|
29670
30096
|
const result = await response.value();
|
|
29671
30097
|
return {
|
|
29672
30098
|
success: true,
|
|
29673
30099
|
data: result ? convertApiSubmodelDescriptorToCoreSubmodelDescriptor(result) : void 0,
|
|
29674
|
-
statusCode: response.raw.status
|
|
30100
|
+
statusCode: response.raw.status,
|
|
30101
|
+
etag: getEtag(response.raw)
|
|
29675
30102
|
};
|
|
29676
30103
|
} catch (err) {
|
|
29677
30104
|
const customError = await handleApiError(err);
|
|
29678
30105
|
return {
|
|
29679
30106
|
success: false,
|
|
29680
30107
|
error: customError,
|
|
29681
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30108
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30109
|
+
...getConditionalErrorFields(err)
|
|
29682
30110
|
};
|
|
29683
30111
|
}
|
|
29684
30112
|
}
|
|
@@ -29697,14 +30125,16 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29697
30125
|
return {
|
|
29698
30126
|
success: true,
|
|
29699
30127
|
data: await response.value(),
|
|
29700
|
-
statusCode: response.raw.status
|
|
30128
|
+
statusCode: response.raw.status,
|
|
30129
|
+
etag: getEtag(response.raw)
|
|
29701
30130
|
};
|
|
29702
30131
|
} catch (err) {
|
|
29703
30132
|
const customError = await handleApiError(err);
|
|
29704
30133
|
return {
|
|
29705
30134
|
success: false,
|
|
29706
30135
|
error: customError,
|
|
29707
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30136
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30137
|
+
...getConditionalErrorFields(err)
|
|
29708
30138
|
};
|
|
29709
30139
|
}
|
|
29710
30140
|
}
|
|
@@ -29760,14 +30190,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29760
30190
|
pagedResult: result.paging_metadata,
|
|
29761
30191
|
result: submodels
|
|
29762
30192
|
},
|
|
29763
|
-
statusCode: response.raw.status
|
|
30193
|
+
statusCode: response.raw.status,
|
|
30194
|
+
etag: getEtag(response.raw)
|
|
29764
30195
|
};
|
|
29765
30196
|
} catch (err) {
|
|
29766
30197
|
const customError = await handleApiError(err);
|
|
29767
30198
|
return {
|
|
29768
30199
|
success: false,
|
|
29769
30200
|
error: customError,
|
|
29770
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30201
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30202
|
+
...getConditionalErrorFields(err)
|
|
29771
30203
|
};
|
|
29772
30204
|
}
|
|
29773
30205
|
}
|
|
@@ -29797,14 +30229,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29797
30229
|
return {
|
|
29798
30230
|
success: true,
|
|
29799
30231
|
data: await response.value(),
|
|
29800
|
-
statusCode: response.raw.status
|
|
30232
|
+
statusCode: response.raw.status,
|
|
30233
|
+
etag: getEtag(response.raw)
|
|
29801
30234
|
};
|
|
29802
30235
|
} catch (err) {
|
|
29803
30236
|
const customError = await handleApiError(err);
|
|
29804
30237
|
return {
|
|
29805
30238
|
success: false,
|
|
29806
30239
|
error: customError,
|
|
29807
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30240
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30241
|
+
...getConditionalErrorFields(err)
|
|
29808
30242
|
};
|
|
29809
30243
|
}
|
|
29810
30244
|
}
|
|
@@ -29838,14 +30272,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29838
30272
|
return {
|
|
29839
30273
|
success: true,
|
|
29840
30274
|
data: await response.value(),
|
|
29841
|
-
statusCode: response.raw.status
|
|
30275
|
+
statusCode: response.raw.status,
|
|
30276
|
+
etag: getEtag(response.raw)
|
|
29842
30277
|
};
|
|
29843
30278
|
} catch (err) {
|
|
29844
30279
|
const customError = await handleApiError(err);
|
|
29845
30280
|
return {
|
|
29846
30281
|
success: false,
|
|
29847
30282
|
error: customError,
|
|
29848
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30283
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30284
|
+
...getConditionalErrorFields(err)
|
|
29849
30285
|
};
|
|
29850
30286
|
}
|
|
29851
30287
|
}
|
|
@@ -29877,14 +30313,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29877
30313
|
return {
|
|
29878
30314
|
success: true,
|
|
29879
30315
|
data: await response.value(),
|
|
29880
|
-
statusCode: response.raw.status
|
|
30316
|
+
statusCode: response.raw.status,
|
|
30317
|
+
etag: getEtag(response.raw)
|
|
29881
30318
|
};
|
|
29882
30319
|
} catch (err) {
|
|
29883
30320
|
const customError = await handleApiError(err);
|
|
29884
30321
|
return {
|
|
29885
30322
|
success: false,
|
|
29886
30323
|
error: customError,
|
|
29887
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30324
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30325
|
+
...getConditionalErrorFields(err)
|
|
29888
30326
|
};
|
|
29889
30327
|
}
|
|
29890
30328
|
}
|
|
@@ -29916,14 +30354,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29916
30354
|
return {
|
|
29917
30355
|
success: true,
|
|
29918
30356
|
data: await response.value(),
|
|
29919
|
-
statusCode: response.raw.status
|
|
30357
|
+
statusCode: response.raw.status,
|
|
30358
|
+
etag: getEtag(response.raw)
|
|
29920
30359
|
};
|
|
29921
30360
|
} catch (err) {
|
|
29922
30361
|
const customError = await handleApiError(err);
|
|
29923
30362
|
return {
|
|
29924
30363
|
success: false,
|
|
29925
30364
|
error: customError,
|
|
29926
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30365
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30366
|
+
...getConditionalErrorFields(err)
|
|
29927
30367
|
};
|
|
29928
30368
|
}
|
|
29929
30369
|
}
|
|
@@ -29943,14 +30383,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29943
30383
|
return {
|
|
29944
30384
|
success: true,
|
|
29945
30385
|
data: convertApiSubmodelToCoreSubmodel(await response.value()),
|
|
29946
|
-
statusCode: response.raw.status
|
|
30386
|
+
statusCode: response.raw.status,
|
|
30387
|
+
etag: getEtag(response.raw)
|
|
29947
30388
|
};
|
|
29948
30389
|
} catch (err) {
|
|
29949
30390
|
const customError = await handleApiError(err);
|
|
29950
30391
|
return {
|
|
29951
30392
|
success: false,
|
|
29952
30393
|
error: customError,
|
|
29953
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30394
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30395
|
+
...getConditionalErrorFields(err)
|
|
29954
30396
|
};
|
|
29955
30397
|
}
|
|
29956
30398
|
}
|
|
@@ -29960,26 +30402,29 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29960
30402
|
* @param options Object containing:
|
|
29961
30403
|
* - configuration: The http request options
|
|
29962
30404
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30405
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29963
30406
|
*
|
|
29964
30407
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29965
30408
|
*/
|
|
29966
30409
|
async deleteSubmodelById(options) {
|
|
29967
|
-
const { configuration, submodelIdentifier } = options;
|
|
30410
|
+
const { configuration, submodelIdentifier, ifMatch } = options;
|
|
29968
30411
|
try {
|
|
29969
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30412
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29970
30413
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29971
30414
|
const response = await apiInstance.deleteSubmodelByIdRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
29972
30415
|
return {
|
|
29973
30416
|
success: true,
|
|
29974
30417
|
data: await response.value(),
|
|
29975
|
-
statusCode: response.raw.status
|
|
30418
|
+
statusCode: response.raw.status,
|
|
30419
|
+
etag: getEtag(response.raw)
|
|
29976
30420
|
};
|
|
29977
30421
|
} catch (err) {
|
|
29978
30422
|
const customError = await handleApiError(err);
|
|
29979
30423
|
return {
|
|
29980
30424
|
success: false,
|
|
29981
30425
|
error: customError,
|
|
29982
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30426
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30427
|
+
...getConditionalErrorFields(err)
|
|
29983
30428
|
};
|
|
29984
30429
|
}
|
|
29985
30430
|
}
|
|
@@ -29991,13 +30436,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29991
30436
|
* - submodelIdentifier: The Submodel’s unique id
|
|
29992
30437
|
* - level?: Determines the structural depth of the respective resource content
|
|
29993
30438
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30439
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29994
30440
|
*
|
|
29995
30441
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29996
30442
|
*/
|
|
29997
30443
|
async getSubmodelById(options) {
|
|
29998
|
-
const { configuration, submodelIdentifier, level, extent } = options;
|
|
30444
|
+
const { configuration, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
29999
30445
|
try {
|
|
30000
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30446
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30001
30447
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30002
30448
|
const response = await apiInstance.getSubmodelByIdRaw({
|
|
30003
30449
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30007,14 +30453,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30007
30453
|
return {
|
|
30008
30454
|
success: true,
|
|
30009
30455
|
data: convertApiSubmodelToCoreSubmodel(await response.value()),
|
|
30010
|
-
statusCode: response.raw.status
|
|
30456
|
+
statusCode: response.raw.status,
|
|
30457
|
+
etag: getEtag(response.raw)
|
|
30011
30458
|
};
|
|
30012
30459
|
} catch (err) {
|
|
30460
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30461
|
+
if (notModified) return notModified;
|
|
30013
30462
|
const customError = await handleApiError(err);
|
|
30014
30463
|
return {
|
|
30015
30464
|
success: false,
|
|
30016
30465
|
error: customError,
|
|
30017
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30466
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30467
|
+
...getConditionalErrorFields(err)
|
|
30018
30468
|
};
|
|
30019
30469
|
}
|
|
30020
30470
|
}
|
|
@@ -30024,26 +30474,31 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30024
30474
|
* @param options Object containing:
|
|
30025
30475
|
* - configuration: The http request options
|
|
30026
30476
|
* - submodelIdentifier: The Submodel's unique id
|
|
30477
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30027
30478
|
*
|
|
30028
30479
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30029
30480
|
*/
|
|
30030
30481
|
async getSubmodelByIdReference(options) {
|
|
30031
|
-
const { configuration, submodelIdentifier } = options;
|
|
30482
|
+
const { configuration, submodelIdentifier, ifNoneMatch } = options;
|
|
30032
30483
|
try {
|
|
30033
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30484
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30034
30485
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30035
30486
|
const response = await apiInstance.getSubmodelByIdReferenceRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
30036
30487
|
return {
|
|
30037
30488
|
success: true,
|
|
30038
30489
|
data: await response.value(),
|
|
30039
|
-
statusCode: response.raw.status
|
|
30490
|
+
statusCode: response.raw.status,
|
|
30491
|
+
etag: getEtag(response.raw)
|
|
30040
30492
|
};
|
|
30041
30493
|
} catch (err) {
|
|
30494
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30495
|
+
if (notModified) return notModified;
|
|
30042
30496
|
const customError = await handleApiError(err);
|
|
30043
30497
|
return {
|
|
30044
30498
|
success: false,
|
|
30045
30499
|
error: customError,
|
|
30046
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30500
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30501
|
+
...getConditionalErrorFields(err)
|
|
30047
30502
|
};
|
|
30048
30503
|
}
|
|
30049
30504
|
}
|
|
@@ -30054,13 +30509,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30054
30509
|
* - configuration: The http request options
|
|
30055
30510
|
* - submodelIdentifier: The Submodel's unique id
|
|
30056
30511
|
* - level?: Determines the structural depth of the respective resource content
|
|
30512
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30057
30513
|
*
|
|
30058
30514
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30059
30515
|
*/
|
|
30060
30516
|
async getSubmodelByIdPath(options) {
|
|
30061
|
-
const { configuration, submodelIdentifier, level } = options;
|
|
30517
|
+
const { configuration, submodelIdentifier, level, ifNoneMatch } = options;
|
|
30062
30518
|
try {
|
|
30063
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30519
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30064
30520
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30065
30521
|
const response = await apiInstance.getSubmodelByIdPathRaw({
|
|
30066
30522
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30069,14 +30525,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30069
30525
|
return {
|
|
30070
30526
|
success: true,
|
|
30071
30527
|
data: await response.value(),
|
|
30072
|
-
statusCode: response.raw.status
|
|
30528
|
+
statusCode: response.raw.status,
|
|
30529
|
+
etag: getEtag(response.raw)
|
|
30073
30530
|
};
|
|
30074
30531
|
} catch (err) {
|
|
30532
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30533
|
+
if (notModified) return notModified;
|
|
30075
30534
|
const customError = await handleApiError(err);
|
|
30076
30535
|
return {
|
|
30077
30536
|
success: false,
|
|
30078
30537
|
error: customError,
|
|
30079
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30538
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30539
|
+
...getConditionalErrorFields(err)
|
|
30080
30540
|
};
|
|
30081
30541
|
}
|
|
30082
30542
|
}
|
|
@@ -30087,13 +30547,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30087
30547
|
* - configuration: The http request options
|
|
30088
30548
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30089
30549
|
* - submodel: Submodel object
|
|
30550
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30551
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
30090
30552
|
*
|
|
30091
30553
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30092
30554
|
*/
|
|
30093
30555
|
async putSubmodelById(options) {
|
|
30094
|
-
const { configuration, submodelIdentifier, submodel } = options;
|
|
30556
|
+
const { configuration, submodelIdentifier, submodel, ifMatch, ifNoneMatch } = options;
|
|
30095
30557
|
try {
|
|
30096
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration
|
|
30558
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, {
|
|
30559
|
+
ifMatch,
|
|
30560
|
+
ifNoneMatch
|
|
30561
|
+
}));
|
|
30097
30562
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30098
30563
|
const response = await apiInstance.putSubmodelByIdRaw({
|
|
30099
30564
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30102,20 +30567,23 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30102
30567
|
if (response.raw.status === 204) return {
|
|
30103
30568
|
success: true,
|
|
30104
30569
|
data: void 0,
|
|
30105
|
-
statusCode: response.raw.status
|
|
30570
|
+
statusCode: response.raw.status,
|
|
30571
|
+
etag: getEtag(response.raw)
|
|
30106
30572
|
};
|
|
30107
30573
|
const result = await response.value();
|
|
30108
30574
|
return {
|
|
30109
30575
|
success: true,
|
|
30110
30576
|
data: result ? convertApiSubmodelToCoreSubmodel(result) : void 0,
|
|
30111
|
-
statusCode: response.raw.status
|
|
30577
|
+
statusCode: response.raw.status,
|
|
30578
|
+
etag: getEtag(response.raw)
|
|
30112
30579
|
};
|
|
30113
30580
|
} catch (err) {
|
|
30114
30581
|
const customError = await handleApiError(err);
|
|
30115
30582
|
return {
|
|
30116
30583
|
success: false,
|
|
30117
30584
|
error: customError,
|
|
30118
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30585
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30586
|
+
...getConditionalErrorFields(err)
|
|
30119
30587
|
};
|
|
30120
30588
|
}
|
|
30121
30589
|
}
|
|
@@ -30127,13 +30595,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30127
30595
|
* - submodelIdentifier: The Submodel's unique id
|
|
30128
30596
|
* - submodel: Submodel object
|
|
30129
30597
|
* - level?: Determines the structural depth of the respective resource content
|
|
30598
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30130
30599
|
*
|
|
30131
30600
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30132
30601
|
*/
|
|
30133
30602
|
async patchSubmodelById(options) {
|
|
30134
|
-
const { configuration, submodelIdentifier, submodel, level } = options;
|
|
30603
|
+
const { configuration, submodelIdentifier, submodel, level, ifMatch } = options;
|
|
30135
30604
|
try {
|
|
30136
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30605
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30137
30606
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30138
30607
|
const response = await apiInstance.patchSubmodelByIdRaw({
|
|
30139
30608
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30143,14 +30612,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30143
30612
|
return {
|
|
30144
30613
|
success: true,
|
|
30145
30614
|
data: await response.value(),
|
|
30146
|
-
statusCode: response.raw.status
|
|
30615
|
+
statusCode: response.raw.status,
|
|
30616
|
+
etag: getEtag(response.raw)
|
|
30147
30617
|
};
|
|
30148
30618
|
} catch (err) {
|
|
30149
30619
|
const customError = await handleApiError(err);
|
|
30150
30620
|
return {
|
|
30151
30621
|
success: false,
|
|
30152
30622
|
error: customError,
|
|
30153
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30623
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30624
|
+
...getConditionalErrorFields(err)
|
|
30154
30625
|
};
|
|
30155
30626
|
}
|
|
30156
30627
|
}
|
|
@@ -30164,13 +30635,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30164
30635
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30165
30636
|
* - level?: Determines the structural depth of the respective resource content
|
|
30166
30637
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30638
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30167
30639
|
*
|
|
30168
30640
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30169
30641
|
*/
|
|
30170
30642
|
async getAllSubmodelElements(options) {
|
|
30171
|
-
const { configuration, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
30643
|
+
const { configuration, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
30172
30644
|
try {
|
|
30173
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30645
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30174
30646
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30175
30647
|
const response = await apiInstance.getAllSubmodelElementsRaw({
|
|
30176
30648
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30187,14 +30659,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30187
30659
|
pagedResult: result.paging_metadata,
|
|
30188
30660
|
result: submodelElements
|
|
30189
30661
|
},
|
|
30190
|
-
statusCode: response.raw.status
|
|
30662
|
+
statusCode: response.raw.status,
|
|
30663
|
+
etag: getEtag(response.raw)
|
|
30191
30664
|
};
|
|
30192
30665
|
} catch (err) {
|
|
30666
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30667
|
+
if (notModified) return notModified;
|
|
30193
30668
|
const customError = await handleApiError(err);
|
|
30194
30669
|
return {
|
|
30195
30670
|
success: false,
|
|
30196
30671
|
error: customError,
|
|
30197
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30672
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30673
|
+
...getConditionalErrorFields(err)
|
|
30198
30674
|
};
|
|
30199
30675
|
}
|
|
30200
30676
|
}
|
|
@@ -30206,13 +30682,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30206
30682
|
* - submodelIdentifier: The Submodel's unique id
|
|
30207
30683
|
* - limit?: The maximum number of elements in the response array
|
|
30208
30684
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30685
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30209
30686
|
*
|
|
30210
30687
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30211
30688
|
*/
|
|
30212
30689
|
async getAllSubmodelElementsMetadata(options) {
|
|
30213
|
-
const { configuration, submodelIdentifier, limit, cursor } = options;
|
|
30690
|
+
const { configuration, submodelIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
30214
30691
|
try {
|
|
30215
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30692
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30216
30693
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30217
30694
|
const response = await apiInstance.getAllSubmodelElementsMetadataSubmodelRepoRaw({
|
|
30218
30695
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30222,14 +30699,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30222
30699
|
return {
|
|
30223
30700
|
success: true,
|
|
30224
30701
|
data: await response.value(),
|
|
30225
|
-
statusCode: response.raw.status
|
|
30702
|
+
statusCode: response.raw.status,
|
|
30703
|
+
etag: getEtag(response.raw)
|
|
30226
30704
|
};
|
|
30227
30705
|
} catch (err) {
|
|
30706
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30707
|
+
if (notModified) return notModified;
|
|
30228
30708
|
const customError = await handleApiError(err);
|
|
30229
30709
|
return {
|
|
30230
30710
|
success: false,
|
|
30231
30711
|
error: customError,
|
|
30232
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30712
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30713
|
+
...getConditionalErrorFields(err)
|
|
30233
30714
|
};
|
|
30234
30715
|
}
|
|
30235
30716
|
}
|
|
@@ -30243,13 +30724,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30243
30724
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30244
30725
|
* - level?: Determines the structural depth of the respective resource content
|
|
30245
30726
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30727
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30246
30728
|
*
|
|
30247
30729
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30248
30730
|
*/
|
|
30249
30731
|
async getAllSubmodelElementsValueOnly(options) {
|
|
30250
|
-
const { configuration, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
30732
|
+
const { configuration, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
30251
30733
|
try {
|
|
30252
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30734
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30253
30735
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30254
30736
|
const response = await apiInstance.getAllSubmodelElementsValueOnlySubmodelRepoRaw({
|
|
30255
30737
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30261,14 +30743,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30261
30743
|
return {
|
|
30262
30744
|
success: true,
|
|
30263
30745
|
data: await response.value(),
|
|
30264
|
-
statusCode: response.raw.status
|
|
30746
|
+
statusCode: response.raw.status,
|
|
30747
|
+
etag: getEtag(response.raw)
|
|
30265
30748
|
};
|
|
30266
30749
|
} catch (err) {
|
|
30750
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30751
|
+
if (notModified) return notModified;
|
|
30267
30752
|
const customError = await handleApiError(err);
|
|
30268
30753
|
return {
|
|
30269
30754
|
success: false,
|
|
30270
30755
|
error: customError,
|
|
30271
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30756
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30757
|
+
...getConditionalErrorFields(err)
|
|
30272
30758
|
};
|
|
30273
30759
|
}
|
|
30274
30760
|
}
|
|
@@ -30281,13 +30767,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30281
30767
|
* - limit?: The maximum number of elements in the response array
|
|
30282
30768
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30283
30769
|
* - level?: Determines the structural depth of the respective resource content
|
|
30770
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30284
30771
|
*
|
|
30285
30772
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30286
30773
|
*/
|
|
30287
30774
|
async getAllSubmodelElementsReference(options) {
|
|
30288
|
-
const { configuration, submodelIdentifier, limit, cursor, level } = options;
|
|
30775
|
+
const { configuration, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
30289
30776
|
try {
|
|
30290
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30777
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30291
30778
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30292
30779
|
const response = await apiInstance.getAllSubmodelElementsReferenceSubmodelRepoRaw({
|
|
30293
30780
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30298,14 +30785,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30298
30785
|
return {
|
|
30299
30786
|
success: true,
|
|
30300
30787
|
data: await response.value(),
|
|
30301
|
-
statusCode: response.raw.status
|
|
30788
|
+
statusCode: response.raw.status,
|
|
30789
|
+
etag: getEtag(response.raw)
|
|
30302
30790
|
};
|
|
30303
30791
|
} catch (err) {
|
|
30792
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30793
|
+
if (notModified) return notModified;
|
|
30304
30794
|
const customError = await handleApiError(err);
|
|
30305
30795
|
return {
|
|
30306
30796
|
success: false,
|
|
30307
30797
|
error: customError,
|
|
30308
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30798
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30799
|
+
...getConditionalErrorFields(err)
|
|
30309
30800
|
};
|
|
30310
30801
|
}
|
|
30311
30802
|
}
|
|
@@ -30318,13 +30809,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30318
30809
|
* - limit?: The maximum number of elements in the response array
|
|
30319
30810
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30320
30811
|
* - level?: Determines the structural depth of the respective resource content
|
|
30812
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30321
30813
|
*
|
|
30322
30814
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30323
30815
|
*/
|
|
30324
30816
|
async getAllSubmodelElementsPath(options) {
|
|
30325
|
-
const { configuration, submodelIdentifier, limit, cursor, level } = options;
|
|
30817
|
+
const { configuration, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
30326
30818
|
try {
|
|
30327
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30819
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30328
30820
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30329
30821
|
const response = await apiInstance.getAllSubmodelElementsPathSubmodelRepoRaw({
|
|
30330
30822
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30335,14 +30827,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30335
30827
|
return {
|
|
30336
30828
|
success: true,
|
|
30337
30829
|
data: await response.value(),
|
|
30338
|
-
statusCode: response.raw.status
|
|
30830
|
+
statusCode: response.raw.status,
|
|
30831
|
+
etag: getEtag(response.raw)
|
|
30339
30832
|
};
|
|
30340
30833
|
} catch (err) {
|
|
30834
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30835
|
+
if (notModified) return notModified;
|
|
30341
30836
|
const customError = await handleApiError(err);
|
|
30342
30837
|
return {
|
|
30343
30838
|
success: false,
|
|
30344
30839
|
error: customError,
|
|
30345
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30840
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30841
|
+
...getConditionalErrorFields(err)
|
|
30346
30842
|
};
|
|
30347
30843
|
}
|
|
30348
30844
|
}
|
|
@@ -30352,13 +30848,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30352
30848
|
* @param options Object containing:
|
|
30353
30849
|
* - configuration: The http request options
|
|
30354
30850
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30851
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30355
30852
|
*
|
|
30356
30853
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30357
30854
|
*/
|
|
30358
30855
|
async postSubmodelElement(options) {
|
|
30359
|
-
const { configuration, submodelIdentifier, submodelElement } = options;
|
|
30856
|
+
const { configuration, submodelIdentifier, submodelElement, ifMatch } = options;
|
|
30360
30857
|
try {
|
|
30361
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30858
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30362
30859
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30363
30860
|
const response = await apiInstance.postSubmodelElementSubmodelRepoRaw({
|
|
30364
30861
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30367,14 +30864,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30367
30864
|
return {
|
|
30368
30865
|
success: true,
|
|
30369
30866
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
30370
|
-
statusCode: response.raw.status
|
|
30867
|
+
statusCode: response.raw.status,
|
|
30868
|
+
etag: getEtag(response.raw)
|
|
30371
30869
|
};
|
|
30372
30870
|
} catch (err) {
|
|
30373
30871
|
const customError = await handleApiError(err);
|
|
30374
30872
|
return {
|
|
30375
30873
|
success: false,
|
|
30376
30874
|
error: customError,
|
|
30377
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30875
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30876
|
+
...getConditionalErrorFields(err)
|
|
30378
30877
|
};
|
|
30379
30878
|
}
|
|
30380
30879
|
}
|
|
@@ -30387,13 +30886,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30387
30886
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30388
30887
|
* - level?: Determines the structural depth of the respective resource content
|
|
30389
30888
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30889
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30390
30890
|
*
|
|
30391
30891
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30392
30892
|
*/
|
|
30393
30893
|
async getSubmodelElementByPath(options) {
|
|
30394
|
-
const { configuration, submodelIdentifier, idShortPath, level, extent } = options;
|
|
30894
|
+
const { configuration, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
30395
30895
|
try {
|
|
30396
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30896
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30397
30897
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30398
30898
|
const response = await apiInstance.getSubmodelElementByPathSubmodelRepoRaw({
|
|
30399
30899
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30404,14 +30904,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30404
30904
|
return {
|
|
30405
30905
|
success: true,
|
|
30406
30906
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
30407
|
-
statusCode: response.raw.status
|
|
30907
|
+
statusCode: response.raw.status,
|
|
30908
|
+
etag: getEtag(response.raw)
|
|
30408
30909
|
};
|
|
30409
30910
|
} catch (err) {
|
|
30911
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30912
|
+
if (notModified) return notModified;
|
|
30410
30913
|
const customError = await handleApiError(err);
|
|
30411
30914
|
return {
|
|
30412
30915
|
success: false,
|
|
30413
30916
|
error: customError,
|
|
30414
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30917
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30918
|
+
...getConditionalErrorFields(err)
|
|
30415
30919
|
};
|
|
30416
30920
|
}
|
|
30417
30921
|
}
|
|
@@ -30422,13 +30926,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30422
30926
|
* - configuration: The http request options
|
|
30423
30927
|
* - submodelIdentifier: The Submodel's unique id
|
|
30424
30928
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30929
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30425
30930
|
*
|
|
30426
30931
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30427
30932
|
*/
|
|
30428
30933
|
async getSubmodelElementByPathMetadata(options) {
|
|
30429
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
30934
|
+
const { configuration, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
30430
30935
|
try {
|
|
30431
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30936
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30432
30937
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30433
30938
|
const response = await apiInstance.getSubmodelElementByPathMetadataSubmodelRepoRaw({
|
|
30434
30939
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30437,14 +30942,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30437
30942
|
return {
|
|
30438
30943
|
success: true,
|
|
30439
30944
|
data: await response.value(),
|
|
30440
|
-
statusCode: response.raw.status
|
|
30945
|
+
statusCode: response.raw.status,
|
|
30946
|
+
etag: getEtag(response.raw)
|
|
30441
30947
|
};
|
|
30442
30948
|
} catch (err) {
|
|
30949
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30950
|
+
if (notModified) return notModified;
|
|
30443
30951
|
const customError = await handleApiError(err);
|
|
30444
30952
|
return {
|
|
30445
30953
|
success: false,
|
|
30446
30954
|
error: customError,
|
|
30447
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30955
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30956
|
+
...getConditionalErrorFields(err)
|
|
30448
30957
|
};
|
|
30449
30958
|
}
|
|
30450
30959
|
}
|
|
@@ -30455,13 +30964,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30455
30964
|
* - configuration: The http request options
|
|
30456
30965
|
* - submodelIdentifier: The Submodel's unique id
|
|
30457
30966
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30967
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30458
30968
|
*
|
|
30459
30969
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30460
30970
|
*/
|
|
30461
30971
|
async getSubmodelElementByPathReference(options) {
|
|
30462
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
30972
|
+
const { configuration, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
30463
30973
|
try {
|
|
30464
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30974
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30465
30975
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30466
30976
|
const response = await apiInstance.getSubmodelElementByPathReferenceSubmodelRepoRaw({
|
|
30467
30977
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30470,14 +30980,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30470
30980
|
return {
|
|
30471
30981
|
success: true,
|
|
30472
30982
|
data: await response.value(),
|
|
30473
|
-
statusCode: response.raw.status
|
|
30983
|
+
statusCode: response.raw.status,
|
|
30984
|
+
etag: getEtag(response.raw)
|
|
30474
30985
|
};
|
|
30475
30986
|
} catch (err) {
|
|
30987
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30988
|
+
if (notModified) return notModified;
|
|
30476
30989
|
const customError = await handleApiError(err);
|
|
30477
30990
|
return {
|
|
30478
30991
|
success: false,
|
|
30479
30992
|
error: customError,
|
|
30480
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30993
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30994
|
+
...getConditionalErrorFields(err)
|
|
30481
30995
|
};
|
|
30482
30996
|
}
|
|
30483
30997
|
}
|
|
@@ -30489,13 +31003,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30489
31003
|
* - submodelIdentifier: The Submodel's unique id
|
|
30490
31004
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30491
31005
|
* - level?: Determines the structural depth of the respective resource content
|
|
31006
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30492
31007
|
*
|
|
30493
31008
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30494
31009
|
*/
|
|
30495
31010
|
async getSubmodelElementByPathPath(options) {
|
|
30496
|
-
const { configuration, submodelIdentifier, idShortPath, level } = options;
|
|
31011
|
+
const { configuration, submodelIdentifier, idShortPath, level, ifNoneMatch } = options;
|
|
30497
31012
|
try {
|
|
30498
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31013
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30499
31014
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30500
31015
|
const response = await apiInstance.getSubmodelElementByPathPathSubmodelRepoRaw({
|
|
30501
31016
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30505,14 +31020,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30505
31020
|
return {
|
|
30506
31021
|
success: true,
|
|
30507
31022
|
data: await response.value(),
|
|
30508
|
-
statusCode: response.raw.status
|
|
31023
|
+
statusCode: response.raw.status,
|
|
31024
|
+
etag: getEtag(response.raw)
|
|
30509
31025
|
};
|
|
30510
31026
|
} catch (err) {
|
|
31027
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31028
|
+
if (notModified) return notModified;
|
|
30511
31029
|
const customError = await handleApiError(err);
|
|
30512
31030
|
return {
|
|
30513
31031
|
success: false,
|
|
30514
31032
|
error: customError,
|
|
30515
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31033
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31034
|
+
...getConditionalErrorFields(err)
|
|
30516
31035
|
};
|
|
30517
31036
|
}
|
|
30518
31037
|
}
|
|
@@ -30524,13 +31043,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30524
31043
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30525
31044
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30526
31045
|
* - submodelElement: SubmodelElement object
|
|
31046
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30527
31047
|
*
|
|
30528
31048
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30529
31049
|
*/
|
|
30530
31050
|
async postSubmodelElementByPath(options) {
|
|
30531
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
31051
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElement, ifMatch } = options;
|
|
30532
31052
|
try {
|
|
30533
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31053
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30534
31054
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30535
31055
|
const response = await apiInstance.postSubmodelElementByPathSubmodelRepoRaw({
|
|
30536
31056
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30540,14 +31060,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30540
31060
|
return {
|
|
30541
31061
|
success: true,
|
|
30542
31062
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
30543
|
-
statusCode: response.raw.status
|
|
31063
|
+
statusCode: response.raw.status,
|
|
31064
|
+
etag: getEtag(response.raw)
|
|
30544
31065
|
};
|
|
30545
31066
|
} catch (err) {
|
|
30546
31067
|
const customError = await handleApiError(err);
|
|
30547
31068
|
return {
|
|
30548
31069
|
success: false,
|
|
30549
31070
|
error: customError,
|
|
30550
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31071
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31072
|
+
...getConditionalErrorFields(err)
|
|
30551
31073
|
};
|
|
30552
31074
|
}
|
|
30553
31075
|
}
|
|
@@ -30558,13 +31080,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30558
31080
|
* - configuration: The http request options.
|
|
30559
31081
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30560
31082
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31083
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30561
31084
|
*
|
|
30562
31085
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30563
31086
|
*/
|
|
30564
31087
|
async deleteSubmodelElementByPath(options) {
|
|
30565
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
31088
|
+
const { configuration, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
30566
31089
|
try {
|
|
30567
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31090
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30568
31091
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30569
31092
|
const response = await apiInstance.deleteSubmodelElementByPathSubmodelRepoRaw({
|
|
30570
31093
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30573,14 +31096,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30573
31096
|
return {
|
|
30574
31097
|
success: true,
|
|
30575
31098
|
data: await response.value(),
|
|
30576
|
-
statusCode: response.raw.status
|
|
31099
|
+
statusCode: response.raw.status,
|
|
31100
|
+
etag: getEtag(response.raw)
|
|
30577
31101
|
};
|
|
30578
31102
|
} catch (err) {
|
|
30579
31103
|
const customError = await handleApiError(err);
|
|
30580
31104
|
return {
|
|
30581
31105
|
success: false,
|
|
30582
31106
|
error: customError,
|
|
30583
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31107
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31108
|
+
...getConditionalErrorFields(err)
|
|
30584
31109
|
};
|
|
30585
31110
|
}
|
|
30586
31111
|
}
|
|
@@ -30593,13 +31118,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30593
31118
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30594
31119
|
* - submodelElement: SubmodelElement object
|
|
30595
31120
|
* - level?: Determines the structural depth of the respective resource content
|
|
31121
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31122
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
30596
31123
|
*
|
|
30597
31124
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30598
31125
|
*/
|
|
30599
31126
|
async putSubmodelElementByPath(options) {
|
|
30600
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
31127
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElement, level, ifMatch, ifNoneMatch } = options;
|
|
30601
31128
|
try {
|
|
30602
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration
|
|
31129
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, {
|
|
31130
|
+
ifMatch,
|
|
31131
|
+
ifNoneMatch
|
|
31132
|
+
}));
|
|
30603
31133
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30604
31134
|
const response = await apiInstance.putSubmodelElementByPathSubmodelRepoRaw({
|
|
30605
31135
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30610,20 +31140,23 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30610
31140
|
if (response.raw.status === 204) return {
|
|
30611
31141
|
success: true,
|
|
30612
31142
|
data: void 0,
|
|
30613
|
-
statusCode: response.raw.status
|
|
31143
|
+
statusCode: response.raw.status,
|
|
31144
|
+
etag: getEtag(response.raw)
|
|
30614
31145
|
};
|
|
30615
31146
|
const result = await response.value();
|
|
30616
31147
|
return {
|
|
30617
31148
|
success: true,
|
|
30618
31149
|
data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : void 0,
|
|
30619
|
-
statusCode: response.raw.status
|
|
31150
|
+
statusCode: response.raw.status,
|
|
31151
|
+
etag: getEtag(response.raw)
|
|
30620
31152
|
};
|
|
30621
31153
|
} catch (err) {
|
|
30622
31154
|
const customError = await handleApiError(err);
|
|
30623
31155
|
return {
|
|
30624
31156
|
success: false,
|
|
30625
31157
|
error: customError,
|
|
30626
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31158
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31159
|
+
...getConditionalErrorFields(err)
|
|
30627
31160
|
};
|
|
30628
31161
|
}
|
|
30629
31162
|
}
|
|
@@ -30636,13 +31169,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30636
31169
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30637
31170
|
* - submodelElement: SubmodelElement object
|
|
30638
31171
|
* - level?: Determines the structural depth of the respective resource content
|
|
31172
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30639
31173
|
*
|
|
30640
31174
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30641
31175
|
*/
|
|
30642
31176
|
async patchSubmodelElementByPath(options) {
|
|
30643
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
31177
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElement, level, ifMatch } = options;
|
|
30644
31178
|
try {
|
|
30645
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31179
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30646
31180
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30647
31181
|
const response = await apiInstance.patchSubmodelElementByPathSubmodelRepoRaw({
|
|
30648
31182
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30653,14 +31187,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30653
31187
|
return {
|
|
30654
31188
|
success: true,
|
|
30655
31189
|
data: await response.value(),
|
|
30656
|
-
statusCode: response.raw.status
|
|
31190
|
+
statusCode: response.raw.status,
|
|
31191
|
+
etag: getEtag(response.raw)
|
|
30657
31192
|
};
|
|
30658
31193
|
} catch (err) {
|
|
30659
31194
|
const customError = await handleApiError(err);
|
|
30660
31195
|
return {
|
|
30661
31196
|
success: false,
|
|
30662
31197
|
error: customError,
|
|
30663
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31198
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31199
|
+
...getConditionalErrorFields(err)
|
|
30664
31200
|
};
|
|
30665
31201
|
}
|
|
30666
31202
|
}
|
|
@@ -30670,26 +31206,31 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30670
31206
|
* @param options Object containing:
|
|
30671
31207
|
* - configuration: The http request options
|
|
30672
31208
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31209
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30673
31210
|
*
|
|
30674
31211
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30675
31212
|
*/
|
|
30676
31213
|
async getSubmodelByIdMetadata(options) {
|
|
30677
|
-
const { configuration, submodelIdentifier } = options;
|
|
31214
|
+
const { configuration, submodelIdentifier, ifNoneMatch } = options;
|
|
30678
31215
|
try {
|
|
30679
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31216
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30680
31217
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30681
31218
|
const response = await apiInstance.getSubmodelByIdMetadataRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
30682
31219
|
return {
|
|
30683
31220
|
success: true,
|
|
30684
31221
|
data: await response.value(),
|
|
30685
|
-
statusCode: response.raw.status
|
|
31222
|
+
statusCode: response.raw.status,
|
|
31223
|
+
etag: getEtag(response.raw)
|
|
30686
31224
|
};
|
|
30687
31225
|
} catch (err) {
|
|
31226
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31227
|
+
if (notModified) return notModified;
|
|
30688
31228
|
const customError = await handleApiError(err);
|
|
30689
31229
|
return {
|
|
30690
31230
|
success: false,
|
|
30691
31231
|
error: customError,
|
|
30692
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31232
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31233
|
+
...getConditionalErrorFields(err)
|
|
30693
31234
|
};
|
|
30694
31235
|
}
|
|
30695
31236
|
}
|
|
@@ -30701,13 +31242,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30701
31242
|
* - submodelIdentifier: The Submodel's unique id
|
|
30702
31243
|
* - submodelMetadata: SubmodelMetadata object
|
|
30703
31244
|
* - level?: Determines the structural depth of the respective resource content
|
|
31245
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30704
31246
|
*
|
|
30705
31247
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30706
31248
|
*/
|
|
30707
31249
|
async patchSubmodelByIdMetadata(options) {
|
|
30708
|
-
const { configuration, submodelIdentifier, submodelMetadata, level } = options;
|
|
31250
|
+
const { configuration, submodelIdentifier, submodelMetadata, level, ifMatch } = options;
|
|
30709
31251
|
try {
|
|
30710
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31252
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30711
31253
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30712
31254
|
const response = await apiInstance.patchSubmodelByIdMetadataRaw({
|
|
30713
31255
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30717,14 +31259,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30717
31259
|
return {
|
|
30718
31260
|
success: true,
|
|
30719
31261
|
data: await response.value(),
|
|
30720
|
-
statusCode: response.raw.status
|
|
31262
|
+
statusCode: response.raw.status,
|
|
31263
|
+
etag: getEtag(response.raw)
|
|
30721
31264
|
};
|
|
30722
31265
|
} catch (err) {
|
|
30723
31266
|
const customError = await handleApiError(err);
|
|
30724
31267
|
return {
|
|
30725
31268
|
success: false,
|
|
30726
31269
|
error: customError,
|
|
30727
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31270
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31271
|
+
...getConditionalErrorFields(err)
|
|
30728
31272
|
};
|
|
30729
31273
|
}
|
|
30730
31274
|
}
|
|
@@ -30736,13 +31280,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30736
31280
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30737
31281
|
* - level?: Determines the structural depth of the respective resource content
|
|
30738
31282
|
* - extent?: Determines to which extent the resource is being serialized
|
|
31283
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30739
31284
|
*
|
|
30740
31285
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30741
31286
|
*/
|
|
30742
31287
|
async getSubmodelByIdValueOnly(options) {
|
|
30743
|
-
const { configuration, submodelIdentifier, level, extent } = options;
|
|
31288
|
+
const { configuration, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
30744
31289
|
try {
|
|
30745
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31290
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30746
31291
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30747
31292
|
const response = await apiInstance.getSubmodelByIdValueOnlyRaw({
|
|
30748
31293
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30752,14 +31297,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30752
31297
|
return {
|
|
30753
31298
|
success: true,
|
|
30754
31299
|
data: await response.value(),
|
|
30755
|
-
statusCode: response.raw.status
|
|
31300
|
+
statusCode: response.raw.status,
|
|
31301
|
+
etag: getEtag(response.raw)
|
|
30756
31302
|
};
|
|
30757
31303
|
} catch (err) {
|
|
31304
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31305
|
+
if (notModified) return notModified;
|
|
30758
31306
|
const customError = await handleApiError(err);
|
|
30759
31307
|
return {
|
|
30760
31308
|
success: false,
|
|
30761
31309
|
error: customError,
|
|
30762
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31310
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31311
|
+
...getConditionalErrorFields(err)
|
|
30763
31312
|
};
|
|
30764
31313
|
}
|
|
30765
31314
|
}
|
|
@@ -30771,13 +31320,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30771
31320
|
* - submodelIdentifier: The Submodel's unique id
|
|
30772
31321
|
* - body: Value-only payload object
|
|
30773
31322
|
* - level?: Determines the structural depth of the respective resource content
|
|
31323
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30774
31324
|
*
|
|
30775
31325
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30776
31326
|
*/
|
|
30777
31327
|
async patchSubmodelByIdValueOnly(options) {
|
|
30778
|
-
const { configuration, submodelIdentifier, body, level } = options;
|
|
31328
|
+
const { configuration, submodelIdentifier, body, level, ifMatch } = options;
|
|
30779
31329
|
try {
|
|
30780
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31330
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30781
31331
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30782
31332
|
const response = await apiInstance.patchSubmodelByIdValueOnlyRaw({
|
|
30783
31333
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30787,14 +31337,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30787
31337
|
return {
|
|
30788
31338
|
success: true,
|
|
30789
31339
|
data: await response.value(),
|
|
30790
|
-
statusCode: response.raw.status
|
|
31340
|
+
statusCode: response.raw.status,
|
|
31341
|
+
etag: getEtag(response.raw)
|
|
30791
31342
|
};
|
|
30792
31343
|
} catch (err) {
|
|
30793
31344
|
const customError = await handleApiError(err);
|
|
30794
31345
|
return {
|
|
30795
31346
|
success: false,
|
|
30796
31347
|
error: customError,
|
|
30797
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31348
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31349
|
+
...getConditionalErrorFields(err)
|
|
30798
31350
|
};
|
|
30799
31351
|
}
|
|
30800
31352
|
}
|
|
@@ -30807,13 +31359,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30807
31359
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30808
31360
|
* - level?: Determines the structural depth of the respective resource content
|
|
30809
31361
|
* - extent?: Determines to which extent the resource is being serialized
|
|
31362
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30810
31363
|
*
|
|
30811
31364
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30812
31365
|
*/
|
|
30813
31366
|
async getSubmodelElementByPathValueOnly(options) {
|
|
30814
|
-
const { configuration, submodelIdentifier, idShortPath, level, extent } = options;
|
|
31367
|
+
const { configuration, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
30815
31368
|
try {
|
|
30816
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31369
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30817
31370
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30818
31371
|
const response = await apiInstance.getSubmodelElementByPathValueOnlySubmodelRepoRaw({
|
|
30819
31372
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30824,14 +31377,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30824
31377
|
return {
|
|
30825
31378
|
success: true,
|
|
30826
31379
|
data: await response.value(),
|
|
30827
|
-
statusCode: response.raw.status
|
|
31380
|
+
statusCode: response.raw.status,
|
|
31381
|
+
etag: getEtag(response.raw)
|
|
30828
31382
|
};
|
|
30829
31383
|
} catch (err) {
|
|
31384
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31385
|
+
if (notModified) return notModified;
|
|
30830
31386
|
const customError = await handleApiError(err);
|
|
30831
31387
|
return {
|
|
30832
31388
|
success: false,
|
|
30833
31389
|
error: customError,
|
|
30834
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31390
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31391
|
+
...getConditionalErrorFields(err)
|
|
30835
31392
|
};
|
|
30836
31393
|
}
|
|
30837
31394
|
}
|
|
@@ -30844,13 +31401,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30844
31401
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30845
31402
|
* - submodelElementValue: SubmodelElementValue object
|
|
30846
31403
|
* - level?: Determines the structural depth of the respective resource content
|
|
31404
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30847
31405
|
*
|
|
30848
31406
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30849
31407
|
*/
|
|
30850
31408
|
async patchSubmodelElementByPathValueOnly(options) {
|
|
30851
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
31409
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElementValue, level, ifMatch } = options;
|
|
30852
31410
|
try {
|
|
30853
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31411
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30854
31412
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30855
31413
|
const response = await apiInstance.patchSubmodelElementByPathValueOnlySubmodelRepoRaw({
|
|
30856
31414
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30861,14 +31419,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30861
31419
|
return {
|
|
30862
31420
|
success: true,
|
|
30863
31421
|
data: await response.value(),
|
|
30864
|
-
statusCode: response.raw.status
|
|
31422
|
+
statusCode: response.raw.status,
|
|
31423
|
+
etag: getEtag(response.raw)
|
|
30865
31424
|
};
|
|
30866
31425
|
} catch (err) {
|
|
30867
31426
|
const customError = await handleApiError(err);
|
|
30868
31427
|
return {
|
|
30869
31428
|
success: false,
|
|
30870
31429
|
error: customError,
|
|
30871
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31430
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31431
|
+
...getConditionalErrorFields(err)
|
|
30872
31432
|
};
|
|
30873
31433
|
}
|
|
30874
31434
|
}
|
|
@@ -30880,13 +31440,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30880
31440
|
* - submodelIdentifier: The Submodel's unique id
|
|
30881
31441
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30882
31442
|
* - submodelElementMetadata: SubmodelElementMetadata object
|
|
31443
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30883
31444
|
*
|
|
30884
31445
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30885
31446
|
*/
|
|
30886
31447
|
async patchSubmodelElementByPathMetadata(options) {
|
|
30887
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
31448
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElementMetadata, ifMatch } = options;
|
|
30888
31449
|
try {
|
|
30889
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31450
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30890
31451
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30891
31452
|
const response = await apiInstance.patchSubmodelElementByPathMetadataSubmodelRepoRaw({
|
|
30892
31453
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30896,14 +31457,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30896
31457
|
return {
|
|
30897
31458
|
success: true,
|
|
30898
31459
|
data: await response.value(),
|
|
30899
|
-
statusCode: response.raw.status
|
|
31460
|
+
statusCode: response.raw.status,
|
|
31461
|
+
etag: getEtag(response.raw)
|
|
30900
31462
|
};
|
|
30901
31463
|
} catch (err) {
|
|
30902
31464
|
const customError = await handleApiError(err);
|
|
30903
31465
|
return {
|
|
30904
31466
|
success: false,
|
|
30905
31467
|
error: customError,
|
|
30906
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31468
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31469
|
+
...getConditionalErrorFields(err)
|
|
30907
31470
|
};
|
|
30908
31471
|
}
|
|
30909
31472
|
}
|
|
@@ -30914,13 +31477,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30914
31477
|
* - configuration: The http request options
|
|
30915
31478
|
* - submodelIdentifier: The Submodel's unique id
|
|
30916
31479
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31480
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30917
31481
|
*
|
|
30918
31482
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30919
31483
|
*/
|
|
30920
31484
|
async getFileByPath(options) {
|
|
30921
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
31485
|
+
const { configuration, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
30922
31486
|
try {
|
|
30923
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31487
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30924
31488
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30925
31489
|
const response = await apiInstance.getFileByPathSubmodelRepoRaw({
|
|
30926
31490
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30929,14 +31493,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30929
31493
|
return {
|
|
30930
31494
|
success: true,
|
|
30931
31495
|
data: await response.value(),
|
|
30932
|
-
statusCode: response.raw.status
|
|
31496
|
+
statusCode: response.raw.status,
|
|
31497
|
+
etag: getEtag(response.raw)
|
|
30933
31498
|
};
|
|
30934
31499
|
} catch (err) {
|
|
31500
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31501
|
+
if (notModified) return notModified;
|
|
30935
31502
|
const customError = await handleApiError(err);
|
|
30936
31503
|
return {
|
|
30937
31504
|
success: false,
|
|
30938
31505
|
error: customError,
|
|
30939
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31506
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31507
|
+
...getConditionalErrorFields(err)
|
|
30940
31508
|
};
|
|
30941
31509
|
}
|
|
30942
31510
|
}
|
|
@@ -30949,13 +31517,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30949
31517
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30950
31518
|
* - fileName?: Name of the uploaded file
|
|
30951
31519
|
* - file?: File content
|
|
31520
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31521
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
30952
31522
|
*
|
|
30953
31523
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30954
31524
|
*/
|
|
30955
31525
|
async putFileByPath(options) {
|
|
30956
|
-
const { configuration, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
31526
|
+
const { configuration, submodelIdentifier, idShortPath, fileName, file, ifMatch, ifNoneMatch } = options;
|
|
30957
31527
|
try {
|
|
30958
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration
|
|
31528
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, {
|
|
31529
|
+
ifMatch,
|
|
31530
|
+
ifNoneMatch
|
|
31531
|
+
}));
|
|
30959
31532
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30960
31533
|
const response = await apiInstance.putFileByPathSubmodelRepoRaw({
|
|
30961
31534
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30966,14 +31539,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30966
31539
|
return {
|
|
30967
31540
|
success: true,
|
|
30968
31541
|
data: await response.value(),
|
|
30969
|
-
statusCode: response.raw.status
|
|
31542
|
+
statusCode: response.raw.status,
|
|
31543
|
+
etag: getEtag(response.raw)
|
|
30970
31544
|
};
|
|
30971
31545
|
} catch (err) {
|
|
30972
31546
|
const customError = await handleApiError(err);
|
|
30973
31547
|
return {
|
|
30974
31548
|
success: false,
|
|
30975
31549
|
error: customError,
|
|
30976
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31550
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31551
|
+
...getConditionalErrorFields(err)
|
|
30977
31552
|
};
|
|
30978
31553
|
}
|
|
30979
31554
|
}
|
|
@@ -30984,13 +31559,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30984
31559
|
* - configuration: The http request options
|
|
30985
31560
|
* - submodelIdentifier: The Submodel's unique id
|
|
30986
31561
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31562
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30987
31563
|
*
|
|
30988
31564
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30989
31565
|
*/
|
|
30990
31566
|
async deleteFileByPath(options) {
|
|
30991
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
31567
|
+
const { configuration, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
30992
31568
|
try {
|
|
30993
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31569
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30994
31570
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30995
31571
|
const response = await apiInstance.deleteFileByPathSubmodelRepoRaw({
|
|
30996
31572
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30999,14 +31575,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30999
31575
|
return {
|
|
31000
31576
|
success: true,
|
|
31001
31577
|
data: await response.value(),
|
|
31002
|
-
statusCode: response.raw.status
|
|
31578
|
+
statusCode: response.raw.status,
|
|
31579
|
+
etag: getEtag(response.raw)
|
|
31003
31580
|
};
|
|
31004
31581
|
} catch (err) {
|
|
31005
31582
|
const customError = await handleApiError(err);
|
|
31006
31583
|
return {
|
|
31007
31584
|
success: false,
|
|
31008
31585
|
error: customError,
|
|
31009
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31586
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31587
|
+
...getConditionalErrorFields(err)
|
|
31010
31588
|
};
|
|
31011
31589
|
}
|
|
31012
31590
|
}
|
|
@@ -31019,13 +31597,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31019
31597
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31020
31598
|
* - operationRequest: Operation request object
|
|
31021
31599
|
* - async?: Determines whether an operation invocation is performed asynchronously or synchronously
|
|
31600
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31022
31601
|
*
|
|
31023
31602
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31024
31603
|
*/
|
|
31025
31604
|
async postInvokeOperationSubmodelRepo(options) {
|
|
31026
|
-
const { configuration, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
31605
|
+
const { configuration, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
31027
31606
|
try {
|
|
31028
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31607
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31029
31608
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31030
31609
|
const response = await apiInstance.invokeOperationSubmodelRepoRaw({
|
|
31031
31610
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -31035,14 +31614,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31035
31614
|
return {
|
|
31036
31615
|
success: true,
|
|
31037
31616
|
data: await response.value(),
|
|
31038
|
-
statusCode: response.raw.status
|
|
31617
|
+
statusCode: response.raw.status,
|
|
31618
|
+
etag: getEtag(response.raw)
|
|
31039
31619
|
};
|
|
31040
31620
|
} catch (err) {
|
|
31041
31621
|
const customError = await handleApiError(err);
|
|
31042
31622
|
return {
|
|
31043
31623
|
success: false,
|
|
31044
31624
|
error: customError,
|
|
31045
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31625
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31626
|
+
...getConditionalErrorFields(err)
|
|
31046
31627
|
};
|
|
31047
31628
|
}
|
|
31048
31629
|
}
|
|
@@ -31055,13 +31636,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31055
31636
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31056
31637
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31057
31638
|
* - operationRequestValueOnly: Operation request object
|
|
31639
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31058
31640
|
*
|
|
31059
31641
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31060
31642
|
*/
|
|
31061
31643
|
async postInvokeOperationValueOnly(options) {
|
|
31062
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
31644
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
31063
31645
|
try {
|
|
31064
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31646
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31065
31647
|
const encodedAasIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
31066
31648
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31067
31649
|
const response = await apiInstance.invokeOperationValueOnlyRaw({
|
|
@@ -31073,14 +31655,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31073
31655
|
return {
|
|
31074
31656
|
success: true,
|
|
31075
31657
|
data: await response.value(),
|
|
31076
|
-
statusCode: response.raw.status
|
|
31658
|
+
statusCode: response.raw.status,
|
|
31659
|
+
etag: getEtag(response.raw)
|
|
31077
31660
|
};
|
|
31078
31661
|
} catch (err) {
|
|
31079
31662
|
const customError = await handleApiError(err);
|
|
31080
31663
|
return {
|
|
31081
31664
|
success: false,
|
|
31082
31665
|
error: customError,
|
|
31083
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31666
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31667
|
+
...getConditionalErrorFields(err)
|
|
31084
31668
|
};
|
|
31085
31669
|
}
|
|
31086
31670
|
}
|
|
@@ -31092,13 +31676,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31092
31676
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31093
31677
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31094
31678
|
* - operationRequest: Operation request object
|
|
31679
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31095
31680
|
*
|
|
31096
31681
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31097
31682
|
*/
|
|
31098
31683
|
async postInvokeOperationAsync(options) {
|
|
31099
|
-
const { configuration, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
31684
|
+
const { configuration, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
31100
31685
|
try {
|
|
31101
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31686
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31102
31687
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31103
31688
|
const response = await apiInstance.invokeOperationAsyncRaw({
|
|
31104
31689
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -31108,14 +31693,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31108
31693
|
return {
|
|
31109
31694
|
success: true,
|
|
31110
31695
|
data: await response.value(),
|
|
31111
|
-
statusCode: response.raw.status
|
|
31696
|
+
statusCode: response.raw.status,
|
|
31697
|
+
etag: getEtag(response.raw)
|
|
31112
31698
|
};
|
|
31113
31699
|
} catch (err) {
|
|
31114
31700
|
const customError = await handleApiError(err);
|
|
31115
31701
|
return {
|
|
31116
31702
|
success: false,
|
|
31117
31703
|
error: customError,
|
|
31118
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31704
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31705
|
+
...getConditionalErrorFields(err)
|
|
31119
31706
|
};
|
|
31120
31707
|
}
|
|
31121
31708
|
}
|
|
@@ -31128,13 +31715,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31128
31715
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31129
31716
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31130
31717
|
* - operationRequestValueOnly: Operation request object
|
|
31718
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31131
31719
|
*
|
|
31132
31720
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31133
31721
|
*/
|
|
31134
31722
|
async postInvokeOperationAsyncValueOnly(options) {
|
|
31135
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
31723
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
31136
31724
|
try {
|
|
31137
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31725
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31138
31726
|
const encodedAasIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
31139
31727
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31140
31728
|
const response = await apiInstance.invokeOperationAsyncValueOnlyRaw({
|
|
@@ -31146,14 +31734,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31146
31734
|
return {
|
|
31147
31735
|
success: true,
|
|
31148
31736
|
data: await response.value(),
|
|
31149
|
-
statusCode: response.raw.status
|
|
31737
|
+
statusCode: response.raw.status,
|
|
31738
|
+
etag: getEtag(response.raw)
|
|
31150
31739
|
};
|
|
31151
31740
|
} catch (err) {
|
|
31152
31741
|
const customError = await handleApiError(err);
|
|
31153
31742
|
return {
|
|
31154
31743
|
success: false,
|
|
31155
31744
|
error: customError,
|
|
31156
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31745
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31746
|
+
...getConditionalErrorFields(err)
|
|
31157
31747
|
};
|
|
31158
31748
|
}
|
|
31159
31749
|
}
|
|
@@ -31181,14 +31771,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31181
31771
|
return {
|
|
31182
31772
|
success: true,
|
|
31183
31773
|
data: await response.value(),
|
|
31184
|
-
statusCode: response.raw.status
|
|
31774
|
+
statusCode: response.raw.status,
|
|
31775
|
+
etag: getEtag(response.raw)
|
|
31185
31776
|
};
|
|
31186
31777
|
} catch (err) {
|
|
31187
31778
|
const customError = await handleApiError(err);
|
|
31188
31779
|
return {
|
|
31189
31780
|
success: false,
|
|
31190
31781
|
error: customError,
|
|
31191
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31782
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31783
|
+
...getConditionalErrorFields(err)
|
|
31192
31784
|
};
|
|
31193
31785
|
}
|
|
31194
31786
|
}
|
|
@@ -31216,14 +31808,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31216
31808
|
return {
|
|
31217
31809
|
success: true,
|
|
31218
31810
|
data: await response.value(),
|
|
31219
|
-
statusCode: response.raw.status
|
|
31811
|
+
statusCode: response.raw.status,
|
|
31812
|
+
etag: getEtag(response.raw)
|
|
31220
31813
|
};
|
|
31221
31814
|
} catch (err) {
|
|
31222
31815
|
const customError = await handleApiError(err);
|
|
31223
31816
|
return {
|
|
31224
31817
|
success: false,
|
|
31225
31818
|
error: customError,
|
|
31226
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31819
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31820
|
+
...getConditionalErrorFields(err)
|
|
31227
31821
|
};
|
|
31228
31822
|
}
|
|
31229
31823
|
}
|
|
@@ -31251,14 +31845,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31251
31845
|
return {
|
|
31252
31846
|
success: true,
|
|
31253
31847
|
data: await response.value(),
|
|
31254
|
-
statusCode: response.raw.status
|
|
31848
|
+
statusCode: response.raw.status,
|
|
31849
|
+
etag: getEtag(response.raw)
|
|
31255
31850
|
};
|
|
31256
31851
|
} catch (err) {
|
|
31257
31852
|
const customError = await handleApiError(err);
|
|
31258
31853
|
return {
|
|
31259
31854
|
success: false,
|
|
31260
31855
|
error: customError,
|
|
31261
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31856
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31857
|
+
...getConditionalErrorFields(err)
|
|
31262
31858
|
};
|
|
31263
31859
|
}
|
|
31264
31860
|
}
|
|
@@ -31284,14 +31880,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31284
31880
|
return {
|
|
31285
31881
|
success: true,
|
|
31286
31882
|
data: await response.value(),
|
|
31287
|
-
statusCode: response.raw.status
|
|
31883
|
+
statusCode: response.raw.status,
|
|
31884
|
+
etag: getEtag(response.raw)
|
|
31288
31885
|
};
|
|
31289
31886
|
} catch (err) {
|
|
31290
31887
|
const customError = await handleApiError(err);
|
|
31291
31888
|
return {
|
|
31292
31889
|
success: false,
|
|
31293
31890
|
error: customError,
|
|
31294
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31891
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31892
|
+
...getConditionalErrorFields(err)
|
|
31295
31893
|
};
|
|
31296
31894
|
}
|
|
31297
31895
|
}
|
|
@@ -31310,14 +31908,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31310
31908
|
return {
|
|
31311
31909
|
success: true,
|
|
31312
31910
|
data: await response.value(),
|
|
31313
|
-
statusCode: response.raw.status
|
|
31911
|
+
statusCode: response.raw.status,
|
|
31912
|
+
etag: getEtag(response.raw)
|
|
31314
31913
|
};
|
|
31315
31914
|
} catch (err) {
|
|
31316
31915
|
const customError = await handleApiError(err);
|
|
31317
31916
|
return {
|
|
31318
31917
|
success: false,
|
|
31319
31918
|
error: customError,
|
|
31320
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31919
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31920
|
+
...getConditionalErrorFields(err)
|
|
31321
31921
|
};
|
|
31322
31922
|
}
|
|
31323
31923
|
}
|
|
@@ -31515,7 +32115,8 @@ var SubmodelService = class {
|
|
|
31515
32115
|
* - useRegistryEndpoint?: Whether to try registry endpoint first (default: true)
|
|
31516
32116
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
31517
32117
|
*
|
|
31518
|
-
* @returns Either `{ success: true; data: { submodel, descriptor?, conceptDescriptions? } }` or `{ success: false; error: ... }`.
|
|
32118
|
+
* @returns Either `{ success: true; data: { submodel, descriptor?, conceptDescriptions? }; etag? }` or `{ success: false; error: ... }`.
|
|
32119
|
+
* `etag` is the entity tag of the Submodel, if the repository sends one.
|
|
31519
32120
|
*/
|
|
31520
32121
|
async getSubmodelById(options) {
|
|
31521
32122
|
const { submodelIdentifier, useRegistryEndpoint = true, includeConceptDescriptions = false } = options;
|
|
@@ -31538,7 +32139,8 @@ var SubmodelService = class {
|
|
|
31538
32139
|
submodel: submodelResult.data.submodel,
|
|
31539
32140
|
descriptor,
|
|
31540
32141
|
...submodelResult.data.conceptDescriptions && { conceptDescriptions: submodelResult.data.conceptDescriptions }
|
|
31541
|
-
}
|
|
32142
|
+
},
|
|
32143
|
+
etag: submodelResult.etag
|
|
31542
32144
|
};
|
|
31543
32145
|
}
|
|
31544
32146
|
}
|
|
@@ -31564,7 +32166,8 @@ var SubmodelService = class {
|
|
|
31564
32166
|
submodel,
|
|
31565
32167
|
descriptor: void 0,
|
|
31566
32168
|
...conceptDescriptions && { conceptDescriptions }
|
|
31567
|
-
}
|
|
32169
|
+
},
|
|
32170
|
+
etag: submodelResult.etag
|
|
31568
32171
|
};
|
|
31569
32172
|
}
|
|
31570
32173
|
return {
|
|
@@ -31622,7 +32225,8 @@ var SubmodelService = class {
|
|
|
31622
32225
|
* - endpoint: The endpoint URL (format: http://host/submodels/{base64EncodedId})
|
|
31623
32226
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
31624
32227
|
*
|
|
31625
|
-
* @returns Either `{ success: true; data: { submodel, conceptDescriptions? } }` or `{ success: false; error: ... }`.
|
|
32228
|
+
* @returns Either `{ success: true; data: { submodel, conceptDescriptions? }; etag? }` or `{ success: false; error: ... }`.
|
|
32229
|
+
* `etag` is the entity tag of the Submodel, if the repository sends one.
|
|
31626
32230
|
*/
|
|
31627
32231
|
async getSubmodelByEndpoint(options) {
|
|
31628
32232
|
const { endpoint, includeConceptDescriptions = false } = options;
|
|
@@ -31664,7 +32268,8 @@ var SubmodelService = class {
|
|
|
31664
32268
|
data: {
|
|
31665
32269
|
submodel,
|
|
31666
32270
|
...conceptDescriptions && { conceptDescriptions }
|
|
31667
|
-
}
|
|
32271
|
+
},
|
|
32272
|
+
etag: submodelResult.etag
|
|
31668
32273
|
};
|
|
31669
32274
|
}
|
|
31670
32275
|
/**
|
|
@@ -31754,11 +32359,13 @@ var SubmodelService = class {
|
|
|
31754
32359
|
* @param options Object containing:
|
|
31755
32360
|
* - submodel: The updated Submodel
|
|
31756
32361
|
* - updateInRegistry?: Whether to update the descriptor in the registry (default: true)
|
|
32362
|
+
* - ifMatch?: Sent as `If-Match` header with the repository update; if the Submodel has changed, the update fails
|
|
32363
|
+
* with `preconditionFailed` and the registry is not updated
|
|
31757
32364
|
*
|
|
31758
32365
|
* @returns Either `{ success: true; data: { submodel, descriptor? } }` or `{ success: false; error: ... }`.
|
|
31759
32366
|
*/
|
|
31760
32367
|
async updateSubmodel(options) {
|
|
31761
|
-
const { submodel, updateInRegistry = true } = options;
|
|
32368
|
+
const { submodel, updateInRegistry = true, ifMatch } = options;
|
|
31762
32369
|
if (!this.submodelRepositoryConfig) return {
|
|
31763
32370
|
success: false,
|
|
31764
32371
|
error: {
|
|
@@ -31769,11 +32376,13 @@ var SubmodelService = class {
|
|
|
31769
32376
|
const submodelResult = await this.submodelRepositoryClient.putSubmodelById({
|
|
31770
32377
|
configuration: this.submodelRepositoryConfig,
|
|
31771
32378
|
submodelIdentifier: submodel.id,
|
|
31772
|
-
submodel
|
|
32379
|
+
submodel,
|
|
32380
|
+
ifMatch
|
|
31773
32381
|
});
|
|
31774
32382
|
if (!submodelResult.success) return {
|
|
31775
32383
|
success: false,
|
|
31776
|
-
error: submodelResult.error
|
|
32384
|
+
error: submodelResult.error,
|
|
32385
|
+
...pickConditionalErrorFields(submodelResult)
|
|
31777
32386
|
};
|
|
31778
32387
|
const updatedSubmodel = submodelResult.data || submodel;
|
|
31779
32388
|
if (updateInRegistry && this.submodelRegistryConfig) {
|
|
@@ -31807,16 +32416,30 @@ var SubmodelService = class {
|
|
|
31807
32416
|
* Deletes a Submodel and optionally removes it from the registry.
|
|
31808
32417
|
*
|
|
31809
32418
|
* This method removes the descriptor from the registry first (if requested),
|
|
31810
|
-
* then deletes the Submodel from the repository.
|
|
32419
|
+
* then deletes the Submodel from the repository. With `ifMatch`, the Submodel is deleted from the repository
|
|
32420
|
+
* first, so that a failed precondition leaves the descriptor in the registry.
|
|
31811
32421
|
*
|
|
31812
32422
|
* @param options Object containing:
|
|
31813
32423
|
* - submodelIdentifier: The Submodel identifier to remove
|
|
31814
32424
|
* - deleteFromRegistry?: Whether to delete from registry (default: true)
|
|
32425
|
+
* - ifMatch?: Sent as `If-Match` header with the repository delete; if the Submodel has changed, the delete fails
|
|
32426
|
+
* with `preconditionFailed`. Requires the repository configuration.
|
|
31815
32427
|
*
|
|
31816
32428
|
* @returns Either `{ success: true; data: void }` or `{ success: false; error: ... }`.
|
|
31817
32429
|
*/
|
|
31818
32430
|
async deleteSubmodel(options) {
|
|
31819
|
-
const { submodelIdentifier, deleteFromRegistry = true } = options;
|
|
32431
|
+
const { submodelIdentifier, deleteFromRegistry = true, ifMatch } = options;
|
|
32432
|
+
if (ifMatch) {
|
|
32433
|
+
if (!this.submodelRepositoryConfig) return {
|
|
32434
|
+
success: false,
|
|
32435
|
+
error: {
|
|
32436
|
+
errorType: "ConfigurationError",
|
|
32437
|
+
message: "Repository configuration required for a conditional delete"
|
|
32438
|
+
}
|
|
32439
|
+
};
|
|
32440
|
+
const repositoryResult = await this.deleteSubmodelFromRepository(submodelIdentifier, ifMatch);
|
|
32441
|
+
if (!repositoryResult.success) return repositoryResult;
|
|
32442
|
+
}
|
|
31820
32443
|
if (deleteFromRegistry && this.submodelRegistryConfig) {
|
|
31821
32444
|
const registryResult = await this.submodelRegistryClient.deleteSubmodelDescriptorById({
|
|
31822
32445
|
configuration: this.submodelRegistryConfig,
|
|
@@ -31827,14 +32450,26 @@ var SubmodelService = class {
|
|
|
31827
32450
|
error: registryResult.error
|
|
31828
32451
|
};
|
|
31829
32452
|
}
|
|
32453
|
+
if (!ifMatch) {
|
|
32454
|
+
const repositoryResult = await this.deleteSubmodelFromRepository(submodelIdentifier);
|
|
32455
|
+
if (!repositoryResult.success) return repositoryResult;
|
|
32456
|
+
}
|
|
32457
|
+
return {
|
|
32458
|
+
success: true,
|
|
32459
|
+
data: void 0
|
|
32460
|
+
};
|
|
32461
|
+
}
|
|
32462
|
+
async deleteSubmodelFromRepository(submodelIdentifier, ifMatch) {
|
|
31830
32463
|
if (this.submodelRepositoryConfig) {
|
|
31831
32464
|
const repositoryResult = await this.submodelRepositoryClient.deleteSubmodelById({
|
|
31832
32465
|
configuration: this.submodelRepositoryConfig,
|
|
31833
|
-
submodelIdentifier
|
|
32466
|
+
submodelIdentifier,
|
|
32467
|
+
ifMatch
|
|
31834
32468
|
});
|
|
31835
32469
|
if (!repositoryResult.success) return {
|
|
31836
32470
|
success: false,
|
|
31837
|
-
error: repositoryResult.error
|
|
32471
|
+
error: repositoryResult.error,
|
|
32472
|
+
...pickConditionalErrorFields(repositoryResult)
|
|
31838
32473
|
};
|
|
31839
32474
|
}
|
|
31840
32475
|
return {
|
|
@@ -32102,7 +32737,8 @@ var AasService = class {
|
|
|
32102
32737
|
* - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
|
|
32103
32738
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
32104
32739
|
*
|
|
32105
|
-
* @returns Either `{ success: true; data: { shell, descriptor?, submodels? } }` or `{ success: false; error: ... }`.
|
|
32740
|
+
* @returns Either `{ success: true; data: { shell, descriptor?, submodels? }; etag? }` or `{ success: false; error: ... }`.
|
|
32741
|
+
* `etag` is the entity tag of the shell, if the repository sends one.
|
|
32106
32742
|
*/
|
|
32107
32743
|
async getAasById(options) {
|
|
32108
32744
|
const { aasIdentifier, useRegistryEndpoint = true, includeSubmodels = false } = options;
|
|
@@ -32131,7 +32767,8 @@ var AasService = class {
|
|
|
32131
32767
|
shell,
|
|
32132
32768
|
descriptor,
|
|
32133
32769
|
...submodels && { submodels }
|
|
32134
|
-
}
|
|
32770
|
+
},
|
|
32771
|
+
etag: shellResult.etag
|
|
32135
32772
|
};
|
|
32136
32773
|
}
|
|
32137
32774
|
}
|
|
@@ -32158,7 +32795,8 @@ var AasService = class {
|
|
|
32158
32795
|
shell,
|
|
32159
32796
|
descriptor: void 0,
|
|
32160
32797
|
...submodels && { submodels }
|
|
32161
|
-
}
|
|
32798
|
+
},
|
|
32799
|
+
etag: shellResult.etag
|
|
32162
32800
|
};
|
|
32163
32801
|
}
|
|
32164
32802
|
return {
|
|
@@ -32217,7 +32855,8 @@ var AasService = class {
|
|
|
32217
32855
|
* - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
|
|
32218
32856
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
32219
32857
|
*
|
|
32220
|
-
* @returns Either `{ success: true; data: { shell, submodels? } }` or `{ success: false; error: ... }`.
|
|
32858
|
+
* @returns Either `{ success: true; data: { shell, submodels? }; etag? }` or `{ success: false; error: ... }`.
|
|
32859
|
+
* `etag` is the entity tag of the shell, if the repository sends one.
|
|
32221
32860
|
*/
|
|
32222
32861
|
async getAasByEndpoint(options) {
|
|
32223
32862
|
const { endpoint, includeSubmodels = false } = options;
|
|
@@ -32259,7 +32898,8 @@ var AasService = class {
|
|
|
32259
32898
|
data: {
|
|
32260
32899
|
shell,
|
|
32261
32900
|
...submodels && { submodels }
|
|
32262
|
-
}
|
|
32901
|
+
},
|
|
32902
|
+
etag: shellResult.etag
|
|
32263
32903
|
};
|
|
32264
32904
|
}
|
|
32265
32905
|
/**
|
|
@@ -32328,11 +32968,13 @@ var AasService = class {
|
|
|
32328
32968
|
* @param options Object containing:
|
|
32329
32969
|
* - shell: The updated AAS
|
|
32330
32970
|
* - updateInRegistry?: Whether to update the descriptor in the registry (default: true)
|
|
32971
|
+
* - ifMatch?: Sent as `If-Match` header with the repository update; if the shell has changed, the update fails with
|
|
32972
|
+
* `preconditionFailed` and the registry is not updated
|
|
32331
32973
|
*
|
|
32332
32974
|
* @returns Either `{ success: true; data: { shell, descriptor? } }` or `{ success: false; error: ... }`.
|
|
32333
32975
|
*/
|
|
32334
32976
|
async updateAas(options) {
|
|
32335
|
-
const { shell, updateInRegistry = true } = options;
|
|
32977
|
+
const { shell, updateInRegistry = true, ifMatch } = options;
|
|
32336
32978
|
if (!this.aasRepositoryConfig) return {
|
|
32337
32979
|
success: false,
|
|
32338
32980
|
error: {
|
|
@@ -32343,11 +32985,13 @@ var AasService = class {
|
|
|
32343
32985
|
const shellResult = await this.aasRepositoryClient.putAssetAdministrationShellById({
|
|
32344
32986
|
configuration: this.aasRepositoryConfig,
|
|
32345
32987
|
aasIdentifier: shell.id,
|
|
32346
|
-
assetAdministrationShell: shell
|
|
32988
|
+
assetAdministrationShell: shell,
|
|
32989
|
+
ifMatch
|
|
32347
32990
|
});
|
|
32348
32991
|
if (!shellResult.success) return {
|
|
32349
32992
|
success: false,
|
|
32350
|
-
error: shellResult.error
|
|
32993
|
+
error: shellResult.error,
|
|
32994
|
+
...pickConditionalErrorFields(shellResult)
|
|
32351
32995
|
};
|
|
32352
32996
|
const updatedShell = shellResult.data || shell;
|
|
32353
32997
|
if (updateInRegistry && this.aasRegistryConfig) {
|
|
@@ -32381,16 +33025,30 @@ var AasService = class {
|
|
|
32381
33025
|
* Deletes an Asset Administration Shell and optionally removes it from the registry.
|
|
32382
33026
|
*
|
|
32383
33027
|
* This method removes the descriptor from the registry first (if requested),
|
|
32384
|
-
* then deletes the AAS from the repository.
|
|
33028
|
+
* then deletes the AAS from the repository. With `ifMatch`, the AAS is deleted from the repository first,
|
|
33029
|
+
* so that a failed precondition leaves the descriptor in the registry.
|
|
32385
33030
|
*
|
|
32386
33031
|
* @param options Object containing:
|
|
32387
33032
|
* - aasIdentifier: The AAS identifier to remove
|
|
32388
33033
|
* - deleteFromRegistry?: Whether to delete from registry (default: true)
|
|
33034
|
+
* - ifMatch?: Sent as `If-Match` header with the repository delete; if the shell has changed, the delete fails with
|
|
33035
|
+
* `preconditionFailed`. Requires the repository configuration.
|
|
32389
33036
|
*
|
|
32390
33037
|
* @returns Either `{ success: true; data: void }` or `{ success: false; error: ... }`.
|
|
32391
33038
|
*/
|
|
32392
33039
|
async deleteAas(options) {
|
|
32393
|
-
const { aasIdentifier, deleteFromRegistry = true } = options;
|
|
33040
|
+
const { aasIdentifier, deleteFromRegistry = true, ifMatch } = options;
|
|
33041
|
+
if (ifMatch) {
|
|
33042
|
+
if (!this.aasRepositoryConfig) return {
|
|
33043
|
+
success: false,
|
|
33044
|
+
error: {
|
|
33045
|
+
errorType: "ConfigurationError",
|
|
33046
|
+
message: "Repository configuration required for a conditional delete"
|
|
33047
|
+
}
|
|
33048
|
+
};
|
|
33049
|
+
const repoResult = await this.deleteAasFromRepository(aasIdentifier, ifMatch);
|
|
33050
|
+
if (!repoResult.success) return repoResult;
|
|
33051
|
+
}
|
|
32394
33052
|
if (deleteFromRegistry && this.aasRegistryConfig) {
|
|
32395
33053
|
const registryResult = await this.aasRegistryClient.deleteAssetAdministrationShellDescriptorById({
|
|
32396
33054
|
configuration: this.aasRegistryConfig,
|
|
@@ -32401,14 +33059,26 @@ var AasService = class {
|
|
|
32401
33059
|
error: registryResult.error
|
|
32402
33060
|
};
|
|
32403
33061
|
}
|
|
33062
|
+
if (!ifMatch) {
|
|
33063
|
+
const repoResult = await this.deleteAasFromRepository(aasIdentifier);
|
|
33064
|
+
if (!repoResult.success) return repoResult;
|
|
33065
|
+
}
|
|
33066
|
+
return {
|
|
33067
|
+
success: true,
|
|
33068
|
+
data: void 0
|
|
33069
|
+
};
|
|
33070
|
+
}
|
|
33071
|
+
async deleteAasFromRepository(aasIdentifier, ifMatch) {
|
|
32404
33072
|
if (this.aasRepositoryConfig) {
|
|
32405
33073
|
const repoResult = await this.aasRepositoryClient.deleteAssetAdministrationShellById({
|
|
32406
33074
|
configuration: this.aasRepositoryConfig,
|
|
32407
|
-
aasIdentifier
|
|
33075
|
+
aasIdentifier,
|
|
33076
|
+
ifMatch
|
|
32408
33077
|
});
|
|
32409
33078
|
if (!repoResult.success) return {
|
|
32410
33079
|
success: false,
|
|
32411
|
-
error: repoResult.error
|
|
33080
|
+
error: repoResult.error,
|
|
33081
|
+
...pickConditionalErrorFields(repoResult)
|
|
32412
33082
|
};
|
|
32413
33083
|
}
|
|
32414
33084
|
return {
|