@salesforce/lds-runtime-bridge 1.266.0 → 1.268.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.
@@ -3006,6 +3006,26 @@ function findFieldInfo(objectInfo, fieldName) {
3006
3006
  return values$1(objectInfo.fields).find((field) => field.apiName === fieldName ||
3007
3007
  (field.dataType === 'Reference' && field.relationshipName === fieldName));
3008
3008
  }
3009
+ async function readIngestionTimestampForKey(key, query) {
3010
+ let ingestionTimestamp = 0;
3011
+ const sql = `
3012
+ SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
3013
+ FROM lds_data
3014
+ WHERE key IS ?
3015
+ `;
3016
+ const results = await query(sql, [key]);
3017
+ const [timestamp] = results.rows.map((row) => row[0]);
3018
+ if (timestamp !== null) {
3019
+ const numericalTimestamp = Number(timestamp);
3020
+ if (isNaN(numericalTimestamp)) {
3021
+ return ingestionTimestamp;
3022
+ }
3023
+ // adjust the timestamp to account for ingestion processing time
3024
+ // 30s is used because this is the default record TTL
3025
+ ingestionTimestamp = numericalTimestamp - 30000;
3026
+ }
3027
+ return ingestionTimestamp;
3028
+ }
3009
3029
 
3010
3030
  function findSpanningField(name) {
3011
3031
  return (field) => {
@@ -3525,18 +3545,7 @@ async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
3525
3545
  const key = buildKeyStringForRecordQuery(operation,
3526
3546
  // join varables passed from query to the argument variables given from the AST
3527
3547
  { ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
3528
- const sql = `
3529
- SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
3530
- FROM lds_data
3531
- WHERE key IS ?
3532
- `;
3533
- const results = await query(sql, [key]);
3534
- const [timestamp] = results.rows.map((row) => row[0]);
3535
- if (timestamp !== null && typeof timestamp === 'number') {
3536
- // adjust the timestamp to account for ingestion processing time
3537
- // 30s is used because this is the default record TTL
3538
- ingestionTimestamp = timestamp - 30000;
3539
- }
3548
+ return readIngestionTimestampForKey(key, query);
3540
3549
  }
3541
3550
  return ingestionTimestamp;
3542
3551
  }
@@ -3963,4 +3972,4 @@ function ldsRuntimeBridge() {
3963
3972
  }
3964
3973
 
3965
3974
  export { ldsRuntimeBridge as default };
3966
- // version: 1.266.0-2ee9b6853
3975
+ // version: 1.268.0-cd9e2e269
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-bridge",
3
- "version": "1.266.0",
3
+ "version": "1.268.0",
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.266.0",
38
- "@salesforce/lds-instrumentation": "^1.266.0",
37
+ "@salesforce/lds-adapters-uiapi": "^1.268.0",
38
+ "@salesforce/lds-instrumentation": "^1.268.0",
39
39
  "@salesforce/user": "0.0.21",
40
40
  "o11y": "244.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@salesforce/lds-drafts-adapters-uiapi": "^1.266.0",
44
- "@salesforce/lds-network-aura": "^1.266.0",
45
- "@salesforce/lds-runtime-aura": "^1.266.0",
46
- "@salesforce/lds-store-nimbus": "^1.266.0",
47
- "@salesforce/nimbus-plugin-lds": "^1.266.0",
43
+ "@salesforce/lds-drafts-adapters-uiapi": "^1.268.0",
44
+ "@salesforce/lds-network-aura": "^1.268.0",
45
+ "@salesforce/lds-runtime-aura": "^1.268.0",
46
+ "@salesforce/lds-store-nimbus": "^1.268.0",
47
+ "@salesforce/nimbus-plugin-lds": "^1.268.0",
48
48
  "babel-plugin-dynamic-import-node": "^2.3.3"
49
49
  },
50
50
  "luvioBundlesize": [