@salesforce/lds-worker-api 1.296.1 → 1.298.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.
@@ -26,7 +26,7 @@
26
26
  SnapshotState["Stale"] = "Stale";
27
27
  })(SnapshotState$3 || (SnapshotState$3 = {}));
28
28
 
29
- const { create: create$b, entries: entries$6, freeze: freeze$6, keys: keys$c, values: values$5, assign: assign$a } = Object;
29
+ const { create: create$c, entries: entries$7, freeze: freeze$6, keys: keys$d, values: values$6, assign: assign$b } = Object;
30
30
  const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
31
31
  const { isArray: isArray$9 } = Array;
32
32
  const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
@@ -54,7 +54,7 @@
54
54
  }
55
55
  }
56
56
  else {
57
- const keys$1 = keys$c(value);
57
+ const keys$1 = keys$d(value);
58
58
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
59
59
  deepFreeze(value[keys$1[i]]);
60
60
  }
@@ -325,7 +325,7 @@
325
325
  if (node === null) {
326
326
  return 'null';
327
327
  }
328
- const keys$1 = keys$c(node).sort();
328
+ const keys$1 = keys$d(node).sort();
329
329
  out = '';
330
330
  for (i = 0; i < keys$1.length; i++) {
331
331
  const key = keys$1[i];
@@ -593,13 +593,13 @@
593
593
  class StringKeyInMemoryStore {
594
594
  constructor(options = {}) {
595
595
  // public, in memory properties
596
- this.records = create$b(null);
597
- this.metadata = create$b(null);
598
- this.visitedIds = create$b(null);
599
- this.refreshedIds = create$b(null);
600
- this.redirectKeys = create$b(null);
601
- this.retainedIds = create$b(null);
602
- this.ttlOverrides = create$b(null);
596
+ this.records = create$c(null);
597
+ this.metadata = create$c(null);
598
+ this.visitedIds = create$c(null);
599
+ this.refreshedIds = create$c(null);
600
+ this.redirectKeys = create$c(null);
601
+ this.retainedIds = create$c(null);
602
+ this.ttlOverrides = create$c(null);
603
603
  this.snapshotSubscriptions = [];
604
604
  this.trimTask = null;
605
605
  this.pendingTrimKeys = new Set();
@@ -607,8 +607,8 @@
607
607
  this.watchSubscriptions = [];
608
608
  this.eventObservers = [];
609
609
  // private/protected
610
- this.insertedIds = create$b(null);
611
- this.reverseRedirectKeys = create$b(null);
610
+ this.insertedIds = create$c(null);
611
+ this.reverseRedirectKeys = create$c(null);
612
612
  this.currentSnapshotId = 0;
613
613
  this.scheduler = options.scheduler || buildDefaultScheduler();
614
614
  if (options.initialData) {
@@ -621,13 +621,13 @@
621
621
  return this.records[this.getCanonicalRecordId(key)];
622
622
  }
623
623
  getNumEntries() {
624
- return keys$c(this.records).length;
624
+ return keys$d(this.records).length;
625
625
  }
626
626
  readMetadata(key) {
627
627
  return this.metadata[this.getCanonicalRecordId(key)];
628
628
  }
629
629
  readMetadataWhere(query) {
630
- const keys$1 = keys$c(this.metadata);
630
+ const keys$1 = keys$d(this.metadata);
631
631
  const results = [];
632
632
  const hasNamespaceQuery = hasOwnProperty$3.call(query, 'namespace');
633
633
  const hasRepresentationNameQuery = hasOwnProperty$3.call(query, 'representationName');
@@ -724,8 +724,8 @@
724
724
  // Note: we should always get the subscription references from this at the beginning
725
725
  // of the function, in case the reference changes (because of an unsubscribe)
726
726
  const { snapshotSubscriptions, watchSubscriptions, visitedIds, refreshedIds, insertedIds } = this;
727
- const allVisitedIds = keys$c(visitedIds);
728
- const allRefreshedIds = keys$c(refreshedIds);
727
+ const allVisitedIds = keys$d(visitedIds);
728
+ const allRefreshedIds = keys$d(refreshedIds);
729
729
  // Early exit if nothing has changed
730
730
  if (allVisitedIds.length === 0 && allRefreshedIds.length === 0) {
731
731
  return Promise.resolve();
@@ -768,9 +768,9 @@
768
768
  callback(watchCallbackEntries);
769
769
  }
770
770
  }
771
- this.visitedIds = create$b(null);
772
- this.refreshedIds = create$b(null);
773
- this.insertedIds = create$b(null);
771
+ this.visitedIds = create$c(null);
772
+ this.refreshedIds = create$c(null);
773
+ this.insertedIds = create$c(null);
774
774
  // the .then removes the return of an array of voids to a single void
775
775
  return Promise.all(snapshotSubPromises).then(() => { });
776
776
  }
@@ -959,18 +959,18 @@
959
959
  return this.defaultTTLOverride;
960
960
  }
961
961
  reset() {
962
- this.records = create$b(null);
962
+ this.records = create$c(null);
963
963
  this.snapshotSubscriptions = [];
964
964
  this.watchSubscriptions = [];
965
- this.visitedIds = create$b(null);
966
- this.refreshedIds = create$b(null);
967
- this.insertedIds = create$b(null);
968
- this.redirectKeys = create$b(null);
969
- this.reverseRedirectKeys = create$b(null);
970
- this.retainedIds = create$b(null);
971
- this.ttlOverrides = create$b(null);
965
+ this.visitedIds = create$c(null);
966
+ this.refreshedIds = create$c(null);
967
+ this.insertedIds = create$c(null);
968
+ this.redirectKeys = create$c(null);
969
+ this.reverseRedirectKeys = create$c(null);
970
+ this.retainedIds = create$c(null);
971
+ this.ttlOverrides = create$c(null);
972
972
  this.trimTask = null;
973
- this.metadata = create$b(null);
973
+ this.metadata = create$c(null);
974
974
  this.defaultTTLOverride = undefined;
975
975
  emitLuvioStoreEvent({ type: 'store-reset', timestamp: Date.now() }, this.eventObservers);
976
976
  }
@@ -1229,7 +1229,7 @@
1229
1229
  calculateAndSetNewTTLs(storeMetadata, resetInitialDataTtls) {
1230
1230
  if (resetInitialDataTtls === true) {
1231
1231
  const now = Date.now();
1232
- keys$c(storeMetadata).forEach((key) => {
1232
+ keys$d(storeMetadata).forEach((key) => {
1233
1233
  const storeMetadataEntry = storeMetadata[key];
1234
1234
  const ttl = storeMetadataEntry.expirationTimestamp - storeMetadataEntry.ingestionTimestamp;
1235
1235
  storeMetadataEntry.ingestionTimestamp = now;
@@ -1258,7 +1258,7 @@
1258
1258
  hasOverlappingIds(snapshot, visitedIds) === false);
1259
1259
  }
1260
1260
  function getMatchingIds(partialKey, visitedIds) {
1261
- const keys$1 = keys$c(partialKey);
1261
+ const keys$1 = keys$d(partialKey);
1262
1262
  return visitedIds.filter((visitedId) => {
1263
1263
  return keys$1.every((key) => {
1264
1264
  return partialKey[key] === visitedId[key];
@@ -1908,8 +1908,8 @@
1908
1908
  } while (redirectKey !== undefined);
1909
1909
  }
1910
1910
  isUsingStringKeys() {
1911
- return (keys$c(this.fallbackStringKeyInMemoryStore.visitedIds).length !== 0 ||
1912
- keys$c(this.fallbackStringKeyInMemoryStore.refreshedIds).length !== 0);
1911
+ return (keys$d(this.fallbackStringKeyInMemoryStore.visitedIds).length !== 0 ||
1912
+ keys$d(this.fallbackStringKeyInMemoryStore.refreshedIds).length !== 0);
1913
1913
  }
1914
1914
  delegateToFallbackStringKeyStore(snapshot) {
1915
1915
  return !isErrorSnapshot$3(snapshot) && typeof snapshot.recordId === 'string';
@@ -1951,7 +1951,7 @@
1951
1951
  buildKeySchema(keyMetadata) {
1952
1952
  // pull NamespacedType type out of NormalizedKeyMetadata
1953
1953
  const { namespace: _ns, representationName: _rn, ...keyParamValues } = keyMetadata;
1954
- const keySchema = keys$c(keyParamValues).sort();
1954
+ const keySchema = keys$d(keyParamValues).sort();
1955
1955
  return ['namespace', 'representationName', ...keySchema];
1956
1956
  }
1957
1957
  serialize() {
@@ -2245,7 +2245,7 @@
2245
2245
  return value;
2246
2246
  }
2247
2247
  keys() {
2248
- return keys$c(this.data);
2248
+ return keys$d(this.data);
2249
2249
  }
2250
2250
  isScalar(propertyName) {
2251
2251
  // TODO W-6900046 - merge.ts casts these to any and manually sets `data`
@@ -2666,7 +2666,7 @@
2666
2666
  }
2667
2667
  }
2668
2668
  selectAllObject(record, data, visitedKeys) {
2669
- const recordKeys = keys$c(record);
2669
+ const recordKeys = keys$d(record);
2670
2670
  const { length } = recordKeys;
2671
2671
  for (let i = 0; i < length; i += 1) {
2672
2672
  const key = recordKeys[i];
@@ -2850,7 +2850,7 @@
2850
2850
  }
2851
2851
  const { baseSnapshotValue } = this.currentPath;
2852
2852
  if (isDefined$1(baseSnapshotValue)) {
2853
- this.snapshotChanged = keys$1.length !== keys$c(baseSnapshotValue).length;
2853
+ this.snapshotChanged = keys$1.length !== keys$d(baseSnapshotValue).length;
2854
2854
  }
2855
2855
  }
2856
2856
  checkIfChanged(value, options) {
@@ -2894,7 +2894,7 @@
2894
2894
  return this.markMissing();
2895
2895
  }
2896
2896
  const sink = (data[propertyName] = {});
2897
- const keys$1 = keys$c(obj);
2897
+ const keys$1 = keys$d(obj);
2898
2898
  this.checkIfObjectKeysLengthChanged(keys$1);
2899
2899
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
2900
2900
  const key = keys$1[i];
@@ -2905,7 +2905,7 @@
2905
2905
  }
2906
2906
  readLinkMap(propertyName, selection, record, data) {
2907
2907
  const map = record[propertyName];
2908
- const keys$1 = keys$c(map);
2908
+ const keys$1 = keys$d(map);
2909
2909
  const sink = {};
2910
2910
  this.checkIfObjectKeysLengthChanged(keys$1);
2911
2911
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
@@ -3039,7 +3039,7 @@
3039
3039
  return;
3040
3040
  }
3041
3041
  const sink = (data[propertyName] = {});
3042
- const keys$1 = keys$c(obj);
3042
+ const keys$1 = keys$d(obj);
3043
3043
  this.checkIfObjectKeysLengthChanged(keys$1);
3044
3044
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
3045
3045
  const key = keys$1[i];
@@ -3272,8 +3272,8 @@
3272
3272
  this.defaultCachePolicy = { type: 'cache-then-network' };
3273
3273
  this.store = store;
3274
3274
  this.networkAdapter = networkAdapter;
3275
- this.adapterContextMap = create$b(null);
3276
- this.typeQueryEvaluatorMap = create$b(null);
3275
+ this.adapterContextMap = create$c(null);
3276
+ this.typeQueryEvaluatorMap = create$c(null);
3277
3277
  // bind these methods so when they get passed into the
3278
3278
  // Store, the this reference is preserved
3279
3279
  this.createSnapshot = this.createSnapshot.bind(this);
@@ -3473,7 +3473,7 @@
3473
3473
  // retrieve from adapterContextMap if contextId is supplied
3474
3474
  // we will only track context of adapters that explicitly provide a contextId
3475
3475
  if (this.adapterContextMap[contextId] === undefined) {
3476
- this.adapterContextMap[contextId] = create$b(null);
3476
+ this.adapterContextMap[contextId] = create$c(null);
3477
3477
  }
3478
3478
  const contextStore = this.adapterContextMap[contextId];
3479
3479
  const context = {
@@ -3735,13 +3735,13 @@
3735
3735
  // undefined values on the injected networkAdapter. So we do it here, on
3736
3736
  // the API that those adapters call to dispatch their ResourceRequests.
3737
3737
  const { queryParams, urlParams } = mergedResourceRequest;
3738
- for (const paramKey of keys$c(queryParams)) {
3738
+ for (const paramKey of keys$d(queryParams)) {
3739
3739
  const value = queryParams[paramKey];
3740
3740
  if (value === undefined) {
3741
3741
  delete queryParams[paramKey];
3742
3742
  }
3743
3743
  }
3744
- for (const paramKey of keys$c(urlParams)) {
3744
+ for (const paramKey of keys$d(urlParams)) {
3745
3745
  const value = urlParams[paramKey];
3746
3746
  if (value === undefined) {
3747
3747
  delete urlParams[paramKey];
@@ -4068,16 +4068,16 @@
4068
4068
  return acc;
4069
4069
  }, {});
4070
4070
  const resourceParams = {};
4071
- if (keys$c(urlParams).length > 0) {
4071
+ if (keys$d(urlParams).length > 0) {
4072
4072
  resourceParams[CONFIG_PROPERTY_URL_PARAMS] = urlParams;
4073
4073
  }
4074
- if (keys$c(queryParams).length > 0) {
4074
+ if (keys$d(queryParams).length > 0) {
4075
4075
  resourceParams[CONFIG_PROPERTY_QUERY_PARAMS] = queryParams;
4076
4076
  }
4077
4077
  if (bodyParams.length > 0) {
4078
4078
  resourceParams[CONFIG_PROPERTY_BODY] = actualBodyParams;
4079
4079
  }
4080
- if (keys$c(headerParams).length > 0) {
4080
+ if (keys$d(headerParams).length > 0) {
4081
4081
  resourceParams[CONFIG_PROPERTY_HEADERS] = headerParams;
4082
4082
  }
4083
4083
  return resourceParams;
@@ -4210,7 +4210,7 @@
4210
4210
  }
4211
4211
  callbacks.push(callback);
4212
4212
  }
4213
- // version: 1.296.1-1aa7fc7e3
4213
+ // version: 1.298.0-3a2eedddc
4214
4214
 
4215
4215
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4216
4216
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15718,7 +15718,7 @@
15718
15718
  }
15719
15719
  return superResult;
15720
15720
  }
15721
- // version: 1.296.1-1aa7fc7e3
15721
+ // version: 1.298.0-3a2eedddc
15722
15722
 
15723
15723
  function unwrap(data) {
15724
15724
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16308,7 +16308,7 @@
16308
16308
  return factory(luvio);
16309
16309
  }
16310
16310
 
16311
- const { create: create$a, defineProperty, defineProperties } = Object;
16311
+ const { create: create$b, defineProperty, defineProperties } = Object;
16312
16312
 
16313
16313
  var SnapshotState$2;
16314
16314
  (function (SnapshotState) {
@@ -16647,7 +16647,7 @@
16647
16647
  const { apiFamily, name } = metadata;
16648
16648
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16649
16649
  }
16650
- // version: 1.296.1-1aa7fc7e3
16650
+ // version: 1.298.0-3a2eedddc
16651
16651
 
16652
16652
  /**
16653
16653
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16750,7 +16750,7 @@
16750
16750
 
16751
16751
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16752
16752
 
16753
- const { assign: assign$9, create: create$9, freeze: freeze$5, isFrozen: isFrozen$3, keys: keys$b } = Object;
16753
+ const { assign: assign$a, create: create$a, freeze: freeze$5, isFrozen: isFrozen$3, keys: keys$c } = Object;
16754
16754
 
16755
16755
  ObjectCreate$3(null);
16756
16756
 
@@ -17207,7 +17207,7 @@
17207
17207
  }
17208
17208
  const keyPrefix$2 = 'UiApi';
17209
17209
 
17210
- const { assign: assign$8, create: create$8, freeze: freeze$4, isFrozen: isFrozen$2, keys: keys$a } = Object;
17210
+ const { assign: assign$9, create: create$9, freeze: freeze$4, isFrozen: isFrozen$2, keys: keys$b } = Object;
17211
17211
  const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
17212
17212
  const { split, endsWith } = String.prototype;
17213
17213
  const { isArray: isArray$7 } = Array;
@@ -17236,7 +17236,7 @@
17236
17236
  for (let i = 0, len = value.length; i < len; i += 1) {
17237
17237
  result[value[i]] = true;
17238
17238
  }
17239
- return keys$a(result);
17239
+ return keys$b(result);
17240
17240
  }
17241
17241
  /**
17242
17242
  * @param source The array of string to filter
@@ -18091,14 +18091,14 @@
18091
18091
  mergeable: true,
18092
18092
  });
18093
18093
  const input_childRelationships = input.childRelationships;
18094
- const input_childRelationships_keys = keys$a(input_childRelationships);
18094
+ const input_childRelationships_keys = keys$b(input_childRelationships);
18095
18095
  const input_childRelationships_length = input_childRelationships_keys.length;
18096
18096
  for (let i = 0; i < input_childRelationships_length; i++) {
18097
18097
  const key = input_childRelationships_keys[i];
18098
18098
  getTypeCacheKeys$V$1(rootKeySet, luvio, input_childRelationships[key], () => rootKey + '__childRelationships' + '__' + key);
18099
18099
  }
18100
18100
  const input_fields = input.fields;
18101
- const input_fields_keys = keys$a(input_fields);
18101
+ const input_fields_keys = keys$b(input_fields);
18102
18102
  const input_fields_length = input_fields_keys.length;
18103
18103
  for (let i = 0; i < input_fields_length; i++) {
18104
18104
  const key = input_fields_keys[i];
@@ -20015,7 +20015,7 @@
20015
20015
  function createPathSelection(propertyName, fieldDefinition) {
20016
20016
  const fieldsSelection = [];
20017
20017
  const { children } = fieldDefinition;
20018
- const childrenKeys = keys$a(children);
20018
+ const childrenKeys = keys$b(children);
20019
20019
  for (let i = 0, len = childrenKeys.length; i < len; i += 1) {
20020
20020
  const childKey = childrenKeys[i];
20021
20021
  const childFieldDefinition = children[childKey];
@@ -20060,7 +20060,7 @@
20060
20060
  */
20061
20061
  function createPathSelectionFromValue(fields) {
20062
20062
  const fieldsSelection = [];
20063
- const fieldNames = keys$a(fields);
20063
+ const fieldNames = keys$b(fields);
20064
20064
  for (let i = 0, len = fieldNames.length; i < len; i++) {
20065
20065
  const fieldName = fieldNames[i];
20066
20066
  const { value: fieldValue } = fields[fieldName];
@@ -20099,7 +20099,7 @@
20099
20099
  }
20100
20100
  function extractRecordFieldsRecursively(record) {
20101
20101
  const fields = [];
20102
- const fieldNames = keys$a(record.fields);
20102
+ const fieldNames = keys$b(record.fields);
20103
20103
  for (let i = 0, len = fieldNames.length; i < len; i++) {
20104
20104
  const fieldName = fieldNames[i];
20105
20105
  const { value: fieldValue } = record.fields[fieldName];
@@ -20290,7 +20290,7 @@
20290
20290
  // For a spanning record that is detected to be a circular reference, we add the field along with Id and Name.
20291
20291
  // It's possible for spanning record lookup fields to sometimes be circular, and sometimes not - depending on the value of the lookup field.
20292
20292
  // For more information on scenarios that caused this fix: search "LDS Recursive Spanning Fields Problem" in Quip
20293
- if (keys$a(next.children).length === 0) {
20293
+ if (keys$b(next.children).length === 0) {
20294
20294
  addScalarFieldId(next);
20295
20295
  addScalarFieldName(next);
20296
20296
  }
@@ -20341,13 +20341,13 @@
20341
20341
  return endsWith.call(spanningNode.scalar('apiName'), CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX);
20342
20342
  }
20343
20343
  function convertTrieToFields(root) {
20344
- if (keys$a(root.children).length === 0) {
20344
+ if (keys$b(root.children).length === 0) {
20345
20345
  return [];
20346
20346
  }
20347
20347
  return convertTrieToFieldsRecursively(root);
20348
20348
  }
20349
20349
  function convertTrieToFieldsRecursively(root) {
20350
- const childKeys = keys$a(root.children);
20350
+ const childKeys = keys$b(root.children);
20351
20351
  if (childKeys.length === 0) {
20352
20352
  if (root.name === '') {
20353
20353
  return [];
@@ -20384,7 +20384,7 @@
20384
20384
  function mergeFieldsTries(rootA, rootB) {
20385
20385
  const rootAchildren = rootA.children;
20386
20386
  const rootBchildren = rootB.children;
20387
- const childBKeys = keys$a(rootBchildren);
20387
+ const childBKeys = keys$b(rootBchildren);
20388
20388
  for (let i = 0, len = childBKeys.length; i < len; i++) {
20389
20389
  const childBKey = childBKeys[i];
20390
20390
  if (rootAchildren[childBKey] === undefined) {
@@ -20544,8 +20544,8 @@
20544
20544
  }
20545
20545
  const childrenA = a.children;
20546
20546
  const childrenB = b.children;
20547
- const childKeysA = keys$a(childrenA);
20548
- const childKeysB = keys$a(childrenB);
20547
+ const childKeysA = keys$b(childrenA);
20548
+ const childKeysB = keys$b(childrenB);
20549
20549
  const childKeysBLength = childKeysB.length;
20550
20550
  if (childKeysBLength > childKeysA.length) {
20551
20551
  return false;
@@ -20589,7 +20589,7 @@
20589
20589
  // RecordRepresentationNormalized['fields'] to include `pending:true` property
20590
20590
  const mergedFields = { ...newRecord.fields };
20591
20591
  const merged = { ...newRecord, fields: mergedFields };
20592
- const existingFields = keys$a(oldRecord.fields);
20592
+ const existingFields = keys$b(oldRecord.fields);
20593
20593
  for (let i = 0, len = existingFields.length; i < len; i += 1) {
20594
20594
  const spanningFieldName = existingFields[i];
20595
20595
  if (newRecord.fields[spanningFieldName] === undefined) {
@@ -20722,7 +20722,7 @@
20722
20722
  if (isGraphNode(node)) {
20723
20723
  const dependencies = node.retrieve();
20724
20724
  if (dependencies !== null) {
20725
- const depKeys = keys$a(dependencies);
20725
+ const depKeys = keys$b(dependencies);
20726
20726
  for (let i = 0, len = depKeys.length; i < len; i++) {
20727
20727
  luvio.storeEvict(depKeys[i]);
20728
20728
  }
@@ -20869,7 +20869,7 @@
20869
20869
  }
20870
20870
  for (let i = 0; i < fieldSubtries.length; i++) {
20871
20871
  const subtrie = fieldSubtries[i];
20872
- const fieldNames = keys$a(subtrie.children);
20872
+ const fieldNames = keys$b(subtrie.children);
20873
20873
  for (let i = 0; i < fieldNames.length; i++) {
20874
20874
  const fieldName = fieldNames[i];
20875
20875
  const childTrie = subtrie.children[fieldName];
@@ -20983,9 +20983,9 @@
20983
20983
  return false;
20984
20984
  }
20985
20985
  }
20986
- const headersKeys = keys$a(headers);
20986
+ const headersKeys = keys$b(headers);
20987
20987
  const headersKeyLength = headersKeys.length;
20988
- if (headersKeyLength !== keys$a(existingHeaders).length) {
20988
+ if (headersKeyLength !== keys$b(existingHeaders).length) {
20989
20989
  return false;
20990
20990
  }
20991
20991
  for (let i = 0, len = headersKeyLength; i < len; i++) {
@@ -21593,7 +21593,7 @@
21593
21593
 
21594
21594
  // iterate through the map to build configs for network calls
21595
21595
  function resolveConflict(luvio, map) {
21596
- const ids = keys$a(map.conflicts);
21596
+ const ids = keys$b(map.conflicts);
21597
21597
  if (ids.length === 0) {
21598
21598
  instrumentation$3.recordConflictsResolved(map.serverRequestCount);
21599
21599
  return;
@@ -23045,18 +23045,18 @@
23045
23045
  return {
23046
23046
  getRecordSelectionFieldSets() {
23047
23047
  const optionalPlusDefaultFields = { ...optionalFields_ };
23048
- const fields = keys$a(defaultFields_);
23048
+ const fields = keys$b(defaultFields_);
23049
23049
  for (let i = 0; i < fields.length; ++i) {
23050
23050
  const field = fields[i];
23051
23051
  if (!fields_[field] && !defaultServerFieldStatus.missingFields[field]) {
23052
23052
  optionalPlusDefaultFields[field] = true;
23053
23053
  }
23054
23054
  }
23055
- return [keys$a(fields_).sort(), keys$a(optionalPlusDefaultFields).sort()];
23055
+ return [keys$b(fields_).sort(), keys$b(optionalPlusDefaultFields).sort()];
23056
23056
  },
23057
23057
  processRecords(records) {
23058
23058
  const { missingFields } = defaultServerFieldStatus;
23059
- const fields = keys$a(missingFields);
23059
+ const fields = keys$b(missingFields);
23060
23060
  for (let i = 0; i < fields.length; ++i) {
23061
23061
  const field = fields[i], splitField = field.split('.').slice(1);
23062
23062
  for (let i = 0; i < records.length; ++i) {
@@ -25511,7 +25511,7 @@
25511
25511
  const lookupFields = {};
25512
25512
  const { apiName, fields: recordFields } = record;
25513
25513
  const { fields: objectInfoFields } = objectInfo;
25514
- const objectInfoFieldNames = keys$a(objectInfoFields);
25514
+ const objectInfoFieldNames = keys$b(objectInfoFields);
25515
25515
  for (let i = 0, len = objectInfoFieldNames.length; i < len; i += 1) {
25516
25516
  const fieldName = objectInfoFieldNames[i];
25517
25517
  const field = objectInfoFields[fieldName];
@@ -25530,12 +25530,12 @@
25530
25530
  const nameField = `${apiName}.${relationshipName}.${getNameField(objectInfo, fieldName)}`;
25531
25531
  lookupFields[nameField] = true;
25532
25532
  }
25533
- return keys$a(lookupFields);
25533
+ return keys$b(lookupFields);
25534
25534
  }
25535
25535
  function getRecordUiMissingRecordLookupFields(recordUi) {
25536
25536
  const { records, objectInfos } = recordUi;
25537
25537
  const recordLookupFields = {};
25538
- const recordIds = keys$a(records);
25538
+ const recordIds = keys$b(records);
25539
25539
  for (let i = 0, len = recordIds.length; i < len; i += 1) {
25540
25540
  const recordId = recordIds[i];
25541
25541
  const recordData = records[recordId];
@@ -25573,19 +25573,19 @@
25573
25573
  }
25574
25574
  function eachLayout(recordUi, cb) {
25575
25575
  const { layouts } = recordUi;
25576
- const layoutApiNames = keys$a(layouts);
25576
+ const layoutApiNames = keys$b(layouts);
25577
25577
  for (let a = 0, len = layoutApiNames.length; a < len; a += 1) {
25578
25578
  const apiName = layoutApiNames[a];
25579
25579
  const apiNameData = layouts[apiName];
25580
- const recordTypeIds = keys$a(apiNameData);
25580
+ const recordTypeIds = keys$b(apiNameData);
25581
25581
  for (let b = 0, recordTypeIdsLen = recordTypeIds.length; b < recordTypeIdsLen; b += 1) {
25582
25582
  const recordTypeId = recordTypeIds[b];
25583
25583
  const recordTypeData = apiNameData[recordTypeId];
25584
- const layoutTypes = keys$a(recordTypeData);
25584
+ const layoutTypes = keys$b(recordTypeData);
25585
25585
  for (let c = 0, layoutTypesLen = layoutTypes.length; c < layoutTypesLen; c += 1) {
25586
25586
  const layoutType = layoutTypes[c];
25587
25587
  const layoutTypeData = recordTypeData[layoutType];
25588
- const modes = keys$a(layoutTypeData);
25588
+ const modes = keys$b(layoutTypeData);
25589
25589
  for (let d = 0, modesLen = modes.length; d < modesLen; d += 1) {
25590
25590
  const mode = modes[d];
25591
25591
  const layout = layoutTypeData[mode];
@@ -25791,14 +25791,14 @@
25791
25791
  function publishDependencies(luvio, recordIds, depKeys) {
25792
25792
  for (let i = 0, len = recordIds.length; i < len; i += 1) {
25793
25793
  const recordDepKey = dependencyKeyBuilder({ recordId: recordIds[i] });
25794
- const dependencies = create$8(null);
25794
+ const dependencies = create$9(null);
25795
25795
  for (let j = 0, len = depKeys.length; j < len; j++) {
25796
25796
  dependencies[depKeys[j]] = true;
25797
25797
  }
25798
25798
  const node = luvio.getNode(recordDepKey);
25799
25799
  if (isGraphNode(node)) {
25800
25800
  const recordDeps = node.retrieve();
25801
- assign$8(dependencies, recordDeps);
25801
+ assign$9(dependencies, recordDeps);
25802
25802
  }
25803
25803
  luvio.storePublish(recordDepKey, dependencies);
25804
25804
  }
@@ -25982,11 +25982,11 @@
25982
25982
  ];
25983
25983
  function getFieldsFromLayoutMap(layoutMap, objectInfo) {
25984
25984
  let fields = [];
25985
- const layoutTypes = keys$a(layoutMap);
25985
+ const layoutTypes = keys$b(layoutMap);
25986
25986
  for (let i = 0, layoutTypesLen = layoutTypes.length; i < layoutTypesLen; i += 1) {
25987
25987
  const layoutType = layoutTypes[i];
25988
25988
  const modesMap = layoutMap[layoutType];
25989
- const modes = keys$a(modesMap);
25989
+ const modes = keys$b(modesMap);
25990
25990
  for (let m = 0, modesLen = modes.length; m < modesLen; m += 1) {
25991
25991
  const mode = modes[m];
25992
25992
  const modeKeys = getQualifiedFieldApiNamesFromLayout(modesMap[mode], objectInfo);
@@ -26015,7 +26015,7 @@
26015
26015
  return getRecord$1(luvio, refresh, recordId, [], implicitFields);
26016
26016
  }
26017
26017
  function getRecordForNonLayoutableEntities(luvio, adapterContext, refresh, recordId, objectInfo, configOptionalFields, configFields) {
26018
- const fields = keys$a(configFields ? configFields : {}).map((key) => `${objectInfo.apiName}.${key}`);
26018
+ const fields = keys$b(configFields ? configFields : {}).map((key) => `${objectInfo.apiName}.${key}`);
26019
26019
  // W-12697744
26020
26020
  // Set the implicit fields received from the server in adapter context
26021
26021
  // This ensures that the implicit fields are available when data is read locally or from durable store
@@ -26254,7 +26254,7 @@
26254
26254
  }
26255
26255
  const { layoutType, mode, snapshot } = container;
26256
26256
  if (wrapper.layoutMap[layoutType] === undefined) {
26257
- wrapper.layoutMap = assign$8({}, wrapper.layoutMap, {
26257
+ wrapper.layoutMap = assign$9({}, wrapper.layoutMap, {
26258
26258
  [layoutType]: {},
26259
26259
  });
26260
26260
  }
@@ -35573,7 +35573,7 @@
35573
35573
  }
35574
35574
  }
35575
35575
  if (records.length > 0) {
35576
- assign$8(config, { records });
35576
+ assign$9(config, { records });
35577
35577
  }
35578
35578
  }
35579
35579
  return config;
@@ -40715,7 +40715,7 @@
40715
40715
  let clonedLayoutUserStateSections;
40716
40716
  const { sectionUserStates } = layoutUserStateInput;
40717
40717
  const { sectionUserStates: cachedSectionUserStates } = cachedLayoutUserState;
40718
- const sectionUserStateKeys = keys$a(sectionUserStates);
40718
+ const sectionUserStateKeys = keys$b(sectionUserStates);
40719
40719
  for (let i = 0, len = sectionUserStateKeys.length; i < len; i += 1) {
40720
40720
  const sectionId = sectionUserStateKeys[i];
40721
40721
  if (cachedSectionUserStates[sectionId] === undefined) {
@@ -43204,11 +43204,23 @@
43204
43204
  return config;
43205
43205
  }
43206
43206
 
43207
+ const ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z$/;
43207
43208
  function getHeaders(clientOptions) {
43208
43209
  const headers = {};
43209
43210
  if (untrustedIsObject$2(clientOptions)) {
43210
43211
  if (typeof clientOptions.ifUnmodifiedSince === 'string') {
43211
43212
  headers.ifUnmodifiedSince = clientOptions.ifUnmodifiedSince;
43213
+ // HTTP standard format date is expected by UI-API
43214
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since
43215
+ // A component built for Connect API must use If-Unmodified-Since
43216
+ // dates formatted as ISO 8601, which does not match the HTTP spec.
43217
+ // For compatibility, convert the date to match the standard.
43218
+ if (headers.ifUnmodifiedSince.match(ISO8601_DATE_REGEX)) {
43219
+ const utcString = new Date(headers.ifUnmodifiedSince).toUTCString();
43220
+ if (utcString !== 'Invalid Date') {
43221
+ headers.ifUnmodifiedSince = utcString;
43222
+ }
43223
+ }
43212
43224
  }
43213
43225
  }
43214
43226
  return headers;
@@ -44244,7 +44256,7 @@
44244
44256
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44245
44257
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44246
44258
  });
44247
- // version: 1.296.1-cf86708a0
44259
+ // version: 1.298.0-6f15dc1ec
44248
44260
 
44249
44261
  var ldsIdempotencyWriteDisabled = {
44250
44262
  isOpen: function (e) {
@@ -44420,7 +44432,7 @@
44420
44432
  const { parse: parse$6, stringify: stringify$6 } = JSON;
44421
44433
  const { join: join$2, push: push$2, unshift } = Array.prototype;
44422
44434
  const { isArray: isArray$5 } = Array;
44423
- const { entries: entries$5, keys: keys$8 } = Object;
44435
+ const { entries: entries$6, keys: keys$9 } = Object;
44424
44436
 
44425
44437
  const UI_API_BASE_URI = '/services/data/v62.0/ui-api';
44426
44438
 
@@ -44485,7 +44497,7 @@
44485
44497
  function mergeRecordFields$1(first, second) {
44486
44498
  const { fields: targetFields } = first;
44487
44499
  const { fields: sourceFields } = second;
44488
- const fieldNames = keys$8(sourceFields);
44500
+ const fieldNames = keys$9(sourceFields);
44489
44501
  for (let i = 0, len = fieldNames.length; i < len; i += 1) {
44490
44502
  const fieldName = fieldNames[i];
44491
44503
  const sourceField = sourceFields[fieldName];
@@ -44727,7 +44739,7 @@
44727
44739
  if (fulfill === undefined) {
44728
44740
  return null;
44729
44741
  }
44730
- const handlersMap = entries$5(inflightRequests);
44742
+ const handlersMap = entries$6(inflightRequests);
44731
44743
  for (let i = 0, len = handlersMap.length; i < len; i += 1) {
44732
44744
  const [transactionKey, handlers] = handlersMap[i];
44733
44745
  // check fulfillment against only the first handler ([0]) because it's equal or
@@ -44892,7 +44904,7 @@
44892
44904
  const MessagingDurableSegment = 'MESSAGING';
44893
44905
  const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
44894
44906
 
44895
- const { keys: keys$7, create: create$6, assign: assign$6, freeze: freeze$1$1 } = Object;
44907
+ const { keys: keys$8, create: create$7, assign: assign$7, freeze: freeze$2$1 } = Object;
44896
44908
 
44897
44909
  //Durable store error instrumentation key
44898
44910
  const DURABLE_STORE_ERROR = 'durable-store-error';
@@ -44939,7 +44951,7 @@
44939
44951
  if (durableRecords === undefined) {
44940
44952
  return { revivedKeys, hadUnexpectedShape };
44941
44953
  }
44942
- const durableKeys = keys$7(durableRecords);
44954
+ const durableKeys = keys$8(durableRecords);
44943
44955
  if (durableKeys.length === 0) {
44944
44956
  // no records to revive
44945
44957
  return { revivedKeys, hadUnexpectedShape };
@@ -45124,7 +45136,7 @@
45124
45136
  overrides,
45125
45137
  };
45126
45138
  }
45127
- const keys$1 = keys$7(entries);
45139
+ const keys$1 = keys$8(entries);
45128
45140
  for (let i = 0, len = keys$1.length; i < len; i++) {
45129
45141
  const key = keys$1[i];
45130
45142
  const entry = entries[key];
@@ -45146,14 +45158,14 @@
45146
45158
  }
45147
45159
 
45148
45160
  function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler, redirects, additionalDurableStoreOperations = [], enableDurableMetadataRefresh = false) {
45149
- const durableRecords = create$6(null);
45150
- const refreshedDurableRecords = create$6(null);
45151
- const evictedRecords = create$6(null);
45161
+ const durableRecords = create$7(null);
45162
+ const refreshedDurableRecords = create$7(null);
45163
+ const evictedRecords = create$7(null);
45152
45164
  const { visitedIds, refreshedIds } = store.fallbackStringKeyInMemoryStore;
45153
45165
  // TODO: W-8909393 Once metadata is stored in its own segment we need to
45154
45166
  // call setEntries for the visitedIds on default segment and call setEntries
45155
45167
  // on the metadata segment for the refreshedIds
45156
- const keys$1 = keys$7({ ...visitedIds, ...refreshedIds });
45168
+ const keys$1 = keys$8({ ...visitedIds, ...refreshedIds });
45157
45169
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
45158
45170
  const key = keys$1[i];
45159
45171
  const canonicalKey = store.getCanonicalRecordId(key);
@@ -45176,7 +45188,7 @@
45176
45188
  setRecordTo(entries, key, record, metadata);
45177
45189
  }
45178
45190
  const durableStoreOperations = additionalDurableStoreOperations;
45179
- const recordKeys = keys$7(durableRecords);
45191
+ const recordKeys = keys$8(durableRecords);
45180
45192
  if (recordKeys.length > 0) {
45181
45193
  // publishes with data
45182
45194
  durableStoreOperations.push({
@@ -45185,7 +45197,7 @@
45185
45197
  segment: DefaultDurableSegment,
45186
45198
  });
45187
45199
  }
45188
- const refreshKeys = keys$7(refreshedDurableRecords);
45200
+ const refreshKeys = keys$8(refreshedDurableRecords);
45189
45201
  if (refreshKeys.length > 0) {
45190
45202
  // publishes with only metadata updates
45191
45203
  durableStoreOperations.push({
@@ -45207,7 +45219,7 @@
45207
45219
  });
45208
45220
  });
45209
45221
  // evicts
45210
- const evictedKeys = keys$7(evictedRecords);
45222
+ const evictedKeys = keys$8(evictedRecords);
45211
45223
  if (evictedKeys.length > 0) {
45212
45224
  durableStoreOperations.push({
45213
45225
  type: 'evictEntries',
@@ -45311,7 +45323,7 @@
45311
45323
  // A reviving store is only "active" during a call to `environment.storeLookup`, and will
45312
45324
  // be used by the reader attempting to build an L1 snapshot. Immediately after the L1 rebuild
45313
45325
  // the reviving store becomes inactive other than receiving change notifications.
45314
- return create$6(upstreamStore, {
45326
+ return create$7(upstreamStore, {
45315
45327
  readEntry: { value: readEntry },
45316
45328
  markStale: { value: markStale },
45317
45329
  clearStale: { value: clearStale },
@@ -45323,7 +45335,7 @@
45323
45335
  const ADAPTER_CONTEXT_ID_SUFFIX = '__NAMED_CONTEXT';
45324
45336
  async function reviveOrCreateContext(adapterId, durableStore, durableStoreErrorHandler, contextStores, pendingContextStoreKeys, onContextLoaded) {
45325
45337
  // initialize empty context store
45326
- contextStores[adapterId] = create$6(null);
45338
+ contextStores[adapterId] = create$7(null);
45327
45339
  const context = {
45328
45340
  set(key, value) {
45329
45341
  contextStores[adapterId][key] = value;
@@ -45388,7 +45400,7 @@
45388
45400
  const revivingStores = new Set();
45389
45401
  // redirects that need to be flushed to the durable store
45390
45402
  const pendingStoreRedirects = new Map();
45391
- const contextStores = create$6(null);
45403
+ const contextStores = create$7(null);
45392
45404
  let initializationPromise = new Promise((resolve) => {
45393
45405
  const finish = () => {
45394
45406
  resolve();
@@ -45465,7 +45477,7 @@
45465
45477
  try {
45466
45478
  const entries = await durableStore.getEntries(adapterContextKeysFromDifferentInstance, AdapterContextSegment);
45467
45479
  if (entries !== undefined) {
45468
- const entryKeys = keys$7(entries);
45480
+ const entryKeys = keys$8(entries);
45469
45481
  for (let i = 0, len = entryKeys.length; i < len; i++) {
45470
45482
  const entryKey = entryKeys[i];
45471
45483
  const entry = entries[entryKey];
@@ -45500,7 +45512,7 @@
45500
45512
  if (filteredKeys.length > 0) {
45501
45513
  const entries = await durableStore.getMetadata(filteredKeys, DefaultDurableSegment);
45502
45514
  if (entries !== undefined) {
45503
- const entryKeys = keys$7(entries);
45515
+ const entryKeys = keys$8(entries);
45504
45516
  for (let i = 0, len = entryKeys.length; i < len; i++) {
45505
45517
  const entryKey = entryKeys[i];
45506
45518
  const { metadata } = entries[entryKey];
@@ -45872,7 +45884,7 @@
45872
45884
  validateNotDisposed();
45873
45885
  const entryKeys = keys$1.map(serializeStructuredKey);
45874
45886
  const entries = await durableStore.getEntries(entryKeys, DefaultDurableSegment);
45875
- if (entries === undefined || keys$7(entries).length === 0) {
45887
+ if (entries === undefined || keys$8(entries).length === 0) {
45876
45888
  return environment.notifyStoreUpdateAvailable(keys$1);
45877
45889
  }
45878
45890
  const now = Date.now();
@@ -45924,7 +45936,7 @@
45924
45936
  type: 'stale-while-revalidate',
45925
45937
  staleDurationSeconds: Number.MAX_SAFE_INTEGER,
45926
45938
  });
45927
- return create$6(environment, {
45939
+ return create$7(environment, {
45928
45940
  publishStoreMetadata: { value: publishStoreMetadata },
45929
45941
  storeIngest: { value: storeIngest },
45930
45942
  storeIngestError: { value: storeIngestError },
@@ -45960,14 +45972,10 @@
45960
45972
  * For full license text, see the LICENSE.txt file
45961
45973
  */
45962
45974
 
45963
-
45964
- function isStoreKeyRecordId(key) {
45965
- return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
45966
- }
45967
45975
  function isStoreKeyRecordField(key) {
45968
45976
  return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) > -1;
45969
45977
  }
45970
- function buildRecordFieldStoreKey(recordKey, fieldName) {
45978
+ function buildRecordFieldStoreKey$1(recordKey, fieldName) {
45971
45979
  return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
45972
45980
  }
45973
45981
  function objectsDeepEqual(lhs, rhs) {
@@ -45994,15 +46002,6 @@
45994
46002
  return true;
45995
46003
  }
45996
46004
 
45997
- function isStoreRecordError(storeRecord) {
45998
- return storeRecord.__type === 'error';
45999
- }
46000
- function isEntryDurableRecordRepresentation(entry, key) {
46001
- // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
46002
- return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
46003
- entry.data.__type === undefined);
46004
- }
46005
-
46006
46005
  /**
46007
46006
  * Copyright (c) 2022, Salesforce, Inc.,
46008
46007
  * All rights reserved.
@@ -46388,7 +46387,7 @@
46388
46387
  function errors(result) {
46389
46388
  return result.error;
46390
46389
  }
46391
- function values$4(result) {
46390
+ function values$5(result) {
46392
46391
  return result.value;
46393
46392
  }
46394
46393
  function flattenResults(results) {
@@ -46396,7 +46395,7 @@
46396
46395
  if (fails.length > 0) {
46397
46396
  return failure(fails);
46398
46397
  }
46399
- return success(results.filter(isSuccess).map(values$4));
46398
+ return success(results.filter(isSuccess).map(values$5));
46400
46399
  }
46401
46400
 
46402
46401
  function getFieldInfo(apiName, fieldName, infoMap) {
@@ -47213,7 +47212,7 @@
47213
47212
  }
47214
47213
 
47215
47214
  const { isArray: isArray$4 } = Array;
47216
- const { keys: keys$6 } = Object;
47215
+ const { keys: keys$7 } = Object;
47217
47216
 
47218
47217
  function isListValueNode(node) {
47219
47218
  return node.kind === 'ListValue';
@@ -47281,7 +47280,7 @@
47281
47280
  if (failures.length > 0) {
47282
47281
  return failure(failures);
47283
47282
  }
47284
- const containers = results.filter(isSuccess).map(values$4);
47283
+ const containers = results.filter(isSuccess).map(values$5);
47285
47284
  const predicates = [];
47286
47285
  containers.forEach((c) => {
47287
47286
  if (c.predicate !== undefined) {
@@ -47573,7 +47572,7 @@
47573
47572
  if (fails.length > 0) {
47574
47573
  return failure(fails);
47575
47574
  }
47576
- const vals = results.filter(isSuccess).reduce(flatMap$1(values$4), []);
47575
+ const vals = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
47577
47576
  return success(vals);
47578
47577
  }
47579
47578
  function isFilterFunction(name) {
@@ -47583,7 +47582,7 @@
47583
47582
  const results = Object.entries(operatorNode.fields)
47584
47583
  .filter(([key, _]) => isFilterFunction(key) === false)
47585
47584
  .map(([key, value]) => operatorWithValue(key, value, dataType));
47586
- const _values = results.filter(isSuccess).map(values$4);
47585
+ const _values = results.filter(isSuccess).map(values$5);
47587
47586
  const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
47588
47587
  if (fails.length > 0) {
47589
47588
  return failure(fails);
@@ -48504,7 +48503,7 @@
48504
48503
  }
48505
48504
  function recordFields(luvioSelections, names, parentApiName, parentAlias, input, joins) {
48506
48505
  const results = luvioSelections.map((selection) => selectionToQueryField(selection, names, parentApiName, parentAlias, input, joins));
48507
- const fields = results.filter(isSuccess).reduce(flatMap$1(values$4), []);
48506
+ const fields = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
48508
48507
  const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
48509
48508
  if (fails.length > 0) {
48510
48509
  return failure(fails);
@@ -48752,7 +48751,7 @@
48752
48751
  }
48753
48752
  function rootQuery(recordNodes, input) {
48754
48753
  const results = recordNodes.map((record) => rootRecordQuery(record, input));
48755
- const connections = results.filter(isSuccess).map(values$4);
48754
+ const connections = results.filter(isSuccess).map(values$5);
48756
48755
  const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
48757
48756
  if (fails.length > 0) {
48758
48757
  return failure(fails);
@@ -48848,7 +48847,7 @@
48848
48847
  switch (valueNode.kind) {
48849
48848
  case Kind$1.OBJECT: {
48850
48849
  // For example, `{ Id: { eq: $draftId } }` is a `ObjectValueNode`, which has field keys 'Id'
48851
- const resultQuery = keys$6(valueNode.fields)
48850
+ const resultQuery = keys$7(valueNode.fields)
48852
48851
  .map((key) => generateVariableSubQuery(valueNode.fields[key], key, type, variables))
48853
48852
  .filter((subquery) => subquery.length > 0)
48854
48853
  .join(',');
@@ -48924,7 +48923,7 @@
48924
48923
  }
48925
48924
  function swapValueNodeWithVariableNodes(original, swapped) {
48926
48925
  if (original.kind === Kind$1.OBJECT) {
48927
- for (const key of keys$6(original.fields)) {
48926
+ for (const key of keys$7(original.fields)) {
48928
48927
  if (isObjectValueNode$1(swapped) && swapped.fields[key]) {
48929
48928
  if (is(original.fields[key], 'Variable')) {
48930
48929
  original.fields[key] = swapped.fields[key];
@@ -49533,7 +49532,7 @@
49533
49532
  return new DraftErrorFetchResponse(HttpStatusCode$1.BadRequest, error);
49534
49533
  }
49535
49534
 
49536
- const { keys: keys$5, create: create$5, assign: assign$5, values: values$3 } = Object;
49535
+ const { keys: keys$6, create: create$6, assign: assign$6, values: values$4 } = Object;
49537
49536
  const { stringify: stringify$5, parse: parse$5 } = JSON;
49538
49537
  const { isArray: isArray$3$1 } = Array;
49539
49538
 
@@ -49643,13 +49642,13 @@
49643
49642
  }
49644
49643
  softEvict(key);
49645
49644
  };
49646
- return create$5(luvio, {
49645
+ return create$6(luvio, {
49647
49646
  dispatchResourceRequest: { value: dispatchResourceRequest },
49648
49647
  publishStoreMetadata: { value: publishStoreMetadata },
49649
49648
  storeEvict: { value: storeEvict },
49650
49649
  });
49651
49650
  }
49652
- return create$5(luvio, {
49651
+ return create$6(luvio, {
49653
49652
  dispatchResourceRequest: { value: dispatchResourceRequest },
49654
49653
  publishStoreMetadata: { value: publishStoreMetadata },
49655
49654
  });
@@ -49683,7 +49682,7 @@
49683
49682
  if (entries === undefined) {
49684
49683
  return mappings;
49685
49684
  }
49686
- const keys$1 = keys$5(entries);
49685
+ const keys$1 = keys$6(entries);
49687
49686
  for (const key of keys$1) {
49688
49687
  const entry = entries[key].data;
49689
49688
  if (isLegacyDraftIdMapping(key)) {
@@ -49701,7 +49700,7 @@
49701
49700
  async function clearDraftIdSegment(durableStore) {
49702
49701
  const entries = await durableStore.getAllEntries(DRAFT_ID_MAPPINGS_SEGMENT);
49703
49702
  if (entries) {
49704
- const keys$1 = keys$5(entries);
49703
+ const keys$1 = keys$6(entries);
49705
49704
  if (keys$1.length > 0) {
49706
49705
  await durableStore.evictEntries(keys$1, DRAFT_ID_MAPPINGS_SEGMENT);
49707
49706
  }
@@ -49960,7 +49959,7 @@
49960
49959
  const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
49961
49960
  // write the queue operations to the store prior to ingesting the result
49962
49961
  await this.draftStore.completeAction(queueOperations);
49963
- await handler.handleActionCompleted(action, queueOperations, values$3(this.handlers));
49962
+ await handler.handleActionCompleted(action, queueOperations, values$4(this.handlers));
49964
49963
  this.retryIntervalMilliseconds = 0;
49965
49964
  this.uploadingActionId = undefined;
49966
49965
  await this.notifyChangedListeners({
@@ -50112,7 +50111,7 @@
50112
50111
  return this.replaceOrMergeActions(targetActionId, sourceActionId, true);
50113
50112
  }
50114
50113
  async setMetadata(actionId, metadata) {
50115
- const keys$1 = keys$5(metadata);
50114
+ const keys$1 = keys$6(metadata);
50116
50115
  const compatibleKeys = keys$1.filter((key) => {
50117
50116
  const value = metadata[key];
50118
50117
  return typeof key === 'string' && typeof value === 'string';
@@ -50267,7 +50266,7 @@
50267
50266
  const waitForOngoingSync = this.syncPromise || Promise.resolve();
50268
50267
  return waitForOngoingSync.then(() => {
50269
50268
  const { draftStore } = this;
50270
- const keys$1 = keys$5(draftStore);
50269
+ const keys$1 = keys$6(draftStore);
50271
50270
  const actionArray = [];
50272
50271
  for (let i = 0, len = keys$1.length; i < len; i++) {
50273
50272
  const key = keys$1[i];
@@ -50291,7 +50290,7 @@
50291
50290
  deleteByTag(tag) {
50292
50291
  const deleteAction = () => {
50293
50292
  const { draftStore } = this;
50294
- const keys$1 = keys$5(draftStore);
50293
+ const keys$1 = keys$6(draftStore);
50295
50294
  const durableKeys = [];
50296
50295
  for (let i = 0, len = keys$1.length; i < len; i++) {
50297
50296
  const key = keys$1[i];
@@ -50381,7 +50380,7 @@
50381
50380
  return this.runQueuedOperations();
50382
50381
  }
50383
50382
  const { draftStore } = this;
50384
- const keys$1 = keys$5(durableEntries);
50383
+ const keys$1 = keys$6(durableEntries);
50385
50384
  for (let i = 0, len = keys$1.length; i < len; i++) {
50386
50385
  const entry = durableEntries[keys$1[i]];
50387
50386
  const action = entry.data;
@@ -51255,7 +51254,7 @@
51255
51254
  decrementRefCount(key);
51256
51255
  };
51257
51256
  // note the makeEnvironmentUiApiRecordDraftAware will eventually go away once the adapters become draft aware
51258
- return create$5(env, {
51257
+ return create$6(env, {
51259
51258
  storePublish: { value: storePublish },
51260
51259
  handleSuccessResponse: { value: handleSuccessResponse },
51261
51260
  softEvict: { value: softEvict },
@@ -51269,7 +51268,7 @@
51269
51268
  */
51270
51269
 
51271
51270
 
51272
- const { keys: keys$4, values: values$2, create: create$4, assign: assign$4, freeze: freeze$3, entries: entries$4 } = Object;
51271
+ const { keys: keys$5, values: values$3, create: create$5, assign: assign$5, freeze: freeze$1$1, entries: entries$5 } = Object;
51273
51272
  const { stringify: stringify$4, parse: parse$4 } = JSON;
51274
51273
  const { shift } = Array.prototype;
51275
51274
  const { isArray: isArray$2$1, from: from$2 } = Array;
@@ -51336,7 +51335,7 @@
51336
51335
  */
51337
51336
  function filterOutReferenceFieldsAndLinks(record) {
51338
51337
  const filteredFields = {};
51339
- const fieldNames = keys$4(record.fields);
51338
+ const fieldNames = keys$5(record.fields);
51340
51339
  for (const fieldName of fieldNames) {
51341
51340
  const field = record.fields[fieldName];
51342
51341
  if (isFieldLink(field) === false) {
@@ -51437,7 +51436,7 @@
51437
51436
  const resolvedRequest = resolveResourceRequestIds(luvio, resourceRequest, canonicalKey);
51438
51437
  return env.dispatchResourceRequest(resolvedRequest, context, eventObservers);
51439
51438
  };
51440
- return create$4(env, {
51439
+ return create$5(env, {
51441
51440
  dispatchResourceRequest: { value: dispatchResourceRequest },
51442
51441
  });
51443
51442
  }
@@ -51615,7 +51614,7 @@
51615
51614
  return applyDraftsToBatchResponse(resourceRequest, response, removedDraftIds);
51616
51615
  }));
51617
51616
  };
51618
- return create$4(env, {
51617
+ return create$5(env, {
51619
51618
  dispatchResourceRequest: { value: dispatchResourceRequest },
51620
51619
  });
51621
51620
  }
@@ -51625,7 +51624,7 @@
51625
51624
  const adapterSpecificEnvironments = synthesizers.reduce((environment, synthesizer) => {
51626
51625
  return synthesizer(luvio, environment, options);
51627
51626
  }, env);
51628
- return create$4(adapterSpecificEnvironments, {});
51627
+ return create$5(adapterSpecificEnvironments, {});
51629
51628
  }
51630
51629
 
51631
51630
  function clone(obj) {
@@ -51719,7 +51718,7 @@
51719
51718
  changedNameFields[fieldName] = fieldValue;
51720
51719
  }
51721
51720
  }
51722
- if (keys$4(changedNameFields).length > 0) {
51721
+ if (keys$5(changedNameFields).length > 0) {
51723
51722
  const newNameValue = filteredNameFields
51724
51723
  .map((key) => {
51725
51724
  if (changedNameFields[key] !== undefined) {
@@ -51802,7 +51801,7 @@
51802
51801
  const injectedCompoundNameField = compoundNameFieldFromDraftUpdates(record, draftOperationFields, apiName, objectInfos);
51803
51802
  // inject the compound Name field into the DraftOperation so on broadcast it doesnt try to
51804
51803
  // synthesize the Name field a second time when the durable store change notifier is triggered
51805
- if (keys$4(injectedCompoundNameField).length > 0 && draftActionType === 'update') {
51804
+ if (keys$5(injectedCompoundNameField).length > 0 && draftActionType === 'update') {
51806
51805
  draftOperation.fields['Name'] = injectedCompoundNameField['Name'];
51807
51806
  }
51808
51807
  const fields = { ...draftOperationFields, ...injectedCompoundNameField };
@@ -51813,7 +51812,7 @@
51813
51812
  LastModifiedDate: lastModifiedDate,
51814
51813
  };
51815
51814
  const draftFields = buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, internalFields, objectInfos, referencedRecords, formatDisplayValue);
51816
- const fieldNames = keys$4(draftFields);
51815
+ const fieldNames = keys$5(draftFields);
51817
51816
  for (let i = 0, len = fieldNames.length; i < len; i++) {
51818
51817
  const fieldName = fieldNames[i];
51819
51818
  // don't apply server values to draft created records
@@ -51874,7 +51873,7 @@
51874
51873
  return undefined;
51875
51874
  }
51876
51875
  const updatedFields = {};
51877
- const fieldNames = keys$4(fields);
51876
+ const fieldNames = keys$5(fields);
51878
51877
  for (let i = 0, len = fieldNames.length; i < len; i++) {
51879
51878
  const fieldName = fieldNames[i];
51880
51879
  const field = fields[fieldName];
@@ -51921,7 +51920,7 @@
51921
51920
  * @param fields List of draft record fields
51922
51921
  */
51923
51922
  function buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, fields, objectInfos, referencedRecords, formatDisplayValue) {
51924
- const fieldNames = keys$4(fields);
51923
+ const fieldNames = keys$5(fields);
51925
51924
  const recordFields = {};
51926
51925
  const objectInfo = objectInfos.get(apiName);
51927
51926
  for (let i = 0, len = fieldNames.length; i < len; i++) {
@@ -51989,7 +51988,7 @@
51989
51988
  draftFields[DEFAULT_FIELD_LAST_MODIFIED_DATE] = { value: timestampString, displayValue: null };
51990
51989
  draftFields[DEFAULT_FIELD_OWNER_ID] = { value: userId, displayValue: null };
51991
51990
  draftFields[DEFAULT_FIELD_ID] = { value: recordId, displayValue: null };
51992
- const allObjectFields = keys$4(objectInfo.fields);
51991
+ const allObjectFields = keys$5(objectInfo.fields);
51993
51992
  allObjectFields.forEach((fieldName) => {
51994
51993
  if (draftFields[fieldName] === undefined) {
51995
51994
  draftFields[fieldName] = { value: null, displayValue: null };
@@ -52130,7 +52129,7 @@
52130
52129
  this.isDraftId = isDraftId;
52131
52130
  this.recordService = recordService;
52132
52131
  this.handlerId = LDS_ACTION_HANDLER_ID;
52133
- this.collectedFields = create$4(null);
52132
+ this.collectedFields = create$5(null);
52134
52133
  recordService.registerRecordHandler(this);
52135
52134
  }
52136
52135
  async buildPendingAction(request, queue) {
@@ -52192,7 +52191,7 @@
52192
52191
  throw Error(`Could not generate draft. Object info is missing`);
52193
52192
  }
52194
52193
  const appendedFields = this.getBackdatingFields(objectInfo, resolvedRequest.method, pendingAction);
52195
- if (keys$4(appendedFields).length > 0) {
52194
+ if (keys$5(appendedFields).length > 0) {
52196
52195
  pendingAction.data.body = {
52197
52196
  ...pendingAction.data.body,
52198
52197
  fields: {
@@ -52206,7 +52205,7 @@
52206
52205
  }
52207
52206
  getBackdatingFields(objectInfo, requestMethod, pendingAction) {
52208
52207
  const fields = {};
52209
- const actionFieldNames = keys$4(pendingAction.data.body.fields);
52208
+ const actionFieldNames = keys$5(pendingAction.data.body.fields);
52210
52209
  if (requestMethod === 'post') {
52211
52210
  // `CreateRecord` with `CreatedDate` field
52212
52211
  if (isBackdatingFieldEditable(objectInfo, DEFAULT_FIELD_CREATED_DATE$1, 'createable', actionFieldNames)) {
@@ -52252,7 +52251,7 @@
52252
52251
  return;
52253
52252
  }
52254
52253
  const objectInfo = objectInfoMap[apiName];
52255
- const optionalFields = values$2(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
52254
+ const optionalFields = values$3(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
52256
52255
  await getAdapterData(this.getRecordAdapter, {
52257
52256
  recordId: referenceFieldInfo.id,
52258
52257
  optionalFields,
@@ -52271,7 +52270,7 @@
52271
52270
  const referenceToInfos = fieldInfo.referenceToInfos;
52272
52271
  const apiNames = referenceToInfos.map((referenceToInfo) => referenceToInfo.apiName);
52273
52272
  const objectInfoMap = await this.objectInfoService.getObjectInfos(apiNames);
52274
- for (const objectInfo of values$2(objectInfoMap)) {
52273
+ for (const objectInfo of values$3(objectInfoMap)) {
52275
52274
  const { apiName, keyPrefix } = objectInfo;
52276
52275
  if (keyPrefix !== null && id.startsWith(keyPrefix)) {
52277
52276
  return apiName;
@@ -52399,17 +52398,17 @@
52399
52398
  // otherwise we're a record
52400
52399
  if (draftMetadata === undefined) {
52401
52400
  // no drafts applied to this record, publish and be done
52402
- this.collectedFields = create$4(null);
52401
+ this.collectedFields = create$5(null);
52403
52402
  return publishData(key, data);
52404
52403
  }
52405
52404
  // create a denormalized record with the collected fields
52406
- const recordFieldNames = keys$4(data.fields);
52405
+ const recordFieldNames = keys$5(data.fields);
52407
52406
  const partialRecord = {
52408
52407
  ...data,
52409
52408
  fields: {},
52410
52409
  };
52411
52410
  for (const fieldName of recordFieldNames) {
52412
- const collectedField = this.collectedFields[buildRecordFieldStoreKey(key, fieldName)];
52411
+ const collectedField = this.collectedFields[buildRecordFieldStoreKey$1(key, fieldName)];
52413
52412
  if (collectedField !== undefined) {
52414
52413
  partialRecord.fields[fieldName] =
52415
52414
  collectedField;
@@ -52425,15 +52424,15 @@
52425
52424
  lastModifiedDate: recordWithDrafts.lastModifiedDate,
52426
52425
  lastModifiedById: recordWithDrafts.lastModifiedById,
52427
52426
  };
52428
- for (const fieldName of keys$4(recordWithSpanningRefLinks.fields)) {
52429
- const fieldKey = buildRecordFieldStoreKey(key, fieldName);
52427
+ for (const fieldName of keys$5(recordWithSpanningRefLinks.fields)) {
52428
+ const fieldKey = buildRecordFieldStoreKey$1(key, fieldName);
52430
52429
  normalizedRecord.fields[fieldName] = { __ref: fieldKey };
52431
52430
  publishData(fieldKey, recordWithSpanningRefLinks.fields[fieldName]);
52432
52431
  }
52433
52432
  // publish the normalized record
52434
52433
  publishData(key, normalizedRecord);
52435
52434
  // we've published the record, now clear the collected fields
52436
- this.collectedFields = create$4(null);
52435
+ this.collectedFields = create$5(null);
52437
52436
  }
52438
52437
  updateMetadata(existingMetadata, incomingMetadata) {
52439
52438
  // ensure the the api name cannot be overwritten in the incoming metadata
@@ -52470,7 +52469,7 @@
52470
52469
  let resolvedUrlParams = request.urlParams;
52471
52470
  if (request.method === 'post' || request.method === 'patch') {
52472
52471
  const bodyFields = resolvedBody.fields;
52473
- const fieldNames = keys$4(bodyFields);
52472
+ const fieldNames = keys$5(bodyFields);
52474
52473
  for (let i = 0, len = fieldNames.length; i < len; i++) {
52475
52474
  const fieldName = fieldNames[i];
52476
52475
  const fieldValue = bodyFields[fieldName];
@@ -52564,366 +52563,6 @@
52564
52563
  !draftActionFieldNames.includes(backdatingFieldName));
52565
52564
  }
52566
52565
 
52567
- function createLink$2(key) {
52568
- return { __ref: key };
52569
- }
52570
- /**
52571
- * Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
52572
- * durable store record representation and normalizes it back out into the format the the luvio store expects it
52573
- * @param key Record store key
52574
- * @param entry Durable entry containing a denormalized record representation
52575
- * @returns a set of entries containing the normalized record and its normalized fields
52576
- */
52577
- function normalizeRecordFields(key, entry) {
52578
- const { data: record } = entry;
52579
- const { fields, links } = record;
52580
- const missingFieldLinks = keys$4(links);
52581
- const fieldNames = keys$4(fields);
52582
- const normalizedFields = {};
52583
- const returnEntries = {};
52584
- // restore fields
52585
- for (let i = 0, len = fieldNames.length; i < len; i++) {
52586
- const fieldName = fieldNames[i];
52587
- const field = fields[fieldName];
52588
- const fieldKey = buildRecordFieldStoreKey(key, fieldName);
52589
- returnEntries[fieldKey] = { data: field };
52590
- normalizedFields[fieldName] = createLink$2(fieldKey);
52591
- }
52592
- // restore missing fields
52593
- for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
52594
- const fieldName = missingFieldLinks[i];
52595
- const link = links[fieldName];
52596
- if (link.isMissing === true) {
52597
- normalizedFields[fieldName] = { ...link, __ref: undefined };
52598
- }
52599
- }
52600
- returnEntries[key] = {
52601
- data: assign$4(record, { fields: normalizedFields }),
52602
- metadata: entry.metadata,
52603
- };
52604
- return returnEntries;
52605
- }
52606
- /**
52607
- * Transforms a record for storage in the durable store. The transformation involves denormalizing
52608
- * scalar fields and persisting link metadata to transform back into a normalized representation
52609
- *
52610
- * If the record contains pending fields this will return undefined as pending records do not get persisted
52611
- * to the durable store. There should be a refresh operation outbound that will bring in the updated record.
52612
- *
52613
- * @param normalizedRecord Record containing normalized field links
52614
- * @param recordStore a store containing referenced record fields
52615
- */
52616
- function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
52617
- const fields = normalizedRecord.fields;
52618
- const filteredFields = {};
52619
- const links = {};
52620
- const fieldNames = keys$4(fields);
52621
- for (let i = 0, len = fieldNames.length; i < len; i++) {
52622
- const fieldName = fieldNames[i];
52623
- const field = fields[fieldName];
52624
- // pending fields get filtered out of the durable store
52625
- const { pending } = field;
52626
- if (pending === true) {
52627
- // do not write records with pending fields to the durable store
52628
- // there should be a refresh operation outbound that will bring in the updated record
52629
- return undefined;
52630
- }
52631
- const { __ref } = field;
52632
- if (__ref !== undefined) {
52633
- let ref = records[__ref];
52634
- if (pendingEntries !== undefined) {
52635
- // If the ref was part of the pending write that takes precedence
52636
- const pendingEntry = pendingEntries[__ref];
52637
- if (pendingEntry !== undefined) {
52638
- ref = pendingEntry.data;
52639
- }
52640
- }
52641
- // if field reference exists then add it to our filteredFields
52642
- if (ref !== undefined) {
52643
- filteredFields[fieldName] = ref;
52644
- }
52645
- else {
52646
- // if we have a store to read, try to find the field there too
52647
- // The durable ingest staging store may pass through to L1, and
52648
- // not all fields are necessarily published every time, so it is
52649
- // important to check L1 and not just the fields being published,
52650
- // otherwise we risk truncating the fields on the record.
52651
- if (store) {
52652
- ref = store.readEntry(__ref);
52653
- if (ref !== undefined) {
52654
- filteredFields[fieldName] = ref;
52655
- }
52656
- }
52657
- }
52658
- }
52659
- // we want to preserve fields that are missing nodes
52660
- if (field.isMissing === true) {
52661
- links[fieldName] = field;
52662
- }
52663
- }
52664
- return {
52665
- ...normalizedRecord,
52666
- fields: filteredFields,
52667
- links,
52668
- };
52669
- }
52670
- function getDenormalizedKey(originalKey, recordId, luvio) {
52671
- // this will likely need to be handled when moving to structured keys
52672
- // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
52673
- // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
52674
- if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
52675
- return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
52676
- }
52677
- return keyBuilder$26(luvio, { recordId });
52678
- }
52679
- function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
52680
- const getEntries = function (entries, segment) {
52681
- // this HOF only inspects records in the default segment
52682
- if (segment !== DefaultDurableSegment) {
52683
- return durableStore.getEntries(entries, segment);
52684
- }
52685
- const { length: entriesLength } = entries;
52686
- if (entriesLength === 0) {
52687
- return Promise.resolve({});
52688
- }
52689
- // filter out record field keys
52690
- const filteredEntryIds = [];
52691
- // map of records to avoid requesting duplicate record keys when requesting both records and fields
52692
- const recordEntries = {};
52693
- const recordViewEntries = {};
52694
- for (let i = 0, len = entriesLength; i < len; i++) {
52695
- const id = entries[i];
52696
- const recordId = extractRecordIdFromStoreKey$1(id);
52697
- if (recordId !== undefined) {
52698
- if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
52699
- if (recordViewEntries[recordId] === undefined) {
52700
- const key = getDenormalizedKey(id, recordId, luvio);
52701
- recordViewEntries[recordId] = true;
52702
- filteredEntryIds.push(key);
52703
- }
52704
- }
52705
- else {
52706
- if (recordEntries[recordId] === undefined) {
52707
- const key = getDenormalizedKey(id, recordId, luvio);
52708
- recordEntries[recordId] = true;
52709
- filteredEntryIds.push(key);
52710
- }
52711
- }
52712
- }
52713
- else {
52714
- filteredEntryIds.push(id);
52715
- }
52716
- }
52717
- // call base getEntries
52718
- return durableStore.getEntries(filteredEntryIds, segment).then((durableEntries) => {
52719
- if (durableEntries === undefined) {
52720
- return undefined;
52721
- }
52722
- const returnEntries = create$4(null);
52723
- const keys$1 = keys$4(durableEntries);
52724
- for (let i = 0, len = keys$1.length; i < len; i++) {
52725
- const key = keys$1[i];
52726
- const value = durableEntries[key];
52727
- if (value === undefined) {
52728
- continue;
52729
- }
52730
- if (isEntryDurableRecordRepresentation(value, key)) {
52731
- assign$4(returnEntries, normalizeRecordFields(key, value));
52732
- }
52733
- else {
52734
- returnEntries[key] = value;
52735
- }
52736
- }
52737
- return returnEntries;
52738
- });
52739
- };
52740
- const denormalizeEntries = function (entries) {
52741
- let hasEntries = false;
52742
- let hasMetadata = false;
52743
- const putEntries = create$4(null);
52744
- const putMetadata = create$4(null);
52745
- const keys$1 = keys$4(entries);
52746
- const putRecords = {};
52747
- const putRecordViews = {};
52748
- const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
52749
- const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
52750
- const store = getStore();
52751
- for (let i = 0, len = keys$1.length; i < len; i++) {
52752
- const key = keys$1[i];
52753
- let value = entries[key];
52754
- const recordId = extractRecordIdFromStoreKey$1(key);
52755
- // do not put normalized field values
52756
- if (recordId !== undefined) {
52757
- const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
52758
- if (isRecordView) {
52759
- if (putRecordViews[recordId] === true) {
52760
- continue;
52761
- }
52762
- }
52763
- else {
52764
- if (putRecords[recordId] === true) {
52765
- continue;
52766
- }
52767
- }
52768
- const recordKey = getDenormalizedKey(key, recordId, luvio);
52769
- const recordEntries = entries;
52770
- const entry = recordEntries[recordKey];
52771
- let record = entry && entry.data;
52772
- if (record === undefined) {
52773
- record = storeRecords[recordKey];
52774
- if (record === undefined) {
52775
- // fields are being published without a record for them existing,
52776
- // fields cannot exist standalone in the durable store
52777
- continue;
52778
- }
52779
- }
52780
- if (isRecordView) {
52781
- putRecordViews[recordId] = true;
52782
- }
52783
- else {
52784
- putRecords[recordId] = true;
52785
- }
52786
- if (isStoreRecordError(record)) {
52787
- hasEntries = true;
52788
- putEntries[recordKey] = value;
52789
- continue;
52790
- }
52791
- let metadata = entry && entry.metadata;
52792
- if (metadata === undefined) {
52793
- metadata = {
52794
- ...storeMetadata[recordKey],
52795
- metadataVersion: DURABLE_METADATA_VERSION,
52796
- };
52797
- }
52798
- const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
52799
- if (denormalizedRecord !== undefined) {
52800
- hasEntries = true;
52801
- putEntries[recordKey] = {
52802
- data: denormalizedRecord,
52803
- metadata,
52804
- };
52805
- // if undefined then it is pending
52806
- // we should still update metadata on pending records
52807
- }
52808
- else {
52809
- hasMetadata = true;
52810
- metadata.expirationTimestamp = metadata.ingestionTimestamp;
52811
- putMetadata[recordKey] = {
52812
- metadata,
52813
- };
52814
- }
52815
- }
52816
- else {
52817
- hasEntries = true;
52818
- putEntries[key] = value;
52819
- }
52820
- }
52821
- return { putEntries, putMetadata, hasEntries, hasMetadata };
52822
- };
52823
- const setEntries = function (entries, segment) {
52824
- if (segment !== DefaultDurableSegment) {
52825
- return durableStore.setEntries(entries, segment);
52826
- }
52827
- const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
52828
- const promises = [
52829
- hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
52830
- ];
52831
- if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
52832
- promises.push(hasMetadata && sqlStore !== undefined
52833
- ? durableStore.setMetadata(putMetadata, segment)
52834
- : undefined);
52835
- }
52836
- return Promise.all(promises).then(() => { });
52837
- };
52838
- const batchOperations = function (operations) {
52839
- const operationsWithDenormedRecords = [];
52840
- for (let i = 0, len = operations.length; i < len; i++) {
52841
- const operation = operations[i];
52842
- if (operation.type === 'setMetadata') {
52843
- // if setMetadata also contains entry data then it needs to be denormalized.
52844
- const keys$1 = keys$4(operation.entries);
52845
- if (keys$1.length > 0) {
52846
- const firstKey = keys$1[0];
52847
- // casted to any to check if data exists
52848
- const firstEntry = operation.entries[firstKey];
52849
- // it is not possible for setMetadata to contain entries with both data and no data in the same operation.
52850
- // this is determined by the plugin supporting update batch calls before it gets to this HOF.
52851
- // so we only need to check one entry to confirm this for performance
52852
- if (firstEntry.data !== undefined) {
52853
- const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
52854
- operationsWithDenormedRecords.push({
52855
- ...operation,
52856
- entries: putEntries,
52857
- });
52858
- if (hasMetadata &&
52859
- sqlStore !== undefined &&
52860
- sqlStore.isBatchUpdateSupported() === true) {
52861
- operationsWithDenormedRecords.push({
52862
- ...operation,
52863
- entries: putMetadata,
52864
- type: 'setMetadata',
52865
- });
52866
- }
52867
- }
52868
- else {
52869
- operationsWithDenormedRecords.push(operation);
52870
- }
52871
- }
52872
- continue;
52873
- }
52874
- if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
52875
- operationsWithDenormedRecords.push(operation);
52876
- continue;
52877
- }
52878
- const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
52879
- operationsWithDenormedRecords.push({
52880
- ...operation,
52881
- entries: putEntries,
52882
- });
52883
- if (hasMetadata &&
52884
- sqlStore !== undefined &&
52885
- sqlStore.isBatchUpdateSupported() === true) {
52886
- operationsWithDenormedRecords.push({
52887
- ...operation,
52888
- entries: putMetadata,
52889
- type: 'setMetadata',
52890
- });
52891
- }
52892
- }
52893
- return durableStore.batchOperations(operationsWithDenormedRecords);
52894
- };
52895
- /**
52896
- * Retrieves a denormalized record from the store
52897
- * NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
52898
- * @param recordKey record key
52899
- * @param durableStore the durable store
52900
- * @returns a DraftRecordRepresentation containing the requested fields
52901
- */
52902
- const getDenormalizedRecord = function (recordKey) {
52903
- return durableStore.getEntries([recordKey], DefaultDurableSegment).then((entries) => {
52904
- if (entries === undefined) {
52905
- return undefined;
52906
- }
52907
- const denormalizedEntry = entries[recordKey];
52908
- if (denormalizedEntry === undefined) {
52909
- return undefined;
52910
- }
52911
- // don't include link information
52912
- const denormalizedRecord = denormalizedEntry.data;
52913
- if (isStoreRecordError(denormalizedRecord)) {
52914
- return undefined;
52915
- }
52916
- return denormalizedRecord;
52917
- });
52918
- };
52919
- return create$4(durableStore, {
52920
- getEntries: { value: getEntries, writable: true },
52921
- setEntries: { value: setEntries, writable: true },
52922
- batchOperations: { value: batchOperations, writable: true },
52923
- getDenormalizedRecord: { value: getDenormalizedRecord, writable: true },
52924
- });
52925
- }
52926
-
52927
52566
  /**
52928
52567
  * This function takes an unknown error and normalizes it to an Error object
52929
52568
  */
@@ -52962,7 +52601,7 @@
52962
52601
  }
52963
52602
  return createOkResponse(data);
52964
52603
  };
52965
- return create$4(env, {
52604
+ return create$5(env, {
52966
52605
  dispatchResourceRequest: { value: dispatchResourceRequest },
52967
52606
  });
52968
52607
  }
@@ -53029,7 +52668,7 @@
53029
52668
  };
53030
52669
  }
53031
52670
  objectInfoMap.set(apiName, objectInfo);
53032
- const fields = keys$4(operation.fields);
52671
+ const fields = keys$5(operation.fields);
53033
52672
  const unexpectedFields = [];
53034
52673
  for (const field of fields) {
53035
52674
  const fieldInfo = objectInfo.fields[field];
@@ -53353,7 +52992,7 @@
53353
52992
  ...trimmedDownData.contentVersion,
53354
52993
  fields: cvFields,
53355
52994
  };
53356
- freeze$3(trimmedDownData);
52995
+ freeze$1$1(trimmedDownData);
53357
52996
  snapshot.data = trimmedDownData;
53358
52997
  }
53359
52998
  eventEmitter({ type: 'create-content-document-and-version-draft-finished' });
@@ -53367,14 +53006,13 @@
53367
53006
  const CONTENT_VERSION_API_NAME = 'ContentVersion';
53368
53007
  const LATEST_PUBLISHED_VERSION_ID_FIELD = 'LatestPublishedVersionId';
53369
53008
  class ContentDocumentCompositeRepresentationActionHandler extends AbstractResourceRequestActionHandler {
53370
- constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, durableStore, binaryStore) {
53009
+ constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, binaryStore) {
53371
53010
  super(draftQueue, networkAdapter, getLuvio);
53372
53011
  this.getLuvio = getLuvio;
53373
53012
  this.draftRecordService = draftRecordService;
53374
53013
  this.draftQueue = draftQueue;
53375
53014
  this.networkAdapter = networkAdapter;
53376
53015
  this.isDraftId = isDraftId;
53377
- this.durableStore = durableStore;
53378
53016
  this.binaryStore = binaryStore;
53379
53017
  this.binaryStoreUrlsToUpdate = new Map();
53380
53018
  this.handlerId = HANDLER_ID;
@@ -53786,6 +53424,389 @@
53786
53424
  };
53787
53425
  }
53788
53426
 
53427
+ /**
53428
+ * Copyright (c) 2022, Salesforce, Inc.,
53429
+ * All rights reserved.
53430
+ * For full license text, see the LICENSE.txt file
53431
+ */
53432
+
53433
+
53434
+ const { keys: keys$4, values: values$2, create: create$4, assign: assign$4, freeze: freeze$3, entries: entries$4 } = Object;
53435
+
53436
+ function buildRecordFieldStoreKey(recordKey, fieldName) {
53437
+ return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
53438
+ }
53439
+ function isStoreKeyRecordId(key) {
53440
+ return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
53441
+ }
53442
+ function createLink$2(key) {
53443
+ return { __ref: key };
53444
+ }
53445
+ function isStoreRecordError(storeRecord) {
53446
+ return storeRecord.__type === 'error';
53447
+ }
53448
+ function isEntryDurableRecordRepresentation(entry, key) {
53449
+ // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
53450
+ return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
53451
+ entry.data.__type === undefined);
53452
+ }
53453
+ /**
53454
+ * Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
53455
+ * durable store record representation and normalizes it back out into the format the the luvio store expects it
53456
+ * @param key Record store key
53457
+ * @param entry Durable entry containing a denormalized record representation
53458
+ * @returns a set of entries containing the normalized record and its normalized fields
53459
+ */
53460
+ function normalizeRecordFields(key, entry) {
53461
+ const { data: record } = entry;
53462
+ const { fields, links } = record;
53463
+ const missingFieldLinks = keys$4(links);
53464
+ const fieldNames = keys$4(fields);
53465
+ const normalizedFields = {};
53466
+ const returnEntries = {};
53467
+ // restore fields
53468
+ for (let i = 0, len = fieldNames.length; i < len; i++) {
53469
+ const fieldName = fieldNames[i];
53470
+ const field = fields[fieldName];
53471
+ const fieldKey = buildRecordFieldStoreKey(key, fieldName);
53472
+ returnEntries[fieldKey] = { data: field };
53473
+ normalizedFields[fieldName] = createLink$2(fieldKey);
53474
+ }
53475
+ // restore missing fields
53476
+ for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
53477
+ const fieldName = missingFieldLinks[i];
53478
+ const link = links[fieldName];
53479
+ if (link.isMissing === true) {
53480
+ normalizedFields[fieldName] = { ...link, __ref: undefined };
53481
+ }
53482
+ }
53483
+ returnEntries[key] = {
53484
+ data: assign$4(record, { fields: normalizedFields }),
53485
+ metadata: entry.metadata,
53486
+ };
53487
+ return returnEntries;
53488
+ }
53489
+ /**
53490
+ * Transforms a record for storage in the durable store. The transformation involves denormalizing
53491
+ * scalar fields and persisting link metadata to transform back into a normalized representation
53492
+ *
53493
+ * If the record contains pending fields this will return undefined as pending records do not get persisted
53494
+ * to the durable store. There should be a refresh operation outbound that will bring in the updated record.
53495
+ *
53496
+ * @param normalizedRecord Record containing normalized field links
53497
+ * @param recordStore a store containing referenced record fields
53498
+ */
53499
+ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
53500
+ const fields = normalizedRecord.fields;
53501
+ const filteredFields = {};
53502
+ const links = {};
53503
+ const fieldNames = keys$4(fields);
53504
+ for (let i = 0, len = fieldNames.length; i < len; i++) {
53505
+ const fieldName = fieldNames[i];
53506
+ const field = fields[fieldName];
53507
+ // pending fields get filtered out of the durable store
53508
+ const { pending } = field;
53509
+ if (pending === true) {
53510
+ // do not write records with pending fields to the durable store
53511
+ // there should be a refresh operation outbound that will bring in the updated record
53512
+ return undefined;
53513
+ }
53514
+ const { __ref } = field;
53515
+ if (__ref !== undefined) {
53516
+ let ref = records[__ref];
53517
+ if (pendingEntries !== undefined) {
53518
+ // If the ref was part of the pending write that takes precedence
53519
+ const pendingEntry = pendingEntries[__ref];
53520
+ if (pendingEntry !== undefined) {
53521
+ ref = pendingEntry.data;
53522
+ }
53523
+ }
53524
+ // if field reference exists then add it to our filteredFields
53525
+ if (ref !== undefined) {
53526
+ filteredFields[fieldName] = ref;
53527
+ }
53528
+ else {
53529
+ // if we have a store to read, try to find the field there too
53530
+ // The durable ingest staging store may pass through to L1, and
53531
+ // not all fields are necessarily published every time, so it is
53532
+ // important to check L1 and not just the fields being published,
53533
+ // otherwise we risk truncating the fields on the record.
53534
+ if (store) {
53535
+ ref = store.readEntry(__ref);
53536
+ if (ref !== undefined) {
53537
+ filteredFields[fieldName] = ref;
53538
+ }
53539
+ }
53540
+ }
53541
+ }
53542
+ // we want to preserve fields that are missing nodes
53543
+ if (field.isMissing === true) {
53544
+ links[fieldName] = field;
53545
+ }
53546
+ }
53547
+ return {
53548
+ ...normalizedRecord,
53549
+ fields: filteredFields,
53550
+ links,
53551
+ };
53552
+ }
53553
+ function getDenormalizedKey(originalKey, recordId, luvio) {
53554
+ // this will likely need to be handled when moving to structured keys
53555
+ // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
53556
+ // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
53557
+ if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
53558
+ return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
53559
+ }
53560
+ return keyBuilder$26(luvio, { recordId });
53561
+ }
53562
+ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
53563
+ const getEntries = function (entries, segment) {
53564
+ // this HOF only inspects records in the default segment
53565
+ if (segment !== DefaultDurableSegment) {
53566
+ return durableStore.getEntries(entries, segment);
53567
+ }
53568
+ const { length: entriesLength } = entries;
53569
+ if (entriesLength === 0) {
53570
+ return Promise.resolve({});
53571
+ }
53572
+ // filter out record field keys
53573
+ const filteredEntryIds = [];
53574
+ // map of records to avoid requesting duplicate record keys when requesting both records and fields
53575
+ const recordEntries = {};
53576
+ const recordViewEntries = {};
53577
+ for (let i = 0, len = entriesLength; i < len; i++) {
53578
+ const id = entries[i];
53579
+ const recordId = extractRecordIdFromStoreKey$1(id);
53580
+ if (recordId !== undefined) {
53581
+ if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
53582
+ if (recordViewEntries[recordId] === undefined) {
53583
+ const key = getDenormalizedKey(id, recordId, luvio);
53584
+ recordViewEntries[recordId] = true;
53585
+ filteredEntryIds.push(key);
53586
+ }
53587
+ }
53588
+ else {
53589
+ if (recordEntries[recordId] === undefined) {
53590
+ const key = getDenormalizedKey(id, recordId, luvio);
53591
+ recordEntries[recordId] = true;
53592
+ filteredEntryIds.push(key);
53593
+ }
53594
+ }
53595
+ }
53596
+ else {
53597
+ filteredEntryIds.push(id);
53598
+ }
53599
+ }
53600
+ // call base getEntries
53601
+ return durableStore.getEntries(filteredEntryIds, segment).then((durableEntries) => {
53602
+ if (durableEntries === undefined) {
53603
+ return undefined;
53604
+ }
53605
+ const returnEntries = create$4(null);
53606
+ const keys$1 = keys$4(durableEntries);
53607
+ for (let i = 0, len = keys$1.length; i < len; i++) {
53608
+ const key = keys$1[i];
53609
+ const value = durableEntries[key];
53610
+ if (value === undefined) {
53611
+ continue;
53612
+ }
53613
+ if (isEntryDurableRecordRepresentation(value, key)) {
53614
+ assign$4(returnEntries, normalizeRecordFields(key, value));
53615
+ }
53616
+ else {
53617
+ returnEntries[key] = value;
53618
+ }
53619
+ }
53620
+ return returnEntries;
53621
+ });
53622
+ };
53623
+ const denormalizeEntries = function (entries) {
53624
+ let hasEntries = false;
53625
+ let hasMetadata = false;
53626
+ const putEntries = create$4(null);
53627
+ const putMetadata = create$4(null);
53628
+ const keys$1 = keys$4(entries);
53629
+ const putRecords = {};
53630
+ const putRecordViews = {};
53631
+ const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
53632
+ const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
53633
+ const store = getStore();
53634
+ for (let i = 0, len = keys$1.length; i < len; i++) {
53635
+ const key = keys$1[i];
53636
+ let value = entries[key];
53637
+ const recordId = extractRecordIdFromStoreKey$1(key);
53638
+ // do not put normalized field values
53639
+ if (recordId !== undefined) {
53640
+ const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
53641
+ if (isRecordView) {
53642
+ if (putRecordViews[recordId] === true) {
53643
+ continue;
53644
+ }
53645
+ }
53646
+ else {
53647
+ if (putRecords[recordId] === true) {
53648
+ continue;
53649
+ }
53650
+ }
53651
+ const recordKey = getDenormalizedKey(key, recordId, luvio);
53652
+ const recordEntries = entries;
53653
+ const entry = recordEntries[recordKey];
53654
+ let record = entry && entry.data;
53655
+ if (record === undefined) {
53656
+ record = storeRecords[recordKey];
53657
+ if (record === undefined) {
53658
+ // fields are being published without a record for them existing,
53659
+ // fields cannot exist standalone in the durable store
53660
+ continue;
53661
+ }
53662
+ }
53663
+ if (isRecordView) {
53664
+ putRecordViews[recordId] = true;
53665
+ }
53666
+ else {
53667
+ putRecords[recordId] = true;
53668
+ }
53669
+ if (isStoreRecordError(record)) {
53670
+ hasEntries = true;
53671
+ putEntries[recordKey] = value;
53672
+ continue;
53673
+ }
53674
+ let metadata = entry && entry.metadata;
53675
+ if (metadata === undefined) {
53676
+ metadata = {
53677
+ ...storeMetadata[recordKey],
53678
+ metadataVersion: DURABLE_METADATA_VERSION,
53679
+ };
53680
+ }
53681
+ const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
53682
+ if (denormalizedRecord !== undefined) {
53683
+ hasEntries = true;
53684
+ putEntries[recordKey] = {
53685
+ data: denormalizedRecord,
53686
+ metadata,
53687
+ };
53688
+ // if undefined then it is pending
53689
+ // we should still update metadata on pending records
53690
+ }
53691
+ else {
53692
+ hasMetadata = true;
53693
+ metadata.expirationTimestamp = metadata.ingestionTimestamp;
53694
+ putMetadata[recordKey] = {
53695
+ metadata,
53696
+ };
53697
+ }
53698
+ }
53699
+ else {
53700
+ hasEntries = true;
53701
+ putEntries[key] = value;
53702
+ }
53703
+ }
53704
+ return { putEntries, putMetadata, hasEntries, hasMetadata };
53705
+ };
53706
+ const setEntries = function (entries, segment) {
53707
+ if (segment !== DefaultDurableSegment) {
53708
+ return durableStore.setEntries(entries, segment);
53709
+ }
53710
+ const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
53711
+ const promises = [
53712
+ hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
53713
+ ];
53714
+ if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
53715
+ promises.push(hasMetadata && sqlStore !== undefined
53716
+ ? durableStore.setMetadata(putMetadata, segment)
53717
+ : undefined);
53718
+ }
53719
+ return Promise.all(promises).then(() => { });
53720
+ };
53721
+ const batchOperations = function (operations) {
53722
+ const operationsWithDenormedRecords = [];
53723
+ for (let i = 0, len = operations.length; i < len; i++) {
53724
+ const operation = operations[i];
53725
+ if (operation.type === 'setMetadata') {
53726
+ // if setMetadata also contains entry data then it needs to be denormalized.
53727
+ const keys$1 = keys$4(operation.entries);
53728
+ if (keys$1.length > 0) {
53729
+ const firstKey = keys$1[0];
53730
+ // casted to any to check if data exists
53731
+ const firstEntry = operation.entries[firstKey];
53732
+ // it is not possible for setMetadata to contain entries with both data and no data in the same operation.
53733
+ // this is determined by the plugin supporting update batch calls before it gets to this HOF.
53734
+ // so we only need to check one entry to confirm this for performance
53735
+ if (firstEntry.data !== undefined) {
53736
+ const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
53737
+ operationsWithDenormedRecords.push({
53738
+ ...operation,
53739
+ entries: putEntries,
53740
+ });
53741
+ if (hasMetadata &&
53742
+ sqlStore !== undefined &&
53743
+ sqlStore.isBatchUpdateSupported() === true) {
53744
+ operationsWithDenormedRecords.push({
53745
+ ...operation,
53746
+ entries: putMetadata,
53747
+ type: 'setMetadata',
53748
+ });
53749
+ }
53750
+ }
53751
+ else {
53752
+ operationsWithDenormedRecords.push(operation);
53753
+ }
53754
+ }
53755
+ continue;
53756
+ }
53757
+ if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
53758
+ operationsWithDenormedRecords.push(operation);
53759
+ continue;
53760
+ }
53761
+ const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
53762
+ operationsWithDenormedRecords.push({
53763
+ ...operation,
53764
+ entries: putEntries,
53765
+ });
53766
+ if (hasMetadata &&
53767
+ sqlStore !== undefined &&
53768
+ sqlStore.isBatchUpdateSupported() === true) {
53769
+ operationsWithDenormedRecords.push({
53770
+ ...operation,
53771
+ entries: putMetadata,
53772
+ type: 'setMetadata',
53773
+ });
53774
+ }
53775
+ }
53776
+ return durableStore.batchOperations(operationsWithDenormedRecords);
53777
+ };
53778
+ /**
53779
+ * Retrieves a denormalized record from the store
53780
+ * NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
53781
+ * @param recordKey record key
53782
+ * @param durableStore the durable store
53783
+ * @returns a DraftRecordRepresentation containing the requested fields
53784
+ */
53785
+ const getDenormalizedRecord = function (recordKey) {
53786
+ return durableStore.getEntries([recordKey], DefaultDurableSegment).then((entries) => {
53787
+ if (entries === undefined) {
53788
+ return undefined;
53789
+ }
53790
+ const denormalizedEntry = entries[recordKey];
53791
+ if (denormalizedEntry === undefined) {
53792
+ return undefined;
53793
+ }
53794
+ // don't include link information
53795
+ const denormalizedRecord = denormalizedEntry.data;
53796
+ if (isStoreRecordError(denormalizedRecord)) {
53797
+ return undefined;
53798
+ }
53799
+ return denormalizedRecord;
53800
+ });
53801
+ };
53802
+ return create$4(durableStore, {
53803
+ getEntries: { value: getEntries, writable: true },
53804
+ setEntries: { value: setEntries, writable: true },
53805
+ batchOperations: { value: batchOperations, writable: true },
53806
+ getDenormalizedRecord: { value: getDenormalizedRecord, writable: true },
53807
+ });
53808
+ }
53809
+
53789
53810
  function serializeFieldArguments$1(argumentNodes, variables) {
53790
53811
  const mutableArgumentNodes = Object.assign([], argumentNodes);
53791
53812
  return `args__(${mutableArgumentNodes
@@ -60587,7 +60608,7 @@
60587
60608
  };
60588
60609
  }
60589
60610
 
60590
- const { keys: keys$9, create: create$7, assign: assign$7, entries, values } = Object;
60611
+ const { keys: keys$a, create: create$8, assign: assign$8, entries, values } = Object;
60591
60612
  const { stringify: stringify$7, parse: parse$7 } = JSON;
60592
60613
 
60593
60614
  function selectColumnsFromTableWhereKeyIn(columnNames, table, keyColumnName, whereIn) {
@@ -60654,7 +60675,7 @@
60654
60675
  },
60655
60676
  conflictColumns: this.conflictColumnNames,
60656
60677
  columns: this.columnNames,
60657
- rows: keys$9(entries).reduce((rows, key) => {
60678
+ rows: keys$a(entries).reduce((rows, key) => {
60658
60679
  const entry = entries[key];
60659
60680
  const { data, metadata } = entry;
60660
60681
  const row = [key, stringify$7(data), metadata ? stringify$7(metadata) : null];
@@ -60673,7 +60694,7 @@
60673
60694
  type: 'setMetadata',
60674
60695
  },
60675
60696
  columns: [COLUMN_NAME_METADATA$1],
60676
- values: keys$9(entries).reduce((values, key) => {
60697
+ values: keys$a(entries).reduce((values, key) => {
60677
60698
  const { metadata } = entries[key];
60678
60699
  const row = [metadata ? stringify$7(metadata) : null];
60679
60700
  values[key] = row;
@@ -60763,7 +60784,7 @@
60763
60784
  },
60764
60785
  conflictColumns: this.conflictColumnNames,
60765
60786
  columns: this.columnNames,
60766
- rows: keys$9(entries).reduce((rows, key) => {
60787
+ rows: keys$a(entries).reduce((rows, key) => {
60767
60788
  const entry = entries[key];
60768
60789
  const { data, metadata } = entry;
60769
60790
  const row = [key, stringify$7(data)];
@@ -60789,7 +60810,7 @@
60789
60810
  type: 'setMetadata',
60790
60811
  },
60791
60812
  columns: [COLUMN_NAME_METADATA],
60792
- values: keys$9(entries).reduce((values, key) => {
60813
+ values: keys$a(entries).reduce((values, key) => {
60793
60814
  const { metadata } = entries[key];
60794
60815
  const row = [metadata ? stringify$7(metadata) : null];
60795
60816
  values[key] = row;
@@ -60798,7 +60819,7 @@
60798
60819
  };
60799
60820
  }
60800
60821
  metadataToUpdateSQLQueries(entries, segment) {
60801
- return keys$9(entries).reduce((accu, key) => {
60822
+ return keys$a(entries).reduce((accu, key) => {
60802
60823
  const { metadata } = entries[key];
60803
60824
  if (metadata !== undefined) {
60804
60825
  accu.push({
@@ -60869,7 +60890,7 @@
60869
60890
  return this.getTable(segment).getAll(segment);
60870
60891
  }
60871
60892
  setEntries(entries, segment) {
60872
- if (keys$9(entries).length === 0) {
60893
+ if (keys$a(entries).length === 0) {
60873
60894
  return Promise.resolve();
60874
60895
  }
60875
60896
  const table = this.getTable(segment);
@@ -60877,7 +60898,7 @@
60877
60898
  return this.batchOperationAsPromise([upsertOperation]);
60878
60899
  }
60879
60900
  setMetadata(entries, segment) {
60880
- if (keys$9(entries).length === 0) {
60901
+ if (keys$a(entries).length === 0) {
60881
60902
  return Promise.resolve();
60882
60903
  }
60883
60904
  const table = this.getTable(segment);
@@ -60896,13 +60917,13 @@
60896
60917
  batchOperations(operations) {
60897
60918
  const sqliteOperations = operations.reduce((acc, cur) => {
60898
60919
  if (cur.type === 'setEntries') {
60899
- if (keys$9(cur.entries).length > 0) {
60920
+ if (keys$a(cur.entries).length > 0) {
60900
60921
  const table = this.getTable(cur.segment);
60901
60922
  acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
60902
60923
  }
60903
60924
  }
60904
60925
  else if (cur.type === 'setMetadata') {
60905
- if (keys$9(cur.entries).length > 0) {
60926
+ if (keys$a(cur.entries).length > 0) {
60906
60927
  const table = this.getTable(cur.segment);
60907
60928
  if (this.supportsBatchUpdates) {
60908
60929
  acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
@@ -61035,7 +61056,7 @@
61035
61056
  },
61036
61057
  conflictColumns: this.conflictColumnNames,
61037
61058
  columns: this.columnNames,
61038
- rows: keys$9(entries).reduce((rows, key) => {
61059
+ rows: keys$a(entries).reduce((rows, key) => {
61039
61060
  const entry = entries[key];
61040
61061
  rows.push([key, stringify$7(entry.data)]);
61041
61062
  return rows;
@@ -62546,7 +62567,7 @@
62546
62567
  const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
62547
62568
  const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService);
62548
62569
  const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated);
62549
- const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, recordDenormingStore, NimbusBinaryStore);
62570
+ const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore);
62550
62571
  lazyDraftQueue.addHandler(uiApiRecordHandler);
62551
62572
  lazyDraftQueue.addHandler(quickActionHandler);
62552
62573
  lazyDraftQueue.addHandler(contentDocumentCompositeActionHandler);
@@ -62645,7 +62666,7 @@
62645
62666
  id: '@salesforce/lds-network-adapter',
62646
62667
  instrument: instrument$2,
62647
62668
  });
62648
- // version: 1.296.1-1aa7fc7e3
62669
+ // version: 1.298.0-3a2eedddc
62649
62670
 
62650
62671
  const { create: create$3, keys: keys$3 } = Object;
62651
62672
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -82714,7 +82735,7 @@
82714
82735
  configuration: { ...configurationForGraphQLAdapters$1 },
82715
82736
  instrument: instrument$1,
82716
82737
  });
82717
- // version: 1.296.1-cf86708a0
82738
+ // version: 1.298.0-6f15dc1ec
82718
82739
 
82719
82740
  // On core the unstable adapters are re-exported with different names,
82720
82741
  // we want to match them here.
@@ -84970,7 +84991,7 @@
84970
84991
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
84971
84992
  graphQLImperative = ldsAdapter;
84972
84993
  });
84973
- // version: 1.296.1-cf86708a0
84994
+ // version: 1.298.0-6f15dc1ec
84974
84995
 
84975
84996
  var gqlApi = /*#__PURE__*/Object.freeze({
84976
84997
  __proto__: null,
@@ -84995,7 +85016,7 @@
84995
85016
  if (lazyDMLAdapterMap === undefined || lazyImperativeAdapterMap === undefined) {
84996
85017
  // We should eventually be explicit about what we expose here instead of exporting everything from the modules,
84997
85018
  // this is our API contract to native callers and should be explicit
84998
- const map = Object.assign({}, gqlApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi);
85019
+ const map = Object.assign({}, gqlApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi);
84999
85020
  const imperativeAdapterNames = keys$3(map).filter((name) => name.endsWith(IMPERATIVE_ADAPTER_SUFFIX));
85000
85021
  const imperativeMap = {};
85001
85022
  for (const adapterName of imperativeAdapterNames) {
@@ -85705,7 +85726,7 @@
85705
85726
  function register(r) {
85706
85727
  callbacks$1.forEach((callback) => callback(r));
85707
85728
  }
85708
- // version: 1.296.1-1aa7fc7e3
85729
+ // version: 1.298.0-3a2eedddc
85709
85730
 
85710
85731
  /**
85711
85732
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -90686,4 +90707,4 @@
90686
90707
  exports.subscribeToAdapter = subscribeToAdapter;
90687
90708
 
90688
90709
  }));
90689
- // version: 1.296.1-1aa7fc7e3
90710
+ // version: 1.298.0-3a2eedddc