@salesforce/lds-runtime-bridge 1.287.0-dev6 → 1.287.0-dev7
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/dist/ldsRuntimeBridge.js +53 -7
- package/package.json +8 -8
package/dist/ldsRuntimeBridge.js
CHANGED
|
@@ -1366,6 +1366,9 @@ class NimbusSqliteStore {
|
|
|
1366
1366
|
isEvalSupported() {
|
|
1367
1367
|
return true;
|
|
1368
1368
|
}
|
|
1369
|
+
isBatchUpdateSupported() {
|
|
1370
|
+
return this.supportsBatchUpdates;
|
|
1371
|
+
}
|
|
1369
1372
|
query(sql, params) {
|
|
1370
1373
|
return new Promise((resolve, reject) => {
|
|
1371
1374
|
this.plugin.query(sql, params, (result) => {
|
|
@@ -3837,7 +3840,7 @@ function getDenormalizedKey(originalKey, recordId, luvio) {
|
|
|
3837
3840
|
}
|
|
3838
3841
|
return keyBuilderRecord(luvio, { recordId });
|
|
3839
3842
|
}
|
|
3840
|
-
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore) {
|
|
3843
|
+
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
|
|
3841
3844
|
const getEntries = function (entries, segment) {
|
|
3842
3845
|
// this HOF only inspects records in the default segment
|
|
3843
3846
|
if (segment !== DefaultDurableSegment) {
|
|
@@ -3899,7 +3902,10 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
3899
3902
|
});
|
|
3900
3903
|
};
|
|
3901
3904
|
const denormalizeEntries = function (entries) {
|
|
3905
|
+
let hasEntries = false;
|
|
3906
|
+
let hasMetadata = false;
|
|
3902
3907
|
const putEntries = create(null);
|
|
3908
|
+
const putMetadata = create(null);
|
|
3903
3909
|
const keys$1 = keys(entries);
|
|
3904
3910
|
const putRecords = {};
|
|
3905
3911
|
const putRecordViews = {};
|
|
@@ -3942,6 +3948,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
3942
3948
|
putRecords[recordId] = true;
|
|
3943
3949
|
}
|
|
3944
3950
|
if (isStoreRecordError(record)) {
|
|
3951
|
+
hasEntries = true;
|
|
3945
3952
|
putEntries[recordKey] = value;
|
|
3946
3953
|
continue;
|
|
3947
3954
|
}
|
|
@@ -3954,24 +3961,43 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
3954
3961
|
}
|
|
3955
3962
|
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
3956
3963
|
if (denormalizedRecord !== undefined) {
|
|
3964
|
+
hasEntries = true;
|
|
3957
3965
|
putEntries[recordKey] = {
|
|
3958
3966
|
data: denormalizedRecord,
|
|
3959
3967
|
metadata,
|
|
3960
3968
|
};
|
|
3969
|
+
// if undefined then it is pending
|
|
3970
|
+
// we should still update metadata on pending records
|
|
3971
|
+
}
|
|
3972
|
+
else {
|
|
3973
|
+
hasMetadata = true;
|
|
3974
|
+
metadata.expirationTimestamp = metadata.ingestionTimestamp;
|
|
3975
|
+
putMetadata[recordKey] = {
|
|
3976
|
+
metadata,
|
|
3977
|
+
};
|
|
3961
3978
|
}
|
|
3962
3979
|
}
|
|
3963
3980
|
else {
|
|
3981
|
+
hasEntries = true;
|
|
3964
3982
|
putEntries[key] = value;
|
|
3965
3983
|
}
|
|
3966
3984
|
}
|
|
3967
|
-
return putEntries;
|
|
3985
|
+
return { putEntries, putMetadata, hasEntries, hasMetadata };
|
|
3968
3986
|
};
|
|
3969
3987
|
const setEntries = function (entries, segment) {
|
|
3970
3988
|
if (segment !== DefaultDurableSegment) {
|
|
3971
3989
|
return durableStore.setEntries(entries, segment);
|
|
3972
3990
|
}
|
|
3973
|
-
const putEntries = denormalizeEntries(entries);
|
|
3974
|
-
|
|
3991
|
+
const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
|
|
3992
|
+
const promises = [
|
|
3993
|
+
hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
|
|
3994
|
+
];
|
|
3995
|
+
if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
|
|
3996
|
+
promises.push(hasMetadata && sqlStore !== undefined
|
|
3997
|
+
? durableStore.setMetadata(putMetadata, segment)
|
|
3998
|
+
: undefined);
|
|
3999
|
+
}
|
|
4000
|
+
return Promise.all(promises).then(() => { });
|
|
3975
4001
|
};
|
|
3976
4002
|
const batchOperations = function (operations) {
|
|
3977
4003
|
const operationsWithDenormedRecords = [];
|
|
@@ -3988,10 +4014,20 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
3988
4014
|
// this is determined by the plugin supporting update batch calls before it gets to this HOF.
|
|
3989
4015
|
// so we only need to check one entry to confirm this for performance
|
|
3990
4016
|
if (firstEntry.data !== undefined) {
|
|
4017
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
3991
4018
|
operationsWithDenormedRecords.push({
|
|
3992
4019
|
...operation,
|
|
3993
|
-
entries:
|
|
4020
|
+
entries: putEntries,
|
|
3994
4021
|
});
|
|
4022
|
+
if (hasMetadata &&
|
|
4023
|
+
sqlStore !== undefined &&
|
|
4024
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
4025
|
+
operationsWithDenormedRecords.push({
|
|
4026
|
+
...operation,
|
|
4027
|
+
entries: putMetadata,
|
|
4028
|
+
type: 'setMetadata',
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
3995
4031
|
}
|
|
3996
4032
|
else {
|
|
3997
4033
|
operationsWithDenormedRecords.push(operation);
|
|
@@ -4003,10 +4039,20 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
4003
4039
|
operationsWithDenormedRecords.push(operation);
|
|
4004
4040
|
continue;
|
|
4005
4041
|
}
|
|
4042
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
4006
4043
|
operationsWithDenormedRecords.push({
|
|
4007
4044
|
...operation,
|
|
4008
|
-
entries:
|
|
4045
|
+
entries: putEntries,
|
|
4009
4046
|
});
|
|
4047
|
+
if (hasMetadata &&
|
|
4048
|
+
sqlStore !== undefined &&
|
|
4049
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
4050
|
+
operationsWithDenormedRecords.push({
|
|
4051
|
+
...operation,
|
|
4052
|
+
entries: putMetadata,
|
|
4053
|
+
type: 'setMetadata',
|
|
4054
|
+
});
|
|
4055
|
+
}
|
|
4010
4056
|
}
|
|
4011
4057
|
return durableStore.batchOperations(operationsWithDenormedRecords);
|
|
4012
4058
|
};
|
|
@@ -4101,4 +4147,4 @@ function ldsRuntimeBridge() {
|
|
|
4101
4147
|
}
|
|
4102
4148
|
|
|
4103
4149
|
export { ldsRuntimeBridge as default };
|
|
4104
|
-
// version: 1.287.0-
|
|
4150
|
+
// version: 1.287.0-dev7-60e10f218
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-bridge",
|
|
3
|
-
"version": "1.287.0-
|
|
3
|
+
"version": "1.287.0-dev7",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for bridge.app.",
|
|
6
6
|
"main": "dist/ldsRuntimeBridge.js",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-bridge"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@salesforce/lds-adapters-uiapi": "^1.287.0-
|
|
38
|
-
"@salesforce/lds-instrumentation": "^1.287.0-
|
|
37
|
+
"@salesforce/lds-adapters-uiapi": "^1.287.0-dev7",
|
|
38
|
+
"@salesforce/lds-instrumentation": "^1.287.0-dev7",
|
|
39
39
|
"@salesforce/user": "0.0.21",
|
|
40
40
|
"o11y": "250.7.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-drafts-adapters-uiapi": "^1.287.0-
|
|
44
|
-
"@salesforce/lds-network-aura": "^1.287.0-
|
|
45
|
-
"@salesforce/lds-runtime-aura": "^1.287.0-
|
|
46
|
-
"@salesforce/lds-store-nimbus": "^1.287.0-
|
|
47
|
-
"@salesforce/nimbus-plugin-lds": "^1.287.0-
|
|
43
|
+
"@salesforce/lds-drafts-adapters-uiapi": "^1.287.0-dev7",
|
|
44
|
+
"@salesforce/lds-network-aura": "^1.287.0-dev7",
|
|
45
|
+
"@salesforce/lds-runtime-aura": "^1.287.0-dev7",
|
|
46
|
+
"@salesforce/lds-store-nimbus": "^1.287.0-dev7",
|
|
47
|
+
"@salesforce/nimbus-plugin-lds": "^1.287.0-dev7",
|
|
48
48
|
"babel-plugin-dynamic-import-node": "^2.3.3"
|
|
49
49
|
},
|
|
50
50
|
"luvioBundlesize": [
|