@salesforce/lds-worker-api 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.
@@ -449,7 +449,16 @@ function invokeAdapterWithMetadata(adapterId, config, metadata, onResponse, nati
449
449
  return;
450
450
  }
451
451
  if (adapterId === 'deleteRecord') {
452
- invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResponse, nativeAdapterRequestContext);
452
+ draftManager.stopQueueWhileRunning(() => {
453
+ return new Promise((resolve) => {
454
+ const onResponseWrapper = (response) => {
455
+ resolve(response);
456
+ };
457
+ invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResponseWrapper, nativeAdapterRequestContext);
458
+ }).then((callbackValue) => {
459
+ onResponse(callbackValue);
460
+ });
461
+ });
453
462
  }
454
463
  else {
455
464
  draftManager.stopQueueWhileRunning(() => {
@@ -597,9 +606,7 @@ function removeDraftNodeActionId(targetDraftId, responseValue) {
597
606
  ...responseValue.data.drafts,
598
607
  draftActionIds: responseValue.data.drafts.draftActionIds.filter((x) => x !== targetDraftId),
599
608
  };
600
- return Object.assign(responseValue, {
601
- data: { drafts: recordDraftsNode },
602
- });
609
+ return { ...responseValue, data: { ...responseValue.data, drafts: recordDraftsNode } };
603
610
  }
604
611
  function convertErrorIntoNativeFetchError(error, defaultMessage) {
605
612
  let message = defaultMessage;
@@ -1121,4 +1128,4 @@ if (process.env.NODE_ENV !== 'production') {
1121
1128
  }
1122
1129
 
1123
1130
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1124
- // version: 1.331.0-fec0cd0317
1131
+ // version: 1.332.0-dev10-0d26f7dda1
@@ -4265,7 +4265,7 @@ function withDefaultLuvio(callback) {
4265
4265
  }
4266
4266
  callbacks.push(callback);
4267
4267
  }
4268
- // version: 1.331.0-fec0cd0317
4268
+ // version: 1.332.0-dev10-0d26f7dda1
4269
4269
 
4270
4270
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4271
4271
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5213,7 +5213,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
5213
5213
  const { apiFamily, name } = metadata;
5214
5214
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5215
5215
  }
5216
- // version: 1.331.0-fec0cd0317
5216
+ // version: 1.332.0-dev10-0d26f7dda1
5217
5217
 
5218
5218
  /**
5219
5219
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -33850,7 +33850,7 @@ withDefaultLuvio((luvio) => {
33850
33850
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
33851
33851
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
33852
33852
  });
33853
- // version: 1.331.0-e9c482e8ab
33853
+ // version: 1.332.0-dev10-d8601dd102
33854
33854
 
33855
33855
  /**
33856
33856
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -65842,13 +65842,25 @@ function convertGraphQLToRaml$1(astNode, state) {
65842
65842
  ? getRequestedFieldsForType$1(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$H$1)
65843
65843
  : new Map();
65844
65844
  const { fieldsBag, trie } = createFieldsBagAndTrie$1(data, requestedFields, state);
65845
+ const recordTypeId = data.ldsRecordTypeId === null ? null : data.ldsRecordTypeId.value;
65846
+ if (recordTypeId && recordTypeId !== MAIN_RECORD_TYPE_ID) {
65847
+ const fieldName = 'RecordTypeId';
65848
+ fieldsBag[fieldName] = {
65849
+ value: recordTypeId,
65850
+ displayValue: null,
65851
+ };
65852
+ trie.children[fieldName] = {
65853
+ name: fieldName,
65854
+ children: {},
65855
+ };
65856
+ }
65845
65857
  const recordRepresentation = {
65846
65858
  apiName: data.ApiName,
65847
65859
  eTag: '',
65848
65860
  lastModifiedById: data.LastModifiedById.value,
65849
65861
  lastModifiedDate: data.LastModifiedDate.value,
65850
65862
  systemModstamp: data.SystemModstamp.value,
65851
- recordTypeId: data.ldsRecordTypeId === null ? null : data.ldsRecordTypeId.value,
65863
+ recordTypeId: recordTypeId,
65852
65864
  recordTypeInfo: null,
65853
65865
  childRelationships: {},
65854
65866
  id: data.Id,
@@ -80117,11 +80129,13 @@ class UiApiDraftRecordService {
80117
80129
 
80118
80130
  const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
80119
80131
  class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestActionHandler {
80120
- constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService) {
80132
+ constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
80121
80133
  super(draftQueue, networkAdapter, getLuvio, draftRecordService);
80122
80134
  this.draftRecordService = draftRecordService;
80123
80135
  this.isDraftId = isDraftId;
80124
80136
  this.sideEffectService = sideEffectService;
80137
+ this.objectInfoService = objectInfoService;
80138
+ this.getRecord = getRecord;
80125
80139
  this.handlerId = QUICK_ACTION_HANDLER;
80126
80140
  draftRecordService.registerRecordHandler(this);
80127
80141
  }
@@ -80153,6 +80167,30 @@ class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestA
80153
80167
  });
80154
80168
  luvio.storeIngest(key, ingest$B$2, response);
80155
80169
  }
80170
+ async handleActionCompleted(action, queueOperations) {
80171
+ await super.handleActionCompleted(action, queueOperations);
80172
+ this.getLuvio();
80173
+ const canonicalId = action.response.body.id;
80174
+ this.buildTagForTargetId(canonicalId);
80175
+ const prefix = canonicalId.substring(0, 3);
80176
+ if (prefix.length !== 3) {
80177
+ // if we can't get a prefix, don't do the rest
80178
+ return;
80179
+ }
80180
+ const apiName = await this.objectInfoService.apiNameForPrefix(prefix);
80181
+ const objectInfo = await this.objectInfoService.getObjectInfo(apiName);
80182
+ if (!objectInfo) {
80183
+ return;
80184
+ }
80185
+ await this.getRecord({ recordId: canonicalId, fields: this.allFields(objectInfo) });
80186
+ }
80187
+ allFields(objectInfo) {
80188
+ let fields = [];
80189
+ Object.keys(objectInfo.fields).forEach((fieldName) => {
80190
+ fields.push(objectInfo.apiName + '.' + fieldName);
80191
+ });
80192
+ return fields;
80193
+ }
80156
80194
  mergeRequestBody() {
80157
80195
  throw Error('mergeActions not supported for QuickActionExecutionRepresentationHandler');
80158
80196
  }
@@ -80255,12 +80293,16 @@ function isCreateContentDocumentAndVersionDraftAdapterEvent(customEvent) {
80255
80293
  /* global __nimbus */
80256
80294
  function chunkToBase64(chunk) {
80257
80295
  const bytes = new Uint8Array(chunk);
80258
- const binary = String.fromCharCode.apply(null, bytes);
80296
+ const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
80297
+ let binary = '';
80298
+ for (let i = 0; i < bytes.length; i += CHUNK_SIZE) {
80299
+ binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK_SIZE));
80300
+ }
80259
80301
  return btoa(binary);
80260
80302
  }
80261
80303
  async function streamBufferToBinaryStore(binaryStore, file, mimeType) {
80262
80304
  const uri = await binaryStore.createStream(mimeType);
80263
- const CHUNK_SIZE = 64 * 1024; // 64KB
80305
+ const CHUNK_SIZE = 1024 * 1024 * 2; // 2mb
80264
80306
  const fileSize = file.size;
80265
80307
  let offset = 0;
80266
80308
  try {
@@ -81802,10 +81844,13 @@ function sanitizePredicateIDValue(value, draftFunction) {
81802
81844
  }
81803
81845
  }
81804
81846
  function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
81805
- if (!value || (isArray$1$1(value) && value.length === 0)) {
81847
+ if (value === undefined || (isArray$1$1(value) && value.length === 0)) {
81806
81848
  // eslint-disable-next-line
81807
81849
  throw new Error(`No value specified for MultiPickList filter`);
81808
81850
  }
81851
+ if (value === null) {
81852
+ return createSinglePredicate(null, operator, fieldInfo, alias);
81853
+ }
81809
81854
  // generate single prodicate for = and !=
81810
81855
  if (operator === '=' || operator === '!=') {
81811
81856
  // The raw value could be ';;a; b;;', clean it up to 'a;b'
@@ -81825,6 +81870,9 @@ function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
81825
81870
  type: PredicateType.compound,
81826
81871
  operator: operator === 'LIKE' ? 'or' : 'and',
81827
81872
  children: valueArray.map((v) => {
81873
+ if (v === null) {
81874
+ return createSinglePredicate(v, operator, fieldInfo, alias);
81875
+ }
81828
81876
  const splittedValue = v
81829
81877
  .split(MultiPickListValueSeparator)
81830
81878
  .map((v) => v.trim())
@@ -81887,7 +81935,7 @@ function multiPicklistToSql(operator, value) {
81887
81935
  // match the behavior described in SOQL documentation (https://sfdc.co/c9j0r)
81888
81936
  // To make sure the match is safe for includes/excludes. the value is prefix and
81889
81937
  // suffix with ';', like 'abc' to '%;abc;%'. raw value for eq and ne.
81890
- if (operator === 'LIKE' || operator === 'NOT LIKE') {
81938
+ if (value !== null && (operator === 'LIKE' || operator === 'NOT LIKE')) {
81891
81939
  return `%${MultiPickListValueSeparator}${value}${MultiPickListValueSeparator}%`;
81892
81940
  }
81893
81941
  else {
@@ -82054,14 +82102,7 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
82054
82102
  // SQLite is case sensitive by default, SOQL is case in-sensitive by default
82055
82103
  // For pick list includes or excludeds, prefix and suffix the field value with ';' to guarantee the query accuracy.
82056
82104
  if (dataType === 'MultiPicklist' && (operator === 'LIKE' || operator === 'NOT LIKE')) {
82057
- // to include nulls in NOT LIKE operators we need to still return a value for NULL
82058
- // calling the COALESCE function with the extracted value and empty string will make it an empty string
82059
- // instead of NULL in the function return and can be compared
82060
- const coalesce = (sql) => {
82061
- return `COALESCE(${sql}, '')`;
82062
- };
82063
- const extract = `json_extract("${alias}".data, '${leftPath}')`;
82064
- sql = `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
82105
+ sql = buildMultiPicklistSQL(predicate, valueBinding, questionSql);
82065
82106
  }
82066
82107
  else {
82067
82108
  sql = `json_extract("${alias}".data, '${leftPath}') ${operator} ${questionSql}${isCaseSensitive === true ? '' : ` COLLATE NOCASE`}`;
@@ -82071,6 +82112,22 @@ function singlePredicateToSql(predicate, defaultAlias, isChildNotPredicate = fal
82071
82112
  }
82072
82113
  return { sql, binding };
82073
82114
  }
82115
+ function buildMultiPicklistSQL(predicate, value, questionSql) {
82116
+ const { alias, leftPath, operator } = predicate;
82117
+ if (value.length === 1 && value.includes(null)) {
82118
+ return `json_extract("${alias}".data, '${leftPath}') ${operator === 'LIKE' ? 'IS' : 'IS NOT'} ${questionSql}`;
82119
+ }
82120
+ else {
82121
+ // to include nulls in NOT LIKE operators we need to still return a value for NULL
82122
+ // calling the COALESCE function with the extracted value and empty string will make it an empty string
82123
+ // instead of NULL in the function return and can be compared
82124
+ const coalesce = (sql) => {
82125
+ return `COALESCE(${sql}, '')`;
82126
+ };
82127
+ const extract = `json_extract("${alias}".data, '${leftPath}')`;
82128
+ return `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
82129
+ }
82130
+ }
82074
82131
  // for one value, return { sql: '?', bindings:'xxx'}. for multiple value, return { sql: '(?, ?, ?)', binding: ['xxx','yyy','zzz'] }
82075
82132
  function handleExtractedPredicateValue(boundValue, checkForNull) {
82076
82133
  let questionSql = '?';
@@ -83027,65 +83084,100 @@ function pathForKey(key) {
83027
83084
  }
83028
83085
  }
83029
83086
 
83030
- function scopeToJoins(scope = '', settings) {
83031
- if (scope !== 'ASSIGNEDTOME')
83032
- return [];
83033
- return [
83034
- {
83035
- alias: 'ServiceAppointment_AssignedResource',
83036
- type: 'INNER',
83037
- to: 'ServiceAppointment',
83038
- conditions: [
83039
- {
83040
- type: PredicateType.single,
83041
- alias: 'ServiceAppointment_AssignedResource',
83042
- leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83043
- operator: '=',
83044
- value: 'AssignedResource',
83045
- dataType: 'String',
83046
- isCaseSensitive: true,
83047
- },
83048
- {
83049
- leftPath: '$.id',
83050
- rightPath: '$.fields.ServiceAppointmentId.value',
83051
- },
83052
- ],
83053
- apiName: 'AssignedResource',
83054
- },
83055
- {
83056
- alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83057
- type: 'INNER',
83058
- to: 'ServiceAppointment_AssignedResource',
83059
- conditions: [
83060
- {
83061
- type: PredicateType.single,
83062
- alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83063
- leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83064
- operator: '=',
83065
- value: 'ServiceResource',
83066
- dataType: 'String',
83067
- isCaseSensitive: true,
83068
- },
83069
- {
83070
- leftPath: '$.fields.ServiceResourceId.value',
83071
- rightPath: '$.id',
83072
- },
83073
- {
83074
- type: PredicateType.single,
83075
- alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83076
- leftPath: '$.fields.RelatedRecordId.value',
83077
- operator: '=',
83078
- value: settings.userId,
83079
- dataType: 'String',
83080
- isCaseSensitive: true,
83081
- },
83082
- ],
83083
- apiName: 'ServiceResource',
83084
- },
83085
- ];
83087
+ function scopeToJoins(scope = '', fieldName, settings) {
83088
+ if (scope === 'ASSIGNEDTOME') {
83089
+ return [
83090
+ {
83091
+ alias: 'ServiceAppointment_AssignedResource',
83092
+ type: 'INNER',
83093
+ to: 'ServiceAppointment',
83094
+ conditions: [
83095
+ {
83096
+ type: PredicateType.single,
83097
+ alias: 'ServiceAppointment_AssignedResource',
83098
+ leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83099
+ operator: '=',
83100
+ value: 'AssignedResource',
83101
+ dataType: 'String',
83102
+ isCaseSensitive: true,
83103
+ },
83104
+ {
83105
+ leftPath: '$.id',
83106
+ rightPath: '$.fields.ServiceAppointmentId.value',
83107
+ },
83108
+ ],
83109
+ apiName: 'AssignedResource',
83110
+ },
83111
+ {
83112
+ alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83113
+ type: 'INNER',
83114
+ to: 'ServiceAppointment_AssignedResource',
83115
+ conditions: [
83116
+ {
83117
+ type: PredicateType.single,
83118
+ alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83119
+ leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83120
+ operator: '=',
83121
+ value: 'ServiceResource',
83122
+ dataType: 'String',
83123
+ isCaseSensitive: true,
83124
+ },
83125
+ {
83126
+ leftPath: '$.fields.ServiceResourceId.value',
83127
+ rightPath: '$.id',
83128
+ },
83129
+ {
83130
+ type: PredicateType.single,
83131
+ alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83132
+ leftPath: '$.fields.RelatedRecordId.value',
83133
+ operator: '=',
83134
+ value: settings.userId,
83135
+ dataType: 'String',
83136
+ isCaseSensitive: true,
83137
+ },
83138
+ ],
83139
+ apiName: 'ServiceResource',
83140
+ },
83141
+ ];
83142
+ }
83143
+ else if (scope === 'MINE' && fieldName === 'ResourceAbsence') {
83144
+ return [
83145
+ {
83146
+ alias: 'ResourceAbsence_Resource',
83147
+ type: 'INNER',
83148
+ to: 'ResourceAbsence',
83149
+ conditions: [
83150
+ {
83151
+ type: PredicateType.single,
83152
+ alias: 'ResourceAbsence_Resource',
83153
+ leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83154
+ operator: '=',
83155
+ value: 'ServiceResource',
83156
+ dataType: 'String',
83157
+ isCaseSensitive: true,
83158
+ },
83159
+ {
83160
+ leftPath: '$.fields.ResourceId.value',
83161
+ rightPath: '$.id',
83162
+ },
83163
+ {
83164
+ type: PredicateType.single,
83165
+ alias: 'ResourceAbsence_Resource',
83166
+ leftPath: '$.fields.OwnerId.value',
83167
+ operator: '=',
83168
+ value: settings.userId,
83169
+ dataType: 'String',
83170
+ isCaseSensitive: true,
83171
+ },
83172
+ ],
83173
+ apiName: 'Resource',
83174
+ },
83175
+ ];
83176
+ }
83177
+ return [];
83086
83178
  }
83087
- function scopeToPredicates(scope = '', settings) {
83088
- if (scope !== 'MINE')
83179
+ function scopeToPredicates(scope = '', fieldName, settings) {
83180
+ if (scope !== 'MINE' || fieldName === 'ResourceAbsence')
83089
83181
  return [];
83090
83182
  return [
83091
83183
  {
@@ -84116,10 +84208,10 @@ async function connectionResolver(obj, args, context, info) {
84116
84208
  // Alias starts as entity's ApiName
84117
84209
  const predicates = [
84118
84210
  ...filterToPredicates(args.where, alias, alias, context.objectInfos, joins, draftFunctions),
84119
- ...scopeToPredicates(args.scope, context.settings),
84211
+ ...scopeToPredicates(args.scope, info.fieldName, context.settings),
84120
84212
  ...childRelationshipToPredicates(childRelationshipFieldName, parentRecord ? parentRecord.id : undefined),
84121
84213
  ];
84122
- const scopeJoins = scopeToJoins(args.scope, context.settings);
84214
+ const scopeJoins = scopeToJoins(args.scope, info.fieldName, context.settings);
84123
84215
  joins.push(...scopeJoins);
84124
84216
  // Limit defaults to 10 records if unspecified
84125
84217
  let limit = 10;
@@ -85247,9 +85339,11 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
85247
85339
  .filter(nodeIsNamed('node'))[0];
85248
85340
  switch (node.name.value) {
85249
85341
  case 'scope':
85250
- // Hanle 'MINE' field
85251
85342
  if (isScopeArgumentNodeWithType(node, 'MINE', variables)) {
85252
- if (isMineScopeAvailable(ancestorPath, pathToObjectApiNamesMap, objectInfos)) {
85343
+ if (recordQueryApiName === 'ResourceAbsence') {
85344
+ inlineFragmentSelections[ancestorPath].push(...mineResourceAbsenceSelections);
85345
+ }
85346
+ else if (isMineScopeAvailable(ancestorPath, pathToObjectApiNamesMap, objectInfos)) {
85253
85347
  // 'typeConditon' is added when the 'InlineFragmentNode' is appended at the write pass
85254
85348
  inlineFragmentSelections[ancestorPath].push(...mineFragmentSelections);
85255
85349
  }
@@ -86400,6 +86494,93 @@ let mineFragmentSelections = [
86400
86494
  },
86401
86495
  },
86402
86496
  ];
86497
+ const mineResourceAbsenceSelections = [
86498
+ {
86499
+ kind: 'Field',
86500
+ name: {
86501
+ kind: 'Name',
86502
+ value: 'ResourceId',
86503
+ },
86504
+ arguments: [],
86505
+ directives: [],
86506
+ selectionSet: {
86507
+ kind: 'SelectionSet',
86508
+ selections: [
86509
+ {
86510
+ kind: 'Field',
86511
+ name: {
86512
+ kind: 'Name',
86513
+ value: 'value',
86514
+ },
86515
+ arguments: [],
86516
+ directives: [],
86517
+ },
86518
+ ],
86519
+ },
86520
+ },
86521
+ {
86522
+ kind: 'Field',
86523
+ name: {
86524
+ kind: 'Name',
86525
+ value: 'Resource',
86526
+ },
86527
+ arguments: [],
86528
+ directives: [
86529
+ {
86530
+ kind: 'Directive',
86531
+ name: {
86532
+ kind: 'Name',
86533
+ value: 'category',
86534
+ },
86535
+ arguments: [
86536
+ {
86537
+ kind: 'Argument',
86538
+ name: {
86539
+ kind: 'Name',
86540
+ value: 'name',
86541
+ },
86542
+ value: {
86543
+ kind: 'StringValue',
86544
+ value: PARENT_RELATIONSHIP,
86545
+ block: false,
86546
+ },
86547
+ },
86548
+ ],
86549
+ },
86550
+ ],
86551
+ selectionSet: {
86552
+ kind: 'SelectionSet',
86553
+ selections: [
86554
+ {
86555
+ kind: 'Field',
86556
+ name: {
86557
+ kind: 'Name',
86558
+ value: 'Id',
86559
+ },
86560
+ },
86561
+ {
86562
+ kind: 'Field',
86563
+ name: {
86564
+ kind: 'Name',
86565
+ value: 'OwnerId',
86566
+ },
86567
+ selectionSet: {
86568
+ kind: 'SelectionSet',
86569
+ selections: [
86570
+ {
86571
+ kind: 'Field',
86572
+ name: {
86573
+ kind: 'Name',
86574
+ value: 'value',
86575
+ },
86576
+ },
86577
+ ],
86578
+ },
86579
+ },
86580
+ ],
86581
+ },
86582
+ },
86583
+ ];
86403
86584
  const assignedToMeFragmentSelections = [
86404
86585
  {
86405
86586
  kind: 'Field',
@@ -92023,7 +92204,7 @@ class SideEffectService {
92023
92204
  const objectInfo = await this.ensureObjectInfo(apiName);
92024
92205
  const recordFields = {};
92025
92206
  for (const fieldName of keys$3(fields)) {
92026
- const draftField = fields[fieldName];
92207
+ const draftField = fields[fieldName] ?? null;
92027
92208
  recordFields[fieldName] = { value: draftField, displayValue: null };
92028
92209
  const fieldInfo = objectInfo.fields[fieldName];
92029
92210
  if (fieldInfo) {
@@ -92454,7 +92635,8 @@ class DurableRecordStore {
92454
92635
  }
92455
92636
  async exists(key) {
92456
92637
  const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
92457
- return result.rows[0][0] === 1;
92638
+ const exists = result.rows[0][0];
92639
+ return exists == true;
92458
92640
  }
92459
92641
  async getRecord(key) {
92460
92642
  const canonicalKey = this.getLuvio().storeGetCanonicalKey(key);
@@ -92579,7 +92761,7 @@ function getRuntime() {
92579
92761
  const draftService = new UiApiDraftRecordService(() => lazyLuvio, lazyDurableStore, lazyObjectInfoService, newRecordId, lazySideEffectStore, lazyDurableRecordStore);
92580
92762
  const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService, lazySideEffectService, lazyDurableRecordStore);
92581
92763
  uiApiRecordHandler.setSideEffectHooks(sfsSideEffectHooks);
92582
- const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
92764
+ const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService, lazyObjectInfoService, getRecord);
92583
92765
  const updateRecordQuickActionHandler = new UpdateRecordQuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
92584
92766
  const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, userId, draftService, lazyObjectInfoService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore, lazySideEffectService);
92585
92767
  lazyDraftQueue.addHandler(uiApiRecordHandler);
@@ -92685,7 +92867,7 @@ register$1({
92685
92867
  id: '@salesforce/lds-network-adapter',
92686
92868
  instrument: instrument$2,
92687
92869
  });
92688
- // version: 1.331.0-fec0cd0317
92870
+ // version: 1.332.0-dev10-0d26f7dda1
92689
92871
 
92690
92872
  const { create: create$2, keys: keys$2 } = Object;
92691
92873
  const { stringify, parse } = JSON;
@@ -115252,7 +115434,7 @@ register$1({
115252
115434
  configuration: { ...configurationForGraphQLAdapters$1 },
115253
115435
  instrument: instrument$1,
115254
115436
  });
115255
- // version: 1.331.0-e9c482e8ab
115437
+ // version: 1.332.0-dev10-d8601dd102
115256
115438
 
115257
115439
  // On core the unstable adapters are re-exported with different names,
115258
115440
  // we want to match them here.
@@ -115404,7 +115586,7 @@ withDefaultLuvio((luvio) => {
115404
115586
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
115405
115587
  graphQLImperative = ldsAdapter;
115406
115588
  });
115407
- // version: 1.331.0-e9c482e8ab
115589
+ // version: 1.332.0-dev10-d8601dd102
115408
115590
 
115409
115591
  var gqlApi = /*#__PURE__*/Object.freeze({
115410
115592
  __proto__: null,
@@ -115817,7 +115999,16 @@ function invokeAdapterWithMetadata(adapterId, config, metadata, onResponse, nati
115817
115999
  return;
115818
116000
  }
115819
116001
  if (adapterId === 'deleteRecord') {
115820
- invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResponse, nativeAdapterRequestContext);
116002
+ draftManager.stopQueueWhileRunning(() => {
116003
+ return new Promise((resolve) => {
116004
+ const onResponseWrapper = (response) => {
116005
+ resolve(response);
116006
+ };
116007
+ invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResponseWrapper, nativeAdapterRequestContext);
116008
+ }).then((callbackValue) => {
116009
+ onResponse(callbackValue);
116010
+ });
116011
+ });
115821
116012
  }
115822
116013
  else {
115823
116014
  draftManager.stopQueueWhileRunning(() => {
@@ -115965,9 +116156,7 @@ function removeDraftNodeActionId(targetDraftId, responseValue) {
115965
116156
  ...responseValue.data.drafts,
115966
116157
  draftActionIds: responseValue.data.drafts.draftActionIds.filter((x) => x !== targetDraftId),
115967
116158
  };
115968
- return Object.assign(responseValue, {
115969
- data: { drafts: recordDraftsNode },
115970
- });
116159
+ return { ...responseValue, data: { ...responseValue.data, drafts: recordDraftsNode } };
115971
116160
  }
115972
116161
  function convertErrorIntoNativeFetchError(error, defaultMessage) {
115973
116162
  let message = defaultMessage;
@@ -116189,7 +116378,7 @@ const callbacks$1 = [];
116189
116378
  function register(r) {
116190
116379
  callbacks$1.forEach((callback) => callback(r));
116191
116380
  }
116192
- // version: 1.331.0-fec0cd0317
116381
+ // version: 1.332.0-dev10-0d26f7dda1
116193
116382
 
116194
116383
  /**
116195
116384
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -117252,4 +117441,4 @@ const { luvio } = getRuntime();
117252
117441
  setDefaultLuvio({ luvio });
117253
117442
 
117254
117443
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
117255
- // version: 1.331.0-fec0cd0317
117444
+ // version: 1.332.0-dev10-0d26f7dda1
@@ -4271,7 +4271,7 @@
4271
4271
  }
4272
4272
  callbacks.push(callback);
4273
4273
  }
4274
- // version: 1.331.0-fec0cd0317
4274
+ // version: 1.332.0-dev10-0d26f7dda1
4275
4275
 
4276
4276
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4277
4277
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5219,7 +5219,7 @@
5219
5219
  const { apiFamily, name } = metadata;
5220
5220
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5221
5221
  }
5222
- // version: 1.331.0-fec0cd0317
5222
+ // version: 1.332.0-dev10-0d26f7dda1
5223
5223
 
5224
5224
  /**
5225
5225
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -33856,7 +33856,7 @@
33856
33856
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
33857
33857
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
33858
33858
  });
33859
- // version: 1.331.0-e9c482e8ab
33859
+ // version: 1.332.0-dev10-d8601dd102
33860
33860
 
33861
33861
  /**
33862
33862
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -65848,13 +65848,25 @@
65848
65848
  ? getRequestedFieldsForType$1(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$H$1)
65849
65849
  : new Map();
65850
65850
  const { fieldsBag, trie } = createFieldsBagAndTrie$1(data, requestedFields, state);
65851
+ const recordTypeId = data.ldsRecordTypeId === null ? null : data.ldsRecordTypeId.value;
65852
+ if (recordTypeId && recordTypeId !== MAIN_RECORD_TYPE_ID) {
65853
+ const fieldName = 'RecordTypeId';
65854
+ fieldsBag[fieldName] = {
65855
+ value: recordTypeId,
65856
+ displayValue: null,
65857
+ };
65858
+ trie.children[fieldName] = {
65859
+ name: fieldName,
65860
+ children: {},
65861
+ };
65862
+ }
65851
65863
  const recordRepresentation = {
65852
65864
  apiName: data.ApiName,
65853
65865
  eTag: '',
65854
65866
  lastModifiedById: data.LastModifiedById.value,
65855
65867
  lastModifiedDate: data.LastModifiedDate.value,
65856
65868
  systemModstamp: data.SystemModstamp.value,
65857
- recordTypeId: data.ldsRecordTypeId === null ? null : data.ldsRecordTypeId.value,
65869
+ recordTypeId: recordTypeId,
65858
65870
  recordTypeInfo: null,
65859
65871
  childRelationships: {},
65860
65872
  id: data.Id,
@@ -80123,11 +80135,13 @@
80123
80135
 
80124
80136
  const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
80125
80137
  class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestActionHandler {
80126
- constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService) {
80138
+ constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
80127
80139
  super(draftQueue, networkAdapter, getLuvio, draftRecordService);
80128
80140
  this.draftRecordService = draftRecordService;
80129
80141
  this.isDraftId = isDraftId;
80130
80142
  this.sideEffectService = sideEffectService;
80143
+ this.objectInfoService = objectInfoService;
80144
+ this.getRecord = getRecord;
80131
80145
  this.handlerId = QUICK_ACTION_HANDLER;
80132
80146
  draftRecordService.registerRecordHandler(this);
80133
80147
  }
@@ -80159,6 +80173,30 @@
80159
80173
  });
80160
80174
  luvio.storeIngest(key, ingest$B$2, response);
80161
80175
  }
80176
+ async handleActionCompleted(action, queueOperations) {
80177
+ await super.handleActionCompleted(action, queueOperations);
80178
+ this.getLuvio();
80179
+ const canonicalId = action.response.body.id;
80180
+ this.buildTagForTargetId(canonicalId);
80181
+ const prefix = canonicalId.substring(0, 3);
80182
+ if (prefix.length !== 3) {
80183
+ // if we can't get a prefix, don't do the rest
80184
+ return;
80185
+ }
80186
+ const apiName = await this.objectInfoService.apiNameForPrefix(prefix);
80187
+ const objectInfo = await this.objectInfoService.getObjectInfo(apiName);
80188
+ if (!objectInfo) {
80189
+ return;
80190
+ }
80191
+ await this.getRecord({ recordId: canonicalId, fields: this.allFields(objectInfo) });
80192
+ }
80193
+ allFields(objectInfo) {
80194
+ let fields = [];
80195
+ Object.keys(objectInfo.fields).forEach((fieldName) => {
80196
+ fields.push(objectInfo.apiName + '.' + fieldName);
80197
+ });
80198
+ return fields;
80199
+ }
80162
80200
  mergeRequestBody() {
80163
80201
  throw Error('mergeActions not supported for QuickActionExecutionRepresentationHandler');
80164
80202
  }
@@ -80261,12 +80299,16 @@
80261
80299
  /* global __nimbus */
80262
80300
  function chunkToBase64(chunk) {
80263
80301
  const bytes = new Uint8Array(chunk);
80264
- const binary = String.fromCharCode.apply(null, bytes);
80302
+ const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
80303
+ let binary = '';
80304
+ for (let i = 0; i < bytes.length; i += CHUNK_SIZE) {
80305
+ binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK_SIZE));
80306
+ }
80265
80307
  return btoa(binary);
80266
80308
  }
80267
80309
  async function streamBufferToBinaryStore(binaryStore, file, mimeType) {
80268
80310
  const uri = await binaryStore.createStream(mimeType);
80269
- const CHUNK_SIZE = 64 * 1024; // 64KB
80311
+ const CHUNK_SIZE = 1024 * 1024 * 2; // 2mb
80270
80312
  const fileSize = file.size;
80271
80313
  let offset = 0;
80272
80314
  try {
@@ -81808,10 +81850,13 @@
81808
81850
  }
81809
81851
  }
81810
81852
  function createMultiPicklistPredicate(value, operator, fieldInfo, alias) {
81811
- if (!value || (isArray$1$1(value) && value.length === 0)) {
81853
+ if (value === undefined || (isArray$1$1(value) && value.length === 0)) {
81812
81854
  // eslint-disable-next-line
81813
81855
  throw new Error(`No value specified for MultiPickList filter`);
81814
81856
  }
81857
+ if (value === null) {
81858
+ return createSinglePredicate(null, operator, fieldInfo, alias);
81859
+ }
81815
81860
  // generate single prodicate for = and !=
81816
81861
  if (operator === '=' || operator === '!=') {
81817
81862
  // The raw value could be ';;a; b;;', clean it up to 'a;b'
@@ -81831,6 +81876,9 @@
81831
81876
  type: PredicateType.compound,
81832
81877
  operator: operator === 'LIKE' ? 'or' : 'and',
81833
81878
  children: valueArray.map((v) => {
81879
+ if (v === null) {
81880
+ return createSinglePredicate(v, operator, fieldInfo, alias);
81881
+ }
81834
81882
  const splittedValue = v
81835
81883
  .split(MultiPickListValueSeparator)
81836
81884
  .map((v) => v.trim())
@@ -81893,7 +81941,7 @@
81893
81941
  // match the behavior described in SOQL documentation (https://sfdc.co/c9j0r)
81894
81942
  // To make sure the match is safe for includes/excludes. the value is prefix and
81895
81943
  // suffix with ';', like 'abc' to '%;abc;%'. raw value for eq and ne.
81896
- if (operator === 'LIKE' || operator === 'NOT LIKE') {
81944
+ if (value !== null && (operator === 'LIKE' || operator === 'NOT LIKE')) {
81897
81945
  return `%${MultiPickListValueSeparator}${value}${MultiPickListValueSeparator}%`;
81898
81946
  }
81899
81947
  else {
@@ -82060,14 +82108,7 @@
82060
82108
  // SQLite is case sensitive by default, SOQL is case in-sensitive by default
82061
82109
  // For pick list includes or excludeds, prefix and suffix the field value with ';' to guarantee the query accuracy.
82062
82110
  if (dataType === 'MultiPicklist' && (operator === 'LIKE' || operator === 'NOT LIKE')) {
82063
- // to include nulls in NOT LIKE operators we need to still return a value for NULL
82064
- // calling the COALESCE function with the extracted value and empty string will make it an empty string
82065
- // instead of NULL in the function return and can be compared
82066
- const coalesce = (sql) => {
82067
- return `COALESCE(${sql}, '')`;
82068
- };
82069
- const extract = `json_extract("${alias}".data, '${leftPath}')`;
82070
- sql = `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
82111
+ sql = buildMultiPicklistSQL(predicate, valueBinding, questionSql);
82071
82112
  }
82072
82113
  else {
82073
82114
  sql = `json_extract("${alias}".data, '${leftPath}') ${operator} ${questionSql}${isCaseSensitive === true ? '' : ` COLLATE NOCASE`}`;
@@ -82077,6 +82118,22 @@
82077
82118
  }
82078
82119
  return { sql, binding };
82079
82120
  }
82121
+ function buildMultiPicklistSQL(predicate, value, questionSql) {
82122
+ const { alias, leftPath, operator } = predicate;
82123
+ if (value.length === 1 && value.includes(null)) {
82124
+ return `json_extract("${alias}".data, '${leftPath}') ${operator === 'LIKE' ? 'IS' : 'IS NOT'} ${questionSql}`;
82125
+ }
82126
+ else {
82127
+ // to include nulls in NOT LIKE operators we need to still return a value for NULL
82128
+ // calling the COALESCE function with the extracted value and empty string will make it an empty string
82129
+ // instead of NULL in the function return and can be compared
82130
+ const coalesce = (sql) => {
82131
+ return `COALESCE(${sql}, '')`;
82132
+ };
82133
+ const extract = `json_extract("${alias}".data, '${leftPath}')`;
82134
+ return `'${MultiPickListValueSeparator}' || ${operator === 'NOT LIKE' ? coalesce(extract) : extract} || '${MultiPickListValueSeparator}' ${operator} ${questionSql} COLLATE NOCASE`;
82135
+ }
82136
+ }
82080
82137
  // for one value, return { sql: '?', bindings:'xxx'}. for multiple value, return { sql: '(?, ?, ?)', binding: ['xxx','yyy','zzz'] }
82081
82138
  function handleExtractedPredicateValue(boundValue, checkForNull) {
82082
82139
  let questionSql = '?';
@@ -83033,65 +83090,100 @@
83033
83090
  }
83034
83091
  }
83035
83092
 
83036
- function scopeToJoins(scope = '', settings) {
83037
- if (scope !== 'ASSIGNEDTOME')
83038
- return [];
83039
- return [
83040
- {
83041
- alias: 'ServiceAppointment_AssignedResource',
83042
- type: 'INNER',
83043
- to: 'ServiceAppointment',
83044
- conditions: [
83045
- {
83046
- type: PredicateType.single,
83047
- alias: 'ServiceAppointment_AssignedResource',
83048
- leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83049
- operator: '=',
83050
- value: 'AssignedResource',
83051
- dataType: 'String',
83052
- isCaseSensitive: true,
83053
- },
83054
- {
83055
- leftPath: '$.id',
83056
- rightPath: '$.fields.ServiceAppointmentId.value',
83057
- },
83058
- ],
83059
- apiName: 'AssignedResource',
83060
- },
83061
- {
83062
- alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83063
- type: 'INNER',
83064
- to: 'ServiceAppointment_AssignedResource',
83065
- conditions: [
83066
- {
83067
- type: PredicateType.single,
83068
- alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83069
- leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83070
- operator: '=',
83071
- value: 'ServiceResource',
83072
- dataType: 'String',
83073
- isCaseSensitive: true,
83074
- },
83075
- {
83076
- leftPath: '$.fields.ServiceResourceId.value',
83077
- rightPath: '$.id',
83078
- },
83079
- {
83080
- type: PredicateType.single,
83081
- alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83082
- leftPath: '$.fields.RelatedRecordId.value',
83083
- operator: '=',
83084
- value: settings.userId,
83085
- dataType: 'String',
83086
- isCaseSensitive: true,
83087
- },
83088
- ],
83089
- apiName: 'ServiceResource',
83090
- },
83091
- ];
83093
+ function scopeToJoins(scope = '', fieldName, settings) {
83094
+ if (scope === 'ASSIGNEDTOME') {
83095
+ return [
83096
+ {
83097
+ alias: 'ServiceAppointment_AssignedResource',
83098
+ type: 'INNER',
83099
+ to: 'ServiceAppointment',
83100
+ conditions: [
83101
+ {
83102
+ type: PredicateType.single,
83103
+ alias: 'ServiceAppointment_AssignedResource',
83104
+ leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83105
+ operator: '=',
83106
+ value: 'AssignedResource',
83107
+ dataType: 'String',
83108
+ isCaseSensitive: true,
83109
+ },
83110
+ {
83111
+ leftPath: '$.id',
83112
+ rightPath: '$.fields.ServiceAppointmentId.value',
83113
+ },
83114
+ ],
83115
+ apiName: 'AssignedResource',
83116
+ },
83117
+ {
83118
+ alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83119
+ type: 'INNER',
83120
+ to: 'ServiceAppointment_AssignedResource',
83121
+ conditions: [
83122
+ {
83123
+ type: PredicateType.single,
83124
+ alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83125
+ leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83126
+ operator: '=',
83127
+ value: 'ServiceResource',
83128
+ dataType: 'String',
83129
+ isCaseSensitive: true,
83130
+ },
83131
+ {
83132
+ leftPath: '$.fields.ServiceResourceId.value',
83133
+ rightPath: '$.id',
83134
+ },
83135
+ {
83136
+ type: PredicateType.single,
83137
+ alias: 'ServiceAppointment_AssignedResource_ServiceResource',
83138
+ leftPath: '$.fields.RelatedRecordId.value',
83139
+ operator: '=',
83140
+ value: settings.userId,
83141
+ dataType: 'String',
83142
+ isCaseSensitive: true,
83143
+ },
83144
+ ],
83145
+ apiName: 'ServiceResource',
83146
+ },
83147
+ ];
83148
+ }
83149
+ else if (scope === 'MINE' && fieldName === 'ResourceAbsence') {
83150
+ return [
83151
+ {
83152
+ alias: 'ResourceAbsence_Resource',
83153
+ type: 'INNER',
83154
+ to: 'ResourceAbsence',
83155
+ conditions: [
83156
+ {
83157
+ type: PredicateType.single,
83158
+ alias: 'ResourceAbsence_Resource',
83159
+ leftPath: JSON_EXTRACT_PATH_INGESTION_APINAME,
83160
+ operator: '=',
83161
+ value: 'ServiceResource',
83162
+ dataType: 'String',
83163
+ isCaseSensitive: true,
83164
+ },
83165
+ {
83166
+ leftPath: '$.fields.ResourceId.value',
83167
+ rightPath: '$.id',
83168
+ },
83169
+ {
83170
+ type: PredicateType.single,
83171
+ alias: 'ResourceAbsence_Resource',
83172
+ leftPath: '$.fields.OwnerId.value',
83173
+ operator: '=',
83174
+ value: settings.userId,
83175
+ dataType: 'String',
83176
+ isCaseSensitive: true,
83177
+ },
83178
+ ],
83179
+ apiName: 'Resource',
83180
+ },
83181
+ ];
83182
+ }
83183
+ return [];
83092
83184
  }
83093
- function scopeToPredicates(scope = '', settings) {
83094
- if (scope !== 'MINE')
83185
+ function scopeToPredicates(scope = '', fieldName, settings) {
83186
+ if (scope !== 'MINE' || fieldName === 'ResourceAbsence')
83095
83187
  return [];
83096
83188
  return [
83097
83189
  {
@@ -84122,10 +84214,10 @@
84122
84214
  // Alias starts as entity's ApiName
84123
84215
  const predicates = [
84124
84216
  ...filterToPredicates(args.where, alias, alias, context.objectInfos, joins, draftFunctions),
84125
- ...scopeToPredicates(args.scope, context.settings),
84217
+ ...scopeToPredicates(args.scope, info.fieldName, context.settings),
84126
84218
  ...childRelationshipToPredicates(childRelationshipFieldName, parentRecord ? parentRecord.id : undefined),
84127
84219
  ];
84128
- const scopeJoins = scopeToJoins(args.scope, context.settings);
84220
+ const scopeJoins = scopeToJoins(args.scope, info.fieldName, context.settings);
84129
84221
  joins.push(...scopeJoins);
84130
84222
  // Limit defaults to 10 records if unspecified
84131
84223
  let limit = 10;
@@ -85253,9 +85345,11 @@
85253
85345
  .filter(nodeIsNamed('node'))[0];
85254
85346
  switch (node.name.value) {
85255
85347
  case 'scope':
85256
- // Hanle 'MINE' field
85257
85348
  if (isScopeArgumentNodeWithType(node, 'MINE', variables)) {
85258
- if (isMineScopeAvailable(ancestorPath, pathToObjectApiNamesMap, objectInfos)) {
85349
+ if (recordQueryApiName === 'ResourceAbsence') {
85350
+ inlineFragmentSelections[ancestorPath].push(...mineResourceAbsenceSelections);
85351
+ }
85352
+ else if (isMineScopeAvailable(ancestorPath, pathToObjectApiNamesMap, objectInfos)) {
85259
85353
  // 'typeConditon' is added when the 'InlineFragmentNode' is appended at the write pass
85260
85354
  inlineFragmentSelections[ancestorPath].push(...mineFragmentSelections);
85261
85355
  }
@@ -86406,6 +86500,93 @@
86406
86500
  },
86407
86501
  },
86408
86502
  ];
86503
+ const mineResourceAbsenceSelections = [
86504
+ {
86505
+ kind: 'Field',
86506
+ name: {
86507
+ kind: 'Name',
86508
+ value: 'ResourceId',
86509
+ },
86510
+ arguments: [],
86511
+ directives: [],
86512
+ selectionSet: {
86513
+ kind: 'SelectionSet',
86514
+ selections: [
86515
+ {
86516
+ kind: 'Field',
86517
+ name: {
86518
+ kind: 'Name',
86519
+ value: 'value',
86520
+ },
86521
+ arguments: [],
86522
+ directives: [],
86523
+ },
86524
+ ],
86525
+ },
86526
+ },
86527
+ {
86528
+ kind: 'Field',
86529
+ name: {
86530
+ kind: 'Name',
86531
+ value: 'Resource',
86532
+ },
86533
+ arguments: [],
86534
+ directives: [
86535
+ {
86536
+ kind: 'Directive',
86537
+ name: {
86538
+ kind: 'Name',
86539
+ value: 'category',
86540
+ },
86541
+ arguments: [
86542
+ {
86543
+ kind: 'Argument',
86544
+ name: {
86545
+ kind: 'Name',
86546
+ value: 'name',
86547
+ },
86548
+ value: {
86549
+ kind: 'StringValue',
86550
+ value: PARENT_RELATIONSHIP,
86551
+ block: false,
86552
+ },
86553
+ },
86554
+ ],
86555
+ },
86556
+ ],
86557
+ selectionSet: {
86558
+ kind: 'SelectionSet',
86559
+ selections: [
86560
+ {
86561
+ kind: 'Field',
86562
+ name: {
86563
+ kind: 'Name',
86564
+ value: 'Id',
86565
+ },
86566
+ },
86567
+ {
86568
+ kind: 'Field',
86569
+ name: {
86570
+ kind: 'Name',
86571
+ value: 'OwnerId',
86572
+ },
86573
+ selectionSet: {
86574
+ kind: 'SelectionSet',
86575
+ selections: [
86576
+ {
86577
+ kind: 'Field',
86578
+ name: {
86579
+ kind: 'Name',
86580
+ value: 'value',
86581
+ },
86582
+ },
86583
+ ],
86584
+ },
86585
+ },
86586
+ ],
86587
+ },
86588
+ },
86589
+ ];
86409
86590
  const assignedToMeFragmentSelections = [
86410
86591
  {
86411
86592
  kind: 'Field',
@@ -92029,7 +92210,7 @@
92029
92210
  const objectInfo = await this.ensureObjectInfo(apiName);
92030
92211
  const recordFields = {};
92031
92212
  for (const fieldName of keys$3(fields)) {
92032
- const draftField = fields[fieldName];
92213
+ const draftField = fields[fieldName] ?? null;
92033
92214
  recordFields[fieldName] = { value: draftField, displayValue: null };
92034
92215
  const fieldInfo = objectInfo.fields[fieldName];
92035
92216
  if (fieldInfo) {
@@ -92460,7 +92641,8 @@
92460
92641
  }
92461
92642
  async exists(key) {
92462
92643
  const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
92463
- return result.rows[0][0] === 1;
92644
+ const exists = result.rows[0][0];
92645
+ return exists == true;
92464
92646
  }
92465
92647
  async getRecord(key) {
92466
92648
  const canonicalKey = this.getLuvio().storeGetCanonicalKey(key);
@@ -92585,7 +92767,7 @@
92585
92767
  const draftService = new UiApiDraftRecordService(() => lazyLuvio, lazyDurableStore, lazyObjectInfoService, newRecordId, lazySideEffectStore, lazyDurableRecordStore);
92586
92768
  const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService, lazySideEffectService, lazyDurableRecordStore);
92587
92769
  uiApiRecordHandler.setSideEffectHooks(sfsSideEffectHooks);
92588
- const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
92770
+ const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService, lazyObjectInfoService, getRecord);
92589
92771
  const updateRecordQuickActionHandler = new UpdateRecordQuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, lazySideEffectService);
92590
92772
  const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, userId, draftService, lazyObjectInfoService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore, lazySideEffectService);
92591
92773
  lazyDraftQueue.addHandler(uiApiRecordHandler);
@@ -92691,7 +92873,7 @@
92691
92873
  id: '@salesforce/lds-network-adapter',
92692
92874
  instrument: instrument$2,
92693
92875
  });
92694
- // version: 1.331.0-fec0cd0317
92876
+ // version: 1.332.0-dev10-0d26f7dda1
92695
92877
 
92696
92878
  const { create: create$2, keys: keys$2 } = Object;
92697
92879
  const { stringify, parse } = JSON;
@@ -115258,7 +115440,7 @@
115258
115440
  configuration: { ...configurationForGraphQLAdapters$1 },
115259
115441
  instrument: instrument$1,
115260
115442
  });
115261
- // version: 1.331.0-e9c482e8ab
115443
+ // version: 1.332.0-dev10-d8601dd102
115262
115444
 
115263
115445
  // On core the unstable adapters are re-exported with different names,
115264
115446
  // we want to match them here.
@@ -115410,7 +115592,7 @@
115410
115592
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
115411
115593
  graphQLImperative = ldsAdapter;
115412
115594
  });
115413
- // version: 1.331.0-e9c482e8ab
115595
+ // version: 1.332.0-dev10-d8601dd102
115414
115596
 
115415
115597
  var gqlApi = /*#__PURE__*/Object.freeze({
115416
115598
  __proto__: null,
@@ -115823,7 +116005,16 @@
115823
116005
  return;
115824
116006
  }
115825
116007
  if (adapterId === 'deleteRecord') {
115826
- invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResponse, nativeAdapterRequestContext);
116008
+ draftManager.stopQueueWhileRunning(() => {
116009
+ return new Promise((resolve) => {
116010
+ const onResponseWrapper = (response) => {
116011
+ resolve(response);
116012
+ };
116013
+ invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResponseWrapper, nativeAdapterRequestContext);
116014
+ }).then((callbackValue) => {
116015
+ onResponse(callbackValue);
116016
+ });
116017
+ });
115827
116018
  }
115828
116019
  else {
115829
116020
  draftManager.stopQueueWhileRunning(() => {
@@ -115971,9 +116162,7 @@
115971
116162
  ...responseValue.data.drafts,
115972
116163
  draftActionIds: responseValue.data.drafts.draftActionIds.filter((x) => x !== targetDraftId),
115973
116164
  };
115974
- return Object.assign(responseValue, {
115975
- data: { drafts: recordDraftsNode },
115976
- });
116165
+ return { ...responseValue, data: { ...responseValue.data, drafts: recordDraftsNode } };
115977
116166
  }
115978
116167
  function convertErrorIntoNativeFetchError(error, defaultMessage) {
115979
116168
  let message = defaultMessage;
@@ -116195,7 +116384,7 @@
116195
116384
  function register(r) {
116196
116385
  callbacks$1.forEach((callback) => callback(r));
116197
116386
  }
116198
- // version: 1.331.0-fec0cd0317
116387
+ // version: 1.332.0-dev10-0d26f7dda1
116199
116388
 
116200
116389
  /**
116201
116390
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -117277,4 +117466,4 @@
117277
117466
  exports.subscribeToAdapter = subscribeToAdapter;
117278
117467
 
117279
117468
  }));
117280
- // version: 1.331.0-fec0cd0317
117469
+ // version: 1.332.0-dev10-0d26f7dda1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.331.0",
3
+ "version": "1.332.0-dev10",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,14 +35,14 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.331.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.331.0",
40
- "@salesforce/lds-default-luvio": "^1.331.0",
41
- "@salesforce/lds-drafts": "^1.331.0",
42
- "@salesforce/lds-graphql-parser": "^1.331.0",
43
- "@salesforce/lds-luvio-engine": "^1.331.0",
44
- "@salesforce/lds-runtime-mobile": "^1.331.0",
45
- "@salesforce/nimbus-plugin-lds": "^1.331.0",
38
+ "@salesforce/lds-adapters-graphql": "^1.332.0-dev10",
39
+ "@salesforce/lds-adapters-uiapi": "^1.332.0-dev10",
40
+ "@salesforce/lds-default-luvio": "^1.332.0-dev10",
41
+ "@salesforce/lds-drafts": "^1.332.0-dev10",
42
+ "@salesforce/lds-graphql-parser": "^1.332.0-dev10",
43
+ "@salesforce/lds-luvio-engine": "^1.332.0-dev10",
44
+ "@salesforce/lds-runtime-mobile": "^1.332.0-dev10",
45
+ "@salesforce/nimbus-plugin-lds": "^1.332.0-dev10",
46
46
  "ajv": "^8.11.0",
47
47
  "glob": "^7.1.5",
48
48
  "nimbus-types": "^2.0.0-alpha1",