@salesforce/lds-runtime-aura 1.420.0 → 1.421.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.
@@ -34,13 +34,13 @@ import { ThirdPartyTracker } from 'instrumentation:thirdPartyTracker';
34
34
  import { markStart, markEnd, counter, registerCacheStats, perfStart, perfEnd, registerPeriodicLogger, interaction, timer, mark } from 'instrumentation/service';
35
35
  import { instrument as instrument$2, setupLexNetworkAdapter } from 'force/ldsNetworkFetch';
36
36
  import { REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, instrument as instrument$3 } from 'force/ldsBindings';
37
- import { LRUCache, instrumentAdapter, instrumentLuvio, logMessage as logMessage$1, 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';
37
+ import { stateManagerInstrumentation, OperationTypeValue, LRUCache, instrumentAdapter, instrumentLuvio, logMessage as logMessage$1, setupInstrumentation as setupInstrumentation$1, logObjectInfoChanged as logObjectInfoChanged$1, updatePercentileHistogramMetric, incrementCounterMetric, incrementGetRecordNotifyChangeAllowCount, incrementGetRecordNotifyChangeDropCount, incrementNotifyRecordUpdateAvailableAllowCount, incrementNotifyRecordUpdateAvailableDropCount, setLdsAdaptersUiapiInstrumentation, logError as logError$2, setLdsNetworkAdapterInstrumentation, executeAsyncActivity, METRIC_KEYS, onIdleDetected } from 'force/ldsInstrumentation';
38
38
  import { instrument as instrument$4 } from 'force/adsBridge';
39
39
  import { instrument as instrument$5 } from '@lwc/state';
40
40
  import { withRegistration, register, setDefaultLuvio } from 'force/ldsEngine';
41
41
  import applyPredictionRequestLimit from '@salesforce/gate/lds.pdl.applyRequestLimit';
42
42
  import { pageScopedCache } from 'instrumentation/utility';
43
- import { createStorage, clearStorages } from 'force/ldsStorage';
43
+ import { createStorage, clearStorages, setDurableStorageImplementation } from 'force/ldsDurableStorage';
44
44
  import lightningConnectEnabled from '@salesforce/gate/ui.services.LightningConnect.enabled';
45
45
  import bypassAppRestrictionEnabled from '@salesforce/gate/ui.services.LightningConnect.BypassAppRestriction.enabled';
46
46
  import csrfValidationEnabled from '@salesforce/gate/ui.services.LightningConnect.CsrfValidation.enabled';
@@ -49,6 +49,7 @@ import useHttpUiapiOneApp from '@salesforce/gate/lds.useHttpUiapiOneApp';
49
49
  import useHttpUiapiOneRuntime from '@salesforce/gate/lds.useHttpUiapiOneRuntime';
50
50
  import disableCreateContentDocumentAndVersionHTTPLexRuntime from '@salesforce/gate/lds.lex.http.disableCreateContentDocumentAndVersion';
51
51
  import useHotspotLimit from '@salesforce/gate/lds.pdl.useHotspotLimit';
52
+ import { createStorage as createStorage$1, clearStorages as clearStorages$1 } from 'force/ldsStorage';
52
53
 
53
54
  /*!
54
55
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -2705,7 +2706,7 @@ function buildServiceDescriptor$d(luvio) {
2705
2706
  },
2706
2707
  };
2707
2708
  }
2708
- // version: 1.420.0-576a1ea316
2709
+ // version: 1.421.0-45320a2742
2709
2710
 
2710
2711
  /*!
2711
2712
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3058,7 +3059,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
3058
3059
  },
3059
3060
  };
3060
3061
  }
3061
- // version: 1.420.0-576a1ea316
3062
+ // version: 1.421.0-45320a2742
3062
3063
 
3063
3064
  /*!
3064
3065
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4926,6 +4927,59 @@ const TOTAL_ADAPTER_REQUEST_SUCCESS_COUNT = {
4926
4927
  },
4927
4928
  };
4928
4929
 
4930
+ function getOperationType(type) {
4931
+ switch (type) {
4932
+ case 'internal':
4933
+ return OperationTypeValue.Internal;
4934
+ case 'external':
4935
+ return OperationTypeValue.External;
4936
+ case 'uiapi':
4937
+ return OperationTypeValue.UiApi;
4938
+ case 'unknown':
4939
+ return OperationTypeValue.Unknown;
4940
+ default:
4941
+ return OperationTypeValue.Other;
4942
+ }
4943
+ }
4944
+ /**
4945
+ /**
4946
+ * Determines if the given component name represents an external component.
4947
+ * @remarks A component is considered external if its name starts with 'c/'.
4948
+ *
4949
+ * @param componentName - The name of the component to check.
4950
+ * @returns True if the component is external, false otherwise.
4951
+ */
4952
+ function isExternalComponent(componentName = '') {
4953
+ return componentName.startsWith('c/');
4954
+ }
4955
+ function stateCreated(metadata) {
4956
+ const definedBy = metadata.definedBy || 'unknown';
4957
+ const type = getOperationType(metadata.type);
4958
+ stateManagerInstrumentation.incrementStateCreatedCount({
4959
+ type,
4960
+ definedBy,
4961
+ });
4962
+ }
4963
+ function contextConsumed({ stateDefMetadata, componentName, }) {
4964
+ const definedBy = stateDefMetadata?.definedBy || 'unknown';
4965
+ let type = getOperationType(stateDefMetadata?.type || 'unknown');
4966
+ if (type !== OperationTypeValue.External && isExternalComponent(componentName)) {
4967
+ type = OperationTypeValue.External;
4968
+ }
4969
+ stateManagerInstrumentation.incrementStateContextConsumedCount({
4970
+ type,
4971
+ definedBy,
4972
+ });
4973
+ }
4974
+ function stateDefined(metadata) {
4975
+ const definedBy = metadata?.definedBy || 'unknown';
4976
+ const type = getOperationType(metadata?.type || 'unknown');
4977
+ stateManagerInstrumentation.incrementStateDefinedCount({
4978
+ type,
4979
+ definedBy,
4980
+ });
4981
+ }
4982
+
4929
4983
  const { create, keys, hasOwnProperty, entries } = Object;
4930
4984
  const { isArray, from } = Array;
4931
4985
  const { stringify: stringify$1 } = JSON;
@@ -5444,12 +5498,7 @@ function setStateManagerInstrumentationHooks() {
5444
5498
  if (stateManagerInstrumentationHooksInitialized) {
5445
5499
  return;
5446
5500
  }
5447
- instrument$5({
5448
- stateCreated: incrementStateCreatedCount,
5449
- // noop for now.
5450
- stateDefined: () => { },
5451
- contextConsumed: () => { },
5452
- });
5501
+ instrument$5({ stateCreated, stateDefined, contextConsumed });
5453
5502
  stateManagerInstrumentationHooksInitialized = true;
5454
5503
  }
5455
5504
  /**
@@ -5646,7 +5695,7 @@ function getEnvironmentSetting(name) {
5646
5695
  }
5647
5696
  return undefined;
5648
5697
  }
5649
- // version: 1.420.0-576a1ea316
5698
+ // version: 1.421.0-45320a2742
5650
5699
 
5651
5700
  const environmentHasAura = typeof window !== 'undefined' && typeof window.$A !== 'undefined';
5652
5701
  const defaultConfig = {
@@ -6605,19 +6654,19 @@ const UIAPI_PATHS = [
6605
6654
  // getObjectInfo
6606
6655
  '/ui-api/object-info/{objectApiName}',
6607
6656
  // getObjectInfos
6608
- // '/ui-api/object-info/batch/{objectApiNames}',
6657
+ '/ui-api/object-info/batch/{objectApiNames}',
6609
6658
  // getPicklistValuesByRecordType
6610
- // '/ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}',
6659
+ '/ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}',
6611
6660
  // getDuplicates
6612
- // '/ui-api/predupe',
6661
+ '/ui-api/predupe',
6613
6662
  // getRecord
6614
- // '/ui-api/records/{recordId}',
6663
+ '/ui-api/records/{recordId}',
6615
6664
  // getRecordUi
6616
- // '/ui-api/record-ui/{recordIds}',
6665
+ '/ui-api/record-ui/{recordIds}',
6617
6666
  // getRelatedListInfo
6618
- // '/ui-api/related-list-info/{parentObjectApiName}/{relatedListId}',
6667
+ '/ui-api/related-list-info/{parentObjectApiName}/{relatedListId}',
6619
6668
  // getRelatedListRecords
6620
- // '/ui-api/related-list-records/{parentRecordId}/{relatedListId}',
6669
+ '/ui-api/related-list-records/{parentRecordId}/{relatedListId}',
6621
6670
  ];
6622
6671
  /**
6623
6672
  * Single content documents version URL enabled/disabled by killswitch.
@@ -10427,6 +10476,10 @@ function buildPredictorForContext(context) {
10427
10476
  };
10428
10477
  }
10429
10478
  function initializeLDS() {
10479
+ setDurableStorageImplementation({
10480
+ createStorage: createStorage$1,
10481
+ clearStorages: clearStorages$1,
10482
+ });
10430
10483
  const storeOptions = {
10431
10484
  scheduler: () => { },
10432
10485
  };
@@ -10553,4 +10606,4 @@ function ldsEngineCreator() {
10553
10606
  }
10554
10607
 
10555
10608
  export { LexRequestStrategy, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
10556
- // version: 1.420.0-fc658f6118
10609
+ // version: 1.421.0-2828c95aef
@@ -0,0 +1,4 @@
1
+ import type { StateDefMetadata, ContextConsumedMetadata } from '@lwc/state';
2
+ export declare function stateCreated(metadata: StateDefMetadata): void;
3
+ export declare function contextConsumed({ stateDefMetadata, componentName, }: ContextConsumedMetadata): void;
4
+ export declare function stateDefined(metadata?: StateDefMetadata): void;
@@ -1,6 +1,6 @@
1
1
  import { type PrefetchStorage } from '.';
2
2
  import { InMemoryPrefetchStorage } from './in-memory-prefetch-storage';
3
- import { type AuraStorage, type AuraStorageConfig } from '@salesforce/lds-aura-storage';
3
+ import { type Storage, type StorageConfig } from '@salesforce/lds-durable-storage';
4
4
  export declare const DEFAULT_STORAGE_OPTIONS: {
5
5
  name: string;
6
6
  persistent: boolean;
@@ -11,7 +11,7 @@ export declare const DEFAULT_STORAGE_OPTIONS: {
11
11
  debugLogging: boolean;
12
12
  version: number;
13
13
  };
14
- export type StorageOptions = Partial<AuraStorageConfig> & {
14
+ export type StorageOptions = Partial<StorageConfig> & {
15
15
  onPredictionsReadyCallback?: () => void;
16
16
  };
17
17
  export declare function buildAuraPrefetchStorage(options?: StorageOptions): PrefetchStorage;
@@ -19,7 +19,7 @@ export declare function buildAuraLocalStoragePrefetchStorage(options?: StorageOp
19
19
  export declare class AuraPrefetchStorage implements PrefetchStorage {
20
20
  private auraStorage;
21
21
  private inMemoryStorage;
22
- constructor(auraStorage: AuraStorage, inMemoryStorage: InMemoryPrefetchStorage, onPredictionsReadyCallback?: () => void);
22
+ constructor(auraStorage: Storage, inMemoryStorage: InMemoryPrefetchStorage, onPredictionsReadyCallback?: () => void);
23
23
  set<T>(key: string, value: T): Promise<void>;
24
24
  get<T>(key: string): T | undefined;
25
25
  }
@@ -1,11 +1,11 @@
1
- import { type AuraStorageConfig } from '@salesforce/lds-aura-storage';
1
+ import { type StorageConfig } from '@salesforce/lds-durable-storage';
2
2
  import { type CacheInclusionPolicyServiceDescriptor, type CacheQuery, type CacheUpdate, DurableCacheInclusionPolicy } from '@conduit-client/service-cache-inclusion-policy/v1';
3
3
  import type { Cache, CacheEntry, Key } from '@conduit-client/service-cache/v1';
4
4
  import type { DeepReadonly } from '@conduit-client/utils';
5
5
  /**
6
6
  * Configuration options for AuraDurableCacheInclusionPolicy
7
7
  */
8
- export type DurableCacheConfig = Partial<AuraStorageConfig>;
8
+ export type DurableCacheConfig = Partial<StorageConfig>;
9
9
  /**
10
10
  * Durable cache inclusion policy that uses AuraStorage for persistent L2 cache
11
11
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.420.0",
3
+ "version": "1.421.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -34,50 +34,52 @@
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.14.0",
38
- "@conduit-client/tools-core": "3.14.0",
39
- "@salesforce/lds-adapters-apex": "^1.420.0",
40
- "@salesforce/lds-adapters-uiapi": "^1.420.0",
41
- "@salesforce/lds-ads-bridge": "^1.420.0",
42
- "@salesforce/lds-aura-storage": "^1.420.0",
43
- "@salesforce/lds-bindings": "^1.420.0",
44
- "@salesforce/lds-instrumentation": "^1.420.0",
45
- "@salesforce/lds-network-aura": "^1.420.0",
46
- "@salesforce/lds-network-fetch": "^1.420.0",
37
+ "@conduit-client/service-provisioner": "3.15.1",
38
+ "@conduit-client/tools-core": "3.15.1",
39
+ "@salesforce/lds-adapters-apex": "^1.421.0",
40
+ "@salesforce/lds-adapters-uiapi": "^1.421.0",
41
+ "@salesforce/lds-ads-bridge": "^1.421.0",
42
+ "@salesforce/lds-aura-storage": "^1.421.0",
43
+ "@salesforce/lds-bindings": "^1.421.0",
44
+ "@salesforce/lds-durable-storage": "^1.420.0",
45
+ "@salesforce/lds-instrumentation": "^1.421.0",
46
+ "@salesforce/lds-network-aura": "^1.421.0",
47
+ "@salesforce/lds-network-fetch": "^1.421.0",
47
48
  "jwt-encode": "1.0.1"
48
49
  },
49
50
  "dependencies": {
50
- "@conduit-client/command-aura-graphql-normalized-cache-control": "3.14.0",
51
- "@conduit-client/command-aura-network": "3.14.0",
52
- "@conduit-client/command-aura-normalized-cache-control": "3.14.0",
53
- "@conduit-client/command-aura-resource-cache-control": "3.14.0",
54
- "@conduit-client/command-fetch-network": "3.14.0",
55
- "@conduit-client/command-http-graphql-normalized-cache-control": "3.14.0",
56
- "@conduit-client/command-http-normalized-cache-control": "3.14.0",
57
- "@conduit-client/command-ndjson": "3.14.0",
58
- "@conduit-client/command-network": "3.14.0",
59
- "@conduit-client/command-sse": "3.14.0",
60
- "@conduit-client/command-streaming": "3.14.0",
61
- "@conduit-client/service-aura-network": "3.14.0",
62
- "@conduit-client/service-bindings-imperative": "3.14.0",
63
- "@conduit-client/service-bindings-lwc": "3.14.0",
64
- "@conduit-client/service-cache": "3.14.0",
65
- "@conduit-client/service-cache-control": "3.14.0",
66
- "@conduit-client/service-cache-inclusion-policy": "3.14.0",
67
- "@conduit-client/service-config": "3.14.0",
68
- "@conduit-client/service-feature-flags": "3.14.0",
69
- "@conduit-client/service-fetch-network": "3.14.0",
70
- "@conduit-client/service-instrument-command": "3.14.0",
71
- "@conduit-client/service-pubsub": "3.14.0",
72
- "@conduit-client/service-store": "3.14.0",
73
- "@conduit-client/utils": "3.14.0",
51
+ "@conduit-client/command-aura-graphql-normalized-cache-control": "3.15.1",
52
+ "@conduit-client/command-aura-network": "3.15.1",
53
+ "@conduit-client/command-aura-normalized-cache-control": "3.15.1",
54
+ "@conduit-client/command-aura-resource-cache-control": "3.15.1",
55
+ "@conduit-client/command-fetch-network": "3.15.1",
56
+ "@conduit-client/command-http-graphql-normalized-cache-control": "3.15.1",
57
+ "@conduit-client/command-http-normalized-cache-control": "3.15.1",
58
+ "@conduit-client/command-ndjson": "3.15.1",
59
+ "@conduit-client/command-network": "3.15.1",
60
+ "@conduit-client/command-sse": "3.15.1",
61
+ "@conduit-client/command-streaming": "3.15.1",
62
+ "@conduit-client/service-aura-network": "3.15.1",
63
+ "@conduit-client/service-bindings-imperative": "3.15.1",
64
+ "@conduit-client/service-bindings-lwc": "3.15.1",
65
+ "@conduit-client/service-cache": "3.15.1",
66
+ "@conduit-client/service-cache-control": "3.15.1",
67
+ "@conduit-client/service-cache-inclusion-policy": "3.15.1",
68
+ "@conduit-client/service-config": "3.15.1",
69
+ "@conduit-client/service-feature-flags": "3.15.1",
70
+ "@conduit-client/service-fetch-network": "3.15.1",
71
+ "@conduit-client/service-instrument-command": "3.15.1",
72
+ "@conduit-client/service-pubsub": "3.15.1",
73
+ "@conduit-client/service-store": "3.15.1",
74
+ "@conduit-client/utils": "3.15.1",
74
75
  "@luvio/network-adapter-composable": "0.160.3",
75
76
  "@luvio/network-adapter-fetch": "0.160.3",
76
- "@lwc/state": "^0.26.0",
77
- "@salesforce/lds-adapters-onestore-graphql": "^1.420.0",
77
+ "@lwc/state": "^0.28.0",
78
+ "@salesforce/lds-adapters-onestore-graphql": "^1.421.0",
78
79
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
79
- "@salesforce/lds-luvio-service": "^1.420.0",
80
- "@salesforce/lds-luvio-uiapi-records-service": "^1.420.0"
80
+ "@salesforce/lds-durable-storage": "^1.421.0",
81
+ "@salesforce/lds-luvio-service": "^1.421.0",
82
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.421.0"
81
83
  },
82
84
  "luvioBundlesize": [
83
85
  {