@salesforce/lds-runtime-aura 1.428.0-dev2 → 1.428.0-dev21

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.
@@ -1,6 +1,31 @@
1
+ import { type JwtResolver } from '@conduit-client/jwt-manager';
1
2
  import { type FetchServiceDescriptor } from '@conduit-client/service-fetch-network/v1';
3
+ import { type ExtraInfo } from '../network-sfap';
2
4
  import { type LoggerService } from '@conduit-client/utils';
5
+ export declare function buildDispatchingSfapJwtResolver(legacyResolver: JwtResolver<ExtraInfo>, parameterizedResolver: JwtResolver<ExtraInfo>): JwtResolver<ExtraInfo>;
6
+ export declare function prefetchSfapJwt(): Promise<undefined>;
3
7
  export declare function buildJwtAuthorizedSfapFetchServiceDescriptor(logger: LoggerService): FetchServiceDescriptor;
8
+ /**
9
+ * Returns a service descriptor for the **direct-to-Data360** custom command
10
+ * (CDP Query v3, host `*.c360a.salesforce.com`).
11
+ *
12
+ * Unlike SFAP, the per-tenant base host is NOT returned in the mint response's
13
+ * `baseUri` (which is the fixed SFAP host); it rides on the minted JWT as the
14
+ * `cdp_url` claim. The standard `JwtRequestModifier` only receives `extraInfo`,
15
+ * never the decoded claims, so the host rewrite cannot be expressed as a modifier
16
+ * — it must read the token directly. This descriptor therefore uses a bespoke
17
+ * interceptor ({@link buildData360HostRewriteInterceptor}) that mints the
18
+ * parameterized SFAP JWT, attaches the Bearer token, decodes `cdp_url`, and
19
+ * rewrites the request host to that TSE.
20
+ *
21
+ * It reuses the module's `sfapJwtManager`: `cdp_url` is emitted on the same
22
+ * `SFAP_API`-scope JWT, so the Data360 command mints the same kind of token — it
23
+ * just forwards the data-cloud scopes via the context-seed `jwtMintParams`.
24
+ *
25
+ * Gated behind its own `data_360_cdp_url_rewrite` auth-scope tag so it binds ONLY to
26
+ * the Data360 command — the SFAP fleet never flows past this interceptor.
27
+ */
28
+ export declare function buildJwtAuthorizedData360FetchServiceDescriptor(logger: LoggerService): FetchServiceDescriptor;
4
29
  /**
5
30
  * Returns a service descriptor for a fetch service that includes one-off copilot
6
31
  * hacks. This fetch service is not intended for use by anything other than
@@ -2,6 +2,7 @@ import type { FetchResponse, ResourceRequest, ResourceRequestContext } from '@lu
2
2
  import type { JwtResolver } from '@conduit-client/jwt-manager';
3
3
  export declare const SFAPController = "SalesforceApiPlatformController";
4
4
  export declare const SFAPJwtMethod = "getSFAPLightningJwtService";
5
+ export declare const SFAPJwtPostMethod = "postSFAPLightningJwtService";
5
6
  export type ExtraInfo = {
6
7
  baseUri: string;
7
8
  };
@@ -10,7 +11,6 @@ export type ExtraInfo = {
10
11
  * {@link JwtResolver} for platform SFAP
11
12
  */
12
13
  export declare const platformSfapJwtResolver: JwtResolver<ExtraInfo>;
13
- export declare function prefetchSfapJwt(): Promise<undefined>;
14
14
  declare const composedNetworkAdapter: {
15
15
  shouldHandleRequest(resourceRequest: ResourceRequest): boolean;
16
16
  adapter: (resourceRequest: ResourceRequest, resourceRequestContext: ResourceRequestContext) => Promise<FetchResponse<any>>;
@@ -0,0 +1,34 @@
1
+ import type { JwtMintParams, JwtResolver } from '@conduit-client/jwt-manager';
2
+ import { type ParameterizedSfapExtraInfo } from './sfap-jwt-mint-params';
3
+ /**
4
+ * Parameterized SFAP JWT resolver that mints over **Aura transport** instead of a
5
+ * direct HTTP `fetch`.
6
+ *
7
+ * It dispatches the SFAP Lightning JWT Service's parameterized POST via its
8
+ * auto-generated Aura controller method
9
+ * `SalesforceApiPlatformController.postSFAPLightningJwtService` (generated by
10
+ * `@ConnectSignature(..., generateAuraMethod = true)` on the Connect resource).
11
+ * The mint inputs ride as the single `requestBody` named param, in the same
12
+ * `{ scopes, dynamicParameters: { items } }` shape the HTTP resolver POSTs — built
13
+ * by the shared {@link buildRequestBody}, so the two transports stay in lockstep.
14
+ *
15
+ * Why Aura (not the HTTP resolver): the mint endpoint is a same-origin core
16
+ * resource, and routing it over Aura keeps session/CSRF handling inside the Aura
17
+ * stack rather than issuing a credentialed cross-cutting `fetch` from the client.
18
+ * This mirrors the legacy parameterless `platformSfapJwtResolver` in
19
+ * `network-sfap.ts`, which already mints over Aura via the `getSFAPLightningJwtService`
20
+ * generated method — this is the parameterized sibling of that call.
21
+ *
22
+ * A `JwtResolver` is invoked directly by `JwtManager` (not through Luvio's
23
+ * `appRouter`/`ResourceRequest` pipeline), so the correct mechanism is a direct
24
+ * named-controller `dispatchAuraAction`, not the `auraNetworkAdapter`/connect-route
25
+ * table. The SFAP JWT endpoint is not registered as a connect-over-Aura route, and
26
+ * a resolver has no `ResourceRequest` for the router to look up.
27
+ */
28
+ export declare class ParameterizedSfapJwtAuraResolver implements JwtResolver<ParameterizedSfapExtraInfo> {
29
+ getJwt(params?: JwtMintParams): Promise<{
30
+ jwt: string;
31
+ extraInfo: ParameterizedSfapExtraInfo;
32
+ }>;
33
+ }
34
+ export declare function buildParameterizedSfapJwtAuraResolver(): ParameterizedSfapJwtAuraResolver;
@@ -0,0 +1,50 @@
1
+ import type { FetchParameters, RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
+ import { type JwtRequestModifier } from '@conduit-client/service-fetch-network/v1';
3
+ import type { JwtManager } from '@conduit-client/jwt-manager';
4
+ import type { ExtraInfo } from '../network-sfap';
5
+ /**
6
+ * The context-seed key under which a custom command forwards its JWT mint
7
+ * parameters. The framework's `buildServiceDescriptor` merges the request init's
8
+ * `__contextSeed` onto the per-request interceptor context, so this interceptor
9
+ * reads the params off `context[JWT_MINT_PARAMS_SEED_KEY]`.
10
+ *
11
+ * This is a cross-team contract: the custom command writes this key, this
12
+ * interceptor reads it. It is intentionally an opaque key — OneStore does not
13
+ * define it and never inspects the param shape; the typed shape lives in the
14
+ * resolver.
15
+ */
16
+ export declare const JWT_MINT_PARAMS_SEED_KEY = "jwtMintParams";
17
+ /**
18
+ * Returns `true` if the fetch arguments already carry an `Authorization` header,
19
+ * across the three shapes the framework's `setHeader` handles: a `Request`
20
+ * resource's own headers, an `options.headers` `Headers` instance, or a plain
21
+ * record. The descriptor's guarded legacy interceptor uses this to skip when the
22
+ * parameterized interceptor has already authorized the request — avoiding a second
23
+ * mint and the throw `setHeaderAuthorization` raises on an existing header.
24
+ */
25
+ export declare function hasAuthorizationHeader([resource, options]: FetchParameters): boolean;
26
+ /**
27
+ * Builds the request interceptor that bridges the per-request context seed to the
28
+ * dispatching SFAP JwtManager for the **parameterized** mint path.
29
+ *
30
+ * For a parameterized SFAP command, the context carries `jwtMintParams`. This
31
+ * interceptor reads them, calls `jwtManager.getJwt(params)` (which the dispatching
32
+ * resolver routes to the parameterized resolver), attaches the `Authorization`
33
+ * header, and rewrites the request URL via the minted `baseUri`. The presence of
34
+ * that `Authorization` header is the signal the descriptor's guarded legacy
35
+ * interceptor uses to skip — so the legacy path does not mint a second time.
36
+ *
37
+ * For a legacy parameterless command the context carries no `jwtMintParams`, so
38
+ * this interceptor **early-returns on its first line** and the request flows
39
+ * unchanged to the legacy `buildJwtRequestHeaderInterceptor` — guaranteeing zero
40
+ * behavior change for non-opted-in adapters.
41
+ *
42
+ * Lives in `lds-lightning-platform` (not OneStore) beside the existing SFAP/CSRF
43
+ * interceptors, per the JWT-parameterization ADR §5: OneStore provides only the
44
+ * generic interceptor mechanism and the opaque context-seed channel; the service-
45
+ * specific bridge is a runtime-layer concern.
46
+ *
47
+ * @param jwtManager - the dispatching SFAP JwtManager
48
+ * @param jwtRequestModifier - applies the minted `extraInfo.baseUri` to the request URL
49
+ */
50
+ export declare function buildJwtParameterizationInterceptor(jwtManager: JwtManager<unknown, ExtraInfo>, jwtRequestModifier?: JwtRequestModifier): RequestInterceptor;
@@ -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
  /**
@@ -0,0 +1,80 @@
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.428.0-dev2",
3
+ "version": "1.428.0-dev21",
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,60 @@
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-dev2",
40
- "@salesforce/lds-adapters-uiapi": "^1.428.0-dev2",
41
- "@salesforce/lds-ads-bridge": "^1.428.0-dev2",
42
- "@salesforce/lds-aura-storage": "^1.428.0-dev2",
43
- "@salesforce/lds-bindings": "^1.428.0-dev2",
44
- "@salesforce/lds-instrumentation": "^1.428.0-dev2",
45
- "@salesforce/lds-network-aura": "^1.428.0-dev2",
46
- "@salesforce/lds-network-fetch": "^1.428.0-dev2",
37
+ "@conduit-client/service-provisioner": "3.19.0-dev3",
38
+ "@conduit-client/tools-core": "3.19.0-dev3",
39
+ "@salesforce/lds-adapters-apex": "^1.428.0-dev21",
40
+ "@salesforce/lds-adapters-uiapi": "^1.428.0-dev21",
41
+ "@salesforce/lds-ads-bridge": "^1.428.0-dev21",
42
+ "@salesforce/lds-aura-storage": "^1.428.0-dev21",
43
+ "@salesforce/lds-bindings": "^1.428.0-dev21",
44
+ "@salesforce/lds-instrumentation": "^1.428.0-dev21",
45
+ "@salesforce/lds-network-aura": "^1.428.0-dev21",
46
+ "@salesforce/lds-network-fetch": "^1.428.0-dev21",
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",
74
- "@luvio/network-adapter-composable": "0.160.3",
75
- "@luvio/network-adapter-fetch": "0.160.3",
50
+ "@conduit-client/command-aura-graphql-normalized-cache-control": "3.19.0-dev3",
51
+ "@conduit-client/command-aura-network": "3.19.0-dev3",
52
+ "@conduit-client/command-aura-normalized-cache-control": "3.19.0-dev3",
53
+ "@conduit-client/command-aura-resource-cache-control": "3.19.0-dev3",
54
+ "@conduit-client/command-fetch-network": "3.19.0-dev3",
55
+ "@conduit-client/command-http-graphql-normalized-cache-control": "3.19.0-dev3",
56
+ "@conduit-client/command-http-normalized-cache-control": "3.19.0-dev3",
57
+ "@conduit-client/command-ndjson": "3.19.0-dev3",
58
+ "@conduit-client/command-network": "3.19.0-dev3",
59
+ "@conduit-client/command-sse": "3.19.0-dev3",
60
+ "@conduit-client/command-streaming": "3.19.0-dev3",
61
+ "@conduit-client/jwt-manager": "3.19.0-dev3",
62
+ "@conduit-client/service-aura-network": "3.19.0-dev3",
63
+ "@conduit-client/service-bindings-imperative": "3.19.0-dev3",
64
+ "@conduit-client/service-bindings-lwc": "3.19.0-dev3",
65
+ "@conduit-client/service-cache": "3.19.0-dev3",
66
+ "@conduit-client/service-cache-control": "3.19.0-dev3",
67
+ "@conduit-client/service-cache-inclusion-policy": "3.19.0-dev3",
68
+ "@conduit-client/service-config": "3.19.0-dev3",
69
+ "@conduit-client/service-feature-flags": "3.19.0-dev3",
70
+ "@conduit-client/service-fetch-network": "3.19.0-dev3",
71
+ "@conduit-client/service-instrument-command": "3.19.0-dev3",
72
+ "@conduit-client/service-pubsub": "3.19.0-dev3",
73
+ "@conduit-client/service-store": "3.19.0-dev3",
74
+ "@conduit-client/utils": "3.19.0-dev3",
75
+ "@luvio/network-adapter-composable": "0.160.4-dev1",
76
+ "@luvio/network-adapter-fetch": "0.160.4-dev1",
76
77
  "@lwc/state": "^0.29.0",
77
- "@salesforce/lds-adapters-onestore-graphql": "^1.428.0-dev2",
78
+ "@salesforce/lds-adapters-onestore-graphql": "^1.428.0-dev21",
78
79
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
79
- "@salesforce/lds-durable-storage": "^1.428.0-dev2",
80
- "@salesforce/lds-luvio-service": "^1.428.0-dev2",
81
- "@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-dev2"
80
+ "@salesforce/lds-durable-storage": "^1.428.0-dev21",
81
+ "@salesforce/lds-luvio-service": "^1.428.0-dev21",
82
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-dev21"
82
83
  },
83
84
  "luvioBundlesize": [
84
85
  {
85
86
  "path": "./dist/ldsEngineCreator.js",
86
87
  "maxSize": {
87
- "none": "370 kB",
88
+ "none": "410 kB",
88
89
  "min": "190 kB",
89
- "compressed": "61.9 kB"
90
+ "compressed": "71.5 kB"
90
91
  }
91
92
  }
92
93
  ],