@salesforce/lds-runtime-aura 1.428.0-dev1 → 1.428.0-dev11

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.
@@ -1354,6 +1354,7 @@ class HttpCacheControlCommand extends CacheControlCommand {
1354
1354
  constructor(services) {
1355
1355
  super(services);
1356
1356
  this.services = services;
1357
+ this.additionalNullResponses = [];
1357
1358
  }
1358
1359
  requestFromNetwork() {
1359
1360
  return this.fetch();
@@ -1365,6 +1366,15 @@ class HttpCacheControlCommand extends CacheControlCommand {
1365
1366
  return resolvedPromiseLike$2(err$1(toError(reason)));
1366
1367
  }
1367
1368
  }
1369
+ isSemanticNullResponse(response) {
1370
+ return this.additionalNullResponses.includes(response.status);
1371
+ }
1372
+ isProtocolNoBodyStatus(status) {
1373
+ return status === 204 || status === 205;
1374
+ }
1375
+ isUndeclaredNoBodyResponse(response) {
1376
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
1377
+ }
1368
1378
  async coerceError(errorResponse) {
1369
1379
  return toError(errorResponse.statusText);
1370
1380
  }
@@ -1375,12 +1385,26 @@ class HttpCacheControlCommand extends CacheControlCommand {
1375
1385
  return response.then(
1376
1386
  (response2) => {
1377
1387
  if (response2.ok) {
1378
- return response2.json().then(
1379
- (json) => {
1380
- return this.processFetchReturnValue(json);
1381
- },
1382
- (reason) => err$1(toError(reason))
1383
- ).finally(() => {
1388
+ let resultPromise;
1389
+ if (this.isSemanticNullResponse(response2)) {
1390
+ resultPromise = Promise.resolve(ok$2(null));
1391
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
1392
+ resultPromise = Promise.resolve(
1393
+ err$1(
1394
+ toError(
1395
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
1396
+ )
1397
+ )
1398
+ );
1399
+ } else {
1400
+ resultPromise = response2.json().then(
1401
+ (json) => {
1402
+ return this.processFetchReturnValue(json);
1403
+ },
1404
+ (reason) => err$1(toError(reason))
1405
+ );
1406
+ }
1407
+ return resultPromise.finally(() => {
1384
1408
  try {
1385
1409
  this.afterRequestHooks({ statusCode: response2.status });
1386
1410
  } catch {
@@ -1564,6 +1588,7 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
1564
1588
  constructor(services) {
1565
1589
  super(services);
1566
1590
  this.services = services;
1591
+ this.additionalNullResponses = [];
1567
1592
  }
1568
1593
  fetch() {
1569
1594
  try {
@@ -1572,6 +1597,15 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
1572
1597
  return resolvedPromiseLike$2(err$1(toError(reason)));
1573
1598
  }
1574
1599
  }
1600
+ isSemanticNullResponse(response) {
1601
+ return this.additionalNullResponses.includes(response.status);
1602
+ }
1603
+ isProtocolNoBodyStatus(status) {
1604
+ return status === 204 || status === 205;
1605
+ }
1606
+ isUndeclaredNoBodyResponse(response) {
1607
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
1608
+ }
1575
1609
  async coerceError(errorResponse) {
1576
1610
  return toError(errorResponse.statusText);
1577
1611
  }
@@ -1579,10 +1613,24 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
1579
1613
  return response.then(
1580
1614
  (response2) => {
1581
1615
  if (response2.ok) {
1582
- return response2.json().then(
1583
- (json) => ok$2(json),
1584
- (reason) => err$1(toError(reason))
1585
- ).finally(() => {
1616
+ let resultPromise;
1617
+ if (this.isSemanticNullResponse(response2)) {
1618
+ resultPromise = Promise.resolve(ok$2(null));
1619
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
1620
+ resultPromise = Promise.resolve(
1621
+ err$1(
1622
+ toError(
1623
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
1624
+ )
1625
+ )
1626
+ );
1627
+ } else {
1628
+ resultPromise = response2.json().then(
1629
+ (json) => ok$2(json),
1630
+ (reason) => err$1(toError(reason))
1631
+ );
1632
+ }
1633
+ return resultPromise.finally(() => {
1586
1634
  try {
1587
1635
  this.afterRequestHooks({ statusCode: response2.status });
1588
1636
  } catch {
@@ -2712,7 +2760,7 @@ function buildServiceDescriptor$d(luvio) {
2712
2760
  },
2713
2761
  };
2714
2762
  }
2715
- // version: 1.428.0-dev1-52205c6c54
2763
+ // version: 1.428.0-dev11-659d2de2fa
2716
2764
 
2717
2765
  /*!
2718
2766
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3065,7 +3113,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
3065
3113
  },
3066
3114
  };
3067
3115
  }
3068
- // version: 1.428.0-dev1-52205c6c54
3116
+ // version: 1.428.0-dev11-659d2de2fa
3069
3117
 
3070
3118
  /*!
3071
3119
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4782,13 +4830,6 @@ const platformSfapJwtResolver = {
4782
4830
  },
4783
4831
  };
4784
4832
  const jwtManager = new JwtManager(new JwtRepository(), platformSfapJwtResolver);
4785
- function prefetchSfapJwt() {
4786
- const maybePromise = jwtManager.getJwt();
4787
- if ('then' in maybePromise) {
4788
- return maybePromise.then(() => undefined).catch(() => undefined);
4789
- }
4790
- return Promise.resolve(undefined);
4791
- }
4792
4833
  const authenticateRequest = (resourceRequest, jwt) => {
4793
4834
  const { token } = jwt;
4794
4835
  const { headers } = resourceRequest;
@@ -5701,7 +5742,7 @@ function getEnvironmentSetting(name) {
5701
5742
  }
5702
5743
  return undefined;
5703
5744
  }
5704
- // version: 1.428.0-dev1-52205c6c54
5745
+ // version: 1.428.0-dev11-659d2de2fa
5705
5746
 
5706
5747
  const environmentHasAura = typeof window !== 'undefined' && typeof window.$A !== 'undefined';
5707
5748
  const defaultConfig = {
@@ -6883,12 +6924,12 @@ class CsrfTokenRetryPolicy extends RetryPolicy {
6883
6924
  if (context.attempt >= this.config.maxRetries) {
6884
6925
  return false;
6885
6926
  }
6886
- // Only retry on 400 status
6887
- if (result.status !== 400) {
6927
+ // Connect may return 401 or 400 for invalid CSRF scenarios
6928
+ if (result.status !== 400 && result.status !== 401) {
6888
6929
  return false;
6889
6930
  }
6890
6931
  // Check if this is a CSRF error by examining the response body
6891
- // This avoids retrying all 400s (validation errors, bad requests, etc.)
6932
+ // This avoids retrying all 400s/401s (validation errors, auth errors, etc.)
6892
6933
  return await isCsrfError(result);
6893
6934
  }
6894
6935
  /**
@@ -6978,6 +7019,13 @@ function buildCsrfRetryInterceptor() {
6978
7019
  const SFAP_BASE_URL = 'api.salesforce.com';
6979
7020
  const sfapJwtRepository = new JwtRepository();
6980
7021
  const sfapJwtManager = new JwtManager(sfapJwtRepository, platformSfapJwtResolver);
7022
+ function prefetchSfapJwt() {
7023
+ const maybePromise = sfapJwtManager.getJwt();
7024
+ if ('then' in maybePromise) {
7025
+ return maybePromise.then(() => undefined).catch(() => undefined);
7026
+ }
7027
+ return Promise.resolve(undefined);
7028
+ }
6981
7029
  function buildJwtAuthorizedSfapFetchServiceDescriptor(logger) {
6982
7030
  const jwtAuthorizedFetchService = buildServiceDescriptor$2({
6983
7031
  createContext: createInstrumentationIdContext(),
@@ -10532,4 +10580,4 @@ function ldsEngineCreator() {
10532
10580
  }
10533
10581
 
10534
10582
  export { LexRequestStrategy, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
10535
- // version: 1.428.0-dev1-c95a813572
10583
+ // version: 1.428.0-dev11-b4d8cf1aec
@@ -1,5 +1,6 @@
1
1
  import { type FetchServiceDescriptor } from '@conduit-client/service-fetch-network/v1';
2
2
  import { type LoggerService } from '@conduit-client/utils';
3
+ export declare function prefetchSfapJwt(): Promise<undefined>;
3
4
  export declare function buildJwtAuthorizedSfapFetchServiceDescriptor(logger: LoggerService): FetchServiceDescriptor;
4
5
  /**
5
6
  * Returns a service descriptor for a fetch service that includes one-off copilot
@@ -10,7 +10,6 @@ export type ExtraInfo = {
10
10
  * {@link JwtResolver} for platform SFAP
11
11
  */
12
12
  export declare const platformSfapJwtResolver: JwtResolver<ExtraInfo>;
13
- export declare function prefetchSfapJwt(): Promise<undefined>;
14
13
  declare const composedNetworkAdapter: {
15
14
  shouldHandleRequest(resourceRequest: ResourceRequest): boolean;
16
15
  adapter: (resourceRequest: ResourceRequest, resourceRequestContext: ResourceRequestContext) => Promise<FetchResponse<any>>;
@@ -1,4 +1,5 @@
1
- import { RetryPolicy, RetryContext } from '@conduit-client/service-retry/v1';
1
+ import type { RetryContext } from '@conduit-client/service-retry/v1';
2
+ import { RetryPolicy } from '@conduit-client/service-retry/v1';
2
3
  import type { FetchParameters } from '@conduit-client/service-fetch-network/v1';
3
4
  type CsrfTokenRetryPolicyConfig = {
4
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.428.0-dev1",
3
+ "version": "1.428.0-dev11",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -34,51 +34,51 @@
34
34
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-aura"
35
35
  },
36
36
  "devDependencies": {
37
- "@conduit-client/service-provisioner": "3.18.0",
38
- "@conduit-client/tools-core": "3.18.0",
39
- "@salesforce/lds-adapters-apex": "^1.428.0-dev1",
40
- "@salesforce/lds-adapters-uiapi": "^1.428.0-dev1",
41
- "@salesforce/lds-ads-bridge": "^1.428.0-dev1",
42
- "@salesforce/lds-aura-storage": "^1.428.0-dev1",
43
- "@salesforce/lds-bindings": "^1.428.0-dev1",
44
- "@salesforce/lds-instrumentation": "^1.428.0-dev1",
45
- "@salesforce/lds-network-aura": "^1.428.0-dev1",
46
- "@salesforce/lds-network-fetch": "^1.428.0-dev1",
37
+ "@conduit-client/service-provisioner": "3.18.1-dev2",
38
+ "@conduit-client/tools-core": "3.18.1-dev2",
39
+ "@salesforce/lds-adapters-apex": "^1.428.0-dev11",
40
+ "@salesforce/lds-adapters-uiapi": "^1.428.0-dev11",
41
+ "@salesforce/lds-ads-bridge": "^1.428.0-dev11",
42
+ "@salesforce/lds-aura-storage": "^1.428.0-dev11",
43
+ "@salesforce/lds-bindings": "^1.428.0-dev11",
44
+ "@salesforce/lds-instrumentation": "^1.428.0-dev11",
45
+ "@salesforce/lds-network-aura": "^1.428.0-dev11",
46
+ "@salesforce/lds-network-fetch": "^1.428.0-dev11",
47
47
  "jwt-encode": "1.0.1"
48
48
  },
49
49
  "dependencies": {
50
- "@conduit-client/command-aura-graphql-normalized-cache-control": "3.18.0",
51
- "@conduit-client/command-aura-network": "3.18.0",
52
- "@conduit-client/command-aura-normalized-cache-control": "3.18.0",
53
- "@conduit-client/command-aura-resource-cache-control": "3.18.0",
54
- "@conduit-client/command-fetch-network": "3.18.0",
55
- "@conduit-client/command-http-graphql-normalized-cache-control": "3.18.0",
56
- "@conduit-client/command-http-normalized-cache-control": "3.18.0",
57
- "@conduit-client/command-ndjson": "3.18.0",
58
- "@conduit-client/command-network": "3.18.0",
59
- "@conduit-client/command-sse": "3.18.0",
60
- "@conduit-client/command-streaming": "3.18.0",
61
- "@conduit-client/service-aura-network": "3.18.0",
62
- "@conduit-client/service-bindings-imperative": "3.18.0",
63
- "@conduit-client/service-bindings-lwc": "3.18.0",
64
- "@conduit-client/service-cache": "3.18.0",
65
- "@conduit-client/service-cache-control": "3.18.0",
66
- "@conduit-client/service-cache-inclusion-policy": "3.18.0",
67
- "@conduit-client/service-config": "3.18.0",
68
- "@conduit-client/service-feature-flags": "3.18.0",
69
- "@conduit-client/service-fetch-network": "3.18.0",
70
- "@conduit-client/service-instrument-command": "3.18.0",
71
- "@conduit-client/service-pubsub": "3.18.0",
72
- "@conduit-client/service-store": "3.18.0",
73
- "@conduit-client/utils": "3.18.0",
50
+ "@conduit-client/command-aura-graphql-normalized-cache-control": "3.18.1-dev2",
51
+ "@conduit-client/command-aura-network": "3.18.1-dev2",
52
+ "@conduit-client/command-aura-normalized-cache-control": "3.18.1-dev2",
53
+ "@conduit-client/command-aura-resource-cache-control": "3.18.1-dev2",
54
+ "@conduit-client/command-fetch-network": "3.18.1-dev2",
55
+ "@conduit-client/command-http-graphql-normalized-cache-control": "3.18.1-dev2",
56
+ "@conduit-client/command-http-normalized-cache-control": "3.18.1-dev2",
57
+ "@conduit-client/command-ndjson": "3.18.1-dev2",
58
+ "@conduit-client/command-network": "3.18.1-dev2",
59
+ "@conduit-client/command-sse": "3.18.1-dev2",
60
+ "@conduit-client/command-streaming": "3.18.1-dev2",
61
+ "@conduit-client/service-aura-network": "3.18.1-dev2",
62
+ "@conduit-client/service-bindings-imperative": "3.18.1-dev2",
63
+ "@conduit-client/service-bindings-lwc": "3.18.1-dev2",
64
+ "@conduit-client/service-cache": "3.18.1-dev2",
65
+ "@conduit-client/service-cache-control": "3.18.1-dev2",
66
+ "@conduit-client/service-cache-inclusion-policy": "3.18.1-dev2",
67
+ "@conduit-client/service-config": "3.18.1-dev2",
68
+ "@conduit-client/service-feature-flags": "3.18.1-dev2",
69
+ "@conduit-client/service-fetch-network": "3.18.1-dev2",
70
+ "@conduit-client/service-instrument-command": "3.18.1-dev2",
71
+ "@conduit-client/service-pubsub": "3.18.1-dev2",
72
+ "@conduit-client/service-store": "3.18.1-dev2",
73
+ "@conduit-client/utils": "3.18.1-dev2",
74
74
  "@luvio/network-adapter-composable": "0.160.3",
75
75
  "@luvio/network-adapter-fetch": "0.160.3",
76
76
  "@lwc/state": "^0.29.0",
77
- "@salesforce/lds-adapters-onestore-graphql": "^1.428.0-dev1",
77
+ "@salesforce/lds-adapters-onestore-graphql": "^1.428.0-dev11",
78
78
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
79
- "@salesforce/lds-durable-storage": "^1.428.0-dev1",
80
- "@salesforce/lds-luvio-service": "^1.428.0-dev1",
81
- "@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-dev1"
79
+ "@salesforce/lds-durable-storage": "^1.428.0-dev11",
80
+ "@salesforce/lds-luvio-service": "^1.428.0-dev11",
81
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-dev11"
82
82
  },
83
83
  "luvioBundlesize": [
84
84
  {