@salesforce/lds-runtime-aura 1.412.1 → 1.413.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.
@@ -33,7 +33,7 @@ import { dispatchGlobalEvent, unstable_loadComponentDefs, executeGlobalControlle
33
33
  import auraNetworkAdapter, { dispatchAuraAction, defaultActionConfig, instrument as instrument$1, forceRecordTransactionsDisabled as forceRecordTransactionsDisabled$1, ldsNetworkAdapterInstrument, CrudEventState, CrudEventType, UIAPI_RECORDS_PATH, UIAPI_RELATED_LIST_RECORDS_BATCH_PATH, UIAPI_RELATED_LIST_RECORDS_PATH } from 'force/ldsNetwork';
34
34
  import { ThirdPartyTracker } from 'instrumentation:thirdPartyTracker';
35
35
  import { markStart, markEnd, counter, registerCacheStats, perfStart, perfEnd, registerPeriodicLogger, interaction, timer } from 'instrumentation/service';
36
- import { instrument as instrument$2, setupLexNetworkAdapter, internalRequestTracker, generateRequestId as generateRequestId$1 } from 'force/ldsNetworkFetch';
36
+ import { instrument as instrument$2, generateRequestId as generateRequestId$1, setupLexNetworkAdapter } from 'force/ldsNetworkFetch';
37
37
  import { REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, instrument as instrument$3 } from 'force/ldsBindings';
38
38
  import { LRUCache, instrumentAdapter, instrumentLuvio, setupInstrumentation as setupInstrumentation$1, logObjectInfoChanged as logObjectInfoChanged$1, updatePercentileHistogramMetric, incrementCounterMetric, incrementGetRecordNotifyChangeAllowCount, incrementGetRecordNotifyChangeDropCount, incrementNotifyRecordUpdateAvailableAllowCount, incrementNotifyRecordUpdateAvailableDropCount, setLdsAdaptersUiapiInstrumentation, logError as logError$2, setLdsNetworkAdapterInstrumentation, incrementStateCreatedCount, executeAsyncActivity, METRIC_KEYS, onIdleDetected } from 'force/ldsInstrumentation';
39
39
  import { instrument as instrument$4 } from 'force/adsBridge';
@@ -411,7 +411,10 @@ class AuraNetworkCommand extends NetworkCommand$1 {
411
411
  coerceAuraErrors(auraErrors) {
412
412
  return toError(auraErrors[0]);
413
413
  }
414
- async coerceFetchErrors(errorResponse) {
414
+ /**
415
+ * Customize how non-2xx fetch fallback responses are converted into errors.
416
+ */
417
+ async coerceError(errorResponse) {
415
418
  return toError(errorResponse.statusText);
416
419
  }
417
420
  convertAuraResponseToData(responsePromise, coerceError) {
@@ -449,7 +452,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
449
452
  }
450
453
  });
451
454
  } else {
452
- return this.coerceFetchErrors(response2).then((coercedError) => {
455
+ return this.coerceError(response2).then((coercedError) => {
453
456
  return err$1(coercedError);
454
457
  }).finally(() => {
455
458
  try {
@@ -1090,7 +1093,7 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
1090
1093
  coerceAuraErrors(auraErrors) {
1091
1094
  return toError(auraErrors[0]);
1092
1095
  }
1093
- async coerceFetchError(errorResponse) {
1096
+ async coerceError(errorResponse) {
1094
1097
  return toError(errorResponse.statusText);
1095
1098
  }
1096
1099
  processAuraReturnValue(auraReturnValue) {
@@ -1136,7 +1139,7 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
1136
1139
  }
1137
1140
  });
1138
1141
  } else {
1139
- return this.coerceFetchError(response2).then((coercedError) => {
1142
+ return this.coerceError(response2).then((coercedError) => {
1140
1143
  return err$1(coercedError);
1141
1144
  }).finally(() => {
1142
1145
  try {
@@ -1238,7 +1241,7 @@ class AuraCacheControlCommand extends CacheControlCommand {
1238
1241
  coerceAuraErrors(auraErrors) {
1239
1242
  return toError(auraErrors[0]);
1240
1243
  }
1241
- async coerceFetchError(errorResponse) {
1244
+ async coerceError(errorResponse) {
1242
1245
  return toError(errorResponse.statusText);
1243
1246
  }
1244
1247
  processAuraReturnValue(auraReturnValue) {
@@ -1284,7 +1287,7 @@ class AuraCacheControlCommand extends CacheControlCommand {
1284
1287
  }
1285
1288
  });
1286
1289
  } else {
1287
- return this.coerceFetchError(response2).then((coercedError) => {
1290
+ return this.coerceError(response2).then((coercedError) => {
1288
1291
  return err$1(coercedError);
1289
1292
  }).finally(() => {
1290
1293
  try {
@@ -2702,7 +2705,7 @@ function buildServiceDescriptor$d(luvio) {
2702
2705
  },
2703
2706
  };
2704
2707
  }
2705
- // version: 1.412.1-944b7de7af
2708
+ // version: 1.413.0-8cd312301b
2706
2709
 
2707
2710
  /*!
2708
2711
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3055,7 +3058,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
3055
3058
  },
3056
3059
  };
3057
3060
  }
3058
- // version: 1.412.1-944b7de7af
3061
+ // version: 1.413.0-8cd312301b
3059
3062
 
3060
3063
  /*!
3061
3064
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4805,7 +4808,7 @@ function getEnvironmentSetting(name) {
4805
4808
  }
4806
4809
  return undefined;
4807
4810
  }
4808
- // version: 1.412.1-944b7de7af
4811
+ // version: 1.413.0-8cd312301b
4809
4812
 
4810
4813
  /**
4811
4814
  * Observability / Critical Availability Program (230+)
@@ -5815,7 +5818,7 @@ function buildLexRuntimeLuvio5xxStatusResponseInterceptor() {
5815
5818
 
5816
5819
  const CSRF_TOKEN_KEY = 'salesforce_csrf_token';
5817
5820
  const CSRF_STORAGE_NAME = 'ldsCSRFToken';
5818
- const BASE_URI = '/services/data/v66.0';
5821
+ const BASE_URI = '/services/data/v67.0';
5819
5822
  const UI_API_BASE_URI = `${BASE_URI}/ui-api`;
5820
5823
  const CSRF_TOKEN_ENDPOINT = `${UI_API_BASE_URI}/session/csrf`;
5821
5824
  const CSRF_STORAGE_CONFIG = {
@@ -6034,6 +6037,48 @@ function buildLuvioCsrfTokenInterceptor() {
6034
6037
  };
6035
6038
  }
6036
6039
 
6040
+ function createInstrumentationIdContext() {
6041
+ return () => ({
6042
+ instrumentationId: generateRequestId$1(),
6043
+ });
6044
+ }
6045
+ function createStartMark(requestId) {
6046
+ const startMark = markStart('transport', 'request');
6047
+ startMark.context = {
6048
+ auraXHRId: requestId,
6049
+ background: false,
6050
+ actionDefs: ['lds-fetch'],
6051
+ requestId,
6052
+ requestLength: -1, // not known
6053
+ };
6054
+ }
6055
+ // noop implementation for when one is not provided
6056
+ let internalRequestTracker = {
6057
+ hasTracker: () => false,
6058
+ registerHandler: (_request, _name, _loadedCheck) => { },
6059
+ markFinished: (_request) => { },
6060
+ };
6061
+
6062
+ function buildLuvioThirdPartyTrackerRegisterInterceptor() {
6063
+ return (resourceRequest, context) => {
6064
+ if (context && context.instrumentationId) {
6065
+ instrumentationTracker.registerHandler(context.instrumentationId, 'luvio-inflight-network-request', () => {
6066
+ // return false until we signal we are finished
6067
+ return false;
6068
+ });
6069
+ }
6070
+ return resolvedPromiseLike$2(resourceRequest);
6071
+ };
6072
+ }
6073
+
6074
+ function buildLuvioThirdPartyTrackerFinishInterceptor() {
6075
+ return async (context) => {
6076
+ if (context && context.instrumentationId) {
6077
+ instrumentationTracker.markFinished(context.instrumentationId);
6078
+ }
6079
+ };
6080
+ }
6081
+
6037
6082
  function isOneRuntime() {
6038
6083
  return !!globalThis.LWR;
6039
6084
  }
@@ -6156,12 +6201,18 @@ const composedFetchNetworkAdapter = {
6156
6201
  }
6157
6202
  return ENABLED_PATH_MATCHERS.some((matcher) => matcher.test(path));
6158
6203
  },
6159
- adapter: setupLexNetworkAdapter(requestTracker, requestLogger, {
6160
- request: [buildLuvioPageScopedCacheRequestInterceptor(), buildLuvioCsrfTokenInterceptor()],
6204
+ adapter: setupLexNetworkAdapter(requestLogger, {
6205
+ createContext: createInstrumentationIdContext(),
6206
+ request: [
6207
+ buildLuvioThirdPartyTrackerRegisterInterceptor(),
6208
+ buildLuvioPageScopedCacheRequestInterceptor(),
6209
+ buildLuvioCsrfTokenInterceptor(),
6210
+ ],
6161
6211
  response: [
6162
6212
  buildLexRuntimeLuvio5xxStatusResponseInterceptor(),
6163
6213
  buildLexRuntimeLuvioAuthExpirationRedirectResponseInterceptor(),
6164
6214
  ],
6215
+ finally: [buildLuvioThirdPartyTrackerFinishInterceptor()],
6165
6216
  }),
6166
6217
  };
6167
6218
 
@@ -6185,22 +6236,6 @@ function buildThirdPartyTrackerRegisterInterceptor() {
6185
6236
  };
6186
6237
  }
6187
6238
 
6188
- function createInstrumentationIdContext() {
6189
- return () => ({
6190
- instrumentationId: generateRequestId$1(),
6191
- });
6192
- }
6193
- function createStartMark(requestId) {
6194
- const startMark = markStart('transport', 'request');
6195
- startMark.context = {
6196
- auraXHRId: requestId,
6197
- background: false,
6198
- actionDefs: ['lds-fetch'],
6199
- requestId,
6200
- requestLength: -1, // not known
6201
- };
6202
- }
6203
-
6204
6239
  const DEFAULT_CONFIG$1 = {
6205
6240
  maxRetries: 1, // Only retry once after token refresh
6206
6241
  };
@@ -6291,8 +6326,8 @@ async function isCsrfError(response) {
6291
6326
  // Clone to avoid consuming the original response
6292
6327
  const cloned = response.clone();
6293
6328
  const body = await cloned.json();
6294
- // Check the error array format: data[0].errorCode
6295
- const errorCode = body?.data?.[0]?.errorCode;
6329
+ // Check the error array format: body[0].errorCode
6330
+ const errorCode = body?.[0]?.errorCode;
6296
6331
  return errorCode === 'INVALID_ACCESS_TOKEN';
6297
6332
  }
6298
6333
  catch {
@@ -10015,4 +10050,4 @@ function ldsEngineCreator() {
10015
10050
  }
10016
10051
 
10017
10052
  export { LexRequestStrategy, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
10018
- // version: 1.412.1-054d9a1111
10053
+ // version: 1.413.0-a073c11951
@@ -0,0 +1 @@
1
+ export declare function buildLuvioThirdPartyTrackerFinishInterceptor(): (context?: any) => Promise<void>;
@@ -2,3 +2,9 @@ export declare function createInstrumentationIdContext(): () => {
2
2
  instrumentationId: string;
3
3
  };
4
4
  export declare function createStartMark(requestId: string): void;
5
+ export type RequestTracker = {
6
+ hasTracker: () => boolean;
7
+ registerHandler: (request: any, name: string, loadedCheck: () => boolean) => void;
8
+ markFinished: (request: any) => void;
9
+ };
10
+ export declare let internalRequestTracker: RequestTracker;
@@ -1,5 +1,6 @@
1
1
  import { type ResourceRequest } from '@luvio/engine';
2
- import type { RequestLogger, RequestTracker } from '@salesforce/lds-network-fetch';
2
+ import type { RequestLogger } from '@salesforce/lds-network-fetch';
3
+ import { RequestTracker } from './instrumentation-utils';
3
4
  /**
4
5
  * Base set of url paths that this adapter can serve via HTTP when enabled.
5
6
  * Extend this list to support additional endpoints (see predicate wiring below).
@@ -0,0 +1,2 @@
1
+ import { ResourceRequest } from '@luvio/engine';
2
+ export declare function buildLuvioThirdPartyTrackerRegisterInterceptor(): (resourceRequest: ResourceRequest, context?: any) => PromiseLike<ResourceRequest>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.412.1",
3
+ "version": "1.413.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -34,49 +34,49 @@
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.7.1",
38
- "@conduit-client/tools-core": "3.7.1",
39
- "@salesforce/lds-adapters-apex": "^1.412.1",
40
- "@salesforce/lds-adapters-uiapi": "^1.412.1",
41
- "@salesforce/lds-ads-bridge": "^1.412.1",
42
- "@salesforce/lds-aura-storage": "^1.412.1",
43
- "@salesforce/lds-bindings": "^1.412.1",
44
- "@salesforce/lds-instrumentation": "^1.412.1",
45
- "@salesforce/lds-network-aura": "^1.412.1",
46
- "@salesforce/lds-network-fetch": "^1.412.1",
37
+ "@conduit-client/service-provisioner": "3.8.0",
38
+ "@conduit-client/tools-core": "3.8.0",
39
+ "@salesforce/lds-adapters-apex": "^1.413.0",
40
+ "@salesforce/lds-adapters-uiapi": "^1.413.0",
41
+ "@salesforce/lds-ads-bridge": "^1.413.0",
42
+ "@salesforce/lds-aura-storage": "^1.413.0",
43
+ "@salesforce/lds-bindings": "^1.413.0",
44
+ "@salesforce/lds-instrumentation": "^1.413.0",
45
+ "@salesforce/lds-network-aura": "^1.413.0",
46
+ "@salesforce/lds-network-fetch": "^1.413.0",
47
47
  "jwt-encode": "1.0.1"
48
48
  },
49
49
  "dependencies": {
50
- "@conduit-client/command-aura-graphql-normalized-cache-control": "3.7.1",
51
- "@conduit-client/command-aura-network": "3.7.1",
52
- "@conduit-client/command-aura-normalized-cache-control": "3.7.1",
53
- "@conduit-client/command-aura-resource-cache-control": "3.7.1",
54
- "@conduit-client/command-fetch-network": "3.7.1",
55
- "@conduit-client/command-http-graphql-normalized-cache-control": "3.7.1",
56
- "@conduit-client/command-http-normalized-cache-control": "3.7.1",
57
- "@conduit-client/command-ndjson": "3.7.1",
58
- "@conduit-client/command-network": "3.7.1",
59
- "@conduit-client/command-sse": "3.7.1",
60
- "@conduit-client/command-streaming": "3.7.1",
61
- "@conduit-client/service-aura-network": "3.7.1",
62
- "@conduit-client/service-bindings-imperative": "3.7.1",
63
- "@conduit-client/service-bindings-lwc": "3.7.1",
64
- "@conduit-client/service-cache": "3.7.1",
65
- "@conduit-client/service-cache-control": "3.7.1",
66
- "@conduit-client/service-cache-inclusion-policy": "3.7.1",
67
- "@conduit-client/service-feature-flags": "3.7.1",
68
- "@conduit-client/service-fetch-network": "3.7.1",
69
- "@conduit-client/service-instrument-command": "3.7.1",
70
- "@conduit-client/service-pubsub": "3.7.1",
71
- "@conduit-client/service-store": "3.7.1",
72
- "@conduit-client/utils": "3.7.1",
50
+ "@conduit-client/command-aura-graphql-normalized-cache-control": "3.8.0",
51
+ "@conduit-client/command-aura-network": "3.8.0",
52
+ "@conduit-client/command-aura-normalized-cache-control": "3.8.0",
53
+ "@conduit-client/command-aura-resource-cache-control": "3.8.0",
54
+ "@conduit-client/command-fetch-network": "3.8.0",
55
+ "@conduit-client/command-http-graphql-normalized-cache-control": "3.8.0",
56
+ "@conduit-client/command-http-normalized-cache-control": "3.8.0",
57
+ "@conduit-client/command-ndjson": "3.8.0",
58
+ "@conduit-client/command-network": "3.8.0",
59
+ "@conduit-client/command-sse": "3.8.0",
60
+ "@conduit-client/command-streaming": "3.8.0",
61
+ "@conduit-client/service-aura-network": "3.8.0",
62
+ "@conduit-client/service-bindings-imperative": "3.8.0",
63
+ "@conduit-client/service-bindings-lwc": "3.8.0",
64
+ "@conduit-client/service-cache": "3.8.0",
65
+ "@conduit-client/service-cache-control": "3.8.0",
66
+ "@conduit-client/service-cache-inclusion-policy": "3.8.0",
67
+ "@conduit-client/service-feature-flags": "3.8.0",
68
+ "@conduit-client/service-fetch-network": "3.8.0",
69
+ "@conduit-client/service-instrument-command": "3.8.0",
70
+ "@conduit-client/service-pubsub": "3.8.0",
71
+ "@conduit-client/service-store": "3.8.0",
72
+ "@conduit-client/utils": "3.8.0",
73
73
  "@luvio/network-adapter-composable": "0.158.7",
74
74
  "@luvio/network-adapter-fetch": "0.158.7",
75
75
  "@lwc/state": "^0.23.0",
76
- "@salesforce/lds-adapters-onestore-graphql": "^1.412.1",
77
- "@salesforce/lds-adapters-uiapi-lex": "^1.412.1",
78
- "@salesforce/lds-luvio-service": "^1.412.1",
79
- "@salesforce/lds-luvio-uiapi-records-service": "^1.412.1"
76
+ "@salesforce/lds-adapters-onestore-graphql": "^1.413.0",
77
+ "@salesforce/lds-adapters-uiapi-lex": "^1.413.0",
78
+ "@salesforce/lds-luvio-service": "^1.413.0",
79
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.413.0"
80
80
  },
81
81
  "luvioBundlesize": [
82
82
  {
@@ -84,7 +84,7 @@
84
84
  "maxSize": {
85
85
  "none": "350 kB",
86
86
  "min": "190 kB",
87
- "compressed": "57.2 kB"
87
+ "compressed": "57.3 kB"
88
88
  }
89
89
  }
90
90
  ],