@salesforce/lds-worker-api 1.308.0 → 1.309.0-dev11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sfdc/es/ldsWorkerApi.js +11 -5
- package/dist/sfdc/es/types/executeAdapter.d.ts +1 -0
- package/dist/standalone/es/lds-worker-api.js +232 -77
- package/dist/standalone/es/types/executeAdapter.d.ts +1 -0
- package/dist/standalone/umd/lds-worker-api.js +232 -77
- package/dist/standalone/umd/types/executeAdapter.d.ts +1 -0
- package/package.json +11 -11
|
@@ -33,12 +33,12 @@ import * as lightningRelatedListApi from 'lightning/uiRelatedListApi';
|
|
|
33
33
|
import * as unstableLightningRelatedListApi from 'lightning/unstable_uiRelatedListApi';
|
|
34
34
|
import * as lightningGraphQLApi from 'lightning/uiGraphQLApi';
|
|
35
35
|
import * as gqlApi from 'force/ldsAdaptersGraphql';
|
|
36
|
-
import { getRuntime,
|
|
36
|
+
import { getRuntime, O11Y_NAMESPACE_LDS_MOBILE, reportGraphqlQueryParseError } from 'native/ldsRuntimeMobile';
|
|
37
37
|
export { registerReportObserver } from 'native/ldsRuntimeMobile';
|
|
38
38
|
import { HttpStatusCode } from 'force/luvioEngine';
|
|
39
|
+
import { getInstrumentation } from 'o11y/client';
|
|
39
40
|
import { API_NAMESPACE, RECORD_REPRESENTATION_NAME, keyBuilderRecord } from 'native/ldsAdaptersUiapiMobile';
|
|
40
41
|
import { withDefaultLuvio } from 'native/ldsEngineMobile';
|
|
41
|
-
import { getInstrumentation } from 'o11y/client';
|
|
42
42
|
import { evictCacheRecordsByIdsSchema, evictExpiredEntriesSchema } from 'o11y_schema/sf_lds';
|
|
43
43
|
|
|
44
44
|
const { create, keys } = Object;
|
|
@@ -159,6 +159,7 @@ function normalizeError(error) {
|
|
|
159
159
|
return new Error(stringify(error));
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
const ldsMobileInstrumentation$1 = getInstrumentation(O11Y_NAMESPACE_LDS_MOBILE);
|
|
162
163
|
/**
|
|
163
164
|
* Coerces a cache policy passed in from native to a luvio cache policy
|
|
164
165
|
* @param nativeCachePolicy The cache policy passed in from native
|
|
@@ -440,9 +441,14 @@ function invokeAdapterWithMetadata(adapterId, config, metadata, onResponse, nati
|
|
|
440
441
|
draftIds.length > 0) {
|
|
441
442
|
const draftId = draftIds[draftIds.length - 1];
|
|
442
443
|
const managerState = await draftManager.getQueue();
|
|
443
|
-
const
|
|
444
|
+
const draftItem = managerState.items.find((x) => x.id === draftId);
|
|
445
|
+
if (draftItem === undefined) {
|
|
446
|
+
// draftItem no longer exists, might have already been uploaded
|
|
447
|
+
ldsMobileInstrumentation$1.log('tried to set metadata on draft item that no longer exists');
|
|
448
|
+
return onResponse(responseValue);
|
|
449
|
+
}
|
|
444
450
|
draftManager
|
|
445
|
-
.setMetadata(draftId, { ...
|
|
451
|
+
.setMetadata(draftId, { ...draftItem.metadata, ...metadata })
|
|
446
452
|
.then(() => {
|
|
447
453
|
onResponse(responseValue);
|
|
448
454
|
})
|
|
@@ -1071,4 +1077,4 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1071
1077
|
}
|
|
1072
1078
|
|
|
1073
1079
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
1074
|
-
// version: 1.
|
|
1080
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
@@ -2,6 +2,7 @@ import type { AdapterRequestContext, CachePolicy, LuvioAdapterEventObserver } fr
|
|
|
2
2
|
import type { DraftQueueItemMetadata } from '@salesforce/lds-drafts';
|
|
3
3
|
import type { NativeErrorResponse } from './responses';
|
|
4
4
|
import type { ObservabilityContext } from '@salesforce/lds-runtime-mobile';
|
|
5
|
+
export declare const ldsMobileInstrumentation: import("o11y/dist/modules/o11y/client/interfaces").Instrumentation;
|
|
5
6
|
export type NativeCallbackValue = NativeCallbackData | NativeCallbackError | NativeCallbackErrors;
|
|
6
7
|
export type NativeCallbackData = {
|
|
7
8
|
data: any | undefined;
|
|
@@ -931,7 +931,7 @@ class StringKeyInMemoryStore {
|
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
expirePossibleStaleRecords(keys) {
|
|
934
|
-
const expirationTimestamp = Date.now();
|
|
934
|
+
const expirationTimestamp = Date.now() - 1;
|
|
935
935
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
936
936
|
const key = keys[i];
|
|
937
937
|
const metadata = this.readMetadata(key);
|
|
@@ -4137,7 +4137,7 @@ function createResourceParamsImpl(config, configMetadata) {
|
|
|
4137
4137
|
}
|
|
4138
4138
|
return resourceParams;
|
|
4139
4139
|
}
|
|
4140
|
-
// engine version: 0.156.
|
|
4140
|
+
// engine version: 0.156.4-dev1-8df86bf0
|
|
4141
4141
|
|
|
4142
4142
|
/**
|
|
4143
4143
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -4265,7 +4265,7 @@ function withDefaultLuvio(callback) {
|
|
|
4265
4265
|
}
|
|
4266
4266
|
callbacks.push(callback);
|
|
4267
4267
|
}
|
|
4268
|
-
// version: 1.
|
|
4268
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
4269
4269
|
|
|
4270
4270
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4271
4271
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15764,7 +15764,7 @@ function gql(literals, ...subs) {
|
|
|
15764
15764
|
}
|
|
15765
15765
|
return superResult;
|
|
15766
15766
|
}
|
|
15767
|
-
// version: 1.
|
|
15767
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
15768
15768
|
|
|
15769
15769
|
function unwrap(data) {
|
|
15770
15770
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16173,6 +16173,18 @@ class LWCInfinteScrollingLuvioWireAdapter extends LWCLuvioWireAdapter {
|
|
|
16173
16173
|
},
|
|
16174
16174
|
};
|
|
16175
16175
|
}
|
|
16176
|
+
subscribe(snapshot) {
|
|
16177
|
+
var _a;
|
|
16178
|
+
super.subscribe(snapshot);
|
|
16179
|
+
// if the snapshot is refreshed we should stop using data from before the refresh
|
|
16180
|
+
if (this.connected && ((_a = snapshot.refresh) === null || _a === void 0 ? void 0 : _a.resolve)) {
|
|
16181
|
+
const originalResolve = snapshot.refresh.resolve;
|
|
16182
|
+
snapshot.refresh.resolve = (config) => {
|
|
16183
|
+
this.connectTimestamp = Date.now();
|
|
16184
|
+
return originalResolve(config);
|
|
16185
|
+
};
|
|
16186
|
+
}
|
|
16187
|
+
}
|
|
16176
16188
|
}
|
|
16177
16189
|
function createInfiniteScrollingWireAdapterConstructor$1(adapter, name, luvio) {
|
|
16178
16190
|
const constructor = function (callback, sourceContext) {
|
|
@@ -16693,7 +16705,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16693
16705
|
const { apiFamily, name } = metadata;
|
|
16694
16706
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16695
16707
|
}
|
|
16696
|
-
// version: 1.
|
|
16708
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
16697
16709
|
|
|
16698
16710
|
/**
|
|
16699
16711
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16792,7 +16804,7 @@ var TypeCheckShapes;
|
|
|
16792
16804
|
TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
|
|
16793
16805
|
TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
|
|
16794
16806
|
})(TypeCheckShapes || (TypeCheckShapes = {}));
|
|
16795
|
-
// engine version: 0.156.
|
|
16807
|
+
// engine version: 0.156.4-dev1-8df86bf0
|
|
16796
16808
|
|
|
16797
16809
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16798
16810
|
|
|
@@ -40966,7 +40978,7 @@ const performUpdateRecordQuickAction_ConfigPropertyMetadata = [
|
|
|
40966
40978
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
40967
40979
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
40968
40980
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
40969
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
40981
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
40970
40982
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
40971
40983
|
];
|
|
40972
40984
|
const performUpdateRecordQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$8, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
@@ -41012,7 +41024,8 @@ function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
|
|
|
41012
41024
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41013
41025
|
return null;
|
|
41014
41026
|
}
|
|
41015
|
-
const
|
|
41027
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
41028
|
+
const config = typeCheckConfig$d(coercedConfig);
|
|
41016
41029
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41017
41030
|
return null;
|
|
41018
41031
|
}
|
|
@@ -41086,7 +41099,7 @@ const performQuickAction_ConfigPropertyMetadata = [
|
|
|
41086
41099
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
41087
41100
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
41088
41101
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
41089
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
41102
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
41090
41103
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
41091
41104
|
];
|
|
41092
41105
|
const performQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$7, performQuickAction_ConfigPropertyMetadata);
|
|
@@ -41132,7 +41145,8 @@ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
|
|
|
41132
41145
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41133
41146
|
return null;
|
|
41134
41147
|
}
|
|
41135
|
-
const
|
|
41148
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performQuickAction_ConfigPropertyMetadata);
|
|
41149
|
+
const config = typeCheckConfig$c(coercedConfig);
|
|
41136
41150
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41137
41151
|
return null;
|
|
41138
41152
|
}
|
|
@@ -44798,7 +44812,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44798
44812
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44799
44813
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44800
44814
|
});
|
|
44801
|
-
// version: 1.
|
|
44815
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
44802
44816
|
|
|
44803
44817
|
var ldsIdempotencyWriteDisabled = {
|
|
44804
44818
|
isOpen: function (e) {
|
|
@@ -50184,7 +50198,8 @@ function buildLuvioOverrideForDraftAdapters(luvio, handler, extractTargetIdFromC
|
|
|
50184
50198
|
resourceRequestCopy.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
50185
50199
|
}
|
|
50186
50200
|
// enable return extra fields for record creation and record update http call
|
|
50187
|
-
if (resourceRequest.basePath === '
|
|
50201
|
+
if (typeof resourceRequest.basePath === 'string' &&
|
|
50202
|
+
resourceRequest.basePath.startsWith('/ui-api/records') &&
|
|
50188
50203
|
(resourceRequest.method === 'post' || resourceRequest.method === 'patch')) {
|
|
50189
50204
|
resourceRequestCopy.queryParams = resourceRequestCopy.queryParams || {};
|
|
50190
50205
|
resourceRequestCopy.queryParams['includeFieldsInBody'] = true;
|
|
@@ -51993,10 +52008,49 @@ const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
|
51993
52008
|
const { shift } = Array.prototype;
|
|
51994
52009
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
51995
52010
|
|
|
52011
|
+
/**
|
|
52012
|
+
* Retrieves a denormalized record from the store
|
|
52013
|
+
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52014
|
+
* @param recordKey record key
|
|
52015
|
+
* @param durableStore the durable store
|
|
52016
|
+
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52017
|
+
*/
|
|
52018
|
+
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52019
|
+
return durableStore
|
|
52020
|
+
.getEntries([recordKey], DefaultDurableSegment)
|
|
52021
|
+
.then((entries) => {
|
|
52022
|
+
if (entries === undefined) {
|
|
52023
|
+
return undefined;
|
|
52024
|
+
}
|
|
52025
|
+
const denormalizedEntry = entries[recordKey];
|
|
52026
|
+
if (denormalizedEntry === undefined) {
|
|
52027
|
+
return undefined;
|
|
52028
|
+
}
|
|
52029
|
+
// don't include link information
|
|
52030
|
+
const denormalizedRecord = denormalizedEntry.data;
|
|
52031
|
+
if (isStoreRecordError(denormalizedRecord)) {
|
|
52032
|
+
return undefined;
|
|
52033
|
+
}
|
|
52034
|
+
return denormalizedRecord;
|
|
52035
|
+
});
|
|
52036
|
+
}
|
|
52037
|
+
function isStoreRecordError(storeRecord) {
|
|
52038
|
+
return storeRecord.__type === 'error';
|
|
52039
|
+
}
|
|
52040
|
+
function isDraftFieldPending(field) {
|
|
52041
|
+
return !!(field.__state && field.__state.pending === true);
|
|
52042
|
+
}
|
|
52043
|
+
function isDraftFieldMissing(field) {
|
|
52044
|
+
return !!(field.__state && field.__state.isMissing === true);
|
|
52045
|
+
}
|
|
52046
|
+
|
|
51996
52047
|
function isFieldLink(field) {
|
|
51997
52048
|
const { value } = field;
|
|
51998
52049
|
return value !== null && typeof value === 'object' && value.__ref !== undefined;
|
|
51999
52050
|
}
|
|
52051
|
+
function isPendingOrMissing(field) {
|
|
52052
|
+
return isDraftFieldMissing(field) || isDraftFieldPending(field);
|
|
52053
|
+
}
|
|
52000
52054
|
|
|
52001
52055
|
const RECORD_ENDPOINT_REGEX$1 = /^\/ui-api\/records\/?(([a-zA-Z0-9]+))?$/;
|
|
52002
52056
|
/**
|
|
@@ -52053,12 +52107,12 @@ function getRecordKeyForId(luvio, recordId) {
|
|
|
52053
52107
|
* @param record draft record representation
|
|
52054
52108
|
* @returns flattened record representation
|
|
52055
52109
|
*/
|
|
52056
|
-
function
|
|
52110
|
+
function filterOutReferenceNonScalarFields(record) {
|
|
52057
52111
|
const filteredFields = {};
|
|
52058
52112
|
const fieldNames = keys$5(record.fields);
|
|
52059
52113
|
for (const fieldName of fieldNames) {
|
|
52060
52114
|
const field = record.fields[fieldName];
|
|
52061
|
-
if (isFieldLink(field) === false) {
|
|
52115
|
+
if (isFieldLink(field) === false && isPendingOrMissing(field) === false) {
|
|
52062
52116
|
filteredFields[fieldName] = field;
|
|
52063
52117
|
}
|
|
52064
52118
|
}
|
|
@@ -52072,42 +52126,6 @@ function filterOutReferenceFieldsAndLinks(record) {
|
|
|
52072
52126
|
return filteredRecords;
|
|
52073
52127
|
}
|
|
52074
52128
|
|
|
52075
|
-
/**
|
|
52076
|
-
* Retrieves a denormalized record from the store
|
|
52077
|
-
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52078
|
-
* @param recordKey record key
|
|
52079
|
-
* @param durableStore the durable store
|
|
52080
|
-
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52081
|
-
*/
|
|
52082
|
-
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52083
|
-
return durableStore
|
|
52084
|
-
.getEntries([recordKey], DefaultDurableSegment)
|
|
52085
|
-
.then((entries) => {
|
|
52086
|
-
if (entries === undefined) {
|
|
52087
|
-
return undefined;
|
|
52088
|
-
}
|
|
52089
|
-
const denormalizedEntry = entries[recordKey];
|
|
52090
|
-
if (denormalizedEntry === undefined) {
|
|
52091
|
-
return undefined;
|
|
52092
|
-
}
|
|
52093
|
-
// don't include link information
|
|
52094
|
-
const denormalizedRecord = denormalizedEntry.data;
|
|
52095
|
-
if (isStoreRecordError(denormalizedRecord)) {
|
|
52096
|
-
return undefined;
|
|
52097
|
-
}
|
|
52098
|
-
return denormalizedRecord;
|
|
52099
|
-
});
|
|
52100
|
-
}
|
|
52101
|
-
function isStoreRecordError(storeRecord) {
|
|
52102
|
-
return storeRecord.__type === 'error';
|
|
52103
|
-
}
|
|
52104
|
-
function isDraftFieldPending(field) {
|
|
52105
|
-
return !!(field.__state && field.__state.pending === true);
|
|
52106
|
-
}
|
|
52107
|
-
function isDraftFieldMissing(field) {
|
|
52108
|
-
return !!(field.__state && field.__state.isMissing === true);
|
|
52109
|
-
}
|
|
52110
|
-
|
|
52111
52129
|
/**
|
|
52112
52130
|
* Checks if a resource request is a GET method on the record endpoint
|
|
52113
52131
|
* @param request the resource request
|
|
@@ -53145,7 +53163,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
53145
53163
|
if (recordWithDrafts === undefined) {
|
|
53146
53164
|
return undefined;
|
|
53147
53165
|
}
|
|
53148
|
-
return
|
|
53166
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53149
53167
|
}
|
|
53150
53168
|
const record = await getDenormalizedRecord(key, this.durableStore);
|
|
53151
53169
|
if (record === undefined) {
|
|
@@ -53156,7 +53174,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
53156
53174
|
if (recordWithDrafts === undefined) {
|
|
53157
53175
|
return recordWithDrafts;
|
|
53158
53176
|
}
|
|
53159
|
-
return
|
|
53177
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53160
53178
|
}
|
|
53161
53179
|
applyDraftsToIncomingData(key, data, draftMetadata, publishData) {
|
|
53162
53180
|
if (draftMetadata === undefined) {
|
|
@@ -54052,9 +54070,9 @@ class ContentDocumentCompositeRepresentationActionHandler extends AbstractResour
|
|
|
54052
54070
|
return undefined;
|
|
54053
54071
|
}
|
|
54054
54072
|
// finally we resolve all references for each record
|
|
54055
|
-
const contentDocResolved = await
|
|
54056
|
-
const contentDocLinkResolved = await
|
|
54057
|
-
const contentVersionResolved = await
|
|
54073
|
+
const contentDocResolved = await filterOutReferenceNonScalarFields(contentDocRecord);
|
|
54074
|
+
const contentDocLinkResolved = await filterOutReferenceNonScalarFields(contentDocLink);
|
|
54075
|
+
const contentVersionResolved = await filterOutReferenceNonScalarFields(contentVersion);
|
|
54058
54076
|
return {
|
|
54059
54077
|
contentDocument: contentDocResolved,
|
|
54060
54078
|
contentDocumentLinks: [contentDocLinkResolved],
|
|
@@ -57126,14 +57144,14 @@ async function connectionResolver(obj, args, context, info) {
|
|
|
57126
57144
|
limit = args.first;
|
|
57127
57145
|
}
|
|
57128
57146
|
let offset = 0;
|
|
57129
|
-
|
|
57130
|
-
|
|
57131
|
-
if (!originalCursor) {
|
|
57132
|
-
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
57133
|
-
throw new Error('Internal Error: unable to determine `after` cursor value');
|
|
57134
|
-
}
|
|
57147
|
+
let originalCursor = context.mappedCursors.get(queryCacheKey);
|
|
57148
|
+
if (originalCursor) {
|
|
57135
57149
|
offset = decodeV1Cursor(originalCursor).i;
|
|
57136
57150
|
}
|
|
57151
|
+
else if (args.after) {
|
|
57152
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
57153
|
+
throw new Error('Internal Error: unable to determine `after` cursor value');
|
|
57154
|
+
}
|
|
57137
57155
|
// if the query wants to know `hasNextPage` then we need to request 1 additional record
|
|
57138
57156
|
let selections = info.fieldNodes
|
|
57139
57157
|
.map((n) => (n.selectionSet ? n.selectionSet.selections : []))
|
|
@@ -61309,32 +61327,118 @@ function normalizeError$2(err) {
|
|
|
61309
61327
|
}
|
|
61310
61328
|
return new Error(stringify$1$1(err));
|
|
61311
61329
|
}
|
|
61330
|
+
// metrics
|
|
61331
|
+
/** GraphQL */
|
|
61332
|
+
const GRAPHQL_EVAL_ERROR = 'gql-eval-error';
|
|
61333
|
+
const GRAPHQL_EVAL_DB_READ_DURATION = 'gql-eval-db-read-duration';
|
|
61312
61334
|
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
61313
61335
|
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
61314
61336
|
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
61315
61337
|
const GRAPHQL_EVAL_QUERY_RECORD_COUNT = 'gql-eval-query-record-count';
|
|
61338
|
+
/** Draft Queue */
|
|
61339
|
+
const DRAFT_QUEUE_STATE_STARTED = 'draft-queue-state-started';
|
|
61340
|
+
const DRAFT_QUEUE_STATE_ERROR = 'draft-queue-state-error';
|
|
61341
|
+
const DRAFT_QUEUE_STATE_WAITING = 'draft-queue-state-waiting';
|
|
61342
|
+
const DRAFT_QUEUE_STATE_STOPPED = 'draft-queue-state-stopped';
|
|
61343
|
+
const DRAFT_QUEUE_ACTION_ADDED = 'draft-queue-action-added';
|
|
61344
|
+
const DRAFT_QUEUE_ACTION_UPLOADING = 'draft-queue-action-uploading';
|
|
61345
|
+
const DRAFT_QUEUE_ACTION_COMPLETED = 'draft-queue-action-completed';
|
|
61346
|
+
const DRAFT_QUEUE_ACTION_DELETED = 'draft-queue-action-deleted';
|
|
61347
|
+
const DRAFT_QUEUE_ACTION_UPDATED = 'draft-queue-action-updated';
|
|
61348
|
+
const DRAFT_QUEUE_ACTION_FAILED = 'draft-queue-action-failed';
|
|
61316
61349
|
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
61317
|
-
|
|
61350
|
+
/** Content Document */
|
|
61351
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS = 'content-document-version-total-synthesize-calls';
|
|
61352
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR = 'create-content-document-version-draft-synthesize-error';
|
|
61353
|
+
/** Priming */
|
|
61354
|
+
const PRIMING_TOTAL_SESSION_COUNT = 'priming-total-session-count';
|
|
61355
|
+
const PRIMING_TOTAL_ERROR_COUNT = 'priming-total-error-count';
|
|
61356
|
+
const PRIMING_TOTAL_PRIMED_COUNT = 'priming-total-primed-count';
|
|
61357
|
+
const PRIMING_TOTAL_CONFLICT_COUNT = 'priming-total-conflict-count';
|
|
61358
|
+
// logs
|
|
61359
|
+
const GRAPHQL_QUERY_PARSE_ERROR = 'gql-query-parse-error';
|
|
61360
|
+
const GRAPHQL_SQL_EVAL_PRECONDITION_ERROR = 'gql-sql-pre-eval-error';
|
|
61361
|
+
const GRAPHQL_CREATE_SNAPSHOT_ERROR = 'gql-create-snapshot-error';
|
|
61362
|
+
const DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR = 'draft-aware-create-content-document-and-version-error';
|
|
61363
|
+
const ldsMobileInstrumentation$2 = getInstrumentation();
|
|
61318
61364
|
function reportGraphqlQueryParseError(err) {
|
|
61319
|
-
normalizeError$2(err);
|
|
61365
|
+
const error = normalizeError$2(err);
|
|
61366
|
+
const errorCode = GRAPHQL_QUERY_PARSE_ERROR;
|
|
61367
|
+
// Metric
|
|
61368
|
+
reportGraphqlAdapterError(errorCode);
|
|
61369
|
+
// Log
|
|
61370
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61320
61371
|
}
|
|
61321
61372
|
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
61322
|
-
normalizeError$2(err);
|
|
61373
|
+
const error = normalizeError$2(err);
|
|
61374
|
+
const errorCode = GRAPHQL_SQL_EVAL_PRECONDITION_ERROR;
|
|
61375
|
+
// Metric
|
|
61376
|
+
reportGraphqlAdapterError(errorCode);
|
|
61377
|
+
// Log
|
|
61378
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61323
61379
|
}
|
|
61324
61380
|
function reportGraphqlCreateSnapshotError(err) {
|
|
61325
|
-
normalizeError$2(err);
|
|
61381
|
+
const error = normalizeError$2(err);
|
|
61382
|
+
const errorCode = GRAPHQL_CREATE_SNAPSHOT_ERROR;
|
|
61383
|
+
// Metric
|
|
61384
|
+
reportGraphqlAdapterError(errorCode);
|
|
61385
|
+
// Log
|
|
61386
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61326
61387
|
}
|
|
61327
61388
|
function reportGraphQlEvalDbReadDuration(duration) {
|
|
61389
|
+
ldsMobileInstrumentation$2.trackValue(GRAPHQL_EVAL_DB_READ_DURATION, duration);
|
|
61390
|
+
}
|
|
61391
|
+
function reportGraphqlAdapterError(errorCode) {
|
|
61392
|
+
// Increment overall count with errorCode as tag
|
|
61393
|
+
ldsMobileInstrumentation$2.incrementCounter(GRAPHQL_EVAL_ERROR, 1, true, { errorCode });
|
|
61328
61394
|
}
|
|
61329
61395
|
function reportGraphqlQueryInstrumentation(data) {
|
|
61330
61396
|
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
61331
61397
|
const recordBuckets = [
|
|
61332
61398
|
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
61333
61399
|
];
|
|
61334
|
-
ldsMobileInstrumentation$
|
|
61335
|
-
ldsMobileInstrumentation$
|
|
61336
|
-
ldsMobileInstrumentation$
|
|
61337
|
-
ldsMobileInstrumentation$
|
|
61400
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_ROOT_QUERY_COUNT, data.rootQueryCount, queryBuckets);
|
|
61401
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_TOTAL_QUERY_COUNT, data.totalQueryCount, queryBuckets);
|
|
61402
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT, data.maxChildRelationships, queryBuckets);
|
|
61403
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_QUERY_RECORD_COUNT, data.requestedRecordCount, recordBuckets);
|
|
61404
|
+
}
|
|
61405
|
+
function reportDraftActionEvent(state) {
|
|
61406
|
+
switch (state) {
|
|
61407
|
+
case 'added':
|
|
61408
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_ADDED);
|
|
61409
|
+
break;
|
|
61410
|
+
case 'uploading':
|
|
61411
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPLOADING);
|
|
61412
|
+
break;
|
|
61413
|
+
case 'completed':
|
|
61414
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_COMPLETED);
|
|
61415
|
+
break;
|
|
61416
|
+
case 'deleted':
|
|
61417
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_DELETED);
|
|
61418
|
+
break;
|
|
61419
|
+
case 'failed':
|
|
61420
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_FAILED, 1, true);
|
|
61421
|
+
break;
|
|
61422
|
+
case 'updated':
|
|
61423
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPDATED);
|
|
61424
|
+
break;
|
|
61425
|
+
}
|
|
61426
|
+
}
|
|
61427
|
+
function reportDraftQueueState(state) {
|
|
61428
|
+
switch (state) {
|
|
61429
|
+
case 'started':
|
|
61430
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STARTED);
|
|
61431
|
+
break;
|
|
61432
|
+
case 'error':
|
|
61433
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_ERROR, 1, true);
|
|
61434
|
+
break;
|
|
61435
|
+
case 'waiting':
|
|
61436
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_WAITING);
|
|
61437
|
+
break;
|
|
61438
|
+
case 'stopped':
|
|
61439
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STOPPED);
|
|
61440
|
+
break;
|
|
61441
|
+
}
|
|
61338
61442
|
}
|
|
61339
61443
|
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
61340
61444
|
let error;
|
|
@@ -61344,16 +61448,43 @@ function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
|
61344
61448
|
else {
|
|
61345
61449
|
error = normalizeError$2(err);
|
|
61346
61450
|
}
|
|
61347
|
-
|
|
61451
|
+
const errorCode = DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR;
|
|
61452
|
+
const errorType = error.errorType;
|
|
61453
|
+
const tags = {
|
|
61454
|
+
errorCode,
|
|
61455
|
+
};
|
|
61456
|
+
if (errorType !== undefined) {
|
|
61457
|
+
tags.errorType = errorType;
|
|
61458
|
+
}
|
|
61459
|
+
// Metric
|
|
61460
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR, 1, true, tags);
|
|
61461
|
+
// Log
|
|
61462
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61348
61463
|
}
|
|
61349
61464
|
function reportDraftAwareContentVersionSynthesizeCalls(mimeType) {
|
|
61465
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS, 1, undefined, { mimeType });
|
|
61466
|
+
}
|
|
61467
|
+
/** Priming */
|
|
61468
|
+
function reportPrimingSessionCreated() {
|
|
61469
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_SESSION_COUNT, 1, undefined, {});
|
|
61350
61470
|
}
|
|
61351
61471
|
function reportPrimingError(errorType, recordCount) {
|
|
61472
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_ERROR_COUNT, recordCount, undefined, {
|
|
61473
|
+
errorType,
|
|
61474
|
+
});
|
|
61475
|
+
}
|
|
61476
|
+
function reportPrimingSuccess(recordCount) {
|
|
61477
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_PRIMED_COUNT, recordCount, undefined);
|
|
61352
61478
|
}
|
|
61353
61479
|
function reportPrimingConflict(resolutionType, recordCount) {
|
|
61480
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_CONFLICT_COUNT, recordCount, undefined, {
|
|
61481
|
+
resolutionType,
|
|
61482
|
+
});
|
|
61354
61483
|
}
|
|
61355
61484
|
/** Network */
|
|
61356
61485
|
function reportChunkCandidateUrlLength(urlLength) {
|
|
61486
|
+
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
61487
|
+
ldsMobileInstrumentation$2.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
61357
61488
|
}
|
|
61358
61489
|
|
|
61359
61490
|
/**
|
|
@@ -61367,13 +61498,19 @@ const withInstrumentation = (operation, config) => {
|
|
|
61367
61498
|
return operation();
|
|
61368
61499
|
}
|
|
61369
61500
|
const { tags, metricName, logError } = config;
|
|
61501
|
+
let hasError = false;
|
|
61370
61502
|
return operation()
|
|
61371
61503
|
.catch((err) => {
|
|
61504
|
+
hasError = true;
|
|
61372
61505
|
const error = normalizeError$2(err);
|
|
61373
61506
|
tags['errorMessage'] = error.message;
|
|
61507
|
+
if (logError) {
|
|
61508
|
+
ldsMobileInstrumentation$2.error(error);
|
|
61509
|
+
}
|
|
61374
61510
|
throw err;
|
|
61375
61511
|
})
|
|
61376
61512
|
.finally(() => {
|
|
61513
|
+
ldsMobileInstrumentation$2.incrementCounter(metricName, 1, hasError, tags);
|
|
61377
61514
|
});
|
|
61378
61515
|
};
|
|
61379
61516
|
|
|
@@ -61386,26 +61523,36 @@ function instrumentDraftQueue(queue) {
|
|
|
61386
61523
|
case DraftQueueEventType.QueueStateChanged:
|
|
61387
61524
|
switch (draftQueueEvent.state) {
|
|
61388
61525
|
case DraftQueueState.Error:
|
|
61526
|
+
reportDraftQueueState('error');
|
|
61389
61527
|
break;
|
|
61390
61528
|
case DraftQueueState.Started:
|
|
61529
|
+
reportDraftQueueState('started');
|
|
61391
61530
|
break;
|
|
61392
61531
|
case DraftQueueState.Stopped:
|
|
61532
|
+
reportDraftQueueState('stopped');
|
|
61393
61533
|
break;
|
|
61394
61534
|
case DraftQueueState.Waiting:
|
|
61535
|
+
reportDraftQueueState('waiting');
|
|
61395
61536
|
break;
|
|
61396
61537
|
}
|
|
61397
61538
|
break;
|
|
61398
61539
|
case DraftQueueEventType.ActionAdded:
|
|
61540
|
+
reportDraftActionEvent('added');
|
|
61399
61541
|
break;
|
|
61400
61542
|
case DraftQueueEventType.ActionUploading:
|
|
61543
|
+
reportDraftActionEvent('uploading');
|
|
61401
61544
|
break;
|
|
61402
61545
|
case DraftQueueEventType.ActionCompleted:
|
|
61546
|
+
reportDraftActionEvent('completed');
|
|
61403
61547
|
break;
|
|
61404
61548
|
case DraftQueueEventType.ActionDeleted:
|
|
61549
|
+
reportDraftActionEvent('deleted');
|
|
61405
61550
|
break;
|
|
61406
61551
|
case DraftQueueEventType.ActionFailed:
|
|
61552
|
+
reportDraftActionEvent('failed');
|
|
61407
61553
|
break;
|
|
61408
61554
|
case DraftQueueEventType.ActionUpdated:
|
|
61555
|
+
reportDraftActionEvent('updated');
|
|
61409
61556
|
break;
|
|
61410
61557
|
}
|
|
61411
61558
|
return Promise.resolve();
|
|
@@ -63230,10 +63377,12 @@ class RecordIngestor {
|
|
|
63230
63377
|
}
|
|
63231
63378
|
|
|
63232
63379
|
function instrumentPrimingSession(session) {
|
|
63380
|
+
reportPrimingSessionCreated();
|
|
63233
63381
|
session.on('error', ({ code, ids }) => {
|
|
63234
63382
|
reportPrimingError(code, ids.length);
|
|
63235
63383
|
});
|
|
63236
63384
|
session.on('primed', ({ length }) => {
|
|
63385
|
+
reportPrimingSuccess(length);
|
|
63237
63386
|
});
|
|
63238
63387
|
session.on('conflict', ({ ids, resolution }) => {
|
|
63239
63388
|
reportPrimingConflict(resolution, ids.length);
|
|
@@ -63926,7 +64075,7 @@ register$1({
|
|
|
63926
64075
|
id: '@salesforce/lds-network-adapter',
|
|
63927
64076
|
instrument: instrument$2,
|
|
63928
64077
|
});
|
|
63929
|
-
// version: 1.
|
|
64078
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
63930
64079
|
|
|
63931
64080
|
const { create: create$3, keys: keys$3 } = Object;
|
|
63932
64081
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -83962,7 +84111,7 @@ register$1({
|
|
|
83962
84111
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
83963
84112
|
instrument: instrument$1,
|
|
83964
84113
|
});
|
|
83965
|
-
// version: 1.
|
|
84114
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
83966
84115
|
|
|
83967
84116
|
// On core the unstable adapters are re-exported with different names,
|
|
83968
84117
|
// we want to match them here.
|
|
@@ -86218,7 +86367,7 @@ withDefaultLuvio((luvio) => {
|
|
|
86218
86367
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
86219
86368
|
graphQLImperative = ldsAdapter;
|
|
86220
86369
|
});
|
|
86221
|
-
// version: 1.
|
|
86370
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
86222
86371
|
|
|
86223
86372
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
86224
86373
|
__proto__: null,
|
|
@@ -86341,6 +86490,7 @@ function normalizeError(error) {
|
|
|
86341
86490
|
return new Error(stringify$1(error));
|
|
86342
86491
|
}
|
|
86343
86492
|
|
|
86493
|
+
const ldsMobileInstrumentation$1 = getInstrumentation();
|
|
86344
86494
|
/**
|
|
86345
86495
|
* Coerces a cache policy passed in from native to a luvio cache policy
|
|
86346
86496
|
* @param nativeCachePolicy The cache policy passed in from native
|
|
@@ -86622,9 +86772,14 @@ function invokeAdapterWithMetadata(adapterId, config, metadata, onResponse, nati
|
|
|
86622
86772
|
draftIds.length > 0) {
|
|
86623
86773
|
const draftId = draftIds[draftIds.length - 1];
|
|
86624
86774
|
const managerState = await draftManager.getQueue();
|
|
86625
|
-
const
|
|
86775
|
+
const draftItem = managerState.items.find((x) => x.id === draftId);
|
|
86776
|
+
if (draftItem === undefined) {
|
|
86777
|
+
// draftItem no longer exists, might have already been uploaded
|
|
86778
|
+
ldsMobileInstrumentation$1.log('tried to set metadata on draft item that no longer exists');
|
|
86779
|
+
return onResponse(responseValue);
|
|
86780
|
+
}
|
|
86626
86781
|
draftManager
|
|
86627
|
-
.setMetadata(draftId, { ...
|
|
86782
|
+
.setMetadata(draftId, { ...draftItem.metadata, ...metadata })
|
|
86628
86783
|
.then(() => {
|
|
86629
86784
|
onResponse(responseValue);
|
|
86630
86785
|
})
|
|
@@ -86953,7 +87108,7 @@ const callbacks$1 = [];
|
|
|
86953
87108
|
function register(r) {
|
|
86954
87109
|
callbacks$1.forEach((callback) => callback(r));
|
|
86955
87110
|
}
|
|
86956
|
-
// version: 1.
|
|
87111
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
86957
87112
|
|
|
86958
87113
|
/**
|
|
86959
87114
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -91915,4 +92070,4 @@ const { luvio } = getRuntime();
|
|
|
91915
92070
|
setDefaultLuvio({ luvio });
|
|
91916
92071
|
|
|
91917
92072
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
91918
|
-
// version: 1.
|
|
92073
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
@@ -2,6 +2,7 @@ import type { AdapterRequestContext, CachePolicy, LuvioAdapterEventObserver } fr
|
|
|
2
2
|
import type { DraftQueueItemMetadata } from '@salesforce/lds-drafts';
|
|
3
3
|
import type { NativeErrorResponse } from './responses';
|
|
4
4
|
import type { ObservabilityContext } from '@salesforce/lds-runtime-mobile';
|
|
5
|
+
export declare const ldsMobileInstrumentation: import("o11y/dist/modules/o11y/client/interfaces").Instrumentation;
|
|
5
6
|
export type NativeCallbackValue = NativeCallbackData | NativeCallbackError | NativeCallbackErrors;
|
|
6
7
|
export type NativeCallbackData = {
|
|
7
8
|
data: any | undefined;
|
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
expirePossibleStaleRecords(keys) {
|
|
940
|
-
const expirationTimestamp = Date.now();
|
|
940
|
+
const expirationTimestamp = Date.now() - 1;
|
|
941
941
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
942
942
|
const key = keys[i];
|
|
943
943
|
const metadata = this.readMetadata(key);
|
|
@@ -4143,7 +4143,7 @@
|
|
|
4143
4143
|
}
|
|
4144
4144
|
return resourceParams;
|
|
4145
4145
|
}
|
|
4146
|
-
// engine version: 0.156.
|
|
4146
|
+
// engine version: 0.156.4-dev1-8df86bf0
|
|
4147
4147
|
|
|
4148
4148
|
/**
|
|
4149
4149
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -4271,7 +4271,7 @@
|
|
|
4271
4271
|
}
|
|
4272
4272
|
callbacks.push(callback);
|
|
4273
4273
|
}
|
|
4274
|
-
// version: 1.
|
|
4274
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
4275
4275
|
|
|
4276
4276
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4277
4277
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15770,7 +15770,7 @@
|
|
|
15770
15770
|
}
|
|
15771
15771
|
return superResult;
|
|
15772
15772
|
}
|
|
15773
|
-
// version: 1.
|
|
15773
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
15774
15774
|
|
|
15775
15775
|
function unwrap(data) {
|
|
15776
15776
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16179,6 +16179,18 @@
|
|
|
16179
16179
|
},
|
|
16180
16180
|
};
|
|
16181
16181
|
}
|
|
16182
|
+
subscribe(snapshot) {
|
|
16183
|
+
var _a;
|
|
16184
|
+
super.subscribe(snapshot);
|
|
16185
|
+
// if the snapshot is refreshed we should stop using data from before the refresh
|
|
16186
|
+
if (this.connected && ((_a = snapshot.refresh) === null || _a === void 0 ? void 0 : _a.resolve)) {
|
|
16187
|
+
const originalResolve = snapshot.refresh.resolve;
|
|
16188
|
+
snapshot.refresh.resolve = (config) => {
|
|
16189
|
+
this.connectTimestamp = Date.now();
|
|
16190
|
+
return originalResolve(config);
|
|
16191
|
+
};
|
|
16192
|
+
}
|
|
16193
|
+
}
|
|
16182
16194
|
}
|
|
16183
16195
|
function createInfiniteScrollingWireAdapterConstructor$1(adapter, name, luvio) {
|
|
16184
16196
|
const constructor = function (callback, sourceContext) {
|
|
@@ -16699,7 +16711,7 @@
|
|
|
16699
16711
|
const { apiFamily, name } = metadata;
|
|
16700
16712
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16701
16713
|
}
|
|
16702
|
-
// version: 1.
|
|
16714
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
16703
16715
|
|
|
16704
16716
|
/**
|
|
16705
16717
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16798,7 +16810,7 @@
|
|
|
16798
16810
|
TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
|
|
16799
16811
|
TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
|
|
16800
16812
|
})(TypeCheckShapes || (TypeCheckShapes = {}));
|
|
16801
|
-
// engine version: 0.156.
|
|
16813
|
+
// engine version: 0.156.4-dev1-8df86bf0
|
|
16802
16814
|
|
|
16803
16815
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16804
16816
|
|
|
@@ -40972,7 +40984,7 @@
|
|
|
40972
40984
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
40973
40985
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
40974
40986
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
40975
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
40987
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
40976
40988
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
40977
40989
|
];
|
|
40978
40990
|
const performUpdateRecordQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$8, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
@@ -41018,7 +41030,8 @@
|
|
|
41018
41030
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41019
41031
|
return null;
|
|
41020
41032
|
}
|
|
41021
|
-
const
|
|
41033
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
41034
|
+
const config = typeCheckConfig$d(coercedConfig);
|
|
41022
41035
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41023
41036
|
return null;
|
|
41024
41037
|
}
|
|
@@ -41092,7 +41105,7 @@
|
|
|
41092
41105
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
41093
41106
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
41094
41107
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
41095
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
41108
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
41096
41109
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
41097
41110
|
];
|
|
41098
41111
|
const performQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$7, performQuickAction_ConfigPropertyMetadata);
|
|
@@ -41138,7 +41151,8 @@
|
|
|
41138
41151
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41139
41152
|
return null;
|
|
41140
41153
|
}
|
|
41141
|
-
const
|
|
41154
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performQuickAction_ConfigPropertyMetadata);
|
|
41155
|
+
const config = typeCheckConfig$c(coercedConfig);
|
|
41142
41156
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41143
41157
|
return null;
|
|
41144
41158
|
}
|
|
@@ -44804,7 +44818,7 @@
|
|
|
44804
44818
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44805
44819
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44806
44820
|
});
|
|
44807
|
-
// version: 1.
|
|
44821
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
44808
44822
|
|
|
44809
44823
|
var ldsIdempotencyWriteDisabled = {
|
|
44810
44824
|
isOpen: function (e) {
|
|
@@ -50190,7 +50204,8 @@
|
|
|
50190
50204
|
resourceRequestCopy.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
50191
50205
|
}
|
|
50192
50206
|
// enable return extra fields for record creation and record update http call
|
|
50193
|
-
if (resourceRequest.basePath === '
|
|
50207
|
+
if (typeof resourceRequest.basePath === 'string' &&
|
|
50208
|
+
resourceRequest.basePath.startsWith('/ui-api/records') &&
|
|
50194
50209
|
(resourceRequest.method === 'post' || resourceRequest.method === 'patch')) {
|
|
50195
50210
|
resourceRequestCopy.queryParams = resourceRequestCopy.queryParams || {};
|
|
50196
50211
|
resourceRequestCopy.queryParams['includeFieldsInBody'] = true;
|
|
@@ -51999,10 +52014,49 @@
|
|
|
51999
52014
|
const { shift } = Array.prototype;
|
|
52000
52015
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
52001
52016
|
|
|
52017
|
+
/**
|
|
52018
|
+
* Retrieves a denormalized record from the store
|
|
52019
|
+
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52020
|
+
* @param recordKey record key
|
|
52021
|
+
* @param durableStore the durable store
|
|
52022
|
+
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52023
|
+
*/
|
|
52024
|
+
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52025
|
+
return durableStore
|
|
52026
|
+
.getEntries([recordKey], DefaultDurableSegment)
|
|
52027
|
+
.then((entries) => {
|
|
52028
|
+
if (entries === undefined) {
|
|
52029
|
+
return undefined;
|
|
52030
|
+
}
|
|
52031
|
+
const denormalizedEntry = entries[recordKey];
|
|
52032
|
+
if (denormalizedEntry === undefined) {
|
|
52033
|
+
return undefined;
|
|
52034
|
+
}
|
|
52035
|
+
// don't include link information
|
|
52036
|
+
const denormalizedRecord = denormalizedEntry.data;
|
|
52037
|
+
if (isStoreRecordError(denormalizedRecord)) {
|
|
52038
|
+
return undefined;
|
|
52039
|
+
}
|
|
52040
|
+
return denormalizedRecord;
|
|
52041
|
+
});
|
|
52042
|
+
}
|
|
52043
|
+
function isStoreRecordError(storeRecord) {
|
|
52044
|
+
return storeRecord.__type === 'error';
|
|
52045
|
+
}
|
|
52046
|
+
function isDraftFieldPending(field) {
|
|
52047
|
+
return !!(field.__state && field.__state.pending === true);
|
|
52048
|
+
}
|
|
52049
|
+
function isDraftFieldMissing(field) {
|
|
52050
|
+
return !!(field.__state && field.__state.isMissing === true);
|
|
52051
|
+
}
|
|
52052
|
+
|
|
52002
52053
|
function isFieldLink(field) {
|
|
52003
52054
|
const { value } = field;
|
|
52004
52055
|
return value !== null && typeof value === 'object' && value.__ref !== undefined;
|
|
52005
52056
|
}
|
|
52057
|
+
function isPendingOrMissing(field) {
|
|
52058
|
+
return isDraftFieldMissing(field) || isDraftFieldPending(field);
|
|
52059
|
+
}
|
|
52006
52060
|
|
|
52007
52061
|
const RECORD_ENDPOINT_REGEX$1 = /^\/ui-api\/records\/?(([a-zA-Z0-9]+))?$/;
|
|
52008
52062
|
/**
|
|
@@ -52059,12 +52113,12 @@
|
|
|
52059
52113
|
* @param record draft record representation
|
|
52060
52114
|
* @returns flattened record representation
|
|
52061
52115
|
*/
|
|
52062
|
-
function
|
|
52116
|
+
function filterOutReferenceNonScalarFields(record) {
|
|
52063
52117
|
const filteredFields = {};
|
|
52064
52118
|
const fieldNames = keys$5(record.fields);
|
|
52065
52119
|
for (const fieldName of fieldNames) {
|
|
52066
52120
|
const field = record.fields[fieldName];
|
|
52067
|
-
if (isFieldLink(field) === false) {
|
|
52121
|
+
if (isFieldLink(field) === false && isPendingOrMissing(field) === false) {
|
|
52068
52122
|
filteredFields[fieldName] = field;
|
|
52069
52123
|
}
|
|
52070
52124
|
}
|
|
@@ -52078,42 +52132,6 @@
|
|
|
52078
52132
|
return filteredRecords;
|
|
52079
52133
|
}
|
|
52080
52134
|
|
|
52081
|
-
/**
|
|
52082
|
-
* Retrieves a denormalized record from the store
|
|
52083
|
-
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52084
|
-
* @param recordKey record key
|
|
52085
|
-
* @param durableStore the durable store
|
|
52086
|
-
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52087
|
-
*/
|
|
52088
|
-
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52089
|
-
return durableStore
|
|
52090
|
-
.getEntries([recordKey], DefaultDurableSegment)
|
|
52091
|
-
.then((entries) => {
|
|
52092
|
-
if (entries === undefined) {
|
|
52093
|
-
return undefined;
|
|
52094
|
-
}
|
|
52095
|
-
const denormalizedEntry = entries[recordKey];
|
|
52096
|
-
if (denormalizedEntry === undefined) {
|
|
52097
|
-
return undefined;
|
|
52098
|
-
}
|
|
52099
|
-
// don't include link information
|
|
52100
|
-
const denormalizedRecord = denormalizedEntry.data;
|
|
52101
|
-
if (isStoreRecordError(denormalizedRecord)) {
|
|
52102
|
-
return undefined;
|
|
52103
|
-
}
|
|
52104
|
-
return denormalizedRecord;
|
|
52105
|
-
});
|
|
52106
|
-
}
|
|
52107
|
-
function isStoreRecordError(storeRecord) {
|
|
52108
|
-
return storeRecord.__type === 'error';
|
|
52109
|
-
}
|
|
52110
|
-
function isDraftFieldPending(field) {
|
|
52111
|
-
return !!(field.__state && field.__state.pending === true);
|
|
52112
|
-
}
|
|
52113
|
-
function isDraftFieldMissing(field) {
|
|
52114
|
-
return !!(field.__state && field.__state.isMissing === true);
|
|
52115
|
-
}
|
|
52116
|
-
|
|
52117
52135
|
/**
|
|
52118
52136
|
* Checks if a resource request is a GET method on the record endpoint
|
|
52119
52137
|
* @param request the resource request
|
|
@@ -53151,7 +53169,7 @@
|
|
|
53151
53169
|
if (recordWithDrafts === undefined) {
|
|
53152
53170
|
return undefined;
|
|
53153
53171
|
}
|
|
53154
|
-
return
|
|
53172
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53155
53173
|
}
|
|
53156
53174
|
const record = await getDenormalizedRecord(key, this.durableStore);
|
|
53157
53175
|
if (record === undefined) {
|
|
@@ -53162,7 +53180,7 @@
|
|
|
53162
53180
|
if (recordWithDrafts === undefined) {
|
|
53163
53181
|
return recordWithDrafts;
|
|
53164
53182
|
}
|
|
53165
|
-
return
|
|
53183
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53166
53184
|
}
|
|
53167
53185
|
applyDraftsToIncomingData(key, data, draftMetadata, publishData) {
|
|
53168
53186
|
if (draftMetadata === undefined) {
|
|
@@ -54058,9 +54076,9 @@
|
|
|
54058
54076
|
return undefined;
|
|
54059
54077
|
}
|
|
54060
54078
|
// finally we resolve all references for each record
|
|
54061
|
-
const contentDocResolved = await
|
|
54062
|
-
const contentDocLinkResolved = await
|
|
54063
|
-
const contentVersionResolved = await
|
|
54079
|
+
const contentDocResolved = await filterOutReferenceNonScalarFields(contentDocRecord);
|
|
54080
|
+
const contentDocLinkResolved = await filterOutReferenceNonScalarFields(contentDocLink);
|
|
54081
|
+
const contentVersionResolved = await filterOutReferenceNonScalarFields(contentVersion);
|
|
54064
54082
|
return {
|
|
54065
54083
|
contentDocument: contentDocResolved,
|
|
54066
54084
|
contentDocumentLinks: [contentDocLinkResolved],
|
|
@@ -57132,14 +57150,14 @@
|
|
|
57132
57150
|
limit = args.first;
|
|
57133
57151
|
}
|
|
57134
57152
|
let offset = 0;
|
|
57135
|
-
|
|
57136
|
-
|
|
57137
|
-
if (!originalCursor) {
|
|
57138
|
-
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
57139
|
-
throw new Error('Internal Error: unable to determine `after` cursor value');
|
|
57140
|
-
}
|
|
57153
|
+
let originalCursor = context.mappedCursors.get(queryCacheKey);
|
|
57154
|
+
if (originalCursor) {
|
|
57141
57155
|
offset = decodeV1Cursor(originalCursor).i;
|
|
57142
57156
|
}
|
|
57157
|
+
else if (args.after) {
|
|
57158
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
57159
|
+
throw new Error('Internal Error: unable to determine `after` cursor value');
|
|
57160
|
+
}
|
|
57143
57161
|
// if the query wants to know `hasNextPage` then we need to request 1 additional record
|
|
57144
57162
|
let selections = info.fieldNodes
|
|
57145
57163
|
.map((n) => (n.selectionSet ? n.selectionSet.selections : []))
|
|
@@ -61315,32 +61333,118 @@
|
|
|
61315
61333
|
}
|
|
61316
61334
|
return new Error(stringify$1$1(err));
|
|
61317
61335
|
}
|
|
61336
|
+
// metrics
|
|
61337
|
+
/** GraphQL */
|
|
61338
|
+
const GRAPHQL_EVAL_ERROR = 'gql-eval-error';
|
|
61339
|
+
const GRAPHQL_EVAL_DB_READ_DURATION = 'gql-eval-db-read-duration';
|
|
61318
61340
|
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
61319
61341
|
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
61320
61342
|
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
61321
61343
|
const GRAPHQL_EVAL_QUERY_RECORD_COUNT = 'gql-eval-query-record-count';
|
|
61344
|
+
/** Draft Queue */
|
|
61345
|
+
const DRAFT_QUEUE_STATE_STARTED = 'draft-queue-state-started';
|
|
61346
|
+
const DRAFT_QUEUE_STATE_ERROR = 'draft-queue-state-error';
|
|
61347
|
+
const DRAFT_QUEUE_STATE_WAITING = 'draft-queue-state-waiting';
|
|
61348
|
+
const DRAFT_QUEUE_STATE_STOPPED = 'draft-queue-state-stopped';
|
|
61349
|
+
const DRAFT_QUEUE_ACTION_ADDED = 'draft-queue-action-added';
|
|
61350
|
+
const DRAFT_QUEUE_ACTION_UPLOADING = 'draft-queue-action-uploading';
|
|
61351
|
+
const DRAFT_QUEUE_ACTION_COMPLETED = 'draft-queue-action-completed';
|
|
61352
|
+
const DRAFT_QUEUE_ACTION_DELETED = 'draft-queue-action-deleted';
|
|
61353
|
+
const DRAFT_QUEUE_ACTION_UPDATED = 'draft-queue-action-updated';
|
|
61354
|
+
const DRAFT_QUEUE_ACTION_FAILED = 'draft-queue-action-failed';
|
|
61322
61355
|
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
61323
|
-
|
|
61356
|
+
/** Content Document */
|
|
61357
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS = 'content-document-version-total-synthesize-calls';
|
|
61358
|
+
const CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR = 'create-content-document-version-draft-synthesize-error';
|
|
61359
|
+
/** Priming */
|
|
61360
|
+
const PRIMING_TOTAL_SESSION_COUNT = 'priming-total-session-count';
|
|
61361
|
+
const PRIMING_TOTAL_ERROR_COUNT = 'priming-total-error-count';
|
|
61362
|
+
const PRIMING_TOTAL_PRIMED_COUNT = 'priming-total-primed-count';
|
|
61363
|
+
const PRIMING_TOTAL_CONFLICT_COUNT = 'priming-total-conflict-count';
|
|
61364
|
+
// logs
|
|
61365
|
+
const GRAPHQL_QUERY_PARSE_ERROR = 'gql-query-parse-error';
|
|
61366
|
+
const GRAPHQL_SQL_EVAL_PRECONDITION_ERROR = 'gql-sql-pre-eval-error';
|
|
61367
|
+
const GRAPHQL_CREATE_SNAPSHOT_ERROR = 'gql-create-snapshot-error';
|
|
61368
|
+
const DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR = 'draft-aware-create-content-document-and-version-error';
|
|
61369
|
+
const ldsMobileInstrumentation$2 = getInstrumentation();
|
|
61324
61370
|
function reportGraphqlQueryParseError(err) {
|
|
61325
|
-
normalizeError$2(err);
|
|
61371
|
+
const error = normalizeError$2(err);
|
|
61372
|
+
const errorCode = GRAPHQL_QUERY_PARSE_ERROR;
|
|
61373
|
+
// Metric
|
|
61374
|
+
reportGraphqlAdapterError(errorCode);
|
|
61375
|
+
// Log
|
|
61376
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61326
61377
|
}
|
|
61327
61378
|
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
61328
|
-
normalizeError$2(err);
|
|
61379
|
+
const error = normalizeError$2(err);
|
|
61380
|
+
const errorCode = GRAPHQL_SQL_EVAL_PRECONDITION_ERROR;
|
|
61381
|
+
// Metric
|
|
61382
|
+
reportGraphqlAdapterError(errorCode);
|
|
61383
|
+
// Log
|
|
61384
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61329
61385
|
}
|
|
61330
61386
|
function reportGraphqlCreateSnapshotError(err) {
|
|
61331
|
-
normalizeError$2(err);
|
|
61387
|
+
const error = normalizeError$2(err);
|
|
61388
|
+
const errorCode = GRAPHQL_CREATE_SNAPSHOT_ERROR;
|
|
61389
|
+
// Metric
|
|
61390
|
+
reportGraphqlAdapterError(errorCode);
|
|
61391
|
+
// Log
|
|
61392
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61332
61393
|
}
|
|
61333
61394
|
function reportGraphQlEvalDbReadDuration(duration) {
|
|
61395
|
+
ldsMobileInstrumentation$2.trackValue(GRAPHQL_EVAL_DB_READ_DURATION, duration);
|
|
61396
|
+
}
|
|
61397
|
+
function reportGraphqlAdapterError(errorCode) {
|
|
61398
|
+
// Increment overall count with errorCode as tag
|
|
61399
|
+
ldsMobileInstrumentation$2.incrementCounter(GRAPHQL_EVAL_ERROR, 1, true, { errorCode });
|
|
61334
61400
|
}
|
|
61335
61401
|
function reportGraphqlQueryInstrumentation(data) {
|
|
61336
61402
|
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
61337
61403
|
const recordBuckets = [
|
|
61338
61404
|
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
61339
61405
|
];
|
|
61340
|
-
ldsMobileInstrumentation$
|
|
61341
|
-
ldsMobileInstrumentation$
|
|
61342
|
-
ldsMobileInstrumentation$
|
|
61343
|
-
ldsMobileInstrumentation$
|
|
61406
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_ROOT_QUERY_COUNT, data.rootQueryCount, queryBuckets);
|
|
61407
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_TOTAL_QUERY_COUNT, data.totalQueryCount, queryBuckets);
|
|
61408
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT, data.maxChildRelationships, queryBuckets);
|
|
61409
|
+
ldsMobileInstrumentation$2.bucketValue(GRAPHQL_EVAL_QUERY_RECORD_COUNT, data.requestedRecordCount, recordBuckets);
|
|
61410
|
+
}
|
|
61411
|
+
function reportDraftActionEvent(state) {
|
|
61412
|
+
switch (state) {
|
|
61413
|
+
case 'added':
|
|
61414
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_ADDED);
|
|
61415
|
+
break;
|
|
61416
|
+
case 'uploading':
|
|
61417
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPLOADING);
|
|
61418
|
+
break;
|
|
61419
|
+
case 'completed':
|
|
61420
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_COMPLETED);
|
|
61421
|
+
break;
|
|
61422
|
+
case 'deleted':
|
|
61423
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_DELETED);
|
|
61424
|
+
break;
|
|
61425
|
+
case 'failed':
|
|
61426
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_FAILED, 1, true);
|
|
61427
|
+
break;
|
|
61428
|
+
case 'updated':
|
|
61429
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_ACTION_UPDATED);
|
|
61430
|
+
break;
|
|
61431
|
+
}
|
|
61432
|
+
}
|
|
61433
|
+
function reportDraftQueueState(state) {
|
|
61434
|
+
switch (state) {
|
|
61435
|
+
case 'started':
|
|
61436
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STARTED);
|
|
61437
|
+
break;
|
|
61438
|
+
case 'error':
|
|
61439
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_ERROR, 1, true);
|
|
61440
|
+
break;
|
|
61441
|
+
case 'waiting':
|
|
61442
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_WAITING);
|
|
61443
|
+
break;
|
|
61444
|
+
case 'stopped':
|
|
61445
|
+
ldsMobileInstrumentation$2.incrementCounter(DRAFT_QUEUE_STATE_STOPPED);
|
|
61446
|
+
break;
|
|
61447
|
+
}
|
|
61344
61448
|
}
|
|
61345
61449
|
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
61346
61450
|
let error;
|
|
@@ -61350,16 +61454,43 @@
|
|
|
61350
61454
|
else {
|
|
61351
61455
|
error = normalizeError$2(err);
|
|
61352
61456
|
}
|
|
61353
|
-
|
|
61457
|
+
const errorCode = DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR;
|
|
61458
|
+
const errorType = error.errorType;
|
|
61459
|
+
const tags = {
|
|
61460
|
+
errorCode,
|
|
61461
|
+
};
|
|
61462
|
+
if (errorType !== undefined) {
|
|
61463
|
+
tags.errorType = errorType;
|
|
61464
|
+
}
|
|
61465
|
+
// Metric
|
|
61466
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_DRAFT_SYNTHESIZE_ERROR, 1, true, tags);
|
|
61467
|
+
// Log
|
|
61468
|
+
ldsMobileInstrumentation$2.error(error, errorCode);
|
|
61354
61469
|
}
|
|
61355
61470
|
function reportDraftAwareContentVersionSynthesizeCalls(mimeType) {
|
|
61471
|
+
ldsMobileInstrumentation$2.incrementCounter(CREATE_CONTENT_DOCUMENT_AND_VERSION_TOTAL_SYNTHESIZE_CALLS, 1, undefined, { mimeType });
|
|
61472
|
+
}
|
|
61473
|
+
/** Priming */
|
|
61474
|
+
function reportPrimingSessionCreated() {
|
|
61475
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_SESSION_COUNT, 1, undefined, {});
|
|
61356
61476
|
}
|
|
61357
61477
|
function reportPrimingError(errorType, recordCount) {
|
|
61478
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_ERROR_COUNT, recordCount, undefined, {
|
|
61479
|
+
errorType,
|
|
61480
|
+
});
|
|
61481
|
+
}
|
|
61482
|
+
function reportPrimingSuccess(recordCount) {
|
|
61483
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_PRIMED_COUNT, recordCount, undefined);
|
|
61358
61484
|
}
|
|
61359
61485
|
function reportPrimingConflict(resolutionType, recordCount) {
|
|
61486
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_CONFLICT_COUNT, recordCount, undefined, {
|
|
61487
|
+
resolutionType,
|
|
61488
|
+
});
|
|
61360
61489
|
}
|
|
61361
61490
|
/** Network */
|
|
61362
61491
|
function reportChunkCandidateUrlLength(urlLength) {
|
|
61492
|
+
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
61493
|
+
ldsMobileInstrumentation$2.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
61363
61494
|
}
|
|
61364
61495
|
|
|
61365
61496
|
/**
|
|
@@ -61373,13 +61504,19 @@
|
|
|
61373
61504
|
return operation();
|
|
61374
61505
|
}
|
|
61375
61506
|
const { tags, metricName, logError } = config;
|
|
61507
|
+
let hasError = false;
|
|
61376
61508
|
return operation()
|
|
61377
61509
|
.catch((err) => {
|
|
61510
|
+
hasError = true;
|
|
61378
61511
|
const error = normalizeError$2(err);
|
|
61379
61512
|
tags['errorMessage'] = error.message;
|
|
61513
|
+
if (logError) {
|
|
61514
|
+
ldsMobileInstrumentation$2.error(error);
|
|
61515
|
+
}
|
|
61380
61516
|
throw err;
|
|
61381
61517
|
})
|
|
61382
61518
|
.finally(() => {
|
|
61519
|
+
ldsMobileInstrumentation$2.incrementCounter(metricName, 1, hasError, tags);
|
|
61383
61520
|
});
|
|
61384
61521
|
};
|
|
61385
61522
|
|
|
@@ -61392,26 +61529,36 @@
|
|
|
61392
61529
|
case DraftQueueEventType.QueueStateChanged:
|
|
61393
61530
|
switch (draftQueueEvent.state) {
|
|
61394
61531
|
case DraftQueueState.Error:
|
|
61532
|
+
reportDraftQueueState('error');
|
|
61395
61533
|
break;
|
|
61396
61534
|
case DraftQueueState.Started:
|
|
61535
|
+
reportDraftQueueState('started');
|
|
61397
61536
|
break;
|
|
61398
61537
|
case DraftQueueState.Stopped:
|
|
61538
|
+
reportDraftQueueState('stopped');
|
|
61399
61539
|
break;
|
|
61400
61540
|
case DraftQueueState.Waiting:
|
|
61541
|
+
reportDraftQueueState('waiting');
|
|
61401
61542
|
break;
|
|
61402
61543
|
}
|
|
61403
61544
|
break;
|
|
61404
61545
|
case DraftQueueEventType.ActionAdded:
|
|
61546
|
+
reportDraftActionEvent('added');
|
|
61405
61547
|
break;
|
|
61406
61548
|
case DraftQueueEventType.ActionUploading:
|
|
61549
|
+
reportDraftActionEvent('uploading');
|
|
61407
61550
|
break;
|
|
61408
61551
|
case DraftQueueEventType.ActionCompleted:
|
|
61552
|
+
reportDraftActionEvent('completed');
|
|
61409
61553
|
break;
|
|
61410
61554
|
case DraftQueueEventType.ActionDeleted:
|
|
61555
|
+
reportDraftActionEvent('deleted');
|
|
61411
61556
|
break;
|
|
61412
61557
|
case DraftQueueEventType.ActionFailed:
|
|
61558
|
+
reportDraftActionEvent('failed');
|
|
61413
61559
|
break;
|
|
61414
61560
|
case DraftQueueEventType.ActionUpdated:
|
|
61561
|
+
reportDraftActionEvent('updated');
|
|
61415
61562
|
break;
|
|
61416
61563
|
}
|
|
61417
61564
|
return Promise.resolve();
|
|
@@ -63236,10 +63383,12 @@
|
|
|
63236
63383
|
}
|
|
63237
63384
|
|
|
63238
63385
|
function instrumentPrimingSession(session) {
|
|
63386
|
+
reportPrimingSessionCreated();
|
|
63239
63387
|
session.on('error', ({ code, ids }) => {
|
|
63240
63388
|
reportPrimingError(code, ids.length);
|
|
63241
63389
|
});
|
|
63242
63390
|
session.on('primed', ({ length }) => {
|
|
63391
|
+
reportPrimingSuccess(length);
|
|
63243
63392
|
});
|
|
63244
63393
|
session.on('conflict', ({ ids, resolution }) => {
|
|
63245
63394
|
reportPrimingConflict(resolution, ids.length);
|
|
@@ -63932,7 +64081,7 @@
|
|
|
63932
64081
|
id: '@salesforce/lds-network-adapter',
|
|
63933
64082
|
instrument: instrument$2,
|
|
63934
64083
|
});
|
|
63935
|
-
// version: 1.
|
|
64084
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
63936
64085
|
|
|
63937
64086
|
const { create: create$3, keys: keys$3 } = Object;
|
|
63938
64087
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -83968,7 +84117,7 @@
|
|
|
83968
84117
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
83969
84118
|
instrument: instrument$1,
|
|
83970
84119
|
});
|
|
83971
|
-
// version: 1.
|
|
84120
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
83972
84121
|
|
|
83973
84122
|
// On core the unstable adapters are re-exported with different names,
|
|
83974
84123
|
// we want to match them here.
|
|
@@ -86224,7 +86373,7 @@
|
|
|
86224
86373
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
86225
86374
|
graphQLImperative = ldsAdapter;
|
|
86226
86375
|
});
|
|
86227
|
-
// version: 1.
|
|
86376
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
86228
86377
|
|
|
86229
86378
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
86230
86379
|
__proto__: null,
|
|
@@ -86347,6 +86496,7 @@
|
|
|
86347
86496
|
return new Error(stringify$1(error));
|
|
86348
86497
|
}
|
|
86349
86498
|
|
|
86499
|
+
const ldsMobileInstrumentation$1 = getInstrumentation();
|
|
86350
86500
|
/**
|
|
86351
86501
|
* Coerces a cache policy passed in from native to a luvio cache policy
|
|
86352
86502
|
* @param nativeCachePolicy The cache policy passed in from native
|
|
@@ -86628,9 +86778,14 @@
|
|
|
86628
86778
|
draftIds.length > 0) {
|
|
86629
86779
|
const draftId = draftIds[draftIds.length - 1];
|
|
86630
86780
|
const managerState = await draftManager.getQueue();
|
|
86631
|
-
const
|
|
86781
|
+
const draftItem = managerState.items.find((x) => x.id === draftId);
|
|
86782
|
+
if (draftItem === undefined) {
|
|
86783
|
+
// draftItem no longer exists, might have already been uploaded
|
|
86784
|
+
ldsMobileInstrumentation$1.log('tried to set metadata on draft item that no longer exists');
|
|
86785
|
+
return onResponse(responseValue);
|
|
86786
|
+
}
|
|
86632
86787
|
draftManager
|
|
86633
|
-
.setMetadata(draftId, { ...
|
|
86788
|
+
.setMetadata(draftId, { ...draftItem.metadata, ...metadata })
|
|
86634
86789
|
.then(() => {
|
|
86635
86790
|
onResponse(responseValue);
|
|
86636
86791
|
})
|
|
@@ -86959,7 +87114,7 @@
|
|
|
86959
87114
|
function register(r) {
|
|
86960
87115
|
callbacks$1.forEach((callback) => callback(r));
|
|
86961
87116
|
}
|
|
86962
|
-
// version: 1.
|
|
87117
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
86963
87118
|
|
|
86964
87119
|
/**
|
|
86965
87120
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -91940,4 +92095,4 @@
|
|
|
91940
92095
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
91941
92096
|
|
|
91942
92097
|
}));
|
|
91943
|
-
// version: 1.
|
|
92098
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
@@ -2,6 +2,7 @@ import type { AdapterRequestContext, CachePolicy, LuvioAdapterEventObserver } fr
|
|
|
2
2
|
import type { DraftQueueItemMetadata } from '@salesforce/lds-drafts';
|
|
3
3
|
import type { NativeErrorResponse } from './responses';
|
|
4
4
|
import type { ObservabilityContext } from '@salesforce/lds-runtime-mobile';
|
|
5
|
+
export declare const ldsMobileInstrumentation: import("o11y/dist/modules/o11y/client/interfaces").Instrumentation;
|
|
5
6
|
export type NativeCallbackValue = NativeCallbackData | NativeCallbackError | NativeCallbackErrors;
|
|
6
7
|
export type NativeCallbackData = {
|
|
7
8
|
data: any | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.309.0-dev11",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/standalone/es/lds-worker-api.js",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
|
|
38
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
39
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
40
|
-
"@salesforce/lds-default-luvio": "^1.
|
|
41
|
-
"@salesforce/lds-drafts": "^1.
|
|
42
|
-
"@salesforce/lds-graphql-parser": "^1.
|
|
43
|
-
"@salesforce/lds-luvio-engine": "^1.
|
|
44
|
-
"@salesforce/lds-priming": "^1.
|
|
45
|
-
"@salesforce/lds-runtime-mobile": "^1.
|
|
46
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
38
|
+
"@salesforce/lds-adapters-graphql": "^1.309.0-dev11",
|
|
39
|
+
"@salesforce/lds-adapters-uiapi": "^1.309.0-dev11",
|
|
40
|
+
"@salesforce/lds-default-luvio": "^1.309.0-dev11",
|
|
41
|
+
"@salesforce/lds-drafts": "^1.309.0-dev11",
|
|
42
|
+
"@salesforce/lds-graphql-parser": "^1.309.0-dev11",
|
|
43
|
+
"@salesforce/lds-luvio-engine": "^1.309.0-dev11",
|
|
44
|
+
"@salesforce/lds-priming": "^1.309.0-dev11",
|
|
45
|
+
"@salesforce/lds-runtime-mobile": "^1.309.0-dev11",
|
|
46
|
+
"@salesforce/nimbus-plugin-lds": "^1.309.0-dev11",
|
|
47
47
|
"ajv": "^8.11.0",
|
|
48
48
|
"glob": "^7.1.5",
|
|
49
49
|
"nimbus-types": "^2.0.0-alpha1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"path": "./dist/sfdc/es/ldsWorkerApi.js",
|
|
57
57
|
"maxSize": {
|
|
58
58
|
"none": "45 kB",
|
|
59
|
-
"min": "
|
|
59
|
+
"min": "19.0 kB",
|
|
60
60
|
"compressed": "8 kB"
|
|
61
61
|
}
|
|
62
62
|
}
|