@salesforce/lds-runtime-aura 1.444.0 → 1.446.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.
- package/dist/ldsEngineCreator.js +111 -185
- package/dist/types/aura-utils.d.ts +33 -4
- package/dist/types/sfap-jwt-mint-params.d.ts +13 -2
- package/package.json +41 -42
package/dist/ldsEngineCreator.js
CHANGED
|
@@ -137,7 +137,9 @@ function buildSubscribableResult$1(result, subscribe, refresh) {
|
|
|
137
137
|
}
|
|
138
138
|
function resolvedPromiseLike$2(result) {
|
|
139
139
|
if (isPromiseLike$2(result)) {
|
|
140
|
-
return result.then(
|
|
140
|
+
return result.then(
|
|
141
|
+
(nextResult) => nextResult
|
|
142
|
+
);
|
|
141
143
|
}
|
|
142
144
|
return {
|
|
143
145
|
then: (onFulfilled, _onRejected) => {
|
|
@@ -154,7 +156,9 @@ function resolvedPromiseLike$2(result) {
|
|
|
154
156
|
}
|
|
155
157
|
function rejectedPromiseLike$2(reason) {
|
|
156
158
|
if (isPromiseLike$2(reason)) {
|
|
157
|
-
return reason.then(
|
|
159
|
+
return reason.then(
|
|
160
|
+
(nextResult) => nextResult
|
|
161
|
+
);
|
|
158
162
|
}
|
|
159
163
|
return {
|
|
160
164
|
then: (_onFulfilled, onRejected) => {
|
|
@@ -173,8 +177,9 @@ function isPromiseLike$2(x) {
|
|
|
173
177
|
return typeof x?.then === "function";
|
|
174
178
|
}
|
|
175
179
|
function stableJSONStringify$2(node) {
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
const withToJSON = node;
|
|
181
|
+
if (withToJSON && typeof withToJSON.toJSON === "function") {
|
|
182
|
+
node = withToJSON.toJSON();
|
|
178
183
|
}
|
|
179
184
|
if (node === void 0) {
|
|
180
185
|
return;
|
|
@@ -200,11 +205,12 @@ function stableJSONStringify$2(node) {
|
|
|
200
205
|
if (node === null) {
|
|
201
206
|
return "null";
|
|
202
207
|
}
|
|
203
|
-
const
|
|
208
|
+
const record = node;
|
|
209
|
+
const objKeys = keys$2(record).sort();
|
|
204
210
|
out = "";
|
|
205
211
|
for (i = 0; i < objKeys.length; i++) {
|
|
206
212
|
const key = objKeys[i];
|
|
207
|
-
const value = stableJSONStringify$2(
|
|
213
|
+
const value = stableJSONStringify$2(record[key]);
|
|
208
214
|
if (!value) {
|
|
209
215
|
continue;
|
|
210
216
|
}
|
|
@@ -235,16 +241,16 @@ var HttpStatusCode$1 = /* @__PURE__ */ ((HttpStatusCode2) => {
|
|
|
235
241
|
return HttpStatusCode2;
|
|
236
242
|
})(HttpStatusCode$1 || {});
|
|
237
243
|
function getFetchResponseFromAuraError(err2) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
data =
|
|
241
|
-
if (
|
|
242
|
-
data.id =
|
|
244
|
+
const auraError = err2;
|
|
245
|
+
if (auraError.data !== void 0 && auraError.data.statusCode !== void 0) {
|
|
246
|
+
const data = auraError.data;
|
|
247
|
+
if (auraError.id !== void 0) {
|
|
248
|
+
data.id = auraError.id;
|
|
243
249
|
}
|
|
244
250
|
return new FetchResponse(data.statusCode, data);
|
|
245
251
|
}
|
|
246
252
|
return new FetchResponse(500, {
|
|
247
|
-
error: err2
|
|
253
|
+
error: err2?.message
|
|
248
254
|
});
|
|
249
255
|
}
|
|
250
256
|
async function coerceResponseToFetchResponse(response) {
|
|
@@ -299,9 +305,10 @@ function deepFreeze(value) {
|
|
|
299
305
|
deepFreeze(value[i]);
|
|
300
306
|
}
|
|
301
307
|
} else {
|
|
302
|
-
const
|
|
308
|
+
const record = value;
|
|
309
|
+
const keys$1 = keys$2(record);
|
|
303
310
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
304
|
-
deepFreeze(
|
|
311
|
+
deepFreeze(record[keys$1[i]]);
|
|
305
312
|
}
|
|
306
313
|
}
|
|
307
314
|
freeze(value);
|
|
@@ -375,7 +382,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
375
382
|
async afterRequestHooks(_options) {
|
|
376
383
|
}
|
|
377
384
|
};
|
|
378
|
-
function buildServiceDescriptor$
|
|
385
|
+
function buildServiceDescriptor$q() {
|
|
379
386
|
return {
|
|
380
387
|
type: "networkCommandBaseClass",
|
|
381
388
|
version: "1.0",
|
|
@@ -481,7 +488,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
481
488
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
482
489
|
}
|
|
483
490
|
}
|
|
484
|
-
function buildServiceDescriptor$
|
|
491
|
+
function buildServiceDescriptor$p() {
|
|
485
492
|
return {
|
|
486
493
|
type: "auraNetworkCommandBaseClass",
|
|
487
494
|
version: "1.0",
|
|
@@ -523,7 +530,9 @@ function buildSubscribableResult(result, subscribe, refresh) {
|
|
|
523
530
|
}
|
|
524
531
|
function resolvedPromiseLike$1(result) {
|
|
525
532
|
if (isPromiseLike$1(result)) {
|
|
526
|
-
return result.then(
|
|
533
|
+
return result.then(
|
|
534
|
+
(nextResult) => nextResult
|
|
535
|
+
);
|
|
527
536
|
}
|
|
528
537
|
return {
|
|
529
538
|
then: (onFulfilled, _onRejected) => {
|
|
@@ -540,7 +549,9 @@ function resolvedPromiseLike$1(result) {
|
|
|
540
549
|
}
|
|
541
550
|
function rejectedPromiseLike$1(reason) {
|
|
542
551
|
if (isPromiseLike$1(reason)) {
|
|
543
|
-
return reason.then(
|
|
552
|
+
return reason.then(
|
|
553
|
+
(nextResult) => nextResult
|
|
554
|
+
);
|
|
544
555
|
}
|
|
545
556
|
return {
|
|
546
557
|
then: (_onFulfilled, onRejected) => {
|
|
@@ -1034,144 +1045,6 @@ function mergeCacheControlConfigs(baseConfig, overrides) {
|
|
|
1034
1045
|
};
|
|
1035
1046
|
}
|
|
1036
1047
|
|
|
1037
|
-
let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheControlCommand {
|
|
1038
|
-
constructor(services) {
|
|
1039
|
-
super(services);
|
|
1040
|
-
this.services = services;
|
|
1041
|
-
this.actionConfig = {
|
|
1042
|
-
background: false,
|
|
1043
|
-
hotspot: true,
|
|
1044
|
-
longRunning: false,
|
|
1045
|
-
storable: false
|
|
1046
|
-
};
|
|
1047
|
-
this.networkPreference = "aura";
|
|
1048
|
-
}
|
|
1049
|
-
get fetchParams() {
|
|
1050
|
-
throw new Error(
|
|
1051
|
-
"Fetch parameters must be specified when using HTTP transport on an Aura adapter"
|
|
1052
|
-
);
|
|
1053
|
-
}
|
|
1054
|
-
shouldUseAuraNetwork() {
|
|
1055
|
-
return this.services.auraNetwork !== void 0 && (this.networkPreference === "aura" || !this.services.fetch);
|
|
1056
|
-
}
|
|
1057
|
-
shouldUseFetch() {
|
|
1058
|
-
return this.services.fetch !== void 0 && (this.networkPreference === "http" || !this.services.auraNetwork);
|
|
1059
|
-
}
|
|
1060
|
-
requestFromNetwork() {
|
|
1061
|
-
if (this.shouldUseAuraNetwork()) {
|
|
1062
|
-
return this.convertAuraResponseToData(
|
|
1063
|
-
this.services.auraNetwork(this.endpoint, this.auraParams, this.actionConfig),
|
|
1064
|
-
(errs) => this.coerceAuraErrors(errs)
|
|
1065
|
-
);
|
|
1066
|
-
} else if (this.shouldUseFetch()) {
|
|
1067
|
-
const params = this.fetchParams;
|
|
1068
|
-
try {
|
|
1069
|
-
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
1070
|
-
} catch (reason) {
|
|
1071
|
-
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
1075
|
-
}
|
|
1076
|
-
coerceAuraErrors(auraErrors) {
|
|
1077
|
-
return toError(auraErrors[0]);
|
|
1078
|
-
}
|
|
1079
|
-
async coerceError(errorResponse) {
|
|
1080
|
-
return toError(errorResponse.statusText);
|
|
1081
|
-
}
|
|
1082
|
-
processAuraReturnValue(auraReturnValue) {
|
|
1083
|
-
return ok$2(auraReturnValue);
|
|
1084
|
-
}
|
|
1085
|
-
processFetchReturnValue(json) {
|
|
1086
|
-
return ok$2(json);
|
|
1087
|
-
}
|
|
1088
|
-
convertAuraResponseToData(responsePromise, coerceError) {
|
|
1089
|
-
return responsePromise.then((response) => {
|
|
1090
|
-
return this.processAuraReturnValue(response.getReturnValue());
|
|
1091
|
-
}).finally(() => {
|
|
1092
|
-
try {
|
|
1093
|
-
this.afterRequestHooks({ statusCode: 200 });
|
|
1094
|
-
} catch {
|
|
1095
|
-
}
|
|
1096
|
-
}).catch((error) => {
|
|
1097
|
-
if (!error) {
|
|
1098
|
-
return err$1(toError("Failed to get error from response"));
|
|
1099
|
-
}
|
|
1100
|
-
if (!error.getError) {
|
|
1101
|
-
return err$1(toError(error));
|
|
1102
|
-
}
|
|
1103
|
-
const actionErrors = error.getError();
|
|
1104
|
-
if (actionErrors.length > 0) {
|
|
1105
|
-
return err$1(coerceError(actionErrors));
|
|
1106
|
-
}
|
|
1107
|
-
return err$1(toError("Error fetching component"));
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
convertFetchResponseToData(response) {
|
|
1111
|
-
return response.then(
|
|
1112
|
-
(response2) => {
|
|
1113
|
-
if (response2.ok) {
|
|
1114
|
-
return response2.json().then(
|
|
1115
|
-
(json) => {
|
|
1116
|
-
return this.processFetchReturnValue(json);
|
|
1117
|
-
},
|
|
1118
|
-
(reason) => err$1(toError(reason))
|
|
1119
|
-
).finally(() => {
|
|
1120
|
-
try {
|
|
1121
|
-
this.afterRequestHooks({ statusCode: response2.status });
|
|
1122
|
-
} catch {
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
} else {
|
|
1126
|
-
return this.coerceError(response2).then((coercedError) => {
|
|
1127
|
-
return err$1(coercedError);
|
|
1128
|
-
}).finally(() => {
|
|
1129
|
-
try {
|
|
1130
|
-
this.afterRequestHooks({ statusCode: response2.status });
|
|
1131
|
-
} catch {
|
|
1132
|
-
}
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
},
|
|
1136
|
-
(reason) => err$1(toError(reason))
|
|
1137
|
-
);
|
|
1138
|
-
}
|
|
1139
|
-
};
|
|
1140
|
-
class AuraResourceCacheControlCommand extends AuraCacheControlCommand$1 {
|
|
1141
|
-
constructor(services) {
|
|
1142
|
-
super(services);
|
|
1143
|
-
this.services = services;
|
|
1144
|
-
}
|
|
1145
|
-
readFromCache(cache) {
|
|
1146
|
-
const data = cache.get(this.buildKey())?.value;
|
|
1147
|
-
if (data === void 0) {
|
|
1148
|
-
return resolvedPromiseLike$2(err$1(new Error("Failed to find data in cache")));
|
|
1149
|
-
}
|
|
1150
|
-
return resolvedPromiseLike$2(ok$2(data));
|
|
1151
|
-
}
|
|
1152
|
-
writeToCache(cache, networkResult) {
|
|
1153
|
-
if (networkResult.isOk()) {
|
|
1154
|
-
cache.set(this.buildKey(), {
|
|
1155
|
-
value: networkResult.value,
|
|
1156
|
-
metadata: {
|
|
1157
|
-
cacheControl: this.buildCacheControlMetadata(networkResult.value)
|
|
1158
|
-
}
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
return resolvedPromiseLike$2(void 0);
|
|
1162
|
-
}
|
|
1163
|
-
buildKey() {
|
|
1164
|
-
return `{"endpoint":${this.endpoint},"params":${stableJSONStringify$2(this.auraParams)}}`;
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
function buildServiceDescriptor$p() {
|
|
1168
|
-
return {
|
|
1169
|
-
type: "auraResourceCacheControlCommand",
|
|
1170
|
-
version: "1.0",
|
|
1171
|
-
service: AuraResourceCacheControlCommand
|
|
1172
|
-
};
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
1048
|
class AuraCacheControlCommand extends CacheControlCommand {
|
|
1176
1049
|
constructor(services) {
|
|
1177
1050
|
super(services);
|
|
@@ -1457,16 +1330,16 @@ class NetworkCommand extends BaseCommand {
|
|
|
1457
1330
|
}
|
|
1458
1331
|
}
|
|
1459
1332
|
function isAbortableCommand(command) {
|
|
1460
|
-
return "isAbortableCommand" in command && command.isAbortableCommand === true;
|
|
1333
|
+
return !!command && typeof command === "object" && "isAbortableCommand" in command && command.isAbortableCommand === true;
|
|
1461
1334
|
}
|
|
1462
1335
|
function hasFetchParams(command) {
|
|
1463
|
-
return command && typeof command === "object" && "fetchParams" in command;
|
|
1336
|
+
return !!command && typeof command === "object" && "fetchParams" in command;
|
|
1464
1337
|
}
|
|
1465
1338
|
function createAbortableDecorator(command, options) {
|
|
1466
|
-
|
|
1339
|
+
const signal = options?.signal;
|
|
1340
|
+
if (!signal || !(signal instanceof AbortSignal)) {
|
|
1467
1341
|
return command;
|
|
1468
1342
|
}
|
|
1469
|
-
const { signal } = options;
|
|
1470
1343
|
if (isAbortableCommand(command)) {
|
|
1471
1344
|
if (process.env.NODE_ENV !== "production") {
|
|
1472
1345
|
console.warn(
|
|
@@ -1477,14 +1350,15 @@ function createAbortableDecorator(command, options) {
|
|
|
1477
1350
|
}
|
|
1478
1351
|
if (!hasFetchParams(command)) {
|
|
1479
1352
|
if (process.env.NODE_ENV !== "production") {
|
|
1353
|
+
const commandName = typeof command === "object" && command !== null ? command.constructor.name : typeof command;
|
|
1480
1354
|
console.warn(
|
|
1481
|
-
`Command ${
|
|
1355
|
+
`Command ${commandName} does not support fetch operations. AbortSignal will be ignored.`
|
|
1482
1356
|
);
|
|
1483
1357
|
}
|
|
1484
1358
|
return command;
|
|
1485
1359
|
}
|
|
1486
1360
|
try {
|
|
1487
|
-
|
|
1361
|
+
const handler = {
|
|
1488
1362
|
get(target, prop, receiver) {
|
|
1489
1363
|
if (prop === "isAbortableCommand") {
|
|
1490
1364
|
return true;
|
|
@@ -1493,8 +1367,8 @@ function createAbortableDecorator(command, options) {
|
|
|
1493
1367
|
return signal;
|
|
1494
1368
|
}
|
|
1495
1369
|
if (prop === "fetchParams") {
|
|
1496
|
-
const originalFetchParams = target
|
|
1497
|
-
const isInternal = target
|
|
1370
|
+
const originalFetchParams = Reflect.get(target, prop, receiver);
|
|
1371
|
+
const isInternal = Reflect.get(target, "isInternalExecution", receiver) === true;
|
|
1498
1372
|
if (typeof originalFetchParams === "function") {
|
|
1499
1373
|
return function(...args) {
|
|
1500
1374
|
const originalReturnValue = originalFetchParams.apply(this, args);
|
|
@@ -1520,7 +1394,8 @@ function createAbortableDecorator(command, options) {
|
|
|
1520
1394
|
}
|
|
1521
1395
|
return Reflect.has(target, prop);
|
|
1522
1396
|
}
|
|
1523
|
-
}
|
|
1397
|
+
};
|
|
1398
|
+
return new Proxy(command, handler);
|
|
1524
1399
|
} catch (error) {
|
|
1525
1400
|
if (process.env.NODE_ENV !== "production") {
|
|
1526
1401
|
console.error(
|
|
@@ -2660,7 +2535,7 @@ function buildServiceDescriptor$d(luvio) {
|
|
|
2660
2535
|
},
|
|
2661
2536
|
};
|
|
2662
2537
|
}
|
|
2663
|
-
// version: 1.
|
|
2538
|
+
// version: 1.446.0-f73bd65030
|
|
2664
2539
|
|
|
2665
2540
|
class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheControlCommand {
|
|
2666
2541
|
constructor(config, documentRootType, services) {
|
|
@@ -2998,7 +2873,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
2998
2873
|
},
|
|
2999
2874
|
};
|
|
3000
2875
|
}
|
|
3001
|
-
// version: 1.
|
|
2876
|
+
// version: 1.446.0-f73bd65030
|
|
3002
2877
|
|
|
3003
2878
|
class RetryService {
|
|
3004
2879
|
constructor(defaultRetryPolicy) {
|
|
@@ -4961,9 +4836,9 @@ function coerceToSfapParams(params) {
|
|
|
4961
4836
|
if (scopes !== undefined && !isStringArray(scopes)) {
|
|
4962
4837
|
return { error: 'SFAP JWT params.scopes must be a string[] when provided.' };
|
|
4963
4838
|
}
|
|
4964
|
-
if (dynamicParams !== undefined && !
|
|
4839
|
+
if (dynamicParams !== undefined && !isPrimitiveRecord(dynamicParams)) {
|
|
4965
4840
|
return {
|
|
4966
|
-
error: 'SFAP JWT params.dynamicParams must be a Record<string, string> when provided.',
|
|
4841
|
+
error: 'SFAP JWT params.dynamicParams must be a Record<string, string | boolean | number> when provided.',
|
|
4967
4842
|
};
|
|
4968
4843
|
}
|
|
4969
4844
|
return { params: { scopes, dynamicParams } };
|
|
@@ -4971,11 +4846,18 @@ function coerceToSfapParams(params) {
|
|
|
4971
4846
|
function isStringArray(value) {
|
|
4972
4847
|
return Array.isArray(value) && value.every((s) => typeof s === 'string');
|
|
4973
4848
|
}
|
|
4974
|
-
|
|
4849
|
+
/**
|
|
4850
|
+
* A record whose values are JSON primitives (string, boolean, or number) — the
|
|
4851
|
+
* value types the SFAP Lightning JWT Service accepts for a dynamic parameter
|
|
4852
|
+
* (see {@link SfapDynamicParamValue}). Booleans/numbers are forwarded natively
|
|
4853
|
+
* (not stringified) so claim handlers that gate on a native `Boolean` see the
|
|
4854
|
+
* intended value. Nested objects/arrays, `null`, and `undefined` are rejected.
|
|
4855
|
+
*/
|
|
4856
|
+
function isPrimitiveRecord(value) {
|
|
4975
4857
|
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
4976
4858
|
return false;
|
|
4977
4859
|
}
|
|
4978
|
-
return Object.values(value).every((v) => typeof v === 'string');
|
|
4860
|
+
return Object.values(value).every((v) => typeof v === 'string' || typeof v === 'boolean' || typeof v === 'number');
|
|
4979
4861
|
}
|
|
4980
4862
|
/**
|
|
4981
4863
|
* Build the SFAP mint request body from the coerced params: `scopes` joined into a
|
|
@@ -5883,16 +5765,28 @@ function getEnvironmentSetting(name) {
|
|
|
5883
5765
|
}
|
|
5884
5766
|
return undefined;
|
|
5885
5767
|
}
|
|
5886
|
-
// version: 1.
|
|
5768
|
+
// version: 1.446.0-74903f7bb8
|
|
5887
5769
|
|
|
5888
5770
|
/**
|
|
5889
5771
|
* Helpers for reaching the Aura framework from the LDS Aura runtime.
|
|
5890
5772
|
*
|
|
5891
|
-
* `window.$A` is only present when the runtime is hosted inside LEX
|
|
5892
|
-
* and non-Aura runtimes it is absent.
|
|
5893
|
-
* `$A`
|
|
5894
|
-
*
|
|
5773
|
+
* `window.$A` is only present when the runtime is hosted inside Aura (LEX or
|
|
5774
|
+
* an Aura site); in tests and non-Aura runtimes it is absent. `getAura()`
|
|
5775
|
+
* centralizes the guarded lookup so the `$A` access lives in one place instead
|
|
5776
|
+
* of being duplicated across modules.
|
|
5895
5777
|
*/
|
|
5778
|
+
/**
|
|
5779
|
+
* Returns the Aura framework global (`window.$A`) when running inside Aura
|
|
5780
|
+
* (LEX or an Aura site), or `undefined` in tests and non-Aura runtimes.
|
|
5781
|
+
* Centralizes the guarded `$A` lookup so callers reach for it once and read
|
|
5782
|
+
* intent instead of repeating `typeof window` / `$A` guards.
|
|
5783
|
+
*/
|
|
5784
|
+
function getAura() {
|
|
5785
|
+
if (typeof window === 'undefined') {
|
|
5786
|
+
return undefined;
|
|
5787
|
+
}
|
|
5788
|
+
return window.$A;
|
|
5789
|
+
}
|
|
5896
5790
|
/**
|
|
5897
5791
|
* Fires an Aura application-level event (e.g. `aura:invalidSession`). Thin
|
|
5898
5792
|
* pass-through to the `aura` framework module so callers depend on this util
|
|
@@ -5906,10 +5800,27 @@ function dispatchGlobalEvent(...args) {
|
|
|
5906
5800
|
* `undefined` otherwise. Defensive: never throws.
|
|
5907
5801
|
*/
|
|
5908
5802
|
function getAuraClientService() {
|
|
5909
|
-
|
|
5910
|
-
|
|
5803
|
+
return getAura()?.clientService;
|
|
5804
|
+
}
|
|
5805
|
+
/**
|
|
5806
|
+
* Returns `true` when the Aura runtime is hosted inside an Aura/Experience
|
|
5807
|
+
* site (Experience Builder / `communityApp`) rather than LEX (one.app).
|
|
5808
|
+
* `$A.get('$Site')` is present and truthy on Aura sites and absent/falsy in
|
|
5809
|
+
* LEX. A stable per-page signal, so it is safe to evaluate once at module
|
|
5810
|
+
* load. Defensive: never throws.
|
|
5811
|
+
*
|
|
5812
|
+
* Used to keep the OneStore GraphQL adapter — and the HTTP UIAPI fetch path —
|
|
5813
|
+
* on the Aura transport for sites, because the HTTP transport's CSRF handling
|
|
5814
|
+
* does not work in the Aura Sites runtime (W-23092947).
|
|
5815
|
+
*/
|
|
5816
|
+
function isAuraSite() {
|
|
5817
|
+
const aura = getAura();
|
|
5818
|
+
try {
|
|
5819
|
+
return !!aura?.get?.('$Site');
|
|
5820
|
+
}
|
|
5821
|
+
catch {
|
|
5822
|
+
return false;
|
|
5911
5823
|
}
|
|
5912
|
-
return window.$A.clientService;
|
|
5913
5824
|
}
|
|
5914
5825
|
|
|
5915
5826
|
const auraClientService = getAuraClientService();
|
|
@@ -7328,6 +7239,13 @@ const PREDICATE_PATH_SETS = [
|
|
|
7328
7239
|
},
|
|
7329
7240
|
];
|
|
7330
7241
|
function getEnabledPaths() {
|
|
7242
|
+
// On Aura/Experience sites the HTTP UIAPI transport's CSRF handling is
|
|
7243
|
+
// broken (W-23092947), so disable every HTTP UIAPI path here and let LDS
|
|
7244
|
+
// fall back to the Aura transport. LEX (one.app / OneRuntime) is
|
|
7245
|
+
// unaffected. This guards all current and future predicates in one place.
|
|
7246
|
+
if (isAuraSite()) {
|
|
7247
|
+
return [];
|
|
7248
|
+
}
|
|
7331
7249
|
const enabled = new Set();
|
|
7332
7250
|
for (const { predicate, paths } of PREDICATE_PATH_SETS) {
|
|
7333
7251
|
if (predicate()) {
|
|
@@ -9964,7 +9882,9 @@ function addAllToSet(targetSet, sourceSet) {
|
|
|
9964
9882
|
}
|
|
9965
9883
|
function resolvedPromiseLike(result) {
|
|
9966
9884
|
if (isPromiseLike(result)) {
|
|
9967
|
-
return result.then(
|
|
9885
|
+
return result.then(
|
|
9886
|
+
(nextResult) => nextResult
|
|
9887
|
+
);
|
|
9968
9888
|
}
|
|
9969
9889
|
return {
|
|
9970
9890
|
then: (onFulfilled, _onRejected) => {
|
|
@@ -9981,7 +9901,9 @@ function resolvedPromiseLike(result) {
|
|
|
9981
9901
|
}
|
|
9982
9902
|
function rejectedPromiseLike(reason) {
|
|
9983
9903
|
if (isPromiseLike(reason)) {
|
|
9984
|
-
return reason.then(
|
|
9904
|
+
return reason.then(
|
|
9905
|
+
(nextResult) => nextResult
|
|
9906
|
+
);
|
|
9985
9907
|
}
|
|
9986
9908
|
return {
|
|
9987
9909
|
then: (_onFulfilled, onRejected) => {
|
|
@@ -11312,6 +11234,11 @@ function initializeOneStore(luvio) {
|
|
|
11312
11234
|
};
|
|
11313
11235
|
// set flags based on gates
|
|
11314
11236
|
featureFlagsService.set('useOneStoreGraphQL', useOneStoreGraphql.isOpen({ fallback: false }));
|
|
11237
|
+
// On Aura/Experience sites the HTTP transport's CSRF handling is broken
|
|
11238
|
+
// (W-23092947), so signal the OneStore GraphQL command to use the Aura
|
|
11239
|
+
// transport there. HTTP remains the default in LEX. Paired with the HTTP
|
|
11240
|
+
// UIAPI fetch path being disabled on sites (see network-fetch.ts).
|
|
11241
|
+
featureFlagsService.set('graphQLUseAura', isAuraSite());
|
|
11315
11242
|
const services = [
|
|
11316
11243
|
instrumentationServiceDescriptor,
|
|
11317
11244
|
buildLexRuntimeDefaultFetchServiceDescriptor(loggerService, retryService),
|
|
@@ -11323,13 +11250,12 @@ function initializeOneStore(luvio) {
|
|
|
11323
11250
|
// Ordering of services matters - L1 only CacheControlService must come before durable
|
|
11324
11251
|
buildServiceDescriptor$g(cacheServiceDescriptor.service, inMemoryCacheInclusionPolicyServiceDescriptor.service, instrumentationServiceDescriptor.service),
|
|
11325
11252
|
durableCacheControlService,
|
|
11326
|
-
buildServiceDescriptor$
|
|
11253
|
+
buildServiceDescriptor$p(),
|
|
11327
11254
|
buildServiceDescriptor$e(),
|
|
11328
11255
|
buildServiceDescriptor$m(),
|
|
11329
|
-
buildServiceDescriptor$
|
|
11256
|
+
buildServiceDescriptor$q(),
|
|
11330
11257
|
buildServiceDescriptor$l(),
|
|
11331
11258
|
buildServiceDescriptor$k(),
|
|
11332
|
-
buildServiceDescriptor$p(),
|
|
11333
11259
|
buildServiceDescriptor$o(),
|
|
11334
11260
|
buildServiceDescriptor$n(),
|
|
11335
11261
|
buildServiceDescriptor$f(),
|
|
@@ -11372,4 +11298,4 @@ function ldsEngineCreator() {
|
|
|
11372
11298
|
}
|
|
11373
11299
|
|
|
11374
11300
|
export { LexRequestStrategy, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
|
|
11375
|
-
// version: 1.
|
|
11301
|
+
// version: 1.446.0-f73bd65030
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helpers for reaching the Aura framework from the LDS Aura runtime.
|
|
3
3
|
*
|
|
4
|
-
* `window.$A` is only present when the runtime is hosted inside LEX
|
|
5
|
-
* and non-Aura runtimes it is absent.
|
|
6
|
-
* `$A`
|
|
7
|
-
*
|
|
4
|
+
* `window.$A` is only present when the runtime is hosted inside Aura (LEX or
|
|
5
|
+
* an Aura site); in tests and non-Aura runtimes it is absent. `getAura()`
|
|
6
|
+
* centralizes the guarded lookup so the `$A` access lives in one place instead
|
|
7
|
+
* of being duplicated across modules.
|
|
8
8
|
*/
|
|
9
9
|
import { dispatchGlobalEvent as auraDispatchGlobalEvent } from 'aura';
|
|
10
|
+
/**
|
|
11
|
+
* The subset of the Aura framework global (`window.$A`) that LDS reaches for.
|
|
12
|
+
* Members are optional/loosely typed because availability depends on the
|
|
13
|
+
* host's Aura version and the runtime context.
|
|
14
|
+
*/
|
|
15
|
+
interface Aura {
|
|
16
|
+
clientService?: AuraClientService;
|
|
17
|
+
get?: (expression: string) => unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the Aura framework global (`window.$A`) when running inside Aura
|
|
21
|
+
* (LEX or an Aura site), or `undefined` in tests and non-Aura runtimes.
|
|
22
|
+
* Centralizes the guarded `$A` lookup so callers reach for it once and read
|
|
23
|
+
* intent instead of repeating `typeof window` / `$A` guards.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAura(): Aura | undefined;
|
|
10
26
|
/**
|
|
11
27
|
* Fires an Aura application-level event (e.g. `aura:invalidSession`). Thin
|
|
12
28
|
* pass-through to the `aura` framework module so callers depend on this util
|
|
@@ -26,3 +42,16 @@ export interface AuraClientService {
|
|
|
26
42
|
* `undefined` otherwise. Defensive: never throws.
|
|
27
43
|
*/
|
|
28
44
|
export declare function getAuraClientService(): AuraClientService | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Returns `true` when the Aura runtime is hosted inside an Aura/Experience
|
|
47
|
+
* site (Experience Builder / `communityApp`) rather than LEX (one.app).
|
|
48
|
+
* `$A.get('$Site')` is present and truthy on Aura sites and absent/falsy in
|
|
49
|
+
* LEX. A stable per-page signal, so it is safe to evaluate once at module
|
|
50
|
+
* load. Defensive: never throws.
|
|
51
|
+
*
|
|
52
|
+
* Used to keep the OneStore GraphQL adapter — and the HTTP UIAPI fetch path —
|
|
53
|
+
* on the Aura transport for sites, because the HTTP transport's CSRF handling
|
|
54
|
+
* does not work in the Aura Sites runtime (W-23092947).
|
|
55
|
+
*/
|
|
56
|
+
export declare function isAuraSite(): boolean;
|
|
57
|
+
export {};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
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;
|
|
2
13
|
/**
|
|
3
14
|
* Typed shape of the params the SFAP Lightning JWT Service understands.
|
|
4
15
|
* Lives in the resolver layer because OneStore is param-shape-agnostic; it
|
|
@@ -7,7 +18,7 @@ import type { JwtMintParams } from '@conduit-client/jwt-manager';
|
|
|
7
18
|
*/
|
|
8
19
|
export type SfapJwtMintParams = {
|
|
9
20
|
scopes?: string[];
|
|
10
|
-
dynamicParams?: Record<string,
|
|
21
|
+
dynamicParams?: Record<string, SfapDynamicParamValue>;
|
|
11
22
|
};
|
|
12
23
|
/**
|
|
13
24
|
* The `extraInfo` the SFAP JWT resolver returns alongside the minted token: the
|
|
@@ -18,7 +29,7 @@ export type ParameterizedSfapExtraInfo = {
|
|
|
18
29
|
};
|
|
19
30
|
type DynamicParameterItem = {
|
|
20
31
|
name: string;
|
|
21
|
-
value:
|
|
32
|
+
value: SfapDynamicParamValue;
|
|
22
33
|
};
|
|
23
34
|
/**
|
|
24
35
|
* The SFAP Lightning JWT Service mint request body. Sent as the `requestBody`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-aura",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.446.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS engine for Aura runtime.",
|
|
6
6
|
"main": "dist/ldsEngineCreator.js",
|
|
@@ -34,54 +34,53 @@
|
|
|
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.
|
|
38
|
-
"@conduit-client/tools-core": "3.
|
|
39
|
-
"@salesforce/lds-adapters-apex": "^1.
|
|
40
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
41
|
-
"@salesforce/lds-ads-bridge": "^1.
|
|
42
|
-
"@salesforce/lds-aura-storage": "^1.
|
|
43
|
-
"@salesforce/lds-bindings": "^1.
|
|
44
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
45
|
-
"@salesforce/lds-network-adapter": "^1.
|
|
46
|
-
"@salesforce/lds-network-aura": "^1.
|
|
47
|
-
"@salesforce/lds-network-fetch": "^1.
|
|
37
|
+
"@conduit-client/service-provisioner": "3.24.0",
|
|
38
|
+
"@conduit-client/tools-core": "3.24.0",
|
|
39
|
+
"@salesforce/lds-adapters-apex": "^1.446.0",
|
|
40
|
+
"@salesforce/lds-adapters-uiapi": "^1.446.0",
|
|
41
|
+
"@salesforce/lds-ads-bridge": "^1.446.0",
|
|
42
|
+
"@salesforce/lds-aura-storage": "^1.446.0",
|
|
43
|
+
"@salesforce/lds-bindings": "^1.446.0",
|
|
44
|
+
"@salesforce/lds-instrumentation": "^1.446.0",
|
|
45
|
+
"@salesforce/lds-network-adapter": "^1.446.0",
|
|
46
|
+
"@salesforce/lds-network-aura": "^1.446.0",
|
|
47
|
+
"@salesforce/lds-network-fetch": "^1.446.0",
|
|
48
48
|
"jwt-encode": "1.0.1"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@conduit-client/command-aura-graphql-normalized-cache-control": "3.
|
|
52
|
-
"@conduit-client/command-aura-network": "3.
|
|
53
|
-
"@conduit-client/command-aura-normalized-cache-control": "3.
|
|
54
|
-
"@conduit-client/command-
|
|
55
|
-
"@conduit-client/command-
|
|
56
|
-
"@conduit-client/command-http-
|
|
57
|
-
"@conduit-client/command-
|
|
58
|
-
"@conduit-client/command-
|
|
59
|
-
"@conduit-client/command-
|
|
60
|
-
"@conduit-client/command-
|
|
61
|
-
"@conduit-client/
|
|
62
|
-
"@conduit-client/
|
|
63
|
-
"@conduit-client/service-
|
|
64
|
-
"@conduit-client/service-bindings-
|
|
65
|
-
"@conduit-client/service-
|
|
66
|
-
"@conduit-client/service-cache": "3.
|
|
67
|
-
"@conduit-client/service-cache-
|
|
68
|
-
"@conduit-client/service-
|
|
69
|
-
"@conduit-client/service-
|
|
70
|
-
"@conduit-client/service-
|
|
71
|
-
"@conduit-client/service-
|
|
72
|
-
"@conduit-client/service-
|
|
73
|
-
"@conduit-client/service-
|
|
74
|
-
"@conduit-client/service-
|
|
75
|
-
"@conduit-client/
|
|
76
|
-
"@conduit-client/utils": "3.23.1",
|
|
51
|
+
"@conduit-client/command-aura-graphql-normalized-cache-control": "3.24.0",
|
|
52
|
+
"@conduit-client/command-aura-network": "3.24.0",
|
|
53
|
+
"@conduit-client/command-aura-normalized-cache-control": "3.24.0",
|
|
54
|
+
"@conduit-client/command-fetch-network": "3.24.0",
|
|
55
|
+
"@conduit-client/command-http-graphql-normalized-cache-control": "3.24.0",
|
|
56
|
+
"@conduit-client/command-http-normalized-cache-control": "3.24.0",
|
|
57
|
+
"@conduit-client/command-ndjson": "3.24.0",
|
|
58
|
+
"@conduit-client/command-network": "3.24.0",
|
|
59
|
+
"@conduit-client/command-sse": "3.24.0",
|
|
60
|
+
"@conduit-client/command-streaming": "3.24.0",
|
|
61
|
+
"@conduit-client/jwt-manager": "3.24.0",
|
|
62
|
+
"@conduit-client/service-aura-network": "3.24.0",
|
|
63
|
+
"@conduit-client/service-bindings-imperative": "3.24.0",
|
|
64
|
+
"@conduit-client/service-bindings-lwc": "3.24.0",
|
|
65
|
+
"@conduit-client/service-cache": "3.24.0",
|
|
66
|
+
"@conduit-client/service-cache-control": "3.24.0",
|
|
67
|
+
"@conduit-client/service-cache-inclusion-policy": "3.24.0",
|
|
68
|
+
"@conduit-client/service-config": "3.24.0",
|
|
69
|
+
"@conduit-client/service-feature-flags": "3.24.0",
|
|
70
|
+
"@conduit-client/service-fetch-network": "3.24.0",
|
|
71
|
+
"@conduit-client/service-instrument-command": "3.24.0",
|
|
72
|
+
"@conduit-client/service-pubsub": "3.24.0",
|
|
73
|
+
"@conduit-client/service-renewable-resource-manager": "3.24.0",
|
|
74
|
+
"@conduit-client/service-store": "3.24.0",
|
|
75
|
+
"@conduit-client/utils": "3.24.0",
|
|
77
76
|
"@luvio/network-adapter-composable": "0.161.0",
|
|
78
77
|
"@luvio/network-adapter-fetch": "0.161.0",
|
|
79
78
|
"@lwc/state": "^0.29.0",
|
|
80
|
-
"@salesforce/lds-adapters-onestore-graphql": "^1.
|
|
79
|
+
"@salesforce/lds-adapters-onestore-graphql": "^1.446.0",
|
|
81
80
|
"@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
|
|
82
|
-
"@salesforce/lds-durable-storage": "^1.
|
|
83
|
-
"@salesforce/lds-luvio-service": "^1.
|
|
84
|
-
"@salesforce/lds-luvio-uiapi-records-service": "^1.
|
|
81
|
+
"@salesforce/lds-durable-storage": "^1.446.0",
|
|
82
|
+
"@salesforce/lds-luvio-service": "^1.446.0",
|
|
83
|
+
"@salesforce/lds-luvio-uiapi-records-service": "^1.446.0"
|
|
85
84
|
},
|
|
86
85
|
"luvioBundlesize": [
|
|
87
86
|
{
|