@salesforce/lds-worker-api 1.365.0 → 1.366.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.
|
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
callbacks.push(callback);
|
|
4276
4276
|
}
|
|
4277
|
-
// version: 1.
|
|
4277
|
+
// version: 1.366.0-30380c7ed7
|
|
4278
4278
|
|
|
4279
4279
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4280
4280
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -4865,7 +4865,7 @@ function safeSanitizeGraphQLConfigObject(config) {
|
|
|
4865
4865
|
}
|
|
4866
4866
|
|
|
4867
4867
|
// For use by callers within this module to instrument interesting things.
|
|
4868
|
-
let instrumentation$
|
|
4868
|
+
let instrumentation$6 = {
|
|
4869
4869
|
refreshCalled: (_fromSource) => { },
|
|
4870
4870
|
instrumentAdapter: (adapter, _metadata) => {
|
|
4871
4871
|
return adapter;
|
|
@@ -4880,20 +4880,20 @@ let instrumentation$5 = {
|
|
|
4880
4880
|
* @param newInstrumentation instrumentation hooks to be overridden
|
|
4881
4881
|
*/
|
|
4882
4882
|
function instrument$4(newInstrumentation) {
|
|
4883
|
-
instrumentation$
|
|
4883
|
+
instrumentation$6 = Object.assign(instrumentation$6, newInstrumentation);
|
|
4884
4884
|
}
|
|
4885
4885
|
|
|
4886
4886
|
let refresh$3;
|
|
4887
4887
|
function bindWireRefresh(luvio) {
|
|
4888
4888
|
const wireRefresh = bindWireRefresh$1(luvio);
|
|
4889
4889
|
refresh$3 = (data, apiFamily) => {
|
|
4890
|
-
instrumentation$
|
|
4890
|
+
instrumentation$6.refreshCalled(apiFamily);
|
|
4891
4891
|
return wireRefresh(data);
|
|
4892
4892
|
};
|
|
4893
4893
|
}
|
|
4894
4894
|
|
|
4895
4895
|
function createInstrumentedAdapter(adapter, metadata) {
|
|
4896
|
-
return instrumentation$
|
|
4896
|
+
return instrumentation$6.instrumentAdapter(adapter, metadata);
|
|
4897
4897
|
}
|
|
4898
4898
|
|
|
4899
4899
|
function createLDSAdapter(luvio, name, factory) {
|
|
@@ -5239,7 +5239,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
5239
5239
|
const { apiFamily, name } = metadata;
|
|
5240
5240
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5241
5241
|
}
|
|
5242
|
-
// version: 1.
|
|
5242
|
+
// version: 1.366.0-30380c7ed7
|
|
5243
5243
|
|
|
5244
5244
|
/**
|
|
5245
5245
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -5851,7 +5851,7 @@ function ensureRegisteredOnce$2(registration) {
|
|
|
5851
5851
|
}
|
|
5852
5852
|
|
|
5853
5853
|
// For use by callers within this module to instrument interesting things.
|
|
5854
|
-
let instrumentation$
|
|
5854
|
+
let instrumentation$5 = {
|
|
5855
5855
|
/**
|
|
5856
5856
|
* Called when a set of record conflicts has been fully resolved. The
|
|
5857
5857
|
* parameter indicates the number of server requests that were needed
|
|
@@ -5900,7 +5900,7 @@ let instrumentation$4 = {
|
|
|
5900
5900
|
* @param newInstrumentation instrumentation hooks to be overridden
|
|
5901
5901
|
*/
|
|
5902
5902
|
function instrument$3(newInstrumentation) {
|
|
5903
|
-
instrumentation$
|
|
5903
|
+
instrumentation$5 = Object.assign(instrumentation$5, newInstrumentation);
|
|
5904
5904
|
}
|
|
5905
5905
|
|
|
5906
5906
|
const engineForPrefetcherMap = new Map();
|
|
@@ -9787,7 +9787,7 @@ function merge$3(existing, incoming, luvio, _path, recordConflictMap) {
|
|
|
9787
9787
|
incoming.recordTypeId === undefined ||
|
|
9788
9788
|
existing.recordTypeId === null ||
|
|
9789
9789
|
existing.recordTypeId === undefined) {
|
|
9790
|
-
instrumentation$
|
|
9790
|
+
instrumentation$5.recordTypeIdIsNull(incoming.apiName);
|
|
9791
9791
|
}
|
|
9792
9792
|
const recordDepKey = dependencyKeyBuilder$1({ recordId: existing.id });
|
|
9793
9793
|
const node = luvio.getNode(recordDepKey);
|
|
@@ -9812,12 +9812,12 @@ function merge$3(existing, incoming, luvio, _path, recordConflictMap) {
|
|
|
9812
9812
|
// }
|
|
9813
9813
|
// Adding instrumentation to see how frequently this occurs
|
|
9814
9814
|
if (existing.apiName !== incoming.apiName) {
|
|
9815
|
-
instrumentation$
|
|
9815
|
+
instrumentation$5.recordApiNameChanged(incoming.apiName, existing.apiName);
|
|
9816
9816
|
}
|
|
9817
9817
|
const incomingWeakEtagZero = incoming.weakEtag === 0;
|
|
9818
9818
|
const existingWeakEtagZero = existing.weakEtag === 0;
|
|
9819
9819
|
if (incomingWeakEtagZero || existingWeakEtagZero) {
|
|
9820
|
-
instrumentation$
|
|
9820
|
+
instrumentation$5.weakEtagZero(incomingWeakEtagZero, existingWeakEtagZero, incoming.apiName);
|
|
9821
9821
|
}
|
|
9822
9822
|
// TODO [W-6900085]: UIAPI returns weakEtag=0 when the record is >2 levels nested. For now
|
|
9823
9823
|
// we treat the record as mergeable.
|
|
@@ -9877,7 +9877,7 @@ function fixDisplayValue(existing, incoming, path) {
|
|
|
9877
9877
|
incomingValue !== null) {
|
|
9878
9878
|
incoming.displayValue = existing.displayValue;
|
|
9879
9879
|
const isSpanningRecord = typeof incomingValue === 'object';
|
|
9880
|
-
instrumentation$
|
|
9880
|
+
instrumentation$5.nullDisplayValueConflict({
|
|
9881
9881
|
entityName: path.parent.data.apiName,
|
|
9882
9882
|
fieldName: path.propertyName,
|
|
9883
9883
|
fieldType: isSpanningRecord ? 'spanning-record' : 'scalar',
|
|
@@ -10667,7 +10667,7 @@ function buildNetworkSnapshot$15(luvio, config, serverRequestCount = 0, options)
|
|
|
10667
10667
|
function resolveConflict$1(luvio, map) {
|
|
10668
10668
|
const ids = keys$7(map.conflicts);
|
|
10669
10669
|
if (ids.length === 0) {
|
|
10670
|
-
instrumentation$
|
|
10670
|
+
instrumentation$5.recordConflictsResolved(map.serverRequestCount);
|
|
10671
10671
|
return;
|
|
10672
10672
|
}
|
|
10673
10673
|
if (ids.length === 1) {
|
|
@@ -15508,7 +15508,7 @@ const notifyChangeFactory = (luvio) => {
|
|
|
15508
15508
|
serverRequestCount: 1,
|
|
15509
15509
|
}), body);
|
|
15510
15510
|
const result = luvio.storeBroadcast();
|
|
15511
|
-
instrumentation$
|
|
15511
|
+
instrumentation$5.getRecordNotifyChangeNetworkResult(existingWeakEtag !== body.weakEtag);
|
|
15512
15512
|
return result;
|
|
15513
15513
|
}, () => {
|
|
15514
15514
|
const cache = new StoreKeyMap();
|
|
@@ -15520,7 +15520,7 @@ const notifyChangeFactory = (luvio) => {
|
|
|
15520
15520
|
const errorSnapshot = luvio.errorSnapshot(error);
|
|
15521
15521
|
luvio.storeIngestError(key, errorSnapshot, RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS$1);
|
|
15522
15522
|
const result = luvio.storeBroadcast();
|
|
15523
|
-
instrumentation$
|
|
15523
|
+
instrumentation$5.getRecordNotifyChangeNetworkResult(null, true);
|
|
15524
15524
|
return result.then(() => errorSnapshot);
|
|
15525
15525
|
});
|
|
15526
15526
|
});
|
|
@@ -34033,12 +34033,12 @@ withDefaultLuvio((luvio) => {
|
|
|
34033
34033
|
baseUpdateRelatedListInfo = createLDSAdapter(luvio, 'baseUpdateRelatedListInfo', updateRelatedListInfoAdapterFactory);
|
|
34034
34034
|
createLDSAdapter(luvio, 'baseUpdateRelatedListPreferences', updateRelatedListPreferencesAdapterFactory);
|
|
34035
34035
|
throttle(60, 60000, createLDSAdapter(luvio, 'getRecordNotifyChange', notifyChangeFactory), {
|
|
34036
|
-
allowFunction: instrumentation$
|
|
34037
|
-
dropFunction: instrumentation$
|
|
34036
|
+
allowFunction: instrumentation$5.getRecordNotifyChangeAllowed,
|
|
34037
|
+
dropFunction: instrumentation$5.getRecordNotifyChangeDropped,
|
|
34038
34038
|
});
|
|
34039
34039
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyRecordUpdateAvailable', notifyUpdateAvailableFactory$5), {
|
|
34040
|
-
allowFunction: instrumentation$
|
|
34041
|
-
dropFunction: instrumentation$
|
|
34040
|
+
allowFunction: instrumentation$5.notifyRecordUpdateAvailableAllowed,
|
|
34041
|
+
dropFunction: instrumentation$5.notifyRecordUpdateAvailableDropped,
|
|
34042
34042
|
});
|
|
34043
34043
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyListViewSummaryUpdateAvailable', notifyUpdateAvailableFactory$2));
|
|
34044
34044
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoSummaryUpdateAvailable', notifyUpdateAvailableFactory$3));
|
|
@@ -34052,7 +34052,50 @@ withDefaultLuvio((luvio) => {
|
|
|
34052
34052
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
34053
34053
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
34054
34054
|
});
|
|
34055
|
-
// version: 1.
|
|
34055
|
+
// version: 1.366.0-bf15f04cce
|
|
34056
|
+
|
|
34057
|
+
function requestIdleDetectedCallback(_callback) { }
|
|
34058
|
+
function declareNotifierTaskSingle(_name) {
|
|
34059
|
+
return {
|
|
34060
|
+
isBusy: false,
|
|
34061
|
+
done: function () { },
|
|
34062
|
+
};
|
|
34063
|
+
}
|
|
34064
|
+
function declareNotifierTaskMulti(_name, _existingBusyCount) {
|
|
34065
|
+
return {
|
|
34066
|
+
isBusy: false,
|
|
34067
|
+
add: function () { },
|
|
34068
|
+
done: function () { },
|
|
34069
|
+
};
|
|
34070
|
+
}
|
|
34071
|
+
function declarePollableTaskMulti(_name, _isBusyChecker) { }
|
|
34072
|
+
const idleDetector = {
|
|
34073
|
+
requestIdleDetectedCallback,
|
|
34074
|
+
declareNotifierTaskSingle,
|
|
34075
|
+
declareNotifierTaskMulti,
|
|
34076
|
+
declarePollableTaskMulti,
|
|
34077
|
+
};
|
|
34078
|
+
function stop(_userSchemaOrText, _userData) { }
|
|
34079
|
+
function error(_error, _userSchemaOrText, _userData) { }
|
|
34080
|
+
const activity = {
|
|
34081
|
+
stop,
|
|
34082
|
+
error,
|
|
34083
|
+
};
|
|
34084
|
+
function startActivity(_name) {
|
|
34085
|
+
return activity;
|
|
34086
|
+
}
|
|
34087
|
+
function log(_schema, _data) { }
|
|
34088
|
+
const mockInstrumentation = {
|
|
34089
|
+
log,
|
|
34090
|
+
startActivity,
|
|
34091
|
+
error: () => { },
|
|
34092
|
+
trackValue: (_operation, _value, _hasError, _tags) => { },
|
|
34093
|
+
incrementCounter: (_operation, _increment, _hasError, _tags) => { },
|
|
34094
|
+
bucketValue: (_operation, _value, _buckets) => { },
|
|
34095
|
+
};
|
|
34096
|
+
const getInstrumentation = () => {
|
|
34097
|
+
return mockInstrumentation;
|
|
34098
|
+
};
|
|
34056
34099
|
|
|
34057
34100
|
/**
|
|
34058
34101
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -45516,49 +45559,6 @@ var graphqQueryFieldLimit = {
|
|
|
45516
45559
|
|
|
45517
45560
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
45518
45561
|
|
|
45519
|
-
function requestIdleDetectedCallback(_callback) { }
|
|
45520
|
-
function declareNotifierTaskSingle(_name) {
|
|
45521
|
-
return {
|
|
45522
|
-
isBusy: false,
|
|
45523
|
-
done: function () { },
|
|
45524
|
-
};
|
|
45525
|
-
}
|
|
45526
|
-
function declareNotifierTaskMulti(_name, _existingBusyCount) {
|
|
45527
|
-
return {
|
|
45528
|
-
isBusy: false,
|
|
45529
|
-
add: function () { },
|
|
45530
|
-
done: function () { },
|
|
45531
|
-
};
|
|
45532
|
-
}
|
|
45533
|
-
function declarePollableTaskMulti(_name, _isBusyChecker) { }
|
|
45534
|
-
const idleDetector = {
|
|
45535
|
-
requestIdleDetectedCallback,
|
|
45536
|
-
declareNotifierTaskSingle,
|
|
45537
|
-
declareNotifierTaskMulti,
|
|
45538
|
-
declarePollableTaskMulti,
|
|
45539
|
-
};
|
|
45540
|
-
function stop(_userSchemaOrText, _userData) { }
|
|
45541
|
-
function error(_error, _userSchemaOrText, _userData) { }
|
|
45542
|
-
const activity = {
|
|
45543
|
-
stop,
|
|
45544
|
-
error,
|
|
45545
|
-
};
|
|
45546
|
-
function startActivity(_name) {
|
|
45547
|
-
return activity;
|
|
45548
|
-
}
|
|
45549
|
-
function log(_schema, _data) { }
|
|
45550
|
-
const mockInstrumentation = {
|
|
45551
|
-
log,
|
|
45552
|
-
startActivity,
|
|
45553
|
-
error: () => { },
|
|
45554
|
-
trackValue: (_operation, _value, _hasError, _tags) => { },
|
|
45555
|
-
incrementCounter: (_operation, _increment, _hasError, _tags) => { },
|
|
45556
|
-
bucketValue: (_operation, _value, _buckets) => { },
|
|
45557
|
-
};
|
|
45558
|
-
const getInstrumentation = () => {
|
|
45559
|
-
return mockInstrumentation;
|
|
45560
|
-
};
|
|
45561
|
-
|
|
45562
45562
|
var ldsAdapterO11yLoggingGate = {
|
|
45563
45563
|
isOpen: function (e) {
|
|
45564
45564
|
return e.fallback;
|
|
@@ -45674,7 +45674,7 @@ const { entries: entries$3, keys: keys$5 } = Object;
|
|
|
45674
45674
|
|
|
45675
45675
|
const UI_API_BASE_URI = '/services/data/v65.0/ui-api';
|
|
45676
45676
|
|
|
45677
|
-
let instrumentation$
|
|
45677
|
+
let instrumentation$3 = {
|
|
45678
45678
|
aggregateUiChunkCount: (_cb) => { },
|
|
45679
45679
|
aggregateUiConnectError: () => { },
|
|
45680
45680
|
duplicateRequest: (_cb) => { },
|
|
@@ -45686,7 +45686,7 @@ let instrumentation$2 = {
|
|
|
45686
45686
|
networkRateLimitExceeded: () => { },
|
|
45687
45687
|
};
|
|
45688
45688
|
function instrument$2(newInstrumentation) {
|
|
45689
|
-
instrumentation$
|
|
45689
|
+
instrumentation$3 = Object.assign(instrumentation$3, newInstrumentation);
|
|
45690
45690
|
}
|
|
45691
45691
|
|
|
45692
45692
|
const LDS_RECORDS_AGGREGATE_UI = 'LDS_Records_AggregateUi';
|
|
@@ -45756,7 +45756,7 @@ function mergeRecordFields$2(first, second) {
|
|
|
45756
45756
|
* would otherwise cause a query length exception.
|
|
45757
45757
|
*/
|
|
45758
45758
|
function dispatchSplitRecordAggregateUiAction(recordId, networkAdapter, resourceRequest, resourceRequestContext) {
|
|
45759
|
-
instrumentation$
|
|
45759
|
+
instrumentation$3.getRecordAggregateInvoke();
|
|
45760
45760
|
return networkAdapter(resourceRequest, resourceRequestContext).then((resp) => {
|
|
45761
45761
|
const { body } = resp;
|
|
45762
45762
|
// This response body could be an executeAggregateUi, which we don't natively support.
|
|
@@ -45772,7 +45772,7 @@ function dispatchSplitRecordAggregateUiAction(recordId, networkAdapter, resource
|
|
|
45772
45772
|
}
|
|
45773
45773
|
const merged = body.compositeResponse.reduce((seed, response) => {
|
|
45774
45774
|
if (response.httpStatusCode !== HttpStatusCode$1.Ok) {
|
|
45775
|
-
instrumentation$
|
|
45775
|
+
instrumentation$3.getRecordAggregateReject(() => recordId);
|
|
45776
45776
|
throw createErrorResponse(HttpStatusCode$1.ServerError, {
|
|
45777
45777
|
error: response.message,
|
|
45778
45778
|
});
|
|
@@ -45782,7 +45782,7 @@ function dispatchSplitRecordAggregateUiAction(recordId, networkAdapter, resource
|
|
|
45782
45782
|
}
|
|
45783
45783
|
return mergeRecordFields$2(seed, response.body);
|
|
45784
45784
|
}, null);
|
|
45785
|
-
instrumentation$
|
|
45785
|
+
instrumentation$3.getRecordAggregateResolve(() => {
|
|
45786
45786
|
return {
|
|
45787
45787
|
recordId,
|
|
45788
45788
|
apiName: merged.apiName,
|
|
@@ -45790,7 +45790,7 @@ function dispatchSplitRecordAggregateUiAction(recordId, networkAdapter, resource
|
|
|
45790
45790
|
});
|
|
45791
45791
|
return createOkResponse$1(merged);
|
|
45792
45792
|
}, (err) => {
|
|
45793
|
-
instrumentation$
|
|
45793
|
+
instrumentation$3.getRecordAggregateReject(() => recordId);
|
|
45794
45794
|
// rethrow error
|
|
45795
45795
|
throw err;
|
|
45796
45796
|
});
|
|
@@ -45868,7 +45868,7 @@ function buildAndDispatchGetRecordAggregateUi(recordId, req, params) {
|
|
|
45868
45868
|
const { networkAdapter, resourceRequest, resourceRequestContext } = req;
|
|
45869
45869
|
const compositeRequest = buildGetRecordByFieldsCompositeRequest(resourceRequest, params);
|
|
45870
45870
|
// W-12245125: Emit chunk size metrics
|
|
45871
|
-
instrumentation$
|
|
45871
|
+
instrumentation$3.aggregateUiChunkCount(() => compositeRequest.length);
|
|
45872
45872
|
const aggregateUiParams = {
|
|
45873
45873
|
compositeRequest,
|
|
45874
45874
|
};
|
|
@@ -46102,7 +46102,7 @@ function platformNetworkAdapter(baseNetworkAdapter) {
|
|
|
46102
46102
|
return (resourceRequest, resourceRequestContext) => {
|
|
46103
46103
|
if (!tokenBucket.take(1)) {
|
|
46104
46104
|
// We are hitting rate limiting, add some metrics
|
|
46105
|
-
instrumentation$
|
|
46105
|
+
instrumentation$3.networkRateLimitExceeded();
|
|
46106
46106
|
}
|
|
46107
46107
|
const salesforceRequest = {
|
|
46108
46108
|
networkAdapter: baseNetworkAdapter,
|
|
@@ -80354,6 +80354,209 @@ class AbstractQuickActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
80354
80354
|
}
|
|
80355
80355
|
}
|
|
80356
80356
|
|
|
80357
|
+
function attachObserversToAdapterRequestContext(observers, adapterRequestContext) {
|
|
80358
|
+
if (adapterRequestContext === undefined) {
|
|
80359
|
+
return { eventObservers: observers };
|
|
80360
|
+
}
|
|
80361
|
+
if (adapterRequestContext.eventObservers === undefined) {
|
|
80362
|
+
return { ...adapterRequestContext, eventObservers: observers };
|
|
80363
|
+
}
|
|
80364
|
+
return {
|
|
80365
|
+
...adapterRequestContext,
|
|
80366
|
+
eventObservers: adapterRequestContext.eventObservers.concat(observers),
|
|
80367
|
+
};
|
|
80368
|
+
}
|
|
80369
|
+
/**
|
|
80370
|
+
* Use this method to sanitize the unknown error object when
|
|
80371
|
+
* we are unsure of the type of the error thrown
|
|
80372
|
+
*
|
|
80373
|
+
* @param err Unknown object to sanitize
|
|
80374
|
+
* @returns an instance of error
|
|
80375
|
+
*/
|
|
80376
|
+
function normalizeError$1(err) {
|
|
80377
|
+
if (err instanceof Error) {
|
|
80378
|
+
return err;
|
|
80379
|
+
}
|
|
80380
|
+
else if (typeof err === 'string') {
|
|
80381
|
+
return new Error(err);
|
|
80382
|
+
}
|
|
80383
|
+
return new Error(stringify$2(err));
|
|
80384
|
+
}
|
|
80385
|
+
// metrics
|
|
80386
|
+
/** GraphQL */
|
|
80387
|
+
const GRAPHQL_EVAL_ERROR = 'gql-eval-error';
|
|
80388
|
+
const GRAPHQL_EVAL_DB_READ_DURATION = 'gql-eval-db-read-duration';
|
|
80389
|
+
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
80390
|
+
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
80391
|
+
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
80392
|
+
const GRAPHQL_EVAL_QUERY_RECORD_COUNT = 'gql-eval-query-record-count';
|
|
80393
|
+
const GRAPHQL_SNAPSHOT_REFRESH_UNDEFINED = 'gql-snapshot-refresh-undefined';
|
|
80394
|
+
/** Draft Queue */
|
|
80395
|
+
const DRAFT_QUEUE_STATE_STARTED = 'draft-queue-state-started';
|
|
80396
|
+
const DRAFT_QUEUE_STATE_ERROR = 'draft-queue-state-error';
|
|
80397
|
+
const DRAFT_QUEUE_STATE_WAITING = 'draft-queue-state-waiting';
|
|
80398
|
+
const DRAFT_QUEUE_STATE_STOPPED = 'draft-queue-state-stopped';
|
|
80399
|
+
const DRAFT_QUEUE_ACTION_ADDED = 'draft-queue-action-added';
|
|
80400
|
+
const DRAFT_QUEUE_ACTION_UPLOADING = 'draft-queue-action-uploading';
|
|
80401
|
+
const DRAFT_QUEUE_ACTION_COMPLETED = 'draft-queue-action-completed';
|
|
80402
|
+
const DRAFT_QUEUE_ACTION_DELETED = 'draft-queue-action-deleted';
|
|
80403
|
+
const DRAFT_QUEUE_ACTION_UPDATED = 'draft-queue-action-updated';
|
|
80404
|
+
const DRAFT_QUEUE_ACTION_FAILED = 'draft-queue-action-failed';
|
|
80405
|
+
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
80406
|
+
/** Content Document */
|
|
80407
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS = 'content-document-version-total-synthesize-calls';
|
|
80408
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR = 'create-content-document-version-draft-synthesize-error';
|
|
80409
|
+
/** Priming */
|
|
80410
|
+
const PRIMING_TOTAL_SESSION_COUNT = 'priming-total-session-count';
|
|
80411
|
+
const PRIMING_TOTAL_ERROR_COUNT = 'priming-total-error-count';
|
|
80412
|
+
const PRIMING_TOTAL_PRIMED_COUNT = 'priming-total-primed-count';
|
|
80413
|
+
const PRIMING_TOTAL_CONFLICT_COUNT = 'priming-total-conflict-count';
|
|
80414
|
+
// logs
|
|
80415
|
+
const GRAPHQL_QUERY_PARSE_ERROR = 'gql-query-parse-error';
|
|
80416
|
+
const GRAPHQL_SQL_EVAL_PRECONDITION_ERROR = 'gql-sql-pre-eval-error';
|
|
80417
|
+
const GRAPHQL_CREATE_SNAPSHOT_ERROR = 'gql-create-snapshot-error';
|
|
80418
|
+
const DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR = 'draft-aware-create-content-document-and-version-error';
|
|
80419
|
+
const ldsMobileInstrumentation$2 = getInstrumentation();
|
|
80420
|
+
const nimbusLogger = typeof __nimbus !== 'undefined' &&
|
|
80421
|
+
__nimbus.plugins !== undefined &&
|
|
80422
|
+
__nimbus.plugins.JSLoggerPlugin !== undefined
|
|
80423
|
+
? __nimbus.plugins.JSLoggerPlugin
|
|
80424
|
+
: undefined;
|
|
80425
|
+
function reportGraphqlQueryParseError(err) {
|
|
80426
|
+
const error = normalizeError$1(err);
|
|
80427
|
+
const errorCode = GRAPHQL_QUERY_PARSE_ERROR;
|
|
80428
|
+
// Metric
|
|
80429
|
+
reportGraphqlAdapterError(errorCode);
|
|
80430
|
+
// Log
|
|
80431
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80432
|
+
}
|
|
80433
|
+
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
80434
|
+
const error = normalizeError$1(err);
|
|
80435
|
+
const errorCode = GRAPHQL_SQL_EVAL_PRECONDITION_ERROR;
|
|
80436
|
+
// Metric
|
|
80437
|
+
reportGraphqlAdapterError(errorCode);
|
|
80438
|
+
// Log
|
|
80439
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80440
|
+
}
|
|
80441
|
+
function reportGraphqlCreateSnapshotError(err) {
|
|
80442
|
+
const error = normalizeError$1(err);
|
|
80443
|
+
const errorCode = GRAPHQL_CREATE_SNAPSHOT_ERROR;
|
|
80444
|
+
// Metric
|
|
80445
|
+
reportGraphqlAdapterError(errorCode);
|
|
80446
|
+
// Log
|
|
80447
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80448
|
+
}
|
|
80449
|
+
function reportGraphQlEvalDbReadDuration(duration) {
|
|
80450
|
+
ldsMobileInstrumentation$2.trackValue(GRAPHQL_EVAL_DB_READ_DURATION, duration);
|
|
80451
|
+
}
|
|
80452
|
+
function reportGraphqlAdapterError(errorCode) {
|
|
80453
|
+
// Increment overall count with errorCode as tag
|
|
80454
|
+
ldsMobileInstrumentation$2.incrementCounter(GRAPHQL_EVAL_ERROR, 1, true, { errorCode });
|
|
80455
|
+
}
|
|
80456
|
+
function reportGraphqlQueryInstrumentation(data) {
|
|
80457
|
+
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
80458
|
+
const recordBuckets = [
|
|
80459
|
+
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
80460
|
+
];
|
|
80461
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_ROOT_QUERY_COUNT, data.rootQueryCount, queryBuckets);
|
|
80462
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_TOTAL_QUERY_COUNT, data.totalQueryCount, queryBuckets);
|
|
80463
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT, data.maxChildRelationships, queryBuckets);
|
|
80464
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_QUERY_RECORD_COUNT, data.requestedRecordCount, recordBuckets);
|
|
80465
|
+
}
|
|
80466
|
+
function incrementGraphQLRefreshUndfined() {
|
|
80467
|
+
ldsMobileInstrumentation$2.incrementCounter(GRAPHQL_SNAPSHOT_REFRESH_UNDEFINED);
|
|
80468
|
+
}
|
|
80469
|
+
function reportDraftActionEvent(state, draftCount, message) {
|
|
80470
|
+
if (nimbusLogger) {
|
|
80471
|
+
nimbusLogger.logInfo(`Draft action event: ${state}, depth: ${draftCount}${message ? `, message: ${message}` : ''}`);
|
|
80472
|
+
}
|
|
80473
|
+
switch (state) {
|
|
80474
|
+
case 'added':
|
|
80475
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_ADDED);
|
|
80476
|
+
break;
|
|
80477
|
+
case 'uploading':
|
|
80478
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPLOADING);
|
|
80479
|
+
break;
|
|
80480
|
+
case 'completed':
|
|
80481
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_COMPLETED);
|
|
80482
|
+
break;
|
|
80483
|
+
case 'deleted':
|
|
80484
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_DELETED);
|
|
80485
|
+
break;
|
|
80486
|
+
case 'failed':
|
|
80487
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_FAILED, 1, true);
|
|
80488
|
+
break;
|
|
80489
|
+
case 'updated':
|
|
80490
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPDATED);
|
|
80491
|
+
break;
|
|
80492
|
+
}
|
|
80493
|
+
}
|
|
80494
|
+
function reportDraftQueueState(state, draftCount) {
|
|
80495
|
+
if (nimbusLogger) {
|
|
80496
|
+
nimbusLogger.logInfo(`Draft state changed: ${state}, depth: ${draftCount}`);
|
|
80497
|
+
}
|
|
80498
|
+
switch (state) {
|
|
80499
|
+
case 'started':
|
|
80500
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STARTED);
|
|
80501
|
+
break;
|
|
80502
|
+
case 'error':
|
|
80503
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_ERROR, 1, true);
|
|
80504
|
+
break;
|
|
80505
|
+
case 'waiting':
|
|
80506
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_WAITING);
|
|
80507
|
+
break;
|
|
80508
|
+
case 'stopped':
|
|
80509
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STOPPED);
|
|
80510
|
+
break;
|
|
80511
|
+
}
|
|
80512
|
+
}
|
|
80513
|
+
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
80514
|
+
let error;
|
|
80515
|
+
if (err.body !== undefined) {
|
|
80516
|
+
error = err.body;
|
|
80517
|
+
}
|
|
80518
|
+
else {
|
|
80519
|
+
error = normalizeError$1(err);
|
|
80520
|
+
}
|
|
80521
|
+
const errorCode = DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR;
|
|
80522
|
+
const errorType = error.errorType;
|
|
80523
|
+
const tags = {
|
|
80524
|
+
errorCode,
|
|
80525
|
+
};
|
|
80526
|
+
if (errorType !== undefined) {
|
|
80527
|
+
tags.errorType = errorType;
|
|
80528
|
+
}
|
|
80529
|
+
// Metric
|
|
80530
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR, 1, true, tags);
|
|
80531
|
+
// Log
|
|
80532
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80533
|
+
}
|
|
80534
|
+
function reportDraftAwareContentVersionSynthesizeCalls(mimeType) {
|
|
80535
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS, 1, undefined, { mimeType });
|
|
80536
|
+
}
|
|
80537
|
+
/** Priming */
|
|
80538
|
+
function reportPrimingSessionCreated() {
|
|
80539
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_SESSION_COUNT, 1, undefined, {});
|
|
80540
|
+
}
|
|
80541
|
+
function reportPrimingError(errorType, recordCount) {
|
|
80542
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_ERROR_COUNT, recordCount, undefined, {
|
|
80543
|
+
errorType,
|
|
80544
|
+
});
|
|
80545
|
+
}
|
|
80546
|
+
function reportPrimingSuccess(recordCount) {
|
|
80547
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_PRIMED_COUNT, recordCount, undefined);
|
|
80548
|
+
}
|
|
80549
|
+
function reportPrimingConflict(resolutionType, recordCount) {
|
|
80550
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_CONFLICT_COUNT, recordCount, undefined, {
|
|
80551
|
+
resolutionType,
|
|
80552
|
+
});
|
|
80553
|
+
}
|
|
80554
|
+
/** Network */
|
|
80555
|
+
function reportChunkCandidateUrlLength(urlLength) {
|
|
80556
|
+
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
80557
|
+
ldsMobileInstrumentation$2.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
80558
|
+
}
|
|
80559
|
+
|
|
80357
80560
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
80358
80561
|
class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
80359
80562
|
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
|
|
@@ -80364,6 +80567,7 @@ class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandl
|
|
|
80364
80567
|
this.objectInfoService = objectInfoService;
|
|
80365
80568
|
this.getRecord = getRecord;
|
|
80366
80569
|
this.handlerId = QUICK_ACTION_HANDLER;
|
|
80570
|
+
this.instrumentation = getInstrumentation();
|
|
80367
80571
|
draftRecordService.registerRecordHandler(this);
|
|
80368
80572
|
}
|
|
80369
80573
|
async draftActionToSideEffects(queueEntry) {
|
|
@@ -80395,10 +80599,26 @@ class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandl
|
|
|
80395
80599
|
luvio.storeIngest(key, ingest$B$2, response);
|
|
80396
80600
|
}
|
|
80397
80601
|
async handleActionCompleted(action, queueOperations) {
|
|
80602
|
+
/* performQuickAction will not return the new record itself, so before the action
|
|
80603
|
+
* is marked as completed, we need to fetch the actual record. This must be done before
|
|
80604
|
+
* the super method is called because the super method will revert the side effects that
|
|
80605
|
+
* were created for this action, and critically that means evicting the synthetic record
|
|
80606
|
+
* that was created to represent the draft of what would become the canonical record.
|
|
80607
|
+
* Since getRecord is a network call, it is better to have a small timeframe (on the order
|
|
80608
|
+
* of microseconds) where both the synthetic record and the canonical record are in the
|
|
80609
|
+
* store instead of the record missing from the store for the entire duration of the
|
|
80610
|
+
* network call.
|
|
80611
|
+
*/
|
|
80612
|
+
try {
|
|
80613
|
+
await this.fetchRecordIntoStoreFromCompletedAction(action);
|
|
80614
|
+
}
|
|
80615
|
+
catch (error) {
|
|
80616
|
+
this.instrumentation.error(error, 'Error fetching the record created from performQuickAction adapter.');
|
|
80617
|
+
}
|
|
80398
80618
|
await super.handleActionCompleted(action, queueOperations);
|
|
80399
|
-
|
|
80619
|
+
}
|
|
80620
|
+
async fetchRecordIntoStoreFromCompletedAction(action) {
|
|
80400
80621
|
const canonicalId = action.response.body.id;
|
|
80401
|
-
this.buildTagForTargetId(canonicalId);
|
|
80402
80622
|
const prefix = canonicalId.substring(0, 3);
|
|
80403
80623
|
if (prefix.length !== 3) {
|
|
80404
80624
|
// if we can't get a prefix, don't do the rest
|
|
@@ -88105,6 +88325,9 @@ function stringifyIfPresent(value) {
|
|
|
88105
88325
|
if (value === undefined || value === null) {
|
|
88106
88326
|
return null;
|
|
88107
88327
|
}
|
|
88328
|
+
if (typeof value === 'string') {
|
|
88329
|
+
return value;
|
|
88330
|
+
}
|
|
88108
88331
|
return stringify$1(value);
|
|
88109
88332
|
}
|
|
88110
88333
|
function parseIfPresent(value) {
|
|
@@ -88810,96 +89033,6 @@ class NimbusDraftQueue {
|
|
|
88810
89033
|
}
|
|
88811
89034
|
}
|
|
88812
89035
|
|
|
88813
|
-
function attachObserversToAdapterRequestContext(observers, adapterRequestContext) {
|
|
88814
|
-
if (adapterRequestContext === undefined) {
|
|
88815
|
-
return { eventObservers: observers };
|
|
88816
|
-
}
|
|
88817
|
-
if (adapterRequestContext.eventObservers === undefined) {
|
|
88818
|
-
return { ...adapterRequestContext, eventObservers: observers };
|
|
88819
|
-
}
|
|
88820
|
-
return {
|
|
88821
|
-
...adapterRequestContext,
|
|
88822
|
-
eventObservers: adapterRequestContext.eventObservers.concat(observers),
|
|
88823
|
-
};
|
|
88824
|
-
}
|
|
88825
|
-
/**
|
|
88826
|
-
* Use this method to sanitize the unknown error object when
|
|
88827
|
-
* we are unsure of the type of the error thrown
|
|
88828
|
-
*
|
|
88829
|
-
* @param err Unknown object to sanitize
|
|
88830
|
-
* @returns an instance of error
|
|
88831
|
-
*/
|
|
88832
|
-
function normalizeError$1(err) {
|
|
88833
|
-
if (err instanceof Error) {
|
|
88834
|
-
return err;
|
|
88835
|
-
}
|
|
88836
|
-
else if (typeof err === 'string') {
|
|
88837
|
-
return new Error(err);
|
|
88838
|
-
}
|
|
88839
|
-
return new Error(stringify$2(err));
|
|
88840
|
-
}
|
|
88841
|
-
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
88842
|
-
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
88843
|
-
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
88844
|
-
const GRAPHQL_EVAL_QUERY_RECORD_COUNT = 'gql-eval-query-record-count';
|
|
88845
|
-
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
88846
|
-
const ldsMobileInstrumentation$2 = getInstrumentation();
|
|
88847
|
-
const nimbusLogger = typeof __nimbus !== 'undefined' &&
|
|
88848
|
-
__nimbus.plugins !== undefined &&
|
|
88849
|
-
__nimbus.plugins.JSLoggerPlugin !== undefined
|
|
88850
|
-
? __nimbus.plugins.JSLoggerPlugin
|
|
88851
|
-
: undefined;
|
|
88852
|
-
function reportGraphqlQueryParseError(err) {
|
|
88853
|
-
normalizeError$1(err);
|
|
88854
|
-
}
|
|
88855
|
-
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
88856
|
-
normalizeError$1(err);
|
|
88857
|
-
}
|
|
88858
|
-
function reportGraphqlCreateSnapshotError(err) {
|
|
88859
|
-
normalizeError$1(err);
|
|
88860
|
-
}
|
|
88861
|
-
function reportGraphQlEvalDbReadDuration(duration) {
|
|
88862
|
-
}
|
|
88863
|
-
function reportGraphqlQueryInstrumentation(data) {
|
|
88864
|
-
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
88865
|
-
const recordBuckets = [
|
|
88866
|
-
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
88867
|
-
];
|
|
88868
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_ROOT_QUERY_COUNT, data.rootQueryCount, queryBuckets);
|
|
88869
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_TOTAL_QUERY_COUNT, data.totalQueryCount, queryBuckets);
|
|
88870
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT, data.maxChildRelationships, queryBuckets);
|
|
88871
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_QUERY_RECORD_COUNT, data.requestedRecordCount, recordBuckets);
|
|
88872
|
-
}
|
|
88873
|
-
function reportDraftActionEvent(state, draftCount, message) {
|
|
88874
|
-
if (nimbusLogger) {
|
|
88875
|
-
nimbusLogger.logInfo(`Draft action event: ${state}, depth: ${draftCount}${message ? `, message: ${message}` : ''}`);
|
|
88876
|
-
}
|
|
88877
|
-
}
|
|
88878
|
-
function reportDraftQueueState(state, draftCount) {
|
|
88879
|
-
if (nimbusLogger) {
|
|
88880
|
-
nimbusLogger.logInfo(`Draft state changed: ${state}, depth: ${draftCount}`);
|
|
88881
|
-
}
|
|
88882
|
-
}
|
|
88883
|
-
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
88884
|
-
let error;
|
|
88885
|
-
if (err.body !== undefined) {
|
|
88886
|
-
error = err.body;
|
|
88887
|
-
}
|
|
88888
|
-
else {
|
|
88889
|
-
error = normalizeError$1(err);
|
|
88890
|
-
}
|
|
88891
|
-
error.errorType;
|
|
88892
|
-
}
|
|
88893
|
-
function reportDraftAwareContentVersionSynthesizeCalls(mimeType) {
|
|
88894
|
-
}
|
|
88895
|
-
function reportPrimingError(errorType, recordCount) {
|
|
88896
|
-
}
|
|
88897
|
-
function reportPrimingConflict(resolutionType, recordCount) {
|
|
88898
|
-
}
|
|
88899
|
-
/** Network */
|
|
88900
|
-
function reportChunkCandidateUrlLength(urlLength) {
|
|
88901
|
-
}
|
|
88902
|
-
|
|
88903
89036
|
/**
|
|
88904
89037
|
* HOF (high-order-function) that instruments any async operation. If the operation
|
|
88905
89038
|
* has an error then the hasError param will be set on the call to o11y.incrementCounter
|
|
@@ -88911,13 +89044,19 @@ const withInstrumentation = (operation, config) => {
|
|
|
88911
89044
|
return operation();
|
|
88912
89045
|
}
|
|
88913
89046
|
const { tags, metricName, logError } = config;
|
|
89047
|
+
let hasError = false;
|
|
88914
89048
|
return operation()
|
|
88915
89049
|
.catch((err) => {
|
|
89050
|
+
hasError = true;
|
|
88916
89051
|
const error = normalizeError$1(err);
|
|
88917
89052
|
tags['errorMessage'] = error.message;
|
|
89053
|
+
if (logError) {
|
|
89054
|
+
ldsMobileInstrumentation$2.error(error);
|
|
89055
|
+
}
|
|
88918
89056
|
throw err;
|
|
88919
89057
|
})
|
|
88920
89058
|
.finally(() => {
|
|
89059
|
+
ldsMobileInstrumentation$2.incrementCounter(metricName, 1, hasError, tags);
|
|
88921
89060
|
});
|
|
88922
89061
|
};
|
|
88923
89062
|
|
|
@@ -89257,6 +89396,9 @@ function instrumentGraphQLEval(adapter) {
|
|
|
89257
89396
|
case 'graphql-query-instrumentation':
|
|
89258
89397
|
reportGraphqlQueryInstrumentation(data.data);
|
|
89259
89398
|
break;
|
|
89399
|
+
case 'graphql-luvio-refresh-undefined':
|
|
89400
|
+
incrementGraphQLRefreshUndfined();
|
|
89401
|
+
break;
|
|
89260
89402
|
}
|
|
89261
89403
|
}
|
|
89262
89404
|
},
|
|
@@ -89569,6 +89711,9 @@ class LdsInternalDataTable {
|
|
|
89569
89711
|
}
|
|
89570
89712
|
|
|
89571
89713
|
const tasker = idleDetector.declareNotifierTaskMulti('NimbusSqliteStore');
|
|
89714
|
+
const instrumentation$2 = getInstrumentation();
|
|
89715
|
+
const GRAPHQL_QUERY_ROOT_KEY = 'UiApi::uiapi::Query[uiapi]__uiapi__query';
|
|
89716
|
+
const GRAPHQL_QUERY_ROOT_METRIC_NAME = 'gql-query-root-object-size';
|
|
89572
89717
|
class NimbusSqliteStore {
|
|
89573
89718
|
constructor(plugin, additionalTableMap = {}) {
|
|
89574
89719
|
this.plugin = plugin;
|
|
@@ -89615,6 +89760,9 @@ class NimbusSqliteStore {
|
|
|
89615
89760
|
}
|
|
89616
89761
|
const table = this.getTable(segment);
|
|
89617
89762
|
const upsertOperation = table.entriesToUpsertOperations(entries, segment);
|
|
89763
|
+
if (entries[GRAPHQL_QUERY_ROOT_KEY]) {
|
|
89764
|
+
this.trackGraphQLQueryRootSize(upsertOperation);
|
|
89765
|
+
}
|
|
89618
89766
|
return this.batchOperationAsPromise([upsertOperation]);
|
|
89619
89767
|
}
|
|
89620
89768
|
setMetadata(entries, segment) {
|
|
@@ -89630,7 +89778,11 @@ class NimbusSqliteStore {
|
|
|
89630
89778
|
if (cur.type === 'setEntries') {
|
|
89631
89779
|
if (keys$6(cur.entries).length > 0) {
|
|
89632
89780
|
const table = this.getTable(cur.segment);
|
|
89633
|
-
|
|
89781
|
+
const upsertOperation = table.entriesToUpsertOperations(cur.entries, cur.segment);
|
|
89782
|
+
if (cur.entries[GRAPHQL_QUERY_ROOT_KEY]) {
|
|
89783
|
+
this.trackGraphQLQueryRootSize(upsertOperation);
|
|
89784
|
+
}
|
|
89785
|
+
acc.push(upsertOperation);
|
|
89634
89786
|
}
|
|
89635
89787
|
}
|
|
89636
89788
|
else if (cur.type === 'setMetadata') {
|
|
@@ -89714,6 +89866,19 @@ class NimbusSqliteStore {
|
|
|
89714
89866
|
});
|
|
89715
89867
|
}).finally(() => tasker.done());
|
|
89716
89868
|
}
|
|
89869
|
+
trackGraphQLQueryRootSize(upsertOperation) {
|
|
89870
|
+
try {
|
|
89871
|
+
if (upsertOperation.type !== 'upsert') {
|
|
89872
|
+
return;
|
|
89873
|
+
}
|
|
89874
|
+
const row = upsertOperation.rows.find((r) => r[0] === GRAPHQL_QUERY_ROOT_KEY);
|
|
89875
|
+
if (!(row && row[1] && typeof row[1] === 'string')) {
|
|
89876
|
+
return;
|
|
89877
|
+
}
|
|
89878
|
+
instrumentation$2.trackValue(GRAPHQL_QUERY_ROOT_METRIC_NAME, row[1].length);
|
|
89879
|
+
}
|
|
89880
|
+
catch { }
|
|
89881
|
+
}
|
|
89717
89882
|
}
|
|
89718
89883
|
|
|
89719
89884
|
// These const values must be in sync with the latest
|
|
@@ -90351,6 +90516,7 @@ const SESSION_ENQUEUE_RECORD_COUNT = 'priming-session-enqueue-record-count';
|
|
|
90351
90516
|
const SESSION_INGEST_WRITTEN = 'priming-session-ingest-written-count';
|
|
90352
90517
|
const SESSION_INGEST_CONFLICTED = 'priming-session-ingest-conflicted-count';
|
|
90353
90518
|
const SESSION_INGEST_ERRORS = 'priming-session-ingest-error-count';
|
|
90519
|
+
const SESSION_INGEST_DURATION = 'priming-session-ingest-duration';
|
|
90354
90520
|
class PrimingSession extends EventEmitter {
|
|
90355
90521
|
constructor(config) {
|
|
90356
90522
|
super();
|
|
@@ -90525,6 +90691,7 @@ class PrimingSession extends EventEmitter {
|
|
|
90525
90691
|
instrumentation$1$1.trackValue(SESSION_INGEST_WRITTEN, written.length);
|
|
90526
90692
|
instrumentation$1$1.trackValue(SESSION_INGEST_CONFLICTED, conflicted.length);
|
|
90527
90693
|
instrumentation$1$1.trackValue(SESSION_INGEST_ERRORS, errors.length);
|
|
90694
|
+
instrumentation$1$1.trackValue(SESSION_INGEST_DURATION, Date.now() - beforeWrite);
|
|
90528
90695
|
stats.conflictedCount = conflicted.length;
|
|
90529
90696
|
this.emit('batch-written', {
|
|
90530
90697
|
written,
|
|
@@ -91266,10 +91433,12 @@ class RecordLoaderSOQLComposite extends NetworkRecordLoader {
|
|
|
91266
91433
|
}
|
|
91267
91434
|
|
|
91268
91435
|
function instrumentPrimingSession(session) {
|
|
91436
|
+
reportPrimingSessionCreated();
|
|
91269
91437
|
session.on('error', ({ code, ids }) => {
|
|
91270
91438
|
reportPrimingError(code, ids.length);
|
|
91271
91439
|
});
|
|
91272
91440
|
session.on('primed', ({ length }) => {
|
|
91441
|
+
reportPrimingSuccess(length);
|
|
91273
91442
|
});
|
|
91274
91443
|
session.on('conflict', ({ ids, resolution }) => {
|
|
91275
91444
|
reportPrimingConflict(resolution, ids.length);
|
|
@@ -92893,7 +93062,7 @@ function isStoreRecordError(storeRecord) {
|
|
|
92893
93062
|
return storeRecord.__type === 'error';
|
|
92894
93063
|
}
|
|
92895
93064
|
|
|
92896
|
-
const instrumentation$
|
|
93065
|
+
const instrumentation$4 = getInstrumentation();
|
|
92897
93066
|
const ProductConsumed = {
|
|
92898
93067
|
API_NAME: 'ProductConsumed',
|
|
92899
93068
|
Fields: {
|
|
@@ -92951,6 +93120,7 @@ class ProductConsumedUpdatedHook {
|
|
|
92951
93120
|
const originalRecord = await this.durableRecordStore.getRecord(buildRecordRepKeyFromId$1(draftRecordId));
|
|
92952
93121
|
if (originalRecord === undefined) {
|
|
92953
93122
|
incrementCounter(ProductConsumedUpdatedHook.COUNTER_NAME, CounterResult.Error);
|
|
93123
|
+
instrumentation$4.error(`SFS - ProductConsumedUpdatedHook - Original record ${draftRecordId} not found`);
|
|
92954
93124
|
return [];
|
|
92955
93125
|
}
|
|
92956
93126
|
const originalProductItemId = getProductItemIdFromRecordFields(originalRecord.fields);
|
|
@@ -92961,6 +93131,7 @@ class ProductConsumedUpdatedHook {
|
|
|
92961
93131
|
}
|
|
92962
93132
|
if (originalQuantityConsumed === undefined) {
|
|
92963
93133
|
incrementCounter(ProductConsumedUpdatedHook.COUNTER_NAME, CounterResult.Error);
|
|
93134
|
+
instrumentation$4.error(`SFS - ProductConsumedUpdatedHook - Original record ${draftRecordId} QuantityConsumed not found`);
|
|
92964
93135
|
return [];
|
|
92965
93136
|
}
|
|
92966
93137
|
incrementCounter(ProductConsumedUpdatedHook.COUNTER_NAME, CounterResult.Created);
|
|
@@ -92987,6 +93158,7 @@ class ProductConsumedDeletedHook {
|
|
|
92987
93158
|
const originalRecord = await this.durableRecordStore.getRecord(buildRecordRepKeyFromId$1(draftRecordId));
|
|
92988
93159
|
if (originalRecord === undefined) {
|
|
92989
93160
|
incrementCounter(ProductConsumedDeletedHook.COUNTER_NAME, CounterResult.Error);
|
|
93161
|
+
instrumentation$4.error(`SFS - ProductConsumedDeletedHook - Original record ${draftRecordId} not found`);
|
|
92990
93162
|
return [];
|
|
92991
93163
|
}
|
|
92992
93164
|
const productItemId = getProductItemIdFromRecordFields(originalRecord.fields);
|
|
@@ -92997,6 +93169,7 @@ class ProductConsumedDeletedHook {
|
|
|
92997
93169
|
}
|
|
92998
93170
|
if (quantityConsumed === undefined) {
|
|
92999
93171
|
incrementCounter(ProductConsumedDeletedHook.COUNTER_NAME, CounterResult.Error);
|
|
93172
|
+
instrumentation$4.error(`SFS - ProductConsumedDeletedHook - Original record ${draftRecordId} QuantityConsumed not found`);
|
|
93000
93173
|
return [];
|
|
93001
93174
|
}
|
|
93002
93175
|
incrementCounter(ProductConsumedDeletedHook.COUNTER_NAME, CounterResult.Created);
|
|
@@ -93051,7 +93224,7 @@ var CounterResult;
|
|
|
93051
93224
|
CounterResult["Error"] = "Error";
|
|
93052
93225
|
})(CounterResult || (CounterResult = {}));
|
|
93053
93226
|
function incrementCounter(name, result) {
|
|
93054
|
-
instrumentation$
|
|
93227
|
+
instrumentation$4.incrementCounter('SFSSideEffect', 1, result == CounterResult.Error, {
|
|
93055
93228
|
Name: name,
|
|
93056
93229
|
Result: result,
|
|
93057
93230
|
});
|
|
@@ -93256,7 +93429,7 @@ register$1({
|
|
|
93256
93429
|
id: '@salesforce/lds-network-adapter',
|
|
93257
93430
|
instrument: instrument$2,
|
|
93258
93431
|
});
|
|
93259
|
-
// version: 1.
|
|
93432
|
+
// version: 1.366.0-30380c7ed7
|
|
93260
93433
|
|
|
93261
93434
|
const { create: create$2, keys: keys$2 } = Object;
|
|
93262
93435
|
const { stringify, parse } = JSON;
|
|
@@ -119425,7 +119598,7 @@ register$1({
|
|
|
119425
119598
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
119426
119599
|
instrument: instrument$1,
|
|
119427
119600
|
});
|
|
119428
|
-
// version: 1.
|
|
119601
|
+
// version: 1.366.0-bf15f04cce
|
|
119429
119602
|
|
|
119430
119603
|
// On core the unstable adapters are re-exported with different names,
|
|
119431
119604
|
// we want to match them here.
|
|
@@ -119577,7 +119750,7 @@ withDefaultLuvio((luvio) => {
|
|
|
119577
119750
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
119578
119751
|
graphQLImperative = ldsAdapter;
|
|
119579
119752
|
});
|
|
119580
|
-
// version: 1.
|
|
119753
|
+
// version: 1.366.0-bf15f04cce
|
|
119581
119754
|
|
|
119582
119755
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
119583
119756
|
__proto__: null,
|
|
@@ -120376,7 +120549,7 @@ const callbacks$1 = [];
|
|
|
120376
120549
|
function register(r) {
|
|
120377
120550
|
callbacks$1.forEach((callback) => callback(r));
|
|
120378
120551
|
}
|
|
120379
|
-
// version: 1.
|
|
120552
|
+
// version: 1.366.0-30380c7ed7
|
|
120380
120553
|
|
|
120381
120554
|
/**
|
|
120382
120555
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -121545,4 +121718,4 @@ const { luvio } = getRuntime();
|
|
|
121545
121718
|
setDefaultLuvio({ luvio });
|
|
121546
121719
|
|
|
121547
121720
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
121548
|
-
// version: 1.
|
|
121721
|
+
// version: 1.366.0-30380c7ed7
|