@salesforce/lwc-adapters-uiapi 1.290.0 → 1.291.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.
Files changed (2) hide show
  1. package/dist/main.js +28 -1
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -60566,7 +60566,14 @@ const createRecord_ConfigPropertyMetadata = [
60566
60566
  const createResourceParams$4 = /*#__PURE__*/ createResourceParams$k(createRecord_ConfigPropertyMetadata);
60567
60567
 
60568
60568
  function onResponseSuccess(luvio, response, recordIngest, conflictMap) {
60569
- const { body } = response;
60569
+ const { body, status } = response;
60570
+ if (status === HttpStatusCode.NoContent) {
60571
+ const syntheticSnapshot = {
60572
+ state: 'Fulfilled',
60573
+ data: {},
60574
+ };
60575
+ return luvio.storeBroadcast().then(() => syntheticSnapshot);
60576
+ }
60570
60577
  const selections = buildSelectionFromRecord(body);
60571
60578
  const key = keyBuilder$3n(luvio, {
60572
60579
  recordId: body.id,
@@ -60801,11 +60808,23 @@ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
60801
60808
  return config;
60802
60809
  }
60803
60810
 
60811
+ const ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z$/;
60804
60812
  function getHeaders(clientOptions) {
60805
60813
  const headers = {};
60806
60814
  if (untrustedIsObject(clientOptions)) {
60807
60815
  if (typeof clientOptions.ifUnmodifiedSince === 'string') {
60808
60816
  headers.ifUnmodifiedSince = clientOptions.ifUnmodifiedSince;
60817
+ // HTTP standard format date is expected by UI-API
60818
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since
60819
+ // A component built for Connect API must use If-Unmodified-Since
60820
+ // dates formatted as ISO 8601, which does not match the HTTP spec.
60821
+ // For compatibility, convert the date to match the standard.
60822
+ if (headers.ifUnmodifiedSince.match(ISO8601_DATE_REGEX)) {
60823
+ const utcString = new Date(headers.ifUnmodifiedSince).toUTCString();
60824
+ if (utcString !== 'Invalid Date') {
60825
+ headers.ifUnmodifiedSince = utcString;
60826
+ }
60827
+ }
60809
60828
  }
60810
60829
  }
60811
60830
  return headers;
@@ -60824,6 +60843,14 @@ function buildNetworkSnapshot$2(luvio, config, clientOptions) {
60824
60843
  const recordIngest = createRecordIngest(fieldTrie, optionalFieldTrie, conflictMap);
60825
60844
  return luvio.dispatchResourceRequest(request).then((response) => {
60826
60845
  return luvio.handleSuccessResponse(() => {
60846
+ if (response.status === HttpStatusCode.NoContent) {
60847
+ const syntheticSnapshot = {
60848
+ state: 'Fulfilled',
60849
+ data: {},
60850
+ };
60851
+ luvio.storeEvict(keyBuilder$3n(luvio, { recordId }));
60852
+ return luvio.storeBroadcast().then(() => syntheticSnapshot);
60853
+ }
60827
60854
  const snapshot = ingestRecordResponse(luvio, response, recordId, recordIngest, conflictMap);
60828
60855
  return luvio.storeBroadcast().then(() => snapshot);
60829
60856
  }, () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.290.0",
3
+ "version": "1.291.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "UIAPI adapters with LWC bindings",
6
6
  "module": "dist/main.js",
@@ -31,10 +31,10 @@
31
31
  "clean": "rm -rf dist src/generated"
32
32
  },
33
33
  "devDependencies": {
34
- "@salesforce/lds-adapters-uiapi": "^1.290.0"
34
+ "@salesforce/lds-adapters-uiapi": "^1.291.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.154.18",
38
- "@salesforce/lds-default-luvio": "^1.290.0"
38
+ "@salesforce/lds-default-luvio": "^1.291.0"
39
39
  }
40
40
  }