@salesforce/lds-runtime-mobile 1.331.0 → 1.332.0-dev10
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 +262 -80
- package/dist/types/drafts/quickActions/QuickActionExecutionRepresentationHandler.d.ts +10 -4
- package/dist/types/graphql/scopeParser.d.ts +2 -2
- package/package.json +14 -14
- package/sfdc/main.js +262 -80
- package/sfdc/types/drafts/quickActions/QuickActionExecutionRepresentationHandler.d.ts +10 -4
- package/sfdc/types/graphql/scopeParser.d.ts +2 -2
package/dist/main.js
CHANGED
|
@@ -28433,13 +28433,25 @@ function convertGraphQLToRaml(astNode, state) {
|
|
|
28433
28433
|
? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$H)
|
|
28434
28434
|
: new Map();
|
|
28435
28435
|
const { fieldsBag, trie } = createFieldsBagAndTrie(data, requestedFields, state);
|
|
28436
|
+
const recordTypeId = data.ldsRecordTypeId === null ? null : data.ldsRecordTypeId.value;
|
|
28437
|
+
if (recordTypeId && recordTypeId !== MAIN_RECORD_TYPE_ID) {
|
|
28438
|
+
const fieldName = 'RecordTypeId';
|
|
28439
|
+
fieldsBag[fieldName] = {
|
|
28440
|
+
value: recordTypeId,
|
|
28441
|
+
displayValue: null,
|
|
28442
|
+
};
|
|
28443
|
+
trie.children[fieldName] = {
|
|
28444
|
+
name: fieldName,
|
|
28445
|
+
children: {},
|
|
28446
|
+
};
|
|
28447
|
+
}
|
|
28436
28448
|
const recordRepresentation = {
|
|
28437
28449
|
apiName: data.ApiName,
|
|
28438
28450
|
eTag: '',
|
|
28439
28451
|
lastModifiedById: data.LastModifiedById.value,
|
|
28440
28452
|
lastModifiedDate: data.LastModifiedDate.value,
|
|
28441
28453
|
systemModstamp: data.SystemModstamp.value,
|
|
28442
|
-
recordTypeId:
|
|
28454
|
+
recordTypeId: recordTypeId,
|
|
28443
28455
|
recordTypeInfo: null,
|
|
28444
28456
|
childRelationships: {},
|
|
28445
28457
|
id: data.Id,
|
|
@@ -42729,11 +42741,13 @@ class UiApiDraftRecordService {
|
|
|
42729
42741
|
|
|
42730
42742
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
42731
42743
|
class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestActionHandler {
|
|
42732
|
-
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService) {
|
|
42744
|
+
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
|
|
42733
42745
|
super(draftQueue, networkAdapter, getLuvio, draftRecordService);
|
|
42734
42746
|
this.draftRecordService = draftRecordService;
|
|
42735
42747
|
this.isDraftId = isDraftId;
|
|
42736
42748
|
this.sideEffectService = sideEffectService;
|
|
42749
|
+
this.objectInfoService = objectInfoService;
|
|
42750
|
+
this.getRecord = getRecord;
|
|
42737
42751
|
this.handlerId = QUICK_ACTION_HANDLER;
|
|
42738
42752
|
draftRecordService.registerRecordHandler(this);
|
|
42739
42753
|
}
|
|
@@ -42765,6 +42779,30 @@ class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestA
|
|
|
42765
42779
|
});
|
|
42766
42780
|
luvio.storeIngest(key, ingestQuickActionExecutionRepresentation, response);
|
|
42767
42781
|
}
|
|
42782
|
+
async handleActionCompleted(action, queueOperations) {
|
|
42783
|
+
await super.handleActionCompleted(action, queueOperations);
|
|
42784
|
+
this.getLuvio();
|
|
42785
|
+
const canonicalId = action.response.body.id;
|
|
42786
|
+
this.buildTagForTargetId(canonicalId);
|
|
42787
|
+
const prefix = canonicalId.substring(0, 3);
|
|
42788
|
+
if (prefix.length !== 3) {
|
|
42789
|
+
// if we can't get a prefix, don't do the rest
|
|
42790
|
+
return;
|
|
42791
|
+
}
|
|
42792
|
+
const apiName = await this.objectInfoService.apiNameForPrefix(prefix);
|
|
42793
|
+
const objectInfo = await this.objectInfoService.getObjectInfo(apiName);
|
|
42794
|
+
if (!objectInfo) {
|
|
42795
|
+
return;
|
|
42796
|
+
}
|
|
42797
|
+
await this.getRecord({ recordId: canonicalId, fields: this.allFields(objectInfo) });
|
|
42798
|
+
}
|
|
42799
|
+
allFields(objectInfo) {
|
|
42800
|
+
let fields = [];
|
|
42801
|
+
Object.keys(objectInfo.fields).forEach((fieldName) => {
|
|
42802
|
+
fields.push(objectInfo.apiName + '.' + fieldName);
|
|
42803
|
+
});
|
|
42804
|
+
return fields;
|
|
42805
|
+
}
|
|
42768
42806
|
mergeRequestBody() {
|
|
42769
42807
|
throw Error('mergeActions not supported for QuickActionExecutionRepresentationHandler');
|
|
42770
42808
|
}
|
|
@@ -42867,12 +42905,16 @@ function isCreateContentDocumentAndVersionDraftAdapterEvent(customEvent) {
|
|
|
42867
42905
|
/* global __nimbus */
|
|
42868
42906
|
function chunkToBase64(chunk) {
|
|
42869
42907
|
const bytes = new Uint8Array(chunk);
|
|
42870
|
-
const
|
|
42908
|
+
const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
|
|
42909
|
+
let binary = '';
|
|
42910
|
+
for (let i = 0; i < bytes.length; i += CHUNK_SIZE) {
|
|
42911
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK_SIZE));
|
|
42912
|
+
}
|
|
42871
42913
|
return btoa(binary);
|
|
42872
42914
|
}
|
|
42873
42915
|
async function streamBufferToBinaryStore(binaryStore, file, mimeType) {
|
|
42874
42916
|
const uri = await binaryStore.createStream(mimeType);
|
|
42875
|
-
const CHUNK_SIZE =
|
|
42917
|
+
const CHUNK_SIZE = 1024 * 1024 * 2; // 2mb
|
|
42876
42918
|
const fileSize = file.size;
|
|
42877
42919
|
let offset = 0;
|
|
42878
42920
|
try {
|
|
@@ -44418,10 +44460,13 @@ function sanitizePredicateIDValue(value, draftFunction) {
|
|
|
44418
44460
|
}
|
|
44419
44461
|
}
|
|
44420
44462
|
function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
|
|
44421
|
-
if (
|
|
44463
|
+
if (value === undefined || (isArray$1(value) && value.length === 0)) {
|
|
44422
44464
|
// eslint-disable-next-line
|
|
44423
44465
|
throw new Error(`No value specified for MultiPickList filter`);
|
|
44424
44466
|
}
|
|
44467
|
+
if (value === null) {
|
|
44468
|
+
return createSinglePredicate(null, operator, fieldInfo, alias);
|
|
44469
|
+
}
|
|
44425
44470
|
// generate single prodicate for = and !=
|
|
44426
44471
|
if (operator === '=' || operator === '!=') {
|
|
44427
44472
|
// The raw value could be ';;a; b;;', clean it up to 'a;b'
|
|
@@ -44441,6 +44486,9 @@ function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
|
|
|
44441
44486
|
type: PredicateType.compound,
|
|
44442
44487
|
operator: operator === 'LIKE' ? 'or' : 'and',
|
|
44443
44488
|
children: valueArray.map((v) => {
|
|
44489
|
+
if (v === null) {
|
|
44490
|
+
return createSinglePredicate(v, operator, fieldInfo, alias);
|
|
44491
|
+
}
|
|
44444
44492
|
const splittedValue = v
|
|
44445
44493
|
.split(MultiPickListValueSeparator)
|
|
44446
44494
|
.map((v) => v.trim())
|
|
@@ -44503,7 +44551,7 @@ function multiPicklistToSql(operator, value) {
|
|
|
44503
44551
|
// match the behavior described in SOQL documentation (https://sfdc.co/c9j0r)
|
|
44504
44552
|
// To make sure the match is safe for includes/excludes. the value is prefix and
|
|
44505
44553
|
// suffix with ';', like 'abc' to '%;abc;%'. raw value for eq and ne.
|
|
44506
|
-
if (operator === 'LIKE' || operator === 'NOT LIKE') {
|
|
44554
|
+
if (value !== null && (operator === 'LIKE' || operator === 'NOT LIKE')) {
|
|
44507
44555
|
return `%${MultiPickListValueSeparator}${value}${MultiPickListValueSeparator}%`;
|
|
44508
44556
|
}
|
|
44509
44557
|
else {
|
|
@@ -44670,14 +44718,7 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
|
|
|
44670
44718
|
// SQLite is case sensitive by default, SOQL is case in-sensitive by default
|
|
44671
44719
|
// For pick list includes or excludeds, prefix and suffix the field value with ';' to guarantee the query accuracy.
|
|
44672
44720
|
if (dataType === 'MultiPicklist' && (operator === 'LIKE' || operator === 'NOT LIKE')) {
|
|
44673
|
-
|
|
44674
|
-
// calling the COALESCE function with the extracted value and empty string will make it an empty string
|
|
44675
|
-
// instead of NULL in the function return and can be compared
|
|
44676
|
-
const coalesce = (sql) => {
|
|
44677
|
-
return `COALESCE(${sql}, '')`;
|
|
44678
|
-
};
|
|
44679
|
-
const extract = `json_extract("${alias}".data, '${leftPath}')`;
|
|
44680
|
-
sql = `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
|
|
44721
|
+
sql = buildMultiPicklistSQL(predicate, valueBinding, questionSql);
|
|
44681
44722
|
}
|
|
44682
44723
|
else {
|
|
44683
44724
|
sql = `json_extract("${alias}".data, '${leftPath}') ${operator} ${questionSql}${isCaseSensitive === true ? '' : ` COLLATE NOCASE`}`;
|
|
@@ -44687,6 +44728,22 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
|
|
|
44687
44728
|
}
|
|
44688
44729
|
return { sql, binding };
|
|
44689
44730
|
}
|
|
44731
|
+
function buildMultiPicklistSQL(predicate, value, questionSql) {
|
|
44732
|
+
const { alias, leftPath, operator } = predicate;
|
|
44733
|
+
if (value.length === 1 && value.includes(null)) {
|
|
44734
|
+
return `json_extract("${alias}".data, '${leftPath}') ${operator === 'LIKE' ? 'IS' : 'IS NOT'} ${questionSql}`;
|
|
44735
|
+
}
|
|
44736
|
+
else {
|
|
44737
|
+
// to include nulls in NOT LIKE operators we need to still return a value for NULL
|
|
44738
|
+
// calling the COALESCE function with the extracted value and empty string will make it an empty string
|
|
44739
|
+
// instead of NULL in the function return and can be compared
|
|
44740
|
+
const coalesce = (sql) => {
|
|
44741
|
+
return `COALESCE(${sql}, '')`;
|
|
44742
|
+
};
|
|
44743
|
+
const extract = `json_extract("${alias}".data, '${leftPath}')`;
|
|
44744
|
+
return `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
|
|
44745
|
+
}
|
|
44746
|
+
}
|
|
44690
44747
|
// for one value, return { sql: '?', bindings:'xxx'}. for multiple value, return { sql: '(?, ?, ?)', binding: ['xxx','yyy','zzz'] }
|
|
44691
44748
|
function handleExtractedPredicateValue(boundValue, checkForNull) {
|
|
44692
44749
|
let questionSql = '?';
|
|
@@ -45643,65 +45700,100 @@ function pathForKey(key) {
|
|
|
45643
45700
|
}
|
|
45644
45701
|
}
|
|
45645
45702
|
|
|
45646
|
-
function scopeToJoins(scope = '', settings) {
|
|
45647
|
-
if (scope
|
|
45648
|
-
return [
|
|
45649
|
-
|
|
45650
|
-
|
|
45651
|
-
|
|
45652
|
-
|
|
45653
|
-
|
|
45654
|
-
|
|
45655
|
-
|
|
45656
|
-
|
|
45657
|
-
|
|
45658
|
-
|
|
45659
|
-
|
|
45660
|
-
|
|
45661
|
-
|
|
45662
|
-
|
|
45663
|
-
|
|
45664
|
-
|
|
45665
|
-
|
|
45666
|
-
|
|
45667
|
-
|
|
45668
|
-
|
|
45669
|
-
|
|
45670
|
-
|
|
45671
|
-
|
|
45672
|
-
|
|
45673
|
-
|
|
45674
|
-
|
|
45675
|
-
|
|
45676
|
-
|
|
45677
|
-
|
|
45678
|
-
|
|
45679
|
-
|
|
45680
|
-
|
|
45681
|
-
|
|
45682
|
-
|
|
45683
|
-
|
|
45684
|
-
|
|
45685
|
-
|
|
45686
|
-
|
|
45687
|
-
|
|
45688
|
-
|
|
45689
|
-
|
|
45690
|
-
|
|
45691
|
-
|
|
45692
|
-
|
|
45693
|
-
|
|
45694
|
-
|
|
45695
|
-
|
|
45696
|
-
|
|
45697
|
-
|
|
45698
|
-
|
|
45699
|
-
|
|
45700
|
-
|
|
45701
|
-
|
|
45703
|
+
function scopeToJoins(scope = '', fieldName, settings) {
|
|
45704
|
+
if (scope === 'ASSIGNEDTOME') {
|
|
45705
|
+
return [
|
|
45706
|
+
{
|
|
45707
|
+
alias: 'ServiceAppointment_AssignedResource',
|
|
45708
|
+
type: 'INNER',
|
|
45709
|
+
to: 'ServiceAppointment',
|
|
45710
|
+
conditions: [
|
|
45711
|
+
{
|
|
45712
|
+
type: PredicateType.single,
|
|
45713
|
+
alias: 'ServiceAppointment_AssignedResource',
|
|
45714
|
+
leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
|
|
45715
|
+
operator: '=',
|
|
45716
|
+
value: 'AssignedResource',
|
|
45717
|
+
dataType: 'String',
|
|
45718
|
+
isCaseSensitive: true,
|
|
45719
|
+
},
|
|
45720
|
+
{
|
|
45721
|
+
leftPath: '$.id',
|
|
45722
|
+
rightPath: '$.fields.ServiceAppointmentId.value',
|
|
45723
|
+
},
|
|
45724
|
+
],
|
|
45725
|
+
apiName: 'AssignedResource',
|
|
45726
|
+
},
|
|
45727
|
+
{
|
|
45728
|
+
alias: 'ServiceAppointment_AssignedResource_ServiceResource',
|
|
45729
|
+
type: 'INNER',
|
|
45730
|
+
to: 'ServiceAppointment_AssignedResource',
|
|
45731
|
+
conditions: [
|
|
45732
|
+
{
|
|
45733
|
+
type: PredicateType.single,
|
|
45734
|
+
alias: 'ServiceAppointment_AssignedResource_ServiceResource',
|
|
45735
|
+
leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
|
|
45736
|
+
operator: '=',
|
|
45737
|
+
value: 'ServiceResource',
|
|
45738
|
+
dataType: 'String',
|
|
45739
|
+
isCaseSensitive: true,
|
|
45740
|
+
},
|
|
45741
|
+
{
|
|
45742
|
+
leftPath: '$.fields.ServiceResourceId.value',
|
|
45743
|
+
rightPath: '$.id',
|
|
45744
|
+
},
|
|
45745
|
+
{
|
|
45746
|
+
type: PredicateType.single,
|
|
45747
|
+
alias: 'ServiceAppointment_AssignedResource_ServiceResource',
|
|
45748
|
+
leftPath: '$.fields.RelatedRecordId.value',
|
|
45749
|
+
operator: '=',
|
|
45750
|
+
value: settings.userId,
|
|
45751
|
+
dataType: 'String',
|
|
45752
|
+
isCaseSensitive: true,
|
|
45753
|
+
},
|
|
45754
|
+
],
|
|
45755
|
+
apiName: 'ServiceResource',
|
|
45756
|
+
},
|
|
45757
|
+
];
|
|
45758
|
+
}
|
|
45759
|
+
else if (scope === 'MINE' && fieldName === 'ResourceAbsence') {
|
|
45760
|
+
return [
|
|
45761
|
+
{
|
|
45762
|
+
alias: 'ResourceAbsence_Resource',
|
|
45763
|
+
type: 'INNER',
|
|
45764
|
+
to: 'ResourceAbsence',
|
|
45765
|
+
conditions: [
|
|
45766
|
+
{
|
|
45767
|
+
type: PredicateType.single,
|
|
45768
|
+
alias: 'ResourceAbsence_Resource',
|
|
45769
|
+
leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
|
|
45770
|
+
operator: '=',
|
|
45771
|
+
value: 'ServiceResource',
|
|
45772
|
+
dataType: 'String',
|
|
45773
|
+
isCaseSensitive: true,
|
|
45774
|
+
},
|
|
45775
|
+
{
|
|
45776
|
+
leftPath: '$.fields.ResourceId.value',
|
|
45777
|
+
rightPath: '$.id',
|
|
45778
|
+
},
|
|
45779
|
+
{
|
|
45780
|
+
type: PredicateType.single,
|
|
45781
|
+
alias: 'ResourceAbsence_Resource',
|
|
45782
|
+
leftPath: '$.fields.OwnerId.value',
|
|
45783
|
+
operator: '=',
|
|
45784
|
+
value: settings.userId,
|
|
45785
|
+
dataType: 'String',
|
|
45786
|
+
isCaseSensitive: true,
|
|
45787
|
+
},
|
|
45788
|
+
],
|
|
45789
|
+
apiName: 'Resource',
|
|
45790
|
+
},
|
|
45791
|
+
];
|
|
45792
|
+
}
|
|
45793
|
+
return [];
|
|
45702
45794
|
}
|
|
45703
|
-
function scopeToPredicates(scope = '', settings) {
|
|
45704
|
-
if (scope !== 'MINE')
|
|
45795
|
+
function scopeToPredicates(scope = '', fieldName, settings) {
|
|
45796
|
+
if (scope !== 'MINE' || fieldName === 'ResourceAbsence')
|
|
45705
45797
|
return [];
|
|
45706
45798
|
return [
|
|
45707
45799
|
{
|
|
@@ -46732,10 +46824,10 @@ async function connectionResolver(obj, args, context, info) {
|
|
|
46732
46824
|
// Alias starts as entity's ApiName
|
|
46733
46825
|
const predicates = [
|
|
46734
46826
|
...filterToPredicates(args.where, alias, alias, context.objectInfos, joins, draftFunctions),
|
|
46735
|
-
...scopeToPredicates(args.scope, context.settings),
|
|
46827
|
+
...scopeToPredicates(args.scope, info.fieldName, context.settings),
|
|
46736
46828
|
...childRelationshipToPredicates(childRelationshipFieldName, parentRecord ? parentRecord.id : undefined),
|
|
46737
46829
|
];
|
|
46738
|
-
const scopeJoins = scopeToJoins(args.scope, context.settings);
|
|
46830
|
+
const scopeJoins = scopeToJoins(args.scope, info.fieldName, context.settings);
|
|
46739
46831
|
joins.push(...scopeJoins);
|
|
46740
46832
|
// Limit defaults to 10 records if unspecified
|
|
46741
46833
|
let limit = 10;
|
|
@@ -47863,9 +47955,11 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
47863
47955
|
.filter(nodeIsNamed('node'))[0];
|
|
47864
47956
|
switch (node.name.value) {
|
|
47865
47957
|
case 'scope':
|
|
47866
|
-
// Hanle 'MINE' field
|
|
47867
47958
|
if (isScopeArgumentNodeWithType(node, 'MINE', variables)) {
|
|
47868
|
-
if (
|
|
47959
|
+
if (recordQueryApiName === 'ResourceAbsence') {
|
|
47960
|
+
inlineFragmentSelections[ancestorPath].push(...mineResourceAbsenceSelections);
|
|
47961
|
+
}
|
|
47962
|
+
else if (isMineScopeAvailable(ancestorPath, pathToObjectApiNamesMap, objectInfos)) {
|
|
47869
47963
|
// 'typeConditon' is added when the 'InlineFragmentNode' is appended at the write pass
|
|
47870
47964
|
inlineFragmentSelections[ancestorPath].push(...mineFragmentSelections);
|
|
47871
47965
|
}
|
|
@@ -49016,6 +49110,93 @@ let mineFragmentSelections = [
|
|
|
49016
49110
|
},
|
|
49017
49111
|
},
|
|
49018
49112
|
];
|
|
49113
|
+
const mineResourceAbsenceSelections = [
|
|
49114
|
+
{
|
|
49115
|
+
kind: 'Field',
|
|
49116
|
+
name: {
|
|
49117
|
+
kind: 'Name',
|
|
49118
|
+
value: 'ResourceId',
|
|
49119
|
+
},
|
|
49120
|
+
arguments: [],
|
|
49121
|
+
directives: [],
|
|
49122
|
+
selectionSet: {
|
|
49123
|
+
kind: 'SelectionSet',
|
|
49124
|
+
selections: [
|
|
49125
|
+
{
|
|
49126
|
+
kind: 'Field',
|
|
49127
|
+
name: {
|
|
49128
|
+
kind: 'Name',
|
|
49129
|
+
value: 'value',
|
|
49130
|
+
},
|
|
49131
|
+
arguments: [],
|
|
49132
|
+
directives: [],
|
|
49133
|
+
},
|
|
49134
|
+
],
|
|
49135
|
+
},
|
|
49136
|
+
},
|
|
49137
|
+
{
|
|
49138
|
+
kind: 'Field',
|
|
49139
|
+
name: {
|
|
49140
|
+
kind: 'Name',
|
|
49141
|
+
value: 'Resource',
|
|
49142
|
+
},
|
|
49143
|
+
arguments: [],
|
|
49144
|
+
directives: [
|
|
49145
|
+
{
|
|
49146
|
+
kind: 'Directive',
|
|
49147
|
+
name: {
|
|
49148
|
+
kind: 'Name',
|
|
49149
|
+
value: 'category',
|
|
49150
|
+
},
|
|
49151
|
+
arguments: [
|
|
49152
|
+
{
|
|
49153
|
+
kind: 'Argument',
|
|
49154
|
+
name: {
|
|
49155
|
+
kind: 'Name',
|
|
49156
|
+
value: 'name',
|
|
49157
|
+
},
|
|
49158
|
+
value: {
|
|
49159
|
+
kind: 'StringValue',
|
|
49160
|
+
value: PARENT_RELATIONSHIP,
|
|
49161
|
+
block: false,
|
|
49162
|
+
},
|
|
49163
|
+
},
|
|
49164
|
+
],
|
|
49165
|
+
},
|
|
49166
|
+
],
|
|
49167
|
+
selectionSet: {
|
|
49168
|
+
kind: 'SelectionSet',
|
|
49169
|
+
selections: [
|
|
49170
|
+
{
|
|
49171
|
+
kind: 'Field',
|
|
49172
|
+
name: {
|
|
49173
|
+
kind: 'Name',
|
|
49174
|
+
value: 'Id',
|
|
49175
|
+
},
|
|
49176
|
+
},
|
|
49177
|
+
{
|
|
49178
|
+
kind: 'Field',
|
|
49179
|
+
name: {
|
|
49180
|
+
kind: 'Name',
|
|
49181
|
+
value: 'OwnerId',
|
|
49182
|
+
},
|
|
49183
|
+
selectionSet: {
|
|
49184
|
+
kind: 'SelectionSet',
|
|
49185
|
+
selections: [
|
|
49186
|
+
{
|
|
49187
|
+
kind: 'Field',
|
|
49188
|
+
name: {
|
|
49189
|
+
kind: 'Name',
|
|
49190
|
+
value: 'value',
|
|
49191
|
+
},
|
|
49192
|
+
},
|
|
49193
|
+
],
|
|
49194
|
+
},
|
|
49195
|
+
},
|
|
49196
|
+
],
|
|
49197
|
+
},
|
|
49198
|
+
},
|
|
49199
|
+
];
|
|
49019
49200
|
const assignedToMeFragmentSelections = [
|
|
49020
49201
|
{
|
|
49021
49202
|
kind: 'Field',
|
|
@@ -54673,7 +54854,7 @@ class SideEffectService {
|
|
|
54673
54854
|
const objectInfo = await this.ensureObjectInfo(apiName);
|
|
54674
54855
|
const recordFields = {};
|
|
54675
54856
|
for (const fieldName of keys$3(fields)) {
|
|
54676
|
-
const draftField = fields[fieldName];
|
|
54857
|
+
const draftField = fields[fieldName] ?? null;
|
|
54677
54858
|
recordFields[fieldName] = { value: draftField, displayValue: null };
|
|
54678
54859
|
const fieldInfo = objectInfo.fields[fieldName];
|
|
54679
54860
|
if (fieldInfo) {
|
|
@@ -55104,7 +55285,8 @@ class DurableRecordStore {
|
|
|
55104
55285
|
}
|
|
55105
55286
|
async exists(key) {
|
|
55106
55287
|
const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
|
|
55107
|
-
|
|
55288
|
+
const exists = result.rows[0][0];
|
|
55289
|
+
return exists == true;
|
|
55108
55290
|
}
|
|
55109
55291
|
async getRecord(key) {
|
|
55110
55292
|
const canonicalKey = this.getLuvio().storeGetCanonicalKey(key);
|
|
@@ -55229,7 +55411,7 @@ function getRuntime() {
|
|
|
55229
55411
|
const draftService = new UiApiDraftRecordService(() => lazyLuvio, lazyDurableStore, lazyObjectInfoService, newRecordId, lazySideEffectStore, lazyDurableRecordStore);
|
|
55230
55412
|
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService, lazySideEffectService, lazyDurableRecordStore);
|
|
55231
55413
|
uiApiRecordHandler.setSideEffectHooks(sfsSideEffectHooks);
|
|
55232
|
-
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
|
|
55414
|
+
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService, lazyObjectInfoService, getRecord);
|
|
55233
55415
|
const updateRecordQuickActionHandler = new UpdateRecordQuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
|
|
55234
55416
|
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, userId, draftService, lazyObjectInfoService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore, lazySideEffectService);
|
|
55235
55417
|
lazyDraftQueue.addHandler(uiApiRecordHandler);
|
|
@@ -55338,4 +55520,4 @@ register({
|
|
|
55338
55520
|
});
|
|
55339
55521
|
|
|
55340
55522
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
55341
|
-
// version: 1.
|
|
55523
|
+
// version: 1.332.0-dev10-0d26f7dda1
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { DraftAction, DraftQueue } from '@salesforce/lds-drafts';
|
|
1
|
+
import type { CompletedDraftAction, QueueOperation, DraftAction, DraftQueue } from '@salesforce/lds-drafts';
|
|
2
2
|
import { AbstractResourceRequestActionHandler } from '../AbstractResourceRequestActionHandler';
|
|
3
|
-
import type { PerformActionInputRepresentation, QuickActionExecutionRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
-
import
|
|
3
|
+
import type { PerformActionInputRepresentation, QuickActionExecutionRepresentation, RecordRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
import { GetRecordConfig } from '@salesforce/lds-adapters-uiapi';
|
|
5
|
+
import type { DurableStoreKeyMetadataMap, Luvio, NetworkAdapter, ResourceRequest, Adapter } from '@luvio/engine';
|
|
5
6
|
import type { UiApiDraftRecordService } from '../UiApiDraftRecordService';
|
|
6
7
|
import type { RecordEffectingHandler } from '../records/actionHandlers/RecordEffectingHandler';
|
|
7
8
|
import { type SideEffectService } from '../sideEffects/SideEffectService';
|
|
8
9
|
import { type SideEffect } from '../sideEffects';
|
|
10
|
+
import { ObjectInfoService } from './../../utils/ObjectInfoService';
|
|
9
11
|
export declare const QUICK_ACTION_HANDLER = "QUICK_ACTION_HANDLER";
|
|
10
12
|
interface PerformQuickActionResourceRequest extends Omit<ResourceRequest, 'body' | 'method'> {
|
|
11
13
|
body: PerformActionInputRepresentation;
|
|
@@ -15,14 +17,18 @@ export declare class QuickActionExecutionRepresentationHandler extends AbstractR
|
|
|
15
17
|
private readonly draftRecordService;
|
|
16
18
|
readonly isDraftId: (targetId: string) => boolean;
|
|
17
19
|
private readonly sideEffectService;
|
|
20
|
+
private readonly objectInfoService;
|
|
21
|
+
private readonly getRecord;
|
|
18
22
|
handlerId: string;
|
|
19
|
-
constructor(getLuvio: () => Luvio, draftRecordService: UiApiDraftRecordService, draftQueue: DraftQueue, networkAdapter: NetworkAdapter, isDraftId: (targetId: string) => boolean, sideEffectService: SideEffectService);
|
|
23
|
+
constructor(getLuvio: () => Luvio, draftRecordService: UiApiDraftRecordService, draftQueue: DraftQueue, networkAdapter: NetworkAdapter, isDraftId: (targetId: string) => boolean, sideEffectService: SideEffectService, objectInfoService: ObjectInfoService, getRecord: Adapter<GetRecordConfig, RecordRepresentation>);
|
|
20
24
|
draftActionToSideEffects(queueEntry: DraftAction<PerformQuickActionResourceRequest, QuickActionExecutionRepresentation>): Promise<SideEffect[]>;
|
|
21
25
|
getIdFromRequest(request: ResourceRequest): Promise<string>;
|
|
22
26
|
getIdFromResponseBody(responseBody: QuickActionExecutionRepresentation): string;
|
|
23
27
|
buildTagForTargetId(id: string): string;
|
|
24
28
|
buildCacheKeysFromResponse(_response: QuickActionExecutionRepresentation): DurableStoreKeyMetadataMap;
|
|
25
29
|
synchronousIngest(response: QuickActionExecutionRepresentation): void;
|
|
30
|
+
handleActionCompleted(action: CompletedDraftAction<ResourceRequest, QuickActionExecutionRepresentation>, queueOperations: QueueOperation[]): Promise<void>;
|
|
31
|
+
private allFields;
|
|
26
32
|
mergeRequestBody<T>(): T;
|
|
27
33
|
}
|
|
28
34
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Join, PredicateValue } from './query';
|
|
2
2
|
import type { LocalEvaluationRuntimeSettings } from './types';
|
|
3
|
-
export declare function scopeToJoins(scope: string | undefined, settings: LocalEvaluationRuntimeSettings): Join[];
|
|
4
|
-
export declare function scopeToPredicates(scope: string | undefined, settings: LocalEvaluationRuntimeSettings): PredicateValue[];
|
|
3
|
+
export declare function scopeToJoins(scope: string | undefined, fieldName: string, settings: LocalEvaluationRuntimeSettings): Join[];
|
|
4
|
+
export declare function scopeToPredicates(scope: string | undefined, fieldName: string, settings: LocalEvaluationRuntimeSettings): PredicateValue[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-mobile",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.332.0-dev10",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for mobile/hybrid environments.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,23 +32,23 @@
|
|
|
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": "^1.
|
|
36
|
-
"@salesforce/lds-bindings": "^1.
|
|
37
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
35
|
+
"@salesforce/lds-adapters-uiapi": "^1.332.0-dev10",
|
|
36
|
+
"@salesforce/lds-bindings": "^1.332.0-dev10",
|
|
37
|
+
"@salesforce/lds-instrumentation": "^1.332.0-dev10",
|
|
38
38
|
"@salesforce/user": "0.0.21",
|
|
39
39
|
"o11y": "250.7.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
43
|
-
"@salesforce/lds-drafts": "^1.
|
|
44
|
-
"@salesforce/lds-durable-records": "^1.
|
|
45
|
-
"@salesforce/lds-network-adapter": "^1.
|
|
46
|
-
"@salesforce/lds-network-nimbus": "^1.
|
|
47
|
-
"@salesforce/lds-store-binary": "^1.
|
|
48
|
-
"@salesforce/lds-store-nimbus": "^1.
|
|
49
|
-
"@salesforce/lds-store-sql": "^1.
|
|
50
|
-
"@salesforce/lds-utils-adapters": "^1.
|
|
51
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
42
|
+
"@salesforce/lds-adapters-graphql": "^1.332.0-dev10",
|
|
43
|
+
"@salesforce/lds-drafts": "^1.332.0-dev10",
|
|
44
|
+
"@salesforce/lds-durable-records": "^1.332.0-dev10",
|
|
45
|
+
"@salesforce/lds-network-adapter": "^1.332.0-dev10",
|
|
46
|
+
"@salesforce/lds-network-nimbus": "^1.332.0-dev10",
|
|
47
|
+
"@salesforce/lds-store-binary": "^1.332.0-dev10",
|
|
48
|
+
"@salesforce/lds-store-nimbus": "^1.332.0-dev10",
|
|
49
|
+
"@salesforce/lds-store-sql": "^1.332.0-dev10",
|
|
50
|
+
"@salesforce/lds-utils-adapters": "^1.332.0-dev10",
|
|
51
|
+
"@salesforce/nimbus-plugin-lds": "^1.332.0-dev10",
|
|
52
52
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
53
53
|
"wait-for-expect": "^3.0.2"
|
|
54
54
|
},
|
package/sfdc/main.js
CHANGED
|
@@ -28433,13 +28433,25 @@ function convertGraphQLToRaml(astNode, state) {
|
|
|
28433
28433
|
? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$H)
|
|
28434
28434
|
: new Map();
|
|
28435
28435
|
const { fieldsBag, trie } = createFieldsBagAndTrie(data, requestedFields, state);
|
|
28436
|
+
const recordTypeId = data.ldsRecordTypeId === null ? null : data.ldsRecordTypeId.value;
|
|
28437
|
+
if (recordTypeId && recordTypeId !== MAIN_RECORD_TYPE_ID) {
|
|
28438
|
+
const fieldName = 'RecordTypeId';
|
|
28439
|
+
fieldsBag[fieldName] = {
|
|
28440
|
+
value: recordTypeId,
|
|
28441
|
+
displayValue: null,
|
|
28442
|
+
};
|
|
28443
|
+
trie.children[fieldName] = {
|
|
28444
|
+
name: fieldName,
|
|
28445
|
+
children: {},
|
|
28446
|
+
};
|
|
28447
|
+
}
|
|
28436
28448
|
const recordRepresentation = {
|
|
28437
28449
|
apiName: data.ApiName,
|
|
28438
28450
|
eTag: '',
|
|
28439
28451
|
lastModifiedById: data.LastModifiedById.value,
|
|
28440
28452
|
lastModifiedDate: data.LastModifiedDate.value,
|
|
28441
28453
|
systemModstamp: data.SystemModstamp.value,
|
|
28442
|
-
recordTypeId:
|
|
28454
|
+
recordTypeId: recordTypeId,
|
|
28443
28455
|
recordTypeInfo: null,
|
|
28444
28456
|
childRelationships: {},
|
|
28445
28457
|
id: data.Id,
|
|
@@ -42729,11 +42741,13 @@ class UiApiDraftRecordService {
|
|
|
42729
42741
|
|
|
42730
42742
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
42731
42743
|
class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestActionHandler {
|
|
42732
|
-
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService) {
|
|
42744
|
+
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
|
|
42733
42745
|
super(draftQueue, networkAdapter, getLuvio, draftRecordService);
|
|
42734
42746
|
this.draftRecordService = draftRecordService;
|
|
42735
42747
|
this.isDraftId = isDraftId;
|
|
42736
42748
|
this.sideEffectService = sideEffectService;
|
|
42749
|
+
this.objectInfoService = objectInfoService;
|
|
42750
|
+
this.getRecord = getRecord;
|
|
42737
42751
|
this.handlerId = QUICK_ACTION_HANDLER;
|
|
42738
42752
|
draftRecordService.registerRecordHandler(this);
|
|
42739
42753
|
}
|
|
@@ -42765,6 +42779,30 @@ class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestA
|
|
|
42765
42779
|
});
|
|
42766
42780
|
luvio.storeIngest(key, ingestQuickActionExecutionRepresentation, response);
|
|
42767
42781
|
}
|
|
42782
|
+
async handleActionCompleted(action, queueOperations) {
|
|
42783
|
+
await super.handleActionCompleted(action, queueOperations);
|
|
42784
|
+
this.getLuvio();
|
|
42785
|
+
const canonicalId = action.response.body.id;
|
|
42786
|
+
this.buildTagForTargetId(canonicalId);
|
|
42787
|
+
const prefix = canonicalId.substring(0, 3);
|
|
42788
|
+
if (prefix.length !== 3) {
|
|
42789
|
+
// if we can't get a prefix, don't do the rest
|
|
42790
|
+
return;
|
|
42791
|
+
}
|
|
42792
|
+
const apiName = await this.objectInfoService.apiNameForPrefix(prefix);
|
|
42793
|
+
const objectInfo = await this.objectInfoService.getObjectInfo(apiName);
|
|
42794
|
+
if (!objectInfo) {
|
|
42795
|
+
return;
|
|
42796
|
+
}
|
|
42797
|
+
await this.getRecord({ recordId: canonicalId, fields: this.allFields(objectInfo) });
|
|
42798
|
+
}
|
|
42799
|
+
allFields(objectInfo) {
|
|
42800
|
+
let fields = [];
|
|
42801
|
+
Object.keys(objectInfo.fields).forEach((fieldName) => {
|
|
42802
|
+
fields.push(objectInfo.apiName + '.' + fieldName);
|
|
42803
|
+
});
|
|
42804
|
+
return fields;
|
|
42805
|
+
}
|
|
42768
42806
|
mergeRequestBody() {
|
|
42769
42807
|
throw Error('mergeActions not supported for QuickActionExecutionRepresentationHandler');
|
|
42770
42808
|
}
|
|
@@ -42867,12 +42905,16 @@ function isCreateContentDocumentAndVersionDraftAdapterEvent(customEvent) {
|
|
|
42867
42905
|
/* global __nimbus */
|
|
42868
42906
|
function chunkToBase64(chunk) {
|
|
42869
42907
|
const bytes = new Uint8Array(chunk);
|
|
42870
|
-
const
|
|
42908
|
+
const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
|
|
42909
|
+
let binary = '';
|
|
42910
|
+
for (let i = 0; i < bytes.length; i += CHUNK_SIZE) {
|
|
42911
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK_SIZE));
|
|
42912
|
+
}
|
|
42871
42913
|
return btoa(binary);
|
|
42872
42914
|
}
|
|
42873
42915
|
async function streamBufferToBinaryStore(binaryStore, file, mimeType) {
|
|
42874
42916
|
const uri = await binaryStore.createStream(mimeType);
|
|
42875
|
-
const CHUNK_SIZE =
|
|
42917
|
+
const CHUNK_SIZE = 1024 * 1024 * 2; // 2mb
|
|
42876
42918
|
const fileSize = file.size;
|
|
42877
42919
|
let offset = 0;
|
|
42878
42920
|
try {
|
|
@@ -44418,10 +44460,13 @@ function sanitizePredicateIDValue(value, draftFunction) {
|
|
|
44418
44460
|
}
|
|
44419
44461
|
}
|
|
44420
44462
|
function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
|
|
44421
|
-
if (
|
|
44463
|
+
if (value === undefined || (isArray$1(value) && value.length === 0)) {
|
|
44422
44464
|
// eslint-disable-next-line
|
|
44423
44465
|
throw new Error(`No value specified for MultiPickList filter`);
|
|
44424
44466
|
}
|
|
44467
|
+
if (value === null) {
|
|
44468
|
+
return createSinglePredicate(null, operator, fieldInfo, alias);
|
|
44469
|
+
}
|
|
44425
44470
|
// generate single prodicate for = and !=
|
|
44426
44471
|
if (operator === '=' || operator === '!=') {
|
|
44427
44472
|
// The raw value could be ';;a; b;;', clean it up to 'a;b'
|
|
@@ -44441,6 +44486,9 @@ function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
|
|
|
44441
44486
|
type: PredicateType.compound,
|
|
44442
44487
|
operator: operator === 'LIKE' ? 'or' : 'and',
|
|
44443
44488
|
children: valueArray.map((v) => {
|
|
44489
|
+
if (v === null) {
|
|
44490
|
+
return createSinglePredicate(v, operator, fieldInfo, alias);
|
|
44491
|
+
}
|
|
44444
44492
|
const splittedValue = v
|
|
44445
44493
|
.split(MultiPickListValueSeparator)
|
|
44446
44494
|
.map((v) => v.trim())
|
|
@@ -44503,7 +44551,7 @@ function multiPicklistToSql(operator, value) {
|
|
|
44503
44551
|
// match the behavior described in SOQL documentation (https://sfdc.co/c9j0r)
|
|
44504
44552
|
// To make sure the match is safe for includes/excludes. the value is prefix and
|
|
44505
44553
|
// suffix with ';', like 'abc' to '%;abc;%'. raw value for eq and ne.
|
|
44506
|
-
if (operator === 'LIKE' || operator === 'NOT LIKE') {
|
|
44554
|
+
if (value !== null && (operator === 'LIKE' || operator === 'NOT LIKE')) {
|
|
44507
44555
|
return `%${MultiPickListValueSeparator}${value}${MultiPickListValueSeparator}%`;
|
|
44508
44556
|
}
|
|
44509
44557
|
else {
|
|
@@ -44670,14 +44718,7 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
|
|
|
44670
44718
|
// SQLite is case sensitive by default, SOQL is case in-sensitive by default
|
|
44671
44719
|
// For pick list includes or excludeds, prefix and suffix the field value with ';' to guarantee the query accuracy.
|
|
44672
44720
|
if (dataType === 'MultiPicklist' && (operator === 'LIKE' || operator === 'NOT LIKE')) {
|
|
44673
|
-
|
|
44674
|
-
// calling the COALESCE function with the extracted value and empty string will make it an empty string
|
|
44675
|
-
// instead of NULL in the function return and can be compared
|
|
44676
|
-
const coalesce = (sql) => {
|
|
44677
|
-
return `COALESCE(${sql}, '')`;
|
|
44678
|
-
};
|
|
44679
|
-
const extract = `json_extract("${alias}".data, '${leftPath}')`;
|
|
44680
|
-
sql = `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
|
|
44721
|
+
sql = buildMultiPicklistSQL(predicate, valueBinding, questionSql);
|
|
44681
44722
|
}
|
|
44682
44723
|
else {
|
|
44683
44724
|
sql = `json_extract("${alias}".data, '${leftPath}') ${operator} ${questionSql}${isCaseSensitive === true ? '' : ` COLLATE NOCASE`}`;
|
|
@@ -44687,6 +44728,22 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
|
|
|
44687
44728
|
}
|
|
44688
44729
|
return { sql, binding };
|
|
44689
44730
|
}
|
|
44731
|
+
function buildMultiPicklistSQL(predicate, value, questionSql) {
|
|
44732
|
+
const { alias, leftPath, operator } = predicate;
|
|
44733
|
+
if (value.length === 1 && value.includes(null)) {
|
|
44734
|
+
return `json_extract("${alias}".data, '${leftPath}') ${operator === 'LIKE' ? 'IS' : 'IS NOT'} ${questionSql}`;
|
|
44735
|
+
}
|
|
44736
|
+
else {
|
|
44737
|
+
// to include nulls in NOT LIKE operators we need to still return a value for NULL
|
|
44738
|
+
// calling the COALESCE function with the extracted value and empty string will make it an empty string
|
|
44739
|
+
// instead of NULL in the function return and can be compared
|
|
44740
|
+
const coalesce = (sql) => {
|
|
44741
|
+
return `COALESCE(${sql}, '')`;
|
|
44742
|
+
};
|
|
44743
|
+
const extract = `json_extract("${alias}".data, '${leftPath}')`;
|
|
44744
|
+
return `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
|
|
44745
|
+
}
|
|
44746
|
+
}
|
|
44690
44747
|
// for one value, return { sql: '?', bindings:'xxx'}. for multiple value, return { sql: '(?, ?, ?)', binding: ['xxx','yyy','zzz'] }
|
|
44691
44748
|
function handleExtractedPredicateValue(boundValue, checkForNull) {
|
|
44692
44749
|
let questionSql = '?';
|
|
@@ -45643,65 +45700,100 @@ function pathForKey(key) {
|
|
|
45643
45700
|
}
|
|
45644
45701
|
}
|
|
45645
45702
|
|
|
45646
|
-
function scopeToJoins(scope = '', settings) {
|
|
45647
|
-
if (scope
|
|
45648
|
-
return [
|
|
45649
|
-
|
|
45650
|
-
|
|
45651
|
-
|
|
45652
|
-
|
|
45653
|
-
|
|
45654
|
-
|
|
45655
|
-
|
|
45656
|
-
|
|
45657
|
-
|
|
45658
|
-
|
|
45659
|
-
|
|
45660
|
-
|
|
45661
|
-
|
|
45662
|
-
|
|
45663
|
-
|
|
45664
|
-
|
|
45665
|
-
|
|
45666
|
-
|
|
45667
|
-
|
|
45668
|
-
|
|
45669
|
-
|
|
45670
|
-
|
|
45671
|
-
|
|
45672
|
-
|
|
45673
|
-
|
|
45674
|
-
|
|
45675
|
-
|
|
45676
|
-
|
|
45677
|
-
|
|
45678
|
-
|
|
45679
|
-
|
|
45680
|
-
|
|
45681
|
-
|
|
45682
|
-
|
|
45683
|
-
|
|
45684
|
-
|
|
45685
|
-
|
|
45686
|
-
|
|
45687
|
-
|
|
45688
|
-
|
|
45689
|
-
|
|
45690
|
-
|
|
45691
|
-
|
|
45692
|
-
|
|
45693
|
-
|
|
45694
|
-
|
|
45695
|
-
|
|
45696
|
-
|
|
45697
|
-
|
|
45698
|
-
|
|
45699
|
-
|
|
45700
|
-
|
|
45701
|
-
|
|
45703
|
+
function scopeToJoins(scope = '', fieldName, settings) {
|
|
45704
|
+
if (scope === 'ASSIGNEDTOME') {
|
|
45705
|
+
return [
|
|
45706
|
+
{
|
|
45707
|
+
alias: 'ServiceAppointment_AssignedResource',
|
|
45708
|
+
type: 'INNER',
|
|
45709
|
+
to: 'ServiceAppointment',
|
|
45710
|
+
conditions: [
|
|
45711
|
+
{
|
|
45712
|
+
type: PredicateType.single,
|
|
45713
|
+
alias: 'ServiceAppointment_AssignedResource',
|
|
45714
|
+
leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
|
|
45715
|
+
operator: '=',
|
|
45716
|
+
value: 'AssignedResource',
|
|
45717
|
+
dataType: 'String',
|
|
45718
|
+
isCaseSensitive: true,
|
|
45719
|
+
},
|
|
45720
|
+
{
|
|
45721
|
+
leftPath: '$.id',
|
|
45722
|
+
rightPath: '$.fields.ServiceAppointmentId.value',
|
|
45723
|
+
},
|
|
45724
|
+
],
|
|
45725
|
+
apiName: 'AssignedResource',
|
|
45726
|
+
},
|
|
45727
|
+
{
|
|
45728
|
+
alias: 'ServiceAppointment_AssignedResource_ServiceResource',
|
|
45729
|
+
type: 'INNER',
|
|
45730
|
+
to: 'ServiceAppointment_AssignedResource',
|
|
45731
|
+
conditions: [
|
|
45732
|
+
{
|
|
45733
|
+
type: PredicateType.single,
|
|
45734
|
+
alias: 'ServiceAppointment_AssignedResource_ServiceResource',
|
|
45735
|
+
leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
|
|
45736
|
+
operator: '=',
|
|
45737
|
+
value: 'ServiceResource',
|
|
45738
|
+
dataType: 'String',
|
|
45739
|
+
isCaseSensitive: true,
|
|
45740
|
+
},
|
|
45741
|
+
{
|
|
45742
|
+
leftPath: '$.fields.ServiceResourceId.value',
|
|
45743
|
+
rightPath: '$.id',
|
|
45744
|
+
},
|
|
45745
|
+
{
|
|
45746
|
+
type: PredicateType.single,
|
|
45747
|
+
alias: 'ServiceAppointment_AssignedResource_ServiceResource',
|
|
45748
|
+
leftPath: '$.fields.RelatedRecordId.value',
|
|
45749
|
+
operator: '=',
|
|
45750
|
+
value: settings.userId,
|
|
45751
|
+
dataType: 'String',
|
|
45752
|
+
isCaseSensitive: true,
|
|
45753
|
+
},
|
|
45754
|
+
],
|
|
45755
|
+
apiName: 'ServiceResource',
|
|
45756
|
+
},
|
|
45757
|
+
];
|
|
45758
|
+
}
|
|
45759
|
+
else if (scope === 'MINE' && fieldName === 'ResourceAbsence') {
|
|
45760
|
+
return [
|
|
45761
|
+
{
|
|
45762
|
+
alias: 'ResourceAbsence_Resource',
|
|
45763
|
+
type: 'INNER',
|
|
45764
|
+
to: 'ResourceAbsence',
|
|
45765
|
+
conditions: [
|
|
45766
|
+
{
|
|
45767
|
+
type: PredicateType.single,
|
|
45768
|
+
alias: 'ResourceAbsence_Resource',
|
|
45769
|
+
leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
|
|
45770
|
+
operator: '=',
|
|
45771
|
+
value: 'ServiceResource',
|
|
45772
|
+
dataType: 'String',
|
|
45773
|
+
isCaseSensitive: true,
|
|
45774
|
+
},
|
|
45775
|
+
{
|
|
45776
|
+
leftPath: '$.fields.ResourceId.value',
|
|
45777
|
+
rightPath: '$.id',
|
|
45778
|
+
},
|
|
45779
|
+
{
|
|
45780
|
+
type: PredicateType.single,
|
|
45781
|
+
alias: 'ResourceAbsence_Resource',
|
|
45782
|
+
leftPath: '$.fields.OwnerId.value',
|
|
45783
|
+
operator: '=',
|
|
45784
|
+
value: settings.userId,
|
|
45785
|
+
dataType: 'String',
|
|
45786
|
+
isCaseSensitive: true,
|
|
45787
|
+
},
|
|
45788
|
+
],
|
|
45789
|
+
apiName: 'Resource',
|
|
45790
|
+
},
|
|
45791
|
+
];
|
|
45792
|
+
}
|
|
45793
|
+
return [];
|
|
45702
45794
|
}
|
|
45703
|
-
function scopeToPredicates(scope = '', settings) {
|
|
45704
|
-
if (scope !== 'MINE')
|
|
45795
|
+
function scopeToPredicates(scope = '', fieldName, settings) {
|
|
45796
|
+
if (scope !== 'MINE' || fieldName === 'ResourceAbsence')
|
|
45705
45797
|
return [];
|
|
45706
45798
|
return [
|
|
45707
45799
|
{
|
|
@@ -46732,10 +46824,10 @@ async function connectionResolver(obj, args, context, info) {
|
|
|
46732
46824
|
// Alias starts as entity's ApiName
|
|
46733
46825
|
const predicates = [
|
|
46734
46826
|
...filterToPredicates(args.where, alias, alias, context.objectInfos, joins, draftFunctions),
|
|
46735
|
-
...scopeToPredicates(args.scope, context.settings),
|
|
46827
|
+
...scopeToPredicates(args.scope, info.fieldName, context.settings),
|
|
46736
46828
|
...childRelationshipToPredicates(childRelationshipFieldName, parentRecord ? parentRecord.id : undefined),
|
|
46737
46829
|
];
|
|
46738
|
-
const scopeJoins = scopeToJoins(args.scope, context.settings);
|
|
46830
|
+
const scopeJoins = scopeToJoins(args.scope, info.fieldName, context.settings);
|
|
46739
46831
|
joins.push(...scopeJoins);
|
|
46740
46832
|
// Limit defaults to 10 records if unspecified
|
|
46741
46833
|
let limit = 10;
|
|
@@ -47863,9 +47955,11 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
47863
47955
|
.filter(nodeIsNamed('node'))[0];
|
|
47864
47956
|
switch (node.name.value) {
|
|
47865
47957
|
case 'scope':
|
|
47866
|
-
// Hanle 'MINE' field
|
|
47867
47958
|
if (isScopeArgumentNodeWithType(node, 'MINE', variables)) {
|
|
47868
|
-
if (
|
|
47959
|
+
if (recordQueryApiName === 'ResourceAbsence') {
|
|
47960
|
+
inlineFragmentSelections[ancestorPath].push(...mineResourceAbsenceSelections);
|
|
47961
|
+
}
|
|
47962
|
+
else if (isMineScopeAvailable(ancestorPath, pathToObjectApiNamesMap, objectInfos)) {
|
|
47869
47963
|
// 'typeConditon' is added when the 'InlineFragmentNode' is appended at the write pass
|
|
47870
47964
|
inlineFragmentSelections[ancestorPath].push(...mineFragmentSelections);
|
|
47871
47965
|
}
|
|
@@ -49016,6 +49110,93 @@ let mineFragmentSelections = [
|
|
|
49016
49110
|
},
|
|
49017
49111
|
},
|
|
49018
49112
|
];
|
|
49113
|
+
const mineResourceAbsenceSelections = [
|
|
49114
|
+
{
|
|
49115
|
+
kind: 'Field',
|
|
49116
|
+
name: {
|
|
49117
|
+
kind: 'Name',
|
|
49118
|
+
value: 'ResourceId',
|
|
49119
|
+
},
|
|
49120
|
+
arguments: [],
|
|
49121
|
+
directives: [],
|
|
49122
|
+
selectionSet: {
|
|
49123
|
+
kind: 'SelectionSet',
|
|
49124
|
+
selections: [
|
|
49125
|
+
{
|
|
49126
|
+
kind: 'Field',
|
|
49127
|
+
name: {
|
|
49128
|
+
kind: 'Name',
|
|
49129
|
+
value: 'value',
|
|
49130
|
+
},
|
|
49131
|
+
arguments: [],
|
|
49132
|
+
directives: [],
|
|
49133
|
+
},
|
|
49134
|
+
],
|
|
49135
|
+
},
|
|
49136
|
+
},
|
|
49137
|
+
{
|
|
49138
|
+
kind: 'Field',
|
|
49139
|
+
name: {
|
|
49140
|
+
kind: 'Name',
|
|
49141
|
+
value: 'Resource',
|
|
49142
|
+
},
|
|
49143
|
+
arguments: [],
|
|
49144
|
+
directives: [
|
|
49145
|
+
{
|
|
49146
|
+
kind: 'Directive',
|
|
49147
|
+
name: {
|
|
49148
|
+
kind: 'Name',
|
|
49149
|
+
value: 'category',
|
|
49150
|
+
},
|
|
49151
|
+
arguments: [
|
|
49152
|
+
{
|
|
49153
|
+
kind: 'Argument',
|
|
49154
|
+
name: {
|
|
49155
|
+
kind: 'Name',
|
|
49156
|
+
value: 'name',
|
|
49157
|
+
},
|
|
49158
|
+
value: {
|
|
49159
|
+
kind: 'StringValue',
|
|
49160
|
+
value: PARENT_RELATIONSHIP,
|
|
49161
|
+
block: false,
|
|
49162
|
+
},
|
|
49163
|
+
},
|
|
49164
|
+
],
|
|
49165
|
+
},
|
|
49166
|
+
],
|
|
49167
|
+
selectionSet: {
|
|
49168
|
+
kind: 'SelectionSet',
|
|
49169
|
+
selections: [
|
|
49170
|
+
{
|
|
49171
|
+
kind: 'Field',
|
|
49172
|
+
name: {
|
|
49173
|
+
kind: 'Name',
|
|
49174
|
+
value: 'Id',
|
|
49175
|
+
},
|
|
49176
|
+
},
|
|
49177
|
+
{
|
|
49178
|
+
kind: 'Field',
|
|
49179
|
+
name: {
|
|
49180
|
+
kind: 'Name',
|
|
49181
|
+
value: 'OwnerId',
|
|
49182
|
+
},
|
|
49183
|
+
selectionSet: {
|
|
49184
|
+
kind: 'SelectionSet',
|
|
49185
|
+
selections: [
|
|
49186
|
+
{
|
|
49187
|
+
kind: 'Field',
|
|
49188
|
+
name: {
|
|
49189
|
+
kind: 'Name',
|
|
49190
|
+
value: 'value',
|
|
49191
|
+
},
|
|
49192
|
+
},
|
|
49193
|
+
],
|
|
49194
|
+
},
|
|
49195
|
+
},
|
|
49196
|
+
],
|
|
49197
|
+
},
|
|
49198
|
+
},
|
|
49199
|
+
];
|
|
49019
49200
|
const assignedToMeFragmentSelections = [
|
|
49020
49201
|
{
|
|
49021
49202
|
kind: 'Field',
|
|
@@ -54673,7 +54854,7 @@ class SideEffectService {
|
|
|
54673
54854
|
const objectInfo = await this.ensureObjectInfo(apiName);
|
|
54674
54855
|
const recordFields = {};
|
|
54675
54856
|
for (const fieldName of keys$3(fields)) {
|
|
54676
|
-
const draftField = fields[fieldName];
|
|
54857
|
+
const draftField = fields[fieldName] ?? null;
|
|
54677
54858
|
recordFields[fieldName] = { value: draftField, displayValue: null };
|
|
54678
54859
|
const fieldInfo = objectInfo.fields[fieldName];
|
|
54679
54860
|
if (fieldInfo) {
|
|
@@ -55104,7 +55285,8 @@ class DurableRecordStore {
|
|
|
55104
55285
|
}
|
|
55105
55286
|
async exists(key) {
|
|
55106
55287
|
const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
|
|
55107
|
-
|
|
55288
|
+
const exists = result.rows[0][0];
|
|
55289
|
+
return exists == true;
|
|
55108
55290
|
}
|
|
55109
55291
|
async getRecord(key) {
|
|
55110
55292
|
const canonicalKey = this.getLuvio().storeGetCanonicalKey(key);
|
|
@@ -55229,7 +55411,7 @@ function getRuntime() {
|
|
|
55229
55411
|
const draftService = new UiApiDraftRecordService(() => lazyLuvio, lazyDurableStore, lazyObjectInfoService, newRecordId, lazySideEffectStore, lazyDurableRecordStore);
|
|
55230
55412
|
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService, lazySideEffectService, lazyDurableRecordStore);
|
|
55231
55413
|
uiApiRecordHandler.setSideEffectHooks(sfsSideEffectHooks);
|
|
55232
|
-
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
|
|
55414
|
+
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService, lazyObjectInfoService, getRecord);
|
|
55233
55415
|
const updateRecordQuickActionHandler = new UpdateRecordQuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
|
|
55234
55416
|
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, userId, draftService, lazyObjectInfoService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore, lazySideEffectService);
|
|
55235
55417
|
lazyDraftQueue.addHandler(uiApiRecordHandler);
|
|
@@ -55338,4 +55520,4 @@ register({
|
|
|
55338
55520
|
});
|
|
55339
55521
|
|
|
55340
55522
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
55341
|
-
// version: 1.
|
|
55523
|
+
// version: 1.332.0-dev10-0d26f7dda1
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { DraftAction, DraftQueue } from '@salesforce/lds-drafts';
|
|
1
|
+
import type { CompletedDraftAction, QueueOperation, DraftAction, DraftQueue } from '@salesforce/lds-drafts';
|
|
2
2
|
import { AbstractResourceRequestActionHandler } from '../AbstractResourceRequestActionHandler';
|
|
3
|
-
import type { PerformActionInputRepresentation, QuickActionExecutionRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
-
import
|
|
3
|
+
import type { PerformActionInputRepresentation, QuickActionExecutionRepresentation, RecordRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
import { GetRecordConfig } from '@salesforce/lds-adapters-uiapi';
|
|
5
|
+
import type { DurableStoreKeyMetadataMap, Luvio, NetworkAdapter, ResourceRequest, Adapter } from '@luvio/engine';
|
|
5
6
|
import type { UiApiDraftRecordService } from '../UiApiDraftRecordService';
|
|
6
7
|
import type { RecordEffectingHandler } from '../records/actionHandlers/RecordEffectingHandler';
|
|
7
8
|
import { type SideEffectService } from '../sideEffects/SideEffectService';
|
|
8
9
|
import { type SideEffect } from '../sideEffects';
|
|
10
|
+
import { ObjectInfoService } from './../../utils/ObjectInfoService';
|
|
9
11
|
export declare const QUICK_ACTION_HANDLER = "QUICK_ACTION_HANDLER";
|
|
10
12
|
interface PerformQuickActionResourceRequest extends Omit<ResourceRequest, 'body' | 'method'> {
|
|
11
13
|
body: PerformActionInputRepresentation;
|
|
@@ -15,14 +17,18 @@ export declare class QuickActionExecutionRepresentationHandler extends AbstractR
|
|
|
15
17
|
private readonly draftRecordService;
|
|
16
18
|
readonly isDraftId: (targetId: string) => boolean;
|
|
17
19
|
private readonly sideEffectService;
|
|
20
|
+
private readonly objectInfoService;
|
|
21
|
+
private readonly getRecord;
|
|
18
22
|
handlerId: string;
|
|
19
|
-
constructor(getLuvio: () => Luvio, draftRecordService: UiApiDraftRecordService, draftQueue: DraftQueue, networkAdapter: NetworkAdapter, isDraftId: (targetId: string) => boolean, sideEffectService: SideEffectService);
|
|
23
|
+
constructor(getLuvio: () => Luvio, draftRecordService: UiApiDraftRecordService, draftQueue: DraftQueue, networkAdapter: NetworkAdapter, isDraftId: (targetId: string) => boolean, sideEffectService: SideEffectService, objectInfoService: ObjectInfoService, getRecord: Adapter<GetRecordConfig, RecordRepresentation>);
|
|
20
24
|
draftActionToSideEffects(queueEntry: DraftAction<PerformQuickActionResourceRequest, QuickActionExecutionRepresentation>): Promise<SideEffect[]>;
|
|
21
25
|
getIdFromRequest(request: ResourceRequest): Promise<string>;
|
|
22
26
|
getIdFromResponseBody(responseBody: QuickActionExecutionRepresentation): string;
|
|
23
27
|
buildTagForTargetId(id: string): string;
|
|
24
28
|
buildCacheKeysFromResponse(_response: QuickActionExecutionRepresentation): DurableStoreKeyMetadataMap;
|
|
25
29
|
synchronousIngest(response: QuickActionExecutionRepresentation): void;
|
|
30
|
+
handleActionCompleted(action: CompletedDraftAction<ResourceRequest, QuickActionExecutionRepresentation>, queueOperations: QueueOperation[]): Promise<void>;
|
|
31
|
+
private allFields;
|
|
26
32
|
mergeRequestBody<T>(): T;
|
|
27
33
|
}
|
|
28
34
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Join, PredicateValue } from './query';
|
|
2
2
|
import type { LocalEvaluationRuntimeSettings } from './types';
|
|
3
|
-
export declare function scopeToJoins(scope: string | undefined, settings: LocalEvaluationRuntimeSettings): Join[];
|
|
4
|
-
export declare function scopeToPredicates(scope: string | undefined, settings: LocalEvaluationRuntimeSettings): PredicateValue[];
|
|
3
|
+
export declare function scopeToJoins(scope: string | undefined, fieldName: string, settings: LocalEvaluationRuntimeSettings): Join[];
|
|
4
|
+
export declare function scopeToPredicates(scope: string | undefined, fieldName: string, settings: LocalEvaluationRuntimeSettings): PredicateValue[];
|