basyx-typescript-sdk 2.2.5 → 2.3.1
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 +1190 -513
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +1190 -513
- 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/lib/errorHandler.js +9 -4
- 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.cjs
CHANGED
|
@@ -5063,7 +5063,7 @@ var AasxFileService_exports = /* @__PURE__ */ __exportAll({
|
|
|
5063
5063
|
});
|
|
5064
5064
|
//#endregion
|
|
5065
5065
|
//#region dist/lib/apiConfig.js
|
|
5066
|
-
function applyDefaults(configuration) {
|
|
5066
|
+
function applyDefaults(configuration, conditionalHeaders) {
|
|
5067
5067
|
const options = {
|
|
5068
5068
|
basePath: configuration.basePath || void 0,
|
|
5069
5069
|
fetchApi: configuration.fetchApi || getDefaultFetchApi(),
|
|
@@ -5073,7 +5073,7 @@ function applyDefaults(configuration) {
|
|
|
5073
5073
|
password: configuration.password || void 0,
|
|
5074
5074
|
apiKey: configuration.apiKey || void 0,
|
|
5075
5075
|
accessToken: configuration.accessToken || void 0,
|
|
5076
|
-
headers: configuration.headers || void 0,
|
|
5076
|
+
headers: withConditionalHeaders(configuration.headers || void 0, conditionalHeaders),
|
|
5077
5077
|
credentials: configuration.credentials || void 0
|
|
5078
5078
|
};
|
|
5079
5079
|
const ConfigurationCtor = configuration.constructor;
|
|
@@ -5082,6 +5082,23 @@ function applyDefaults(configuration) {
|
|
|
5082
5082
|
function getDefaultFetchApi() {
|
|
5083
5083
|
return fetch.bind(globalThis);
|
|
5084
5084
|
}
|
|
5085
|
+
/**
|
|
5086
|
+
* Adds `If-Match` and `If-None-Match` to the configured headers. A passed condition replaces a configured header of
|
|
5087
|
+
* the same name regardless of its case; without conditions the configured headers are returned unchanged.
|
|
5088
|
+
*/
|
|
5089
|
+
function withConditionalHeaders(headers, conditionalHeaders) {
|
|
5090
|
+
const conditions = {
|
|
5091
|
+
"If-Match": conditionalHeaders?.ifMatch,
|
|
5092
|
+
"If-None-Match": conditionalHeaders?.ifNoneMatch
|
|
5093
|
+
};
|
|
5094
|
+
const names = Object.keys(conditions).filter((name) => conditions[name]);
|
|
5095
|
+
if (names.length === 0) return headers;
|
|
5096
|
+
const lowerCaseNames = names.map((name) => name.toLowerCase());
|
|
5097
|
+
const merged = {};
|
|
5098
|
+
for (const [name, value] of Object.entries(headers ?? {})) if (!lowerCaseNames.includes(name.toLowerCase())) merged[name] = value;
|
|
5099
|
+
for (const name of names) merged[name] = conditions[name];
|
|
5100
|
+
return merged;
|
|
5101
|
+
}
|
|
5085
5102
|
//#endregion
|
|
5086
5103
|
//#region dist/lib/base64Url.js
|
|
5087
5104
|
/**
|
|
@@ -5139,6 +5156,58 @@ function base64Decode(urlSafeBase64String) {
|
|
|
5139
5156
|
}
|
|
5140
5157
|
}
|
|
5141
5158
|
//#endregion
|
|
5159
|
+
//#region dist/lib/conditionalRequests.js
|
|
5160
|
+
function getErrorResponse(err) {
|
|
5161
|
+
return err?.response;
|
|
5162
|
+
}
|
|
5163
|
+
/**
|
|
5164
|
+
* Returns the `ETag` header of a response, or `undefined` if the server sent none.
|
|
5165
|
+
* The entity tag is opaque and returned unchanged.
|
|
5166
|
+
*/
|
|
5167
|
+
function getEtag(response) {
|
|
5168
|
+
const headers = response?.headers;
|
|
5169
|
+
if (typeof headers?.get !== "function") return;
|
|
5170
|
+
return headers.get("ETag") ?? void 0;
|
|
5171
|
+
}
|
|
5172
|
+
/**
|
|
5173
|
+
* Returns the conditional request fields of a failed request: the `ETag` of the error response and the flags for
|
|
5174
|
+
* `412 Precondition Failed` and `428 Precondition Required`. Fields that do not apply are omitted.
|
|
5175
|
+
*/
|
|
5176
|
+
function getConditionalErrorFields(err) {
|
|
5177
|
+
const response = getErrorResponse(err);
|
|
5178
|
+
const etag = getEtag(response);
|
|
5179
|
+
return {
|
|
5180
|
+
...etag !== void 0 && { etag },
|
|
5181
|
+
...response?.status === 412 && { preconditionFailed: true },
|
|
5182
|
+
...response?.status === 428 && { preconditionRequired: true }
|
|
5183
|
+
};
|
|
5184
|
+
}
|
|
5185
|
+
/**
|
|
5186
|
+
* Returns the conditional request fields of a failed {@link ApiResult}, so that a composite operation can pass them on.
|
|
5187
|
+
*/
|
|
5188
|
+
function pickConditionalErrorFields(result) {
|
|
5189
|
+
return {
|
|
5190
|
+
...result.etag !== void 0 && { etag: result.etag },
|
|
5191
|
+
...result.preconditionFailed && { preconditionFailed: true },
|
|
5192
|
+
...result.preconditionRequired && { preconditionRequired: true }
|
|
5193
|
+
};
|
|
5194
|
+
}
|
|
5195
|
+
/**
|
|
5196
|
+
* Returns the {@link NotModifiedResult} for a `304 Not Modified` answer to a read with `ifNoneMatch`, or `undefined`
|
|
5197
|
+
* for any other error.
|
|
5198
|
+
*/
|
|
5199
|
+
function getNotModifiedResult(err, ifNoneMatch) {
|
|
5200
|
+
const response = getErrorResponse(err);
|
|
5201
|
+
if (!ifNoneMatch || response?.status !== 304) return;
|
|
5202
|
+
const etag = getEtag(response);
|
|
5203
|
+
return {
|
|
5204
|
+
success: true,
|
|
5205
|
+
notModified: true,
|
|
5206
|
+
statusCode: 304,
|
|
5207
|
+
...etag !== void 0 && { etag }
|
|
5208
|
+
};
|
|
5209
|
+
}
|
|
5210
|
+
//#endregion
|
|
5142
5211
|
//#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
|
|
5143
5212
|
/**
|
|
5144
5213
|
* Provide common functions shared among the modules.
|
|
@@ -25904,6 +25973,13 @@ function isRequiredErrorLike(err) {
|
|
|
25904
25973
|
return err instanceof RequiredError || err?.name === "RequiredError";
|
|
25905
25974
|
}
|
|
25906
25975
|
/**
|
|
25976
|
+
* Returns the current time as a UTC date-time string matching the timestamp
|
|
25977
|
+
* pattern of the AAS API Message schema.
|
|
25978
|
+
*/
|
|
25979
|
+
function currentTimestamp() {
|
|
25980
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
25981
|
+
}
|
|
25982
|
+
/**
|
|
25907
25983
|
* Processes errors from API calls and standardizes them to a Result object
|
|
25908
25984
|
* with a consistent messages array following the API spec guidelines.
|
|
25909
25985
|
*
|
|
@@ -25914,7 +25990,7 @@ async function handleApiError(err) {
|
|
|
25914
25990
|
try {
|
|
25915
25991
|
const errorAny = err;
|
|
25916
25992
|
if (errorAny?.messages && Array.isArray(errorAny.messages)) return { messages: errorAny.messages };
|
|
25917
|
-
const timestamp = (
|
|
25993
|
+
const timestamp = currentTimestamp();
|
|
25918
25994
|
let message = {
|
|
25919
25995
|
code: "500",
|
|
25920
25996
|
messageType: "Exception",
|
|
@@ -25965,7 +26041,7 @@ async function handleApiError(err) {
|
|
|
25965
26041
|
code: "500",
|
|
25966
26042
|
messageType: "Exception",
|
|
25967
26043
|
text: "An error occurred while processing another error",
|
|
25968
|
-
timestamp: (
|
|
26044
|
+
timestamp: currentTimestamp()
|
|
25969
26045
|
}] };
|
|
25970
26046
|
}
|
|
25971
26047
|
}
|
|
@@ -25996,7 +26072,10 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
25996
26072
|
const { configuration, assetIds, limit, cursor } = options;
|
|
25997
26073
|
try {
|
|
25998
26074
|
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
25999
|
-
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify(
|
|
26075
|
+
const encodedAssetIds = assetIds?.map((id) => base64Encode(JSON.stringify({
|
|
26076
|
+
name: id.name,
|
|
26077
|
+
value: id.value
|
|
26078
|
+
})));
|
|
26000
26079
|
const response = await apiInstance.getAllAssetAdministrationShellIdsByAssetLinkRaw({
|
|
26001
26080
|
assetIds: encodedAssetIds,
|
|
26002
26081
|
limit,
|
|
@@ -26010,14 +26089,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26010
26089
|
pagedResult: result.paging_metadata,
|
|
26011
26090
|
result: shellIds
|
|
26012
26091
|
},
|
|
26013
|
-
statusCode: response.raw.status
|
|
26092
|
+
statusCode: response.raw.status,
|
|
26093
|
+
etag: getEtag(response.raw)
|
|
26014
26094
|
};
|
|
26015
26095
|
} catch (err) {
|
|
26016
26096
|
const customError = await handleApiError(err);
|
|
26017
26097
|
return {
|
|
26018
26098
|
success: false,
|
|
26019
26099
|
error: customError,
|
|
26020
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26100
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26101
|
+
...getConditionalErrorFields(err)
|
|
26021
26102
|
};
|
|
26022
26103
|
}
|
|
26023
26104
|
}
|
|
@@ -26028,13 +26109,14 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26028
26109
|
* - configuration: The http request options.
|
|
26029
26110
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
26030
26111
|
* - specificAssetId: A set of specific asset identifiers
|
|
26112
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26031
26113
|
*
|
|
26032
26114
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26033
26115
|
*/
|
|
26034
26116
|
async postAllAssetLinksById(options) {
|
|
26035
|
-
const { configuration, aasIdentifier, specificAssetId } = options;
|
|
26117
|
+
const { configuration, aasIdentifier, specificAssetId, ifMatch } = options;
|
|
26036
26118
|
try {
|
|
26037
|
-
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
26119
|
+
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26038
26120
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
26039
26121
|
const response = await apiInstance.postAllAssetLinksByIdRaw({
|
|
26040
26122
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26043,14 +26125,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26043
26125
|
return {
|
|
26044
26126
|
success: true,
|
|
26045
26127
|
data: (await response.value()).map(convertApiAssetIdToCoreAssetId),
|
|
26046
|
-
statusCode: response.raw.status
|
|
26128
|
+
statusCode: response.raw.status,
|
|
26129
|
+
etag: getEtag(response.raw)
|
|
26047
26130
|
};
|
|
26048
26131
|
} catch (err) {
|
|
26049
26132
|
const customError = await handleApiError(err);
|
|
26050
26133
|
return {
|
|
26051
26134
|
success: false,
|
|
26052
26135
|
error: customError,
|
|
26053
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26136
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26137
|
+
...getConditionalErrorFields(err)
|
|
26054
26138
|
};
|
|
26055
26139
|
}
|
|
26056
26140
|
}
|
|
@@ -26060,26 +26144,29 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26060
26144
|
* @param options Object containing:
|
|
26061
26145
|
* - configuration: The http request options
|
|
26062
26146
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
26147
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26063
26148
|
*
|
|
26064
26149
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26065
26150
|
*/
|
|
26066
26151
|
async deleteAllAssetLinksById(options) {
|
|
26067
|
-
const { configuration, aasIdentifier } = options;
|
|
26152
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
26068
26153
|
try {
|
|
26069
|
-
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
26154
|
+
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26070
26155
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
26071
26156
|
const response = await apiInstance.deleteAllAssetLinksByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26072
26157
|
return {
|
|
26073
26158
|
success: true,
|
|
26074
26159
|
data: await response.value(),
|
|
26075
|
-
statusCode: response.raw.status
|
|
26160
|
+
statusCode: response.raw.status,
|
|
26161
|
+
etag: getEtag(response.raw)
|
|
26076
26162
|
};
|
|
26077
26163
|
} catch (err) {
|
|
26078
26164
|
const customError = await handleApiError(err);
|
|
26079
26165
|
return {
|
|
26080
26166
|
success: false,
|
|
26081
26167
|
error: customError,
|
|
26082
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26168
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26169
|
+
...getConditionalErrorFields(err)
|
|
26083
26170
|
};
|
|
26084
26171
|
}
|
|
26085
26172
|
}
|
|
@@ -26089,26 +26176,31 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26089
26176
|
* @param options Object containing:
|
|
26090
26177
|
* - configuration: The http request options
|
|
26091
26178
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
26179
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26092
26180
|
*
|
|
26093
26181
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26094
26182
|
*/
|
|
26095
26183
|
async getAllAssetLinksById(options) {
|
|
26096
|
-
const { configuration, aasIdentifier } = options;
|
|
26184
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
26097
26185
|
try {
|
|
26098
|
-
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration));
|
|
26186
|
+
const apiInstance = new AssetAdministrationShellBasicDiscoveryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26099
26187
|
const encodedAasIdentifier = base64Encode(aasIdentifier);
|
|
26100
26188
|
const response = await apiInstance.getAllAssetLinksByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26101
26189
|
return {
|
|
26102
26190
|
success: true,
|
|
26103
26191
|
data: (await response.value()).map(convertApiAssetIdToCoreAssetId),
|
|
26104
|
-
statusCode: response.raw.status
|
|
26192
|
+
statusCode: response.raw.status,
|
|
26193
|
+
etag: getEtag(response.raw)
|
|
26105
26194
|
};
|
|
26106
26195
|
} catch (err) {
|
|
26196
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26197
|
+
if (notModified) return notModified;
|
|
26107
26198
|
const customError = await handleApiError(err);
|
|
26108
26199
|
return {
|
|
26109
26200
|
success: false,
|
|
26110
26201
|
error: customError,
|
|
26111
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26202
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26203
|
+
...getConditionalErrorFields(err)
|
|
26112
26204
|
};
|
|
26113
26205
|
}
|
|
26114
26206
|
}
|
|
@@ -26142,14 +26234,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26142
26234
|
pagedResult: result.paging_metadata,
|
|
26143
26235
|
result: shellIds
|
|
26144
26236
|
},
|
|
26145
|
-
statusCode: response.raw.status
|
|
26237
|
+
statusCode: response.raw.status,
|
|
26238
|
+
etag: getEtag(response.raw)
|
|
26146
26239
|
};
|
|
26147
26240
|
} catch (err) {
|
|
26148
26241
|
const customError = await handleApiError(err);
|
|
26149
26242
|
return {
|
|
26150
26243
|
success: false,
|
|
26151
26244
|
error: customError,
|
|
26152
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26245
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26246
|
+
...getConditionalErrorFields(err)
|
|
26153
26247
|
};
|
|
26154
26248
|
}
|
|
26155
26249
|
}
|
|
@@ -26168,14 +26262,16 @@ var AasDiscoveryClient = class AasDiscoveryClient {
|
|
|
26168
26262
|
return {
|
|
26169
26263
|
success: true,
|
|
26170
26264
|
data: await response.value(),
|
|
26171
|
-
statusCode: response.raw.status
|
|
26265
|
+
statusCode: response.raw.status,
|
|
26266
|
+
etag: getEtag(response.raw)
|
|
26172
26267
|
};
|
|
26173
26268
|
} catch (err) {
|
|
26174
26269
|
const customError = await handleApiError(err);
|
|
26175
26270
|
return {
|
|
26176
26271
|
success: false,
|
|
26177
26272
|
error: customError,
|
|
26178
|
-
statusCode: AasDiscoveryClient.extractStatusCode(err, customError)
|
|
26273
|
+
statusCode: AasDiscoveryClient.extractStatusCode(err, customError),
|
|
26274
|
+
...getConditionalErrorFields(err)
|
|
26179
26275
|
};
|
|
26180
26276
|
}
|
|
26181
26277
|
}
|
|
@@ -26464,14 +26560,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26464
26560
|
pagedResult: result.paging_metadata,
|
|
26465
26561
|
result: aasDescriptors
|
|
26466
26562
|
},
|
|
26467
|
-
statusCode: response.raw.status
|
|
26563
|
+
statusCode: response.raw.status,
|
|
26564
|
+
etag: getEtag(response.raw)
|
|
26468
26565
|
};
|
|
26469
26566
|
} catch (err) {
|
|
26470
26567
|
const customError = await handleApiError(err);
|
|
26471
26568
|
return {
|
|
26472
26569
|
success: false,
|
|
26473
26570
|
error: customError,
|
|
26474
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26571
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26572
|
+
...getConditionalErrorFields(err)
|
|
26475
26573
|
};
|
|
26476
26574
|
}
|
|
26477
26575
|
}
|
|
@@ -26491,14 +26589,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26491
26589
|
return {
|
|
26492
26590
|
success: true,
|
|
26493
26591
|
data: convertApiAasDescriptorToCoreAasDescriptor(await response.value()),
|
|
26494
|
-
statusCode: response.raw.status
|
|
26592
|
+
statusCode: response.raw.status,
|
|
26593
|
+
etag: getEtag(response.raw)
|
|
26495
26594
|
};
|
|
26496
26595
|
} catch (err) {
|
|
26497
26596
|
const customError = await handleApiError(err);
|
|
26498
26597
|
return {
|
|
26499
26598
|
success: false,
|
|
26500
26599
|
error: customError,
|
|
26501
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26600
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26601
|
+
...getConditionalErrorFields(err)
|
|
26502
26602
|
};
|
|
26503
26603
|
}
|
|
26504
26604
|
}
|
|
@@ -26508,26 +26608,29 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26508
26608
|
* @param options Object containing:
|
|
26509
26609
|
* - configuration: The http request options
|
|
26510
26610
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26611
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26511
26612
|
*
|
|
26512
26613
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26513
26614
|
*/
|
|
26514
26615
|
async deleteAssetAdministrationShellDescriptorById(options) {
|
|
26515
|
-
const { configuration, aasIdentifier } = options;
|
|
26616
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
26516
26617
|
try {
|
|
26517
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26618
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26518
26619
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26519
26620
|
const response = await apiInstance.deleteAssetAdministrationShellDescriptorByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26520
26621
|
return {
|
|
26521
26622
|
success: true,
|
|
26522
26623
|
data: await response.value(),
|
|
26523
|
-
statusCode: response.raw.status
|
|
26624
|
+
statusCode: response.raw.status,
|
|
26625
|
+
etag: getEtag(response.raw)
|
|
26524
26626
|
};
|
|
26525
26627
|
} catch (err) {
|
|
26526
26628
|
const customError = await handleApiError(err);
|
|
26527
26629
|
return {
|
|
26528
26630
|
success: false,
|
|
26529
26631
|
error: customError,
|
|
26530
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26632
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26633
|
+
...getConditionalErrorFields(err)
|
|
26531
26634
|
};
|
|
26532
26635
|
}
|
|
26533
26636
|
}
|
|
@@ -26537,26 +26640,31 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26537
26640
|
* @param options Object containing:
|
|
26538
26641
|
* - configuration: The http request options
|
|
26539
26642
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26643
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26540
26644
|
*
|
|
26541
26645
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26542
26646
|
*/
|
|
26543
26647
|
async getAssetAdministrationShellDescriptorById(options) {
|
|
26544
|
-
const { configuration, aasIdentifier } = options;
|
|
26648
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
26545
26649
|
try {
|
|
26546
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26650
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26547
26651
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26548
26652
|
const response = await apiInstance.getAssetAdministrationShellDescriptorByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
26549
26653
|
return {
|
|
26550
26654
|
success: true,
|
|
26551
26655
|
data: convertApiAasDescriptorToCoreAasDescriptor(await response.value()),
|
|
26552
|
-
statusCode: response.raw.status
|
|
26656
|
+
statusCode: response.raw.status,
|
|
26657
|
+
etag: getEtag(response.raw)
|
|
26553
26658
|
};
|
|
26554
26659
|
} catch (err) {
|
|
26660
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26661
|
+
if (notModified) return notModified;
|
|
26555
26662
|
const customError = await handleApiError(err);
|
|
26556
26663
|
return {
|
|
26557
26664
|
success: false,
|
|
26558
26665
|
error: customError,
|
|
26559
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26666
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26667
|
+
...getConditionalErrorFields(err)
|
|
26560
26668
|
};
|
|
26561
26669
|
}
|
|
26562
26670
|
}
|
|
@@ -26567,13 +26675,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26567
26675
|
* - configuration: The http request options
|
|
26568
26676
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26569
26677
|
* - assetAdministrationShellDescriptor: Asset Administration Shell Descriptor object
|
|
26678
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26679
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
26570
26680
|
*
|
|
26571
26681
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26572
26682
|
*/
|
|
26573
26683
|
async putAssetAdministrationShellDescriptorById(options) {
|
|
26574
|
-
const { configuration, aasIdentifier, assetAdministrationShellDescriptor } = options;
|
|
26684
|
+
const { configuration, aasIdentifier, assetAdministrationShellDescriptor, ifMatch, ifNoneMatch } = options;
|
|
26575
26685
|
try {
|
|
26576
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration
|
|
26686
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, {
|
|
26687
|
+
ifMatch,
|
|
26688
|
+
ifNoneMatch
|
|
26689
|
+
}));
|
|
26577
26690
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26578
26691
|
const response = await apiInstance.putAssetAdministrationShellDescriptorByIdRaw({
|
|
26579
26692
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26582,20 +26695,23 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26582
26695
|
if (response.raw.status === 204) return {
|
|
26583
26696
|
success: true,
|
|
26584
26697
|
data: void 0,
|
|
26585
|
-
statusCode: response.raw.status
|
|
26698
|
+
statusCode: response.raw.status,
|
|
26699
|
+
etag: getEtag(response.raw)
|
|
26586
26700
|
};
|
|
26587
26701
|
const result = await response.value();
|
|
26588
26702
|
return {
|
|
26589
26703
|
success: true,
|
|
26590
26704
|
data: result ? convertApiAasDescriptorToCoreAasDescriptor(result) : void 0,
|
|
26591
|
-
statusCode: response.raw.status
|
|
26705
|
+
statusCode: response.raw.status,
|
|
26706
|
+
etag: getEtag(response.raw)
|
|
26592
26707
|
};
|
|
26593
26708
|
} catch (err) {
|
|
26594
26709
|
const customError = await handleApiError(err);
|
|
26595
26710
|
return {
|
|
26596
26711
|
success: false,
|
|
26597
26712
|
error: customError,
|
|
26598
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26713
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26714
|
+
...getConditionalErrorFields(err)
|
|
26599
26715
|
};
|
|
26600
26716
|
}
|
|
26601
26717
|
}
|
|
@@ -26607,13 +26723,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26607
26723
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26608
26724
|
* - limit?: The maximum number of elements in the response array
|
|
26609
26725
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
26726
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26610
26727
|
*
|
|
26611
26728
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26612
26729
|
*/
|
|
26613
26730
|
async getAllSubmodelDescriptorsThroughSuperpath(options) {
|
|
26614
|
-
const { configuration, aasIdentifier, limit, cursor } = options;
|
|
26731
|
+
const { configuration, aasIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
26615
26732
|
try {
|
|
26616
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26733
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26617
26734
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26618
26735
|
const response = await apiInstance.getAllSubmodelDescriptorsThroughSuperpathRaw({
|
|
26619
26736
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26628,14 +26745,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26628
26745
|
pagedResult: result.paging_metadata,
|
|
26629
26746
|
result: submodelDescriptors
|
|
26630
26747
|
},
|
|
26631
|
-
statusCode: response.raw.status
|
|
26748
|
+
statusCode: response.raw.status,
|
|
26749
|
+
etag: getEtag(response.raw)
|
|
26632
26750
|
};
|
|
26633
26751
|
} catch (err) {
|
|
26752
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26753
|
+
if (notModified) return notModified;
|
|
26634
26754
|
const customError = await handleApiError(err);
|
|
26635
26755
|
return {
|
|
26636
26756
|
success: false,
|
|
26637
26757
|
error: customError,
|
|
26638
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26758
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26759
|
+
...getConditionalErrorFields(err)
|
|
26639
26760
|
};
|
|
26640
26761
|
}
|
|
26641
26762
|
}
|
|
@@ -26646,13 +26767,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26646
26767
|
* - configuration: The http request options.
|
|
26647
26768
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26648
26769
|
* - submodelDescriptor: Submodel Descriptor object
|
|
26770
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26649
26771
|
*
|
|
26650
26772
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26651
26773
|
*/
|
|
26652
26774
|
async postSubmodelDescriptorThroughSuperpath(options) {
|
|
26653
|
-
const { configuration, aasIdentifier, submodelDescriptor } = options;
|
|
26775
|
+
const { configuration, aasIdentifier, submodelDescriptor, ifMatch } = options;
|
|
26654
26776
|
try {
|
|
26655
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26777
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26656
26778
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26657
26779
|
const response = await apiInstance.postSubmodelDescriptorThroughSuperpathRaw({
|
|
26658
26780
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -26661,14 +26783,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26661
26783
|
return {
|
|
26662
26784
|
success: true,
|
|
26663
26785
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
26664
|
-
statusCode: response.raw.status
|
|
26786
|
+
statusCode: response.raw.status,
|
|
26787
|
+
etag: getEtag(response.raw)
|
|
26665
26788
|
};
|
|
26666
26789
|
} catch (err) {
|
|
26667
26790
|
const customError = await handleApiError(err);
|
|
26668
26791
|
return {
|
|
26669
26792
|
success: false,
|
|
26670
26793
|
error: customError,
|
|
26671
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26794
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26795
|
+
...getConditionalErrorFields(err)
|
|
26672
26796
|
};
|
|
26673
26797
|
}
|
|
26674
26798
|
}
|
|
@@ -26679,13 +26803,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26679
26803
|
* - configuration: The http request options
|
|
26680
26804
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26681
26805
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
26806
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
26682
26807
|
*
|
|
26683
26808
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26684
26809
|
*/
|
|
26685
26810
|
async getSubmodelDescriptorByIdThroughSuperpath(options) {
|
|
26686
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
26811
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifNoneMatch } = options;
|
|
26687
26812
|
try {
|
|
26688
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26813
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
26689
26814
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26690
26815
|
const encodedSubmodelIdentifier = base64Encode(AasRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
26691
26816
|
const response = await apiInstance.getSubmodelDescriptorByIdThroughSuperpathRaw({
|
|
@@ -26695,14 +26820,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26695
26820
|
return {
|
|
26696
26821
|
success: true,
|
|
26697
26822
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
26698
|
-
statusCode: response.raw.status
|
|
26823
|
+
statusCode: response.raw.status,
|
|
26824
|
+
etag: getEtag(response.raw)
|
|
26699
26825
|
};
|
|
26700
26826
|
} catch (err) {
|
|
26827
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
26828
|
+
if (notModified) return notModified;
|
|
26701
26829
|
const customError = await handleApiError(err);
|
|
26702
26830
|
return {
|
|
26703
26831
|
success: false,
|
|
26704
26832
|
error: customError,
|
|
26705
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26833
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26834
|
+
...getConditionalErrorFields(err)
|
|
26706
26835
|
};
|
|
26707
26836
|
}
|
|
26708
26837
|
}
|
|
@@ -26713,13 +26842,14 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26713
26842
|
* - configuration: The http request options
|
|
26714
26843
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26715
26844
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
26845
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26716
26846
|
*
|
|
26717
26847
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26718
26848
|
*/
|
|
26719
26849
|
async deleteSubmodelDescriptorByIdThroughSuperpath(options) {
|
|
26720
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
26850
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifMatch } = options;
|
|
26721
26851
|
try {
|
|
26722
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration));
|
|
26852
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
26723
26853
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26724
26854
|
const encodedSubmodelIdentifier = base64Encode(AasRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
26725
26855
|
const response = await apiInstance.deleteSubmodelDescriptorByIdThroughSuperpathRaw({
|
|
@@ -26729,14 +26859,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26729
26859
|
return {
|
|
26730
26860
|
success: true,
|
|
26731
26861
|
data: await response.value(),
|
|
26732
|
-
statusCode: response.raw.status
|
|
26862
|
+
statusCode: response.raw.status,
|
|
26863
|
+
etag: getEtag(response.raw)
|
|
26733
26864
|
};
|
|
26734
26865
|
} catch (err) {
|
|
26735
26866
|
const customError = await handleApiError(err);
|
|
26736
26867
|
return {
|
|
26737
26868
|
success: false,
|
|
26738
26869
|
error: customError,
|
|
26739
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26870
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26871
|
+
...getConditionalErrorFields(err)
|
|
26740
26872
|
};
|
|
26741
26873
|
}
|
|
26742
26874
|
}
|
|
@@ -26748,13 +26880,18 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26748
26880
|
* - aasIdentifier: The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
|
|
26749
26881
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
26750
26882
|
* - submodelDescriptor: Submodel Descriptor object
|
|
26883
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
26884
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
26751
26885
|
*
|
|
26752
26886
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
26753
26887
|
*/
|
|
26754
26888
|
async putSubmodelDescriptorByIdThroughSuperpath(options) {
|
|
26755
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodelDescriptor } = options;
|
|
26889
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelDescriptor, ifMatch, ifNoneMatch } = options;
|
|
26756
26890
|
try {
|
|
26757
|
-
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration
|
|
26891
|
+
const apiInstance = new AssetAdministrationShellRegistryAPIApi(applyDefaults(configuration, {
|
|
26892
|
+
ifMatch,
|
|
26893
|
+
ifNoneMatch
|
|
26894
|
+
}));
|
|
26758
26895
|
const encodedAasIdentifier = base64Encode(AasRegistryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
26759
26896
|
const encodedSubmodelIdentifier = base64Encode(AasRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
26760
26897
|
const response = await apiInstance.putSubmodelDescriptorByIdThroughSuperpathRaw({
|
|
@@ -26765,20 +26902,23 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26765
26902
|
if (response.raw.status === 204) return {
|
|
26766
26903
|
success: true,
|
|
26767
26904
|
data: void 0,
|
|
26768
|
-
statusCode: response.raw.status
|
|
26905
|
+
statusCode: response.raw.status,
|
|
26906
|
+
etag: getEtag(response.raw)
|
|
26769
26907
|
};
|
|
26770
26908
|
const result = await response.value();
|
|
26771
26909
|
return {
|
|
26772
26910
|
success: true,
|
|
26773
26911
|
data: result ? convertApiSubmodelDescriptorToCoreSubmodelDescriptor(result) : void 0,
|
|
26774
|
-
statusCode: response.raw.status
|
|
26912
|
+
statusCode: response.raw.status,
|
|
26913
|
+
etag: getEtag(response.raw)
|
|
26775
26914
|
};
|
|
26776
26915
|
} catch (err) {
|
|
26777
26916
|
const customError = await handleApiError(err);
|
|
26778
26917
|
return {
|
|
26779
26918
|
success: false,
|
|
26780
26919
|
error: customError,
|
|
26781
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26920
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26921
|
+
...getConditionalErrorFields(err)
|
|
26782
26922
|
};
|
|
26783
26923
|
}
|
|
26784
26924
|
}
|
|
@@ -26797,14 +26937,16 @@ var AasRegistryClient = class AasRegistryClient {
|
|
|
26797
26937
|
return {
|
|
26798
26938
|
success: true,
|
|
26799
26939
|
data: await response.value(),
|
|
26800
|
-
statusCode: response.raw.status
|
|
26940
|
+
statusCode: response.raw.status,
|
|
26941
|
+
etag: getEtag(response.raw)
|
|
26801
26942
|
};
|
|
26802
26943
|
} catch (err) {
|
|
26803
26944
|
const customError = await handleApiError(err);
|
|
26804
26945
|
return {
|
|
26805
26946
|
success: false,
|
|
26806
26947
|
error: customError,
|
|
26807
|
-
statusCode: AasRegistryClient.extractStatusCode(err, customError)
|
|
26948
|
+
statusCode: AasRegistryClient.extractStatusCode(err, customError),
|
|
26949
|
+
...getConditionalErrorFields(err)
|
|
26808
26950
|
};
|
|
26809
26951
|
}
|
|
26810
26952
|
}
|
|
@@ -26997,14 +27139,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
26997
27139
|
pagedResult: result.paging_metadata,
|
|
26998
27140
|
result: shells
|
|
26999
27141
|
},
|
|
27000
|
-
statusCode: response.raw.status
|
|
27142
|
+
statusCode: response.raw.status,
|
|
27143
|
+
etag: getEtag(response.raw)
|
|
27001
27144
|
};
|
|
27002
27145
|
} catch (err) {
|
|
27003
27146
|
const customError = await handleApiError(err);
|
|
27004
27147
|
return {
|
|
27005
27148
|
success: false,
|
|
27006
27149
|
error: customError,
|
|
27007
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27150
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27151
|
+
...getConditionalErrorFields(err)
|
|
27008
27152
|
};
|
|
27009
27153
|
}
|
|
27010
27154
|
}
|
|
@@ -27039,14 +27183,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27039
27183
|
pagedResult: result.paging_metadata,
|
|
27040
27184
|
result: shellReferences
|
|
27041
27185
|
},
|
|
27042
|
-
statusCode: response.raw.status
|
|
27186
|
+
statusCode: response.raw.status,
|
|
27187
|
+
etag: getEtag(response.raw)
|
|
27043
27188
|
};
|
|
27044
27189
|
} catch (err) {
|
|
27045
27190
|
const customError = await handleApiError(err);
|
|
27046
27191
|
return {
|
|
27047
27192
|
success: false,
|
|
27048
27193
|
error: customError,
|
|
27049
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27194
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27195
|
+
...getConditionalErrorFields(err)
|
|
27050
27196
|
};
|
|
27051
27197
|
}
|
|
27052
27198
|
}
|
|
@@ -27066,14 +27212,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27066
27212
|
return {
|
|
27067
27213
|
success: true,
|
|
27068
27214
|
data: convertApiAasToCoreAas(await response.value()),
|
|
27069
|
-
statusCode: response.raw.status
|
|
27215
|
+
statusCode: response.raw.status,
|
|
27216
|
+
etag: getEtag(response.raw)
|
|
27070
27217
|
};
|
|
27071
27218
|
} catch (err) {
|
|
27072
27219
|
const customError = await handleApiError(err);
|
|
27073
27220
|
return {
|
|
27074
27221
|
success: false,
|
|
27075
27222
|
error: customError,
|
|
27076
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27223
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27224
|
+
...getConditionalErrorFields(err)
|
|
27077
27225
|
};
|
|
27078
27226
|
}
|
|
27079
27227
|
}
|
|
@@ -27083,26 +27231,29 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27083
27231
|
* @param options Object containing:
|
|
27084
27232
|
* - configuration: The http request options
|
|
27085
27233
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27234
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27086
27235
|
*
|
|
27087
27236
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27088
27237
|
*/
|
|
27089
27238
|
async deleteAssetAdministrationShellById(options) {
|
|
27090
|
-
const { configuration, aasIdentifier } = options;
|
|
27239
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
27091
27240
|
try {
|
|
27092
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27241
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27093
27242
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27094
27243
|
const response = await apiInstance.deleteAssetAdministrationShellByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27095
27244
|
return {
|
|
27096
27245
|
success: true,
|
|
27097
27246
|
data: await response.value(),
|
|
27098
|
-
statusCode: response.raw.status
|
|
27247
|
+
statusCode: response.raw.status,
|
|
27248
|
+
etag: getEtag(response.raw)
|
|
27099
27249
|
};
|
|
27100
27250
|
} catch (err) {
|
|
27101
27251
|
const customError = await handleApiError(err);
|
|
27102
27252
|
return {
|
|
27103
27253
|
success: false,
|
|
27104
27254
|
error: customError,
|
|
27105
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27255
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27256
|
+
...getConditionalErrorFields(err)
|
|
27106
27257
|
};
|
|
27107
27258
|
}
|
|
27108
27259
|
}
|
|
@@ -27112,26 +27263,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27112
27263
|
* @param options Object containing:
|
|
27113
27264
|
* - configuration: The http request options
|
|
27114
27265
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27266
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27115
27267
|
*
|
|
27116
27268
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27117
27269
|
*/
|
|
27118
27270
|
async getAssetAdministrationShellById(options) {
|
|
27119
|
-
const { configuration, aasIdentifier } = options;
|
|
27271
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27120
27272
|
try {
|
|
27121
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27273
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27122
27274
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27123
27275
|
const response = await apiInstance.getAssetAdministrationShellByIdRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27124
27276
|
return {
|
|
27125
27277
|
success: true,
|
|
27126
27278
|
data: convertApiAasToCoreAas(await response.value()),
|
|
27127
|
-
statusCode: response.raw.status
|
|
27279
|
+
statusCode: response.raw.status,
|
|
27280
|
+
etag: getEtag(response.raw)
|
|
27128
27281
|
};
|
|
27129
27282
|
} catch (err) {
|
|
27283
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27284
|
+
if (notModified) return notModified;
|
|
27130
27285
|
const customError = await handleApiError(err);
|
|
27131
27286
|
return {
|
|
27132
27287
|
success: false,
|
|
27133
27288
|
error: customError,
|
|
27134
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27289
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27290
|
+
...getConditionalErrorFields(err)
|
|
27135
27291
|
};
|
|
27136
27292
|
}
|
|
27137
27293
|
}
|
|
@@ -27142,13 +27298,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27142
27298
|
* - configuration: The http request options
|
|
27143
27299
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27144
27300
|
* - assetAdministrationShell: Asset Administration Shell object
|
|
27301
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27302
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27145
27303
|
*
|
|
27146
27304
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27147
27305
|
*/
|
|
27148
27306
|
async putAssetAdministrationShellById(options) {
|
|
27149
|
-
const { configuration, aasIdentifier, assetAdministrationShell } = options;
|
|
27307
|
+
const { configuration, aasIdentifier, assetAdministrationShell, ifMatch, ifNoneMatch } = options;
|
|
27150
27308
|
try {
|
|
27151
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27309
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27310
|
+
ifMatch,
|
|
27311
|
+
ifNoneMatch
|
|
27312
|
+
}));
|
|
27152
27313
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27153
27314
|
const response = await apiInstance.putAssetAdministrationShellByIdRaw({
|
|
27154
27315
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27157,20 +27318,23 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27157
27318
|
if (response.raw.status === 204) return {
|
|
27158
27319
|
success: true,
|
|
27159
27320
|
data: void 0,
|
|
27160
|
-
statusCode: response.raw.status
|
|
27321
|
+
statusCode: response.raw.status,
|
|
27322
|
+
etag: getEtag(response.raw)
|
|
27161
27323
|
};
|
|
27162
27324
|
const result = await response.value();
|
|
27163
27325
|
return {
|
|
27164
27326
|
success: true,
|
|
27165
27327
|
data: result ? convertApiAasToCoreAas(result) : void 0,
|
|
27166
|
-
statusCode: response.raw.status
|
|
27328
|
+
statusCode: response.raw.status,
|
|
27329
|
+
etag: getEtag(response.raw)
|
|
27167
27330
|
};
|
|
27168
27331
|
} catch (err) {
|
|
27169
27332
|
const customError = await handleApiError(err);
|
|
27170
27333
|
return {
|
|
27171
27334
|
success: false,
|
|
27172
27335
|
error: customError,
|
|
27173
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27336
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27337
|
+
...getConditionalErrorFields(err)
|
|
27174
27338
|
};
|
|
27175
27339
|
}
|
|
27176
27340
|
}
|
|
@@ -27180,26 +27344,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27180
27344
|
* @param options Object containing:
|
|
27181
27345
|
* - configuration: The http request options
|
|
27182
27346
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27347
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27183
27348
|
*
|
|
27184
27349
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27185
27350
|
*/
|
|
27186
27351
|
async getAssetAdministrationShellByIdReferenceAasRepository(options) {
|
|
27187
|
-
const { configuration, aasIdentifier } = options;
|
|
27352
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27188
27353
|
try {
|
|
27189
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27354
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27190
27355
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27191
27356
|
const response = await apiInstance.getAssetAdministrationShellByIdReferenceAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27192
27357
|
return {
|
|
27193
27358
|
success: true,
|
|
27194
27359
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
27195
|
-
statusCode: response.raw.status
|
|
27360
|
+
statusCode: response.raw.status,
|
|
27361
|
+
etag: getEtag(response.raw)
|
|
27196
27362
|
};
|
|
27197
27363
|
} catch (err) {
|
|
27364
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27365
|
+
if (notModified) return notModified;
|
|
27198
27366
|
const customError = await handleApiError(err);
|
|
27199
27367
|
return {
|
|
27200
27368
|
success: false,
|
|
27201
27369
|
error: customError,
|
|
27202
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27370
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27371
|
+
...getConditionalErrorFields(err)
|
|
27203
27372
|
};
|
|
27204
27373
|
}
|
|
27205
27374
|
}
|
|
@@ -27209,26 +27378,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27209
27378
|
* @param options Object containing:
|
|
27210
27379
|
* - configuration: The http request options
|
|
27211
27380
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27381
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27212
27382
|
*
|
|
27213
27383
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27214
27384
|
*/
|
|
27215
27385
|
async getAssetInformationAasRepository(options) {
|
|
27216
|
-
const { configuration, aasIdentifier } = options;
|
|
27386
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27217
27387
|
try {
|
|
27218
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27388
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27219
27389
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27220
27390
|
const response = await apiInstance.getAssetInformationAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27221
27391
|
return {
|
|
27222
27392
|
success: true,
|
|
27223
27393
|
data: convertApiAssetInformationToCoreAssetInformation(await response.value()),
|
|
27224
|
-
statusCode: response.raw.status
|
|
27394
|
+
statusCode: response.raw.status,
|
|
27395
|
+
etag: getEtag(response.raw)
|
|
27225
27396
|
};
|
|
27226
27397
|
} catch (err) {
|
|
27398
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27399
|
+
if (notModified) return notModified;
|
|
27227
27400
|
const customError = await handleApiError(err);
|
|
27228
27401
|
return {
|
|
27229
27402
|
success: false,
|
|
27230
27403
|
error: customError,
|
|
27231
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27404
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27405
|
+
...getConditionalErrorFields(err)
|
|
27232
27406
|
};
|
|
27233
27407
|
}
|
|
27234
27408
|
}
|
|
@@ -27239,13 +27413,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27239
27413
|
* - configuration: The http request options
|
|
27240
27414
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27241
27415
|
* - assetInformation: Asset Information object
|
|
27416
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27417
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27242
27418
|
*
|
|
27243
27419
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27244
27420
|
*/
|
|
27245
27421
|
async putAssetInformationAasRepository(options) {
|
|
27246
|
-
const { configuration, aasIdentifier, assetInformation } = options;
|
|
27422
|
+
const { configuration, aasIdentifier, assetInformation, ifMatch, ifNoneMatch } = options;
|
|
27247
27423
|
try {
|
|
27248
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27424
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27425
|
+
ifMatch,
|
|
27426
|
+
ifNoneMatch
|
|
27427
|
+
}));
|
|
27249
27428
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27250
27429
|
const response = await apiInstance.putAssetInformationAasRepositoryRaw({
|
|
27251
27430
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27254,14 +27433,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27254
27433
|
return {
|
|
27255
27434
|
success: true,
|
|
27256
27435
|
data: await response.value(),
|
|
27257
|
-
statusCode: response.raw.status
|
|
27436
|
+
statusCode: response.raw.status,
|
|
27437
|
+
etag: getEtag(response.raw)
|
|
27258
27438
|
};
|
|
27259
27439
|
} catch (err) {
|
|
27260
27440
|
const customError = await handleApiError(err);
|
|
27261
27441
|
return {
|
|
27262
27442
|
success: false,
|
|
27263
27443
|
error: customError,
|
|
27264
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27444
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27445
|
+
...getConditionalErrorFields(err)
|
|
27265
27446
|
};
|
|
27266
27447
|
}
|
|
27267
27448
|
}
|
|
@@ -27271,31 +27452,35 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27271
27452
|
* @param options Object containing:
|
|
27272
27453
|
* - configuration: The http request options
|
|
27273
27454
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27455
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27274
27456
|
*
|
|
27275
27457
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27276
27458
|
*/
|
|
27277
27459
|
async deleteThumbnailAasRepository(options) {
|
|
27278
|
-
const { configuration, aasIdentifier } = options;
|
|
27460
|
+
const { configuration, aasIdentifier, ifMatch } = options;
|
|
27279
27461
|
try {
|
|
27280
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27462
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27281
27463
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27282
27464
|
const response = await apiInstance.deleteThumbnailAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27283
27465
|
if (response.raw.status === 204) return {
|
|
27284
27466
|
success: true,
|
|
27285
27467
|
data: void 0,
|
|
27286
|
-
statusCode: response.raw.status
|
|
27468
|
+
statusCode: response.raw.status,
|
|
27469
|
+
etag: getEtag(response.raw)
|
|
27287
27470
|
};
|
|
27288
27471
|
return {
|
|
27289
27472
|
success: true,
|
|
27290
27473
|
data: await response.value(),
|
|
27291
|
-
statusCode: response.raw.status
|
|
27474
|
+
statusCode: response.raw.status,
|
|
27475
|
+
etag: getEtag(response.raw)
|
|
27292
27476
|
};
|
|
27293
27477
|
} catch (err) {
|
|
27294
27478
|
const customError = await handleApiError(err);
|
|
27295
27479
|
return {
|
|
27296
27480
|
success: false,
|
|
27297
27481
|
error: customError,
|
|
27298
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27482
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27483
|
+
...getConditionalErrorFields(err)
|
|
27299
27484
|
};
|
|
27300
27485
|
}
|
|
27301
27486
|
}
|
|
@@ -27305,26 +27490,31 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27305
27490
|
* @param options Object containing:
|
|
27306
27491
|
* - configuration: The http request options
|
|
27307
27492
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27493
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27308
27494
|
*
|
|
27309
27495
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27310
27496
|
*/
|
|
27311
27497
|
async getThumbnailAasRepository(options) {
|
|
27312
|
-
const { configuration, aasIdentifier } = options;
|
|
27498
|
+
const { configuration, aasIdentifier, ifNoneMatch } = options;
|
|
27313
27499
|
try {
|
|
27314
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27500
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27315
27501
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27316
27502
|
const response = await apiInstance.getThumbnailAasRepositoryRaw({ aasIdentifier: encodedAasIdentifier });
|
|
27317
27503
|
return {
|
|
27318
27504
|
success: true,
|
|
27319
27505
|
data: await response.value(),
|
|
27320
|
-
statusCode: response.raw.status
|
|
27506
|
+
statusCode: response.raw.status,
|
|
27507
|
+
etag: getEtag(response.raw)
|
|
27321
27508
|
};
|
|
27322
27509
|
} catch (err) {
|
|
27510
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27511
|
+
if (notModified) return notModified;
|
|
27323
27512
|
const customError = await handleApiError(err);
|
|
27324
27513
|
return {
|
|
27325
27514
|
success: false,
|
|
27326
27515
|
error: customError,
|
|
27327
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27516
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27517
|
+
...getConditionalErrorFields(err)
|
|
27328
27518
|
};
|
|
27329
27519
|
}
|
|
27330
27520
|
}
|
|
@@ -27336,13 +27526,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27336
27526
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27337
27527
|
* - fileName: The name of the file
|
|
27338
27528
|
* - file: The file to upload
|
|
27529
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27530
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27339
27531
|
*
|
|
27340
27532
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27341
27533
|
*/
|
|
27342
27534
|
async putThumbnailAasRepository(options) {
|
|
27343
|
-
const { configuration, aasIdentifier, fileName, file } = options;
|
|
27535
|
+
const { configuration, aasIdentifier, fileName, file, ifMatch, ifNoneMatch } = options;
|
|
27344
27536
|
try {
|
|
27345
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27537
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27538
|
+
ifMatch,
|
|
27539
|
+
ifNoneMatch
|
|
27540
|
+
}));
|
|
27346
27541
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27347
27542
|
const response = await apiInstance.putThumbnailAasRepositoryRaw({
|
|
27348
27543
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27352,14 +27547,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27352
27547
|
return {
|
|
27353
27548
|
success: true,
|
|
27354
27549
|
data: await response.value(),
|
|
27355
|
-
statusCode: response.raw.status
|
|
27550
|
+
statusCode: response.raw.status,
|
|
27551
|
+
etag: getEtag(response.raw)
|
|
27356
27552
|
};
|
|
27357
27553
|
} catch (err) {
|
|
27358
27554
|
const customError = await handleApiError(err);
|
|
27359
27555
|
return {
|
|
27360
27556
|
success: false,
|
|
27361
27557
|
error: customError,
|
|
27362
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27558
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27559
|
+
...getConditionalErrorFields(err)
|
|
27363
27560
|
};
|
|
27364
27561
|
}
|
|
27365
27562
|
}
|
|
@@ -27371,13 +27568,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27371
27568
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27372
27569
|
* - limit?: The maximum number of elements in the response array
|
|
27373
27570
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
27571
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27374
27572
|
*
|
|
27375
27573
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27376
27574
|
*/
|
|
27377
27575
|
async getAllSubmodelReferencesAasRepository(options) {
|
|
27378
|
-
const { configuration, aasIdentifier, limit, cursor } = options;
|
|
27576
|
+
const { configuration, aasIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
27379
27577
|
try {
|
|
27380
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27578
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27381
27579
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27382
27580
|
const response = await apiInstance.getAllSubmodelReferencesAasRepositoryRaw({
|
|
27383
27581
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27392,14 +27590,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27392
27590
|
pagedResult: result.paging_metadata,
|
|
27393
27591
|
result: submodelReferences
|
|
27394
27592
|
},
|
|
27395
|
-
statusCode: response.raw.status
|
|
27593
|
+
statusCode: response.raw.status,
|
|
27594
|
+
etag: getEtag(response.raw)
|
|
27396
27595
|
};
|
|
27397
27596
|
} catch (err) {
|
|
27597
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27598
|
+
if (notModified) return notModified;
|
|
27398
27599
|
const customError = await handleApiError(err);
|
|
27399
27600
|
return {
|
|
27400
27601
|
success: false,
|
|
27401
27602
|
error: customError,
|
|
27402
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27603
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27604
|
+
...getConditionalErrorFields(err)
|
|
27403
27605
|
};
|
|
27404
27606
|
}
|
|
27405
27607
|
}
|
|
@@ -27410,13 +27612,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27410
27612
|
* - configuration: The http request options
|
|
27411
27613
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27412
27614
|
* - submodelReference: Reference to the Submodel
|
|
27615
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27413
27616
|
*
|
|
27414
27617
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27415
27618
|
*/
|
|
27416
27619
|
async postSubmodelReferenceAasRepository(options) {
|
|
27417
|
-
const { configuration, aasIdentifier, submodelReference } = options;
|
|
27620
|
+
const { configuration, aasIdentifier, submodelReference, ifMatch } = options;
|
|
27418
27621
|
try {
|
|
27419
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27622
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27420
27623
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27421
27624
|
const response = await apiInstance.postSubmodelReferenceAasRepositoryRaw({
|
|
27422
27625
|
aasIdentifier: encodedAasIdentifier,
|
|
@@ -27425,14 +27628,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27425
27628
|
return {
|
|
27426
27629
|
success: true,
|
|
27427
27630
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
27428
|
-
statusCode: response.raw.status
|
|
27631
|
+
statusCode: response.raw.status,
|
|
27632
|
+
etag: getEtag(response.raw)
|
|
27429
27633
|
};
|
|
27430
27634
|
} catch (err) {
|
|
27431
27635
|
const customError = await handleApiError(err);
|
|
27432
27636
|
return {
|
|
27433
27637
|
success: false,
|
|
27434
27638
|
error: customError,
|
|
27435
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27639
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27640
|
+
...getConditionalErrorFields(err)
|
|
27436
27641
|
};
|
|
27437
27642
|
}
|
|
27438
27643
|
}
|
|
@@ -27443,13 +27648,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27443
27648
|
* - configuration: The http request options
|
|
27444
27649
|
* - aasIdentifier: Unique ID of the AAS
|
|
27445
27650
|
* - submodelIdentifier: The submodel's unique ID
|
|
27651
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27446
27652
|
*
|
|
27447
27653
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27448
27654
|
*/
|
|
27449
27655
|
async deleteSubmodelReferenceAasRepository(options) {
|
|
27450
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
27656
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifMatch } = options;
|
|
27451
27657
|
try {
|
|
27452
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27658
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27453
27659
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27454
27660
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27455
27661
|
const response = await apiInstance.deleteSubmodelReferenceAasRepositoryRaw({
|
|
@@ -27459,14 +27665,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27459
27665
|
return {
|
|
27460
27666
|
success: true,
|
|
27461
27667
|
data: await response.value(),
|
|
27462
|
-
statusCode: response.raw.status
|
|
27668
|
+
statusCode: response.raw.status,
|
|
27669
|
+
etag: getEtag(response.raw)
|
|
27463
27670
|
};
|
|
27464
27671
|
} catch (err) {
|
|
27465
27672
|
const customError = await handleApiError(err);
|
|
27466
27673
|
return {
|
|
27467
27674
|
success: false,
|
|
27468
27675
|
error: customError,
|
|
27469
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27676
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27677
|
+
...getConditionalErrorFields(err)
|
|
27470
27678
|
};
|
|
27471
27679
|
}
|
|
27472
27680
|
}
|
|
@@ -27503,13 +27711,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27503
27711
|
* - submodelIdentifier: The submodel's unique ID
|
|
27504
27712
|
* - level?: Determines the structural depth of the respective resource content
|
|
27505
27713
|
* - extent?: Determines to which extent the resource is being serialized
|
|
27714
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27506
27715
|
*
|
|
27507
27716
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27508
27717
|
*/
|
|
27509
27718
|
async getSubmodelByIdAasRepository(options) {
|
|
27510
|
-
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
27719
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
27511
27720
|
try {
|
|
27512
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27721
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27513
27722
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27514
27723
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27515
27724
|
const response = await apiInstance.getSubmodelByIdAasRepositoryRaw({
|
|
@@ -27521,14 +27730,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27521
27730
|
return {
|
|
27522
27731
|
success: true,
|
|
27523
27732
|
data: convertApiSubmodelToCoreSubmodel(await response.value()),
|
|
27524
|
-
statusCode: response.raw.status
|
|
27733
|
+
statusCode: response.raw.status,
|
|
27734
|
+
etag: getEtag(response.raw)
|
|
27525
27735
|
};
|
|
27526
27736
|
} catch (err) {
|
|
27737
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27738
|
+
if (notModified) return notModified;
|
|
27527
27739
|
const customError = await handleApiError(err);
|
|
27528
27740
|
return {
|
|
27529
27741
|
success: false,
|
|
27530
27742
|
error: customError,
|
|
27531
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27743
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27744
|
+
...getConditionalErrorFields(err)
|
|
27532
27745
|
};
|
|
27533
27746
|
}
|
|
27534
27747
|
}
|
|
@@ -27540,13 +27753,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27540
27753
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27541
27754
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27542
27755
|
* - submodel: Submodel object
|
|
27756
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27757
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
27543
27758
|
*
|
|
27544
27759
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27545
27760
|
*/
|
|
27546
27761
|
async putSubmodelByIdAasRepository(options) {
|
|
27547
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodel } = options;
|
|
27762
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodel, ifMatch, ifNoneMatch } = options;
|
|
27548
27763
|
try {
|
|
27549
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
27764
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
27765
|
+
ifMatch,
|
|
27766
|
+
ifNoneMatch
|
|
27767
|
+
}));
|
|
27550
27768
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27551
27769
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27552
27770
|
const response = await apiInstance.putSubmodelByIdAasRepositoryRaw({
|
|
@@ -27557,34 +27775,39 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27557
27775
|
if (response.raw.status === 204) return {
|
|
27558
27776
|
success: true,
|
|
27559
27777
|
data: void 0,
|
|
27560
|
-
statusCode: response.raw.status
|
|
27778
|
+
statusCode: response.raw.status,
|
|
27779
|
+
etag: getEtag(response.raw)
|
|
27561
27780
|
};
|
|
27562
27781
|
if (response.raw.status === 201) try {
|
|
27563
27782
|
const createdSubmodel = await response.value();
|
|
27564
27783
|
return {
|
|
27565
27784
|
success: true,
|
|
27566
27785
|
data: createdSubmodel ? convertApiSubmodelToCoreSubmodel(createdSubmodel) : void 0,
|
|
27567
|
-
statusCode: response.raw.status
|
|
27786
|
+
statusCode: response.raw.status,
|
|
27787
|
+
etag: getEtag(response.raw)
|
|
27568
27788
|
};
|
|
27569
27789
|
} catch {
|
|
27570
27790
|
return {
|
|
27571
27791
|
success: true,
|
|
27572
27792
|
data: void 0,
|
|
27573
|
-
statusCode: response.raw.status
|
|
27793
|
+
statusCode: response.raw.status,
|
|
27794
|
+
etag: getEtag(response.raw)
|
|
27574
27795
|
};
|
|
27575
27796
|
}
|
|
27576
27797
|
const result = await response.value();
|
|
27577
27798
|
return {
|
|
27578
27799
|
success: true,
|
|
27579
27800
|
data: result ? convertApiSubmodelToCoreSubmodel(result) : void 0,
|
|
27580
|
-
statusCode: response.raw.status
|
|
27801
|
+
statusCode: response.raw.status,
|
|
27802
|
+
etag: getEtag(response.raw)
|
|
27581
27803
|
};
|
|
27582
27804
|
} catch (err) {
|
|
27583
27805
|
const customError = await handleApiError(err);
|
|
27584
27806
|
return {
|
|
27585
27807
|
success: false,
|
|
27586
27808
|
error: customError,
|
|
27587
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27809
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27810
|
+
...getConditionalErrorFields(err)
|
|
27588
27811
|
};
|
|
27589
27812
|
}
|
|
27590
27813
|
}
|
|
@@ -27595,13 +27818,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27595
27818
|
* - configuration: The http request options
|
|
27596
27819
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27597
27820
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27821
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27598
27822
|
*
|
|
27599
27823
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27600
27824
|
*/
|
|
27601
27825
|
async deleteSubmodelByIdAasRepository(options) {
|
|
27602
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
27826
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifMatch } = options;
|
|
27603
27827
|
try {
|
|
27604
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27828
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27605
27829
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27606
27830
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27607
27831
|
const response = await apiInstance.deleteSubmodelByIdAasRepositoryRaw({
|
|
@@ -27611,14 +27835,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27611
27835
|
return {
|
|
27612
27836
|
success: true,
|
|
27613
27837
|
data: await response.value(),
|
|
27614
|
-
statusCode: response.raw.status
|
|
27838
|
+
statusCode: response.raw.status,
|
|
27839
|
+
etag: getEtag(response.raw)
|
|
27615
27840
|
};
|
|
27616
27841
|
} catch (err) {
|
|
27617
27842
|
const customError = await handleApiError(err);
|
|
27618
27843
|
return {
|
|
27619
27844
|
success: false,
|
|
27620
27845
|
error: customError,
|
|
27621
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27846
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27847
|
+
...getConditionalErrorFields(err)
|
|
27622
27848
|
};
|
|
27623
27849
|
}
|
|
27624
27850
|
}
|
|
@@ -27631,13 +27857,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27631
27857
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27632
27858
|
* - submodel: Submodel object
|
|
27633
27859
|
* - level?: Determines the structural depth of the respective resource content
|
|
27860
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27634
27861
|
*
|
|
27635
27862
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27636
27863
|
*/
|
|
27637
27864
|
async patchSubmodelAasRepository(options) {
|
|
27638
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodel, level } = options;
|
|
27865
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodel, level, ifMatch } = options;
|
|
27639
27866
|
try {
|
|
27640
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27867
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27641
27868
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27642
27869
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27643
27870
|
const response = await apiInstance.patchSubmodelAasRepositoryRaw({
|
|
@@ -27649,14 +27876,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27649
27876
|
return {
|
|
27650
27877
|
success: true,
|
|
27651
27878
|
data: await response.value(),
|
|
27652
|
-
statusCode: response.raw.status
|
|
27879
|
+
statusCode: response.raw.status,
|
|
27880
|
+
etag: getEtag(response.raw)
|
|
27653
27881
|
};
|
|
27654
27882
|
} catch (err) {
|
|
27655
27883
|
const customError = await handleApiError(err);
|
|
27656
27884
|
return {
|
|
27657
27885
|
success: false,
|
|
27658
27886
|
error: customError,
|
|
27659
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27887
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27888
|
+
...getConditionalErrorFields(err)
|
|
27660
27889
|
};
|
|
27661
27890
|
}
|
|
27662
27891
|
}
|
|
@@ -27667,13 +27896,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27667
27896
|
* - configuration: The http request options
|
|
27668
27897
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27669
27898
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27899
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27670
27900
|
*
|
|
27671
27901
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27672
27902
|
*/
|
|
27673
27903
|
async getSubmodelByIdMetadataAasRepository(options) {
|
|
27674
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
27904
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifNoneMatch } = options;
|
|
27675
27905
|
try {
|
|
27676
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27906
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27677
27907
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27678
27908
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27679
27909
|
const response = await apiInstance.getSubmodelByIdMetadataAasRepositoryRaw({
|
|
@@ -27683,14 +27913,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27683
27913
|
return {
|
|
27684
27914
|
success: true,
|
|
27685
27915
|
data: await response.value(),
|
|
27686
|
-
statusCode: response.raw.status
|
|
27916
|
+
statusCode: response.raw.status,
|
|
27917
|
+
etag: getEtag(response.raw)
|
|
27687
27918
|
};
|
|
27688
27919
|
} catch (err) {
|
|
27920
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
27921
|
+
if (notModified) return notModified;
|
|
27689
27922
|
const customError = await handleApiError(err);
|
|
27690
27923
|
return {
|
|
27691
27924
|
success: false,
|
|
27692
27925
|
error: customError,
|
|
27693
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27926
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27927
|
+
...getConditionalErrorFields(err)
|
|
27694
27928
|
};
|
|
27695
27929
|
}
|
|
27696
27930
|
}
|
|
@@ -27702,13 +27936,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27702
27936
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27703
27937
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27704
27938
|
* - submodelMetadata: The Submodel Metadata object
|
|
27939
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27705
27940
|
*
|
|
27706
27941
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27707
27942
|
*/
|
|
27708
27943
|
async patchSubmodelByIdMetadataAasRepository(options) {
|
|
27709
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodelMetadata } = options;
|
|
27944
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelMetadata, ifMatch } = options;
|
|
27710
27945
|
try {
|
|
27711
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27946
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27712
27947
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27713
27948
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27714
27949
|
const response = await apiInstance.patchSubmodelByIdMetadataAasRepositoryRaw({
|
|
@@ -27719,14 +27954,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27719
27954
|
return {
|
|
27720
27955
|
success: true,
|
|
27721
27956
|
data: await response.value(),
|
|
27722
|
-
statusCode: response.raw.status
|
|
27957
|
+
statusCode: response.raw.status,
|
|
27958
|
+
etag: getEtag(response.raw)
|
|
27723
27959
|
};
|
|
27724
27960
|
} catch (err) {
|
|
27725
27961
|
const customError = await handleApiError(err);
|
|
27726
27962
|
return {
|
|
27727
27963
|
success: false,
|
|
27728
27964
|
error: customError,
|
|
27729
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
27965
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
27966
|
+
...getConditionalErrorFields(err)
|
|
27730
27967
|
};
|
|
27731
27968
|
}
|
|
27732
27969
|
}
|
|
@@ -27739,13 +27976,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27739
27976
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27740
27977
|
* - level?: Determines the structural depth of the respective resource content
|
|
27741
27978
|
* - extent?: Determines to which extent the resource is being serialized
|
|
27979
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27742
27980
|
*
|
|
27743
27981
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27744
27982
|
*/
|
|
27745
27983
|
async getSubmodelByIdValueOnlyAasRepository(options) {
|
|
27746
|
-
const { configuration, aasIdentifier, submodelIdentifier, level, extent } = options;
|
|
27984
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
27747
27985
|
try {
|
|
27748
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
27986
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27749
27987
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27750
27988
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27751
27989
|
const response = await apiInstance.getSubmodelByIdValueOnlyAasRepositoryRaw({
|
|
@@ -27757,14 +27995,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27757
27995
|
return {
|
|
27758
27996
|
success: true,
|
|
27759
27997
|
data: await response.value(),
|
|
27760
|
-
statusCode: response.raw.status
|
|
27998
|
+
statusCode: response.raw.status,
|
|
27999
|
+
etag: getEtag(response.raw)
|
|
27761
28000
|
};
|
|
27762
28001
|
} catch (err) {
|
|
28002
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28003
|
+
if (notModified) return notModified;
|
|
27763
28004
|
const customError = await handleApiError(err);
|
|
27764
28005
|
return {
|
|
27765
28006
|
success: false,
|
|
27766
28007
|
error: customError,
|
|
27767
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28008
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28009
|
+
...getConditionalErrorFields(err)
|
|
27768
28010
|
};
|
|
27769
28011
|
}
|
|
27770
28012
|
}
|
|
@@ -27776,13 +28018,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27776
28018
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27777
28019
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27778
28020
|
* - level?: Determines the structural depth of the respective resource content
|
|
28021
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27779
28022
|
*
|
|
27780
28023
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27781
28024
|
*/
|
|
27782
28025
|
async patchSubmodelByIdValueOnlyAasRepository(options) {
|
|
27783
|
-
const { configuration, aasIdentifier, submodelIdentifier, body, level } = options;
|
|
28026
|
+
const { configuration, aasIdentifier, submodelIdentifier, body, level, ifMatch } = options;
|
|
27784
28027
|
try {
|
|
27785
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28028
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27786
28029
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27787
28030
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27788
28031
|
const response = await apiInstance.patchSubmodelByIdValueOnlyAasRepositoryRaw({
|
|
@@ -27794,14 +28037,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27794
28037
|
return {
|
|
27795
28038
|
success: true,
|
|
27796
28039
|
data: await response.value(),
|
|
27797
|
-
statusCode: response.raw.status
|
|
28040
|
+
statusCode: response.raw.status,
|
|
28041
|
+
etag: getEtag(response.raw)
|
|
27798
28042
|
};
|
|
27799
28043
|
} catch (err) {
|
|
27800
28044
|
const customError = await handleApiError(err);
|
|
27801
28045
|
return {
|
|
27802
28046
|
success: false,
|
|
27803
28047
|
error: customError,
|
|
27804
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28048
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28049
|
+
...getConditionalErrorFields(err)
|
|
27805
28050
|
};
|
|
27806
28051
|
}
|
|
27807
28052
|
}
|
|
@@ -27812,13 +28057,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27812
28057
|
* - configuration: The http request options
|
|
27813
28058
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27814
28059
|
* - submodelIdentifier: The submodel's unique ID
|
|
28060
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27815
28061
|
*
|
|
27816
28062
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27817
28063
|
*/
|
|
27818
28064
|
async getSubmodelByIdReferenceAasRepository(options) {
|
|
27819
|
-
const { configuration, aasIdentifier, submodelIdentifier } = options;
|
|
28065
|
+
const { configuration, aasIdentifier, submodelIdentifier, ifNoneMatch } = options;
|
|
27820
28066
|
try {
|
|
27821
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28067
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27822
28068
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27823
28069
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27824
28070
|
const response = await apiInstance.getSubmodelByIdReferenceAasRepositoryRaw({
|
|
@@ -27828,14 +28074,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27828
28074
|
return {
|
|
27829
28075
|
success: true,
|
|
27830
28076
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
27831
|
-
statusCode: response.raw.status
|
|
28077
|
+
statusCode: response.raw.status,
|
|
28078
|
+
etag: getEtag(response.raw)
|
|
27832
28079
|
};
|
|
27833
28080
|
} catch (err) {
|
|
28081
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28082
|
+
if (notModified) return notModified;
|
|
27834
28083
|
const customError = await handleApiError(err);
|
|
27835
28084
|
return {
|
|
27836
28085
|
success: false,
|
|
27837
28086
|
error: customError,
|
|
27838
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28087
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28088
|
+
...getConditionalErrorFields(err)
|
|
27839
28089
|
};
|
|
27840
28090
|
}
|
|
27841
28091
|
}
|
|
@@ -27847,13 +28097,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27847
28097
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27848
28098
|
* - submodelIdentifier: The submodel's unique ID
|
|
27849
28099
|
* - level?: Determines the structural depth of the respective resource content
|
|
28100
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27850
28101
|
*
|
|
27851
28102
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27852
28103
|
*/
|
|
27853
28104
|
async getSubmodelByIdPathAasRepository(options) {
|
|
27854
|
-
const { configuration, aasIdentifier, submodelIdentifier, level } = options;
|
|
28105
|
+
const { configuration, aasIdentifier, submodelIdentifier, level, ifNoneMatch } = options;
|
|
27855
28106
|
try {
|
|
27856
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28107
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27857
28108
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27858
28109
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27859
28110
|
const response = await apiInstance.getSubmodelByIdPathAasRepositoryRaw({
|
|
@@ -27864,14 +28115,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27864
28115
|
return {
|
|
27865
28116
|
success: true,
|
|
27866
28117
|
data: await response.value(),
|
|
27867
|
-
statusCode: response.raw.status
|
|
28118
|
+
statusCode: response.raw.status,
|
|
28119
|
+
etag: getEtag(response.raw)
|
|
27868
28120
|
};
|
|
27869
28121
|
} catch (err) {
|
|
28122
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28123
|
+
if (notModified) return notModified;
|
|
27870
28124
|
const customError = await handleApiError(err);
|
|
27871
28125
|
return {
|
|
27872
28126
|
success: false,
|
|
27873
28127
|
error: customError,
|
|
27874
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28128
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28129
|
+
...getConditionalErrorFields(err)
|
|
27875
28130
|
};
|
|
27876
28131
|
}
|
|
27877
28132
|
}
|
|
@@ -27886,13 +28141,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27886
28141
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
27887
28142
|
* - level?: Determines the structural depth of the respective resource content
|
|
27888
28143
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28144
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27889
28145
|
*
|
|
27890
28146
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27891
28147
|
*/
|
|
27892
28148
|
async getAllSubmodelElementsAasRepository(options) {
|
|
27893
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
28149
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
27894
28150
|
try {
|
|
27895
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28151
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27896
28152
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27897
28153
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27898
28154
|
const response = await apiInstance.getAllSubmodelElementsAasRepositoryRaw({
|
|
@@ -27911,14 +28167,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27911
28167
|
pagedResult: result.paging_metadata,
|
|
27912
28168
|
result: submodelElements
|
|
27913
28169
|
},
|
|
27914
|
-
statusCode: response.raw.status
|
|
28170
|
+
statusCode: response.raw.status,
|
|
28171
|
+
etag: getEtag(response.raw)
|
|
27915
28172
|
};
|
|
27916
28173
|
} catch (err) {
|
|
28174
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28175
|
+
if (notModified) return notModified;
|
|
27917
28176
|
const customError = await handleApiError(err);
|
|
27918
28177
|
return {
|
|
27919
28178
|
success: false,
|
|
27920
28179
|
error: customError,
|
|
27921
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28180
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28181
|
+
...getConditionalErrorFields(err)
|
|
27922
28182
|
};
|
|
27923
28183
|
}
|
|
27924
28184
|
}
|
|
@@ -27930,13 +28190,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27930
28190
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
27931
28191
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27932
28192
|
* - submodelElement: The Submodel Element object
|
|
28193
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
27933
28194
|
*
|
|
27934
28195
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27935
28196
|
*/
|
|
27936
28197
|
async postSubmodelElementAasRepository(options) {
|
|
27937
|
-
const { configuration, aasIdentifier, submodelIdentifier, submodelElement } = options;
|
|
28198
|
+
const { configuration, aasIdentifier, submodelIdentifier, submodelElement, ifMatch } = options;
|
|
27938
28199
|
try {
|
|
27939
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28200
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
27940
28201
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27941
28202
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27942
28203
|
const response = await apiInstance.postSubmodelElementAasRepositoryRaw({
|
|
@@ -27947,14 +28208,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27947
28208
|
return {
|
|
27948
28209
|
success: true,
|
|
27949
28210
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
27950
|
-
statusCode: response.raw.status
|
|
28211
|
+
statusCode: response.raw.status,
|
|
28212
|
+
etag: getEtag(response.raw)
|
|
27951
28213
|
};
|
|
27952
28214
|
} catch (err) {
|
|
27953
28215
|
const customError = await handleApiError(err);
|
|
27954
28216
|
return {
|
|
27955
28217
|
success: false,
|
|
27956
28218
|
error: customError,
|
|
27957
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28219
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28220
|
+
...getConditionalErrorFields(err)
|
|
27958
28221
|
};
|
|
27959
28222
|
}
|
|
27960
28223
|
}
|
|
@@ -27967,13 +28230,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27967
28230
|
* - submodelIdentifier: The Submodel’s unique id
|
|
27968
28231
|
* - limit?: The maximum number of elements in the response array
|
|
27969
28232
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28233
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
27970
28234
|
*
|
|
27971
28235
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27972
28236
|
*/
|
|
27973
28237
|
async getAllSubmodelElementsMetadataAasRepository(options) {
|
|
27974
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor } = options;
|
|
28238
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
27975
28239
|
try {
|
|
27976
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28240
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
27977
28241
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
27978
28242
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
27979
28243
|
const response = await apiInstance.getAllSubmodelElementsMetadataAasRepositoryRaw({
|
|
@@ -27990,14 +28254,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
27990
28254
|
pagedResult: result.paging_metadata,
|
|
27991
28255
|
result: submodelElementsMetadata
|
|
27992
28256
|
},
|
|
27993
|
-
statusCode: response.raw.status
|
|
28257
|
+
statusCode: response.raw.status,
|
|
28258
|
+
etag: getEtag(response.raw)
|
|
27994
28259
|
};
|
|
27995
28260
|
} catch (err) {
|
|
28261
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28262
|
+
if (notModified) return notModified;
|
|
27996
28263
|
const customError = await handleApiError(err);
|
|
27997
28264
|
return {
|
|
27998
28265
|
success: false,
|
|
27999
28266
|
error: customError,
|
|
28000
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28267
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28268
|
+
...getConditionalErrorFields(err)
|
|
28001
28269
|
};
|
|
28002
28270
|
}
|
|
28003
28271
|
}
|
|
@@ -28011,13 +28279,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28011
28279
|
* - limit?: The maximum number of elements in the response array
|
|
28012
28280
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28013
28281
|
* - level?: Determines the structural depth of the respective resource content
|
|
28282
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28014
28283
|
*
|
|
28015
28284
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28016
28285
|
*/
|
|
28017
28286
|
async getAllSubmodelElementsValueOnlyAasRepository(options) {
|
|
28018
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
28287
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
28019
28288
|
try {
|
|
28020
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28289
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28021
28290
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28022
28291
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28023
28292
|
const response = await apiInstance.getAllSubmodelElementsValueOnlyAasRepositoryRaw({
|
|
@@ -28035,14 +28304,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28035
28304
|
pagedResult: result.paging_metadata,
|
|
28036
28305
|
result: submodelElementValues
|
|
28037
28306
|
},
|
|
28038
|
-
statusCode: response.raw.status
|
|
28307
|
+
statusCode: response.raw.status,
|
|
28308
|
+
etag: getEtag(response.raw)
|
|
28039
28309
|
};
|
|
28040
28310
|
} catch (err) {
|
|
28311
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28312
|
+
if (notModified) return notModified;
|
|
28041
28313
|
const customError = await handleApiError(err);
|
|
28042
28314
|
return {
|
|
28043
28315
|
success: false,
|
|
28044
28316
|
error: customError,
|
|
28045
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28317
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28318
|
+
...getConditionalErrorFields(err)
|
|
28046
28319
|
};
|
|
28047
28320
|
}
|
|
28048
28321
|
}
|
|
@@ -28056,13 +28329,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28056
28329
|
* - limit?: The maximum number of elements in the response array
|
|
28057
28330
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28058
28331
|
* - level?: Determines the structural depth of the respective resource content
|
|
28332
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28059
28333
|
*
|
|
28060
28334
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28061
28335
|
*/
|
|
28062
28336
|
async getAllSubmodelElementsReferenceAasRepository(options) {
|
|
28063
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level } = options;
|
|
28337
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
28064
28338
|
try {
|
|
28065
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28339
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28066
28340
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28067
28341
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28068
28342
|
const response = await apiInstance.getAllSubmodelElementsReferenceAasRepositoryRaw({
|
|
@@ -28080,14 +28354,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28080
28354
|
pagedResult: result.paging_metadata,
|
|
28081
28355
|
result: submodelElementReferences
|
|
28082
28356
|
},
|
|
28083
|
-
statusCode: response.raw.status
|
|
28357
|
+
statusCode: response.raw.status,
|
|
28358
|
+
etag: getEtag(response.raw)
|
|
28084
28359
|
};
|
|
28085
28360
|
} catch (err) {
|
|
28361
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28362
|
+
if (notModified) return notModified;
|
|
28086
28363
|
const customError = await handleApiError(err);
|
|
28087
28364
|
return {
|
|
28088
28365
|
success: false,
|
|
28089
28366
|
error: customError,
|
|
28090
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28367
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28368
|
+
...getConditionalErrorFields(err)
|
|
28091
28369
|
};
|
|
28092
28370
|
}
|
|
28093
28371
|
}
|
|
@@ -28102,13 +28380,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28102
28380
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
28103
28381
|
* - level?: Determines the structural depth of the respective resource content
|
|
28104
28382
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28383
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28105
28384
|
*
|
|
28106
28385
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28107
28386
|
*/
|
|
28108
28387
|
async getAllSubmodelElementsPathAasRepository(options) {
|
|
28109
|
-
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
28388
|
+
const { configuration, aasIdentifier, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
28110
28389
|
try {
|
|
28111
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28390
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28112
28391
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28113
28392
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28114
28393
|
const response = await apiInstance.getAllSubmodelElementsPathAasRepositoryRaw({
|
|
@@ -28127,14 +28406,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28127
28406
|
pagedResult: result.paging_metadata,
|
|
28128
28407
|
result: submodelElements
|
|
28129
28408
|
},
|
|
28130
|
-
statusCode: response.raw.status
|
|
28409
|
+
statusCode: response.raw.status,
|
|
28410
|
+
etag: getEtag(response.raw)
|
|
28131
28411
|
};
|
|
28132
28412
|
} catch (err) {
|
|
28413
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28414
|
+
if (notModified) return notModified;
|
|
28133
28415
|
const customError = await handleApiError(err);
|
|
28134
28416
|
return {
|
|
28135
28417
|
success: false,
|
|
28136
28418
|
error: customError,
|
|
28137
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28419
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28420
|
+
...getConditionalErrorFields(err)
|
|
28138
28421
|
};
|
|
28139
28422
|
}
|
|
28140
28423
|
}
|
|
@@ -28148,13 +28431,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28148
28431
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28149
28432
|
* - level?: Determines the structural depth of the respective resource content
|
|
28150
28433
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28434
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28151
28435
|
*
|
|
28152
28436
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28153
28437
|
*/
|
|
28154
28438
|
async getSubmodelElementByPathAasRepository(options) {
|
|
28155
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
28439
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
28156
28440
|
try {
|
|
28157
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28441
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28158
28442
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28159
28443
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28160
28444
|
const response = await apiInstance.getSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28167,14 +28451,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28167
28451
|
return {
|
|
28168
28452
|
success: true,
|
|
28169
28453
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
28170
|
-
statusCode: response.raw.status
|
|
28454
|
+
statusCode: response.raw.status,
|
|
28455
|
+
etag: getEtag(response.raw)
|
|
28171
28456
|
};
|
|
28172
28457
|
} catch (err) {
|
|
28458
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28459
|
+
if (notModified) return notModified;
|
|
28173
28460
|
const customError = await handleApiError(err);
|
|
28174
28461
|
return {
|
|
28175
28462
|
success: false,
|
|
28176
28463
|
error: customError,
|
|
28177
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28464
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28465
|
+
...getConditionalErrorFields(err)
|
|
28178
28466
|
};
|
|
28179
28467
|
}
|
|
28180
28468
|
}
|
|
@@ -28187,13 +28475,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28187
28475
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28188
28476
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28189
28477
|
* - submodelElement: SubmodelElement object
|
|
28478
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28190
28479
|
*
|
|
28191
28480
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28192
28481
|
*/
|
|
28193
28482
|
async postSubmodelElementByPathAasRepository(options) {
|
|
28194
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
28483
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, ifMatch } = options;
|
|
28195
28484
|
try {
|
|
28196
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28485
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28197
28486
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28198
28487
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28199
28488
|
const response = await apiInstance.postSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28205,14 +28494,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28205
28494
|
return {
|
|
28206
28495
|
success: true,
|
|
28207
28496
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
28208
|
-
statusCode: response.raw.status
|
|
28497
|
+
statusCode: response.raw.status,
|
|
28498
|
+
etag: getEtag(response.raw)
|
|
28209
28499
|
};
|
|
28210
28500
|
} catch (err) {
|
|
28211
28501
|
const customError = await handleApiError(err);
|
|
28212
28502
|
return {
|
|
28213
28503
|
success: false,
|
|
28214
28504
|
error: customError,
|
|
28215
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28505
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28506
|
+
...getConditionalErrorFields(err)
|
|
28216
28507
|
};
|
|
28217
28508
|
}
|
|
28218
28509
|
}
|
|
@@ -28224,13 +28515,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28224
28515
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28225
28516
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28226
28517
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28518
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28227
28519
|
*
|
|
28228
28520
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28229
28521
|
*/
|
|
28230
28522
|
async deleteSubmodelElementByPathAasRepository(options) {
|
|
28231
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
28523
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
28232
28524
|
try {
|
|
28233
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28525
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28234
28526
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28235
28527
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28236
28528
|
const response = await apiInstance.deleteSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28241,14 +28533,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28241
28533
|
return {
|
|
28242
28534
|
success: true,
|
|
28243
28535
|
data: await response.value(),
|
|
28244
|
-
statusCode: response.raw.status
|
|
28536
|
+
statusCode: response.raw.status,
|
|
28537
|
+
etag: getEtag(response.raw)
|
|
28245
28538
|
};
|
|
28246
28539
|
} catch (err) {
|
|
28247
28540
|
const customError = await handleApiError(err);
|
|
28248
28541
|
return {
|
|
28249
28542
|
success: false,
|
|
28250
28543
|
error: customError,
|
|
28251
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28544
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28545
|
+
...getConditionalErrorFields(err)
|
|
28252
28546
|
};
|
|
28253
28547
|
}
|
|
28254
28548
|
}
|
|
@@ -28261,13 +28555,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28261
28555
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28262
28556
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28263
28557
|
* - submodelElement: SubmodelElement object
|
|
28558
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28559
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
28264
28560
|
*
|
|
28265
28561
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28266
28562
|
*/
|
|
28267
28563
|
async putSubmodelElementByPathAasRepository(options) {
|
|
28268
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
28564
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, ifMatch, ifNoneMatch } = options;
|
|
28269
28565
|
try {
|
|
28270
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
28566
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
28567
|
+
ifMatch,
|
|
28568
|
+
ifNoneMatch
|
|
28569
|
+
}));
|
|
28271
28570
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28272
28571
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28273
28572
|
const response = await apiInstance.putSubmodelElementByPathAasRepositoryRaw({
|
|
@@ -28279,34 +28578,39 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28279
28578
|
if (response.raw.status === 204) return {
|
|
28280
28579
|
success: true,
|
|
28281
28580
|
data: void 0,
|
|
28282
|
-
statusCode: response.raw.status
|
|
28581
|
+
statusCode: response.raw.status,
|
|
28582
|
+
etag: getEtag(response.raw)
|
|
28283
28583
|
};
|
|
28284
28584
|
if (response.raw.status === 201) try {
|
|
28285
28585
|
const createdSubmodelElement = await response.value();
|
|
28286
28586
|
return {
|
|
28287
28587
|
success: true,
|
|
28288
28588
|
data: createdSubmodelElement ? convertApiSubmodelElementToCoreSubmodelElement(createdSubmodelElement) : void 0,
|
|
28289
|
-
statusCode: response.raw.status
|
|
28589
|
+
statusCode: response.raw.status,
|
|
28590
|
+
etag: getEtag(response.raw)
|
|
28290
28591
|
};
|
|
28291
28592
|
} catch {
|
|
28292
28593
|
return {
|
|
28293
28594
|
success: true,
|
|
28294
28595
|
data: void 0,
|
|
28295
|
-
statusCode: response.raw.status
|
|
28596
|
+
statusCode: response.raw.status,
|
|
28597
|
+
etag: getEtag(response.raw)
|
|
28296
28598
|
};
|
|
28297
28599
|
}
|
|
28298
28600
|
const result = await response.value();
|
|
28299
28601
|
return {
|
|
28300
28602
|
success: true,
|
|
28301
28603
|
data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : void 0,
|
|
28302
|
-
statusCode: response.raw.status
|
|
28604
|
+
statusCode: response.raw.status,
|
|
28605
|
+
etag: getEtag(response.raw)
|
|
28303
28606
|
};
|
|
28304
28607
|
} catch (err) {
|
|
28305
28608
|
const customError = await handleApiError(err);
|
|
28306
28609
|
return {
|
|
28307
28610
|
success: false,
|
|
28308
28611
|
error: customError,
|
|
28309
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28612
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28613
|
+
...getConditionalErrorFields(err)
|
|
28310
28614
|
};
|
|
28311
28615
|
}
|
|
28312
28616
|
}
|
|
@@ -28320,13 +28624,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28320
28624
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28321
28625
|
* - submodelElement: SubmodelElement object
|
|
28322
28626
|
* - level?: Determines the structural depth of the respective resource content
|
|
28627
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28323
28628
|
*
|
|
28324
28629
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28325
28630
|
*/
|
|
28326
28631
|
async patchSubmodelElementValueByPathAasRepository(options) {
|
|
28327
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
28632
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElement, level, ifMatch } = options;
|
|
28328
28633
|
try {
|
|
28329
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28634
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28330
28635
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28331
28636
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28332
28637
|
const response = await apiInstance.patchSubmodelElementValueByPathAasRepositoryRaw({
|
|
@@ -28339,14 +28644,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28339
28644
|
return {
|
|
28340
28645
|
success: true,
|
|
28341
28646
|
data: await response.value(),
|
|
28342
|
-
statusCode: response.raw.status
|
|
28647
|
+
statusCode: response.raw.status,
|
|
28648
|
+
etag: getEtag(response.raw)
|
|
28343
28649
|
};
|
|
28344
28650
|
} catch (err) {
|
|
28345
28651
|
const customError = await handleApiError(err);
|
|
28346
28652
|
return {
|
|
28347
28653
|
success: false,
|
|
28348
28654
|
error: customError,
|
|
28349
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28655
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28656
|
+
...getConditionalErrorFields(err)
|
|
28350
28657
|
};
|
|
28351
28658
|
}
|
|
28352
28659
|
}
|
|
@@ -28358,13 +28665,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28358
28665
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28359
28666
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28360
28667
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28668
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28361
28669
|
*
|
|
28362
28670
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28363
28671
|
*/
|
|
28364
28672
|
async getSubmodelElementByPathMetadataAasRepository(options) {
|
|
28365
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
28673
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
28366
28674
|
try {
|
|
28367
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28675
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28368
28676
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28369
28677
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28370
28678
|
const response = await apiInstance.getSubmodelElementByPathMetadataAasRepositoryRaw({
|
|
@@ -28375,14 +28683,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28375
28683
|
return {
|
|
28376
28684
|
success: true,
|
|
28377
28685
|
data: await response.value(),
|
|
28378
|
-
statusCode: response.raw.status
|
|
28686
|
+
statusCode: response.raw.status,
|
|
28687
|
+
etag: getEtag(response.raw)
|
|
28379
28688
|
};
|
|
28380
28689
|
} catch (err) {
|
|
28690
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28691
|
+
if (notModified) return notModified;
|
|
28381
28692
|
const customError = await handleApiError(err);
|
|
28382
28693
|
return {
|
|
28383
28694
|
success: false,
|
|
28384
28695
|
error: customError,
|
|
28385
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28696
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28697
|
+
...getConditionalErrorFields(err)
|
|
28386
28698
|
};
|
|
28387
28699
|
}
|
|
28388
28700
|
}
|
|
@@ -28395,13 +28707,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28395
28707
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28396
28708
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28397
28709
|
* - submodelElementMetadata: The Submodel Element Metadata object
|
|
28710
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28398
28711
|
*
|
|
28399
28712
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28400
28713
|
*/
|
|
28401
28714
|
async patchSubmodelElementValueByPathMetadata(options) {
|
|
28402
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
28715
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementMetadata, ifMatch } = options;
|
|
28403
28716
|
try {
|
|
28404
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28717
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28405
28718
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28406
28719
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28407
28720
|
const response = await apiInstance.patchSubmodelElementValueByPathMetadataRaw({
|
|
@@ -28413,14 +28726,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28413
28726
|
return {
|
|
28414
28727
|
success: true,
|
|
28415
28728
|
data: await response.value(),
|
|
28416
|
-
statusCode: response.raw.status
|
|
28729
|
+
statusCode: response.raw.status,
|
|
28730
|
+
etag: getEtag(response.raw)
|
|
28417
28731
|
};
|
|
28418
28732
|
} catch (err) {
|
|
28419
28733
|
const customError = await handleApiError(err);
|
|
28420
28734
|
return {
|
|
28421
28735
|
success: false,
|
|
28422
28736
|
error: customError,
|
|
28423
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28737
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28738
|
+
...getConditionalErrorFields(err)
|
|
28424
28739
|
};
|
|
28425
28740
|
}
|
|
28426
28741
|
}
|
|
@@ -28434,13 +28749,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28434
28749
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28435
28750
|
* - level?: Determines the structural depth of the respective resource content
|
|
28436
28751
|
* - extent?: Determines to which extent the resource is being serialized
|
|
28752
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28437
28753
|
*
|
|
28438
28754
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28439
28755
|
*/
|
|
28440
28756
|
async getSubmodelElementByPathValueOnlyAasRepository(options) {
|
|
28441
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent } = options;
|
|
28757
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
28442
28758
|
try {
|
|
28443
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28759
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28444
28760
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28445
28761
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28446
28762
|
const response = await apiInstance.getSubmodelElementByPathValueOnlyAasRepositoryRaw({
|
|
@@ -28453,14 +28769,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28453
28769
|
return {
|
|
28454
28770
|
success: true,
|
|
28455
28771
|
data: await response.value(),
|
|
28456
|
-
statusCode: response.raw.status
|
|
28772
|
+
statusCode: response.raw.status,
|
|
28773
|
+
etag: getEtag(response.raw)
|
|
28457
28774
|
};
|
|
28458
28775
|
} catch (err) {
|
|
28776
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28777
|
+
if (notModified) return notModified;
|
|
28459
28778
|
const customError = await handleApiError(err);
|
|
28460
28779
|
return {
|
|
28461
28780
|
success: false,
|
|
28462
28781
|
error: customError,
|
|
28463
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28782
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28783
|
+
...getConditionalErrorFields(err)
|
|
28464
28784
|
};
|
|
28465
28785
|
}
|
|
28466
28786
|
}
|
|
@@ -28474,13 +28794,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28474
28794
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28475
28795
|
* - SubmodelElementValue: SubmodelElementValue object
|
|
28476
28796
|
* - level?: Determines the structural depth of the respective resource content
|
|
28797
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28477
28798
|
*
|
|
28478
28799
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28479
28800
|
*/
|
|
28480
28801
|
async patchSubmodelElementValueByPathValueOnly(options) {
|
|
28481
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
28802
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, submodelElementValue, level, ifMatch } = options;
|
|
28482
28803
|
try {
|
|
28483
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28804
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28484
28805
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28485
28806
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28486
28807
|
const response = await apiInstance.patchSubmodelElementValueByPathValueOnlyRaw({
|
|
@@ -28493,14 +28814,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28493
28814
|
return {
|
|
28494
28815
|
success: true,
|
|
28495
28816
|
data: await response.value(),
|
|
28496
|
-
statusCode: response.raw.status
|
|
28817
|
+
statusCode: response.raw.status,
|
|
28818
|
+
etag: getEtag(response.raw)
|
|
28497
28819
|
};
|
|
28498
28820
|
} catch (err) {
|
|
28499
28821
|
const customError = await handleApiError(err);
|
|
28500
28822
|
return {
|
|
28501
28823
|
success: false,
|
|
28502
28824
|
error: customError,
|
|
28503
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28825
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28826
|
+
...getConditionalErrorFields(err)
|
|
28504
28827
|
};
|
|
28505
28828
|
}
|
|
28506
28829
|
}
|
|
@@ -28513,13 +28836,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28513
28836
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28514
28837
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28515
28838
|
* - level?: Determines the structural depth of the respective resource content
|
|
28839
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28516
28840
|
*
|
|
28517
28841
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28518
28842
|
*/
|
|
28519
28843
|
async getSubmodelElementByPathReferenceAasRepository(options) {
|
|
28520
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
28844
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, ifNoneMatch } = options;
|
|
28521
28845
|
try {
|
|
28522
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28846
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28523
28847
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28524
28848
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28525
28849
|
const response = await apiInstance.getSubmodelElementByPathReferenceAasRepositoryRaw({
|
|
@@ -28531,14 +28855,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28531
28855
|
return {
|
|
28532
28856
|
success: true,
|
|
28533
28857
|
data: convertApiReferenceToCoreReference(await response.value()),
|
|
28534
|
-
statusCode: response.raw.status
|
|
28858
|
+
statusCode: response.raw.status,
|
|
28859
|
+
etag: getEtag(response.raw)
|
|
28535
28860
|
};
|
|
28536
28861
|
} catch (err) {
|
|
28862
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28863
|
+
if (notModified) return notModified;
|
|
28537
28864
|
const customError = await handleApiError(err);
|
|
28538
28865
|
return {
|
|
28539
28866
|
success: false,
|
|
28540
28867
|
error: customError,
|
|
28541
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28868
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28869
|
+
...getConditionalErrorFields(err)
|
|
28542
28870
|
};
|
|
28543
28871
|
}
|
|
28544
28872
|
}
|
|
@@ -28551,13 +28879,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28551
28879
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28552
28880
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28553
28881
|
* - level?: Determines the structural depth of the respective resource content
|
|
28882
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28554
28883
|
*
|
|
28555
28884
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28556
28885
|
*/
|
|
28557
28886
|
async getSubmodelElementByPathPathAasRepository(options) {
|
|
28558
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level } = options;
|
|
28887
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, level, ifNoneMatch } = options;
|
|
28559
28888
|
try {
|
|
28560
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28889
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28561
28890
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28562
28891
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28563
28892
|
const response = await apiInstance.getSubmodelElementByPathPathAasRepositoryRaw({
|
|
@@ -28569,14 +28898,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28569
28898
|
return {
|
|
28570
28899
|
success: true,
|
|
28571
28900
|
data: await response.value(),
|
|
28572
|
-
statusCode: response.raw.status
|
|
28901
|
+
statusCode: response.raw.status,
|
|
28902
|
+
etag: getEtag(response.raw)
|
|
28573
28903
|
};
|
|
28574
28904
|
} catch (err) {
|
|
28905
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28906
|
+
if (notModified) return notModified;
|
|
28575
28907
|
const customError = await handleApiError(err);
|
|
28576
28908
|
return {
|
|
28577
28909
|
success: false,
|
|
28578
28910
|
error: customError,
|
|
28579
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28911
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28912
|
+
...getConditionalErrorFields(err)
|
|
28580
28913
|
};
|
|
28581
28914
|
}
|
|
28582
28915
|
}
|
|
@@ -28588,13 +28921,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28588
28921
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28589
28922
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28590
28923
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28924
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
28591
28925
|
*
|
|
28592
28926
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28593
28927
|
*/
|
|
28594
28928
|
async getFileByPathAasRepository(options) {
|
|
28595
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
28929
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
28596
28930
|
try {
|
|
28597
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
28931
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
28598
28932
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28599
28933
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28600
28934
|
const response = await apiInstance.getFileByPathAasRepositoryRaw({
|
|
@@ -28605,14 +28939,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28605
28939
|
return {
|
|
28606
28940
|
success: true,
|
|
28607
28941
|
data: await response.value(),
|
|
28608
|
-
statusCode: response.raw.status
|
|
28942
|
+
statusCode: response.raw.status,
|
|
28943
|
+
etag: getEtag(response.raw)
|
|
28609
28944
|
};
|
|
28610
28945
|
} catch (err) {
|
|
28946
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
28947
|
+
if (notModified) return notModified;
|
|
28611
28948
|
const customError = await handleApiError(err);
|
|
28612
28949
|
return {
|
|
28613
28950
|
success: false,
|
|
28614
28951
|
error: customError,
|
|
28615
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28952
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
28953
|
+
...getConditionalErrorFields(err)
|
|
28616
28954
|
};
|
|
28617
28955
|
}
|
|
28618
28956
|
}
|
|
@@ -28626,13 +28964,18 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28626
28964
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28627
28965
|
* - fileName: The name of the file
|
|
28628
28966
|
* - file: The file to upload
|
|
28967
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28968
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
28629
28969
|
*
|
|
28630
28970
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28631
28971
|
*/
|
|
28632
28972
|
async putFileByPathAasRepository(options) {
|
|
28633
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
28973
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, fileName, file, ifMatch, ifNoneMatch } = options;
|
|
28634
28974
|
try {
|
|
28635
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration
|
|
28975
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, {
|
|
28976
|
+
ifMatch,
|
|
28977
|
+
ifNoneMatch
|
|
28978
|
+
}));
|
|
28636
28979
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28637
28980
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28638
28981
|
const response = await apiInstance.putFileByPathAasRepositoryRaw({
|
|
@@ -28645,14 +28988,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28645
28988
|
return {
|
|
28646
28989
|
success: true,
|
|
28647
28990
|
data: await response.value(),
|
|
28648
|
-
statusCode: response.raw.status
|
|
28991
|
+
statusCode: response.raw.status,
|
|
28992
|
+
etag: getEtag(response.raw)
|
|
28649
28993
|
};
|
|
28650
28994
|
} catch (err) {
|
|
28651
28995
|
const customError = await handleApiError(err);
|
|
28652
28996
|
return {
|
|
28653
28997
|
success: false,
|
|
28654
28998
|
error: customError,
|
|
28655
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
28999
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29000
|
+
...getConditionalErrorFields(err)
|
|
28656
29001
|
};
|
|
28657
29002
|
}
|
|
28658
29003
|
}
|
|
@@ -28664,13 +29009,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28664
29009
|
* - aasIdentifier: The Asset Administration Shell’s unique id
|
|
28665
29010
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28666
29011
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
29012
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28667
29013
|
*
|
|
28668
29014
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28669
29015
|
*/
|
|
28670
29016
|
async deleteFileByPathAasRepository(options) {
|
|
28671
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath } = options;
|
|
29017
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
28672
29018
|
try {
|
|
28673
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29019
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28674
29020
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28675
29021
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28676
29022
|
const response = await apiInstance.deleteFileByPathAasRepositoryRaw({
|
|
@@ -28681,14 +29027,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28681
29027
|
return {
|
|
28682
29028
|
success: true,
|
|
28683
29029
|
data: await response.value(),
|
|
28684
|
-
statusCode: response.raw.status
|
|
29030
|
+
statusCode: response.raw.status,
|
|
29031
|
+
etag: getEtag(response.raw)
|
|
28685
29032
|
};
|
|
28686
29033
|
} catch (err) {
|
|
28687
29034
|
const customError = await handleApiError(err);
|
|
28688
29035
|
return {
|
|
28689
29036
|
success: false,
|
|
28690
29037
|
error: customError,
|
|
28691
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29038
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29039
|
+
...getConditionalErrorFields(err)
|
|
28692
29040
|
};
|
|
28693
29041
|
}
|
|
28694
29042
|
}
|
|
@@ -28701,13 +29049,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28701
29049
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28702
29050
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28703
29051
|
* - operationRequest: Operation request object
|
|
29052
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28704
29053
|
*
|
|
28705
29054
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28706
29055
|
*/
|
|
28707
29056
|
async invokeOperationAasRepository(options) {
|
|
28708
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
29057
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
28709
29058
|
try {
|
|
28710
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29059
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28711
29060
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28712
29061
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28713
29062
|
const response = await apiInstance.invokeOperationAasRepositoryRaw({
|
|
@@ -28719,14 +29068,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28719
29068
|
return {
|
|
28720
29069
|
success: true,
|
|
28721
29070
|
data: await response.value(),
|
|
28722
|
-
statusCode: response.raw.status
|
|
29071
|
+
statusCode: response.raw.status,
|
|
29072
|
+
etag: getEtag(response.raw)
|
|
28723
29073
|
};
|
|
28724
29074
|
} catch (err) {
|
|
28725
29075
|
const customError = await handleApiError(err);
|
|
28726
29076
|
return {
|
|
28727
29077
|
success: false,
|
|
28728
29078
|
error: customError,
|
|
28729
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29079
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29080
|
+
...getConditionalErrorFields(err)
|
|
28730
29081
|
};
|
|
28731
29082
|
}
|
|
28732
29083
|
}
|
|
@@ -28739,13 +29090,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28739
29090
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28740
29091
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28741
29092
|
* - operationRequestValueOnly: OperationRequestValueOnly object
|
|
29093
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28742
29094
|
*
|
|
28743
29095
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28744
29096
|
*/
|
|
28745
29097
|
async invokeOperationValueOnlyAasRepository(options) {
|
|
28746
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
29098
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
28747
29099
|
try {
|
|
28748
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29100
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28749
29101
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28750
29102
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28751
29103
|
const response = await apiInstance.invokeOperationValueOnlyAasRepositoryRaw({
|
|
@@ -28757,14 +29109,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28757
29109
|
return {
|
|
28758
29110
|
success: true,
|
|
28759
29111
|
data: await response.value(),
|
|
28760
|
-
statusCode: response.raw.status
|
|
29112
|
+
statusCode: response.raw.status,
|
|
29113
|
+
etag: getEtag(response.raw)
|
|
28761
29114
|
};
|
|
28762
29115
|
} catch (err) {
|
|
28763
29116
|
const customError = await handleApiError(err);
|
|
28764
29117
|
return {
|
|
28765
29118
|
success: false,
|
|
28766
29119
|
error: customError,
|
|
28767
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29120
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29121
|
+
...getConditionalErrorFields(err)
|
|
28768
29122
|
};
|
|
28769
29123
|
}
|
|
28770
29124
|
}
|
|
@@ -28777,13 +29131,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28777
29131
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28778
29132
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28779
29133
|
* - operationRequest: OperationRequest object
|
|
29134
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28780
29135
|
*
|
|
28781
29136
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28782
29137
|
*/
|
|
28783
29138
|
async invokeOperationAsyncAasRepository(options) {
|
|
28784
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
29139
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
28785
29140
|
try {
|
|
28786
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29141
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28787
29142
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28788
29143
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28789
29144
|
const response = await apiInstance.invokeOperationAsyncAasRepositoryRaw({
|
|
@@ -28795,14 +29150,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28795
29150
|
return {
|
|
28796
29151
|
success: true,
|
|
28797
29152
|
data: await response.value(),
|
|
28798
|
-
statusCode: response.raw.status
|
|
29153
|
+
statusCode: response.raw.status,
|
|
29154
|
+
etag: getEtag(response.raw)
|
|
28799
29155
|
};
|
|
28800
29156
|
} catch (err) {
|
|
28801
29157
|
const customError = await handleApiError(err);
|
|
28802
29158
|
return {
|
|
28803
29159
|
success: false,
|
|
28804
29160
|
error: customError,
|
|
28805
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29161
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29162
|
+
...getConditionalErrorFields(err)
|
|
28806
29163
|
};
|
|
28807
29164
|
}
|
|
28808
29165
|
}
|
|
@@ -28815,13 +29172,14 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28815
29172
|
* - submodelIdentifier: The Submodel’s unique id
|
|
28816
29173
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
28817
29174
|
* - operationRequestValueOnly: Operation request object
|
|
29175
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
28818
29176
|
*
|
|
28819
29177
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
28820
29178
|
*/
|
|
28821
29179
|
async invokeOperationAsyncValueOnlyAasRepository(options) {
|
|
28822
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
29180
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
28823
29181
|
try {
|
|
28824
|
-
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration));
|
|
29182
|
+
const apiInstance = new AssetAdministrationShellRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
28825
29183
|
const encodedAasIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
28826
29184
|
const encodedSubmodelIdentifier = base64Encode(AasRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
28827
29185
|
const response = await apiInstance.invokeOperationAsyncValueOnlyAasRepositoryRaw({
|
|
@@ -28833,14 +29191,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28833
29191
|
return {
|
|
28834
29192
|
success: true,
|
|
28835
29193
|
data: await response.value(),
|
|
28836
|
-
statusCode: response.raw.status
|
|
29194
|
+
statusCode: response.raw.status,
|
|
29195
|
+
etag: getEtag(response.raw)
|
|
28837
29196
|
};
|
|
28838
29197
|
} catch (err) {
|
|
28839
29198
|
const customError = await handleApiError(err);
|
|
28840
29199
|
return {
|
|
28841
29200
|
success: false,
|
|
28842
29201
|
error: customError,
|
|
28843
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29202
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29203
|
+
...getConditionalErrorFields(err)
|
|
28844
29204
|
};
|
|
28845
29205
|
}
|
|
28846
29206
|
}
|
|
@@ -28872,14 +29232,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28872
29232
|
return {
|
|
28873
29233
|
success: true,
|
|
28874
29234
|
data: await response.value(),
|
|
28875
|
-
statusCode: response.raw.status
|
|
29235
|
+
statusCode: response.raw.status,
|
|
29236
|
+
etag: getEtag(response.raw)
|
|
28876
29237
|
};
|
|
28877
29238
|
} catch (err) {
|
|
28878
29239
|
const customError = await handleApiError(err);
|
|
28879
29240
|
return {
|
|
28880
29241
|
success: false,
|
|
28881
29242
|
error: customError,
|
|
28882
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29243
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29244
|
+
...getConditionalErrorFields(err)
|
|
28883
29245
|
};
|
|
28884
29246
|
}
|
|
28885
29247
|
}
|
|
@@ -28911,14 +29273,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28911
29273
|
return {
|
|
28912
29274
|
success: true,
|
|
28913
29275
|
data: await response.value(),
|
|
28914
|
-
statusCode: response.raw.status
|
|
29276
|
+
statusCode: response.raw.status,
|
|
29277
|
+
etag: getEtag(response.raw)
|
|
28915
29278
|
};
|
|
28916
29279
|
} catch (err) {
|
|
28917
29280
|
const customError = await handleApiError(err);
|
|
28918
29281
|
return {
|
|
28919
29282
|
success: false,
|
|
28920
29283
|
error: customError,
|
|
28921
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29284
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29285
|
+
...getConditionalErrorFields(err)
|
|
28922
29286
|
};
|
|
28923
29287
|
}
|
|
28924
29288
|
}
|
|
@@ -28950,14 +29314,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28950
29314
|
return {
|
|
28951
29315
|
success: true,
|
|
28952
29316
|
data: await response.value(),
|
|
28953
|
-
statusCode: response.raw.status
|
|
29317
|
+
statusCode: response.raw.status,
|
|
29318
|
+
etag: getEtag(response.raw)
|
|
28954
29319
|
};
|
|
28955
29320
|
} catch (err) {
|
|
28956
29321
|
const customError = await handleApiError(err);
|
|
28957
29322
|
return {
|
|
28958
29323
|
success: false,
|
|
28959
29324
|
error: customError,
|
|
28960
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29325
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29326
|
+
...getConditionalErrorFields(err)
|
|
28961
29327
|
};
|
|
28962
29328
|
}
|
|
28963
29329
|
}
|
|
@@ -28983,14 +29349,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
28983
29349
|
return {
|
|
28984
29350
|
success: true,
|
|
28985
29351
|
data: await response.value(),
|
|
28986
|
-
statusCode: response.raw.status
|
|
29352
|
+
statusCode: response.raw.status,
|
|
29353
|
+
etag: getEtag(response.raw)
|
|
28987
29354
|
};
|
|
28988
29355
|
} catch (err) {
|
|
28989
29356
|
const customError = await handleApiError(err);
|
|
28990
29357
|
return {
|
|
28991
29358
|
success: false,
|
|
28992
29359
|
error: customError,
|
|
28993
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29360
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29361
|
+
...getConditionalErrorFields(err)
|
|
28994
29362
|
};
|
|
28995
29363
|
}
|
|
28996
29364
|
}
|
|
@@ -29009,14 +29377,16 @@ var AasRepositoryClient = class AasRepositoryClient {
|
|
|
29009
29377
|
return {
|
|
29010
29378
|
success: true,
|
|
29011
29379
|
data: await response.value(),
|
|
29012
|
-
statusCode: response.raw.status
|
|
29380
|
+
statusCode: response.raw.status,
|
|
29381
|
+
etag: getEtag(response.raw)
|
|
29013
29382
|
};
|
|
29014
29383
|
} catch (err) {
|
|
29015
29384
|
const customError = await handleApiError(err);
|
|
29016
29385
|
return {
|
|
29017
29386
|
success: false,
|
|
29018
29387
|
error: customError,
|
|
29019
|
-
statusCode: AasRepositoryClient.extractStatusCode(err, customError)
|
|
29388
|
+
statusCode: AasRepositoryClient.extractStatusCode(err, customError),
|
|
29389
|
+
...getConditionalErrorFields(err)
|
|
29020
29390
|
};
|
|
29021
29391
|
}
|
|
29022
29392
|
}
|
|
@@ -29066,14 +29436,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29066
29436
|
pagedResult: payload.paging_metadata,
|
|
29067
29437
|
result
|
|
29068
29438
|
},
|
|
29069
|
-
statusCode: response.raw.status
|
|
29439
|
+
statusCode: response.raw.status,
|
|
29440
|
+
etag: getEtag(response.raw)
|
|
29070
29441
|
};
|
|
29071
29442
|
} catch (err) {
|
|
29072
29443
|
const customError = await handleApiError(err);
|
|
29073
29444
|
return {
|
|
29074
29445
|
success: false,
|
|
29075
29446
|
error: customError,
|
|
29076
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29447
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29448
|
+
...getConditionalErrorFields(err)
|
|
29077
29449
|
};
|
|
29078
29450
|
}
|
|
29079
29451
|
}
|
|
@@ -29099,14 +29471,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29099
29471
|
return {
|
|
29100
29472
|
success: true,
|
|
29101
29473
|
data: await response.value(),
|
|
29102
|
-
statusCode: response.raw.status
|
|
29474
|
+
statusCode: response.raw.status,
|
|
29475
|
+
etag: getEtag(response.raw)
|
|
29103
29476
|
};
|
|
29104
29477
|
} catch (err) {
|
|
29105
29478
|
const customError = await handleApiError(err);
|
|
29106
29479
|
return {
|
|
29107
29480
|
success: false,
|
|
29108
29481
|
error: customError,
|
|
29109
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29482
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29483
|
+
...getConditionalErrorFields(err)
|
|
29110
29484
|
};
|
|
29111
29485
|
}
|
|
29112
29486
|
}
|
|
@@ -29116,26 +29490,31 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29116
29490
|
* @param options Object containing:
|
|
29117
29491
|
* - configuration: The http request options
|
|
29118
29492
|
* - packageId: The package Id (UTF8-BASE64-URL-encoded)
|
|
29493
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29119
29494
|
*
|
|
29120
29495
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29121
29496
|
*/
|
|
29122
29497
|
async getAASXByPackageId(options) {
|
|
29123
|
-
const { configuration, packageId } = options;
|
|
29498
|
+
const { configuration, packageId, ifNoneMatch } = options;
|
|
29124
29499
|
try {
|
|
29125
|
-
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration));
|
|
29500
|
+
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
29126
29501
|
const encodedPackageId = base64Encode(AasxFileClient.requireIdentifier(packageId, "packageId"));
|
|
29127
29502
|
const response = await apiInstance.getAASXByPackageIdRaw({ packageId: encodedPackageId });
|
|
29128
29503
|
return {
|
|
29129
29504
|
success: true,
|
|
29130
29505
|
data: await response.value(),
|
|
29131
|
-
statusCode: response.raw.status
|
|
29506
|
+
statusCode: response.raw.status,
|
|
29507
|
+
etag: getEtag(response.raw)
|
|
29132
29508
|
};
|
|
29133
29509
|
} catch (err) {
|
|
29510
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
29511
|
+
if (notModified) return notModified;
|
|
29134
29512
|
const customError = await handleApiError(err);
|
|
29135
29513
|
return {
|
|
29136
29514
|
success: false,
|
|
29137
29515
|
error: customError,
|
|
29138
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29516
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29517
|
+
...getConditionalErrorFields(err)
|
|
29139
29518
|
};
|
|
29140
29519
|
}
|
|
29141
29520
|
}
|
|
@@ -29148,13 +29527,18 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29148
29527
|
* - aasIds?: A list of Asset Administration Shells' unique ids
|
|
29149
29528
|
* - file: The file to upload
|
|
29150
29529
|
* - fileName: The name of the file
|
|
29530
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29531
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
29151
29532
|
*
|
|
29152
29533
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29153
29534
|
*/
|
|
29154
29535
|
async putAASXByPackageId(options) {
|
|
29155
|
-
const { configuration, packageId, aasIds, file, fileName } = options;
|
|
29536
|
+
const { configuration, packageId, aasIds, file, fileName, ifMatch, ifNoneMatch } = options;
|
|
29156
29537
|
try {
|
|
29157
|
-
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration
|
|
29538
|
+
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration, {
|
|
29539
|
+
ifMatch,
|
|
29540
|
+
ifNoneMatch
|
|
29541
|
+
}));
|
|
29158
29542
|
const encodedPackageId = base64Encode(AasxFileClient.requireIdentifier(packageId, "packageId"));
|
|
29159
29543
|
const response = await apiInstance.putAASXByPackageIdRaw({
|
|
29160
29544
|
packageId: encodedPackageId,
|
|
@@ -29165,14 +29549,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29165
29549
|
return {
|
|
29166
29550
|
success: true,
|
|
29167
29551
|
data: await response.value(),
|
|
29168
|
-
statusCode: response.raw.status
|
|
29552
|
+
statusCode: response.raw.status,
|
|
29553
|
+
etag: getEtag(response.raw)
|
|
29169
29554
|
};
|
|
29170
29555
|
} catch (err) {
|
|
29171
29556
|
const customError = await handleApiError(err);
|
|
29172
29557
|
return {
|
|
29173
29558
|
success: false,
|
|
29174
29559
|
error: customError,
|
|
29175
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29560
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29561
|
+
...getConditionalErrorFields(err)
|
|
29176
29562
|
};
|
|
29177
29563
|
}
|
|
29178
29564
|
}
|
|
@@ -29182,26 +29568,29 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29182
29568
|
* @param options Object containing:
|
|
29183
29569
|
* - configuration: The http request options.
|
|
29184
29570
|
* - packageId: The package Id (UTF8-BASE64-URL-encoded)
|
|
29571
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29185
29572
|
*
|
|
29186
29573
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29187
29574
|
*/
|
|
29188
29575
|
async deleteAASXByPackageId(options) {
|
|
29189
|
-
const { configuration, packageId } = options;
|
|
29576
|
+
const { configuration, packageId, ifMatch } = options;
|
|
29190
29577
|
try {
|
|
29191
|
-
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration));
|
|
29578
|
+
const apiInstance = new AASXFileServerAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29192
29579
|
const encodedPackageId = base64Encode(AasxFileClient.requireIdentifier(packageId, "packageId"));
|
|
29193
29580
|
const response = await apiInstance.deleteAASXByPackageIdRaw({ packageId: encodedPackageId });
|
|
29194
29581
|
return {
|
|
29195
29582
|
success: true,
|
|
29196
29583
|
data: await response.value(),
|
|
29197
|
-
statusCode: response.raw.status
|
|
29584
|
+
statusCode: response.raw.status,
|
|
29585
|
+
etag: getEtag(response.raw)
|
|
29198
29586
|
};
|
|
29199
29587
|
} catch (err) {
|
|
29200
29588
|
const customError = await handleApiError(err);
|
|
29201
29589
|
return {
|
|
29202
29590
|
success: false,
|
|
29203
29591
|
error: customError,
|
|
29204
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29592
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29593
|
+
...getConditionalErrorFields(err)
|
|
29205
29594
|
};
|
|
29206
29595
|
}
|
|
29207
29596
|
}
|
|
@@ -29220,14 +29609,16 @@ var AasxFileClient = class AasxFileClient {
|
|
|
29220
29609
|
return {
|
|
29221
29610
|
success: true,
|
|
29222
29611
|
data: await response.value(),
|
|
29223
|
-
statusCode: response.raw.status
|
|
29612
|
+
statusCode: response.raw.status,
|
|
29613
|
+
etag: getEtag(response.raw)
|
|
29224
29614
|
};
|
|
29225
29615
|
} catch (err) {
|
|
29226
29616
|
const customError = await handleApiError(err);
|
|
29227
29617
|
return {
|
|
29228
29618
|
success: false,
|
|
29229
29619
|
error: customError,
|
|
29230
|
-
statusCode: AasxFileClient.extractStatusCode(err, customError)
|
|
29620
|
+
statusCode: AasxFileClient.extractStatusCode(err, customError),
|
|
29621
|
+
...getConditionalErrorFields(err)
|
|
29231
29622
|
};
|
|
29232
29623
|
}
|
|
29233
29624
|
}
|
|
@@ -29284,26 +29675,31 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29284
29675
|
* @param options Object containing:
|
|
29285
29676
|
* - configuration: The http request options
|
|
29286
29677
|
* - cdIdentifier: The Concept Description’s unique id
|
|
29678
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29287
29679
|
*
|
|
29288
29680
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29289
29681
|
*/
|
|
29290
29682
|
async getConceptDescriptionById(options) {
|
|
29291
|
-
const { configuration, cdIdentifier } = options;
|
|
29683
|
+
const { configuration, cdIdentifier, ifNoneMatch } = options;
|
|
29292
29684
|
try {
|
|
29293
|
-
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration));
|
|
29685
|
+
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
29294
29686
|
const encodedCdIdentifier = base64Encode(ConceptDescriptionRepositoryClient.requireIdentifier(cdIdentifier, "cdIdentifier"));
|
|
29295
29687
|
const response = await apiInstance.getConceptDescriptionByIdRaw({ cdIdentifier: encodedCdIdentifier });
|
|
29296
29688
|
return {
|
|
29297
29689
|
success: true,
|
|
29298
29690
|
data: convertApiCDToCoreCD(await response.value()),
|
|
29299
|
-
statusCode: response.raw.status
|
|
29691
|
+
statusCode: response.raw.status,
|
|
29692
|
+
etag: getEtag(response.raw)
|
|
29300
29693
|
};
|
|
29301
29694
|
} catch (err) {
|
|
29695
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
29696
|
+
if (notModified) return notModified;
|
|
29302
29697
|
const customError = await handleApiError(err);
|
|
29303
29698
|
return {
|
|
29304
29699
|
success: false,
|
|
29305
29700
|
error: customError,
|
|
29306
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29701
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29702
|
+
...getConditionalErrorFields(err)
|
|
29307
29703
|
};
|
|
29308
29704
|
}
|
|
29309
29705
|
}
|
|
@@ -29313,26 +29709,29 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29313
29709
|
* @param options Object containing:
|
|
29314
29710
|
* - configuration: The http request options
|
|
29315
29711
|
* - cdIdentifier: The Concept Description’s unique id
|
|
29712
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29316
29713
|
*
|
|
29317
29714
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29318
29715
|
*/
|
|
29319
29716
|
async deleteConceptDescriptionById(options) {
|
|
29320
|
-
const { configuration, cdIdentifier } = options;
|
|
29717
|
+
const { configuration, cdIdentifier, ifMatch } = options;
|
|
29321
29718
|
try {
|
|
29322
|
-
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration));
|
|
29719
|
+
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29323
29720
|
const encodedCdIdentifier = base64Encode(ConceptDescriptionRepositoryClient.requireIdentifier(cdIdentifier, "cdIdentifier"));
|
|
29324
29721
|
const response = await apiInstance.deleteConceptDescriptionByIdRaw({ cdIdentifier: encodedCdIdentifier });
|
|
29325
29722
|
return {
|
|
29326
29723
|
success: true,
|
|
29327
29724
|
data: await response.value(),
|
|
29328
|
-
statusCode: response.raw.status
|
|
29725
|
+
statusCode: response.raw.status,
|
|
29726
|
+
etag: getEtag(response.raw)
|
|
29329
29727
|
};
|
|
29330
29728
|
} catch (err) {
|
|
29331
29729
|
const customError = await handleApiError(err);
|
|
29332
29730
|
return {
|
|
29333
29731
|
success: false,
|
|
29334
29732
|
error: customError,
|
|
29335
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29733
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29734
|
+
...getConditionalErrorFields(err)
|
|
29336
29735
|
};
|
|
29337
29736
|
}
|
|
29338
29737
|
}
|
|
@@ -29343,13 +29742,18 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29343
29742
|
* - configuration: The http request options
|
|
29344
29743
|
* - cdIdentifier: The Concept Description’s unique id
|
|
29345
29744
|
* - conceptDescription: Concept Description object
|
|
29745
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29746
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
29346
29747
|
*
|
|
29347
29748
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29348
29749
|
*/
|
|
29349
29750
|
async putConceptDescriptionById(options) {
|
|
29350
|
-
const { configuration, cdIdentifier, conceptDescription } = options;
|
|
29751
|
+
const { configuration, cdIdentifier, conceptDescription, ifMatch, ifNoneMatch } = options;
|
|
29351
29752
|
try {
|
|
29352
|
-
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration
|
|
29753
|
+
const apiInstance = new ConceptDescriptionRepositoryAPIApi(applyDefaults(configuration, {
|
|
29754
|
+
ifMatch,
|
|
29755
|
+
ifNoneMatch
|
|
29756
|
+
}));
|
|
29353
29757
|
const encodedCdIdentifier = base64Encode(ConceptDescriptionRepositoryClient.requireIdentifier(cdIdentifier, "cdIdentifier"));
|
|
29354
29758
|
const response = await apiInstance.putConceptDescriptionByIdRaw({
|
|
29355
29759
|
cdIdentifier: encodedCdIdentifier,
|
|
@@ -29358,20 +29762,23 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29358
29762
|
if (response.raw.status === 204) return {
|
|
29359
29763
|
success: true,
|
|
29360
29764
|
data: void 0,
|
|
29361
|
-
statusCode: response.raw.status
|
|
29765
|
+
statusCode: response.raw.status,
|
|
29766
|
+
etag: getEtag(response.raw)
|
|
29362
29767
|
};
|
|
29363
29768
|
const result = await response.value();
|
|
29364
29769
|
return {
|
|
29365
29770
|
success: true,
|
|
29366
29771
|
data: result ? convertApiCDToCoreCD(result) : void 0,
|
|
29367
|
-
statusCode: response.raw.status
|
|
29772
|
+
statusCode: response.raw.status,
|
|
29773
|
+
etag: getEtag(response.raw)
|
|
29368
29774
|
};
|
|
29369
29775
|
} catch (err) {
|
|
29370
29776
|
const customError = await handleApiError(err);
|
|
29371
29777
|
return {
|
|
29372
29778
|
success: false,
|
|
29373
29779
|
error: customError,
|
|
29374
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29780
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29781
|
+
...getConditionalErrorFields(err)
|
|
29375
29782
|
};
|
|
29376
29783
|
}
|
|
29377
29784
|
}
|
|
@@ -29409,14 +29816,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29409
29816
|
pagedResult: result.paging_metadata,
|
|
29410
29817
|
result: conceptDescriptions
|
|
29411
29818
|
},
|
|
29412
|
-
statusCode: response.raw.status
|
|
29819
|
+
statusCode: response.raw.status,
|
|
29820
|
+
etag: getEtag(response.raw)
|
|
29413
29821
|
};
|
|
29414
29822
|
} catch (err) {
|
|
29415
29823
|
const customError = await handleApiError(err);
|
|
29416
29824
|
return {
|
|
29417
29825
|
success: false,
|
|
29418
29826
|
error: customError,
|
|
29419
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29827
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29828
|
+
...getConditionalErrorFields(err)
|
|
29420
29829
|
};
|
|
29421
29830
|
}
|
|
29422
29831
|
}
|
|
@@ -29436,14 +29845,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29436
29845
|
return {
|
|
29437
29846
|
success: true,
|
|
29438
29847
|
data: convertApiCDToCoreCD(await response.value()),
|
|
29439
|
-
statusCode: response.raw.status
|
|
29848
|
+
statusCode: response.raw.status,
|
|
29849
|
+
etag: getEtag(response.raw)
|
|
29440
29850
|
};
|
|
29441
29851
|
} catch (err) {
|
|
29442
29852
|
const customError = await handleApiError(err);
|
|
29443
29853
|
return {
|
|
29444
29854
|
success: false,
|
|
29445
29855
|
error: customError,
|
|
29446
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29856
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29857
|
+
...getConditionalErrorFields(err)
|
|
29447
29858
|
};
|
|
29448
29859
|
}
|
|
29449
29860
|
}
|
|
@@ -29469,14 +29880,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29469
29880
|
return {
|
|
29470
29881
|
success: true,
|
|
29471
29882
|
data: await response.value(),
|
|
29472
|
-
statusCode: response.raw.status
|
|
29883
|
+
statusCode: response.raw.status,
|
|
29884
|
+
etag: getEtag(response.raw)
|
|
29473
29885
|
};
|
|
29474
29886
|
} catch (err) {
|
|
29475
29887
|
const customError = await handleApiError(err);
|
|
29476
29888
|
return {
|
|
29477
29889
|
success: false,
|
|
29478
29890
|
error: customError,
|
|
29479
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29891
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29892
|
+
...getConditionalErrorFields(err)
|
|
29480
29893
|
};
|
|
29481
29894
|
}
|
|
29482
29895
|
}
|
|
@@ -29495,14 +29908,16 @@ var ConceptDescriptionRepositoryClient = class ConceptDescriptionRepositoryClien
|
|
|
29495
29908
|
return {
|
|
29496
29909
|
success: true,
|
|
29497
29910
|
data: await response.value(),
|
|
29498
|
-
statusCode: response.raw.status
|
|
29911
|
+
statusCode: response.raw.status,
|
|
29912
|
+
etag: getEtag(response.raw)
|
|
29499
29913
|
};
|
|
29500
29914
|
} catch (err) {
|
|
29501
29915
|
const customError = await handleApiError(err);
|
|
29502
29916
|
return {
|
|
29503
29917
|
success: false,
|
|
29504
29918
|
error: customError,
|
|
29505
|
-
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError)
|
|
29919
|
+
statusCode: ConceptDescriptionRepositoryClient.extractStatusCode(err, customError),
|
|
29920
|
+
...getConditionalErrorFields(err)
|
|
29506
29921
|
};
|
|
29507
29922
|
}
|
|
29508
29923
|
}
|
|
@@ -29548,14 +29963,16 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29548
29963
|
pagedResult: result.paging_metadata,
|
|
29549
29964
|
result: submodelDescriptors
|
|
29550
29965
|
},
|
|
29551
|
-
statusCode: response.raw.status
|
|
29966
|
+
statusCode: response.raw.status,
|
|
29967
|
+
etag: getEtag(response.raw)
|
|
29552
29968
|
};
|
|
29553
29969
|
} catch (err) {
|
|
29554
29970
|
const customError = await handleApiError(err);
|
|
29555
29971
|
return {
|
|
29556
29972
|
success: false,
|
|
29557
29973
|
error: customError,
|
|
29558
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
29974
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
29975
|
+
...getConditionalErrorFields(err)
|
|
29559
29976
|
};
|
|
29560
29977
|
}
|
|
29561
29978
|
}
|
|
@@ -29575,14 +29992,16 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29575
29992
|
return {
|
|
29576
29993
|
success: true,
|
|
29577
29994
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
29578
|
-
statusCode: response.raw.status
|
|
29995
|
+
statusCode: response.raw.status,
|
|
29996
|
+
etag: getEtag(response.raw)
|
|
29579
29997
|
};
|
|
29580
29998
|
} catch (err) {
|
|
29581
29999
|
const customError = await handleApiError(err);
|
|
29582
30000
|
return {
|
|
29583
30001
|
success: false,
|
|
29584
30002
|
error: customError,
|
|
29585
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30003
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30004
|
+
...getConditionalErrorFields(err)
|
|
29586
30005
|
};
|
|
29587
30006
|
}
|
|
29588
30007
|
}
|
|
@@ -29592,26 +30011,29 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29592
30011
|
* @param options Object containing:
|
|
29593
30012
|
* - configuration: The http request options
|
|
29594
30013
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
30014
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29595
30015
|
*
|
|
29596
30016
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29597
30017
|
*/
|
|
29598
30018
|
async deleteSubmodelDescriptorById(options) {
|
|
29599
|
-
const { configuration, submodelIdentifier } = options;
|
|
30019
|
+
const { configuration, submodelIdentifier, ifMatch } = options;
|
|
29600
30020
|
try {
|
|
29601
|
-
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration));
|
|
30021
|
+
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29602
30022
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29603
30023
|
const response = await apiInstance.deleteSubmodelDescriptorByIdRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
29604
30024
|
return {
|
|
29605
30025
|
success: true,
|
|
29606
30026
|
data: await response.value(),
|
|
29607
|
-
statusCode: response.raw.status
|
|
30027
|
+
statusCode: response.raw.status,
|
|
30028
|
+
etag: getEtag(response.raw)
|
|
29608
30029
|
};
|
|
29609
30030
|
} catch (err) {
|
|
29610
30031
|
const customError = await handleApiError(err);
|
|
29611
30032
|
return {
|
|
29612
30033
|
success: false,
|
|
29613
30034
|
error: customError,
|
|
29614
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30035
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30036
|
+
...getConditionalErrorFields(err)
|
|
29615
30037
|
};
|
|
29616
30038
|
}
|
|
29617
30039
|
}
|
|
@@ -29621,26 +30043,31 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29621
30043
|
* @param options Object containing:
|
|
29622
30044
|
* - configuration: The http request options
|
|
29623
30045
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
30046
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29624
30047
|
*
|
|
29625
30048
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29626
30049
|
*/
|
|
29627
30050
|
async getSubmodelDescriptorById(options) {
|
|
29628
|
-
const { configuration, submodelIdentifier } = options;
|
|
30051
|
+
const { configuration, submodelIdentifier, ifNoneMatch } = options;
|
|
29629
30052
|
try {
|
|
29630
|
-
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration));
|
|
30053
|
+
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
29631
30054
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29632
30055
|
const response = await apiInstance.getSubmodelDescriptorByIdRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
29633
30056
|
return {
|
|
29634
30057
|
success: true,
|
|
29635
30058
|
data: convertApiSubmodelDescriptorToCoreSubmodelDescriptor(await response.value()),
|
|
29636
|
-
statusCode: response.raw.status
|
|
30059
|
+
statusCode: response.raw.status,
|
|
30060
|
+
etag: getEtag(response.raw)
|
|
29637
30061
|
};
|
|
29638
30062
|
} catch (err) {
|
|
30063
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30064
|
+
if (notModified) return notModified;
|
|
29639
30065
|
const customError = await handleApiError(err);
|
|
29640
30066
|
return {
|
|
29641
30067
|
success: false,
|
|
29642
30068
|
error: customError,
|
|
29643
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30069
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30070
|
+
...getConditionalErrorFields(err)
|
|
29644
30071
|
};
|
|
29645
30072
|
}
|
|
29646
30073
|
}
|
|
@@ -29651,13 +30078,18 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29651
30078
|
* - configuration: The http request options
|
|
29652
30079
|
* - submodelIdentifier: The Submodel’s unique id (UTF8-BASE64-URL-encoded)
|
|
29653
30080
|
* - submodelDescriptor: Submodel Descriptor object
|
|
30081
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30082
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
29654
30083
|
*
|
|
29655
30084
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29656
30085
|
*/
|
|
29657
30086
|
async putSubmodelDescriptorById(options) {
|
|
29658
|
-
const { configuration, submodelIdentifier, submodelDescriptor } = options;
|
|
30087
|
+
const { configuration, submodelIdentifier, submodelDescriptor, ifMatch, ifNoneMatch } = options;
|
|
29659
30088
|
try {
|
|
29660
|
-
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration
|
|
30089
|
+
const apiInstance = new SubmodelRegistryAPIApi(applyDefaults(configuration, {
|
|
30090
|
+
ifMatch,
|
|
30091
|
+
ifNoneMatch
|
|
30092
|
+
}));
|
|
29661
30093
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRegistryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29662
30094
|
const response = await apiInstance.putSubmodelDescriptorByIdRaw({
|
|
29663
30095
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -29666,20 +30098,23 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29666
30098
|
if (response.raw.status === 204) return {
|
|
29667
30099
|
success: true,
|
|
29668
30100
|
data: void 0,
|
|
29669
|
-
statusCode: response.raw.status
|
|
30101
|
+
statusCode: response.raw.status,
|
|
30102
|
+
etag: getEtag(response.raw)
|
|
29670
30103
|
};
|
|
29671
30104
|
const result = await response.value();
|
|
29672
30105
|
return {
|
|
29673
30106
|
success: true,
|
|
29674
30107
|
data: result ? convertApiSubmodelDescriptorToCoreSubmodelDescriptor(result) : void 0,
|
|
29675
|
-
statusCode: response.raw.status
|
|
30108
|
+
statusCode: response.raw.status,
|
|
30109
|
+
etag: getEtag(response.raw)
|
|
29676
30110
|
};
|
|
29677
30111
|
} catch (err) {
|
|
29678
30112
|
const customError = await handleApiError(err);
|
|
29679
30113
|
return {
|
|
29680
30114
|
success: false,
|
|
29681
30115
|
error: customError,
|
|
29682
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30116
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30117
|
+
...getConditionalErrorFields(err)
|
|
29683
30118
|
};
|
|
29684
30119
|
}
|
|
29685
30120
|
}
|
|
@@ -29698,14 +30133,16 @@ var SubmodelRegistryClient = class SubmodelRegistryClient {
|
|
|
29698
30133
|
return {
|
|
29699
30134
|
success: true,
|
|
29700
30135
|
data: await response.value(),
|
|
29701
|
-
statusCode: response.raw.status
|
|
30136
|
+
statusCode: response.raw.status,
|
|
30137
|
+
etag: getEtag(response.raw)
|
|
29702
30138
|
};
|
|
29703
30139
|
} catch (err) {
|
|
29704
30140
|
const customError = await handleApiError(err);
|
|
29705
30141
|
return {
|
|
29706
30142
|
success: false,
|
|
29707
30143
|
error: customError,
|
|
29708
|
-
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError)
|
|
30144
|
+
statusCode: SubmodelRegistryClient.extractStatusCode(err, customError),
|
|
30145
|
+
...getConditionalErrorFields(err)
|
|
29709
30146
|
};
|
|
29710
30147
|
}
|
|
29711
30148
|
}
|
|
@@ -29761,14 +30198,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29761
30198
|
pagedResult: result.paging_metadata,
|
|
29762
30199
|
result: submodels
|
|
29763
30200
|
},
|
|
29764
|
-
statusCode: response.raw.status
|
|
30201
|
+
statusCode: response.raw.status,
|
|
30202
|
+
etag: getEtag(response.raw)
|
|
29765
30203
|
};
|
|
29766
30204
|
} catch (err) {
|
|
29767
30205
|
const customError = await handleApiError(err);
|
|
29768
30206
|
return {
|
|
29769
30207
|
success: false,
|
|
29770
30208
|
error: customError,
|
|
29771
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30209
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30210
|
+
...getConditionalErrorFields(err)
|
|
29772
30211
|
};
|
|
29773
30212
|
}
|
|
29774
30213
|
}
|
|
@@ -29798,14 +30237,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29798
30237
|
return {
|
|
29799
30238
|
success: true,
|
|
29800
30239
|
data: await response.value(),
|
|
29801
|
-
statusCode: response.raw.status
|
|
30240
|
+
statusCode: response.raw.status,
|
|
30241
|
+
etag: getEtag(response.raw)
|
|
29802
30242
|
};
|
|
29803
30243
|
} catch (err) {
|
|
29804
30244
|
const customError = await handleApiError(err);
|
|
29805
30245
|
return {
|
|
29806
30246
|
success: false,
|
|
29807
30247
|
error: customError,
|
|
29808
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30248
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30249
|
+
...getConditionalErrorFields(err)
|
|
29809
30250
|
};
|
|
29810
30251
|
}
|
|
29811
30252
|
}
|
|
@@ -29839,14 +30280,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29839
30280
|
return {
|
|
29840
30281
|
success: true,
|
|
29841
30282
|
data: await response.value(),
|
|
29842
|
-
statusCode: response.raw.status
|
|
30283
|
+
statusCode: response.raw.status,
|
|
30284
|
+
etag: getEtag(response.raw)
|
|
29843
30285
|
};
|
|
29844
30286
|
} catch (err) {
|
|
29845
30287
|
const customError = await handleApiError(err);
|
|
29846
30288
|
return {
|
|
29847
30289
|
success: false,
|
|
29848
30290
|
error: customError,
|
|
29849
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30291
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30292
|
+
...getConditionalErrorFields(err)
|
|
29850
30293
|
};
|
|
29851
30294
|
}
|
|
29852
30295
|
}
|
|
@@ -29878,14 +30321,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29878
30321
|
return {
|
|
29879
30322
|
success: true,
|
|
29880
30323
|
data: await response.value(),
|
|
29881
|
-
statusCode: response.raw.status
|
|
30324
|
+
statusCode: response.raw.status,
|
|
30325
|
+
etag: getEtag(response.raw)
|
|
29882
30326
|
};
|
|
29883
30327
|
} catch (err) {
|
|
29884
30328
|
const customError = await handleApiError(err);
|
|
29885
30329
|
return {
|
|
29886
30330
|
success: false,
|
|
29887
30331
|
error: customError,
|
|
29888
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30332
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30333
|
+
...getConditionalErrorFields(err)
|
|
29889
30334
|
};
|
|
29890
30335
|
}
|
|
29891
30336
|
}
|
|
@@ -29917,14 +30362,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29917
30362
|
return {
|
|
29918
30363
|
success: true,
|
|
29919
30364
|
data: await response.value(),
|
|
29920
|
-
statusCode: response.raw.status
|
|
30365
|
+
statusCode: response.raw.status,
|
|
30366
|
+
etag: getEtag(response.raw)
|
|
29921
30367
|
};
|
|
29922
30368
|
} catch (err) {
|
|
29923
30369
|
const customError = await handleApiError(err);
|
|
29924
30370
|
return {
|
|
29925
30371
|
success: false,
|
|
29926
30372
|
error: customError,
|
|
29927
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30373
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30374
|
+
...getConditionalErrorFields(err)
|
|
29928
30375
|
};
|
|
29929
30376
|
}
|
|
29930
30377
|
}
|
|
@@ -29944,14 +30391,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29944
30391
|
return {
|
|
29945
30392
|
success: true,
|
|
29946
30393
|
data: convertApiSubmodelToCoreSubmodel(await response.value()),
|
|
29947
|
-
statusCode: response.raw.status
|
|
30394
|
+
statusCode: response.raw.status,
|
|
30395
|
+
etag: getEtag(response.raw)
|
|
29948
30396
|
};
|
|
29949
30397
|
} catch (err) {
|
|
29950
30398
|
const customError = await handleApiError(err);
|
|
29951
30399
|
return {
|
|
29952
30400
|
success: false,
|
|
29953
30401
|
error: customError,
|
|
29954
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30402
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30403
|
+
...getConditionalErrorFields(err)
|
|
29955
30404
|
};
|
|
29956
30405
|
}
|
|
29957
30406
|
}
|
|
@@ -29961,26 +30410,29 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29961
30410
|
* @param options Object containing:
|
|
29962
30411
|
* - configuration: The http request options
|
|
29963
30412
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30413
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
29964
30414
|
*
|
|
29965
30415
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29966
30416
|
*/
|
|
29967
30417
|
async deleteSubmodelById(options) {
|
|
29968
|
-
const { configuration, submodelIdentifier } = options;
|
|
30418
|
+
const { configuration, submodelIdentifier, ifMatch } = options;
|
|
29969
30419
|
try {
|
|
29970
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30420
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
29971
30421
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
29972
30422
|
const response = await apiInstance.deleteSubmodelByIdRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
29973
30423
|
return {
|
|
29974
30424
|
success: true,
|
|
29975
30425
|
data: await response.value(),
|
|
29976
|
-
statusCode: response.raw.status
|
|
30426
|
+
statusCode: response.raw.status,
|
|
30427
|
+
etag: getEtag(response.raw)
|
|
29977
30428
|
};
|
|
29978
30429
|
} catch (err) {
|
|
29979
30430
|
const customError = await handleApiError(err);
|
|
29980
30431
|
return {
|
|
29981
30432
|
success: false,
|
|
29982
30433
|
error: customError,
|
|
29983
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30434
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30435
|
+
...getConditionalErrorFields(err)
|
|
29984
30436
|
};
|
|
29985
30437
|
}
|
|
29986
30438
|
}
|
|
@@ -29992,13 +30444,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
29992
30444
|
* - submodelIdentifier: The Submodel’s unique id
|
|
29993
30445
|
* - level?: Determines the structural depth of the respective resource content
|
|
29994
30446
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30447
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
29995
30448
|
*
|
|
29996
30449
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
29997
30450
|
*/
|
|
29998
30451
|
async getSubmodelById(options) {
|
|
29999
|
-
const { configuration, submodelIdentifier, level, extent } = options;
|
|
30452
|
+
const { configuration, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
30000
30453
|
try {
|
|
30001
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30454
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30002
30455
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30003
30456
|
const response = await apiInstance.getSubmodelByIdRaw({
|
|
30004
30457
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30008,14 +30461,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30008
30461
|
return {
|
|
30009
30462
|
success: true,
|
|
30010
30463
|
data: convertApiSubmodelToCoreSubmodel(await response.value()),
|
|
30011
|
-
statusCode: response.raw.status
|
|
30464
|
+
statusCode: response.raw.status,
|
|
30465
|
+
etag: getEtag(response.raw)
|
|
30012
30466
|
};
|
|
30013
30467
|
} catch (err) {
|
|
30468
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30469
|
+
if (notModified) return notModified;
|
|
30014
30470
|
const customError = await handleApiError(err);
|
|
30015
30471
|
return {
|
|
30016
30472
|
success: false,
|
|
30017
30473
|
error: customError,
|
|
30018
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30474
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30475
|
+
...getConditionalErrorFields(err)
|
|
30019
30476
|
};
|
|
30020
30477
|
}
|
|
30021
30478
|
}
|
|
@@ -30025,26 +30482,31 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30025
30482
|
* @param options Object containing:
|
|
30026
30483
|
* - configuration: The http request options
|
|
30027
30484
|
* - submodelIdentifier: The Submodel's unique id
|
|
30485
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30028
30486
|
*
|
|
30029
30487
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30030
30488
|
*/
|
|
30031
30489
|
async getSubmodelByIdReference(options) {
|
|
30032
|
-
const { configuration, submodelIdentifier } = options;
|
|
30490
|
+
const { configuration, submodelIdentifier, ifNoneMatch } = options;
|
|
30033
30491
|
try {
|
|
30034
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30492
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30035
30493
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30036
30494
|
const response = await apiInstance.getSubmodelByIdReferenceRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
30037
30495
|
return {
|
|
30038
30496
|
success: true,
|
|
30039
30497
|
data: await response.value(),
|
|
30040
|
-
statusCode: response.raw.status
|
|
30498
|
+
statusCode: response.raw.status,
|
|
30499
|
+
etag: getEtag(response.raw)
|
|
30041
30500
|
};
|
|
30042
30501
|
} catch (err) {
|
|
30502
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30503
|
+
if (notModified) return notModified;
|
|
30043
30504
|
const customError = await handleApiError(err);
|
|
30044
30505
|
return {
|
|
30045
30506
|
success: false,
|
|
30046
30507
|
error: customError,
|
|
30047
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30508
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30509
|
+
...getConditionalErrorFields(err)
|
|
30048
30510
|
};
|
|
30049
30511
|
}
|
|
30050
30512
|
}
|
|
@@ -30055,13 +30517,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30055
30517
|
* - configuration: The http request options
|
|
30056
30518
|
* - submodelIdentifier: The Submodel's unique id
|
|
30057
30519
|
* - level?: Determines the structural depth of the respective resource content
|
|
30520
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30058
30521
|
*
|
|
30059
30522
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30060
30523
|
*/
|
|
30061
30524
|
async getSubmodelByIdPath(options) {
|
|
30062
|
-
const { configuration, submodelIdentifier, level } = options;
|
|
30525
|
+
const { configuration, submodelIdentifier, level, ifNoneMatch } = options;
|
|
30063
30526
|
try {
|
|
30064
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30527
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30065
30528
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30066
30529
|
const response = await apiInstance.getSubmodelByIdPathRaw({
|
|
30067
30530
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30070,14 +30533,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30070
30533
|
return {
|
|
30071
30534
|
success: true,
|
|
30072
30535
|
data: await response.value(),
|
|
30073
|
-
statusCode: response.raw.status
|
|
30536
|
+
statusCode: response.raw.status,
|
|
30537
|
+
etag: getEtag(response.raw)
|
|
30074
30538
|
};
|
|
30075
30539
|
} catch (err) {
|
|
30540
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30541
|
+
if (notModified) return notModified;
|
|
30076
30542
|
const customError = await handleApiError(err);
|
|
30077
30543
|
return {
|
|
30078
30544
|
success: false,
|
|
30079
30545
|
error: customError,
|
|
30080
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30546
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30547
|
+
...getConditionalErrorFields(err)
|
|
30081
30548
|
};
|
|
30082
30549
|
}
|
|
30083
30550
|
}
|
|
@@ -30088,13 +30555,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30088
30555
|
* - configuration: The http request options
|
|
30089
30556
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30090
30557
|
* - submodel: Submodel object
|
|
30558
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30559
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
30091
30560
|
*
|
|
30092
30561
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30093
30562
|
*/
|
|
30094
30563
|
async putSubmodelById(options) {
|
|
30095
|
-
const { configuration, submodelIdentifier, submodel } = options;
|
|
30564
|
+
const { configuration, submodelIdentifier, submodel, ifMatch, ifNoneMatch } = options;
|
|
30096
30565
|
try {
|
|
30097
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration
|
|
30566
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, {
|
|
30567
|
+
ifMatch,
|
|
30568
|
+
ifNoneMatch
|
|
30569
|
+
}));
|
|
30098
30570
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30099
30571
|
const response = await apiInstance.putSubmodelByIdRaw({
|
|
30100
30572
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30103,20 +30575,23 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30103
30575
|
if (response.raw.status === 204) return {
|
|
30104
30576
|
success: true,
|
|
30105
30577
|
data: void 0,
|
|
30106
|
-
statusCode: response.raw.status
|
|
30578
|
+
statusCode: response.raw.status,
|
|
30579
|
+
etag: getEtag(response.raw)
|
|
30107
30580
|
};
|
|
30108
30581
|
const result = await response.value();
|
|
30109
30582
|
return {
|
|
30110
30583
|
success: true,
|
|
30111
30584
|
data: result ? convertApiSubmodelToCoreSubmodel(result) : void 0,
|
|
30112
|
-
statusCode: response.raw.status
|
|
30585
|
+
statusCode: response.raw.status,
|
|
30586
|
+
etag: getEtag(response.raw)
|
|
30113
30587
|
};
|
|
30114
30588
|
} catch (err) {
|
|
30115
30589
|
const customError = await handleApiError(err);
|
|
30116
30590
|
return {
|
|
30117
30591
|
success: false,
|
|
30118
30592
|
error: customError,
|
|
30119
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30593
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30594
|
+
...getConditionalErrorFields(err)
|
|
30120
30595
|
};
|
|
30121
30596
|
}
|
|
30122
30597
|
}
|
|
@@ -30128,13 +30603,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30128
30603
|
* - submodelIdentifier: The Submodel's unique id
|
|
30129
30604
|
* - submodel: Submodel object
|
|
30130
30605
|
* - level?: Determines the structural depth of the respective resource content
|
|
30606
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30131
30607
|
*
|
|
30132
30608
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30133
30609
|
*/
|
|
30134
30610
|
async patchSubmodelById(options) {
|
|
30135
|
-
const { configuration, submodelIdentifier, submodel, level } = options;
|
|
30611
|
+
const { configuration, submodelIdentifier, submodel, level, ifMatch } = options;
|
|
30136
30612
|
try {
|
|
30137
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30613
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30138
30614
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30139
30615
|
const response = await apiInstance.patchSubmodelByIdRaw({
|
|
30140
30616
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30144,14 +30620,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30144
30620
|
return {
|
|
30145
30621
|
success: true,
|
|
30146
30622
|
data: await response.value(),
|
|
30147
|
-
statusCode: response.raw.status
|
|
30623
|
+
statusCode: response.raw.status,
|
|
30624
|
+
etag: getEtag(response.raw)
|
|
30148
30625
|
};
|
|
30149
30626
|
} catch (err) {
|
|
30150
30627
|
const customError = await handleApiError(err);
|
|
30151
30628
|
return {
|
|
30152
30629
|
success: false,
|
|
30153
30630
|
error: customError,
|
|
30154
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30631
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30632
|
+
...getConditionalErrorFields(err)
|
|
30155
30633
|
};
|
|
30156
30634
|
}
|
|
30157
30635
|
}
|
|
@@ -30165,13 +30643,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30165
30643
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30166
30644
|
* - level?: Determines the structural depth of the respective resource content
|
|
30167
30645
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30646
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30168
30647
|
*
|
|
30169
30648
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30170
30649
|
*/
|
|
30171
30650
|
async getAllSubmodelElements(options) {
|
|
30172
|
-
const { configuration, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
30651
|
+
const { configuration, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
30173
30652
|
try {
|
|
30174
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30653
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30175
30654
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30176
30655
|
const response = await apiInstance.getAllSubmodelElementsRaw({
|
|
30177
30656
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30188,14 +30667,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30188
30667
|
pagedResult: result.paging_metadata,
|
|
30189
30668
|
result: submodelElements
|
|
30190
30669
|
},
|
|
30191
|
-
statusCode: response.raw.status
|
|
30670
|
+
statusCode: response.raw.status,
|
|
30671
|
+
etag: getEtag(response.raw)
|
|
30192
30672
|
};
|
|
30193
30673
|
} catch (err) {
|
|
30674
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30675
|
+
if (notModified) return notModified;
|
|
30194
30676
|
const customError = await handleApiError(err);
|
|
30195
30677
|
return {
|
|
30196
30678
|
success: false,
|
|
30197
30679
|
error: customError,
|
|
30198
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30680
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30681
|
+
...getConditionalErrorFields(err)
|
|
30199
30682
|
};
|
|
30200
30683
|
}
|
|
30201
30684
|
}
|
|
@@ -30207,13 +30690,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30207
30690
|
* - submodelIdentifier: The Submodel's unique id
|
|
30208
30691
|
* - limit?: The maximum number of elements in the response array
|
|
30209
30692
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30693
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30210
30694
|
*
|
|
30211
30695
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30212
30696
|
*/
|
|
30213
30697
|
async getAllSubmodelElementsMetadata(options) {
|
|
30214
|
-
const { configuration, submodelIdentifier, limit, cursor } = options;
|
|
30698
|
+
const { configuration, submodelIdentifier, limit, cursor, ifNoneMatch } = options;
|
|
30215
30699
|
try {
|
|
30216
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30700
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30217
30701
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30218
30702
|
const response = await apiInstance.getAllSubmodelElementsMetadataSubmodelRepoRaw({
|
|
30219
30703
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30223,14 +30707,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30223
30707
|
return {
|
|
30224
30708
|
success: true,
|
|
30225
30709
|
data: await response.value(),
|
|
30226
|
-
statusCode: response.raw.status
|
|
30710
|
+
statusCode: response.raw.status,
|
|
30711
|
+
etag: getEtag(response.raw)
|
|
30227
30712
|
};
|
|
30228
30713
|
} catch (err) {
|
|
30714
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30715
|
+
if (notModified) return notModified;
|
|
30229
30716
|
const customError = await handleApiError(err);
|
|
30230
30717
|
return {
|
|
30231
30718
|
success: false,
|
|
30232
30719
|
error: customError,
|
|
30233
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30720
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30721
|
+
...getConditionalErrorFields(err)
|
|
30234
30722
|
};
|
|
30235
30723
|
}
|
|
30236
30724
|
}
|
|
@@ -30244,13 +30732,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30244
30732
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30245
30733
|
* - level?: Determines the structural depth of the respective resource content
|
|
30246
30734
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30735
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30247
30736
|
*
|
|
30248
30737
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30249
30738
|
*/
|
|
30250
30739
|
async getAllSubmodelElementsValueOnly(options) {
|
|
30251
|
-
const { configuration, submodelIdentifier, limit, cursor, level, extent } = options;
|
|
30740
|
+
const { configuration, submodelIdentifier, limit, cursor, level, extent, ifNoneMatch } = options;
|
|
30252
30741
|
try {
|
|
30253
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30742
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30254
30743
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30255
30744
|
const response = await apiInstance.getAllSubmodelElementsValueOnlySubmodelRepoRaw({
|
|
30256
30745
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30262,14 +30751,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30262
30751
|
return {
|
|
30263
30752
|
success: true,
|
|
30264
30753
|
data: await response.value(),
|
|
30265
|
-
statusCode: response.raw.status
|
|
30754
|
+
statusCode: response.raw.status,
|
|
30755
|
+
etag: getEtag(response.raw)
|
|
30266
30756
|
};
|
|
30267
30757
|
} catch (err) {
|
|
30758
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30759
|
+
if (notModified) return notModified;
|
|
30268
30760
|
const customError = await handleApiError(err);
|
|
30269
30761
|
return {
|
|
30270
30762
|
success: false,
|
|
30271
30763
|
error: customError,
|
|
30272
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30764
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30765
|
+
...getConditionalErrorFields(err)
|
|
30273
30766
|
};
|
|
30274
30767
|
}
|
|
30275
30768
|
}
|
|
@@ -30282,13 +30775,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30282
30775
|
* - limit?: The maximum number of elements in the response array
|
|
30283
30776
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30284
30777
|
* - level?: Determines the structural depth of the respective resource content
|
|
30778
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30285
30779
|
*
|
|
30286
30780
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30287
30781
|
*/
|
|
30288
30782
|
async getAllSubmodelElementsReference(options) {
|
|
30289
|
-
const { configuration, submodelIdentifier, limit, cursor, level } = options;
|
|
30783
|
+
const { configuration, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
30290
30784
|
try {
|
|
30291
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30785
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30292
30786
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30293
30787
|
const response = await apiInstance.getAllSubmodelElementsReferenceSubmodelRepoRaw({
|
|
30294
30788
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30299,14 +30793,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30299
30793
|
return {
|
|
30300
30794
|
success: true,
|
|
30301
30795
|
data: await response.value(),
|
|
30302
|
-
statusCode: response.raw.status
|
|
30796
|
+
statusCode: response.raw.status,
|
|
30797
|
+
etag: getEtag(response.raw)
|
|
30303
30798
|
};
|
|
30304
30799
|
} catch (err) {
|
|
30800
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30801
|
+
if (notModified) return notModified;
|
|
30305
30802
|
const customError = await handleApiError(err);
|
|
30306
30803
|
return {
|
|
30307
30804
|
success: false,
|
|
30308
30805
|
error: customError,
|
|
30309
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30806
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30807
|
+
...getConditionalErrorFields(err)
|
|
30310
30808
|
};
|
|
30311
30809
|
}
|
|
30312
30810
|
}
|
|
@@ -30319,13 +30817,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30319
30817
|
* - limit?: The maximum number of elements in the response array
|
|
30320
30818
|
* - cursor?: A server-generated identifier retrieved from paging_metadata that specifies from which position the result listing should continue
|
|
30321
30819
|
* - level?: Determines the structural depth of the respective resource content
|
|
30820
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30322
30821
|
*
|
|
30323
30822
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30324
30823
|
*/
|
|
30325
30824
|
async getAllSubmodelElementsPath(options) {
|
|
30326
|
-
const { configuration, submodelIdentifier, limit, cursor, level } = options;
|
|
30825
|
+
const { configuration, submodelIdentifier, limit, cursor, level, ifNoneMatch } = options;
|
|
30327
30826
|
try {
|
|
30328
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30827
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30329
30828
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30330
30829
|
const response = await apiInstance.getAllSubmodelElementsPathSubmodelRepoRaw({
|
|
30331
30830
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30336,14 +30835,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30336
30835
|
return {
|
|
30337
30836
|
success: true,
|
|
30338
30837
|
data: await response.value(),
|
|
30339
|
-
statusCode: response.raw.status
|
|
30838
|
+
statusCode: response.raw.status,
|
|
30839
|
+
etag: getEtag(response.raw)
|
|
30340
30840
|
};
|
|
30341
30841
|
} catch (err) {
|
|
30842
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30843
|
+
if (notModified) return notModified;
|
|
30342
30844
|
const customError = await handleApiError(err);
|
|
30343
30845
|
return {
|
|
30344
30846
|
success: false,
|
|
30345
30847
|
error: customError,
|
|
30346
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30848
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30849
|
+
...getConditionalErrorFields(err)
|
|
30347
30850
|
};
|
|
30348
30851
|
}
|
|
30349
30852
|
}
|
|
@@ -30353,13 +30856,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30353
30856
|
* @param options Object containing:
|
|
30354
30857
|
* - configuration: The http request options
|
|
30355
30858
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30859
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30356
30860
|
*
|
|
30357
30861
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30358
30862
|
*/
|
|
30359
30863
|
async postSubmodelElement(options) {
|
|
30360
|
-
const { configuration, submodelIdentifier, submodelElement } = options;
|
|
30864
|
+
const { configuration, submodelIdentifier, submodelElement, ifMatch } = options;
|
|
30361
30865
|
try {
|
|
30362
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30866
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30363
30867
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30364
30868
|
const response = await apiInstance.postSubmodelElementSubmodelRepoRaw({
|
|
30365
30869
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30368,14 +30872,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30368
30872
|
return {
|
|
30369
30873
|
success: true,
|
|
30370
30874
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
30371
|
-
statusCode: response.raw.status
|
|
30875
|
+
statusCode: response.raw.status,
|
|
30876
|
+
etag: getEtag(response.raw)
|
|
30372
30877
|
};
|
|
30373
30878
|
} catch (err) {
|
|
30374
30879
|
const customError = await handleApiError(err);
|
|
30375
30880
|
return {
|
|
30376
30881
|
success: false,
|
|
30377
30882
|
error: customError,
|
|
30378
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30883
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30884
|
+
...getConditionalErrorFields(err)
|
|
30379
30885
|
};
|
|
30380
30886
|
}
|
|
30381
30887
|
}
|
|
@@ -30388,13 +30894,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30388
30894
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30389
30895
|
* - level?: Determines the structural depth of the respective resource content
|
|
30390
30896
|
* - extent?: Determines to which extent the resource is being serialized
|
|
30897
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30391
30898
|
*
|
|
30392
30899
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30393
30900
|
*/
|
|
30394
30901
|
async getSubmodelElementByPath(options) {
|
|
30395
|
-
const { configuration, submodelIdentifier, idShortPath, level, extent } = options;
|
|
30902
|
+
const { configuration, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
30396
30903
|
try {
|
|
30397
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30904
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30398
30905
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30399
30906
|
const response = await apiInstance.getSubmodelElementByPathSubmodelRepoRaw({
|
|
30400
30907
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30405,14 +30912,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30405
30912
|
return {
|
|
30406
30913
|
success: true,
|
|
30407
30914
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
30408
|
-
statusCode: response.raw.status
|
|
30915
|
+
statusCode: response.raw.status,
|
|
30916
|
+
etag: getEtag(response.raw)
|
|
30409
30917
|
};
|
|
30410
30918
|
} catch (err) {
|
|
30919
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30920
|
+
if (notModified) return notModified;
|
|
30411
30921
|
const customError = await handleApiError(err);
|
|
30412
30922
|
return {
|
|
30413
30923
|
success: false,
|
|
30414
30924
|
error: customError,
|
|
30415
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30925
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30926
|
+
...getConditionalErrorFields(err)
|
|
30416
30927
|
};
|
|
30417
30928
|
}
|
|
30418
30929
|
}
|
|
@@ -30423,13 +30934,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30423
30934
|
* - configuration: The http request options
|
|
30424
30935
|
* - submodelIdentifier: The Submodel's unique id
|
|
30425
30936
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30937
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30426
30938
|
*
|
|
30427
30939
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30428
30940
|
*/
|
|
30429
30941
|
async getSubmodelElementByPathMetadata(options) {
|
|
30430
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
30942
|
+
const { configuration, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
30431
30943
|
try {
|
|
30432
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30944
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30433
30945
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30434
30946
|
const response = await apiInstance.getSubmodelElementByPathMetadataSubmodelRepoRaw({
|
|
30435
30947
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30438,14 +30950,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30438
30950
|
return {
|
|
30439
30951
|
success: true,
|
|
30440
30952
|
data: await response.value(),
|
|
30441
|
-
statusCode: response.raw.status
|
|
30953
|
+
statusCode: response.raw.status,
|
|
30954
|
+
etag: getEtag(response.raw)
|
|
30442
30955
|
};
|
|
30443
30956
|
} catch (err) {
|
|
30957
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30958
|
+
if (notModified) return notModified;
|
|
30444
30959
|
const customError = await handleApiError(err);
|
|
30445
30960
|
return {
|
|
30446
30961
|
success: false,
|
|
30447
30962
|
error: customError,
|
|
30448
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
30963
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
30964
|
+
...getConditionalErrorFields(err)
|
|
30449
30965
|
};
|
|
30450
30966
|
}
|
|
30451
30967
|
}
|
|
@@ -30456,13 +30972,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30456
30972
|
* - configuration: The http request options
|
|
30457
30973
|
* - submodelIdentifier: The Submodel's unique id
|
|
30458
30974
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30975
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30459
30976
|
*
|
|
30460
30977
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30461
30978
|
*/
|
|
30462
30979
|
async getSubmodelElementByPathReference(options) {
|
|
30463
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
30980
|
+
const { configuration, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
30464
30981
|
try {
|
|
30465
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
30982
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30466
30983
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30467
30984
|
const response = await apiInstance.getSubmodelElementByPathReferenceSubmodelRepoRaw({
|
|
30468
30985
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30471,14 +30988,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30471
30988
|
return {
|
|
30472
30989
|
success: true,
|
|
30473
30990
|
data: await response.value(),
|
|
30474
|
-
statusCode: response.raw.status
|
|
30991
|
+
statusCode: response.raw.status,
|
|
30992
|
+
etag: getEtag(response.raw)
|
|
30475
30993
|
};
|
|
30476
30994
|
} catch (err) {
|
|
30995
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
30996
|
+
if (notModified) return notModified;
|
|
30477
30997
|
const customError = await handleApiError(err);
|
|
30478
30998
|
return {
|
|
30479
30999
|
success: false,
|
|
30480
31000
|
error: customError,
|
|
30481
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31001
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31002
|
+
...getConditionalErrorFields(err)
|
|
30482
31003
|
};
|
|
30483
31004
|
}
|
|
30484
31005
|
}
|
|
@@ -30490,13 +31011,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30490
31011
|
* - submodelIdentifier: The Submodel's unique id
|
|
30491
31012
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30492
31013
|
* - level?: Determines the structural depth of the respective resource content
|
|
31014
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30493
31015
|
*
|
|
30494
31016
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30495
31017
|
*/
|
|
30496
31018
|
async getSubmodelElementByPathPath(options) {
|
|
30497
|
-
const { configuration, submodelIdentifier, idShortPath, level } = options;
|
|
31019
|
+
const { configuration, submodelIdentifier, idShortPath, level, ifNoneMatch } = options;
|
|
30498
31020
|
try {
|
|
30499
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31021
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30500
31022
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30501
31023
|
const response = await apiInstance.getSubmodelElementByPathPathSubmodelRepoRaw({
|
|
30502
31024
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30506,14 +31028,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30506
31028
|
return {
|
|
30507
31029
|
success: true,
|
|
30508
31030
|
data: await response.value(),
|
|
30509
|
-
statusCode: response.raw.status
|
|
31031
|
+
statusCode: response.raw.status,
|
|
31032
|
+
etag: getEtag(response.raw)
|
|
30510
31033
|
};
|
|
30511
31034
|
} catch (err) {
|
|
31035
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31036
|
+
if (notModified) return notModified;
|
|
30512
31037
|
const customError = await handleApiError(err);
|
|
30513
31038
|
return {
|
|
30514
31039
|
success: false,
|
|
30515
31040
|
error: customError,
|
|
30516
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31041
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31042
|
+
...getConditionalErrorFields(err)
|
|
30517
31043
|
};
|
|
30518
31044
|
}
|
|
30519
31045
|
}
|
|
@@ -30525,13 +31051,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30525
31051
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30526
31052
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30527
31053
|
* - submodelElement: SubmodelElement object
|
|
31054
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30528
31055
|
*
|
|
30529
31056
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30530
31057
|
*/
|
|
30531
31058
|
async postSubmodelElementByPath(options) {
|
|
30532
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElement } = options;
|
|
31059
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElement, ifMatch } = options;
|
|
30533
31060
|
try {
|
|
30534
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31061
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30535
31062
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30536
31063
|
const response = await apiInstance.postSubmodelElementByPathSubmodelRepoRaw({
|
|
30537
31064
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30541,14 +31068,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30541
31068
|
return {
|
|
30542
31069
|
success: true,
|
|
30543
31070
|
data: convertApiSubmodelElementToCoreSubmodelElement(await response.value()),
|
|
30544
|
-
statusCode: response.raw.status
|
|
31071
|
+
statusCode: response.raw.status,
|
|
31072
|
+
etag: getEtag(response.raw)
|
|
30545
31073
|
};
|
|
30546
31074
|
} catch (err) {
|
|
30547
31075
|
const customError = await handleApiError(err);
|
|
30548
31076
|
return {
|
|
30549
31077
|
success: false,
|
|
30550
31078
|
error: customError,
|
|
30551
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31079
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31080
|
+
...getConditionalErrorFields(err)
|
|
30552
31081
|
};
|
|
30553
31082
|
}
|
|
30554
31083
|
}
|
|
@@ -30559,13 +31088,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30559
31088
|
* - configuration: The http request options.
|
|
30560
31089
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30561
31090
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31091
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30562
31092
|
*
|
|
30563
31093
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30564
31094
|
*/
|
|
30565
31095
|
async deleteSubmodelElementByPath(options) {
|
|
30566
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
31096
|
+
const { configuration, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
30567
31097
|
try {
|
|
30568
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31098
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30569
31099
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30570
31100
|
const response = await apiInstance.deleteSubmodelElementByPathSubmodelRepoRaw({
|
|
30571
31101
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30574,14 +31104,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30574
31104
|
return {
|
|
30575
31105
|
success: true,
|
|
30576
31106
|
data: await response.value(),
|
|
30577
|
-
statusCode: response.raw.status
|
|
31107
|
+
statusCode: response.raw.status,
|
|
31108
|
+
etag: getEtag(response.raw)
|
|
30578
31109
|
};
|
|
30579
31110
|
} catch (err) {
|
|
30580
31111
|
const customError = await handleApiError(err);
|
|
30581
31112
|
return {
|
|
30582
31113
|
success: false,
|
|
30583
31114
|
error: customError,
|
|
30584
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31115
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31116
|
+
...getConditionalErrorFields(err)
|
|
30585
31117
|
};
|
|
30586
31118
|
}
|
|
30587
31119
|
}
|
|
@@ -30594,13 +31126,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30594
31126
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30595
31127
|
* - submodelElement: SubmodelElement object
|
|
30596
31128
|
* - level?: Determines the structural depth of the respective resource content
|
|
31129
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31130
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
30597
31131
|
*
|
|
30598
31132
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30599
31133
|
*/
|
|
30600
31134
|
async putSubmodelElementByPath(options) {
|
|
30601
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
31135
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElement, level, ifMatch, ifNoneMatch } = options;
|
|
30602
31136
|
try {
|
|
30603
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration
|
|
31137
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, {
|
|
31138
|
+
ifMatch,
|
|
31139
|
+
ifNoneMatch
|
|
31140
|
+
}));
|
|
30604
31141
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30605
31142
|
const response = await apiInstance.putSubmodelElementByPathSubmodelRepoRaw({
|
|
30606
31143
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30611,20 +31148,23 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30611
31148
|
if (response.raw.status === 204) return {
|
|
30612
31149
|
success: true,
|
|
30613
31150
|
data: void 0,
|
|
30614
|
-
statusCode: response.raw.status
|
|
31151
|
+
statusCode: response.raw.status,
|
|
31152
|
+
etag: getEtag(response.raw)
|
|
30615
31153
|
};
|
|
30616
31154
|
const result = await response.value();
|
|
30617
31155
|
return {
|
|
30618
31156
|
success: true,
|
|
30619
31157
|
data: result ? convertApiSubmodelElementToCoreSubmodelElement(result) : void 0,
|
|
30620
|
-
statusCode: response.raw.status
|
|
31158
|
+
statusCode: response.raw.status,
|
|
31159
|
+
etag: getEtag(response.raw)
|
|
30621
31160
|
};
|
|
30622
31161
|
} catch (err) {
|
|
30623
31162
|
const customError = await handleApiError(err);
|
|
30624
31163
|
return {
|
|
30625
31164
|
success: false,
|
|
30626
31165
|
error: customError,
|
|
30627
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31166
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31167
|
+
...getConditionalErrorFields(err)
|
|
30628
31168
|
};
|
|
30629
31169
|
}
|
|
30630
31170
|
}
|
|
@@ -30637,13 +31177,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30637
31177
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30638
31178
|
* - submodelElement: SubmodelElement object
|
|
30639
31179
|
* - level?: Determines the structural depth of the respective resource content
|
|
31180
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30640
31181
|
*
|
|
30641
31182
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30642
31183
|
*/
|
|
30643
31184
|
async patchSubmodelElementByPath(options) {
|
|
30644
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElement, level } = options;
|
|
31185
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElement, level, ifMatch } = options;
|
|
30645
31186
|
try {
|
|
30646
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31187
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30647
31188
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30648
31189
|
const response = await apiInstance.patchSubmodelElementByPathSubmodelRepoRaw({
|
|
30649
31190
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30654,14 +31195,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30654
31195
|
return {
|
|
30655
31196
|
success: true,
|
|
30656
31197
|
data: await response.value(),
|
|
30657
|
-
statusCode: response.raw.status
|
|
31198
|
+
statusCode: response.raw.status,
|
|
31199
|
+
etag: getEtag(response.raw)
|
|
30658
31200
|
};
|
|
30659
31201
|
} catch (err) {
|
|
30660
31202
|
const customError = await handleApiError(err);
|
|
30661
31203
|
return {
|
|
30662
31204
|
success: false,
|
|
30663
31205
|
error: customError,
|
|
30664
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31206
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31207
|
+
...getConditionalErrorFields(err)
|
|
30665
31208
|
};
|
|
30666
31209
|
}
|
|
30667
31210
|
}
|
|
@@ -30671,26 +31214,31 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30671
31214
|
* @param options Object containing:
|
|
30672
31215
|
* - configuration: The http request options
|
|
30673
31216
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31217
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30674
31218
|
*
|
|
30675
31219
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30676
31220
|
*/
|
|
30677
31221
|
async getSubmodelByIdMetadata(options) {
|
|
30678
|
-
const { configuration, submodelIdentifier } = options;
|
|
31222
|
+
const { configuration, submodelIdentifier, ifNoneMatch } = options;
|
|
30679
31223
|
try {
|
|
30680
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31224
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30681
31225
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30682
31226
|
const response = await apiInstance.getSubmodelByIdMetadataRaw({ submodelIdentifier: encodedSubmodelIdentifier });
|
|
30683
31227
|
return {
|
|
30684
31228
|
success: true,
|
|
30685
31229
|
data: await response.value(),
|
|
30686
|
-
statusCode: response.raw.status
|
|
31230
|
+
statusCode: response.raw.status,
|
|
31231
|
+
etag: getEtag(response.raw)
|
|
30687
31232
|
};
|
|
30688
31233
|
} catch (err) {
|
|
31234
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31235
|
+
if (notModified) return notModified;
|
|
30689
31236
|
const customError = await handleApiError(err);
|
|
30690
31237
|
return {
|
|
30691
31238
|
success: false,
|
|
30692
31239
|
error: customError,
|
|
30693
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31240
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31241
|
+
...getConditionalErrorFields(err)
|
|
30694
31242
|
};
|
|
30695
31243
|
}
|
|
30696
31244
|
}
|
|
@@ -30702,13 +31250,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30702
31250
|
* - submodelIdentifier: The Submodel's unique id
|
|
30703
31251
|
* - submodelMetadata: SubmodelMetadata object
|
|
30704
31252
|
* - level?: Determines the structural depth of the respective resource content
|
|
31253
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30705
31254
|
*
|
|
30706
31255
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30707
31256
|
*/
|
|
30708
31257
|
async patchSubmodelByIdMetadata(options) {
|
|
30709
|
-
const { configuration, submodelIdentifier, submodelMetadata, level } = options;
|
|
31258
|
+
const { configuration, submodelIdentifier, submodelMetadata, level, ifMatch } = options;
|
|
30710
31259
|
try {
|
|
30711
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31260
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30712
31261
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30713
31262
|
const response = await apiInstance.patchSubmodelByIdMetadataRaw({
|
|
30714
31263
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30718,14 +31267,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30718
31267
|
return {
|
|
30719
31268
|
success: true,
|
|
30720
31269
|
data: await response.value(),
|
|
30721
|
-
statusCode: response.raw.status
|
|
31270
|
+
statusCode: response.raw.status,
|
|
31271
|
+
etag: getEtag(response.raw)
|
|
30722
31272
|
};
|
|
30723
31273
|
} catch (err) {
|
|
30724
31274
|
const customError = await handleApiError(err);
|
|
30725
31275
|
return {
|
|
30726
31276
|
success: false,
|
|
30727
31277
|
error: customError,
|
|
30728
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31278
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31279
|
+
...getConditionalErrorFields(err)
|
|
30729
31280
|
};
|
|
30730
31281
|
}
|
|
30731
31282
|
}
|
|
@@ -30737,13 +31288,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30737
31288
|
* - submodelIdentifier: The Submodel’s unique id
|
|
30738
31289
|
* - level?: Determines the structural depth of the respective resource content
|
|
30739
31290
|
* - extent?: Determines to which extent the resource is being serialized
|
|
31291
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30740
31292
|
*
|
|
30741
31293
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30742
31294
|
*/
|
|
30743
31295
|
async getSubmodelByIdValueOnly(options) {
|
|
30744
|
-
const { configuration, submodelIdentifier, level, extent } = options;
|
|
31296
|
+
const { configuration, submodelIdentifier, level, extent, ifNoneMatch } = options;
|
|
30745
31297
|
try {
|
|
30746
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31298
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30747
31299
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30748
31300
|
const response = await apiInstance.getSubmodelByIdValueOnlyRaw({
|
|
30749
31301
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30753,14 +31305,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30753
31305
|
return {
|
|
30754
31306
|
success: true,
|
|
30755
31307
|
data: await response.value(),
|
|
30756
|
-
statusCode: response.raw.status
|
|
31308
|
+
statusCode: response.raw.status,
|
|
31309
|
+
etag: getEtag(response.raw)
|
|
30757
31310
|
};
|
|
30758
31311
|
} catch (err) {
|
|
31312
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31313
|
+
if (notModified) return notModified;
|
|
30759
31314
|
const customError = await handleApiError(err);
|
|
30760
31315
|
return {
|
|
30761
31316
|
success: false,
|
|
30762
31317
|
error: customError,
|
|
30763
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31318
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31319
|
+
...getConditionalErrorFields(err)
|
|
30764
31320
|
};
|
|
30765
31321
|
}
|
|
30766
31322
|
}
|
|
@@ -30772,13 +31328,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30772
31328
|
* - submodelIdentifier: The Submodel's unique id
|
|
30773
31329
|
* - body: Value-only payload object
|
|
30774
31330
|
* - level?: Determines the structural depth of the respective resource content
|
|
31331
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30775
31332
|
*
|
|
30776
31333
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30777
31334
|
*/
|
|
30778
31335
|
async patchSubmodelByIdValueOnly(options) {
|
|
30779
|
-
const { configuration, submodelIdentifier, body, level } = options;
|
|
31336
|
+
const { configuration, submodelIdentifier, body, level, ifMatch } = options;
|
|
30780
31337
|
try {
|
|
30781
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31338
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30782
31339
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30783
31340
|
const response = await apiInstance.patchSubmodelByIdValueOnlyRaw({
|
|
30784
31341
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30788,14 +31345,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30788
31345
|
return {
|
|
30789
31346
|
success: true,
|
|
30790
31347
|
data: await response.value(),
|
|
30791
|
-
statusCode: response.raw.status
|
|
31348
|
+
statusCode: response.raw.status,
|
|
31349
|
+
etag: getEtag(response.raw)
|
|
30792
31350
|
};
|
|
30793
31351
|
} catch (err) {
|
|
30794
31352
|
const customError = await handleApiError(err);
|
|
30795
31353
|
return {
|
|
30796
31354
|
success: false,
|
|
30797
31355
|
error: customError,
|
|
30798
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31356
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31357
|
+
...getConditionalErrorFields(err)
|
|
30799
31358
|
};
|
|
30800
31359
|
}
|
|
30801
31360
|
}
|
|
@@ -30808,13 +31367,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30808
31367
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30809
31368
|
* - level?: Determines the structural depth of the respective resource content
|
|
30810
31369
|
* - extent?: Determines to which extent the resource is being serialized
|
|
31370
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30811
31371
|
*
|
|
30812
31372
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30813
31373
|
*/
|
|
30814
31374
|
async getSubmodelElementByPathValueOnly(options) {
|
|
30815
|
-
const { configuration, submodelIdentifier, idShortPath, level, extent } = options;
|
|
31375
|
+
const { configuration, submodelIdentifier, idShortPath, level, extent, ifNoneMatch } = options;
|
|
30816
31376
|
try {
|
|
30817
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31377
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30818
31378
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30819
31379
|
const response = await apiInstance.getSubmodelElementByPathValueOnlySubmodelRepoRaw({
|
|
30820
31380
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30825,14 +31385,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30825
31385
|
return {
|
|
30826
31386
|
success: true,
|
|
30827
31387
|
data: await response.value(),
|
|
30828
|
-
statusCode: response.raw.status
|
|
31388
|
+
statusCode: response.raw.status,
|
|
31389
|
+
etag: getEtag(response.raw)
|
|
30829
31390
|
};
|
|
30830
31391
|
} catch (err) {
|
|
31392
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31393
|
+
if (notModified) return notModified;
|
|
30831
31394
|
const customError = await handleApiError(err);
|
|
30832
31395
|
return {
|
|
30833
31396
|
success: false,
|
|
30834
31397
|
error: customError,
|
|
30835
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31398
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31399
|
+
...getConditionalErrorFields(err)
|
|
30836
31400
|
};
|
|
30837
31401
|
}
|
|
30838
31402
|
}
|
|
@@ -30845,13 +31409,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30845
31409
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30846
31410
|
* - submodelElementValue: SubmodelElementValue object
|
|
30847
31411
|
* - level?: Determines the structural depth of the respective resource content
|
|
31412
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30848
31413
|
*
|
|
30849
31414
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30850
31415
|
*/
|
|
30851
31416
|
async patchSubmodelElementByPathValueOnly(options) {
|
|
30852
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElementValue, level } = options;
|
|
31417
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElementValue, level, ifMatch } = options;
|
|
30853
31418
|
try {
|
|
30854
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31419
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30855
31420
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30856
31421
|
const response = await apiInstance.patchSubmodelElementByPathValueOnlySubmodelRepoRaw({
|
|
30857
31422
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30862,14 +31427,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30862
31427
|
return {
|
|
30863
31428
|
success: true,
|
|
30864
31429
|
data: await response.value(),
|
|
30865
|
-
statusCode: response.raw.status
|
|
31430
|
+
statusCode: response.raw.status,
|
|
31431
|
+
etag: getEtag(response.raw)
|
|
30866
31432
|
};
|
|
30867
31433
|
} catch (err) {
|
|
30868
31434
|
const customError = await handleApiError(err);
|
|
30869
31435
|
return {
|
|
30870
31436
|
success: false,
|
|
30871
31437
|
error: customError,
|
|
30872
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31438
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31439
|
+
...getConditionalErrorFields(err)
|
|
30873
31440
|
};
|
|
30874
31441
|
}
|
|
30875
31442
|
}
|
|
@@ -30881,13 +31448,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30881
31448
|
* - submodelIdentifier: The Submodel's unique id
|
|
30882
31449
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30883
31450
|
* - submodelElementMetadata: SubmodelElementMetadata object
|
|
31451
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30884
31452
|
*
|
|
30885
31453
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30886
31454
|
*/
|
|
30887
31455
|
async patchSubmodelElementByPathMetadata(options) {
|
|
30888
|
-
const { configuration, submodelIdentifier, idShortPath, submodelElementMetadata } = options;
|
|
31456
|
+
const { configuration, submodelIdentifier, idShortPath, submodelElementMetadata, ifMatch } = options;
|
|
30889
31457
|
try {
|
|
30890
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31458
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30891
31459
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30892
31460
|
const response = await apiInstance.patchSubmodelElementByPathMetadataSubmodelRepoRaw({
|
|
30893
31461
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30897,14 +31465,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30897
31465
|
return {
|
|
30898
31466
|
success: true,
|
|
30899
31467
|
data: await response.value(),
|
|
30900
|
-
statusCode: response.raw.status
|
|
31468
|
+
statusCode: response.raw.status,
|
|
31469
|
+
etag: getEtag(response.raw)
|
|
30901
31470
|
};
|
|
30902
31471
|
} catch (err) {
|
|
30903
31472
|
const customError = await handleApiError(err);
|
|
30904
31473
|
return {
|
|
30905
31474
|
success: false,
|
|
30906
31475
|
error: customError,
|
|
30907
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31476
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31477
|
+
...getConditionalErrorFields(err)
|
|
30908
31478
|
};
|
|
30909
31479
|
}
|
|
30910
31480
|
}
|
|
@@ -30915,13 +31485,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30915
31485
|
* - configuration: The http request options
|
|
30916
31486
|
* - submodelIdentifier: The Submodel's unique id
|
|
30917
31487
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31488
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; returns `{ success: true; notModified: true }` without data if the representation still has this `etag`
|
|
30918
31489
|
*
|
|
30919
31490
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30920
31491
|
*/
|
|
30921
31492
|
async getFileByPath(options) {
|
|
30922
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
31493
|
+
const { configuration, submodelIdentifier, idShortPath, ifNoneMatch } = options;
|
|
30923
31494
|
try {
|
|
30924
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31495
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifNoneMatch }));
|
|
30925
31496
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30926
31497
|
const response = await apiInstance.getFileByPathSubmodelRepoRaw({
|
|
30927
31498
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30930,14 +31501,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30930
31501
|
return {
|
|
30931
31502
|
success: true,
|
|
30932
31503
|
data: await response.value(),
|
|
30933
|
-
statusCode: response.raw.status
|
|
31504
|
+
statusCode: response.raw.status,
|
|
31505
|
+
etag: getEtag(response.raw)
|
|
30934
31506
|
};
|
|
30935
31507
|
} catch (err) {
|
|
31508
|
+
const notModified = getNotModifiedResult(err, ifNoneMatch);
|
|
31509
|
+
if (notModified) return notModified;
|
|
30936
31510
|
const customError = await handleApiError(err);
|
|
30937
31511
|
return {
|
|
30938
31512
|
success: false,
|
|
30939
31513
|
error: customError,
|
|
30940
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31514
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31515
|
+
...getConditionalErrorFields(err)
|
|
30941
31516
|
};
|
|
30942
31517
|
}
|
|
30943
31518
|
}
|
|
@@ -30950,13 +31525,18 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30950
31525
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
30951
31526
|
* - fileName?: Name of the uploaded file
|
|
30952
31527
|
* - file?: File content
|
|
31528
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31529
|
+
* - ifNoneMatch?: Sent as `If-None-Match` header; use `*` to only create the resource (fails with `preconditionFailed` if it exists)
|
|
30953
31530
|
*
|
|
30954
31531
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30955
31532
|
*/
|
|
30956
31533
|
async putFileByPath(options) {
|
|
30957
|
-
const { configuration, submodelIdentifier, idShortPath, fileName, file } = options;
|
|
31534
|
+
const { configuration, submodelIdentifier, idShortPath, fileName, file, ifMatch, ifNoneMatch } = options;
|
|
30958
31535
|
try {
|
|
30959
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration
|
|
31536
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, {
|
|
31537
|
+
ifMatch,
|
|
31538
|
+
ifNoneMatch
|
|
31539
|
+
}));
|
|
30960
31540
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30961
31541
|
const response = await apiInstance.putFileByPathSubmodelRepoRaw({
|
|
30962
31542
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -30967,14 +31547,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30967
31547
|
return {
|
|
30968
31548
|
success: true,
|
|
30969
31549
|
data: await response.value(),
|
|
30970
|
-
statusCode: response.raw.status
|
|
31550
|
+
statusCode: response.raw.status,
|
|
31551
|
+
etag: getEtag(response.raw)
|
|
30971
31552
|
};
|
|
30972
31553
|
} catch (err) {
|
|
30973
31554
|
const customError = await handleApiError(err);
|
|
30974
31555
|
return {
|
|
30975
31556
|
success: false,
|
|
30976
31557
|
error: customError,
|
|
30977
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31558
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31559
|
+
...getConditionalErrorFields(err)
|
|
30978
31560
|
};
|
|
30979
31561
|
}
|
|
30980
31562
|
}
|
|
@@ -30985,13 +31567,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
30985
31567
|
* - configuration: The http request options
|
|
30986
31568
|
* - submodelIdentifier: The Submodel's unique id
|
|
30987
31569
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31570
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
30988
31571
|
*
|
|
30989
31572
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
30990
31573
|
*/
|
|
30991
31574
|
async deleteFileByPath(options) {
|
|
30992
|
-
const { configuration, submodelIdentifier, idShortPath } = options;
|
|
31575
|
+
const { configuration, submodelIdentifier, idShortPath, ifMatch } = options;
|
|
30993
31576
|
try {
|
|
30994
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31577
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
30995
31578
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
30996
31579
|
const response = await apiInstance.deleteFileByPathSubmodelRepoRaw({
|
|
30997
31580
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -31000,14 +31583,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31000
31583
|
return {
|
|
31001
31584
|
success: true,
|
|
31002
31585
|
data: await response.value(),
|
|
31003
|
-
statusCode: response.raw.status
|
|
31586
|
+
statusCode: response.raw.status,
|
|
31587
|
+
etag: getEtag(response.raw)
|
|
31004
31588
|
};
|
|
31005
31589
|
} catch (err) {
|
|
31006
31590
|
const customError = await handleApiError(err);
|
|
31007
31591
|
return {
|
|
31008
31592
|
success: false,
|
|
31009
31593
|
error: customError,
|
|
31010
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31594
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31595
|
+
...getConditionalErrorFields(err)
|
|
31011
31596
|
};
|
|
31012
31597
|
}
|
|
31013
31598
|
}
|
|
@@ -31020,13 +31605,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31020
31605
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31021
31606
|
* - operationRequest: Operation request object
|
|
31022
31607
|
* - async?: Determines whether an operation invocation is performed asynchronously or synchronously
|
|
31608
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31023
31609
|
*
|
|
31024
31610
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31025
31611
|
*/
|
|
31026
31612
|
async postInvokeOperationSubmodelRepo(options) {
|
|
31027
|
-
const { configuration, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
31613
|
+
const { configuration, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
31028
31614
|
try {
|
|
31029
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31615
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31030
31616
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31031
31617
|
const response = await apiInstance.invokeOperationSubmodelRepoRaw({
|
|
31032
31618
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -31036,14 +31622,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31036
31622
|
return {
|
|
31037
31623
|
success: true,
|
|
31038
31624
|
data: await response.value(),
|
|
31039
|
-
statusCode: response.raw.status
|
|
31625
|
+
statusCode: response.raw.status,
|
|
31626
|
+
etag: getEtag(response.raw)
|
|
31040
31627
|
};
|
|
31041
31628
|
} catch (err) {
|
|
31042
31629
|
const customError = await handleApiError(err);
|
|
31043
31630
|
return {
|
|
31044
31631
|
success: false,
|
|
31045
31632
|
error: customError,
|
|
31046
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31633
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31634
|
+
...getConditionalErrorFields(err)
|
|
31047
31635
|
};
|
|
31048
31636
|
}
|
|
31049
31637
|
}
|
|
@@ -31056,13 +31644,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31056
31644
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31057
31645
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31058
31646
|
* - operationRequestValueOnly: Operation request object
|
|
31647
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31059
31648
|
*
|
|
31060
31649
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31061
31650
|
*/
|
|
31062
31651
|
async postInvokeOperationValueOnly(options) {
|
|
31063
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
31652
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
31064
31653
|
try {
|
|
31065
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31654
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31066
31655
|
const encodedAasIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
31067
31656
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31068
31657
|
const response = await apiInstance.invokeOperationValueOnlyRaw({
|
|
@@ -31074,14 +31663,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31074
31663
|
return {
|
|
31075
31664
|
success: true,
|
|
31076
31665
|
data: await response.value(),
|
|
31077
|
-
statusCode: response.raw.status
|
|
31666
|
+
statusCode: response.raw.status,
|
|
31667
|
+
etag: getEtag(response.raw)
|
|
31078
31668
|
};
|
|
31079
31669
|
} catch (err) {
|
|
31080
31670
|
const customError = await handleApiError(err);
|
|
31081
31671
|
return {
|
|
31082
31672
|
success: false,
|
|
31083
31673
|
error: customError,
|
|
31084
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31674
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31675
|
+
...getConditionalErrorFields(err)
|
|
31085
31676
|
};
|
|
31086
31677
|
}
|
|
31087
31678
|
}
|
|
@@ -31093,13 +31684,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31093
31684
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31094
31685
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31095
31686
|
* - operationRequest: Operation request object
|
|
31687
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31096
31688
|
*
|
|
31097
31689
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31098
31690
|
*/
|
|
31099
31691
|
async postInvokeOperationAsync(options) {
|
|
31100
|
-
const { configuration, submodelIdentifier, idShortPath, operationRequest } = options;
|
|
31692
|
+
const { configuration, submodelIdentifier, idShortPath, operationRequest, ifMatch } = options;
|
|
31101
31693
|
try {
|
|
31102
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31694
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31103
31695
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31104
31696
|
const response = await apiInstance.invokeOperationAsyncRaw({
|
|
31105
31697
|
submodelIdentifier: encodedSubmodelIdentifier,
|
|
@@ -31109,14 +31701,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31109
31701
|
return {
|
|
31110
31702
|
success: true,
|
|
31111
31703
|
data: await response.value(),
|
|
31112
|
-
statusCode: response.raw.status
|
|
31704
|
+
statusCode: response.raw.status,
|
|
31705
|
+
etag: getEtag(response.raw)
|
|
31113
31706
|
};
|
|
31114
31707
|
} catch (err) {
|
|
31115
31708
|
const customError = await handleApiError(err);
|
|
31116
31709
|
return {
|
|
31117
31710
|
success: false,
|
|
31118
31711
|
error: customError,
|
|
31119
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31712
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31713
|
+
...getConditionalErrorFields(err)
|
|
31120
31714
|
};
|
|
31121
31715
|
}
|
|
31122
31716
|
}
|
|
@@ -31129,13 +31723,14 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31129
31723
|
* - submodelIdentifier: The Submodel’s unique id
|
|
31130
31724
|
* - idShortPath: IdShort path to the submodel element (dot-separated)
|
|
31131
31725
|
* - operationRequestValueOnly: Operation request object
|
|
31726
|
+
* - ifMatch?: Sent as `If-Match` header; the request fails with `preconditionFailed` if the resource has changed since the `etag` was issued
|
|
31132
31727
|
*
|
|
31133
31728
|
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
31134
31729
|
*/
|
|
31135
31730
|
async postInvokeOperationAsyncValueOnly(options) {
|
|
31136
|
-
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly } = options;
|
|
31731
|
+
const { configuration, aasIdentifier, submodelIdentifier, idShortPath, operationRequestValueOnly, ifMatch } = options;
|
|
31137
31732
|
try {
|
|
31138
|
-
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration));
|
|
31733
|
+
const apiInstance = new SubmodelRepositoryAPIApi(applyDefaults(configuration, { ifMatch }));
|
|
31139
31734
|
const encodedAasIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(aasIdentifier, "aasIdentifier"));
|
|
31140
31735
|
const encodedSubmodelIdentifier = base64Encode(SubmodelRepositoryClient.requireIdentifier(submodelIdentifier, "submodelIdentifier"));
|
|
31141
31736
|
const response = await apiInstance.invokeOperationAsyncValueOnlyRaw({
|
|
@@ -31147,14 +31742,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31147
31742
|
return {
|
|
31148
31743
|
success: true,
|
|
31149
31744
|
data: await response.value(),
|
|
31150
|
-
statusCode: response.raw.status
|
|
31745
|
+
statusCode: response.raw.status,
|
|
31746
|
+
etag: getEtag(response.raw)
|
|
31151
31747
|
};
|
|
31152
31748
|
} catch (err) {
|
|
31153
31749
|
const customError = await handleApiError(err);
|
|
31154
31750
|
return {
|
|
31155
31751
|
success: false,
|
|
31156
31752
|
error: customError,
|
|
31157
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31753
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31754
|
+
...getConditionalErrorFields(err)
|
|
31158
31755
|
};
|
|
31159
31756
|
}
|
|
31160
31757
|
}
|
|
@@ -31182,14 +31779,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31182
31779
|
return {
|
|
31183
31780
|
success: true,
|
|
31184
31781
|
data: await response.value(),
|
|
31185
|
-
statusCode: response.raw.status
|
|
31782
|
+
statusCode: response.raw.status,
|
|
31783
|
+
etag: getEtag(response.raw)
|
|
31186
31784
|
};
|
|
31187
31785
|
} catch (err) {
|
|
31188
31786
|
const customError = await handleApiError(err);
|
|
31189
31787
|
return {
|
|
31190
31788
|
success: false,
|
|
31191
31789
|
error: customError,
|
|
31192
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31790
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31791
|
+
...getConditionalErrorFields(err)
|
|
31193
31792
|
};
|
|
31194
31793
|
}
|
|
31195
31794
|
}
|
|
@@ -31217,14 +31816,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31217
31816
|
return {
|
|
31218
31817
|
success: true,
|
|
31219
31818
|
data: await response.value(),
|
|
31220
|
-
statusCode: response.raw.status
|
|
31819
|
+
statusCode: response.raw.status,
|
|
31820
|
+
etag: getEtag(response.raw)
|
|
31221
31821
|
};
|
|
31222
31822
|
} catch (err) {
|
|
31223
31823
|
const customError = await handleApiError(err);
|
|
31224
31824
|
return {
|
|
31225
31825
|
success: false,
|
|
31226
31826
|
error: customError,
|
|
31227
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31827
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31828
|
+
...getConditionalErrorFields(err)
|
|
31228
31829
|
};
|
|
31229
31830
|
}
|
|
31230
31831
|
}
|
|
@@ -31252,14 +31853,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31252
31853
|
return {
|
|
31253
31854
|
success: true,
|
|
31254
31855
|
data: await response.value(),
|
|
31255
|
-
statusCode: response.raw.status
|
|
31856
|
+
statusCode: response.raw.status,
|
|
31857
|
+
etag: getEtag(response.raw)
|
|
31256
31858
|
};
|
|
31257
31859
|
} catch (err) {
|
|
31258
31860
|
const customError = await handleApiError(err);
|
|
31259
31861
|
return {
|
|
31260
31862
|
success: false,
|
|
31261
31863
|
error: customError,
|
|
31262
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31864
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31865
|
+
...getConditionalErrorFields(err)
|
|
31263
31866
|
};
|
|
31264
31867
|
}
|
|
31265
31868
|
}
|
|
@@ -31285,14 +31888,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31285
31888
|
return {
|
|
31286
31889
|
success: true,
|
|
31287
31890
|
data: await response.value(),
|
|
31288
|
-
statusCode: response.raw.status
|
|
31891
|
+
statusCode: response.raw.status,
|
|
31892
|
+
etag: getEtag(response.raw)
|
|
31289
31893
|
};
|
|
31290
31894
|
} catch (err) {
|
|
31291
31895
|
const customError = await handleApiError(err);
|
|
31292
31896
|
return {
|
|
31293
31897
|
success: false,
|
|
31294
31898
|
error: customError,
|
|
31295
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31899
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31900
|
+
...getConditionalErrorFields(err)
|
|
31296
31901
|
};
|
|
31297
31902
|
}
|
|
31298
31903
|
}
|
|
@@ -31311,14 +31916,16 @@ var SubmodelRepositoryClient = class SubmodelRepositoryClient {
|
|
|
31311
31916
|
return {
|
|
31312
31917
|
success: true,
|
|
31313
31918
|
data: await response.value(),
|
|
31314
|
-
statusCode: response.raw.status
|
|
31919
|
+
statusCode: response.raw.status,
|
|
31920
|
+
etag: getEtag(response.raw)
|
|
31315
31921
|
};
|
|
31316
31922
|
} catch (err) {
|
|
31317
31923
|
const customError = await handleApiError(err);
|
|
31318
31924
|
return {
|
|
31319
31925
|
success: false,
|
|
31320
31926
|
error: customError,
|
|
31321
|
-
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError)
|
|
31927
|
+
statusCode: SubmodelRepositoryClient.extractStatusCode(err, customError),
|
|
31928
|
+
...getConditionalErrorFields(err)
|
|
31322
31929
|
};
|
|
31323
31930
|
}
|
|
31324
31931
|
}
|
|
@@ -31516,7 +32123,8 @@ var SubmodelService = class {
|
|
|
31516
32123
|
* - useRegistryEndpoint?: Whether to try registry endpoint first (default: true)
|
|
31517
32124
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
31518
32125
|
*
|
|
31519
|
-
* @returns Either `{ success: true; data: { submodel, descriptor?, conceptDescriptions? } }` or `{ success: false; error: ... }`.
|
|
32126
|
+
* @returns Either `{ success: true; data: { submodel, descriptor?, conceptDescriptions? }; etag? }` or `{ success: false; error: ... }`.
|
|
32127
|
+
* `etag` is the entity tag of the Submodel, if the repository sends one.
|
|
31520
32128
|
*/
|
|
31521
32129
|
async getSubmodelById(options) {
|
|
31522
32130
|
const { submodelIdentifier, useRegistryEndpoint = true, includeConceptDescriptions = false } = options;
|
|
@@ -31539,7 +32147,8 @@ var SubmodelService = class {
|
|
|
31539
32147
|
submodel: submodelResult.data.submodel,
|
|
31540
32148
|
descriptor,
|
|
31541
32149
|
...submodelResult.data.conceptDescriptions && { conceptDescriptions: submodelResult.data.conceptDescriptions }
|
|
31542
|
-
}
|
|
32150
|
+
},
|
|
32151
|
+
etag: submodelResult.etag
|
|
31543
32152
|
};
|
|
31544
32153
|
}
|
|
31545
32154
|
}
|
|
@@ -31565,7 +32174,8 @@ var SubmodelService = class {
|
|
|
31565
32174
|
submodel,
|
|
31566
32175
|
descriptor: void 0,
|
|
31567
32176
|
...conceptDescriptions && { conceptDescriptions }
|
|
31568
|
-
}
|
|
32177
|
+
},
|
|
32178
|
+
etag: submodelResult.etag
|
|
31569
32179
|
};
|
|
31570
32180
|
}
|
|
31571
32181
|
return {
|
|
@@ -31623,7 +32233,8 @@ var SubmodelService = class {
|
|
|
31623
32233
|
* - endpoint: The endpoint URL (format: http://host/submodels/{base64EncodedId})
|
|
31624
32234
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
31625
32235
|
*
|
|
31626
|
-
* @returns Either `{ success: true; data: { submodel, conceptDescriptions? } }` or `{ success: false; error: ... }`.
|
|
32236
|
+
* @returns Either `{ success: true; data: { submodel, conceptDescriptions? }; etag? }` or `{ success: false; error: ... }`.
|
|
32237
|
+
* `etag` is the entity tag of the Submodel, if the repository sends one.
|
|
31627
32238
|
*/
|
|
31628
32239
|
async getSubmodelByEndpoint(options) {
|
|
31629
32240
|
const { endpoint, includeConceptDescriptions = false } = options;
|
|
@@ -31665,7 +32276,8 @@ var SubmodelService = class {
|
|
|
31665
32276
|
data: {
|
|
31666
32277
|
submodel,
|
|
31667
32278
|
...conceptDescriptions && { conceptDescriptions }
|
|
31668
|
-
}
|
|
32279
|
+
},
|
|
32280
|
+
etag: submodelResult.etag
|
|
31669
32281
|
};
|
|
31670
32282
|
}
|
|
31671
32283
|
/**
|
|
@@ -31755,11 +32367,13 @@ var SubmodelService = class {
|
|
|
31755
32367
|
* @param options Object containing:
|
|
31756
32368
|
* - submodel: The updated Submodel
|
|
31757
32369
|
* - updateInRegistry?: Whether to update the descriptor in the registry (default: true)
|
|
32370
|
+
* - ifMatch?: Sent as `If-Match` header with the repository update; if the Submodel has changed, the update fails
|
|
32371
|
+
* with `preconditionFailed` and the registry is not updated
|
|
31758
32372
|
*
|
|
31759
32373
|
* @returns Either `{ success: true; data: { submodel, descriptor? } }` or `{ success: false; error: ... }`.
|
|
31760
32374
|
*/
|
|
31761
32375
|
async updateSubmodel(options) {
|
|
31762
|
-
const { submodel, updateInRegistry = true } = options;
|
|
32376
|
+
const { submodel, updateInRegistry = true, ifMatch } = options;
|
|
31763
32377
|
if (!this.submodelRepositoryConfig) return {
|
|
31764
32378
|
success: false,
|
|
31765
32379
|
error: {
|
|
@@ -31770,11 +32384,13 @@ var SubmodelService = class {
|
|
|
31770
32384
|
const submodelResult = await this.submodelRepositoryClient.putSubmodelById({
|
|
31771
32385
|
configuration: this.submodelRepositoryConfig,
|
|
31772
32386
|
submodelIdentifier: submodel.id,
|
|
31773
|
-
submodel
|
|
32387
|
+
submodel,
|
|
32388
|
+
ifMatch
|
|
31774
32389
|
});
|
|
31775
32390
|
if (!submodelResult.success) return {
|
|
31776
32391
|
success: false,
|
|
31777
|
-
error: submodelResult.error
|
|
32392
|
+
error: submodelResult.error,
|
|
32393
|
+
...pickConditionalErrorFields(submodelResult)
|
|
31778
32394
|
};
|
|
31779
32395
|
const updatedSubmodel = submodelResult.data || submodel;
|
|
31780
32396
|
if (updateInRegistry && this.submodelRegistryConfig) {
|
|
@@ -31808,16 +32424,30 @@ var SubmodelService = class {
|
|
|
31808
32424
|
* Deletes a Submodel and optionally removes it from the registry.
|
|
31809
32425
|
*
|
|
31810
32426
|
* This method removes the descriptor from the registry first (if requested),
|
|
31811
|
-
* then deletes the Submodel from the repository.
|
|
32427
|
+
* then deletes the Submodel from the repository. With `ifMatch`, the Submodel is deleted from the repository
|
|
32428
|
+
* first, so that a failed precondition leaves the descriptor in the registry.
|
|
31812
32429
|
*
|
|
31813
32430
|
* @param options Object containing:
|
|
31814
32431
|
* - submodelIdentifier: The Submodel identifier to remove
|
|
31815
32432
|
* - deleteFromRegistry?: Whether to delete from registry (default: true)
|
|
32433
|
+
* - ifMatch?: Sent as `If-Match` header with the repository delete; if the Submodel has changed, the delete fails
|
|
32434
|
+
* with `preconditionFailed`. Requires the repository configuration.
|
|
31816
32435
|
*
|
|
31817
32436
|
* @returns Either `{ success: true; data: void }` or `{ success: false; error: ... }`.
|
|
31818
32437
|
*/
|
|
31819
32438
|
async deleteSubmodel(options) {
|
|
31820
|
-
const { submodelIdentifier, deleteFromRegistry = true } = options;
|
|
32439
|
+
const { submodelIdentifier, deleteFromRegistry = true, ifMatch } = options;
|
|
32440
|
+
if (ifMatch) {
|
|
32441
|
+
if (!this.submodelRepositoryConfig) return {
|
|
32442
|
+
success: false,
|
|
32443
|
+
error: {
|
|
32444
|
+
errorType: "ConfigurationError",
|
|
32445
|
+
message: "Repository configuration required for a conditional delete"
|
|
32446
|
+
}
|
|
32447
|
+
};
|
|
32448
|
+
const repositoryResult = await this.deleteSubmodelFromRepository(submodelIdentifier, ifMatch);
|
|
32449
|
+
if (!repositoryResult.success) return repositoryResult;
|
|
32450
|
+
}
|
|
31821
32451
|
if (deleteFromRegistry && this.submodelRegistryConfig) {
|
|
31822
32452
|
const registryResult = await this.submodelRegistryClient.deleteSubmodelDescriptorById({
|
|
31823
32453
|
configuration: this.submodelRegistryConfig,
|
|
@@ -31828,14 +32458,26 @@ var SubmodelService = class {
|
|
|
31828
32458
|
error: registryResult.error
|
|
31829
32459
|
};
|
|
31830
32460
|
}
|
|
32461
|
+
if (!ifMatch) {
|
|
32462
|
+
const repositoryResult = await this.deleteSubmodelFromRepository(submodelIdentifier);
|
|
32463
|
+
if (!repositoryResult.success) return repositoryResult;
|
|
32464
|
+
}
|
|
32465
|
+
return {
|
|
32466
|
+
success: true,
|
|
32467
|
+
data: void 0
|
|
32468
|
+
};
|
|
32469
|
+
}
|
|
32470
|
+
async deleteSubmodelFromRepository(submodelIdentifier, ifMatch) {
|
|
31831
32471
|
if (this.submodelRepositoryConfig) {
|
|
31832
32472
|
const repositoryResult = await this.submodelRepositoryClient.deleteSubmodelById({
|
|
31833
32473
|
configuration: this.submodelRepositoryConfig,
|
|
31834
|
-
submodelIdentifier
|
|
32474
|
+
submodelIdentifier,
|
|
32475
|
+
ifMatch
|
|
31835
32476
|
});
|
|
31836
32477
|
if (!repositoryResult.success) return {
|
|
31837
32478
|
success: false,
|
|
31838
|
-
error: repositoryResult.error
|
|
32479
|
+
error: repositoryResult.error,
|
|
32480
|
+
...pickConditionalErrorFields(repositoryResult)
|
|
31839
32481
|
};
|
|
31840
32482
|
}
|
|
31841
32483
|
return {
|
|
@@ -32103,7 +32745,8 @@ var AasService = class {
|
|
|
32103
32745
|
* - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
|
|
32104
32746
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
32105
32747
|
*
|
|
32106
|
-
* @returns Either `{ success: true; data: { shell, descriptor?, submodels? } }` or `{ success: false; error: ... }`.
|
|
32748
|
+
* @returns Either `{ success: true; data: { shell, descriptor?, submodels? }; etag? }` or `{ success: false; error: ... }`.
|
|
32749
|
+
* `etag` is the entity tag of the shell, if the repository sends one.
|
|
32107
32750
|
*/
|
|
32108
32751
|
async getAasById(options) {
|
|
32109
32752
|
const { aasIdentifier, useRegistryEndpoint = true, includeSubmodels = false } = options;
|
|
@@ -32132,7 +32775,8 @@ var AasService = class {
|
|
|
32132
32775
|
shell,
|
|
32133
32776
|
descriptor,
|
|
32134
32777
|
...submodels && { submodels }
|
|
32135
|
-
}
|
|
32778
|
+
},
|
|
32779
|
+
etag: shellResult.etag
|
|
32136
32780
|
};
|
|
32137
32781
|
}
|
|
32138
32782
|
}
|
|
@@ -32159,7 +32803,8 @@ var AasService = class {
|
|
|
32159
32803
|
shell,
|
|
32160
32804
|
descriptor: void 0,
|
|
32161
32805
|
...submodels && { submodels }
|
|
32162
|
-
}
|
|
32806
|
+
},
|
|
32807
|
+
etag: shellResult.etag
|
|
32163
32808
|
};
|
|
32164
32809
|
}
|
|
32165
32810
|
return {
|
|
@@ -32218,7 +32863,8 @@ var AasService = class {
|
|
|
32218
32863
|
* - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
|
|
32219
32864
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
32220
32865
|
*
|
|
32221
|
-
* @returns Either `{ success: true; data: { shell, submodels? } }` or `{ success: false; error: ... }`.
|
|
32866
|
+
* @returns Either `{ success: true; data: { shell, submodels? }; etag? }` or `{ success: false; error: ... }`.
|
|
32867
|
+
* `etag` is the entity tag of the shell, if the repository sends one.
|
|
32222
32868
|
*/
|
|
32223
32869
|
async getAasByEndpoint(options) {
|
|
32224
32870
|
const { endpoint, includeSubmodels = false } = options;
|
|
@@ -32260,7 +32906,8 @@ var AasService = class {
|
|
|
32260
32906
|
data: {
|
|
32261
32907
|
shell,
|
|
32262
32908
|
...submodels && { submodels }
|
|
32263
|
-
}
|
|
32909
|
+
},
|
|
32910
|
+
etag: shellResult.etag
|
|
32264
32911
|
};
|
|
32265
32912
|
}
|
|
32266
32913
|
/**
|
|
@@ -32329,11 +32976,13 @@ var AasService = class {
|
|
|
32329
32976
|
* @param options Object containing:
|
|
32330
32977
|
* - shell: The updated AAS
|
|
32331
32978
|
* - updateInRegistry?: Whether to update the descriptor in the registry (default: true)
|
|
32979
|
+
* - ifMatch?: Sent as `If-Match` header with the repository update; if the shell has changed, the update fails with
|
|
32980
|
+
* `preconditionFailed` and the registry is not updated
|
|
32332
32981
|
*
|
|
32333
32982
|
* @returns Either `{ success: true; data: { shell, descriptor? } }` or `{ success: false; error: ... }`.
|
|
32334
32983
|
*/
|
|
32335
32984
|
async updateAas(options) {
|
|
32336
|
-
const { shell, updateInRegistry = true } = options;
|
|
32985
|
+
const { shell, updateInRegistry = true, ifMatch } = options;
|
|
32337
32986
|
if (!this.aasRepositoryConfig) return {
|
|
32338
32987
|
success: false,
|
|
32339
32988
|
error: {
|
|
@@ -32344,11 +32993,13 @@ var AasService = class {
|
|
|
32344
32993
|
const shellResult = await this.aasRepositoryClient.putAssetAdministrationShellById({
|
|
32345
32994
|
configuration: this.aasRepositoryConfig,
|
|
32346
32995
|
aasIdentifier: shell.id,
|
|
32347
|
-
assetAdministrationShell: shell
|
|
32996
|
+
assetAdministrationShell: shell,
|
|
32997
|
+
ifMatch
|
|
32348
32998
|
});
|
|
32349
32999
|
if (!shellResult.success) return {
|
|
32350
33000
|
success: false,
|
|
32351
|
-
error: shellResult.error
|
|
33001
|
+
error: shellResult.error,
|
|
33002
|
+
...pickConditionalErrorFields(shellResult)
|
|
32352
33003
|
};
|
|
32353
33004
|
const updatedShell = shellResult.data || shell;
|
|
32354
33005
|
if (updateInRegistry && this.aasRegistryConfig) {
|
|
@@ -32382,16 +33033,30 @@ var AasService = class {
|
|
|
32382
33033
|
* Deletes an Asset Administration Shell and optionally removes it from the registry.
|
|
32383
33034
|
*
|
|
32384
33035
|
* This method removes the descriptor from the registry first (if requested),
|
|
32385
|
-
* then deletes the AAS from the repository.
|
|
33036
|
+
* then deletes the AAS from the repository. With `ifMatch`, the AAS is deleted from the repository first,
|
|
33037
|
+
* so that a failed precondition leaves the descriptor in the registry.
|
|
32386
33038
|
*
|
|
32387
33039
|
* @param options Object containing:
|
|
32388
33040
|
* - aasIdentifier: The AAS identifier to remove
|
|
32389
33041
|
* - deleteFromRegistry?: Whether to delete from registry (default: true)
|
|
33042
|
+
* - ifMatch?: Sent as `If-Match` header with the repository delete; if the shell has changed, the delete fails with
|
|
33043
|
+
* `preconditionFailed`. Requires the repository configuration.
|
|
32390
33044
|
*
|
|
32391
33045
|
* @returns Either `{ success: true; data: void }` or `{ success: false; error: ... }`.
|
|
32392
33046
|
*/
|
|
32393
33047
|
async deleteAas(options) {
|
|
32394
|
-
const { aasIdentifier, deleteFromRegistry = true } = options;
|
|
33048
|
+
const { aasIdentifier, deleteFromRegistry = true, ifMatch } = options;
|
|
33049
|
+
if (ifMatch) {
|
|
33050
|
+
if (!this.aasRepositoryConfig) return {
|
|
33051
|
+
success: false,
|
|
33052
|
+
error: {
|
|
33053
|
+
errorType: "ConfigurationError",
|
|
33054
|
+
message: "Repository configuration required for a conditional delete"
|
|
33055
|
+
}
|
|
33056
|
+
};
|
|
33057
|
+
const repoResult = await this.deleteAasFromRepository(aasIdentifier, ifMatch);
|
|
33058
|
+
if (!repoResult.success) return repoResult;
|
|
33059
|
+
}
|
|
32395
33060
|
if (deleteFromRegistry && this.aasRegistryConfig) {
|
|
32396
33061
|
const registryResult = await this.aasRegistryClient.deleteAssetAdministrationShellDescriptorById({
|
|
32397
33062
|
configuration: this.aasRegistryConfig,
|
|
@@ -32402,14 +33067,26 @@ var AasService = class {
|
|
|
32402
33067
|
error: registryResult.error
|
|
32403
33068
|
};
|
|
32404
33069
|
}
|
|
33070
|
+
if (!ifMatch) {
|
|
33071
|
+
const repoResult = await this.deleteAasFromRepository(aasIdentifier);
|
|
33072
|
+
if (!repoResult.success) return repoResult;
|
|
33073
|
+
}
|
|
33074
|
+
return {
|
|
33075
|
+
success: true,
|
|
33076
|
+
data: void 0
|
|
33077
|
+
};
|
|
33078
|
+
}
|
|
33079
|
+
async deleteAasFromRepository(aasIdentifier, ifMatch) {
|
|
32405
33080
|
if (this.aasRepositoryConfig) {
|
|
32406
33081
|
const repoResult = await this.aasRepositoryClient.deleteAssetAdministrationShellById({
|
|
32407
33082
|
configuration: this.aasRepositoryConfig,
|
|
32408
|
-
aasIdentifier
|
|
33083
|
+
aasIdentifier,
|
|
33084
|
+
ifMatch
|
|
32409
33085
|
});
|
|
32410
33086
|
if (!repoResult.success) return {
|
|
32411
33087
|
success: false,
|
|
32412
|
-
error: repoResult.error
|
|
33088
|
+
error: repoResult.error,
|
|
33089
|
+
...pickConditionalErrorFields(repoResult)
|
|
32413
33090
|
};
|
|
32414
33091
|
}
|
|
32415
33092
|
return {
|