@salesforce/lds-uiapi-record-utils-mobile 1.296.0 → 1.297.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.
- package/dist/ldsRecordUtils.js +2 -15
- package/dist/types/main.d.ts +0 -1
- package/package.json +2 -2
- package/dist/types/durableStore.d.ts +0 -50
package/dist/ldsRecordUtils.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION
|
|
7
|
+
import { RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION } from '@salesforce/lds-adapters-uiapi-mobile';
|
|
8
8
|
export { API_NAMESPACE, RECORD_ID_PREFIX, RECORD_REPRESENTATION_NAME, RECORD_VIEW_ENTITY_ID_PREFIX, buildRecordRepKeyFromId, extractRecordIdFromStoreKey, isStoreKeyRecordViewEntity } from '@salesforce/lds-adapters-uiapi-mobile';
|
|
9
9
|
|
|
10
10
|
function isStoreKeyRecordId(key) {
|
|
@@ -40,17 +40,4 @@ function objectsDeepEqual(lhs, rhs) {
|
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
return storeRecord.__type === 'error';
|
|
45
|
-
}
|
|
46
|
-
function isEntryDurableRecordRepresentation(entry, key) {
|
|
47
|
-
// Either a DurableRecordRepresentation or StoreRecordError can live at a record key
|
|
48
|
-
return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity(key)) &&
|
|
49
|
-
entry.data.__type === undefined);
|
|
50
|
-
}
|
|
51
|
-
function isFieldLink(field) {
|
|
52
|
-
const { value } = field;
|
|
53
|
-
return value !== null && typeof value === 'object' && value.__ref !== undefined;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { buildRecordFieldStoreKey, isEntryDurableRecordRepresentation, isFieldLink, isStoreKeyRecordField, isStoreKeyRecordId, isStoreRecordError, objectsDeepEqual };
|
|
43
|
+
export { buildRecordFieldStoreKey, isStoreKeyRecordField, isStoreKeyRecordId, objectsDeepEqual };
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export { API_NAMESPACE, RECORD_ID_PREFIX, RECORD_REPRESENTATION_NAME, RECORD_VIEW_ENTITY_ID_PREFIX, isStoreKeyRecordField, isStoreKeyRecordId, extractRecordIdFromStoreKey, buildRecordFieldStoreKey, isStoreKeyRecordViewEntity, buildRecordRepKeyFromId, objectsDeepEqual, } from './store-utils';
|
|
2
|
-
export * from './durableStore';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-uiapi-record-utils-mobile",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.297.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS Record Utilities",
|
|
6
6
|
"main": "dist/ldsRecordUtils.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test:unit": "jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@salesforce/lds-adapters-uiapi-mobile": "^1.
|
|
29
|
+
"@salesforce/lds-adapters-uiapi-mobile": "^1.297.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@luvio/engine": "0.154.20"
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { StoreLink, StoreRecordError } from '@luvio/engine';
|
|
2
|
-
import type { DurableStoreEntry } from '@luvio/environments';
|
|
3
|
-
import type { RecordRepresentationNormalized } from '@salesforce/lds-adapters-uiapi-mobile';
|
|
4
|
-
export type DurableRecordEntry = DurableRecordRepresentation | StoreRecordError;
|
|
5
|
-
/**
|
|
6
|
-
* representation of a record in the durable store
|
|
7
|
-
*/
|
|
8
|
-
export interface DurableRecordRepresentation extends DraftRecordRepresentation {
|
|
9
|
-
links: {
|
|
10
|
-
[key: string]: StoreLink;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare function isStoreRecordError(storeRecord: DurableRecordEntry | RecordRepresentationNormalized): storeRecord is StoreRecordError;
|
|
14
|
-
export declare function isEntryDurableRecordRepresentation(entry: DurableStoreEntry<any>, key: string): entry is DurableStoreEntry<DurableRecordRepresentation>;
|
|
15
|
-
/**
|
|
16
|
-
* Luvio normalizes all record fields regardless of if they are scalar or record references. This does not
|
|
17
|
-
* lend itself well to draft application. When dealing we drafts we convert this fully normalized record into
|
|
18
|
-
* a partially normalized record where all scalar fields are denormalized back into the parent record while
|
|
19
|
-
* record references remain normalized as links.
|
|
20
|
-
*
|
|
21
|
-
* Note that this is also the format that records get stored in in the durable store
|
|
22
|
-
*/
|
|
23
|
-
export interface DraftRecordRepresentation extends Omit<RecordRepresentationNormalized, 'fields'> {
|
|
24
|
-
drafts?: DraftRepresentation;
|
|
25
|
-
fields: {
|
|
26
|
-
[key: string]: DraftRecordFieldValueRepresentation;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export interface DraftRepresentation {
|
|
30
|
-
created: boolean;
|
|
31
|
-
edited: boolean;
|
|
32
|
-
deleted: boolean;
|
|
33
|
-
serverValues: {
|
|
34
|
-
[fieldName: string]: ScalarFieldRepresentationValue;
|
|
35
|
-
};
|
|
36
|
-
draftActionIds: string[];
|
|
37
|
-
latestDraftActionId: string;
|
|
38
|
-
}
|
|
39
|
-
export type ScalarFieldType = boolean | number | string | null;
|
|
40
|
-
export interface ScalarFieldRepresentationValue {
|
|
41
|
-
displayValue: string | null;
|
|
42
|
-
value: ScalarFieldType;
|
|
43
|
-
}
|
|
44
|
-
interface LinkFieldRepresentationValue {
|
|
45
|
-
displayValue: string | null;
|
|
46
|
-
value: StoreLink;
|
|
47
|
-
}
|
|
48
|
-
export type DraftRecordFieldValueRepresentation = ScalarFieldRepresentationValue | LinkFieldRepresentationValue;
|
|
49
|
-
export declare function isFieldLink(field: DraftRecordFieldValueRepresentation): field is LinkFieldRepresentationValue;
|
|
50
|
-
export {};
|