@salesforce/lds-runtime-one-app 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.
@@ -1446,10 +1446,23 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
1446
1446
  this.services = services;
1447
1447
  this.additionalNullResponses = [];
1448
1448
  }
1449
+ /**
1450
+ * The command's operation type. Generated command subclasses override this
1451
+ * getter with their concrete operation (see the generator's
1452
+ * `generateOperationType`); the base returns `undefined` for commands that
1453
+ * don't declare one (e.g. hand-written commands). Transport-layer
1454
+ * interceptors use it to tell a read (`query`) apart from a write — see
1455
+ * `fetch`, which folds it into the context seed.
1456
+ */
1457
+ get operationType() {
1458
+ return void 0;
1459
+ }
1449
1460
  fetch(contextSeed) {
1450
1461
  try {
1451
1462
  const [input, init] = this.fetchParams;
1452
- const initWithSeed = contextSeed === void 0 ? init : { ...init, __contextSeed: contextSeed };
1463
+ const operationType = this.operationType;
1464
+ const seed = operationType === void 0 ? contextSeed : { operationType, ...contextSeed };
1465
+ const initWithSeed = seed === void 0 ? init : { ...init, __contextSeed: seed };
1453
1466
  const fetchCall = initWithSeed === void 0 ? this.services.fetch(input) : this.services.fetch(input, initWithSeed);
1454
1467
  return this.convertFetchResponseToData(fetchCall);
1455
1468
  } catch (reason) {
@@ -2588,7 +2601,7 @@ function buildServiceDescriptor$d(luvio) {
2588
2601
  },
2589
2602
  };
2590
2603
  }
2591
- // version: 1.455.0-c53c97de2a
2604
+ // version: 1.457.0-b38a7243f7
2592
2605
 
2593
2606
  class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheControlCommand {
2594
2607
  constructor(config, documentRootType, services) {
@@ -2927,7 +2940,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
2927
2940
  },
2928
2941
  };
2929
2942
  }
2930
- // version: 1.455.0-c53c97de2a
2943
+ // version: 1.457.0-b38a7243f7
2931
2944
 
2932
2945
  class RetryService {
2933
2946
  constructor(defaultRetryPolicy) {
@@ -5849,7 +5862,7 @@ function getEnvironmentSetting(name) {
5849
5862
  }
5850
5863
  return undefined;
5851
5864
  }
5852
- // version: 1.455.0-96e9b41a18
5865
+ // version: 1.457.0-5118f3b372
5853
5866
 
5854
5867
  /**
5855
5868
  * Helpers for reaching the Aura framework from the LDS Aura runtime.
@@ -6446,6 +6459,18 @@ function getFetchMethod([urlOrRequest, options]) {
6446
6459
  function isRetryableMethod(method) {
6447
6460
  return method?.toLowerCase() === 'get';
6448
6461
  }
6462
+ /**
6463
+ * A request whose operationType is `query` is a read, so it is safe to replay
6464
+ * automatically on 429/503 even when the transport uses a non-GET method (e.g.
6465
+ * a GraphQL/aggregate-ui read issued as a POST). This complements
6466
+ * `isRetryableMethod`: OneStore seeds the command's operationType into the
6467
+ * per-request context, and the throttling policy retries when either the method
6468
+ * is GET or the operationType is `query`. Only `query` is retryable — `mutation`
6469
+ * and an absent/`graphql` operationType are never replayed.
6470
+ */
6471
+ function isRetryableOperationType(operationType) {
6472
+ return operationType === 'query';
6473
+ }
6449
6474
  /**
6450
6475
  * Determines if the HTTP method requires CSRF protection.
6451
6476
  * Only mutating operations (POST, PUT, PATCH, DELETE) require CSRF tokens.
@@ -7544,13 +7569,17 @@ const DEFAULT_CONFIG = {
7544
7569
  jitterPercent: 0.5,
7545
7570
  };
7546
7571
  class FetchThrottlingRetryPolicy extends RetryPolicy {
7547
- constructor(config = DEFAULT_CONFIG, method) {
7572
+ constructor(config = DEFAULT_CONFIG, method, operationType) {
7548
7573
  super();
7549
7574
  this.config = config;
7550
7575
  this.method = method;
7576
+ this.operationType = operationType;
7551
7577
  }
7552
7578
  async shouldRetry(result, context) {
7553
- return (isRetryableMethod(this.method) &&
7579
+ // A request is safe to replay when it's a GET or when OneStore has
7580
+ // flagged it as a read (operationType === 'query'), covering reads
7581
+ // issued over a non-GET method. Writes stay non-retryable.
7582
+ return ((isRetryableMethod(this.method) || isRetryableOperationType(this.operationType)) &&
7554
7583
  (result.status === 429 || result.status === 503) &&
7555
7584
  context.attempt < this.config.maxRetries &&
7556
7585
  context.totalElapsedMs <= this.config.maxTimeToRetry);
@@ -7616,19 +7645,21 @@ function buildCsrfPolicy(mutableRequest) {
7616
7645
  }
7617
7646
  /**
7618
7647
  * Built fresh per request so the write-guard check sees this request's own
7619
- * HTTP method, rather than one method baked in for the life of the service.
7648
+ * HTTP method and operationType, rather than values baked in for the life of
7649
+ * the service.
7620
7650
  */
7621
- function buildThrottlingPolicy(fetchArgs) {
7622
- return new FetchThrottlingRetryPolicy(undefined, getFetchMethod(fetchArgs));
7651
+ function buildThrottlingPolicy(fetchArgs, context) {
7652
+ return new FetchThrottlingRetryPolicy(undefined, getFetchMethod(fetchArgs), context?.operationType);
7623
7653
  }
7624
7654
  /**
7625
7655
  * Builds the retry interceptor used by the generic Conduit fetch service.
7626
7656
  *
7627
7657
  * Composes two independent per-request retry policies — throttling (429/503,
7628
- * GET-only) and CSRF (401 token refresh) — built fresh per request rather
7629
- * than reused off a shared defaultRetryPolicy. This keeps concurrent requests
7630
- * from sharing mutable CSRF request-context state, and lets the throttling
7631
- * policy see this request's own HTTP method.
7658
+ * retryable when the method is GET or the operationType is `query`) and CSRF
7659
+ * (401 token refresh) — built fresh per request rather than reused off a
7660
+ * shared defaultRetryPolicy. This keeps concurrent requests from sharing
7661
+ * mutable CSRF request-context state, and lets the throttling policy see this
7662
+ * request's own HTTP method and operationType.
7632
7663
  *
7633
7664
  * The `retryService` handed in by the framework is used only as the runner for
7634
7665
  * `applyRetry` — the real policy is always the per-request `composedPolicy`
@@ -7637,11 +7668,11 @@ function buildThrottlingPolicy(fetchArgs) {
7637
7668
  * intentionally opt out of retries), we fall through to a plain fetch.
7638
7669
  */
7639
7670
  function buildFetchRetryInterceptor() {
7640
- return async (fetchArgs, retryService, _context) => {
7671
+ return async (fetchArgs, retryService, context) => {
7641
7672
  if (retryService) {
7642
7673
  const mutableRequest = { args: fetchArgs };
7643
7674
  const composedPolicy = new ComposedRetryPolicy([
7644
- buildThrottlingPolicy(fetchArgs),
7675
+ buildThrottlingPolicy(fetchArgs, context),
7645
7676
  buildCsrfPolicy(mutableRequest),
7646
7677
  ]);
7647
7678
  return retryService.applyRetry(async () => {
@@ -10724,7 +10755,7 @@ function buildLexRuntimeCompressedFetchServiceDescriptor(logger, retryService) {
10724
10755
 
10725
10756
  const CSRF_TOKEN_KEY = 'salesforce_csrf_token';
10726
10757
  const CSRF_STORAGE_NAME = 'ldsCSRFToken';
10727
- const BASE_URI = '/services/data/v68.0';
10758
+ const BASE_URI = '/services/data/v69.0';
10728
10759
  const UI_API_BASE_URI = `${BASE_URI}/ui-api`;
10729
10760
  const CSRF_TOKEN_ENDPOINT = `${UI_API_BASE_URI}/session/csrf`;
10730
10761
  const CSRF_STORAGE_CONFIG = {
@@ -11579,4 +11610,4 @@ function ldsEngineCreator() {
11579
11610
  }
11580
11611
 
11581
11612
  export { LexRequestStrategy, PDL_ENGINE_REGISTRATION_ID, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
11582
- // version: 1.455.0-c53c97de2a
11613
+ // 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,10 +3,11 @@ 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
  * The `retryService` handed in by the framework is used only as the runner for
12
13
  * `applyRetry` — the real policy is always the per-request `composedPolicy`
@@ -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-one-app",
3
- "version": "1.455.0",
3
+ "version": "1.457.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for the one.app (LEX) runtime.",
6
6
  "main": "dist/oneAppLdsEngineCreator.js",
@@ -34,59 +34,59 @@
34
34
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-one-app"
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/oneAppLdsEngineCreator.js",
88
88
  "maxSize": {
89
- "none": "418 kB",
89
+ "none": "421 kB",
90
90
  "min": "190 kB",
91
91
  "compressed": "74 kB"
92
92
  }