@salesforce/lwc-adapters-uiapi 1.228.1 → 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 +26 -10
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -13128,7 +13128,7 @@ function fulfill(existing, incoming) {
13128
13128
  const batchRequestWithSingleRequest = isSingleBatchRecordRequest(existingUrlParams) &&
13129
13129
  isSingleRecordRequest(urlParams) &&
13130
13130
  incomingUrlRecords[0] === existingUrlRecords[0];
13131
- if (!batchRequestWithSingleRequest) {
13131
+ if (!batchRequestWithSingleRequest || isRestrictedPathCondition(existingPath, path)) {
13132
13132
  return false;
13133
13133
  }
13134
13134
  }
@@ -13171,6 +13171,12 @@ function isSingleBatchRecordRequest(urlParams) {
13171
13171
  function isSingleRecordRequest(urlParams) {
13172
13172
  return hasOwnProperty.call(urlParams, 'recordId');
13173
13173
  }
13174
+ function isRestrictedPathCondition(existingPath, path) {
13175
+ // should not dedupe getRecordUi and getRecord as both of their representation is different
13176
+ // records call cannot digest response of getRecordUi
13177
+ return ((existingPath.includes('/record-ui') && path.includes('/records')) ||
13178
+ (existingPath.includes('/records') && path.includes('/record-ui')));
13179
+ }
13174
13180
 
13175
13181
  const createResourceRequest$16 = function getUiApiRecordsByRecordIdCreateResourceRequest(config) {
13176
13182
  return {
@@ -19769,18 +19775,28 @@ const buildLayoutModeCacheSnapshot = (apiName, recordTypeId, layoutType, mode) =
19769
19775
  * These are intermediate lookups to check if the record is in the L2 cache
19770
19776
  * @param {Luvio} luvio
19771
19777
  * @param {GetRecordLayoutTypeConfig} config
19772
- * @param {BuildCachedSnapshot<BuildSnapshotContext} cachedSnapshot
19778
+ * @param {BuildCachedSnapshot<BuildSnapshotContext>} cachedSnapshot
19773
19779
  */
19774
19780
  function makeCacheOnlySnapshot(luvio, config, adapterContext, cachedSnapshot) {
19775
- return luvio.applyCachePolicy({
19776
- cachePolicy: {
19777
- // only looking in the cache so we can check for L2 data offline
19778
- type: 'only-if-cached',
19779
- },
19780
- }, { config, luvio, adapterContext }, cachedSnapshot,
19781
- // 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
19782
19785
  () => {
19783
- 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
+ });
19784
19800
  });
19785
19801
  }
19786
19802
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.228.1",
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": "*"
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": "*"
38
+ "@salesforce/lds-default-luvio": "1.229.0-dev2"
39
39
  }
40
40
  }