@salesforce/lds-runtime-aura 1.428.0-dev20 → 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.
package/dist/ldsEngineCreator.js
CHANGED
|
@@ -2763,7 +2763,7 @@ function buildServiceDescriptor$d(luvio) {
|
|
|
2763
2763
|
},
|
|
2764
2764
|
};
|
|
2765
2765
|
}
|
|
2766
|
-
// version: 1.428.0-
|
|
2766
|
+
// version: 1.428.0-dev21-133a7da4f5
|
|
2767
2767
|
|
|
2768
2768
|
/*!
|
|
2769
2769
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -3116,7 +3116,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
3116
3116
|
},
|
|
3117
3117
|
};
|
|
3118
3118
|
}
|
|
3119
|
-
// version: 1.428.0-
|
|
3119
|
+
// version: 1.428.0-dev21-133a7da4f5
|
|
3120
3120
|
|
|
3121
3121
|
/*!
|
|
3122
3122
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -5992,7 +5992,7 @@ function getEnvironmentSetting(name) {
|
|
|
5992
5992
|
}
|
|
5993
5993
|
return undefined;
|
|
5994
5994
|
}
|
|
5995
|
-
// version: 1.428.0-
|
|
5995
|
+
// version: 1.428.0-dev21-133a7da4f5
|
|
5996
5996
|
|
|
5997
5997
|
const environmentHasAura = typeof window !== 'undefined' && typeof window.$A !== 'undefined';
|
|
5998
5998
|
const defaultConfig = {
|
|
@@ -7354,6 +7354,27 @@ function buildJwtParameterizationInterceptor(jwtManager, jwtRequestModifier = (_
|
|
|
7354
7354
|
}
|
|
7355
7355
|
|
|
7356
7356
|
const SFAP_BASE_URL = 'api.salesforce.com';
|
|
7357
|
+
// The fetch-service tag the Data360 (direct-to-Data Cloud) custom command binds
|
|
7358
|
+
// to. Distinct from SFAP's `sfap_api` so the Data360 host-rewrite interceptor only
|
|
7359
|
+
// ever runs for that command — zero blast radius on the SFAP fleet.
|
|
7360
|
+
//
|
|
7361
|
+
// The tag is deliberately named after the *mechanism* (the `cdp_url` host rewrite),
|
|
7362
|
+
// not a capability, because this whole descriptor is interim: it exists only while
|
|
7363
|
+
// the mint service returns the fixed SFAP `baseUri` regardless of platform. When the
|
|
7364
|
+
// service returns the correct per-platform `baseUri`, the data 360 route can be re-evaluated.
|
|
7365
|
+
// This mechanism is NOT intended to be re-used outside of this initial context.
|
|
7366
|
+
// This is a client-side routing key only.
|
|
7367
|
+
const DATA_360_CDP_URL_REWRITE_AUTH_SCOPE = 'data_360_cdp_url_rewrite';
|
|
7368
|
+
// The minted-JWT claim carrying the Data Cloud tenant-specific endpoint (TSE).
|
|
7369
|
+
// The server's `SFAPJwtClaimHandlerImpl` emits it for CDP-provisioned orgs as a
|
|
7370
|
+
// verbatim passthrough of `DataCloudTenant.getApiEndpoint()` — no normalization.
|
|
7371
|
+
// The exact FORM therefore varies and must not be assumed: it may be a bare host
|
|
7372
|
+
// (`<hash>.c360a.salesforce.com`) or a full URL with scheme
|
|
7373
|
+
// (`https://a360.cdp.<region>.aws.sfdc.cl`), and the suffix is cloud-dependent
|
|
7374
|
+
// (commercial `.salesforce.com`, substrate `.aws.sfdc.cl`, GovCloud
|
|
7375
|
+
// `.salesforce.mil`). This is why the interceptor strips any scheme before parsing
|
|
7376
|
+
// and applies no host-suffix policy — see the interceptor docblock's trust boundary.
|
|
7377
|
+
const CDP_URL_CLAIM = 'cdp_url';
|
|
7357
7378
|
function buildDispatchingSfapJwtResolver(legacyResolver, parameterizedResolver) {
|
|
7358
7379
|
return {
|
|
7359
7380
|
getJwt(params) {
|
|
@@ -7397,6 +7418,46 @@ function buildJwtAuthorizedSfapFetchServiceDescriptor(logger) {
|
|
|
7397
7418
|
tags: { authenticationScopes: 'sfap_api' },
|
|
7398
7419
|
};
|
|
7399
7420
|
}
|
|
7421
|
+
/**
|
|
7422
|
+
* Returns a service descriptor for the **direct-to-Data360** custom command
|
|
7423
|
+
* (CDP Query v3, host `*.c360a.salesforce.com`).
|
|
7424
|
+
*
|
|
7425
|
+
* Unlike SFAP, the per-tenant base host is NOT returned in the mint response's
|
|
7426
|
+
* `baseUri` (which is the fixed SFAP host); it rides on the minted JWT as the
|
|
7427
|
+
* `cdp_url` claim. The standard `JwtRequestModifier` only receives `extraInfo`,
|
|
7428
|
+
* never the decoded claims, so the host rewrite cannot be expressed as a modifier
|
|
7429
|
+
* — it must read the token directly. This descriptor therefore uses a bespoke
|
|
7430
|
+
* interceptor ({@link buildData360HostRewriteInterceptor}) that mints the
|
|
7431
|
+
* parameterized SFAP JWT, attaches the Bearer token, decodes `cdp_url`, and
|
|
7432
|
+
* rewrites the request host to that TSE.
|
|
7433
|
+
*
|
|
7434
|
+
* It reuses the module's `sfapJwtManager`: `cdp_url` is emitted on the same
|
|
7435
|
+
* `SFAP_API`-scope JWT, so the Data360 command mints the same kind of token — it
|
|
7436
|
+
* just forwards the data-cloud scopes via the context-seed `jwtMintParams`.
|
|
7437
|
+
*
|
|
7438
|
+
* Gated behind its own `data_360_cdp_url_rewrite` auth-scope tag so it binds ONLY to
|
|
7439
|
+
* the Data360 command — the SFAP fleet never flows past this interceptor.
|
|
7440
|
+
*/
|
|
7441
|
+
function buildJwtAuthorizedData360FetchServiceDescriptor(logger) {
|
|
7442
|
+
const data360FetchService = buildServiceDescriptor$2({
|
|
7443
|
+
createContext: createInstrumentationIdContext(),
|
|
7444
|
+
request: [
|
|
7445
|
+
buildThirdPartyTrackerRegisterInterceptor(),
|
|
7446
|
+
buildData360HostRewriteInterceptor(logger),
|
|
7447
|
+
// Compression runs LAST, after the host-rewrite interceptor has minted,
|
|
7448
|
+
// attached the Bearer token, and rewritten the URL — so it only ever sees
|
|
7449
|
+
// the final request body. It is a strict pass-through: bodies that are
|
|
7450
|
+
// missing, non-string, or under the 1KB threshold flow through untouched,
|
|
7451
|
+
// preserving the tuple (URL + Authorization header) the rewrite produced.
|
|
7452
|
+
buildCompressionInterceptor({ algorithm: 'gzip' }),
|
|
7453
|
+
],
|
|
7454
|
+
finally: [buildThirdPartyTrackerFinishInterceptor()],
|
|
7455
|
+
});
|
|
7456
|
+
return {
|
|
7457
|
+
...data360FetchService,
|
|
7458
|
+
tags: { authenticationScopes: DATA_360_CDP_URL_REWRITE_AUTH_SCOPE },
|
|
7459
|
+
};
|
|
7460
|
+
}
|
|
7400
7461
|
/**
|
|
7401
7462
|
* Returns a service descriptor for a fetch service that includes one-off copilot
|
|
7402
7463
|
* hacks. This fetch service is not intended for use by anything other than
|
|
@@ -7497,6 +7558,75 @@ function buildSfapJwtRequestModifier(logger) {
|
|
|
7497
7558
|
function buildJwtRequestInterceptor(logger) {
|
|
7498
7559
|
return buildJwtRequestHeaderInterceptor(sfapJwtManager, buildSfapJwtRequestModifier(logger));
|
|
7499
7560
|
}
|
|
7561
|
+
/**
|
|
7562
|
+
* Request interceptor for the direct-to-Data360 command. It cannot use the
|
|
7563
|
+
* standard `JwtRequestModifier` seam because the tenant host is a JWT *claim*
|
|
7564
|
+
* (`cdp_url`), and modifiers only receive `extraInfo`. So — like the copilot
|
|
7565
|
+
* interceptor that reads `decodedInfo.iss` — it holds the token directly:
|
|
7566
|
+
*
|
|
7567
|
+
* 1. Read the command's `jwtMintParams` off the per-request context seed and
|
|
7568
|
+
* mint (via the parameterized SFAP resolver, routed by the dispatching
|
|
7569
|
+
* resolver inside `sfapJwtManager`). Without mint params there is no token
|
|
7570
|
+
* to authorize with, so leave the request untouched.
|
|
7571
|
+
* 2. Decode `cdp_url` from the JWT and resolve the tenant-specific endpoint
|
|
7572
|
+
* (TSE). `cdp_url` is a bare host, so a scheme is prepended before parsing
|
|
7573
|
+
* and the protocol is forced to `https:`.
|
|
7574
|
+
* 3. Only after a usable `cdp_url` is confirmed, attach `Authorization: Bearer
|
|
7575
|
+
* <jwt>` and rewrite the request URL's host/protocol to the TSE.
|
|
7576
|
+
*
|
|
7577
|
+
* **Trust boundary.** `cdp_url` is a claim on a first-party, server-minted JWT
|
|
7578
|
+
* delivered over the same-origin Aura transport, so the interceptor does NOT police
|
|
7579
|
+
* its contents (no host-suffix or format allowlist) — the routing host is the
|
|
7580
|
+
* minting service's responsibility, and this mirrors the SFAP sibling, which
|
|
7581
|
+
* likewise trusts the server-provided `baseUri` rewrite target. The one guard that
|
|
7582
|
+
* remains is shape hygiene: if `cdp_url` is absent/empty/non-string (org not
|
|
7583
|
+
* CDP-provisioned, so the server's claim gate did not fire) the interceptor throws
|
|
7584
|
+
* a developer-facing error instead of an opaque parse failure. A minted token is
|
|
7585
|
+
* never attached until a usable host is in hand.
|
|
7586
|
+
*/
|
|
7587
|
+
function buildData360HostRewriteInterceptor(logger) {
|
|
7588
|
+
return (fetchArgs, context) => {
|
|
7589
|
+
const mintParams = context?.[JWT_MINT_PARAMS_SEED_KEY];
|
|
7590
|
+
// No mint params → not a parameterized Data360 request. Nothing to do.
|
|
7591
|
+
if (mintParams === undefined) {
|
|
7592
|
+
return resolvedPromiseLike$2(fetchArgs);
|
|
7593
|
+
}
|
|
7594
|
+
return resolvedPromiseLike$2(sfapJwtManager.getJwt(mintParams)).then((token) => {
|
|
7595
|
+
const [resource, request] = fetchArgs;
|
|
7596
|
+
if (typeof resource !== 'string' && !(resource instanceof URL)) {
|
|
7597
|
+
// istanbul ignore else: not exercised under NODE_ENV=production
|
|
7598
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7599
|
+
throw new Error('Data360 fetch service expects a string or URL resource');
|
|
7600
|
+
}
|
|
7601
|
+
return fetchArgs;
|
|
7602
|
+
}
|
|
7603
|
+
const cdpUrl = token.decodedInfo?.[CDP_URL_CLAIM];
|
|
7604
|
+
// Require a non-empty string. This is shape hygiene, NOT a content
|
|
7605
|
+
// policy: the routing host is the minting service's responsibility, and
|
|
7606
|
+
// we deliberately do not couple to its contents (no host-suffix/format
|
|
7607
|
+
// check — the SFAP sibling likewise trusts its server-provided rewrite
|
|
7608
|
+
// target). We only confirm we were handed a usable host string; a
|
|
7609
|
+
// missing/empty/non-string claim (org not Data Cloud provisioned, so the
|
|
7610
|
+
// server's claim gate did not fire) fails with a clear error rather than
|
|
7611
|
+
// an opaque `new URL` TypeError. The `typeof` check also narrows `cdpUrl`
|
|
7612
|
+
// to `string` for the `.replace` below.
|
|
7613
|
+
if (typeof cdpUrl !== 'string' || cdpUrl.length === 0) {
|
|
7614
|
+
logger.warn(`Data360 fetch service: minted JWT has no usable "${CDP_URL_CLAIM}" claim. The org may not be Data Cloud provisioned.`);
|
|
7615
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
7616
|
+
throw new Error(`Data360 fetch service: minted JWT has no usable "${CDP_URL_CLAIM}" claim; cannot route the request to a Data Cloud tenant endpoint.`);
|
|
7617
|
+
}
|
|
7618
|
+
// `cdp_url` is a bare host (no scheme); prepend https so `new URL`
|
|
7619
|
+
// parses it as an origin. Force https regardless of any scheme in the
|
|
7620
|
+
// claim — the TSE is always TLS.
|
|
7621
|
+
const tse = new URL(`https://${cdpUrl.replace(/^[a-z]+:\/\//i, '')}`);
|
|
7622
|
+
const authorizedArgs = setHeaderAuthorization(token, [resource, request]);
|
|
7623
|
+
const url = typeof resource === 'string' ? new URL(resource) : new URL(resource.toString());
|
|
7624
|
+
url.host = tse.host;
|
|
7625
|
+
url.protocol = 'https:';
|
|
7626
|
+
return [url, authorizedArgs[1]];
|
|
7627
|
+
});
|
|
7628
|
+
};
|
|
7629
|
+
}
|
|
7500
7630
|
/**
|
|
7501
7631
|
* Wraps the legacy `buildJwtRequestHeaderInterceptor` with a pass-through guard:
|
|
7502
7632
|
* when the parameterized interceptor has already authorized the request (an
|
|
@@ -10904,6 +11034,7 @@ function initializeOneStore(luvio) {
|
|
|
10904
11034
|
buildLexRuntimeDefaultFetchServiceDescriptor(loggerService, retryService),
|
|
10905
11035
|
buildUnauthorizedFetchServiceDescriptor(),
|
|
10906
11036
|
buildJwtAuthorizedSfapFetchServiceDescriptor(loggerService),
|
|
11037
|
+
buildJwtAuthorizedData360FetchServiceDescriptor(loggerService),
|
|
10907
11038
|
buildCopilotFetchServiceDescriptor(loggerService),
|
|
10908
11039
|
buildAuraNetworkService(),
|
|
10909
11040
|
buildServiceDescriptor$j(instrumentationServiceDescriptor.service),
|
|
@@ -10958,4 +11089,4 @@ function ldsEngineCreator() {
|
|
|
10958
11089
|
}
|
|
10959
11090
|
|
|
10960
11091
|
export { LexRequestStrategy, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
|
|
10961
|
-
// version: 1.428.0-
|
|
11092
|
+
// version: 1.428.0-dev21-c9faba50c9
|
|
@@ -5,6 +5,27 @@ import { type LoggerService } from '@conduit-client/utils';
|
|
|
5
5
|
export declare function buildDispatchingSfapJwtResolver(legacyResolver: JwtResolver<ExtraInfo>, parameterizedResolver: JwtResolver<ExtraInfo>): JwtResolver<ExtraInfo>;
|
|
6
6
|
export declare function prefetchSfapJwt(): Promise<undefined>;
|
|
7
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;
|
|
8
29
|
/**
|
|
9
30
|
* Returns a service descriptor for a fetch service that includes one-off copilot
|
|
10
31
|
* hacks. This fetch service is not intended for use by anything other than
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-aura",
|
|
3
|
-
"version": "1.428.0-
|
|
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",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@conduit-client/service-provisioner": "3.19.0-dev3",
|
|
38
38
|
"@conduit-client/tools-core": "3.19.0-dev3",
|
|
39
|
-
"@salesforce/lds-adapters-apex": "^1.428.0-
|
|
40
|
-
"@salesforce/lds-adapters-uiapi": "^1.428.0-
|
|
41
|
-
"@salesforce/lds-ads-bridge": "^1.428.0-
|
|
42
|
-
"@salesforce/lds-aura-storage": "^1.428.0-
|
|
43
|
-
"@salesforce/lds-bindings": "^1.428.0-
|
|
44
|
-
"@salesforce/lds-instrumentation": "^1.428.0-
|
|
45
|
-
"@salesforce/lds-network-aura": "^1.428.0-
|
|
46
|
-
"@salesforce/lds-network-fetch": "^1.428.0-
|
|
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": {
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"@luvio/network-adapter-composable": "0.160.4-dev1",
|
|
76
76
|
"@luvio/network-adapter-fetch": "0.160.4-dev1",
|
|
77
77
|
"@lwc/state": "^0.29.0",
|
|
78
|
-
"@salesforce/lds-adapters-onestore-graphql": "^1.428.0-
|
|
78
|
+
"@salesforce/lds-adapters-onestore-graphql": "^1.428.0-dev21",
|
|
79
79
|
"@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
|
|
80
|
-
"@salesforce/lds-durable-storage": "^1.428.0-
|
|
81
|
-
"@salesforce/lds-luvio-service": "^1.428.0-
|
|
82
|
-
"@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-
|
|
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"
|
|
83
83
|
},
|
|
84
84
|
"luvioBundlesize": [
|
|
85
85
|
{
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"maxSize": {
|
|
88
88
|
"none": "410 kB",
|
|
89
89
|
"min": "190 kB",
|
|
90
|
-
"compressed": "71 kB"
|
|
90
|
+
"compressed": "71.5 kB"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
],
|