basyx-typescript-sdk 2.2.5 → 2.3.0

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