@salesforce/lds-runtime-webruntime 1.443.0 → 1.445.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) => {
@@ -176,7 +180,10 @@ function deepEquals$1(x, y) {
176
180
  }
177
181
  for (let i = 0; i < xkeys.length; ++i) {
178
182
  const key = xkeys[i];
179
- if (!deepEquals$1(x[key], y[key])) {
183
+ if (!deepEquals$1(
184
+ x[key],
185
+ y[key]
186
+ )) {
180
187
  return false;
181
188
  }
182
189
  }
@@ -185,8 +192,9 @@ function deepEquals$1(x, y) {
185
192
  return x === y;
186
193
  }
187
194
  function stableJSONStringify(node) {
188
- if (node && node.toJSON && typeof node.toJSON === "function") {
189
- node = node.toJSON();
195
+ const withToJSON = node;
196
+ if (withToJSON && typeof withToJSON.toJSON === "function") {
197
+ node = withToJSON.toJSON();
190
198
  }
191
199
  if (node === void 0) {
192
200
  return;
@@ -212,11 +220,12 @@ function stableJSONStringify(node) {
212
220
  if (node === null) {
213
221
  return "null";
214
222
  }
215
- const objKeys = keys(node).sort();
223
+ const record = node;
224
+ const objKeys = keys(record).sort();
216
225
  out = "";
217
226
  for (i = 0; i < objKeys.length; i++) {
218
227
  const key = objKeys[i];
219
- const value = stableJSONStringify(node[key]);
228
+ const value = stableJSONStringify(record[key]);
220
229
  if (!value) {
221
230
  continue;
222
231
  }
@@ -246,6 +255,19 @@ var HttpStatusCode = /* @__PURE__ */ ((HttpStatusCode2) => {
246
255
  HttpStatusCode2[HttpStatusCode2["GatewayTimeout"] = 504] = "GatewayTimeout";
247
256
  return HttpStatusCode2;
248
257
  })(HttpStatusCode || {});
258
+ function getFetchResponseFromAuraError(err2) {
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;
264
+ }
265
+ return new FetchResponse(data.statusCode, data);
266
+ }
267
+ return new FetchResponse(500, {
268
+ error: err2?.message
269
+ });
270
+ }
249
271
  function getStatusText(status) {
250
272
  switch (status) {
251
273
  case 200:
@@ -285,9 +307,10 @@ function deepFreeze(value) {
285
307
  deepFreeze(value[i]);
286
308
  }
287
309
  } else {
288
- const keys$1 = keys(value);
310
+ const record = value;
311
+ const keys$1 = keys(record);
289
312
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
290
- deepFreeze(value[keys$1[i]]);
313
+ deepFreeze(record[keys$1[i]]);
291
314
  }
292
315
  }
293
316
  freeze(value);
@@ -361,7 +384,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
361
384
  async afterRequestHooks(_options) {
362
385
  }
363
386
  };
364
- function buildServiceDescriptor$q() {
387
+ function buildServiceDescriptor$p() {
365
388
  return {
366
389
  type: "networkCommandBaseClass",
367
390
  version: "1.0",
@@ -387,7 +410,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
387
410
  );
388
411
  }
389
412
  coerceAuraErrors(auraErrors) {
390
- return toError(auraErrors[0]);
413
+ return new UserVisibleError(getFetchResponseFromAuraError(auraErrors[0]));
391
414
  }
392
415
  /**
393
416
  * Customize how non-2xx fetch fallback responses are converted into errors.
@@ -467,7 +490,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
467
490
  return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
468
491
  }
469
492
  }
470
- function buildServiceDescriptor$p() {
493
+ function buildServiceDescriptor$o() {
471
494
  return {
472
495
  type: "auraNetworkCommandBaseClass",
473
496
  version: "1.0",
@@ -509,7 +532,9 @@ function buildSubscribableResult(result, subscribe, refresh) {
509
532
  }
510
533
  function resolvedPromiseLike$1(result) {
511
534
  if (isPromiseLike$1(result)) {
512
- return result.then((nextResult) => nextResult);
535
+ return result.then(
536
+ (nextResult) => nextResult
537
+ );
513
538
  }
514
539
  return {
515
540
  then: (onFulfilled, _onRejected) => {
@@ -526,7 +551,9 @@ function resolvedPromiseLike$1(result) {
526
551
  }
527
552
  function rejectedPromiseLike$1(reason) {
528
553
  if (isPromiseLike$1(reason)) {
529
- return reason.then((nextResult) => nextResult);
554
+ return reason.then(
555
+ (nextResult) => nextResult
556
+ );
530
557
  }
531
558
  return {
532
559
  then: (_onFulfilled, onRejected) => {
@@ -572,7 +599,10 @@ function deepEquals(x, y) {
572
599
  }
573
600
  for (let i = 0; i < xkeys.length; ++i) {
574
601
  const key = xkeys[i];
575
- if (!deepEquals(x[key], y[key])) {
602
+ if (!deepEquals(
603
+ x[key],
604
+ y[key]
605
+ )) {
576
606
  return false;
577
607
  }
578
608
  }
@@ -1017,144 +1047,6 @@ function mergeCacheControlConfigs(baseConfig, overrides) {
1017
1047
  };
1018
1048
  }
1019
1049
 
1020
- let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheControlCommand {
1021
- constructor(services) {
1022
- super(services);
1023
- this.services = services;
1024
- this.actionConfig = {
1025
- background: false,
1026
- hotspot: true,
1027
- longRunning: false,
1028
- storable: false
1029
- };
1030
- this.networkPreference = "aura";
1031
- }
1032
- get fetchParams() {
1033
- throw new Error(
1034
- "Fetch parameters must be specified when using HTTP transport on an Aura adapter"
1035
- );
1036
- }
1037
- shouldUseAuraNetwork() {
1038
- return this.services.auraNetwork !== void 0 && (this.networkPreference === "aura" || !this.services.fetch);
1039
- }
1040
- shouldUseFetch() {
1041
- return this.services.fetch !== void 0 && (this.networkPreference === "http" || !this.services.auraNetwork);
1042
- }
1043
- requestFromNetwork() {
1044
- if (this.shouldUseAuraNetwork()) {
1045
- return this.convertAuraResponseToData(
1046
- this.services.auraNetwork(this.endpoint, this.auraParams, this.actionConfig),
1047
- (errs) => this.coerceAuraErrors(errs)
1048
- );
1049
- } else if (this.shouldUseFetch()) {
1050
- const params = this.fetchParams;
1051
- try {
1052
- return this.convertFetchResponseToData(this.services.fetch(...params));
1053
- } catch (reason) {
1054
- return resolvedPromiseLike$2(err$1(toError(reason)));
1055
- }
1056
- }
1057
- return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
1058
- }
1059
- coerceAuraErrors(auraErrors) {
1060
- return toError(auraErrors[0]);
1061
- }
1062
- async coerceError(errorResponse) {
1063
- return toError(errorResponse.statusText);
1064
- }
1065
- processAuraReturnValue(auraReturnValue) {
1066
- return ok$2(auraReturnValue);
1067
- }
1068
- processFetchReturnValue(json) {
1069
- return ok$2(json);
1070
- }
1071
- convertAuraResponseToData(responsePromise, coerceError) {
1072
- return responsePromise.then((response) => {
1073
- return this.processAuraReturnValue(response.getReturnValue());
1074
- }).finally(() => {
1075
- try {
1076
- this.afterRequestHooks({ statusCode: 200 });
1077
- } catch {
1078
- }
1079
- }).catch((error) => {
1080
- if (!error) {
1081
- return err$1(toError("Failed to get error from response"));
1082
- }
1083
- if (!error.getError) {
1084
- return err$1(toError(error));
1085
- }
1086
- const actionErrors = error.getError();
1087
- if (actionErrors.length > 0) {
1088
- return err$1(coerceError(actionErrors));
1089
- }
1090
- return err$1(toError("Error fetching component"));
1091
- });
1092
- }
1093
- convertFetchResponseToData(response) {
1094
- return response.then(
1095
- (response2) => {
1096
- if (response2.ok) {
1097
- return response2.json().then(
1098
- (json) => {
1099
- return this.processFetchReturnValue(json);
1100
- },
1101
- (reason) => err$1(toError(reason))
1102
- ).finally(() => {
1103
- try {
1104
- this.afterRequestHooks({ statusCode: response2.status });
1105
- } catch {
1106
- }
1107
- });
1108
- } else {
1109
- return this.coerceError(response2).then((coercedError) => {
1110
- return err$1(coercedError);
1111
- }).finally(() => {
1112
- try {
1113
- this.afterRequestHooks({ statusCode: response2.status });
1114
- } catch {
1115
- }
1116
- });
1117
- }
1118
- },
1119
- (reason) => err$1(toError(reason))
1120
- );
1121
- }
1122
- };
1123
- class AuraResourceCacheControlCommand extends AuraCacheControlCommand$1 {
1124
- constructor(services) {
1125
- super(services);
1126
- this.services = services;
1127
- }
1128
- readFromCache(cache) {
1129
- const data = cache.get(this.buildKey())?.value;
1130
- if (data === void 0) {
1131
- return resolvedPromiseLike$2(err$1(new Error("Failed to find data in cache")));
1132
- }
1133
- return resolvedPromiseLike$2(ok$2(data));
1134
- }
1135
- writeToCache(cache, networkResult) {
1136
- if (networkResult.isOk()) {
1137
- cache.set(this.buildKey(), {
1138
- value: networkResult.value,
1139
- metadata: {
1140
- cacheControl: this.buildCacheControlMetadata(networkResult.value)
1141
- }
1142
- });
1143
- }
1144
- return resolvedPromiseLike$2(void 0);
1145
- }
1146
- buildKey() {
1147
- return `{"endpoint":${this.endpoint},"params":${stableJSONStringify(this.auraParams)}}`;
1148
- }
1149
- }
1150
- function buildServiceDescriptor$o() {
1151
- return {
1152
- type: "auraResourceCacheControlCommand",
1153
- version: "1.0",
1154
- service: AuraResourceCacheControlCommand
1155
- };
1156
- }
1157
-
1158
1050
  class AuraCacheControlCommand extends CacheControlCommand {
1159
1051
  constructor(services) {
1160
1052
  super(services);
@@ -1440,16 +1332,16 @@ class NetworkCommand extends BaseCommand {
1440
1332
  }
1441
1333
  }
1442
1334
  function isAbortableCommand(command) {
1443
- return "isAbortableCommand" in command && command.isAbortableCommand === true;
1335
+ return !!command && typeof command === "object" && "isAbortableCommand" in command && command.isAbortableCommand === true;
1444
1336
  }
1445
1337
  function hasFetchParams(command) {
1446
- return command && typeof command === "object" && "fetchParams" in command;
1338
+ return !!command && typeof command === "object" && "fetchParams" in command;
1447
1339
  }
1448
1340
  function createAbortableDecorator(command, options) {
1449
- if (!options?.signal || !(options?.signal instanceof AbortSignal)) {
1341
+ const signal = options?.signal;
1342
+ if (!signal || !(signal instanceof AbortSignal)) {
1450
1343
  return command;
1451
1344
  }
1452
- const { signal } = options;
1453
1345
  if (isAbortableCommand(command)) {
1454
1346
  if (process.env.NODE_ENV !== "production") {
1455
1347
  console.warn(
@@ -1460,14 +1352,15 @@ function createAbortableDecorator(command, options) {
1460
1352
  }
1461
1353
  if (!hasFetchParams(command)) {
1462
1354
  if (process.env.NODE_ENV !== "production") {
1355
+ const commandName = typeof command === "object" && command !== null ? command.constructor.name : typeof command;
1463
1356
  console.warn(
1464
- `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.`
1465
1358
  );
1466
1359
  }
1467
1360
  return command;
1468
1361
  }
1469
1362
  try {
1470
- return new Proxy(command, {
1363
+ const handler = {
1471
1364
  get(target, prop, receiver) {
1472
1365
  if (prop === "isAbortableCommand") {
1473
1366
  return true;
@@ -1476,8 +1369,8 @@ function createAbortableDecorator(command, options) {
1476
1369
  return signal;
1477
1370
  }
1478
1371
  if (prop === "fetchParams") {
1479
- const originalFetchParams = target[prop];
1480
- const isInternal = target.isInternalExecution === true;
1372
+ const originalFetchParams = Reflect.get(target, prop, receiver);
1373
+ const isInternal = Reflect.get(target, "isInternalExecution", receiver) === true;
1481
1374
  if (typeof originalFetchParams === "function") {
1482
1375
  return function(...args) {
1483
1376
  const originalReturnValue = originalFetchParams.apply(this, args);
@@ -1503,7 +1396,8 @@ function createAbortableDecorator(command, options) {
1503
1396
  }
1504
1397
  return Reflect.has(target, prop);
1505
1398
  }
1506
- });
1399
+ };
1400
+ return new Proxy(command, handler);
1507
1401
  } catch (error) {
1508
1402
  if (process.env.NODE_ENV !== "production") {
1509
1403
  console.error(
@@ -2559,7 +2453,9 @@ class Ok {
2559
2453
  const ok = (value) => new Ok(value);
2560
2454
  function resolvedPromiseLike(result) {
2561
2455
  if (isPromiseLike(result)) {
2562
- return result.then((nextResult) => nextResult);
2456
+ return result.then(
2457
+ (nextResult) => nextResult
2458
+ );
2563
2459
  }
2564
2460
  return {
2565
2461
  then: (onFulfilled, _onRejected) => {
@@ -2576,7 +2472,9 @@ function resolvedPromiseLike(result) {
2576
2472
  }
2577
2473
  function rejectedPromiseLike(reason) {
2578
2474
  if (isPromiseLike(reason)) {
2579
- return reason.then((nextResult) => nextResult);
2475
+ return reason.then(
2476
+ (nextResult) => nextResult
2477
+ );
2580
2478
  }
2581
2479
  return {
2582
2480
  then: (_onFulfilled, onRejected) => {
@@ -3230,7 +3128,7 @@ function buildServiceDescriptor$9(luvio) {
3230
3128
  },
3231
3129
  };
3232
3130
  }
3233
- // version: 1.443.0-be70f6bb6e
3131
+ // version: 1.445.0-117c9de71a
3234
3132
 
3235
3133
  /**
3236
3134
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3256,7 +3154,7 @@ function buildServiceDescriptor$8(notifyRecordUpdateAvailable, getNormalizedLuvi
3256
3154
  },
3257
3155
  };
3258
3156
  }
3259
- // version: 1.443.0-be70f6bb6e
3157
+ // version: 1.445.0-117c9de71a
3260
3158
 
3261
3159
  class JsonSchemaViolationError extends Error {
3262
3160
  constructor(message, validationErrors) {
@@ -3677,7 +3575,7 @@ function findSchemaAtPath(document, ref) {
3677
3575
  let path = "#";
3678
3576
  for (const key of keys) {
3679
3577
  path = `${path}/${key}`;
3680
- if (current[key] === void 0) {
3578
+ if (typeof current !== "object" || current === null || current[key] === void 0) {
3681
3579
  throw new InvalidRefError(
3682
3580
  `Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
3683
3581
  );
@@ -3917,7 +3815,10 @@ class GraphQLImperativeBindingsService {
3917
3815
  const options = {
3918
3816
  acceptedOperations: ["query"]
3919
3817
  };
3920
- const result = resolveAndValidateGraphQLConfig(params[0], options);
3818
+ const result = resolveAndValidateGraphQLConfig(
3819
+ params[0],
3820
+ options
3821
+ );
3921
3822
  if (result?.isErr()) {
3922
3823
  return result.error;
3923
3824
  }
@@ -4114,7 +4015,10 @@ class GraphQLMutationBindingsService {
4114
4015
  const options = {
4115
4016
  acceptedOperations: ["mutation"]
4116
4017
  };
4117
- const result2 = resolveAndValidateGraphQLConfig(params[0], options);
4018
+ const result2 = resolveAndValidateGraphQLConfig(
4019
+ params[0],
4020
+ options
4021
+ );
4118
4022
  if (result2?.isErr()) {
4119
4023
  return {
4120
4024
  data: void 0,
@@ -5219,13 +5123,12 @@ withDefaultLuvio((luvio) => {
5219
5123
  buildCopilotFetchServiceDescriptor(loggerService),
5220
5124
  buildServiceDescriptor$i(instrumentationServiceDescriptor.service),
5221
5125
  buildServiceDescriptor$f(cacheServiceDescriptor.service, inMemoryCacheInclusionPolicyServiceDescriptor.service, instrumentationServiceDescriptor.service),
5222
- buildServiceDescriptor$p(),
5126
+ buildServiceDescriptor$o(),
5223
5127
  buildServiceDescriptor$a(),
5224
5128
  buildServiceDescriptor$l(),
5225
- buildServiceDescriptor$q(),
5129
+ buildServiceDescriptor$p(),
5226
5130
  buildServiceDescriptor$k(),
5227
5131
  buildServiceDescriptor$j(),
5228
- buildServiceDescriptor$o(),
5229
5132
  buildServiceDescriptor$n(),
5230
5133
  buildServiceDescriptor$m(),
5231
5134
  buildServiceDescriptor$e(),
@@ -5246,4 +5149,4 @@ withDefaultLuvio((luvio) => {
5246
5149
  ];
5247
5150
  setServices(services);
5248
5151
  });
5249
- // version: 1.443.0-be70f6bb6e
5152
+ // version: 1.445.0-117c9de71a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-webruntime",
3
- "version": "1.443.0",
3
+ "version": "1.445.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.22.0",
39
- "@conduit-client/tools-core": "3.22.0",
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.22.0",
44
- "@conduit-client/command-aura-normalized-cache-control": "3.22.0",
45
- "@conduit-client/command-aura-resource-cache-control": "3.22.0",
46
- "@conduit-client/command-fetch-network": "3.22.0",
47
- "@conduit-client/command-http-normalized-cache-control": "3.22.0",
48
- "@conduit-client/command-ndjson": "3.22.0",
49
- "@conduit-client/command-network": "3.22.0",
50
- "@conduit-client/command-sse": "3.22.0",
51
- "@conduit-client/command-streaming": "3.22.0",
52
- "@conduit-client/jwt-manager": "3.22.0",
53
- "@conduit-client/service-aura-network": "3.22.0",
54
- "@conduit-client/service-bindings-imperative": "3.22.0",
55
- "@conduit-client/service-bindings-lwc": "3.22.0",
56
- "@conduit-client/service-cache": "3.22.0",
57
- "@conduit-client/service-cache-control": "3.22.0",
58
- "@conduit-client/service-cache-inclusion-policy": "3.22.0",
59
- "@conduit-client/service-fetch-network": "3.22.0",
60
- "@conduit-client/service-instrument-command": "3.22.0",
61
- "@conduit-client/service-pubsub": "3.22.0",
62
- "@conduit-client/service-store": "3.22.0",
63
- "@conduit-client/utils": "3.22.0",
64
- "@luvio/network-adapter-composable": "0.160.5",
65
- "@luvio/network-adapter-fetch": "0.160.5",
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",
63
+ "@luvio/network-adapter-composable": "0.161.0",
64
+ "@luvio/network-adapter-fetch": "0.161.0",
66
65
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
67
- "@salesforce/lds-default-luvio": "^1.443.0",
68
- "@salesforce/lds-luvio-service": "^1.443.0",
69
- "@salesforce/lds-luvio-uiapi-records-service": "^1.443.0"
66
+ "@salesforce/lds-default-luvio": "^1.445.0",
67
+ "@salesforce/lds-luvio-service": "^1.445.0",
68
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.445.0"
70
69
  },
71
70
  "luvioBundlesize": [
72
71
  {
@@ -74,7 +73,7 @@
74
73
  "maxSize": {
75
74
  "none": "163 kB",
76
75
  "min": "85 kB",
77
- "compressed": "26 kB"
76
+ "compressed": "26.2 kB"
78
77
  }
79
78
  }
80
79
  ],