@salesforce/lds-worker-api 1.100.2 → 1.100.4
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.
- package/dist/sfdc/es/ldsWorkerApi.js +1 -1
- package/dist/standalone/es/lds-worker-api.js +194 -152
- package/dist/standalone/umd/lds-worker-api.js +194 -152
- package/package.json +10 -10
- package/src/__tests__/data-driven-tests/fixtures/adapter-testcases/graphQL/multiple-recordquery.adapter-testcase.json +28 -0
- package/src/__tests__/data-driven-tests/fixtures/adapter-testcases/graphQL/serverresponse/multiple-recordquery.server-response.network-mock.json +201 -0
- package/src/__tests__/data-driven-tests/fixtures/adapter-testcases/graphQL/snapshotdata/multiple-recordquery.adapter-snapshot.result.json +53 -0
|
@@ -3782,7 +3782,7 @@
|
|
|
3782
3782
|
}
|
|
3783
3783
|
callbacks.push(callback);
|
|
3784
3784
|
}
|
|
3785
|
-
// version: 1.100.
|
|
3785
|
+
// version: 1.100.4-ce1be23b7
|
|
3786
3786
|
|
|
3787
3787
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
3788
3788
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15206,7 +15206,7 @@
|
|
|
15206
15206
|
updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
|
|
15207
15207
|
return luvioDocumentNode;
|
|
15208
15208
|
}
|
|
15209
|
-
// version: 1.100.
|
|
15209
|
+
// version: 1.100.4-ce1be23b7
|
|
15210
15210
|
|
|
15211
15211
|
function unwrap(data) {
|
|
15212
15212
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16087,7 +16087,7 @@
|
|
|
16087
16087
|
const { apiFamily, name } = metadata;
|
|
16088
16088
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16089
16089
|
}
|
|
16090
|
-
// version: 1.100.
|
|
16090
|
+
// version: 1.100.4-ce1be23b7
|
|
16091
16091
|
|
|
16092
16092
|
/**
|
|
16093
16093
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -43640,7 +43640,7 @@
|
|
|
43640
43640
|
dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
|
|
43641
43641
|
});
|
|
43642
43642
|
});
|
|
43643
|
-
// version: 1.100.
|
|
43643
|
+
// version: 1.100.4-ce1be23b7
|
|
43644
43644
|
|
|
43645
43645
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
43646
43646
|
|
|
@@ -48012,6 +48012,44 @@
|
|
|
48012
48012
|
return wrapStartEndEvents(storeEval);
|
|
48013
48013
|
}
|
|
48014
48014
|
|
|
48015
|
+
/**
|
|
48016
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
48017
|
+
* All rights reserved.
|
|
48018
|
+
* For full license text, see the LICENSE.txt file
|
|
48019
|
+
*/
|
|
48020
|
+
|
|
48021
|
+
class AsyncWorkerPool {
|
|
48022
|
+
constructor(concurrency) {
|
|
48023
|
+
this.queue = [];
|
|
48024
|
+
this.activeWorkers = 0;
|
|
48025
|
+
this.concurrency = concurrency;
|
|
48026
|
+
}
|
|
48027
|
+
push(workFn) {
|
|
48028
|
+
return new Promise((resolve, reject) => {
|
|
48029
|
+
this.queue.push(async () => {
|
|
48030
|
+
return workFn().then(resolve).catch(reject);
|
|
48031
|
+
});
|
|
48032
|
+
this.work();
|
|
48033
|
+
});
|
|
48034
|
+
}
|
|
48035
|
+
cancel() {
|
|
48036
|
+
this.queue = [];
|
|
48037
|
+
// TODO [W-12513105]: thread cancellation through to active workers
|
|
48038
|
+
}
|
|
48039
|
+
work() {
|
|
48040
|
+
while (this.queue.length > 0 && this.activeWorkers < this.concurrency) {
|
|
48041
|
+
this.activeWorkers += 1;
|
|
48042
|
+
const next = this.queue.shift();
|
|
48043
|
+
if (next) {
|
|
48044
|
+
next().finally(() => {
|
|
48045
|
+
this.activeWorkers -= 1;
|
|
48046
|
+
this.work();
|
|
48047
|
+
});
|
|
48048
|
+
}
|
|
48049
|
+
}
|
|
48050
|
+
}
|
|
48051
|
+
}
|
|
48052
|
+
|
|
48015
48053
|
/**
|
|
48016
48054
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
48017
48055
|
* All rights reserved.
|
|
@@ -48430,6 +48468,7 @@
|
|
|
48430
48468
|
this.timeoutHandler = undefined;
|
|
48431
48469
|
this.handlers = {};
|
|
48432
48470
|
this.draftStore = draftStore;
|
|
48471
|
+
this.workerPool = new AsyncWorkerPool(1);
|
|
48433
48472
|
}
|
|
48434
48473
|
addHandler(handler) {
|
|
48435
48474
|
const id = handler.handlerId;
|
|
@@ -48529,20 +48568,22 @@
|
|
|
48529
48568
|
});
|
|
48530
48569
|
}
|
|
48531
48570
|
async enqueue(handlerId, data) {
|
|
48532
|
-
|
|
48533
|
-
|
|
48534
|
-
|
|
48535
|
-
|
|
48536
|
-
|
|
48537
|
-
|
|
48538
|
-
|
|
48539
|
-
|
|
48571
|
+
return this.workerPool.push(async () => {
|
|
48572
|
+
let queue = await this.getQueueActions();
|
|
48573
|
+
const handler = this.getHandler(handlerId);
|
|
48574
|
+
const pendingAction = (await handler.buildPendingAction(data, queue));
|
|
48575
|
+
await this.draftStore.writeAction(pendingAction);
|
|
48576
|
+
queue = await this.getQueueActions();
|
|
48577
|
+
await this.notifyChangedListeners({
|
|
48578
|
+
type: DraftQueueEventType.ActionAdded,
|
|
48579
|
+
action: pendingAction,
|
|
48580
|
+
});
|
|
48581
|
+
await handler.handleActionEnqueued(pendingAction, queue);
|
|
48582
|
+
if (this.state === DraftQueueState.Started) {
|
|
48583
|
+
this.processNextAction();
|
|
48584
|
+
}
|
|
48585
|
+
return pendingAction;
|
|
48540
48586
|
});
|
|
48541
|
-
await handler.handleActionEnqueued(pendingAction, queue);
|
|
48542
|
-
if (this.state === DraftQueueState.Started) {
|
|
48543
|
-
this.processNextAction();
|
|
48544
|
-
}
|
|
48545
|
-
return pendingAction;
|
|
48546
48587
|
}
|
|
48547
48588
|
registerOnChangedListener(listener) {
|
|
48548
48589
|
this.draftQueueChangedListeners.push(listener);
|
|
@@ -48554,27 +48595,29 @@
|
|
|
48554
48595
|
};
|
|
48555
48596
|
}
|
|
48556
48597
|
async actionCompleted(action) {
|
|
48557
|
-
|
|
48558
|
-
|
|
48559
|
-
|
|
48560
|
-
|
|
48561
|
-
|
|
48562
|
-
|
|
48563
|
-
|
|
48564
|
-
|
|
48598
|
+
return this.workerPool.push(async () => {
|
|
48599
|
+
const handler = this.getHandler(action.handler);
|
|
48600
|
+
let queue = await this.getQueueActions();
|
|
48601
|
+
const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
|
|
48602
|
+
const idAndKeyMappings = handler.getRedirectMappings(action);
|
|
48603
|
+
const keyMappings = idAndKeyMappings === undefined
|
|
48604
|
+
? undefined
|
|
48605
|
+
: idAndKeyMappings.map((m) => {
|
|
48606
|
+
return { draftKey: m.draftKey, canonicalKey: m.canonicalKey };
|
|
48607
|
+
});
|
|
48608
|
+
await this.draftStore.completeAction(queueOperations, keyMappings);
|
|
48609
|
+
queue = await this.getQueueActions();
|
|
48610
|
+
this.retryIntervalMilliseconds = 0;
|
|
48611
|
+
this.uploadingActionId = undefined;
|
|
48612
|
+
await handler.handleActionCompleted(action, queueOperations, queue, values$1(this.handlers));
|
|
48613
|
+
await this.notifyChangedListeners({
|
|
48614
|
+
type: DraftQueueEventType.ActionCompleted,
|
|
48615
|
+
action,
|
|
48565
48616
|
});
|
|
48566
|
-
|
|
48567
|
-
|
|
48568
|
-
|
|
48569
|
-
this.uploadingActionId = undefined;
|
|
48570
|
-
await handler.handleActionCompleted(action, queueOperations, queue, values$1(this.handlers));
|
|
48571
|
-
await this.notifyChangedListeners({
|
|
48572
|
-
type: DraftQueueEventType.ActionCompleted,
|
|
48573
|
-
action,
|
|
48617
|
+
if (this.state === DraftQueueState.Started) {
|
|
48618
|
+
this.processNextAction();
|
|
48619
|
+
}
|
|
48574
48620
|
});
|
|
48575
|
-
if (this.state === DraftQueueState.Started) {
|
|
48576
|
-
this.processNextAction();
|
|
48577
|
-
}
|
|
48578
48621
|
}
|
|
48579
48622
|
async actionFailed(action, retry) {
|
|
48580
48623
|
this.uploadingActionId = undefined;
|
|
@@ -49010,6 +49053,13 @@
|
|
|
49010
49053
|
this.draftQueue = draftQueue;
|
|
49011
49054
|
this.networkAdapter = networkAdapter;
|
|
49012
49055
|
this.getLuvio = getLuvio;
|
|
49056
|
+
// NOTE[W-12567340]: This property stores in-memory mappings between draft
|
|
49057
|
+
// ids and canonical ids for the current session. Having a local copy of
|
|
49058
|
+
// these mappings is necessary to avoid a race condition between publishing
|
|
49059
|
+
// new mappings to the durable store and those mappings being loaded into
|
|
49060
|
+
// the luvio store redirect table, during which a new draft might be enqueued
|
|
49061
|
+
// which would not see a necessary mapping.
|
|
49062
|
+
this.ephemeralRedirects = {};
|
|
49013
49063
|
}
|
|
49014
49064
|
enqueue(data) {
|
|
49015
49065
|
return this.draftQueue.enqueue(this.handlerId, data);
|
|
@@ -49077,7 +49127,8 @@
|
|
|
49077
49127
|
}
|
|
49078
49128
|
getQueueOperationsForCompletingDrafts(queue, action) {
|
|
49079
49129
|
const queueOperations = [];
|
|
49080
|
-
|
|
49130
|
+
const redirects = this.getRedirectMappings(action);
|
|
49131
|
+
if (redirects !== undefined) {
|
|
49081
49132
|
const { length } = queue;
|
|
49082
49133
|
for (let i = 0; i < length; i++) {
|
|
49083
49134
|
const queueAction = queue[i];
|
|
@@ -49087,69 +49138,64 @@
|
|
|
49087
49138
|
continue;
|
|
49088
49139
|
}
|
|
49089
49140
|
if (isResourceRequestAction(queueAction)) {
|
|
49090
|
-
|
|
49091
|
-
|
|
49092
|
-
|
|
49093
|
-
|
|
49094
|
-
|
|
49095
|
-
|
|
49096
|
-
|
|
49097
|
-
|
|
49098
|
-
|
|
49099
|
-
|
|
49100
|
-
|
|
49101
|
-
|
|
49102
|
-
|
|
49103
|
-
basePath = basePath.replace(draftId, canonicalId);
|
|
49104
|
-
stringifiedBody = stringifiedBody.replace(draftId, canonicalId);
|
|
49105
|
-
queueOperationMutated = true;
|
|
49106
|
-
}
|
|
49107
|
-
// if the action is performed on a previous draft id, we need to replace the action
|
|
49108
|
-
// with a new one at the updated canonical key
|
|
49109
|
-
if (queueActionTag === draftKey) {
|
|
49110
|
-
updatedActionTag = canonicalKey;
|
|
49111
|
-
updatedActionTargetId = canonicalId;
|
|
49112
|
-
}
|
|
49141
|
+
let queueOperationMutated = false;
|
|
49142
|
+
let updatedActionTag = undefined;
|
|
49143
|
+
let updatedActionTargetId = undefined;
|
|
49144
|
+
const { tag: queueActionTag, data: queueActionRequest, id: queueActionId, } = queueAction;
|
|
49145
|
+
let { basePath, body } = queueActionRequest;
|
|
49146
|
+
let stringifiedBody = stringify$4(body);
|
|
49147
|
+
// for each redirected ID/key we loop over the operation to see if it needs
|
|
49148
|
+
// to be updated
|
|
49149
|
+
for (const { draftId, draftKey, canonicalId, canonicalKey } of redirects) {
|
|
49150
|
+
if (basePath.search(draftId) >= 0 || stringifiedBody.search(draftId) >= 0) {
|
|
49151
|
+
basePath = basePath.replace(draftId, canonicalId);
|
|
49152
|
+
stringifiedBody = stringifiedBody.replace(draftId, canonicalId);
|
|
49153
|
+
queueOperationMutated = true;
|
|
49113
49154
|
}
|
|
49114
|
-
if
|
|
49115
|
-
|
|
49116
|
-
|
|
49117
|
-
|
|
49118
|
-
|
|
49119
|
-
|
|
49120
|
-
|
|
49121
|
-
|
|
49122
|
-
|
|
49123
|
-
|
|
49124
|
-
|
|
49125
|
-
|
|
49126
|
-
|
|
49127
|
-
|
|
49128
|
-
|
|
49129
|
-
|
|
49130
|
-
|
|
49131
|
-
}
|
|
49132
|
-
|
|
49133
|
-
|
|
49134
|
-
|
|
49135
|
-
|
|
49136
|
-
|
|
49137
|
-
|
|
49138
|
-
|
|
49139
|
-
|
|
49140
|
-
|
|
49141
|
-
|
|
49142
|
-
|
|
49143
|
-
|
|
49144
|
-
|
|
49145
|
-
|
|
49146
|
-
|
|
49147
|
-
|
|
49148
|
-
|
|
49149
|
-
|
|
49150
|
-
|
|
49151
|
-
|
|
49152
|
-
|
|
49155
|
+
// if the action is performed on a previous draft id, we need to replace the action
|
|
49156
|
+
// with a new one at the updated canonical key
|
|
49157
|
+
if (queueActionTag === draftKey) {
|
|
49158
|
+
updatedActionTag = canonicalKey;
|
|
49159
|
+
updatedActionTargetId = canonicalId;
|
|
49160
|
+
}
|
|
49161
|
+
}
|
|
49162
|
+
if (queueOperationMutated) {
|
|
49163
|
+
if (updatedActionTag !== undefined && updatedActionTargetId !== undefined) {
|
|
49164
|
+
const updatedAction = {
|
|
49165
|
+
...queueAction,
|
|
49166
|
+
tag: updatedActionTag,
|
|
49167
|
+
targetId: updatedActionTargetId,
|
|
49168
|
+
data: {
|
|
49169
|
+
...queueActionRequest,
|
|
49170
|
+
basePath: basePath,
|
|
49171
|
+
body: parse$4(stringifiedBody),
|
|
49172
|
+
},
|
|
49173
|
+
};
|
|
49174
|
+
// item needs to be replaced with a new item at the new record key
|
|
49175
|
+
queueOperations.push({
|
|
49176
|
+
type: QueueOperationType.Delete,
|
|
49177
|
+
id: queueActionId,
|
|
49178
|
+
});
|
|
49179
|
+
queueOperations.push({
|
|
49180
|
+
type: QueueOperationType.Add,
|
|
49181
|
+
action: updatedAction,
|
|
49182
|
+
});
|
|
49183
|
+
}
|
|
49184
|
+
else {
|
|
49185
|
+
const updatedAction = {
|
|
49186
|
+
...queueAction,
|
|
49187
|
+
data: {
|
|
49188
|
+
...queueActionRequest,
|
|
49189
|
+
basePath: basePath,
|
|
49190
|
+
body: parse$4(stringifiedBody),
|
|
49191
|
+
},
|
|
49192
|
+
};
|
|
49193
|
+
// item needs to be updated
|
|
49194
|
+
queueOperations.push({
|
|
49195
|
+
type: QueueOperationType.Update,
|
|
49196
|
+
id: queueActionId,
|
|
49197
|
+
action: updatedAction,
|
|
49198
|
+
});
|
|
49153
49199
|
}
|
|
49154
49200
|
}
|
|
49155
49201
|
}
|
|
@@ -49169,6 +49215,9 @@
|
|
|
49169
49215
|
const body = action.response.body;
|
|
49170
49216
|
const canonicalId = this.getIdFromResponseBody(body);
|
|
49171
49217
|
const draftId = action.targetId;
|
|
49218
|
+
if (draftId !== undefined && canonicalId !== undefined && draftId !== canonicalId) {
|
|
49219
|
+
this.ephemeralRedirects[draftId] = canonicalId;
|
|
49220
|
+
}
|
|
49172
49221
|
return [
|
|
49173
49222
|
{
|
|
49174
49223
|
draftId,
|
|
@@ -53874,7 +53923,8 @@
|
|
|
53874
53923
|
},
|
|
53875
53924
|
];
|
|
53876
53925
|
function removeSyntheticFields(result, query) {
|
|
53877
|
-
|
|
53926
|
+
// It is possible that there are multiple record query.
|
|
53927
|
+
const connectionSelections = query.definitions
|
|
53878
53928
|
.filter(isOperationDefinitionNode)
|
|
53879
53929
|
.reduce((accu, definition) => {
|
|
53880
53930
|
return accu.concat(definition.selectionSet.selections);
|
|
@@ -53885,10 +53935,12 @@
|
|
|
53885
53935
|
.filter(isFieldNode)
|
|
53886
53936
|
.filter(nodeIsNamed('query'))
|
|
53887
53937
|
.reduce(extractSelections, [])
|
|
53888
|
-
.filter(isFieldNode)
|
|
53938
|
+
.filter(isFieldNode);
|
|
53889
53939
|
// queries that are not RecordQuery will be undefined here.
|
|
53890
|
-
// we need to also check that
|
|
53891
|
-
if (!
|
|
53940
|
+
// we need to also check that connectionSelections are not undefined. If any connectionSelection has no `selectionSet` defined, that is a malformed query.
|
|
53941
|
+
if (!connectionSelections ||
|
|
53942
|
+
connectionSelections.length === 0 ||
|
|
53943
|
+
connectionSelections.some((connection) => connection.selectionSet === undefined)) {
|
|
53892
53944
|
return result;
|
|
53893
53945
|
}
|
|
53894
53946
|
const nodeJson = result.data.uiapi.query;
|
|
@@ -53897,10 +53949,15 @@
|
|
|
53897
53949
|
const output = { ...result };
|
|
53898
53950
|
const outputApiParent = output.data.uiapi.query;
|
|
53899
53951
|
const keys$1 = keys$3(nodeJson);
|
|
53900
|
-
keys$1.forEach((
|
|
53952
|
+
keys$1.forEach((recordName) => {
|
|
53901
53953
|
const outputApi = {};
|
|
53902
|
-
|
|
53903
|
-
|
|
53954
|
+
// Each connectionSelection's maps its name or alias to one of returned records. The record name could be `apiName' or alias
|
|
53955
|
+
const targetConnection = connectionSelections.find((connection) => connection.name.value === recordName ||
|
|
53956
|
+
(connection.alias !== undefined && connection.alias.value === recordName));
|
|
53957
|
+
if (targetConnection !== undefined) {
|
|
53958
|
+
createUserJsonOutput(targetConnection, nodeJson[recordName], outputApi);
|
|
53959
|
+
outputApiParent[recordName] = outputApi;
|
|
53960
|
+
}
|
|
53904
53961
|
});
|
|
53905
53962
|
return output;
|
|
53906
53963
|
}
|
|
@@ -54942,12 +54999,18 @@
|
|
|
54942
54999
|
const fieldName = fieldNames[i];
|
|
54943
55000
|
const fieldValue = bodyFields[fieldName];
|
|
54944
55001
|
if (typeof fieldValue === 'string' && this.isDraftId(fieldValue)) {
|
|
54945
|
-
const
|
|
54946
|
-
|
|
54947
|
-
|
|
54948
|
-
|
|
54949
|
-
|
|
54950
|
-
|
|
55002
|
+
const canonicalId = this.ephemeralRedirects[fieldValue];
|
|
55003
|
+
if (canonicalId !== undefined) {
|
|
55004
|
+
bodyFields[fieldName] = canonicalId;
|
|
55005
|
+
}
|
|
55006
|
+
else {
|
|
55007
|
+
const draftKey = this.buildTagForTargetId(fieldValue);
|
|
55008
|
+
const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
|
|
55009
|
+
if (draftKey !== canonicalKey) {
|
|
55010
|
+
const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
|
|
55011
|
+
if (canonicalId !== undefined) {
|
|
55012
|
+
bodyFields[fieldName] = canonicalId;
|
|
55013
|
+
}
|
|
54951
55014
|
}
|
|
54952
55015
|
}
|
|
54953
55016
|
}
|
|
@@ -54955,17 +55018,24 @@
|
|
|
54955
55018
|
}
|
|
54956
55019
|
if (request.method === 'patch' || request.method === 'delete') {
|
|
54957
55020
|
const recordId = request.urlParams['recordId'];
|
|
54958
|
-
const
|
|
54959
|
-
|
|
54960
|
-
if (recordKey !== canonicalKey) {
|
|
54961
|
-
const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
|
|
54962
|
-
if (canonicalId === undefined) {
|
|
54963
|
-
// could not resolve id from request -- return the request un-modified
|
|
54964
|
-
return request;
|
|
54965
|
-
}
|
|
55021
|
+
const canonicalId = this.ephemeralRedirects[recordId];
|
|
55022
|
+
if (canonicalId !== undefined) {
|
|
54966
55023
|
resolvedBasePath = resolvedBasePath.replace(recordId, canonicalId);
|
|
54967
55024
|
resolvedUrlParams = { ...resolvedUrlParams, recordId: canonicalId };
|
|
54968
55025
|
}
|
|
55026
|
+
else {
|
|
55027
|
+
const recordKey = this.buildTagForTargetId(recordId);
|
|
55028
|
+
const canonicalKey = this.getLuvio().storeGetCanonicalKey(recordKey);
|
|
55029
|
+
if (recordKey !== canonicalKey) {
|
|
55030
|
+
const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
|
|
55031
|
+
if (canonicalId === undefined) {
|
|
55032
|
+
// could not resolve id from request -- return the request un-modified
|
|
55033
|
+
return request;
|
|
55034
|
+
}
|
|
55035
|
+
resolvedBasePath = resolvedBasePath.replace(recordId, canonicalId);
|
|
55036
|
+
resolvedUrlParams = { ...resolvedUrlParams, recordId: canonicalId };
|
|
55037
|
+
}
|
|
55038
|
+
}
|
|
54969
55039
|
}
|
|
54970
55040
|
return {
|
|
54971
55041
|
...request,
|
|
@@ -58198,34 +58268,6 @@
|
|
|
58198
58268
|
* For full license text, see the LICENSE.txt file
|
|
58199
58269
|
*/
|
|
58200
58270
|
|
|
58201
|
-
class AsyncWorkerPool {
|
|
58202
|
-
constructor(concurrency) {
|
|
58203
|
-
this.queue = [];
|
|
58204
|
-
this.activeWorkers = 0;
|
|
58205
|
-
this.concurrency = concurrency;
|
|
58206
|
-
}
|
|
58207
|
-
push(workFn) {
|
|
58208
|
-
this.queue.push(workFn);
|
|
58209
|
-
this.work();
|
|
58210
|
-
}
|
|
58211
|
-
cancel() {
|
|
58212
|
-
this.queue = [];
|
|
58213
|
-
// TODO [W-12513105]: thread cancellation through to active workers
|
|
58214
|
-
}
|
|
58215
|
-
work() {
|
|
58216
|
-
while (this.queue.length > 0 && this.activeWorkers < this.concurrency) {
|
|
58217
|
-
this.activeWorkers += 1;
|
|
58218
|
-
const next = this.queue.shift();
|
|
58219
|
-
if (next) {
|
|
58220
|
-
next().finally(() => {
|
|
58221
|
-
this.activeWorkers -= 1;
|
|
58222
|
-
this.work();
|
|
58223
|
-
});
|
|
58224
|
-
}
|
|
58225
|
-
}
|
|
58226
|
-
}
|
|
58227
|
-
}
|
|
58228
|
-
|
|
58229
58271
|
class EventEmitter {
|
|
58230
58272
|
constructor() {
|
|
58231
58273
|
// @ts-ignore typescript doesn't like us setting this to an empty object for some reason
|
|
@@ -58774,7 +58816,7 @@
|
|
|
58774
58816
|
id: '@salesforce/lds-network-adapter',
|
|
58775
58817
|
instrument: instrument$1,
|
|
58776
58818
|
});
|
|
58777
|
-
// version: 1.100.
|
|
58819
|
+
// version: 1.100.4-ce1be23b7
|
|
58778
58820
|
|
|
58779
58821
|
const { create: create$2, keys: keys$2 } = Object;
|
|
58780
58822
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -76427,7 +76469,7 @@
|
|
|
76427
76469
|
configuration: { ...configurationForGraphQLAdapters },
|
|
76428
76470
|
instrument,
|
|
76429
76471
|
});
|
|
76430
|
-
// version: 1.100.
|
|
76472
|
+
// version: 1.100.4-ce1be23b7
|
|
76431
76473
|
|
|
76432
76474
|
// On core the unstable adapters are re-exported with different names,
|
|
76433
76475
|
|
|
@@ -78556,7 +78598,7 @@
|
|
|
78556
78598
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
78557
78599
|
graphQLImperative = ldsAdapter;
|
|
78558
78600
|
});
|
|
78559
|
-
// version: 1.100.
|
|
78601
|
+
// version: 1.100.4-ce1be23b7
|
|
78560
78602
|
|
|
78561
78603
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
78562
78604
|
__proto__: null,
|
|
@@ -79247,4 +79289,4 @@
|
|
|
79247
79289
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
79248
79290
|
|
|
79249
79291
|
}));
|
|
79250
|
-
// version: 1.100.
|
|
79292
|
+
// version: 1.100.4-ce1be23b7
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.100.
|
|
3
|
+
"version": "1.100.4",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/standalone/umd/lds-worker-api.js",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@luvio/engine": "0.135.4",
|
|
38
38
|
"@luvio/environments": "0.135.4",
|
|
39
39
|
"@oat-sa/rollup-plugin-wildcard-external": "^0.1.0",
|
|
40
|
-
"@salesforce/lds-adapters-graphql": "^1.100.
|
|
41
|
-
"@salesforce/lds-adapters-uiapi": "^1.100.
|
|
42
|
-
"@salesforce/lds-default-luvio": "^1.100.
|
|
43
|
-
"@salesforce/lds-drafts": "^1.100.
|
|
44
|
-
"@salesforce/lds-graphql-parser": "^1.100.
|
|
45
|
-
"@salesforce/lds-luvio-engine": "^1.100.
|
|
46
|
-
"@salesforce/lds-priming": "^1.100.
|
|
47
|
-
"@salesforce/lds-runtime-mobile": "^1.100.
|
|
48
|
-
"@salesforce/nimbus-plugin-lds": "^1.100.
|
|
40
|
+
"@salesforce/lds-adapters-graphql": "^1.100.4",
|
|
41
|
+
"@salesforce/lds-adapters-uiapi": "^1.100.4",
|
|
42
|
+
"@salesforce/lds-default-luvio": "^1.100.4",
|
|
43
|
+
"@salesforce/lds-drafts": "^1.100.4",
|
|
44
|
+
"@salesforce/lds-graphql-parser": "^1.100.4",
|
|
45
|
+
"@salesforce/lds-luvio-engine": "^1.100.4",
|
|
46
|
+
"@salesforce/lds-priming": "^1.100.4",
|
|
47
|
+
"@salesforce/lds-runtime-mobile": "^1.100.4",
|
|
48
|
+
"@salesforce/nimbus-plugin-lds": "^1.100.4",
|
|
49
49
|
"ajv": "^8.11.0",
|
|
50
50
|
"glob": "^7.1.5",
|
|
51
51
|
"nimbus-types": "^2.0.0-alpha1",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"testCaseName": "Mutiple record queries are supported",
|
|
3
|
+
"adapters": [
|
|
4
|
+
{
|
|
5
|
+
"name": "getObjectInfo",
|
|
6
|
+
"config": { "objectApiName": "ServiceAppointment" }
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "getObjectInfo",
|
|
10
|
+
"config": { "objectApiName": "Account" }
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "graphql",
|
|
14
|
+
"config": {
|
|
15
|
+
"query": "{ uiapi { query { Account(first: 1) @category(name: \"recordQuery\") { edges { node { Id }} } ServiceAppointment(first: 1 where:{OwnerId:{eq :\"005x0000000xPQs\"}}) @category(name: \"recordQuery\") { edges { node { Id AppointmentNumber {value} } } } second: ServiceAppointment(first: 2 where:{OwnerId:{eq :\"005x0000000xPQs\"}}) @category(name: \"recordQuery\") { edges { node { Id AccountId {value} } } }}}}",
|
|
16
|
+
"variables": {}
|
|
17
|
+
},
|
|
18
|
+
"expectedToSucceed": true,
|
|
19
|
+
"expectedResult": "./adapter-testcases/graphQL/snapshotdata/multiple-recordquery.adapter-snapshot.result.json"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"networkMocks": [
|
|
23
|
+
"./adapter-testcases/graphQL/objectInfos/ServiceAppointment.network-mock.json",
|
|
24
|
+
"./adapter-testcases/graphQL/objectInfos/Account.network-mock.json",
|
|
25
|
+
"./adapter-testcases/graphQL/serverresponse/multiple-recordquery.server-response.network-mock.json"
|
|
26
|
+
],
|
|
27
|
+
"freezeTime": true
|
|
28
|
+
}
|