@salesforce/lds-runtime-webruntime 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.
@@ -113,7 +113,9 @@ function buildSubscribableResult$1(result, subscribe, refresh) {
113
113
  }
114
114
  function resolvedPromiseLike$2(result) {
115
115
  if (isPromiseLike$2(result)) {
116
- return result.then((nextResult) => nextResult);
116
+ return result.then(
117
+ (nextResult) => nextResult
118
+ );
117
119
  }
118
120
  return {
119
121
  then: (onFulfilled, _onRejected) => {
@@ -130,7 +132,9 @@ function resolvedPromiseLike$2(result) {
130
132
  }
131
133
  function rejectedPromiseLike$2(reason) {
132
134
  if (isPromiseLike$2(reason)) {
133
- return reason.then((nextResult) => nextResult);
135
+ return reason.then(
136
+ (nextResult) => nextResult
137
+ );
134
138
  }
135
139
  return {
136
140
  then: (_onFulfilled, onRejected) => {
@@ -188,8 +192,9 @@ function deepEquals$1(x, y) {
188
192
  return x === y;
189
193
  }
190
194
  function stableJSONStringify(node) {
191
- if (node && node.toJSON && typeof node.toJSON === "function") {
192
- node = node.toJSON();
195
+ const withToJSON = node;
196
+ if (withToJSON && typeof withToJSON.toJSON === "function") {
197
+ node = withToJSON.toJSON();
193
198
  }
194
199
  if (node === void 0) {
195
200
  return;
@@ -215,11 +220,12 @@ function stableJSONStringify(node) {
215
220
  if (node === null) {
216
221
  return "null";
217
222
  }
218
- const objKeys = keys(node).sort();
223
+ const record = node;
224
+ const objKeys = keys(record).sort();
219
225
  out = "";
220
226
  for (i = 0; i < objKeys.length; i++) {
221
227
  const key = objKeys[i];
222
- const value = stableJSONStringify(node[key]);
228
+ const value = stableJSONStringify(record[key]);
223
229
  if (!value) {
224
230
  continue;
225
231
  }
@@ -250,16 +256,16 @@ var HttpStatusCode = /* @__PURE__ */ ((HttpStatusCode2) => {
250
256
  return HttpStatusCode2;
251
257
  })(HttpStatusCode || {});
252
258
  function getFetchResponseFromAuraError(err2) {
253
- if (err2.data !== void 0 && err2.data.statusCode !== void 0) {
254
- let data = {};
255
- data = err2.data;
256
- if (err2.id !== void 0) {
257
- data.id = err2.id;
259
+ const auraError = err2;
260
+ if (auraError.data !== void 0 && auraError.data.statusCode !== void 0) {
261
+ const data = auraError.data;
262
+ if (auraError.id !== void 0) {
263
+ data.id = auraError.id;
258
264
  }
259
265
  return new FetchResponse(data.statusCode, data);
260
266
  }
261
267
  return new FetchResponse(500, {
262
- error: err2.message
268
+ error: err2?.message
263
269
  });
264
270
  }
265
271
  function getStatusText(status) {
@@ -301,9 +307,10 @@ function deepFreeze(value) {
301
307
  deepFreeze(value[i]);
302
308
  }
303
309
  } else {
304
- const keys$1 = keys(value);
310
+ const record = value;
311
+ const keys$1 = keys(record);
305
312
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
306
- deepFreeze(value[keys$1[i]]);
313
+ deepFreeze(record[keys$1[i]]);
307
314
  }
308
315
  }
309
316
  freeze(value);
@@ -377,7 +384,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
377
384
  async afterRequestHooks(_options) {
378
385
  }
379
386
  };
380
- function buildServiceDescriptor$q() {
387
+ function buildServiceDescriptor$p() {
381
388
  return {
382
389
  type: "networkCommandBaseClass",
383
390
  version: "1.0",
@@ -483,7 +490,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
483
490
  return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
484
491
  }
485
492
  }
486
- function buildServiceDescriptor$p() {
493
+ function buildServiceDescriptor$o() {
487
494
  return {
488
495
  type: "auraNetworkCommandBaseClass",
489
496
  version: "1.0",
@@ -525,7 +532,9 @@ function buildSubscribableResult(result, subscribe, refresh) {
525
532
  }
526
533
  function resolvedPromiseLike$1(result) {
527
534
  if (isPromiseLike$1(result)) {
528
- return result.then((nextResult) => nextResult);
535
+ return result.then(
536
+ (nextResult) => nextResult
537
+ );
529
538
  }
530
539
  return {
531
540
  then: (onFulfilled, _onRejected) => {
@@ -542,7 +551,9 @@ function resolvedPromiseLike$1(result) {
542
551
  }
543
552
  function rejectedPromiseLike$1(reason) {
544
553
  if (isPromiseLike$1(reason)) {
545
- return reason.then((nextResult) => nextResult);
554
+ return reason.then(
555
+ (nextResult) => nextResult
556
+ );
546
557
  }
547
558
  return {
548
559
  then: (_onFulfilled, onRejected) => {
@@ -1036,144 +1047,6 @@ function mergeCacheControlConfigs(baseConfig, overrides) {
1036
1047
  };
1037
1048
  }
1038
1049
 
1039
- let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheControlCommand {
1040
- constructor(services) {
1041
- super(services);
1042
- this.services = services;
1043
- this.actionConfig = {
1044
- background: false,
1045
- hotspot: true,
1046
- longRunning: false,
1047
- storable: false
1048
- };
1049
- this.networkPreference = "aura";
1050
- }
1051
- get fetchParams() {
1052
- throw new Error(
1053
- "Fetch parameters must be specified when using HTTP transport on an Aura adapter"
1054
- );
1055
- }
1056
- shouldUseAuraNetwork() {
1057
- return this.services.auraNetwork !== void 0 && (this.networkPreference === "aura" || !this.services.fetch);
1058
- }
1059
- shouldUseFetch() {
1060
- return this.services.fetch !== void 0 && (this.networkPreference === "http" || !this.services.auraNetwork);
1061
- }
1062
- requestFromNetwork() {
1063
- if (this.shouldUseAuraNetwork()) {
1064
- return this.convertAuraResponseToData(
1065
- this.services.auraNetwork(this.endpoint, this.auraParams, this.actionConfig),
1066
- (errs) => this.coerceAuraErrors(errs)
1067
- );
1068
- } else if (this.shouldUseFetch()) {
1069
- const params = this.fetchParams;
1070
- try {
1071
- return this.convertFetchResponseToData(this.services.fetch(...params));
1072
- } catch (reason) {
1073
- return resolvedPromiseLike$2(err$1(toError(reason)));
1074
- }
1075
- }
1076
- return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
1077
- }
1078
- coerceAuraErrors(auraErrors) {
1079
- return toError(auraErrors[0]);
1080
- }
1081
- async coerceError(errorResponse) {
1082
- return toError(errorResponse.statusText);
1083
- }
1084
- processAuraReturnValue(auraReturnValue) {
1085
- return ok$2(auraReturnValue);
1086
- }
1087
- processFetchReturnValue(json) {
1088
- return ok$2(json);
1089
- }
1090
- convertAuraResponseToData(responsePromise, coerceError) {
1091
- return responsePromise.then((response) => {
1092
- return this.processAuraReturnValue(response.getReturnValue());
1093
- }).finally(() => {
1094
- try {
1095
- this.afterRequestHooks({ statusCode: 200 });
1096
- } catch {
1097
- }
1098
- }).catch((error) => {
1099
- if (!error) {
1100
- return err$1(toError("Failed to get error from response"));
1101
- }
1102
- if (!error.getError) {
1103
- return err$1(toError(error));
1104
- }
1105
- const actionErrors = error.getError();
1106
- if (actionErrors.length > 0) {
1107
- return err$1(coerceError(actionErrors));
1108
- }
1109
- return err$1(toError("Error fetching component"));
1110
- });
1111
- }
1112
- convertFetchResponseToData(response) {
1113
- return response.then(
1114
- (response2) => {
1115
- if (response2.ok) {
1116
- return response2.json().then(
1117
- (json) => {
1118
- return this.processFetchReturnValue(json);
1119
- },
1120
- (reason) => err$1(toError(reason))
1121
- ).finally(() => {
1122
- try {
1123
- this.afterRequestHooks({ statusCode: response2.status });
1124
- } catch {
1125
- }
1126
- });
1127
- } else {
1128
- return this.coerceError(response2).then((coercedError) => {
1129
- return err$1(coercedError);
1130
- }).finally(() => {
1131
- try {
1132
- this.afterRequestHooks({ statusCode: response2.status });
1133
- } catch {
1134
- }
1135
- });
1136
- }
1137
- },
1138
- (reason) => err$1(toError(reason))
1139
- );
1140
- }
1141
- };
1142
- class AuraResourceCacheControlCommand extends AuraCacheControlCommand$1 {
1143
- constructor(services) {
1144
- super(services);
1145
- this.services = services;
1146
- }
1147
- readFromCache(cache) {
1148
- const data = cache.get(this.buildKey())?.value;
1149
- if (data === void 0) {
1150
- return resolvedPromiseLike$2(err$1(new Error("Failed to find data in cache")));
1151
- }
1152
- return resolvedPromiseLike$2(ok$2(data));
1153
- }
1154
- writeToCache(cache, networkResult) {
1155
- if (networkResult.isOk()) {
1156
- cache.set(this.buildKey(), {
1157
- value: networkResult.value,
1158
- metadata: {
1159
- cacheControl: this.buildCacheControlMetadata(networkResult.value)
1160
- }
1161
- });
1162
- }
1163
- return resolvedPromiseLike$2(void 0);
1164
- }
1165
- buildKey() {
1166
- return `{"endpoint":${this.endpoint},"params":${stableJSONStringify(this.auraParams)}}`;
1167
- }
1168
- }
1169
- function buildServiceDescriptor$o() {
1170
- return {
1171
- type: "auraResourceCacheControlCommand",
1172
- version: "1.0",
1173
- service: AuraResourceCacheControlCommand
1174
- };
1175
- }
1176
-
1177
1050
  class AuraCacheControlCommand extends CacheControlCommand {
1178
1051
  constructor(services) {
1179
1052
  super(services);
@@ -1459,16 +1332,16 @@ class NetworkCommand extends BaseCommand {
1459
1332
  }
1460
1333
  }
1461
1334
  function isAbortableCommand(command) {
1462
- return "isAbortableCommand" in command && command.isAbortableCommand === true;
1335
+ return !!command && typeof command === "object" && "isAbortableCommand" in command && command.isAbortableCommand === true;
1463
1336
  }
1464
1337
  function hasFetchParams(command) {
1465
- return command && typeof command === "object" && "fetchParams" in command;
1338
+ return !!command && typeof command === "object" && "fetchParams" in command;
1466
1339
  }
1467
1340
  function createAbortableDecorator(command, options) {
1468
- if (!options?.signal || !(options?.signal instanceof AbortSignal)) {
1341
+ const signal = options?.signal;
1342
+ if (!signal || !(signal instanceof AbortSignal)) {
1469
1343
  return command;
1470
1344
  }
1471
- const { signal } = options;
1472
1345
  if (isAbortableCommand(command)) {
1473
1346
  if (process.env.NODE_ENV !== "production") {
1474
1347
  console.warn(
@@ -1479,14 +1352,15 @@ function createAbortableDecorator(command, options) {
1479
1352
  }
1480
1353
  if (!hasFetchParams(command)) {
1481
1354
  if (process.env.NODE_ENV !== "production") {
1355
+ const commandName = typeof command === "object" && command !== null ? command.constructor.name : typeof command;
1482
1356
  console.warn(
1483
- `Command ${command.constructor.name} does not support fetch operations. AbortSignal will be ignored.`
1357
+ `Command ${commandName} does not support fetch operations. AbortSignal will be ignored.`
1484
1358
  );
1485
1359
  }
1486
1360
  return command;
1487
1361
  }
1488
1362
  try {
1489
- return new Proxy(command, {
1363
+ const handler = {
1490
1364
  get(target, prop, receiver) {
1491
1365
  if (prop === "isAbortableCommand") {
1492
1366
  return true;
@@ -1495,8 +1369,8 @@ function createAbortableDecorator(command, options) {
1495
1369
  return signal;
1496
1370
  }
1497
1371
  if (prop === "fetchParams") {
1498
- const originalFetchParams = target[prop];
1499
- const isInternal = target.isInternalExecution === true;
1372
+ const originalFetchParams = Reflect.get(target, prop, receiver);
1373
+ const isInternal = Reflect.get(target, "isInternalExecution", receiver) === true;
1500
1374
  if (typeof originalFetchParams === "function") {
1501
1375
  return function(...args) {
1502
1376
  const originalReturnValue = originalFetchParams.apply(this, args);
@@ -1522,7 +1396,8 @@ function createAbortableDecorator(command, options) {
1522
1396
  }
1523
1397
  return Reflect.has(target, prop);
1524
1398
  }
1525
- });
1399
+ };
1400
+ return new Proxy(command, handler);
1526
1401
  } catch (error) {
1527
1402
  if (process.env.NODE_ENV !== "production") {
1528
1403
  console.error(
@@ -2578,7 +2453,9 @@ class Ok {
2578
2453
  const ok = (value) => new Ok(value);
2579
2454
  function resolvedPromiseLike(result) {
2580
2455
  if (isPromiseLike(result)) {
2581
- return result.then((nextResult) => nextResult);
2456
+ return result.then(
2457
+ (nextResult) => nextResult
2458
+ );
2582
2459
  }
2583
2460
  return {
2584
2461
  then: (onFulfilled, _onRejected) => {
@@ -2595,7 +2472,9 @@ function resolvedPromiseLike(result) {
2595
2472
  }
2596
2473
  function rejectedPromiseLike(reason) {
2597
2474
  if (isPromiseLike(reason)) {
2598
- return reason.then((nextResult) => nextResult);
2475
+ return reason.then(
2476
+ (nextResult) => nextResult
2477
+ );
2599
2478
  }
2600
2479
  return {
2601
2480
  then: (_onFulfilled, onRejected) => {
@@ -3249,7 +3128,7 @@ function buildServiceDescriptor$9(luvio) {
3249
3128
  },
3250
3129
  };
3251
3130
  }
3252
- // version: 1.444.0-a7f42f9edf
3131
+ // version: 1.446.0-f73bd65030
3253
3132
 
3254
3133
  /**
3255
3134
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3275,7 +3154,7 @@ function buildServiceDescriptor$8(notifyRecordUpdateAvailable, getNormalizedLuvi
3275
3154
  },
3276
3155
  };
3277
3156
  }
3278
- // version: 1.444.0-a7f42f9edf
3157
+ // version: 1.446.0-f73bd65030
3279
3158
 
3280
3159
  class JsonSchemaViolationError extends Error {
3281
3160
  constructor(message, validationErrors) {
@@ -3696,7 +3575,7 @@ function findSchemaAtPath(document, ref) {
3696
3575
  let path = "#";
3697
3576
  for (const key of keys) {
3698
3577
  path = `${path}/${key}`;
3699
- if (current[key] === void 0) {
3578
+ if (typeof current !== "object" || current === null || current[key] === void 0) {
3700
3579
  throw new InvalidRefError(
3701
3580
  `Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
3702
3581
  );
@@ -5244,13 +5123,12 @@ withDefaultLuvio((luvio) => {
5244
5123
  buildCopilotFetchServiceDescriptor(loggerService),
5245
5124
  buildServiceDescriptor$i(instrumentationServiceDescriptor.service),
5246
5125
  buildServiceDescriptor$f(cacheServiceDescriptor.service, inMemoryCacheInclusionPolicyServiceDescriptor.service, instrumentationServiceDescriptor.service),
5247
- buildServiceDescriptor$p(),
5126
+ buildServiceDescriptor$o(),
5248
5127
  buildServiceDescriptor$a(),
5249
5128
  buildServiceDescriptor$l(),
5250
- buildServiceDescriptor$q(),
5129
+ buildServiceDescriptor$p(),
5251
5130
  buildServiceDescriptor$k(),
5252
5131
  buildServiceDescriptor$j(),
5253
- buildServiceDescriptor$o(),
5254
5132
  buildServiceDescriptor$n(),
5255
5133
  buildServiceDescriptor$m(),
5256
5134
  buildServiceDescriptor$e(),
@@ -5271,4 +5149,4 @@ withDefaultLuvio((luvio) => {
5271
5149
  ];
5272
5150
  setServices(services);
5273
5151
  });
5274
- // version: 1.444.0-a7f42f9edf
5152
+ // version: 1.446.0-f73bd65030
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-webruntime",
3
- "version": "1.444.0",
3
+ "version": "1.446.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Webruntime runtime",
6
6
  "main": "dist/ldsWebruntimeOneStoreInit.js",
@@ -35,38 +35,37 @@
35
35
  "ready": "yarn build && jest --collectCoverage && yarn test:size && yarn release:corejar"
36
36
  },
37
37
  "devDependencies": {
38
- "@conduit-client/service-provisioner": "3.23.1",
39
- "@conduit-client/tools-core": "3.23.1",
38
+ "@conduit-client/service-provisioner": "3.24.0",
39
+ "@conduit-client/tools-core": "3.24.0",
40
40
  "jwt-encode": "1.0.1"
41
41
  },
42
42
  "dependencies": {
43
- "@conduit-client/command-aura-network": "3.23.1",
44
- "@conduit-client/command-aura-normalized-cache-control": "3.23.1",
45
- "@conduit-client/command-aura-resource-cache-control": "3.23.1",
46
- "@conduit-client/command-fetch-network": "3.23.1",
47
- "@conduit-client/command-http-normalized-cache-control": "3.23.1",
48
- "@conduit-client/command-ndjson": "3.23.1",
49
- "@conduit-client/command-network": "3.23.1",
50
- "@conduit-client/command-sse": "3.23.1",
51
- "@conduit-client/command-streaming": "3.23.1",
52
- "@conduit-client/jwt-manager": "3.23.1",
53
- "@conduit-client/service-aura-network": "3.23.1",
54
- "@conduit-client/service-bindings-imperative": "3.23.1",
55
- "@conduit-client/service-bindings-lwc": "3.23.1",
56
- "@conduit-client/service-cache": "3.23.1",
57
- "@conduit-client/service-cache-control": "3.23.1",
58
- "@conduit-client/service-cache-inclusion-policy": "3.23.1",
59
- "@conduit-client/service-fetch-network": "3.23.1",
60
- "@conduit-client/service-instrument-command": "3.23.1",
61
- "@conduit-client/service-pubsub": "3.23.1",
62
- "@conduit-client/service-store": "3.23.1",
63
- "@conduit-client/utils": "3.23.1",
43
+ "@conduit-client/command-aura-network": "3.24.0",
44
+ "@conduit-client/command-aura-normalized-cache-control": "3.24.0",
45
+ "@conduit-client/command-fetch-network": "3.24.0",
46
+ "@conduit-client/command-http-normalized-cache-control": "3.24.0",
47
+ "@conduit-client/command-ndjson": "3.24.0",
48
+ "@conduit-client/command-network": "3.24.0",
49
+ "@conduit-client/command-sse": "3.24.0",
50
+ "@conduit-client/command-streaming": "3.24.0",
51
+ "@conduit-client/jwt-manager": "3.24.0",
52
+ "@conduit-client/service-aura-network": "3.24.0",
53
+ "@conduit-client/service-bindings-imperative": "3.24.0",
54
+ "@conduit-client/service-bindings-lwc": "3.24.0",
55
+ "@conduit-client/service-cache": "3.24.0",
56
+ "@conduit-client/service-cache-control": "3.24.0",
57
+ "@conduit-client/service-cache-inclusion-policy": "3.24.0",
58
+ "@conduit-client/service-fetch-network": "3.24.0",
59
+ "@conduit-client/service-instrument-command": "3.24.0",
60
+ "@conduit-client/service-pubsub": "3.24.0",
61
+ "@conduit-client/service-store": "3.24.0",
62
+ "@conduit-client/utils": "3.24.0",
64
63
  "@luvio/network-adapter-composable": "0.161.0",
65
64
  "@luvio/network-adapter-fetch": "0.161.0",
66
65
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
67
- "@salesforce/lds-default-luvio": "^1.444.0",
68
- "@salesforce/lds-luvio-service": "^1.444.0",
69
- "@salesforce/lds-luvio-uiapi-records-service": "^1.444.0"
66
+ "@salesforce/lds-default-luvio": "^1.446.0",
67
+ "@salesforce/lds-luvio-service": "^1.446.0",
68
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.446.0"
70
69
  },
71
70
  "luvioBundlesize": [
72
71
  {