@salesforce/lds-runtime-webruntime 1.382.0 → 1.384.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.
@@ -520,7 +520,7 @@ class CacheControlRequestRunner {
520
520
  }
521
521
  requestFromNetwork() {
522
522
  const that = this;
523
- return async function* () {
523
+ return (async function* () {
524
524
  const result = await that.requestFromNetworkInternal();
525
525
  if (result.isErr()) {
526
526
  that.networkError = result;
@@ -528,7 +528,7 @@ class CacheControlRequestRunner {
528
528
  that.networkData = result;
529
529
  }
530
530
  yield result;
531
- }();
531
+ })();
532
532
  }
533
533
  writeToCache(cache, networkResult) {
534
534
  return this.writeToCacheInternal(cache, networkResult);
@@ -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.382.0-73d929ea11
3709
+ // version: 1.384.0-835fd13f44
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.382.0-73d929ea11
3735
+ // version: 1.384.0-835fd13f44
3695
3736
 
3696
3737
  /*!
3697
3738
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3723,12 +3764,12 @@ function t(e2) {
3723
3764
  throw "Illegal base64url string!";
3724
3765
  }
3725
3766
  try {
3726
- return function(e3) {
3727
- return decodeURIComponent(r(e3).replace(/(.)/g, function(e4, r2) {
3767
+ return (function(e3) {
3768
+ return decodeURIComponent(r(e3).replace(/(.)/g, (function(e4, r2) {
3728
3769
  var t3 = r2.charCodeAt(0).toString(16).toUpperCase();
3729
3770
  return t3.length < 2 && (t3 = "0" + t3), "%" + t3;
3730
- }));
3731
- }(t2);
3771
+ })));
3772
+ })(t2);
3732
3773
  } catch (e3) {
3733
3774
  return r(t2);
3734
3775
  }
@@ -4311,4 +4352,4 @@ const services = [
4311
4352
  buildServiceDescriptor$1({}, {}),
4312
4353
  ];
4313
4354
  setServices(services);
4314
- // version: 1.382.0-8ca71123b0
4355
+ // version: 1.384.0-cb845692ac
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-webruntime",
3
- "version": "1.382.0",
3
+ "version": "1.384.0",
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.4",
39
+ "@luvio/tools-core": "5.58.4",
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.4",
44
+ "@luvio/command-aura-normalized-cache-control": "5.58.4",
45
+ "@luvio/command-aura-resource-cache-control": "5.58.4",
46
+ "@luvio/command-fetch-network": "5.58.4",
47
+ "@luvio/command-http-normalized-cache-control": "5.58.4",
48
+ "@luvio/command-ndjson": "5.58.4",
49
+ "@luvio/command-network": "5.58.4",
50
+ "@luvio/command-sse": "5.58.4",
51
+ "@luvio/command-streaming": "5.58.4",
52
+ "@luvio/jwt-manager": "5.58.4",
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.382.0",
65
- "@salesforce/lds-luvio-service": "^1.382.0",
66
- "@salesforce/lds-luvio-uiapi-records-service": "^1.382.0"
55
+ "@luvio/service-aura-network": "5.58.4",
56
+ "@luvio/service-cache": "5.58.4",
57
+ "@luvio/service-cache-control": "5.58.4",
58
+ "@luvio/service-cache-inclusion-policy": "5.58.4",
59
+ "@luvio/service-fetch-network": "5.58.4",
60
+ "@luvio/service-instrument-command": "5.58.4",
61
+ "@luvio/service-pubsub": "5.58.4",
62
+ "@luvio/service-store": "5.58.4",
63
+ "@luvio/utils": "5.58.4",
64
+ "@salesforce/lds-adapters-uiapi-lex": "^1.384.0",
65
+ "@salesforce/lds-luvio-service": "^1.384.0",
66
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.384.0"
67
67
  },
68
68
  "luvioBundlesize": [
69
69
  {