@salesforce/lds-worker-api 1.266.0-dev17 → 1.266.0-dev19

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.
@@ -379,8 +379,22 @@ function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, on
379
379
  draftIds !== undefined &&
380
380
  draftIds.length > 0) {
381
381
  const draftId = draftIds[draftIds.length - 1];
382
- draftManager.replaceAction(draftIdToReplace, draftId).then(() => {
382
+ draftManager
383
+ .replaceAction(draftIdToReplace, draftId)
384
+ .then(() => {
383
385
  onResponse(responseValue);
386
+ })
387
+ .catch((error) => {
388
+ let message = 'Unknown error replacing draft';
389
+ if (error instanceof Error) {
390
+ message = error.message;
391
+ }
392
+ else if (typeof error === 'string') {
393
+ message = error;
394
+ }
395
+ onResponse({
396
+ error: createNativeFetchErrorResponse(message),
397
+ });
384
398
  });
385
399
  }
386
400
  else {
@@ -1034,4 +1048,4 @@ if (process.env.NODE_ENV !== 'production') {
1034
1048
  }
1035
1049
 
1036
1050
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1037
- // version: 1.266.0-dev17-880c5fb50
1051
+ // version: 1.266.0-dev19-80cc21d89
@@ -4157,7 +4157,7 @@ function withDefaultLuvio(callback) {
4157
4157
  }
4158
4158
  callbacks.push(callback);
4159
4159
  }
4160
- // version: 1.266.0-dev17-880c5fb50
4160
+ // version: 1.266.0-dev19-80cc21d89
4161
4161
 
4162
4162
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4163
4163
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15665,7 +15665,7 @@ function gql(literals, ...subs) {
15665
15665
  }
15666
15666
  return superResult;
15667
15667
  }
15668
- // version: 1.266.0-dev17-880c5fb50
15668
+ // version: 1.266.0-dev19-80cc21d89
15669
15669
 
15670
15670
  function unwrap(data) {
15671
15671
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16590,7 +16590,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16590
16590
  const { apiFamily, name } = metadata;
16591
16591
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16592
16592
  }
16593
- // version: 1.266.0-dev17-880c5fb50
16593
+ // version: 1.266.0-dev19-80cc21d89
16594
16594
 
16595
16595
  /**
16596
16596
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -43167,7 +43167,7 @@ withDefaultLuvio((luvio) => {
43167
43167
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
43168
43168
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
43169
43169
  });
43170
- // version: 1.266.0-dev17-8af99d255
43170
+ // version: 1.266.0-dev19-3b7e488f6
43171
43171
 
43172
43172
  var ldsIdempotencyWriteDisabled = {
43173
43173
  isOpen: function (e) {
@@ -49139,7 +49139,12 @@ class DurableDraftQueue {
49139
49139
  }
49140
49140
  finally {
49141
49141
  this.replacingAction = undefined;
49142
- await this.startQueueSafe();
49142
+ try {
49143
+ await this.startQueueSafe();
49144
+ }
49145
+ catch (_a) {
49146
+ // An error starting the queue should not bubble up from this method
49147
+ }
49143
49148
  }
49144
49149
  return updatedTarget;
49145
49150
  });
@@ -52662,6 +52667,12 @@ function addResolversToSchema(schema, polyFields) {
52662
52667
  break;
52663
52668
  case 'LastModifiedDate':
52664
52669
  field.resolve = ({ recordRepresentation: record }) => {
52670
+ // In UIAPI record reps, LastModifiedDate might be present as a field,
52671
+ // which will include both the value and displayValue
52672
+ if (record.fields['LastModifiedDate']) {
52673
+ return record.fields['LastModifiedDate'];
52674
+ }
52675
+ // If the field is not present, just return the value of the root property
52665
52676
  return record.lastModifiedDate
52666
52677
  ? { value: record.lastModifiedDate }
52667
52678
  : null;
@@ -52696,16 +52707,26 @@ function addResolversToSchema(schema, polyFields) {
52696
52707
  : null;
52697
52708
  };
52698
52709
  const { recordRepresentation: record, ingestionTimestamp } = obj;
52699
- const fieldName = field.name.endsWith('__r')
52700
- ? field.name.replace('__r', '__c')
52701
- : field.name;
52702
- const id = (record.fields[fieldName] && record.fields[fieldName].value) ||
52703
- (record.fields[`${fieldName}Id`] &&
52704
- record.fields[`${fieldName}Id`].value);
52705
- if (!id)
52710
+ let id = undefined;
52711
+ if (field.name === 'RecordType') {
52712
+ // RecordTypeId has special handling during ingest and is
52713
+ // not in record.fields, so check for it at the UIAPI root property location
52714
+ id = record.recordTypeId;
52715
+ }
52716
+ else if (field.name.endsWith('__r')) {
52717
+ // Custom relationships end in `__r` and the corresponding ID field should be `__c`
52718
+ let fieldName = field.name.replace('__r', '__c');
52719
+ id = record.fields[fieldName] && record.fields[fieldName].value;
52720
+ }
52721
+ else {
52722
+ // Standard relationships are just FieldNameId
52723
+ let fieldName = field.name + 'Id';
52724
+ id = record.fields[fieldName] && record.fields[fieldName].value;
52725
+ }
52726
+ if (!id || typeof id !== 'string') {
52727
+ // possibly field injection did not inject the necessary Id field
52728
+ // for the relationship, or we found a non-string value.
52706
52729
  return null;
52707
- if (id['__ref'] !== undefined) {
52708
- return fetchRecordOrNull(record.fields[`${field.name}Id`].value);
52709
52730
  }
52710
52731
  seenRecordIds.add(id);
52711
52732
  return fetchRecordOrNull(id);
@@ -61091,7 +61112,7 @@ register$1({
61091
61112
  id: '@salesforce/lds-network-adapter',
61092
61113
  instrument: instrument$2,
61093
61114
  });
61094
- // version: 1.266.0-dev17-880c5fb50
61115
+ // version: 1.266.0-dev19-80cc21d89
61095
61116
 
61096
61117
  const { create: create$3, keys: keys$3 } = Object;
61097
61118
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -79486,7 +79507,7 @@ register$1({
79486
79507
  configuration: { ...configurationForGraphQLAdapters$1 },
79487
79508
  instrument: instrument$1,
79488
79509
  });
79489
- // version: 1.266.0-dev17-8af99d255
79510
+ // version: 1.266.0-dev19-3b7e488f6
79490
79511
 
79491
79512
  // On core the unstable adapters are re-exported with different names,
79492
79513
  // we want to match them here.
@@ -81740,7 +81761,7 @@ withDefaultLuvio((luvio) => {
81740
81761
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
81741
81762
  graphQLImperative = ldsAdapter;
81742
81763
  });
81743
- // version: 1.266.0-dev17-8af99d255
81764
+ // version: 1.266.0-dev19-3b7e488f6
81744
81765
 
81745
81766
  var gqlApi = /*#__PURE__*/Object.freeze({
81746
81767
  __proto__: null,
@@ -82083,8 +82104,22 @@ function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, on
82083
82104
  draftIds !== undefined &&
82084
82105
  draftIds.length > 0) {
82085
82106
  const draftId = draftIds[draftIds.length - 1];
82086
- draftManager.replaceAction(draftIdToReplace, draftId).then(() => {
82107
+ draftManager
82108
+ .replaceAction(draftIdToReplace, draftId)
82109
+ .then(() => {
82087
82110
  onResponse(responseValue);
82111
+ })
82112
+ .catch((error) => {
82113
+ let message = 'Unknown error replacing draft';
82114
+ if (error instanceof Error) {
82115
+ message = error.message;
82116
+ }
82117
+ else if (typeof error === 'string') {
82118
+ message = error;
82119
+ }
82120
+ onResponse({
82121
+ error: createNativeFetchErrorResponse(message),
82122
+ });
82088
82123
  });
82089
82124
  }
82090
82125
  else {
@@ -82438,7 +82473,7 @@ const callbacks$1 = [];
82438
82473
  function register(r) {
82439
82474
  callbacks$1.forEach((callback) => callback(r));
82440
82475
  }
82441
- // version: 1.266.0-dev17-880c5fb50
82476
+ // version: 1.266.0-dev19-80cc21d89
82442
82477
 
82443
82478
  /**
82444
82479
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -87343,4 +87378,4 @@ const { luvio } = getRuntime();
87343
87378
  setDefaultLuvio({ luvio });
87344
87379
 
87345
87380
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
87346
- // version: 1.266.0-dev17-880c5fb50
87381
+ // version: 1.266.0-dev19-80cc21d89
@@ -4163,7 +4163,7 @@
4163
4163
  }
4164
4164
  callbacks.push(callback);
4165
4165
  }
4166
- // version: 1.266.0-dev17-880c5fb50
4166
+ // version: 1.266.0-dev19-80cc21d89
4167
4167
 
4168
4168
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4169
4169
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15671,7 +15671,7 @@
15671
15671
  }
15672
15672
  return superResult;
15673
15673
  }
15674
- // version: 1.266.0-dev17-880c5fb50
15674
+ // version: 1.266.0-dev19-80cc21d89
15675
15675
 
15676
15676
  function unwrap(data) {
15677
15677
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16596,7 +16596,7 @@
16596
16596
  const { apiFamily, name } = metadata;
16597
16597
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16598
16598
  }
16599
- // version: 1.266.0-dev17-880c5fb50
16599
+ // version: 1.266.0-dev19-80cc21d89
16600
16600
 
16601
16601
  /**
16602
16602
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -43173,7 +43173,7 @@
43173
43173
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
43174
43174
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
43175
43175
  });
43176
- // version: 1.266.0-dev17-8af99d255
43176
+ // version: 1.266.0-dev19-3b7e488f6
43177
43177
 
43178
43178
  var ldsIdempotencyWriteDisabled = {
43179
43179
  isOpen: function (e) {
@@ -49145,7 +49145,12 @@
49145
49145
  }
49146
49146
  finally {
49147
49147
  this.replacingAction = undefined;
49148
- await this.startQueueSafe();
49148
+ try {
49149
+ await this.startQueueSafe();
49150
+ }
49151
+ catch (_a) {
49152
+ // An error starting the queue should not bubble up from this method
49153
+ }
49149
49154
  }
49150
49155
  return updatedTarget;
49151
49156
  });
@@ -52668,6 +52673,12 @@
52668
52673
  break;
52669
52674
  case 'LastModifiedDate':
52670
52675
  field.resolve = ({ recordRepresentation: record }) => {
52676
+ // In UIAPI record reps, LastModifiedDate might be present as a field,
52677
+ // which will include both the value and displayValue
52678
+ if (record.fields['LastModifiedDate']) {
52679
+ return record.fields['LastModifiedDate'];
52680
+ }
52681
+ // If the field is not present, just return the value of the root property
52671
52682
  return record.lastModifiedDate
52672
52683
  ? { value: record.lastModifiedDate }
52673
52684
  : null;
@@ -52702,16 +52713,26 @@
52702
52713
  : null;
52703
52714
  };
52704
52715
  const { recordRepresentation: record, ingestionTimestamp } = obj;
52705
- const fieldName = field.name.endsWith('__r')
52706
- ? field.name.replace('__r', '__c')
52707
- : field.name;
52708
- const id = (record.fields[fieldName] && record.fields[fieldName].value) ||
52709
- (record.fields[`${fieldName}Id`] &&
52710
- record.fields[`${fieldName}Id`].value);
52711
- if (!id)
52716
+ let id = undefined;
52717
+ if (field.name === 'RecordType') {
52718
+ // RecordTypeId has special handling during ingest and is
52719
+ // not in record.fields, so check for it at the UIAPI root property location
52720
+ id = record.recordTypeId;
52721
+ }
52722
+ else if (field.name.endsWith('__r')) {
52723
+ // Custom relationships end in `__r` and the corresponding ID field should be `__c`
52724
+ let fieldName = field.name.replace('__r', '__c');
52725
+ id = record.fields[fieldName] && record.fields[fieldName].value;
52726
+ }
52727
+ else {
52728
+ // Standard relationships are just FieldNameId
52729
+ let fieldName = field.name + 'Id';
52730
+ id = record.fields[fieldName] && record.fields[fieldName].value;
52731
+ }
52732
+ if (!id || typeof id !== 'string') {
52733
+ // possibly field injection did not inject the necessary Id field
52734
+ // for the relationship, or we found a non-string value.
52712
52735
  return null;
52713
- if (id['__ref'] !== undefined) {
52714
- return fetchRecordOrNull(record.fields[`${field.name}Id`].value);
52715
52736
  }
52716
52737
  seenRecordIds.add(id);
52717
52738
  return fetchRecordOrNull(id);
@@ -61097,7 +61118,7 @@
61097
61118
  id: '@salesforce/lds-network-adapter',
61098
61119
  instrument: instrument$2,
61099
61120
  });
61100
- // version: 1.266.0-dev17-880c5fb50
61121
+ // version: 1.266.0-dev19-80cc21d89
61101
61122
 
61102
61123
  const { create: create$3, keys: keys$3 } = Object;
61103
61124
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -79492,7 +79513,7 @@
79492
79513
  configuration: { ...configurationForGraphQLAdapters$1 },
79493
79514
  instrument: instrument$1,
79494
79515
  });
79495
- // version: 1.266.0-dev17-8af99d255
79516
+ // version: 1.266.0-dev19-3b7e488f6
79496
79517
 
79497
79518
  // On core the unstable adapters are re-exported with different names,
79498
79519
  // we want to match them here.
@@ -81746,7 +81767,7 @@
81746
81767
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
81747
81768
  graphQLImperative = ldsAdapter;
81748
81769
  });
81749
- // version: 1.266.0-dev17-8af99d255
81770
+ // version: 1.266.0-dev19-3b7e488f6
81750
81771
 
81751
81772
  var gqlApi = /*#__PURE__*/Object.freeze({
81752
81773
  __proto__: null,
@@ -82089,8 +82110,22 @@
82089
82110
  draftIds !== undefined &&
82090
82111
  draftIds.length > 0) {
82091
82112
  const draftId = draftIds[draftIds.length - 1];
82092
- draftManager.replaceAction(draftIdToReplace, draftId).then(() => {
82113
+ draftManager
82114
+ .replaceAction(draftIdToReplace, draftId)
82115
+ .then(() => {
82093
82116
  onResponse(responseValue);
82117
+ })
82118
+ .catch((error) => {
82119
+ let message = 'Unknown error replacing draft';
82120
+ if (error instanceof Error) {
82121
+ message = error.message;
82122
+ }
82123
+ else if (typeof error === 'string') {
82124
+ message = error;
82125
+ }
82126
+ onResponse({
82127
+ error: createNativeFetchErrorResponse(message),
82128
+ });
82094
82129
  });
82095
82130
  }
82096
82131
  else {
@@ -82444,7 +82479,7 @@
82444
82479
  function register(r) {
82445
82480
  callbacks$1.forEach((callback) => callback(r));
82446
82481
  }
82447
- // version: 1.266.0-dev17-880c5fb50
82482
+ // version: 1.266.0-dev19-80cc21d89
82448
82483
 
82449
82484
  /**
82450
82485
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -87367,4 +87402,4 @@
87367
87402
  exports.subscribeToAdapter = subscribeToAdapter;
87368
87403
 
87369
87404
  }));
87370
- // version: 1.266.0-dev17-880c5fb50
87405
+ // version: 1.266.0-dev19-80cc21d89
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.266.0-dev17",
3
+ "version": "1.266.0-dev19",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.266.0-dev17",
39
- "@salesforce/lds-adapters-uiapi": "^1.266.0-dev17",
40
- "@salesforce/lds-default-luvio": "^1.266.0-dev17",
41
- "@salesforce/lds-drafts": "^1.266.0-dev17",
42
- "@salesforce/lds-graphql-parser": "^1.266.0-dev17",
43
- "@salesforce/lds-luvio-engine": "^1.266.0-dev17",
44
- "@salesforce/lds-priming": "^1.266.0-dev17",
45
- "@salesforce/lds-runtime-mobile": "^1.266.0-dev17",
46
- "@salesforce/nimbus-plugin-lds": "^1.266.0-dev17",
38
+ "@salesforce/lds-adapters-graphql": "^1.266.0-dev19",
39
+ "@salesforce/lds-adapters-uiapi": "^1.266.0-dev19",
40
+ "@salesforce/lds-default-luvio": "^1.266.0-dev19",
41
+ "@salesforce/lds-drafts": "^1.266.0-dev19",
42
+ "@salesforce/lds-graphql-parser": "^1.266.0-dev19",
43
+ "@salesforce/lds-luvio-engine": "^1.266.0-dev19",
44
+ "@salesforce/lds-priming": "^1.266.0-dev19",
45
+ "@salesforce/lds-runtime-mobile": "^1.266.0-dev19",
46
+ "@salesforce/nimbus-plugin-lds": "^1.266.0-dev19",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",
@@ -55,7 +55,7 @@
55
55
  {
56
56
  "path": "./dist/sfdc/es/ldsWorkerApi.js",
57
57
  "maxSize": {
58
- "none": "41.8 kB",
58
+ "none": "42.0 kB",
59
59
  "min": "17.7 kB",
60
60
  "compressed": "7.4 kB"
61
61
  }