@salesforce/lds-runtime-aura 1.455.0 → 1.457.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.
@@ -1447,10 +1447,23 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
1447
1447
  this.services = services;
1448
1448
  this.additionalNullResponses = [];
1449
1449
  }
1450
+ /**
1451
+ * The command's operation type. Generated command subclasses override this
1452
+ * getter with their concrete operation (see the generator's
1453
+ * `generateOperationType`); the base returns `undefined` for commands that
1454
+ * don't declare one (e.g. hand-written commands). Transport-layer
1455
+ * interceptors use it to tell a read (`query`) apart from a write — see
1456
+ * `fetch`, which folds it into the context seed.
1457
+ */
1458
+ get operationType() {
1459
+ return void 0;
1460
+ }
1450
1461
  fetch(contextSeed) {
1451
1462
  try {
1452
1463
  const [input, init] = this.fetchParams;
1453
- const initWithSeed = contextSeed === void 0 ? init : { ...init, __contextSeed: contextSeed };
1464
+ const operationType = this.operationType;
1465
+ const seed = operationType === void 0 ? contextSeed : { operationType, ...contextSeed };
1466
+ const initWithSeed = seed === void 0 ? init : { ...init, __contextSeed: seed };
1454
1467
  const fetchCall = initWithSeed === void 0 ? this.services.fetch(input) : this.services.fetch(input, initWithSeed);
1455
1468
  return this.convertFetchResponseToData(fetchCall);
1456
1469
  } catch (reason) {
@@ -2589,7 +2602,7 @@ function buildServiceDescriptor$d(luvio) {
2589
2602
  },
2590
2603
  };
2591
2604
  }
2592
- // version: 1.455.0-c53c97de2a
2605
+ // version: 1.457.0-b38a7243f7
2593
2606
 
2594
2607
  class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheControlCommand {
2595
2608
  constructor(config, documentRootType, services) {
@@ -2928,7 +2941,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
2928
2941
  },
2929
2942
  };
2930
2943
  }
2931
- // version: 1.455.0-c53c97de2a
2944
+ // version: 1.457.0-b38a7243f7
2932
2945
 
2933
2946
  class RetryService {
2934
2947
  constructor(defaultRetryPolicy) {
@@ -5934,7 +5947,7 @@ function getEnvironmentSetting(name) {
5934
5947
  }
5935
5948
  return undefined;
5936
5949
  }
5937
- // version: 1.455.0-96e9b41a18
5950
+ // version: 1.457.0-5118f3b372
5938
5951
 
5939
5952
  const auraClientService = getAuraClientService();
5940
5953
  const defaultConfig = {
@@ -6495,6 +6508,18 @@ function getFetchMethod([urlOrRequest, options]) {
6495
6508
  function isRetryableMethod(method) {
6496
6509
  return method?.toLowerCase() === 'get';
6497
6510
  }
6511
+ /**
6512
+ * A request whose operationType is `query` is a read, so it is safe to replay
6513
+ * automatically on 429/503 even when the transport uses a non-GET method (e.g.
6514
+ * a GraphQL/aggregate-ui read issued as a POST). This complements
6515
+ * `isRetryableMethod`: OneStore seeds the command's operationType into the
6516
+ * per-request context, and the throttling policy retries when either the method
6517
+ * is GET or the operationType is `query`. Only `query` is retryable — `mutation`
6518
+ * and an absent/`graphql` operationType are never replayed.
6519
+ */
6520
+ function isRetryableOperationType(operationType) {
6521
+ return operationType === 'query';
6522
+ }
6498
6523
  /**
6499
6524
  * Determines if the HTTP method requires CSRF protection.
6500
6525
  * Only mutating operations (POST, PUT, PATCH, DELETE) require CSRF tokens.
@@ -7615,13 +7640,17 @@ const DEFAULT_CONFIG = {
7615
7640
  jitterPercent: 0.5,
7616
7641
  };
7617
7642
  class FetchThrottlingRetryPolicy extends RetryPolicy {
7618
- constructor(config = DEFAULT_CONFIG, method) {
7643
+ constructor(config = DEFAULT_CONFIG, method, operationType) {
7619
7644
  super();
7620
7645
  this.config = config;
7621
7646
  this.method = method;
7647
+ this.operationType = operationType;
7622
7648
  }
7623
7649
  async shouldRetry(result, context) {
7624
- return (isRetryableMethod(this.method) &&
7650
+ // A request is safe to replay when it's a GET or when OneStore has
7651
+ // flagged it as a read (operationType === 'query'), covering reads
7652
+ // issued over a non-GET method. Writes stay non-retryable.
7653
+ return ((isRetryableMethod(this.method) || isRetryableOperationType(this.operationType)) &&
7625
7654
  (result.status === 429 || result.status === 503) &&
7626
7655
  context.attempt < this.config.maxRetries &&
7627
7656
  context.totalElapsedMs <= this.config.maxTimeToRetry);
@@ -7687,26 +7716,28 @@ function buildCsrfPolicy(mutableRequest) {
7687
7716
  }
7688
7717
  /**
7689
7718
  * Built fresh per request so the write-guard check sees this request's own
7690
- * HTTP method, rather than one method baked in for the life of the service.
7719
+ * HTTP method and operationType, rather than values baked in for the life of
7720
+ * the service.
7691
7721
  */
7692
- function buildThrottlingPolicy(fetchArgs) {
7693
- return new FetchThrottlingRetryPolicy(undefined, getFetchMethod(fetchArgs));
7722
+ function buildThrottlingPolicy(fetchArgs, context) {
7723
+ return new FetchThrottlingRetryPolicy(undefined, getFetchMethod(fetchArgs), context?.operationType);
7694
7724
  }
7695
7725
  /**
7696
7726
  * Builds the retry interceptor used by the generic Conduit fetch service.
7697
7727
  *
7698
7728
  * Composes two independent per-request retry policies — throttling (429/503,
7699
- * GET-only) and CSRF (401 token refresh) built fresh per request rather
7700
- * than reused off a shared defaultRetryPolicy. This keeps concurrent requests
7701
- * from sharing mutable CSRF request-context state, and lets the throttling
7702
- * policy see this request's own HTTP method.
7729
+ * retryable when the method is GET or the operationType is `query`) and CSRF
7730
+ * (401 token refresh) built fresh per request rather than reused off a
7731
+ * shared defaultRetryPolicy. This keeps concurrent requests from sharing
7732
+ * mutable CSRF request-context state, and lets the throttling policy see this
7733
+ * request's own HTTP method and operationType.
7703
7734
  */
7704
7735
  function buildFetchRetryInterceptor() {
7705
- return async (fetchArgs, retryService, _context) => {
7736
+ return async (fetchArgs, retryService, context) => {
7706
7737
  if (retryService) {
7707
7738
  const mutableRequest = { args: fetchArgs };
7708
7739
  const composedPolicy = new ComposedRetryPolicy([
7709
- buildThrottlingPolicy(fetchArgs),
7740
+ buildThrottlingPolicy(fetchArgs, context),
7710
7741
  buildCsrfPolicy(mutableRequest),
7711
7742
  ]);
7712
7743
  return retryService.applyRetry(async () => {
@@ -10789,7 +10820,7 @@ function buildLexRuntimeCompressedFetchServiceDescriptor(logger, retryService) {
10789
10820
 
10790
10821
  const CSRF_TOKEN_KEY = 'salesforce_csrf_token';
10791
10822
  const CSRF_STORAGE_NAME = 'ldsCSRFToken';
10792
- const BASE_URI = '/services/data/v68.0';
10823
+ const BASE_URI = '/services/data/v69.0';
10793
10824
  const UI_API_BASE_URI = `${BASE_URI}/ui-api`;
10794
10825
  const CSRF_TOKEN_ENDPOINT = `${UI_API_BASE_URI}/session/csrf`;
10795
10826
  const CSRF_STORAGE_CONFIG = {
@@ -11657,4 +11688,4 @@ function ldsEngineCreator() {
11657
11688
  }
11658
11689
 
11659
11690
  export { LexRequestStrategy, PDL_ENGINE_REGISTRATION_ID, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
11660
- // version: 1.455.0-c53c97de2a
11691
+ // version: 1.457.0-b38a7243f7
@@ -13,6 +13,16 @@ export declare function getFetchMethod([urlOrRequest, options]: FetchParameters)
13
13
  * write-guard rule lives in exactly one place.
14
14
  */
15
15
  export declare function isRetryableMethod(method: string | undefined): boolean;
16
+ /**
17
+ * A request whose operationType is `query` is a read, so it is safe to replay
18
+ * automatically on 429/503 even when the transport uses a non-GET method (e.g.
19
+ * a GraphQL/aggregate-ui read issued as a POST). This complements
20
+ * `isRetryableMethod`: OneStore seeds the command's operationType into the
21
+ * per-request context, and the throttling policy retries when either the method
22
+ * is GET or the operationType is `query`. Only `query` is retryable — `mutation`
23
+ * and an absent/`graphql` operationType are never replayed.
24
+ */
25
+ export declare function isRetryableOperationType(operationType: string | undefined): boolean;
16
26
  /**
17
27
  * Determines if the HTTP method requires CSRF protection.
18
28
  * Only mutating operations (POST, PUT, PATCH, DELETE) require CSRF tokens.
@@ -3,9 +3,10 @@ import type { RetryInterceptor } from '@conduit-client/service-fetch-network/v1'
3
3
  * Builds the retry interceptor used by the generic Conduit fetch service.
4
4
  *
5
5
  * Composes two independent per-request retry policies — throttling (429/503,
6
- * GET-only) and CSRF (401 token refresh) built fresh per request rather
7
- * than reused off a shared defaultRetryPolicy. This keeps concurrent requests
8
- * from sharing mutable CSRF request-context state, and lets the throttling
9
- * policy see this request's own HTTP method.
6
+ * retryable when the method is GET or the operationType is `query`) and CSRF
7
+ * (401 token refresh) built fresh per request rather than reused off a
8
+ * shared defaultRetryPolicy. This keeps concurrent requests from sharing
9
+ * mutable CSRF request-context state, and lets the throttling policy see this
10
+ * request's own HTTP method and operationType.
10
11
  */
11
12
  export declare function buildFetchRetryInterceptor(): RetryInterceptor;
@@ -11,7 +11,8 @@ type FetchThrottlingRetryPolicyConfig = {
11
11
  export declare class FetchThrottlingRetryPolicy extends RetryPolicy<Response> {
12
12
  private config;
13
13
  private method?;
14
- constructor(config?: FetchThrottlingRetryPolicyConfig, method?: string | undefined);
14
+ private operationType?;
15
+ constructor(config?: FetchThrottlingRetryPolicyConfig, method?: string | undefined, operationType?: string | undefined);
15
16
  shouldRetry(result: Response, context: RetryContext<Response>): Promise<boolean>;
16
17
  calculateDelay(result: Response, context: RetryContext<Response>): Promise<number>;
17
18
  parseRetryAfterHeader(result: Response): number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.455.0",
3
+ "version": "1.457.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime.",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -34,59 +34,59 @@
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.26.3",
38
- "@conduit-client/tools-core": "3.26.3",
39
- "@salesforce/lds-adapters-apex": "^1.455.0",
40
- "@salesforce/lds-adapters-uiapi": "^1.455.0",
41
- "@salesforce/lds-ads-bridge": "^1.455.0",
42
- "@salesforce/lds-aura-storage": "^1.455.0",
43
- "@salesforce/lds-bindings": "^1.455.0",
44
- "@salesforce/lds-instrumentation": "^1.455.0",
45
- "@salesforce/lds-network-adapter": "^1.455.0",
46
- "@salesforce/lds-network-aura": "^1.455.0",
47
- "@salesforce/lds-network-fetch": "^1.455.0",
37
+ "@conduit-client/service-provisioner": "3.27.0",
38
+ "@conduit-client/tools-core": "3.27.0",
39
+ "@salesforce/lds-adapters-apex": "^1.457.0",
40
+ "@salesforce/lds-adapters-uiapi": "^1.457.0",
41
+ "@salesforce/lds-ads-bridge": "^1.457.0",
42
+ "@salesforce/lds-aura-storage": "^1.457.0",
43
+ "@salesforce/lds-bindings": "^1.457.0",
44
+ "@salesforce/lds-instrumentation": "^1.457.0",
45
+ "@salesforce/lds-network-adapter": "^1.457.0",
46
+ "@salesforce/lds-network-aura": "^1.457.0",
47
+ "@salesforce/lds-network-fetch": "^1.457.0",
48
48
  "jwt-encode": "1.0.1"
49
49
  },
50
50
  "dependencies": {
51
- "@conduit-client/command-aura-graphql-normalized-cache-control": "3.26.3",
52
- "@conduit-client/command-aura-network": "3.26.3",
53
- "@conduit-client/command-aura-normalized-cache-control": "3.26.3",
54
- "@conduit-client/command-fetch-network": "3.26.3",
55
- "@conduit-client/command-http-graphql-normalized-cache-control": "3.26.3",
56
- "@conduit-client/command-http-normalized-cache-control": "3.26.3",
57
- "@conduit-client/command-ndjson": "3.26.3",
58
- "@conduit-client/command-network": "3.26.3",
59
- "@conduit-client/command-sse": "3.26.3",
60
- "@conduit-client/command-streaming": "3.26.3",
61
- "@conduit-client/jwt-manager": "3.26.3",
62
- "@conduit-client/service-aura-network": "3.26.3",
63
- "@conduit-client/service-bindings-imperative": "3.26.3",
64
- "@conduit-client/service-bindings-lwc": "3.26.3",
65
- "@conduit-client/service-cache": "3.26.3",
66
- "@conduit-client/service-cache-control": "3.26.3",
67
- "@conduit-client/service-cache-inclusion-policy": "3.26.3",
68
- "@conduit-client/service-config": "3.26.3",
69
- "@conduit-client/service-feature-flags": "3.26.3",
70
- "@conduit-client/service-fetch-network": "3.26.3",
71
- "@conduit-client/service-instrument-command": "3.26.3",
72
- "@conduit-client/service-pubsub": "3.26.3",
73
- "@conduit-client/service-renewable-resource-manager": "3.26.3",
74
- "@conduit-client/service-store": "3.26.3",
75
- "@conduit-client/utils": "3.26.3",
51
+ "@conduit-client/command-aura-graphql-normalized-cache-control": "3.27.0",
52
+ "@conduit-client/command-aura-network": "3.27.0",
53
+ "@conduit-client/command-aura-normalized-cache-control": "3.27.0",
54
+ "@conduit-client/command-fetch-network": "3.27.0",
55
+ "@conduit-client/command-http-graphql-normalized-cache-control": "3.27.0",
56
+ "@conduit-client/command-http-normalized-cache-control": "3.27.0",
57
+ "@conduit-client/command-ndjson": "3.27.0",
58
+ "@conduit-client/command-network": "3.27.0",
59
+ "@conduit-client/command-sse": "3.27.0",
60
+ "@conduit-client/command-streaming": "3.27.0",
61
+ "@conduit-client/jwt-manager": "3.27.0",
62
+ "@conduit-client/service-aura-network": "3.27.0",
63
+ "@conduit-client/service-bindings-imperative": "3.27.0",
64
+ "@conduit-client/service-bindings-lwc": "3.27.0",
65
+ "@conduit-client/service-cache": "3.27.0",
66
+ "@conduit-client/service-cache-control": "3.27.0",
67
+ "@conduit-client/service-cache-inclusion-policy": "3.27.0",
68
+ "@conduit-client/service-config": "3.27.0",
69
+ "@conduit-client/service-feature-flags": "3.27.0",
70
+ "@conduit-client/service-fetch-network": "3.27.0",
71
+ "@conduit-client/service-instrument-command": "3.27.0",
72
+ "@conduit-client/service-pubsub": "3.27.0",
73
+ "@conduit-client/service-renewable-resource-manager": "3.27.0",
74
+ "@conduit-client/service-store": "3.27.0",
75
+ "@conduit-client/utils": "3.27.0",
76
76
  "@luvio/network-adapter-composable": "0.161.2",
77
77
  "@luvio/network-adapter-fetch": "0.161.2",
78
78
  "@lwc/state": "^0.29.0",
79
- "@salesforce/lds-adapters-onestore-graphql": "^1.455.0",
79
+ "@salesforce/lds-adapters-onestore-graphql": "^1.457.0",
80
80
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
81
- "@salesforce/lds-durable-storage": "^1.455.0",
82
- "@salesforce/lds-luvio-service": "^1.455.0",
83
- "@salesforce/lds-luvio-uiapi-records-service": "^1.455.0"
81
+ "@salesforce/lds-durable-storage": "^1.457.0",
82
+ "@salesforce/lds-luvio-service": "^1.457.0",
83
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.457.0"
84
84
  },
85
85
  "luvioBundlesize": [
86
86
  {
87
87
  "path": "./dist/ldsEngineCreator.js",
88
88
  "maxSize": {
89
- "none": "421 kB",
89
+ "none": "424 kB",
90
90
  "min": "190 kB",
91
91
  "compressed": "75 kB"
92
92
  }