@salesforce/lds-runtime-mobile 1.100.2

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.
Files changed (98) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/DraftQueueFactory.d.ts +3 -0
  3. package/dist/NimbusBinaryStore.d.ts +2 -0
  4. package/dist/NimbusDraftQueue.d.ts +25 -0
  5. package/dist/RecordIdGenerator.d.ts +15 -0
  6. package/dist/__mocks__/@salesforce/i18n/currency.d.ts +2 -0
  7. package/dist/__mocks__/@salesforce/i18n/dateTime.shortDateFormat.d.ts +2 -0
  8. package/dist/__mocks__/@salesforce/i18n/dateTime.shortDateTimeFormat.d.ts +2 -0
  9. package/dist/__mocks__/@salesforce/i18n/dateTime.shortTimeFormat.d.ts +2 -0
  10. package/dist/__mocks__/@salesforce/i18n/locale.d.ts +2 -0
  11. package/dist/__mocks__/@salesforce/i18n/timeZone.d.ts +2 -0
  12. package/dist/__mocks__/@salesforce/user/Id.d.ts +2 -0
  13. package/dist/__mocks__/force/ldsGraphqlParser.d.ts +3 -0
  14. package/dist/__mocks__/lightning/i18nCldrOptions.d.ts +2 -0
  15. package/dist/__mocks__/lightning/i18nService.d.ts +10 -0
  16. package/dist/__mocks__/o11y/activity.d.ts +2 -0
  17. package/dist/__mocks__/o11y/client.d.ts +5 -0
  18. package/dist/__mocks__/o11y/idleDetector.d.ts +2 -0
  19. package/dist/__mocks__/o11y/instrumentation.d.ts +15 -0
  20. package/dist/durableStore/NimbusSqliteStore/NimbusSqliteStore.d.ts +20 -0
  21. package/dist/durableStore/NimbusSqliteStore/tables/AbstractKeyValueDataTable.d.ts +14 -0
  22. package/dist/durableStore/NimbusSqliteStore/tables/LdsDataTable.d.ts +15 -0
  23. package/dist/durableStore/NimbusSqliteStore/tables/LdsDataTableBase.d.ts +8 -0
  24. package/dist/durableStore/NimbusSqliteStore/tables/LdsDraftIdMapDataTable.d.ts +5 -0
  25. package/dist/durableStore/NimbusSqliteStore/tables/LdsDraftsDataTable.d.ts +5 -0
  26. package/dist/durableStore/NimbusSqliteStore/tables/LdsInternalDataTable.d.ts +15 -0
  27. package/dist/durableStore/NimbusSqliteStore/tables/index.d.ts +5 -0
  28. package/dist/durableStore/NimbusSqliteStore/tables/utils.d.ts +2 -0
  29. package/dist/durableStore/index.d.ts +2 -0
  30. package/dist/durableStore/makeEnvironmentGraphqlAware.d.ts +2 -0
  31. package/dist/environment/enableLazyObjectInfoCaching.d.ts +13 -0
  32. package/dist/inspection/setupInspection.d.ts +2 -0
  33. package/dist/instrumentation/instrumentDraftQueue.d.ts +2 -0
  34. package/dist/instrumentation/instrumentGraphQLEval.d.ts +2 -0
  35. package/dist/instrumentation/instrumentMobileAdapter.d.ts +6 -0
  36. package/dist/instrumentation/instrumentPrimingSession.d.ts +2 -0
  37. package/dist/instrumentation/instrumentationContentDocumentVersionAdapter.d.ts +2 -0
  38. package/dist/instrumentation/instrumentationUtils.d.ts +10 -0
  39. package/dist/instrumentation/metrics.d.ts +14 -0
  40. package/dist/instrumentation/withInstrumentation.d.ts +12 -0
  41. package/dist/localization/formatDisplayValue.d.ts +6 -0
  42. package/dist/main.d.ts +6 -0
  43. package/dist/main.js +15242 -0
  44. package/dist/priming/primingSessionFactory.d.ts +13 -0
  45. package/dist/runtime.d.ts +17 -0
  46. package/dist/utils/ObjectInfoService.d.ts +43 -0
  47. package/dist/utils/adapters.d.ts +18 -0
  48. package/dist/utils/language.d.ts +29 -0
  49. package/dist/utils/utils.d.ts +13 -0
  50. package/package.json +93 -0
  51. package/sfdc/DraftQueueFactory.d.ts +3 -0
  52. package/sfdc/NimbusBinaryStore.d.ts +2 -0
  53. package/sfdc/NimbusDraftQueue.d.ts +25 -0
  54. package/sfdc/RecordIdGenerator.d.ts +15 -0
  55. package/sfdc/__mocks__/@salesforce/i18n/currency.d.ts +2 -0
  56. package/sfdc/__mocks__/@salesforce/i18n/dateTime.shortDateFormat.d.ts +2 -0
  57. package/sfdc/__mocks__/@salesforce/i18n/dateTime.shortDateTimeFormat.d.ts +2 -0
  58. package/sfdc/__mocks__/@salesforce/i18n/dateTime.shortTimeFormat.d.ts +2 -0
  59. package/sfdc/__mocks__/@salesforce/i18n/locale.d.ts +2 -0
  60. package/sfdc/__mocks__/@salesforce/i18n/timeZone.d.ts +2 -0
  61. package/sfdc/__mocks__/@salesforce/user/Id.d.ts +2 -0
  62. package/sfdc/__mocks__/force/ldsGraphqlParser.d.ts +3 -0
  63. package/sfdc/__mocks__/lightning/i18nCldrOptions.d.ts +2 -0
  64. package/sfdc/__mocks__/lightning/i18nService.d.ts +10 -0
  65. package/sfdc/__mocks__/o11y/activity.d.ts +2 -0
  66. package/sfdc/__mocks__/o11y/client.d.ts +5 -0
  67. package/sfdc/__mocks__/o11y/idleDetector.d.ts +2 -0
  68. package/sfdc/__mocks__/o11y/instrumentation.d.ts +15 -0
  69. package/sfdc/durableStore/NimbusSqliteStore/NimbusSqliteStore.d.ts +20 -0
  70. package/sfdc/durableStore/NimbusSqliteStore/tables/AbstractKeyValueDataTable.d.ts +14 -0
  71. package/sfdc/durableStore/NimbusSqliteStore/tables/LdsDataTable.d.ts +15 -0
  72. package/sfdc/durableStore/NimbusSqliteStore/tables/LdsDataTableBase.d.ts +8 -0
  73. package/sfdc/durableStore/NimbusSqliteStore/tables/LdsDraftIdMapDataTable.d.ts +5 -0
  74. package/sfdc/durableStore/NimbusSqliteStore/tables/LdsDraftsDataTable.d.ts +5 -0
  75. package/sfdc/durableStore/NimbusSqliteStore/tables/LdsInternalDataTable.d.ts +15 -0
  76. package/sfdc/durableStore/NimbusSqliteStore/tables/index.d.ts +5 -0
  77. package/sfdc/durableStore/NimbusSqliteStore/tables/utils.d.ts +2 -0
  78. package/sfdc/durableStore/index.d.ts +2 -0
  79. package/sfdc/durableStore/makeEnvironmentGraphqlAware.d.ts +2 -0
  80. package/sfdc/environment/enableLazyObjectInfoCaching.d.ts +13 -0
  81. package/sfdc/inspection/setupInspection.d.ts +2 -0
  82. package/sfdc/instrumentation/instrumentDraftQueue.d.ts +2 -0
  83. package/sfdc/instrumentation/instrumentGraphQLEval.d.ts +2 -0
  84. package/sfdc/instrumentation/instrumentMobileAdapter.d.ts +6 -0
  85. package/sfdc/instrumentation/instrumentPrimingSession.d.ts +2 -0
  86. package/sfdc/instrumentation/instrumentationContentDocumentVersionAdapter.d.ts +2 -0
  87. package/sfdc/instrumentation/instrumentationUtils.d.ts +10 -0
  88. package/sfdc/instrumentation/metrics.d.ts +14 -0
  89. package/sfdc/instrumentation/withInstrumentation.d.ts +12 -0
  90. package/sfdc/localization/formatDisplayValue.d.ts +6 -0
  91. package/sfdc/main.d.ts +6 -0
  92. package/sfdc/main.js +15242 -0
  93. package/sfdc/priming/primingSessionFactory.d.ts +13 -0
  94. package/sfdc/runtime.d.ts +17 -0
  95. package/sfdc/utils/ObjectInfoService.d.ts +43 -0
  96. package/sfdc/utils/adapters.d.ts +18 -0
  97. package/sfdc/utils/language.d.ts +29 -0
  98. package/sfdc/utils/utils.d.ts +13 -0
@@ -0,0 +1,13 @@
1
+ import { PrimingSession } from '@salesforce/lds-priming';
2
+ import type { Luvio, NetworkAdapter } from '@luvio/engine';
3
+ import type { NimbusSqliteStore } from '../durableStore/NimbusSqliteStore/NimbusSqliteStore';
4
+ import type { ObjectInfoService } from '../main';
5
+ export interface PrimingSessionFactoryConfig {
6
+ store: NimbusSqliteStore;
7
+ networkAdapter: NetworkAdapter;
8
+ objectInfoService: ObjectInfoService;
9
+ getLuvio: () => Luvio;
10
+ concurrency?: number;
11
+ batchSize?: number;
12
+ }
13
+ export declare function primingSessionFactory(config: PrimingSessionFactoryConfig): PrimingSession;
@@ -0,0 +1,17 @@
1
+ import { Luvio } from '@luvio/engine';
2
+ import { DraftManager } from '@salesforce/lds-drafts';
3
+ import type { DraftQueue } from '@salesforce/lds-drafts';
4
+ import type { PrimingSession } from '@salesforce/lds-priming';
5
+ export interface Runtime {
6
+ luvio: Luvio;
7
+ draftQueue: DraftQueue;
8
+ draftManager: DraftManager;
9
+ createPrimingSession: (config: {
10
+ concurrency?: number;
11
+ batchSize?: number;
12
+ }) => PrimingSession;
13
+ }
14
+ /**
15
+ * This returns the LDS on Mobile Runtime singleton object.
16
+ */
17
+ export declare function getRuntime(): Runtime;
@@ -0,0 +1,43 @@
1
+ import type { Adapter } from '@luvio/engine';
2
+ import type { DurableStore } from '@luvio/environments';
3
+ import type { ObjectInfoRepresentation, SimplifiedBatchRepresentation, getObjectInfoAdapterFactory, getObjectInfosAdapterFactory } from '@salesforce/lds-adapters-uiapi';
4
+ export declare const OBJECT_INFO_PREFIX_SEGMENT = "OBJECT_INFO_PREFIX_SEGMENT";
5
+ export interface ObjectInfoIndex {
6
+ apiName: string;
7
+ keyPrefix: string | null;
8
+ }
9
+ type ObjectInfoAdapterReturn = ReturnType<typeof getObjectInfoAdapterFactory>;
10
+ type ObjectInfosAdapterReturn = ReturnType<typeof getObjectInfosAdapterFactory>;
11
+ type ObjectInfoConfig = Parameters<ObjectInfoAdapterReturn>[0];
12
+ type ObjectInfosConfig = Parameters<ObjectInfosAdapterReturn>[0];
13
+ export type ObjectInfoMap = {
14
+ [apiName: string]: ObjectInfoRepresentation;
15
+ };
16
+ export declare class ObjectInfoService {
17
+ private getObjectInfoAdapter;
18
+ private getObjectInfosAdapter;
19
+ private durableStore;
20
+ objectInfoMemoryCache: {
21
+ [apiName: string]: string | null;
22
+ };
23
+ constructor(getObjectInfoAdapter: Adapter<ObjectInfoConfig, ObjectInfoRepresentation>, getObjectInfosAdapter: Adapter<ObjectInfosConfig, SimplifiedBatchRepresentation>, durableStore: DurableStore);
24
+ apiNameForPrefix: (prefix: string) => Promise<string>;
25
+ /**
26
+ * Size of return map not necessarily correlated with number of inputs. The
27
+ * ObjectInfoMap returned will only be populated with values of apiNames returned
28
+ * from the adapter.
29
+ */
30
+ getObjectInfos(apiNames: string[]): Promise<ObjectInfoMap>;
31
+ ensureObjectInfoCached: (apiName: string, entry?: ObjectInfoRepresentation) => Promise<void>;
32
+ /**
33
+ * Caches ObjectInfo(ApiName and KeyPrefix) in Durable Store
34
+ *
35
+ * @param apiName eg: 'Account'
36
+ * @param objectInfo Object Info
37
+ *
38
+ * @returns Promise
39
+ */
40
+ private createObjectInfoMapping;
41
+ private isObjectInfoInDurableStore;
42
+ }
43
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { InMemoryStore, NetworkAdapter } from '@luvio/engine';
2
+ import { Luvio } from '@luvio/engine';
3
+ import type { DurableStore } from '@luvio/environments';
4
+ import type { EnsureCachedObjectInfoFunction } from '../environment/enableLazyObjectInfoCaching';
5
+ /**
6
+ Builds adapter instances for environments that have cross-adapter dependencies.
7
+ These are only to be used internally in this module and not exported.
8
+ They do not use draft environments, just the makeDurable environment.
9
+ */
10
+ export declare function buildInternalAdapters(store: InMemoryStore, networkAdapter: NetworkAdapter, durableStore: DurableStore, ensureObjectInfoCached: EnsureCachedObjectInfoFunction): {
11
+ luvio: Luvio;
12
+ durableEnvironment: import("@luvio/environments").DurableEnvironment;
13
+ adapters: {
14
+ getRecord: import("@luvio/engine").Adapter<import("@salesforce/lds-adapters-uiapi").GetRecordConfig, import("@salesforce/lds-adapters-uiapi").RecordRepresentation>;
15
+ getObjectInfo: import("@luvio/engine").Adapter<import("@salesforce/lds-adapters-uiapi").GetObjectInfoConfig, import("@salesforce/lds-adapters-uiapi").ObjectInfoRepresentation>;
16
+ getObjectInfos: import("@luvio/engine").Adapter<import("@salesforce/lds-adapters-uiapi/dist/types/src/generated/adapters/getObjectInfos").GetObjectInfosConfig, import("@salesforce/lds-adapters-uiapi").SimplifiedBatchRepresentation>;
17
+ };
18
+ };
@@ -0,0 +1,29 @@
1
+ declare const keys: {
2
+ (o: object): string[];
3
+ (o: {}): string[];
4
+ }, create: {
5
+ (o: object | null): any;
6
+ (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
7
+ }, assign: {
8
+ <T extends {}, U>(target: T, source: U): T & U;
9
+ <T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
10
+ <T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
11
+ (target: object, ...sources: any[]): any;
12
+ }, entries: {
13
+ <T>(o: {
14
+ [s: string]: T;
15
+ } | ArrayLike<T>): [string, T][];
16
+ (o: {}): [string, any][];
17
+ };
18
+ declare const stringify: {
19
+ (value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
20
+ (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
21
+ }, parse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
22
+ declare const push: (...items: any[]) => number, join: (separator?: string | undefined) => string, slice: (start?: number | undefined, end?: number | undefined) => any[];
23
+ declare const isArray: (arg: any) => arg is any[], from: {
24
+ <T>(arrayLike: ArrayLike<T>): T[];
25
+ <T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
26
+ <T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
27
+ <T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
28
+ };
29
+ export { keys as ObjectKeys, create as ObjectCreate, assign as ObjectAssign, entries as ObjectEntries, push as ArrayPrototypePush, join as ArrayPrototypeJoin, slice as ArrayPrototypeSlice, isArray as ArrayIsArray, from as ArrayFrom, stringify as JSONStringify, parse as JSONParse, };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
3
+ * This is needed because insertion order for JSON.stringify(object) affects output:
4
+ * JSON.stringify({a: 1, b: 2})
5
+ * "{"a":1,"b":2}"
6
+ * JSON.stringify({b: 2, a: 1})
7
+ * "{"b":2,"a":1}"
8
+ * Modified from the apex implementation to sort arrays non-destructively.
9
+ * @param data Data to be JSON-stringified.
10
+ * @returns JSON.stringified value with consistent ordering of keys.
11
+ */
12
+ export declare function stableJSONStringify(node: any): string | undefined;
13
+ export declare function isPromise<D>(value: D | Promise<D> | null): value is Promise<D>;