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