@salesforce/lds-ads-bridge 1.124.2 → 1.124.3
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.
- package/dist/ads-bridge-perf.js +4728 -4728
- package/dist/adsBridge.js +342 -342
- package/package.json +2 -2
- package/rollup.config.js +3 -3
- package/dist/ads-bridge.d.ts +0 -87
- package/dist/instrumentation.d.ts +0 -22
- package/dist/main.d.ts +0 -13
- package/dist/utils/language.d.ts +0 -11
- package/dist/utils/metric-keys.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-ads-bridge",
|
|
3
|
-
"version": "1.124.
|
|
3
|
+
"version": "1.124.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "Bridge to sync data between LDS and ADS",
|
|
6
6
|
"main": "dist/adsBridge.js",
|
|
7
7
|
"module": "dist/adsBridge.js",
|
|
8
|
-
"types": "dist/main.d.ts",
|
|
8
|
+
"types": "dist/types/main.d.ts",
|
|
9
9
|
"sfdc": {
|
|
10
10
|
"path": "forcelds/adsBridge/",
|
|
11
11
|
"publishedFileName": "adsBridge.js",
|
package/rollup.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import resolve from '@rollup/plugin-node-resolve';
|
|
2
|
-
import typescript from 'rollup
|
|
2
|
+
import typescript from '@rollup/plugin-typescript';
|
|
3
3
|
|
|
4
4
|
import * as packageJson from './package.json';
|
|
5
5
|
import { buildBanner, buildFooter, copyrightHeaderPlugin } from '../../scripts/rollup/rollup-utils';
|
|
@@ -24,7 +24,7 @@ const adsBridge = {
|
|
|
24
24
|
copyrightHeaderPlugin,
|
|
25
25
|
resolve(),
|
|
26
26
|
typescript({
|
|
27
|
-
|
|
27
|
+
declaration: false,
|
|
28
28
|
}),
|
|
29
29
|
],
|
|
30
30
|
};
|
|
@@ -39,7 +39,7 @@ const adsBridgeForPerfTest = {
|
|
|
39
39
|
copyrightHeaderPlugin,
|
|
40
40
|
resolve(),
|
|
41
41
|
typescript({
|
|
42
|
-
|
|
42
|
+
declaration: false,
|
|
43
43
|
}),
|
|
44
44
|
],
|
|
45
45
|
};
|
package/dist/ads-bridge.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { Luvio } from '@luvio/engine';
|
|
2
|
-
import type { RecordRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
-
interface AdsRecord {
|
|
4
|
-
/**
|
|
5
|
-
* True if the passed record is a primary record, otherwise false.
|
|
6
|
-
*
|
|
7
|
-
* The Salesforce APIs may represent different records with the same record id. All the
|
|
8
|
-
* records returned by the UI API are primary records.
|
|
9
|
-
*/
|
|
10
|
-
isPrimary: boolean;
|
|
11
|
-
/** The actual record data */
|
|
12
|
-
record: RecordRepresentation;
|
|
13
|
-
}
|
|
14
|
-
interface AdsRecordMap {
|
|
15
|
-
[recordId: string]: {
|
|
16
|
-
[objectApiName: string]: AdsRecord;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
interface ObjectMetadata {
|
|
20
|
-
/**
|
|
21
|
-
* The entity key prefix.
|
|
22
|
-
* This originally was typed as simply a "string",
|
|
23
|
-
* however, "keyPrefix" can be null on ObjectInfoRepresentation
|
|
24
|
-
* and existing behavior simply passes ObjectInfoRepresentation.keyPrefix
|
|
25
|
-
* straight to ADS. This type has been updated to capture that
|
|
26
|
-
* a string or null can be passed here.
|
|
27
|
-
* */
|
|
28
|
-
_keyPrefix: string | null;
|
|
29
|
-
/** The entity field name. */
|
|
30
|
-
_nameField: string;
|
|
31
|
-
/** The entity label. */
|
|
32
|
-
_entityLabel: string;
|
|
33
|
-
}
|
|
34
|
-
interface AdsObjectMetadataMap {
|
|
35
|
-
[objectApiName: string]: ObjectMetadata;
|
|
36
|
-
}
|
|
37
|
-
type LdsRecordChangedCallback = (record: AdsRecordMap, objectMetadata: AdsObjectMetadataMap) => any;
|
|
38
|
-
/**
|
|
39
|
-
* Returns whether or not a the record is a DMO entity.
|
|
40
|
-
* @param record - The record.
|
|
41
|
-
* @returns True if DMO, false otherwise.
|
|
42
|
-
*/
|
|
43
|
-
export declare function isDMOEntity(record: RecordRepresentation): boolean;
|
|
44
|
-
export default class AdsBridge {
|
|
45
|
-
private luvio;
|
|
46
|
-
private isRecordEmitLocked;
|
|
47
|
-
private watchUnsubscribe;
|
|
48
|
-
constructor(luvio: Luvio);
|
|
49
|
-
/**
|
|
50
|
-
* This setter invoked by recordLibrary to listen for records ingested by Luvio. The passed method
|
|
51
|
-
* is invoked whenever a record is ingested. It may be via getRecord, getRecordUi, getListUi, ...
|
|
52
|
-
*/
|
|
53
|
-
set receiveFromLdsCallback(callback: LdsRecordChangedCallback | undefined);
|
|
54
|
-
/**
|
|
55
|
-
* This method is invoked when a record has been ingested by ADS.
|
|
56
|
-
*
|
|
57
|
-
* ADS may invoke this method with records that are not UIAPI allowlisted so not refreshable by
|
|
58
|
-
* Luvio. Luvio filters the provided list so it ingests only UIAPI allowlisted records.
|
|
59
|
-
*/
|
|
60
|
-
addRecords(records: RecordRepresentation[], uiApiEntityAllowlist?: {
|
|
61
|
-
[name: string]: 'false' | undefined;
|
|
62
|
-
}): void;
|
|
63
|
-
/**
|
|
64
|
-
* This method is invoked whenever a record has been evicted from ADS.
|
|
65
|
-
*/
|
|
66
|
-
evict(recordId: string): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Gets the list of fields of a record that Luvio has in its store. The field list doesn't
|
|
69
|
-
* contains the spanning record fields. ADS uses this list when it loads a record from the
|
|
70
|
-
* server. This is an optimization to make a single roundtrip it queries for all fields required
|
|
71
|
-
* by ADS and Luvio.
|
|
72
|
-
*/
|
|
73
|
-
getTrackedFieldsForRecord(recordId: string): Promise<string[]>;
|
|
74
|
-
/**
|
|
75
|
-
* Prevents the bridge to emit record change during the execution of the callback.
|
|
76
|
-
* This methods should wrap all the Luvio store mutation done by the bridge. It prevents Luvio store
|
|
77
|
-
* mutations triggered by ADS to be emit back to ADS.
|
|
78
|
-
*/
|
|
79
|
-
private lockLdsRecordEmit;
|
|
80
|
-
/**
|
|
81
|
-
* This method retrieves queries the store with with passed record ids to retrieve their
|
|
82
|
-
* associated records and object info. Note that the passed ids are not Salesforce record id
|
|
83
|
-
* but rather Luvio internals store ids.
|
|
84
|
-
*/
|
|
85
|
-
private emitRecordChanged;
|
|
86
|
-
}
|
|
87
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Instrumentation hooks exposed by this module.
|
|
3
|
-
*/
|
|
4
|
-
export interface AdsBridgeInstrumentation {
|
|
5
|
-
/**
|
|
6
|
-
* Called at the end of execution for a function to track latency
|
|
7
|
-
* Current functions tracked: packages/lds-ads-bridge/src/utils/metric-keys.ts
|
|
8
|
-
*/
|
|
9
|
-
timerMetricAddDuration?: (metricName: string, valueInMs: number) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare let instrumentation: {
|
|
12
|
-
timerMetricAddDuration: (_metricName: string, _valueInMs: number) => void;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Allows external modules (typically a runtime environment) to set
|
|
16
|
-
* instrumentation hooks for this module. Note that the hooks are
|
|
17
|
-
* incremental - hooks not suppiled in newInstrumentation will retain
|
|
18
|
-
* their previous values. The default instrumentation hooks are no-ops.
|
|
19
|
-
*
|
|
20
|
-
* @param newInstrumentation instrumentation hooks to be overridden
|
|
21
|
-
*/
|
|
22
|
-
export declare function instrument(newInstrumentation: AdsBridgeInstrumentation): void;
|
package/dist/main.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import AdsBridge from './ads-bridge';
|
|
2
|
-
/**
|
|
3
|
-
* Callback used to inform interested parties that a new default Luvio has been set.
|
|
4
|
-
*/
|
|
5
|
-
export type Callback = (adsBridge: AdsBridge) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Registers a callback to be invoked with the AdsBridge instance. Note that the
|
|
8
|
-
* callback may be invoked multiple times if the default Luvio changes.
|
|
9
|
-
*
|
|
10
|
-
* @param callback callback to be invoked with the AdsBridge
|
|
11
|
-
*/
|
|
12
|
-
export declare function withAdsBridge(callback: Callback): void;
|
|
13
|
-
export { instrument, AdsBridgeInstrumentation } from './instrumentation';
|
package/dist/utils/language.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const push: (...items: any[]) => number;
|
|
2
|
-
declare const keys: {
|
|
3
|
-
(o: object): string[];
|
|
4
|
-
(o: {}): string[];
|
|
5
|
-
};
|
|
6
|
-
declare const hasOwnProperty: (v: PropertyKey) => boolean;
|
|
7
|
-
declare const parse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any, stringify: {
|
|
8
|
-
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
9
|
-
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
10
|
-
};
|
|
11
|
-
export { push as ArrayPrototypePush, keys as ObjectKeys, hasOwnProperty as ObjectPrototypeHasOwnProperty, parse as JSONParse, stringify as JSONStringify, };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const ADS_BRIDGE_ADD_RECORDS_DURATION = "ads-bridge-add-records-duration";
|
|
2
|
-
export declare const ADS_BRIDGE_EMIT_RECORD_CHANGED_DURATION = "ads-bridge-emit-record-changed-duration";
|
|
3
|
-
export declare const ADS_BRIDGE_EVICT_DURATION = "ads-bridge-evict-duration";
|