@salesforce/lds-runtime-webruntime 1.379.1 → 1.380.0-dev2

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.
@@ -3280,7 +3280,7 @@ function buildGraphQLInputExtension(input) {
3280
3280
  };
3281
3281
  return prev;
3282
3282
  }, {})) || {};
3283
- const fragments = input.query.definitions.filter((def) => def.kind === "FragmentDefinition").reduce((prev, fragment) => {
3283
+ const fragments = input.query.definitions.filter(isFragmentDefinition).reduce((prev, fragment) => {
3284
3284
  prev[fragment.name.value] = fragment;
3285
3285
  return prev;
3286
3286
  }, {});
@@ -3290,6 +3290,47 @@ function buildGraphQLInputExtension(input) {
3290
3290
  parentFieldSelection: void 0
3291
3291
  });
3292
3292
  }
3293
+ const TYPENAME_FIELD = {
3294
+ kind: Kind.FIELD,
3295
+ name: {
3296
+ kind: Kind.NAME,
3297
+ value: "__typename"
3298
+ }
3299
+ };
3300
+ function addTypenameToDocument(doc) {
3301
+ return visit(doc, {
3302
+ SelectionSet: {
3303
+ enter(node, _key, parent) {
3304
+ if (isOperationDefinition(parent)) {
3305
+ return;
3306
+ }
3307
+ const { selections } = node;
3308
+ if (!selections || selections.length === 0) {
3309
+ return;
3310
+ }
3311
+ const skip = selections.some((selection) => {
3312
+ return isField(selection) && (selection.name.value === "__typename" || selection.name.value.lastIndexOf("__", 0) === 0);
3313
+ });
3314
+ if (skip) {
3315
+ return;
3316
+ }
3317
+ return {
3318
+ ...node,
3319
+ selections: [...selections, TYPENAME_FIELD]
3320
+ };
3321
+ }
3322
+ }
3323
+ });
3324
+ }
3325
+ function isOperationDefinition(parent) {
3326
+ return !!parent && !Array.isArray(parent) && parent.kind === Kind.OPERATION_DEFINITION;
3327
+ }
3328
+ function isField(node) {
3329
+ return node.kind === Kind.FIELD;
3330
+ }
3331
+ function isFragmentDefinition(node) {
3332
+ return node.kind === Kind.FRAGMENT_DEFINITION;
3333
+ }
3293
3334
 
3294
3335
  /*!
3295
3336
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3413,7 +3454,7 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
3413
3454
  if (augmentedQueryResult.isErr()) {
3414
3455
  throw augmentedQueryResult.error;
3415
3456
  }
3416
- return augmentedQueryResult.value;
3457
+ return addTypenameToDocument(augmentedQueryResult.value);
3417
3458
  }
3418
3459
  buildWriteInput(data) {
3419
3460
  const extensionResult = buildGraphQLInputExtension({
@@ -3507,7 +3548,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
3507
3548
  if (augmentedQueryResult.isErr()) {
3508
3549
  throw augmentedQueryResult.error;
3509
3550
  }
3510
- return augmentedQueryResult.value;
3551
+ return addTypenameToDocument(augmentedQueryResult.value);
3511
3552
  }
3512
3553
  buildWriteInput(data) {
3513
3554
  const extensionResult = buildGraphQLInputExtension({
@@ -3665,7 +3706,7 @@ function buildServiceDescriptor$2(luvio) {
3665
3706
  },
3666
3707
  };
3667
3708
  }
3668
- // version: 1.379.1-7ea94edc38
3709
+ // version: 1.380.0-dev2-fd70e1c449
3669
3710
 
3670
3711
  /**
3671
3712
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3691,7 +3732,7 @@ function buildServiceDescriptor$1(notifyRecordUpdateAvailable, getNormalizedLuvi
3691
3732
  },
3692
3733
  };
3693
3734
  }
3694
- // version: 1.379.1-7ea94edc38
3735
+ // version: 1.380.0-dev2-fd70e1c449
3695
3736
 
3696
3737
  /*!
3697
3738
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4311,4 +4352,4 @@ const services = [
4311
4352
  buildServiceDescriptor$1({}, {}),
4312
4353
  ];
4313
4354
  setServices(services);
4314
- // version: 1.379.1-5350e195b2
4355
+ // version: 1.380.0-dev2-40594334e8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-webruntime",
3
- "version": "1.379.1",
3
+ "version": "1.380.0-dev2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Webruntime runtime",
6
6
  "main": "dist/ldsWebruntimeOneStoreInit.js",
@@ -35,35 +35,35 @@
35
35
  "ready": "yarn build && jest --collectCoverage && yarn test:size && yarn release:corejar"
36
36
  },
37
37
  "devDependencies": {
38
- "@luvio/service-provisioner": "5.57.2",
39
- "@luvio/tools-core": "5.57.2",
38
+ "@luvio/service-provisioner": "5.58.2",
39
+ "@luvio/tools-core": "5.58.2",
40
40
  "jwt-encode": "1.0.1"
41
41
  },
42
42
  "dependencies": {
43
- "@luvio/command-aura-network": "5.57.2",
44
- "@luvio/command-aura-normalized-cache-control": "5.57.2",
45
- "@luvio/command-aura-resource-cache-control": "5.57.2",
46
- "@luvio/command-fetch-network": "5.57.2",
47
- "@luvio/command-http-normalized-cache-control": "5.57.2",
48
- "@luvio/command-ndjson": "5.57.2",
49
- "@luvio/command-network": "5.57.2",
50
- "@luvio/command-sse": "5.57.2",
51
- "@luvio/command-streaming": "5.57.2",
52
- "@luvio/jwt-manager": "5.57.2",
43
+ "@luvio/command-aura-network": "5.58.2",
44
+ "@luvio/command-aura-normalized-cache-control": "5.58.2",
45
+ "@luvio/command-aura-resource-cache-control": "5.58.2",
46
+ "@luvio/command-fetch-network": "5.58.2",
47
+ "@luvio/command-http-normalized-cache-control": "5.58.2",
48
+ "@luvio/command-ndjson": "5.58.2",
49
+ "@luvio/command-network": "5.58.2",
50
+ "@luvio/command-sse": "5.58.2",
51
+ "@luvio/command-streaming": "5.58.2",
52
+ "@luvio/jwt-manager": "5.58.2",
53
53
  "@luvio/network-adapter-composable": "0.158.7",
54
54
  "@luvio/network-adapter-fetch": "0.158.7",
55
- "@luvio/service-aura-network": "5.57.2",
56
- "@luvio/service-cache": "5.57.2",
57
- "@luvio/service-cache-control": "5.57.2",
58
- "@luvio/service-cache-inclusion-policy": "5.57.2",
59
- "@luvio/service-fetch-network": "5.57.2",
60
- "@luvio/service-instrument-command": "5.57.2",
61
- "@luvio/service-pubsub": "5.57.2",
62
- "@luvio/service-store": "5.57.2",
63
- "@luvio/utils": "5.57.2",
64
- "@salesforce/lds-adapters-uiapi-lex": "^1.379.1",
65
- "@salesforce/lds-luvio-service": "^1.379.1",
66
- "@salesforce/lds-luvio-uiapi-records-service": "^1.379.1"
55
+ "@luvio/service-aura-network": "5.58.2",
56
+ "@luvio/service-cache": "5.58.2",
57
+ "@luvio/service-cache-control": "5.58.2",
58
+ "@luvio/service-cache-inclusion-policy": "5.58.2",
59
+ "@luvio/service-fetch-network": "5.58.2",
60
+ "@luvio/service-instrument-command": "5.58.2",
61
+ "@luvio/service-pubsub": "5.58.2",
62
+ "@luvio/service-store": "5.58.2",
63
+ "@luvio/utils": "5.58.2",
64
+ "@salesforce/lds-adapters-uiapi-lex": "^1.380.0-dev2",
65
+ "@salesforce/lds-luvio-service": "^1.380.0-dev2",
66
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.380.0-dev2"
67
67
  },
68
68
  "luvioBundlesize": [
69
69
  {