@salesforce/lds-runtime-webruntime 1.404.0-dev5 → 1.404.0-dev7

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.
@@ -473,7 +473,12 @@ class AuraNetworkCommand extends NetworkCommand$1 {
473
473
  this.coerceAuraErrors
474
474
  );
475
475
  } else if (this.shouldUseFetch()) {
476
- return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
476
+ const params = this.fetchParams;
477
+ try {
478
+ return this.convertFetchResponseToData(this.services.fetch(...params));
479
+ } catch (reason) {
480
+ return resolvedPromiseLike$2(err$1(toError(reason)));
481
+ }
477
482
  }
478
483
  return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
479
484
  }
@@ -1071,7 +1076,12 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
1071
1076
  (errs) => this.coerceAuraErrors(errs)
1072
1077
  );
1073
1078
  } else if (this.shouldUseFetch()) {
1074
- return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
1079
+ const params = this.fetchParams;
1080
+ try {
1081
+ return this.convertFetchResponseToData(this.services.fetch(...params));
1082
+ } catch (reason) {
1083
+ return resolvedPromiseLike$2(err$1(toError(reason)));
1084
+ }
1075
1085
  }
1076
1086
  return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
1077
1087
  }
@@ -1214,7 +1224,12 @@ class AuraCacheControlCommand extends CacheControlCommand {
1214
1224
  (errs) => this.coerceAuraErrors(errs)
1215
1225
  );
1216
1226
  } else if (this.shouldUseFetch()) {
1217
- return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
1227
+ const params = this.fetchParams;
1228
+ try {
1229
+ return this.convertFetchResponseToData(this.services.fetch(...params));
1230
+ } catch (reason) {
1231
+ return resolvedPromiseLike$2(err$1(toError(reason)));
1232
+ }
1218
1233
  }
1219
1234
  return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
1220
1235
  }
@@ -1332,7 +1347,11 @@ class HttpCacheControlCommand extends CacheControlCommand {
1332
1347
  return this.fetch();
1333
1348
  }
1334
1349
  fetch() {
1335
- return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
1350
+ try {
1351
+ return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
1352
+ } catch (reason) {
1353
+ return resolvedPromiseLike$2(err$1(toError(reason)));
1354
+ }
1336
1355
  }
1337
1356
  async coerceError(errorResponse) {
1338
1357
  return toError(errorResponse.statusText);
@@ -1535,7 +1554,11 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
1535
1554
  this.services = services;
1536
1555
  }
1537
1556
  fetch() {
1538
- return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
1557
+ try {
1558
+ return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
1559
+ } catch (reason) {
1560
+ return resolvedPromiseLike$2(err$1(toError(reason)));
1561
+ }
1539
1562
  }
1540
1563
  async coerceError(errorResponse) {
1541
1564
  return toError(errorResponse.statusText);
@@ -1591,7 +1614,11 @@ class StreamingCommand extends BaseCommand {
1591
1614
  this.services = services;
1592
1615
  }
1593
1616
  execute() {
1594
- return this.convertFetchStreamResponseToData(this.services.fetch(...this.fetchParams));
1617
+ try {
1618
+ return this.convertFetchStreamResponseToData(this.services.fetch(...this.fetchParams));
1619
+ } catch (reason) {
1620
+ return resolvedPromiseLike$2(err$1(toError(reason)));
1621
+ }
1595
1622
  }
1596
1623
  convertFetchStreamResponseToData(response) {
1597
1624
  return response.then(
@@ -2427,9 +2454,13 @@ class OnlyIfCachedCacheControlStrategy extends CacheControlStrategy {
2427
2454
  }
2428
2455
  get expiredChecks() {
2429
2456
  return [
2430
- (cacheControlMetadata) => cacheControlMetadata.type === "no-store"
2457
+ ...super.expiredChecks,
2458
+ (cacheControlMetadata) => cacheControlMetadata.type === "no-cache"
2431
2459
  ];
2432
2460
  }
2461
+ // Note: If we add support for `stale-while-revalidate` in the future, we may
2462
+ // need to further override expiredChecks to allow stale entries that are within the
2463
+ // stale-while-revalidate window to be returned for only-if-cached requests.
2433
2464
  collectCacheHitInstrumentation(startTime, instrumentationAttributes) {
2434
2465
  if (this.services.instrumentation) {
2435
2466
  const meter = this.services.instrumentation.metrics.getMeter("onestore");
@@ -2984,11 +3015,26 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
2984
3015
  return buildSubscribableResult$1(result, this.buildSubscribe(), () => this.refresh());
2985
3016
  });
2986
3017
  } else if (this.shouldUseFetch()) {
2987
- return this.convertFetchResponseToData(
2988
- this.services.fetch(...this.originalFetchParams)
2989
- ).then((result) => {
2990
- return buildSubscribableResult$1(result, this.buildSubscribe(), () => this.refresh());
2991
- });
3018
+ const params = this.originalFetchParams;
3019
+ try {
3020
+ return this.convertFetchResponseToData(this.services.fetch(...params)).then(
3021
+ (result) => {
3022
+ return buildSubscribableResult$1(
3023
+ result,
3024
+ this.buildSubscribe(),
3025
+ () => this.refresh()
3026
+ );
3027
+ }
3028
+ );
3029
+ } catch (reason) {
3030
+ return resolvedPromiseLike$2(
3031
+ buildSubscribableResult$1(
3032
+ err$1(toError(reason)),
3033
+ this.buildSubscribe(),
3034
+ () => this.refresh()
3035
+ )
3036
+ );
3037
+ }
2992
3038
  }
2993
3039
  return resolvedPromiseLike$2(
2994
3040
  buildSubscribableResult$1(
@@ -3263,7 +3309,7 @@ function buildServiceDescriptor$9(luvio) {
3263
3309
  },
3264
3310
  };
3265
3311
  }
3266
- // version: 1.404.0-dev5-38a59c52aa
3312
+ // version: 1.404.0-dev7-7d4ca687f7
3267
3313
 
3268
3314
  /**
3269
3315
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3289,7 +3335,7 @@ function buildServiceDescriptor$8(notifyRecordUpdateAvailable, getNormalizedLuvi
3289
3335
  },
3290
3336
  };
3291
3337
  }
3292
- // version: 1.404.0-dev5-38a59c52aa
3338
+ // version: 1.404.0-dev7-7d4ca687f7
3293
3339
 
3294
3340
  /*!
3295
3341
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4726,7 +4772,12 @@ class JwtManager {
4726
4772
  * All rights reserved.
4727
4773
  * For full license text, see the LICENSE.txt file
4728
4774
  */
4729
- function buildServiceDescriptor(interceptors = { request: [], response: [], finally: [] }, retryService) {
4775
+ function buildServiceDescriptor(interceptors = {
4776
+ request: [],
4777
+ retry: void 0,
4778
+ response: [],
4779
+ finally: []
4780
+ }, retryService) {
4730
4781
  return {
4731
4782
  type: "fetch",
4732
4783
  version: "1.0",
@@ -4735,6 +4786,7 @@ function buildServiceDescriptor(interceptors = { request: [], response: [], fina
4735
4786
  const context = (_a = interceptors.createContext) == null ? void 0 : _a.call(interceptors);
4736
4787
  const {
4737
4788
  request: requestInterceptors = [],
4789
+ retry: retryInterceptor = void 0,
4738
4790
  response: responseInterceptors = [],
4739
4791
  finally: finallyInterceptors = []
4740
4792
  } = interceptors;
@@ -4743,10 +4795,14 @@ function buildServiceDescriptor(interceptors = { request: [], response: [], fina
4743
4795
  resolvedPromiseLike$2(args)
4744
4796
  );
4745
4797
  return Promise.resolve(pending).then((args2) => {
4746
- if (retryService) {
4747
- return retryService.applyRetry(() => fetch(...args2));
4798
+ if (retryInterceptor) {
4799
+ return retryInterceptor(args2, retryService, context);
4800
+ } else {
4801
+ if (retryService) {
4802
+ return retryService.applyRetry(() => fetch(...args2));
4803
+ }
4804
+ return fetch(...args2);
4748
4805
  }
4749
- return fetch(...args2);
4750
4806
  }).then((response) => {
4751
4807
  return responseInterceptors.reduce(
4752
4808
  (previousPromise, interceptor) => previousPromise.then((response2) => interceptor(response2, context)),
@@ -5078,4 +5134,4 @@ withDefaultLuvio((luvio) => {
5078
5134
  ];
5079
5135
  setServices(services);
5080
5136
  });
5081
- // version: 1.404.0-dev5-924c469d6b
5137
+ // version: 1.404.0-dev7-f7cbfedbf0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-webruntime",
3
- "version": "1.404.0-dev5",
3
+ "version": "1.404.0-dev7",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Webruntime runtime",
6
6
  "main": "dist/ldsWebruntimeOneStoreInit.js",
@@ -35,38 +35,38 @@
35
35
  "ready": "yarn build && jest --collectCoverage && yarn test:size && yarn release:corejar"
36
36
  },
37
37
  "devDependencies": {
38
- "@conduit-client/service-provisioner": "3.2.0",
39
- "@conduit-client/tools-core": "3.2.0",
38
+ "@conduit-client/service-provisioner": "3.7.0-dev2",
39
+ "@conduit-client/tools-core": "3.7.0-dev2",
40
40
  "jwt-encode": "1.0.1"
41
41
  },
42
42
  "dependencies": {
43
- "@conduit-client/command-aura-network": "3.2.0",
44
- "@conduit-client/command-aura-normalized-cache-control": "3.2.0",
45
- "@conduit-client/command-aura-resource-cache-control": "3.2.0",
46
- "@conduit-client/command-fetch-network": "3.2.0",
47
- "@conduit-client/command-http-normalized-cache-control": "3.2.0",
48
- "@conduit-client/command-ndjson": "3.2.0",
49
- "@conduit-client/command-network": "3.2.0",
50
- "@conduit-client/command-sse": "3.2.0",
51
- "@conduit-client/command-streaming": "3.2.0",
52
- "@conduit-client/jwt-manager": "3.2.0",
53
- "@conduit-client/service-aura-network": "3.2.0",
54
- "@conduit-client/service-bindings-imperative": "3.2.0",
55
- "@conduit-client/service-bindings-lwc": "3.2.0",
56
- "@conduit-client/service-cache": "3.2.0",
57
- "@conduit-client/service-cache-control": "3.2.0",
58
- "@conduit-client/service-cache-inclusion-policy": "3.2.0",
59
- "@conduit-client/service-fetch-network": "3.2.0",
60
- "@conduit-client/service-instrument-command": "3.2.0",
61
- "@conduit-client/service-pubsub": "3.2.0",
62
- "@conduit-client/service-store": "3.2.0",
63
- "@conduit-client/utils": "3.2.0",
43
+ "@conduit-client/command-aura-network": "3.7.0-dev2",
44
+ "@conduit-client/command-aura-normalized-cache-control": "3.7.0-dev2",
45
+ "@conduit-client/command-aura-resource-cache-control": "3.7.0-dev2",
46
+ "@conduit-client/command-fetch-network": "3.7.0-dev2",
47
+ "@conduit-client/command-http-normalized-cache-control": "3.7.0-dev2",
48
+ "@conduit-client/command-ndjson": "3.7.0-dev2",
49
+ "@conduit-client/command-network": "3.7.0-dev2",
50
+ "@conduit-client/command-sse": "3.7.0-dev2",
51
+ "@conduit-client/command-streaming": "3.7.0-dev2",
52
+ "@conduit-client/jwt-manager": "3.7.0-dev2",
53
+ "@conduit-client/service-aura-network": "3.7.0-dev2",
54
+ "@conduit-client/service-bindings-imperative": "3.7.0-dev2",
55
+ "@conduit-client/service-bindings-lwc": "3.7.0-dev2",
56
+ "@conduit-client/service-cache": "3.7.0-dev2",
57
+ "@conduit-client/service-cache-control": "3.7.0-dev2",
58
+ "@conduit-client/service-cache-inclusion-policy": "3.7.0-dev2",
59
+ "@conduit-client/service-fetch-network": "3.7.0-dev2",
60
+ "@conduit-client/service-instrument-command": "3.7.0-dev2",
61
+ "@conduit-client/service-pubsub": "3.7.0-dev2",
62
+ "@conduit-client/service-store": "3.7.0-dev2",
63
+ "@conduit-client/utils": "3.7.0-dev2",
64
64
  "@luvio/network-adapter-composable": "0.158.7",
65
65
  "@luvio/network-adapter-fetch": "0.158.7",
66
- "@salesforce/lds-adapters-uiapi-lex": "^1.404.0-dev5",
67
- "@salesforce/lds-default-luvio": "^1.404.0-dev5",
68
- "@salesforce/lds-luvio-service": "^1.404.0-dev5",
69
- "@salesforce/lds-luvio-uiapi-records-service": "^1.404.0-dev5"
66
+ "@salesforce/lds-adapters-uiapi-lex": "^1.404.0-dev7",
67
+ "@salesforce/lds-default-luvio": "^1.404.0-dev7",
68
+ "@salesforce/lds-luvio-service": "^1.404.0-dev7",
69
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.404.0-dev7"
70
70
  },
71
71
  "luvioBundlesize": [
72
72
  {