@salesforce/lds-runtime-mobile 1.298.0 → 1.299.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/main.js +144 -70
- package/package.json +20 -20
- package/sfdc/main.js +144 -70
package/dist/main.js
CHANGED
|
@@ -12501,7 +12501,7 @@ function createNewRecordQuery(schema, objectInfo, objectInfoMap) {
|
|
|
12501
12501
|
const { apiName, childRelationships, fields: fieldsRepresentation } = objectInfo;
|
|
12502
12502
|
typedScalars.add(`${apiName}_Filter`);
|
|
12503
12503
|
typedScalars.add(`${apiName}_OrderBy`);
|
|
12504
|
-
const { fields, polymorphicFieldTypeNames } = makeRecordField(values$1(fieldsRepresentation), objectInfoMap, parentRelationshipFields, 'Missing');
|
|
12504
|
+
const { fields, polymorphicFieldTypeNames } = makeRecordField(values$1(fieldsRepresentation), objectInfo, objectInfoMap, parentRelationshipFields, 'Missing');
|
|
12505
12505
|
// handles child relationship
|
|
12506
12506
|
const { spanningRecordConnections, typedScalars: spanningConnectionTypedScalars } = makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, parentRelationshipFields);
|
|
12507
12507
|
typedScalars = new Set([...typedScalars, ...spanningConnectionTypedScalars]);
|
|
@@ -12564,7 +12564,7 @@ function extendExistingRecordType(schema, type, objectInfo, objectInfoMap) {
|
|
|
12564
12564
|
return (existingFields.includes(field.apiName) === false ||
|
|
12565
12565
|
(field.relationshipName !== null && field.referenceToInfos.length > 0));
|
|
12566
12566
|
});
|
|
12567
|
-
const { fields, polymorphicFieldTypeNames } = makeRecordField(missingFields, objectInfoMap, parentRelationshipFields, 'Cached', existingFields);
|
|
12567
|
+
const { fields, polymorphicFieldTypeNames } = makeRecordField(missingFields, objectInfo, objectInfoMap, parentRelationshipFields, 'Cached', existingFields);
|
|
12568
12568
|
const { apiName, childRelationships } = objectInfo;
|
|
12569
12569
|
// handles child relationship
|
|
12570
12570
|
const { spanningRecordConnections, typedScalars: spanningConnectionTypedScalars } = makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, parentRelationshipFields, existingFields);
|
|
@@ -12639,12 +12639,12 @@ function makeSpanningRecordConnections(schema, childRelationships, objectInfoMap
|
|
|
12639
12639
|
* @param recordTypeInSchema
|
|
12640
12640
|
* @returns
|
|
12641
12641
|
*/
|
|
12642
|
-
function makeRecordField(fieldRepresentations, objectInfoMap, existingParentRelationships, recordTypeInSchema, existingFields = []) {
|
|
12642
|
+
function makeRecordField(fieldRepresentations, objectInfo, objectInfoMap, existingParentRelationships, recordTypeInSchema, existingFields = []) {
|
|
12643
12643
|
const polymorphicFieldTypeNames = new Set();
|
|
12644
12644
|
let fields = ``;
|
|
12645
12645
|
for (const field of values$1(fieldRepresentations)) {
|
|
12646
12646
|
if (!fieldsStaticallyAdded.includes(field.apiName) && recordTypeInSchema === 'Missing') {
|
|
12647
|
-
fields += `${field.apiName}: ${
|
|
12647
|
+
fields += `${field.apiName}: ${graphqlTypeForField(field, objectInfo)}\n`;
|
|
12648
12648
|
}
|
|
12649
12649
|
//handles parent relationship
|
|
12650
12650
|
if (field.relationshipName === null) {
|
|
@@ -12683,49 +12683,90 @@ function makeRecordField(fieldRepresentations, objectInfoMap, existingParentRela
|
|
|
12683
12683
|
* @param apiName
|
|
12684
12684
|
* @returns
|
|
12685
12685
|
*/
|
|
12686
|
-
function
|
|
12687
|
-
if (apiName
|
|
12688
|
-
return
|
|
12686
|
+
function graphqlTypeForField(field, objectInfo) {
|
|
12687
|
+
if (field.apiName === 'Id') {
|
|
12688
|
+
return 'ID!';
|
|
12689
12689
|
}
|
|
12690
|
-
switch (
|
|
12691
|
-
case '
|
|
12692
|
-
|
|
12693
|
-
case 'Email':
|
|
12694
|
-
case 'TextArea':
|
|
12695
|
-
return 'StringValue';
|
|
12696
|
-
case 'Reference':
|
|
12697
|
-
return 'IDValue';
|
|
12698
|
-
case 'Double':
|
|
12699
|
-
return 'DoubleValue';
|
|
12690
|
+
switch (field.dataType) {
|
|
12691
|
+
case 'Base64':
|
|
12692
|
+
return 'Base64Value';
|
|
12700
12693
|
case 'Boolean':
|
|
12701
12694
|
return 'BooleanValue';
|
|
12695
|
+
case 'Currency':
|
|
12696
|
+
return 'CurrencyValue';
|
|
12702
12697
|
case 'Date':
|
|
12703
12698
|
return 'DateValue';
|
|
12704
|
-
case 'Time':
|
|
12705
|
-
return 'TimeValue';
|
|
12706
12699
|
case 'DateTime':
|
|
12707
12700
|
return 'DateTimeValue';
|
|
12708
|
-
case '
|
|
12709
|
-
return '
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12701
|
+
case 'Double': {
|
|
12702
|
+
return getLatLongType(field, objectInfo) || 'DoubleValue';
|
|
12703
|
+
}
|
|
12704
|
+
case 'Email':
|
|
12705
|
+
return 'EmailValue';
|
|
12706
|
+
case 'EncryptedString':
|
|
12707
|
+
return 'EncryptedStringValue';
|
|
12708
|
+
case 'Int':
|
|
12709
|
+
return 'IntValue';
|
|
12710
|
+
// NB: JSON field type should never happen, but maybe in setup entities?
|
|
12711
|
+
case 'Json':
|
|
12712
|
+
case 'JSON':
|
|
12713
|
+
return 'JSONValue';
|
|
12714
|
+
case 'Long':
|
|
12715
|
+
return 'LongValue';
|
|
12716
12716
|
case 'MultiPicklist':
|
|
12717
12717
|
return 'MultiPicklistValue';
|
|
12718
12718
|
case 'Percent':
|
|
12719
12719
|
return 'PercentValue';
|
|
12720
|
-
case '
|
|
12721
|
-
return '
|
|
12722
|
-
case '
|
|
12723
|
-
return '
|
|
12720
|
+
case 'Phone':
|
|
12721
|
+
return 'PhoneNumberValue';
|
|
12722
|
+
case 'Picklist':
|
|
12723
|
+
return 'PicklistValue';
|
|
12724
|
+
case 'Reference':
|
|
12725
|
+
return 'IDValue';
|
|
12726
|
+
case 'String':
|
|
12727
|
+
return 'StringValue';
|
|
12728
|
+
case 'TextArea':
|
|
12729
|
+
return getTextAreaType(field);
|
|
12730
|
+
case 'Time':
|
|
12731
|
+
return 'TimeValue';
|
|
12732
|
+
case 'Url':
|
|
12733
|
+
return 'UrlValue';
|
|
12724
12734
|
// ! do the rest of the custom types
|
|
12725
12735
|
default:
|
|
12726
12736
|
return 'String';
|
|
12727
12737
|
}
|
|
12728
12738
|
}
|
|
12739
|
+
// Match server behavior for Latitude/Longitude fields:
|
|
12740
|
+
function getLatLongType(field, objectInfo) {
|
|
12741
|
+
const compoundFieldName = field.compoundFieldName;
|
|
12742
|
+
if (!compoundFieldName)
|
|
12743
|
+
return;
|
|
12744
|
+
const compoundField = objectInfo.fields[compoundFieldName];
|
|
12745
|
+
if (!compoundField)
|
|
12746
|
+
return;
|
|
12747
|
+
if (compoundField.dataType !== 'Address' && compoundField.dataType !== 'Location') {
|
|
12748
|
+
return;
|
|
12749
|
+
}
|
|
12750
|
+
// NB: the following means custom location fields will map to `DoubleValue` because
|
|
12751
|
+
// the fields will have the suffix `__s`. This is technically incorrect but matches
|
|
12752
|
+
// the server behavior as of the 252 release.
|
|
12753
|
+
if (field.apiName.endsWith('Latitude')) {
|
|
12754
|
+
return 'LatitudeValue';
|
|
12755
|
+
}
|
|
12756
|
+
if (field.apiName.endsWith('Longitude')) {
|
|
12757
|
+
return 'LongitudeValue';
|
|
12758
|
+
}
|
|
12759
|
+
}
|
|
12760
|
+
// Match server behavior for text area types:
|
|
12761
|
+
function getTextAreaType(field) {
|
|
12762
|
+
if (field.extraTypeInfo === 'RichTextArea') {
|
|
12763
|
+
return 'RichTextAreaValue';
|
|
12764
|
+
}
|
|
12765
|
+
else if (field.length > 255) {
|
|
12766
|
+
return 'LongTextAreaValue';
|
|
12767
|
+
}
|
|
12768
|
+
return 'TextAreaValue';
|
|
12769
|
+
}
|
|
12729
12770
|
|
|
12730
12771
|
async function evaluate(config, observers, settings, objectInfos, store, snapshot, cache, draftFunctions) {
|
|
12731
12772
|
const eventEmitter = createCustomAdapterEventEmitter(GRAPHQL_EVAL_NAMESPACE, observers);
|
|
@@ -17705,6 +17746,7 @@ class RecordLoaderGraphQL {
|
|
|
17705
17746
|
let rep;
|
|
17706
17747
|
try {
|
|
17707
17748
|
rep = await this.callGraphQL(batch, abortController);
|
|
17749
|
+
return this.generateFetchResult(rep, batch);
|
|
17708
17750
|
}
|
|
17709
17751
|
catch (e) {
|
|
17710
17752
|
return {
|
|
@@ -17714,12 +17756,15 @@ class RecordLoaderGraphQL {
|
|
|
17714
17756
|
missingIds: batch.ids,
|
|
17715
17757
|
};
|
|
17716
17758
|
}
|
|
17717
|
-
return this.generateFetchResult(rep, batch);
|
|
17718
17759
|
}
|
|
17719
17760
|
async batchFetchRecordData(batchs, abortController) {
|
|
17720
|
-
let reps;
|
|
17721
17761
|
try {
|
|
17722
|
-
reps = await this.callBatchGraphQL(batchs, abortController);
|
|
17762
|
+
const reps = await this.callBatchGraphQL(batchs, abortController);
|
|
17763
|
+
const recordFetchResults = [];
|
|
17764
|
+
for (let i = 0; i < reps.length; i++) {
|
|
17765
|
+
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
17766
|
+
}
|
|
17767
|
+
return recordFetchResults;
|
|
17723
17768
|
}
|
|
17724
17769
|
catch (e) {
|
|
17725
17770
|
const missingIds = batchs
|
|
@@ -17734,11 +17779,6 @@ class RecordLoaderGraphQL {
|
|
|
17734
17779
|
},
|
|
17735
17780
|
];
|
|
17736
17781
|
}
|
|
17737
|
-
const recordFetchResults = [];
|
|
17738
|
-
for (let i = 0; i < reps.length; i++) {
|
|
17739
|
-
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
17740
|
-
}
|
|
17741
|
-
return recordFetchResults;
|
|
17742
17782
|
}
|
|
17743
17783
|
generateFetchResult(repResult, batchInput) {
|
|
17744
17784
|
const { data, errors } = repResult;
|
|
@@ -17942,19 +17982,26 @@ class NimbusPrimingNetworkAdapter {
|
|
|
17942
17982
|
priority: 'background',
|
|
17943
17983
|
observabilityContext: {},
|
|
17944
17984
|
}, abortController, (response) => {
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17985
|
+
if (response.status < 200 || response.status > 299) {
|
|
17986
|
+
reject(new Error(response.body || 'Network error'));
|
|
17987
|
+
return;
|
|
17988
|
+
}
|
|
17989
|
+
try {
|
|
17990
|
+
const { body } = response;
|
|
17991
|
+
if (body) {
|
|
17992
|
+
const { results } = JSON.parse(body);
|
|
17993
|
+
if (results) {
|
|
17994
|
+
const gqlResults = results.map((compositeGqlResult) => compositeGqlResult.result);
|
|
17995
|
+
resolve(gqlResults);
|
|
17996
|
+
return;
|
|
17997
|
+
}
|
|
17951
17998
|
}
|
|
17952
17999
|
else {
|
|
17953
18000
|
reject(new Error(`No body returned from ${batchEndPointPath} endpoint`));
|
|
17954
18001
|
}
|
|
17955
18002
|
}
|
|
17956
|
-
|
|
17957
|
-
reject(
|
|
18003
|
+
catch (error) {
|
|
18004
|
+
reject(error);
|
|
17958
18005
|
}
|
|
17959
18006
|
}, (error) => {
|
|
17960
18007
|
reject(error);
|
|
@@ -17975,12 +18022,21 @@ class NimbusPrimingNetworkAdapter {
|
|
|
17975
18022
|
priority: 'background',
|
|
17976
18023
|
observabilityContext: {},
|
|
17977
18024
|
}, abortController, (response) => {
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
18025
|
+
if (response.status < 200 || response.status > 299) {
|
|
18026
|
+
reject(new Error(response.body || 'Network error'));
|
|
18027
|
+
return;
|
|
17981
18028
|
}
|
|
17982
|
-
|
|
17983
|
-
|
|
18029
|
+
try {
|
|
18030
|
+
const { body } = response;
|
|
18031
|
+
if (body) {
|
|
18032
|
+
resolve(JSON.parse(body));
|
|
18033
|
+
}
|
|
18034
|
+
else {
|
|
18035
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
18036
|
+
}
|
|
18037
|
+
}
|
|
18038
|
+
catch (error) {
|
|
18039
|
+
reject(error);
|
|
17984
18040
|
}
|
|
17985
18041
|
}, (error) => {
|
|
17986
18042
|
reject(error);
|
|
@@ -17998,12 +18054,21 @@ class NimbusPrimingNetworkAdapter {
|
|
|
17998
18054
|
priority: 'background',
|
|
17999
18055
|
observabilityContext: {},
|
|
18000
18056
|
}, abortController, (response) => {
|
|
18001
|
-
|
|
18002
|
-
|
|
18003
|
-
|
|
18057
|
+
if (response.status < 200 || response.status > 299) {
|
|
18058
|
+
reject(new Error(response.body || 'Network error'));
|
|
18059
|
+
return;
|
|
18004
18060
|
}
|
|
18005
|
-
|
|
18006
|
-
|
|
18061
|
+
try {
|
|
18062
|
+
const { body } = response;
|
|
18063
|
+
if (body) {
|
|
18064
|
+
resolve(JSON.parse(body).objects);
|
|
18065
|
+
}
|
|
18066
|
+
else {
|
|
18067
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
18068
|
+
}
|
|
18069
|
+
}
|
|
18070
|
+
catch (error) {
|
|
18071
|
+
reject(error);
|
|
18007
18072
|
}
|
|
18008
18073
|
}, (error) => {
|
|
18009
18074
|
reject(error);
|
|
@@ -18025,19 +18090,28 @@ class NimbusPrimingNetworkAdapter {
|
|
|
18025
18090
|
priority: 'background',
|
|
18026
18091
|
observabilityContext: {},
|
|
18027
18092
|
}, abortController, (response) => {
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
results.forEach((result) => {
|
|
18032
|
-
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
18033
|
-
if (result.statusCode === 200) {
|
|
18034
|
-
map.set(result.result.apiName, result.result);
|
|
18035
|
-
}
|
|
18036
|
-
});
|
|
18037
|
-
resolve(map);
|
|
18093
|
+
if (response.status < 200 || response.status > 299) {
|
|
18094
|
+
reject(new Error(response.body || 'Network error'));
|
|
18095
|
+
return;
|
|
18038
18096
|
}
|
|
18039
|
-
|
|
18040
|
-
|
|
18097
|
+
try {
|
|
18098
|
+
const { body } = response;
|
|
18099
|
+
if (body) {
|
|
18100
|
+
const results = JSON.parse(body).results;
|
|
18101
|
+
results.forEach((result) => {
|
|
18102
|
+
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
18103
|
+
if (result.statusCode === 200) {
|
|
18104
|
+
map.set(result.result.apiName, result.result);
|
|
18105
|
+
}
|
|
18106
|
+
});
|
|
18107
|
+
resolve(map);
|
|
18108
|
+
}
|
|
18109
|
+
else {
|
|
18110
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
18111
|
+
}
|
|
18112
|
+
}
|
|
18113
|
+
catch (error) {
|
|
18114
|
+
reject(error);
|
|
18041
18115
|
}
|
|
18042
18116
|
}, (error) => {
|
|
18043
18117
|
reject(error);
|
|
@@ -18471,4 +18545,4 @@ register({
|
|
|
18471
18545
|
});
|
|
18472
18546
|
|
|
18473
18547
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
18474
|
-
// version: 1.
|
|
18548
|
+
// version: 1.299.0-83936bf1de
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-mobile",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.299.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for mobile/hybrid environments.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,27 +32,27 @@
|
|
|
32
32
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@salesforce/lds-adapters-uiapi-mobile": "^1.
|
|
36
|
-
"@salesforce/lds-bindings": "^1.
|
|
37
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
38
|
-
"@salesforce/lds-priming": "^1.
|
|
35
|
+
"@salesforce/lds-adapters-uiapi-mobile": "^1.299.0",
|
|
36
|
+
"@salesforce/lds-bindings": "^1.299.0",
|
|
37
|
+
"@salesforce/lds-instrumentation": "^1.299.0",
|
|
38
|
+
"@salesforce/lds-priming": "^1.299.0",
|
|
39
39
|
"@salesforce/user": "0.0.21",
|
|
40
40
|
"o11y": "250.7.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
44
|
-
"@salesforce/lds-drafts": "^1.
|
|
45
|
-
"@salesforce/lds-drafts-adapters-uiapi": "^1.
|
|
46
|
-
"@salesforce/lds-durable-records": "^1.
|
|
47
|
-
"@salesforce/lds-graphql-eval": "^1.
|
|
48
|
-
"@salesforce/lds-graphql-local-evaluation": "^1.
|
|
49
|
-
"@salesforce/lds-network-adapter": "^1.
|
|
50
|
-
"@salesforce/lds-network-nimbus": "^1.
|
|
51
|
-
"@salesforce/lds-store-binary": "^1.
|
|
52
|
-
"@salesforce/lds-store-nimbus": "^1.
|
|
53
|
-
"@salesforce/lds-store-sql": "^1.
|
|
54
|
-
"@salesforce/lds-utils-adapters": "^1.
|
|
55
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
43
|
+
"@salesforce/lds-adapters-graphql": "^1.299.0",
|
|
44
|
+
"@salesforce/lds-drafts": "^1.299.0",
|
|
45
|
+
"@salesforce/lds-drafts-adapters-uiapi": "^1.299.0",
|
|
46
|
+
"@salesforce/lds-durable-records": "^1.299.0",
|
|
47
|
+
"@salesforce/lds-graphql-eval": "^1.299.0",
|
|
48
|
+
"@salesforce/lds-graphql-local-evaluation": "^1.299.0",
|
|
49
|
+
"@salesforce/lds-network-adapter": "^1.299.0",
|
|
50
|
+
"@salesforce/lds-network-nimbus": "^1.299.0",
|
|
51
|
+
"@salesforce/lds-store-binary": "^1.299.0",
|
|
52
|
+
"@salesforce/lds-store-nimbus": "^1.299.0",
|
|
53
|
+
"@salesforce/lds-store-sql": "^1.299.0",
|
|
54
|
+
"@salesforce/lds-utils-adapters": "^1.299.0",
|
|
55
|
+
"@salesforce/nimbus-plugin-lds": "^1.299.0",
|
|
56
56
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
57
57
|
"wait-for-expect": "^3.0.2"
|
|
58
58
|
},
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
{
|
|
61
61
|
"path": "./dist/main.js",
|
|
62
62
|
"maxSize": {
|
|
63
|
-
"none": "
|
|
63
|
+
"none": "802 kB",
|
|
64
64
|
"min": "400 kB",
|
|
65
65
|
"compressed": "150 kB"
|
|
66
66
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
{
|
|
69
69
|
"path": "./sfdc/main.js",
|
|
70
70
|
"maxSize": {
|
|
71
|
-
"none": "
|
|
71
|
+
"none": "802 kB",
|
|
72
72
|
"min": "400 kB",
|
|
73
73
|
"compressed": "150 kB"
|
|
74
74
|
}
|
package/sfdc/main.js
CHANGED
|
@@ -12501,7 +12501,7 @@ function createNewRecordQuery(schema, objectInfo, objectInfoMap) {
|
|
|
12501
12501
|
const { apiName, childRelationships, fields: fieldsRepresentation } = objectInfo;
|
|
12502
12502
|
typedScalars.add(`${apiName}_Filter`);
|
|
12503
12503
|
typedScalars.add(`${apiName}_OrderBy`);
|
|
12504
|
-
const { fields, polymorphicFieldTypeNames } = makeRecordField(values$1(fieldsRepresentation), objectInfoMap, parentRelationshipFields, 'Missing');
|
|
12504
|
+
const { fields, polymorphicFieldTypeNames } = makeRecordField(values$1(fieldsRepresentation), objectInfo, objectInfoMap, parentRelationshipFields, 'Missing');
|
|
12505
12505
|
// handles child relationship
|
|
12506
12506
|
const { spanningRecordConnections, typedScalars: spanningConnectionTypedScalars } = makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, parentRelationshipFields);
|
|
12507
12507
|
typedScalars = new Set([...typedScalars, ...spanningConnectionTypedScalars]);
|
|
@@ -12564,7 +12564,7 @@ function extendExistingRecordType(schema, type, objectInfo, objectInfoMap) {
|
|
|
12564
12564
|
return (existingFields.includes(field.apiName) === false ||
|
|
12565
12565
|
(field.relationshipName !== null && field.referenceToInfos.length > 0));
|
|
12566
12566
|
});
|
|
12567
|
-
const { fields, polymorphicFieldTypeNames } = makeRecordField(missingFields, objectInfoMap, parentRelationshipFields, 'Cached', existingFields);
|
|
12567
|
+
const { fields, polymorphicFieldTypeNames } = makeRecordField(missingFields, objectInfo, objectInfoMap, parentRelationshipFields, 'Cached', existingFields);
|
|
12568
12568
|
const { apiName, childRelationships } = objectInfo;
|
|
12569
12569
|
// handles child relationship
|
|
12570
12570
|
const { spanningRecordConnections, typedScalars: spanningConnectionTypedScalars } = makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, parentRelationshipFields, existingFields);
|
|
@@ -12639,12 +12639,12 @@ function makeSpanningRecordConnections(schema, childRelationships, objectInfoMap
|
|
|
12639
12639
|
* @param recordTypeInSchema
|
|
12640
12640
|
* @returns
|
|
12641
12641
|
*/
|
|
12642
|
-
function makeRecordField(fieldRepresentations, objectInfoMap, existingParentRelationships, recordTypeInSchema, existingFields = []) {
|
|
12642
|
+
function makeRecordField(fieldRepresentations, objectInfo, objectInfoMap, existingParentRelationships, recordTypeInSchema, existingFields = []) {
|
|
12643
12643
|
const polymorphicFieldTypeNames = new Set();
|
|
12644
12644
|
let fields = ``;
|
|
12645
12645
|
for (const field of values$1(fieldRepresentations)) {
|
|
12646
12646
|
if (!fieldsStaticallyAdded.includes(field.apiName) && recordTypeInSchema === 'Missing') {
|
|
12647
|
-
fields += `${field.apiName}: ${
|
|
12647
|
+
fields += `${field.apiName}: ${graphqlTypeForField(field, objectInfo)}\n`;
|
|
12648
12648
|
}
|
|
12649
12649
|
//handles parent relationship
|
|
12650
12650
|
if (field.relationshipName === null) {
|
|
@@ -12683,49 +12683,90 @@ function makeRecordField(fieldRepresentations, objectInfoMap, existingParentRela
|
|
|
12683
12683
|
* @param apiName
|
|
12684
12684
|
* @returns
|
|
12685
12685
|
*/
|
|
12686
|
-
function
|
|
12687
|
-
if (apiName
|
|
12688
|
-
return
|
|
12686
|
+
function graphqlTypeForField(field, objectInfo) {
|
|
12687
|
+
if (field.apiName === 'Id') {
|
|
12688
|
+
return 'ID!';
|
|
12689
12689
|
}
|
|
12690
|
-
switch (
|
|
12691
|
-
case '
|
|
12692
|
-
|
|
12693
|
-
case 'Email':
|
|
12694
|
-
case 'TextArea':
|
|
12695
|
-
return 'StringValue';
|
|
12696
|
-
case 'Reference':
|
|
12697
|
-
return 'IDValue';
|
|
12698
|
-
case 'Double':
|
|
12699
|
-
return 'DoubleValue';
|
|
12690
|
+
switch (field.dataType) {
|
|
12691
|
+
case 'Base64':
|
|
12692
|
+
return 'Base64Value';
|
|
12700
12693
|
case 'Boolean':
|
|
12701
12694
|
return 'BooleanValue';
|
|
12695
|
+
case 'Currency':
|
|
12696
|
+
return 'CurrencyValue';
|
|
12702
12697
|
case 'Date':
|
|
12703
12698
|
return 'DateValue';
|
|
12704
|
-
case 'Time':
|
|
12705
|
-
return 'TimeValue';
|
|
12706
12699
|
case 'DateTime':
|
|
12707
12700
|
return 'DateTimeValue';
|
|
12708
|
-
case '
|
|
12709
|
-
return '
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12701
|
+
case 'Double': {
|
|
12702
|
+
return getLatLongType(field, objectInfo) || 'DoubleValue';
|
|
12703
|
+
}
|
|
12704
|
+
case 'Email':
|
|
12705
|
+
return 'EmailValue';
|
|
12706
|
+
case 'EncryptedString':
|
|
12707
|
+
return 'EncryptedStringValue';
|
|
12708
|
+
case 'Int':
|
|
12709
|
+
return 'IntValue';
|
|
12710
|
+
// NB: JSON field type should never happen, but maybe in setup entities?
|
|
12711
|
+
case 'Json':
|
|
12712
|
+
case 'JSON':
|
|
12713
|
+
return 'JSONValue';
|
|
12714
|
+
case 'Long':
|
|
12715
|
+
return 'LongValue';
|
|
12716
12716
|
case 'MultiPicklist':
|
|
12717
12717
|
return 'MultiPicklistValue';
|
|
12718
12718
|
case 'Percent':
|
|
12719
12719
|
return 'PercentValue';
|
|
12720
|
-
case '
|
|
12721
|
-
return '
|
|
12722
|
-
case '
|
|
12723
|
-
return '
|
|
12720
|
+
case 'Phone':
|
|
12721
|
+
return 'PhoneNumberValue';
|
|
12722
|
+
case 'Picklist':
|
|
12723
|
+
return 'PicklistValue';
|
|
12724
|
+
case 'Reference':
|
|
12725
|
+
return 'IDValue';
|
|
12726
|
+
case 'String':
|
|
12727
|
+
return 'StringValue';
|
|
12728
|
+
case 'TextArea':
|
|
12729
|
+
return getTextAreaType(field);
|
|
12730
|
+
case 'Time':
|
|
12731
|
+
return 'TimeValue';
|
|
12732
|
+
case 'Url':
|
|
12733
|
+
return 'UrlValue';
|
|
12724
12734
|
// ! do the rest of the custom types
|
|
12725
12735
|
default:
|
|
12726
12736
|
return 'String';
|
|
12727
12737
|
}
|
|
12728
12738
|
}
|
|
12739
|
+
// Match server behavior for Latitude/Longitude fields:
|
|
12740
|
+
function getLatLongType(field, objectInfo) {
|
|
12741
|
+
const compoundFieldName = field.compoundFieldName;
|
|
12742
|
+
if (!compoundFieldName)
|
|
12743
|
+
return;
|
|
12744
|
+
const compoundField = objectInfo.fields[compoundFieldName];
|
|
12745
|
+
if (!compoundField)
|
|
12746
|
+
return;
|
|
12747
|
+
if (compoundField.dataType !== 'Address' && compoundField.dataType !== 'Location') {
|
|
12748
|
+
return;
|
|
12749
|
+
}
|
|
12750
|
+
// NB: the following means custom location fields will map to `DoubleValue` because
|
|
12751
|
+
// the fields will have the suffix `__s`. This is technically incorrect but matches
|
|
12752
|
+
// the server behavior as of the 252 release.
|
|
12753
|
+
if (field.apiName.endsWith('Latitude')) {
|
|
12754
|
+
return 'LatitudeValue';
|
|
12755
|
+
}
|
|
12756
|
+
if (field.apiName.endsWith('Longitude')) {
|
|
12757
|
+
return 'LongitudeValue';
|
|
12758
|
+
}
|
|
12759
|
+
}
|
|
12760
|
+
// Match server behavior for text area types:
|
|
12761
|
+
function getTextAreaType(field) {
|
|
12762
|
+
if (field.extraTypeInfo === 'RichTextArea') {
|
|
12763
|
+
return 'RichTextAreaValue';
|
|
12764
|
+
}
|
|
12765
|
+
else if (field.length > 255) {
|
|
12766
|
+
return 'LongTextAreaValue';
|
|
12767
|
+
}
|
|
12768
|
+
return 'TextAreaValue';
|
|
12769
|
+
}
|
|
12729
12770
|
|
|
12730
12771
|
async function evaluate(config, observers, settings, objectInfos, store, snapshot, cache, draftFunctions) {
|
|
12731
12772
|
const eventEmitter = createCustomAdapterEventEmitter(GRAPHQL_EVAL_NAMESPACE, observers);
|
|
@@ -17705,6 +17746,7 @@ class RecordLoaderGraphQL {
|
|
|
17705
17746
|
let rep;
|
|
17706
17747
|
try {
|
|
17707
17748
|
rep = await this.callGraphQL(batch, abortController);
|
|
17749
|
+
return this.generateFetchResult(rep, batch);
|
|
17708
17750
|
}
|
|
17709
17751
|
catch (e) {
|
|
17710
17752
|
return {
|
|
@@ -17714,12 +17756,15 @@ class RecordLoaderGraphQL {
|
|
|
17714
17756
|
missingIds: batch.ids,
|
|
17715
17757
|
};
|
|
17716
17758
|
}
|
|
17717
|
-
return this.generateFetchResult(rep, batch);
|
|
17718
17759
|
}
|
|
17719
17760
|
async batchFetchRecordData(batchs, abortController) {
|
|
17720
|
-
let reps;
|
|
17721
17761
|
try {
|
|
17722
|
-
reps = await this.callBatchGraphQL(batchs, abortController);
|
|
17762
|
+
const reps = await this.callBatchGraphQL(batchs, abortController);
|
|
17763
|
+
const recordFetchResults = [];
|
|
17764
|
+
for (let i = 0; i < reps.length; i++) {
|
|
17765
|
+
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
17766
|
+
}
|
|
17767
|
+
return recordFetchResults;
|
|
17723
17768
|
}
|
|
17724
17769
|
catch (e) {
|
|
17725
17770
|
const missingIds = batchs
|
|
@@ -17734,11 +17779,6 @@ class RecordLoaderGraphQL {
|
|
|
17734
17779
|
},
|
|
17735
17780
|
];
|
|
17736
17781
|
}
|
|
17737
|
-
const recordFetchResults = [];
|
|
17738
|
-
for (let i = 0; i < reps.length; i++) {
|
|
17739
|
-
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
17740
|
-
}
|
|
17741
|
-
return recordFetchResults;
|
|
17742
17782
|
}
|
|
17743
17783
|
generateFetchResult(repResult, batchInput) {
|
|
17744
17784
|
const { data, errors } = repResult;
|
|
@@ -17942,19 +17982,26 @@ class NimbusPrimingNetworkAdapter {
|
|
|
17942
17982
|
priority: 'background',
|
|
17943
17983
|
observabilityContext: {},
|
|
17944
17984
|
}, abortController, (response) => {
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17985
|
+
if (response.status < 200 || response.status > 299) {
|
|
17986
|
+
reject(new Error(response.body || 'Network error'));
|
|
17987
|
+
return;
|
|
17988
|
+
}
|
|
17989
|
+
try {
|
|
17990
|
+
const { body } = response;
|
|
17991
|
+
if (body) {
|
|
17992
|
+
const { results } = JSON.parse(body);
|
|
17993
|
+
if (results) {
|
|
17994
|
+
const gqlResults = results.map((compositeGqlResult) => compositeGqlResult.result);
|
|
17995
|
+
resolve(gqlResults);
|
|
17996
|
+
return;
|
|
17997
|
+
}
|
|
17951
17998
|
}
|
|
17952
17999
|
else {
|
|
17953
18000
|
reject(new Error(`No body returned from ${batchEndPointPath} endpoint`));
|
|
17954
18001
|
}
|
|
17955
18002
|
}
|
|
17956
|
-
|
|
17957
|
-
reject(
|
|
18003
|
+
catch (error) {
|
|
18004
|
+
reject(error);
|
|
17958
18005
|
}
|
|
17959
18006
|
}, (error) => {
|
|
17960
18007
|
reject(error);
|
|
@@ -17975,12 +18022,21 @@ class NimbusPrimingNetworkAdapter {
|
|
|
17975
18022
|
priority: 'background',
|
|
17976
18023
|
observabilityContext: {},
|
|
17977
18024
|
}, abortController, (response) => {
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
18025
|
+
if (response.status < 200 || response.status > 299) {
|
|
18026
|
+
reject(new Error(response.body || 'Network error'));
|
|
18027
|
+
return;
|
|
17981
18028
|
}
|
|
17982
|
-
|
|
17983
|
-
|
|
18029
|
+
try {
|
|
18030
|
+
const { body } = response;
|
|
18031
|
+
if (body) {
|
|
18032
|
+
resolve(JSON.parse(body));
|
|
18033
|
+
}
|
|
18034
|
+
else {
|
|
18035
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
18036
|
+
}
|
|
18037
|
+
}
|
|
18038
|
+
catch (error) {
|
|
18039
|
+
reject(error);
|
|
17984
18040
|
}
|
|
17985
18041
|
}, (error) => {
|
|
17986
18042
|
reject(error);
|
|
@@ -17998,12 +18054,21 @@ class NimbusPrimingNetworkAdapter {
|
|
|
17998
18054
|
priority: 'background',
|
|
17999
18055
|
observabilityContext: {},
|
|
18000
18056
|
}, abortController, (response) => {
|
|
18001
|
-
|
|
18002
|
-
|
|
18003
|
-
|
|
18057
|
+
if (response.status < 200 || response.status > 299) {
|
|
18058
|
+
reject(new Error(response.body || 'Network error'));
|
|
18059
|
+
return;
|
|
18004
18060
|
}
|
|
18005
|
-
|
|
18006
|
-
|
|
18061
|
+
try {
|
|
18062
|
+
const { body } = response;
|
|
18063
|
+
if (body) {
|
|
18064
|
+
resolve(JSON.parse(body).objects);
|
|
18065
|
+
}
|
|
18066
|
+
else {
|
|
18067
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
18068
|
+
}
|
|
18069
|
+
}
|
|
18070
|
+
catch (error) {
|
|
18071
|
+
reject(error);
|
|
18007
18072
|
}
|
|
18008
18073
|
}, (error) => {
|
|
18009
18074
|
reject(error);
|
|
@@ -18025,19 +18090,28 @@ class NimbusPrimingNetworkAdapter {
|
|
|
18025
18090
|
priority: 'background',
|
|
18026
18091
|
observabilityContext: {},
|
|
18027
18092
|
}, abortController, (response) => {
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
results.forEach((result) => {
|
|
18032
|
-
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
18033
|
-
if (result.statusCode === 200) {
|
|
18034
|
-
map.set(result.result.apiName, result.result);
|
|
18035
|
-
}
|
|
18036
|
-
});
|
|
18037
|
-
resolve(map);
|
|
18093
|
+
if (response.status < 200 || response.status > 299) {
|
|
18094
|
+
reject(new Error(response.body || 'Network error'));
|
|
18095
|
+
return;
|
|
18038
18096
|
}
|
|
18039
|
-
|
|
18040
|
-
|
|
18097
|
+
try {
|
|
18098
|
+
const { body } = response;
|
|
18099
|
+
if (body) {
|
|
18100
|
+
const results = JSON.parse(body).results;
|
|
18101
|
+
results.forEach((result) => {
|
|
18102
|
+
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
18103
|
+
if (result.statusCode === 200) {
|
|
18104
|
+
map.set(result.result.apiName, result.result);
|
|
18105
|
+
}
|
|
18106
|
+
});
|
|
18107
|
+
resolve(map);
|
|
18108
|
+
}
|
|
18109
|
+
else {
|
|
18110
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
18111
|
+
}
|
|
18112
|
+
}
|
|
18113
|
+
catch (error) {
|
|
18114
|
+
reject(error);
|
|
18041
18115
|
}
|
|
18042
18116
|
}, (error) => {
|
|
18043
18117
|
reject(error);
|
|
@@ -18471,4 +18545,4 @@ register({
|
|
|
18471
18545
|
});
|
|
18472
18546
|
|
|
18473
18547
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
18474
|
-
// version: 1.
|
|
18548
|
+
// version: 1.299.0-83936bf1de
|