@salesforce/lds-worker-api 1.112.0 → 1.112.1

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.
@@ -744,4 +744,4 @@ if (process.env.NODE_ENV !== 'production') {
744
744
  }
745
745
 
746
746
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
747
- // version: 1.112.0-725d7e6e3
747
+ // version: 1.112.1-1a0875b1d
@@ -3649,7 +3649,7 @@ class Luvio {
3649
3649
  return this.environment.buildStructuredKey(namespace, representationName, idValues);
3650
3650
  }
3651
3651
  }
3652
- // engine version: 0.136.5-77eb3bb4
3652
+ // engine version: 0.137.1-cdbdc5cd
3653
3653
 
3654
3654
  /**
3655
3655
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3776,7 +3776,7 @@ function withDefaultLuvio(callback) {
3776
3776
  }
3777
3777
  callbacks.push(callback);
3778
3778
  }
3779
- // version: 1.112.0-725d7e6e3
3779
+ // version: 1.112.1-1a0875b1d
3780
3780
 
3781
3781
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3782
3782
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15200,7 +15200,7 @@ function parseAndVisit(source) {
15200
15200
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15201
15201
  return luvioDocumentNode;
15202
15202
  }
15203
- // version: 1.112.0-725d7e6e3
15203
+ // version: 1.112.1-1a0875b1d
15204
15204
 
15205
15205
  function unwrap(data) {
15206
15206
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -15971,15 +15971,31 @@ function createInvalidConfigError() {
15971
15971
  function createGraphQLImperativeAdapter(luvio, adapter, metadata, astResolver) {
15972
15972
  const { name } = metadata;
15973
15973
  const imperativeAdapterInvoke = (config, requestContext, callback) => {
15974
- const ast = astResolver(config.query);
15975
- if (ast === undefined) {
15976
- callback(createInvalidConfigError());
15977
- return;
15974
+ let coercedConfig = null;
15975
+ if ('batchQuery' in config) {
15976
+ coercedConfig = {
15977
+ batchQuery: config.batchQuery.map((individualConfig) => ({
15978
+ ...individualConfig,
15979
+ query: astResolver(individualConfig.query),
15980
+ })),
15981
+ };
15982
+ // If any of the configurations are invalid, we bail out of calling the adapter.
15983
+ if (coercedConfig.batchQuery.some((individualConfig) => individualConfig.query === undefined)) {
15984
+ callback(createInvalidConfigError());
15985
+ return;
15986
+ }
15987
+ }
15988
+ else if ('query' in config) {
15989
+ const ast = astResolver(config.query);
15990
+ if (ast === undefined) {
15991
+ callback(createInvalidConfigError());
15992
+ return;
15993
+ }
15994
+ coercedConfig = {
15995
+ ...config,
15996
+ query: ast,
15997
+ };
15978
15998
  }
15979
- const coercedConfig = {
15980
- ...config,
15981
- query: ast,
15982
- };
15983
15999
  const snapshotOrPromise = adapter(coercedConfig, requestContext);
15984
16000
  if (snapshotOrPromise === null) {
15985
16001
  callback(createInvalidConfigError());
@@ -16005,15 +16021,31 @@ function createGraphQLImperativeAdapter(luvio, adapter, metadata, astResolver) {
16005
16021
  const imperativeAdapterSubscribe = (config, requestContext, callback) => {
16006
16022
  let subscriberCallback = callback;
16007
16023
  let unsub;
16008
- const ast = astResolver(config.query);
16009
- if (ast === undefined) {
16010
- callback(createInvalidConfigError());
16011
- return () => { };
16024
+ let coercedConfig = null;
16025
+ if ('batchQuery' in config) {
16026
+ coercedConfig = {
16027
+ batchQuery: config.batchQuery.map((individualConfig) => ({
16028
+ ...individualConfig,
16029
+ query: astResolver(individualConfig.query),
16030
+ })),
16031
+ };
16032
+ // If any of the configurations are invalid, we bail out of calling the adapter.
16033
+ if (coercedConfig.batchQuery.some((individualConfig) => individualConfig.query === undefined)) {
16034
+ callback(createInvalidConfigError());
16035
+ return () => { };
16036
+ }
16037
+ }
16038
+ else if ('query' in config) {
16039
+ const ast = astResolver(config.query);
16040
+ if (ast === undefined) {
16041
+ callback(createInvalidConfigError());
16042
+ return () => { };
16043
+ }
16044
+ coercedConfig = {
16045
+ ...config,
16046
+ query: ast,
16047
+ };
16012
16048
  }
16013
- const coercedConfig = {
16014
- ...config,
16015
- query: ast,
16016
- };
16017
16049
  const snapshotOrPromise = adapter(coercedConfig, requestContext);
16018
16050
  if (snapshotOrPromise === null) {
16019
16051
  subscriberCallback(createInvalidConfigError());
@@ -16081,7 +16113,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16081
16113
  const { apiFamily, name } = metadata;
16082
16114
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16083
16115
  }
16084
- // version: 1.112.0-725d7e6e3
16116
+ // version: 1.112.1-1a0875b1d
16085
16117
 
16086
16118
  /**
16087
16119
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16164,7 +16196,7 @@ var FragmentReadResultState;
16164
16196
  ({
16165
16197
  state: FragmentReadResultState.Missing,
16166
16198
  });
16167
- // engine version: 0.136.5-77eb3bb4
16199
+ // engine version: 0.137.1-cdbdc5cd
16168
16200
 
16169
16201
  const { keys: ObjectKeys$3, freeze: ObjectFreeze$3, create: ObjectCreate$3 } = Object;
16170
16202
 
@@ -44269,7 +44301,7 @@ withDefaultLuvio((luvio) => {
44269
44301
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44270
44302
  });
44271
44303
  });
44272
- // version: 1.112.0-725d7e6e3
44304
+ // version: 1.112.1-1a0875b1d
44273
44305
 
44274
44306
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44275
44307
 
@@ -59663,7 +59695,7 @@ register({
59663
59695
  id: '@salesforce/lds-network-adapter',
59664
59696
  instrument: instrument$1,
59665
59697
  });
59666
- // version: 1.112.0-725d7e6e3
59698
+ // version: 1.112.1-1a0875b1d
59667
59699
 
59668
59700
  const { create: create$2, keys: keys$2 } = Object;
59669
59701
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -77389,7 +77421,7 @@ register({
77389
77421
  configuration: { ...configurationForGraphQLAdapters },
77390
77422
  instrument,
77391
77423
  });
77392
- // version: 1.112.0-725d7e6e3
77424
+ // version: 1.112.1-1a0875b1d
77393
77425
 
77394
77426
  // On core the unstable adapters are re-exported with different names,
77395
77427
 
@@ -79518,7 +79550,7 @@ withDefaultLuvio((luvio) => {
79518
79550
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79519
79551
  graphQLImperative = ldsAdapter;
79520
79552
  });
79521
- // version: 1.112.0-725d7e6e3
79553
+ // version: 1.112.1-1a0875b1d
79522
79554
 
79523
79555
  var gqlApi = /*#__PURE__*/Object.freeze({
79524
79556
  __proto__: null,
@@ -80193,4 +80225,4 @@ const { luvio } = getRuntime();
80193
80225
  setDefaultLuvio({ luvio });
80194
80226
 
80195
80227
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
80196
- // version: 1.112.0-725d7e6e3
80228
+ // version: 1.112.1-1a0875b1d
@@ -3655,7 +3655,7 @@
3655
3655
  return this.environment.buildStructuredKey(namespace, representationName, idValues);
3656
3656
  }
3657
3657
  }
3658
- // engine version: 0.136.5-77eb3bb4
3658
+ // engine version: 0.137.1-cdbdc5cd
3659
3659
 
3660
3660
  /**
3661
3661
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3782,7 +3782,7 @@
3782
3782
  }
3783
3783
  callbacks.push(callback);
3784
3784
  }
3785
- // version: 1.112.0-725d7e6e3
3785
+ // version: 1.112.1-1a0875b1d
3786
3786
 
3787
3787
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3788
3788
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15206,7 +15206,7 @@
15206
15206
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15207
15207
  return luvioDocumentNode;
15208
15208
  }
15209
- // version: 1.112.0-725d7e6e3
15209
+ // version: 1.112.1-1a0875b1d
15210
15210
 
15211
15211
  function unwrap(data) {
15212
15212
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -15977,15 +15977,31 @@
15977
15977
  function createGraphQLImperativeAdapter(luvio, adapter, metadata, astResolver) {
15978
15978
  const { name } = metadata;
15979
15979
  const imperativeAdapterInvoke = (config, requestContext, callback) => {
15980
- const ast = astResolver(config.query);
15981
- if (ast === undefined) {
15982
- callback(createInvalidConfigError());
15983
- return;
15980
+ let coercedConfig = null;
15981
+ if ('batchQuery' in config) {
15982
+ coercedConfig = {
15983
+ batchQuery: config.batchQuery.map((individualConfig) => ({
15984
+ ...individualConfig,
15985
+ query: astResolver(individualConfig.query),
15986
+ })),
15987
+ };
15988
+ // If any of the configurations are invalid, we bail out of calling the adapter.
15989
+ if (coercedConfig.batchQuery.some((individualConfig) => individualConfig.query === undefined)) {
15990
+ callback(createInvalidConfigError());
15991
+ return;
15992
+ }
15993
+ }
15994
+ else if ('query' in config) {
15995
+ const ast = astResolver(config.query);
15996
+ if (ast === undefined) {
15997
+ callback(createInvalidConfigError());
15998
+ return;
15999
+ }
16000
+ coercedConfig = {
16001
+ ...config,
16002
+ query: ast,
16003
+ };
15984
16004
  }
15985
- const coercedConfig = {
15986
- ...config,
15987
- query: ast,
15988
- };
15989
16005
  const snapshotOrPromise = adapter(coercedConfig, requestContext);
15990
16006
  if (snapshotOrPromise === null) {
15991
16007
  callback(createInvalidConfigError());
@@ -16011,15 +16027,31 @@
16011
16027
  const imperativeAdapterSubscribe = (config, requestContext, callback) => {
16012
16028
  let subscriberCallback = callback;
16013
16029
  let unsub;
16014
- const ast = astResolver(config.query);
16015
- if (ast === undefined) {
16016
- callback(createInvalidConfigError());
16017
- return () => { };
16030
+ let coercedConfig = null;
16031
+ if ('batchQuery' in config) {
16032
+ coercedConfig = {
16033
+ batchQuery: config.batchQuery.map((individualConfig) => ({
16034
+ ...individualConfig,
16035
+ query: astResolver(individualConfig.query),
16036
+ })),
16037
+ };
16038
+ // If any of the configurations are invalid, we bail out of calling the adapter.
16039
+ if (coercedConfig.batchQuery.some((individualConfig) => individualConfig.query === undefined)) {
16040
+ callback(createInvalidConfigError());
16041
+ return () => { };
16042
+ }
16043
+ }
16044
+ else if ('query' in config) {
16045
+ const ast = astResolver(config.query);
16046
+ if (ast === undefined) {
16047
+ callback(createInvalidConfigError());
16048
+ return () => { };
16049
+ }
16050
+ coercedConfig = {
16051
+ ...config,
16052
+ query: ast,
16053
+ };
16018
16054
  }
16019
- const coercedConfig = {
16020
- ...config,
16021
- query: ast,
16022
- };
16023
16055
  const snapshotOrPromise = adapter(coercedConfig, requestContext);
16024
16056
  if (snapshotOrPromise === null) {
16025
16057
  subscriberCallback(createInvalidConfigError());
@@ -16087,7 +16119,7 @@
16087
16119
  const { apiFamily, name } = metadata;
16088
16120
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16089
16121
  }
16090
- // version: 1.112.0-725d7e6e3
16122
+ // version: 1.112.1-1a0875b1d
16091
16123
 
16092
16124
  /**
16093
16125
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16170,7 +16202,7 @@
16170
16202
  ({
16171
16203
  state: FragmentReadResultState.Missing,
16172
16204
  });
16173
- // engine version: 0.136.5-77eb3bb4
16205
+ // engine version: 0.137.1-cdbdc5cd
16174
16206
 
16175
16207
  const { keys: ObjectKeys$3, freeze: ObjectFreeze$3, create: ObjectCreate$3 } = Object;
16176
16208
 
@@ -44275,7 +44307,7 @@
44275
44307
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44276
44308
  });
44277
44309
  });
44278
- // version: 1.112.0-725d7e6e3
44310
+ // version: 1.112.1-1a0875b1d
44279
44311
 
44280
44312
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44281
44313
 
@@ -59669,7 +59701,7 @@
59669
59701
  id: '@salesforce/lds-network-adapter',
59670
59702
  instrument: instrument$1,
59671
59703
  });
59672
- // version: 1.112.0-725d7e6e3
59704
+ // version: 1.112.1-1a0875b1d
59673
59705
 
59674
59706
  const { create: create$2, keys: keys$2 } = Object;
59675
59707
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -77395,7 +77427,7 @@
77395
77427
  configuration: { ...configurationForGraphQLAdapters },
77396
77428
  instrument,
77397
77429
  });
77398
- // version: 1.112.0-725d7e6e3
77430
+ // version: 1.112.1-1a0875b1d
77399
77431
 
77400
77432
  // On core the unstable adapters are re-exported with different names,
77401
77433
 
@@ -79524,7 +79556,7 @@
79524
79556
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79525
79557
  graphQLImperative = ldsAdapter;
79526
79558
  });
79527
- // version: 1.112.0-725d7e6e3
79559
+ // version: 1.112.1-1a0875b1d
79528
79560
 
79529
79561
  var gqlApi = /*#__PURE__*/Object.freeze({
79530
79562
  __proto__: null,
@@ -80216,4 +80248,4 @@
80216
80248
  Object.defineProperty(exports, '__esModule', { value: true });
80217
80249
 
80218
80250
  }));
80219
- // version: 1.112.0-725d7e6e3
80251
+ // version: 1.112.1-1a0875b1d
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.112.0",
3
+ "version": "1.112.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/umd/lds-worker-api.js",
@@ -33,19 +33,19 @@
33
33
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-worker-api"
34
34
  },
35
35
  "devDependencies": {
36
- "@luvio/adapter-test-library": "0.136.5",
37
- "@luvio/engine": "0.136.5",
38
- "@luvio/environments": "0.136.5",
36
+ "@luvio/adapter-test-library": "0.137.1",
37
+ "@luvio/engine": "0.137.1",
38
+ "@luvio/environments": "0.137.1",
39
39
  "@oat-sa/rollup-plugin-wildcard-external": "^0.1.0",
40
- "@salesforce/lds-adapters-graphql": "^1.112.0",
41
- "@salesforce/lds-adapters-uiapi": "^1.112.0",
42
- "@salesforce/lds-default-luvio": "^1.112.0",
43
- "@salesforce/lds-drafts": "^1.112.0",
44
- "@salesforce/lds-graphql-parser": "^1.112.0",
45
- "@salesforce/lds-luvio-engine": "^1.112.0",
46
- "@salesforce/lds-priming": "^1.112.0",
47
- "@salesforce/lds-runtime-mobile": "^1.112.0",
48
- "@salesforce/nimbus-plugin-lds": "^1.112.0",
40
+ "@salesforce/lds-adapters-graphql": "^1.112.1",
41
+ "@salesforce/lds-adapters-uiapi": "^1.112.1",
42
+ "@salesforce/lds-default-luvio": "^1.112.1",
43
+ "@salesforce/lds-drafts": "^1.112.1",
44
+ "@salesforce/lds-graphql-parser": "^1.112.1",
45
+ "@salesforce/lds-luvio-engine": "^1.112.1",
46
+ "@salesforce/lds-priming": "^1.112.1",
47
+ "@salesforce/lds-runtime-mobile": "^1.112.1",
48
+ "@salesforce/nimbus-plugin-lds": "^1.112.1",
49
49
  "ajv": "^8.11.0",
50
50
  "glob": "^7.1.5",
51
51
  "nimbus-types": "^2.0.0-alpha1",