@salesforce/lds-runtime-mobile 1.100.2 → 1.100.3

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.
Files changed (3) hide show
  1. package/dist/main.js +16 -8
  2. package/package.json +15 -15
  3. package/sfdc/main.js +16 -8
package/dist/main.js CHANGED
@@ -10220,7 +10220,8 @@ const assignedToMeFragmentSelections = [
10220
10220
  },
10221
10221
  ];
10222
10222
  function removeSyntheticFields(result, query) {
10223
- const connectionSelection = query.definitions
10223
+ // It is possible that there are multiple record query.
10224
+ const connectionSelections = query.definitions
10224
10225
  .filter(isOperationDefinitionNode)
10225
10226
  .reduce((accu, definition) => {
10226
10227
  return accu.concat(definition.selectionSet.selections);
@@ -10231,10 +10232,12 @@ function removeSyntheticFields(result, query) {
10231
10232
  .filter(isFieldNode)
10232
10233
  .filter(nodeIsNamed('query'))
10233
10234
  .reduce(extractSelections, [])
10234
- .filter(isFieldNode)[0];
10235
+ .filter(isFieldNode);
10235
10236
  // queries that are not RecordQuery will be undefined here.
10236
- // we need to also check that connectionSelection is not undefined.
10237
- if (!connectionSelection || !connectionSelection.selectionSet) {
10237
+ // we need to also check that connectionSelections are not undefined. If any connectionSelection has no `selectionSet` defined, that is a malformed query.
10238
+ if (!connectionSelections ||
10239
+ connectionSelections.length === 0 ||
10240
+ connectionSelections.some((connection) => connection.selectionSet === undefined)) {
10238
10241
  return result;
10239
10242
  }
10240
10243
  const nodeJson = result.data.uiapi.query;
@@ -10243,10 +10246,15 @@ function removeSyntheticFields(result, query) {
10243
10246
  const output = { ...result };
10244
10247
  const outputApiParent = output.data.uiapi.query;
10245
10248
  const keys$1 = keys$3(nodeJson);
10246
- keys$1.forEach((apiName) => {
10249
+ keys$1.forEach((recordName) => {
10247
10250
  const outputApi = {};
10248
- createUserJsonOutput(connectionSelection, nodeJson[apiName], outputApi);
10249
- outputApiParent[apiName] = outputApi;
10251
+ // Each connectionSelection's maps its name or alias to one of returned records. The record name could be `apiName' or alias
10252
+ const targetConnection = connectionSelections.find((connection) => connection.name.value === recordName ||
10253
+ (connection.alias !== undefined && connection.alias.value === recordName));
10254
+ if (targetConnection !== undefined) {
10255
+ createUserJsonOutput(targetConnection, nodeJson[recordName], outputApi);
10256
+ outputApiParent[recordName] = outputApi;
10257
+ }
10250
10258
  });
10251
10259
  return output;
10252
10260
  }
@@ -15239,4 +15247,4 @@ register({
15239
15247
  });
15240
15248
 
15241
15249
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15242
- // version: 1.100.2-ca56bb821
15250
+ // version: 1.100.3-8176c84f6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.100.2",
3
+ "version": "1.100.3",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -32,10 +32,10 @@
32
32
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
33
33
  },
34
34
  "dependencies": {
35
- "@salesforce/lds-adapters-uiapi": "^1.100.2",
36
- "@salesforce/lds-bindings": "^1.100.2",
37
- "@salesforce/lds-instrumentation": "^1.100.2",
38
- "@salesforce/lds-priming": "^1.100.2",
35
+ "@salesforce/lds-adapters-uiapi": "^1.100.3",
36
+ "@salesforce/lds-bindings": "^1.100.3",
37
+ "@salesforce/lds-instrumentation": "^1.100.3",
38
+ "@salesforce/lds-priming": "^1.100.3",
39
39
  "@salesforce/user": "0.0.12",
40
40
  "o11y": "244.0.0"
41
41
  },
@@ -43,16 +43,16 @@
43
43
  "@luvio/engine": "0.135.4",
44
44
  "@luvio/environments": "0.135.4",
45
45
  "@luvio/graphql-parser": "0.135.4",
46
- "@salesforce/lds-adapters-graphql": "^1.100.2",
47
- "@salesforce/lds-drafts": "^1.100.2",
48
- "@salesforce/lds-drafts-adapters-uiapi": "^1.100.2",
49
- "@salesforce/lds-graphql-eval": "^1.100.2",
50
- "@salesforce/lds-network-adapter": "^1.100.2",
51
- "@salesforce/lds-network-nimbus": "^1.100.2",
52
- "@salesforce/lds-store-binary": "^1.100.2",
53
- "@salesforce/lds-store-sql": "^1.100.2",
54
- "@salesforce/lds-utils-adapters": "^1.100.2",
55
- "@salesforce/nimbus-plugin-lds": "^1.100.2",
46
+ "@salesforce/lds-adapters-graphql": "^1.100.3",
47
+ "@salesforce/lds-drafts": "^1.100.3",
48
+ "@salesforce/lds-drafts-adapters-uiapi": "^1.100.3",
49
+ "@salesforce/lds-graphql-eval": "^1.100.3",
50
+ "@salesforce/lds-network-adapter": "^1.100.3",
51
+ "@salesforce/lds-network-nimbus": "^1.100.3",
52
+ "@salesforce/lds-store-binary": "^1.100.3",
53
+ "@salesforce/lds-store-sql": "^1.100.3",
54
+ "@salesforce/lds-utils-adapters": "^1.100.3",
55
+ "@salesforce/nimbus-plugin-lds": "^1.100.3",
56
56
  "babel-plugin-dynamic-import-node": "^2.3.3",
57
57
  "wait-for-expect": "^3.0.2"
58
58
  },
package/sfdc/main.js CHANGED
@@ -10220,7 +10220,8 @@ const assignedToMeFragmentSelections = [
10220
10220
  },
10221
10221
  ];
10222
10222
  function removeSyntheticFields(result, query) {
10223
- const connectionSelection = query.definitions
10223
+ // It is possible that there are multiple record query.
10224
+ const connectionSelections = query.definitions
10224
10225
  .filter(isOperationDefinitionNode)
10225
10226
  .reduce((accu, definition) => {
10226
10227
  return accu.concat(definition.selectionSet.selections);
@@ -10231,10 +10232,12 @@ function removeSyntheticFields(result, query) {
10231
10232
  .filter(isFieldNode)
10232
10233
  .filter(nodeIsNamed('query'))
10233
10234
  .reduce(extractSelections, [])
10234
- .filter(isFieldNode)[0];
10235
+ .filter(isFieldNode);
10235
10236
  // queries that are not RecordQuery will be undefined here.
10236
- // we need to also check that connectionSelection is not undefined.
10237
- if (!connectionSelection || !connectionSelection.selectionSet) {
10237
+ // we need to also check that connectionSelections are not undefined. If any connectionSelection has no `selectionSet` defined, that is a malformed query.
10238
+ if (!connectionSelections ||
10239
+ connectionSelections.length === 0 ||
10240
+ connectionSelections.some((connection) => connection.selectionSet === undefined)) {
10238
10241
  return result;
10239
10242
  }
10240
10243
  const nodeJson = result.data.uiapi.query;
@@ -10243,10 +10246,15 @@ function removeSyntheticFields(result, query) {
10243
10246
  const output = { ...result };
10244
10247
  const outputApiParent = output.data.uiapi.query;
10245
10248
  const keys$1 = keys$3(nodeJson);
10246
- keys$1.forEach((apiName) => {
10249
+ keys$1.forEach((recordName) => {
10247
10250
  const outputApi = {};
10248
- createUserJsonOutput(connectionSelection, nodeJson[apiName], outputApi);
10249
- outputApiParent[apiName] = outputApi;
10251
+ // Each connectionSelection's maps its name or alias to one of returned records. The record name could be `apiName' or alias
10252
+ const targetConnection = connectionSelections.find((connection) => connection.name.value === recordName ||
10253
+ (connection.alias !== undefined && connection.alias.value === recordName));
10254
+ if (targetConnection !== undefined) {
10255
+ createUserJsonOutput(targetConnection, nodeJson[recordName], outputApi);
10256
+ outputApiParent[recordName] = outputApi;
10257
+ }
10250
10258
  });
10251
10259
  return output;
10252
10260
  }
@@ -15239,4 +15247,4 @@ register({
15239
15247
  });
15240
15248
 
15241
15249
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15242
- // version: 1.100.2-ca56bb821
15250
+ // version: 1.100.3-8176c84f6