@salesforce/lds-worker-api 1.266.0-dev10 → 1.266.0-dev11

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.
@@ -1034,4 +1034,4 @@ if (process.env.NODE_ENV !== 'production') {
1034
1034
  }
1035
1035
 
1036
1036
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1037
- // version: 1.266.0-dev10-ff398791a
1037
+ // version: 1.266.0-dev11-133bca5b9
@@ -4144,7 +4144,7 @@ function withDefaultLuvio(callback) {
4144
4144
  }
4145
4145
  callbacks.push(callback);
4146
4146
  }
4147
- // version: 1.266.0-dev10-ff398791a
4147
+ // version: 1.266.0-dev11-133bca5b9
4148
4148
 
4149
4149
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4150
4150
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15652,7 +15652,7 @@ function gql(literals, ...subs) {
15652
15652
  }
15653
15653
  return superResult;
15654
15654
  }
15655
- // version: 1.266.0-dev10-ff398791a
15655
+ // version: 1.266.0-dev11-133bca5b9
15656
15656
 
15657
15657
  function unwrap(data) {
15658
15658
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16577,7 +16577,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16577
16577
  const { apiFamily, name } = metadata;
16578
16578
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16579
16579
  }
16580
- // version: 1.266.0-dev10-ff398791a
16580
+ // version: 1.266.0-dev11-133bca5b9
16581
16581
 
16582
16582
  /**
16583
16583
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -43154,7 +43154,7 @@ withDefaultLuvio((luvio) => {
43154
43154
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
43155
43155
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
43156
43156
  });
43157
- // version: 1.266.0-dev10-3275d4bf8
43157
+ // version: 1.266.0-dev11-54133651d
43158
43158
 
43159
43159
  var ldsIdempotencyWriteDisabled = {
43160
43160
  isOpen: function (e) {
@@ -47657,9 +47657,10 @@ function rootRecordQuery(selection, input) {
47657
47657
  // If there is no metadata for this query or it somehow lacks a timestamp
47658
47658
  // skip setting the root timestamp
47659
47659
  if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
47660
- // adjust the timestamp to account for ingestion processing time
47661
- // 30s is used because this is the default record TTL
47662
- input.rootTimestamp = queryMetadata.ingestionTimestamp - 30000;
47660
+ const timestamp = Number(queryMetadata.ingestionTimestamp);
47661
+ if (!isNaN(timestamp)) {
47662
+ input.rootTimestamp = timestamp;
47663
+ }
47663
47664
  }
47664
47665
  }
47665
47666
  return recordQuery(selection, alias, apiName, [], input);
@@ -52310,6 +52311,20 @@ function findFieldInfo(objectInfo, fieldName) {
52310
52311
  return values$2(objectInfo.fields).find((field) => field.apiName === fieldName ||
52311
52312
  (field.dataType === 'Reference' && field.relationshipName === fieldName));
52312
52313
  }
52314
+ async function readIngestionTimestampForKey(key, query) {
52315
+ let ingestionTimestamp = 0;
52316
+ const sql = `SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}') FROM lds_data WHERE key IS ?`;
52317
+ const results = await query(sql, [key]);
52318
+ const [timestamp] = results.rows.map((row) => row[0]);
52319
+ if (timestamp !== null) {
52320
+ const numericalTimestamp = Number(timestamp);
52321
+ if (isNaN(numericalTimestamp)) {
52322
+ return ingestionTimestamp;
52323
+ }
52324
+ ingestionTimestamp = numericalTimestamp;
52325
+ }
52326
+ return ingestionTimestamp;
52327
+ }
52313
52328
 
52314
52329
  function findSpanningField(name) {
52315
52330
  return (field) => {
@@ -52829,18 +52844,7 @@ async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
52829
52844
  const key = buildKeyStringForRecordQuery(operation,
52830
52845
  // join varables passed from query to the argument variables given from the AST
52831
52846
  { ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
52832
- const sql = `
52833
- SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
52834
- FROM lds_data
52835
- WHERE key IS ?
52836
- `;
52837
- const results = await query(sql, [key]);
52838
- const [timestamp] = results.rows.map((row) => row[0]);
52839
- if (timestamp !== null && typeof timestamp === 'number') {
52840
- // adjust the timestamp to account for ingestion processing time
52841
- // 30s is used because this is the default record TTL
52842
- ingestionTimestamp = timestamp - 30000;
52843
- }
52847
+ return readIngestionTimestampForKey(key, query);
52844
52848
  }
52845
52849
  return ingestionTimestamp;
52846
52850
  }
@@ -61055,7 +61059,7 @@ register$1({
61055
61059
  id: '@salesforce/lds-network-adapter',
61056
61060
  instrument: instrument$2,
61057
61061
  });
61058
- // version: 1.266.0-dev10-ff398791a
61062
+ // version: 1.266.0-dev11-133bca5b9
61059
61063
 
61060
61064
  const { create: create$3, keys: keys$3 } = Object;
61061
61065
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -79450,7 +79454,7 @@ register$1({
79450
79454
  configuration: { ...configurationForGraphQLAdapters$1 },
79451
79455
  instrument: instrument$1,
79452
79456
  });
79453
- // version: 1.266.0-dev10-3275d4bf8
79457
+ // version: 1.266.0-dev11-54133651d
79454
79458
 
79455
79459
  // On core the unstable adapters are re-exported with different names,
79456
79460
  // we want to match them here.
@@ -81704,7 +81708,7 @@ withDefaultLuvio((luvio) => {
81704
81708
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
81705
81709
  graphQLImperative = ldsAdapter;
81706
81710
  });
81707
- // version: 1.266.0-dev10-3275d4bf8
81711
+ // version: 1.266.0-dev11-54133651d
81708
81712
 
81709
81713
  var gqlApi = /*#__PURE__*/Object.freeze({
81710
81714
  __proto__: null,
@@ -82402,7 +82406,7 @@ const callbacks$1 = [];
82402
82406
  function register(r) {
82403
82407
  callbacks$1.forEach((callback) => callback(r));
82404
82408
  }
82405
- // version: 1.266.0-dev10-ff398791a
82409
+ // version: 1.266.0-dev11-133bca5b9
82406
82410
 
82407
82411
  /**
82408
82412
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -87307,4 +87311,4 @@ const { luvio } = getRuntime();
87307
87311
  setDefaultLuvio({ luvio });
87308
87312
 
87309
87313
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
87310
- // version: 1.266.0-dev10-ff398791a
87314
+ // version: 1.266.0-dev11-133bca5b9
@@ -4150,7 +4150,7 @@
4150
4150
  }
4151
4151
  callbacks.push(callback);
4152
4152
  }
4153
- // version: 1.266.0-dev10-ff398791a
4153
+ // version: 1.266.0-dev11-133bca5b9
4154
4154
 
4155
4155
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4156
4156
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15658,7 +15658,7 @@
15658
15658
  }
15659
15659
  return superResult;
15660
15660
  }
15661
- // version: 1.266.0-dev10-ff398791a
15661
+ // version: 1.266.0-dev11-133bca5b9
15662
15662
 
15663
15663
  function unwrap(data) {
15664
15664
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16583,7 +16583,7 @@
16583
16583
  const { apiFamily, name } = metadata;
16584
16584
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16585
16585
  }
16586
- // version: 1.266.0-dev10-ff398791a
16586
+ // version: 1.266.0-dev11-133bca5b9
16587
16587
 
16588
16588
  /**
16589
16589
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -43160,7 +43160,7 @@
43160
43160
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
43161
43161
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
43162
43162
  });
43163
- // version: 1.266.0-dev10-3275d4bf8
43163
+ // version: 1.266.0-dev11-54133651d
43164
43164
 
43165
43165
  var ldsIdempotencyWriteDisabled = {
43166
43166
  isOpen: function (e) {
@@ -47663,9 +47663,10 @@
47663
47663
  // If there is no metadata for this query or it somehow lacks a timestamp
47664
47664
  // skip setting the root timestamp
47665
47665
  if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
47666
- // adjust the timestamp to account for ingestion processing time
47667
- // 30s is used because this is the default record TTL
47668
- input.rootTimestamp = queryMetadata.ingestionTimestamp - 30000;
47666
+ const timestamp = Number(queryMetadata.ingestionTimestamp);
47667
+ if (!isNaN(timestamp)) {
47668
+ input.rootTimestamp = timestamp;
47669
+ }
47669
47670
  }
47670
47671
  }
47671
47672
  return recordQuery(selection, alias, apiName, [], input);
@@ -52316,6 +52317,20 @@
52316
52317
  return values$2(objectInfo.fields).find((field) => field.apiName === fieldName ||
52317
52318
  (field.dataType === 'Reference' && field.relationshipName === fieldName));
52318
52319
  }
52320
+ async function readIngestionTimestampForKey(key, query) {
52321
+ let ingestionTimestamp = 0;
52322
+ const sql = `SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}') FROM lds_data WHERE key IS ?`;
52323
+ const results = await query(sql, [key]);
52324
+ const [timestamp] = results.rows.map((row) => row[0]);
52325
+ if (timestamp !== null) {
52326
+ const numericalTimestamp = Number(timestamp);
52327
+ if (isNaN(numericalTimestamp)) {
52328
+ return ingestionTimestamp;
52329
+ }
52330
+ ingestionTimestamp = numericalTimestamp;
52331
+ }
52332
+ return ingestionTimestamp;
52333
+ }
52319
52334
 
52320
52335
  function findSpanningField(name) {
52321
52336
  return (field) => {
@@ -52835,18 +52850,7 @@
52835
52850
  const key = buildKeyStringForRecordQuery(operation,
52836
52851
  // join varables passed from query to the argument variables given from the AST
52837
52852
  { ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
52838
- const sql = `
52839
- SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
52840
- FROM lds_data
52841
- WHERE key IS ?
52842
- `;
52843
- const results = await query(sql, [key]);
52844
- const [timestamp] = results.rows.map((row) => row[0]);
52845
- if (timestamp !== null && typeof timestamp === 'number') {
52846
- // adjust the timestamp to account for ingestion processing time
52847
- // 30s is used because this is the default record TTL
52848
- ingestionTimestamp = timestamp - 30000;
52849
- }
52853
+ return readIngestionTimestampForKey(key, query);
52850
52854
  }
52851
52855
  return ingestionTimestamp;
52852
52856
  }
@@ -61061,7 +61065,7 @@
61061
61065
  id: '@salesforce/lds-network-adapter',
61062
61066
  instrument: instrument$2,
61063
61067
  });
61064
- // version: 1.266.0-dev10-ff398791a
61068
+ // version: 1.266.0-dev11-133bca5b9
61065
61069
 
61066
61070
  const { create: create$3, keys: keys$3 } = Object;
61067
61071
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -79456,7 +79460,7 @@
79456
79460
  configuration: { ...configurationForGraphQLAdapters$1 },
79457
79461
  instrument: instrument$1,
79458
79462
  });
79459
- // version: 1.266.0-dev10-3275d4bf8
79463
+ // version: 1.266.0-dev11-54133651d
79460
79464
 
79461
79465
  // On core the unstable adapters are re-exported with different names,
79462
79466
  // we want to match them here.
@@ -81710,7 +81714,7 @@
81710
81714
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
81711
81715
  graphQLImperative = ldsAdapter;
81712
81716
  });
81713
- // version: 1.266.0-dev10-3275d4bf8
81717
+ // version: 1.266.0-dev11-54133651d
81714
81718
 
81715
81719
  var gqlApi = /*#__PURE__*/Object.freeze({
81716
81720
  __proto__: null,
@@ -82408,7 +82412,7 @@
82408
82412
  function register(r) {
82409
82413
  callbacks$1.forEach((callback) => callback(r));
82410
82414
  }
82411
- // version: 1.266.0-dev10-ff398791a
82415
+ // version: 1.266.0-dev11-133bca5b9
82412
82416
 
82413
82417
  /**
82414
82418
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -87331,4 +87335,4 @@
87331
87335
  exports.subscribeToAdapter = subscribeToAdapter;
87332
87336
 
87333
87337
  }));
87334
- // version: 1.266.0-dev10-ff398791a
87338
+ // version: 1.266.0-dev11-133bca5b9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.266.0-dev10",
3
+ "version": "1.266.0-dev11",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.266.0-dev10",
39
- "@salesforce/lds-adapters-uiapi": "^1.266.0-dev10",
40
- "@salesforce/lds-default-luvio": "^1.266.0-dev10",
41
- "@salesforce/lds-drafts": "^1.266.0-dev10",
42
- "@salesforce/lds-graphql-parser": "^1.266.0-dev10",
43
- "@salesforce/lds-luvio-engine": "^1.266.0-dev10",
44
- "@salesforce/lds-priming": "^1.266.0-dev10",
45
- "@salesforce/lds-runtime-mobile": "^1.266.0-dev10",
46
- "@salesforce/nimbus-plugin-lds": "^1.266.0-dev10",
38
+ "@salesforce/lds-adapters-graphql": "^1.266.0-dev11",
39
+ "@salesforce/lds-adapters-uiapi": "^1.266.0-dev11",
40
+ "@salesforce/lds-default-luvio": "^1.266.0-dev11",
41
+ "@salesforce/lds-drafts": "^1.266.0-dev11",
42
+ "@salesforce/lds-graphql-parser": "^1.266.0-dev11",
43
+ "@salesforce/lds-luvio-engine": "^1.266.0-dev11",
44
+ "@salesforce/lds-priming": "^1.266.0-dev11",
45
+ "@salesforce/lds-runtime-mobile": "^1.266.0-dev11",
46
+ "@salesforce/nimbus-plugin-lds": "^1.266.0-dev11",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",