@salesforce/lds-runtime-aura 1.464.0 → 1.465.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.
Files changed (34) hide show
  1. package/dist/ldsEngineCreator.js +3209 -3198
  2. package/dist/types/fetch-service-descriptors/jwt-authorized-fetch-service.d.ts +1 -1
  3. package/dist/types/network-fetch.d.ts +1 -1
  4. package/package.json +42 -41
  5. package/dist/types/aura-instrumentation/main.d.ts +0 -182
  6. package/dist/types/aura-instrumentation/state-managers.d.ts +0 -4
  7. package/dist/types/aura-instrumentation/utils/observability.d.ts +0 -36
  8. package/dist/types/aura-instrumentation/utils/utils.d.ts +0 -13
  9. package/dist/types/instrumentation-utils.d.ts +0 -14
  10. package/dist/types/language.d.ts +0 -23
  11. package/dist/types/network-sfap.d.ts +0 -18
  12. package/dist/types/parameterized-sfap-jwt-aura-resolver.d.ts +0 -34
  13. package/dist/types/request-interceptors/action-enqueue.d.ts +0 -4
  14. package/dist/types/request-interceptors/csrf-service.d.ts +0 -19
  15. package/dist/types/request-interceptors/csrf-token.d.ts +0 -19
  16. package/dist/types/request-interceptors/entity-encoding.d.ts +0 -17
  17. package/dist/types/request-interceptors/first-party-header.d.ts +0 -17
  18. package/dist/types/request-interceptors/idempotency-key.d.ts +0 -24
  19. package/dist/types/request-interceptors/jwt-parameterization.d.ts +0 -58
  20. package/dist/types/request-interceptors/luvio-page-scoped-cache.d.ts +0 -11
  21. package/dist/types/request-interceptors/page-scoped-cache.d.ts +0 -2
  22. package/dist/types/request-interceptors/transport-send.d.ts +0 -5
  23. package/dist/types/response-interceptors/action-finish.d.ts +0 -4
  24. package/dist/types/response-interceptors/error-body-normalization.d.ts +0 -20
  25. package/dist/types/response-interceptors/transport-receive.d.ts +0 -4
  26. package/dist/types/retry-interceptors/luvio-fetch-retry.d.ts +0 -11
  27. package/dist/types/retry-policies/csrf-token-retry-policy.d.ts +0 -72
  28. package/dist/types/retry-policies/fetch-throttling-retry-policy.d.ts +0 -20
  29. package/dist/types/retry-policies/luvio-csrf-token-retry-policy.d.ts +0 -24
  30. package/dist/types/retry-policies/luvio-fetch-throttling-retry-policy.d.ts +0 -19
  31. package/dist/types/retry-policies/luvio-idempotency-retry-policy.d.ts +0 -29
  32. package/dist/types/retry-policies/unconfigured-retry-policy.d.ts +0 -20
  33. package/dist/types/service-variants/durable-cache-inclusion-policy.d.ts +0 -82
  34. package/dist/types/sfap-jwt-mint-params.d.ts +0 -80
@@ -1,5 +0,0 @@
1
- import type { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
- import type { ResourceRequest } from '@luvio/engine';
3
- export declare const SFDC_REQUEST_ID_KEY = "X-SFDC-Request-Id";
4
- export declare function buildTransportMarksSendInterceptor(): RequestInterceptor;
5
- export declare function buildLuvioTransportMarksSendInterceptor(): (resourceRequest: ResourceRequest, context?: any) => PromiseLike<ResourceRequest>;
@@ -1,4 +0,0 @@
1
- import type { ResponseInterceptor } from '@conduit-client/service-fetch-network/v1';
2
- import type { ResponseInterceptor as LuvioResponseInterceptor } from '@salesforce/lds-network-fetch';
3
- export declare function buildActionMarksReceiveInterceptor(): ResponseInterceptor;
4
- export declare function buildLuvioActionMarksReceiveInterceptor(): LuvioResponseInterceptor;
@@ -1,20 +0,0 @@
1
- import type { ResponseInterceptor as LuvioResponseInterceptor } from '@salesforce/lds-network-fetch';
2
- /**
3
- * Normalizes Connect REST error envelopes into the Aura Shape A
4
- * (ConnectInJava) shape, so consumers can read `response.body.errorCode`
5
- * regardless of transport.
6
- *
7
- * - HTTP error envelope (this path): `[{ errorCode, message }, ...]`
8
- * - Aura Shape A: `{ errorCode, message, statusCode, ... }`
9
- *
10
- * The full array is preserved at `body.enhancedErrorInfo.allErrors` since
11
- * Connect can return multiple errors per response.
12
- *
13
- * Aura Shape B (`{ error: "..." }`) is an Aura-only fallback that never
14
- * appears on the HTTP path, so no normalization is needed for it here.
15
- *
16
- * Ordering: must run AFTER any other interceptor that inspects the raw
17
- * error body shape (e.g. the 5xx interceptor's ErrorId extraction reads
18
- * `body[0].message` from the array form).
19
- */
20
- export declare function buildLuvioErrorBodyNormalizationInterceptor(): LuvioResponseInterceptor;
@@ -1,4 +0,0 @@
1
- import type { ResponseInterceptor } from '@conduit-client/service-fetch-network/v1';
2
- import type { ResponseInterceptor as LuvioResponseInterceptor } from '@salesforce/lds-network-fetch';
3
- export declare function buildTransportMarksReceiveInterceptor(): ResponseInterceptor;
4
- export declare function buildLuvioTransportMarksReceiveInterceptor(): LuvioResponseInterceptor;
@@ -1,11 +0,0 @@
1
- import type { LuvioRetryInterceptor } from '@salesforce/lds-network-fetch';
2
- /**
3
- * Builds the LuvioRetryInterceptor used by the UIAPI fetch adapter. A fresh
4
- * RetryService and policies are created per request to keep the
5
- * mutableRequest context isolated across concurrent requests.
6
- *
7
- * Policy order matters: ComposedRetryPolicy uses the first matching policy's
8
- * shouldRetry/delay. A keyed-write 503 fails throttling's method gate, so it
9
- * falls to the idempotency policy to replay same-key.
10
- */
11
- export declare function buildLuvioFetchRetryInterceptor(): LuvioRetryInterceptor;
@@ -1,72 +0,0 @@
1
- import type { RetryContext } from '@conduit-client/service-retry/v1';
2
- import { RetryPolicy } from '@conduit-client/service-retry/v1';
3
- import type { FetchParameters } from '@conduit-client/service-fetch-network/v1';
4
- type CsrfTokenRetryPolicyConfig = {
5
- /**
6
- * Maximum number of retry attempts for CSRF token refresh.
7
- * Typically should be 1 since we only want to retry once after refreshing.
8
- */
9
- maxRetries: number;
10
- };
11
- /**
12
- * Mutable container for fetch arguments that can be modified between retries.
13
- */
14
- export interface MutableFetchRequest {
15
- args: FetchParameters;
16
- }
17
- /**
18
- * Retry policy that handles CSRF token expiration errors.
19
- *
20
- * When a request fails with a CSRF token error this policy will:
21
- * 1. Detect the error condition in shouldRetry
22
- * 2. Refresh the CSRF token in prepareRetry hook
23
- * 3. Update the request headers with the new token via mutable context
24
- * 4. Retry the request once (maxRetries = 1)
25
- *
26
- */
27
- export declare class CsrfTokenRetryPolicy extends RetryPolicy<Response> {
28
- private config;
29
- private requestContext?;
30
- constructor(config?: CsrfTokenRetryPolicyConfig);
31
- /**
32
- * Allows the fetch service to pass mutable request context.
33
- * This is a side-channel that enables request modification between retries.
34
- *
35
- * @param context - Mutable container holding fetch arguments
36
- */
37
- setRequestContext(context: MutableFetchRequest): void;
38
- /**
39
- * Determines if a failed request should be retried due to CSRF token issues.
40
- */
41
- shouldRetry(result: Response, context: RetryContext<Response>): Promise<boolean>;
42
- /**
43
- * CSRF token refresh should happen immediately with no delay.
44
- */
45
- calculateDelay(_result: Response, _context: RetryContext<Response>): Promise<number>;
46
- /**
47
- * Called by retry service before each retry attempt.
48
- *
49
- * This hook is supported by the Conduit retry service (with prepareRetry support).
50
- * It performs token refresh and request update:
51
- * 1. Refreshes the CSRF token from the server
52
- * 2. Updates the mutable request context with the new token
53
- *
54
- * Note: We already validated this is a CSRF error in shouldRetry,
55
- * so we can proceed directly to token refresh.
56
- *
57
- * The fetch service must call setRequestContext() to provide the mutable args container.
58
- * When the retry service re-executes the operation, it will use the updated args.
59
- *
60
- * @param _result - The failed response that triggered the retry (unused, already validated)
61
- * @param _context - Current retry context (unused but part of interface)
62
- */
63
- prepareRetry(_result: Response, _context: RetryContext<Response>): Promise<void>;
64
- }
65
- /**
66
- * Helper to check if a response indicates a CSRF token error.
67
- *
68
- * @param response - The response to check
69
- * @returns true if the response indicates a CSRF token error (INVALID_ACCESS_TOKEN)
70
- */
71
- export declare function isCsrfError(response: Response): Promise<boolean>;
72
- export {};
@@ -1,20 +0,0 @@
1
- import type { RetryContext } from '@conduit-client/service-retry/v1';
2
- import { RetryPolicy } from '@conduit-client/service-retry/v1';
3
- type FetchThrottlingRetryPolicyConfig = {
4
- maxRetries: number;
5
- maxTimeToRetry: number;
6
- baseDelay: number;
7
- maxDelay: number;
8
- exponentialFactor: number;
9
- jitterPercent: number;
10
- };
11
- export declare class FetchThrottlingRetryPolicy extends RetryPolicy<Response> {
12
- private config;
13
- private method?;
14
- private operationType?;
15
- constructor(config?: FetchThrottlingRetryPolicyConfig, method?: string | undefined, operationType?: string | undefined);
16
- shouldRetry(result: Response, context: RetryContext<Response>): Promise<boolean>;
17
- calculateDelay(result: Response, context: RetryContext<Response>): Promise<number>;
18
- parseRetryAfterHeader(result: Response): number | undefined;
19
- }
20
- export {};
@@ -1,24 +0,0 @@
1
- import type { RetryContext } from '@conduit-client/service-retry/v1';
2
- import { RetryPolicy } from '@conduit-client/service-retry/v1';
3
- import type { FetchResponse, ResourceRequest } from '@luvio/engine';
4
- type LuvioCsrfTokenRetryPolicyConfig = {
5
- maxRetries: number;
6
- };
7
- /**
8
- * Mutable container for the ResourceRequest that can be updated between retries.
9
- */
10
- export interface MutableLuvioRequest {
11
- request: ResourceRequest;
12
- }
13
- export declare class LuvioCsrfTokenRetryPolicy extends RetryPolicy<FetchResponse<any>> {
14
- private config;
15
- private requestContext?;
16
- constructor(config?: LuvioCsrfTokenRetryPolicyConfig);
17
- setRequestContext(context: MutableLuvioRequest): void;
18
- shouldRetry(result: FetchResponse<any>, context: RetryContext<FetchResponse<any>>): Promise<boolean>;
19
- calculateDelay(_result: FetchResponse<any>, _context: RetryContext<FetchResponse<any>>): Promise<number>;
20
- prepareRetry(_result: FetchResponse<any>, _context: RetryContext<FetchResponse<any>>): Promise<void>;
21
- }
22
- /** True when a Luvio FetchResponse indicates a CSRF token error. */
23
- export declare function isCsrfError(response: FetchResponse<any>): boolean;
24
- export {};
@@ -1,19 +0,0 @@
1
- import { RetryPolicy, type RetryContext } from '@conduit-client/service-retry/v1';
2
- import type { FetchResponse, ResourceRequest } from '@luvio/engine';
3
- type LuvioFetchThrottlingRetryPolicyConfig = {
4
- maxRetries: number;
5
- maxTimeToRetry: number;
6
- baseDelay: number;
7
- maxDelay: number;
8
- exponentialFactor: number;
9
- jitterPercent: number;
10
- };
11
- export declare class LuvioFetchThrottlingRetryPolicy extends RetryPolicy<FetchResponse<any>> {
12
- private config;
13
- private request?;
14
- constructor(config?: LuvioFetchThrottlingRetryPolicyConfig, request?: ResourceRequest | undefined);
15
- shouldRetry(result: FetchResponse<any>, context: RetryContext<FetchResponse<any>>): Promise<boolean>;
16
- calculateDelay(result: FetchResponse<any>, context: RetryContext<FetchResponse<any>>): Promise<number>;
17
- parseRetryAfterHeader(result: FetchResponse<any>): number | undefined;
18
- }
19
- export {};
@@ -1,29 +0,0 @@
1
- import type { RetryContext } from '@conduit-client/service-retry/v1';
2
- import { RetryPolicy } from '@conduit-client/service-retry/v1';
3
- import type { FetchResponse } from '@luvio/engine';
4
- import type { MutableLuvioRequest } from './luvio-csrf-token-retry-policy';
5
- type LuvioIdempotencyRetryPolicyConfig = {
6
- maxRetries: number;
7
- };
8
- /**
9
- * Retry policy for writes carrying an `Idempotency-Key`. A peer of the CSRF and
10
- * throttling policies in the composed retry chain, not a modification of
11
- * either: its 503 (keyed-write lock-acquire) and throttling's 503 (keyless
12
- * GET/read-POST) never contend because they key off different requests, and it
13
- * only claims a 400/409 when the body carries an idempotency-specific
14
- * errorCode, so it never steals CSRF's INVALID_ACCESS_TOKEN.
15
- *
16
- * Eligibility follows from the header's *presence* on the request, not from
17
- * the mint interceptor's registry flag — so a stale flag can never cause an
18
- * unsafe replay.
19
- */
20
- export declare class LuvioIdempotencyRetryPolicy extends RetryPolicy<FetchResponse<any>> {
21
- private config;
22
- private requestContext?;
23
- constructor(config?: LuvioIdempotencyRetryPolicyConfig);
24
- setRequestContext(context: MutableLuvioRequest): void;
25
- shouldRetry(result: FetchResponse<any>, context: RetryContext<FetchResponse<any>>): Promise<boolean>;
26
- calculateDelay(result: FetchResponse<any>, _context: RetryContext<FetchResponse<any>>): Promise<number>;
27
- prepareRetry(result: FetchResponse<any>, _context: RetryContext<FetchResponse<any>>): Promise<void>;
28
- }
29
- export {};
@@ -1,20 +0,0 @@
1
- import type { RetryContext } from '@conduit-client/service-retry/v1';
2
- import { RetryPolicy } from '@conduit-client/service-retry/v1';
3
- /**
4
- * The default policy for the runtime's shared retry service.
5
- *
6
- * Every fetch-service descriptor wired with the retry service also supplies its
7
- * own `retry:` interceptor, which passes a per-request policy as the override to
8
- * `applyRetry` — so this default is never consulted on any real path. It is
9
- * reachable only if a descriptor is registered with the retry service but omits
10
- * its `retry:` interceptor; in that case service-fetch-network falls back to
11
- * `retryService.applyRetry(fetch)` with no override, and this policy runs.
12
- *
13
- * That is a wiring mistake, not a runtime condition. We surface it loudly in
14
- * development rather than silently degrading to never-retry (the behavior of a
15
- * plain empty policy), following the repo convention for should-never-run paths.
16
- */
17
- export declare class UnconfiguredRetryPolicy extends RetryPolicy<Response> {
18
- shouldRetry(_result: Response, _context: RetryContext<Response>): Promise<boolean>;
19
- calculateDelay(_result: Response, _context: RetryContext<Response>): Promise<number>;
20
- }
@@ -1,82 +0,0 @@
1
- import { type StorageConfig } from '@salesforce/lds-durable-storage';
2
- import { type CacheInclusionPolicyServiceDescriptor, type CacheQuery, type CacheUpdate, DurableCacheInclusionPolicy } from '@conduit-client/service-cache-inclusion-policy/v1';
3
- import type { Cache, CacheEntry, Key } from '@conduit-client/service-cache/v1';
4
- import type { DeepReadonly } from '@conduit-client/utils';
5
- /**
6
- * Configuration options for AuraDurableCacheInclusionPolicy
7
- */
8
- export type DurableCacheConfig = Partial<StorageConfig>;
9
- /**
10
- * Durable cache inclusion policy that uses AuraStorage for persistent L2 cache
11
- */
12
- export declare class AuraDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
13
- private readonly storage;
14
- constructor(config?: DurableCacheConfig);
15
- /**
16
- * Revive cache entries from AuraStorage into L1 cache
17
- * @param keys - Set of keys to revive
18
- * @param l1 - L1 cache instance
19
- * @returns Set of keys that were successfully revived
20
- */
21
- revive(keys: Set<Key>, l1: Cache): Promise<Set<Key>>;
22
- /**
23
- * Sync changed keys from L1 cache to AuraStorage (L2 cache)
24
- * @param changedKeys - Set of keys that have changed
25
- * @param l1 - L1 cache instance
26
- */
27
- syncToL2Cache(changedKeys: Set<Key>, l1: Cache): Promise<void>;
28
- /**
29
- * Find entries matching a query
30
- * @param query - Cache query to match entries
31
- */
32
- find(query: CacheQuery): AsyncGenerator<[key: Key, value: DeepReadonly<CacheEntry<unknown>>], void, unknown>;
33
- /**
34
- * Find and modify entries matching a query
35
- * @param query - Cache query to match entries
36
- * @param cacheUpdate - Update to apply to matching entries
37
- *
38
- * Note: This method does not publish cache events. Callers should publish
39
- * appropriate cache events (e.g., 'cacheEviction') after eviction operations
40
- * to notify subscribers.
41
- */
42
- findAndModify(query: CacheQuery, cacheUpdate: CacheUpdate): AsyncGenerator<Key, void, unknown>;
43
- /**
44
- * Check if an entry matches a cache query
45
- * @param key - Cache key to check
46
- * @param entry - Cache entry to check
47
- * @param query - Query to match against
48
- * @returns true if the entry matches the query
49
- */
50
- private matchesQuery;
51
- private isAndQuery;
52
- private isOrQuery;
53
- private isNotQuery;
54
- private matchesKey;
55
- private matchesMetadata;
56
- /**
57
- * Apply an update to a cache entry
58
- * @param entry - Original cache entry
59
- * @param update - Update to apply
60
- * @returns Object indicating the result: modified entry, deleted marker, or no-op
61
- */
62
- private applyUpdate;
63
- /**
64
- * Build an update for a cache entry
65
- * @param update - The cache update operation to apply
66
- * @param existing - The existing cache entry being modified
67
- * @returns An object indicating the type of update
68
- */
69
- private buildUpdate;
70
- /**
71
- * Build an invalidated cache control metadata
72
- * @param existingCacheControl - The current CacheControlMetadata
73
- * @returns A new CacheControlMetadata object with maxAge set to 0, or undefined if no changes needed
74
- */
75
- private buildInvalidatedCacheControl;
76
- }
77
- /**
78
- * Factory function to create an AuraDurableCacheInclusionPolicy service descriptor
79
- * @param config - Optional configuration for the storage
80
- * @returns Service descriptor for the cache inclusion policy
81
- */
82
- export declare function buildAuraDurableCacheInclusionPolicyService(config?: DurableCacheConfig): CacheInclusionPolicyServiceDescriptor;
@@ -1,80 +0,0 @@
1
- import type { JwtMintParams } from '@conduit-client/jwt-manager';
2
- /**
3
- * JSON-primitive value a dynamic mint parameter may take.
4
- *
5
- * Mirrors the SFAP Lightning JWT Service's own `validateValue`
6
- * (`SFAPLightningJwtServiceResource.java`), which accepts native `Boolean`,
7
- * `Number`, or `String` and lets the minted claim's type follow the JSON type.
8
- * The resolver therefore forwards these primitives verbatim — it must NOT
9
- * stringify booleans/numbers, because the `data_cloud_user_claims` handler gates
10
- * on native `Boolean.TRUE.equals(...)` and silently drops a stringified `"true"`.
11
- */
12
- export type SfapDynamicParamValue = string | boolean | number;
13
- /**
14
- * Typed shape of the params the SFAP Lightning JWT Service understands.
15
- * Lives in the resolver layer because OneStore is param-shape-agnostic; it
16
- * sees only an opaque `JwtMintParams` bag and stable-JSON-stringifies it for
17
- * cache keying.
18
- */
19
- export type SfapJwtMintParams = {
20
- scopes?: string[];
21
- dynamicParams?: Record<string, SfapDynamicParamValue>;
22
- };
23
- /**
24
- * The `extraInfo` the SFAP JWT resolver returns alongside the minted token: the
25
- * per-tenant base URI the downstream SFAP API request is rewritten to.
26
- */
27
- export type ParameterizedSfapExtraInfo = {
28
- baseUri: string;
29
- };
30
- type DynamicParameterItem = {
31
- name: string;
32
- value: SfapDynamicParamValue;
33
- };
34
- /**
35
- * The SFAP Lightning JWT Service mint request body. Sent as the `requestBody`
36
- * named param of the `postSFAPLightningJwtService` Aura controller method.
37
- * Matches the server's `SFAPLightningJwtServiceInputRepresentation`: `scopes` is
38
- * a single space-delimited string; `dynamicParameters` is `{ items: [{ name, value }] }`.
39
- */
40
- export type SfapJwtRequestBody = {
41
- scopes?: string;
42
- dynamicParameters?: {
43
- items: DynamicParameterItem[];
44
- };
45
- };
46
- /**
47
- * Normalize SFAP-shaped params into the opaque `JwtMintParams` bag that callers
48
- * hand to `JwtManager.getJwt(params)`. Scopes are sorted because they are
49
- * semantically a set — without this, `['a', 'b']` and `['b', 'a']` would cache
50
- * as separate entries (OneStore treats arrays as ordered under stable-JSON
51
- * serialization; see ADR "JWT Parameterization" §2).
52
- *
53
- * MANDATORY CONSUMER ENTRY POINT. Every consumer that mints a parameterized
54
- * SFAP JWT MUST assemble its params through this function before calling the
55
- * manager. The cache key is derived by `JwtManager` from the caller's params
56
- * (`cacheKeyFor(params)`) *before* the resolver runs — so the resolver cannot
57
- * normalize after the fact. Set-stable caching therefore depends on the caller
58
- * routing params through here. Do NOT sort inside the resolver: that would only
59
- * reorder the wire body, not the cache key, and mutating the caller's params
60
- * mid-call would desync the in-flight-dedup key from the stored-token key.
61
- */
62
- export declare function buildSfapJwtMintParams(params: SfapJwtMintParams): JwtMintParams;
63
- export type SfapParamsResult = {
64
- params: SfapJwtMintParams;
65
- } | {
66
- error: string;
67
- };
68
- /**
69
- * Validate and narrow an opaque `JwtMintParams` bag to the SFAP-shaped subset the
70
- * resolver forwards. Returns `{ error }` (surfaced as a resolver rejection) for a
71
- * malformed bag rather than throwing.
72
- */
73
- export declare function coerceToSfapParams(params: JwtMintParams): SfapParamsResult;
74
- /**
75
- * Build the SFAP mint request body from the coerced params: `scopes` joined into a
76
- * single space-delimited string, `dynamicParams` mapped to `dynamicParameters.items`.
77
- * Empty scopes / dynamic params are omitted.
78
- */
79
- export declare function buildRequestBody(params: SfapJwtMintParams): SfapJwtRequestBody;
80
- export {};