@salesforce/lds-worker-api 1.310.0 → 1.311.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.
@@ -1071,4 +1071,4 @@ if (process.env.NODE_ENV !== 'production') {
1071
1071
  }
1072
1072
 
1073
1073
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1074
- // version: 1.310.0-6f61f12f95
1074
+ // version: 1.311.0-167623b638
@@ -4265,7 +4265,7 @@ function withDefaultLuvio(callback) {
4265
4265
  }
4266
4266
  callbacks.push(callback);
4267
4267
  }
4268
- // version: 1.310.0-6f61f12f95
4268
+ // version: 1.311.0-167623b638
4269
4269
 
4270
4270
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4271
4271
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15764,7 +15764,7 @@ function gql(literals, ...subs) {
15764
15764
  }
15765
15765
  return superResult;
15766
15766
  }
15767
- // version: 1.310.0-6f61f12f95
15767
+ // version: 1.311.0-167623b638
15768
15768
 
15769
15769
  function unwrap(data) {
15770
15770
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16693,7 +16693,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16693
16693
  const { apiFamily, name } = metadata;
16694
16694
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16695
16695
  }
16696
- // version: 1.310.0-6f61f12f95
16696
+ // version: 1.311.0-167623b638
16697
16697
 
16698
16698
  /**
16699
16699
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44800,7 +44800,7 @@ withDefaultLuvio((luvio) => {
44800
44800
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44801
44801
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44802
44802
  });
44803
- // version: 1.310.0-51b4ab090c
44803
+ // version: 1.311.0-5f03b383b7
44804
44804
 
44805
44805
  var ldsIdempotencyWriteDisabled = {
44806
44806
  isOpen: function (e) {
@@ -55688,6 +55688,11 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
55688
55688
  let { alias, leftPath, operator, value, dataType, isCaseSensitive } = predicate;
55689
55689
  let binding = [];
55690
55690
  let boundValue = extractPredicateValue(value, dataType);
55691
+ // using != does not include null values
55692
+ // using IS NOT predicate will include null values as null also is not the value
55693
+ if (operator === '!=') {
55694
+ operator = 'IS NOT';
55695
+ }
55691
55696
  // Handles boolean type field
55692
55697
  if (dataType === 'Boolean') {
55693
55698
  if (boundValue === null) {
@@ -55703,13 +55708,8 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
55703
55708
  boundValue = 0;
55704
55709
  }
55705
55710
  }
55706
- if (boundValue === null) {
55707
- if (operator === '=') {
55708
- operator = 'IS';
55709
- }
55710
- else if (operator === '!=') {
55711
- operator = 'IS NOT';
55712
- }
55711
+ if (boundValue === null && operator === '=') {
55712
+ operator = 'IS';
55713
55713
  }
55714
55714
  alias = !alias ? defaultAlias : alias;
55715
55715
  let sql;
@@ -55861,7 +55861,13 @@ function extractPredicateValue(value, dataType) {
55861
55861
  return value;
55862
55862
  }
55863
55863
  if (typeof value !== 'object') {
55864
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
55864
+ // GraphQL server treats empty string value as null
55865
+ if (typeof value === 'string' && value.length === 0) {
55866
+ return null;
55867
+ }
55868
+ else if (typeof value === 'string' ||
55869
+ typeof value === 'number' ||
55870
+ typeof value === 'boolean') {
55865
55871
  return value;
55866
55872
  }
55867
55873
  else {
@@ -63031,7 +63037,11 @@ class PrimingSession extends EventEmitter {
63031
63037
  const unavailableTypes = apiNames.filter((x) => !objectInfoMap[x]);
63032
63038
  const availableTypes = apiNames.filter((x) => objectInfoMap[x]);
63033
63039
  const unavilableBatches = batches.filter((x) => unavailableTypes.includes(x.type));
63034
- const availableBatches = batches.filter((x) => !unavailableTypes.includes(x.type));
63040
+ const availableBatches = batches
63041
+ .filter((x) => !unavailableTypes.includes(x.type))
63042
+ .map((x) => {
63043
+ return { ...x, objectInfo: objectInfoMap[x.type] };
63044
+ });
63035
63045
  const unavailableIds = unavilableBatches.reduce((acc, x) => {
63036
63046
  acc.push(...x.ids);
63037
63047
  return acc;
@@ -63053,7 +63063,7 @@ const requiredFieldMap = {
63053
63063
  Id: 'Id',
63054
63064
  LastModifiedById: 'LastModifiedById { value }',
63055
63065
  LastModifiedDate: 'LastModifiedDate { value }',
63056
- RecordTypeId: 'RecordTypeId { value }',
63066
+ RecordTypeId: 'RecordTypeId(fallback: true) { value }',
63057
63067
  SystemModstamp: 'SystemModstamp { value }',
63058
63068
  WeakEtag: 'WeakEtag',
63059
63069
  };
@@ -63120,9 +63130,10 @@ class RecordLoaderGraphQL {
63120
63130
  missingIds: batchInput.ids,
63121
63131
  };
63122
63132
  }
63133
+ const objectInfo = batchInput.objectInfo;
63123
63134
  const seenRecords = new Set(batchInput.ids);
63124
63135
  const records = data.uiapi.query[batchInput.type].edges.map((edge) => {
63125
- const record = this.generateDurableRecordRepresentation(edge.node);
63136
+ const record = this.generateDurableRecordRepresentation(edge.node, objectInfo);
63126
63137
  seenRecords.delete(record.id);
63127
63138
  return record;
63128
63139
  });
@@ -63173,7 +63184,7 @@ class RecordLoaderGraphQL {
63173
63184
  }
63174
63185
  `;
63175
63186
  }
63176
- generateDurableRecordRepresentation(node) {
63187
+ generateDurableRecordRepresentation(node, objectInfo) {
63177
63188
  const standardRecordFields = new Set(Object.keys(requiredFieldMap).map((x) => `${requiredPrefix}${x}`));
63178
63189
  const id = node[`${requiredPrefix}Id`];
63179
63190
  const recordTypeId = node[`${requiredPrefix}RecordTypeId`].value;
@@ -63188,6 +63199,16 @@ class RecordLoaderGraphQL {
63188
63199
  }, {});
63189
63200
  fields['Id'] = { value: id, displayValue: null };
63190
63201
  fields['RecordTypeId'] = { value: recordTypeId, displayValue: null };
63202
+ let recordTypeInfo = null;
63203
+ if (recordTypeId !== null &&
63204
+ objectInfo.recordTypeInfos &&
63205
+ objectInfo.recordTypeInfos[recordTypeId]) {
63206
+ const appliedRecordTypeInfo = objectInfo.recordTypeInfos[recordTypeId];
63207
+ // ui-api only applies the record type if its not the default type, otherwise it sets it to null
63208
+ if (appliedRecordTypeInfo.defaultRecordTypeMapping === false) {
63209
+ recordTypeInfo = appliedRecordTypeInfo;
63210
+ }
63211
+ }
63191
63212
  return {
63192
63213
  apiName: node[`${requiredPrefix}ApiName`],
63193
63214
  childRelationships: {},
@@ -63202,7 +63223,7 @@ class RecordLoaderGraphQL {
63202
63223
  ? node[`${requiredPrefix}LastModifiedDate`].value
63203
63224
  : null,
63204
63225
  recordTypeId,
63205
- recordTypeInfo: null,
63226
+ recordTypeInfo: recordTypeInfo,
63206
63227
  systemModstamp: node[`${requiredPrefix}SystemModstamp`] &&
63207
63228
  node[`${requiredPrefix}SystemModstamp`].value
63208
63229
  ? node[`${requiredPrefix}SystemModstamp`].value
@@ -63940,7 +63961,7 @@ register$1({
63940
63961
  id: '@salesforce/lds-network-adapter',
63941
63962
  instrument: instrument$2,
63942
63963
  });
63943
- // version: 1.310.0-6f61f12f95
63964
+ // version: 1.311.0-167623b638
63944
63965
 
63945
63966
  const { create: create$3, keys: keys$3 } = Object;
63946
63967
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -83976,7 +83997,7 @@ register$1({
83976
83997
  configuration: { ...configurationForGraphQLAdapters$1 },
83977
83998
  instrument: instrument$1,
83978
83999
  });
83979
- // version: 1.310.0-51b4ab090c
84000
+ // version: 1.311.0-5f03b383b7
83980
84001
 
83981
84002
  // On core the unstable adapters are re-exported with different names,
83982
84003
  // we want to match them here.
@@ -86232,7 +86253,7 @@ withDefaultLuvio((luvio) => {
86232
86253
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
86233
86254
  graphQLImperative = ldsAdapter;
86234
86255
  });
86235
- // version: 1.310.0-51b4ab090c
86256
+ // version: 1.311.0-5f03b383b7
86236
86257
 
86237
86258
  var gqlApi = /*#__PURE__*/Object.freeze({
86238
86259
  __proto__: null,
@@ -86967,7 +86988,7 @@ const callbacks$1 = [];
86967
86988
  function register(r) {
86968
86989
  callbacks$1.forEach((callback) => callback(r));
86969
86990
  }
86970
- // version: 1.310.0-6f61f12f95
86991
+ // version: 1.311.0-167623b638
86971
86992
 
86972
86993
  /**
86973
86994
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -91929,4 +91950,4 @@ const { luvio } = getRuntime();
91929
91950
  setDefaultLuvio({ luvio });
91930
91951
 
91931
91952
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
91932
- // version: 1.310.0-6f61f12f95
91953
+ // version: 1.311.0-167623b638
@@ -4271,7 +4271,7 @@
4271
4271
  }
4272
4272
  callbacks.push(callback);
4273
4273
  }
4274
- // version: 1.310.0-6f61f12f95
4274
+ // version: 1.311.0-167623b638
4275
4275
 
4276
4276
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4277
4277
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15770,7 +15770,7 @@
15770
15770
  }
15771
15771
  return superResult;
15772
15772
  }
15773
- // version: 1.310.0-6f61f12f95
15773
+ // version: 1.311.0-167623b638
15774
15774
 
15775
15775
  function unwrap(data) {
15776
15776
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16699,7 +16699,7 @@
16699
16699
  const { apiFamily, name } = metadata;
16700
16700
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16701
16701
  }
16702
- // version: 1.310.0-6f61f12f95
16702
+ // version: 1.311.0-167623b638
16703
16703
 
16704
16704
  /**
16705
16705
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44806,7 +44806,7 @@
44806
44806
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44807
44807
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44808
44808
  });
44809
- // version: 1.310.0-51b4ab090c
44809
+ // version: 1.311.0-5f03b383b7
44810
44810
 
44811
44811
  var ldsIdempotencyWriteDisabled = {
44812
44812
  isOpen: function (e) {
@@ -55694,6 +55694,11 @@
55694
55694
  let { alias, leftPath, operator, value, dataType, isCaseSensitive } = predicate;
55695
55695
  let binding = [];
55696
55696
  let boundValue = extractPredicateValue(value, dataType);
55697
+ // using != does not include null values
55698
+ // using IS NOT predicate will include null values as null also is not the value
55699
+ if (operator === '!=') {
55700
+ operator = 'IS NOT';
55701
+ }
55697
55702
  // Handles boolean type field
55698
55703
  if (dataType === 'Boolean') {
55699
55704
  if (boundValue === null) {
@@ -55709,13 +55714,8 @@
55709
55714
  boundValue = 0;
55710
55715
  }
55711
55716
  }
55712
- if (boundValue === null) {
55713
- if (operator === '=') {
55714
- operator = 'IS';
55715
- }
55716
- else if (operator === '!=') {
55717
- operator = 'IS NOT';
55718
- }
55717
+ if (boundValue === null && operator === '=') {
55718
+ operator = 'IS';
55719
55719
  }
55720
55720
  alias = !alias ? defaultAlias : alias;
55721
55721
  let sql;
@@ -55867,7 +55867,13 @@
55867
55867
  return value;
55868
55868
  }
55869
55869
  if (typeof value !== 'object') {
55870
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
55870
+ // GraphQL server treats empty string value as null
55871
+ if (typeof value === 'string' && value.length === 0) {
55872
+ return null;
55873
+ }
55874
+ else if (typeof value === 'string' ||
55875
+ typeof value === 'number' ||
55876
+ typeof value === 'boolean') {
55871
55877
  return value;
55872
55878
  }
55873
55879
  else {
@@ -63037,7 +63043,11 @@
63037
63043
  const unavailableTypes = apiNames.filter((x) => !objectInfoMap[x]);
63038
63044
  const availableTypes = apiNames.filter((x) => objectInfoMap[x]);
63039
63045
  const unavilableBatches = batches.filter((x) => unavailableTypes.includes(x.type));
63040
- const availableBatches = batches.filter((x) => !unavailableTypes.includes(x.type));
63046
+ const availableBatches = batches
63047
+ .filter((x) => !unavailableTypes.includes(x.type))
63048
+ .map((x) => {
63049
+ return { ...x, objectInfo: objectInfoMap[x.type] };
63050
+ });
63041
63051
  const unavailableIds = unavilableBatches.reduce((acc, x) => {
63042
63052
  acc.push(...x.ids);
63043
63053
  return acc;
@@ -63059,7 +63069,7 @@
63059
63069
  Id: 'Id',
63060
63070
  LastModifiedById: 'LastModifiedById { value }',
63061
63071
  LastModifiedDate: 'LastModifiedDate { value }',
63062
- RecordTypeId: 'RecordTypeId { value }',
63072
+ RecordTypeId: 'RecordTypeId(fallback: true) { value }',
63063
63073
  SystemModstamp: 'SystemModstamp { value }',
63064
63074
  WeakEtag: 'WeakEtag',
63065
63075
  };
@@ -63126,9 +63136,10 @@
63126
63136
  missingIds: batchInput.ids,
63127
63137
  };
63128
63138
  }
63139
+ const objectInfo = batchInput.objectInfo;
63129
63140
  const seenRecords = new Set(batchInput.ids);
63130
63141
  const records = data.uiapi.query[batchInput.type].edges.map((edge) => {
63131
- const record = this.generateDurableRecordRepresentation(edge.node);
63142
+ const record = this.generateDurableRecordRepresentation(edge.node, objectInfo);
63132
63143
  seenRecords.delete(record.id);
63133
63144
  return record;
63134
63145
  });
@@ -63179,7 +63190,7 @@
63179
63190
  }
63180
63191
  `;
63181
63192
  }
63182
- generateDurableRecordRepresentation(node) {
63193
+ generateDurableRecordRepresentation(node, objectInfo) {
63183
63194
  const standardRecordFields = new Set(Object.keys(requiredFieldMap).map((x) => `${requiredPrefix}${x}`));
63184
63195
  const id = node[`${requiredPrefix}Id`];
63185
63196
  const recordTypeId = node[`${requiredPrefix}RecordTypeId`].value;
@@ -63194,6 +63205,16 @@
63194
63205
  }, {});
63195
63206
  fields['Id'] = { value: id, displayValue: null };
63196
63207
  fields['RecordTypeId'] = { value: recordTypeId, displayValue: null };
63208
+ let recordTypeInfo = null;
63209
+ if (recordTypeId !== null &&
63210
+ objectInfo.recordTypeInfos &&
63211
+ objectInfo.recordTypeInfos[recordTypeId]) {
63212
+ const appliedRecordTypeInfo = objectInfo.recordTypeInfos[recordTypeId];
63213
+ // ui-api only applies the record type if its not the default type, otherwise it sets it to null
63214
+ if (appliedRecordTypeInfo.defaultRecordTypeMapping === false) {
63215
+ recordTypeInfo = appliedRecordTypeInfo;
63216
+ }
63217
+ }
63197
63218
  return {
63198
63219
  apiName: node[`${requiredPrefix}ApiName`],
63199
63220
  childRelationships: {},
@@ -63208,7 +63229,7 @@
63208
63229
  ? node[`${requiredPrefix}LastModifiedDate`].value
63209
63230
  : null,
63210
63231
  recordTypeId,
63211
- recordTypeInfo: null,
63232
+ recordTypeInfo: recordTypeInfo,
63212
63233
  systemModstamp: node[`${requiredPrefix}SystemModstamp`] &&
63213
63234
  node[`${requiredPrefix}SystemModstamp`].value
63214
63235
  ? node[`${requiredPrefix}SystemModstamp`].value
@@ -63946,7 +63967,7 @@
63946
63967
  id: '@salesforce/lds-network-adapter',
63947
63968
  instrument: instrument$2,
63948
63969
  });
63949
- // version: 1.310.0-6f61f12f95
63970
+ // version: 1.311.0-167623b638
63950
63971
 
63951
63972
  const { create: create$3, keys: keys$3 } = Object;
63952
63973
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -83982,7 +84003,7 @@
83982
84003
  configuration: { ...configurationForGraphQLAdapters$1 },
83983
84004
  instrument: instrument$1,
83984
84005
  });
83985
- // version: 1.310.0-51b4ab090c
84006
+ // version: 1.311.0-5f03b383b7
83986
84007
 
83987
84008
  // On core the unstable adapters are re-exported with different names,
83988
84009
  // we want to match them here.
@@ -86238,7 +86259,7 @@
86238
86259
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
86239
86260
  graphQLImperative = ldsAdapter;
86240
86261
  });
86241
- // version: 1.310.0-51b4ab090c
86262
+ // version: 1.311.0-5f03b383b7
86242
86263
 
86243
86264
  var gqlApi = /*#__PURE__*/Object.freeze({
86244
86265
  __proto__: null,
@@ -86973,7 +86994,7 @@
86973
86994
  function register(r) {
86974
86995
  callbacks$1.forEach((callback) => callback(r));
86975
86996
  }
86976
- // version: 1.310.0-6f61f12f95
86997
+ // version: 1.311.0-167623b638
86977
86998
 
86978
86999
  /**
86979
87000
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -91954,4 +91975,4 @@
91954
91975
  exports.subscribeToAdapter = subscribeToAdapter;
91955
91976
 
91956
91977
  }));
91957
- // version: 1.310.0-6f61f12f95
91978
+ // version: 1.311.0-167623b638
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.310.0",
3
+ "version": "1.311.0",
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.310.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.310.0",
40
- "@salesforce/lds-default-luvio": "^1.310.0",
41
- "@salesforce/lds-drafts": "^1.310.0",
42
- "@salesforce/lds-graphql-parser": "^1.310.0",
43
- "@salesforce/lds-luvio-engine": "^1.310.0",
44
- "@salesforce/lds-priming": "^1.310.0",
45
- "@salesforce/lds-runtime-mobile": "^1.310.0",
46
- "@salesforce/nimbus-plugin-lds": "^1.310.0",
38
+ "@salesforce/lds-adapters-graphql": "^1.311.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.311.0",
40
+ "@salesforce/lds-default-luvio": "^1.311.0",
41
+ "@salesforce/lds-drafts": "^1.311.0",
42
+ "@salesforce/lds-graphql-parser": "^1.311.0",
43
+ "@salesforce/lds-luvio-engine": "^1.311.0",
44
+ "@salesforce/lds-priming": "^1.311.0",
45
+ "@salesforce/lds-runtime-mobile": "^1.311.0",
46
+ "@salesforce/nimbus-plugin-lds": "^1.311.0",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",