@salesforce/lds-worker-api 1.353.0 → 1.354.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.354.0-dc8789df55
|
|
@@ -4266,7 +4266,7 @@ function withDefaultLuvio(callback) {
|
|
|
4266
4266
|
}
|
|
4267
4267
|
callbacks.push(callback);
|
|
4268
4268
|
}
|
|
4269
|
-
// version: 1.
|
|
4269
|
+
// version: 1.354.0-dc8789df55
|
|
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.354.0-dc8789df55
|
|
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.354.0-c6c04442c4
|
|
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;
|
|
@@ -80880,7 +80916,10 @@ function createRecordDraftAdapterFactory(actionHandler, durableRecordStore) {
|
|
|
80880
80916
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80881
80917
|
throw transformErrorToDraftSynthesisError(err);
|
|
80882
80918
|
});
|
|
80883
|
-
|
|
80919
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80920
|
+
if (!record) {
|
|
80921
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80922
|
+
}
|
|
80884
80923
|
if (record) {
|
|
80885
80924
|
return {
|
|
80886
80925
|
state: 'Fulfilled',
|
|
@@ -80908,7 +80947,10 @@ function updateRecordDraftAdapterFactory(actionHandler, durableRecordStore) {
|
|
|
80908
80947
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80909
80948
|
throw transformErrorToDraftSynthesisError(err);
|
|
80910
80949
|
});
|
|
80911
|
-
|
|
80950
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80951
|
+
if (!record) {
|
|
80952
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80953
|
+
}
|
|
80912
80954
|
if (record) {
|
|
80913
80955
|
return {
|
|
80914
80956
|
state: 'Fulfilled',
|
|
@@ -90926,12 +90968,15 @@ class SoqlRecordConverter {
|
|
|
90926
90968
|
};
|
|
90927
90969
|
}
|
|
90928
90970
|
weakEtag(lastModifiedDate) {
|
|
90971
|
+
if (!lastModifiedDate)
|
|
90972
|
+
return 0;
|
|
90929
90973
|
const date = new Date(lastModifiedDate);
|
|
90930
|
-
|
|
90974
|
+
const timestamp = date.getTime();
|
|
90975
|
+
return isNaN(timestamp) ? 0 : timestamp; // milliseconds which matches GQL results
|
|
90931
90976
|
}
|
|
90932
90977
|
formatFieldValueIfNeeded(field, value) {
|
|
90933
90978
|
if (!value)
|
|
90934
|
-
return
|
|
90979
|
+
return null;
|
|
90935
90980
|
if (this.fieldTypeMapping.get(field) === 'DateTime') {
|
|
90936
90981
|
const date = new Date(value);
|
|
90937
90982
|
return date.toISOString();
|
|
@@ -92623,6 +92668,8 @@ function isStoreRecordError$1(storeRecord) {
|
|
|
92623
92668
|
return storeRecord.__type === 'error';
|
|
92624
92669
|
}
|
|
92625
92670
|
|
|
92671
|
+
// NB: This is not exported from luvio, redefined here to avoid changing luvio in patch
|
|
92672
|
+
const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
92626
92673
|
class DurableRecordStore {
|
|
92627
92674
|
constructor(durableStore, getLuvio) {
|
|
92628
92675
|
this.durableStore = durableStore;
|
|
@@ -92638,6 +92685,19 @@ class DurableRecordStore {
|
|
|
92638
92685
|
const map = await this.getRecords([canonicalKey]);
|
|
92639
92686
|
return map.get(canonicalKey);
|
|
92640
92687
|
}
|
|
92688
|
+
// This method will first lookup a redirected key directly in L2, and if a redirected key exists fetch the record with that key.
|
|
92689
|
+
async getRedirectedRecord(key) {
|
|
92690
|
+
const entries = await this.durableStore.getEntries([key], RedirectDurableSegment);
|
|
92691
|
+
if (entries === undefined) {
|
|
92692
|
+
return undefined;
|
|
92693
|
+
}
|
|
92694
|
+
const redirectedEntry = entries[key];
|
|
92695
|
+
if (redirectedEntry === undefined || redirectedEntry.data === undefined) {
|
|
92696
|
+
return undefined;
|
|
92697
|
+
}
|
|
92698
|
+
const redirectedRecord = await this.getRecord(redirectedEntry.data.redirect);
|
|
92699
|
+
return redirectedRecord;
|
|
92700
|
+
}
|
|
92641
92701
|
async getRecords(keys) {
|
|
92642
92702
|
const withMetadata = await this.getRecordsWithMetadata(keys);
|
|
92643
92703
|
const map = new Map();
|
|
@@ -93033,7 +93093,7 @@ register$1({
|
|
|
93033
93093
|
id: '@salesforce/lds-network-adapter',
|
|
93034
93094
|
instrument: instrument$2,
|
|
93035
93095
|
});
|
|
93036
|
-
// version: 1.
|
|
93096
|
+
// version: 1.354.0-dc8789df55
|
|
93037
93097
|
|
|
93038
93098
|
const { create: create$2, keys: keys$2 } = Object;
|
|
93039
93099
|
const { stringify, parse } = JSON;
|
|
@@ -116928,7 +116988,7 @@ register$1({
|
|
|
116928
116988
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
116929
116989
|
instrument: instrument$1,
|
|
116930
116990
|
});
|
|
116931
|
-
// version: 1.
|
|
116991
|
+
// version: 1.354.0-c6c04442c4
|
|
116932
116992
|
|
|
116933
116993
|
// On core the unstable adapters are re-exported with different names,
|
|
116934
116994
|
// we want to match them here.
|
|
@@ -117080,7 +117140,7 @@ withDefaultLuvio((luvio) => {
|
|
|
117080
117140
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
117081
117141
|
graphQLImperative = ldsAdapter;
|
|
117082
117142
|
});
|
|
117083
|
-
// version: 1.
|
|
117143
|
+
// version: 1.354.0-c6c04442c4
|
|
117084
117144
|
|
|
117085
117145
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
117086
117146
|
__proto__: null,
|
|
@@ -117872,7 +117932,7 @@ const callbacks$1 = [];
|
|
|
117872
117932
|
function register(r) {
|
|
117873
117933
|
callbacks$1.forEach((callback) => callback(r));
|
|
117874
117934
|
}
|
|
117875
|
-
// version: 1.
|
|
117935
|
+
// version: 1.354.0-dc8789df55
|
|
117876
117936
|
|
|
117877
117937
|
/**
|
|
117878
117938
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -118952,4 +119012,4 @@ const { luvio } = getRuntime();
|
|
|
118952
119012
|
setDefaultLuvio({ luvio });
|
|
118953
119013
|
|
|
118954
119014
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
118955
|
-
// version: 1.
|
|
119015
|
+
// version: 1.354.0-dc8789df55
|
|
@@ -4272,7 +4272,7 @@
|
|
|
4272
4272
|
}
|
|
4273
4273
|
callbacks.push(callback);
|
|
4274
4274
|
}
|
|
4275
|
-
// version: 1.
|
|
4275
|
+
// version: 1.354.0-dc8789df55
|
|
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.354.0-dc8789df55
|
|
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.354.0-c6c04442c4
|
|
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;
|
|
@@ -80886,7 +80922,10 @@
|
|
|
80886
80922
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80887
80923
|
throw transformErrorToDraftSynthesisError(err);
|
|
80888
80924
|
});
|
|
80889
|
-
|
|
80925
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80926
|
+
if (!record) {
|
|
80927
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80928
|
+
}
|
|
80890
80929
|
if (record) {
|
|
80891
80930
|
return {
|
|
80892
80931
|
state: 'Fulfilled',
|
|
@@ -80914,7 +80953,10 @@
|
|
|
80914
80953
|
const action = await actionHandler.enqueue(request).catch((err) => {
|
|
80915
80954
|
throw transformErrorToDraftSynthesisError(err);
|
|
80916
80955
|
});
|
|
80917
|
-
|
|
80956
|
+
let record = await durableRecordStore.getRecord(action.tag);
|
|
80957
|
+
if (!record) {
|
|
80958
|
+
record = await durableRecordStore.getRedirectedRecord(action.tag);
|
|
80959
|
+
}
|
|
80918
80960
|
if (record) {
|
|
80919
80961
|
return {
|
|
80920
80962
|
state: 'Fulfilled',
|
|
@@ -90932,12 +90974,15 @@
|
|
|
90932
90974
|
};
|
|
90933
90975
|
}
|
|
90934
90976
|
weakEtag(lastModifiedDate) {
|
|
90977
|
+
if (!lastModifiedDate)
|
|
90978
|
+
return 0;
|
|
90935
90979
|
const date = new Date(lastModifiedDate);
|
|
90936
|
-
|
|
90980
|
+
const timestamp = date.getTime();
|
|
90981
|
+
return isNaN(timestamp) ? 0 : timestamp; // milliseconds which matches GQL results
|
|
90937
90982
|
}
|
|
90938
90983
|
formatFieldValueIfNeeded(field, value) {
|
|
90939
90984
|
if (!value)
|
|
90940
|
-
return
|
|
90985
|
+
return null;
|
|
90941
90986
|
if (this.fieldTypeMapping.get(field) === 'DateTime') {
|
|
90942
90987
|
const date = new Date(value);
|
|
90943
90988
|
return date.toISOString();
|
|
@@ -92629,6 +92674,8 @@
|
|
|
92629
92674
|
return storeRecord.__type === 'error';
|
|
92630
92675
|
}
|
|
92631
92676
|
|
|
92677
|
+
// NB: This is not exported from luvio, redefined here to avoid changing luvio in patch
|
|
92678
|
+
const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
92632
92679
|
class DurableRecordStore {
|
|
92633
92680
|
constructor(durableStore, getLuvio) {
|
|
92634
92681
|
this.durableStore = durableStore;
|
|
@@ -92644,6 +92691,19 @@
|
|
|
92644
92691
|
const map = await this.getRecords([canonicalKey]);
|
|
92645
92692
|
return map.get(canonicalKey);
|
|
92646
92693
|
}
|
|
92694
|
+
// This method will first lookup a redirected key directly in L2, and if a redirected key exists fetch the record with that key.
|
|
92695
|
+
async getRedirectedRecord(key) {
|
|
92696
|
+
const entries = await this.durableStore.getEntries([key], RedirectDurableSegment);
|
|
92697
|
+
if (entries === undefined) {
|
|
92698
|
+
return undefined;
|
|
92699
|
+
}
|
|
92700
|
+
const redirectedEntry = entries[key];
|
|
92701
|
+
if (redirectedEntry === undefined || redirectedEntry.data === undefined) {
|
|
92702
|
+
return undefined;
|
|
92703
|
+
}
|
|
92704
|
+
const redirectedRecord = await this.getRecord(redirectedEntry.data.redirect);
|
|
92705
|
+
return redirectedRecord;
|
|
92706
|
+
}
|
|
92647
92707
|
async getRecords(keys) {
|
|
92648
92708
|
const withMetadata = await this.getRecordsWithMetadata(keys);
|
|
92649
92709
|
const map = new Map();
|
|
@@ -93039,7 +93099,7 @@
|
|
|
93039
93099
|
id: '@salesforce/lds-network-adapter',
|
|
93040
93100
|
instrument: instrument$2,
|
|
93041
93101
|
});
|
|
93042
|
-
// version: 1.
|
|
93102
|
+
// version: 1.354.0-dc8789df55
|
|
93043
93103
|
|
|
93044
93104
|
const { create: create$2, keys: keys$2 } = Object;
|
|
93045
93105
|
const { stringify, parse } = JSON;
|
|
@@ -116934,7 +116994,7 @@
|
|
|
116934
116994
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
116935
116995
|
instrument: instrument$1,
|
|
116936
116996
|
});
|
|
116937
|
-
// version: 1.
|
|
116997
|
+
// version: 1.354.0-c6c04442c4
|
|
116938
116998
|
|
|
116939
116999
|
// On core the unstable adapters are re-exported with different names,
|
|
116940
117000
|
// we want to match them here.
|
|
@@ -117086,7 +117146,7 @@
|
|
|
117086
117146
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
117087
117147
|
graphQLImperative = ldsAdapter;
|
|
117088
117148
|
});
|
|
117089
|
-
// version: 1.
|
|
117149
|
+
// version: 1.354.0-c6c04442c4
|
|
117090
117150
|
|
|
117091
117151
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
117092
117152
|
__proto__: null,
|
|
@@ -117878,7 +117938,7 @@
|
|
|
117878
117938
|
function register(r) {
|
|
117879
117939
|
callbacks$1.forEach((callback) => callback(r));
|
|
117880
117940
|
}
|
|
117881
|
-
// version: 1.
|
|
117941
|
+
// version: 1.354.0-dc8789df55
|
|
117882
117942
|
|
|
117883
117943
|
/**
|
|
117884
117944
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -118977,4 +119037,4 @@
|
|
|
118977
119037
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
118978
119038
|
|
|
118979
119039
|
}));
|
|
118980
|
-
// version: 1.
|
|
119040
|
+
// version: 1.354.0-dc8789df55
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.354.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.354.0",
|
|
39
|
+
"@salesforce/lds-adapters-uiapi": "^1.354.0",
|
|
40
|
+
"@salesforce/lds-default-luvio": "^1.354.0",
|
|
41
|
+
"@salesforce/lds-drafts": "^1.354.0",
|
|
42
|
+
"@salesforce/lds-graphql-parser": "^1.354.0",
|
|
43
|
+
"@salesforce/lds-luvio-engine": "^1.354.0",
|
|
44
|
+
"@salesforce/lds-runtime-mobile": "^1.354.0",
|
|
45
|
+
"@salesforce/nimbus-plugin-lds": "^1.354.0",
|
|
46
46
|
"ajv": "^8.11.0",
|
|
47
47
|
"glob": "^7.1.5",
|
|
48
48
|
"nimbus-types": "^2.0.0-alpha1",
|