@salesforce/lds-worker-api 1.369.0 → 1.370.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.
- package/dist/sfdc/es/ldsWorkerApi.js +1 -1
- package/dist/standalone/es/lds-worker-api.js +1113 -658
- package/dist/standalone/umd/lds-worker-api.js +1113 -658
- package/package.json +9 -9
|
@@ -24,7 +24,7 @@ const { create: create$a, entries: entries$5, freeze: freeze$6, keys: keys$a, va
|
|
|
24
24
|
const { hasOwnProperty: hasOwnProperty$4 } = Object.prototype;
|
|
25
25
|
const { isArray: isArray$9 } = Array;
|
|
26
26
|
const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
|
|
27
|
-
const { parse: parse$
|
|
27
|
+
const { parse: parse$b, stringify: stringify$b } = JSON;
|
|
28
28
|
const WeakSetCtor = WeakSet;
|
|
29
29
|
|
|
30
30
|
const deeplyFrozen = new WeakSetCtor();
|
|
@@ -302,7 +302,7 @@ function stableJSONStringify$4(node) {
|
|
|
302
302
|
return isFinite(node) ? '' + node : 'null';
|
|
303
303
|
}
|
|
304
304
|
if (typeof node !== 'object') {
|
|
305
|
-
return stringify$
|
|
305
|
+
return stringify$b(node);
|
|
306
306
|
}
|
|
307
307
|
let i;
|
|
308
308
|
let out;
|
|
@@ -330,7 +330,7 @@ function stableJSONStringify$4(node) {
|
|
|
330
330
|
if (out) {
|
|
331
331
|
out += ',';
|
|
332
332
|
}
|
|
333
|
-
out += stringify$
|
|
333
|
+
out += stringify$b(key) + ':' + value;
|
|
334
334
|
}
|
|
335
335
|
return '{' + out + '}';
|
|
336
336
|
}
|
|
@@ -2314,7 +2314,7 @@ function formatStorageKey(name, argValues) {
|
|
|
2314
2314
|
if (hasOwnProperty$4.call(argValues, _argName)) {
|
|
2315
2315
|
var value = argValues[_argName];
|
|
2316
2316
|
if (value !== null || value !== undefined) {
|
|
2317
|
-
values.push(_argName + ':' + stringify$
|
|
2317
|
+
values.push(_argName + ':' + stringify$b(value));
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
@@ -2629,7 +2629,7 @@ class Reader {
|
|
|
2629
2629
|
}
|
|
2630
2630
|
// Only works for non-complex values.. No Date or Functions.
|
|
2631
2631
|
opaqueCopy(value) {
|
|
2632
|
-
return parse$
|
|
2632
|
+
return parse$b(stringify$b(value));
|
|
2633
2633
|
}
|
|
2634
2634
|
deepCopy(record, data, key, visitedKeys) {
|
|
2635
2635
|
const value = record[key];
|
|
@@ -2775,7 +2775,7 @@ class Reader {
|
|
|
2775
2775
|
this.readScalar(propertyName, source, sink);
|
|
2776
2776
|
return;
|
|
2777
2777
|
}
|
|
2778
|
-
throw new Error(`Invalid Link State. Link on "${this.currentPath.fullPath}" is null but selection is not nullable: \n${stringify$
|
|
2778
|
+
throw new Error(`Invalid Link State. Link on "${this.currentPath.fullPath}" is null but selection is not nullable: \n${stringify$b(selection, null, 2)}`);
|
|
2779
2779
|
case StoreLinkStateValues$2.Pending:
|
|
2780
2780
|
this.markPending();
|
|
2781
2781
|
return;
|
|
@@ -2897,7 +2897,7 @@ class Reader {
|
|
|
2897
2897
|
}
|
|
2898
2898
|
if ((options === null || options === void 0 ? void 0 : options.useDeepEquals) === true) {
|
|
2899
2899
|
this.snapshotChanged =
|
|
2900
|
-
stringify$
|
|
2900
|
+
stringify$b(this.currentPath.baseSnapshotValue) !== stringify$b(value);
|
|
2901
2901
|
}
|
|
2902
2902
|
else {
|
|
2903
2903
|
this.snapshotChanged = this.currentPath.baseSnapshotValue !== value;
|
|
@@ -3298,7 +3298,7 @@ function normalizeNetworkAdapterError(error) {
|
|
|
3298
3298
|
return error;
|
|
3299
3299
|
}
|
|
3300
3300
|
// anything else should get turned into an Error with the errorType set
|
|
3301
|
-
const normalizedError = new Error(`NetworkAdapter rejected with non-Error object: ${typeof error === 'undefined' ? 'undefined' : stringify$
|
|
3301
|
+
const normalizedError = new Error(`NetworkAdapter rejected with non-Error object: ${typeof error === 'undefined' ? 'undefined' : stringify$b(error)}`);
|
|
3302
3302
|
normalizedError.errorType = 'networkAdapterError';
|
|
3303
3303
|
return normalizedError;
|
|
3304
3304
|
}
|
|
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
callbacks.push(callback);
|
|
4276
4276
|
}
|
|
4277
|
-
// version: 1.
|
|
4277
|
+
// version: 1.370.0-3ec6ffba72
|
|
4278
4278
|
|
|
4279
4279
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4280
4280
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -4390,7 +4390,7 @@ function isPromise$1$1(value) {
|
|
|
4390
4390
|
}
|
|
4391
4391
|
|
|
4392
4392
|
const { isArray: isArray$8 } = Array;
|
|
4393
|
-
const { stringify: stringify$
|
|
4393
|
+
const { stringify: stringify$a } = JSON;
|
|
4394
4394
|
|
|
4395
4395
|
/**
|
|
4396
4396
|
* (Re)throws an error after adding a prefix to the message.
|
|
@@ -4403,7 +4403,7 @@ function throwAnnotatedError(error, messagePrefix) {
|
|
|
4403
4403
|
error.message = `${messagePrefix}\n[${error.message}]`;
|
|
4404
4404
|
throw error;
|
|
4405
4405
|
}
|
|
4406
|
-
throw new Error(`${messagePrefix}\n[${stringify$
|
|
4406
|
+
throw new Error(`${messagePrefix}\n[${stringify$a(error)}]`);
|
|
4407
4407
|
}
|
|
4408
4408
|
|
|
4409
4409
|
class Sanitizer {
|
|
@@ -4419,7 +4419,7 @@ class Sanitizer {
|
|
|
4419
4419
|
}
|
|
4420
4420
|
sanitize() {
|
|
4421
4421
|
const sanitizer = this;
|
|
4422
|
-
stringify$
|
|
4422
|
+
stringify$a(this.obj, function (key, value) {
|
|
4423
4423
|
if (key === '') {
|
|
4424
4424
|
return value;
|
|
4425
4425
|
}
|
|
@@ -5290,7 +5290,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
5290
5290
|
const { apiFamily, name } = metadata;
|
|
5291
5291
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5292
5292
|
}
|
|
5293
|
-
// version: 1.
|
|
5293
|
+
// version: 1.370.0-3ec6ffba72
|
|
5294
5294
|
|
|
5295
5295
|
/**
|
|
5296
5296
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -5452,6 +5452,14 @@ let oneStoreGetObjectInfoAdapter$3 = undefined;
|
|
|
5452
5452
|
* One store enabled Get Object Infos adapter
|
|
5453
5453
|
*/
|
|
5454
5454
|
let oneStoreGetObjectInfosAdapter$3 = undefined;
|
|
5455
|
+
/**
|
|
5456
|
+
* One store enabled GraphQL adapter
|
|
5457
|
+
*/
|
|
5458
|
+
let oneStoreGraphQLWireAdapter$3 = undefined;
|
|
5459
|
+
/**
|
|
5460
|
+
* One store enabled GraphQL imperative query adapter
|
|
5461
|
+
*/
|
|
5462
|
+
let oneStoreGraphQLImperativeQueryAdapter$3 = undefined;
|
|
5455
5463
|
/**
|
|
5456
5464
|
* Determines when to include PDL strategies for Related Lists
|
|
5457
5465
|
*/
|
|
@@ -5478,6 +5486,18 @@ const configurationForOneStoreEnabledAdapters$3 = {
|
|
|
5478
5486
|
getGetObjectInfosAdapter: function () {
|
|
5479
5487
|
return oneStoreGetObjectInfosAdapter$3;
|
|
5480
5488
|
},
|
|
5489
|
+
setGraphQLWireAdapter: function (adapter) {
|
|
5490
|
+
oneStoreGraphQLWireAdapter$3 = adapter;
|
|
5491
|
+
},
|
|
5492
|
+
getGraphQLWireAdapter: function () {
|
|
5493
|
+
return oneStoreGraphQLWireAdapter$3;
|
|
5494
|
+
},
|
|
5495
|
+
setGraphQLImperativeQueryAdapter: function (adapter) {
|
|
5496
|
+
oneStoreGraphQLImperativeQueryAdapter$3 = adapter;
|
|
5497
|
+
},
|
|
5498
|
+
getGraphQLImperativeQueryAdapter: function () {
|
|
5499
|
+
return oneStoreGraphQLImperativeQueryAdapter$3;
|
|
5500
|
+
},
|
|
5481
5501
|
};
|
|
5482
5502
|
const getKeywordSearchResultsFactory$3 = new Configurable$3();
|
|
5483
5503
|
const getListRecordsByNameFactory$3 = new Configurable$3();
|
|
@@ -5717,6 +5737,14 @@ let oneStoreGetObjectInfoAdapter$2 = undefined;
|
|
|
5717
5737
|
* One store enabled Get Object Infos adapter
|
|
5718
5738
|
*/
|
|
5719
5739
|
let oneStoreGetObjectInfosAdapter$2 = undefined;
|
|
5740
|
+
/**
|
|
5741
|
+
* One store enabled GraphQL adapter
|
|
5742
|
+
*/
|
|
5743
|
+
let oneStoreGraphQLWireAdapter$2 = undefined;
|
|
5744
|
+
/**
|
|
5745
|
+
* One store enabled GraphQL imperative query adapter
|
|
5746
|
+
*/
|
|
5747
|
+
let oneStoreGraphQLImperativeQueryAdapter$2 = undefined;
|
|
5720
5748
|
/**
|
|
5721
5749
|
* Determines when to include PDL strategies for Related Lists
|
|
5722
5750
|
*/
|
|
@@ -5743,6 +5771,18 @@ const configurationForOneStoreEnabledAdapters$2 = {
|
|
|
5743
5771
|
getGetObjectInfosAdapter: function () {
|
|
5744
5772
|
return oneStoreGetObjectInfosAdapter$2;
|
|
5745
5773
|
},
|
|
5774
|
+
setGraphQLWireAdapter: function (adapter) {
|
|
5775
|
+
oneStoreGraphQLWireAdapter$2 = adapter;
|
|
5776
|
+
},
|
|
5777
|
+
getGraphQLWireAdapter: function () {
|
|
5778
|
+
return oneStoreGraphQLWireAdapter$2;
|
|
5779
|
+
},
|
|
5780
|
+
setGraphQLImperativeQueryAdapter: function (adapter) {
|
|
5781
|
+
oneStoreGraphQLImperativeQueryAdapter$2 = adapter;
|
|
5782
|
+
},
|
|
5783
|
+
getGraphQLImperativeQueryAdapter: function () {
|
|
5784
|
+
return oneStoreGraphQLImperativeQueryAdapter$2;
|
|
5785
|
+
},
|
|
5746
5786
|
};
|
|
5747
5787
|
/**
|
|
5748
5788
|
* Helper function to return the one store adapter if it's defined, otherwise return the luvio adapter.
|
|
@@ -5750,7 +5790,7 @@ const configurationForOneStoreEnabledAdapters$2 = {
|
|
|
5750
5790
|
* @param oneStoreAdapter - The one store bound adapter.
|
|
5751
5791
|
* @returns Luvio or one store wire adapter constructor.
|
|
5752
5792
|
*/
|
|
5753
|
-
function getLuvioOrOneStoreAdapter(luvioAdapter, oneStoreAdapter) {
|
|
5793
|
+
function getLuvioOrOneStoreAdapter$1(luvioAdapter, oneStoreAdapter) {
|
|
5754
5794
|
return oneStoreAdapter ?? luvioAdapter;
|
|
5755
5795
|
}
|
|
5756
5796
|
const getKeywordSearchResultsFactory$2 = new Configurable$2();
|
|
@@ -6115,7 +6155,7 @@ const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
|
6115
6155
|
const { split: split$1, endsWith: endsWith$1 } = String.prototype;
|
|
6116
6156
|
const { isArray: isArray$7 } = Array;
|
|
6117
6157
|
const { concat: concat$3, filter: filter$3, includes: includes$3, push: push$4, reduce: reduce$3 } = Array.prototype;
|
|
6118
|
-
const { parse: parse$
|
|
6158
|
+
const { parse: parse$a, stringify: stringify$9 } = JSON;
|
|
6119
6159
|
|
|
6120
6160
|
function isString$3(value) {
|
|
6121
6161
|
return typeof value === 'string';
|
|
@@ -14814,7 +14854,7 @@ function prepareRequest$5$1(luvio, config) {
|
|
|
14814
14854
|
// we have to run ingest code and look at the resulting snapshot's seenRecords.
|
|
14815
14855
|
function getCacheKeys$1(keySet, luvio, config, key, originalResponseBody) {
|
|
14816
14856
|
const { recordIds, layoutTypes, modes } = config;
|
|
14817
|
-
const responseBody = parse$
|
|
14857
|
+
const responseBody = parse$a(stringify$9(originalResponseBody));
|
|
14818
14858
|
eachLayout$1(responseBody, (apiName, recordTypeId, layout) => {
|
|
14819
14859
|
if (layout.id === null) {
|
|
14820
14860
|
return;
|
|
@@ -30519,7 +30559,7 @@ function ingestAndBroadcast(luvio, key, config, body) {
|
|
|
30519
30559
|
});
|
|
30520
30560
|
}
|
|
30521
30561
|
function clone$2(userLayoutState) {
|
|
30522
|
-
return parse$
|
|
30562
|
+
return parse$a(stringify$9(userLayoutState));
|
|
30523
30563
|
}
|
|
30524
30564
|
// Applies optimisticUpdate to layoutUserState
|
|
30525
30565
|
// If the optimistic update can be applied, returns RecordLayoutUserStateRepresentation
|
|
@@ -30554,7 +30594,7 @@ function coerceConfigWithDefaults$2$1(untrusted, layoutUserStateInput) {
|
|
|
30554
30594
|
const config = validateAdapterConfig$L(untrusted, getLayoutUserState_ConfigPropertyNames);
|
|
30555
30595
|
if (config === null) {
|
|
30556
30596
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
30557
|
-
throw new Error(`@wire(updateLayoutUserState) invalid configuration ${stringify$
|
|
30597
|
+
throw new Error(`@wire(updateLayoutUserState) invalid configuration ${stringify$9(untrusted)}`);
|
|
30558
30598
|
}
|
|
30559
30599
|
// This will throw if layoutUserStateInput is not a valid input
|
|
30560
30600
|
validate$8(layoutUserStateInput, 'layoutUserStateInput');
|
|
@@ -33896,8 +33936,8 @@ function bindExportsTo$1(luvio) {
|
|
|
33896
33936
|
updateRecord: unwrapSnapshotData(factory$2$1),
|
|
33897
33937
|
updateRecordAvatar: unwrapSnapshotData(factory$8$1),
|
|
33898
33938
|
// One Store Enabled Adapters
|
|
33899
|
-
getObjectInfo: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfoAdapter()),
|
|
33900
|
-
getObjectInfos: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfosAdapter()),
|
|
33939
|
+
getObjectInfo: getLuvioOrOneStoreAdapter$1(createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfoAdapter()),
|
|
33940
|
+
getObjectInfos: getLuvioOrOneStoreAdapter$1(createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfosAdapter()),
|
|
33901
33941
|
// Imperative Adapters
|
|
33902
33942
|
unstable_getActionOverrides_imperative: createImperativeAdapter(luvio, getActionOverrides_ldsAdapter, getActionOverridesMetadata),
|
|
33903
33943
|
getAllApps_imperative: createImperativeAdapter(luvio, getAllApps_ldsAdapter, getAllAppsMetadata),
|
|
@@ -34126,7 +34166,7 @@ withDefaultLuvio((luvio) => {
|
|
|
34126
34166
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
34127
34167
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
34128
34168
|
});
|
|
34129
|
-
// version: 1.
|
|
34169
|
+
// version: 1.370.0-7c1df2520b
|
|
34130
34170
|
|
|
34131
34171
|
function requestIdleDetectedCallback(_callback) { }
|
|
34132
34172
|
function declareNotifierTaskSingle(_name) {
|
|
@@ -35792,7 +35832,7 @@ function isNameStart(code) {
|
|
|
35792
35832
|
* Given a GraphQL source, parses it into a Document.
|
|
35793
35833
|
* Throws GraphQLError if a syntax error is encountered.
|
|
35794
35834
|
*/
|
|
35795
|
-
function parse$
|
|
35835
|
+
function parse$9(source, options) {
|
|
35796
35836
|
var parser = new Parser(source, options);
|
|
35797
35837
|
return parser.parseDocument();
|
|
35798
35838
|
}
|
|
@@ -44801,7 +44841,7 @@ function buildASTSchema(documentAST, options) {
|
|
|
44801
44841
|
*/
|
|
44802
44842
|
|
|
44803
44843
|
function buildSchema(source, options) {
|
|
44804
|
-
var document = parse$
|
|
44844
|
+
var document = parse$9(source, {
|
|
44805
44845
|
noLocation: options === null || options === void 0 ? void 0 : options.noLocation,
|
|
44806
44846
|
allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,
|
|
44807
44847
|
allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,
|
|
@@ -45352,7 +45392,7 @@ function parseDocument(inputString) {
|
|
|
45352
45392
|
return cachedDoc;
|
|
45353
45393
|
}
|
|
45354
45394
|
// parse throws an GraphQLError in case of invalid query, should this be in try/catch?
|
|
45355
|
-
const parsedDoc = parse$
|
|
45395
|
+
const parsedDoc = parse$9(inputString, { noLocation: true });
|
|
45356
45396
|
if (!parsedDoc || parsedDoc.kind !== 'Document') {
|
|
45357
45397
|
return null;
|
|
45358
45398
|
}
|
|
@@ -45610,7 +45650,7 @@ function metaschemaMapper(doc) {
|
|
|
45610
45650
|
* @deprecated In favor of gql tagged template literal
|
|
45611
45651
|
*/
|
|
45612
45652
|
function parseAndVisit(source) {
|
|
45613
|
-
const ast = parse$
|
|
45653
|
+
const ast = parse$9(source, { noLocation: true });
|
|
45614
45654
|
const luvioDocumentNode = transform(ast);
|
|
45615
45655
|
// In-place substitution of metaschema annotations
|
|
45616
45656
|
metaschemaMapper(ast);
|
|
@@ -45816,7 +45856,7 @@ function setServices(services) {
|
|
|
45816
45856
|
*/
|
|
45817
45857
|
|
|
45818
45858
|
|
|
45819
|
-
const { parse: parse$
|
|
45859
|
+
const { parse: parse$7, stringify: stringify$7 } = JSON;
|
|
45820
45860
|
const { join: join$1, push: push$2, unshift } = Array.prototype;
|
|
45821
45861
|
const { isArray: isArray$5 } = Array;
|
|
45822
45862
|
const { entries: entries$4, keys: keys$6 } = Object;
|
|
@@ -46114,10 +46154,10 @@ function getTransactionKey(req) {
|
|
|
46114
46154
|
const { resourceRequest } = req;
|
|
46115
46155
|
const { baseUri, basePath, queryParams, headers } = resourceRequest;
|
|
46116
46156
|
const path = `${baseUri}${basePath}`;
|
|
46117
|
-
const queryParamsString = queryParams ? stringify$
|
|
46118
|
-
const headersString = stringify$
|
|
46157
|
+
const queryParamsString = queryParams ? stringify$7(queryParams) : EMPTY_STRING;
|
|
46158
|
+
const headersString = stringify$7(headers);
|
|
46119
46159
|
const bodyString = resourceRequest.body && isResourceRequestDedupable(req)
|
|
46120
|
-
? stringify$
|
|
46160
|
+
? stringify$7(resourceRequest.body)
|
|
46121
46161
|
: EMPTY_STRING;
|
|
46122
46162
|
return `${path}${TRANSACTION_KEY_SEP}${headersString}${TRANSACTION_KEY_SEP}${queryParamsString}${bodyString}`;
|
|
46123
46163
|
}
|
|
@@ -46183,7 +46223,7 @@ const dedupeRequest = (req) => {
|
|
|
46183
46223
|
// extra clone (particularly when there's only 1 handler).
|
|
46184
46224
|
for (let i = 1, len = handlers.length; i < len; i++) {
|
|
46185
46225
|
const handler = handlers[i];
|
|
46186
|
-
handler.resolve(parse$
|
|
46226
|
+
handler.resolve(parse$7(stringify$7(response)));
|
|
46187
46227
|
}
|
|
46188
46228
|
handlers[0].resolve(response);
|
|
46189
46229
|
}, (error) => {
|
|
@@ -47595,7 +47635,7 @@ var QueueOperationType;
|
|
|
47595
47635
|
})(QueueOperationType || (QueueOperationType = {}));
|
|
47596
47636
|
|
|
47597
47637
|
const { keys: keys$4, create: create$4, assign: assign$3, values: values$2 } = Object;
|
|
47598
|
-
const { stringify: stringify$
|
|
47638
|
+
const { stringify: stringify$6, parse: parse$6 } = JSON;
|
|
47599
47639
|
const { isArray: isArray$4 } = Array;
|
|
47600
47640
|
|
|
47601
47641
|
class DraftSynthesisError extends Error {
|
|
@@ -48297,7 +48337,7 @@ class DurableDraftQueue {
|
|
|
48297
48337
|
}
|
|
48298
48338
|
|
|
48299
48339
|
function clone$1(obj) {
|
|
48300
|
-
return parse$
|
|
48340
|
+
return parse$6(stringify$6(obj));
|
|
48301
48341
|
}
|
|
48302
48342
|
|
|
48303
48343
|
const DRAFT_ACTION_KEY_JUNCTION = '__DraftAction__';
|
|
@@ -48756,7 +48796,7 @@ class DraftManager {
|
|
|
48756
48796
|
// We should always return an array, if the body is just a dictionary,
|
|
48757
48797
|
// stick it in an array
|
|
48758
48798
|
const body = isArray$4(action.error.body) ? action.error.body : [action.error.body];
|
|
48759
|
-
const bodyString = stringify$
|
|
48799
|
+
const bodyString = stringify$6(body);
|
|
48760
48800
|
item.error = {
|
|
48761
48801
|
status: action.error.status || 0,
|
|
48762
48802
|
ok: action.error.ok || false,
|
|
@@ -48977,7 +49017,7 @@ const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
|
48977
49017
|
const { split, endsWith } = String.prototype;
|
|
48978
49018
|
const { from: from$1, isArray: isArray$3$1 } = Array;
|
|
48979
49019
|
const { concat: concat$2, filter: filter$2, includes: includes$2, push: push$1$1, reduce: reduce$2, shift, slice: slice$1 } = Array.prototype;
|
|
48980
|
-
const { parse: parse$
|
|
49020
|
+
const { parse: parse$5, stringify: stringify$5 } = JSON;
|
|
48981
49021
|
|
|
48982
49022
|
function isString$2(value) {
|
|
48983
49023
|
return typeof value === 'string';
|
|
@@ -55353,7 +55393,7 @@ function prepareRequest$3(luvio, config) {
|
|
|
55353
55393
|
// we have to run ingest code and look at the resulting snapshot's seenRecords.
|
|
55354
55394
|
function getCacheKeys(keySet, luvio, config, key, originalResponseBody) {
|
|
55355
55395
|
const { recordIds, layoutTypes, modes } = config;
|
|
55356
|
-
const responseBody = parse$
|
|
55396
|
+
const responseBody = parse$5(stringify$5(originalResponseBody));
|
|
55357
55397
|
eachLayout(responseBody, (apiName, recordTypeId, layout) => {
|
|
55358
55398
|
if (layout.id === null) {
|
|
55359
55399
|
return;
|
|
@@ -79769,7 +79809,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
79769
79809
|
let updatedActionTargetId = undefined;
|
|
79770
79810
|
const { tag: queueActionTag, data: queueActionRequest, id: queueActionId, } = queueAction;
|
|
79771
79811
|
let { basePath, body } = queueActionRequest;
|
|
79772
|
-
let stringifiedBody = stringify$
|
|
79812
|
+
let stringifiedBody = stringify$5(body);
|
|
79773
79813
|
// for each redirected ID/key we loop over the operation to see if it needs
|
|
79774
79814
|
// to be updated
|
|
79775
79815
|
for (const { draftId, draftKey, canonicalId, canonicalKey } of redirects) {
|
|
@@ -79794,7 +79834,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
79794
79834
|
data: {
|
|
79795
79835
|
...queueActionRequest,
|
|
79796
79836
|
basePath: basePath,
|
|
79797
|
-
body: parse$
|
|
79837
|
+
body: parse$5(stringifiedBody),
|
|
79798
79838
|
},
|
|
79799
79839
|
};
|
|
79800
79840
|
// item needs to be replaced with a new item at the new record key
|
|
@@ -79813,7 +79853,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
79813
79853
|
data: {
|
|
79814
79854
|
...queueActionRequest,
|
|
79815
79855
|
basePath: basePath,
|
|
79816
|
-
body: parse$
|
|
79856
|
+
body: parse$5(stringifiedBody),
|
|
79817
79857
|
},
|
|
79818
79858
|
};
|
|
79819
79859
|
// item needs to be updated
|
|
@@ -80529,7 +80569,7 @@ function normalizeError$1(err) {
|
|
|
80529
80569
|
else if (typeof err === 'string') {
|
|
80530
80570
|
return new Error(err);
|
|
80531
80571
|
}
|
|
80532
|
-
return new Error(stringify$
|
|
80572
|
+
return new Error(stringify$5(err));
|
|
80533
80573
|
}
|
|
80534
80574
|
// metrics
|
|
80535
80575
|
/** GraphQL */
|
|
@@ -81642,7 +81682,7 @@ function recordLoaderFactory(query) {
|
|
|
81642
81682
|
rows.forEach((row) => {
|
|
81643
81683
|
if (!row[0])
|
|
81644
81684
|
return null;
|
|
81645
|
-
const record = parse$
|
|
81685
|
+
const record = parse$5(row[0]);
|
|
81646
81686
|
if (record.id === id) {
|
|
81647
81687
|
foundRow = record;
|
|
81648
81688
|
}
|
|
@@ -82001,7 +82041,7 @@ function dateTimePredicate(input, operator, field, alias) {
|
|
|
82001
82041
|
return dateTimeRange(range, operator, field, alias);
|
|
82002
82042
|
}
|
|
82003
82043
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
82004
|
-
throw new Error(`Where filter ${stringify$
|
|
82044
|
+
throw new Error(`Where filter ${stringify$5(input)} is not supported`);
|
|
82005
82045
|
}
|
|
82006
82046
|
function dateTimeRange(input, op, field, alias) {
|
|
82007
82047
|
const dateFunction = field.dataType === 'DateTime' ? 'datetime' : 'date';
|
|
@@ -84645,14 +84685,14 @@ function isLocalCursor(maybeCursor) {
|
|
|
84645
84685
|
typeof maybeCursor.i === 'number');
|
|
84646
84686
|
}
|
|
84647
84687
|
function encodeV1Cursor(cursor) {
|
|
84648
|
-
return base64encode(stringify$
|
|
84688
|
+
return base64encode(stringify$5(cursor));
|
|
84649
84689
|
}
|
|
84650
84690
|
const CURSOR_PARSE_ERROR = 'Unable to parse cursor';
|
|
84651
84691
|
function decodeV1Cursor(base64cursor) {
|
|
84652
84692
|
let maybeCursor;
|
|
84653
84693
|
try {
|
|
84654
84694
|
const cursorString = base64decode(base64cursor);
|
|
84655
|
-
maybeCursor = parse$
|
|
84695
|
+
maybeCursor = parse$5(cursorString);
|
|
84656
84696
|
}
|
|
84657
84697
|
catch (error) {
|
|
84658
84698
|
let message = CURSOR_PARSE_ERROR;
|
|
@@ -84856,7 +84896,7 @@ async function readPaginationMetadataForKeys(keys, query) {
|
|
|
84856
84896
|
const results = await query(sql, keys.map((k) => k + '__pagination'));
|
|
84857
84897
|
for (let row of results.rows) {
|
|
84858
84898
|
let key = row[0].replace(/__pagination$/, '');
|
|
84859
|
-
let metadata = parse$
|
|
84899
|
+
let metadata = parse$5(row[1]);
|
|
84860
84900
|
metadataMap.set(key, metadata);
|
|
84861
84901
|
}
|
|
84862
84902
|
return metadataMap;
|
|
@@ -84962,8 +85002,8 @@ async function connectionResolver(obj, args, context, info) {
|
|
|
84962
85002
|
//map each sql result with the ingestion timestamp to pass it down a level
|
|
84963
85003
|
let records = results.rows.map((row, index) => {
|
|
84964
85004
|
const recordMetadataResult = {
|
|
84965
|
-
recordRepresentation: parse$
|
|
84966
|
-
metadata: parse$
|
|
85005
|
+
recordRepresentation: parse$5(row[0]),
|
|
85006
|
+
metadata: parse$5(row[1]),
|
|
84967
85007
|
};
|
|
84968
85008
|
const { recordRepresentation, metadata } = recordMetadataResult;
|
|
84969
85009
|
context.seenRecordIds.add(recordRepresentation.id);
|
|
@@ -85414,7 +85454,7 @@ function extendSchemaWithObjectInfos(cache, objectInfoMap) {
|
|
|
85414
85454
|
return cache;
|
|
85415
85455
|
}
|
|
85416
85456
|
// parse extensions into DocumentNode to extend the schema
|
|
85417
|
-
const extensions = parse$
|
|
85457
|
+
const extensions = parse$9(typeDefs);
|
|
85418
85458
|
const polymorphicFieldTypeNames = [
|
|
85419
85459
|
...polyFieldTypeNameArr,
|
|
85420
85460
|
...cache.getPolymorphicFieldTypeNames(),
|
|
@@ -87957,7 +87997,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
87957
87997
|
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
87958
87998
|
return async function draftAwareGraphQLAdapter(config, requestContext = {}) {
|
|
87959
87999
|
//create a copy to not accidentally modify the AST in the astResolver map of luvio
|
|
87960
|
-
const copy = parse$
|
|
88000
|
+
const copy = parse$5(stringify$5(config.query));
|
|
87961
88001
|
// the injected ast has extra fields needed for eval in it
|
|
87962
88002
|
let injectedAST;
|
|
87963
88003
|
// the cursor mapped ast is passed upstream so it won't reject on our local cursors
|
|
@@ -88050,7 +88090,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
88050
88090
|
} = await evaluate({
|
|
88051
88091
|
...config,
|
|
88052
88092
|
//need to create another copy of the ast for future writes
|
|
88053
|
-
query: parse$
|
|
88093
|
+
query: parse$5(stringify$5(injectedAST)),
|
|
88054
88094
|
}, observers, { userId }, objectInfoNeeded, store, nonEvaluatedSnapshot, graphqlSchemaCache, draftFunctions, mappedCursors));
|
|
88055
88095
|
}
|
|
88056
88096
|
catch (throwable) {
|
|
@@ -88176,7 +88216,7 @@ function makeGetRecordsConfig(keyMap) {
|
|
|
88176
88216
|
|
|
88177
88217
|
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio, isDraftId, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy) {
|
|
88178
88218
|
return async function environmentAwareGraphQLBatchAdapter(config, requestContext = {}) {
|
|
88179
|
-
const batchQueryCopy = config.batchQuery.map((query) => parse$
|
|
88219
|
+
const batchQueryCopy = config.batchQuery.map((query) => parse$5(stringify$5(query)));
|
|
88180
88220
|
let injectedBatchQuery = [];
|
|
88181
88221
|
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
88182
88222
|
const draftFunctions = {
|
|
@@ -88401,7 +88441,7 @@ const recordIdGenerator = (id) => {
|
|
|
88401
88441
|
|
|
88402
88442
|
|
|
88403
88443
|
const { keys: keys$2$1, create: create$2$1, assign: assign$1$1, entries: entries$2 } = Object;
|
|
88404
|
-
const { stringify: stringify$
|
|
88444
|
+
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
88405
88445
|
const { push: push$3, join, slice } = Array.prototype;
|
|
88406
88446
|
const { isArray: isArray$2$1, from } = Array;
|
|
88407
88447
|
|
|
@@ -88425,7 +88465,7 @@ function ldsParamsToString(params) {
|
|
|
88425
88465
|
returnParams[key] = `${value}`;
|
|
88426
88466
|
}
|
|
88427
88467
|
if (isObject(value) === true && keys$2$1(value).length > 0) {
|
|
88428
|
-
returnParams[key] = stringify$
|
|
88468
|
+
returnParams[key] = stringify$4(value);
|
|
88429
88469
|
}
|
|
88430
88470
|
}
|
|
88431
88471
|
return returnParams;
|
|
@@ -88487,13 +88527,13 @@ function stringifyIfPresent(value) {
|
|
|
88487
88527
|
if (typeof value === 'string') {
|
|
88488
88528
|
return value;
|
|
88489
88529
|
}
|
|
88490
|
-
return stringify$
|
|
88530
|
+
return stringify$4(value);
|
|
88491
88531
|
}
|
|
88492
88532
|
function parseIfPresent(value) {
|
|
88493
88533
|
if (value === undefined || value === null || value === '') {
|
|
88494
88534
|
return null;
|
|
88495
88535
|
}
|
|
88496
|
-
return parse$
|
|
88536
|
+
return parse$4(value);
|
|
88497
88537
|
}
|
|
88498
88538
|
function buildNimbusNetworkPluginRequest(resourceRequest, resourceRequestContext) {
|
|
88499
88539
|
const { basePath, baseUri, method, headers, queryParams, body } = resourceRequest;
|
|
@@ -88992,8 +89032,8 @@ function getMaxLengthPerChunkAllowed(request) {
|
|
|
88992
89032
|
// Too much work to get exact length of the final url, so use stringified json to get the rough length.
|
|
88993
89033
|
const roughUrlLengthWithoutFieldsAndOptionFields = request.basePath.length +
|
|
88994
89034
|
request.baseUri.length +
|
|
88995
|
-
(request.urlParams ? stringify$
|
|
88996
|
-
stringify$
|
|
89035
|
+
(request.urlParams ? stringify$4(request.urlParams).length : 0) +
|
|
89036
|
+
stringify$4({ ...request.queryParams, fields: {}, optionalFields: {} }).length;
|
|
88997
89037
|
return MAX_URL_LENGTH - roughUrlLengthWithoutFieldsAndOptionFields;
|
|
88998
89038
|
}
|
|
88999
89039
|
// we don't have access to the host so we cannot calculate the exact length of the url
|
|
@@ -89099,10 +89139,10 @@ class NimbusDraftQueue {
|
|
|
89099
89139
|
if (callProxyMethod === undefined) {
|
|
89100
89140
|
return Promise.reject(new Error('callProxyMethod not defined on the nimbus plugin'));
|
|
89101
89141
|
}
|
|
89102
|
-
const serializedAction = stringify$
|
|
89142
|
+
const serializedAction = stringify$5([handlerId, data]);
|
|
89103
89143
|
return new Promise((resolve, reject) => {
|
|
89104
89144
|
callProxyMethod('enqueue', serializedAction, (serializedActionResponse) => {
|
|
89105
|
-
const response = parse$
|
|
89145
|
+
const response = parse$5(serializedActionResponse);
|
|
89106
89146
|
resolve(response);
|
|
89107
89147
|
}, (errorMessage) => {
|
|
89108
89148
|
reject(new Error(errorMessage));
|
|
@@ -89123,8 +89163,8 @@ class NimbusDraftQueue {
|
|
|
89123
89163
|
return Promise.reject(new Error('callProxyMethod not defined on the nimbus plugin'));
|
|
89124
89164
|
}
|
|
89125
89165
|
return new Promise((resolve, reject) => {
|
|
89126
|
-
callProxyMethod('getQueueActions', stringify$
|
|
89127
|
-
resolve(parse$
|
|
89166
|
+
callProxyMethod('getQueueActions', stringify$5([]), (serializedQueue) => {
|
|
89167
|
+
resolve(parse$5(serializedQueue));
|
|
89128
89168
|
}, (errorMessage) => {
|
|
89129
89169
|
reject(new Error(errorMessage));
|
|
89130
89170
|
});
|
|
@@ -89135,17 +89175,17 @@ class NimbusDraftQueue {
|
|
|
89135
89175
|
if (callProxyMethod === undefined) {
|
|
89136
89176
|
return Promise.reject('callProxyMethod not defined on the nimbus plugin');
|
|
89137
89177
|
}
|
|
89138
|
-
const stringifiedArgs = stringify$
|
|
89178
|
+
const stringifiedArgs = stringify$5([action]);
|
|
89139
89179
|
return new Promise((resolve, reject) => {
|
|
89140
89180
|
callProxyMethod('getDataForAction', stringifiedArgs, (data) => {
|
|
89141
89181
|
if (data === undefined) {
|
|
89142
89182
|
resolve(undefined);
|
|
89143
89183
|
}
|
|
89144
89184
|
else {
|
|
89145
|
-
resolve(parse$
|
|
89185
|
+
resolve(parse$5(data));
|
|
89146
89186
|
}
|
|
89147
89187
|
}, (serializedError) => {
|
|
89148
|
-
reject(parse$
|
|
89188
|
+
reject(parse$5(serializedError));
|
|
89149
89189
|
});
|
|
89150
89190
|
});
|
|
89151
89191
|
}
|
|
@@ -89627,7 +89667,7 @@ function registerReportObserver(reportObserver) {
|
|
|
89627
89667
|
}
|
|
89628
89668
|
|
|
89629
89669
|
const { keys: keys$1$1, create: create$1$1, assign: assign$5, entries: entries$1, values } = Object;
|
|
89630
|
-
const { stringify: stringify$
|
|
89670
|
+
const { stringify: stringify$3, parse: parse$3 } = JSON;
|
|
89631
89671
|
|
|
89632
89672
|
function selectColumnsFromTableWhereKeyIn(columnNames, table, keyColumnName, whereIn) {
|
|
89633
89673
|
const paramList = whereIn.map(() => '?').join(',');
|
|
@@ -89640,13 +89680,13 @@ function selectColumnsFromTableWhereKeyInNamespaced(columnNames, table, keyColum
|
|
|
89640
89680
|
|
|
89641
89681
|
// These const values must be in sync with the latest
|
|
89642
89682
|
// @salesforce/nimbus-plugin-lds/sql schema file
|
|
89643
|
-
const TABLE_NAME$1 = 'lds_data';
|
|
89683
|
+
const TABLE_NAME$1$1 = 'lds_data';
|
|
89644
89684
|
const COLUMN_NAME_KEY$2 = 'key';
|
|
89645
89685
|
const COLUMN_NAME_DATA$2 = 'data';
|
|
89646
89686
|
const COLUMN_NAME_METADATA$1 = 'metadata';
|
|
89647
89687
|
class LdsDataTable {
|
|
89648
89688
|
constructor(plugin) {
|
|
89649
|
-
this.tableName = TABLE_NAME$1;
|
|
89689
|
+
this.tableName = TABLE_NAME$1$1;
|
|
89650
89690
|
this.columnNames = [COLUMN_NAME_KEY$2, COLUMN_NAME_DATA$2, COLUMN_NAME_METADATA$1];
|
|
89651
89691
|
this.conflictColumnNames = [COLUMN_NAME_KEY$2];
|
|
89652
89692
|
this.getAllQuery = `SELECT ${this.columnNames.join(',')} FROM ${this.tableName}`;
|
|
@@ -89668,7 +89708,7 @@ class LdsDataTable {
|
|
|
89668
89708
|
const [key, stringifiedMetadata] = row;
|
|
89669
89709
|
if (stringifiedMetadata !== undefined) {
|
|
89670
89710
|
entries[key] = {
|
|
89671
|
-
metadata: parse$
|
|
89711
|
+
metadata: parse$3(stringifiedMetadata),
|
|
89672
89712
|
};
|
|
89673
89713
|
}
|
|
89674
89714
|
return entries;
|
|
@@ -89696,7 +89736,7 @@ class LdsDataTable {
|
|
|
89696
89736
|
rows: keys$1$1(entries).reduce((rows, key) => {
|
|
89697
89737
|
const entry = entries[key];
|
|
89698
89738
|
const { data, metadata } = entry;
|
|
89699
|
-
const row = [key, stringify$
|
|
89739
|
+
const row = [key, stringify$3(data), metadata ? stringify$3(metadata) : null];
|
|
89700
89740
|
rows.push(row);
|
|
89701
89741
|
return rows;
|
|
89702
89742
|
}, []),
|
|
@@ -89714,7 +89754,7 @@ class LdsDataTable {
|
|
|
89714
89754
|
columns: [COLUMN_NAME_METADATA$1],
|
|
89715
89755
|
values: keys$1$1(entries).reduce((values, key) => {
|
|
89716
89756
|
const { metadata } = entries[key];
|
|
89717
|
-
const row = [metadata ? stringify$
|
|
89757
|
+
const row = [metadata ? stringify$3(metadata) : null];
|
|
89718
89758
|
values[key] = row;
|
|
89719
89759
|
return values;
|
|
89720
89760
|
}, {}),
|
|
@@ -89724,10 +89764,10 @@ class LdsDataTable {
|
|
|
89724
89764
|
return sqliteResult.rows.reduce((entries, row) => {
|
|
89725
89765
|
const [key, stringifiedData, stringifiedMetadata] = row;
|
|
89726
89766
|
const durableStoreEntry = {
|
|
89727
|
-
data: parse$
|
|
89767
|
+
data: parse$3(stringifiedData),
|
|
89728
89768
|
};
|
|
89729
89769
|
if (stringifiedMetadata !== null) {
|
|
89730
|
-
durableStoreEntry.metadata = parse$
|
|
89770
|
+
durableStoreEntry.metadata = parse$3(stringifiedMetadata);
|
|
89731
89771
|
}
|
|
89732
89772
|
entries[key] = durableStoreEntry;
|
|
89733
89773
|
return entries;
|
|
@@ -89777,7 +89817,7 @@ class LdsInternalDataTable {
|
|
|
89777
89817
|
const [key, stringifiedMetadata] = row;
|
|
89778
89818
|
if (stringifiedMetadata !== undefined) {
|
|
89779
89819
|
entries[key] = {
|
|
89780
|
-
metadata: parse$
|
|
89820
|
+
metadata: parse$3(stringifiedMetadata),
|
|
89781
89821
|
};
|
|
89782
89822
|
}
|
|
89783
89823
|
return entries;
|
|
@@ -89805,9 +89845,9 @@ class LdsInternalDataTable {
|
|
|
89805
89845
|
rows: keys$1$1(entries).reduce((rows, key) => {
|
|
89806
89846
|
const entry = entries[key];
|
|
89807
89847
|
const { data, metadata } = entry;
|
|
89808
|
-
const row = [key, stringify$
|
|
89848
|
+
const row = [key, stringify$3(data)];
|
|
89809
89849
|
if (metadata) {
|
|
89810
|
-
row.push(stringify$
|
|
89850
|
+
row.push(stringify$3(metadata));
|
|
89811
89851
|
}
|
|
89812
89852
|
else {
|
|
89813
89853
|
row.push(null);
|
|
@@ -89830,7 +89870,7 @@ class LdsInternalDataTable {
|
|
|
89830
89870
|
columns: [COLUMN_NAME_METADATA],
|
|
89831
89871
|
values: keys$1$1(entries).reduce((values, key) => {
|
|
89832
89872
|
const { metadata } = entries[key];
|
|
89833
|
-
const row = [metadata ? stringify$
|
|
89873
|
+
const row = [metadata ? stringify$3(metadata) : null];
|
|
89834
89874
|
values[key] = row;
|
|
89835
89875
|
return values;
|
|
89836
89876
|
}, {}),
|
|
@@ -89842,7 +89882,7 @@ class LdsInternalDataTable {
|
|
|
89842
89882
|
if (metadata !== undefined) {
|
|
89843
89883
|
accu.push({
|
|
89844
89884
|
sql: `UPDATE ${this.tableName} SET ${COLUMN_NAME_METADATA} = ? WHERE (${COLUMN_NAME_KEY$1} IS ? AND ${COLUMN_NAME_NAMESPACE} IS ?)`,
|
|
89845
|
-
params: [stringify$
|
|
89885
|
+
params: [stringify$3(metadata), key, segment],
|
|
89846
89886
|
change: {
|
|
89847
89887
|
ids: [key],
|
|
89848
89888
|
segment,
|
|
@@ -89858,10 +89898,10 @@ class LdsInternalDataTable {
|
|
|
89858
89898
|
return sqliteResult.rows.reduce((entries, row) => {
|
|
89859
89899
|
const [key, stringifiedData, stringifiedMetadata] = row;
|
|
89860
89900
|
const durableStoreEntry = {
|
|
89861
|
-
data: parse$
|
|
89901
|
+
data: parse$3(stringifiedData),
|
|
89862
89902
|
};
|
|
89863
89903
|
if (stringifiedMetadata !== null) {
|
|
89864
|
-
durableStoreEntry.metadata = parse$
|
|
89904
|
+
durableStoreEntry.metadata = parse$3(stringifiedMetadata);
|
|
89865
89905
|
}
|
|
89866
89906
|
entries[key] = durableStoreEntry;
|
|
89867
89907
|
return entries;
|
|
@@ -90083,7 +90123,7 @@ class AbstractKeyValueDataTable {
|
|
|
90083
90123
|
columns: this.columnNames,
|
|
90084
90124
|
rows: keys$1$1(entries).reduce((rows, key) => {
|
|
90085
90125
|
const entry = entries[key];
|
|
90086
|
-
rows.push([key, stringify$
|
|
90126
|
+
rows.push([key, stringify$3(entry.data)]);
|
|
90087
90127
|
return rows;
|
|
90088
90128
|
}, []),
|
|
90089
90129
|
};
|
|
@@ -90096,7 +90136,7 @@ class AbstractKeyValueDataTable {
|
|
|
90096
90136
|
return sqliteResult.rows.reduce((entries, row) => {
|
|
90097
90137
|
const [key, stringifiedData] = row;
|
|
90098
90138
|
const durableStoreEntry = {
|
|
90099
|
-
data: parse$
|
|
90139
|
+
data: parse$3(stringifiedData),
|
|
90100
90140
|
};
|
|
90101
90141
|
entries[key] = durableStoreEntry;
|
|
90102
90142
|
return entries;
|
|
@@ -90106,10 +90146,10 @@ class AbstractKeyValueDataTable {
|
|
|
90106
90146
|
|
|
90107
90147
|
// These const values must be in sync with the latest
|
|
90108
90148
|
// @salesforce/nimbus-plugin-lds/sql schema file
|
|
90109
|
-
const TABLE_NAME = 'lds_env_drafts';
|
|
90149
|
+
const TABLE_NAME$1 = 'lds_env_drafts';
|
|
90110
90150
|
class LdsDraftsDataTable extends AbstractKeyValueDataTable {
|
|
90111
90151
|
constructor(plugin) {
|
|
90112
|
-
super(plugin, TABLE_NAME);
|
|
90152
|
+
super(plugin, TABLE_NAME$1);
|
|
90113
90153
|
}
|
|
90114
90154
|
}
|
|
90115
90155
|
|
|
@@ -91971,7 +92011,7 @@ function setupObserver() {
|
|
|
91971
92011
|
registerReportObserver((report) => {
|
|
91972
92012
|
__nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
|
|
91973
92013
|
name: report.adapterName,
|
|
91974
|
-
serializedConfig: stringify$
|
|
92014
|
+
serializedConfig: stringify$5(report.config),
|
|
91975
92015
|
status: report.result,
|
|
91976
92016
|
duration: report.executionTime,
|
|
91977
92017
|
});
|
|
@@ -92087,7 +92127,7 @@ function transformConfiguration$1$1(config) {
|
|
|
92087
92127
|
// Make a copy of the config before running transform to avoid mutating the original config
|
|
92088
92128
|
const adapterConfigCopy = {
|
|
92089
92129
|
...config,
|
|
92090
|
-
query: parse$
|
|
92130
|
+
query: parse$9(print(config.query))
|
|
92091
92131
|
};
|
|
92092
92132
|
return {
|
|
92093
92133
|
...adapterConfigCopy,
|
|
@@ -92449,7 +92489,7 @@ function transformConfiguration$2(config) {
|
|
|
92449
92489
|
const batchQueryTransformed = config.batchQuery.map((singleConfig) => {
|
|
92450
92490
|
return {
|
|
92451
92491
|
...singleConfig,
|
|
92452
|
-
query: applyMinimumFieldsToQuery(parse$
|
|
92492
|
+
query: applyMinimumFieldsToQuery(parse$9(print(singleConfig.query))), // Stringifies and parses again to avoid mutating original. Should we just JSON.stringify to avoid the dependency on the parser?
|
|
92453
92493
|
};
|
|
92454
92494
|
});
|
|
92455
92495
|
return {
|
|
@@ -92914,7 +92954,7 @@ class SideEffectService {
|
|
|
92914
92954
|
}
|
|
92915
92955
|
|
|
92916
92956
|
function clone(obj) {
|
|
92917
|
-
return parse$
|
|
92957
|
+
return parse$5(stringify$5(obj));
|
|
92918
92958
|
}
|
|
92919
92959
|
|
|
92920
92960
|
/* global __nimbus */
|
|
@@ -93412,7 +93452,7 @@ function createSfsSideEffectHooks(durableRecordStore) {
|
|
|
93412
93452
|
*/
|
|
93413
93453
|
const { create: create$6, freeze: freeze$3, keys: keys$7, entries } = Object;
|
|
93414
93454
|
const { isArray: isArray$1$1 } = Array;
|
|
93415
|
-
const { stringify: stringify$
|
|
93455
|
+
const { stringify: stringify$2, parse: parse$2 } = JSON;
|
|
93416
93456
|
const LogLevelMap = {
|
|
93417
93457
|
TRACE: 4,
|
|
93418
93458
|
DEBUG: 3,
|
|
@@ -93449,7 +93489,7 @@ class ConsoleLogger {
|
|
|
93449
93489
|
this.printer(this.formatter(level, message));
|
|
93450
93490
|
}
|
|
93451
93491
|
}
|
|
93452
|
-
let Ok$
|
|
93492
|
+
let Ok$1 = class Ok {
|
|
93453
93493
|
constructor(value) {
|
|
93454
93494
|
this.value = value;
|
|
93455
93495
|
}
|
|
@@ -93471,7 +93511,7 @@ let Err$1 = class Err {
|
|
|
93471
93511
|
return !this.isOk();
|
|
93472
93512
|
}
|
|
93473
93513
|
};
|
|
93474
|
-
const ok$
|
|
93514
|
+
const ok$1 = (value) => new Ok$1(value);
|
|
93475
93515
|
const err$1 = (err2) => new Err$1(err2);
|
|
93476
93516
|
function isSubscribableResult(x) {
|
|
93477
93517
|
if (typeof x !== "object" || x === null) {
|
|
@@ -93534,7 +93574,7 @@ function stableJSONStringify$2(node) {
|
|
|
93534
93574
|
return isFinite(node) ? "" + node : "null";
|
|
93535
93575
|
}
|
|
93536
93576
|
if (typeof node !== "object") {
|
|
93537
|
-
return stringify$
|
|
93577
|
+
return stringify$2(node);
|
|
93538
93578
|
}
|
|
93539
93579
|
let i;
|
|
93540
93580
|
let out;
|
|
@@ -93562,7 +93602,7 @@ function stableJSONStringify$2(node) {
|
|
|
93562
93602
|
if (out) {
|
|
93563
93603
|
out += ",";
|
|
93564
93604
|
}
|
|
93565
|
-
out += stringify$
|
|
93605
|
+
out += stringify$2(key) + ":" + value;
|
|
93566
93606
|
}
|
|
93567
93607
|
return "{" + out + "}";
|
|
93568
93608
|
}
|
|
@@ -93606,7 +93646,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
93606
93646
|
return err$1(networkResult.error);
|
|
93607
93647
|
} else {
|
|
93608
93648
|
const data = networkResult.value;
|
|
93609
|
-
return ok$
|
|
93649
|
+
return ok$1({
|
|
93610
93650
|
data,
|
|
93611
93651
|
subscribe: (cb) => {
|
|
93612
93652
|
this.subscriptions.push(cb);
|
|
@@ -93625,10 +93665,10 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
93625
93665
|
if (isSubscribableResult(newResult)) {
|
|
93626
93666
|
const value = newResult.value;
|
|
93627
93667
|
this.subscriptions.forEach((cb) => {
|
|
93628
|
-
cb(ok$
|
|
93668
|
+
cb(ok$1(value.data));
|
|
93629
93669
|
});
|
|
93630
93670
|
}
|
|
93631
|
-
return ok$
|
|
93671
|
+
return ok$1(void 0);
|
|
93632
93672
|
}
|
|
93633
93673
|
return err$1(newResult.error);
|
|
93634
93674
|
});
|
|
@@ -93636,7 +93676,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
93636
93676
|
async afterRequestHooks(_options) {
|
|
93637
93677
|
}
|
|
93638
93678
|
};
|
|
93639
|
-
function buildServiceDescriptor$
|
|
93679
|
+
function buildServiceDescriptor$c() {
|
|
93640
93680
|
return {
|
|
93641
93681
|
type: "networkCommandBaseClass",
|
|
93642
93682
|
version: "1.0",
|
|
@@ -93679,7 +93719,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
93679
93719
|
this.afterRequestHooks({ statusCode: 200 });
|
|
93680
93720
|
} catch (e) {
|
|
93681
93721
|
}
|
|
93682
|
-
return ok$
|
|
93722
|
+
return ok$1(auraReturnValue);
|
|
93683
93723
|
}).catch((error) => {
|
|
93684
93724
|
if (!error || !error.getError) {
|
|
93685
93725
|
return err$1(toError("Failed to get error from response"));
|
|
@@ -93698,7 +93738,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
93698
93738
|
(response2) => {
|
|
93699
93739
|
if (response2.ok) {
|
|
93700
93740
|
return response2.json().then(
|
|
93701
|
-
(json) => ok$
|
|
93741
|
+
(json) => ok$1(json),
|
|
93702
93742
|
(reason) => err$1(toError(reason))
|
|
93703
93743
|
).finally(() => {
|
|
93704
93744
|
try {
|
|
@@ -93738,7 +93778,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
93738
93778
|
return resolvedPromiseLike$3(err$1(toError("Aura/Fetch network services not found")));
|
|
93739
93779
|
}
|
|
93740
93780
|
}
|
|
93741
|
-
function buildServiceDescriptor$
|
|
93781
|
+
function buildServiceDescriptor$b() {
|
|
93742
93782
|
return {
|
|
93743
93783
|
type: "auraNetworkCommandBaseClass",
|
|
93744
93784
|
version: "1.0",
|
|
@@ -93757,7 +93797,7 @@ function buildServiceDescriptor$a() {
|
|
|
93757
93797
|
* For full license text, see the LICENSE.txt file
|
|
93758
93798
|
*/
|
|
93759
93799
|
const { isArray: isArray$6 } = Array;
|
|
93760
|
-
|
|
93800
|
+
class Ok {
|
|
93761
93801
|
constructor(value) {
|
|
93762
93802
|
this.value = value;
|
|
93763
93803
|
}
|
|
@@ -93767,7 +93807,7 @@ let Ok$1 = class Ok {
|
|
|
93767
93807
|
isErr() {
|
|
93768
93808
|
return !this.isOk();
|
|
93769
93809
|
}
|
|
93770
|
-
}
|
|
93810
|
+
}
|
|
93771
93811
|
class Err {
|
|
93772
93812
|
constructor(error) {
|
|
93773
93813
|
this.error = error;
|
|
@@ -93779,7 +93819,7 @@ class Err {
|
|
|
93779
93819
|
return !this.isOk();
|
|
93780
93820
|
}
|
|
93781
93821
|
}
|
|
93782
|
-
const ok
|
|
93822
|
+
const ok = (value) => new Ok(value);
|
|
93783
93823
|
const err = (err2) => new Err(err2);
|
|
93784
93824
|
function resolvedPromiseLike$2(result) {
|
|
93785
93825
|
if (isPromiseLike$2(result)) {
|
|
@@ -93870,6 +93910,38 @@ function setOverlaps(setA, setB) {
|
|
|
93870
93910
|
}
|
|
93871
93911
|
return false;
|
|
93872
93912
|
}
|
|
93913
|
+
class CacheControlRequestRunner {
|
|
93914
|
+
constructor(readFromCache, requestFromNetwork, writeToCache) {
|
|
93915
|
+
this.readFromCacheInternal = readFromCache;
|
|
93916
|
+
this.requestFromNetworkInternal = requestFromNetwork;
|
|
93917
|
+
this.writeToCacheInternal = writeToCache;
|
|
93918
|
+
}
|
|
93919
|
+
readFromCache(cache) {
|
|
93920
|
+
const resultPromise = this.readFromCacheInternal(cache);
|
|
93921
|
+
return resultPromise.then((result) => {
|
|
93922
|
+
if (result.isErr()) {
|
|
93923
|
+
return err(result.error);
|
|
93924
|
+
}
|
|
93925
|
+
this.returnData = result;
|
|
93926
|
+
return ok(void 0);
|
|
93927
|
+
});
|
|
93928
|
+
}
|
|
93929
|
+
requestFromNetwork() {
|
|
93930
|
+
const that = this;
|
|
93931
|
+
return async function* () {
|
|
93932
|
+
const result = await that.requestFromNetworkInternal();
|
|
93933
|
+
if (result.isErr()) {
|
|
93934
|
+
that.networkError = result;
|
|
93935
|
+
} else {
|
|
93936
|
+
that.networkData = result;
|
|
93937
|
+
}
|
|
93938
|
+
yield result;
|
|
93939
|
+
}();
|
|
93940
|
+
}
|
|
93941
|
+
writeToCache(cache, networkResult) {
|
|
93942
|
+
return this.writeToCacheInternal(cache, networkResult);
|
|
93943
|
+
}
|
|
93944
|
+
}
|
|
93873
93945
|
class CacheControlCommand extends BaseCommand {
|
|
93874
93946
|
constructor(services) {
|
|
93875
93947
|
super();
|
|
@@ -93889,57 +93961,48 @@ class CacheControlCommand extends BaseCommand {
|
|
|
93889
93961
|
this.cacheControlStrategyConfig,
|
|
93890
93962
|
overrides
|
|
93891
93963
|
);
|
|
93892
|
-
|
|
93893
|
-
let returnError;
|
|
93894
|
-
const requestRunner = {
|
|
93895
|
-
readFromCache: (cache) => {
|
|
93896
|
-
const resultPromise2 = this.buildResultWithSubscribe(cache);
|
|
93897
|
-
return resultPromise2.then((result) => {
|
|
93898
|
-
if (result.isErr()) {
|
|
93899
|
-
return err(result.error);
|
|
93900
|
-
}
|
|
93901
|
-
returnData = result;
|
|
93902
|
-
return ok$1(void 0);
|
|
93903
|
-
});
|
|
93904
|
-
},
|
|
93905
|
-
requestFromNetwork: () => {
|
|
93906
|
-
const that = this;
|
|
93907
|
-
return async function* () {
|
|
93908
|
-
const result = await that.requestFromNetwork();
|
|
93909
|
-
if (result.isErr()) {
|
|
93910
|
-
returnError = result;
|
|
93911
|
-
}
|
|
93912
|
-
yield result;
|
|
93913
|
-
}();
|
|
93914
|
-
},
|
|
93915
|
-
writeToCache: (cache, networkResult) => {
|
|
93916
|
-
return this.writeToCacheAndRecordKeys(cache, networkResult);
|
|
93917
|
-
}
|
|
93918
|
-
};
|
|
93964
|
+
const requestRunner = this.buildRequestRunner();
|
|
93919
93965
|
const resultPromise = this.services.cacheController.execute(mergedCacheControlConfig, requestRunner, {
|
|
93920
93966
|
instrumentationAttributes: this.instrumentationAttributes
|
|
93921
93967
|
});
|
|
93922
93968
|
return resultPromise.then((result) => {
|
|
93923
|
-
return this.
|
|
93924
|
-
|
|
93925
|
-
|
|
93926
|
-
|
|
93927
|
-
|
|
93928
|
-
|
|
93929
|
-
|
|
93930
|
-
|
|
93931
|
-
|
|
93932
|
-
|
|
93933
|
-
if (
|
|
93934
|
-
return
|
|
93969
|
+
return this.handleCacheControllerResult(result, requestRunner);
|
|
93970
|
+
});
|
|
93971
|
+
}
|
|
93972
|
+
handleCacheControllerResult(result, requestRunner) {
|
|
93973
|
+
const { networkError, networkData, returnData } = requestRunner;
|
|
93974
|
+
return this.publishUpdatedKeys().then(() => {
|
|
93975
|
+
if (networkError) {
|
|
93976
|
+
return networkError;
|
|
93977
|
+
}
|
|
93978
|
+
if (result.isErr()) {
|
|
93979
|
+
if (networkData) {
|
|
93980
|
+
return this.constructSubscribableResult(networkData.value);
|
|
93935
93981
|
}
|
|
93936
|
-
|
|
93937
|
-
|
|
93982
|
+
return err(result.error);
|
|
93983
|
+
}
|
|
93984
|
+
if (this.subscriptions.length > 0) {
|
|
93985
|
+
this.subscribeToKeysUsed();
|
|
93986
|
+
}
|
|
93987
|
+
if (returnData === void 0) {
|
|
93988
|
+
if (networkData) {
|
|
93989
|
+
return this.constructSubscribableResult(networkData.value);
|
|
93938
93990
|
}
|
|
93939
|
-
return
|
|
93940
|
-
}
|
|
93991
|
+
return err(new Error("Cache miss after fetching from network"));
|
|
93992
|
+
}
|
|
93993
|
+
if (returnData.isOk() && this.lastEmittedData === void 0) {
|
|
93994
|
+
this.lastEmittedData = returnData.value.data;
|
|
93995
|
+
}
|
|
93996
|
+
return returnData;
|
|
93941
93997
|
});
|
|
93942
93998
|
}
|
|
93999
|
+
buildRequestRunner() {
|
|
94000
|
+
return new CacheControlRequestRunner(
|
|
94001
|
+
(cache) => this.buildResultWithSubscribe(cache),
|
|
94002
|
+
() => this.requestFromNetwork(),
|
|
94003
|
+
(cache, networkResult) => this.writeToCacheAndRecordKeys(cache, networkResult)
|
|
94004
|
+
);
|
|
94005
|
+
}
|
|
93943
94006
|
publishUpdatedKeys() {
|
|
93944
94007
|
if (this.services.pubSub) {
|
|
93945
94008
|
if (this.keysUpdated !== void 0 && this.keysUpdated.size > 0) {
|
|
@@ -93990,7 +94053,7 @@ class CacheControlCommand extends BaseCommand {
|
|
|
93990
94053
|
if (result.isErr()) {
|
|
93991
94054
|
return err(result.error);
|
|
93992
94055
|
}
|
|
93993
|
-
return ok
|
|
94056
|
+
return ok(void 0);
|
|
93994
94057
|
});
|
|
93995
94058
|
}
|
|
93996
94059
|
writeToCacheAndRecordKeys(cache, networkResult) {
|
|
@@ -93998,7 +94061,7 @@ class CacheControlCommand extends BaseCommand {
|
|
|
93998
94061
|
return this.writeToCache(recordableCache, networkResult).then((result) => {
|
|
93999
94062
|
this.instantiationTime = Date.now() / 1e3;
|
|
94000
94063
|
this.keysUpdated = recordableCache.keysUpdated;
|
|
94001
|
-
return ok
|
|
94064
|
+
return ok(result);
|
|
94002
94065
|
});
|
|
94003
94066
|
}
|
|
94004
94067
|
buildResultWithSubscribe(cache) {
|
|
@@ -94010,14 +94073,18 @@ class CacheControlCommand extends BaseCommand {
|
|
|
94010
94073
|
} else {
|
|
94011
94074
|
const data = readResult.value;
|
|
94012
94075
|
this.keysUsed = recordableCache.keysRead;
|
|
94013
|
-
return
|
|
94014
|
-
data,
|
|
94015
|
-
subscribe: this.buildSubscribe(),
|
|
94016
|
-
refresh: () => this.refresh()
|
|
94017
|
-
});
|
|
94076
|
+
return this.constructSubscribableResult(data);
|
|
94018
94077
|
}
|
|
94019
94078
|
});
|
|
94020
94079
|
}
|
|
94080
|
+
constructSubscribableResult(data) {
|
|
94081
|
+
return ok({
|
|
94082
|
+
data,
|
|
94083
|
+
// this cast is in case we need to return Network data as a fallback for caching errors
|
|
94084
|
+
subscribe: this.buildSubscribe(),
|
|
94085
|
+
refresh: () => this.refresh()
|
|
94086
|
+
});
|
|
94087
|
+
}
|
|
94021
94088
|
/**
|
|
94022
94089
|
* Builds a function that subscribes to cache changes via the pubsub service. Whenever
|
|
94023
94090
|
* relevant cache updates occur, it re-reads the data and compares it against
|
|
@@ -94049,7 +94116,7 @@ class CacheControlCommand extends BaseCommand {
|
|
|
94049
94116
|
}
|
|
94050
94117
|
if (!this.equals(this.lastEmittedData, result.value.data)) {
|
|
94051
94118
|
this.lastEmittedData = result.value.data;
|
|
94052
|
-
this.invokeConsumerCallbacks(ok
|
|
94119
|
+
this.invokeConsumerCallbacks(ok(result.value.data));
|
|
94053
94120
|
}
|
|
94054
94121
|
return result;
|
|
94055
94122
|
});
|
|
@@ -94137,7 +94204,7 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
|
|
|
94137
94204
|
this.afterRequestHooks({ statusCode: 200 });
|
|
94138
94205
|
} catch (e) {
|
|
94139
94206
|
}
|
|
94140
|
-
return ok$
|
|
94207
|
+
return ok$1(auraReturnValue);
|
|
94141
94208
|
}).catch((error) => {
|
|
94142
94209
|
if (!error || !error.getError) {
|
|
94143
94210
|
return err$1(toError("Failed to get error from response"));
|
|
@@ -94156,7 +94223,7 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
|
|
|
94156
94223
|
(response2) => {
|
|
94157
94224
|
if (response2.ok) {
|
|
94158
94225
|
return response2.json().then(
|
|
94159
|
-
(json) => ok$
|
|
94226
|
+
(json) => ok$1(json),
|
|
94160
94227
|
(reason) => err$1(toError(reason))
|
|
94161
94228
|
).finally(() => {
|
|
94162
94229
|
try {
|
|
@@ -94188,10 +94255,10 @@ class AuraNormalizedCacheControlCommand extends AuraCacheControlCommand$1 {
|
|
|
94188
94255
|
const data = this.buildResultType().query(cache, this.buildQuery());
|
|
94189
94256
|
if (data.isErr()) {
|
|
94190
94257
|
return resolvedPromiseLike$3(
|
|
94191
|
-
err$1(new Error(`Failed to build data from type: ${stringify$
|
|
94258
|
+
err$1(new Error(`Failed to build data from type: ${stringify$2(data.error)}`))
|
|
94192
94259
|
);
|
|
94193
94260
|
}
|
|
94194
|
-
return resolvedPromiseLike$3(ok$
|
|
94261
|
+
return resolvedPromiseLike$3(ok$1(data.value));
|
|
94195
94262
|
}
|
|
94196
94263
|
writeToCache(cache, networkResult) {
|
|
94197
94264
|
if (networkResult.isOk()) {
|
|
@@ -94203,7 +94270,7 @@ class AuraNormalizedCacheControlCommand extends AuraCacheControlCommand$1 {
|
|
|
94203
94270
|
return resolvedPromiseLike$3(void 0);
|
|
94204
94271
|
}
|
|
94205
94272
|
}
|
|
94206
|
-
function buildServiceDescriptor$
|
|
94273
|
+
function buildServiceDescriptor$a() {
|
|
94207
94274
|
return {
|
|
94208
94275
|
type: "auraNormalizedCacheControlCommand",
|
|
94209
94276
|
version: "1.0",
|
|
@@ -94268,7 +94335,7 @@ class AuraCacheControlCommand extends CacheControlCommand {
|
|
|
94268
94335
|
this.afterRequestHooks({ statusCode: 200 });
|
|
94269
94336
|
} catch (e) {
|
|
94270
94337
|
}
|
|
94271
|
-
return ok$
|
|
94338
|
+
return ok$1(auraReturnValue);
|
|
94272
94339
|
}).catch((error) => {
|
|
94273
94340
|
if (!error || !error.getError) {
|
|
94274
94341
|
return err$1(toError("Failed to get error from response"));
|
|
@@ -94287,7 +94354,7 @@ class AuraCacheControlCommand extends CacheControlCommand {
|
|
|
94287
94354
|
(response2) => {
|
|
94288
94355
|
if (response2.ok) {
|
|
94289
94356
|
return response2.json().then(
|
|
94290
|
-
(json) => ok$
|
|
94357
|
+
(json) => ok$1(json),
|
|
94291
94358
|
(reason) => err$1(toError(reason))
|
|
94292
94359
|
).finally(() => {
|
|
94293
94360
|
try {
|
|
@@ -94324,7 +94391,7 @@ class AuraResourceCacheControlCommand extends AuraCacheControlCommand {
|
|
|
94324
94391
|
if (data === void 0) {
|
|
94325
94392
|
return resolvedPromiseLike$3(err$1(new Error("Failed to find data in cache")));
|
|
94326
94393
|
}
|
|
94327
|
-
return resolvedPromiseLike$3(ok$
|
|
94394
|
+
return resolvedPromiseLike$3(ok$1(data));
|
|
94328
94395
|
}
|
|
94329
94396
|
writeToCache(cache, networkResult) {
|
|
94330
94397
|
if (networkResult.isOk()) {
|
|
@@ -94341,7 +94408,7 @@ class AuraResourceCacheControlCommand extends AuraCacheControlCommand {
|
|
|
94341
94408
|
return `{"endpoint":${this.endpoint},"params":${stableJSONStringify$2(this.auraParams)}}`;
|
|
94342
94409
|
}
|
|
94343
94410
|
}
|
|
94344
|
-
function buildServiceDescriptor$
|
|
94411
|
+
function buildServiceDescriptor$9() {
|
|
94345
94412
|
return {
|
|
94346
94413
|
type: "auraResourceCacheControlCommand",
|
|
94347
94414
|
version: "1.0",
|
|
@@ -94379,7 +94446,7 @@ class NetworkCommand extends BaseCommand {
|
|
|
94379
94446
|
return err$1(networkResult.error);
|
|
94380
94447
|
} else {
|
|
94381
94448
|
const data = networkResult.value;
|
|
94382
|
-
return ok$
|
|
94449
|
+
return ok$1({
|
|
94383
94450
|
data,
|
|
94384
94451
|
subscribe: (cb) => {
|
|
94385
94452
|
this.subscriptions.push(cb);
|
|
@@ -94398,10 +94465,10 @@ class NetworkCommand extends BaseCommand {
|
|
|
94398
94465
|
if (isSubscribableResult(newResult)) {
|
|
94399
94466
|
const value = newResult.value;
|
|
94400
94467
|
this.subscriptions.forEach((cb) => {
|
|
94401
|
-
cb(ok$
|
|
94468
|
+
cb(ok$1(value.data));
|
|
94402
94469
|
});
|
|
94403
94470
|
}
|
|
94404
|
-
return ok$
|
|
94471
|
+
return ok$1(void 0);
|
|
94405
94472
|
}
|
|
94406
94473
|
return err$1(newResult.error);
|
|
94407
94474
|
});
|
|
@@ -94425,7 +94492,7 @@ class FetchNetworkCommand extends NetworkCommand {
|
|
|
94425
94492
|
(response2) => {
|
|
94426
94493
|
if (response2.ok) {
|
|
94427
94494
|
return response2.json().then(
|
|
94428
|
-
(json) => ok$
|
|
94495
|
+
(json) => ok$1(json),
|
|
94429
94496
|
(reason) => err$1(toError(reason))
|
|
94430
94497
|
).finally(() => {
|
|
94431
94498
|
try {
|
|
@@ -94448,7 +94515,7 @@ class FetchNetworkCommand extends NetworkCommand {
|
|
|
94448
94515
|
);
|
|
94449
94516
|
}
|
|
94450
94517
|
}
|
|
94451
|
-
function buildServiceDescriptor$
|
|
94518
|
+
function buildServiceDescriptor$8() {
|
|
94452
94519
|
return {
|
|
94453
94520
|
type: "fetchNetworkCommandBaseClass",
|
|
94454
94521
|
version: "1.0",
|
|
@@ -94485,7 +94552,7 @@ class HttpCacheControlCommand extends CacheControlCommand {
|
|
|
94485
94552
|
(response2) => {
|
|
94486
94553
|
if (response2.ok) {
|
|
94487
94554
|
return response2.json().then(
|
|
94488
|
-
(json) => ok$
|
|
94555
|
+
(json) => ok$1(json),
|
|
94489
94556
|
(reason) => err$1(toError(reason))
|
|
94490
94557
|
).finally(() => {
|
|
94491
94558
|
try {
|
|
@@ -94517,10 +94584,10 @@ class HttpNormalizedCacheControlCommand extends HttpCacheControlCommand {
|
|
|
94517
94584
|
const data = this.buildResultType().query(cache, this.buildQuery());
|
|
94518
94585
|
if (data.isErr()) {
|
|
94519
94586
|
return resolvedPromiseLike$3(
|
|
94520
|
-
err$1(new Error(`Failed to build data from type: ${stringify$
|
|
94587
|
+
err$1(new Error(`Failed to build data from type: ${stringify$2(data.error)}`))
|
|
94521
94588
|
);
|
|
94522
94589
|
}
|
|
94523
|
-
return resolvedPromiseLike$3(ok$
|
|
94590
|
+
return resolvedPromiseLike$3(ok$1(data.value));
|
|
94524
94591
|
}
|
|
94525
94592
|
writeToCache(cache, networkResult) {
|
|
94526
94593
|
if (networkResult.isOk()) {
|
|
@@ -94532,7 +94599,7 @@ class HttpNormalizedCacheControlCommand extends HttpCacheControlCommand {
|
|
|
94532
94599
|
return resolvedPromiseLike$3(void 0);
|
|
94533
94600
|
}
|
|
94534
94601
|
}
|
|
94535
|
-
function buildServiceDescriptor$
|
|
94602
|
+
function buildServiceDescriptor$7() {
|
|
94536
94603
|
return {
|
|
94537
94604
|
type: "httpNormalizedCacheControlCommand",
|
|
94538
94605
|
version: "1.0",
|
|
@@ -94550,12 +94617,12 @@ function buildServiceDescriptor$6() {
|
|
|
94550
94617
|
* All rights reserved.
|
|
94551
94618
|
* For full license text, see the LICENSE.txt file
|
|
94552
94619
|
*/
|
|
94553
|
-
const { stringify: stringify$
|
|
94554
|
-
function deepCopy(x) {
|
|
94555
|
-
const stringified = stringify$
|
|
94556
|
-
return stringified ? parse$
|
|
94620
|
+
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
94621
|
+
function deepCopy$1(x) {
|
|
94622
|
+
const stringified = stringify$1(x);
|
|
94623
|
+
return stringified ? parse$1(stringified) : void 0;
|
|
94557
94624
|
}
|
|
94558
|
-
class DefaultRecordableCache {
|
|
94625
|
+
let DefaultRecordableCache$1 = class DefaultRecordableCache {
|
|
94559
94626
|
constructor(baseCache) {
|
|
94560
94627
|
this.baseCache = baseCache;
|
|
94561
94628
|
this.keysRead = /* @__PURE__ */ new Set();
|
|
@@ -94574,7 +94641,7 @@ class DefaultRecordableCache {
|
|
|
94574
94641
|
this.missingKeysRead.add(key);
|
|
94575
94642
|
}
|
|
94576
94643
|
if (options == null ? void 0 : options.copy) {
|
|
94577
|
-
return deepCopy(value);
|
|
94644
|
+
return deepCopy$1(value);
|
|
94578
94645
|
}
|
|
94579
94646
|
return value;
|
|
94580
94647
|
}
|
|
@@ -94600,13 +94667,13 @@ class DefaultRecordableCache {
|
|
|
94600
94667
|
return new DefaultRecordableCache(this);
|
|
94601
94668
|
}
|
|
94602
94669
|
filter(predicate) {
|
|
94603
|
-
return new DefaultFilteredCache(this, predicate);
|
|
94670
|
+
return new DefaultFilteredCache$1(this, predicate);
|
|
94604
94671
|
}
|
|
94605
94672
|
buildFixedTimeWritableCache(generatedTime) {
|
|
94606
|
-
return new FixedTimeWritableCache(this, generatedTime);
|
|
94673
|
+
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
94607
94674
|
}
|
|
94608
|
-
}
|
|
94609
|
-
class DefaultFilteredCache {
|
|
94675
|
+
};
|
|
94676
|
+
let DefaultFilteredCache$1 = class DefaultFilteredCache {
|
|
94610
94677
|
constructor(baseCache, predicate) {
|
|
94611
94678
|
this.baseCache = baseCache;
|
|
94612
94679
|
this.predicate = predicate;
|
|
@@ -94618,7 +94685,7 @@ class DefaultFilteredCache {
|
|
|
94618
94685
|
const result = this.baseCache.get(key);
|
|
94619
94686
|
if (result && this.predicate(key, result)) {
|
|
94620
94687
|
if (options == null ? void 0 : options.copy) {
|
|
94621
|
-
return deepCopy(result);
|
|
94688
|
+
return deepCopy$1(result);
|
|
94622
94689
|
}
|
|
94623
94690
|
return result;
|
|
94624
94691
|
}
|
|
@@ -94640,7 +94707,7 @@ class DefaultFilteredCache {
|
|
|
94640
94707
|
return this.getFilteredEntries();
|
|
94641
94708
|
}
|
|
94642
94709
|
record() {
|
|
94643
|
-
return new DefaultRecordableCache(this);
|
|
94710
|
+
return new DefaultRecordableCache$1(this);
|
|
94644
94711
|
}
|
|
94645
94712
|
filter(predicate) {
|
|
94646
94713
|
return new DefaultFilteredCache(this, predicate);
|
|
@@ -94660,10 +94727,10 @@ class DefaultFilteredCache {
|
|
|
94660
94727
|
return filteredKeySet;
|
|
94661
94728
|
}
|
|
94662
94729
|
buildFixedTimeWritableCache(generatedTime) {
|
|
94663
|
-
return new FixedTimeWritableCache(this, generatedTime);
|
|
94730
|
+
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
94664
94731
|
}
|
|
94665
|
-
}
|
|
94666
|
-
class FixedTimeWritableCache {
|
|
94732
|
+
};
|
|
94733
|
+
let FixedTimeWritableCache$1 = class FixedTimeWritableCache {
|
|
94667
94734
|
constructor(baseCache, generatedTime) {
|
|
94668
94735
|
this.baseCache = baseCache;
|
|
94669
94736
|
this.generatedTime = generatedTime;
|
|
@@ -94699,22 +94766,22 @@ class FixedTimeWritableCache {
|
|
|
94699
94766
|
return this.baseCache.entries();
|
|
94700
94767
|
}
|
|
94701
94768
|
record() {
|
|
94702
|
-
return new DefaultRecordableCache(this);
|
|
94769
|
+
return new DefaultRecordableCache$1(this);
|
|
94703
94770
|
}
|
|
94704
94771
|
filter(predicate) {
|
|
94705
|
-
return new DefaultFilteredCache(this, predicate);
|
|
94772
|
+
return new DefaultFilteredCache$1(this, predicate);
|
|
94706
94773
|
}
|
|
94707
94774
|
buildFixedTimeWritableCache(generatedTime) {
|
|
94708
94775
|
return new FixedTimeWritableCache(this, generatedTime);
|
|
94709
94776
|
}
|
|
94710
|
-
}
|
|
94711
|
-
class DefaultCache {
|
|
94777
|
+
};
|
|
94778
|
+
let DefaultCache$1 = class DefaultCache {
|
|
94712
94779
|
constructor() {
|
|
94713
94780
|
this.data = {};
|
|
94714
94781
|
}
|
|
94715
94782
|
get(key, options) {
|
|
94716
94783
|
if (options == null ? void 0 : options.copy) {
|
|
94717
|
-
return deepCopy(this.data[key]);
|
|
94784
|
+
return deepCopy$1(this.data[key]);
|
|
94718
94785
|
}
|
|
94719
94786
|
return this.data[key];
|
|
94720
94787
|
}
|
|
@@ -94776,20 +94843,20 @@ class DefaultCache {
|
|
|
94776
94843
|
return Object.entries(this.data);
|
|
94777
94844
|
}
|
|
94778
94845
|
record() {
|
|
94779
|
-
return new DefaultRecordableCache(this);
|
|
94846
|
+
return new DefaultRecordableCache$1(this);
|
|
94780
94847
|
}
|
|
94781
94848
|
filter(predicate) {
|
|
94782
|
-
return new DefaultFilteredCache(this, predicate);
|
|
94849
|
+
return new DefaultFilteredCache$1(this, predicate);
|
|
94783
94850
|
}
|
|
94784
94851
|
buildFixedTimeWritableCache(generatedTime) {
|
|
94785
|
-
return new FixedTimeWritableCache(this, generatedTime);
|
|
94852
|
+
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
94786
94853
|
}
|
|
94787
|
-
}
|
|
94788
|
-
function buildServiceDescriptor$
|
|
94854
|
+
};
|
|
94855
|
+
function buildServiceDescriptor$6() {
|
|
94789
94856
|
return {
|
|
94790
94857
|
type: "cache",
|
|
94791
94858
|
version: "1.0",
|
|
94792
|
-
service: new DefaultCache()
|
|
94859
|
+
service: new DefaultCache$1()
|
|
94793
94860
|
};
|
|
94794
94861
|
}
|
|
94795
94862
|
|
|
@@ -94822,7 +94889,7 @@ class NoCacheCacheControlStrategy extends CacheControlStrategy {
|
|
|
94822
94889
|
const tempCache = this.filteredCache;
|
|
94823
94890
|
return new Promise(async (resolve, reject) => {
|
|
94824
94891
|
try {
|
|
94825
|
-
let readResult = ok$
|
|
94892
|
+
let readResult = ok$1(void 0);
|
|
94826
94893
|
for await (const rfnResult of this.requestRunner.requestFromNetwork()) {
|
|
94827
94894
|
if (rfnResult) {
|
|
94828
94895
|
const result = await this.services.cacheInclusionPolicy.write({
|
|
@@ -94860,13 +94927,13 @@ class MaxAgeCacheControlStrategy extends CacheControlStrategy {
|
|
|
94860
94927
|
startTime,
|
|
94861
94928
|
options == null ? void 0 : options.instrumentationAttributes
|
|
94862
94929
|
);
|
|
94863
|
-
return ok$
|
|
94930
|
+
return ok$1(void 0);
|
|
94864
94931
|
}
|
|
94865
94932
|
this.collectCacheMissInstrumentation(startTime, options == null ? void 0 : options.instrumentationAttributes);
|
|
94866
94933
|
const tempCache = this.filteredCache;
|
|
94867
94934
|
return new Promise(async (resolve, reject) => {
|
|
94868
94935
|
try {
|
|
94869
|
-
let readResult = ok$
|
|
94936
|
+
let readResult = ok$1(void 0);
|
|
94870
94937
|
for await (const rfnResult of this.requestRunner.requestFromNetwork()) {
|
|
94871
94938
|
if (rfnResult) {
|
|
94872
94939
|
const result = await this.services.cacheInclusionPolicy.write({
|
|
@@ -94882,7 +94949,7 @@ class MaxAgeCacheControlStrategy extends CacheControlStrategy {
|
|
|
94882
94949
|
readFromL1: (l1) => this.requestRunner.readFromCache(l1)
|
|
94883
94950
|
});
|
|
94884
94951
|
if (readResult.isOk()) {
|
|
94885
|
-
resolve(ok$
|
|
94952
|
+
resolve(ok$1(void 0));
|
|
94886
94953
|
}
|
|
94887
94954
|
}
|
|
94888
94955
|
return resolve(readResult);
|
|
@@ -94953,7 +95020,7 @@ class CacheController {
|
|
|
94953
95020
|
yield* this.services.cacheInclusionPolicy.findAndModify(query, cacheUpdate);
|
|
94954
95021
|
}
|
|
94955
95022
|
}
|
|
94956
|
-
function buildServiceDescriptor$
|
|
95023
|
+
function buildServiceDescriptor$5(cache, cacheInclusionPolicy) {
|
|
94957
95024
|
return {
|
|
94958
95025
|
type: "cacheController",
|
|
94959
95026
|
version: "1.0",
|
|
@@ -94961,193 +95028,6 @@ function buildServiceDescriptor$4(cache, cacheInclusionPolicy) {
|
|
|
94961
95028
|
};
|
|
94962
95029
|
}
|
|
94963
95030
|
|
|
94964
|
-
/*!
|
|
94965
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
94966
|
-
* All rights reserved.
|
|
94967
|
-
* For full license text, see the LICENSE.txt file
|
|
94968
|
-
*/
|
|
94969
|
-
class CacheInclusionPolicyService {
|
|
94970
|
-
}
|
|
94971
|
-
/*!
|
|
94972
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
94973
|
-
* All rights reserved.
|
|
94974
|
-
* For full license text, see the LICENSE.txt file
|
|
94975
|
-
*/
|
|
94976
|
-
class Ok {
|
|
94977
|
-
constructor(value) {
|
|
94978
|
-
this.value = value;
|
|
94979
|
-
}
|
|
94980
|
-
isOk() {
|
|
94981
|
-
return true;
|
|
94982
|
-
}
|
|
94983
|
-
isErr() {
|
|
94984
|
-
return !this.isOk();
|
|
94985
|
-
}
|
|
94986
|
-
}
|
|
94987
|
-
const ok = (value) => new Ok(value);
|
|
94988
|
-
function resolvedPromiseLike$1(result) {
|
|
94989
|
-
if (isPromiseLike$1(result)) {
|
|
94990
|
-
return result.then((nextResult) => nextResult);
|
|
94991
|
-
}
|
|
94992
|
-
return {
|
|
94993
|
-
then: (onFulfilled, _onRejected) => {
|
|
94994
|
-
try {
|
|
94995
|
-
return resolvedPromiseLike$1(onFulfilled(result));
|
|
94996
|
-
} catch (e) {
|
|
94997
|
-
if (onFulfilled === void 0) {
|
|
94998
|
-
return resolvedPromiseLike$1(result);
|
|
94999
|
-
}
|
|
95000
|
-
return rejectedPromiseLike$1(e);
|
|
95001
|
-
}
|
|
95002
|
-
}
|
|
95003
|
-
};
|
|
95004
|
-
}
|
|
95005
|
-
function rejectedPromiseLike$1(reason) {
|
|
95006
|
-
if (isPromiseLike$1(reason)) {
|
|
95007
|
-
return reason.then((nextResult) => nextResult);
|
|
95008
|
-
}
|
|
95009
|
-
return {
|
|
95010
|
-
then: (_onFulfilled, onRejected) => {
|
|
95011
|
-
if (typeof onRejected === "function") {
|
|
95012
|
-
try {
|
|
95013
|
-
return resolvedPromiseLike$1(onRejected(reason));
|
|
95014
|
-
} catch (e) {
|
|
95015
|
-
return rejectedPromiseLike$1(e);
|
|
95016
|
-
}
|
|
95017
|
-
}
|
|
95018
|
-
return rejectedPromiseLike$1(reason);
|
|
95019
|
-
}
|
|
95020
|
-
};
|
|
95021
|
-
}
|
|
95022
|
-
function isPromiseLike$1(x) {
|
|
95023
|
-
return typeof (x == null ? void 0 : x.then) === "function";
|
|
95024
|
-
}
|
|
95025
|
-
const isAndQuery = (query) => "$and" in query;
|
|
95026
|
-
const isOrQuery = (query) => "$or" in query;
|
|
95027
|
-
const isNotQuery = (query) => "$not" in query;
|
|
95028
|
-
const matchesMetadata = (metadataQuery, cacheControl) => {
|
|
95029
|
-
if ("cacheControlType" in metadataQuery && cacheControl.type !== metadataQuery.cacheControlType.$eq) {
|
|
95030
|
-
return false;
|
|
95031
|
-
}
|
|
95032
|
-
if ("maxAge" in metadataQuery && cacheControl.type === "max-age") {
|
|
95033
|
-
const maxAge = cacheControl.maxAge ?? 0;
|
|
95034
|
-
if (metadataQuery.maxAge.$gte !== void 0 && maxAge < metadataQuery.maxAge.$gte || metadataQuery.maxAge.$lte !== void 0 && maxAge > metadataQuery.maxAge.$lte) {
|
|
95035
|
-
return false;
|
|
95036
|
-
}
|
|
95037
|
-
}
|
|
95038
|
-
return true;
|
|
95039
|
-
};
|
|
95040
|
-
function queryToPredicate(query) {
|
|
95041
|
-
return (key, entry) => {
|
|
95042
|
-
if (!query) return false;
|
|
95043
|
-
if (isAndQuery(query))
|
|
95044
|
-
return query.$and.every((subQuery) => queryToPredicate(subQuery)(key, entry));
|
|
95045
|
-
if (isOrQuery(query))
|
|
95046
|
-
return query.$or.some((subQuery) => queryToPredicate(subQuery)(key, entry));
|
|
95047
|
-
if (isNotQuery(query)) return !queryToPredicate(query.$not)(key, entry);
|
|
95048
|
-
if ("key" in query) return matchesKey(query.key, key);
|
|
95049
|
-
if ("metadata" in query)
|
|
95050
|
-
return matchesMetadata(query.metadata, entry.metadata.cacheControl);
|
|
95051
|
-
if ("value" in query) return false;
|
|
95052
|
-
throw new Error("Unknown Query Operation");
|
|
95053
|
-
};
|
|
95054
|
-
}
|
|
95055
|
-
function matchesKey(keyQuery, key) {
|
|
95056
|
-
if ("$regex" in keyQuery) {
|
|
95057
|
-
return keyQuery.$regex.test(key);
|
|
95058
|
-
}
|
|
95059
|
-
return false;
|
|
95060
|
-
}
|
|
95061
|
-
function buildUpdate(update, existing) {
|
|
95062
|
-
switch (update.type) {
|
|
95063
|
-
case "invalidate":
|
|
95064
|
-
const updatedCacheControl = buildInvalidatedCacheControl(
|
|
95065
|
-
existing.metadata.cacheControl
|
|
95066
|
-
);
|
|
95067
|
-
return updatedCacheControl !== void 0 ? { type: "metadata", metadata: updatedCacheControl } : { type: "no-op" };
|
|
95068
|
-
default:
|
|
95069
|
-
throw new Error(`Invalid update operation: ${update.type}`);
|
|
95070
|
-
}
|
|
95071
|
-
}
|
|
95072
|
-
function buildInvalidatedCacheControl(existingCacheControl) {
|
|
95073
|
-
switch (existingCacheControl.type) {
|
|
95074
|
-
case "max-age":
|
|
95075
|
-
case "stale-while-revalidate":
|
|
95076
|
-
if (existingCacheControl.maxAge !== 0) {
|
|
95077
|
-
return {
|
|
95078
|
-
...existingCacheControl,
|
|
95079
|
-
maxAge: 0
|
|
95080
|
-
};
|
|
95081
|
-
}
|
|
95082
|
-
}
|
|
95083
|
-
return void 0;
|
|
95084
|
-
}
|
|
95085
|
-
class InMemoryCacheInclusionPolicy extends CacheInclusionPolicyService {
|
|
95086
|
-
constructor(services) {
|
|
95087
|
-
super();
|
|
95088
|
-
this.services = services;
|
|
95089
|
-
}
|
|
95090
|
-
/**
|
|
95091
|
-
* Reads data out of a single level in memory store.
|
|
95092
|
-
*/
|
|
95093
|
-
read(options) {
|
|
95094
|
-
const { l1, readFromL1 } = options;
|
|
95095
|
-
return readFromL1(l1);
|
|
95096
|
-
}
|
|
95097
|
-
/**
|
|
95098
|
-
* Writes data to a single level in memory store.
|
|
95099
|
-
*/
|
|
95100
|
-
write(options) {
|
|
95101
|
-
const { l1, writeToL1 } = options;
|
|
95102
|
-
return writeToL1(l1);
|
|
95103
|
-
}
|
|
95104
|
-
/**
|
|
95105
|
-
* Finds cache entries that match the given query.
|
|
95106
|
-
* Returns an async generator that yields `[key, entry]`.
|
|
95107
|
-
*/
|
|
95108
|
-
async *find(query) {
|
|
95109
|
-
const cache = this.services.cache;
|
|
95110
|
-
const predicate = queryToPredicate(query);
|
|
95111
|
-
const filteredEntries = cache.filter(predicate).entries();
|
|
95112
|
-
for (const entry of filteredEntries) {
|
|
95113
|
-
yield entry;
|
|
95114
|
-
}
|
|
95115
|
-
}
|
|
95116
|
-
/**
|
|
95117
|
-
* Finds and modifies cache entries that match the given query.
|
|
95118
|
-
* Extends `find(query)` and returns an async generator of modified keys.
|
|
95119
|
-
*/
|
|
95120
|
-
async *findAndModify(query, cacheUpdate) {
|
|
95121
|
-
const cache = this.services.cache;
|
|
95122
|
-
for await (const [key, value] of this.find(query)) {
|
|
95123
|
-
const update = buildUpdate(cacheUpdate, value);
|
|
95124
|
-
switch (update.type) {
|
|
95125
|
-
case "entry":
|
|
95126
|
-
this.write({
|
|
95127
|
-
l1: cache,
|
|
95128
|
-
writeToL1: (l1) => resolvedPromiseLike$1(ok(l1.set(key, update.entry)))
|
|
95129
|
-
});
|
|
95130
|
-
yield key;
|
|
95131
|
-
break;
|
|
95132
|
-
case "metadata":
|
|
95133
|
-
this.write({
|
|
95134
|
-
l1: cache,
|
|
95135
|
-
writeToL1: (l1) => resolvedPromiseLike$1(ok(l1.setMetadata(key, update.metadata)))
|
|
95136
|
-
});
|
|
95137
|
-
yield key;
|
|
95138
|
-
break;
|
|
95139
|
-
}
|
|
95140
|
-
}
|
|
95141
|
-
}
|
|
95142
|
-
}
|
|
95143
|
-
function buildInMemoryCacheInclusionPolicyService(cache) {
|
|
95144
|
-
return {
|
|
95145
|
-
service: new InMemoryCacheInclusionPolicy({ cache }),
|
|
95146
|
-
type: "cacheInclusionPolicy",
|
|
95147
|
-
version: "1.0"
|
|
95148
|
-
};
|
|
95149
|
-
}
|
|
95150
|
-
|
|
95151
95031
|
/*!
|
|
95152
95032
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
95153
95033
|
* All rights reserved.
|
|
@@ -95186,7 +95066,7 @@ function buildInstrumentCommand(services) {
|
|
|
95186
95066
|
};
|
|
95187
95067
|
};
|
|
95188
95068
|
}
|
|
95189
|
-
function buildServiceDescriptor$
|
|
95069
|
+
function buildServiceDescriptor$4(instrumentation) {
|
|
95190
95070
|
return {
|
|
95191
95071
|
type: "instrumentCommand",
|
|
95192
95072
|
version: "1.0",
|
|
@@ -95456,7 +95336,7 @@ class O11yInstrumentation {
|
|
|
95456
95336
|
this.metrics = new O11yOTelMetricsAPI(this.services);
|
|
95457
95337
|
}
|
|
95458
95338
|
}
|
|
95459
|
-
function buildServiceDescriptor$
|
|
95339
|
+
function buildServiceDescriptor$3(logger) {
|
|
95460
95340
|
return {
|
|
95461
95341
|
type: "instrumentation",
|
|
95462
95342
|
version: "1.0",
|
|
@@ -95474,41 +95354,41 @@ function buildServiceDescriptor$2(logger) {
|
|
|
95474
95354
|
* All rights reserved.
|
|
95475
95355
|
* For full license text, see the LICENSE.txt file
|
|
95476
95356
|
*/
|
|
95477
|
-
function resolvedPromiseLike(result) {
|
|
95478
|
-
if (isPromiseLike(result)) {
|
|
95357
|
+
function resolvedPromiseLike$1(result) {
|
|
95358
|
+
if (isPromiseLike$1(result)) {
|
|
95479
95359
|
return result.then((nextResult) => nextResult);
|
|
95480
95360
|
}
|
|
95481
95361
|
return {
|
|
95482
95362
|
then: (onFulfilled, _onRejected) => {
|
|
95483
95363
|
try {
|
|
95484
|
-
return resolvedPromiseLike(onFulfilled(result));
|
|
95364
|
+
return resolvedPromiseLike$1(onFulfilled(result));
|
|
95485
95365
|
} catch (e) {
|
|
95486
95366
|
if (onFulfilled === void 0) {
|
|
95487
|
-
return resolvedPromiseLike(result);
|
|
95367
|
+
return resolvedPromiseLike$1(result);
|
|
95488
95368
|
}
|
|
95489
|
-
return rejectedPromiseLike(e);
|
|
95369
|
+
return rejectedPromiseLike$1(e);
|
|
95490
95370
|
}
|
|
95491
95371
|
}
|
|
95492
95372
|
};
|
|
95493
95373
|
}
|
|
95494
|
-
function rejectedPromiseLike(reason) {
|
|
95495
|
-
if (isPromiseLike(reason)) {
|
|
95374
|
+
function rejectedPromiseLike$1(reason) {
|
|
95375
|
+
if (isPromiseLike$1(reason)) {
|
|
95496
95376
|
return reason.then((nextResult) => nextResult);
|
|
95497
95377
|
}
|
|
95498
95378
|
return {
|
|
95499
95379
|
then: (_onFulfilled, onRejected) => {
|
|
95500
95380
|
if (typeof onRejected === "function") {
|
|
95501
95381
|
try {
|
|
95502
|
-
return resolvedPromiseLike(onRejected(reason));
|
|
95382
|
+
return resolvedPromiseLike$1(onRejected(reason));
|
|
95503
95383
|
} catch (e) {
|
|
95504
|
-
return rejectedPromiseLike(e);
|
|
95384
|
+
return rejectedPromiseLike$1(e);
|
|
95505
95385
|
}
|
|
95506
95386
|
}
|
|
95507
|
-
return rejectedPromiseLike(reason);
|
|
95387
|
+
return rejectedPromiseLike$1(reason);
|
|
95508
95388
|
}
|
|
95509
95389
|
};
|
|
95510
95390
|
}
|
|
95511
|
-
function isPromiseLike(x) {
|
|
95391
|
+
function isPromiseLike$1(x) {
|
|
95512
95392
|
return typeof (x == null ? void 0 : x.then) === "function";
|
|
95513
95393
|
}
|
|
95514
95394
|
const EventTypeWildcard = Symbol("EventTypeWildcard");
|
|
@@ -95538,14 +95418,14 @@ class DefaultPubSubService {
|
|
|
95538
95418
|
return;
|
|
95539
95419
|
}
|
|
95540
95420
|
const returnVal = subscription.callback.call(subscription, event);
|
|
95541
|
-
if (isPromiseLike(returnVal)) {
|
|
95421
|
+
if (isPromiseLike$1(returnVal)) {
|
|
95542
95422
|
promises.push(returnVal);
|
|
95543
95423
|
}
|
|
95544
95424
|
});
|
|
95545
95425
|
if (promises.length > 0) {
|
|
95546
95426
|
return Promise.all(promises).then(() => void 0);
|
|
95547
95427
|
}
|
|
95548
|
-
return resolvedPromiseLike(void 0);
|
|
95428
|
+
return resolvedPromiseLike$1(void 0);
|
|
95549
95429
|
}
|
|
95550
95430
|
getSubscriptions(event) {
|
|
95551
95431
|
const eventTypeSubscriptions = this.subscriptions.get(event.type);
|
|
@@ -95566,7 +95446,7 @@ class DefaultPubSubService {
|
|
|
95566
95446
|
return matchingSubscriptions;
|
|
95567
95447
|
}
|
|
95568
95448
|
}
|
|
95569
|
-
function buildServiceDescriptor$
|
|
95449
|
+
function buildServiceDescriptor$2() {
|
|
95570
95450
|
return {
|
|
95571
95451
|
type: "pubSub",
|
|
95572
95452
|
version: "1.0",
|
|
@@ -95579,7 +95459,7 @@ function buildServiceDescriptor$1() {
|
|
|
95579
95459
|
* All rights reserved.
|
|
95580
95460
|
* For full license text, see the LICENSE.txt file
|
|
95581
95461
|
*/
|
|
95582
|
-
function buildServiceDescriptor(interceptors = { request: [], response: [] }) {
|
|
95462
|
+
function buildServiceDescriptor$1(interceptors = { request: [], response: [] }) {
|
|
95583
95463
|
return {
|
|
95584
95464
|
type: "fetch",
|
|
95585
95465
|
version: "1.0",
|
|
@@ -95613,7 +95493,7 @@ function buildNimbusFetchServiceDescriptor() {
|
|
|
95613
95493
|
});
|
|
95614
95494
|
};
|
|
95615
95495
|
return {
|
|
95616
|
-
...buildServiceDescriptor(),
|
|
95496
|
+
...buildServiceDescriptor$1(),
|
|
95617
95497
|
service: service,
|
|
95618
95498
|
};
|
|
95619
95499
|
}
|
|
@@ -95662,31 +95542,550 @@ function convertFetchParamsToResourceRequest([input, init]) {
|
|
|
95662
95542
|
};
|
|
95663
95543
|
}
|
|
95664
95544
|
|
|
95545
|
+
/*!
|
|
95546
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
95547
|
+
* All rights reserved.
|
|
95548
|
+
* For full license text, see the LICENSE.txt file
|
|
95549
|
+
*/
|
|
95550
|
+
class CacheInclusionPolicyService {
|
|
95551
|
+
}
|
|
95552
|
+
function setDifference(setA, setB) {
|
|
95553
|
+
const differenceSet = /* @__PURE__ */ new Set();
|
|
95554
|
+
for (const element of setA) {
|
|
95555
|
+
if (!setB.has(element)) {
|
|
95556
|
+
differenceSet.add(element);
|
|
95557
|
+
}
|
|
95558
|
+
}
|
|
95559
|
+
return differenceSet;
|
|
95560
|
+
}
|
|
95561
|
+
function resolvedPromiseLike(result) {
|
|
95562
|
+
if (isPromiseLike(result)) {
|
|
95563
|
+
return result.then((nextResult) => nextResult);
|
|
95564
|
+
}
|
|
95565
|
+
return {
|
|
95566
|
+
then: (onFulfilled, _onRejected) => {
|
|
95567
|
+
try {
|
|
95568
|
+
return resolvedPromiseLike(onFulfilled(result));
|
|
95569
|
+
} catch (e) {
|
|
95570
|
+
if (onFulfilled === void 0) {
|
|
95571
|
+
return resolvedPromiseLike(result);
|
|
95572
|
+
}
|
|
95573
|
+
return rejectedPromiseLike(e);
|
|
95574
|
+
}
|
|
95575
|
+
}
|
|
95576
|
+
};
|
|
95577
|
+
}
|
|
95578
|
+
function rejectedPromiseLike(reason) {
|
|
95579
|
+
if (isPromiseLike(reason)) {
|
|
95580
|
+
return reason.then((nextResult) => nextResult);
|
|
95581
|
+
}
|
|
95582
|
+
return {
|
|
95583
|
+
then: (_onFulfilled, onRejected) => {
|
|
95584
|
+
if (typeof onRejected === "function") {
|
|
95585
|
+
try {
|
|
95586
|
+
return resolvedPromiseLike(onRejected(reason));
|
|
95587
|
+
} catch (e) {
|
|
95588
|
+
return rejectedPromiseLike(e);
|
|
95589
|
+
}
|
|
95590
|
+
}
|
|
95591
|
+
return rejectedPromiseLike(reason);
|
|
95592
|
+
}
|
|
95593
|
+
};
|
|
95594
|
+
}
|
|
95595
|
+
function isPromiseLike(x) {
|
|
95596
|
+
return typeof (x == null ? void 0 : x.then) === "function";
|
|
95597
|
+
}
|
|
95598
|
+
/*!
|
|
95599
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
95600
|
+
* All rights reserved.
|
|
95601
|
+
* For full license text, see the LICENSE.txt file
|
|
95602
|
+
*/
|
|
95603
|
+
/*!
|
|
95604
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
95605
|
+
* All rights reserved.
|
|
95606
|
+
* For full license text, see the LICENSE.txt file
|
|
95607
|
+
*/
|
|
95608
|
+
const { stringify: stringify$8, parse: parse$8 } = JSON;
|
|
95609
|
+
function deepCopy(x) {
|
|
95610
|
+
const stringified = stringify$8(x);
|
|
95611
|
+
return stringified ? parse$8(stringified) : void 0;
|
|
95612
|
+
}
|
|
95613
|
+
class DefaultRecordableCache {
|
|
95614
|
+
constructor(baseCache) {
|
|
95615
|
+
this.baseCache = baseCache;
|
|
95616
|
+
this.keysRead = /* @__PURE__ */ new Set();
|
|
95617
|
+
this.missingKeysRead = /* @__PURE__ */ new Set();
|
|
95618
|
+
this.keysUpdated = /* @__PURE__ */ new Set();
|
|
95619
|
+
this.metadataKeysUpdated = /* @__PURE__ */ new Set();
|
|
95620
|
+
}
|
|
95621
|
+
delete(key) {
|
|
95622
|
+
this.keysUpdated.add(key);
|
|
95623
|
+
this.baseCache.delete(key);
|
|
95624
|
+
}
|
|
95625
|
+
get(key, options) {
|
|
95626
|
+
this.keysRead.add(key);
|
|
95627
|
+
const value = this.baseCache.get(key);
|
|
95628
|
+
if (value === void 0) {
|
|
95629
|
+
this.missingKeysRead.add(key);
|
|
95630
|
+
}
|
|
95631
|
+
if (options == null ? void 0 : options.copy) {
|
|
95632
|
+
return deepCopy(value);
|
|
95633
|
+
}
|
|
95634
|
+
return value;
|
|
95635
|
+
}
|
|
95636
|
+
set(key, value) {
|
|
95637
|
+
this.keysUpdated.add(key);
|
|
95638
|
+
this.metadataKeysUpdated.add(key);
|
|
95639
|
+
this.baseCache.set(key, value);
|
|
95640
|
+
}
|
|
95641
|
+
setMetadata(key, cacheControlMetadata) {
|
|
95642
|
+
this.metadataKeysUpdated.add(key);
|
|
95643
|
+
this.baseCache.setMetadata(key, cacheControlMetadata);
|
|
95644
|
+
}
|
|
95645
|
+
length() {
|
|
95646
|
+
return this.baseCache.length();
|
|
95647
|
+
}
|
|
95648
|
+
keys() {
|
|
95649
|
+
return this.baseCache.keys();
|
|
95650
|
+
}
|
|
95651
|
+
entries() {
|
|
95652
|
+
return this.baseCache.entries();
|
|
95653
|
+
}
|
|
95654
|
+
record() {
|
|
95655
|
+
return new DefaultRecordableCache(this);
|
|
95656
|
+
}
|
|
95657
|
+
filter(predicate) {
|
|
95658
|
+
return new DefaultFilteredCache(this, predicate);
|
|
95659
|
+
}
|
|
95660
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
95661
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
95662
|
+
}
|
|
95663
|
+
}
|
|
95664
|
+
class DefaultFilteredCache {
|
|
95665
|
+
constructor(baseCache, predicate) {
|
|
95666
|
+
this.baseCache = baseCache;
|
|
95667
|
+
this.predicate = predicate;
|
|
95668
|
+
}
|
|
95669
|
+
delete(key) {
|
|
95670
|
+
this.baseCache.delete(key);
|
|
95671
|
+
}
|
|
95672
|
+
get(key, options) {
|
|
95673
|
+
const result = this.baseCache.get(key);
|
|
95674
|
+
if (result && this.predicate(key, result)) {
|
|
95675
|
+
if (options == null ? void 0 : options.copy) {
|
|
95676
|
+
return deepCopy(result);
|
|
95677
|
+
}
|
|
95678
|
+
return result;
|
|
95679
|
+
}
|
|
95680
|
+
return void 0;
|
|
95681
|
+
}
|
|
95682
|
+
set(key, value) {
|
|
95683
|
+
this.baseCache.set(key, value);
|
|
95684
|
+
}
|
|
95685
|
+
setMetadata(key, cacheControlMetadata) {
|
|
95686
|
+
this.baseCache.setMetadata(key, cacheControlMetadata);
|
|
95687
|
+
}
|
|
95688
|
+
length() {
|
|
95689
|
+
return this.getFilteredKeys().size;
|
|
95690
|
+
}
|
|
95691
|
+
keys() {
|
|
95692
|
+
return this.getFilteredKeys();
|
|
95693
|
+
}
|
|
95694
|
+
entries() {
|
|
95695
|
+
return this.getFilteredEntries();
|
|
95696
|
+
}
|
|
95697
|
+
record() {
|
|
95698
|
+
return new DefaultRecordableCache(this);
|
|
95699
|
+
}
|
|
95700
|
+
filter(predicate) {
|
|
95701
|
+
return new DefaultFilteredCache(this, predicate);
|
|
95702
|
+
}
|
|
95703
|
+
getFilteredEntries() {
|
|
95704
|
+
return this.baseCache.entries().filter(([key, _value]) => {
|
|
95705
|
+
return this.get(key);
|
|
95706
|
+
});
|
|
95707
|
+
}
|
|
95708
|
+
getFilteredKeys() {
|
|
95709
|
+
const filteredKeySet = /* @__PURE__ */ new Set();
|
|
95710
|
+
this.baseCache.keys().forEach((key) => {
|
|
95711
|
+
if (this.get(key)) {
|
|
95712
|
+
filteredKeySet.add(key);
|
|
95713
|
+
}
|
|
95714
|
+
});
|
|
95715
|
+
return filteredKeySet;
|
|
95716
|
+
}
|
|
95717
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
95718
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
95719
|
+
}
|
|
95720
|
+
}
|
|
95721
|
+
class FixedTimeWritableCache {
|
|
95722
|
+
constructor(baseCache, generatedTime) {
|
|
95723
|
+
this.baseCache = baseCache;
|
|
95724
|
+
this.generatedTime = generatedTime;
|
|
95725
|
+
}
|
|
95726
|
+
delete(key) {
|
|
95727
|
+
this.baseCache.delete(key);
|
|
95728
|
+
}
|
|
95729
|
+
get(key, options) {
|
|
95730
|
+
return this.baseCache.get(key, options);
|
|
95731
|
+
}
|
|
95732
|
+
set(key, value) {
|
|
95733
|
+
this.baseCache.set(key, {
|
|
95734
|
+
...value,
|
|
95735
|
+
metadata: {
|
|
95736
|
+
...value.metadata,
|
|
95737
|
+
cacheControl: { ...value.metadata.cacheControl, generatedTime: this.generatedTime }
|
|
95738
|
+
}
|
|
95739
|
+
});
|
|
95740
|
+
}
|
|
95741
|
+
setMetadata(key, cacheControlMetadata) {
|
|
95742
|
+
this.baseCache.setMetadata(key, {
|
|
95743
|
+
...cacheControlMetadata,
|
|
95744
|
+
generatedTime: this.generatedTime
|
|
95745
|
+
});
|
|
95746
|
+
}
|
|
95747
|
+
length() {
|
|
95748
|
+
return this.baseCache.length();
|
|
95749
|
+
}
|
|
95750
|
+
keys() {
|
|
95751
|
+
return this.baseCache.keys();
|
|
95752
|
+
}
|
|
95753
|
+
entries() {
|
|
95754
|
+
return this.baseCache.entries();
|
|
95755
|
+
}
|
|
95756
|
+
record() {
|
|
95757
|
+
return new DefaultRecordableCache(this);
|
|
95758
|
+
}
|
|
95759
|
+
filter(predicate) {
|
|
95760
|
+
return new DefaultFilteredCache(this, predicate);
|
|
95761
|
+
}
|
|
95762
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
95763
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
95764
|
+
}
|
|
95765
|
+
}
|
|
95766
|
+
class DefaultCache {
|
|
95767
|
+
constructor() {
|
|
95768
|
+
this.data = {};
|
|
95769
|
+
}
|
|
95770
|
+
get(key, options) {
|
|
95771
|
+
if (options == null ? void 0 : options.copy) {
|
|
95772
|
+
return deepCopy(this.data[key]);
|
|
95773
|
+
}
|
|
95774
|
+
return this.data[key];
|
|
95775
|
+
}
|
|
95776
|
+
/**
|
|
95777
|
+
* Adds the specified key/value to the cache.
|
|
95778
|
+
*
|
|
95779
|
+
* @param key key at which to store value
|
|
95780
|
+
* @param entry value to be stored
|
|
95781
|
+
*/
|
|
95782
|
+
set(key, entry) {
|
|
95783
|
+
if (entry.metadata.cacheControl.type === "no-store") {
|
|
95784
|
+
return;
|
|
95785
|
+
}
|
|
95786
|
+
this.data[key] = {
|
|
95787
|
+
...entry,
|
|
95788
|
+
metadata: {
|
|
95789
|
+
...entry.metadata,
|
|
95790
|
+
type: entry.metadata.type || {
|
|
95791
|
+
namespace: "OneStore:Internal",
|
|
95792
|
+
name: "UnknownType"
|
|
95793
|
+
},
|
|
95794
|
+
cacheControl: {
|
|
95795
|
+
generatedTime: Date.now() / 1e3,
|
|
95796
|
+
...entry.metadata.cacheControl
|
|
95797
|
+
}
|
|
95798
|
+
}
|
|
95799
|
+
};
|
|
95800
|
+
}
|
|
95801
|
+
/**
|
|
95802
|
+
* Removes the cache entry associated with the specified key.
|
|
95803
|
+
*
|
|
95804
|
+
* @param key key to be removed from the store
|
|
95805
|
+
*/
|
|
95806
|
+
delete(key) {
|
|
95807
|
+
delete this.data[key];
|
|
95808
|
+
}
|
|
95809
|
+
/**
|
|
95810
|
+
* Sets the metadata for the specified key if the key is in cache.
|
|
95811
|
+
* If the key doesn't exist, it does nothing.
|
|
95812
|
+
*
|
|
95813
|
+
* @param key key at which to store metadata
|
|
95814
|
+
* @param cacheControlMetadata metadata to be stored
|
|
95815
|
+
*/
|
|
95816
|
+
setMetadata(key, cacheControlMetadata) {
|
|
95817
|
+
if (key in this.data) {
|
|
95818
|
+
this.data[key].metadata.cacheControl = {
|
|
95819
|
+
generatedTime: Date.now() / 1e3,
|
|
95820
|
+
...cacheControlMetadata
|
|
95821
|
+
};
|
|
95822
|
+
}
|
|
95823
|
+
}
|
|
95824
|
+
length() {
|
|
95825
|
+
return this.keys().size;
|
|
95826
|
+
}
|
|
95827
|
+
keys() {
|
|
95828
|
+
return new Set(Object.keys(this.data));
|
|
95829
|
+
}
|
|
95830
|
+
entries() {
|
|
95831
|
+
return Object.entries(this.data);
|
|
95832
|
+
}
|
|
95833
|
+
record() {
|
|
95834
|
+
return new DefaultRecordableCache(this);
|
|
95835
|
+
}
|
|
95836
|
+
filter(predicate) {
|
|
95837
|
+
return new DefaultFilteredCache(this, predicate);
|
|
95838
|
+
}
|
|
95839
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
95840
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
95841
|
+
}
|
|
95842
|
+
}
|
|
95843
|
+
function buildServiceDescriptor() {
|
|
95844
|
+
return {
|
|
95845
|
+
type: "cache",
|
|
95846
|
+
version: "1.0",
|
|
95847
|
+
service: new DefaultCache()
|
|
95848
|
+
};
|
|
95849
|
+
}
|
|
95850
|
+
class DurableCacheInclusionPolicy extends CacheInclusionPolicyService {
|
|
95851
|
+
/**
|
|
95852
|
+
* Reads data out of a 2 level inclusive store.
|
|
95853
|
+
*/
|
|
95854
|
+
read(options) {
|
|
95855
|
+
const { l1, readFromL1, alreadyRevivedKeys } = options;
|
|
95856
|
+
const recordableCache = l1.record();
|
|
95857
|
+
return readFromL1(recordableCache).then((readResult) => {
|
|
95858
|
+
if (readResult.isOk()) {
|
|
95859
|
+
return readResult;
|
|
95860
|
+
}
|
|
95861
|
+
const keysToRevive = recordableCache.keysRead;
|
|
95862
|
+
if (alreadyRevivedKeys && setDifference(keysToRevive, alreadyRevivedKeys).size === 0) {
|
|
95863
|
+
return readResult;
|
|
95864
|
+
}
|
|
95865
|
+
return this.revive(keysToRevive, l1).then((revivedKeys) => {
|
|
95866
|
+
if (setDifference(keysToRevive, revivedKeys).size > 0) {
|
|
95867
|
+
return readResult;
|
|
95868
|
+
}
|
|
95869
|
+
return this.read({ l1, readFromL1, alreadyRevivedKeys: revivedKeys });
|
|
95870
|
+
});
|
|
95871
|
+
});
|
|
95872
|
+
}
|
|
95873
|
+
/**
|
|
95874
|
+
* Writes data to a 2 level inclusive store.
|
|
95875
|
+
*/
|
|
95876
|
+
write(options) {
|
|
95877
|
+
const { l1, writeToL1 } = options;
|
|
95878
|
+
const tempL1 = buildServiceDescriptor().service.record();
|
|
95879
|
+
return writeToL1(tempL1).then(() => {
|
|
95880
|
+
const keysToReviveRecordableCache = l1.record();
|
|
95881
|
+
tempL1.keysUpdated.forEach((key) => keysToReviveRecordableCache.get(key));
|
|
95882
|
+
tempL1.missingKeysRead.forEach((key) => keysToReviveRecordableCache.get(key));
|
|
95883
|
+
const missingKeys = keysToReviveRecordableCache.missingKeysRead;
|
|
95884
|
+
const revivePromiseLike = missingKeys.size > 0 ? this.revive(missingKeys, l1).then(() => void 0) : resolvedPromiseLike(void 0);
|
|
95885
|
+
return revivePromiseLike.then(() => {
|
|
95886
|
+
const recordableCache = l1.record();
|
|
95887
|
+
return writeToL1(recordableCache).then((result) => {
|
|
95888
|
+
this.syncToL2Cache(recordableCache.keysUpdated, l1);
|
|
95889
|
+
return result;
|
|
95890
|
+
});
|
|
95891
|
+
});
|
|
95892
|
+
});
|
|
95893
|
+
}
|
|
95894
|
+
}
|
|
95895
|
+
|
|
95896
|
+
class NimbusDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
|
|
95897
|
+
constructor(services, store) {
|
|
95898
|
+
super();
|
|
95899
|
+
this.services = services;
|
|
95900
|
+
this.store = store;
|
|
95901
|
+
this.registerListener();
|
|
95902
|
+
}
|
|
95903
|
+
revive(keys, l1) {
|
|
95904
|
+
if (keys.size === 0)
|
|
95905
|
+
return Promise.resolve(new Set());
|
|
95906
|
+
return this.store.getEntries(keys).then((entries) => {
|
|
95907
|
+
const keysRevived = new Set();
|
|
95908
|
+
if (!entries)
|
|
95909
|
+
return keysRevived;
|
|
95910
|
+
entries.forEach(({ key, entry }) => {
|
|
95911
|
+
l1.set(key, entry);
|
|
95912
|
+
keysRevived.add(key);
|
|
95913
|
+
});
|
|
95914
|
+
return keysRevived;
|
|
95915
|
+
});
|
|
95916
|
+
}
|
|
95917
|
+
syncToL2Cache(changedKeys, l1) {
|
|
95918
|
+
if (changedKeys.size === 0)
|
|
95919
|
+
return Promise.resolve();
|
|
95920
|
+
const entries = [];
|
|
95921
|
+
for (const key of changedKeys) {
|
|
95922
|
+
const entry = l1.get(key);
|
|
95923
|
+
if (entry) {
|
|
95924
|
+
entries.push({ key, entry });
|
|
95925
|
+
}
|
|
95926
|
+
}
|
|
95927
|
+
return entries.length > 0 ? this.store.setEntries(entries) : Promise.resolve();
|
|
95928
|
+
}
|
|
95929
|
+
find(_query) {
|
|
95930
|
+
throw new Error('find not supported on the NimbusDurableCacheInclusionPolicy');
|
|
95931
|
+
}
|
|
95932
|
+
findAndModify(_query, _cacheUpdate) {
|
|
95933
|
+
throw new Error('findAndModify not supported on the NimbusDurableCacheInclusionPolicy');
|
|
95934
|
+
}
|
|
95935
|
+
registerListener() {
|
|
95936
|
+
this.store.registerOnChangedListener(async (changes) => {
|
|
95937
|
+
changes.forEach((change) => {
|
|
95938
|
+
const upsertKeys = new Set();
|
|
95939
|
+
const evictKeys = new Set();
|
|
95940
|
+
for (const key of change.keys) {
|
|
95941
|
+
if (change.type === 'upsert') {
|
|
95942
|
+
upsertKeys.add(key);
|
|
95943
|
+
}
|
|
95944
|
+
else {
|
|
95945
|
+
evictKeys.add(key);
|
|
95946
|
+
}
|
|
95947
|
+
}
|
|
95948
|
+
if (upsertKeys.size > 0) {
|
|
95949
|
+
this.store.getEntries(upsertKeys).then((entries) => {
|
|
95950
|
+
if (entries === undefined)
|
|
95951
|
+
return;
|
|
95952
|
+
entries.forEach(({ key, entry }) => {
|
|
95953
|
+
this.services.cache.set(key, entry);
|
|
95954
|
+
return resolvedPromiseLike$3(ok$1(undefined));
|
|
95955
|
+
});
|
|
95956
|
+
});
|
|
95957
|
+
}
|
|
95958
|
+
// TODO: onestore doesnt support cache eviction yet
|
|
95959
|
+
// if (evictKeys.size > 0) {
|
|
95960
|
+
// evictKeys.forEach((key) => {
|
|
95961
|
+
// this.services.cache.evict(key);
|
|
95962
|
+
// });
|
|
95963
|
+
// }
|
|
95964
|
+
});
|
|
95965
|
+
});
|
|
95966
|
+
}
|
|
95967
|
+
}
|
|
95968
|
+
function buildNimbusDurableCacheInclusionPolicyService(cache, store) {
|
|
95969
|
+
return {
|
|
95970
|
+
service: new NimbusDurableCacheInclusionPolicy({ cache }, store),
|
|
95971
|
+
type: 'cacheInclusionPolicy',
|
|
95972
|
+
version: '1.0',
|
|
95973
|
+
};
|
|
95974
|
+
}
|
|
95975
|
+
|
|
95976
|
+
const TABLE_NAME = 'lds_one_store_data';
|
|
95977
|
+
class NimbusSqliteOneStoreCache {
|
|
95978
|
+
constructor(sqlStore) {
|
|
95979
|
+
this.sqlStore = sqlStore;
|
|
95980
|
+
}
|
|
95981
|
+
async getEntry(key) {
|
|
95982
|
+
const result = await this.query(`SELECT key, data, metadata FROM ${TABLE_NAME} WHERE key = ?`, [key]);
|
|
95983
|
+
if (result.rows.length === 0)
|
|
95984
|
+
return undefined;
|
|
95985
|
+
const [_key, data, metadata] = result.rows[0];
|
|
95986
|
+
return {
|
|
95987
|
+
key,
|
|
95988
|
+
entry: {
|
|
95989
|
+
value: JSON.parse(data),
|
|
95990
|
+
metadata: metadata ? JSON.parse(metadata) : undefined,
|
|
95991
|
+
},
|
|
95992
|
+
};
|
|
95993
|
+
}
|
|
95994
|
+
async getEntries(keys) {
|
|
95995
|
+
if (keys.size === 0)
|
|
95996
|
+
return undefined;
|
|
95997
|
+
const placeholders = Array(keys.size).fill('?').join(', ');
|
|
95998
|
+
const result = await this.query(`SELECT key, data, metadata FROM ${TABLE_NAME} WHERE key IN (${placeholders})`, [...keys]);
|
|
95999
|
+
if (result.rows.length === 0)
|
|
96000
|
+
return undefined;
|
|
96001
|
+
return result.rows.map((row) => {
|
|
96002
|
+
const [key, data, metadata] = row;
|
|
96003
|
+
return {
|
|
96004
|
+
key: key,
|
|
96005
|
+
entry: {
|
|
96006
|
+
value: JSON.parse(data),
|
|
96007
|
+
metadata: metadata ? JSON.parse(metadata) : undefined,
|
|
96008
|
+
},
|
|
96009
|
+
};
|
|
96010
|
+
});
|
|
96011
|
+
}
|
|
96012
|
+
async setEntry(key, entry) {
|
|
96013
|
+
return this.setEntries([{ key, entry }]);
|
|
96014
|
+
}
|
|
96015
|
+
async setEntries(entries) {
|
|
96016
|
+
if (entries.length === 0)
|
|
96017
|
+
return;
|
|
96018
|
+
const rows = entries.map(({ key, entry: { value, metadata } }) => [
|
|
96019
|
+
key,
|
|
96020
|
+
JSON.stringify(value),
|
|
96021
|
+
JSON.stringify(metadata),
|
|
96022
|
+
]);
|
|
96023
|
+
const operation = {
|
|
96024
|
+
type: 'upsert',
|
|
96025
|
+
table: TABLE_NAME,
|
|
96026
|
+
keyColumn: 'key',
|
|
96027
|
+
conflictColumns: ['key'],
|
|
96028
|
+
columns: ['key', 'data', 'metadata'],
|
|
96029
|
+
rows,
|
|
96030
|
+
context: {},
|
|
96031
|
+
};
|
|
96032
|
+
return this.batchQuery([operation]);
|
|
96033
|
+
}
|
|
96034
|
+
registerOnChangedListener(listener) {
|
|
96035
|
+
let unsubscribeId = undefined;
|
|
96036
|
+
this.sqlStore
|
|
96037
|
+
.registerOnChangedListener((changes) => {
|
|
96038
|
+
const onestoreChanges = changes.filter((change) => change.table === TABLE_NAME);
|
|
96039
|
+
return listener(onestoreChanges);
|
|
96040
|
+
})
|
|
96041
|
+
.then((id) => {
|
|
96042
|
+
unsubscribeId = id;
|
|
96043
|
+
});
|
|
96044
|
+
return () => {
|
|
96045
|
+
if (unsubscribeId === undefined)
|
|
96046
|
+
return Promise.resolve();
|
|
96047
|
+
return this.sqlStore.unsubscribeOnChangedListener(unsubscribeId);
|
|
96048
|
+
};
|
|
96049
|
+
}
|
|
96050
|
+
batchQuery(operations) {
|
|
96051
|
+
return new Promise((resolve, reject) => {
|
|
96052
|
+
this.sqlStore.batchOperations(operations, (error) => {
|
|
96053
|
+
error ? reject(error) : resolve();
|
|
96054
|
+
});
|
|
96055
|
+
});
|
|
96056
|
+
}
|
|
96057
|
+
query(sql, params) {
|
|
96058
|
+
return new Promise((resolve, reject) => {
|
|
96059
|
+
this.sqlStore.query(sql, params, resolve, reject);
|
|
96060
|
+
});
|
|
96061
|
+
}
|
|
96062
|
+
}
|
|
96063
|
+
|
|
95665
96064
|
// TODO[@W-18753648]: These services depend on WebApis that aren't available in the worker.
|
|
95666
96065
|
// import { buildServiceDescriptor as buildNdJsonServiceDescriptor } from '@luvio/command-ndjson/v1';
|
|
95667
96066
|
// import { buildServiceDescriptor as buildStreamingCommandServiceDescriptor } from '@luvio/command-streaming/v1';
|
|
95668
96067
|
// import { buildServiceDescriptor as buildSseCommandServiceDescriptor } from '@luvio/command-sse/v1';
|
|
95669
|
-
function initializeOneStore() {
|
|
96068
|
+
function initializeOneStore(sqliteStore) {
|
|
95670
96069
|
if (!useOneStore.isOpen({ fallback: true })) {
|
|
95671
96070
|
return;
|
|
95672
96071
|
}
|
|
95673
96072
|
const loggerService = new ConsoleLogger('ERROR');
|
|
95674
|
-
const cacheServiceDescriptor = buildServiceDescriptor$
|
|
95675
|
-
const instrumentationServiceDescriptor = buildServiceDescriptor$
|
|
95676
|
-
const
|
|
96073
|
+
const cacheServiceDescriptor = buildServiceDescriptor$6();
|
|
96074
|
+
const instrumentationServiceDescriptor = buildServiceDescriptor$3(loggerService);
|
|
96075
|
+
const nimbusSqliteOneStoreCacheServiceDescriptor = buildNimbusDurableCacheInclusionPolicyService(cacheServiceDescriptor.service, new NimbusSqliteOneStoreCache(sqliteStore));
|
|
95677
96076
|
const services = [
|
|
95678
96077
|
instrumentationServiceDescriptor,
|
|
95679
96078
|
buildNimbusFetchServiceDescriptor(),
|
|
95680
|
-
buildServiceDescriptor$
|
|
96079
|
+
buildServiceDescriptor$4(instrumentationServiceDescriptor.service),
|
|
95681
96080
|
// NOTE: These do not directly depend on Aura, and are necessary for HTTP fallback support.
|
|
96081
|
+
buildServiceDescriptor$b(),
|
|
95682
96082
|
buildServiceDescriptor$a(),
|
|
95683
96083
|
buildServiceDescriptor$9(),
|
|
96084
|
+
buildServiceDescriptor$5(cacheServiceDescriptor.service, nimbusSqliteOneStoreCacheServiceDescriptor.service),
|
|
95684
96085
|
buildServiceDescriptor$8(),
|
|
95685
|
-
buildServiceDescriptor$
|
|
96086
|
+
buildServiceDescriptor$c(),
|
|
95686
96087
|
buildServiceDescriptor$7(),
|
|
95687
|
-
buildServiceDescriptor$
|
|
95688
|
-
buildServiceDescriptor$6(),
|
|
95689
|
-
buildServiceDescriptor$1(),
|
|
96088
|
+
buildServiceDescriptor$2(),
|
|
95690
96089
|
// TODO[@W-18753648]: See note above.
|
|
95691
96090
|
// buildStreamingCommandServiceDescriptor(),
|
|
95692
96091
|
// buildNdJsonServiceDescriptor(),
|
|
@@ -95865,7 +96264,7 @@ function getRuntime({ primeUser = false } = {}) {
|
|
|
95865
96264
|
withRegistration('@salesforce/lds-adapters-uiapi/graphql', configureUIAPIGraphQL);
|
|
95866
96265
|
}
|
|
95867
96266
|
// onestore initialization
|
|
95868
|
-
initializeOneStore();
|
|
96267
|
+
initializeOneStore(lazyDurableStore['plugin']);
|
|
95869
96268
|
return {
|
|
95870
96269
|
luvio: lazyLuvio,
|
|
95871
96270
|
internalLuvio: lazyInternalLuvio,
|
|
@@ -95897,7 +96296,7 @@ register$1({
|
|
|
95897
96296
|
id: '@salesforce/lds-network-adapter',
|
|
95898
96297
|
instrument: instrument$2,
|
|
95899
96298
|
});
|
|
95900
|
-
// version: 1.
|
|
96299
|
+
// version: 1.370.0-3ec6ffba72
|
|
95901
96300
|
|
|
95902
96301
|
const { create: create$2, keys: keys$2 } = Object;
|
|
95903
96302
|
const { stringify, parse } = JSON;
|
|
@@ -96551,6 +96950,267 @@ function buildAdapterValidationConfig$1(displayName, paramsMeta) {
|
|
|
96551
96950
|
}
|
|
96552
96951
|
const keyPrefix$1 = 'UiApi';
|
|
96553
96952
|
|
|
96953
|
+
/**
|
|
96954
|
+
* Defines configuration for the module with a default value which can be overridden by the runtime environment.
|
|
96955
|
+
*/
|
|
96956
|
+
// A holder for a configurable adapter override
|
|
96957
|
+
let Configurable$1 = class Configurable {
|
|
96958
|
+
constructor() {
|
|
96959
|
+
this.getAdapter = () => {
|
|
96960
|
+
return this.adapter;
|
|
96961
|
+
};
|
|
96962
|
+
this.setAdapter = (value) => {
|
|
96963
|
+
this.adapter = value;
|
|
96964
|
+
};
|
|
96965
|
+
this.adapter = undefined;
|
|
96966
|
+
}
|
|
96967
|
+
};
|
|
96968
|
+
// Configurable adapters that can have environmental overrides
|
|
96969
|
+
let configurableCreateRecordAdapter$1 = new Configurable$1();
|
|
96970
|
+
let configurableUpdateRecordAdapter$1 = new Configurable$1();
|
|
96971
|
+
let configurableDeleteRecordAdapter$1 = new Configurable$1();
|
|
96972
|
+
let configurablePerformQuickActionAdapter$1 = new Configurable$1();
|
|
96973
|
+
let configurablePerformUpdateRecordQuickActionAdapter$1 = new Configurable$1();
|
|
96974
|
+
let configurableCreateContentDocumentAndVersion$1 = new Configurable$1();
|
|
96975
|
+
let configurableCreateContentVersion$1 = new Configurable$1();
|
|
96976
|
+
/**
|
|
96977
|
+
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
96978
|
+
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
96979
|
+
* be reached by following 1 relationship from the root record, etc.
|
|
96980
|
+
* @defaultValue '5', replicates the current behavior
|
|
96981
|
+
*/
|
|
96982
|
+
let trackedFieldDepthOnCacheMiss$1 = 5;
|
|
96983
|
+
/**
|
|
96984
|
+
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
96985
|
+
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
96986
|
+
* be reached by following 1 relationship from the root record, etc.
|
|
96987
|
+
* @defaultValue '5', replicates the current behavior
|
|
96988
|
+
*/
|
|
96989
|
+
let trackedFieldDepthOnCacheMergeConflict$1 = 5;
|
|
96990
|
+
/**
|
|
96991
|
+
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
96992
|
+
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
96993
|
+
* be reached by following 1 relationship from the root record, etc.
|
|
96994
|
+
* @defaultValue '5', replicates the current behavior
|
|
96995
|
+
*/
|
|
96996
|
+
let trackedFieldDepthOnNotifyChange$1 = 5;
|
|
96997
|
+
/**
|
|
96998
|
+
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
96999
|
+
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
97000
|
+
*/
|
|
97001
|
+
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
97002
|
+
/**
|
|
97003
|
+
* One store enabled Get Object Info adapter
|
|
97004
|
+
*/
|
|
97005
|
+
let oneStoreGetObjectInfoAdapter$1 = undefined;
|
|
97006
|
+
/**
|
|
97007
|
+
* One store enabled Get Object Infos adapter
|
|
97008
|
+
*/
|
|
97009
|
+
let oneStoreGetObjectInfosAdapter$1 = undefined;
|
|
97010
|
+
/**
|
|
97011
|
+
* One store enabled GraphQL adapter
|
|
97012
|
+
*/
|
|
97013
|
+
let oneStoreGraphQLWireAdapter$1 = undefined;
|
|
97014
|
+
/**
|
|
97015
|
+
* One store enabled GraphQL imperative query adapter
|
|
97016
|
+
*/
|
|
97017
|
+
let oneStoreGraphQLImperativeQueryAdapter$1 = undefined;
|
|
97018
|
+
/**
|
|
97019
|
+
* Determines when to include PDL strategies for Related Lists
|
|
97020
|
+
*/
|
|
97021
|
+
let relatedListsPredictionsEnabled$1 = false;
|
|
97022
|
+
/**
|
|
97023
|
+
* Determines whether to include additional PDL strategies for Related Lists
|
|
97024
|
+
*/
|
|
97025
|
+
let relatedListsPlusPredictionsEnabled$1 = false;
|
|
97026
|
+
let recordRepresentationIngestionOverride$1 = undefined;
|
|
97027
|
+
/**
|
|
97028
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
97029
|
+
* Configuration for one store enabled REST adapters only.
|
|
97030
|
+
*/
|
|
97031
|
+
const configurationForOneStoreEnabledAdapters$1 = {
|
|
97032
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
97033
|
+
oneStoreGetObjectInfoAdapter$1 = adapter;
|
|
97034
|
+
},
|
|
97035
|
+
getGetObjectInfoAdapter: function () {
|
|
97036
|
+
return oneStoreGetObjectInfoAdapter$1;
|
|
97037
|
+
},
|
|
97038
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
97039
|
+
oneStoreGetObjectInfosAdapter$1 = adapter;
|
|
97040
|
+
},
|
|
97041
|
+
getGetObjectInfosAdapter: function () {
|
|
97042
|
+
return oneStoreGetObjectInfosAdapter$1;
|
|
97043
|
+
},
|
|
97044
|
+
setGraphQLWireAdapter: function (adapter) {
|
|
97045
|
+
oneStoreGraphQLWireAdapter$1 = adapter;
|
|
97046
|
+
},
|
|
97047
|
+
getGraphQLWireAdapter: function () {
|
|
97048
|
+
return oneStoreGraphQLWireAdapter$1;
|
|
97049
|
+
},
|
|
97050
|
+
setGraphQLImperativeQueryAdapter: function (adapter) {
|
|
97051
|
+
oneStoreGraphQLImperativeQueryAdapter$1 = adapter;
|
|
97052
|
+
},
|
|
97053
|
+
getGraphQLImperativeQueryAdapter: function () {
|
|
97054
|
+
return oneStoreGraphQLImperativeQueryAdapter$1;
|
|
97055
|
+
},
|
|
97056
|
+
};
|
|
97057
|
+
/**
|
|
97058
|
+
* Helper function to return the one store adapter if it's defined, otherwise return the luvio adapter.
|
|
97059
|
+
* @param luvioAdapter - The luvio bound adapter.
|
|
97060
|
+
* @param oneStoreAdapter - The one store bound adapter.
|
|
97061
|
+
* @returns Luvio or one store wire adapter constructor.
|
|
97062
|
+
*/
|
|
97063
|
+
function getLuvioOrOneStoreAdapter(luvioAdapter, oneStoreAdapter) {
|
|
97064
|
+
return oneStoreAdapter ?? luvioAdapter;
|
|
97065
|
+
}
|
|
97066
|
+
const getKeywordSearchResultsFactory$1 = new Configurable$1();
|
|
97067
|
+
const getListRecordsByNameFactory$1 = new Configurable$1();
|
|
97068
|
+
const getListUiFactory$1 = new Configurable$1();
|
|
97069
|
+
const getLookupRecordsFactory$1 = new Configurable$1();
|
|
97070
|
+
const getQuickActionDefaultsFactory$1 = new Configurable$1();
|
|
97071
|
+
const getRecordCreateDefaultsFactory$1 = new Configurable$1();
|
|
97072
|
+
const getRecordTemplateCloneFactory$1 = new Configurable$1();
|
|
97073
|
+
const getRecordTemplateCreateFactory$1 = new Configurable$1();
|
|
97074
|
+
const getRecordUiFactory$1 = new Configurable$1();
|
|
97075
|
+
const getRecordFactory$1 = new Configurable$1();
|
|
97076
|
+
const getRecordsFactory$1 = new Configurable$1();
|
|
97077
|
+
const getRelatedListRecordsFactory$1 = new Configurable$1();
|
|
97078
|
+
const getRelatedListRecordsBatchFactory$1 = new Configurable$1();
|
|
97079
|
+
const getSearchResultsFactory$1 = new Configurable$1();
|
|
97080
|
+
// The following set of adapters all touch RecordRepresentation directly or indirectly,
|
|
97081
|
+
// so they need to support having a custom factory provided by the mobile environment.
|
|
97082
|
+
const configurationForEnvironmentFactoryOverrides$1 = {
|
|
97083
|
+
getKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory$1.getAdapter,
|
|
97084
|
+
setGetKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory$1.setAdapter,
|
|
97085
|
+
getListRecordsByNameAdapterFactory: getListRecordsByNameFactory$1.getAdapter,
|
|
97086
|
+
setGetListRecordsByNameAdapterFactory: getListRecordsByNameFactory$1.setAdapter,
|
|
97087
|
+
getListUiAdapterFactory: getListUiFactory$1.getAdapter,
|
|
97088
|
+
setGetListUiAdapterFactory: getListUiFactory$1.setAdapter,
|
|
97089
|
+
getLookupRecordsAdapterFactory: getLookupRecordsFactory$1.getAdapter,
|
|
97090
|
+
setGetLookupRecordsAdapterFactory: getLookupRecordsFactory$1.setAdapter,
|
|
97091
|
+
getQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory$1.getAdapter,
|
|
97092
|
+
setGetQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory$1.setAdapter,
|
|
97093
|
+
getRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory$1.getAdapter,
|
|
97094
|
+
setGetRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory$1.setAdapter,
|
|
97095
|
+
getRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory$1.getAdapter,
|
|
97096
|
+
setGetRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory$1.setAdapter,
|
|
97097
|
+
getRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory$1.getAdapter,
|
|
97098
|
+
setGetRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory$1.setAdapter,
|
|
97099
|
+
getRecordUiAdapterFactory: getRecordUiFactory$1.getAdapter,
|
|
97100
|
+
setGetRecordUiAdapterFactory: getRecordUiFactory$1.setAdapter,
|
|
97101
|
+
getRecordAdapterFactory: getRecordFactory$1.getAdapter,
|
|
97102
|
+
setGetRecordAdapterFactory: getRecordFactory$1.setAdapter,
|
|
97103
|
+
getRecordsAdapterFactory: getRecordsFactory$1.getAdapter,
|
|
97104
|
+
setGetRecordsAdapterFactory: getRecordsFactory$1.setAdapter,
|
|
97105
|
+
getRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory$1.getAdapter,
|
|
97106
|
+
setGetRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory$1.setAdapter,
|
|
97107
|
+
getRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory$1.getAdapter,
|
|
97108
|
+
setGetRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory$1.setAdapter,
|
|
97109
|
+
getSearchResultsAdapterFactory: getSearchResultsFactory$1.getAdapter,
|
|
97110
|
+
setGetSearchResultsAdapterFactory: getSearchResultsFactory$1.setAdapter,
|
|
97111
|
+
};
|
|
97112
|
+
/**
|
|
97113
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
97114
|
+
* Configuration for REST adapters only.
|
|
97115
|
+
*/
|
|
97116
|
+
const configurationForRestAdapters$1 = {
|
|
97117
|
+
setTrackedFieldDepthOnCacheMiss: function (trackedFieldDepthOnCacheMissParam) {
|
|
97118
|
+
trackedFieldDepthOnCacheMiss$1 = trackedFieldDepthOnCacheMissParam;
|
|
97119
|
+
},
|
|
97120
|
+
getTrackedFieldDepthOnCacheMiss: function () {
|
|
97121
|
+
return trackedFieldDepthOnCacheMiss$1;
|
|
97122
|
+
},
|
|
97123
|
+
setTrackedFieldDepthOnCacheMergeConflict: function (trackedFieldDepthOnCacheMergeConflictParam) {
|
|
97124
|
+
trackedFieldDepthOnCacheMergeConflict$1 = trackedFieldDepthOnCacheMergeConflictParam;
|
|
97125
|
+
},
|
|
97126
|
+
getTrackedFieldDepthOnCacheMergeConflict: function () {
|
|
97127
|
+
return trackedFieldDepthOnCacheMergeConflict$1;
|
|
97128
|
+
},
|
|
97129
|
+
setTrackedFieldDepthOnNotifyChange: function (trackedFieldDepthOnNotifyChangeParam) {
|
|
97130
|
+
trackedFieldDepthOnNotifyChange$1 = trackedFieldDepthOnNotifyChangeParam;
|
|
97131
|
+
},
|
|
97132
|
+
getTrackedFieldDepthOnNotifyChange: function () {
|
|
97133
|
+
return trackedFieldDepthOnNotifyChange$1;
|
|
97134
|
+
},
|
|
97135
|
+
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
97136
|
+
trackedFieldLeafNodeIdAndNameOnly$1 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
97137
|
+
},
|
|
97138
|
+
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
97139
|
+
return trackedFieldLeafNodeIdAndNameOnly$1;
|
|
97140
|
+
},
|
|
97141
|
+
setRelatedListsPredictionsEnabled: function (f) {
|
|
97142
|
+
relatedListsPredictionsEnabled$1 = f;
|
|
97143
|
+
},
|
|
97144
|
+
areRelatedListsPredictionsEnabled: function () {
|
|
97145
|
+
return relatedListsPredictionsEnabled$1 === true;
|
|
97146
|
+
},
|
|
97147
|
+
setRelatedListsPlusPredictionsEnabled: function (f) {
|
|
97148
|
+
relatedListsPlusPredictionsEnabled$1 = f;
|
|
97149
|
+
},
|
|
97150
|
+
areRelatedListsPlusPredictionsEnabled: function () {
|
|
97151
|
+
return relatedListsPlusPredictionsEnabled$1 === true;
|
|
97152
|
+
},
|
|
97153
|
+
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
97154
|
+
recordRepresentationIngestionOverride$1 = ingest;
|
|
97155
|
+
},
|
|
97156
|
+
getRecordRepresentationIngestionOverride: function () {
|
|
97157
|
+
return recordRepresentationIngestionOverride$1;
|
|
97158
|
+
},
|
|
97159
|
+
// createRecord
|
|
97160
|
+
getDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter$1.getAdapter,
|
|
97161
|
+
setDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter$1.setAdapter,
|
|
97162
|
+
// updateRecord
|
|
97163
|
+
getDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter$1.getAdapter,
|
|
97164
|
+
setDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter$1.setAdapter,
|
|
97165
|
+
// deleteRecord
|
|
97166
|
+
getDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter$1.getAdapter,
|
|
97167
|
+
setDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter$1.setAdapter,
|
|
97168
|
+
// performQuickAction
|
|
97169
|
+
getDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter$1.getAdapter,
|
|
97170
|
+
setDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter$1.setAdapter,
|
|
97171
|
+
// performRecordUpdateQuickAction
|
|
97172
|
+
getDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter$1.getAdapter,
|
|
97173
|
+
setDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter$1.setAdapter,
|
|
97174
|
+
// createContentDocumentAndVersion
|
|
97175
|
+
getDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion$1.getAdapter,
|
|
97176
|
+
setDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion$1.setAdapter,
|
|
97177
|
+
// createContentVersion
|
|
97178
|
+
getDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion$1.getAdapter,
|
|
97179
|
+
setDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion$1.setAdapter,
|
|
97180
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
97181
|
+
...configurationForEnvironmentFactoryOverrides$1,
|
|
97182
|
+
};
|
|
97183
|
+
let configurableGraphQLAdapter$1 = new Configurable$1();
|
|
97184
|
+
let configurableGraphQLBatchAdapter$1 = new Configurable$1();
|
|
97185
|
+
/**
|
|
97186
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
97187
|
+
* Configuration for GraphQL adapters only.
|
|
97188
|
+
*/
|
|
97189
|
+
const configurationForGraphQLAdapters$1 = {
|
|
97190
|
+
getDraftAwareGraphQLAdapter: configurableGraphQLAdapter$1.getAdapter,
|
|
97191
|
+
setDraftAwareGraphQLAdapter: configurableGraphQLAdapter$1.setAdapter,
|
|
97192
|
+
getEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter$1.getAdapter,
|
|
97193
|
+
setEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter$1.setAdapter,
|
|
97194
|
+
};
|
|
97195
|
+
const registrations$1 = new Set();
|
|
97196
|
+
/**
|
|
97197
|
+
* lds-adapter-uiapi is special. The non-SFDC bundle combines REST and GQL adapters,
|
|
97198
|
+
* yet for SFDC those are separate bundles. So non-SFDC bundle (./main.ts) registers
|
|
97199
|
+
* both REST and GQL configs. We want each SFDC bundle to register (we don't want one
|
|
97200
|
+
* SFDC bundle to assume the other is being loaded and therefore the other one will
|
|
97201
|
+
* take care of registration) but we don't want to double register either.
|
|
97202
|
+
*
|
|
97203
|
+
* So we make this function that memoizes if it's been called before and only
|
|
97204
|
+
* actually registers once.
|
|
97205
|
+
*/
|
|
97206
|
+
function ensureRegisteredOnce$1(registration) {
|
|
97207
|
+
const { id } = registration;
|
|
97208
|
+
if (!registrations$1.has(id)) {
|
|
97209
|
+
register$1(registration);
|
|
97210
|
+
registrations$1.add(id);
|
|
97211
|
+
}
|
|
97212
|
+
}
|
|
97213
|
+
|
|
96554
97214
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
96555
97215
|
function equalsObject(a, b, equalsProp) {
|
|
96556
97216
|
const aKeys = ObjectKeys(a).sort();
|
|
@@ -120784,7 +121444,7 @@ function transformConfiguration$1(config) {
|
|
|
120784
121444
|
// Make a copy of the config before running transform to avoid mutating the original config
|
|
120785
121445
|
const adapterConfigCopy = {
|
|
120786
121446
|
...config,
|
|
120787
|
-
query: parse$
|
|
121447
|
+
query: parse$9(print(config.query))
|
|
120788
121448
|
};
|
|
120789
121449
|
return {
|
|
120790
121450
|
...adapterConfigCopy,
|
|
@@ -120847,238 +121507,6 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
|
120847
121507
|
return cacheSnapshot;
|
|
120848
121508
|
}
|
|
120849
121509
|
|
|
120850
|
-
/**
|
|
120851
|
-
* Defines configuration for the module with a default value which can be overridden by the runtime environment.
|
|
120852
|
-
*/
|
|
120853
|
-
// A holder for a configurable adapter override
|
|
120854
|
-
let Configurable$1 = class Configurable {
|
|
120855
|
-
constructor() {
|
|
120856
|
-
this.getAdapter = () => {
|
|
120857
|
-
return this.adapter;
|
|
120858
|
-
};
|
|
120859
|
-
this.setAdapter = (value) => {
|
|
120860
|
-
this.adapter = value;
|
|
120861
|
-
};
|
|
120862
|
-
this.adapter = undefined;
|
|
120863
|
-
}
|
|
120864
|
-
};
|
|
120865
|
-
// Configurable adapters that can have environmental overrides
|
|
120866
|
-
let configurableCreateRecordAdapter$1 = new Configurable$1();
|
|
120867
|
-
let configurableUpdateRecordAdapter$1 = new Configurable$1();
|
|
120868
|
-
let configurableDeleteRecordAdapter$1 = new Configurable$1();
|
|
120869
|
-
let configurablePerformQuickActionAdapter$1 = new Configurable$1();
|
|
120870
|
-
let configurablePerformUpdateRecordQuickActionAdapter$1 = new Configurable$1();
|
|
120871
|
-
let configurableCreateContentDocumentAndVersion$1 = new Configurable$1();
|
|
120872
|
-
let configurableCreateContentVersion$1 = new Configurable$1();
|
|
120873
|
-
/**
|
|
120874
|
-
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
120875
|
-
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
120876
|
-
* be reached by following 1 relationship from the root record, etc.
|
|
120877
|
-
* @defaultValue '5', replicates the current behavior
|
|
120878
|
-
*/
|
|
120879
|
-
let trackedFieldDepthOnCacheMiss$1 = 5;
|
|
120880
|
-
/**
|
|
120881
|
-
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
120882
|
-
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
120883
|
-
* be reached by following 1 relationship from the root record, etc.
|
|
120884
|
-
* @defaultValue '5', replicates the current behavior
|
|
120885
|
-
*/
|
|
120886
|
-
let trackedFieldDepthOnCacheMergeConflict$1 = 5;
|
|
120887
|
-
/**
|
|
120888
|
-
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
120889
|
-
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
120890
|
-
* be reached by following 1 relationship from the root record, etc.
|
|
120891
|
-
* @defaultValue '5', replicates the current behavior
|
|
120892
|
-
*/
|
|
120893
|
-
let trackedFieldDepthOnNotifyChange$1 = 5;
|
|
120894
|
-
/**
|
|
120895
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
120896
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
120897
|
-
*/
|
|
120898
|
-
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
120899
|
-
/**
|
|
120900
|
-
* One store enabled Get Object Info adapter
|
|
120901
|
-
*/
|
|
120902
|
-
let oneStoreGetObjectInfoAdapter$1 = undefined;
|
|
120903
|
-
/**
|
|
120904
|
-
* One store enabled Get Object Infos adapter
|
|
120905
|
-
*/
|
|
120906
|
-
let oneStoreGetObjectInfosAdapter$1 = undefined;
|
|
120907
|
-
/**
|
|
120908
|
-
* Determines when to include PDL strategies for Related Lists
|
|
120909
|
-
*/
|
|
120910
|
-
let relatedListsPredictionsEnabled$1 = false;
|
|
120911
|
-
/**
|
|
120912
|
-
* Determines whether to include additional PDL strategies for Related Lists
|
|
120913
|
-
*/
|
|
120914
|
-
let relatedListsPlusPredictionsEnabled$1 = false;
|
|
120915
|
-
let recordRepresentationIngestionOverride$1 = undefined;
|
|
120916
|
-
/**
|
|
120917
|
-
* Defines the configuration API and is exposed internally as well as externally.
|
|
120918
|
-
* Configuration for one store enabled REST adapters only.
|
|
120919
|
-
*/
|
|
120920
|
-
const configurationForOneStoreEnabledAdapters$1 = {
|
|
120921
|
-
setGetObjectInfoAdapter: function (adapter) {
|
|
120922
|
-
oneStoreGetObjectInfoAdapter$1 = adapter;
|
|
120923
|
-
},
|
|
120924
|
-
getGetObjectInfoAdapter: function () {
|
|
120925
|
-
return oneStoreGetObjectInfoAdapter$1;
|
|
120926
|
-
},
|
|
120927
|
-
setGetObjectInfosAdapter: function (adapter) {
|
|
120928
|
-
oneStoreGetObjectInfosAdapter$1 = adapter;
|
|
120929
|
-
},
|
|
120930
|
-
getGetObjectInfosAdapter: function () {
|
|
120931
|
-
return oneStoreGetObjectInfosAdapter$1;
|
|
120932
|
-
},
|
|
120933
|
-
};
|
|
120934
|
-
const getKeywordSearchResultsFactory$1 = new Configurable$1();
|
|
120935
|
-
const getListRecordsByNameFactory$1 = new Configurable$1();
|
|
120936
|
-
const getListUiFactory$1 = new Configurable$1();
|
|
120937
|
-
const getLookupRecordsFactory$1 = new Configurable$1();
|
|
120938
|
-
const getQuickActionDefaultsFactory$1 = new Configurable$1();
|
|
120939
|
-
const getRecordCreateDefaultsFactory$1 = new Configurable$1();
|
|
120940
|
-
const getRecordTemplateCloneFactory$1 = new Configurable$1();
|
|
120941
|
-
const getRecordTemplateCreateFactory$1 = new Configurable$1();
|
|
120942
|
-
const getRecordUiFactory$1 = new Configurable$1();
|
|
120943
|
-
const getRecordFactory$1 = new Configurable$1();
|
|
120944
|
-
const getRecordsFactory$1 = new Configurable$1();
|
|
120945
|
-
const getRelatedListRecordsFactory$1 = new Configurable$1();
|
|
120946
|
-
const getRelatedListRecordsBatchFactory$1 = new Configurable$1();
|
|
120947
|
-
const getSearchResultsFactory$1 = new Configurable$1();
|
|
120948
|
-
// The following set of adapters all touch RecordRepresentation directly or indirectly,
|
|
120949
|
-
// so they need to support having a custom factory provided by the mobile environment.
|
|
120950
|
-
const configurationForEnvironmentFactoryOverrides$1 = {
|
|
120951
|
-
getKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory$1.getAdapter,
|
|
120952
|
-
setGetKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory$1.setAdapter,
|
|
120953
|
-
getListRecordsByNameAdapterFactory: getListRecordsByNameFactory$1.getAdapter,
|
|
120954
|
-
setGetListRecordsByNameAdapterFactory: getListRecordsByNameFactory$1.setAdapter,
|
|
120955
|
-
getListUiAdapterFactory: getListUiFactory$1.getAdapter,
|
|
120956
|
-
setGetListUiAdapterFactory: getListUiFactory$1.setAdapter,
|
|
120957
|
-
getLookupRecordsAdapterFactory: getLookupRecordsFactory$1.getAdapter,
|
|
120958
|
-
setGetLookupRecordsAdapterFactory: getLookupRecordsFactory$1.setAdapter,
|
|
120959
|
-
getQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory$1.getAdapter,
|
|
120960
|
-
setGetQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory$1.setAdapter,
|
|
120961
|
-
getRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory$1.getAdapter,
|
|
120962
|
-
setGetRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory$1.setAdapter,
|
|
120963
|
-
getRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory$1.getAdapter,
|
|
120964
|
-
setGetRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory$1.setAdapter,
|
|
120965
|
-
getRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory$1.getAdapter,
|
|
120966
|
-
setGetRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory$1.setAdapter,
|
|
120967
|
-
getRecordUiAdapterFactory: getRecordUiFactory$1.getAdapter,
|
|
120968
|
-
setGetRecordUiAdapterFactory: getRecordUiFactory$1.setAdapter,
|
|
120969
|
-
getRecordAdapterFactory: getRecordFactory$1.getAdapter,
|
|
120970
|
-
setGetRecordAdapterFactory: getRecordFactory$1.setAdapter,
|
|
120971
|
-
getRecordsAdapterFactory: getRecordsFactory$1.getAdapter,
|
|
120972
|
-
setGetRecordsAdapterFactory: getRecordsFactory$1.setAdapter,
|
|
120973
|
-
getRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory$1.getAdapter,
|
|
120974
|
-
setGetRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory$1.setAdapter,
|
|
120975
|
-
getRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory$1.getAdapter,
|
|
120976
|
-
setGetRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory$1.setAdapter,
|
|
120977
|
-
getSearchResultsAdapterFactory: getSearchResultsFactory$1.getAdapter,
|
|
120978
|
-
setGetSearchResultsAdapterFactory: getSearchResultsFactory$1.setAdapter,
|
|
120979
|
-
};
|
|
120980
|
-
/**
|
|
120981
|
-
* Defines the configuration API and is exposed internally as well as externally.
|
|
120982
|
-
* Configuration for REST adapters only.
|
|
120983
|
-
*/
|
|
120984
|
-
const configurationForRestAdapters$1 = {
|
|
120985
|
-
setTrackedFieldDepthOnCacheMiss: function (trackedFieldDepthOnCacheMissParam) {
|
|
120986
|
-
trackedFieldDepthOnCacheMiss$1 = trackedFieldDepthOnCacheMissParam;
|
|
120987
|
-
},
|
|
120988
|
-
getTrackedFieldDepthOnCacheMiss: function () {
|
|
120989
|
-
return trackedFieldDepthOnCacheMiss$1;
|
|
120990
|
-
},
|
|
120991
|
-
setTrackedFieldDepthOnCacheMergeConflict: function (trackedFieldDepthOnCacheMergeConflictParam) {
|
|
120992
|
-
trackedFieldDepthOnCacheMergeConflict$1 = trackedFieldDepthOnCacheMergeConflictParam;
|
|
120993
|
-
},
|
|
120994
|
-
getTrackedFieldDepthOnCacheMergeConflict: function () {
|
|
120995
|
-
return trackedFieldDepthOnCacheMergeConflict$1;
|
|
120996
|
-
},
|
|
120997
|
-
setTrackedFieldDepthOnNotifyChange: function (trackedFieldDepthOnNotifyChangeParam) {
|
|
120998
|
-
trackedFieldDepthOnNotifyChange$1 = trackedFieldDepthOnNotifyChangeParam;
|
|
120999
|
-
},
|
|
121000
|
-
getTrackedFieldDepthOnNotifyChange: function () {
|
|
121001
|
-
return trackedFieldDepthOnNotifyChange$1;
|
|
121002
|
-
},
|
|
121003
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
121004
|
-
trackedFieldLeafNodeIdAndNameOnly$1 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
121005
|
-
},
|
|
121006
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
121007
|
-
return trackedFieldLeafNodeIdAndNameOnly$1;
|
|
121008
|
-
},
|
|
121009
|
-
setRelatedListsPredictionsEnabled: function (f) {
|
|
121010
|
-
relatedListsPredictionsEnabled$1 = f;
|
|
121011
|
-
},
|
|
121012
|
-
areRelatedListsPredictionsEnabled: function () {
|
|
121013
|
-
return relatedListsPredictionsEnabled$1 === true;
|
|
121014
|
-
},
|
|
121015
|
-
setRelatedListsPlusPredictionsEnabled: function (f) {
|
|
121016
|
-
relatedListsPlusPredictionsEnabled$1 = f;
|
|
121017
|
-
},
|
|
121018
|
-
areRelatedListsPlusPredictionsEnabled: function () {
|
|
121019
|
-
return relatedListsPlusPredictionsEnabled$1 === true;
|
|
121020
|
-
},
|
|
121021
|
-
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
121022
|
-
recordRepresentationIngestionOverride$1 = ingest;
|
|
121023
|
-
},
|
|
121024
|
-
getRecordRepresentationIngestionOverride: function () {
|
|
121025
|
-
return recordRepresentationIngestionOverride$1;
|
|
121026
|
-
},
|
|
121027
|
-
// createRecord
|
|
121028
|
-
getDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter$1.getAdapter,
|
|
121029
|
-
setDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter$1.setAdapter,
|
|
121030
|
-
// updateRecord
|
|
121031
|
-
getDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter$1.getAdapter,
|
|
121032
|
-
setDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter$1.setAdapter,
|
|
121033
|
-
// deleteRecord
|
|
121034
|
-
getDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter$1.getAdapter,
|
|
121035
|
-
setDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter$1.setAdapter,
|
|
121036
|
-
// performQuickAction
|
|
121037
|
-
getDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter$1.getAdapter,
|
|
121038
|
-
setDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter$1.setAdapter,
|
|
121039
|
-
// performRecordUpdateQuickAction
|
|
121040
|
-
getDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter$1.getAdapter,
|
|
121041
|
-
setDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter$1.setAdapter,
|
|
121042
|
-
// createContentDocumentAndVersion
|
|
121043
|
-
getDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion$1.getAdapter,
|
|
121044
|
-
setDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion$1.setAdapter,
|
|
121045
|
-
// createContentVersion
|
|
121046
|
-
getDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion$1.getAdapter,
|
|
121047
|
-
setDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion$1.setAdapter,
|
|
121048
|
-
...configurationForOneStoreEnabledAdapters$1,
|
|
121049
|
-
...configurationForEnvironmentFactoryOverrides$1,
|
|
121050
|
-
};
|
|
121051
|
-
let configurableGraphQLAdapter$1 = new Configurable$1();
|
|
121052
|
-
let configurableGraphQLBatchAdapter$1 = new Configurable$1();
|
|
121053
|
-
/**
|
|
121054
|
-
* Defines the configuration API and is exposed internally as well as externally.
|
|
121055
|
-
* Configuration for GraphQL adapters only.
|
|
121056
|
-
*/
|
|
121057
|
-
const configurationForGraphQLAdapters$1 = {
|
|
121058
|
-
getDraftAwareGraphQLAdapter: configurableGraphQLAdapter$1.getAdapter,
|
|
121059
|
-
setDraftAwareGraphQLAdapter: configurableGraphQLAdapter$1.setAdapter,
|
|
121060
|
-
getEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter$1.getAdapter,
|
|
121061
|
-
setEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter$1.setAdapter,
|
|
121062
|
-
};
|
|
121063
|
-
const registrations$1 = new Set();
|
|
121064
|
-
/**
|
|
121065
|
-
* lds-adapter-uiapi is special. The non-SFDC bundle combines REST and GQL adapters,
|
|
121066
|
-
* yet for SFDC those are separate bundles. So non-SFDC bundle (./main.ts) registers
|
|
121067
|
-
* both REST and GQL configs. We want each SFDC bundle to register (we don't want one
|
|
121068
|
-
* SFDC bundle to assume the other is being loaded and therefore the other one will
|
|
121069
|
-
* take care of registration) but we don't want to double register either.
|
|
121070
|
-
*
|
|
121071
|
-
* So we make this function that memoizes if it's been called before and only
|
|
121072
|
-
* actually registers once.
|
|
121073
|
-
*/
|
|
121074
|
-
function ensureRegisteredOnce$1(registration) {
|
|
121075
|
-
const { id } = registration;
|
|
121076
|
-
if (!registrations$1.has(id)) {
|
|
121077
|
-
register$1(registration);
|
|
121078
|
-
registrations$1.add(id);
|
|
121079
|
-
}
|
|
121080
|
-
}
|
|
121081
|
-
|
|
121082
121510
|
function validateAdapterConfig$1(untrustedConfig, _configPropertyNames) {
|
|
121083
121511
|
if (untrustedConfig !== null && typeof untrustedConfig === 'object') {
|
|
121084
121512
|
const operationNameIsDefinedAsUndefined = ObjectPrototypeHasOwnProperty.call(untrustedConfig, 'operationName') &&
|
|
@@ -121405,7 +121833,7 @@ function transformConfiguration(config) {
|
|
|
121405
121833
|
const batchQueryTransformed = config.batchQuery.map((singleConfig) => {
|
|
121406
121834
|
return {
|
|
121407
121835
|
...singleConfig,
|
|
121408
|
-
query: applyMinimumFieldsToDocument(parse$
|
|
121836
|
+
query: applyMinimumFieldsToDocument(parse$9(print(singleConfig.query)), { queryTypeName: 'Query' }, getQueryTransformerForType, singleConfig.operationName), // Stringifies and parses again to avoid mutating original. Should we just JSON.stringify to avoid the dependency on the parser?
|
|
121409
121837
|
};
|
|
121410
121838
|
});
|
|
121411
121839
|
return {
|
|
@@ -121547,11 +121975,11 @@ function bindExportsTo(luvio) {
|
|
|
121547
121975
|
const graphqlBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'graphqlBatch', factory), graphqlBatchMetadata);
|
|
121548
121976
|
return {
|
|
121549
121977
|
// Wire Adapters
|
|
121550
|
-
graphql: createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
121551
121978
|
graphqlBatch: createGraphQLWireAdapterConstructor(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
121552
121979
|
// One Store Enabled Adapters
|
|
121980
|
+
graphql: getLuvioOrOneStoreAdapter(createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver), configurationForOneStoreEnabledAdapters$1.getGraphQLWireAdapter()),
|
|
121981
|
+
graphql_imperative: getLuvioOrOneStoreAdapter(createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver), configurationForOneStoreEnabledAdapters$1.getGraphQLImperativeQueryAdapter()),
|
|
121553
121982
|
// Imperative Adapters
|
|
121554
|
-
graphql_imperative: createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
121555
121983
|
graphqlBatch_imperative: createGraphQLImperativeAdapter(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
121556
121984
|
};
|
|
121557
121985
|
}
|
|
@@ -122066,7 +122494,14 @@ register$1({
|
|
|
122066
122494
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
122067
122495
|
instrument: instrument$1,
|
|
122068
122496
|
});
|
|
122069
|
-
|
|
122497
|
+
function refreshGraphQL(data) {
|
|
122498
|
+
// If OneStore data, call its refresh instead
|
|
122499
|
+
if (typeof data.refresh === 'function') {
|
|
122500
|
+
return data.refresh();
|
|
122501
|
+
}
|
|
122502
|
+
return refresh$3(data, 'refreshUiApi');
|
|
122503
|
+
}
|
|
122504
|
+
// version: 1.370.0-7c1df2520b
|
|
122070
122505
|
|
|
122071
122506
|
// On core the unstable adapters are re-exported with different names,
|
|
122072
122507
|
// we want to match them here.
|
|
@@ -122078,7 +122513,7 @@ var unstableLightningRelatedListApi = /*#__PURE__*/Object.freeze({
|
|
|
122078
122513
|
gql: gql,
|
|
122079
122514
|
get graphql () { return graphql; },
|
|
122080
122515
|
get graphqlBatch () { return graphqlBatch; },
|
|
122081
|
-
|
|
122516
|
+
refreshGraphQL: refreshGraphQL,
|
|
122082
122517
|
get unstable_getActionOverrides_imperative () { return unstable_getActionOverrides_imperative; },
|
|
122083
122518
|
get unstable_getFlexipageFormulaOverrides_imperative () { return unstable_getFlexipageFormulaOverrides_imperative; },
|
|
122084
122519
|
get unstable_getGlobalActions_imperative () { return unstable_getGlobalActions_imperative; },
|
|
@@ -122218,7 +122653,7 @@ withDefaultLuvio((luvio) => {
|
|
|
122218
122653
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
122219
122654
|
graphQLImperative = ldsAdapter;
|
|
122220
122655
|
});
|
|
122221
|
-
// version: 1.
|
|
122656
|
+
// version: 1.370.0-7c1df2520b
|
|
122222
122657
|
|
|
122223
122658
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
122224
122659
|
__proto__: null,
|
|
@@ -123017,7 +123452,7 @@ const callbacks$1 = [];
|
|
|
123017
123452
|
function register(r) {
|
|
123018
123453
|
callbacks$1.forEach((callback) => callback(r));
|
|
123019
123454
|
}
|
|
123020
|
-
// version: 1.
|
|
123455
|
+
// version: 1.370.0-3ec6ffba72
|
|
123021
123456
|
|
|
123022
123457
|
/**
|
|
123023
123458
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -123083,6 +123518,14 @@ let oneStoreGetObjectInfoAdapter = undefined;
|
|
|
123083
123518
|
* One store enabled Get Object Infos adapter
|
|
123084
123519
|
*/
|
|
123085
123520
|
let oneStoreGetObjectInfosAdapter = undefined;
|
|
123521
|
+
/**
|
|
123522
|
+
* One store enabled GraphQL adapter
|
|
123523
|
+
*/
|
|
123524
|
+
let oneStoreGraphQLWireAdapter = undefined;
|
|
123525
|
+
/**
|
|
123526
|
+
* One store enabled GraphQL imperative query adapter
|
|
123527
|
+
*/
|
|
123528
|
+
let oneStoreGraphQLImperativeQueryAdapter = undefined;
|
|
123086
123529
|
/**
|
|
123087
123530
|
* Determines when to include PDL strategies for Related Lists
|
|
123088
123531
|
*/
|
|
@@ -123109,6 +123552,18 @@ const configurationForOneStoreEnabledAdapters = {
|
|
|
123109
123552
|
getGetObjectInfosAdapter: function () {
|
|
123110
123553
|
return oneStoreGetObjectInfosAdapter;
|
|
123111
123554
|
},
|
|
123555
|
+
setGraphQLWireAdapter: function (adapter) {
|
|
123556
|
+
oneStoreGraphQLWireAdapter = adapter;
|
|
123557
|
+
},
|
|
123558
|
+
getGraphQLWireAdapter: function () {
|
|
123559
|
+
return oneStoreGraphQLWireAdapter;
|
|
123560
|
+
},
|
|
123561
|
+
setGraphQLImperativeQueryAdapter: function (adapter) {
|
|
123562
|
+
oneStoreGraphQLImperativeQueryAdapter = adapter;
|
|
123563
|
+
},
|
|
123564
|
+
getGraphQLImperativeQueryAdapter: function () {
|
|
123565
|
+
return oneStoreGraphQLImperativeQueryAdapter;
|
|
123566
|
+
},
|
|
123112
123567
|
};
|
|
123113
123568
|
const getKeywordSearchResultsFactory = new Configurable();
|
|
123114
123569
|
const getListRecordsByNameFactory = new Configurable();
|
|
@@ -124184,4 +124639,4 @@ const { luvio } = getRuntime();
|
|
|
124184
124639
|
setDefaultLuvio({ luvio });
|
|
124185
124640
|
|
|
124186
124641
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
124187
|
-
// version: 1.
|
|
124642
|
+
// version: 1.370.0-3ec6ffba72
|