@salesforce/lds-worker-api 1.131.0-dev12 → 1.131.0-dev13

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.
@@ -758,4 +758,4 @@ if (process.env.NODE_ENV !== 'production') {
758
758
  }
759
759
 
760
760
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
761
- // version: 1.131.0-dev12-f6948e56d
761
+ // version: 1.131.0-dev13-329f91e5c
@@ -3780,7 +3780,7 @@ function withDefaultLuvio(callback) {
3780
3780
  }
3781
3781
  callbacks.push(callback);
3782
3782
  }
3783
- // version: 1.131.0-dev12-f6948e56d
3783
+ // version: 1.131.0-dev13-329f91e5c
3784
3784
 
3785
3785
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3786
3786
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15213,7 +15213,7 @@ function parseAndVisit(source) {
15213
15213
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15214
15214
  return luvioDocumentNode;
15215
15215
  }
15216
- // version: 1.131.0-dev12-f6948e56d
15216
+ // version: 1.131.0-dev13-329f91e5c
15217
15217
 
15218
15218
  function unwrap(data) {
15219
15219
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16126,7 +16126,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16126
16126
  const { apiFamily, name } = metadata;
16127
16127
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16128
16128
  }
16129
- // version: 1.131.0-dev12-f6948e56d
16129
+ // version: 1.131.0-dev13-329f91e5c
16130
16130
 
16131
16131
  /**
16132
16132
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -20004,7 +20004,7 @@ function fulfill(existing, incoming) {
20004
20004
  const batchRequestWithSingleRequest = isSingleBatchRecordRequest(existingUrlParams) &&
20005
20005
  isSingleRecordRequest(urlParams) &&
20006
20006
  incomingUrlRecords[0] === existingUrlRecords[0];
20007
- if (!batchRequestWithSingleRequest) {
20007
+ if (!batchRequestWithSingleRequest || isRestrictedPathCondition(existingPath, path)) {
20008
20008
  return false;
20009
20009
  }
20010
20010
  }
@@ -20047,6 +20047,12 @@ function isSingleBatchRecordRequest(urlParams) {
20047
20047
  function isSingleRecordRequest(urlParams) {
20048
20048
  return hasOwnProperty$1.call(urlParams, 'recordId');
20049
20049
  }
20050
+ function isRestrictedPathCondition(existingPath, path) {
20051
+ // should not dedupe getRecordUi and getRecord as both of their representation is different
20052
+ // records call cannot digest response of getRecordUi
20053
+ return ((existingPath.includes('/record-ui') && path.includes('/records')) ||
20054
+ (existingPath.includes('/records') && path.includes('/record-ui')));
20055
+ }
20050
20056
 
20051
20057
  const createResourceRequest$10 = function getUiApiRecordsByRecordIdCreateResourceRequest(config) {
20052
20058
  return {
@@ -44472,7 +44478,7 @@ withDefaultLuvio((luvio) => {
44472
44478
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44473
44479
  });
44474
44480
  });
44475
- // version: 1.131.0-dev12-53a795775
44481
+ // version: 1.131.0-dev13-a38ed0c06
44476
44482
 
44477
44483
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44478
44484
 
@@ -53704,26 +53710,20 @@ function generateRecordQueries(objectInfos) {
53704
53710
  let recordConnections = ``;
53705
53711
  const polymorphicFieldTypeNames = new Set();
53706
53712
  let typedScalars = new Set();
53713
+ let parentRelationshipFields = new Set();
53707
53714
  for (const objectInfo of values(objectInfos)) {
53708
53715
  const { apiName, childRelationships } = objectInfo;
53709
53716
  let fields = ``;
53710
53717
  typedScalars.add(`${apiName}_Filter`);
53711
53718
  typedScalars.add(`${apiName}_OrderBy`);
53712
- for (const childRelationship of childRelationships) {
53713
- const { childObjectApiName } = childRelationship;
53714
- // Only add the relationship if there is relevant objectinfos for it,
53715
- // otherwise we'd be defining types we cannot satisfy and aren't referenced in
53716
- // the query.
53717
- if (objectInfos[childObjectApiName] !== undefined) {
53718
- fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
53719
- typedScalars.add(`${childObjectApiName}_Filter`);
53720
- typedScalars.add(`${childObjectApiName}_OrderBy`);
53721
- }
53722
- }
53723
53719
  for (const field of values(objectInfo.fields)) {
53724
53720
  if (!fieldsStaticallyAdded.includes(field.apiName)) {
53725
53721
  fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
53726
53722
  }
53723
+ //handles parent relationship
53724
+ if (field.relationshipName === null) {
53725
+ continue;
53726
+ }
53727
53727
  // For spanning parent relationships with no union types
53728
53728
  if (field.referenceToInfos.length === 1) {
53729
53729
  const [relation] = field.referenceToInfos;
@@ -53731,11 +53731,13 @@ function generateRecordQueries(objectInfos) {
53731
53731
  // otherwise we'd be defining types we cannot satisfy and aren't referenced in
53732
53732
  // the query.
53733
53733
  if (objectInfos[relation.apiName] !== undefined) {
53734
+ parentRelationshipFields.add(field.relationshipName);
53734
53735
  fields += `${field.relationshipName}: ${relation.apiName}\n`;
53735
53736
  }
53736
53737
  // For polymorphic field, its type is 'Record' inteface. The concrete entity type name is saved for field resolving of next phase
53737
53738
  }
53738
53739
  else if (field.referenceToInfos.length > 1) {
53740
+ parentRelationshipFields.add(field.relationshipName);
53739
53741
  fields += `${field.relationshipName}: Record\n`;
53740
53742
  for (const relation of field.referenceToInfos) {
53741
53743
  if (objectInfos[relation.apiName] !== undefined) {
@@ -53744,6 +53746,20 @@ function generateRecordQueries(objectInfos) {
53744
53746
  }
53745
53747
  }
53746
53748
  }
53749
+ // handles child relationship
53750
+ for (const childRelationship of childRelationships) {
53751
+ const { childObjectApiName } = childRelationship;
53752
+ // Only add the relationship if there is relevant objectinfos for it,
53753
+ // otherwise we'd be defining types we cannot satisfy and aren't referenced in
53754
+ // the query.
53755
+ // If one field has both parent relationship and child relationship with the same name, the child relationship is ignored. This is how the server GQL has implemented as date of 08/07/2023
53756
+ if (objectInfos[childObjectApiName] !== undefined &&
53757
+ !parentRelationshipFields.has(childRelationship.relationshipName)) {
53758
+ fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
53759
+ typedScalars.add(`${childObjectApiName}_Filter`);
53760
+ typedScalars.add(`${childObjectApiName}_OrderBy`);
53761
+ }
53762
+ }
53747
53763
  recordQueries += `${apiName}(first: Int, where: ${apiName}_Filter, orderBy: ${apiName}_OrderBy, scope: SupportedScopes): ${apiName}Connection\n`;
53748
53764
  const isServiceAppointment = apiName === 'ServiceAppointment';
53749
53765
  recordConnections += /* GraphQL */ `
@@ -60588,7 +60604,7 @@ register({
60588
60604
  id: '@salesforce/lds-network-adapter',
60589
60605
  instrument: instrument$1,
60590
60606
  });
60591
- // version: 1.131.0-dev12-f6948e56d
60607
+ // version: 1.131.0-dev13-329f91e5c
60592
60608
 
60593
60609
  const { create: create$2, keys: keys$2 } = Object;
60594
60610
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -74896,7 +74912,7 @@ register({
74896
74912
  configuration: { ...configurationForGraphQLAdapters },
74897
74913
  instrument,
74898
74914
  });
74899
- // version: 1.131.0-dev12-53a795775
74915
+ // version: 1.131.0-dev13-a38ed0c06
74900
74916
 
74901
74917
  // On core the unstable adapters are re-exported with different names,
74902
74918
 
@@ -77152,7 +77168,7 @@ withDefaultLuvio((luvio) => {
77152
77168
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
77153
77169
  graphQLImperative = ldsAdapter;
77154
77170
  });
77155
- // version: 1.131.0-dev12-53a795775
77171
+ // version: 1.131.0-dev13-a38ed0c06
77156
77172
 
77157
77173
  var gqlApi = /*#__PURE__*/Object.freeze({
77158
77174
  __proto__: null,
@@ -77841,4 +77857,4 @@ const { luvio } = getRuntime();
77841
77857
  setDefaultLuvio({ luvio });
77842
77858
 
77843
77859
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
77844
- // version: 1.131.0-dev12-f6948e56d
77860
+ // version: 1.131.0-dev13-329f91e5c
@@ -3786,7 +3786,7 @@
3786
3786
  }
3787
3787
  callbacks.push(callback);
3788
3788
  }
3789
- // version: 1.131.0-dev12-f6948e56d
3789
+ // version: 1.131.0-dev13-329f91e5c
3790
3790
 
3791
3791
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3792
3792
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15219,7 +15219,7 @@
15219
15219
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15220
15220
  return luvioDocumentNode;
15221
15221
  }
15222
- // version: 1.131.0-dev12-f6948e56d
15222
+ // version: 1.131.0-dev13-329f91e5c
15223
15223
 
15224
15224
  function unwrap(data) {
15225
15225
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16132,7 +16132,7 @@
16132
16132
  const { apiFamily, name } = metadata;
16133
16133
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16134
16134
  }
16135
- // version: 1.131.0-dev12-f6948e56d
16135
+ // version: 1.131.0-dev13-329f91e5c
16136
16136
 
16137
16137
  /**
16138
16138
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -20010,7 +20010,7 @@
20010
20010
  const batchRequestWithSingleRequest = isSingleBatchRecordRequest(existingUrlParams) &&
20011
20011
  isSingleRecordRequest(urlParams) &&
20012
20012
  incomingUrlRecords[0] === existingUrlRecords[0];
20013
- if (!batchRequestWithSingleRequest) {
20013
+ if (!batchRequestWithSingleRequest || isRestrictedPathCondition(existingPath, path)) {
20014
20014
  return false;
20015
20015
  }
20016
20016
  }
@@ -20053,6 +20053,12 @@
20053
20053
  function isSingleRecordRequest(urlParams) {
20054
20054
  return hasOwnProperty$1.call(urlParams, 'recordId');
20055
20055
  }
20056
+ function isRestrictedPathCondition(existingPath, path) {
20057
+ // should not dedupe getRecordUi and getRecord as both of their representation is different
20058
+ // records call cannot digest response of getRecordUi
20059
+ return ((existingPath.includes('/record-ui') && path.includes('/records')) ||
20060
+ (existingPath.includes('/records') && path.includes('/record-ui')));
20061
+ }
20056
20062
 
20057
20063
  const createResourceRequest$10 = function getUiApiRecordsByRecordIdCreateResourceRequest(config) {
20058
20064
  return {
@@ -44478,7 +44484,7 @@
44478
44484
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44479
44485
  });
44480
44486
  });
44481
- // version: 1.131.0-dev12-53a795775
44487
+ // version: 1.131.0-dev13-a38ed0c06
44482
44488
 
44483
44489
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44484
44490
 
@@ -53710,26 +53716,20 @@
53710
53716
  let recordConnections = ``;
53711
53717
  const polymorphicFieldTypeNames = new Set();
53712
53718
  let typedScalars = new Set();
53719
+ let parentRelationshipFields = new Set();
53713
53720
  for (const objectInfo of values(objectInfos)) {
53714
53721
  const { apiName, childRelationships } = objectInfo;
53715
53722
  let fields = ``;
53716
53723
  typedScalars.add(`${apiName}_Filter`);
53717
53724
  typedScalars.add(`${apiName}_OrderBy`);
53718
- for (const childRelationship of childRelationships) {
53719
- const { childObjectApiName } = childRelationship;
53720
- // Only add the relationship if there is relevant objectinfos for it,
53721
- // otherwise we'd be defining types we cannot satisfy and aren't referenced in
53722
- // the query.
53723
- if (objectInfos[childObjectApiName] !== undefined) {
53724
- fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
53725
- typedScalars.add(`${childObjectApiName}_Filter`);
53726
- typedScalars.add(`${childObjectApiName}_OrderBy`);
53727
- }
53728
- }
53729
53725
  for (const field of values(objectInfo.fields)) {
53730
53726
  if (!fieldsStaticallyAdded.includes(field.apiName)) {
53731
53727
  fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
53732
53728
  }
53729
+ //handles parent relationship
53730
+ if (field.relationshipName === null) {
53731
+ continue;
53732
+ }
53733
53733
  // For spanning parent relationships with no union types
53734
53734
  if (field.referenceToInfos.length === 1) {
53735
53735
  const [relation] = field.referenceToInfos;
@@ -53737,11 +53737,13 @@
53737
53737
  // otherwise we'd be defining types we cannot satisfy and aren't referenced in
53738
53738
  // the query.
53739
53739
  if (objectInfos[relation.apiName] !== undefined) {
53740
+ parentRelationshipFields.add(field.relationshipName);
53740
53741
  fields += `${field.relationshipName}: ${relation.apiName}\n`;
53741
53742
  }
53742
53743
  // For polymorphic field, its type is 'Record' inteface. The concrete entity type name is saved for field resolving of next phase
53743
53744
  }
53744
53745
  else if (field.referenceToInfos.length > 1) {
53746
+ parentRelationshipFields.add(field.relationshipName);
53745
53747
  fields += `${field.relationshipName}: Record\n`;
53746
53748
  for (const relation of field.referenceToInfos) {
53747
53749
  if (objectInfos[relation.apiName] !== undefined) {
@@ -53750,6 +53752,20 @@
53750
53752
  }
53751
53753
  }
53752
53754
  }
53755
+ // handles child relationship
53756
+ for (const childRelationship of childRelationships) {
53757
+ const { childObjectApiName } = childRelationship;
53758
+ // Only add the relationship if there is relevant objectinfos for it,
53759
+ // otherwise we'd be defining types we cannot satisfy and aren't referenced in
53760
+ // the query.
53761
+ // If one field has both parent relationship and child relationship with the same name, the child relationship is ignored. This is how the server GQL has implemented as date of 08/07/2023
53762
+ if (objectInfos[childObjectApiName] !== undefined &&
53763
+ !parentRelationshipFields.has(childRelationship.relationshipName)) {
53764
+ fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
53765
+ typedScalars.add(`${childObjectApiName}_Filter`);
53766
+ typedScalars.add(`${childObjectApiName}_OrderBy`);
53767
+ }
53768
+ }
53753
53769
  recordQueries += `${apiName}(first: Int, where: ${apiName}_Filter, orderBy: ${apiName}_OrderBy, scope: SupportedScopes): ${apiName}Connection\n`;
53754
53770
  const isServiceAppointment = apiName === 'ServiceAppointment';
53755
53771
  recordConnections += /* GraphQL */ `
@@ -60594,7 +60610,7 @@
60594
60610
  id: '@salesforce/lds-network-adapter',
60595
60611
  instrument: instrument$1,
60596
60612
  });
60597
- // version: 1.131.0-dev12-f6948e56d
60613
+ // version: 1.131.0-dev13-329f91e5c
60598
60614
 
60599
60615
  const { create: create$2, keys: keys$2 } = Object;
60600
60616
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -74902,7 +74918,7 @@
74902
74918
  configuration: { ...configurationForGraphQLAdapters },
74903
74919
  instrument,
74904
74920
  });
74905
- // version: 1.131.0-dev12-53a795775
74921
+ // version: 1.131.0-dev13-a38ed0c06
74906
74922
 
74907
74923
  // On core the unstable adapters are re-exported with different names,
74908
74924
 
@@ -77158,7 +77174,7 @@
77158
77174
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
77159
77175
  graphQLImperative = ldsAdapter;
77160
77176
  });
77161
- // version: 1.131.0-dev12-53a795775
77177
+ // version: 1.131.0-dev13-a38ed0c06
77162
77178
 
77163
77179
  var gqlApi = /*#__PURE__*/Object.freeze({
77164
77180
  __proto__: null,
@@ -77864,4 +77880,4 @@
77864
77880
  Object.defineProperty(exports, '__esModule', { value: true });
77865
77881
 
77866
77882
  }));
77867
- // version: 1.131.0-dev12-f6948e56d
77883
+ // version: 1.131.0-dev13-329f91e5c
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.131.0-dev12",
3
+ "version": "1.131.0-dev13",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -34,15 +34,15 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@oat-sa/rollup-plugin-wildcard-external": "^0.1.0",
37
- "@salesforce/lds-adapters-graphql": "1.131.0-dev12",
38
- "@salesforce/lds-adapters-uiapi": "1.131.0-dev12",
39
- "@salesforce/lds-default-luvio": "1.131.0-dev12",
40
- "@salesforce/lds-drafts": "1.131.0-dev12",
41
- "@salesforce/lds-graphql-parser": "1.131.0-dev12",
42
- "@salesforce/lds-luvio-engine": "1.131.0-dev12",
43
- "@salesforce/lds-priming": "1.131.0-dev12",
44
- "@salesforce/lds-runtime-mobile": "1.131.0-dev12",
45
- "@salesforce/nimbus-plugin-lds": "1.131.0-dev12",
37
+ "@salesforce/lds-adapters-graphql": "1.131.0-dev13",
38
+ "@salesforce/lds-adapters-uiapi": "1.131.0-dev13",
39
+ "@salesforce/lds-default-luvio": "1.131.0-dev13",
40
+ "@salesforce/lds-drafts": "1.131.0-dev13",
41
+ "@salesforce/lds-graphql-parser": "1.131.0-dev13",
42
+ "@salesforce/lds-luvio-engine": "1.131.0-dev13",
43
+ "@salesforce/lds-priming": "1.131.0-dev13",
44
+ "@salesforce/lds-runtime-mobile": "1.131.0-dev13",
45
+ "@salesforce/nimbus-plugin-lds": "1.131.0-dev13",
46
46
  "ajv": "^8.11.0",
47
47
  "glob": "^7.1.5",
48
48
  "nimbus-types": "^2.0.0-alpha1",