@salesforce/lwc-adapters-uiapi 1.229.0-dev1 → 1.229.0-dev2

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 +19 -9
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -19775,18 +19775,28 @@ const buildLayoutModeCacheSnapshot = (apiName, recordTypeId, layoutType, mode) =
19775
19775
  * These are intermediate lookups to check if the record is in the L2 cache
19776
19776
  * @param {Luvio} luvio
19777
19777
  * @param {GetRecordLayoutTypeConfig} config
19778
- * @param {BuildCachedSnapshot<BuildSnapshotContext} cachedSnapshot
19778
+ * @param {BuildCachedSnapshot<BuildSnapshotContext>} cachedSnapshot
19779
19779
  */
19780
19780
  function makeCacheOnlySnapshot(luvio, config, adapterContext, cachedSnapshot) {
19781
- return luvio.applyCachePolicy({
19782
- cachePolicy: {
19783
- // only looking in the cache so we can check for L2 data offline
19784
- type: 'only-if-cached',
19785
- },
19786
- }, { config, luvio, adapterContext }, cachedSnapshot,
19787
- // this won't be invoked since we're requesting only-if-cached
19781
+ return luvio.applyCachePolicy(
19782
+ // Pass empty context so environment will use its default cache-policy
19783
+ {}, { config, luvio, adapterContext }, cachedSnapshot,
19784
+ // disallow hitting the network by returning a gateway timeout
19788
19785
  () => {
19789
- throw Error('buildNetworkSnapshot should not be called for only-if-cached policy');
19786
+ return new Promise((resolve) => {
19787
+ resolve({
19788
+ state: 'Error',
19789
+ data: undefined,
19790
+ error: {
19791
+ body: undefined,
19792
+ headers: {},
19793
+ ok: false,
19794
+ status: 504,
19795
+ statusText: 'Gateway Timeout',
19796
+ errorType: 'fetchResponse',
19797
+ },
19798
+ });
19799
+ });
19790
19800
  });
19791
19801
  }
19792
19802
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.229.0-dev1",
3
+ "version": "1.229.0-dev2",
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.229.0-dev1"
34
+ "@salesforce/lds-adapters-uiapi": "1.229.0-dev2"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.145.2",
38
- "@salesforce/lds-default-luvio": "1.229.0-dev1"
38
+ "@salesforce/lds-default-luvio": "1.229.0-dev2"
39
39
  }
40
40
  }