@salesforce/lds-durable-records 1.341.0 → 1.343.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.
|
@@ -360,59 +360,4 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
// This HOF ensures that missing links that are stored in the "links" property in the durable store get restored to the "fields" property.
|
|
365
|
-
// this code is necessary for backwards compatibility with records that were stored in the durable store before the "links" property was removed.
|
|
366
|
-
function makeDurableStoreBackwardsCompatible(durableStore) {
|
|
367
|
-
const getEntries = function (entries, segment) {
|
|
368
|
-
// this HOF only inspects records in the default segment
|
|
369
|
-
if (segment !== DefaultDurableSegment) {
|
|
370
|
-
return durableStore.getEntries(entries, segment);
|
|
371
|
-
}
|
|
372
|
-
const { length: entriesLength } = entries;
|
|
373
|
-
if (entriesLength === 0) {
|
|
374
|
-
return Promise.resolve({});
|
|
375
|
-
}
|
|
376
|
-
// call base getEntries
|
|
377
|
-
return durableStore.getEntries(entries, segment).then((durableEntries) => {
|
|
378
|
-
if (durableEntries === undefined) {
|
|
379
|
-
return undefined;
|
|
380
|
-
}
|
|
381
|
-
const returnEntries = create(null);
|
|
382
|
-
const keys$1 = keys(durableEntries);
|
|
383
|
-
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
384
|
-
const key = keys$1[i];
|
|
385
|
-
const value = durableEntries[key];
|
|
386
|
-
if (value === undefined) {
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
if (isEntryDurableRecordRepresentation(value, key)) {
|
|
390
|
-
const record = value.data;
|
|
391
|
-
const { links } = record;
|
|
392
|
-
if (links !== undefined) {
|
|
393
|
-
const missingLinks = keys(links);
|
|
394
|
-
for (let j = 0, len = missingLinks.length; j < len; j++) {
|
|
395
|
-
const fieldName = missingLinks[j];
|
|
396
|
-
const link = links[fieldName];
|
|
397
|
-
if (link !== undefined && link.isMissing === true) {
|
|
398
|
-
record.fields[fieldName] = {
|
|
399
|
-
__state: { isMissing: true },
|
|
400
|
-
value: undefined,
|
|
401
|
-
displayValue: undefined,
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
delete record.links;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
returnEntries[key] = value;
|
|
409
|
-
}
|
|
410
|
-
return returnEntries;
|
|
411
|
-
});
|
|
412
|
-
};
|
|
413
|
-
return create(durableStore, {
|
|
414
|
-
getEntries: { value: getEntries, writable: true },
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export { makeDurableStoreBackwardsCompatible, makeRecordDenormalizingDurableStore };
|
|
363
|
+
export { makeRecordDenormalizingDurableStore };
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { makeRecordDenormalizingDurableStore } from './makeRecordDenormalizingDurableStore';
|
|
2
|
-
export { makeDurableStoreBackwardsCompatible } from './makeDurableStoreBackwardsCompatible';
|
|
3
2
|
export type DurableRecordRepresentationFieldState = {
|
|
4
3
|
isMissing?: true;
|
|
5
4
|
pending?: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-durable-records",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.343.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS Record Utilities",
|
|
6
6
|
"main": "dist/ldsDurableRecords.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@luvio/engine": "0.156.5",
|
|
27
27
|
"@luvio/environments": "0.156.5",
|
|
28
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
28
|
+
"@salesforce/lds-adapters-uiapi": "^1.343.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@salesforce/lds-store-nimbus": "^1.
|
|
31
|
+
"@salesforce/lds-store-nimbus": "^1.343.0"
|
|
32
32
|
}
|
|
33
33
|
}
|