@salesforce/lds-runtime-mobile 1.368.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/main.js +774 -395
- package/dist/types/instrumentation/metrics.d.ts +2 -0
- package/dist/types/onestore/index.d.ts +2 -1
- package/dist/types/onestore/nimbusDurableCacheInclusionPolicy.d.ts +15 -0
- package/dist/types/onestore/nimbusSqliteStoreCache.d.ts +19 -0
- package/package.json +30 -30
- package/sfdc/main.js +774 -395
- package/sfdc/types/instrumentation/metrics.d.ts +2 -0
- package/sfdc/types/onestore/index.d.ts +2 -1
- package/sfdc/types/onestore/nimbusDurableCacheInclusionPolicy.d.ts +15 -0
- package/sfdc/types/onestore/nimbusSqliteStoreCache.d.ts +19 -0
package/dist/main.js
CHANGED
|
@@ -20,7 +20,7 @@ import { setupInstrumentation, instrumentAdapter as instrumentAdapter$1, instrum
|
|
|
20
20
|
import { HttpStatusCode, setBypassDeepFreeze, StoreKeySet, serializeStructuredKey, StringKeyInMemoryStore, Reader, deepFreeze, emitAdapterEvent, ingestShape, coerceConfig as coerceConfig$1, typeCheckConfig as typeCheckConfig$h, createResourceParams as createResourceParams$h, StoreKeyMap, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$f, resolveLink, createCustomAdapterEventEmitter, isFileReference, Environment, Luvio, InMemoryStore } from '@luvio/engine';
|
|
21
21
|
import { isSupportedEntity, configuration, getObjectInfoAdapterFactory, RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION, isStoreKeyRecordViewEntity, extractRecordIdFromStoreKey, buildRecordRepKeyFromId, keyBuilderRecord, RecordRepresentationTTL, keyBuilderQuickActionExecutionRepresentation, ingestQuickActionExecutionRepresentation, getRecordId18 as getRecordId18$1, getRecordsAdapterFactory as getRecordsAdapterFactory$1, RecordRepresentationRepresentationType, ObjectInfoRepresentationType, getObjectInfosAdapterFactory, getObjectInfoDirectoryAdapterFactory, UiApiNamespace, RecordRepresentationType, RecordRepresentationVersion } from '@salesforce/lds-adapters-uiapi';
|
|
22
22
|
import { getInstrumentation, idleDetector } from 'o11y/client';
|
|
23
|
-
import { Kind as Kind$1, visit as visit$1, isObjectType, defaultFieldResolver, buildSchema, parse as parse$
|
|
23
|
+
import { Kind as Kind$1, visit as visit$1, isObjectType, defaultFieldResolver, buildSchema, parse as parse$8, extendSchema, isScalarType, execute, print } from '@luvio/graphql-parser';
|
|
24
24
|
import FIRST_DAY_OF_WEEK from '@salesforce/i18n/firstDayOfWeek';
|
|
25
25
|
import graphqQueryFieldLimit from '@salesforce/gate/lmr.graphqQueryFieldLimit';
|
|
26
26
|
import caseSensitiveUserId from '@salesforce/user/Id';
|
|
@@ -36,6 +36,7 @@ import { getDateTimeFormat, getDateTimeISO8601Parser, getNumberFormat } from 'li
|
|
|
36
36
|
import formattingOptions from 'lightning/i18nCldrOptions';
|
|
37
37
|
import ldsPrimingGraphqlBatch from '@salesforce/gate/lds.primingGraphqlBatch';
|
|
38
38
|
import lmrPrimingUseSoql from '@salesforce/gate/lmr.primingUseSoql';
|
|
39
|
+
import aggressiveTrimCountKillSwitchGate from '@salesforce/gate/lmr.disableAggresiveTrimCountChange';
|
|
39
40
|
import graphqlL2AdapterGate from '@salesforce/gate/lmr.graphqlL2Adapter';
|
|
40
41
|
import productConsumedSideEffects from '@salesforce/gate/com.salesforce.fieldservice.vanStockLDSBypass256';
|
|
41
42
|
import useOneStore from '@salesforce/gate/lmr.useOneStore';
|
|
@@ -48,7 +49,7 @@ import { setServices } from '@luvio/service-provisioner/v1';
|
|
|
48
49
|
*/
|
|
49
50
|
|
|
50
51
|
|
|
51
|
-
const { parse: parse$
|
|
52
|
+
const { parse: parse$7, stringify: stringify$7 } = JSON;
|
|
52
53
|
const { join: join$1, push: push$2, unshift } = Array.prototype;
|
|
53
54
|
const { isArray: isArray$5 } = Array;
|
|
54
55
|
const { entries: entries$4, keys: keys$6 } = Object;
|
|
@@ -351,10 +352,10 @@ function getTransactionKey(req) {
|
|
|
351
352
|
const { resourceRequest } = req;
|
|
352
353
|
const { baseUri, basePath, queryParams, headers } = resourceRequest;
|
|
353
354
|
const path = `${baseUri}${basePath}`;
|
|
354
|
-
const queryParamsString = queryParams ? stringify$
|
|
355
|
-
const headersString = stringify$
|
|
355
|
+
const queryParamsString = queryParams ? stringify$7(queryParams) : EMPTY_STRING;
|
|
356
|
+
const headersString = stringify$7(headers);
|
|
356
357
|
const bodyString = resourceRequest.body && isResourceRequestDedupable(req)
|
|
357
|
-
? stringify$
|
|
358
|
+
? stringify$7(resourceRequest.body)
|
|
358
359
|
: EMPTY_STRING;
|
|
359
360
|
return `${path}${TRANSACTION_KEY_SEP}${headersString}${TRANSACTION_KEY_SEP}${queryParamsString}${bodyString}`;
|
|
360
361
|
}
|
|
@@ -425,7 +426,7 @@ const dedupeRequest = (req) => {
|
|
|
425
426
|
// extra clone (particularly when there's only 1 handler).
|
|
426
427
|
for (let i = 1, len = handlers.length; i < len; i++) {
|
|
427
428
|
const handler = handlers[i];
|
|
428
|
-
handler.resolve(parse$
|
|
429
|
+
handler.resolve(parse$7(stringify$7(response)));
|
|
429
430
|
}
|
|
430
431
|
handlers[0].resolve(response);
|
|
431
432
|
}, (error) => {
|
|
@@ -1840,7 +1841,7 @@ var QueueOperationType;
|
|
|
1840
1841
|
})(QueueOperationType || (QueueOperationType = {}));
|
|
1841
1842
|
|
|
1842
1843
|
const { keys: keys$4, create: create$4, assign: assign$3, values: values$2 } = Object;
|
|
1843
|
-
const { stringify: stringify$
|
|
1844
|
+
const { stringify: stringify$6, parse: parse$6 } = JSON;
|
|
1844
1845
|
const { isArray: isArray$4 } = Array;
|
|
1845
1846
|
|
|
1846
1847
|
class DraftSynthesisError extends Error {
|
|
@@ -2542,7 +2543,7 @@ class DurableDraftQueue {
|
|
|
2542
2543
|
}
|
|
2543
2544
|
|
|
2544
2545
|
function clone$1(obj) {
|
|
2545
|
-
return parse$
|
|
2546
|
+
return parse$6(stringify$6(obj));
|
|
2546
2547
|
}
|
|
2547
2548
|
|
|
2548
2549
|
const DRAFT_ACTION_KEY_JUNCTION = '__DraftAction__';
|
|
@@ -3009,7 +3010,7 @@ class DraftManager {
|
|
|
3009
3010
|
// We should always return an array, if the body is just a dictionary,
|
|
3010
3011
|
// stick it in an array
|
|
3011
3012
|
const body = isArray$4(action.error.body) ? action.error.body : [action.error.body];
|
|
3012
|
-
const bodyString = stringify$
|
|
3013
|
+
const bodyString = stringify$6(body);
|
|
3013
3014
|
item.error = {
|
|
3014
3015
|
status: action.error.status || 0,
|
|
3015
3016
|
ok: action.error.ok || false,
|
|
@@ -3256,7 +3257,7 @@ const { hasOwnProperty } = Object.prototype;
|
|
|
3256
3257
|
const { split, endsWith } = String.prototype;
|
|
3257
3258
|
const { from: from$1, isArray: isArray$3 } = Array;
|
|
3258
3259
|
const { concat, filter, includes, push: push$1, reduce, shift, slice: slice$1 } = Array.prototype;
|
|
3259
|
-
const { parse: parse$
|
|
3260
|
+
const { parse: parse$5, stringify: stringify$5 } = JSON;
|
|
3260
3261
|
|
|
3261
3262
|
function isString(value) {
|
|
3262
3263
|
return typeof value === 'string';
|
|
@@ -14853,7 +14854,7 @@ function prepareRequest$3(luvio, config) {
|
|
|
14853
14854
|
// we have to run ingest code and look at the resulting snapshot's seenRecords.
|
|
14854
14855
|
function getCacheKeys(keySet, luvio, config, key, originalResponseBody) {
|
|
14855
14856
|
const { recordIds, layoutTypes, modes } = config;
|
|
14856
|
-
const responseBody = parse$
|
|
14857
|
+
const responseBody = parse$5(stringify$5(originalResponseBody));
|
|
14857
14858
|
eachLayout(responseBody, (apiName, recordTypeId, layout) => {
|
|
14858
14859
|
if (layout.id === null) {
|
|
14859
14860
|
return;
|
|
@@ -42022,7 +42023,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
42022
42023
|
let updatedActionTargetId = undefined;
|
|
42023
42024
|
const { tag: queueActionTag, data: queueActionRequest, id: queueActionId, } = queueAction;
|
|
42024
42025
|
let { basePath, body } = queueActionRequest;
|
|
42025
|
-
let stringifiedBody = stringify$
|
|
42026
|
+
let stringifiedBody = stringify$5(body);
|
|
42026
42027
|
// for each redirected ID/key we loop over the operation to see if it needs
|
|
42027
42028
|
// to be updated
|
|
42028
42029
|
for (const { draftId, draftKey, canonicalId, canonicalKey } of redirects) {
|
|
@@ -42047,7 +42048,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
42047
42048
|
data: {
|
|
42048
42049
|
...queueActionRequest,
|
|
42049
42050
|
basePath: basePath,
|
|
42050
|
-
body: parse$
|
|
42051
|
+
body: parse$5(stringifiedBody),
|
|
42051
42052
|
},
|
|
42052
42053
|
};
|
|
42053
42054
|
// item needs to be replaced with a new item at the new record key
|
|
@@ -42066,7 +42067,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
42066
42067
|
data: {
|
|
42067
42068
|
...queueActionRequest,
|
|
42068
42069
|
basePath: basePath,
|
|
42069
|
-
body: parse$
|
|
42070
|
+
body: parse$5(stringifiedBody),
|
|
42070
42071
|
},
|
|
42071
42072
|
};
|
|
42072
42073
|
// item needs to be updated
|
|
@@ -42782,7 +42783,7 @@ function normalizeError(err) {
|
|
|
42782
42783
|
else if (typeof err === 'string') {
|
|
42783
42784
|
return new Error(err);
|
|
42784
42785
|
}
|
|
42785
|
-
return new Error(stringify$
|
|
42786
|
+
return new Error(stringify$5(err));
|
|
42786
42787
|
}
|
|
42787
42788
|
|
|
42788
42789
|
const O11Y_NAMESPACE_LDS_MOBILE = 'lds-mobile';
|
|
@@ -42820,6 +42821,10 @@ const GRAPHQL_QUERY_PARSE_ERROR = 'gql-query-parse-error';
|
|
|
42820
42821
|
const GRAPHQL_SQL_EVAL_PRECONDITION_ERROR = 'gql-sql-pre-eval-error';
|
|
42821
42822
|
const GRAPHQL_CREATE_SNAPSHOT_ERROR = 'gql-create-snapshot-error';
|
|
42822
42823
|
const DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR = 'draft-aware-create-content-document-and-version-error';
|
|
42824
|
+
/** Garbage Collection */
|
|
42825
|
+
const GARBAGE_COLLECTION_AGGRESSIVE_TRIM_COUNT = 'garbage-collection-aggressive-trim-count';
|
|
42826
|
+
const GARBAGE_COLLECTION_AGGRESSIVE_TRIM_RECORDS_TRIMMED = 'garbage-collection-aggressive-trim-records-trimmed';
|
|
42827
|
+
const GARBAGE_COLLECTION_AGGRESSIVE_TRIM_TOTAL_RECORDS_BEFORE_TRIM = 'garbage-collection-aggressive-trim-total-records-before-trim';
|
|
42823
42828
|
const ldsMobileInstrumentation = getInstrumentation(O11Y_NAMESPACE_LDS_MOBILE);
|
|
42824
42829
|
const nimbusLogger = typeof __nimbus !== 'undefined' &&
|
|
42825
42830
|
__nimbus.plugins !== undefined &&
|
|
@@ -42960,6 +42965,12 @@ function reportChunkCandidateUrlLength(urlLength) {
|
|
|
42960
42965
|
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
42961
42966
|
ldsMobileInstrumentation.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
42962
42967
|
}
|
|
42968
|
+
/** Garbage Collection */
|
|
42969
|
+
function reportAggressiveTrimTriggered(trimCount, beforeTrimRecordCount, totalRecordsTrimmed) {
|
|
42970
|
+
ldsMobileInstrumentation.trackValue(GARBAGE_COLLECTION_AGGRESSIVE_TRIM_COUNT, trimCount);
|
|
42971
|
+
ldsMobileInstrumentation.trackValue(GARBAGE_COLLECTION_AGGRESSIVE_TRIM_TOTAL_RECORDS_BEFORE_TRIM, beforeTrimRecordCount);
|
|
42972
|
+
ldsMobileInstrumentation.trackValue(GARBAGE_COLLECTION_AGGRESSIVE_TRIM_RECORDS_TRIMMED, totalRecordsTrimmed);
|
|
42973
|
+
}
|
|
42963
42974
|
|
|
42964
42975
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
42965
42976
|
class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
@@ -43891,7 +43902,7 @@ function recordLoaderFactory(query) {
|
|
|
43891
43902
|
rows.forEach((row) => {
|
|
43892
43903
|
if (!row[0])
|
|
43893
43904
|
return null;
|
|
43894
|
-
const record = parse$
|
|
43905
|
+
const record = parse$5(row[0]);
|
|
43895
43906
|
if (record.id === id) {
|
|
43896
43907
|
foundRow = record;
|
|
43897
43908
|
}
|
|
@@ -44250,7 +44261,7 @@ function dateTimePredicate(input, operator, field, alias) {
|
|
|
44250
44261
|
return dateTimeRange(range, operator, field, alias);
|
|
44251
44262
|
}
|
|
44252
44263
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
44253
|
-
throw new Error(`Where filter ${stringify$
|
|
44264
|
+
throw new Error(`Where filter ${stringify$5(input)} is not supported`);
|
|
44254
44265
|
}
|
|
44255
44266
|
function dateTimeRange(input, op, field, alias) {
|
|
44256
44267
|
const dateFunction = field.dataType === 'DateTime' ? 'datetime' : 'date';
|
|
@@ -46894,14 +46905,14 @@ function isLocalCursor(maybeCursor) {
|
|
|
46894
46905
|
typeof maybeCursor.i === 'number');
|
|
46895
46906
|
}
|
|
46896
46907
|
function encodeV1Cursor(cursor) {
|
|
46897
|
-
return base64encode(stringify$
|
|
46908
|
+
return base64encode(stringify$5(cursor));
|
|
46898
46909
|
}
|
|
46899
46910
|
const CURSOR_PARSE_ERROR = 'Unable to parse cursor';
|
|
46900
46911
|
function decodeV1Cursor(base64cursor) {
|
|
46901
46912
|
let maybeCursor;
|
|
46902
46913
|
try {
|
|
46903
46914
|
const cursorString = base64decode(base64cursor);
|
|
46904
|
-
maybeCursor = parse$
|
|
46915
|
+
maybeCursor = parse$5(cursorString);
|
|
46905
46916
|
}
|
|
46906
46917
|
catch (error) {
|
|
46907
46918
|
let message = CURSOR_PARSE_ERROR;
|
|
@@ -47105,7 +47116,7 @@ async function readPaginationMetadataForKeys(keys, query) {
|
|
|
47105
47116
|
const results = await query(sql, keys.map((k) => k + '__pagination'));
|
|
47106
47117
|
for (let row of results.rows) {
|
|
47107
47118
|
let key = row[0].replace(/__pagination$/, '');
|
|
47108
|
-
let metadata = parse$
|
|
47119
|
+
let metadata = parse$5(row[1]);
|
|
47109
47120
|
metadataMap.set(key, metadata);
|
|
47110
47121
|
}
|
|
47111
47122
|
return metadataMap;
|
|
@@ -47211,8 +47222,8 @@ async function connectionResolver(obj, args, context, info) {
|
|
|
47211
47222
|
//map each sql result with the ingestion timestamp to pass it down a level
|
|
47212
47223
|
let records = results.rows.map((row, index) => {
|
|
47213
47224
|
const recordMetadataResult = {
|
|
47214
|
-
recordRepresentation: parse$
|
|
47215
|
-
metadata: parse$
|
|
47225
|
+
recordRepresentation: parse$5(row[0]),
|
|
47226
|
+
metadata: parse$5(row[1]),
|
|
47216
47227
|
};
|
|
47217
47228
|
const { recordRepresentation, metadata } = recordMetadataResult;
|
|
47218
47229
|
context.seenRecordIds.add(recordRepresentation.id);
|
|
@@ -47663,7 +47674,7 @@ function extendSchemaWithObjectInfos(cache, objectInfoMap) {
|
|
|
47663
47674
|
return cache;
|
|
47664
47675
|
}
|
|
47665
47676
|
// parse extensions into DocumentNode to extend the schema
|
|
47666
|
-
const extensions = parse$
|
|
47677
|
+
const extensions = parse$8(typeDefs);
|
|
47667
47678
|
const polymorphicFieldTypeNames = [
|
|
47668
47679
|
...polyFieldTypeNameArr,
|
|
47669
47680
|
...cache.getPolymorphicFieldTypeNames(),
|
|
@@ -50206,7 +50217,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
50206
50217
|
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
50207
50218
|
return async function draftAwareGraphQLAdapter(config, requestContext = {}) {
|
|
50208
50219
|
//create a copy to not accidentally modify the AST in the astResolver map of luvio
|
|
50209
|
-
const copy = parse$
|
|
50220
|
+
const copy = parse$5(stringify$5(config.query));
|
|
50210
50221
|
// the injected ast has extra fields needed for eval in it
|
|
50211
50222
|
let injectedAST;
|
|
50212
50223
|
// the cursor mapped ast is passed upstream so it won't reject on our local cursors
|
|
@@ -50299,7 +50310,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
50299
50310
|
} = await evaluate({
|
|
50300
50311
|
...config,
|
|
50301
50312
|
//need to create another copy of the ast for future writes
|
|
50302
|
-
query: parse$
|
|
50313
|
+
query: parse$5(stringify$5(injectedAST)),
|
|
50303
50314
|
}, observers, { userId }, objectInfoNeeded, store, nonEvaluatedSnapshot, graphqlSchemaCache, draftFunctions, mappedCursors));
|
|
50304
50315
|
}
|
|
50305
50316
|
catch (throwable) {
|
|
@@ -50425,7 +50436,7 @@ function makeGetRecordsConfig(keyMap) {
|
|
|
50425
50436
|
|
|
50426
50437
|
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio, isDraftId, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy) {
|
|
50427
50438
|
return async function environmentAwareGraphQLBatchAdapter(config, requestContext = {}) {
|
|
50428
|
-
const batchQueryCopy = config.batchQuery.map((query) => parse$
|
|
50439
|
+
const batchQueryCopy = config.batchQuery.map((query) => parse$5(stringify$5(query)));
|
|
50429
50440
|
let injectedBatchQuery = [];
|
|
50430
50441
|
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
50431
50442
|
const draftFunctions = {
|
|
@@ -50650,7 +50661,7 @@ const recordIdGenerator = (id) => {
|
|
|
50650
50661
|
|
|
50651
50662
|
|
|
50652
50663
|
const { keys: keys$2, create: create$2, assign: assign$1, entries: entries$2 } = Object;
|
|
50653
|
-
const { stringify: stringify$
|
|
50664
|
+
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
50654
50665
|
const { push, join, slice } = Array.prototype;
|
|
50655
50666
|
const { isArray: isArray$2, from } = Array;
|
|
50656
50667
|
|
|
@@ -50674,7 +50685,7 @@ function ldsParamsToString(params) {
|
|
|
50674
50685
|
returnParams[key] = `${value}`;
|
|
50675
50686
|
}
|
|
50676
50687
|
if (isObject(value) === true && keys$2(value).length > 0) {
|
|
50677
|
-
returnParams[key] = stringify$
|
|
50688
|
+
returnParams[key] = stringify$4(value);
|
|
50678
50689
|
}
|
|
50679
50690
|
}
|
|
50680
50691
|
return returnParams;
|
|
@@ -50736,13 +50747,13 @@ function stringifyIfPresent(value) {
|
|
|
50736
50747
|
if (typeof value === 'string') {
|
|
50737
50748
|
return value;
|
|
50738
50749
|
}
|
|
50739
|
-
return stringify$
|
|
50750
|
+
return stringify$4(value);
|
|
50740
50751
|
}
|
|
50741
50752
|
function parseIfPresent(value) {
|
|
50742
50753
|
if (value === undefined || value === null || value === '') {
|
|
50743
50754
|
return null;
|
|
50744
50755
|
}
|
|
50745
|
-
return parse$
|
|
50756
|
+
return parse$4(value);
|
|
50746
50757
|
}
|
|
50747
50758
|
function buildNimbusNetworkPluginRequest(resourceRequest, resourceRequestContext) {
|
|
50748
50759
|
const { basePath, baseUri, method, headers, queryParams, body } = resourceRequest;
|
|
@@ -51242,8 +51253,8 @@ function getMaxLengthPerChunkAllowed(request) {
|
|
|
51242
51253
|
// Too much work to get exact length of the final url, so use stringified json to get the rough length.
|
|
51243
51254
|
const roughUrlLengthWithoutFieldsAndOptionFields = request.basePath.length +
|
|
51244
51255
|
request.baseUri.length +
|
|
51245
|
-
(request.urlParams ? stringify$
|
|
51246
|
-
stringify$
|
|
51256
|
+
(request.urlParams ? stringify$4(request.urlParams).length : 0) +
|
|
51257
|
+
stringify$4({ ...request.queryParams, fields: {}, optionalFields: {} }).length;
|
|
51247
51258
|
return MAX_URL_LENGTH - roughUrlLengthWithoutFieldsAndOptionFields;
|
|
51248
51259
|
}
|
|
51249
51260
|
// we don't have access to the host so we cannot calculate the exact length of the url
|
|
@@ -51349,10 +51360,10 @@ class NimbusDraftQueue {
|
|
|
51349
51360
|
if (callProxyMethod === undefined) {
|
|
51350
51361
|
return Promise.reject(new Error('callProxyMethod not defined on the nimbus plugin'));
|
|
51351
51362
|
}
|
|
51352
|
-
const serializedAction = stringify$
|
|
51363
|
+
const serializedAction = stringify$5([handlerId, data]);
|
|
51353
51364
|
return new Promise((resolve, reject) => {
|
|
51354
51365
|
callProxyMethod('enqueue', serializedAction, (serializedActionResponse) => {
|
|
51355
|
-
const response = parse$
|
|
51366
|
+
const response = parse$5(serializedActionResponse);
|
|
51356
51367
|
resolve(response);
|
|
51357
51368
|
}, (errorMessage) => {
|
|
51358
51369
|
reject(new Error(errorMessage));
|
|
@@ -51373,8 +51384,8 @@ class NimbusDraftQueue {
|
|
|
51373
51384
|
return Promise.reject(new Error('callProxyMethod not defined on the nimbus plugin'));
|
|
51374
51385
|
}
|
|
51375
51386
|
return new Promise((resolve, reject) => {
|
|
51376
|
-
callProxyMethod('getQueueActions', stringify$
|
|
51377
|
-
resolve(parse$
|
|
51387
|
+
callProxyMethod('getQueueActions', stringify$5([]), (serializedQueue) => {
|
|
51388
|
+
resolve(parse$5(serializedQueue));
|
|
51378
51389
|
}, (errorMessage) => {
|
|
51379
51390
|
reject(new Error(errorMessage));
|
|
51380
51391
|
});
|
|
@@ -51385,17 +51396,17 @@ class NimbusDraftQueue {
|
|
|
51385
51396
|
if (callProxyMethod === undefined) {
|
|
51386
51397
|
return Promise.reject('callProxyMethod not defined on the nimbus plugin');
|
|
51387
51398
|
}
|
|
51388
|
-
const stringifiedArgs = stringify$
|
|
51399
|
+
const stringifiedArgs = stringify$5([action]);
|
|
51389
51400
|
return new Promise((resolve, reject) => {
|
|
51390
51401
|
callProxyMethod('getDataForAction', stringifiedArgs, (data) => {
|
|
51391
51402
|
if (data === undefined) {
|
|
51392
51403
|
resolve(undefined);
|
|
51393
51404
|
}
|
|
51394
51405
|
else {
|
|
51395
|
-
resolve(parse$
|
|
51406
|
+
resolve(parse$5(data));
|
|
51396
51407
|
}
|
|
51397
51408
|
}, (serializedError) => {
|
|
51398
|
-
reject(parse$
|
|
51409
|
+
reject(parse$5(serializedError));
|
|
51399
51410
|
});
|
|
51400
51411
|
});
|
|
51401
51412
|
}
|
|
@@ -51887,7 +51898,7 @@ function registerReportObserver(reportObserver) {
|
|
|
51887
51898
|
}
|
|
51888
51899
|
|
|
51889
51900
|
const { keys: keys$1, create: create$1, assign, entries: entries$1, values } = Object;
|
|
51890
|
-
const { stringify: stringify$
|
|
51901
|
+
const { stringify: stringify$3, parse: parse$3 } = JSON;
|
|
51891
51902
|
|
|
51892
51903
|
function selectColumnsFromTableWhereKeyIn(columnNames, table, keyColumnName, whereIn) {
|
|
51893
51904
|
const paramList = whereIn.map(() => '?').join(',');
|
|
@@ -51900,13 +51911,13 @@ function selectColumnsFromTableWhereKeyInNamespaced(columnNames, table, keyColum
|
|
|
51900
51911
|
|
|
51901
51912
|
// These const values must be in sync with the latest
|
|
51902
51913
|
// @salesforce/nimbus-plugin-lds/sql schema file
|
|
51903
|
-
const TABLE_NAME$1 = 'lds_data';
|
|
51914
|
+
const TABLE_NAME$1$1 = 'lds_data';
|
|
51904
51915
|
const COLUMN_NAME_KEY$2 = 'key';
|
|
51905
51916
|
const COLUMN_NAME_DATA$2 = 'data';
|
|
51906
51917
|
const COLUMN_NAME_METADATA$1 = 'metadata';
|
|
51907
51918
|
class LdsDataTable {
|
|
51908
51919
|
constructor(plugin) {
|
|
51909
|
-
this.tableName = TABLE_NAME$1;
|
|
51920
|
+
this.tableName = TABLE_NAME$1$1;
|
|
51910
51921
|
this.columnNames = [COLUMN_NAME_KEY$2, COLUMN_NAME_DATA$2, COLUMN_NAME_METADATA$1];
|
|
51911
51922
|
this.conflictColumnNames = [COLUMN_NAME_KEY$2];
|
|
51912
51923
|
this.getAllQuery = `SELECT ${this.columnNames.join(',')} FROM ${this.tableName}`;
|
|
@@ -51928,7 +51939,7 @@ class LdsDataTable {
|
|
|
51928
51939
|
const [key, stringifiedMetadata] = row;
|
|
51929
51940
|
if (stringifiedMetadata !== undefined) {
|
|
51930
51941
|
entries[key] = {
|
|
51931
|
-
metadata: parse$
|
|
51942
|
+
metadata: parse$3(stringifiedMetadata),
|
|
51932
51943
|
};
|
|
51933
51944
|
}
|
|
51934
51945
|
return entries;
|
|
@@ -51956,7 +51967,7 @@ class LdsDataTable {
|
|
|
51956
51967
|
rows: keys$1(entries).reduce((rows, key) => {
|
|
51957
51968
|
const entry = entries[key];
|
|
51958
51969
|
const { data, metadata } = entry;
|
|
51959
|
-
const row = [key, stringify$
|
|
51970
|
+
const row = [key, stringify$3(data), metadata ? stringify$3(metadata) : null];
|
|
51960
51971
|
rows.push(row);
|
|
51961
51972
|
return rows;
|
|
51962
51973
|
}, []),
|
|
@@ -51974,7 +51985,7 @@ class LdsDataTable {
|
|
|
51974
51985
|
columns: [COLUMN_NAME_METADATA$1],
|
|
51975
51986
|
values: keys$1(entries).reduce((values, key) => {
|
|
51976
51987
|
const { metadata } = entries[key];
|
|
51977
|
-
const row = [metadata ? stringify$
|
|
51988
|
+
const row = [metadata ? stringify$3(metadata) : null];
|
|
51978
51989
|
values[key] = row;
|
|
51979
51990
|
return values;
|
|
51980
51991
|
}, {}),
|
|
@@ -51984,10 +51995,10 @@ class LdsDataTable {
|
|
|
51984
51995
|
return sqliteResult.rows.reduce((entries, row) => {
|
|
51985
51996
|
const [key, stringifiedData, stringifiedMetadata] = row;
|
|
51986
51997
|
const durableStoreEntry = {
|
|
51987
|
-
data: parse$
|
|
51998
|
+
data: parse$3(stringifiedData),
|
|
51988
51999
|
};
|
|
51989
52000
|
if (stringifiedMetadata !== null) {
|
|
51990
|
-
durableStoreEntry.metadata = parse$
|
|
52001
|
+
durableStoreEntry.metadata = parse$3(stringifiedMetadata);
|
|
51991
52002
|
}
|
|
51992
52003
|
entries[key] = durableStoreEntry;
|
|
51993
52004
|
return entries;
|
|
@@ -52037,7 +52048,7 @@ class LdsInternalDataTable {
|
|
|
52037
52048
|
const [key, stringifiedMetadata] = row;
|
|
52038
52049
|
if (stringifiedMetadata !== undefined) {
|
|
52039
52050
|
entries[key] = {
|
|
52040
|
-
metadata: parse$
|
|
52051
|
+
metadata: parse$3(stringifiedMetadata),
|
|
52041
52052
|
};
|
|
52042
52053
|
}
|
|
52043
52054
|
return entries;
|
|
@@ -52065,9 +52076,9 @@ class LdsInternalDataTable {
|
|
|
52065
52076
|
rows: keys$1(entries).reduce((rows, key) => {
|
|
52066
52077
|
const entry = entries[key];
|
|
52067
52078
|
const { data, metadata } = entry;
|
|
52068
|
-
const row = [key, stringify$
|
|
52079
|
+
const row = [key, stringify$3(data)];
|
|
52069
52080
|
if (metadata) {
|
|
52070
|
-
row.push(stringify$
|
|
52081
|
+
row.push(stringify$3(metadata));
|
|
52071
52082
|
}
|
|
52072
52083
|
else {
|
|
52073
52084
|
row.push(null);
|
|
@@ -52090,7 +52101,7 @@ class LdsInternalDataTable {
|
|
|
52090
52101
|
columns: [COLUMN_NAME_METADATA],
|
|
52091
52102
|
values: keys$1(entries).reduce((values, key) => {
|
|
52092
52103
|
const { metadata } = entries[key];
|
|
52093
|
-
const row = [metadata ? stringify$
|
|
52104
|
+
const row = [metadata ? stringify$3(metadata) : null];
|
|
52094
52105
|
values[key] = row;
|
|
52095
52106
|
return values;
|
|
52096
52107
|
}, {}),
|
|
@@ -52102,7 +52113,7 @@ class LdsInternalDataTable {
|
|
|
52102
52113
|
if (metadata !== undefined) {
|
|
52103
52114
|
accu.push({
|
|
52104
52115
|
sql: `UPDATE ${this.tableName} SET ${COLUMN_NAME_METADATA} = ? WHERE (${COLUMN_NAME_KEY$1} IS ? AND ${COLUMN_NAME_NAMESPACE} IS ?)`,
|
|
52105
|
-
params: [stringify$
|
|
52116
|
+
params: [stringify$3(metadata), key, segment],
|
|
52106
52117
|
change: {
|
|
52107
52118
|
ids: [key],
|
|
52108
52119
|
segment,
|
|
@@ -52118,10 +52129,10 @@ class LdsInternalDataTable {
|
|
|
52118
52129
|
return sqliteResult.rows.reduce((entries, row) => {
|
|
52119
52130
|
const [key, stringifiedData, stringifiedMetadata] = row;
|
|
52120
52131
|
const durableStoreEntry = {
|
|
52121
|
-
data: parse$
|
|
52132
|
+
data: parse$3(stringifiedData),
|
|
52122
52133
|
};
|
|
52123
52134
|
if (stringifiedMetadata !== null) {
|
|
52124
|
-
durableStoreEntry.metadata = parse$
|
|
52135
|
+
durableStoreEntry.metadata = parse$3(stringifiedMetadata);
|
|
52125
52136
|
}
|
|
52126
52137
|
entries[key] = durableStoreEntry;
|
|
52127
52138
|
return entries;
|
|
@@ -52349,7 +52360,7 @@ class AbstractKeyValueDataTable {
|
|
|
52349
52360
|
columns: this.columnNames,
|
|
52350
52361
|
rows: keys$1(entries).reduce((rows, key) => {
|
|
52351
52362
|
const entry = entries[key];
|
|
52352
|
-
rows.push([key, stringify$
|
|
52363
|
+
rows.push([key, stringify$3(entry.data)]);
|
|
52353
52364
|
return rows;
|
|
52354
52365
|
}, []),
|
|
52355
52366
|
};
|
|
@@ -52362,7 +52373,7 @@ class AbstractKeyValueDataTable {
|
|
|
52362
52373
|
return sqliteResult.rows.reduce((entries, row) => {
|
|
52363
52374
|
const [key, stringifiedData] = row;
|
|
52364
52375
|
const durableStoreEntry = {
|
|
52365
|
-
data: parse$
|
|
52376
|
+
data: parse$3(stringifiedData),
|
|
52366
52377
|
};
|
|
52367
52378
|
entries[key] = durableStoreEntry;
|
|
52368
52379
|
return entries;
|
|
@@ -52372,10 +52383,10 @@ class AbstractKeyValueDataTable {
|
|
|
52372
52383
|
|
|
52373
52384
|
// These const values must be in sync with the latest
|
|
52374
52385
|
// @salesforce/nimbus-plugin-lds/sql schema file
|
|
52375
|
-
const TABLE_NAME = 'lds_env_drafts';
|
|
52386
|
+
const TABLE_NAME$1 = 'lds_env_drafts';
|
|
52376
52387
|
class LdsDraftsDataTable extends AbstractKeyValueDataTable {
|
|
52377
52388
|
constructor(plugin) {
|
|
52378
|
-
super(plugin, TABLE_NAME);
|
|
52389
|
+
super(plugin, TABLE_NAME$1);
|
|
52379
52390
|
}
|
|
52380
52391
|
}
|
|
52381
52392
|
|
|
@@ -54153,8 +54164,14 @@ function primingSessionFactory(config) {
|
|
|
54153
54164
|
return instrumentPrimingSession(session);
|
|
54154
54165
|
}
|
|
54155
54166
|
|
|
54156
|
-
|
|
54157
|
-
|
|
54167
|
+
// count will get reset to 0 when the module is instantated again when bootstrapped
|
|
54168
|
+
let aggressiveTrimCount = 0;
|
|
54169
|
+
const DEFAULT_MAX_RECORD_COUNT = aggressiveTrimCountKillSwitchGate.isOpen({ fallback: false })
|
|
54170
|
+
? 10000
|
|
54171
|
+
: 80000;
|
|
54172
|
+
const DEFAULT_MAX_BATCH_SIZE = aggressiveTrimCountKillSwitchGate.isOpen({ fallback: false })
|
|
54173
|
+
? 1000
|
|
54174
|
+
: 200;
|
|
54158
54175
|
async function aggressiveTrim(data, deallocateFn, options = {}) {
|
|
54159
54176
|
const maxStoreRecords = options.maxStoreRecords !== undefined ? options.maxStoreRecords : DEFAULT_MAX_RECORD_COUNT;
|
|
54160
54177
|
const batchSize = options.batchSize !== undefined ? options.batchSize : DEFAULT_MAX_BATCH_SIZE;
|
|
@@ -54186,6 +54203,9 @@ async function aggressiveTrim(data, deallocateFn, options = {}) {
|
|
|
54186
54203
|
const count = await batch();
|
|
54187
54204
|
deallocatedCount = deallocatedCount + count;
|
|
54188
54205
|
}
|
|
54206
|
+
//increment trim count and report metrics
|
|
54207
|
+
aggressiveTrimCount++;
|
|
54208
|
+
reportAggressiveTrimTriggered(aggressiveTrimCount, storeKeyLength, deallocatedCount);
|
|
54189
54209
|
const trimKeysSkipped = makeSetFilteredFromDifference(pendingTrimKeys, (key) => trimKeys.has(key) === false);
|
|
54190
54210
|
return {
|
|
54191
54211
|
deallocatedCount,
|
|
@@ -54228,7 +54248,7 @@ function setupObserver() {
|
|
|
54228
54248
|
registerReportObserver((report) => {
|
|
54229
54249
|
__nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
|
|
54230
54250
|
name: report.adapterName,
|
|
54231
|
-
serializedConfig: stringify$
|
|
54251
|
+
serializedConfig: stringify$5(report.config),
|
|
54232
54252
|
status: report.result,
|
|
54233
54253
|
duration: report.executionTime,
|
|
54234
54254
|
});
|
|
@@ -54349,7 +54369,7 @@ function transformConfiguration$1(config) {
|
|
|
54349
54369
|
// Make a copy of the config before running transform to avoid mutating the original config
|
|
54350
54370
|
const adapterConfigCopy = {
|
|
54351
54371
|
...config,
|
|
54352
|
-
query: parse$
|
|
54372
|
+
query: parse$8(print(config.query))
|
|
54353
54373
|
};
|
|
54354
54374
|
return {
|
|
54355
54375
|
...adapterConfigCopy,
|
|
@@ -54727,7 +54747,7 @@ function transformConfiguration(config) {
|
|
|
54727
54747
|
const batchQueryTransformed = config.batchQuery.map((singleConfig) => {
|
|
54728
54748
|
return {
|
|
54729
54749
|
...singleConfig,
|
|
54730
|
-
query: applyMinimumFieldsToQuery(parse$
|
|
54750
|
+
query: applyMinimumFieldsToQuery(parse$8(print(singleConfig.query))), // Stringifies and parses again to avoid mutating original. Should we just JSON.stringify to avoid the dependency on the parser?
|
|
54731
54751
|
};
|
|
54732
54752
|
});
|
|
54733
54753
|
return {
|
|
@@ -55192,7 +55212,7 @@ class SideEffectService {
|
|
|
55192
55212
|
}
|
|
55193
55213
|
|
|
55194
55214
|
function clone(obj) {
|
|
55195
|
-
return parse$
|
|
55215
|
+
return parse$5(stringify$5(obj));
|
|
55196
55216
|
}
|
|
55197
55217
|
|
|
55198
55218
|
/* global __nimbus */
|
|
@@ -55690,7 +55710,7 @@ function createSfsSideEffectHooks(durableRecordStore) {
|
|
|
55690
55710
|
*/
|
|
55691
55711
|
const { create, freeze, keys, entries } = Object;
|
|
55692
55712
|
const { isArray: isArray$1 } = Array;
|
|
55693
|
-
const { stringify: stringify$
|
|
55713
|
+
const { stringify: stringify$2, parse: parse$2 } = JSON;
|
|
55694
55714
|
const LogLevelMap = {
|
|
55695
55715
|
TRACE: 4,
|
|
55696
55716
|
DEBUG: 3,
|
|
@@ -55727,7 +55747,7 @@ class ConsoleLogger {
|
|
|
55727
55747
|
this.printer(this.formatter(level, message));
|
|
55728
55748
|
}
|
|
55729
55749
|
}
|
|
55730
|
-
let Ok$
|
|
55750
|
+
let Ok$1 = class Ok {
|
|
55731
55751
|
constructor(value) {
|
|
55732
55752
|
this.value = value;
|
|
55733
55753
|
}
|
|
@@ -55749,7 +55769,7 @@ let Err$1 = class Err {
|
|
|
55749
55769
|
return !this.isOk();
|
|
55750
55770
|
}
|
|
55751
55771
|
};
|
|
55752
|
-
const ok$
|
|
55772
|
+
const ok$1 = (value) => new Ok$1(value);
|
|
55753
55773
|
const err$1 = (err2) => new Err$1(err2);
|
|
55754
55774
|
function isSubscribableResult(x) {
|
|
55755
55775
|
if (typeof x !== "object" || x === null) {
|
|
@@ -55812,7 +55832,7 @@ function stableJSONStringify(node) {
|
|
|
55812
55832
|
return isFinite(node) ? "" + node : "null";
|
|
55813
55833
|
}
|
|
55814
55834
|
if (typeof node !== "object") {
|
|
55815
|
-
return stringify$
|
|
55835
|
+
return stringify$2(node);
|
|
55816
55836
|
}
|
|
55817
55837
|
let i;
|
|
55818
55838
|
let out;
|
|
@@ -55840,7 +55860,7 @@ function stableJSONStringify(node) {
|
|
|
55840
55860
|
if (out) {
|
|
55841
55861
|
out += ",";
|
|
55842
55862
|
}
|
|
55843
|
-
out += stringify$
|
|
55863
|
+
out += stringify$2(key) + ":" + value;
|
|
55844
55864
|
}
|
|
55845
55865
|
return "{" + out + "}";
|
|
55846
55866
|
}
|
|
@@ -55884,7 +55904,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
55884
55904
|
return err$1(networkResult.error);
|
|
55885
55905
|
} else {
|
|
55886
55906
|
const data = networkResult.value;
|
|
55887
|
-
return ok$
|
|
55907
|
+
return ok$1({
|
|
55888
55908
|
data,
|
|
55889
55909
|
subscribe: (cb) => {
|
|
55890
55910
|
this.subscriptions.push(cb);
|
|
@@ -55903,10 +55923,10 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
55903
55923
|
if (isSubscribableResult(newResult)) {
|
|
55904
55924
|
const value = newResult.value;
|
|
55905
55925
|
this.subscriptions.forEach((cb) => {
|
|
55906
|
-
cb(ok$
|
|
55926
|
+
cb(ok$1(value.data));
|
|
55907
55927
|
});
|
|
55908
55928
|
}
|
|
55909
|
-
return ok$
|
|
55929
|
+
return ok$1(void 0);
|
|
55910
55930
|
}
|
|
55911
55931
|
return err$1(newResult.error);
|
|
55912
55932
|
});
|
|
@@ -55914,7 +55934,7 @@ let NetworkCommand$1 = class NetworkCommand extends BaseCommand {
|
|
|
55914
55934
|
async afterRequestHooks(_options) {
|
|
55915
55935
|
}
|
|
55916
55936
|
};
|
|
55917
|
-
function buildServiceDescriptor$
|
|
55937
|
+
function buildServiceDescriptor$c() {
|
|
55918
55938
|
return {
|
|
55919
55939
|
type: "networkCommandBaseClass",
|
|
55920
55940
|
version: "1.0",
|
|
@@ -55957,7 +55977,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
55957
55977
|
this.afterRequestHooks({ statusCode: 200 });
|
|
55958
55978
|
} catch (e) {
|
|
55959
55979
|
}
|
|
55960
|
-
return ok$
|
|
55980
|
+
return ok$1(auraReturnValue);
|
|
55961
55981
|
}).catch((error) => {
|
|
55962
55982
|
if (!error || !error.getError) {
|
|
55963
55983
|
return err$1(toError("Failed to get error from response"));
|
|
@@ -55976,7 +55996,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
55976
55996
|
(response2) => {
|
|
55977
55997
|
if (response2.ok) {
|
|
55978
55998
|
return response2.json().then(
|
|
55979
|
-
(json) => ok$
|
|
55999
|
+
(json) => ok$1(json),
|
|
55980
56000
|
(reason) => err$1(toError(reason))
|
|
55981
56001
|
).finally(() => {
|
|
55982
56002
|
try {
|
|
@@ -56016,7 +56036,7 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
56016
56036
|
return resolvedPromiseLike$3(err$1(toError("Aura/Fetch network services not found")));
|
|
56017
56037
|
}
|
|
56018
56038
|
}
|
|
56019
|
-
function buildServiceDescriptor$
|
|
56039
|
+
function buildServiceDescriptor$b() {
|
|
56020
56040
|
return {
|
|
56021
56041
|
type: "auraNetworkCommandBaseClass",
|
|
56022
56042
|
version: "1.0",
|
|
@@ -56035,7 +56055,7 @@ function buildServiceDescriptor$a() {
|
|
|
56035
56055
|
* For full license text, see the LICENSE.txt file
|
|
56036
56056
|
*/
|
|
56037
56057
|
const { isArray } = Array;
|
|
56038
|
-
|
|
56058
|
+
class Ok {
|
|
56039
56059
|
constructor(value) {
|
|
56040
56060
|
this.value = value;
|
|
56041
56061
|
}
|
|
@@ -56045,7 +56065,7 @@ let Ok$1 = class Ok {
|
|
|
56045
56065
|
isErr() {
|
|
56046
56066
|
return !this.isOk();
|
|
56047
56067
|
}
|
|
56048
|
-
}
|
|
56068
|
+
}
|
|
56049
56069
|
class Err {
|
|
56050
56070
|
constructor(error) {
|
|
56051
56071
|
this.error = error;
|
|
@@ -56057,7 +56077,7 @@ class Err {
|
|
|
56057
56077
|
return !this.isOk();
|
|
56058
56078
|
}
|
|
56059
56079
|
}
|
|
56060
|
-
const ok
|
|
56080
|
+
const ok = (value) => new Ok(value);
|
|
56061
56081
|
const err = (err2) => new Err(err2);
|
|
56062
56082
|
function resolvedPromiseLike$2(result) {
|
|
56063
56083
|
if (isPromiseLike$2(result)) {
|
|
@@ -56148,6 +56168,38 @@ function setOverlaps(setA, setB) {
|
|
|
56148
56168
|
}
|
|
56149
56169
|
return false;
|
|
56150
56170
|
}
|
|
56171
|
+
class CacheControlRequestRunner {
|
|
56172
|
+
constructor(readFromCache, requestFromNetwork, writeToCache) {
|
|
56173
|
+
this.readFromCacheInternal = readFromCache;
|
|
56174
|
+
this.requestFromNetworkInternal = requestFromNetwork;
|
|
56175
|
+
this.writeToCacheInternal = writeToCache;
|
|
56176
|
+
}
|
|
56177
|
+
readFromCache(cache) {
|
|
56178
|
+
const resultPromise = this.readFromCacheInternal(cache);
|
|
56179
|
+
return resultPromise.then((result) => {
|
|
56180
|
+
if (result.isErr()) {
|
|
56181
|
+
return err(result.error);
|
|
56182
|
+
}
|
|
56183
|
+
this.returnData = result;
|
|
56184
|
+
return ok(void 0);
|
|
56185
|
+
});
|
|
56186
|
+
}
|
|
56187
|
+
requestFromNetwork() {
|
|
56188
|
+
const that = this;
|
|
56189
|
+
return async function* () {
|
|
56190
|
+
const result = await that.requestFromNetworkInternal();
|
|
56191
|
+
if (result.isErr()) {
|
|
56192
|
+
that.networkError = result;
|
|
56193
|
+
} else {
|
|
56194
|
+
that.networkData = result;
|
|
56195
|
+
}
|
|
56196
|
+
yield result;
|
|
56197
|
+
}();
|
|
56198
|
+
}
|
|
56199
|
+
writeToCache(cache, networkResult) {
|
|
56200
|
+
return this.writeToCacheInternal(cache, networkResult);
|
|
56201
|
+
}
|
|
56202
|
+
}
|
|
56151
56203
|
class CacheControlCommand extends BaseCommand {
|
|
56152
56204
|
constructor(services) {
|
|
56153
56205
|
super();
|
|
@@ -56167,57 +56219,48 @@ class CacheControlCommand extends BaseCommand {
|
|
|
56167
56219
|
this.cacheControlStrategyConfig,
|
|
56168
56220
|
overrides
|
|
56169
56221
|
);
|
|
56170
|
-
|
|
56171
|
-
let returnError;
|
|
56172
|
-
const requestRunner = {
|
|
56173
|
-
readFromCache: (cache) => {
|
|
56174
|
-
const resultPromise2 = this.buildResultWithSubscribe(cache);
|
|
56175
|
-
return resultPromise2.then((result) => {
|
|
56176
|
-
if (result.isErr()) {
|
|
56177
|
-
return err(result.error);
|
|
56178
|
-
}
|
|
56179
|
-
returnData = result;
|
|
56180
|
-
return ok$1(void 0);
|
|
56181
|
-
});
|
|
56182
|
-
},
|
|
56183
|
-
requestFromNetwork: () => {
|
|
56184
|
-
const that = this;
|
|
56185
|
-
return async function* () {
|
|
56186
|
-
const result = await that.requestFromNetwork();
|
|
56187
|
-
if (result.isErr()) {
|
|
56188
|
-
returnError = result;
|
|
56189
|
-
}
|
|
56190
|
-
yield result;
|
|
56191
|
-
}();
|
|
56192
|
-
},
|
|
56193
|
-
writeToCache: (cache, networkResult) => {
|
|
56194
|
-
return this.writeToCacheAndRecordKeys(cache, networkResult);
|
|
56195
|
-
}
|
|
56196
|
-
};
|
|
56222
|
+
const requestRunner = this.buildRequestRunner();
|
|
56197
56223
|
const resultPromise = this.services.cacheController.execute(mergedCacheControlConfig, requestRunner, {
|
|
56198
56224
|
instrumentationAttributes: this.instrumentationAttributes
|
|
56199
56225
|
});
|
|
56200
56226
|
return resultPromise.then((result) => {
|
|
56201
|
-
return this.
|
|
56202
|
-
|
|
56203
|
-
|
|
56204
|
-
|
|
56205
|
-
|
|
56206
|
-
|
|
56207
|
-
|
|
56208
|
-
|
|
56209
|
-
|
|
56210
|
-
|
|
56211
|
-
if (
|
|
56212
|
-
return
|
|
56227
|
+
return this.handleCacheControllerResult(result, requestRunner);
|
|
56228
|
+
});
|
|
56229
|
+
}
|
|
56230
|
+
handleCacheControllerResult(result, requestRunner) {
|
|
56231
|
+
const { networkError, networkData, returnData } = requestRunner;
|
|
56232
|
+
return this.publishUpdatedKeys().then(() => {
|
|
56233
|
+
if (networkError) {
|
|
56234
|
+
return networkError;
|
|
56235
|
+
}
|
|
56236
|
+
if (result.isErr()) {
|
|
56237
|
+
if (networkData) {
|
|
56238
|
+
return this.constructSubscribableResult(networkData.value);
|
|
56213
56239
|
}
|
|
56214
|
-
|
|
56215
|
-
|
|
56240
|
+
return err(result.error);
|
|
56241
|
+
}
|
|
56242
|
+
if (this.subscriptions.length > 0) {
|
|
56243
|
+
this.subscribeToKeysUsed();
|
|
56244
|
+
}
|
|
56245
|
+
if (returnData === void 0) {
|
|
56246
|
+
if (networkData) {
|
|
56247
|
+
return this.constructSubscribableResult(networkData.value);
|
|
56216
56248
|
}
|
|
56217
|
-
return
|
|
56218
|
-
}
|
|
56249
|
+
return err(new Error("Cache miss after fetching from network"));
|
|
56250
|
+
}
|
|
56251
|
+
if (returnData.isOk() && this.lastEmittedData === void 0) {
|
|
56252
|
+
this.lastEmittedData = returnData.value.data;
|
|
56253
|
+
}
|
|
56254
|
+
return returnData;
|
|
56219
56255
|
});
|
|
56220
56256
|
}
|
|
56257
|
+
buildRequestRunner() {
|
|
56258
|
+
return new CacheControlRequestRunner(
|
|
56259
|
+
(cache) => this.buildResultWithSubscribe(cache),
|
|
56260
|
+
() => this.requestFromNetwork(),
|
|
56261
|
+
(cache, networkResult) => this.writeToCacheAndRecordKeys(cache, networkResult)
|
|
56262
|
+
);
|
|
56263
|
+
}
|
|
56221
56264
|
publishUpdatedKeys() {
|
|
56222
56265
|
if (this.services.pubSub) {
|
|
56223
56266
|
if (this.keysUpdated !== void 0 && this.keysUpdated.size > 0) {
|
|
@@ -56268,7 +56311,7 @@ class CacheControlCommand extends BaseCommand {
|
|
|
56268
56311
|
if (result.isErr()) {
|
|
56269
56312
|
return err(result.error);
|
|
56270
56313
|
}
|
|
56271
|
-
return ok
|
|
56314
|
+
return ok(void 0);
|
|
56272
56315
|
});
|
|
56273
56316
|
}
|
|
56274
56317
|
writeToCacheAndRecordKeys(cache, networkResult) {
|
|
@@ -56276,7 +56319,7 @@ class CacheControlCommand extends BaseCommand {
|
|
|
56276
56319
|
return this.writeToCache(recordableCache, networkResult).then((result) => {
|
|
56277
56320
|
this.instantiationTime = Date.now() / 1e3;
|
|
56278
56321
|
this.keysUpdated = recordableCache.keysUpdated;
|
|
56279
|
-
return ok
|
|
56322
|
+
return ok(result);
|
|
56280
56323
|
});
|
|
56281
56324
|
}
|
|
56282
56325
|
buildResultWithSubscribe(cache) {
|
|
@@ -56288,14 +56331,18 @@ class CacheControlCommand extends BaseCommand {
|
|
|
56288
56331
|
} else {
|
|
56289
56332
|
const data = readResult.value;
|
|
56290
56333
|
this.keysUsed = recordableCache.keysRead;
|
|
56291
|
-
return
|
|
56292
|
-
data,
|
|
56293
|
-
subscribe: this.buildSubscribe(),
|
|
56294
|
-
refresh: () => this.refresh()
|
|
56295
|
-
});
|
|
56334
|
+
return this.constructSubscribableResult(data);
|
|
56296
56335
|
}
|
|
56297
56336
|
});
|
|
56298
56337
|
}
|
|
56338
|
+
constructSubscribableResult(data) {
|
|
56339
|
+
return ok({
|
|
56340
|
+
data,
|
|
56341
|
+
// this cast is in case we need to return Network data as a fallback for caching errors
|
|
56342
|
+
subscribe: this.buildSubscribe(),
|
|
56343
|
+
refresh: () => this.refresh()
|
|
56344
|
+
});
|
|
56345
|
+
}
|
|
56299
56346
|
/**
|
|
56300
56347
|
* Builds a function that subscribes to cache changes via the pubsub service. Whenever
|
|
56301
56348
|
* relevant cache updates occur, it re-reads the data and compares it against
|
|
@@ -56327,7 +56374,7 @@ class CacheControlCommand extends BaseCommand {
|
|
|
56327
56374
|
}
|
|
56328
56375
|
if (!this.equals(this.lastEmittedData, result.value.data)) {
|
|
56329
56376
|
this.lastEmittedData = result.value.data;
|
|
56330
|
-
this.invokeConsumerCallbacks(ok
|
|
56377
|
+
this.invokeConsumerCallbacks(ok(result.value.data));
|
|
56331
56378
|
}
|
|
56332
56379
|
return result;
|
|
56333
56380
|
});
|
|
@@ -56415,7 +56462,7 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
|
|
|
56415
56462
|
this.afterRequestHooks({ statusCode: 200 });
|
|
56416
56463
|
} catch (e) {
|
|
56417
56464
|
}
|
|
56418
|
-
return ok$
|
|
56465
|
+
return ok$1(auraReturnValue);
|
|
56419
56466
|
}).catch((error) => {
|
|
56420
56467
|
if (!error || !error.getError) {
|
|
56421
56468
|
return err$1(toError("Failed to get error from response"));
|
|
@@ -56434,7 +56481,7 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
|
|
|
56434
56481
|
(response2) => {
|
|
56435
56482
|
if (response2.ok) {
|
|
56436
56483
|
return response2.json().then(
|
|
56437
|
-
(json) => ok$
|
|
56484
|
+
(json) => ok$1(json),
|
|
56438
56485
|
(reason) => err$1(toError(reason))
|
|
56439
56486
|
).finally(() => {
|
|
56440
56487
|
try {
|
|
@@ -56466,10 +56513,10 @@ class AuraNormalizedCacheControlCommand extends AuraCacheControlCommand$1 {
|
|
|
56466
56513
|
const data = this.buildResultType().query(cache, this.buildQuery());
|
|
56467
56514
|
if (data.isErr()) {
|
|
56468
56515
|
return resolvedPromiseLike$3(
|
|
56469
|
-
err$1(new Error(`Failed to build data from type: ${stringify$
|
|
56516
|
+
err$1(new Error(`Failed to build data from type: ${stringify$2(data.error)}`))
|
|
56470
56517
|
);
|
|
56471
56518
|
}
|
|
56472
|
-
return resolvedPromiseLike$3(ok$
|
|
56519
|
+
return resolvedPromiseLike$3(ok$1(data.value));
|
|
56473
56520
|
}
|
|
56474
56521
|
writeToCache(cache, networkResult) {
|
|
56475
56522
|
if (networkResult.isOk()) {
|
|
@@ -56481,7 +56528,7 @@ class AuraNormalizedCacheControlCommand extends AuraCacheControlCommand$1 {
|
|
|
56481
56528
|
return resolvedPromiseLike$3(void 0);
|
|
56482
56529
|
}
|
|
56483
56530
|
}
|
|
56484
|
-
function buildServiceDescriptor$
|
|
56531
|
+
function buildServiceDescriptor$a() {
|
|
56485
56532
|
return {
|
|
56486
56533
|
type: "auraNormalizedCacheControlCommand",
|
|
56487
56534
|
version: "1.0",
|
|
@@ -56546,7 +56593,7 @@ class AuraCacheControlCommand extends CacheControlCommand {
|
|
|
56546
56593
|
this.afterRequestHooks({ statusCode: 200 });
|
|
56547
56594
|
} catch (e) {
|
|
56548
56595
|
}
|
|
56549
|
-
return ok$
|
|
56596
|
+
return ok$1(auraReturnValue);
|
|
56550
56597
|
}).catch((error) => {
|
|
56551
56598
|
if (!error || !error.getError) {
|
|
56552
56599
|
return err$1(toError("Failed to get error from response"));
|
|
@@ -56565,7 +56612,7 @@ class AuraCacheControlCommand extends CacheControlCommand {
|
|
|
56565
56612
|
(response2) => {
|
|
56566
56613
|
if (response2.ok) {
|
|
56567
56614
|
return response2.json().then(
|
|
56568
|
-
(json) => ok$
|
|
56615
|
+
(json) => ok$1(json),
|
|
56569
56616
|
(reason) => err$1(toError(reason))
|
|
56570
56617
|
).finally(() => {
|
|
56571
56618
|
try {
|
|
@@ -56602,7 +56649,7 @@ class AuraResourceCacheControlCommand extends AuraCacheControlCommand {
|
|
|
56602
56649
|
if (data === void 0) {
|
|
56603
56650
|
return resolvedPromiseLike$3(err$1(new Error("Failed to find data in cache")));
|
|
56604
56651
|
}
|
|
56605
|
-
return resolvedPromiseLike$3(ok$
|
|
56652
|
+
return resolvedPromiseLike$3(ok$1(data));
|
|
56606
56653
|
}
|
|
56607
56654
|
writeToCache(cache, networkResult) {
|
|
56608
56655
|
if (networkResult.isOk()) {
|
|
@@ -56619,7 +56666,7 @@ class AuraResourceCacheControlCommand extends AuraCacheControlCommand {
|
|
|
56619
56666
|
return `{"endpoint":${this.endpoint},"params":${stableJSONStringify(this.auraParams)}}`;
|
|
56620
56667
|
}
|
|
56621
56668
|
}
|
|
56622
|
-
function buildServiceDescriptor$
|
|
56669
|
+
function buildServiceDescriptor$9() {
|
|
56623
56670
|
return {
|
|
56624
56671
|
type: "auraResourceCacheControlCommand",
|
|
56625
56672
|
version: "1.0",
|
|
@@ -56657,7 +56704,7 @@ class NetworkCommand extends BaseCommand {
|
|
|
56657
56704
|
return err$1(networkResult.error);
|
|
56658
56705
|
} else {
|
|
56659
56706
|
const data = networkResult.value;
|
|
56660
|
-
return ok$
|
|
56707
|
+
return ok$1({
|
|
56661
56708
|
data,
|
|
56662
56709
|
subscribe: (cb) => {
|
|
56663
56710
|
this.subscriptions.push(cb);
|
|
@@ -56676,10 +56723,10 @@ class NetworkCommand extends BaseCommand {
|
|
|
56676
56723
|
if (isSubscribableResult(newResult)) {
|
|
56677
56724
|
const value = newResult.value;
|
|
56678
56725
|
this.subscriptions.forEach((cb) => {
|
|
56679
|
-
cb(ok$
|
|
56726
|
+
cb(ok$1(value.data));
|
|
56680
56727
|
});
|
|
56681
56728
|
}
|
|
56682
|
-
return ok$
|
|
56729
|
+
return ok$1(void 0);
|
|
56683
56730
|
}
|
|
56684
56731
|
return err$1(newResult.error);
|
|
56685
56732
|
});
|
|
@@ -56703,7 +56750,7 @@ class FetchNetworkCommand extends NetworkCommand {
|
|
|
56703
56750
|
(response2) => {
|
|
56704
56751
|
if (response2.ok) {
|
|
56705
56752
|
return response2.json().then(
|
|
56706
|
-
(json) => ok$
|
|
56753
|
+
(json) => ok$1(json),
|
|
56707
56754
|
(reason) => err$1(toError(reason))
|
|
56708
56755
|
).finally(() => {
|
|
56709
56756
|
try {
|
|
@@ -56726,7 +56773,7 @@ class FetchNetworkCommand extends NetworkCommand {
|
|
|
56726
56773
|
);
|
|
56727
56774
|
}
|
|
56728
56775
|
}
|
|
56729
|
-
function buildServiceDescriptor$
|
|
56776
|
+
function buildServiceDescriptor$8() {
|
|
56730
56777
|
return {
|
|
56731
56778
|
type: "fetchNetworkCommandBaseClass",
|
|
56732
56779
|
version: "1.0",
|
|
@@ -56763,7 +56810,7 @@ class HttpCacheControlCommand extends CacheControlCommand {
|
|
|
56763
56810
|
(response2) => {
|
|
56764
56811
|
if (response2.ok) {
|
|
56765
56812
|
return response2.json().then(
|
|
56766
|
-
(json) => ok$
|
|
56813
|
+
(json) => ok$1(json),
|
|
56767
56814
|
(reason) => err$1(toError(reason))
|
|
56768
56815
|
).finally(() => {
|
|
56769
56816
|
try {
|
|
@@ -56795,10 +56842,10 @@ class HttpNormalizedCacheControlCommand extends HttpCacheControlCommand {
|
|
|
56795
56842
|
const data = this.buildResultType().query(cache, this.buildQuery());
|
|
56796
56843
|
if (data.isErr()) {
|
|
56797
56844
|
return resolvedPromiseLike$3(
|
|
56798
|
-
err$1(new Error(`Failed to build data from type: ${stringify$
|
|
56845
|
+
err$1(new Error(`Failed to build data from type: ${stringify$2(data.error)}`))
|
|
56799
56846
|
);
|
|
56800
56847
|
}
|
|
56801
|
-
return resolvedPromiseLike$3(ok$
|
|
56848
|
+
return resolvedPromiseLike$3(ok$1(data.value));
|
|
56802
56849
|
}
|
|
56803
56850
|
writeToCache(cache, networkResult) {
|
|
56804
56851
|
if (networkResult.isOk()) {
|
|
@@ -56810,7 +56857,7 @@ class HttpNormalizedCacheControlCommand extends HttpCacheControlCommand {
|
|
|
56810
56857
|
return resolvedPromiseLike$3(void 0);
|
|
56811
56858
|
}
|
|
56812
56859
|
}
|
|
56813
|
-
function buildServiceDescriptor$
|
|
56860
|
+
function buildServiceDescriptor$7() {
|
|
56814
56861
|
return {
|
|
56815
56862
|
type: "httpNormalizedCacheControlCommand",
|
|
56816
56863
|
version: "1.0",
|
|
@@ -56828,12 +56875,12 @@ function buildServiceDescriptor$6() {
|
|
|
56828
56875
|
* All rights reserved.
|
|
56829
56876
|
* For full license text, see the LICENSE.txt file
|
|
56830
56877
|
*/
|
|
56831
|
-
const { stringify, parse } = JSON;
|
|
56832
|
-
function deepCopy(x) {
|
|
56833
|
-
const stringified = stringify(x);
|
|
56834
|
-
return stringified ? parse(stringified) : void 0;
|
|
56878
|
+
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
56879
|
+
function deepCopy$1(x) {
|
|
56880
|
+
const stringified = stringify$1(x);
|
|
56881
|
+
return stringified ? parse$1(stringified) : void 0;
|
|
56835
56882
|
}
|
|
56836
|
-
class DefaultRecordableCache {
|
|
56883
|
+
let DefaultRecordableCache$1 = class DefaultRecordableCache {
|
|
56837
56884
|
constructor(baseCache) {
|
|
56838
56885
|
this.baseCache = baseCache;
|
|
56839
56886
|
this.keysRead = /* @__PURE__ */ new Set();
|
|
@@ -56852,7 +56899,7 @@ class DefaultRecordableCache {
|
|
|
56852
56899
|
this.missingKeysRead.add(key);
|
|
56853
56900
|
}
|
|
56854
56901
|
if (options == null ? void 0 : options.copy) {
|
|
56855
|
-
return deepCopy(value);
|
|
56902
|
+
return deepCopy$1(value);
|
|
56856
56903
|
}
|
|
56857
56904
|
return value;
|
|
56858
56905
|
}
|
|
@@ -56878,13 +56925,13 @@ class DefaultRecordableCache {
|
|
|
56878
56925
|
return new DefaultRecordableCache(this);
|
|
56879
56926
|
}
|
|
56880
56927
|
filter(predicate) {
|
|
56881
|
-
return new DefaultFilteredCache(this, predicate);
|
|
56928
|
+
return new DefaultFilteredCache$1(this, predicate);
|
|
56882
56929
|
}
|
|
56883
56930
|
buildFixedTimeWritableCache(generatedTime) {
|
|
56884
|
-
return new FixedTimeWritableCache(this, generatedTime);
|
|
56931
|
+
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
56885
56932
|
}
|
|
56886
|
-
}
|
|
56887
|
-
class DefaultFilteredCache {
|
|
56933
|
+
};
|
|
56934
|
+
let DefaultFilteredCache$1 = class DefaultFilteredCache {
|
|
56888
56935
|
constructor(baseCache, predicate) {
|
|
56889
56936
|
this.baseCache = baseCache;
|
|
56890
56937
|
this.predicate = predicate;
|
|
@@ -56896,7 +56943,7 @@ class DefaultFilteredCache {
|
|
|
56896
56943
|
const result = this.baseCache.get(key);
|
|
56897
56944
|
if (result && this.predicate(key, result)) {
|
|
56898
56945
|
if (options == null ? void 0 : options.copy) {
|
|
56899
|
-
return deepCopy(result);
|
|
56946
|
+
return deepCopy$1(result);
|
|
56900
56947
|
}
|
|
56901
56948
|
return result;
|
|
56902
56949
|
}
|
|
@@ -56918,7 +56965,7 @@ class DefaultFilteredCache {
|
|
|
56918
56965
|
return this.getFilteredEntries();
|
|
56919
56966
|
}
|
|
56920
56967
|
record() {
|
|
56921
|
-
return new DefaultRecordableCache(this);
|
|
56968
|
+
return new DefaultRecordableCache$1(this);
|
|
56922
56969
|
}
|
|
56923
56970
|
filter(predicate) {
|
|
56924
56971
|
return new DefaultFilteredCache(this, predicate);
|
|
@@ -56938,10 +56985,10 @@ class DefaultFilteredCache {
|
|
|
56938
56985
|
return filteredKeySet;
|
|
56939
56986
|
}
|
|
56940
56987
|
buildFixedTimeWritableCache(generatedTime) {
|
|
56941
|
-
return new FixedTimeWritableCache(this, generatedTime);
|
|
56988
|
+
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
56942
56989
|
}
|
|
56943
|
-
}
|
|
56944
|
-
class FixedTimeWritableCache {
|
|
56990
|
+
};
|
|
56991
|
+
let FixedTimeWritableCache$1 = class FixedTimeWritableCache {
|
|
56945
56992
|
constructor(baseCache, generatedTime) {
|
|
56946
56993
|
this.baseCache = baseCache;
|
|
56947
56994
|
this.generatedTime = generatedTime;
|
|
@@ -56977,22 +57024,22 @@ class FixedTimeWritableCache {
|
|
|
56977
57024
|
return this.baseCache.entries();
|
|
56978
57025
|
}
|
|
56979
57026
|
record() {
|
|
56980
|
-
return new DefaultRecordableCache(this);
|
|
57027
|
+
return new DefaultRecordableCache$1(this);
|
|
56981
57028
|
}
|
|
56982
57029
|
filter(predicate) {
|
|
56983
|
-
return new DefaultFilteredCache(this, predicate);
|
|
57030
|
+
return new DefaultFilteredCache$1(this, predicate);
|
|
56984
57031
|
}
|
|
56985
57032
|
buildFixedTimeWritableCache(generatedTime) {
|
|
56986
57033
|
return new FixedTimeWritableCache(this, generatedTime);
|
|
56987
57034
|
}
|
|
56988
|
-
}
|
|
56989
|
-
class DefaultCache {
|
|
57035
|
+
};
|
|
57036
|
+
let DefaultCache$1 = class DefaultCache {
|
|
56990
57037
|
constructor() {
|
|
56991
57038
|
this.data = {};
|
|
56992
57039
|
}
|
|
56993
57040
|
get(key, options) {
|
|
56994
57041
|
if (options == null ? void 0 : options.copy) {
|
|
56995
|
-
return deepCopy(this.data[key]);
|
|
57042
|
+
return deepCopy$1(this.data[key]);
|
|
56996
57043
|
}
|
|
56997
57044
|
return this.data[key];
|
|
56998
57045
|
}
|
|
@@ -57054,20 +57101,20 @@ class DefaultCache {
|
|
|
57054
57101
|
return Object.entries(this.data);
|
|
57055
57102
|
}
|
|
57056
57103
|
record() {
|
|
57057
|
-
return new DefaultRecordableCache(this);
|
|
57104
|
+
return new DefaultRecordableCache$1(this);
|
|
57058
57105
|
}
|
|
57059
57106
|
filter(predicate) {
|
|
57060
|
-
return new DefaultFilteredCache(this, predicate);
|
|
57107
|
+
return new DefaultFilteredCache$1(this, predicate);
|
|
57061
57108
|
}
|
|
57062
57109
|
buildFixedTimeWritableCache(generatedTime) {
|
|
57063
|
-
return new FixedTimeWritableCache(this, generatedTime);
|
|
57110
|
+
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
57064
57111
|
}
|
|
57065
|
-
}
|
|
57066
|
-
function buildServiceDescriptor$
|
|
57112
|
+
};
|
|
57113
|
+
function buildServiceDescriptor$6() {
|
|
57067
57114
|
return {
|
|
57068
57115
|
type: "cache",
|
|
57069
57116
|
version: "1.0",
|
|
57070
|
-
service: new DefaultCache()
|
|
57117
|
+
service: new DefaultCache$1()
|
|
57071
57118
|
};
|
|
57072
57119
|
}
|
|
57073
57120
|
|
|
@@ -57100,7 +57147,7 @@ class NoCacheCacheControlStrategy extends CacheControlStrategy {
|
|
|
57100
57147
|
const tempCache = this.filteredCache;
|
|
57101
57148
|
return new Promise(async (resolve, reject) => {
|
|
57102
57149
|
try {
|
|
57103
|
-
let readResult = ok$
|
|
57150
|
+
let readResult = ok$1(void 0);
|
|
57104
57151
|
for await (const rfnResult of this.requestRunner.requestFromNetwork()) {
|
|
57105
57152
|
if (rfnResult) {
|
|
57106
57153
|
const result = await this.services.cacheInclusionPolicy.write({
|
|
@@ -57138,13 +57185,13 @@ class MaxAgeCacheControlStrategy extends CacheControlStrategy {
|
|
|
57138
57185
|
startTime,
|
|
57139
57186
|
options == null ? void 0 : options.instrumentationAttributes
|
|
57140
57187
|
);
|
|
57141
|
-
return ok$
|
|
57188
|
+
return ok$1(void 0);
|
|
57142
57189
|
}
|
|
57143
57190
|
this.collectCacheMissInstrumentation(startTime, options == null ? void 0 : options.instrumentationAttributes);
|
|
57144
57191
|
const tempCache = this.filteredCache;
|
|
57145
57192
|
return new Promise(async (resolve, reject) => {
|
|
57146
57193
|
try {
|
|
57147
|
-
let readResult = ok$
|
|
57194
|
+
let readResult = ok$1(void 0);
|
|
57148
57195
|
for await (const rfnResult of this.requestRunner.requestFromNetwork()) {
|
|
57149
57196
|
if (rfnResult) {
|
|
57150
57197
|
const result = await this.services.cacheInclusionPolicy.write({
|
|
@@ -57160,7 +57207,7 @@ class MaxAgeCacheControlStrategy extends CacheControlStrategy {
|
|
|
57160
57207
|
readFromL1: (l1) => this.requestRunner.readFromCache(l1)
|
|
57161
57208
|
});
|
|
57162
57209
|
if (readResult.isOk()) {
|
|
57163
|
-
resolve(ok$
|
|
57210
|
+
resolve(ok$1(void 0));
|
|
57164
57211
|
}
|
|
57165
57212
|
}
|
|
57166
57213
|
return resolve(readResult);
|
|
@@ -57231,7 +57278,7 @@ class CacheController {
|
|
|
57231
57278
|
yield* this.services.cacheInclusionPolicy.findAndModify(query, cacheUpdate);
|
|
57232
57279
|
}
|
|
57233
57280
|
}
|
|
57234
|
-
function buildServiceDescriptor$
|
|
57281
|
+
function buildServiceDescriptor$5(cache, cacheInclusionPolicy) {
|
|
57235
57282
|
return {
|
|
57236
57283
|
type: "cacheController",
|
|
57237
57284
|
version: "1.0",
|
|
@@ -57239,193 +57286,6 @@ function buildServiceDescriptor$4(cache, cacheInclusionPolicy) {
|
|
|
57239
57286
|
};
|
|
57240
57287
|
}
|
|
57241
57288
|
|
|
57242
|
-
/*!
|
|
57243
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57244
|
-
* All rights reserved.
|
|
57245
|
-
* For full license text, see the LICENSE.txt file
|
|
57246
|
-
*/
|
|
57247
|
-
class CacheInclusionPolicyService {
|
|
57248
|
-
}
|
|
57249
|
-
/*!
|
|
57250
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57251
|
-
* All rights reserved.
|
|
57252
|
-
* For full license text, see the LICENSE.txt file
|
|
57253
|
-
*/
|
|
57254
|
-
class Ok {
|
|
57255
|
-
constructor(value) {
|
|
57256
|
-
this.value = value;
|
|
57257
|
-
}
|
|
57258
|
-
isOk() {
|
|
57259
|
-
return true;
|
|
57260
|
-
}
|
|
57261
|
-
isErr() {
|
|
57262
|
-
return !this.isOk();
|
|
57263
|
-
}
|
|
57264
|
-
}
|
|
57265
|
-
const ok = (value) => new Ok(value);
|
|
57266
|
-
function resolvedPromiseLike$1(result) {
|
|
57267
|
-
if (isPromiseLike$1(result)) {
|
|
57268
|
-
return result.then((nextResult) => nextResult);
|
|
57269
|
-
}
|
|
57270
|
-
return {
|
|
57271
|
-
then: (onFulfilled, _onRejected) => {
|
|
57272
|
-
try {
|
|
57273
|
-
return resolvedPromiseLike$1(onFulfilled(result));
|
|
57274
|
-
} catch (e) {
|
|
57275
|
-
if (onFulfilled === void 0) {
|
|
57276
|
-
return resolvedPromiseLike$1(result);
|
|
57277
|
-
}
|
|
57278
|
-
return rejectedPromiseLike$1(e);
|
|
57279
|
-
}
|
|
57280
|
-
}
|
|
57281
|
-
};
|
|
57282
|
-
}
|
|
57283
|
-
function rejectedPromiseLike$1(reason) {
|
|
57284
|
-
if (isPromiseLike$1(reason)) {
|
|
57285
|
-
return reason.then((nextResult) => nextResult);
|
|
57286
|
-
}
|
|
57287
|
-
return {
|
|
57288
|
-
then: (_onFulfilled, onRejected) => {
|
|
57289
|
-
if (typeof onRejected === "function") {
|
|
57290
|
-
try {
|
|
57291
|
-
return resolvedPromiseLike$1(onRejected(reason));
|
|
57292
|
-
} catch (e) {
|
|
57293
|
-
return rejectedPromiseLike$1(e);
|
|
57294
|
-
}
|
|
57295
|
-
}
|
|
57296
|
-
return rejectedPromiseLike$1(reason);
|
|
57297
|
-
}
|
|
57298
|
-
};
|
|
57299
|
-
}
|
|
57300
|
-
function isPromiseLike$1(x) {
|
|
57301
|
-
return typeof (x == null ? void 0 : x.then) === "function";
|
|
57302
|
-
}
|
|
57303
|
-
const isAndQuery = (query) => "$and" in query;
|
|
57304
|
-
const isOrQuery = (query) => "$or" in query;
|
|
57305
|
-
const isNotQuery = (query) => "$not" in query;
|
|
57306
|
-
const matchesMetadata = (metadataQuery, cacheControl) => {
|
|
57307
|
-
if ("cacheControlType" in metadataQuery && cacheControl.type !== metadataQuery.cacheControlType.$eq) {
|
|
57308
|
-
return false;
|
|
57309
|
-
}
|
|
57310
|
-
if ("maxAge" in metadataQuery && cacheControl.type === "max-age") {
|
|
57311
|
-
const maxAge = cacheControl.maxAge ?? 0;
|
|
57312
|
-
if (metadataQuery.maxAge.$gte !== void 0 && maxAge < metadataQuery.maxAge.$gte || metadataQuery.maxAge.$lte !== void 0 && maxAge > metadataQuery.maxAge.$lte) {
|
|
57313
|
-
return false;
|
|
57314
|
-
}
|
|
57315
|
-
}
|
|
57316
|
-
return true;
|
|
57317
|
-
};
|
|
57318
|
-
function queryToPredicate(query) {
|
|
57319
|
-
return (key, entry) => {
|
|
57320
|
-
if (!query) return false;
|
|
57321
|
-
if (isAndQuery(query))
|
|
57322
|
-
return query.$and.every((subQuery) => queryToPredicate(subQuery)(key, entry));
|
|
57323
|
-
if (isOrQuery(query))
|
|
57324
|
-
return query.$or.some((subQuery) => queryToPredicate(subQuery)(key, entry));
|
|
57325
|
-
if (isNotQuery(query)) return !queryToPredicate(query.$not)(key, entry);
|
|
57326
|
-
if ("key" in query) return matchesKey(query.key, key);
|
|
57327
|
-
if ("metadata" in query)
|
|
57328
|
-
return matchesMetadata(query.metadata, entry.metadata.cacheControl);
|
|
57329
|
-
if ("value" in query) return false;
|
|
57330
|
-
throw new Error("Unknown Query Operation");
|
|
57331
|
-
};
|
|
57332
|
-
}
|
|
57333
|
-
function matchesKey(keyQuery, key) {
|
|
57334
|
-
if ("$regex" in keyQuery) {
|
|
57335
|
-
return keyQuery.$regex.test(key);
|
|
57336
|
-
}
|
|
57337
|
-
return false;
|
|
57338
|
-
}
|
|
57339
|
-
function buildUpdate(update, existing) {
|
|
57340
|
-
switch (update.type) {
|
|
57341
|
-
case "invalidate":
|
|
57342
|
-
const updatedCacheControl = buildInvalidatedCacheControl(
|
|
57343
|
-
existing.metadata.cacheControl
|
|
57344
|
-
);
|
|
57345
|
-
return updatedCacheControl !== void 0 ? { type: "metadata", metadata: updatedCacheControl } : { type: "no-op" };
|
|
57346
|
-
default:
|
|
57347
|
-
throw new Error(`Invalid update operation: ${update.type}`);
|
|
57348
|
-
}
|
|
57349
|
-
}
|
|
57350
|
-
function buildInvalidatedCacheControl(existingCacheControl) {
|
|
57351
|
-
switch (existingCacheControl.type) {
|
|
57352
|
-
case "max-age":
|
|
57353
|
-
case "stale-while-revalidate":
|
|
57354
|
-
if (existingCacheControl.maxAge !== 0) {
|
|
57355
|
-
return {
|
|
57356
|
-
...existingCacheControl,
|
|
57357
|
-
maxAge: 0
|
|
57358
|
-
};
|
|
57359
|
-
}
|
|
57360
|
-
}
|
|
57361
|
-
return void 0;
|
|
57362
|
-
}
|
|
57363
|
-
class InMemoryCacheInclusionPolicy extends CacheInclusionPolicyService {
|
|
57364
|
-
constructor(services) {
|
|
57365
|
-
super();
|
|
57366
|
-
this.services = services;
|
|
57367
|
-
}
|
|
57368
|
-
/**
|
|
57369
|
-
* Reads data out of a single level in memory store.
|
|
57370
|
-
*/
|
|
57371
|
-
read(options) {
|
|
57372
|
-
const { l1, readFromL1 } = options;
|
|
57373
|
-
return readFromL1(l1);
|
|
57374
|
-
}
|
|
57375
|
-
/**
|
|
57376
|
-
* Writes data to a single level in memory store.
|
|
57377
|
-
*/
|
|
57378
|
-
write(options) {
|
|
57379
|
-
const { l1, writeToL1 } = options;
|
|
57380
|
-
return writeToL1(l1);
|
|
57381
|
-
}
|
|
57382
|
-
/**
|
|
57383
|
-
* Finds cache entries that match the given query.
|
|
57384
|
-
* Returns an async generator that yields `[key, entry]`.
|
|
57385
|
-
*/
|
|
57386
|
-
async *find(query) {
|
|
57387
|
-
const cache = this.services.cache;
|
|
57388
|
-
const predicate = queryToPredicate(query);
|
|
57389
|
-
const filteredEntries = cache.filter(predicate).entries();
|
|
57390
|
-
for (const entry of filteredEntries) {
|
|
57391
|
-
yield entry;
|
|
57392
|
-
}
|
|
57393
|
-
}
|
|
57394
|
-
/**
|
|
57395
|
-
* Finds and modifies cache entries that match the given query.
|
|
57396
|
-
* Extends `find(query)` and returns an async generator of modified keys.
|
|
57397
|
-
*/
|
|
57398
|
-
async *findAndModify(query, cacheUpdate) {
|
|
57399
|
-
const cache = this.services.cache;
|
|
57400
|
-
for await (const [key, value] of this.find(query)) {
|
|
57401
|
-
const update = buildUpdate(cacheUpdate, value);
|
|
57402
|
-
switch (update.type) {
|
|
57403
|
-
case "entry":
|
|
57404
|
-
this.write({
|
|
57405
|
-
l1: cache,
|
|
57406
|
-
writeToL1: (l1) => resolvedPromiseLike$1(ok(l1.set(key, update.entry)))
|
|
57407
|
-
});
|
|
57408
|
-
yield key;
|
|
57409
|
-
break;
|
|
57410
|
-
case "metadata":
|
|
57411
|
-
this.write({
|
|
57412
|
-
l1: cache,
|
|
57413
|
-
writeToL1: (l1) => resolvedPromiseLike$1(ok(l1.setMetadata(key, update.metadata)))
|
|
57414
|
-
});
|
|
57415
|
-
yield key;
|
|
57416
|
-
break;
|
|
57417
|
-
}
|
|
57418
|
-
}
|
|
57419
|
-
}
|
|
57420
|
-
}
|
|
57421
|
-
function buildInMemoryCacheInclusionPolicyService(cache) {
|
|
57422
|
-
return {
|
|
57423
|
-
service: new InMemoryCacheInclusionPolicy({ cache }),
|
|
57424
|
-
type: "cacheInclusionPolicy",
|
|
57425
|
-
version: "1.0"
|
|
57426
|
-
};
|
|
57427
|
-
}
|
|
57428
|
-
|
|
57429
57289
|
/*!
|
|
57430
57290
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57431
57291
|
* All rights reserved.
|
|
@@ -57464,7 +57324,7 @@ function buildInstrumentCommand(services) {
|
|
|
57464
57324
|
};
|
|
57465
57325
|
};
|
|
57466
57326
|
}
|
|
57467
|
-
function buildServiceDescriptor$
|
|
57327
|
+
function buildServiceDescriptor$4(instrumentation) {
|
|
57468
57328
|
return {
|
|
57469
57329
|
type: "instrumentCommand",
|
|
57470
57330
|
version: "1.0",
|
|
@@ -57734,7 +57594,7 @@ class O11yInstrumentation {
|
|
|
57734
57594
|
this.metrics = new O11yOTelMetricsAPI(this.services);
|
|
57735
57595
|
}
|
|
57736
57596
|
}
|
|
57737
|
-
function buildServiceDescriptor$
|
|
57597
|
+
function buildServiceDescriptor$3(logger) {
|
|
57738
57598
|
return {
|
|
57739
57599
|
type: "instrumentation",
|
|
57740
57600
|
version: "1.0",
|
|
@@ -57752,41 +57612,41 @@ function buildServiceDescriptor$2(logger) {
|
|
|
57752
57612
|
* All rights reserved.
|
|
57753
57613
|
* For full license text, see the LICENSE.txt file
|
|
57754
57614
|
*/
|
|
57755
|
-
function resolvedPromiseLike(result) {
|
|
57756
|
-
if (isPromiseLike(result)) {
|
|
57615
|
+
function resolvedPromiseLike$1(result) {
|
|
57616
|
+
if (isPromiseLike$1(result)) {
|
|
57757
57617
|
return result.then((nextResult) => nextResult);
|
|
57758
57618
|
}
|
|
57759
57619
|
return {
|
|
57760
57620
|
then: (onFulfilled, _onRejected) => {
|
|
57761
57621
|
try {
|
|
57762
|
-
return resolvedPromiseLike(onFulfilled(result));
|
|
57622
|
+
return resolvedPromiseLike$1(onFulfilled(result));
|
|
57763
57623
|
} catch (e) {
|
|
57764
57624
|
if (onFulfilled === void 0) {
|
|
57765
|
-
return resolvedPromiseLike(result);
|
|
57625
|
+
return resolvedPromiseLike$1(result);
|
|
57766
57626
|
}
|
|
57767
|
-
return rejectedPromiseLike(e);
|
|
57627
|
+
return rejectedPromiseLike$1(e);
|
|
57768
57628
|
}
|
|
57769
57629
|
}
|
|
57770
57630
|
};
|
|
57771
57631
|
}
|
|
57772
|
-
function rejectedPromiseLike(reason) {
|
|
57773
|
-
if (isPromiseLike(reason)) {
|
|
57632
|
+
function rejectedPromiseLike$1(reason) {
|
|
57633
|
+
if (isPromiseLike$1(reason)) {
|
|
57774
57634
|
return reason.then((nextResult) => nextResult);
|
|
57775
57635
|
}
|
|
57776
57636
|
return {
|
|
57777
57637
|
then: (_onFulfilled, onRejected) => {
|
|
57778
57638
|
if (typeof onRejected === "function") {
|
|
57779
57639
|
try {
|
|
57780
|
-
return resolvedPromiseLike(onRejected(reason));
|
|
57640
|
+
return resolvedPromiseLike$1(onRejected(reason));
|
|
57781
57641
|
} catch (e) {
|
|
57782
|
-
return rejectedPromiseLike(e);
|
|
57642
|
+
return rejectedPromiseLike$1(e);
|
|
57783
57643
|
}
|
|
57784
57644
|
}
|
|
57785
|
-
return rejectedPromiseLike(reason);
|
|
57645
|
+
return rejectedPromiseLike$1(reason);
|
|
57786
57646
|
}
|
|
57787
57647
|
};
|
|
57788
57648
|
}
|
|
57789
|
-
function isPromiseLike(x) {
|
|
57649
|
+
function isPromiseLike$1(x) {
|
|
57790
57650
|
return typeof (x == null ? void 0 : x.then) === "function";
|
|
57791
57651
|
}
|
|
57792
57652
|
const EventTypeWildcard = Symbol("EventTypeWildcard");
|
|
@@ -57816,14 +57676,14 @@ class DefaultPubSubService {
|
|
|
57816
57676
|
return;
|
|
57817
57677
|
}
|
|
57818
57678
|
const returnVal = subscription.callback.call(subscription, event);
|
|
57819
|
-
if (isPromiseLike(returnVal)) {
|
|
57679
|
+
if (isPromiseLike$1(returnVal)) {
|
|
57820
57680
|
promises.push(returnVal);
|
|
57821
57681
|
}
|
|
57822
57682
|
});
|
|
57823
57683
|
if (promises.length > 0) {
|
|
57824
57684
|
return Promise.all(promises).then(() => void 0);
|
|
57825
57685
|
}
|
|
57826
|
-
return resolvedPromiseLike(void 0);
|
|
57686
|
+
return resolvedPromiseLike$1(void 0);
|
|
57827
57687
|
}
|
|
57828
57688
|
getSubscriptions(event) {
|
|
57829
57689
|
const eventTypeSubscriptions = this.subscriptions.get(event.type);
|
|
@@ -57844,7 +57704,7 @@ class DefaultPubSubService {
|
|
|
57844
57704
|
return matchingSubscriptions;
|
|
57845
57705
|
}
|
|
57846
57706
|
}
|
|
57847
|
-
function buildServiceDescriptor$
|
|
57707
|
+
function buildServiceDescriptor$2() {
|
|
57848
57708
|
return {
|
|
57849
57709
|
type: "pubSub",
|
|
57850
57710
|
version: "1.0",
|
|
@@ -57857,7 +57717,7 @@ function buildServiceDescriptor$1() {
|
|
|
57857
57717
|
* All rights reserved.
|
|
57858
57718
|
* For full license text, see the LICENSE.txt file
|
|
57859
57719
|
*/
|
|
57860
|
-
function buildServiceDescriptor(interceptors = { request: [], response: [] }) {
|
|
57720
|
+
function buildServiceDescriptor$1(interceptors = { request: [], response: [] }) {
|
|
57861
57721
|
return {
|
|
57862
57722
|
type: "fetch",
|
|
57863
57723
|
version: "1.0",
|
|
@@ -57891,7 +57751,7 @@ function buildNimbusFetchServiceDescriptor() {
|
|
|
57891
57751
|
});
|
|
57892
57752
|
};
|
|
57893
57753
|
return {
|
|
57894
|
-
...buildServiceDescriptor(),
|
|
57754
|
+
...buildServiceDescriptor$1(),
|
|
57895
57755
|
service: service,
|
|
57896
57756
|
};
|
|
57897
57757
|
}
|
|
@@ -57940,31 +57800,550 @@ function convertFetchParamsToResourceRequest([input, init]) {
|
|
|
57940
57800
|
};
|
|
57941
57801
|
}
|
|
57942
57802
|
|
|
57803
|
+
/*!
|
|
57804
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57805
|
+
* All rights reserved.
|
|
57806
|
+
* For full license text, see the LICENSE.txt file
|
|
57807
|
+
*/
|
|
57808
|
+
class CacheInclusionPolicyService {
|
|
57809
|
+
}
|
|
57810
|
+
function setDifference(setA, setB) {
|
|
57811
|
+
const differenceSet = /* @__PURE__ */ new Set();
|
|
57812
|
+
for (const element of setA) {
|
|
57813
|
+
if (!setB.has(element)) {
|
|
57814
|
+
differenceSet.add(element);
|
|
57815
|
+
}
|
|
57816
|
+
}
|
|
57817
|
+
return differenceSet;
|
|
57818
|
+
}
|
|
57819
|
+
function resolvedPromiseLike(result) {
|
|
57820
|
+
if (isPromiseLike(result)) {
|
|
57821
|
+
return result.then((nextResult) => nextResult);
|
|
57822
|
+
}
|
|
57823
|
+
return {
|
|
57824
|
+
then: (onFulfilled, _onRejected) => {
|
|
57825
|
+
try {
|
|
57826
|
+
return resolvedPromiseLike(onFulfilled(result));
|
|
57827
|
+
} catch (e) {
|
|
57828
|
+
if (onFulfilled === void 0) {
|
|
57829
|
+
return resolvedPromiseLike(result);
|
|
57830
|
+
}
|
|
57831
|
+
return rejectedPromiseLike(e);
|
|
57832
|
+
}
|
|
57833
|
+
}
|
|
57834
|
+
};
|
|
57835
|
+
}
|
|
57836
|
+
function rejectedPromiseLike(reason) {
|
|
57837
|
+
if (isPromiseLike(reason)) {
|
|
57838
|
+
return reason.then((nextResult) => nextResult);
|
|
57839
|
+
}
|
|
57840
|
+
return {
|
|
57841
|
+
then: (_onFulfilled, onRejected) => {
|
|
57842
|
+
if (typeof onRejected === "function") {
|
|
57843
|
+
try {
|
|
57844
|
+
return resolvedPromiseLike(onRejected(reason));
|
|
57845
|
+
} catch (e) {
|
|
57846
|
+
return rejectedPromiseLike(e);
|
|
57847
|
+
}
|
|
57848
|
+
}
|
|
57849
|
+
return rejectedPromiseLike(reason);
|
|
57850
|
+
}
|
|
57851
|
+
};
|
|
57852
|
+
}
|
|
57853
|
+
function isPromiseLike(x) {
|
|
57854
|
+
return typeof (x == null ? void 0 : x.then) === "function";
|
|
57855
|
+
}
|
|
57856
|
+
/*!
|
|
57857
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57858
|
+
* All rights reserved.
|
|
57859
|
+
* For full license text, see the LICENSE.txt file
|
|
57860
|
+
*/
|
|
57861
|
+
/*!
|
|
57862
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57863
|
+
* All rights reserved.
|
|
57864
|
+
* For full license text, see the LICENSE.txt file
|
|
57865
|
+
*/
|
|
57866
|
+
const { stringify, parse } = JSON;
|
|
57867
|
+
function deepCopy(x) {
|
|
57868
|
+
const stringified = stringify(x);
|
|
57869
|
+
return stringified ? parse(stringified) : void 0;
|
|
57870
|
+
}
|
|
57871
|
+
class DefaultRecordableCache {
|
|
57872
|
+
constructor(baseCache) {
|
|
57873
|
+
this.baseCache = baseCache;
|
|
57874
|
+
this.keysRead = /* @__PURE__ */ new Set();
|
|
57875
|
+
this.missingKeysRead = /* @__PURE__ */ new Set();
|
|
57876
|
+
this.keysUpdated = /* @__PURE__ */ new Set();
|
|
57877
|
+
this.metadataKeysUpdated = /* @__PURE__ */ new Set();
|
|
57878
|
+
}
|
|
57879
|
+
delete(key) {
|
|
57880
|
+
this.keysUpdated.add(key);
|
|
57881
|
+
this.baseCache.delete(key);
|
|
57882
|
+
}
|
|
57883
|
+
get(key, options) {
|
|
57884
|
+
this.keysRead.add(key);
|
|
57885
|
+
const value = this.baseCache.get(key);
|
|
57886
|
+
if (value === void 0) {
|
|
57887
|
+
this.missingKeysRead.add(key);
|
|
57888
|
+
}
|
|
57889
|
+
if (options == null ? void 0 : options.copy) {
|
|
57890
|
+
return deepCopy(value);
|
|
57891
|
+
}
|
|
57892
|
+
return value;
|
|
57893
|
+
}
|
|
57894
|
+
set(key, value) {
|
|
57895
|
+
this.keysUpdated.add(key);
|
|
57896
|
+
this.metadataKeysUpdated.add(key);
|
|
57897
|
+
this.baseCache.set(key, value);
|
|
57898
|
+
}
|
|
57899
|
+
setMetadata(key, cacheControlMetadata) {
|
|
57900
|
+
this.metadataKeysUpdated.add(key);
|
|
57901
|
+
this.baseCache.setMetadata(key, cacheControlMetadata);
|
|
57902
|
+
}
|
|
57903
|
+
length() {
|
|
57904
|
+
return this.baseCache.length();
|
|
57905
|
+
}
|
|
57906
|
+
keys() {
|
|
57907
|
+
return this.baseCache.keys();
|
|
57908
|
+
}
|
|
57909
|
+
entries() {
|
|
57910
|
+
return this.baseCache.entries();
|
|
57911
|
+
}
|
|
57912
|
+
record() {
|
|
57913
|
+
return new DefaultRecordableCache(this);
|
|
57914
|
+
}
|
|
57915
|
+
filter(predicate) {
|
|
57916
|
+
return new DefaultFilteredCache(this, predicate);
|
|
57917
|
+
}
|
|
57918
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
57919
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
57920
|
+
}
|
|
57921
|
+
}
|
|
57922
|
+
class DefaultFilteredCache {
|
|
57923
|
+
constructor(baseCache, predicate) {
|
|
57924
|
+
this.baseCache = baseCache;
|
|
57925
|
+
this.predicate = predicate;
|
|
57926
|
+
}
|
|
57927
|
+
delete(key) {
|
|
57928
|
+
this.baseCache.delete(key);
|
|
57929
|
+
}
|
|
57930
|
+
get(key, options) {
|
|
57931
|
+
const result = this.baseCache.get(key);
|
|
57932
|
+
if (result && this.predicate(key, result)) {
|
|
57933
|
+
if (options == null ? void 0 : options.copy) {
|
|
57934
|
+
return deepCopy(result);
|
|
57935
|
+
}
|
|
57936
|
+
return result;
|
|
57937
|
+
}
|
|
57938
|
+
return void 0;
|
|
57939
|
+
}
|
|
57940
|
+
set(key, value) {
|
|
57941
|
+
this.baseCache.set(key, value);
|
|
57942
|
+
}
|
|
57943
|
+
setMetadata(key, cacheControlMetadata) {
|
|
57944
|
+
this.baseCache.setMetadata(key, cacheControlMetadata);
|
|
57945
|
+
}
|
|
57946
|
+
length() {
|
|
57947
|
+
return this.getFilteredKeys().size;
|
|
57948
|
+
}
|
|
57949
|
+
keys() {
|
|
57950
|
+
return this.getFilteredKeys();
|
|
57951
|
+
}
|
|
57952
|
+
entries() {
|
|
57953
|
+
return this.getFilteredEntries();
|
|
57954
|
+
}
|
|
57955
|
+
record() {
|
|
57956
|
+
return new DefaultRecordableCache(this);
|
|
57957
|
+
}
|
|
57958
|
+
filter(predicate) {
|
|
57959
|
+
return new DefaultFilteredCache(this, predicate);
|
|
57960
|
+
}
|
|
57961
|
+
getFilteredEntries() {
|
|
57962
|
+
return this.baseCache.entries().filter(([key, _value]) => {
|
|
57963
|
+
return this.get(key);
|
|
57964
|
+
});
|
|
57965
|
+
}
|
|
57966
|
+
getFilteredKeys() {
|
|
57967
|
+
const filteredKeySet = /* @__PURE__ */ new Set();
|
|
57968
|
+
this.baseCache.keys().forEach((key) => {
|
|
57969
|
+
if (this.get(key)) {
|
|
57970
|
+
filteredKeySet.add(key);
|
|
57971
|
+
}
|
|
57972
|
+
});
|
|
57973
|
+
return filteredKeySet;
|
|
57974
|
+
}
|
|
57975
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
57976
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
57977
|
+
}
|
|
57978
|
+
}
|
|
57979
|
+
class FixedTimeWritableCache {
|
|
57980
|
+
constructor(baseCache, generatedTime) {
|
|
57981
|
+
this.baseCache = baseCache;
|
|
57982
|
+
this.generatedTime = generatedTime;
|
|
57983
|
+
}
|
|
57984
|
+
delete(key) {
|
|
57985
|
+
this.baseCache.delete(key);
|
|
57986
|
+
}
|
|
57987
|
+
get(key, options) {
|
|
57988
|
+
return this.baseCache.get(key, options);
|
|
57989
|
+
}
|
|
57990
|
+
set(key, value) {
|
|
57991
|
+
this.baseCache.set(key, {
|
|
57992
|
+
...value,
|
|
57993
|
+
metadata: {
|
|
57994
|
+
...value.metadata,
|
|
57995
|
+
cacheControl: { ...value.metadata.cacheControl, generatedTime: this.generatedTime }
|
|
57996
|
+
}
|
|
57997
|
+
});
|
|
57998
|
+
}
|
|
57999
|
+
setMetadata(key, cacheControlMetadata) {
|
|
58000
|
+
this.baseCache.setMetadata(key, {
|
|
58001
|
+
...cacheControlMetadata,
|
|
58002
|
+
generatedTime: this.generatedTime
|
|
58003
|
+
});
|
|
58004
|
+
}
|
|
58005
|
+
length() {
|
|
58006
|
+
return this.baseCache.length();
|
|
58007
|
+
}
|
|
58008
|
+
keys() {
|
|
58009
|
+
return this.baseCache.keys();
|
|
58010
|
+
}
|
|
58011
|
+
entries() {
|
|
58012
|
+
return this.baseCache.entries();
|
|
58013
|
+
}
|
|
58014
|
+
record() {
|
|
58015
|
+
return new DefaultRecordableCache(this);
|
|
58016
|
+
}
|
|
58017
|
+
filter(predicate) {
|
|
58018
|
+
return new DefaultFilteredCache(this, predicate);
|
|
58019
|
+
}
|
|
58020
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
58021
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
58022
|
+
}
|
|
58023
|
+
}
|
|
58024
|
+
class DefaultCache {
|
|
58025
|
+
constructor() {
|
|
58026
|
+
this.data = {};
|
|
58027
|
+
}
|
|
58028
|
+
get(key, options) {
|
|
58029
|
+
if (options == null ? void 0 : options.copy) {
|
|
58030
|
+
return deepCopy(this.data[key]);
|
|
58031
|
+
}
|
|
58032
|
+
return this.data[key];
|
|
58033
|
+
}
|
|
58034
|
+
/**
|
|
58035
|
+
* Adds the specified key/value to the cache.
|
|
58036
|
+
*
|
|
58037
|
+
* @param key key at which to store value
|
|
58038
|
+
* @param entry value to be stored
|
|
58039
|
+
*/
|
|
58040
|
+
set(key, entry) {
|
|
58041
|
+
if (entry.metadata.cacheControl.type === "no-store") {
|
|
58042
|
+
return;
|
|
58043
|
+
}
|
|
58044
|
+
this.data[key] = {
|
|
58045
|
+
...entry,
|
|
58046
|
+
metadata: {
|
|
58047
|
+
...entry.metadata,
|
|
58048
|
+
type: entry.metadata.type || {
|
|
58049
|
+
namespace: "OneStore:Internal",
|
|
58050
|
+
name: "UnknownType"
|
|
58051
|
+
},
|
|
58052
|
+
cacheControl: {
|
|
58053
|
+
generatedTime: Date.now() / 1e3,
|
|
58054
|
+
...entry.metadata.cacheControl
|
|
58055
|
+
}
|
|
58056
|
+
}
|
|
58057
|
+
};
|
|
58058
|
+
}
|
|
58059
|
+
/**
|
|
58060
|
+
* Removes the cache entry associated with the specified key.
|
|
58061
|
+
*
|
|
58062
|
+
* @param key key to be removed from the store
|
|
58063
|
+
*/
|
|
58064
|
+
delete(key) {
|
|
58065
|
+
delete this.data[key];
|
|
58066
|
+
}
|
|
58067
|
+
/**
|
|
58068
|
+
* Sets the metadata for the specified key if the key is in cache.
|
|
58069
|
+
* If the key doesn't exist, it does nothing.
|
|
58070
|
+
*
|
|
58071
|
+
* @param key key at which to store metadata
|
|
58072
|
+
* @param cacheControlMetadata metadata to be stored
|
|
58073
|
+
*/
|
|
58074
|
+
setMetadata(key, cacheControlMetadata) {
|
|
58075
|
+
if (key in this.data) {
|
|
58076
|
+
this.data[key].metadata.cacheControl = {
|
|
58077
|
+
generatedTime: Date.now() / 1e3,
|
|
58078
|
+
...cacheControlMetadata
|
|
58079
|
+
};
|
|
58080
|
+
}
|
|
58081
|
+
}
|
|
58082
|
+
length() {
|
|
58083
|
+
return this.keys().size;
|
|
58084
|
+
}
|
|
58085
|
+
keys() {
|
|
58086
|
+
return new Set(Object.keys(this.data));
|
|
58087
|
+
}
|
|
58088
|
+
entries() {
|
|
58089
|
+
return Object.entries(this.data);
|
|
58090
|
+
}
|
|
58091
|
+
record() {
|
|
58092
|
+
return new DefaultRecordableCache(this);
|
|
58093
|
+
}
|
|
58094
|
+
filter(predicate) {
|
|
58095
|
+
return new DefaultFilteredCache(this, predicate);
|
|
58096
|
+
}
|
|
58097
|
+
buildFixedTimeWritableCache(generatedTime) {
|
|
58098
|
+
return new FixedTimeWritableCache(this, generatedTime);
|
|
58099
|
+
}
|
|
58100
|
+
}
|
|
58101
|
+
function buildServiceDescriptor() {
|
|
58102
|
+
return {
|
|
58103
|
+
type: "cache",
|
|
58104
|
+
version: "1.0",
|
|
58105
|
+
service: new DefaultCache()
|
|
58106
|
+
};
|
|
58107
|
+
}
|
|
58108
|
+
class DurableCacheInclusionPolicy extends CacheInclusionPolicyService {
|
|
58109
|
+
/**
|
|
58110
|
+
* Reads data out of a 2 level inclusive store.
|
|
58111
|
+
*/
|
|
58112
|
+
read(options) {
|
|
58113
|
+
const { l1, readFromL1, alreadyRevivedKeys } = options;
|
|
58114
|
+
const recordableCache = l1.record();
|
|
58115
|
+
return readFromL1(recordableCache).then((readResult) => {
|
|
58116
|
+
if (readResult.isOk()) {
|
|
58117
|
+
return readResult;
|
|
58118
|
+
}
|
|
58119
|
+
const keysToRevive = recordableCache.keysRead;
|
|
58120
|
+
if (alreadyRevivedKeys && setDifference(keysToRevive, alreadyRevivedKeys).size === 0) {
|
|
58121
|
+
return readResult;
|
|
58122
|
+
}
|
|
58123
|
+
return this.revive(keysToRevive, l1).then((revivedKeys) => {
|
|
58124
|
+
if (setDifference(keysToRevive, revivedKeys).size > 0) {
|
|
58125
|
+
return readResult;
|
|
58126
|
+
}
|
|
58127
|
+
return this.read({ l1, readFromL1, alreadyRevivedKeys: revivedKeys });
|
|
58128
|
+
});
|
|
58129
|
+
});
|
|
58130
|
+
}
|
|
58131
|
+
/**
|
|
58132
|
+
* Writes data to a 2 level inclusive store.
|
|
58133
|
+
*/
|
|
58134
|
+
write(options) {
|
|
58135
|
+
const { l1, writeToL1 } = options;
|
|
58136
|
+
const tempL1 = buildServiceDescriptor().service.record();
|
|
58137
|
+
return writeToL1(tempL1).then(() => {
|
|
58138
|
+
const keysToReviveRecordableCache = l1.record();
|
|
58139
|
+
tempL1.keysUpdated.forEach((key) => keysToReviveRecordableCache.get(key));
|
|
58140
|
+
tempL1.missingKeysRead.forEach((key) => keysToReviveRecordableCache.get(key));
|
|
58141
|
+
const missingKeys = keysToReviveRecordableCache.missingKeysRead;
|
|
58142
|
+
const revivePromiseLike = missingKeys.size > 0 ? this.revive(missingKeys, l1).then(() => void 0) : resolvedPromiseLike(void 0);
|
|
58143
|
+
return revivePromiseLike.then(() => {
|
|
58144
|
+
const recordableCache = l1.record();
|
|
58145
|
+
return writeToL1(recordableCache).then((result) => {
|
|
58146
|
+
this.syncToL2Cache(recordableCache.keysUpdated, l1);
|
|
58147
|
+
return result;
|
|
58148
|
+
});
|
|
58149
|
+
});
|
|
58150
|
+
});
|
|
58151
|
+
}
|
|
58152
|
+
}
|
|
58153
|
+
|
|
58154
|
+
class NimbusDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
|
|
58155
|
+
constructor(services, store) {
|
|
58156
|
+
super();
|
|
58157
|
+
this.services = services;
|
|
58158
|
+
this.store = store;
|
|
58159
|
+
this.registerListener();
|
|
58160
|
+
}
|
|
58161
|
+
revive(keys, l1) {
|
|
58162
|
+
if (keys.size === 0)
|
|
58163
|
+
return Promise.resolve(new Set());
|
|
58164
|
+
return this.store.getEntries(keys).then((entries) => {
|
|
58165
|
+
const keysRevived = new Set();
|
|
58166
|
+
if (!entries)
|
|
58167
|
+
return keysRevived;
|
|
58168
|
+
entries.forEach(({ key, entry }) => {
|
|
58169
|
+
l1.set(key, entry);
|
|
58170
|
+
keysRevived.add(key);
|
|
58171
|
+
});
|
|
58172
|
+
return keysRevived;
|
|
58173
|
+
});
|
|
58174
|
+
}
|
|
58175
|
+
syncToL2Cache(changedKeys, l1) {
|
|
58176
|
+
if (changedKeys.size === 0)
|
|
58177
|
+
return Promise.resolve();
|
|
58178
|
+
const entries = [];
|
|
58179
|
+
for (const key of changedKeys) {
|
|
58180
|
+
const entry = l1.get(key);
|
|
58181
|
+
if (entry) {
|
|
58182
|
+
entries.push({ key, entry });
|
|
58183
|
+
}
|
|
58184
|
+
}
|
|
58185
|
+
return entries.length > 0 ? this.store.setEntries(entries) : Promise.resolve();
|
|
58186
|
+
}
|
|
58187
|
+
find(_query) {
|
|
58188
|
+
throw new Error('find not supported on the NimbusDurableCacheInclusionPolicy');
|
|
58189
|
+
}
|
|
58190
|
+
findAndModify(_query, _cacheUpdate) {
|
|
58191
|
+
throw new Error('findAndModify not supported on the NimbusDurableCacheInclusionPolicy');
|
|
58192
|
+
}
|
|
58193
|
+
registerListener() {
|
|
58194
|
+
this.store.registerOnChangedListener(async (changes) => {
|
|
58195
|
+
changes.forEach((change) => {
|
|
58196
|
+
const upsertKeys = new Set();
|
|
58197
|
+
const evictKeys = new Set();
|
|
58198
|
+
for (const key of change.keys) {
|
|
58199
|
+
if (change.type === 'upsert') {
|
|
58200
|
+
upsertKeys.add(key);
|
|
58201
|
+
}
|
|
58202
|
+
else {
|
|
58203
|
+
evictKeys.add(key);
|
|
58204
|
+
}
|
|
58205
|
+
}
|
|
58206
|
+
if (upsertKeys.size > 0) {
|
|
58207
|
+
this.store.getEntries(upsertKeys).then((entries) => {
|
|
58208
|
+
if (entries === undefined)
|
|
58209
|
+
return;
|
|
58210
|
+
entries.forEach(({ key, entry }) => {
|
|
58211
|
+
this.services.cache.set(key, entry);
|
|
58212
|
+
return resolvedPromiseLike$3(ok$1(undefined));
|
|
58213
|
+
});
|
|
58214
|
+
});
|
|
58215
|
+
}
|
|
58216
|
+
// TODO: onestore doesnt support cache eviction yet
|
|
58217
|
+
// if (evictKeys.size > 0) {
|
|
58218
|
+
// evictKeys.forEach((key) => {
|
|
58219
|
+
// this.services.cache.evict(key);
|
|
58220
|
+
// });
|
|
58221
|
+
// }
|
|
58222
|
+
});
|
|
58223
|
+
});
|
|
58224
|
+
}
|
|
58225
|
+
}
|
|
58226
|
+
function buildNimbusDurableCacheInclusionPolicyService(cache, store) {
|
|
58227
|
+
return {
|
|
58228
|
+
service: new NimbusDurableCacheInclusionPolicy({ cache }, store),
|
|
58229
|
+
type: 'cacheInclusionPolicy',
|
|
58230
|
+
version: '1.0',
|
|
58231
|
+
};
|
|
58232
|
+
}
|
|
58233
|
+
|
|
58234
|
+
const TABLE_NAME = 'lds_one_store_data';
|
|
58235
|
+
class NimbusSqliteOneStoreCache {
|
|
58236
|
+
constructor(sqlStore) {
|
|
58237
|
+
this.sqlStore = sqlStore;
|
|
58238
|
+
}
|
|
58239
|
+
async getEntry(key) {
|
|
58240
|
+
const result = await this.query(`SELECT key, data, metadata FROM ${TABLE_NAME} WHERE key = ?`, [key]);
|
|
58241
|
+
if (result.rows.length === 0)
|
|
58242
|
+
return undefined;
|
|
58243
|
+
const [_key, data, metadata] = result.rows[0];
|
|
58244
|
+
return {
|
|
58245
|
+
key,
|
|
58246
|
+
entry: {
|
|
58247
|
+
value: JSON.parse(data),
|
|
58248
|
+
metadata: metadata ? JSON.parse(metadata) : undefined,
|
|
58249
|
+
},
|
|
58250
|
+
};
|
|
58251
|
+
}
|
|
58252
|
+
async getEntries(keys) {
|
|
58253
|
+
if (keys.size === 0)
|
|
58254
|
+
return undefined;
|
|
58255
|
+
const placeholders = Array(keys.size).fill('?').join(', ');
|
|
58256
|
+
const result = await this.query(`SELECT key, data, metadata FROM ${TABLE_NAME} WHERE key IN (${placeholders})`, [...keys]);
|
|
58257
|
+
if (result.rows.length === 0)
|
|
58258
|
+
return undefined;
|
|
58259
|
+
return result.rows.map((row) => {
|
|
58260
|
+
const [key, data, metadata] = row;
|
|
58261
|
+
return {
|
|
58262
|
+
key: key,
|
|
58263
|
+
entry: {
|
|
58264
|
+
value: JSON.parse(data),
|
|
58265
|
+
metadata: metadata ? JSON.parse(metadata) : undefined,
|
|
58266
|
+
},
|
|
58267
|
+
};
|
|
58268
|
+
});
|
|
58269
|
+
}
|
|
58270
|
+
async setEntry(key, entry) {
|
|
58271
|
+
return this.setEntries([{ key, entry }]);
|
|
58272
|
+
}
|
|
58273
|
+
async setEntries(entries) {
|
|
58274
|
+
if (entries.length === 0)
|
|
58275
|
+
return;
|
|
58276
|
+
const rows = entries.map(({ key, entry: { value, metadata } }) => [
|
|
58277
|
+
key,
|
|
58278
|
+
JSON.stringify(value),
|
|
58279
|
+
JSON.stringify(metadata),
|
|
58280
|
+
]);
|
|
58281
|
+
const operation = {
|
|
58282
|
+
type: 'upsert',
|
|
58283
|
+
table: TABLE_NAME,
|
|
58284
|
+
keyColumn: 'key',
|
|
58285
|
+
conflictColumns: ['key'],
|
|
58286
|
+
columns: ['key', 'data', 'metadata'],
|
|
58287
|
+
rows,
|
|
58288
|
+
context: {},
|
|
58289
|
+
};
|
|
58290
|
+
return this.batchQuery([operation]);
|
|
58291
|
+
}
|
|
58292
|
+
registerOnChangedListener(listener) {
|
|
58293
|
+
let unsubscribeId = undefined;
|
|
58294
|
+
this.sqlStore
|
|
58295
|
+
.registerOnChangedListener((changes) => {
|
|
58296
|
+
const onestoreChanges = changes.filter((change) => change.table === TABLE_NAME);
|
|
58297
|
+
return listener(onestoreChanges);
|
|
58298
|
+
})
|
|
58299
|
+
.then((id) => {
|
|
58300
|
+
unsubscribeId = id;
|
|
58301
|
+
});
|
|
58302
|
+
return () => {
|
|
58303
|
+
if (unsubscribeId === undefined)
|
|
58304
|
+
return Promise.resolve();
|
|
58305
|
+
return this.sqlStore.unsubscribeOnChangedListener(unsubscribeId);
|
|
58306
|
+
};
|
|
58307
|
+
}
|
|
58308
|
+
batchQuery(operations) {
|
|
58309
|
+
return new Promise((resolve, reject) => {
|
|
58310
|
+
this.sqlStore.batchOperations(operations, (error) => {
|
|
58311
|
+
error ? reject(error) : resolve();
|
|
58312
|
+
});
|
|
58313
|
+
});
|
|
58314
|
+
}
|
|
58315
|
+
query(sql, params) {
|
|
58316
|
+
return new Promise((resolve, reject) => {
|
|
58317
|
+
this.sqlStore.query(sql, params, resolve, reject);
|
|
58318
|
+
});
|
|
58319
|
+
}
|
|
58320
|
+
}
|
|
58321
|
+
|
|
57943
58322
|
// TODO[@W-18753648]: These services depend on WebApis that aren't available in the worker.
|
|
57944
58323
|
// import { buildServiceDescriptor as buildNdJsonServiceDescriptor } from '@luvio/command-ndjson/v1';
|
|
57945
58324
|
// import { buildServiceDescriptor as buildStreamingCommandServiceDescriptor } from '@luvio/command-streaming/v1';
|
|
57946
58325
|
// import { buildServiceDescriptor as buildSseCommandServiceDescriptor } from '@luvio/command-sse/v1';
|
|
57947
|
-
function initializeOneStore() {
|
|
58326
|
+
function initializeOneStore(sqliteStore) {
|
|
57948
58327
|
if (!useOneStore.isOpen({ fallback: true })) {
|
|
57949
58328
|
return;
|
|
57950
58329
|
}
|
|
57951
58330
|
const loggerService = new ConsoleLogger('ERROR');
|
|
57952
|
-
const cacheServiceDescriptor = buildServiceDescriptor$
|
|
57953
|
-
const instrumentationServiceDescriptor = buildServiceDescriptor$
|
|
57954
|
-
const
|
|
58331
|
+
const cacheServiceDescriptor = buildServiceDescriptor$6();
|
|
58332
|
+
const instrumentationServiceDescriptor = buildServiceDescriptor$3(loggerService);
|
|
58333
|
+
const nimbusSqliteOneStoreCacheServiceDescriptor = buildNimbusDurableCacheInclusionPolicyService(cacheServiceDescriptor.service, new NimbusSqliteOneStoreCache(sqliteStore));
|
|
57955
58334
|
const services = [
|
|
57956
58335
|
instrumentationServiceDescriptor,
|
|
57957
58336
|
buildNimbusFetchServiceDescriptor(),
|
|
57958
|
-
buildServiceDescriptor$
|
|
58337
|
+
buildServiceDescriptor$4(instrumentationServiceDescriptor.service),
|
|
57959
58338
|
// NOTE: These do not directly depend on Aura, and are necessary for HTTP fallback support.
|
|
58339
|
+
buildServiceDescriptor$b(),
|
|
57960
58340
|
buildServiceDescriptor$a(),
|
|
57961
58341
|
buildServiceDescriptor$9(),
|
|
58342
|
+
buildServiceDescriptor$5(cacheServiceDescriptor.service, nimbusSqliteOneStoreCacheServiceDescriptor.service),
|
|
57962
58343
|
buildServiceDescriptor$8(),
|
|
57963
|
-
buildServiceDescriptor$
|
|
58344
|
+
buildServiceDescriptor$c(),
|
|
57964
58345
|
buildServiceDescriptor$7(),
|
|
57965
|
-
buildServiceDescriptor$
|
|
57966
|
-
buildServiceDescriptor$6(),
|
|
57967
|
-
buildServiceDescriptor$1(),
|
|
58346
|
+
buildServiceDescriptor$2(),
|
|
57968
58347
|
// TODO[@W-18753648]: See note above.
|
|
57969
58348
|
// buildStreamingCommandServiceDescriptor(),
|
|
57970
58349
|
// buildNdJsonServiceDescriptor(),
|
|
@@ -58144,7 +58523,7 @@ function getRuntime({ primeUser = false } = {}) {
|
|
|
58144
58523
|
withRegistration('@salesforce/lds-adapters-uiapi/graphql', configureUIAPIGraphQL);
|
|
58145
58524
|
}
|
|
58146
58525
|
// onestore initialization
|
|
58147
|
-
initializeOneStore();
|
|
58526
|
+
initializeOneStore(lazyDurableStore['plugin']);
|
|
58148
58527
|
return {
|
|
58149
58528
|
luvio: lazyLuvio,
|
|
58150
58529
|
internalLuvio: lazyInternalLuvio,
|
|
@@ -58178,4 +58557,4 @@ register({
|
|
|
58178
58557
|
});
|
|
58179
58558
|
|
|
58180
58559
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, registerReportObserver, reportGraphqlQueryParseError };
|
|
58181
|
-
// version: 1.
|
|
58560
|
+
// version: 1.370.0-3ec6ffba72
|