@salesforce/lds-worker-api 1.242.0 → 1.243.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3905,7 +3905,7 @@
3905
3905
  }
3906
3906
  return resourceParams;
3907
3907
  }
3908
- // engine version: 0.150.1-6f3c0558
3908
+ // engine version: 0.150.2-5dcb5d26
3909
3909
 
3910
3910
  /**
3911
3911
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4033,7 +4033,7 @@
4033
4033
  }
4034
4034
  callbacks.push(callback);
4035
4035
  }
4036
- // version: 1.242.0-57237c3b6
4036
+ // version: 1.243.0-87f38263e
4037
4037
 
4038
4038
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4039
4039
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15494,7 +15494,7 @@
15494
15494
  }
15495
15495
  return superResult;
15496
15496
  }
15497
- // version: 1.242.0-57237c3b6
15497
+ // version: 1.243.0-87f38263e
15498
15498
 
15499
15499
  function unwrap(data) {
15500
15500
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16419,7 +16419,7 @@
16419
16419
  const { apiFamily, name } = metadata;
16420
16420
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16421
16421
  }
16422
- // version: 1.242.0-57237c3b6
16422
+ // version: 1.243.0-87f38263e
16423
16423
 
16424
16424
  /**
16425
16425
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16518,7 +16518,7 @@
16518
16518
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16519
16519
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16520
16520
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16521
- // engine version: 0.150.1-6f3c0558
16521
+ // engine version: 0.150.2-5dcb5d26
16522
16522
 
16523
16523
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16524
16524
 
@@ -17106,60 +17106,11 @@
17106
17106
  entry['__metadata'] = createLink$3(metadataKey);
17107
17107
  }
17108
17108
 
17109
- const VERSION$1m = "275ae22194003d1e53f548b81219c5cb";
17110
- function validate$1K(obj, path = 'ListColumnRepresentation') {
17111
- const v_error = (() => {
17112
- if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
17113
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
17114
- }
17115
- const obj_fieldApiName = obj.fieldApiName;
17116
- const path_fieldApiName = path + '.fieldApiName';
17117
- if (typeof obj_fieldApiName !== 'string') {
17118
- return new TypeError('Expected "string" but received "' + typeof obj_fieldApiName + '" (at "' + path_fieldApiName + '")');
17119
- }
17120
- const obj_label = obj.label;
17121
- const path_label = path + '.label';
17122
- if (typeof obj_label !== 'string') {
17123
- return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
17124
- }
17125
- const obj_lookupId = obj.lookupId;
17126
- const path_lookupId = path + '.lookupId';
17127
- let obj_lookupId_union0 = null;
17128
- const obj_lookupId_union0_error = (() => {
17129
- if (typeof obj_lookupId !== 'string') {
17130
- return new TypeError('Expected "string" but received "' + typeof obj_lookupId + '" (at "' + path_lookupId + '")');
17131
- }
17132
- })();
17133
- if (obj_lookupId_union0_error != null) {
17134
- obj_lookupId_union0 = obj_lookupId_union0_error.message;
17135
- }
17136
- let obj_lookupId_union1 = null;
17137
- const obj_lookupId_union1_error = (() => {
17138
- if (obj_lookupId !== null) {
17139
- return new TypeError('Expected "null" but received "' + typeof obj_lookupId + '" (at "' + path_lookupId + '")');
17140
- }
17141
- })();
17142
- if (obj_lookupId_union1_error != null) {
17143
- obj_lookupId_union1 = obj_lookupId_union1_error.message;
17144
- }
17145
- if (obj_lookupId_union0 && obj_lookupId_union1) {
17146
- let message = 'Object doesn\'t match union (at "' + path_lookupId + '")';
17147
- message += '\n' + obj_lookupId_union0.split('\n').map((line) => '\t' + line).join('\n');
17148
- message += '\n' + obj_lookupId_union1.split('\n').map((line) => '\t' + line).join('\n');
17149
- return new TypeError(message);
17150
- }
17151
- const obj_sortable = obj.sortable;
17152
- const path_sortable = path + '.sortable';
17153
- if (typeof obj_sortable !== 'boolean') {
17154
- return new TypeError('Expected "boolean" but received "' + typeof obj_sortable + '" (at "' + path_sortable + '")');
17155
- }
17156
- })();
17157
- return v_error === undefined ? null : v_error;
17158
- }
17159
- const select$1U = function ListColumnRepresentationSelect() {
17109
+ const VERSION$1o = "275ae22194003d1e53f548b81219c5cb";
17110
+ const select$1W$1 = function ListColumnRepresentationSelect() {
17160
17111
  return {
17161
17112
  kind: 'Fragment',
17162
- version: VERSION$1m,
17113
+ version: VERSION$1o,
17163
17114
  private: [],
17164
17115
  selections: [
17165
17116
  {
@@ -17182,46 +17133,11 @@
17182
17133
  };
17183
17134
  };
17184
17135
 
17185
- const VERSION$1l = "623aa9ce3a11031e35faf5671a41746e";
17186
- function validate$1J(obj, path = 'ListFilterByInfoRepresentation') {
17187
- const v_error = (() => {
17188
- if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
17189
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
17190
- }
17191
- const obj_fieldApiName = obj.fieldApiName;
17192
- const path_fieldApiName = path + '.fieldApiName';
17193
- if (typeof obj_fieldApiName !== 'string') {
17194
- return new TypeError('Expected "string" but received "' + typeof obj_fieldApiName + '" (at "' + path_fieldApiName + '")');
17195
- }
17196
- const obj_label = obj.label;
17197
- const path_label = path + '.label';
17198
- if (typeof obj_label !== 'string') {
17199
- return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
17200
- }
17201
- const obj_operandLabels = obj.operandLabels;
17202
- const path_operandLabels = path + '.operandLabels';
17203
- if (!ArrayIsArray$2(obj_operandLabels)) {
17204
- return new TypeError('Expected "array" but received "' + typeof obj_operandLabels + '" (at "' + path_operandLabels + '")');
17205
- }
17206
- for (let i = 0; i < obj_operandLabels.length; i++) {
17207
- const obj_operandLabels_item = obj_operandLabels[i];
17208
- const path_operandLabels_item = path_operandLabels + '[' + i + ']';
17209
- if (typeof obj_operandLabels_item !== 'string') {
17210
- return new TypeError('Expected "string" but received "' + typeof obj_operandLabels_item + '" (at "' + path_operandLabels_item + '")');
17211
- }
17212
- }
17213
- const obj_operator = obj.operator;
17214
- const path_operator = path + '.operator';
17215
- if (typeof obj_operator !== 'string') {
17216
- return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
17217
- }
17218
- })();
17219
- return v_error === undefined ? null : v_error;
17220
- }
17221
- const select$1T = function ListFilterByInfoRepresentationSelect() {
17136
+ const VERSION$1n = "623aa9ce3a11031e35faf5671a41746e";
17137
+ const select$1V = function ListFilterByInfoRepresentationSelect() {
17222
17138
  return {
17223
17139
  kind: 'Fragment',
17224
- version: VERSION$1l,
17140
+ version: VERSION$1n,
17225
17141
  private: [],
17226
17142
  selections: [
17227
17143
  {
@@ -17245,11 +17161,11 @@
17245
17161
  };
17246
17162
  };
17247
17163
 
17248
- const VERSION$1k = "76042ff4af603b2ac0ec69fa0bd12046";
17249
- const select$1S = function ListReferenceRepresentationSelect() {
17164
+ const VERSION$1m = "76042ff4af603b2ac0ec69fa0bd12046";
17165
+ const select$1U = function ListReferenceRepresentationSelect() {
17250
17166
  return {
17251
17167
  kind: 'Fragment',
17252
- version: VERSION$1k,
17168
+ version: VERSION$1m,
17253
17169
  private: [],
17254
17170
  selections: [
17255
17171
  {
@@ -17295,6 +17211,47 @@
17295
17211
  return true;
17296
17212
  }
17297
17213
 
17214
+ const VERSION$1l = "494e0262f07ff2cc5f82d1e0262fec4f";
17215
+ const select$1T = function ListInfoShareRepresentationSelect() {
17216
+ return {
17217
+ kind: 'Fragment',
17218
+ version: VERSION$1l,
17219
+ private: [],
17220
+ selections: [
17221
+ {
17222
+ name: 'groupApiName',
17223
+ kind: 'Scalar'
17224
+ },
17225
+ {
17226
+ name: 'label',
17227
+ kind: 'Scalar'
17228
+ }
17229
+ ]
17230
+ };
17231
+ };
17232
+
17233
+ const VERSION$1k = "561657f32721ec1dac1601575b029640";
17234
+ const select$1S = function ListInfoShareCategoryRepresentationSelect() {
17235
+ const { selections: ListInfoShareRepresentation__selections, opaque: ListInfoShareRepresentation__opaque, } = select$1T();
17236
+ return {
17237
+ kind: 'Fragment',
17238
+ version: VERSION$1k,
17239
+ private: [],
17240
+ selections: [
17241
+ {
17242
+ name: 'shareType',
17243
+ kind: 'Scalar'
17244
+ },
17245
+ {
17246
+ name: 'shares',
17247
+ kind: 'Object',
17248
+ plural: true,
17249
+ selections: ListInfoShareRepresentation__selections
17250
+ }
17251
+ ]
17252
+ };
17253
+ };
17254
+
17298
17255
  const VERSION$1j = "32def9b631252c12b91a8209c1f49f5a";
17299
17256
  const select$1R = function ListOrderByInfoRepresentationSelect() {
17300
17257
  return {
@@ -17319,24 +17276,6 @@
17319
17276
  };
17320
17277
 
17321
17278
  const VERSION$1i = "2634258f216db34315c06d759a35676d";
17322
- function validate$1G(obj, path = 'ListScopeEntityRepresentation') {
17323
- const v_error = (() => {
17324
- if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
17325
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
17326
- }
17327
- const obj_id = obj.id;
17328
- const path_id = path + '.id';
17329
- if (typeof obj_id !== 'string') {
17330
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
17331
- }
17332
- const obj_label = obj.label;
17333
- const path_label = path + '.label';
17334
- if (typeof obj_label !== 'string') {
17335
- return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
17336
- }
17337
- })();
17338
- return v_error === undefined ? null : v_error;
17339
- }
17340
17279
  const select$1Q = function ListScopeEntityRepresentationSelect() {
17341
17280
  return {
17342
17281
  kind: 'Fragment',
@@ -17356,29 +17295,6 @@
17356
17295
  };
17357
17296
 
17358
17297
  const VERSION$1h = "3b85c5a08d50ce328481b9f8ab56127b";
17359
- function validate$1F(obj, path = 'ListScopeRelatedEntityRepresentation') {
17360
- const v_error = (() => {
17361
- if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
17362
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
17363
- }
17364
- const obj_id = obj.id;
17365
- const path_id = path + '.id';
17366
- if (typeof obj_id !== 'string') {
17367
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
17368
- }
17369
- const obj_label = obj.label;
17370
- const path_label = path + '.label';
17371
- if (typeof obj_label !== 'string') {
17372
- return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
17373
- }
17374
- const obj_type = obj.type;
17375
- const path_type = path + '.type';
17376
- if (typeof obj_type !== 'string') {
17377
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
17378
- }
17379
- })();
17380
- return v_error === undefined ? null : v_error;
17381
- }
17382
17298
  const select$1P = function ListScopeRelatedEntityRepresentationSelect() {
17383
17299
  return {
17384
17300
  kind: 'Fragment',
@@ -17401,83 +17317,7 @@
17401
17317
  };
17402
17318
  };
17403
17319
 
17404
- const VERSION$1g = "a51de242c746e5500a833e84dfaa2170";
17405
- function validate$1E(obj, path = 'ListScopeRepresentation') {
17406
- const v_error = (() => {
17407
- if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
17408
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
17409
- }
17410
- const obj_apiName = obj.apiName;
17411
- const path_apiName = path + '.apiName';
17412
- if (typeof obj_apiName !== 'string') {
17413
- return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
17414
- }
17415
- const obj_entity = obj.entity;
17416
- const path_entity = path + '.entity';
17417
- let obj_entity_union0 = null;
17418
- const obj_entity_union0_error = (() => {
17419
- const referencepath_entityValidationError = validate$1G(obj_entity, path_entity);
17420
- if (referencepath_entityValidationError !== null) {
17421
- let message = 'Object doesn\'t match ListScopeEntityRepresentation (at "' + path_entity + '")\n';
17422
- message += referencepath_entityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
17423
- return new TypeError(message);
17424
- }
17425
- })();
17426
- if (obj_entity_union0_error != null) {
17427
- obj_entity_union0 = obj_entity_union0_error.message;
17428
- }
17429
- let obj_entity_union1 = null;
17430
- const obj_entity_union1_error = (() => {
17431
- if (obj_entity !== null) {
17432
- return new TypeError('Expected "null" but received "' + typeof obj_entity + '" (at "' + path_entity + '")');
17433
- }
17434
- })();
17435
- if (obj_entity_union1_error != null) {
17436
- obj_entity_union1 = obj_entity_union1_error.message;
17437
- }
17438
- if (obj_entity_union0 && obj_entity_union1) {
17439
- let message = 'Object doesn\'t match union (at "' + path_entity + '")';
17440
- message += '\n' + obj_entity_union0.split('\n').map((line) => '\t' + line).join('\n');
17441
- message += '\n' + obj_entity_union1.split('\n').map((line) => '\t' + line).join('\n');
17442
- return new TypeError(message);
17443
- }
17444
- const obj_label = obj.label;
17445
- const path_label = path + '.label';
17446
- if (typeof obj_label !== 'string') {
17447
- return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
17448
- }
17449
- const obj_relatedEntity = obj.relatedEntity;
17450
- const path_relatedEntity = path + '.relatedEntity';
17451
- let obj_relatedEntity_union0 = null;
17452
- const obj_relatedEntity_union0_error = (() => {
17453
- const referencepath_relatedEntityValidationError = validate$1F(obj_relatedEntity, path_relatedEntity);
17454
- if (referencepath_relatedEntityValidationError !== null) {
17455
- let message = 'Object doesn\'t match ListScopeRelatedEntityRepresentation (at "' + path_relatedEntity + '")\n';
17456
- message += referencepath_relatedEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
17457
- return new TypeError(message);
17458
- }
17459
- })();
17460
- if (obj_relatedEntity_union0_error != null) {
17461
- obj_relatedEntity_union0 = obj_relatedEntity_union0_error.message;
17462
- }
17463
- let obj_relatedEntity_union1 = null;
17464
- const obj_relatedEntity_union1_error = (() => {
17465
- if (obj_relatedEntity !== null) {
17466
- return new TypeError('Expected "null" but received "' + typeof obj_relatedEntity + '" (at "' + path_relatedEntity + '")');
17467
- }
17468
- })();
17469
- if (obj_relatedEntity_union1_error != null) {
17470
- obj_relatedEntity_union1 = obj_relatedEntity_union1_error.message;
17471
- }
17472
- if (obj_relatedEntity_union0 && obj_relatedEntity_union1) {
17473
- let message = 'Object doesn\'t match union (at "' + path_relatedEntity + '")';
17474
- message += '\n' + obj_relatedEntity_union0.split('\n').map((line) => '\t' + line).join('\n');
17475
- message += '\n' + obj_relatedEntity_union1.split('\n').map((line) => '\t' + line).join('\n');
17476
- return new TypeError(message);
17477
- }
17478
- })();
17479
- return v_error === undefined ? null : v_error;
17480
- }
17320
+ const VERSION$1g = "2fe9814e7124b47f59da585483c1b3f9";
17481
17321
  const select$1O = function ListScopeRepresentationSelect() {
17482
17322
  const { selections: ListScopeEntityRepresentation__selections, opaque: ListScopeEntityRepresentation__opaque, } = select$1Q();
17483
17323
  const { selections: ListScopeRelatedEntityRepresentation__selections, opaque: ListScopeRelatedEntityRepresentation__opaque, } = select$1P();
@@ -17532,7 +17372,7 @@
17532
17372
  };
17533
17373
 
17534
17374
  const TTL$y = 900000;
17535
- const VERSION$1e = "8b55d621d80c84ec2e331abc4e12fc56";
17375
+ const VERSION$1e = "0dbff3feaaa7ced2709e9ae46c58a3e7";
17536
17376
  const RepresentationType$R = 'ListInfoRepresentation';
17537
17377
  function keyBuilder$1V(luvio, config) {
17538
17378
  return keyPrefix$1 + '::' + RepresentationType$R + ':' + (config.listViewApiName === null ? '' : config.listViewApiName) + ':' + config.objectApiName + ':' + config.type;
@@ -17549,9 +17389,10 @@
17549
17389
  return input;
17550
17390
  }
17551
17391
  const select$1M = function ListInfoRepresentationSelect() {
17552
- const { selections: ListColumnRepresentation__selections, opaque: ListColumnRepresentation__opaque, } = select$1U();
17553
- const { selections: ListFilterByInfoRepresentation__selections, opaque: ListFilterByInfoRepresentation__opaque, } = select$1T();
17554
- const { selections: ListReferenceRepresentation__selections, opaque: ListReferenceRepresentation__opaque, } = select$1S();
17392
+ const { selections: ListColumnRepresentation__selections, opaque: ListColumnRepresentation__opaque, } = select$1W$1();
17393
+ const { selections: ListFilterByInfoRepresentation__selections, opaque: ListFilterByInfoRepresentation__opaque, } = select$1V();
17394
+ const { selections: ListReferenceRepresentation__selections, opaque: ListReferenceRepresentation__opaque, } = select$1U();
17395
+ const { selections: ListInfoShareCategoryRepresentation__selections, opaque: ListInfoShareCategoryRepresentation__opaque, } = select$1S();
17555
17396
  const { selections: ListOrderByInfoRepresentation__selections, opaque: ListOrderByInfoRepresentation__opaque, } = select$1R();
17556
17397
  const { selections: ListScopeRepresentation__selections, opaque: ListScopeRepresentation__opaque, } = select$1O();
17557
17398
  const { selections: ListUserPreferenceRepresentation__selections, opaque: ListUserPreferenceRepresentation__opaque, } = select$1N();
@@ -17599,6 +17440,13 @@
17599
17440
  kind: 'Object',
17600
17441
  selections: ListReferenceRepresentation__selections
17601
17442
  },
17443
+ {
17444
+ name: 'listShares',
17445
+ kind: 'Object',
17446
+ plural: true,
17447
+ selections: ListInfoShareCategoryRepresentation__selections,
17448
+ required: false
17449
+ },
17602
17450
  {
17603
17451
  name: 'objectApiNames',
17604
17452
  kind: 'Scalar',
@@ -20511,6 +20359,7 @@
20511
20359
  const createRecordIngest = (fieldsTrie, optionalFieldsTrie, recordConflictMap) => {
20512
20360
  const childNormalize = createChildRecordNormalize(fieldsTrie, optionalFieldsTrie, recordConflictMap);
20513
20361
  return (input, path, luvio, store, timestamp) => {
20362
+ input.eTag = ''; //[W-13724550] Record Reps ALWAYS have '' etag, to be consistent with GraphQL, as it is not queryable via GraphQL.
20514
20363
  const key = keyBuilderFromType$z(luvio, input);
20515
20364
  let existingRecord = store.readEntry(key);
20516
20365
  const recordPath = {
@@ -21212,6 +21061,7 @@
21212
21061
 
21213
21062
  const createIngestRecordWithFields = (fields, optionalFields) => {
21214
21063
  return (input, path, luvio, store, timestamp) => {
21064
+ input.eTag = ''; //[W-13724550] Record Reps ALWAYS have '' etag, to be consistent with GraphQL, as it is not queryable via GraphQL.
21215
21065
  const conflictMap = {
21216
21066
  conflicts: {},
21217
21067
  serverRequestCount: 0,
@@ -21364,7 +21214,7 @@
21364
21214
  return input;
21365
21215
  }
21366
21216
  const select$1H = function ListRecordCollectionRepresentationSelect(paginationParams) {
21367
- const { selections: ListReferenceRepresentation__selections, opaque: ListReferenceRepresentation__opaque, } = select$1S();
21217
+ const { selections: ListReferenceRepresentation__selections, opaque: ListReferenceRepresentation__opaque, } = select$1U();
21368
21218
  return {
21369
21219
  kind: 'Fragment',
21370
21220
  reader: true,
@@ -21478,7 +21328,7 @@
21478
21328
  kind: 'Link',
21479
21329
  fragment: select$1I()
21480
21330
  } : params.records;
21481
- const { selections: ListReferenceRepresentation__selections, opaque: ListReferenceRepresentation__opaque, } = select$1S();
21331
+ const { selections: ListReferenceRepresentation__selections, opaque: ListReferenceRepresentation__opaque, } = select$1U();
21482
21332
  return {
21483
21333
  kind: 'Fragment',
21484
21334
  reader: true,
@@ -27380,7 +27230,7 @@
27380
27230
  buildCachedSnapshotCachePolicy$B, buildNetworkSnapshotCachePolicy$B);
27381
27231
  };
27382
27232
 
27383
- function validate$17(obj, path = 'ActionRelatedListSingleBatchInputRepresentation') {
27233
+ function validate$19(obj, path = 'ActionRelatedListSingleBatchInputRepresentation') {
27384
27234
  const v_error = (() => {
27385
27235
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
27386
27236
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -27791,7 +27641,7 @@
27791
27641
  const untrustedConfig_relatedListsActionParameters_array = [];
27792
27642
  for (let i = 0, arrayLength = untrustedConfig_relatedListsActionParameters.length; i < arrayLength; i++) {
27793
27643
  const untrustedConfig_relatedListsActionParameters_item = untrustedConfig_relatedListsActionParameters[i];
27794
- const referenceActionRelatedListSingleBatchInputRepresentationValidationError = validate$17(untrustedConfig_relatedListsActionParameters_item);
27644
+ const referenceActionRelatedListSingleBatchInputRepresentationValidationError = validate$19(untrustedConfig_relatedListsActionParameters_item);
27795
27645
  if (referenceActionRelatedListSingleBatchInputRepresentationValidationError === null) {
27796
27646
  untrustedConfig_relatedListsActionParameters_array.push(untrustedConfig_relatedListsActionParameters_item);
27797
27647
  }
@@ -30030,6 +29880,103 @@
30030
29880
  buildCachedSnapshotCachePolicy$s, buildNetworkSnapshotCachePolicy$s);
30031
29881
  };
30032
29882
 
29883
+ function validate$$(obj, path = 'ListFilterByInfoInputRepresentation') {
29884
+ const v_error = (() => {
29885
+ if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
29886
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
29887
+ }
29888
+ const obj_fieldApiName = obj.fieldApiName;
29889
+ const path_fieldApiName = path + '.fieldApiName';
29890
+ if (typeof obj_fieldApiName !== 'string') {
29891
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldApiName + '" (at "' + path_fieldApiName + '")');
29892
+ }
29893
+ const obj_operandLabels = obj.operandLabels;
29894
+ const path_operandLabels = path + '.operandLabels';
29895
+ if (!ArrayIsArray$2(obj_operandLabels)) {
29896
+ return new TypeError('Expected "array" but received "' + typeof obj_operandLabels + '" (at "' + path_operandLabels + '")');
29897
+ }
29898
+ for (let i = 0; i < obj_operandLabels.length; i++) {
29899
+ const obj_operandLabels_item = obj_operandLabels[i];
29900
+ const path_operandLabels_item = path_operandLabels + '[' + i + ']';
29901
+ if (typeof obj_operandLabels_item !== 'string') {
29902
+ return new TypeError('Expected "string" but received "' + typeof obj_operandLabels_item + '" (at "' + path_operandLabels_item + '")');
29903
+ }
29904
+ }
29905
+ const obj_operator = obj.operator;
29906
+ const path_operator = path + '.operator';
29907
+ if (typeof obj_operator !== 'string') {
29908
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
29909
+ }
29910
+ })();
29911
+ return v_error === undefined ? null : v_error;
29912
+ }
29913
+
29914
+ function validate$_(obj, path = 'ListScopeInputRepresentation') {
29915
+ const v_error = (() => {
29916
+ if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
29917
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
29918
+ }
29919
+ const obj_apiName = obj.apiName;
29920
+ const path_apiName = path + '.apiName';
29921
+ if (typeof obj_apiName !== 'string') {
29922
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
29923
+ }
29924
+ const obj_entityId = obj.entityId;
29925
+ const path_entityId = path + '.entityId';
29926
+ let obj_entityId_union0 = null;
29927
+ const obj_entityId_union0_error = (() => {
29928
+ if (typeof obj_entityId !== 'string') {
29929
+ return new TypeError('Expected "string" but received "' + typeof obj_entityId + '" (at "' + path_entityId + '")');
29930
+ }
29931
+ })();
29932
+ if (obj_entityId_union0_error != null) {
29933
+ obj_entityId_union0 = obj_entityId_union0_error.message;
29934
+ }
29935
+ let obj_entityId_union1 = null;
29936
+ const obj_entityId_union1_error = (() => {
29937
+ if (obj_entityId !== null) {
29938
+ return new TypeError('Expected "null" but received "' + typeof obj_entityId + '" (at "' + path_entityId + '")');
29939
+ }
29940
+ })();
29941
+ if (obj_entityId_union1_error != null) {
29942
+ obj_entityId_union1 = obj_entityId_union1_error.message;
29943
+ }
29944
+ if (obj_entityId_union0 && obj_entityId_union1) {
29945
+ let message = 'Object doesn\'t match union (at "' + path_entityId + '")';
29946
+ message += '\n' + obj_entityId_union0.split('\n').map((line) => '\t' + line).join('\n');
29947
+ message += '\n' + obj_entityId_union1.split('\n').map((line) => '\t' + line).join('\n');
29948
+ return new TypeError(message);
29949
+ }
29950
+ const obj_relatedEntityId = obj.relatedEntityId;
29951
+ const path_relatedEntityId = path + '.relatedEntityId';
29952
+ let obj_relatedEntityId_union0 = null;
29953
+ const obj_relatedEntityId_union0_error = (() => {
29954
+ if (typeof obj_relatedEntityId !== 'string') {
29955
+ return new TypeError('Expected "string" but received "' + typeof obj_relatedEntityId + '" (at "' + path_relatedEntityId + '")');
29956
+ }
29957
+ })();
29958
+ if (obj_relatedEntityId_union0_error != null) {
29959
+ obj_relatedEntityId_union0 = obj_relatedEntityId_union0_error.message;
29960
+ }
29961
+ let obj_relatedEntityId_union1 = null;
29962
+ const obj_relatedEntityId_union1_error = (() => {
29963
+ if (obj_relatedEntityId !== null) {
29964
+ return new TypeError('Expected "null" but received "' + typeof obj_relatedEntityId + '" (at "' + path_relatedEntityId + '")');
29965
+ }
29966
+ })();
29967
+ if (obj_relatedEntityId_union1_error != null) {
29968
+ obj_relatedEntityId_union1 = obj_relatedEntityId_union1_error.message;
29969
+ }
29970
+ if (obj_relatedEntityId_union0 && obj_relatedEntityId_union1) {
29971
+ let message = 'Object doesn\'t match union (at "' + path_relatedEntityId + '")';
29972
+ message += '\n' + obj_relatedEntityId_union0.split('\n').map((line) => '\t' + line).join('\n');
29973
+ message += '\n' + obj_relatedEntityId_union1.split('\n').map((line) => '\t' + line).join('\n');
29974
+ return new TypeError(message);
29975
+ }
29976
+ })();
29977
+ return v_error === undefined ? null : v_error;
29978
+ }
29979
+
30033
29980
  function select$14$1(luvio, params) {
30034
29981
  return select$1M();
30035
29982
  }
@@ -30065,10 +30012,11 @@
30065
30012
  const adapterName$A = 'createListInfo';
30066
30013
  const createListInfo_ConfigPropertyMetadata = [
30067
30014
  generateParamConfigMetadata$2('objectApiName', true, 0 /* UrlParameter */, 0 /* String */, false, getObjectApiName$1$1),
30068
- generateParamConfigMetadata$2('displayColumns', false, 2 /* Body */, 4 /* Unsupported */, true),
30069
- generateParamConfigMetadata$2('filterLogicString', false, 2 /* Body */, 4 /* Unsupported */),
30015
+ generateParamConfigMetadata$2('displayColumns', false, 2 /* Body */, 0 /* String */, true),
30016
+ generateParamConfigMetadata$2('filterLogicString', false, 2 /* Body */, 0 /* String */),
30070
30017
  generateParamConfigMetadata$2('filteredByInfo', false, 2 /* Body */, 4 /* Unsupported */, true),
30071
30018
  generateParamConfigMetadata$2('label', false, 2 /* Body */, 0 /* String */),
30019
+ generateParamConfigMetadata$2('listShares', false, 2 /* Body */, 0 /* String */, true),
30072
30020
  generateParamConfigMetadata$2('listViewApiName', false, 2 /* Body */, 0 /* String */),
30073
30021
  generateParamConfigMetadata$2('scope', false, 2 /* Body */, 4 /* Unsupported */),
30074
30022
  generateParamConfigMetadata$2('visibility', false, 2 /* Body */, 0 /* String */),
@@ -30078,46 +30026,21 @@
30078
30026
  function typeCheckConfig$E(untrustedConfig) {
30079
30027
  const config = {};
30080
30028
  typeCheckConfig$12(untrustedConfig, config, createListInfo_ConfigPropertyMetadata);
30081
- const untrustedConfig_displayColumns = untrustedConfig.displayColumns;
30082
- if (ArrayIsArray$1(untrustedConfig_displayColumns)) {
30083
- const untrustedConfig_displayColumns_array = [];
30084
- for (let i = 0, arrayLength = untrustedConfig_displayColumns.length; i < arrayLength; i++) {
30085
- const untrustedConfig_displayColumns_item = untrustedConfig_displayColumns[i];
30086
- const referenceListColumnRepresentationValidationError = validate$1K(untrustedConfig_displayColumns_item);
30087
- if (referenceListColumnRepresentationValidationError === null) {
30088
- untrustedConfig_displayColumns_array.push(untrustedConfig_displayColumns_item);
30089
- }
30090
- if (untrustedConfig_displayColumns_item === null) {
30091
- untrustedConfig_displayColumns_array.push(untrustedConfig_displayColumns_item);
30092
- }
30093
- }
30094
- config.displayColumns = untrustedConfig_displayColumns_array;
30095
- }
30096
- const untrustedConfig_filterLogicString = untrustedConfig.filterLogicString;
30097
- if (typeof untrustedConfig_filterLogicString === 'string') {
30098
- config.filterLogicString = untrustedConfig_filterLogicString;
30099
- }
30100
- if (untrustedConfig_filterLogicString === null) {
30101
- config.filterLogicString = untrustedConfig_filterLogicString;
30102
- }
30103
30029
  const untrustedConfig_filteredByInfo = untrustedConfig.filteredByInfo;
30104
30030
  if (ArrayIsArray$1(untrustedConfig_filteredByInfo)) {
30105
30031
  const untrustedConfig_filteredByInfo_array = [];
30106
30032
  for (let i = 0, arrayLength = untrustedConfig_filteredByInfo.length; i < arrayLength; i++) {
30107
30033
  const untrustedConfig_filteredByInfo_item = untrustedConfig_filteredByInfo[i];
30108
- const referenceListFilterByInfoRepresentationValidationError = validate$1J(untrustedConfig_filteredByInfo_item);
30109
- if (referenceListFilterByInfoRepresentationValidationError === null) {
30034
+ const referenceListFilterByInfoInputRepresentationValidationError = validate$$(untrustedConfig_filteredByInfo_item);
30035
+ if (referenceListFilterByInfoInputRepresentationValidationError === null) {
30110
30036
  untrustedConfig_filteredByInfo_array.push(untrustedConfig_filteredByInfo_item);
30111
30037
  }
30112
30038
  }
30113
30039
  config.filteredByInfo = untrustedConfig_filteredByInfo_array;
30114
30040
  }
30115
30041
  const untrustedConfig_scope = untrustedConfig.scope;
30116
- const referenceListScopeRepresentationValidationError = validate$1E(untrustedConfig_scope);
30117
- if (referenceListScopeRepresentationValidationError === null) {
30118
- config.scope = untrustedConfig_scope;
30119
- }
30120
- if (untrustedConfig_scope === null) {
30042
+ const referenceListScopeInputRepresentationValidationError = validate$_(untrustedConfig_scope);
30043
+ if (referenceListScopeInputRepresentationValidationError === null) {
30121
30044
  config.scope = untrustedConfig_scope;
30122
30045
  }
30123
30046
  return config;
@@ -30282,10 +30205,11 @@
30282
30205
  const updateListInfoByName_ConfigPropertyMetadata = [
30283
30206
  generateParamConfigMetadata$2('listViewApiName', true, 0 /* UrlParameter */, 0 /* String */),
30284
30207
  generateParamConfigMetadata$2('objectApiName', true, 0 /* UrlParameter */, 0 /* String */, false, getObjectApiName$1$1),
30285
- generateParamConfigMetadata$2('displayColumns', false, 2 /* Body */, 4 /* Unsupported */, true),
30286
- generateParamConfigMetadata$2('filterLogicString', false, 2 /* Body */, 4 /* Unsupported */),
30208
+ generateParamConfigMetadata$2('displayColumns', false, 2 /* Body */, 0 /* String */, true),
30209
+ generateParamConfigMetadata$2('filterLogicString', false, 2 /* Body */, 0 /* String */),
30287
30210
  generateParamConfigMetadata$2('filteredByInfo', false, 2 /* Body */, 4 /* Unsupported */, true),
30288
30211
  generateParamConfigMetadata$2('label', false, 2 /* Body */, 0 /* String */),
30212
+ generateParamConfigMetadata$2('listShares', false, 2 /* Body */, 0 /* String */, true),
30289
30213
  generateParamConfigMetadata$2('scope', false, 2 /* Body */, 4 /* Unsupported */),
30290
30214
  generateParamConfigMetadata$2('visibility', false, 2 /* Body */, 0 /* String */),
30291
30215
  ];
@@ -30294,46 +30218,21 @@
30294
30218
  function typeCheckConfig$C(untrustedConfig) {
30295
30219
  const config = {};
30296
30220
  typeCheckConfig$12(untrustedConfig, config, updateListInfoByName_ConfigPropertyMetadata);
30297
- const untrustedConfig_displayColumns = untrustedConfig.displayColumns;
30298
- if (ArrayIsArray$1(untrustedConfig_displayColumns)) {
30299
- const untrustedConfig_displayColumns_array = [];
30300
- for (let i = 0, arrayLength = untrustedConfig_displayColumns.length; i < arrayLength; i++) {
30301
- const untrustedConfig_displayColumns_item = untrustedConfig_displayColumns[i];
30302
- const referenceListColumnRepresentationValidationError = validate$1K(untrustedConfig_displayColumns_item);
30303
- if (referenceListColumnRepresentationValidationError === null) {
30304
- untrustedConfig_displayColumns_array.push(untrustedConfig_displayColumns_item);
30305
- }
30306
- if (untrustedConfig_displayColumns_item === null) {
30307
- untrustedConfig_displayColumns_array.push(untrustedConfig_displayColumns_item);
30308
- }
30309
- }
30310
- config.displayColumns = untrustedConfig_displayColumns_array;
30311
- }
30312
- const untrustedConfig_filterLogicString = untrustedConfig.filterLogicString;
30313
- if (typeof untrustedConfig_filterLogicString === 'string') {
30314
- config.filterLogicString = untrustedConfig_filterLogicString;
30315
- }
30316
- if (untrustedConfig_filterLogicString === null) {
30317
- config.filterLogicString = untrustedConfig_filterLogicString;
30318
- }
30319
30221
  const untrustedConfig_filteredByInfo = untrustedConfig.filteredByInfo;
30320
30222
  if (ArrayIsArray$1(untrustedConfig_filteredByInfo)) {
30321
30223
  const untrustedConfig_filteredByInfo_array = [];
30322
30224
  for (let i = 0, arrayLength = untrustedConfig_filteredByInfo.length; i < arrayLength; i++) {
30323
30225
  const untrustedConfig_filteredByInfo_item = untrustedConfig_filteredByInfo[i];
30324
- const referenceListFilterByInfoRepresentationValidationError = validate$1J(untrustedConfig_filteredByInfo_item);
30325
- if (referenceListFilterByInfoRepresentationValidationError === null) {
30226
+ const referenceListFilterByInfoInputRepresentationValidationError = validate$$(untrustedConfig_filteredByInfo_item);
30227
+ if (referenceListFilterByInfoInputRepresentationValidationError === null) {
30326
30228
  untrustedConfig_filteredByInfo_array.push(untrustedConfig_filteredByInfo_item);
30327
30229
  }
30328
30230
  }
30329
30231
  config.filteredByInfo = untrustedConfig_filteredByInfo_array;
30330
30232
  }
30331
30233
  const untrustedConfig_scope = untrustedConfig.scope;
30332
- const referenceListScopeRepresentationValidationError = validate$1E(untrustedConfig_scope);
30333
- if (referenceListScopeRepresentationValidationError === null) {
30334
- config.scope = untrustedConfig_scope;
30335
- }
30336
- if (untrustedConfig_scope === null) {
30234
+ const referenceListScopeInputRepresentationValidationError = validate$_(untrustedConfig_scope);
30235
+ if (referenceListScopeInputRepresentationValidationError === null) {
30337
30236
  config.scope = untrustedConfig_scope;
30338
30237
  }
30339
30238
  return config;
@@ -34823,16 +34722,6 @@
34823
34722
  };
34824
34723
  }
34825
34724
 
34826
- const adapterName$k = 'updateRelatedListInfo';
34827
- const updateRelatedListInfo_ConfigPropertyMetadata = [
34828
- generateParamConfigMetadata$2('parentObjectApiName', true, 0 /* UrlParameter */, 0 /* String */, false, getObjectApiName$1$1),
34829
- generateParamConfigMetadata$2('relatedListId', true, 0 /* UrlParameter */, 0 /* String */),
34830
- generateParamConfigMetadata$2('recordTypeId', false, 1 /* QueryParameter */, 0 /* String */),
34831
- generateParamConfigMetadata$2('orderedByInfo', true, 2 /* Body */, 4 /* Unsupported */, true),
34832
- generateParamConfigMetadata$2('userPreferences', true, 2 /* Body */, 4 /* Unsupported */),
34833
- ];
34834
- const updateRelatedListInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$k, updateRelatedListInfo_ConfigPropertyMetadata);
34835
- const createResourceParams$m = /*#__PURE__*/ createResourceParams$Z(updateRelatedListInfo_ConfigPropertyMetadata);
34836
34725
  function typeCheckConfig$o(untrustedConfig) {
34837
34726
  const config = {};
34838
34727
  typeCheckConfig$12(untrustedConfig, config, updateRelatedListInfo_ConfigPropertyMetadata);
@@ -34853,8 +34742,22 @@
34853
34742
  if (referenceListUserPreferenceInputRepresentationValidationError === null) {
34854
34743
  config.userPreferences = untrustedConfig_userPreferences;
34855
34744
  }
34745
+ else {
34746
+ throw referenceListUserPreferenceInputRepresentationValidationError;
34747
+ }
34856
34748
  return config;
34857
34749
  }
34750
+
34751
+ const adapterName$k = 'updateRelatedListInfo';
34752
+ const updateRelatedListInfo_ConfigPropertyMetadata = [
34753
+ generateParamConfigMetadata$2('parentObjectApiName', true, 0 /* UrlParameter */, 0 /* String */, false, getObjectApiName$1$1),
34754
+ generateParamConfigMetadata$2('relatedListId', true, 0 /* UrlParameter */, 0 /* String */),
34755
+ generateParamConfigMetadata$2('recordTypeId', false, 1 /* QueryParameter */, 0 /* String */),
34756
+ generateParamConfigMetadata$2('orderedByInfo', true, 2 /* Body */, 4 /* Unsupported */, true),
34757
+ generateParamConfigMetadata$2('userPreferences', true, 2 /* Body */, 4 /* Unsupported */),
34758
+ ];
34759
+ const updateRelatedListInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$k, updateRelatedListInfo_ConfigPropertyMetadata);
34760
+ const createResourceParams$m = /*#__PURE__*/ createResourceParams$Z(updateRelatedListInfo_ConfigPropertyMetadata);
34858
34761
  function validateAdapterConfig$n(untrustedConfig, configPropertyNames) {
34859
34762
  if (!untrustedIsObject$2(untrustedConfig)) {
34860
34763
  return null;
@@ -40822,7 +40725,7 @@
40822
40725
  };
40823
40726
  };
40824
40727
 
40825
- const VERSION$1n = "5f97eb4f2c3f805ef9d98ba7f0530b3e";
40728
+ const VERSION$1p = "5f97eb4f2c3f805ef9d98ba7f0530b3e";
40826
40729
  const RepresentationType$S = 'ContentDocumentCompositeRepresentation';
40827
40730
  function keyBuilder$1W(luvio, config) {
40828
40731
  return keyPrefix$1 + '::' + RepresentationType$S + ':' + config.contentDocumentId;
@@ -40902,7 +40805,7 @@
40902
40805
  const ingest$15 = function ContentDocumentCompositeRepresentationIngest(input, path, luvio, store, timestamp) {
40903
40806
  const key = keyBuilderFromType$B(luvio, input);
40904
40807
  const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
40905
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "UiApi", VERSION$1n, RepresentationType$S, equals$12);
40808
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "UiApi", VERSION$1p, RepresentationType$S, equals$12);
40906
40809
  return createLink$3(key);
40907
40810
  };
40908
40811
  function getTypeCacheKeys$18(rootKeySet, luvio, input, fullPathFactory) {
@@ -40969,11 +40872,11 @@
40969
40872
  priority: 'normal',
40970
40873
  };
40971
40874
  }
40972
- const select$1V = function ContentDocumentCompositeRepresentationSelect(body) {
40875
+ const select$21 = function ContentDocumentCompositeRepresentationSelect(body) {
40973
40876
  return {
40974
40877
  kind: 'Fragment',
40975
40878
  private: [],
40976
- version: VERSION$1n,
40879
+ version: VERSION$1p,
40977
40880
  selections: [
40978
40881
  {
40979
40882
  name: 'contentDocument',
@@ -41012,7 +40915,7 @@
41012
40915
  function ingestSuccess$1$1(luvio, resourceParams, response) {
41013
40916
  const { body } = response;
41014
40917
  const key = keyBuilderFromType$B(luvio, body);
41015
- const node = select$1V(body);
40918
+ const node = select$21(body);
41016
40919
  luvio.storeIngest(key, ingest$15, body);
41017
40920
  const snapshot = luvio.storeLookup({
41018
40921
  recordId: key,
@@ -41083,7 +40986,7 @@
41083
40986
  function ingestSuccess$M(luvio, resourceParams, response) {
41084
40987
  const { body } = response;
41085
40988
  const key = keyBuilderFromType$B(luvio, body);
41086
- const node = select$1V(body);
40989
+ const node = select$21(body);
41087
40990
  luvio.storeIngest(key, ingest$15, body);
41088
40991
  const snapshot = luvio.storeLookup({
41089
40992
  recordId: key,
@@ -41743,7 +41646,7 @@
41743
41646
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
41744
41647
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
41745
41648
  });
41746
- // version: 1.242.0-a5da424f9
41649
+ // version: 1.243.0-c7d8ec9e0
41747
41650
 
41748
41651
  var caseSensitiveUserId = '005B0000000GR4OIAW';
41749
41652
 
@@ -42385,6 +42288,9 @@
42385
42288
  }
42386
42289
 
42387
42290
  function isStoreEntryError(storeRecord) {
42291
+ if (!storeRecord || typeof storeRecord !== 'object') {
42292
+ return false;
42293
+ }
42388
42294
  return storeRecord.__type === 'error';
42389
42295
  }
42390
42296
 
@@ -47925,9 +47831,6 @@
47925
47831
  }
47926
47832
  async buildPendingAction(request, queue) {
47927
47833
  const targetId = await this.getIdFromRequest(request);
47928
- if (targetId === undefined) {
47929
- return Promise.reject(new Error('Cannot determine target id from the resource request'));
47930
- }
47931
47834
  const tag = this.buildTagForTargetId(targetId);
47932
47835
  const handlerActions = queue.filter((x) => x.handler === this.handlerId);
47933
47836
  if (request.method === 'post' && actionsForTag(tag, handlerActions).length > 0) {
@@ -49978,6 +49881,10 @@
49978
49881
  return node.kind === 'OperationDefinition';
49979
49882
  }
49980
49883
 
49884
+ const POLYMORPHIC_PARENT_RELATIONSHIP = 'polymorphicParentRelationship';
49885
+ const PARENT_RELATIONSHIP = 'parentRelationship';
49886
+ const CHILD_RELATIONSHIP = 'childRelationship';
49887
+ const RECORD_QUERY = 'recordQuery';
49981
49888
  function requestsDraftsField(recordFieldNode) {
49982
49889
  if (!recordFieldNode.selectionSet)
49983
49890
  return false;
@@ -49993,18 +49900,41 @@
49993
49900
  directive.arguments
49994
49901
  .map((argument) => argument.value)
49995
49902
  .filter(isStringValueNode)
49996
- .some((categoryName) => categoryName.value === 'recordQuery'));
49903
+ .some((categoryName) => categoryName.value === RECORD_QUERY));
49997
49904
  });
49998
49905
  }
49999
49906
  return false;
50000
49907
  }
50001
- // finds field with 'recordQuery' and 'childRelationship' directive
50002
- function findNearestRecordQuery(ancestors) {
50003
- const recordQueryAncester = findNearestAncesterPath(ancestors, true).node;
50004
- return recordQueryAncester === undefined ? undefined : recordQueryAncester;
49908
+ // finds connection field with 'recordQuery' and 'childRelationship' directive.
49909
+ function findNearestConnection(ancestors) {
49910
+ const connectionAncestor = findNearestAncesterPath(ancestors, true).node;
49911
+ return connectionAncestor === undefined ? undefined : connectionAncestor;
49912
+ }
49913
+ // convinient method to find nearest connection with its path
49914
+ function findNearestConnectionWithPath(ancestors) {
49915
+ const closestAncestorPath = findNearestAncesterPath(ancestors, true);
49916
+ let connection = undefined;
49917
+ let connectionPath = undefined;
49918
+ if (closestAncestorPath.parentIndex > 0) {
49919
+ const connectionAncestor = closestAncestorPath.node;
49920
+ const connectionAncestors = ancestors.slice(0, closestAncestorPath.parentIndex);
49921
+ connection =
49922
+ connectionAncestor === undefined ? undefined : connectionAncestor;
49923
+ if (connection !== undefined) {
49924
+ const ancesterPath = findAncesterPath(connectionAncestors);
49925
+ connectionPath =
49926
+ ancesterPath === ''
49927
+ ? connection.name.value
49928
+ : `${ancesterPath}#${connection.name.value}`;
49929
+ }
49930
+ }
49931
+ return {
49932
+ connection,
49933
+ path: connectionPath,
49934
+ };
50005
49935
  }
50006
- // finds cloeset ancester. If 'parentRelationship' is allowed, it could be 'InlineFragmentNode' since it inherits the 'parent' relationship. 'InlineFragmentNode' makes sure that only one 'apiName' returns when tree is traversed.
50007
- function findNearestAncesterPath(ancestors, recordQueryOnly) {
49936
+ // finds closest ancestor. If node with 'parentRelationship' is the ancester, the end result could be 'InlineFragmentNode' since it inherits the 'parent' relationship. 'InlineFragmentNode' makes sure that only one 'apiName' returns when tree is traversed.
49937
+ function findNearestAncesterPath(ancestors, connectionOnly) {
50008
49938
  let recordQueryPath = { node: undefined, parentIndex: -1 };
50009
49939
  let relationship = '';
50010
49940
  for (let i = ancestors.length - 1; i >= 0; i--) {
@@ -50018,9 +49948,11 @@
50018
49948
  continue;
50019
49949
  for (let arg of directive.arguments) {
50020
49950
  if (arg.value &&
50021
- (arg.value.value === 'recordQuery' ||
50022
- arg.value.value === 'childRelationship' ||
50023
- (!recordQueryOnly && arg.value.value === 'parentRelationship'))) {
49951
+ (arg.value.value === RECORD_QUERY ||
49952
+ arg.value.value === CHILD_RELATIONSHIP ||
49953
+ (!connectionOnly &&
49954
+ (arg.value.value === PARENT_RELATIONSHIP ||
49955
+ arg.value.value === POLYMORPHIC_PARENT_RELATIONSHIP)))) {
50024
49956
  recordQueryPath = { node: node, parentIndex: i };
50025
49957
  relationship = arg.value.value;
50026
49958
  break;
@@ -50035,17 +49967,19 @@
50035
49967
  //checks if nearest ancester could be an inline fragment
50036
49968
  if (recordQueryPath.node !== undefined &&
50037
49969
  recordQueryPath.node.selectionSet &&
50038
- relationship === 'parentRelationship') {
50039
- //
50040
- if (recordQueryPath.node.selectionSet.selections.every(isInlineFragmentNode)) {
50041
- //
50042
- const inlineFragmentLoc = recordQueryPath.parentIndex + 2;
50043
- if (inlineFragmentLoc < ancestors.length && ancestors[inlineFragmentLoc]) {
49970
+ (relationship === PARENT_RELATIONSHIP || relationship === POLYMORPHIC_PARENT_RELATIONSHIP)) {
49971
+ // InlineFragment is usually 3 steps aways from its FieldNode parent within ancester hierarchy if it exists. The below search
49972
+ // is applied to adapt to future AST structure change
49973
+ let parentIndex = recordQueryPath.parentIndex + 1;
49974
+ while (parentIndex < ancestors.length) {
49975
+ if (isInlineFragmentNode(ancestors[parentIndex])) {
50044
49976
  recordQueryPath = {
50045
- node: ancestors[inlineFragmentLoc],
50046
- parentIndex: inlineFragmentLoc,
49977
+ node: ancestors[parentIndex],
49978
+ parentIndex,
50047
49979
  };
49980
+ break;
50048
49981
  }
49982
+ parentIndex++;
50049
49983
  }
50050
49984
  }
50051
49985
  return recordQueryPath;
@@ -50069,7 +50003,7 @@
50069
50003
  ? sectionPath
50070
50004
  : sectionPath === ''
50071
50005
  ? path
50072
- : `${sectionPath}_${path}`;
50006
+ : `${sectionPath}#${path}`;
50073
50007
  }
50074
50008
  }
50075
50009
  boundaryIndex = parentIndex;
@@ -50127,9 +50061,9 @@
50127
50061
  const relationships = args
50128
50062
  .map((arg) => arg.value)
50129
50063
  .filter(isStringValueNode)
50130
- .filter((valueNode) => valueNode.value === 'childRelationship' ||
50131
- valueNode.value === 'parentRelationship' ||
50132
- valueNode.value === 'polymorphicParentRelationship')
50064
+ .filter((valueNode) => valueNode.value === CHILD_RELATIONSHIP ||
50065
+ valueNode.value === PARENT_RELATIONSHIP ||
50066
+ valueNode.value === POLYMORPHIC_PARENT_RELATIONSHIP)
50133
50067
  .map((relationshipNode) => relationshipNode.value);
50134
50068
  if (relationships.length > 0) {
50135
50069
  return relationships[0];
@@ -50186,8 +50120,8 @@
50186
50120
  */
50187
50121
  function isParentRelationship(node) {
50188
50122
  return (node &&
50189
- (isRelationship(node, 'parentRelationship') ||
50190
- isRelationship(node, 'polymorphicParentRelationship')));
50123
+ (isRelationship(node, PARENT_RELATIONSHIP) ||
50124
+ isRelationship(node, POLYMORPHIC_PARENT_RELATIONSHIP)));
50191
50125
  }
50192
50126
  /*
50193
50127
  checks if the InlineFragment spans
@@ -51279,7 +51213,7 @@
51279
51213
  },
51280
51214
  value: {
51281
51215
  kind: Kind$1.STRING,
51282
- value: 'parentRelationship',
51216
+ value: PARENT_RELATIONSHIP,
51283
51217
  block: false,
51284
51218
  },
51285
51219
  },
@@ -51293,7 +51227,7 @@
51293
51227
  // example 2 'ServiceAppointment' -> ['Owner']; 'Owner' -> ['User', 'Group']
51294
51228
  const objectNodeInfoTree = {};
51295
51229
  // save the field path to apiName map
51296
- // example 1: 'ServiceAppointment' -> ['ServiceAppointment']; 'ServiceAppointment_Account' -> ['Account']; 'ServiceAppointment_Account_Owner' -> ['User']
51230
+ // example 1: 'ServiceAppointment' -> ['ServiceAppointment']; 'ServiceAppointment#ccount' -> ['Account']; 'ServiceAppointment#Account#Owner' -> ['User']
51297
51231
  const pathToObjectApiNamesMap = {};
51298
51232
  let startNodes = new Set();
51299
51233
  let totalNodes = new Set();
@@ -51308,11 +51242,11 @@
51308
51242
  visit$1(originalAST, {
51309
51243
  Argument: {
51310
51244
  enter(node, key, parent, path, ancestors) {
51311
- const recordQueryNode = findNearestRecordQuery(ancestors);
51312
- if (!recordQueryNode)
51245
+ const { connection: recordConnectionNode, path: ancesterPath } = findNearestConnectionWithPath(ancestors);
51246
+ if (!recordConnectionNode || !ancesterPath)
51313
51247
  return;
51314
- if (!objectNodeInfoTree[recordQueryNode.name.value]) {
51315
- objectNodeInfoTree[recordQueryNode.name.value] = [];
51248
+ if (!objectNodeInfoTree[ancesterPath]) {
51249
+ objectNodeInfoTree[ancesterPath] = [];
51316
51250
  }
51317
51251
  switch (node.name.value) {
51318
51252
  case 'orderBy':
@@ -51320,12 +51254,12 @@
51320
51254
  if (node.value.kind !== 'ObjectValue') {
51321
51255
  return;
51322
51256
  }
51323
- totalNodes.add(recordQueryNode.name.value);
51257
+ totalNodes.add(ancesterPath);
51324
51258
  // 'childRelationship' node is not taken as the startNode of the 'NodeInfoTree' graph. The field scanning will construct the graph which lead here.
51325
- if (isRecordQuery(recordQueryNode)) {
51326
- startNodes.add(recordQueryNode.name.value);
51259
+ if (isRecordQuery(recordConnectionNode)) {
51260
+ startNodes.add(recordConnectionNode.name.value);
51327
51261
  }
51328
- growObjectFieldTree(objectNodeInfoTree, recordQueryNode.name.value, node.value, totalNodes, startNodes);
51262
+ growObjectFieldTree(objectNodeInfoTree, ancesterPath, node.value, totalNodes, startNodes);
51329
51263
  break;
51330
51264
  case 'scope':
51331
51265
  if (!isScopeArgumentNodeWithType(node, 'ASSIGNEDTOME', variables)) {
@@ -51340,17 +51274,16 @@
51340
51274
  name: 'ServiceResources',
51341
51275
  });
51342
51276
  }
51343
- if (objectNodeInfoTree['ServiceResources'] === undefined) {
51344
- objectNodeInfoTree['ServiceResources'] = [];
51345
- }
51346
- if (!objectNodeInfoTree['ServiceResources'].some((child) => child.name === 'ServiceResource')) {
51347
- objectNodeInfoTree['ServiceResources'].push({
51348
- relation: 'parent',
51349
- name: 'ServiceResource',
51350
- });
51277
+ if (objectNodeInfoTree['ServiceAppointment#ServiceResources'] === undefined) {
51278
+ objectNodeInfoTree['ServiceAppointment#ServiceResources'] = [
51279
+ {
51280
+ relation: 'parent',
51281
+ name: 'ServiceResource',
51282
+ },
51283
+ ];
51351
51284
  }
51352
- if (objectNodeInfoTree['ServiceResource'] === undefined) {
51353
- objectNodeInfoTree['ServiceResource'] = [];
51285
+ if (objectNodeInfoTree['ServiceAppointment#ServiceResources#ServiceResource'] === undefined) {
51286
+ objectNodeInfoTree['ServiceAppointment#ServiceResources#ServiceResource'] = [];
51354
51287
  }
51355
51288
  break;
51356
51289
  default:
@@ -51364,7 +51297,7 @@
51364
51297
  return;
51365
51298
  if (!node.selectionSet)
51366
51299
  return;
51367
- const recordQueryField = findNearestRecordQuery(ancestors);
51300
+ const recordQueryField = findNearestConnection(ancestors);
51368
51301
  //only injects fields for 'recordQuery' field. ignores the 'childRelationship' field since it will be traversed as the child of the 'recordQuery'
51369
51302
  if (isRecordQuery(recordQueryField) && recordQueryField) {
51370
51303
  totalNodes.add(recordQueryField.name.value);
@@ -51381,7 +51314,7 @@
51381
51314
  visit$1(originalAST, {
51382
51315
  Argument: {
51383
51316
  leave(node, key, parent, path, ancestors) {
51384
- const recordQueryField = findNearestRecordQuery(ancestors);
51317
+ const recordQueryField = findNearestConnection(ancestors);
51385
51318
  if (!recordQueryField)
51386
51319
  return;
51387
51320
  const ancestorPath = findAncesterPath(ancestors);
@@ -51429,7 +51362,7 @@
51429
51362
  case 'where': {
51430
51363
  inlineFragmentSelections[ancestorPath] = [
51431
51364
  ...inlineFragmentSelections[ancestorPath],
51432
- ...injectFilter(node, idState, ancestorPath, objectInfos, pathToObjectApiNamesMap, draftFunctions, recordReferenceNode),
51365
+ ...injectFilter(node, idState, ancestorPath, false, objectInfos, pathToObjectApiNamesMap, draftFunctions, recordReferenceNode),
51433
51366
  ];
51434
51367
  break;
51435
51368
  }
@@ -51445,7 +51378,7 @@
51445
51378
  if (!node.selectionSet)
51446
51379
  return;
51447
51380
  // it could be 'recordQuery' or 'childRelationship'
51448
- const recordQueryField = findNearestRecordQuery(ancestors);
51381
+ const recordQueryField = findNearestConnection(ancestors);
51449
51382
  if (!recordQueryField)
51450
51383
  return;
51451
51384
  const ancestorPath = findAncesterPath(ancestors);
@@ -51457,7 +51390,7 @@
51457
51390
  spanningSelections.push(selection);
51458
51391
  }
51459
51392
  }
51460
- const injectedFields = injectFields(spanningSelections, node, ancestors, objectInfos, pathToObjectApiNamesMap);
51393
+ const injectedFields = injectFields(spanningSelections, node, ancestorPath, ancestors, objectInfos, pathToObjectApiNamesMap);
51461
51394
  const mergedInjectedFields = mergeSelectionNodes$1(inlineFragmentSelections[ancestorPath], injectedFields);
51462
51395
  inlineFragmentSelections[ancestorPath] = mergedInjectedFields;
51463
51396
  },
@@ -51470,7 +51403,7 @@
51470
51403
  // removes 'ServicesResources' query field node if 'assignedtome' scope shows up
51471
51404
  if (assignedtomeQueryFieldNode !== undefined &&
51472
51405
  node.name.value === 'ServiceResources') {
51473
- const serviceResourcesAncestor = findNearestRecordQuery(ancestors);
51406
+ const serviceResourcesAncestor = findNearestConnection(ancestors);
51474
51407
  if (serviceResourcesAncestor === assignedtomeQueryFieldNode) {
51475
51408
  return null;
51476
51409
  }
@@ -51479,7 +51412,7 @@
51479
51412
  return;
51480
51413
  if (!node.selectionSet)
51481
51414
  return;
51482
- const recordQueryField = findNearestRecordQuery(ancestors);
51415
+ const recordQueryField = findNearestConnection(ancestors);
51483
51416
  if (!recordQueryField)
51484
51417
  return;
51485
51418
  const ancestorPath = findAncesterPath(ancestors);
@@ -51682,15 +51615,16 @@
51682
51615
  }
51683
51616
  // example: 'Account'
51684
51617
  const childNode = objectFieldNode.name.value;
51618
+ const childNodepath = `${parentNode}#${childNode}`;
51685
51619
  if (!tree[parentNode].some((child) => child.name === childNode)) {
51686
51620
  tree[parentNode].push({
51687
51621
  relation: 'parent',
51688
51622
  name: childNode,
51689
51623
  });
51690
- totalNodes.add(childNode);
51624
+ totalNodes.add(childNodepath);
51691
51625
  }
51692
51626
  // recursively go to deeper level of filter.
51693
- growObjectFieldTree(tree, childNode, objectFieldNode.value, totalNodes, startNodes);
51627
+ growObjectFieldTree(tree, childNodepath, objectFieldNode.value, totalNodes, startNodes);
51694
51628
  }
51695
51629
  }
51696
51630
  }
@@ -51725,19 +51659,20 @@
51725
51659
  }
51726
51660
  if (!tree[parentSectionPath].some((field) => field.name === fieldName)) {
51727
51661
  tree[parentSectionPath].push({
51728
- relation: relationType === 'parentRelationship' ||
51729
- relationType === 'polymorphicParentRelationship'
51662
+ relation: relationType === PARENT_RELATIONSHIP ||
51663
+ relationType === POLYMORPHIC_PARENT_RELATIONSHIP
51730
51664
  ? 'parent'
51731
51665
  : 'child',
51732
51666
  name: fieldName,
51733
51667
  });
51734
- totalNodes.add(fieldName);
51668
+ totalNodes.add(`${parentSectionPath}#${fieldName}`);
51735
51669
  }
51736
51670
  if (entryNode.selectionSet && entryNode.selectionSet.selections) {
51737
51671
  const childNodes = entryNode.selectionSet.selections.filter(isFieldOrInlineFragmentNode);
51738
51672
  // recursively build the traversal tree
51739
51673
  for (const child of childNodes) {
51740
- growFieldTree(tree, fieldName, child, entryNode, totalNodes, startNodes);
51674
+ const path = `${parentSectionPath}#${fieldName}`;
51675
+ growFieldTree(tree, path, child, entryNode, totalNodes, startNodes);
51741
51676
  }
51742
51677
  }
51743
51678
  }
@@ -51767,23 +51702,23 @@
51767
51702
  }
51768
51703
  if (!tree[parentSectionPath].some((field) => field.name === conditionName)) {
51769
51704
  tree[parentSectionPath].push({
51770
- relation: relationType === 'parentRelationship' ||
51771
- relationType === 'polymorphicParentRelationship'
51705
+ relation: relationType === PARENT_RELATIONSHIP ||
51706
+ relationType === POLYMORPHIC_PARENT_RELATIONSHIP
51772
51707
  ? 'parent'
51773
51708
  : 'child',
51774
51709
  name: conditionName,
51775
51710
  });
51776
- totalNodes.add(conditionName);
51711
+ const path = `${parentSectionPath}#${conditionName}`;
51712
+ totalNodes.add(path);
51777
51713
  }
51778
51714
  }
51779
51715
  }
51780
51716
  // dive deep immediately for 'InlineFragment'
51781
51717
  const childNodes = entryNode.selectionSet.selections.filter(isFieldOrInlineFragmentNode);
51718
+ const path = `${parentSectionPath}${entryNode.typeCondition ? '#' + entryNode.typeCondition.name.value : ''}`;
51782
51719
  // Navigates into InLineFragment
51783
51720
  for (const child of childNodes) {
51784
- growFieldTree(tree, entryNode.typeCondition
51785
- ? entryNode.typeCondition.name.value
51786
- : parentSectionPath, child, entryNode, totalNodes, startNodes);
51721
+ growFieldTree(tree, path, child, entryNode, totalNodes, startNodes);
51787
51722
  }
51788
51723
  }
51789
51724
  }
@@ -51827,7 +51762,7 @@
51827
51762
  }
51828
51763
  const validObjectInfoNodes = [];
51829
51764
  let updatedObjectInfoMap = {};
51830
- // InlineFragment and polymorphic field support fits into this scenario pathToObjectApiNamesMap Entry: 'ServiceAppointment_Owner' -> ['User', 'Group']; ServiceAppointment_Owner_User' -> ['User']
51765
+ // InlineFragment and polymorphic field support fits into this scenario pathToObjectApiNamesMap Entry: 'ServiceAppointment#Owner' -> ['User', 'Group']; ServiceAppointment#Owner#User' -> ['User']
51831
51766
  if (objectInfoApiNames.length > 0 &&
51832
51767
  nodesAtSameLevel.length > 0 &&
51833
51768
  objectInfoApiNames.includes(nodesAtSameLevel[0].name)) {
@@ -51839,7 +51774,7 @@
51839
51774
  // eslint-disable-next-line
51840
51775
  throw new Error(`Condition ${field.name} does not exists for ${parentPath}`);
51841
51776
  }
51842
- const path = `${parentPath}_${field.name}`;
51777
+ const path = `${parentPath}#${field.name}`;
51843
51778
  pathToObjectApiNamesMap[path] = [field.name];
51844
51779
  }
51845
51780
  validObjectInfoNodes.push(...nodesAtSameLevel);
@@ -51855,7 +51790,7 @@
51855
51790
  let apiNames = [];
51856
51791
  for (const nodeInfo of nodesAtSameLevel) {
51857
51792
  const field = nodeInfo.name;
51858
- const path = `${parentPath}_${field}`;
51793
+ const path = `${parentPath}#${field}`;
51859
51794
  // Handle 'parentRelationship'
51860
51795
  if (nodeInfo.relation === 'parent') {
51861
51796
  const relationshipId = referenceIdFieldForRelationship(field);
@@ -51873,12 +51808,12 @@
51873
51808
  }
51874
51809
  }
51875
51810
  // This is a polymorphic field
51876
- if (fieldDefinition.referenceToInfos.length > 1 && objectInfotree[field]) {
51811
+ if (fieldDefinition.referenceToInfos.length > 1 && objectInfotree[path]) {
51877
51812
  // Fields needs to expand and heterogenous entity ObjectInfo needs to be fetched
51878
- const referencedNodeInfos = objectInfotree[field];
51813
+ const referencedNodeInfos = objectInfotree[path];
51879
51814
  const requestedApiNames = referencedNodeInfos.map((referenceNodeInfo) => referenceNodeInfo.name);
51880
51815
  // Fetches requested ObjectInfo only. Some entity's relation field could define more than 6 references. Only references show up in query need to be handled.
51881
- if (requestedApiNames.length > 0 && objectInfotree[field]) {
51816
+ if (requestedApiNames.length > 0 && objectInfotree[path]) {
51882
51817
  fieldDefinition.referenceToInfos
51883
51818
  .filter((referenceToInfo) => requestedApiNames.includes(referenceToInfo.apiName))
51884
51819
  .forEach((ref) => {
@@ -51938,8 +51873,8 @@
51938
51873
  }
51939
51874
  for (const nodeInfo of validObjectInfoNodes) {
51940
51875
  const field = nodeInfo.name;
51941
- const subLevelFields = objectInfotree[field];
51942
- const path = `${parentPath}_${field}`;
51876
+ const path = `${parentPath}#${field}`;
51877
+ const subLevelFields = objectInfotree[path];
51943
51878
  if (subLevelFields && subLevelFields.length > 0) {
51944
51879
  const subObjectInfos = await fetchObjectInfos(objectInfotree, pathToObjectApiNamesMap, updatedObjectInfoMap, subLevelFields, path, objectInfoService);
51945
51880
  updatedObjectInfoMap = { ...updatedObjectInfoMap, ...subObjectInfos };
@@ -51956,27 +51891,29 @@
51956
51891
  * 'path' and 'queryNode' is 1 level above the 'filterNode'
51957
51892
  * @param filterNode filter node which needs to be injected. For example, 'State' ObjectFieldNode within filter 'where: { State: { eq: "Nova Scotia" }}'
51958
51893
  * @param idState ID state will be updated to determine if the ID fields in AST need to be swapped. The swapping happens later.
51959
- * @param path path to the current filterNode's parent. For example, path could be 'ServiceApointment' when filterNode is 'State'. If the path does not exist in 'pathToObjectApiNamesMap', parent node is not an field of relationship or recordQuery
51894
+ * @param parentPath path to the current filterNode's parent. For example, path could be 'ServiceApointment' when filterNode is 'State'. If the path does not exist in 'pathToObjectApiNamesMap', parent node is not an field of relationship or recordQuery
51895
+ * @param isParentPolymorphic true if parent points to a polymorphic field.
51960
51896
  * @param queryNode referece FieldNode which provides the information if 'filterNode' exist in it nor not.
51961
51897
  * @param objectInfos ObjectInfo map used in injection. If ObjectInfo misses or field does not exist in ObjectInfo, the error will be thrown
51962
51898
  * @param pathToObjectApiNamesMap map used to locate the ObjectInfo. The key is path to a field, value is the ObjectInfo's apiName array. In the case of polymorphic fields, the apiName array have 2 or more elements. For example, 'ServiceAppointment' -> ['ServiceAppointment']; 'ServiceAppointment_Account' -> ['Account'], 'ServiceAppointment_Owner' -> ['User', 'Group'].
51963
51899
  * @param draftFunctions functions for working with record ids that may be draft-created ids
51964
51900
  * @returns an array of nodes with injected fields
51965
51901
  */
51966
- function injectFilter(filterNode, idState, path, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode) {
51902
+ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode) {
51967
51903
  const injectedSelections = [];
51904
+ let isPolymorphicField = false;
51968
51905
  switch (filterNode.kind) {
51969
51906
  case Kind$1.ARGUMENT:
51970
51907
  if (filterNode.value.kind !== 'ObjectValue')
51971
51908
  return [];
51972
51909
  filterNode.value.fields.forEach((objectFieldNode) => {
51973
- let subResults = injectFilter(objectFieldNode, idState, path, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
51910
+ let subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
51974
51911
  for (const subResult of subResults) {
51975
51912
  mergeOrAddToGroup(injectedSelections, subResult);
51976
51913
  }
51977
51914
  // multiple Ids might need to be swapped. remember their paths for faster write.
51978
51915
  if (idState.swapNeeded) {
51979
- idState.paths.push(path);
51916
+ idState.paths.push(parentPath);
51980
51917
  }
51981
51918
  });
51982
51919
  return injectedSelections;
@@ -51985,7 +51922,7 @@
51985
51922
  case Kind$1.LIST: {
51986
51923
  filterNode.value.values.filter(isObjectValueNode).forEach((objectValueNode) => {
51987
51924
  objectValueNode.fields.forEach((objectFieldNode) => {
51988
- const subResults = injectFilter(objectFieldNode, idState, path, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
51925
+ const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
51989
51926
  for (const subResult of subResults) {
51990
51927
  mergeOrAddToGroup(injectedSelections, subResult);
51991
51928
  }
@@ -51996,7 +51933,7 @@
51996
51933
  case Kind$1.OBJECT: {
51997
51934
  if (filterNode.name.value === 'not') {
51998
51935
  filterNode.value.fields.forEach((objectFieldNode) => {
51999
- const subResults = injectFilter(objectFieldNode, idState, path, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
51936
+ const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
52000
51937
  for (const subResult of subResults) {
52001
51938
  mergeOrAddToGroup(injectedSelections, subResult);
52002
51939
  }
@@ -52006,15 +51943,15 @@
52006
51943
  let apiNames = [];
52007
51944
  let isScalarField = false;
52008
51945
  //It is possible that this is a polymorphic field
52009
- apiNames = pathToObjectApiNamesMap[path];
52010
- // example: path: 'ServiceAppointment_LastModifiedDate'; filterNode: '{eq: {literal: LAST_WEEK}}'. queryNode: 'LastModifedDate { value}' FilterNode's parent has been verifed as a valid node
51946
+ apiNames = pathToObjectApiNamesMap[parentPath];
51947
+ // example: path: 'ServiceAppointment#LastModifiedDate'; filterNode: '{eq: {literal: LAST_WEEK}}'. queryNode: 'LastModifedDate { value}' FilterNode's parent has been verifed as a valid node
52011
51948
  if (apiNames === undefined) {
52012
51949
  isScalarField = true;
52013
51950
  }
52014
51951
  else {
52015
51952
  if (apiNames.some((apiName) => objectInfos[apiName] === undefined)) {
52016
51953
  // eslint-disable-next-line
52017
- throw new Error(`ObjectInfo is missing for ${path}`);
51954
+ throw new Error(`ObjectInfo is missing for ${parentPath}`);
52018
51955
  }
52019
51956
  }
52020
51957
  if (isScalarField) {
@@ -52038,21 +51975,17 @@
52038
51975
  let isSpanning = false;
52039
51976
  // if true, current node is a polymorphic concrete type node. For example, field node `User` under `Owner`
52040
51977
  let isInlineFragment = false;
52041
- let isPolymorphicField = false;
52042
51978
  let isTypeNameExisting = false;
52043
51979
  let curPath;
52044
51980
  let fieldName = filterNode.name.value;
52045
- curPath = `${path}_${fieldName}`;
51981
+ curPath = `${parentPath}#${fieldName}`;
52046
51982
  if (pathToObjectApiNamesMap[curPath] &&
52047
51983
  pathToObjectApiNamesMap[curPath].length > 0) {
52048
51984
  isSpanning = true;
52049
- if (pathToObjectApiNamesMap[curPath].length === 1 &&
52050
- pathToObjectApiNamesMap[path] &&
52051
- pathToObjectApiNamesMap[path].length >= 1 &&
52052
- pathToObjectApiNamesMap[path].includes(pathToObjectApiNamesMap[curPath][0])) {
52053
- isInlineFragment = isPolymorphicFieldPath(path, pathToObjectApiNamesMap);
52054
- }
52055
- isPolymorphicField = isPolymorphicFieldPath(curPath, pathToObjectApiNamesMap);
51985
+ isInlineFragment =
51986
+ isParentPolymorphic &&
51987
+ pathToObjectApiNamesMap[curPath].length === 1;
51988
+ isPolymorphicField = isPolymorphicFieldPath(curPath, pathToObjectApiNamesMap, objectInfos);
52056
51989
  }
52057
51990
  // When filter node is at InLineFragment Level(a concrete entity of polymorphic field), query node is one level up. For example, ObjectFieldNode is ...{User:{...}}, queryNode is Owner:[User]
52058
51991
  if (isInlineFragment) {
@@ -52098,7 +52031,7 @@
52098
52031
  }
52099
52032
  const objectInfoName = pathToObjectApiNamesMap[curPath] !== undefined
52100
52033
  ? pathToObjectApiNamesMap[curPath][0]
52101
- : pathToObjectApiNamesMap[path][0];
52034
+ : pathToObjectApiNamesMap[parentPath][0];
52102
52035
  const isIdField = isFieldAnIdField(filterNode.name.value, objectInfos[objectInfoName]);
52103
52036
  if (!isIdField) {
52104
52037
  let subSelectionNodes = [];
@@ -52110,7 +52043,7 @@
52110
52043
  updateIDInfo(subFieldNode, idState, draftFunctions);
52111
52044
  }
52112
52045
  // try injecting the fields within predicate no matter it has relation or not.
52113
- let subResults = injectFilter(subFieldNode, idState, curPath, objectInfos, pathToObjectApiNamesMap, draftFunctions, existingFields ? existingFields[0] : undefined);
52046
+ let subResults = injectFilter(subFieldNode, idState, curPath, isPolymorphicField, objectInfos, pathToObjectApiNamesMap, draftFunctions, existingFields ? existingFields[0] : undefined);
52114
52047
  subSelectionNodes = subSelectionNodes.concat(subResults);
52115
52048
  });
52116
52049
  if (!subFieldsHasId) {
@@ -52271,15 +52204,43 @@
52271
52204
  }
52272
52205
  group.push(element);
52273
52206
  }
52274
- // checks if the path points to a polymorphic field. If path points to a polymorphic field, its entry within `pathToObjectApiNamesMap` has the format {"Path" : ["elem1", "elem2"]}.
52275
- // There must be also two entries pointing to concrete polymorphic field path. The two entries are like {"Path_elem1" : ["elem1"]} and {"Path_elem2" : ["elem2"]}
52276
- // For example ServiceAppointment_Owner' --> ['User', 'Group']; 'ServiceAppointment_Owner_User' --> ['User'], 'ServiceAppointment_Owner_Group' --> ['Group']
52277
- function isPolymorphicFieldPath(path, pathToObjectApiNamesMap) {
52278
- const apiName = pathToObjectApiNamesMap[path][0];
52279
- const apiNamesAtChildPath = pathToObjectApiNamesMap[`${path}_${apiName}`];
52280
- return (apiNamesAtChildPath !== undefined &&
52281
- apiNamesAtChildPath.length === 1 &&
52282
- apiNamesAtChildPath[0] === apiName);
52207
+ // checks if the path points to a polymorphic field. For example, for the below `pathToObjectApiNamesMap`
52208
+ // {
52209
+ // 'ServiceAppointment' -> ['ServiceAppointment']
52210
+ // 'ServiceAppointment#Owner' --> ['User'],
52211
+ // 'ServiceAppointment#Owner#User' --> ['User']
52212
+ // }
52213
+ // path `ServiceAppointment#Owner` points to a polymorphic field, but path `ServiceAppointment#Owner#User` does not.
52214
+ function isPolymorphicFieldPath(path, pathToObjectApiNamesMap, objectInfos) {
52215
+ const lastSegmentIndex = path.lastIndexOf('#');
52216
+ if (lastSegmentIndex < 0) {
52217
+ return false;
52218
+ }
52219
+ const lastSegment = path.slice(lastSegmentIndex + 1);
52220
+ const parentApiPath = path.slice(0, lastSegmentIndex);
52221
+ if (pathToObjectApiNamesMap[parentApiPath] === undefined) {
52222
+ return false;
52223
+ }
52224
+ const parentObjectApiNames = pathToObjectApiNamesMap[parentApiPath];
52225
+ // If the last segment is a Polymorphic field, its immediate parent is a concrete object entity, which has 1 objectApiName mapped to the parent path in `pathToObjectApiNamesMap`.
52226
+ // For example, we like to check if `ServiceAppointment#Owner` path is polymorphic. The last segment is `Owner` and its parent `ServiceAppointment` has one element (which is also `ServiceAppointment`) array as its value.
52227
+ // Below are the entries in `pathToObjectApiNamesMap`
52228
+ // {
52229
+ // `ServiceAppointmen`t: [`ServiceAppointment`],
52230
+ // `ServiceAppointment#Owner`: [`User`, `Group`],
52231
+ // `ServiceAppointment#Owner#User`: [`User`],
52232
+ // `ServiceAppointment#Owner#Group`: [`Group`],
52233
+ // }
52234
+ if (parentObjectApiNames.length !== 1) {
52235
+ return false;
52236
+ }
52237
+ const parentObjectInfo = objectInfos[parentObjectApiNames[0]];
52238
+ const relationshipField = referenceIdFieldForRelationship(lastSegment);
52239
+ let fieldDefinition = parentObjectInfo.fields[relationshipField];
52240
+ if (fieldDefinition === undefined) {
52241
+ return false;
52242
+ }
52243
+ return fieldDefinition.polymorphicForeignKey;
52283
52244
  }
52284
52245
  function isFieldAnIdField(fieldName, objectInfo) {
52285
52246
  if (fieldName === 'Id')
@@ -52333,10 +52294,10 @@
52333
52294
  * @param parentNode parent node of param 1
52334
52295
  * @param ancestors ancester of param 1
52335
52296
  * @param objectInfos ObjectInfo map used in injection. If ObjectInfo misses or field does not exist in ObjectInfo, the error will be thrown
52336
- * @param pathToObjectApiNamesMap map used to locate the ObjectInfo. The key is path to a field, value is the ObjectInfo's apiName array. In the case of polymorphic fields, the apiName array have 2 or more elements. For example, 'ServiceAppointment' -> ['ServiceAppointment']; 'ServiceAppointment_Account' -> ['Account'], 'ServiceAppointment_Owner' -> ['User', 'Group'].
52297
+ * @param pathToObjectApiNamesMap map used to locate the ObjectInfo. The key is path to a field, value is the ObjectInfo's apiName array. In the case of polymorphic fields, the apiName array have 2 or more elements. For example, 'ServiceAppointment' -> ['ServiceAppointment']; 'ServiceAppointment#Account' -> ['Account'], 'ServiceAppointment#Owner' -> ['User', 'Group'].
52337
52298
  * @return injected SelectionNodes used to construct the InlineFragment.
52338
52299
  */
52339
- function injectFields(selections, parentNode, ancestors, objectInfos, pathToObjectApiNamesMap) {
52300
+ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos, pathToObjectApiNamesMap) {
52340
52301
  /**
52341
52302
  * 1 parentship can return 2 FieldNode which need to be flattened
52342
52303
  * Concact: { ** Contact { ** ContactId {
@@ -52354,6 +52315,10 @@
52354
52315
  if (!selection.selectionSet) {
52355
52316
  return selection;
52356
52317
  }
52318
+ const segment = isFieldNode(selection)
52319
+ ? selection.name.value
52320
+ : selection.typeCondition.name.value;
52321
+ const curPath = `${parentPath}#${segment}`;
52357
52322
  const spanningSubSelections = [];
52358
52323
  for (const subSelection of selection.selectionSet.selections) {
52359
52324
  if (isFieldSpanning(subSelection, selection)) {
@@ -52361,7 +52326,7 @@
52361
52326
  }
52362
52327
  }
52363
52328
  // Handles multiple level field injection like 'ServiceAppointment' --> 'Account' --> 'Owner'
52364
- const subInjectedSelections = injectFields(spanningSubSelections, selection, ancestors, objectInfos, pathToObjectApiNamesMap);
52329
+ const subInjectedSelections = injectFields(spanningSubSelections, selection, curPath, ancestors, objectInfos, pathToObjectApiNamesMap);
52365
52330
  if (!selection.selectionSet) {
52366
52331
  return selection;
52367
52332
  }
@@ -52404,7 +52369,7 @@
52404
52369
  }
52405
52370
  }
52406
52371
  // For polymorphic fields, the Id field is excluded.
52407
- const excludeId = selection.selectionSet.selections.every(isInlineFragmentNode);
52372
+ const excludeId = isPolymorphicFieldPath(curPath, pathToObjectApiNamesMap, objectInfos);
52408
52373
  const idSelection = [];
52409
52374
  if (!excludeId && !hasIdAlready) {
52410
52375
  idSelection.push({
@@ -52415,8 +52380,8 @@
52415
52380
  },
52416
52381
  });
52417
52382
  }
52418
- // Inject '__typename' for polymorphic fields. '__typename' field acts as a reference to concrete type of a polymorphic field and is used to match JSON response with AST node. For more detail,
52419
- // please reference 'removeSyntheticFields'.
52383
+ // Inject '__typename' for InlineFragment. '__typename' field acts as a reference to concrete type of a polymorphic field or a standard field in the returned GQL response, which equals to
52384
+ // `typedCondition` of the InlineFragment in the query AST. It is used to match JSON response with AST node. For more detail, please reference 'removeSyntheticFields'.
52420
52385
  if (isInlineFragmentNode(selection) &&
52421
52386
  !selection.selectionSet.selections.find((selection) => isFieldNode(selection) && selection.name.value === '__typename')) {
52422
52387
  idSelection.push({
@@ -52450,7 +52415,7 @@
52450
52415
  if (isFieldNode(parentNode) && parentNode.selectionSet && parentNode.name.value === 'node') {
52451
52416
  if (parentNode.selectionSet.selections
52452
52417
  .filter(isFieldOrInlineFragmentNode)
52453
- .some((selectionNode) => isRelationship(selectionNode, 'childRelationship'))) {
52418
+ .some((selectionNode) => isRelationship(selectionNode, CHILD_RELATIONSHIP))) {
52454
52419
  if (!parentNode.selectionSet.selections
52455
52420
  .filter(isFieldNode)
52456
52421
  .some((sibling) => sibling.name.value === 'Id')) {
@@ -52469,7 +52434,7 @@
52469
52434
  if (parentInfo.parentIndex >= 0) {
52470
52435
  // example node { TimeSheetEntries { edges { node { Id }}}}
52471
52436
  const parent = parentInfo.node;
52472
- if (isRelationship(parent, 'childRelationship')) {
52437
+ if (isRelationship(parent, CHILD_RELATIONSHIP)) {
52473
52438
  const unVisitedAncestors = ancestors.slice(0, parentInfo.parentIndex);
52474
52439
  // path : "TimeSheet"
52475
52440
  const grandParentPath = findAncesterPath(unVisitedAncestors);
@@ -52598,7 +52563,7 @@
52598
52563
  },
52599
52564
  value: {
52600
52565
  kind: 'StringValue',
52601
- value: 'childRelationship',
52566
+ value: CHILD_RELATIONSHIP,
52602
52567
  block: false,
52603
52568
  },
52604
52569
  },
@@ -52690,7 +52655,7 @@
52690
52655
  },
52691
52656
  value: {
52692
52657
  kind: 'StringValue',
52693
- value: 'parentRelationship',
52658
+ value: PARENT_RELATIONSHIP,
52694
52659
  block: false,
52695
52660
  },
52696
52661
  },
@@ -52827,7 +52792,9 @@
52827
52792
  jsonOutput[fieldName] = null;
52828
52793
  return;
52829
52794
  }
52830
- jsonOutput[fieldName] = {};
52795
+ if (jsonOutput[fieldName] === undefined) {
52796
+ jsonOutput[fieldName] = {};
52797
+ }
52831
52798
  createUserJsonOutput(selection, jsonInput[fieldName], jsonOutput[fieldName]);
52832
52799
  }
52833
52800
  else {
@@ -52874,7 +52841,7 @@
52874
52841
  function getRecordIdFromRecordRequest(request) {
52875
52842
  const { method, basePath } = request;
52876
52843
  if (basePath === undefined) {
52877
- return undefined;
52844
+ throw Error(`Could not determine record id from request without a basePath`);
52878
52845
  }
52879
52846
  let recordId = '';
52880
52847
  switch (method) {
@@ -52883,13 +52850,13 @@
52883
52850
  case 'delete': {
52884
52851
  const matches = basePath.match(RECORD_ENDPOINT_REGEX$1);
52885
52852
  if (!matches || matches.length !== 3) {
52886
- return undefined;
52853
+ throw Error(`Could not determine record id from request path ${basePath}`);
52887
52854
  }
52888
52855
  recordId = matches[2];
52889
52856
  break;
52890
52857
  }
52891
52858
  default: {
52892
- return undefined;
52859
+ throw Error(`Could not determine record id from request type `);
52893
52860
  }
52894
52861
  }
52895
52862
  return recordId;
@@ -53745,7 +53712,7 @@
53745
53712
  if (request.method === 'post') {
53746
53713
  const apiName = request.body.apiName;
53747
53714
  if (apiName === undefined) {
53748
- return undefined;
53715
+ throw Error('Could not determine api name from request body');
53749
53716
  }
53750
53717
  return this.recordService.synthesizeId(apiName);
53751
53718
  }
@@ -54460,11 +54427,11 @@
54460
54427
  const objectInfo = await getAdapterData(this.objectInfoAdapter, {
54461
54428
  objectApiName: apiName,
54462
54429
  });
54463
- if (objectInfo === undefined) {
54464
- return undefined;
54430
+ if (objectInfo === undefined || objectInfo.keyPrefix === null) {
54431
+ throw Error(`Could not find or fetch object info for ${apiName}`);
54465
54432
  }
54466
54433
  if (objectInfo.keyPrefix === null) {
54467
- return undefined;
54434
+ throw Error(`Could not find key prefix for ${apiName}. Cannot synthesize id.`);
54468
54435
  }
54469
54436
  return this.generateId(objectInfo.keyPrefix);
54470
54437
  }
@@ -54540,7 +54507,7 @@
54540
54507
  getIdFromRequest(request) {
54541
54508
  const apiName = request.body.apiName;
54542
54509
  if (typeof apiName !== 'string') {
54543
- throw Error('expected api name not found');
54510
+ throw Error('expected api name not found in request body');
54544
54511
  }
54545
54512
  const id = this.draftRecordService.synthesizeId(apiName);
54546
54513
  return Promise.resolve(id);
@@ -55002,16 +54969,18 @@
55002
54969
  // remember ContentDocument ID
55003
54970
  pendingAction.metadata[CONTENT_DOCUMENT_DRAFT_ID_KEY] = targetId;
55004
54971
  // generate and remember ContentVersion ID
55005
- const contentVersionId = await this.draftRecordService.synthesizeId(CONTENT_VERSION_API_NAME);
55006
- if (contentVersionId === undefined) {
54972
+ const contentVersionId = await this.draftRecordService
54973
+ .synthesizeId(CONTENT_VERSION_API_NAME)
54974
+ .catch(() => {
55007
54975
  return Promise.reject(new DraftSynthesisError('Cannot generate local ContentVersion synthetic id', 'CANNOT_GENERATE_ID'));
55008
- }
54976
+ });
55009
54977
  pendingAction.metadata[CONTENT_VERSION_DRAFT_ID_KEY] = contentVersionId;
55010
54978
  // generate and remember ContentDocumentLink ID
55011
- const contentDocumentLinkId = await this.draftRecordService.synthesizeId(CONTENT_DOCUMENT_LINK_API_NAME);
55012
- if (contentDocumentLinkId === undefined) {
54979
+ const contentDocumentLinkId = await this.draftRecordService
54980
+ .synthesizeId(CONTENT_DOCUMENT_LINK_API_NAME)
54981
+ .catch(() => {
55013
54982
  return Promise.reject(new DraftSynthesisError('Cannot generate local ContentDocumentLink synthetic id', 'CANNOT_GENERATE_ID'));
55014
- }
54983
+ });
55015
54984
  pendingAction.metadata[CONTENT_DOCUMENT_LINK_DRAFT_ID_KEY] = contentDocumentLinkId;
55016
54985
  // assert that object infos and references exist
55017
54986
  const metaDataResult = await this.draftRecordService.getRecordDraftMetadata(targetId, pendingAction);
@@ -55040,8 +55009,7 @@
55040
55009
  return false;
55041
55010
  }
55042
55011
  async getIdFromRequest(_request) {
55043
- const id = this.draftRecordService.synthesizeId(CONTENT_DOCUMENT_API_NAME);
55044
- return id;
55012
+ return this.draftRecordService.synthesizeId(CONTENT_DOCUMENT_API_NAME);
55045
55013
  }
55046
55014
  getIdFromResponseBody(responseBody) {
55047
55015
  return responseBody.contentDocument.id;
@@ -57858,6 +57826,9 @@
57858
57826
  this.ldsRecordRefresher = config.ldsRecordRefresher;
57859
57827
  this.networkWorkerPool = new AsyncWorkerPool(this.concurrency);
57860
57828
  this.useBatchGQL = ldsPrimingGraphqlBatch.isOpen({ fallback: false });
57829
+ if (this.useBatchGQL) {
57830
+ this.batchSize = this.batchSize / DEFAULT_GQL_QUERY_BATCH_SIZE;
57831
+ }
57861
57832
  this.conflictPool = new ConflictPool(config.store, this.objectInfoLoader);
57862
57833
  }
57863
57834
  // function that enqueues priming work
@@ -58717,7 +58688,7 @@
58717
58688
  id: '@salesforce/lds-network-adapter',
58718
58689
  instrument: instrument$2,
58719
58690
  });
58720
- // version: 1.242.0-57237c3b6
58691
+ // version: 1.243.0-87f38263e
58721
58692
 
58722
58693
  const { create: create$3, keys: keys$3 } = Object;
58723
58694
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -77185,7 +77156,7 @@
77185
77156
  configuration: { ...configurationForGraphQLAdapters$1 },
77186
77157
  instrument: instrument$1,
77187
77158
  });
77188
- // version: 1.242.0-a5da424f9
77159
+ // version: 1.243.0-c7d8ec9e0
77189
77160
 
77190
77161
  // On core the unstable adapters are re-exported with different names,
77191
77162
  // we want to match them here.
@@ -79434,7 +79405,7 @@
79434
79405
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79435
79406
  graphQLImperative = ldsAdapter;
79436
79407
  });
79437
- // version: 1.242.0-a5da424f9
79408
+ // version: 1.243.0-c7d8ec9e0
79438
79409
 
79439
79410
  var gqlApi = /*#__PURE__*/Object.freeze({
79440
79411
  __proto__: null,
@@ -80132,7 +80103,7 @@
80132
80103
  function register(r) {
80133
80104
  callbacks$1.forEach((callback) => callback(r));
80134
80105
  }
80135
- // version: 1.242.0-57237c3b6
80106
+ // version: 1.243.0-87f38263e
80136
80107
 
80137
80108
  /**
80138
80109
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -84793,4 +84764,4 @@
84793
84764
  exports.subscribeToAdapter = subscribeToAdapter;
84794
84765
 
84795
84766
  }));
84796
- // version: 1.242.0-57237c3b6
84767
+ // version: 1.243.0-87f38263e