@salesforce/lds-worker-api 1.296.1 → 1.297.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.297.0-1fc775982
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.297.0-1fc775982
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.297.0-1fc775982
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) {
@@ -44244,7 +44244,7 @@
44244
44244
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44245
44245
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44246
44246
  });
44247
- // version: 1.296.1-cf86708a0
44247
+ // version: 1.297.0-e0cfbd880
44248
44248
 
44249
44249
  var ldsIdempotencyWriteDisabled = {
44250
44250
  isOpen: function (e) {
@@ -44420,7 +44420,7 @@
44420
44420
  const { parse: parse$6, stringify: stringify$6 } = JSON;
44421
44421
  const { join: join$2, push: push$2, unshift } = Array.prototype;
44422
44422
  const { isArray: isArray$5 } = Array;
44423
- const { entries: entries$5, keys: keys$8 } = Object;
44423
+ const { entries: entries$6, keys: keys$9 } = Object;
44424
44424
 
44425
44425
  const UI_API_BASE_URI = '/services/data/v62.0/ui-api';
44426
44426
 
@@ -44485,7 +44485,7 @@
44485
44485
  function mergeRecordFields$1(first, second) {
44486
44486
  const { fields: targetFields } = first;
44487
44487
  const { fields: sourceFields } = second;
44488
- const fieldNames = keys$8(sourceFields);
44488
+ const fieldNames = keys$9(sourceFields);
44489
44489
  for (let i = 0, len = fieldNames.length; i < len; i += 1) {
44490
44490
  const fieldName = fieldNames[i];
44491
44491
  const sourceField = sourceFields[fieldName];
@@ -44727,7 +44727,7 @@
44727
44727
  if (fulfill === undefined) {
44728
44728
  return null;
44729
44729
  }
44730
- const handlersMap = entries$5(inflightRequests);
44730
+ const handlersMap = entries$6(inflightRequests);
44731
44731
  for (let i = 0, len = handlersMap.length; i < len; i += 1) {
44732
44732
  const [transactionKey, handlers] = handlersMap[i];
44733
44733
  // check fulfillment against only the first handler ([0]) because it's equal or
@@ -44892,7 +44892,7 @@
44892
44892
  const MessagingDurableSegment = 'MESSAGING';
44893
44893
  const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
44894
44894
 
44895
- const { keys: keys$7, create: create$6, assign: assign$6, freeze: freeze$1$1 } = Object;
44895
+ const { keys: keys$8, create: create$7, assign: assign$7, freeze: freeze$2$1 } = Object;
44896
44896
 
44897
44897
  //Durable store error instrumentation key
44898
44898
  const DURABLE_STORE_ERROR = 'durable-store-error';
@@ -44939,7 +44939,7 @@
44939
44939
  if (durableRecords === undefined) {
44940
44940
  return { revivedKeys, hadUnexpectedShape };
44941
44941
  }
44942
- const durableKeys = keys$7(durableRecords);
44942
+ const durableKeys = keys$8(durableRecords);
44943
44943
  if (durableKeys.length === 0) {
44944
44944
  // no records to revive
44945
44945
  return { revivedKeys, hadUnexpectedShape };
@@ -45124,7 +45124,7 @@
45124
45124
  overrides,
45125
45125
  };
45126
45126
  }
45127
- const keys$1 = keys$7(entries);
45127
+ const keys$1 = keys$8(entries);
45128
45128
  for (let i = 0, len = keys$1.length; i < len; i++) {
45129
45129
  const key = keys$1[i];
45130
45130
  const entry = entries[key];
@@ -45146,14 +45146,14 @@
45146
45146
  }
45147
45147
 
45148
45148
  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);
45149
+ const durableRecords = create$7(null);
45150
+ const refreshedDurableRecords = create$7(null);
45151
+ const evictedRecords = create$7(null);
45152
45152
  const { visitedIds, refreshedIds } = store.fallbackStringKeyInMemoryStore;
45153
45153
  // TODO: W-8909393 Once metadata is stored in its own segment we need to
45154
45154
  // call setEntries for the visitedIds on default segment and call setEntries
45155
45155
  // on the metadata segment for the refreshedIds
45156
- const keys$1 = keys$7({ ...visitedIds, ...refreshedIds });
45156
+ const keys$1 = keys$8({ ...visitedIds, ...refreshedIds });
45157
45157
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
45158
45158
  const key = keys$1[i];
45159
45159
  const canonicalKey = store.getCanonicalRecordId(key);
@@ -45176,7 +45176,7 @@
45176
45176
  setRecordTo(entries, key, record, metadata);
45177
45177
  }
45178
45178
  const durableStoreOperations = additionalDurableStoreOperations;
45179
- const recordKeys = keys$7(durableRecords);
45179
+ const recordKeys = keys$8(durableRecords);
45180
45180
  if (recordKeys.length > 0) {
45181
45181
  // publishes with data
45182
45182
  durableStoreOperations.push({
@@ -45185,7 +45185,7 @@
45185
45185
  segment: DefaultDurableSegment,
45186
45186
  });
45187
45187
  }
45188
- const refreshKeys = keys$7(refreshedDurableRecords);
45188
+ const refreshKeys = keys$8(refreshedDurableRecords);
45189
45189
  if (refreshKeys.length > 0) {
45190
45190
  // publishes with only metadata updates
45191
45191
  durableStoreOperations.push({
@@ -45207,7 +45207,7 @@
45207
45207
  });
45208
45208
  });
45209
45209
  // evicts
45210
- const evictedKeys = keys$7(evictedRecords);
45210
+ const evictedKeys = keys$8(evictedRecords);
45211
45211
  if (evictedKeys.length > 0) {
45212
45212
  durableStoreOperations.push({
45213
45213
  type: 'evictEntries',
@@ -45311,7 +45311,7 @@
45311
45311
  // A reviving store is only "active" during a call to `environment.storeLookup`, and will
45312
45312
  // be used by the reader attempting to build an L1 snapshot. Immediately after the L1 rebuild
45313
45313
  // the reviving store becomes inactive other than receiving change notifications.
45314
- return create$6(upstreamStore, {
45314
+ return create$7(upstreamStore, {
45315
45315
  readEntry: { value: readEntry },
45316
45316
  markStale: { value: markStale },
45317
45317
  clearStale: { value: clearStale },
@@ -45323,7 +45323,7 @@
45323
45323
  const ADAPTER_CONTEXT_ID_SUFFIX = '__NAMED_CONTEXT';
45324
45324
  async function reviveOrCreateContext(adapterId, durableStore, durableStoreErrorHandler, contextStores, pendingContextStoreKeys, onContextLoaded) {
45325
45325
  // initialize empty context store
45326
- contextStores[adapterId] = create$6(null);
45326
+ contextStores[adapterId] = create$7(null);
45327
45327
  const context = {
45328
45328
  set(key, value) {
45329
45329
  contextStores[adapterId][key] = value;
@@ -45388,7 +45388,7 @@
45388
45388
  const revivingStores = new Set();
45389
45389
  // redirects that need to be flushed to the durable store
45390
45390
  const pendingStoreRedirects = new Map();
45391
- const contextStores = create$6(null);
45391
+ const contextStores = create$7(null);
45392
45392
  let initializationPromise = new Promise((resolve) => {
45393
45393
  const finish = () => {
45394
45394
  resolve();
@@ -45465,7 +45465,7 @@
45465
45465
  try {
45466
45466
  const entries = await durableStore.getEntries(adapterContextKeysFromDifferentInstance, AdapterContextSegment);
45467
45467
  if (entries !== undefined) {
45468
- const entryKeys = keys$7(entries);
45468
+ const entryKeys = keys$8(entries);
45469
45469
  for (let i = 0, len = entryKeys.length; i < len; i++) {
45470
45470
  const entryKey = entryKeys[i];
45471
45471
  const entry = entries[entryKey];
@@ -45500,7 +45500,7 @@
45500
45500
  if (filteredKeys.length > 0) {
45501
45501
  const entries = await durableStore.getMetadata(filteredKeys, DefaultDurableSegment);
45502
45502
  if (entries !== undefined) {
45503
- const entryKeys = keys$7(entries);
45503
+ const entryKeys = keys$8(entries);
45504
45504
  for (let i = 0, len = entryKeys.length; i < len; i++) {
45505
45505
  const entryKey = entryKeys[i];
45506
45506
  const { metadata } = entries[entryKey];
@@ -45872,7 +45872,7 @@
45872
45872
  validateNotDisposed();
45873
45873
  const entryKeys = keys$1.map(serializeStructuredKey);
45874
45874
  const entries = await durableStore.getEntries(entryKeys, DefaultDurableSegment);
45875
- if (entries === undefined || keys$7(entries).length === 0) {
45875
+ if (entries === undefined || keys$8(entries).length === 0) {
45876
45876
  return environment.notifyStoreUpdateAvailable(keys$1);
45877
45877
  }
45878
45878
  const now = Date.now();
@@ -45924,7 +45924,7 @@
45924
45924
  type: 'stale-while-revalidate',
45925
45925
  staleDurationSeconds: Number.MAX_SAFE_INTEGER,
45926
45926
  });
45927
- return create$6(environment, {
45927
+ return create$7(environment, {
45928
45928
  publishStoreMetadata: { value: publishStoreMetadata },
45929
45929
  storeIngest: { value: storeIngest },
45930
45930
  storeIngestError: { value: storeIngestError },
@@ -45960,14 +45960,10 @@
45960
45960
  * For full license text, see the LICENSE.txt file
45961
45961
  */
45962
45962
 
45963
-
45964
- function isStoreKeyRecordId(key) {
45965
- return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
45966
- }
45967
45963
  function isStoreKeyRecordField(key) {
45968
45964
  return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) > -1;
45969
45965
  }
45970
- function buildRecordFieldStoreKey(recordKey, fieldName) {
45966
+ function buildRecordFieldStoreKey$1(recordKey, fieldName) {
45971
45967
  return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
45972
45968
  }
45973
45969
  function objectsDeepEqual(lhs, rhs) {
@@ -45994,15 +45990,6 @@
45994
45990
  return true;
45995
45991
  }
45996
45992
 
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
45993
  /**
46007
45994
  * Copyright (c) 2022, Salesforce, Inc.,
46008
45995
  * All rights reserved.
@@ -46388,7 +46375,7 @@
46388
46375
  function errors(result) {
46389
46376
  return result.error;
46390
46377
  }
46391
- function values$4(result) {
46378
+ function values$5(result) {
46392
46379
  return result.value;
46393
46380
  }
46394
46381
  function flattenResults(results) {
@@ -46396,7 +46383,7 @@
46396
46383
  if (fails.length > 0) {
46397
46384
  return failure(fails);
46398
46385
  }
46399
- return success(results.filter(isSuccess).map(values$4));
46386
+ return success(results.filter(isSuccess).map(values$5));
46400
46387
  }
46401
46388
 
46402
46389
  function getFieldInfo(apiName, fieldName, infoMap) {
@@ -47213,7 +47200,7 @@
47213
47200
  }
47214
47201
 
47215
47202
  const { isArray: isArray$4 } = Array;
47216
- const { keys: keys$6 } = Object;
47203
+ const { keys: keys$7 } = Object;
47217
47204
 
47218
47205
  function isListValueNode(node) {
47219
47206
  return node.kind === 'ListValue';
@@ -47281,7 +47268,7 @@
47281
47268
  if (failures.length > 0) {
47282
47269
  return failure(failures);
47283
47270
  }
47284
- const containers = results.filter(isSuccess).map(values$4);
47271
+ const containers = results.filter(isSuccess).map(values$5);
47285
47272
  const predicates = [];
47286
47273
  containers.forEach((c) => {
47287
47274
  if (c.predicate !== undefined) {
@@ -47573,7 +47560,7 @@
47573
47560
  if (fails.length > 0) {
47574
47561
  return failure(fails);
47575
47562
  }
47576
- const vals = results.filter(isSuccess).reduce(flatMap$1(values$4), []);
47563
+ const vals = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
47577
47564
  return success(vals);
47578
47565
  }
47579
47566
  function isFilterFunction(name) {
@@ -47583,7 +47570,7 @@
47583
47570
  const results = Object.entries(operatorNode.fields)
47584
47571
  .filter(([key, _]) => isFilterFunction(key) === false)
47585
47572
  .map(([key, value]) => operatorWithValue(key, value, dataType));
47586
- const _values = results.filter(isSuccess).map(values$4);
47573
+ const _values = results.filter(isSuccess).map(values$5);
47587
47574
  const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
47588
47575
  if (fails.length > 0) {
47589
47576
  return failure(fails);
@@ -48504,7 +48491,7 @@
48504
48491
  }
48505
48492
  function recordFields(luvioSelections, names, parentApiName, parentAlias, input, joins) {
48506
48493
  const results = luvioSelections.map((selection) => selectionToQueryField(selection, names, parentApiName, parentAlias, input, joins));
48507
- const fields = results.filter(isSuccess).reduce(flatMap$1(values$4), []);
48494
+ const fields = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
48508
48495
  const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
48509
48496
  if (fails.length > 0) {
48510
48497
  return failure(fails);
@@ -48752,7 +48739,7 @@
48752
48739
  }
48753
48740
  function rootQuery(recordNodes, input) {
48754
48741
  const results = recordNodes.map((record) => rootRecordQuery(record, input));
48755
- const connections = results.filter(isSuccess).map(values$4);
48742
+ const connections = results.filter(isSuccess).map(values$5);
48756
48743
  const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
48757
48744
  if (fails.length > 0) {
48758
48745
  return failure(fails);
@@ -48848,7 +48835,7 @@
48848
48835
  switch (valueNode.kind) {
48849
48836
  case Kind$1.OBJECT: {
48850
48837
  // For example, `{ Id: { eq: $draftId } }` is a `ObjectValueNode`, which has field keys 'Id'
48851
- const resultQuery = keys$6(valueNode.fields)
48838
+ const resultQuery = keys$7(valueNode.fields)
48852
48839
  .map((key) => generateVariableSubQuery(valueNode.fields[key], key, type, variables))
48853
48840
  .filter((subquery) => subquery.length > 0)
48854
48841
  .join(',');
@@ -48924,7 +48911,7 @@
48924
48911
  }
48925
48912
  function swapValueNodeWithVariableNodes(original, swapped) {
48926
48913
  if (original.kind === Kind$1.OBJECT) {
48927
- for (const key of keys$6(original.fields)) {
48914
+ for (const key of keys$7(original.fields)) {
48928
48915
  if (isObjectValueNode$1(swapped) && swapped.fields[key]) {
48929
48916
  if (is(original.fields[key], 'Variable')) {
48930
48917
  original.fields[key] = swapped.fields[key];
@@ -49533,7 +49520,7 @@
49533
49520
  return new DraftErrorFetchResponse(HttpStatusCode$1.BadRequest, error);
49534
49521
  }
49535
49522
 
49536
- const { keys: keys$5, create: create$5, assign: assign$5, values: values$3 } = Object;
49523
+ const { keys: keys$6, create: create$6, assign: assign$6, values: values$4 } = Object;
49537
49524
  const { stringify: stringify$5, parse: parse$5 } = JSON;
49538
49525
  const { isArray: isArray$3$1 } = Array;
49539
49526
 
@@ -49643,13 +49630,13 @@
49643
49630
  }
49644
49631
  softEvict(key);
49645
49632
  };
49646
- return create$5(luvio, {
49633
+ return create$6(luvio, {
49647
49634
  dispatchResourceRequest: { value: dispatchResourceRequest },
49648
49635
  publishStoreMetadata: { value: publishStoreMetadata },
49649
49636
  storeEvict: { value: storeEvict },
49650
49637
  });
49651
49638
  }
49652
- return create$5(luvio, {
49639
+ return create$6(luvio, {
49653
49640
  dispatchResourceRequest: { value: dispatchResourceRequest },
49654
49641
  publishStoreMetadata: { value: publishStoreMetadata },
49655
49642
  });
@@ -49683,7 +49670,7 @@
49683
49670
  if (entries === undefined) {
49684
49671
  return mappings;
49685
49672
  }
49686
- const keys$1 = keys$5(entries);
49673
+ const keys$1 = keys$6(entries);
49687
49674
  for (const key of keys$1) {
49688
49675
  const entry = entries[key].data;
49689
49676
  if (isLegacyDraftIdMapping(key)) {
@@ -49701,7 +49688,7 @@
49701
49688
  async function clearDraftIdSegment(durableStore) {
49702
49689
  const entries = await durableStore.getAllEntries(DRAFT_ID_MAPPINGS_SEGMENT);
49703
49690
  if (entries) {
49704
- const keys$1 = keys$5(entries);
49691
+ const keys$1 = keys$6(entries);
49705
49692
  if (keys$1.length > 0) {
49706
49693
  await durableStore.evictEntries(keys$1, DRAFT_ID_MAPPINGS_SEGMENT);
49707
49694
  }
@@ -49960,7 +49947,7 @@
49960
49947
  const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
49961
49948
  // write the queue operations to the store prior to ingesting the result
49962
49949
  await this.draftStore.completeAction(queueOperations);
49963
- await handler.handleActionCompleted(action, queueOperations, values$3(this.handlers));
49950
+ await handler.handleActionCompleted(action, queueOperations, values$4(this.handlers));
49964
49951
  this.retryIntervalMilliseconds = 0;
49965
49952
  this.uploadingActionId = undefined;
49966
49953
  await this.notifyChangedListeners({
@@ -50112,7 +50099,7 @@
50112
50099
  return this.replaceOrMergeActions(targetActionId, sourceActionId, true);
50113
50100
  }
50114
50101
  async setMetadata(actionId, metadata) {
50115
- const keys$1 = keys$5(metadata);
50102
+ const keys$1 = keys$6(metadata);
50116
50103
  const compatibleKeys = keys$1.filter((key) => {
50117
50104
  const value = metadata[key];
50118
50105
  return typeof key === 'string' && typeof value === 'string';
@@ -50267,7 +50254,7 @@
50267
50254
  const waitForOngoingSync = this.syncPromise || Promise.resolve();
50268
50255
  return waitForOngoingSync.then(() => {
50269
50256
  const { draftStore } = this;
50270
- const keys$1 = keys$5(draftStore);
50257
+ const keys$1 = keys$6(draftStore);
50271
50258
  const actionArray = [];
50272
50259
  for (let i = 0, len = keys$1.length; i < len; i++) {
50273
50260
  const key = keys$1[i];
@@ -50291,7 +50278,7 @@
50291
50278
  deleteByTag(tag) {
50292
50279
  const deleteAction = () => {
50293
50280
  const { draftStore } = this;
50294
- const keys$1 = keys$5(draftStore);
50281
+ const keys$1 = keys$6(draftStore);
50295
50282
  const durableKeys = [];
50296
50283
  for (let i = 0, len = keys$1.length; i < len; i++) {
50297
50284
  const key = keys$1[i];
@@ -50381,7 +50368,7 @@
50381
50368
  return this.runQueuedOperations();
50382
50369
  }
50383
50370
  const { draftStore } = this;
50384
- const keys$1 = keys$5(durableEntries);
50371
+ const keys$1 = keys$6(durableEntries);
50385
50372
  for (let i = 0, len = keys$1.length; i < len; i++) {
50386
50373
  const entry = durableEntries[keys$1[i]];
50387
50374
  const action = entry.data;
@@ -51255,7 +51242,7 @@
51255
51242
  decrementRefCount(key);
51256
51243
  };
51257
51244
  // note the makeEnvironmentUiApiRecordDraftAware will eventually go away once the adapters become draft aware
51258
- return create$5(env, {
51245
+ return create$6(env, {
51259
51246
  storePublish: { value: storePublish },
51260
51247
  handleSuccessResponse: { value: handleSuccessResponse },
51261
51248
  softEvict: { value: softEvict },
@@ -51269,7 +51256,7 @@
51269
51256
  */
51270
51257
 
51271
51258
 
51272
- const { keys: keys$4, values: values$2, create: create$4, assign: assign$4, freeze: freeze$3, entries: entries$4 } = Object;
51259
+ const { keys: keys$5, values: values$3, create: create$5, assign: assign$5, freeze: freeze$1$1, entries: entries$5 } = Object;
51273
51260
  const { stringify: stringify$4, parse: parse$4 } = JSON;
51274
51261
  const { shift } = Array.prototype;
51275
51262
  const { isArray: isArray$2$1, from: from$2 } = Array;
@@ -51336,7 +51323,7 @@
51336
51323
  */
51337
51324
  function filterOutReferenceFieldsAndLinks(record) {
51338
51325
  const filteredFields = {};
51339
- const fieldNames = keys$4(record.fields);
51326
+ const fieldNames = keys$5(record.fields);
51340
51327
  for (const fieldName of fieldNames) {
51341
51328
  const field = record.fields[fieldName];
51342
51329
  if (isFieldLink(field) === false) {
@@ -51437,7 +51424,7 @@
51437
51424
  const resolvedRequest = resolveResourceRequestIds(luvio, resourceRequest, canonicalKey);
51438
51425
  return env.dispatchResourceRequest(resolvedRequest, context, eventObservers);
51439
51426
  };
51440
- return create$4(env, {
51427
+ return create$5(env, {
51441
51428
  dispatchResourceRequest: { value: dispatchResourceRequest },
51442
51429
  });
51443
51430
  }
@@ -51615,7 +51602,7 @@
51615
51602
  return applyDraftsToBatchResponse(resourceRequest, response, removedDraftIds);
51616
51603
  }));
51617
51604
  };
51618
- return create$4(env, {
51605
+ return create$5(env, {
51619
51606
  dispatchResourceRequest: { value: dispatchResourceRequest },
51620
51607
  });
51621
51608
  }
@@ -51625,7 +51612,7 @@
51625
51612
  const adapterSpecificEnvironments = synthesizers.reduce((environment, synthesizer) => {
51626
51613
  return synthesizer(luvio, environment, options);
51627
51614
  }, env);
51628
- return create$4(adapterSpecificEnvironments, {});
51615
+ return create$5(adapterSpecificEnvironments, {});
51629
51616
  }
51630
51617
 
51631
51618
  function clone(obj) {
@@ -51719,7 +51706,7 @@
51719
51706
  changedNameFields[fieldName] = fieldValue;
51720
51707
  }
51721
51708
  }
51722
- if (keys$4(changedNameFields).length > 0) {
51709
+ if (keys$5(changedNameFields).length > 0) {
51723
51710
  const newNameValue = filteredNameFields
51724
51711
  .map((key) => {
51725
51712
  if (changedNameFields[key] !== undefined) {
@@ -51802,7 +51789,7 @@
51802
51789
  const injectedCompoundNameField = compoundNameFieldFromDraftUpdates(record, draftOperationFields, apiName, objectInfos);
51803
51790
  // inject the compound Name field into the DraftOperation so on broadcast it doesnt try to
51804
51791
  // synthesize the Name field a second time when the durable store change notifier is triggered
51805
- if (keys$4(injectedCompoundNameField).length > 0 && draftActionType === 'update') {
51792
+ if (keys$5(injectedCompoundNameField).length > 0 && draftActionType === 'update') {
51806
51793
  draftOperation.fields['Name'] = injectedCompoundNameField['Name'];
51807
51794
  }
51808
51795
  const fields = { ...draftOperationFields, ...injectedCompoundNameField };
@@ -51813,7 +51800,7 @@
51813
51800
  LastModifiedDate: lastModifiedDate,
51814
51801
  };
51815
51802
  const draftFields = buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, internalFields, objectInfos, referencedRecords, formatDisplayValue);
51816
- const fieldNames = keys$4(draftFields);
51803
+ const fieldNames = keys$5(draftFields);
51817
51804
  for (let i = 0, len = fieldNames.length; i < len; i++) {
51818
51805
  const fieldName = fieldNames[i];
51819
51806
  // don't apply server values to draft created records
@@ -51874,7 +51861,7 @@
51874
51861
  return undefined;
51875
51862
  }
51876
51863
  const updatedFields = {};
51877
- const fieldNames = keys$4(fields);
51864
+ const fieldNames = keys$5(fields);
51878
51865
  for (let i = 0, len = fieldNames.length; i < len; i++) {
51879
51866
  const fieldName = fieldNames[i];
51880
51867
  const field = fields[fieldName];
@@ -51921,7 +51908,7 @@
51921
51908
  * @param fields List of draft record fields
51922
51909
  */
51923
51910
  function buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, fields, objectInfos, referencedRecords, formatDisplayValue) {
51924
- const fieldNames = keys$4(fields);
51911
+ const fieldNames = keys$5(fields);
51925
51912
  const recordFields = {};
51926
51913
  const objectInfo = objectInfos.get(apiName);
51927
51914
  for (let i = 0, len = fieldNames.length; i < len; i++) {
@@ -51989,7 +51976,7 @@
51989
51976
  draftFields[DEFAULT_FIELD_LAST_MODIFIED_DATE] = { value: timestampString, displayValue: null };
51990
51977
  draftFields[DEFAULT_FIELD_OWNER_ID] = { value: userId, displayValue: null };
51991
51978
  draftFields[DEFAULT_FIELD_ID] = { value: recordId, displayValue: null };
51992
- const allObjectFields = keys$4(objectInfo.fields);
51979
+ const allObjectFields = keys$5(objectInfo.fields);
51993
51980
  allObjectFields.forEach((fieldName) => {
51994
51981
  if (draftFields[fieldName] === undefined) {
51995
51982
  draftFields[fieldName] = { value: null, displayValue: null };
@@ -52130,7 +52117,7 @@
52130
52117
  this.isDraftId = isDraftId;
52131
52118
  this.recordService = recordService;
52132
52119
  this.handlerId = LDS_ACTION_HANDLER_ID;
52133
- this.collectedFields = create$4(null);
52120
+ this.collectedFields = create$5(null);
52134
52121
  recordService.registerRecordHandler(this);
52135
52122
  }
52136
52123
  async buildPendingAction(request, queue) {
@@ -52192,7 +52179,7 @@
52192
52179
  throw Error(`Could not generate draft. Object info is missing`);
52193
52180
  }
52194
52181
  const appendedFields = this.getBackdatingFields(objectInfo, resolvedRequest.method, pendingAction);
52195
- if (keys$4(appendedFields).length > 0) {
52182
+ if (keys$5(appendedFields).length > 0) {
52196
52183
  pendingAction.data.body = {
52197
52184
  ...pendingAction.data.body,
52198
52185
  fields: {
@@ -52206,7 +52193,7 @@
52206
52193
  }
52207
52194
  getBackdatingFields(objectInfo, requestMethod, pendingAction) {
52208
52195
  const fields = {};
52209
- const actionFieldNames = keys$4(pendingAction.data.body.fields);
52196
+ const actionFieldNames = keys$5(pendingAction.data.body.fields);
52210
52197
  if (requestMethod === 'post') {
52211
52198
  // `CreateRecord` with `CreatedDate` field
52212
52199
  if (isBackdatingFieldEditable(objectInfo, DEFAULT_FIELD_CREATED_DATE$1, 'createable', actionFieldNames)) {
@@ -52252,7 +52239,7 @@
52252
52239
  return;
52253
52240
  }
52254
52241
  const objectInfo = objectInfoMap[apiName];
52255
- const optionalFields = values$2(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
52242
+ const optionalFields = values$3(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
52256
52243
  await getAdapterData(this.getRecordAdapter, {
52257
52244
  recordId: referenceFieldInfo.id,
52258
52245
  optionalFields,
@@ -52271,7 +52258,7 @@
52271
52258
  const referenceToInfos = fieldInfo.referenceToInfos;
52272
52259
  const apiNames = referenceToInfos.map((referenceToInfo) => referenceToInfo.apiName);
52273
52260
  const objectInfoMap = await this.objectInfoService.getObjectInfos(apiNames);
52274
- for (const objectInfo of values$2(objectInfoMap)) {
52261
+ for (const objectInfo of values$3(objectInfoMap)) {
52275
52262
  const { apiName, keyPrefix } = objectInfo;
52276
52263
  if (keyPrefix !== null && id.startsWith(keyPrefix)) {
52277
52264
  return apiName;
@@ -52399,17 +52386,17 @@
52399
52386
  // otherwise we're a record
52400
52387
  if (draftMetadata === undefined) {
52401
52388
  // no drafts applied to this record, publish and be done
52402
- this.collectedFields = create$4(null);
52389
+ this.collectedFields = create$5(null);
52403
52390
  return publishData(key, data);
52404
52391
  }
52405
52392
  // create a denormalized record with the collected fields
52406
- const recordFieldNames = keys$4(data.fields);
52393
+ const recordFieldNames = keys$5(data.fields);
52407
52394
  const partialRecord = {
52408
52395
  ...data,
52409
52396
  fields: {},
52410
52397
  };
52411
52398
  for (const fieldName of recordFieldNames) {
52412
- const collectedField = this.collectedFields[buildRecordFieldStoreKey(key, fieldName)];
52399
+ const collectedField = this.collectedFields[buildRecordFieldStoreKey$1(key, fieldName)];
52413
52400
  if (collectedField !== undefined) {
52414
52401
  partialRecord.fields[fieldName] =
52415
52402
  collectedField;
@@ -52425,15 +52412,15 @@
52425
52412
  lastModifiedDate: recordWithDrafts.lastModifiedDate,
52426
52413
  lastModifiedById: recordWithDrafts.lastModifiedById,
52427
52414
  };
52428
- for (const fieldName of keys$4(recordWithSpanningRefLinks.fields)) {
52429
- const fieldKey = buildRecordFieldStoreKey(key, fieldName);
52415
+ for (const fieldName of keys$5(recordWithSpanningRefLinks.fields)) {
52416
+ const fieldKey = buildRecordFieldStoreKey$1(key, fieldName);
52430
52417
  normalizedRecord.fields[fieldName] = { __ref: fieldKey };
52431
52418
  publishData(fieldKey, recordWithSpanningRefLinks.fields[fieldName]);
52432
52419
  }
52433
52420
  // publish the normalized record
52434
52421
  publishData(key, normalizedRecord);
52435
52422
  // we've published the record, now clear the collected fields
52436
- this.collectedFields = create$4(null);
52423
+ this.collectedFields = create$5(null);
52437
52424
  }
52438
52425
  updateMetadata(existingMetadata, incomingMetadata) {
52439
52426
  // ensure the the api name cannot be overwritten in the incoming metadata
@@ -52470,7 +52457,7 @@
52470
52457
  let resolvedUrlParams = request.urlParams;
52471
52458
  if (request.method === 'post' || request.method === 'patch') {
52472
52459
  const bodyFields = resolvedBody.fields;
52473
- const fieldNames = keys$4(bodyFields);
52460
+ const fieldNames = keys$5(bodyFields);
52474
52461
  for (let i = 0, len = fieldNames.length; i < len; i++) {
52475
52462
  const fieldName = fieldNames[i];
52476
52463
  const fieldValue = bodyFields[fieldName];
@@ -52564,366 +52551,6 @@
52564
52551
  !draftActionFieldNames.includes(backdatingFieldName));
52565
52552
  }
52566
52553
 
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
52554
  /**
52928
52555
  * This function takes an unknown error and normalizes it to an Error object
52929
52556
  */
@@ -52962,7 +52589,7 @@
52962
52589
  }
52963
52590
  return createOkResponse(data);
52964
52591
  };
52965
- return create$4(env, {
52592
+ return create$5(env, {
52966
52593
  dispatchResourceRequest: { value: dispatchResourceRequest },
52967
52594
  });
52968
52595
  }
@@ -53029,7 +52656,7 @@
53029
52656
  };
53030
52657
  }
53031
52658
  objectInfoMap.set(apiName, objectInfo);
53032
- const fields = keys$4(operation.fields);
52659
+ const fields = keys$5(operation.fields);
53033
52660
  const unexpectedFields = [];
53034
52661
  for (const field of fields) {
53035
52662
  const fieldInfo = objectInfo.fields[field];
@@ -53353,7 +52980,7 @@
53353
52980
  ...trimmedDownData.contentVersion,
53354
52981
  fields: cvFields,
53355
52982
  };
53356
- freeze$3(trimmedDownData);
52983
+ freeze$1$1(trimmedDownData);
53357
52984
  snapshot.data = trimmedDownData;
53358
52985
  }
53359
52986
  eventEmitter({ type: 'create-content-document-and-version-draft-finished' });
@@ -53367,14 +52994,13 @@
53367
52994
  const CONTENT_VERSION_API_NAME = 'ContentVersion';
53368
52995
  const LATEST_PUBLISHED_VERSION_ID_FIELD = 'LatestPublishedVersionId';
53369
52996
  class ContentDocumentCompositeRepresentationActionHandler extends AbstractResourceRequestActionHandler {
53370
- constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, durableStore, binaryStore) {
52997
+ constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, binaryStore) {
53371
52998
  super(draftQueue, networkAdapter, getLuvio);
53372
52999
  this.getLuvio = getLuvio;
53373
53000
  this.draftRecordService = draftRecordService;
53374
53001
  this.draftQueue = draftQueue;
53375
53002
  this.networkAdapter = networkAdapter;
53376
53003
  this.isDraftId = isDraftId;
53377
- this.durableStore = durableStore;
53378
53004
  this.binaryStore = binaryStore;
53379
53005
  this.binaryStoreUrlsToUpdate = new Map();
53380
53006
  this.handlerId = HANDLER_ID;
@@ -53786,6 +53412,389 @@
53786
53412
  };
53787
53413
  }
53788
53414
 
53415
+ /**
53416
+ * Copyright (c) 2022, Salesforce, Inc.,
53417
+ * All rights reserved.
53418
+ * For full license text, see the LICENSE.txt file
53419
+ */
53420
+
53421
+
53422
+ const { keys: keys$4, values: values$2, create: create$4, assign: assign$4, freeze: freeze$3, entries: entries$4 } = Object;
53423
+
53424
+ function buildRecordFieldStoreKey(recordKey, fieldName) {
53425
+ return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
53426
+ }
53427
+ function isStoreKeyRecordId(key) {
53428
+ return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
53429
+ }
53430
+ function createLink$2(key) {
53431
+ return { __ref: key };
53432
+ }
53433
+ function isStoreRecordError(storeRecord) {
53434
+ return storeRecord.__type === 'error';
53435
+ }
53436
+ function isEntryDurableRecordRepresentation(entry, key) {
53437
+ // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
53438
+ return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
53439
+ entry.data.__type === undefined);
53440
+ }
53441
+ /**
53442
+ * Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
53443
+ * durable store record representation and normalizes it back out into the format the the luvio store expects it
53444
+ * @param key Record store key
53445
+ * @param entry Durable entry containing a denormalized record representation
53446
+ * @returns a set of entries containing the normalized record and its normalized fields
53447
+ */
53448
+ function normalizeRecordFields(key, entry) {
53449
+ const { data: record } = entry;
53450
+ const { fields, links } = record;
53451
+ const missingFieldLinks = keys$4(links);
53452
+ const fieldNames = keys$4(fields);
53453
+ const normalizedFields = {};
53454
+ const returnEntries = {};
53455
+ // restore fields
53456
+ for (let i = 0, len = fieldNames.length; i < len; i++) {
53457
+ const fieldName = fieldNames[i];
53458
+ const field = fields[fieldName];
53459
+ const fieldKey = buildRecordFieldStoreKey(key, fieldName);
53460
+ returnEntries[fieldKey] = { data: field };
53461
+ normalizedFields[fieldName] = createLink$2(fieldKey);
53462
+ }
53463
+ // restore missing fields
53464
+ for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
53465
+ const fieldName = missingFieldLinks[i];
53466
+ const link = links[fieldName];
53467
+ if (link.isMissing === true) {
53468
+ normalizedFields[fieldName] = { ...link, __ref: undefined };
53469
+ }
53470
+ }
53471
+ returnEntries[key] = {
53472
+ data: assign$4(record, { fields: normalizedFields }),
53473
+ metadata: entry.metadata,
53474
+ };
53475
+ return returnEntries;
53476
+ }
53477
+ /**
53478
+ * Transforms a record for storage in the durable store. The transformation involves denormalizing
53479
+ * scalar fields and persisting link metadata to transform back into a normalized representation
53480
+ *
53481
+ * If the record contains pending fields this will return undefined as pending records do not get persisted
53482
+ * to the durable store. There should be a refresh operation outbound that will bring in the updated record.
53483
+ *
53484
+ * @param normalizedRecord Record containing normalized field links
53485
+ * @param recordStore a store containing referenced record fields
53486
+ */
53487
+ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
53488
+ const fields = normalizedRecord.fields;
53489
+ const filteredFields = {};
53490
+ const links = {};
53491
+ const fieldNames = keys$4(fields);
53492
+ for (let i = 0, len = fieldNames.length; i < len; i++) {
53493
+ const fieldName = fieldNames[i];
53494
+ const field = fields[fieldName];
53495
+ // pending fields get filtered out of the durable store
53496
+ const { pending } = field;
53497
+ if (pending === true) {
53498
+ // do not write records with pending fields to the durable store
53499
+ // there should be a refresh operation outbound that will bring in the updated record
53500
+ return undefined;
53501
+ }
53502
+ const { __ref } = field;
53503
+ if (__ref !== undefined) {
53504
+ let ref = records[__ref];
53505
+ if (pendingEntries !== undefined) {
53506
+ // If the ref was part of the pending write that takes precedence
53507
+ const pendingEntry = pendingEntries[__ref];
53508
+ if (pendingEntry !== undefined) {
53509
+ ref = pendingEntry.data;
53510
+ }
53511
+ }
53512
+ // if field reference exists then add it to our filteredFields
53513
+ if (ref !== undefined) {
53514
+ filteredFields[fieldName] = ref;
53515
+ }
53516
+ else {
53517
+ // if we have a store to read, try to find the field there too
53518
+ // The durable ingest staging store may pass through to L1, and
53519
+ // not all fields are necessarily published every time, so it is
53520
+ // important to check L1 and not just the fields being published,
53521
+ // otherwise we risk truncating the fields on the record.
53522
+ if (store) {
53523
+ ref = store.readEntry(__ref);
53524
+ if (ref !== undefined) {
53525
+ filteredFields[fieldName] = ref;
53526
+ }
53527
+ }
53528
+ }
53529
+ }
53530
+ // we want to preserve fields that are missing nodes
53531
+ if (field.isMissing === true) {
53532
+ links[fieldName] = field;
53533
+ }
53534
+ }
53535
+ return {
53536
+ ...normalizedRecord,
53537
+ fields: filteredFields,
53538
+ links,
53539
+ };
53540
+ }
53541
+ function getDenormalizedKey(originalKey, recordId, luvio) {
53542
+ // this will likely need to be handled when moving to structured keys
53543
+ // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
53544
+ // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
53545
+ if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
53546
+ return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
53547
+ }
53548
+ return keyBuilder$26(luvio, { recordId });
53549
+ }
53550
+ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
53551
+ const getEntries = function (entries, segment) {
53552
+ // this HOF only inspects records in the default segment
53553
+ if (segment !== DefaultDurableSegment) {
53554
+ return durableStore.getEntries(entries, segment);
53555
+ }
53556
+ const { length: entriesLength } = entries;
53557
+ if (entriesLength === 0) {
53558
+ return Promise.resolve({});
53559
+ }
53560
+ // filter out record field keys
53561
+ const filteredEntryIds = [];
53562
+ // map of records to avoid requesting duplicate record keys when requesting both records and fields
53563
+ const recordEntries = {};
53564
+ const recordViewEntries = {};
53565
+ for (let i = 0, len = entriesLength; i < len; i++) {
53566
+ const id = entries[i];
53567
+ const recordId = extractRecordIdFromStoreKey$1(id);
53568
+ if (recordId !== undefined) {
53569
+ if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
53570
+ if (recordViewEntries[recordId] === undefined) {
53571
+ const key = getDenormalizedKey(id, recordId, luvio);
53572
+ recordViewEntries[recordId] = true;
53573
+ filteredEntryIds.push(key);
53574
+ }
53575
+ }
53576
+ else {
53577
+ if (recordEntries[recordId] === undefined) {
53578
+ const key = getDenormalizedKey(id, recordId, luvio);
53579
+ recordEntries[recordId] = true;
53580
+ filteredEntryIds.push(key);
53581
+ }
53582
+ }
53583
+ }
53584
+ else {
53585
+ filteredEntryIds.push(id);
53586
+ }
53587
+ }
53588
+ // call base getEntries
53589
+ return durableStore.getEntries(filteredEntryIds, segment).then((durableEntries) => {
53590
+ if (durableEntries === undefined) {
53591
+ return undefined;
53592
+ }
53593
+ const returnEntries = create$4(null);
53594
+ const keys$1 = keys$4(durableEntries);
53595
+ for (let i = 0, len = keys$1.length; i < len; i++) {
53596
+ const key = keys$1[i];
53597
+ const value = durableEntries[key];
53598
+ if (value === undefined) {
53599
+ continue;
53600
+ }
53601
+ if (isEntryDurableRecordRepresentation(value, key)) {
53602
+ assign$4(returnEntries, normalizeRecordFields(key, value));
53603
+ }
53604
+ else {
53605
+ returnEntries[key] = value;
53606
+ }
53607
+ }
53608
+ return returnEntries;
53609
+ });
53610
+ };
53611
+ const denormalizeEntries = function (entries) {
53612
+ let hasEntries = false;
53613
+ let hasMetadata = false;
53614
+ const putEntries = create$4(null);
53615
+ const putMetadata = create$4(null);
53616
+ const keys$1 = keys$4(entries);
53617
+ const putRecords = {};
53618
+ const putRecordViews = {};
53619
+ const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
53620
+ const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
53621
+ const store = getStore();
53622
+ for (let i = 0, len = keys$1.length; i < len; i++) {
53623
+ const key = keys$1[i];
53624
+ let value = entries[key];
53625
+ const recordId = extractRecordIdFromStoreKey$1(key);
53626
+ // do not put normalized field values
53627
+ if (recordId !== undefined) {
53628
+ const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
53629
+ if (isRecordView) {
53630
+ if (putRecordViews[recordId] === true) {
53631
+ continue;
53632
+ }
53633
+ }
53634
+ else {
53635
+ if (putRecords[recordId] === true) {
53636
+ continue;
53637
+ }
53638
+ }
53639
+ const recordKey = getDenormalizedKey(key, recordId, luvio);
53640
+ const recordEntries = entries;
53641
+ const entry = recordEntries[recordKey];
53642
+ let record = entry && entry.data;
53643
+ if (record === undefined) {
53644
+ record = storeRecords[recordKey];
53645
+ if (record === undefined) {
53646
+ // fields are being published without a record for them existing,
53647
+ // fields cannot exist standalone in the durable store
53648
+ continue;
53649
+ }
53650
+ }
53651
+ if (isRecordView) {
53652
+ putRecordViews[recordId] = true;
53653
+ }
53654
+ else {
53655
+ putRecords[recordId] = true;
53656
+ }
53657
+ if (isStoreRecordError(record)) {
53658
+ hasEntries = true;
53659
+ putEntries[recordKey] = value;
53660
+ continue;
53661
+ }
53662
+ let metadata = entry && entry.metadata;
53663
+ if (metadata === undefined) {
53664
+ metadata = {
53665
+ ...storeMetadata[recordKey],
53666
+ metadataVersion: DURABLE_METADATA_VERSION,
53667
+ };
53668
+ }
53669
+ const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
53670
+ if (denormalizedRecord !== undefined) {
53671
+ hasEntries = true;
53672
+ putEntries[recordKey] = {
53673
+ data: denormalizedRecord,
53674
+ metadata,
53675
+ };
53676
+ // if undefined then it is pending
53677
+ // we should still update metadata on pending records
53678
+ }
53679
+ else {
53680
+ hasMetadata = true;
53681
+ metadata.expirationTimestamp = metadata.ingestionTimestamp;
53682
+ putMetadata[recordKey] = {
53683
+ metadata,
53684
+ };
53685
+ }
53686
+ }
53687
+ else {
53688
+ hasEntries = true;
53689
+ putEntries[key] = value;
53690
+ }
53691
+ }
53692
+ return { putEntries, putMetadata, hasEntries, hasMetadata };
53693
+ };
53694
+ const setEntries = function (entries, segment) {
53695
+ if (segment !== DefaultDurableSegment) {
53696
+ return durableStore.setEntries(entries, segment);
53697
+ }
53698
+ const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
53699
+ const promises = [
53700
+ hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
53701
+ ];
53702
+ if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
53703
+ promises.push(hasMetadata && sqlStore !== undefined
53704
+ ? durableStore.setMetadata(putMetadata, segment)
53705
+ : undefined);
53706
+ }
53707
+ return Promise.all(promises).then(() => { });
53708
+ };
53709
+ const batchOperations = function (operations) {
53710
+ const operationsWithDenormedRecords = [];
53711
+ for (let i = 0, len = operations.length; i < len; i++) {
53712
+ const operation = operations[i];
53713
+ if (operation.type === 'setMetadata') {
53714
+ // if setMetadata also contains entry data then it needs to be denormalized.
53715
+ const keys$1 = keys$4(operation.entries);
53716
+ if (keys$1.length > 0) {
53717
+ const firstKey = keys$1[0];
53718
+ // casted to any to check if data exists
53719
+ const firstEntry = operation.entries[firstKey];
53720
+ // it is not possible for setMetadata to contain entries with both data and no data in the same operation.
53721
+ // this is determined by the plugin supporting update batch calls before it gets to this HOF.
53722
+ // so we only need to check one entry to confirm this for performance
53723
+ if (firstEntry.data !== undefined) {
53724
+ const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
53725
+ operationsWithDenormedRecords.push({
53726
+ ...operation,
53727
+ entries: putEntries,
53728
+ });
53729
+ if (hasMetadata &&
53730
+ sqlStore !== undefined &&
53731
+ sqlStore.isBatchUpdateSupported() === true) {
53732
+ operationsWithDenormedRecords.push({
53733
+ ...operation,
53734
+ entries: putMetadata,
53735
+ type: 'setMetadata',
53736
+ });
53737
+ }
53738
+ }
53739
+ else {
53740
+ operationsWithDenormedRecords.push(operation);
53741
+ }
53742
+ }
53743
+ continue;
53744
+ }
53745
+ if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
53746
+ operationsWithDenormedRecords.push(operation);
53747
+ continue;
53748
+ }
53749
+ const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
53750
+ operationsWithDenormedRecords.push({
53751
+ ...operation,
53752
+ entries: putEntries,
53753
+ });
53754
+ if (hasMetadata &&
53755
+ sqlStore !== undefined &&
53756
+ sqlStore.isBatchUpdateSupported() === true) {
53757
+ operationsWithDenormedRecords.push({
53758
+ ...operation,
53759
+ entries: putMetadata,
53760
+ type: 'setMetadata',
53761
+ });
53762
+ }
53763
+ }
53764
+ return durableStore.batchOperations(operationsWithDenormedRecords);
53765
+ };
53766
+ /**
53767
+ * Retrieves a denormalized record from the store
53768
+ * NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
53769
+ * @param recordKey record key
53770
+ * @param durableStore the durable store
53771
+ * @returns a DraftRecordRepresentation containing the requested fields
53772
+ */
53773
+ const getDenormalizedRecord = function (recordKey) {
53774
+ return durableStore.getEntries([recordKey], DefaultDurableSegment).then((entries) => {
53775
+ if (entries === undefined) {
53776
+ return undefined;
53777
+ }
53778
+ const denormalizedEntry = entries[recordKey];
53779
+ if (denormalizedEntry === undefined) {
53780
+ return undefined;
53781
+ }
53782
+ // don't include link information
53783
+ const denormalizedRecord = denormalizedEntry.data;
53784
+ if (isStoreRecordError(denormalizedRecord)) {
53785
+ return undefined;
53786
+ }
53787
+ return denormalizedRecord;
53788
+ });
53789
+ };
53790
+ return create$4(durableStore, {
53791
+ getEntries: { value: getEntries, writable: true },
53792
+ setEntries: { value: setEntries, writable: true },
53793
+ batchOperations: { value: batchOperations, writable: true },
53794
+ getDenormalizedRecord: { value: getDenormalizedRecord, writable: true },
53795
+ });
53796
+ }
53797
+
53789
53798
  function serializeFieldArguments$1(argumentNodes, variables) {
53790
53799
  const mutableArgumentNodes = Object.assign([], argumentNodes);
53791
53800
  return `args__(${mutableArgumentNodes
@@ -60587,7 +60596,7 @@
60587
60596
  };
60588
60597
  }
60589
60598
 
60590
- const { keys: keys$9, create: create$7, assign: assign$7, entries, values } = Object;
60599
+ const { keys: keys$a, create: create$8, assign: assign$8, entries, values } = Object;
60591
60600
  const { stringify: stringify$7, parse: parse$7 } = JSON;
60592
60601
 
60593
60602
  function selectColumnsFromTableWhereKeyIn(columnNames, table, keyColumnName, whereIn) {
@@ -60654,7 +60663,7 @@
60654
60663
  },
60655
60664
  conflictColumns: this.conflictColumnNames,
60656
60665
  columns: this.columnNames,
60657
- rows: keys$9(entries).reduce((rows, key) => {
60666
+ rows: keys$a(entries).reduce((rows, key) => {
60658
60667
  const entry = entries[key];
60659
60668
  const { data, metadata } = entry;
60660
60669
  const row = [key, stringify$7(data), metadata ? stringify$7(metadata) : null];
@@ -60673,7 +60682,7 @@
60673
60682
  type: 'setMetadata',
60674
60683
  },
60675
60684
  columns: [COLUMN_NAME_METADATA$1],
60676
- values: keys$9(entries).reduce((values, key) => {
60685
+ values: keys$a(entries).reduce((values, key) => {
60677
60686
  const { metadata } = entries[key];
60678
60687
  const row = [metadata ? stringify$7(metadata) : null];
60679
60688
  values[key] = row;
@@ -60763,7 +60772,7 @@
60763
60772
  },
60764
60773
  conflictColumns: this.conflictColumnNames,
60765
60774
  columns: this.columnNames,
60766
- rows: keys$9(entries).reduce((rows, key) => {
60775
+ rows: keys$a(entries).reduce((rows, key) => {
60767
60776
  const entry = entries[key];
60768
60777
  const { data, metadata } = entry;
60769
60778
  const row = [key, stringify$7(data)];
@@ -60789,7 +60798,7 @@
60789
60798
  type: 'setMetadata',
60790
60799
  },
60791
60800
  columns: [COLUMN_NAME_METADATA],
60792
- values: keys$9(entries).reduce((values, key) => {
60801
+ values: keys$a(entries).reduce((values, key) => {
60793
60802
  const { metadata } = entries[key];
60794
60803
  const row = [metadata ? stringify$7(metadata) : null];
60795
60804
  values[key] = row;
@@ -60798,7 +60807,7 @@
60798
60807
  };
60799
60808
  }
60800
60809
  metadataToUpdateSQLQueries(entries, segment) {
60801
- return keys$9(entries).reduce((accu, key) => {
60810
+ return keys$a(entries).reduce((accu, key) => {
60802
60811
  const { metadata } = entries[key];
60803
60812
  if (metadata !== undefined) {
60804
60813
  accu.push({
@@ -60869,7 +60878,7 @@
60869
60878
  return this.getTable(segment).getAll(segment);
60870
60879
  }
60871
60880
  setEntries(entries, segment) {
60872
- if (keys$9(entries).length === 0) {
60881
+ if (keys$a(entries).length === 0) {
60873
60882
  return Promise.resolve();
60874
60883
  }
60875
60884
  const table = this.getTable(segment);
@@ -60877,7 +60886,7 @@
60877
60886
  return this.batchOperationAsPromise([upsertOperation]);
60878
60887
  }
60879
60888
  setMetadata(entries, segment) {
60880
- if (keys$9(entries).length === 0) {
60889
+ if (keys$a(entries).length === 0) {
60881
60890
  return Promise.resolve();
60882
60891
  }
60883
60892
  const table = this.getTable(segment);
@@ -60896,13 +60905,13 @@
60896
60905
  batchOperations(operations) {
60897
60906
  const sqliteOperations = operations.reduce((acc, cur) => {
60898
60907
  if (cur.type === 'setEntries') {
60899
- if (keys$9(cur.entries).length > 0) {
60908
+ if (keys$a(cur.entries).length > 0) {
60900
60909
  const table = this.getTable(cur.segment);
60901
60910
  acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
60902
60911
  }
60903
60912
  }
60904
60913
  else if (cur.type === 'setMetadata') {
60905
- if (keys$9(cur.entries).length > 0) {
60914
+ if (keys$a(cur.entries).length > 0) {
60906
60915
  const table = this.getTable(cur.segment);
60907
60916
  if (this.supportsBatchUpdates) {
60908
60917
  acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
@@ -61035,7 +61044,7 @@
61035
61044
  },
61036
61045
  conflictColumns: this.conflictColumnNames,
61037
61046
  columns: this.columnNames,
61038
- rows: keys$9(entries).reduce((rows, key) => {
61047
+ rows: keys$a(entries).reduce((rows, key) => {
61039
61048
  const entry = entries[key];
61040
61049
  rows.push([key, stringify$7(entry.data)]);
61041
61050
  return rows;
@@ -62546,7 +62555,7 @@
62546
62555
  const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
62547
62556
  const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService);
62548
62557
  const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated);
62549
- const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, recordDenormingStore, NimbusBinaryStore);
62558
+ const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore);
62550
62559
  lazyDraftQueue.addHandler(uiApiRecordHandler);
62551
62560
  lazyDraftQueue.addHandler(quickActionHandler);
62552
62561
  lazyDraftQueue.addHandler(contentDocumentCompositeActionHandler);
@@ -62645,7 +62654,7 @@
62645
62654
  id: '@salesforce/lds-network-adapter',
62646
62655
  instrument: instrument$2,
62647
62656
  });
62648
- // version: 1.296.1-1aa7fc7e3
62657
+ // version: 1.297.0-1fc775982
62649
62658
 
62650
62659
  const { create: create$3, keys: keys$3 } = Object;
62651
62660
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -82714,7 +82723,7 @@
82714
82723
  configuration: { ...configurationForGraphQLAdapters$1 },
82715
82724
  instrument: instrument$1,
82716
82725
  });
82717
- // version: 1.296.1-cf86708a0
82726
+ // version: 1.297.0-e0cfbd880
82718
82727
 
82719
82728
  // On core the unstable adapters are re-exported with different names,
82720
82729
  // we want to match them here.
@@ -84970,7 +84979,7 @@
84970
84979
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
84971
84980
  graphQLImperative = ldsAdapter;
84972
84981
  });
84973
- // version: 1.296.1-cf86708a0
84982
+ // version: 1.297.0-e0cfbd880
84974
84983
 
84975
84984
  var gqlApi = /*#__PURE__*/Object.freeze({
84976
84985
  __proto__: null,
@@ -85705,7 +85714,7 @@
85705
85714
  function register(r) {
85706
85715
  callbacks$1.forEach((callback) => callback(r));
85707
85716
  }
85708
- // version: 1.296.1-1aa7fc7e3
85717
+ // version: 1.297.0-1fc775982
85709
85718
 
85710
85719
  /**
85711
85720
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -90686,4 +90695,4 @@
90686
90695
  exports.subscribeToAdapter = subscribeToAdapter;
90687
90696
 
90688
90697
  }));
90689
- // version: 1.296.1-1aa7fc7e3
90698
+ // version: 1.297.0-1fc775982