@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.
|
@@ -4280,7 +4280,7 @@
|
|
|
4280
4280
|
}
|
|
4281
4281
|
callbacks.push(callback);
|
|
4282
4282
|
}
|
|
4283
|
-
// version: 1.
|
|
4283
|
+
// version: 1.366.0-30380c7ed7
|
|
4284
4284
|
|
|
4285
4285
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4286
4286
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -4871,7 +4871,7 @@
|
|
|
4871
4871
|
}
|
|
4872
4872
|
|
|
4873
4873
|
// For use by callers within this module to instrument interesting things.
|
|
4874
|
-
let instrumentation$
|
|
4874
|
+
let instrumentation$6 = {
|
|
4875
4875
|
refreshCalled: (_fromSource) => { },
|
|
4876
4876
|
instrumentAdapter: (adapter, _metadata) => {
|
|
4877
4877
|
return adapter;
|
|
@@ -4886,20 +4886,20 @@
|
|
|
4886
4886
|
* @param newInstrumentation instrumentation hooks to be overridden
|
|
4887
4887
|
*/
|
|
4888
4888
|
function instrument$4(newInstrumentation) {
|
|
4889
|
-
instrumentation$
|
|
4889
|
+
instrumentation$6 = Object.assign(instrumentation$6, newInstrumentation);
|
|
4890
4890
|
}
|
|
4891
4891
|
|
|
4892
4892
|
let refresh$3;
|
|
4893
4893
|
function bindWireRefresh(luvio) {
|
|
4894
4894
|
const wireRefresh = bindWireRefresh$1(luvio);
|
|
4895
4895
|
refresh$3 = (data, apiFamily) => {
|
|
4896
|
-
instrumentation$
|
|
4896
|
+
instrumentation$6.refreshCalled(apiFamily);
|
|
4897
4897
|
return wireRefresh(data);
|
|
4898
4898
|
};
|
|
4899
4899
|
}
|
|
4900
4900
|
|
|
4901
4901
|
function createInstrumentedAdapter(adapter, metadata) {
|
|
4902
|
-
return instrumentation$
|
|
4902
|
+
return instrumentation$6.instrumentAdapter(adapter, metadata);
|
|
4903
4903
|
}
|
|
4904
4904
|
|
|
4905
4905
|
function createLDSAdapter(luvio, name, factory) {
|
|
@@ -5245,7 +5245,7 @@
|
|
|
5245
5245
|
const { apiFamily, name } = metadata;
|
|
5246
5246
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5247
5247
|
}
|
|
5248
|
-
// version: 1.
|
|
5248
|
+
// version: 1.366.0-30380c7ed7
|
|
5249
5249
|
|
|
5250
5250
|
/**
|
|
5251
5251
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -5857,7 +5857,7 @@
|
|
|
5857
5857
|
}
|
|
5858
5858
|
|
|
5859
5859
|
// For use by callers within this module to instrument interesting things.
|
|
5860
|
-
let instrumentation$
|
|
5860
|
+
let instrumentation$5 = {
|
|
5861
5861
|
/**
|
|
5862
5862
|
* Called when a set of record conflicts has been fully resolved. The
|
|
5863
5863
|
* parameter indicates the number of server requests that were needed
|
|
@@ -5906,7 +5906,7 @@
|
|
|
5906
5906
|
* @param newInstrumentation instrumentation hooks to be overridden
|
|
5907
5907
|
*/
|
|
5908
5908
|
function instrument$3(newInstrumentation) {
|
|
5909
|
-
instrumentation$
|
|
5909
|
+
instrumentation$5 = Object.assign(instrumentation$5, newInstrumentation);
|
|
5910
5910
|
}
|
|
5911
5911
|
|
|
5912
5912
|
const engineForPrefetcherMap = new Map();
|
|
@@ -9793,7 +9793,7 @@
|
|
|
9793
9793
|
incoming.recordTypeId === undefined ||
|
|
9794
9794
|
existing.recordTypeId === null ||
|
|
9795
9795
|
existing.recordTypeId === undefined) {
|
|
9796
|
-
instrumentation$
|
|
9796
|
+
instrumentation$5.recordTypeIdIsNull(incoming.apiName);
|
|
9797
9797
|
}
|
|
9798
9798
|
const recordDepKey = dependencyKeyBuilder$1({ recordId: existing.id });
|
|
9799
9799
|
const node = luvio.getNode(recordDepKey);
|
|
@@ -9818,12 +9818,12 @@
|
|
|
9818
9818
|
// }
|
|
9819
9819
|
// Adding instrumentation to see how frequently this occurs
|
|
9820
9820
|
if (existing.apiName !== incoming.apiName) {
|
|
9821
|
-
instrumentation$
|
|
9821
|
+
instrumentation$5.recordApiNameChanged(incoming.apiName, existing.apiName);
|
|
9822
9822
|
}
|
|
9823
9823
|
const incomingWeakEtagZero = incoming.weakEtag === 0;
|
|
9824
9824
|
const existingWeakEtagZero = existing.weakEtag === 0;
|
|
9825
9825
|
if (incomingWeakEtagZero || existingWeakEtagZero) {
|
|
9826
|
-
instrumentation$
|
|
9826
|
+
instrumentation$5.weakEtagZero(incomingWeakEtagZero, existingWeakEtagZero, incoming.apiName);
|
|
9827
9827
|
}
|
|
9828
9828
|
// TODO [W-6900085]: UIAPI returns weakEtag=0 when the record is >2 levels nested. For now
|
|
9829
9829
|
// we treat the record as mergeable.
|
|
@@ -9883,7 +9883,7 @@
|
|
|
9883
9883
|
incomingValue !== null) {
|
|
9884
9884
|
incoming.displayValue = existing.displayValue;
|
|
9885
9885
|
const isSpanningRecord = typeof incomingValue === 'object';
|
|
9886
|
-
instrumentation$
|
|
9886
|
+
instrumentation$5.nullDisplayValueConflict({
|
|
9887
9887
|
entityName: path.parent.data.apiName,
|
|
9888
9888
|
fieldName: path.propertyName,
|
|
9889
9889
|
fieldType: isSpanningRecord ? 'spanning-record' : 'scalar',
|
|
@@ -10673,7 +10673,7 @@
|
|
|
10673
10673
|
function resolveConflict$1(luvio, map) {
|
|
10674
10674
|
const ids = keys$7(map.conflicts);
|
|
10675
10675
|
if (ids.length === 0) {
|
|
10676
|
-
instrumentation$
|
|
10676
|
+
instrumentation$5.recordConflictsResolved(map.serverRequestCount);
|
|
10677
10677
|
return;
|
|
10678
10678
|
}
|
|
10679
10679
|
if (ids.length === 1) {
|
|
@@ -15514,7 +15514,7 @@
|
|
|
15514
15514
|
serverRequestCount: 1,
|
|
15515
15515
|
}), body);
|
|
15516
15516
|
const result = luvio.storeBroadcast();
|
|
15517
|
-
instrumentation$
|
|
15517
|
+
instrumentation$5.getRecordNotifyChangeNetworkResult(existingWeakEtag !== body.weakEtag);
|
|
15518
15518
|
return result;
|
|
15519
15519
|
}, () => {
|
|
15520
15520
|
const cache = new StoreKeyMap();
|
|
@@ -15526,7 +15526,7 @@
|
|
|
15526
15526
|
const errorSnapshot = luvio.errorSnapshot(error);
|
|
15527
15527
|
luvio.storeIngestError(key, errorSnapshot, RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS$1);
|
|
15528
15528
|
const result = luvio.storeBroadcast();
|
|
15529
|
-
instrumentation$
|
|
15529
|
+
instrumentation$5.getRecordNotifyChangeNetworkResult(null, true);
|
|
15530
15530
|
return result.then(() => errorSnapshot);
|
|
15531
15531
|
});
|
|
15532
15532
|
});
|
|
@@ -34039,12 +34039,12 @@
|
|
|
34039
34039
|
baseUpdateRelatedListInfo = createLDSAdapter(luvio, 'baseUpdateRelatedListInfo', updateRelatedListInfoAdapterFactory);
|
|
34040
34040
|
createLDSAdapter(luvio, 'baseUpdateRelatedListPreferences', updateRelatedListPreferencesAdapterFactory);
|
|
34041
34041
|
throttle(60, 60000, createLDSAdapter(luvio, 'getRecordNotifyChange', notifyChangeFactory), {
|
|
34042
|
-
allowFunction: instrumentation$
|
|
34043
|
-
dropFunction: instrumentation$
|
|
34042
|
+
allowFunction: instrumentation$5.getRecordNotifyChangeAllowed,
|
|
34043
|
+
dropFunction: instrumentation$5.getRecordNotifyChangeDropped,
|
|
34044
34044
|
});
|
|
34045
34045
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyRecordUpdateAvailable', notifyUpdateAvailableFactory$5), {
|
|
34046
|
-
allowFunction: instrumentation$
|
|
34047
|
-
dropFunction: instrumentation$
|
|
34046
|
+
allowFunction: instrumentation$5.notifyRecordUpdateAvailableAllowed,
|
|
34047
|
+
dropFunction: instrumentation$5.notifyRecordUpdateAvailableDropped,
|
|
34048
34048
|
});
|
|
34049
34049
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyListViewSummaryUpdateAvailable', notifyUpdateAvailableFactory$2));
|
|
34050
34050
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoSummaryUpdateAvailable', notifyUpdateAvailableFactory$3));
|
|
@@ -34058,7 +34058,50 @@
|
|
|
34058
34058
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
34059
34059
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
34060
34060
|
});
|
|
34061
|
-
// version: 1.
|
|
34061
|
+
// version: 1.366.0-bf15f04cce
|
|
34062
|
+
|
|
34063
|
+
function requestIdleDetectedCallback(_callback) { }
|
|
34064
|
+
function declareNotifierTaskSingle(_name) {
|
|
34065
|
+
return {
|
|
34066
|
+
isBusy: false,
|
|
34067
|
+
done: function () { },
|
|
34068
|
+
};
|
|
34069
|
+
}
|
|
34070
|
+
function declareNotifierTaskMulti(_name, _existingBusyCount) {
|
|
34071
|
+
return {
|
|
34072
|
+
isBusy: false,
|
|
34073
|
+
add: function () { },
|
|
34074
|
+
done: function () { },
|
|
34075
|
+
};
|
|
34076
|
+
}
|
|
34077
|
+
function declarePollableTaskMulti(_name, _isBusyChecker) { }
|
|
34078
|
+
const idleDetector = {
|
|
34079
|
+
requestIdleDetectedCallback,
|
|
34080
|
+
declareNotifierTaskSingle,
|
|
34081
|
+
declareNotifierTaskMulti,
|
|
34082
|
+
declarePollableTaskMulti,
|
|
34083
|
+
};
|
|
34084
|
+
function stop(_userSchemaOrText, _userData) { }
|
|
34085
|
+
function error(_error, _userSchemaOrText, _userData) { }
|
|
34086
|
+
const activity = {
|
|
34087
|
+
stop,
|
|
34088
|
+
error,
|
|
34089
|
+
};
|
|
34090
|
+
function startActivity(_name) {
|
|
34091
|
+
return activity;
|
|
34092
|
+
}
|
|
34093
|
+
function log(_schema, _data) { }
|
|
34094
|
+
const mockInstrumentation = {
|
|
34095
|
+
log,
|
|
34096
|
+
startActivity,
|
|
34097
|
+
error: () => { },
|
|
34098
|
+
trackValue: (_operation, _value, _hasError, _tags) => { },
|
|
34099
|
+
incrementCounter: (_operation, _increment, _hasError, _tags) => { },
|
|
34100
|
+
bucketValue: (_operation, _value, _buckets) => { },
|
|
34101
|
+
};
|
|
34102
|
+
const getInstrumentation = () => {
|
|
34103
|
+
return mockInstrumentation;
|
|
34104
|
+
};
|
|
34062
34105
|
|
|
34063
34106
|
/**
|
|
34064
34107
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -45522,49 +45565,6 @@
|
|
|
45522
45565
|
|
|
45523
45566
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
45524
45567
|
|
|
45525
|
-
function requestIdleDetectedCallback(_callback) { }
|
|
45526
|
-
function declareNotifierTaskSingle(_name) {
|
|
45527
|
-
return {
|
|
45528
|
-
isBusy: false,
|
|
45529
|
-
done: function () { },
|
|
45530
|
-
};
|
|
45531
|
-
}
|
|
45532
|
-
function declareNotifierTaskMulti(_name, _existingBusyCount) {
|
|
45533
|
-
return {
|
|
45534
|
-
isBusy: false,
|
|
45535
|
-
add: function () { },
|
|
45536
|
-
done: function () { },
|
|
45537
|
-
};
|
|
45538
|
-
}
|
|
45539
|
-
function declarePollableTaskMulti(_name, _isBusyChecker) { }
|
|
45540
|
-
const idleDetector = {
|
|
45541
|
-
requestIdleDetectedCallback,
|
|
45542
|
-
declareNotifierTaskSingle,
|
|
45543
|
-
declareNotifierTaskMulti,
|
|
45544
|
-
declarePollableTaskMulti,
|
|
45545
|
-
};
|
|
45546
|
-
function stop(_userSchemaOrText, _userData) { }
|
|
45547
|
-
function error(_error, _userSchemaOrText, _userData) { }
|
|
45548
|
-
const activity = {
|
|
45549
|
-
stop,
|
|
45550
|
-
error,
|
|
45551
|
-
};
|
|
45552
|
-
function startActivity(_name) {
|
|
45553
|
-
return activity;
|
|
45554
|
-
}
|
|
45555
|
-
function log(_schema, _data) { }
|
|
45556
|
-
const mockInstrumentation = {
|
|
45557
|
-
log,
|
|
45558
|
-
startActivity,
|
|
45559
|
-
error: () => { },
|
|
45560
|
-
trackValue: (_operation, _value, _hasError, _tags) => { },
|
|
45561
|
-
incrementCounter: (_operation, _increment, _hasError, _tags) => { },
|
|
45562
|
-
bucketValue: (_operation, _value, _buckets) => { },
|
|
45563
|
-
};
|
|
45564
|
-
const getInstrumentation = () => {
|
|
45565
|
-
return mockInstrumentation;
|
|
45566
|
-
};
|
|
45567
|
-
|
|
45568
45568
|
var ldsAdapterO11yLoggingGate = {
|
|
45569
45569
|
isOpen: function (e) {
|
|
45570
45570
|
return e.fallback;
|
|
@@ -45680,7 +45680,7 @@
|
|
|
45680
45680
|
|
|
45681
45681
|
const UI_API_BASE_URI = '/services/data/v65.0/ui-api';
|
|
45682
45682
|
|
|
45683
|
-
let instrumentation$
|
|
45683
|
+
let instrumentation$3 = {
|
|
45684
45684
|
aggregateUiChunkCount: (_cb) => { },
|
|
45685
45685
|
aggregateUiConnectError: () => { },
|
|
45686
45686
|
duplicateRequest: (_cb) => { },
|
|
@@ -45692,7 +45692,7 @@
|
|
|
45692
45692
|
networkRateLimitExceeded: () => { },
|
|
45693
45693
|
};
|
|
45694
45694
|
function instrument$2(newInstrumentation) {
|
|
45695
|
-
instrumentation$
|
|
45695
|
+
instrumentation$3 = Object.assign(instrumentation$3, newInstrumentation);
|
|
45696
45696
|
}
|
|
45697
45697
|
|
|
45698
45698
|
const LDS_RECORDS_AGGREGATE_UI = 'LDS_Records_AggregateUi';
|
|
@@ -45762,7 +45762,7 @@
|
|
|
45762
45762
|
* would otherwise cause a query length exception.
|
|
45763
45763
|
*/
|
|
45764
45764
|
function dispatchSplitRecordAggregateUiAction(recordId, networkAdapter, resourceRequest, resourceRequestContext) {
|
|
45765
|
-
instrumentation$
|
|
45765
|
+
instrumentation$3.getRecordAggregateInvoke();
|
|
45766
45766
|
return networkAdapter(resourceRequest, resourceRequestContext).then((resp) => {
|
|
45767
45767
|
const { body } = resp;
|
|
45768
45768
|
// This response body could be an executeAggregateUi, which we don't natively support.
|
|
@@ -45778,7 +45778,7 @@
|
|
|
45778
45778
|
}
|
|
45779
45779
|
const merged = body.compositeResponse.reduce((seed, response) => {
|
|
45780
45780
|
if (response.httpStatusCode !== HttpStatusCode$1.Ok) {
|
|
45781
|
-
instrumentation$
|
|
45781
|
+
instrumentation$3.getRecordAggregateReject(() => recordId);
|
|
45782
45782
|
throw createErrorResponse(HttpStatusCode$1.ServerError, {
|
|
45783
45783
|
error: response.message,
|
|
45784
45784
|
});
|
|
@@ -45788,7 +45788,7 @@
|
|
|
45788
45788
|
}
|
|
45789
45789
|
return mergeRecordFields$2(seed, response.body);
|
|
45790
45790
|
}, null);
|
|
45791
|
-
instrumentation$
|
|
45791
|
+
instrumentation$3.getRecordAggregateResolve(() => {
|
|
45792
45792
|
return {
|
|
45793
45793
|
recordId,
|
|
45794
45794
|
apiName: merged.apiName,
|
|
@@ -45796,7 +45796,7 @@
|
|
|
45796
45796
|
});
|
|
45797
45797
|
return createOkResponse$1(merged);
|
|
45798
45798
|
}, (err) => {
|
|
45799
|
-
instrumentation$
|
|
45799
|
+
instrumentation$3.getRecordAggregateReject(() => recordId);
|
|
45800
45800
|
// rethrow error
|
|
45801
45801
|
throw err;
|
|
45802
45802
|
});
|
|
@@ -45874,7 +45874,7 @@
|
|
|
45874
45874
|
const { networkAdapter, resourceRequest, resourceRequestContext } = req;
|
|
45875
45875
|
const compositeRequest = buildGetRecordByFieldsCompositeRequest(resourceRequest, params);
|
|
45876
45876
|
// W-12245125: Emit chunk size metrics
|
|
45877
|
-
instrumentation$
|
|
45877
|
+
instrumentation$3.aggregateUiChunkCount(() => compositeRequest.length);
|
|
45878
45878
|
const aggregateUiParams = {
|
|
45879
45879
|
compositeRequest,
|
|
45880
45880
|
};
|
|
@@ -46108,7 +46108,7 @@
|
|
|
46108
46108
|
return (resourceRequest, resourceRequestContext) => {
|
|
46109
46109
|
if (!tokenBucket.take(1)) {
|
|
46110
46110
|
// We are hitting rate limiting, add some metrics
|
|
46111
|
-
instrumentation$
|
|
46111
|
+
instrumentation$3.networkRateLimitExceeded();
|
|
46112
46112
|
}
|
|
46113
46113
|
const salesforceRequest = {
|
|
46114
46114
|
networkAdapter: baseNetworkAdapter,
|
|
@@ -80360,6 +80360,209 @@
|
|
|
80360
80360
|
}
|
|
80361
80361
|
}
|
|
80362
80362
|
|
|
80363
|
+
function attachObserversToAdapterRequestContext(observers, adapterRequestContext) {
|
|
80364
|
+
if (adapterRequestContext === undefined) {
|
|
80365
|
+
return { eventObservers: observers };
|
|
80366
|
+
}
|
|
80367
|
+
if (adapterRequestContext.eventObservers === undefined) {
|
|
80368
|
+
return { ...adapterRequestContext, eventObservers: observers };
|
|
80369
|
+
}
|
|
80370
|
+
return {
|
|
80371
|
+
...adapterRequestContext,
|
|
80372
|
+
eventObservers: adapterRequestContext.eventObservers.concat(observers),
|
|
80373
|
+
};
|
|
80374
|
+
}
|
|
80375
|
+
/**
|
|
80376
|
+
* Use this method to sanitize the unknown error object when
|
|
80377
|
+
* we are unsure of the type of the error thrown
|
|
80378
|
+
*
|
|
80379
|
+
* @param err Unknown object to sanitize
|
|
80380
|
+
* @returns an instance of error
|
|
80381
|
+
*/
|
|
80382
|
+
function normalizeError$1(err) {
|
|
80383
|
+
if (err instanceof Error) {
|
|
80384
|
+
return err;
|
|
80385
|
+
}
|
|
80386
|
+
else if (typeof err === 'string') {
|
|
80387
|
+
return new Error(err);
|
|
80388
|
+
}
|
|
80389
|
+
return new Error(stringify$2(err));
|
|
80390
|
+
}
|
|
80391
|
+
// metrics
|
|
80392
|
+
/** GraphQL */
|
|
80393
|
+
const GRAPHQL_EVAL_ERROR = 'gql-eval-error';
|
|
80394
|
+
const GRAPHQL_EVAL_DB_READ_DURATION = 'gql-eval-db-read-duration';
|
|
80395
|
+
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
80396
|
+
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
80397
|
+
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
80398
|
+
const GRAPHQL_EVAL_QUERY_RECORD_COUNT = 'gql-eval-query-record-count';
|
|
80399
|
+
const GRAPHQL_SNAPSHOT_REFRESH_UNDEFINED = 'gql-snapshot-refresh-undefined';
|
|
80400
|
+
/** Draft Queue */
|
|
80401
|
+
const DRAFT_QUEUE_STATE_STARTED = 'draft-queue-state-started';
|
|
80402
|
+
const DRAFT_QUEUE_STATE_ERROR = 'draft-queue-state-error';
|
|
80403
|
+
const DRAFT_QUEUE_STATE_WAITING = 'draft-queue-state-waiting';
|
|
80404
|
+
const DRAFT_QUEUE_STATE_STOPPED = 'draft-queue-state-stopped';
|
|
80405
|
+
const DRAFT_QUEUE_ACTION_ADDED = 'draft-queue-action-added';
|
|
80406
|
+
const DRAFT_QUEUE_ACTION_UPLOADING = 'draft-queue-action-uploading';
|
|
80407
|
+
const DRAFT_QUEUE_ACTION_COMPLETED = 'draft-queue-action-completed';
|
|
80408
|
+
const DRAFT_QUEUE_ACTION_DELETED = 'draft-queue-action-deleted';
|
|
80409
|
+
const DRAFT_QUEUE_ACTION_UPDATED = 'draft-queue-action-updated';
|
|
80410
|
+
const DRAFT_QUEUE_ACTION_FAILED = 'draft-queue-action-failed';
|
|
80411
|
+
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
80412
|
+
/** Content Document */
|
|
80413
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS = 'content-document-version-total-synthesize-calls';
|
|
80414
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR = 'create-content-document-version-draft-synthesize-error';
|
|
80415
|
+
/** Priming */
|
|
80416
|
+
const PRIMING_TOTAL_SESSION_COUNT = 'priming-total-session-count';
|
|
80417
|
+
const PRIMING_TOTAL_ERROR_COUNT = 'priming-total-error-count';
|
|
80418
|
+
const PRIMING_TOTAL_PRIMED_COUNT = 'priming-total-primed-count';
|
|
80419
|
+
const PRIMING_TOTAL_CONFLICT_COUNT = 'priming-total-conflict-count';
|
|
80420
|
+
// logs
|
|
80421
|
+
const GRAPHQL_QUERY_PARSE_ERROR = 'gql-query-parse-error';
|
|
80422
|
+
const GRAPHQL_SQL_EVAL_PRECONDITION_ERROR = 'gql-sql-pre-eval-error';
|
|
80423
|
+
const GRAPHQL_CREATE_SNAPSHOT_ERROR = 'gql-create-snapshot-error';
|
|
80424
|
+
const DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR = 'draft-aware-create-content-document-and-version-error';
|
|
80425
|
+
const ldsMobileInstrumentation$2 = getInstrumentation();
|
|
80426
|
+
const nimbusLogger = typeof __nimbus !== 'undefined' &&
|
|
80427
|
+
__nimbus.plugins !== undefined &&
|
|
80428
|
+
__nimbus.plugins.JSLoggerPlugin !== undefined
|
|
80429
|
+
? __nimbus.plugins.JSLoggerPlugin
|
|
80430
|
+
: undefined;
|
|
80431
|
+
function reportGraphqlQueryParseError(err) {
|
|
80432
|
+
const error = normalizeError$1(err);
|
|
80433
|
+
const errorCode = GRAPHQL_QUERY_PARSE_ERROR;
|
|
80434
|
+
// Metric
|
|
80435
|
+
reportGraphqlAdapterError(errorCode);
|
|
80436
|
+
// Log
|
|
80437
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80438
|
+
}
|
|
80439
|
+
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
80440
|
+
const error = normalizeError$1(err);
|
|
80441
|
+
const errorCode = GRAPHQL_SQL_EVAL_PRECONDITION_ERROR;
|
|
80442
|
+
// Metric
|
|
80443
|
+
reportGraphqlAdapterError(errorCode);
|
|
80444
|
+
// Log
|
|
80445
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80446
|
+
}
|
|
80447
|
+
function reportGraphqlCreateSnapshotError(err) {
|
|
80448
|
+
const error = normalizeError$1(err);
|
|
80449
|
+
const errorCode = GRAPHQL_CREATE_SNAPSHOT_ERROR;
|
|
80450
|
+
// Metric
|
|
80451
|
+
reportGraphqlAdapterError(errorCode);
|
|
80452
|
+
// Log
|
|
80453
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80454
|
+
}
|
|
80455
|
+
function reportGraphQlEvalDbReadDuration(duration) {
|
|
80456
|
+
ldsMobileInstrumentation$2.trackValue(GRAPHQL_EVAL_DB_READ_DURATION, duration);
|
|
80457
|
+
}
|
|
80458
|
+
function reportGraphqlAdapterError(errorCode) {
|
|
80459
|
+
// Increment overall count with errorCode as tag
|
|
80460
|
+
ldsMobileInstrumentation$2.incrementCounter(GRAPHQL_EVAL_ERROR, 1, true, { errorCode });
|
|
80461
|
+
}
|
|
80462
|
+
function reportGraphqlQueryInstrumentation(data) {
|
|
80463
|
+
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
80464
|
+
const recordBuckets = [
|
|
80465
|
+
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
80466
|
+
];
|
|
80467
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_ROOT_QUERY_COUNT, data.rootQueryCount, queryBuckets);
|
|
80468
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_TOTAL_QUERY_COUNT, data.totalQueryCount, queryBuckets);
|
|
80469
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT, data.maxChildRelationships, queryBuckets);
|
|
80470
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_QUERY_RECORD_COUNT, data.requestedRecordCount, recordBuckets);
|
|
80471
|
+
}
|
|
80472
|
+
function incrementGraphQLRefreshUndfined() {
|
|
80473
|
+
ldsMobileInstrumentation$2.incrementCounter(GRAPHQL_SNAPSHOT_REFRESH_UNDEFINED);
|
|
80474
|
+
}
|
|
80475
|
+
function reportDraftActionEvent(state, draftCount, message) {
|
|
80476
|
+
if (nimbusLogger) {
|
|
80477
|
+
nimbusLogger.logInfo(`Draft action event: ${state}, depth: ${draftCount}${message ? `, message: ${message}` : ''}`);
|
|
80478
|
+
}
|
|
80479
|
+
switch (state) {
|
|
80480
|
+
case 'added':
|
|
80481
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_ADDED);
|
|
80482
|
+
break;
|
|
80483
|
+
case 'uploading':
|
|
80484
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPLOADING);
|
|
80485
|
+
break;
|
|
80486
|
+
case 'completed':
|
|
80487
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_COMPLETED);
|
|
80488
|
+
break;
|
|
80489
|
+
case 'deleted':
|
|
80490
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_DELETED);
|
|
80491
|
+
break;
|
|
80492
|
+
case 'failed':
|
|
80493
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_FAILED, 1, true);
|
|
80494
|
+
break;
|
|
80495
|
+
case 'updated':
|
|
80496
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPDATED);
|
|
80497
|
+
break;
|
|
80498
|
+
}
|
|
80499
|
+
}
|
|
80500
|
+
function reportDraftQueueState(state, draftCount) {
|
|
80501
|
+
if (nimbusLogger) {
|
|
80502
|
+
nimbusLogger.logInfo(`Draft state changed: ${state}, depth: ${draftCount}`);
|
|
80503
|
+
}
|
|
80504
|
+
switch (state) {
|
|
80505
|
+
case 'started':
|
|
80506
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STARTED);
|
|
80507
|
+
break;
|
|
80508
|
+
case 'error':
|
|
80509
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_ERROR, 1, true);
|
|
80510
|
+
break;
|
|
80511
|
+
case 'waiting':
|
|
80512
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_WAITING);
|
|
80513
|
+
break;
|
|
80514
|
+
case 'stopped':
|
|
80515
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STOPPED);
|
|
80516
|
+
break;
|
|
80517
|
+
}
|
|
80518
|
+
}
|
|
80519
|
+
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
80520
|
+
let error;
|
|
80521
|
+
if (err.body !== undefined) {
|
|
80522
|
+
error = err.body;
|
|
80523
|
+
}
|
|
80524
|
+
else {
|
|
80525
|
+
error = normalizeError$1(err);
|
|
80526
|
+
}
|
|
80527
|
+
const errorCode = DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR;
|
|
80528
|
+
const errorType = error.errorType;
|
|
80529
|
+
const tags = {
|
|
80530
|
+
errorCode,
|
|
80531
|
+
};
|
|
80532
|
+
if (errorType !== undefined) {
|
|
80533
|
+
tags.errorType = errorType;
|
|
80534
|
+
}
|
|
80535
|
+
// Metric
|
|
80536
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR, 1, true, tags);
|
|
80537
|
+
// Log
|
|
80538
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
80539
|
+
}
|
|
80540
|
+
function reportDraftAwareContentVersionSynthesizeCalls(mimeType) {
|
|
80541
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS, 1, undefined, { mimeType });
|
|
80542
|
+
}
|
|
80543
|
+
/** Priming */
|
|
80544
|
+
function reportPrimingSessionCreated() {
|
|
80545
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_SESSION_COUNT, 1, undefined, {});
|
|
80546
|
+
}
|
|
80547
|
+
function reportPrimingError(errorType, recordCount) {
|
|
80548
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_ERROR_COUNT, recordCount, undefined, {
|
|
80549
|
+
errorType,
|
|
80550
|
+
});
|
|
80551
|
+
}
|
|
80552
|
+
function reportPrimingSuccess(recordCount) {
|
|
80553
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_PRIMED_COUNT, recordCount, undefined);
|
|
80554
|
+
}
|
|
80555
|
+
function reportPrimingConflict(resolutionType, recordCount) {
|
|
80556
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_CONFLICT_COUNT, recordCount, undefined, {
|
|
80557
|
+
resolutionType,
|
|
80558
|
+
});
|
|
80559
|
+
}
|
|
80560
|
+
/** Network */
|
|
80561
|
+
function reportChunkCandidateUrlLength(urlLength) {
|
|
80562
|
+
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
80563
|
+
ldsMobileInstrumentation$2.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
80564
|
+
}
|
|
80565
|
+
|
|
80363
80566
|
const QUICK_ACTION_HANDLER = 'QUICK_ACTION_HANDLER';
|
|
80364
80567
|
class QuickActionExecutionRepresentationHandler extends AbstractQuickActionHandler {
|
|
80365
80568
|
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, sideEffectService, objectInfoService, getRecord) {
|
|
@@ -80370,6 +80573,7 @@
|
|
|
80370
80573
|
this.objectInfoService = objectInfoService;
|
|
80371
80574
|
this.getRecord = getRecord;
|
|
80372
80575
|
this.handlerId = QUICK_ACTION_HANDLER;
|
|
80576
|
+
this.instrumentation = getInstrumentation();
|
|
80373
80577
|
draftRecordService.registerRecordHandler(this);
|
|
80374
80578
|
}
|
|
80375
80579
|
async draftActionToSideEffects(queueEntry) {
|
|
@@ -80401,10 +80605,26 @@
|
|
|
80401
80605
|
luvio.storeIngest(key, ingest$B$2, response);
|
|
80402
80606
|
}
|
|
80403
80607
|
async handleActionCompleted(action, queueOperations) {
|
|
80608
|
+
/* performQuickAction will not return the new record itself, so before the action
|
|
80609
|
+
* is marked as completed, we need to fetch the actual record. This must be done before
|
|
80610
|
+
* the super method is called because the super method will revert the side effects that
|
|
80611
|
+
* were created for this action, and critically that means evicting the synthetic record
|
|
80612
|
+
* that was created to represent the draft of what would become the canonical record.
|
|
80613
|
+
* Since getRecord is a network call, it is better to have a small timeframe (on the order
|
|
80614
|
+
* of microseconds) where both the synthetic record and the canonical record are in the
|
|
80615
|
+
* store instead of the record missing from the store for the entire duration of the
|
|
80616
|
+
* network call.
|
|
80617
|
+
*/
|
|
80618
|
+
try {
|
|
80619
|
+
await this.fetchRecordIntoStoreFromCompletedAction(action);
|
|
80620
|
+
}
|
|
80621
|
+
catch (error) {
|
|
80622
|
+
this.instrumentation.error(error, 'Error fetching the record created from performQuickAction adapter.');
|
|
80623
|
+
}
|
|
80404
80624
|
await super.handleActionCompleted(action, queueOperations);
|
|
80405
|
-
|
|
80625
|
+
}
|
|
80626
|
+
async fetchRecordIntoStoreFromCompletedAction(action) {
|
|
80406
80627
|
const canonicalId = action.response.body.id;
|
|
80407
|
-
this.buildTagForTargetId(canonicalId);
|
|
80408
80628
|
const prefix = canonicalId.substring(0, 3);
|
|
80409
80629
|
if (prefix.length !== 3) {
|
|
80410
80630
|
// if we can't get a prefix, don't do the rest
|
|
@@ -88111,6 +88331,9 @@
|
|
|
88111
88331
|
if (value === undefined || value === null) {
|
|
88112
88332
|
return null;
|
|
88113
88333
|
}
|
|
88334
|
+
if (typeof value === 'string') {
|
|
88335
|
+
return value;
|
|
88336
|
+
}
|
|
88114
88337
|
return stringify$1(value);
|
|
88115
88338
|
}
|
|
88116
88339
|
function parseIfPresent(value) {
|
|
@@ -88816,96 +89039,6 @@
|
|
|
88816
89039
|
}
|
|
88817
89040
|
}
|
|
88818
89041
|
|
|
88819
|
-
function attachObserversToAdapterRequestContext(observers, adapterRequestContext) {
|
|
88820
|
-
if (adapterRequestContext === undefined) {
|
|
88821
|
-
return { eventObservers: observers };
|
|
88822
|
-
}
|
|
88823
|
-
if (adapterRequestContext.eventObservers === undefined) {
|
|
88824
|
-
return { ...adapterRequestContext, eventObservers: observers };
|
|
88825
|
-
}
|
|
88826
|
-
return {
|
|
88827
|
-
...adapterRequestContext,
|
|
88828
|
-
eventObservers: adapterRequestContext.eventObservers.concat(observers),
|
|
88829
|
-
};
|
|
88830
|
-
}
|
|
88831
|
-
/**
|
|
88832
|
-
* Use this method to sanitize the unknown error object when
|
|
88833
|
-
* we are unsure of the type of the error thrown
|
|
88834
|
-
*
|
|
88835
|
-
* @param err Unknown object to sanitize
|
|
88836
|
-
* @returns an instance of error
|
|
88837
|
-
*/
|
|
88838
|
-
function normalizeError$1(err) {
|
|
88839
|
-
if (err instanceof Error) {
|
|
88840
|
-
return err;
|
|
88841
|
-
}
|
|
88842
|
-
else if (typeof err === 'string') {
|
|
88843
|
-
return new Error(err);
|
|
88844
|
-
}
|
|
88845
|
-
return new Error(stringify$2(err));
|
|
88846
|
-
}
|
|
88847
|
-
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
88848
|
-
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
88849
|
-
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
88850
|
-
const GRAPHQL_EVAL_QUERY_RECORD_COUNT = 'gql-eval-query-record-count';
|
|
88851
|
-
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
88852
|
-
const ldsMobileInstrumentation$2 = getInstrumentation();
|
|
88853
|
-
const nimbusLogger = typeof __nimbus !== 'undefined' &&
|
|
88854
|
-
__nimbus.plugins !== undefined &&
|
|
88855
|
-
__nimbus.plugins.JSLoggerPlugin !== undefined
|
|
88856
|
-
? __nimbus.plugins.JSLoggerPlugin
|
|
88857
|
-
: undefined;
|
|
88858
|
-
function reportGraphqlQueryParseError(err) {
|
|
88859
|
-
normalizeError$1(err);
|
|
88860
|
-
}
|
|
88861
|
-
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
88862
|
-
normalizeError$1(err);
|
|
88863
|
-
}
|
|
88864
|
-
function reportGraphqlCreateSnapshotError(err) {
|
|
88865
|
-
normalizeError$1(err);
|
|
88866
|
-
}
|
|
88867
|
-
function reportGraphQlEvalDbReadDuration(duration) {
|
|
88868
|
-
}
|
|
88869
|
-
function reportGraphqlQueryInstrumentation(data) {
|
|
88870
|
-
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
88871
|
-
const recordBuckets = [
|
|
88872
|
-
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
88873
|
-
];
|
|
88874
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_ROOT_QUERY_COUNT, data.rootQueryCount, queryBuckets);
|
|
88875
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_TOTAL_QUERY_COUNT, data.totalQueryCount, queryBuckets);
|
|
88876
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT, data.maxChildRelationships, queryBuckets);
|
|
88877
|
-
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_QUERY_RECORD_COUNT, data.requestedRecordCount, recordBuckets);
|
|
88878
|
-
}
|
|
88879
|
-
function reportDraftActionEvent(state, draftCount, message) {
|
|
88880
|
-
if (nimbusLogger) {
|
|
88881
|
-
nimbusLogger.logInfo(`Draft action event: ${state}, depth: ${draftCount}${message ? `, message: ${message}` : ''}`);
|
|
88882
|
-
}
|
|
88883
|
-
}
|
|
88884
|
-
function reportDraftQueueState(state, draftCount) {
|
|
88885
|
-
if (nimbusLogger) {
|
|
88886
|
-
nimbusLogger.logInfo(`Draft state changed: ${state}, depth: ${draftCount}`);
|
|
88887
|
-
}
|
|
88888
|
-
}
|
|
88889
|
-
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
88890
|
-
let error;
|
|
88891
|
-
if (err.body !== undefined) {
|
|
88892
|
-
error = err.body;
|
|
88893
|
-
}
|
|
88894
|
-
else {
|
|
88895
|
-
error = normalizeError$1(err);
|
|
88896
|
-
}
|
|
88897
|
-
error.errorType;
|
|
88898
|
-
}
|
|
88899
|
-
function reportDraftAwareContentVersionSynthesizeCalls(mimeType) {
|
|
88900
|
-
}
|
|
88901
|
-
function reportPrimingError(errorType, recordCount) {
|
|
88902
|
-
}
|
|
88903
|
-
function reportPrimingConflict(resolutionType, recordCount) {
|
|
88904
|
-
}
|
|
88905
|
-
/** Network */
|
|
88906
|
-
function reportChunkCandidateUrlLength(urlLength) {
|
|
88907
|
-
}
|
|
88908
|
-
|
|
88909
89042
|
/**
|
|
88910
89043
|
* HOF (high-order-function) that instruments any async operation. If the operation
|
|
88911
89044
|
* has an error then the hasError param will be set on the call to o11y.incrementCounter
|
|
@@ -88917,13 +89050,19 @@
|
|
|
88917
89050
|
return operation();
|
|
88918
89051
|
}
|
|
88919
89052
|
const { tags, metricName, logError } = config;
|
|
89053
|
+
let hasError = false;
|
|
88920
89054
|
return operation()
|
|
88921
89055
|
.catch((err) => {
|
|
89056
|
+
hasError = true;
|
|
88922
89057
|
const error = normalizeError$1(err);
|
|
88923
89058
|
tags['errorMessage'] = error.message;
|
|
89059
|
+
if (logError) {
|
|
89060
|
+
ldsMobileInstrumentation$2.error(error);
|
|
89061
|
+
}
|
|
88924
89062
|
throw err;
|
|
88925
89063
|
})
|
|
88926
89064
|
.finally(() => {
|
|
89065
|
+
ldsMobileInstrumentation$2.incrementCounter(metricName, 1, hasError, tags);
|
|
88927
89066
|
});
|
|
88928
89067
|
};
|
|
88929
89068
|
|
|
@@ -89263,6 +89402,9 @@
|
|
|
89263
89402
|
case 'graphql-query-instrumentation':
|
|
89264
89403
|
reportGraphqlQueryInstrumentation(data.data);
|
|
89265
89404
|
break;
|
|
89405
|
+
case 'graphql-luvio-refresh-undefined':
|
|
89406
|
+
incrementGraphQLRefreshUndfined();
|
|
89407
|
+
break;
|
|
89266
89408
|
}
|
|
89267
89409
|
}
|
|
89268
89410
|
},
|
|
@@ -89575,6 +89717,9 @@
|
|
|
89575
89717
|
}
|
|
89576
89718
|
|
|
89577
89719
|
const tasker = idleDetector.declareNotifierTaskMulti('NimbusSqliteStore');
|
|
89720
|
+
const instrumentation$2 = getInstrumentation();
|
|
89721
|
+
const GRAPHQL_QUERY_ROOT_KEY = 'UiApi::uiapi::Query[uiapi]__uiapi__query';
|
|
89722
|
+
const GRAPHQL_QUERY_ROOT_METRIC_NAME = 'gql-query-root-object-size';
|
|
89578
89723
|
class NimbusSqliteStore {
|
|
89579
89724
|
constructor(plugin, additionalTableMap = {}) {
|
|
89580
89725
|
this.plugin = plugin;
|
|
@@ -89621,6 +89766,9 @@
|
|
|
89621
89766
|
}
|
|
89622
89767
|
const table = this.getTable(segment);
|
|
89623
89768
|
const upsertOperation = table.entriesToUpsertOperations(entries, segment);
|
|
89769
|
+
if (entries[GRAPHQL_QUERY_ROOT_KEY]) {
|
|
89770
|
+
this.trackGraphQLQueryRootSize(upsertOperation);
|
|
89771
|
+
}
|
|
89624
89772
|
return this.batchOperationAsPromise([upsertOperation]);
|
|
89625
89773
|
}
|
|
89626
89774
|
setMetadata(entries, segment) {
|
|
@@ -89636,7 +89784,11 @@
|
|
|
89636
89784
|
if (cur.type === 'setEntries') {
|
|
89637
89785
|
if (keys$6(cur.entries).length > 0) {
|
|
89638
89786
|
const table = this.getTable(cur.segment);
|
|
89639
|
-
|
|
89787
|
+
const upsertOperation = table.entriesToUpsertOperations(cur.entries, cur.segment);
|
|
89788
|
+
if (cur.entries[GRAPHQL_QUERY_ROOT_KEY]) {
|
|
89789
|
+
this.trackGraphQLQueryRootSize(upsertOperation);
|
|
89790
|
+
}
|
|
89791
|
+
acc.push(upsertOperation);
|
|
89640
89792
|
}
|
|
89641
89793
|
}
|
|
89642
89794
|
else if (cur.type === 'setMetadata') {
|
|
@@ -89720,6 +89872,19 @@
|
|
|
89720
89872
|
});
|
|
89721
89873
|
}).finally(() => tasker.done());
|
|
89722
89874
|
}
|
|
89875
|
+
trackGraphQLQueryRootSize(upsertOperation) {
|
|
89876
|
+
try {
|
|
89877
|
+
if (upsertOperation.type !== 'upsert') {
|
|
89878
|
+
return;
|
|
89879
|
+
}
|
|
89880
|
+
const row = upsertOperation.rows.find((r) => r[0] === GRAPHQL_QUERY_ROOT_KEY);
|
|
89881
|
+
if (!(row && row[1] && typeof row[1] === 'string')) {
|
|
89882
|
+
return;
|
|
89883
|
+
}
|
|
89884
|
+
instrumentation$2.trackValue(GRAPHQL_QUERY_ROOT_METRIC_NAME, row[1].length);
|
|
89885
|
+
}
|
|
89886
|
+
catch { }
|
|
89887
|
+
}
|
|
89723
89888
|
}
|
|
89724
89889
|
|
|
89725
89890
|
// These const values must be in sync with the latest
|
|
@@ -90357,6 +90522,7 @@
|
|
|
90357
90522
|
const SESSION_INGEST_WRITTEN = 'priming-session-ingest-written-count';
|
|
90358
90523
|
const SESSION_INGEST_CONFLICTED = 'priming-session-ingest-conflicted-count';
|
|
90359
90524
|
const SESSION_INGEST_ERRORS = 'priming-session-ingest-error-count';
|
|
90525
|
+
const SESSION_INGEST_DURATION = 'priming-session-ingest-duration';
|
|
90360
90526
|
class PrimingSession extends EventEmitter {
|
|
90361
90527
|
constructor(config) {
|
|
90362
90528
|
super();
|
|
@@ -90531,6 +90697,7 @@
|
|
|
90531
90697
|
instrumentation$1$1.trackValue(SESSION_INGEST_WRITTEN, written.length);
|
|
90532
90698
|
instrumentation$1$1.trackValue(SESSION_INGEST_CONFLICTED, conflicted.length);
|
|
90533
90699
|
instrumentation$1$1.trackValue(SESSION_INGEST_ERRORS, errors.length);
|
|
90700
|
+
instrumentation$1$1.trackValue(SESSION_INGEST_DURATION, Date.now() - beforeWrite);
|
|
90534
90701
|
stats.conflictedCount = conflicted.length;
|
|
90535
90702
|
this.emit('batch-written', {
|
|
90536
90703
|
written,
|
|
@@ -91272,10 +91439,12 @@
|
|
|
91272
91439
|
}
|
|
91273
91440
|
|
|
91274
91441
|
function instrumentPrimingSession(session) {
|
|
91442
|
+
reportPrimingSessionCreated();
|
|
91275
91443
|
session.on('error', ({ code, ids }) => {
|
|
91276
91444
|
reportPrimingError(code, ids.length);
|
|
91277
91445
|
});
|
|
91278
91446
|
session.on('primed', ({ length }) => {
|
|
91447
|
+
reportPrimingSuccess(length);
|
|
91279
91448
|
});
|
|
91280
91449
|
session.on('conflict', ({ ids, resolution }) => {
|
|
91281
91450
|
reportPrimingConflict(resolution, ids.length);
|
|
@@ -92899,7 +93068,7 @@
|
|
|
92899
93068
|
return storeRecord.__type === 'error';
|
|
92900
93069
|
}
|
|
92901
93070
|
|
|
92902
|
-
const instrumentation$
|
|
93071
|
+
const instrumentation$4 = getInstrumentation();
|
|
92903
93072
|
const ProductConsumed = {
|
|
92904
93073
|
API_NAME: 'ProductConsumed',
|
|
92905
93074
|
Fields: {
|
|
@@ -92957,6 +93126,7 @@
|
|
|
92957
93126
|
const originalRecord = await this.durableRecordStore.getRecord(buildRecordRepKeyFromId$1(draftRecordId));
|
|
92958
93127
|
if (originalRecord === undefined) {
|
|
92959
93128
|
incrementCounter(ProductConsumedUpdatedHook.COUNTER_NAME, CounterResult.Error);
|
|
93129
|
+
instrumentation$4.error(`SFS - ProductConsumedUpdatedHook - Original record ${draftRecordId} not found`);
|
|
92960
93130
|
return [];
|
|
92961
93131
|
}
|
|
92962
93132
|
const originalProductItemId = getProductItemIdFromRecordFields(originalRecord.fields);
|
|
@@ -92967,6 +93137,7 @@
|
|
|
92967
93137
|
}
|
|
92968
93138
|
if (originalQuantityConsumed === undefined) {
|
|
92969
93139
|
incrementCounter(ProductConsumedUpdatedHook.COUNTER_NAME, CounterResult.Error);
|
|
93140
|
+
instrumentation$4.error(`SFS - ProductConsumedUpdatedHook - Original record ${draftRecordId} QuantityConsumed not found`);
|
|
92970
93141
|
return [];
|
|
92971
93142
|
}
|
|
92972
93143
|
incrementCounter(ProductConsumedUpdatedHook.COUNTER_NAME, CounterResult.Created);
|
|
@@ -92993,6 +93164,7 @@
|
|
|
92993
93164
|
const originalRecord = await this.durableRecordStore.getRecord(buildRecordRepKeyFromId$1(draftRecordId));
|
|
92994
93165
|
if (originalRecord === undefined) {
|
|
92995
93166
|
incrementCounter(ProductConsumedDeletedHook.COUNTER_NAME, CounterResult.Error);
|
|
93167
|
+
instrumentation$4.error(`SFS - ProductConsumedDeletedHook - Original record ${draftRecordId} not found`);
|
|
92996
93168
|
return [];
|
|
92997
93169
|
}
|
|
92998
93170
|
const productItemId = getProductItemIdFromRecordFields(originalRecord.fields);
|
|
@@ -93003,6 +93175,7 @@
|
|
|
93003
93175
|
}
|
|
93004
93176
|
if (quantityConsumed === undefined) {
|
|
93005
93177
|
incrementCounter(ProductConsumedDeletedHook.COUNTER_NAME, CounterResult.Error);
|
|
93178
|
+
instrumentation$4.error(`SFS - ProductConsumedDeletedHook - Original record ${draftRecordId} QuantityConsumed not found`);
|
|
93006
93179
|
return [];
|
|
93007
93180
|
}
|
|
93008
93181
|
incrementCounter(ProductConsumedDeletedHook.COUNTER_NAME, CounterResult.Created);
|
|
@@ -93057,7 +93230,7 @@
|
|
|
93057
93230
|
CounterResult["Error"] = "Error";
|
|
93058
93231
|
})(CounterResult || (CounterResult = {}));
|
|
93059
93232
|
function incrementCounter(name, result) {
|
|
93060
|
-
instrumentation$
|
|
93233
|
+
instrumentation$4.incrementCounter('SFSSideEffect', 1, result == CounterResult.Error, {
|
|
93061
93234
|
Name: name,
|
|
93062
93235
|
Result: result,
|
|
93063
93236
|
});
|
|
@@ -93262,7 +93435,7 @@
|
|
|
93262
93435
|
id: '@salesforce/lds-network-adapter',
|
|
93263
93436
|
instrument: instrument$2,
|
|
93264
93437
|
});
|
|
93265
|
-
// version: 1.
|
|
93438
|
+
// version: 1.366.0-30380c7ed7
|
|
93266
93439
|
|
|
93267
93440
|
const { create: create$2, keys: keys$2 } = Object;
|
|
93268
93441
|
const { stringify, parse } = JSON;
|
|
@@ -119431,7 +119604,7 @@
|
|
|
119431
119604
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
119432
119605
|
instrument: instrument$1,
|
|
119433
119606
|
});
|
|
119434
|
-
// version: 1.
|
|
119607
|
+
// version: 1.366.0-bf15f04cce
|
|
119435
119608
|
|
|
119436
119609
|
// On core the unstable adapters are re-exported with different names,
|
|
119437
119610
|
// we want to match them here.
|
|
@@ -119583,7 +119756,7 @@
|
|
|
119583
119756
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
119584
119757
|
graphQLImperative = ldsAdapter;
|
|
119585
119758
|
});
|
|
119586
|
-
// version: 1.
|
|
119759
|
+
// version: 1.366.0-bf15f04cce
|
|
119587
119760
|
|
|
119588
119761
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
119589
119762
|
__proto__: null,
|
|
@@ -120382,7 +120555,7 @@
|
|
|
120382
120555
|
function register(r) {
|
|
120383
120556
|
callbacks$1.forEach((callback) => callback(r));
|
|
120384
120557
|
}
|
|
120385
|
-
// version: 1.
|
|
120558
|
+
// version: 1.366.0-30380c7ed7
|
|
120386
120559
|
|
|
120387
120560
|
/**
|
|
120388
120561
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -121571,4 +121744,4 @@
|
|
|
121571
121744
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
121572
121745
|
|
|
121573
121746
|
}));
|
|
121574
|
-
// version: 1.
|
|
121747
|
+
// version: 1.366.0-30380c7ed7
|