@salesforce/lds-worker-api 1.354.0-dev1 → 1.355.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.
|
@@ -1128,4 +1128,4 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
1130
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
1131
|
-
// version: 1.
|
|
1131
|
+
// version: 1.355.0-4ae8017b1b
|
|
@@ -4266,7 +4266,7 @@ function withDefaultLuvio(callback) {
|
|
|
4266
4266
|
}
|
|
4267
4267
|
callbacks.push(callback);
|
|
4268
4268
|
}
|
|
4269
|
-
// version: 1.
|
|
4269
|
+
// version: 1.355.0-4ae8017b1b
|
|
4270
4270
|
|
|
4271
4271
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4272
4272
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5214,7 +5214,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
5214
5214
|
const { apiFamily, name } = metadata;
|
|
5215
5215
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5216
5216
|
}
|
|
5217
|
-
// version: 1.
|
|
5217
|
+
// version: 1.355.0-4ae8017b1b
|
|
5218
5218
|
|
|
5219
5219
|
/**
|
|
5220
5220
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -33990,7 +33990,7 @@ withDefaultLuvio((luvio) => {
|
|
|
33990
33990
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
33991
33991
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
33992
33992
|
});
|
|
33993
|
-
// version: 1.
|
|
33993
|
+
// version: 1.355.0-df8576becd
|
|
33994
33994
|
|
|
33995
33995
|
/**
|
|
33996
33996
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -46076,7 +46076,7 @@ function isDeprecatedDurableStoreEntry(durableRecord) {
|
|
|
46076
46076
|
return false;
|
|
46077
46077
|
}
|
|
46078
46078
|
const DefaultDurableSegment = 'DEFAULT';
|
|
46079
|
-
const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
46079
|
+
const RedirectDurableSegment$1 = 'REDIRECT_KEYS';
|
|
46080
46080
|
const MessagingDurableSegment = 'MESSAGING';
|
|
46081
46081
|
const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
|
|
46082
46082
|
|
|
@@ -46400,7 +46400,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
46400
46400
|
data: { key, redirect: value },
|
|
46401
46401
|
},
|
|
46402
46402
|
},
|
|
46403
|
-
segment: RedirectDurableSegment,
|
|
46403
|
+
segment: RedirectDurableSegment$1,
|
|
46404
46404
|
});
|
|
46405
46405
|
});
|
|
46406
46406
|
// evicts
|
|
@@ -46460,7 +46460,7 @@ function buildIngestStagingStore(environment) {
|
|
|
46460
46460
|
}
|
|
46461
46461
|
|
|
46462
46462
|
async function reviveRedirects(durableStore, env) {
|
|
46463
|
-
const entries = await durableStore.getAllEntries(RedirectDurableSegment);
|
|
46463
|
+
const entries = await durableStore.getAllEntries(RedirectDurableSegment$1);
|
|
46464
46464
|
if (entries) {
|
|
46465
46465
|
for (const durableEntry of Object.keys(entries)) {
|
|
46466
46466
|
const entry = entries[durableEntry];
|
|
@@ -46626,7 +46626,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
46626
46626
|
else if (change.segment === AdapterContextSegment) {
|
|
46627
46627
|
adapterContextSegmentKeys.push(...change.ids);
|
|
46628
46628
|
}
|
|
46629
|
-
else if (change.segment === RedirectDurableSegment) {
|
|
46629
|
+
else if (change.segment === RedirectDurableSegment$1) {
|
|
46630
46630
|
redirectSegmentKeys.push(...change.ids);
|
|
46631
46631
|
}
|
|
46632
46632
|
else if (change.segment === MessagingDurableSegment) {
|
|
@@ -46634,7 +46634,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
46634
46634
|
}
|
|
46635
46635
|
}
|
|
46636
46636
|
if (redirectSegmentKeys.length > 0) {
|
|
46637
|
-
const redirectEntries = await durableStore.getEntries(redirectSegmentKeys, RedirectDurableSegment);
|
|
46637
|
+
const redirectEntries = await durableStore.getEntries(redirectSegmentKeys, RedirectDurableSegment$1);
|
|
46638
46638
|
if (redirectEntries !== undefined) {
|
|
46639
46639
|
const redirectKeys = Object.keys(redirectEntries);
|
|
46640
46640
|
for (const key of redirectKeys) {
|
|
@@ -80254,8 +80254,44 @@ class UiApiDraftRecordService {
|
|
|
80254
80254
|
}
|
|
80255
80255
|
}
|
|
80256
80256
|
|
|
80257
|
+
class AbstractQuickActionHandler extends AbstractResourceRequestActionHandler {
|
|
80258
|
+
constructor(draftQueue, networkAdapter, getLuvio, recordService) {
|
|
80259
|
+
super(draftQueue, networkAdapter, getLuvio, recordService);
|
|
80260
|
+
}
|
|
80261
|
+
async buildPendingAction(request, queue) {
|
|
80262
|
+
this.resolveResourceRequestBody(request.body);
|
|
80263
|
+
return await super.buildPendingAction(request, queue);
|
|
80264
|
+
}
|
|
80265
|
+
resolveResourceRequestBody(body) {
|
|
80266
|
+
let contextId = body.contextId;
|
|
80267
|
+
if (contextId && this.isDraftId(contextId)) {
|
|
80268
|
+
const draftKey = getRecordKeyForId(this.getLuvio(), contextId);
|
|
80269
|
+
const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
|
|
80270
|
+
if (draftKey !== canonicalKey) {
|
|
80271
|
+
const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
|
|
80272
|
+
if (canonicalId !== undefined) {
|
|
80273
|
+
body.contextId = canonicalId;
|
|
80274
|
+
}
|
|
80275
|
+
}
|
|
80276
|
+
}
|
|
80277
|
+
for (const field of keys$2$1(body.fields)) {
|
|
80278
|
+
const fieldValue = body.fields[field];
|
|
80279
|
+
if (typeof fieldValue === 'string' && this.isDraftId(fieldValue)) {
|
|
80280
|
+
const draftKey = getRecordKeyForId(this.getLuvio(), fieldValue);
|
|
80281
|
+
const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
|
|
80282
|
+
if (draftKey !== canonicalKey) {
|
|
80283
|
+
const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
|
|
80284
|
+
if (canonicalId !== undefined) {
|
|
80285
|
+
body.fields[field] = canonicalId;
|
|
80286
|
+
}
|
|
80287
|
+
}
|
|
80288
|
+
}
|
|
80289
|
+
}
|
|
80290
|
+
}
|
|
80291
|
+
}
|
|
80292
|
+
|
|
80257
80293
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
80258
|
-
class QuickActionExecutionRepresentationHandler extends
|
|
80294
|
+
class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
80259
80295
|
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
|
|
80260
80296
|
super(draftQueue, networkAdapter, getLuvio, draftRecordService);
|
|
80261
80297
|
this.draftRecordService = draftRecordService;
|
|
@@ -80324,7 +80360,7 @@ class QuickActionExecutionRepresentationHandler extends AbstractResourceRequestA
|
|
|
80324
80360
|
}
|
|
80325
80361
|
|
|
80326
80362
|
const UPDATE_RECORD_QUICK_ACTION_HANDLER = 'UPDATE_RECORD_QUICK_ACTION_HANDLER';
|
|
80327
|
-
class UpdateRecordQuickActionExecutionRepresentationHandler extends
|
|
80363
|
+
class UpdateRecordQuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
80328
80364
|
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService) {
|
|
80329
80365
|
super(draftQueue, networkAdapter, getLuvio, draftRecordService);
|
|
80330
80366
|
this.draftRecordService = draftRecordService;
|
|
@@ -80884,7 +80920,10 @@ function createRecordDraftAdapterFactory(actionHandler, durableRecordStore) {
|
|
|
80884
80920
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80885
80921
|
throw transformErrorToDraftSynthesisError(err);
|
|
80886
80922
|
});
|
|
80887
|
-
|
|
80923
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80924
|
+
if (!record) {
|
|
80925
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80926
|
+
}
|
|
80888
80927
|
if (record) {
|
|
80889
80928
|
return {
|
|
80890
80929
|
state: 'Fulfilled',
|
|
@@ -80912,7 +80951,10 @@ function updateRecordDraftAdapterFactory(actionHandler, durableRecordStore) {
|
|
|
80912
80951
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80913
80952
|
throw transformErrorToDraftSynthesisError(err);
|
|
80914
80953
|
});
|
|
80915
|
-
|
|
80954
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80955
|
+
if (!record) {
|
|
80956
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80957
|
+
}
|
|
80916
80958
|
if (record) {
|
|
80917
80959
|
return {
|
|
80918
80960
|
state: 'Fulfilled',
|
|
@@ -90930,12 +90972,15 @@ class SoqlRecordConverter {
|
|
|
90930
90972
|
};
|
|
90931
90973
|
}
|
|
90932
90974
|
weakEtag(lastModifiedDate) {
|
|
90975
|
+
if (!lastModifiedDate)
|
|
90976
|
+
return 0;
|
|
90933
90977
|
const date = new Date(lastModifiedDate);
|
|
90934
|
-
|
|
90978
|
+
const timestamp = date.getTime();
|
|
90979
|
+
return isNaN(timestamp) ? 0 : timestamp; // milliseconds which matches GQL results
|
|
90935
90980
|
}
|
|
90936
90981
|
formatFieldValueIfNeeded(field, value) {
|
|
90937
90982
|
if (!value)
|
|
90938
|
-
return
|
|
90983
|
+
return null;
|
|
90939
90984
|
if (this.fieldTypeMapping.get(field) === 'DateTime') {
|
|
90940
90985
|
const date = new Date(value);
|
|
90941
90986
|
return date.toISOString();
|
|
@@ -92627,6 +92672,8 @@ function isStoreRecordError$1(storeRecord) {
|
|
|
92627
92672
|
return storeRecord.__type === 'error';
|
|
92628
92673
|
}
|
|
92629
92674
|
|
|
92675
|
+
// NB: This is not exported from luvio, redefined here to avoid changing luvio in patch
|
|
92676
|
+
const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
92630
92677
|
class DurableRecordStore {
|
|
92631
92678
|
constructor(durableStore, getLuvio) {
|
|
92632
92679
|
this.durableStore = durableStore;
|
|
@@ -92642,6 +92689,19 @@ class DurableRecordStore {
|
|
|
92642
92689
|
const map = await this.getRecords([canonicalKey]);
|
|
92643
92690
|
return map.get(canonicalKey);
|
|
92644
92691
|
}
|
|
92692
|
+
// This method will first lookup a redirected key directly in L2, and if a redirected key exists fetch the record with that key.
|
|
92693
|
+
async getRedirectedRecord(key) {
|
|
92694
|
+
const entries = await this.durableStore.getEntries([key], RedirectDurableSegment);
|
|
92695
|
+
if (entries === undefined) {
|
|
92696
|
+
return undefined;
|
|
92697
|
+
}
|
|
92698
|
+
const redirectedEntry = entries[key];
|
|
92699
|
+
if (redirectedEntry === undefined || redirectedEntry.data === undefined) {
|
|
92700
|
+
return undefined;
|
|
92701
|
+
}
|
|
92702
|
+
const redirectedRecord = await this.getRecord(redirectedEntry.data.redirect);
|
|
92703
|
+
return redirectedRecord;
|
|
92704
|
+
}
|
|
92645
92705
|
async getRecords(keys) {
|
|
92646
92706
|
const withMetadata = await this.getRecordsWithMetadata(keys);
|
|
92647
92707
|
const map = new Map();
|
|
@@ -93037,7 +93097,7 @@ register$1({
|
|
|
93037
93097
|
id: '@salesforce/lds-network-adapter',
|
|
93038
93098
|
instrument: instrument$2,
|
|
93039
93099
|
});
|
|
93040
|
-
// version: 1.
|
|
93100
|
+
// version: 1.355.0-4ae8017b1b
|
|
93041
93101
|
|
|
93042
93102
|
const { create: create$2, keys: keys$2 } = Object;
|
|
93043
93103
|
const { stringify, parse } = JSON;
|
|
@@ -116932,7 +116992,7 @@ register$1({
|
|
|
116932
116992
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
116933
116993
|
instrument: instrument$1,
|
|
116934
116994
|
});
|
|
116935
|
-
// version: 1.
|
|
116995
|
+
// version: 1.355.0-df8576becd
|
|
116936
116996
|
|
|
116937
116997
|
// On core the unstable adapters are re-exported with different names,
|
|
116938
116998
|
// we want to match them here.
|
|
@@ -117084,7 +117144,7 @@ withDefaultLuvio((luvio) => {
|
|
|
117084
117144
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
117085
117145
|
graphQLImperative = ldsAdapter;
|
|
117086
117146
|
});
|
|
117087
|
-
// version: 1.
|
|
117147
|
+
// version: 1.355.0-df8576becd
|
|
117088
117148
|
|
|
117089
117149
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
117090
117150
|
__proto__: null,
|
|
@@ -117876,7 +117936,7 @@ const callbacks$1 = [];
|
|
|
117876
117936
|
function register(r) {
|
|
117877
117937
|
callbacks$1.forEach((callback) => callback(r));
|
|
117878
117938
|
}
|
|
117879
|
-
// version: 1.
|
|
117939
|
+
// version: 1.355.0-4ae8017b1b
|
|
117880
117940
|
|
|
117881
117941
|
/**
|
|
117882
117942
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -118956,4 +119016,4 @@ const { luvio } = getRuntime();
|
|
|
118956
119016
|
setDefaultLuvio({ luvio });
|
|
118957
119017
|
|
|
118958
119018
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
118959
|
-
// version: 1.
|
|
119019
|
+
// version: 1.355.0-4ae8017b1b
|
|
@@ -4272,7 +4272,7 @@
|
|
|
4272
4272
|
}
|
|
4273
4273
|
callbacks.push(callback);
|
|
4274
4274
|
}
|
|
4275
|
-
// version: 1.
|
|
4275
|
+
// version: 1.355.0-4ae8017b1b
|
|
4276
4276
|
|
|
4277
4277
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4278
4278
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5220,7 +5220,7 @@
|
|
|
5220
5220
|
const { apiFamily, name } = metadata;
|
|
5221
5221
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5222
5222
|
}
|
|
5223
|
-
// version: 1.
|
|
5223
|
+
// version: 1.355.0-4ae8017b1b
|
|
5224
5224
|
|
|
5225
5225
|
/**
|
|
5226
5226
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -33996,7 +33996,7 @@
|
|
|
33996
33996
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
33997
33997
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
33998
33998
|
});
|
|
33999
|
-
// version: 1.
|
|
33999
|
+
// version: 1.355.0-df8576becd
|
|
34000
34000
|
|
|
34001
34001
|
/**
|
|
34002
34002
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -46082,7 +46082,7 @@
|
|
|
46082
46082
|
return false;
|
|
46083
46083
|
}
|
|
46084
46084
|
const DefaultDurableSegment = 'DEFAULT';
|
|
46085
|
-
const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
46085
|
+
const RedirectDurableSegment$1 = 'REDIRECT_KEYS';
|
|
46086
46086
|
const MessagingDurableSegment = 'MESSAGING';
|
|
46087
46087
|
const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
|
|
46088
46088
|
|
|
@@ -46406,7 +46406,7 @@
|
|
|
46406
46406
|
data: { key, redirect: value },
|
|
46407
46407
|
},
|
|
46408
46408
|
},
|
|
46409
|
-
segment: RedirectDurableSegment,
|
|
46409
|
+
segment: RedirectDurableSegment$1,
|
|
46410
46410
|
});
|
|
46411
46411
|
});
|
|
46412
46412
|
// evicts
|
|
@@ -46466,7 +46466,7 @@
|
|
|
46466
46466
|
}
|
|
46467
46467
|
|
|
46468
46468
|
async function reviveRedirects(durableStore, env) {
|
|
46469
|
-
const entries = await durableStore.getAllEntries(RedirectDurableSegment);
|
|
46469
|
+
const entries = await durableStore.getAllEntries(RedirectDurableSegment$1);
|
|
46470
46470
|
if (entries) {
|
|
46471
46471
|
for (const durableEntry of Object.keys(entries)) {
|
|
46472
46472
|
const entry = entries[durableEntry];
|
|
@@ -46632,7 +46632,7 @@
|
|
|
46632
46632
|
else if (change.segment === AdapterContextSegment) {
|
|
46633
46633
|
adapterContextSegmentKeys.push(...change.ids);
|
|
46634
46634
|
}
|
|
46635
|
-
else if (change.segment === RedirectDurableSegment) {
|
|
46635
|
+
else if (change.segment === RedirectDurableSegment$1) {
|
|
46636
46636
|
redirectSegmentKeys.push(...change.ids);
|
|
46637
46637
|
}
|
|
46638
46638
|
else if (change.segment === MessagingDurableSegment) {
|
|
@@ -46640,7 +46640,7 @@
|
|
|
46640
46640
|
}
|
|
46641
46641
|
}
|
|
46642
46642
|
if (redirectSegmentKeys.length > 0) {
|
|
46643
|
-
const redirectEntries = await durableStore.getEntries(redirectSegmentKeys, RedirectDurableSegment);
|
|
46643
|
+
const redirectEntries = await durableStore.getEntries(redirectSegmentKeys, RedirectDurableSegment$1);
|
|
46644
46644
|
if (redirectEntries !== undefined) {
|
|
46645
46645
|
const redirectKeys = Object.keys(redirectEntries);
|
|
46646
46646
|
for (const key of redirectKeys) {
|
|
@@ -80260,8 +80260,44 @@
|
|
|
80260
80260
|
}
|
|
80261
80261
|
}
|
|
80262
80262
|
|
|
80263
|
+
class AbstractQuickActionHandler extends AbstractResourceRequestActionHandler {
|
|
80264
|
+
constructor(draftQueue, networkAdapter, getLuvio, recordService) {
|
|
80265
|
+
super(draftQueue, networkAdapter, getLuvio, recordService);
|
|
80266
|
+
}
|
|
80267
|
+
async buildPendingAction(request, queue) {
|
|
80268
|
+
this.resolveResourceRequestBody(request.body);
|
|
80269
|
+
return await super.buildPendingAction(request, queue);
|
|
80270
|
+
}
|
|
80271
|
+
resolveResourceRequestBody(body) {
|
|
80272
|
+
let contextId = body.contextId;
|
|
80273
|
+
if (contextId && this.isDraftId(contextId)) {
|
|
80274
|
+
const draftKey = getRecordKeyForId(this.getLuvio(), contextId);
|
|
80275
|
+
const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
|
|
80276
|
+
if (draftKey !== canonicalKey) {
|
|
80277
|
+
const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
|
|
80278
|
+
if (canonicalId !== undefined) {
|
|
80279
|
+
body.contextId = canonicalId;
|
|
80280
|
+
}
|
|
80281
|
+
}
|
|
80282
|
+
}
|
|
80283
|
+
for (const field of keys$2$1(body.fields)) {
|
|
80284
|
+
const fieldValue = body.fields[field];
|
|
80285
|
+
if (typeof fieldValue === 'string' && this.isDraftId(fieldValue)) {
|
|
80286
|
+
const draftKey = getRecordKeyForId(this.getLuvio(), fieldValue);
|
|
80287
|
+
const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
|
|
80288
|
+
if (draftKey !== canonicalKey) {
|
|
80289
|
+
const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
|
|
80290
|
+
if (canonicalId !== undefined) {
|
|
80291
|
+
body.fields[field] = canonicalId;
|
|
80292
|
+
}
|
|
80293
|
+
}
|
|
80294
|
+
}
|
|
80295
|
+
}
|
|
80296
|
+
}
|
|
80297
|
+
}
|
|
80298
|
+
|
|
80263
80299
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
80264
|
-
class QuickActionExecutionRepresentationHandler extends
|
|
80300
|
+
class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
80265
80301
|
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
|
|
80266
80302
|
super(draftQueue, networkAdapter, getLuvio, draftRecordService);
|
|
80267
80303
|
this.draftRecordService = draftRecordService;
|
|
@@ -80330,7 +80366,7 @@
|
|
|
80330
80366
|
}
|
|
80331
80367
|
|
|
80332
80368
|
const UPDATE_RECORD_QUICK_ACTION_HANDLER = 'UPDATE_RECORD_QUICK_ACTION_HANDLER';
|
|
80333
|
-
class UpdateRecordQuickActionExecutionRepresentationHandler extends
|
|
80369
|
+
class UpdateRecordQuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
80334
80370
|
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService) {
|
|
80335
80371
|
super(draftQueue, networkAdapter, getLuvio, draftRecordService);
|
|
80336
80372
|
this.draftRecordService = draftRecordService;
|
|
@@ -80890,7 +80926,10 @@
|
|
|
80890
80926
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80891
80927
|
throw transformErrorToDraftSynthesisError(err);
|
|
80892
80928
|
});
|
|
80893
|
-
|
|
80929
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80930
|
+
if (!record) {
|
|
80931
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80932
|
+
}
|
|
80894
80933
|
if (record) {
|
|
80895
80934
|
return {
|
|
80896
80935
|
state: 'Fulfilled',
|
|
@@ -80918,7 +80957,10 @@
|
|
|
80918
80957
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80919
80958
|
throw transformErrorToDraftSynthesisError(err);
|
|
80920
80959
|
});
|
|
80921
|
-
|
|
80960
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80961
|
+
if (!record) {
|
|
80962
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80963
|
+
}
|
|
80922
80964
|
if (record) {
|
|
80923
80965
|
return {
|
|
80924
80966
|
state: 'Fulfilled',
|
|
@@ -90936,12 +90978,15 @@
|
|
|
90936
90978
|
};
|
|
90937
90979
|
}
|
|
90938
90980
|
weakEtag(lastModifiedDate) {
|
|
90981
|
+
if (!lastModifiedDate)
|
|
90982
|
+
return 0;
|
|
90939
90983
|
const date = new Date(lastModifiedDate);
|
|
90940
|
-
|
|
90984
|
+
const timestamp = date.getTime();
|
|
90985
|
+
return isNaN(timestamp) ? 0 : timestamp; // milliseconds which matches GQL results
|
|
90941
90986
|
}
|
|
90942
90987
|
formatFieldValueIfNeeded(field, value) {
|
|
90943
90988
|
if (!value)
|
|
90944
|
-
return
|
|
90989
|
+
return null;
|
|
90945
90990
|
if (this.fieldTypeMapping.get(field) === 'DateTime') {
|
|
90946
90991
|
const date = new Date(value);
|
|
90947
90992
|
return date.toISOString();
|
|
@@ -92633,6 +92678,8 @@
|
|
|
92633
92678
|
return storeRecord.__type === 'error';
|
|
92634
92679
|
}
|
|
92635
92680
|
|
|
92681
|
+
// NB: This is not exported from luvio, redefined here to avoid changing luvio in patch
|
|
92682
|
+
const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
92636
92683
|
class DurableRecordStore {
|
|
92637
92684
|
constructor(durableStore, getLuvio) {
|
|
92638
92685
|
this.durableStore = durableStore;
|
|
@@ -92648,6 +92695,19 @@
|
|
|
92648
92695
|
const map = await this.getRecords([canonicalKey]);
|
|
92649
92696
|
return map.get(canonicalKey);
|
|
92650
92697
|
}
|
|
92698
|
+
// This method will first lookup a redirected key directly in L2, and if a redirected key exists fetch the record with that key.
|
|
92699
|
+
async getRedirectedRecord(key) {
|
|
92700
|
+
const entries = await this.durableStore.getEntries([key], RedirectDurableSegment);
|
|
92701
|
+
if (entries === undefined) {
|
|
92702
|
+
return undefined;
|
|
92703
|
+
}
|
|
92704
|
+
const redirectedEntry = entries[key];
|
|
92705
|
+
if (redirectedEntry === undefined || redirectedEntry.data === undefined) {
|
|
92706
|
+
return undefined;
|
|
92707
|
+
}
|
|
92708
|
+
const redirectedRecord = await this.getRecord(redirectedEntry.data.redirect);
|
|
92709
|
+
return redirectedRecord;
|
|
92710
|
+
}
|
|
92651
92711
|
async getRecords(keys) {
|
|
92652
92712
|
const withMetadata = await this.getRecordsWithMetadata(keys);
|
|
92653
92713
|
const map = new Map();
|
|
@@ -93043,7 +93103,7 @@
|
|
|
93043
93103
|
id: '@salesforce/lds-network-adapter',
|
|
93044
93104
|
instrument: instrument$2,
|
|
93045
93105
|
});
|
|
93046
|
-
// version: 1.
|
|
93106
|
+
// version: 1.355.0-4ae8017b1b
|
|
93047
93107
|
|
|
93048
93108
|
const { create: create$2, keys: keys$2 } = Object;
|
|
93049
93109
|
const { stringify, parse } = JSON;
|
|
@@ -116938,7 +116998,7 @@
|
|
|
116938
116998
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
116939
116999
|
instrument: instrument$1,
|
|
116940
117000
|
});
|
|
116941
|
-
// version: 1.
|
|
117001
|
+
// version: 1.355.0-df8576becd
|
|
116942
117002
|
|
|
116943
117003
|
// On core the unstable adapters are re-exported with different names,
|
|
116944
117004
|
// we want to match them here.
|
|
@@ -117090,7 +117150,7 @@
|
|
|
117090
117150
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
117091
117151
|
graphQLImperative = ldsAdapter;
|
|
117092
117152
|
});
|
|
117093
|
-
// version: 1.
|
|
117153
|
+
// version: 1.355.0-df8576becd
|
|
117094
117154
|
|
|
117095
117155
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
117096
117156
|
__proto__: null,
|
|
@@ -117882,7 +117942,7 @@
|
|
|
117882
117942
|
function register(r) {
|
|
117883
117943
|
callbacks$1.forEach((callback) => callback(r));
|
|
117884
117944
|
}
|
|
117885
|
-
// version: 1.
|
|
117945
|
+
// version: 1.355.0-4ae8017b1b
|
|
117886
117946
|
|
|
117887
117947
|
/**
|
|
117888
117948
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -118981,4 +119041,4 @@
|
|
|
118981
119041
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
118982
119042
|
|
|
118983
119043
|
}));
|
|
118984
|
-
// version: 1.
|
|
119044
|
+
// version: 1.355.0-4ae8017b1b
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.355.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/standalone/es/lds-worker-api.js",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
|
|
38
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
39
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
40
|
-
"@salesforce/lds-default-luvio": "^1.
|
|
41
|
-
"@salesforce/lds-drafts": "^1.
|
|
42
|
-
"@salesforce/lds-graphql-parser": "^1.
|
|
43
|
-
"@salesforce/lds-luvio-engine": "^1.
|
|
44
|
-
"@salesforce/lds-runtime-mobile": "^1.
|
|
45
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
38
|
+
"@salesforce/lds-adapters-graphql": "^1.355.0",
|
|
39
|
+
"@salesforce/lds-adapters-uiapi": "^1.355.0",
|
|
40
|
+
"@salesforce/lds-default-luvio": "^1.355.0",
|
|
41
|
+
"@salesforce/lds-drafts": "^1.355.0",
|
|
42
|
+
"@salesforce/lds-graphql-parser": "^1.355.0",
|
|
43
|
+
"@salesforce/lds-luvio-engine": "^1.355.0",
|
|
44
|
+
"@salesforce/lds-runtime-mobile": "^1.355.0",
|
|
45
|
+
"@salesforce/nimbus-plugin-lds": "^1.355.0",
|
|
46
46
|
"ajv": "^8.11.0",
|
|
47
47
|
"glob": "^7.1.5",
|
|
48
48
|
"nimbus-types": "^2.0.0-alpha1",
|