@salesforce/lds-worker-api 1.309.0-dev10 → 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 +163 -26
- package/dist/standalone/es/types/executeAdapter.d.ts +1 -0
- package/dist/standalone/umd/lds-worker-api.js +163 -26
- 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.309.0-
|
|
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;
|
|
@@ -4265,7 +4265,7 @@ function withDefaultLuvio(callback) {
|
|
|
4265
4265
|
}
|
|
4266
4266
|
callbacks.push(callback);
|
|
4267
4267
|
}
|
|
4268
|
-
// version: 1.309.0-
|
|
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.309.0-
|
|
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".
|
|
@@ -16705,7 +16705,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16705
16705
|
const { apiFamily, name } = metadata;
|
|
16706
16706
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16707
16707
|
}
|
|
16708
|
-
// version: 1.309.0-
|
|
16708
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
16709
16709
|
|
|
16710
16710
|
/**
|
|
16711
16711
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -44812,7 +44812,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44812
44812
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44813
44813
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44814
44814
|
});
|
|
44815
|
-
// version: 1.309.0-
|
|
44815
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
44816
44816
|
|
|
44817
44817
|
var ldsIdempotencyWriteDisabled = {
|
|
44818
44818
|
isOpen: function (e) {
|
|
@@ -57144,14 +57144,14 @@ async function connectionResolver(obj, args, context, info) {
|
|
|
57144
57144
|
limit = args.first;
|
|
57145
57145
|
}
|
|
57146
57146
|
let offset = 0;
|
|
57147
|
-
|
|
57148
|
-
|
|
57149
|
-
if (!originalCursor) {
|
|
57150
|
-
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
57151
|
-
throw new Error('Internal Error: unable to determine `after` cursor value');
|
|
57152
|
-
}
|
|
57147
|
+
let originalCursor = context.mappedCursors.get(queryCacheKey);
|
|
57148
|
+
if (originalCursor) {
|
|
57153
57149
|
offset = decodeV1Cursor(originalCursor).i;
|
|
57154
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
|
+
}
|
|
57155
57155
|
// if the query wants to know `hasNextPage` then we need to request 1 additional record
|
|
57156
57156
|
let selections = info.fieldNodes
|
|
57157
57157
|
.map((n) => (n.selectionSet ? n.selectionSet.selections : []))
|
|
@@ -61327,32 +61327,118 @@ function normalizeError$2(err) {
|
|
|
61327
61327
|
}
|
|
61328
61328
|
return new Error(stringify$1$1(err));
|
|
61329
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';
|
|
61330
61334
|
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
61331
61335
|
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
61332
61336
|
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
61333
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';
|
|
61334
61349
|
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
61335
|
-
|
|
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();
|
|
61336
61364
|
function reportGraphqlQueryParseError(err) {
|
|
61337
|
-
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);
|
|
61338
61371
|
}
|
|
61339
61372
|
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
61340
|
-
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);
|
|
61341
61379
|
}
|
|
61342
61380
|
function reportGraphqlCreateSnapshotError(err) {
|
|
61343
|
-
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);
|
|
61344
61387
|
}
|
|
61345
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 });
|
|
61346
61394
|
}
|
|
61347
61395
|
function reportGraphqlQueryInstrumentation(data) {
|
|
61348
61396
|
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
61349
61397
|
const recordBuckets = [
|
|
61350
61398
|
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
61351
61399
|
];
|
|
61352
|
-
ldsMobileInstrumentation$
|
|
61353
|
-
ldsMobileInstrumentation$
|
|
61354
|
-
ldsMobileInstrumentation$
|
|
61355
|
-
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
|
+
}
|
|
61356
61442
|
}
|
|
61357
61443
|
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
61358
61444
|
let error;
|
|
@@ -61362,16 +61448,43 @@ function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
|
61362
61448
|
else {
|
|
61363
61449
|
error = normalizeError$2(err);
|
|
61364
61450
|
}
|
|
61365
|
-
|
|
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);
|
|
61366
61463
|
}
|
|
61367
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, {});
|
|
61368
61470
|
}
|
|
61369
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);
|
|
61370
61478
|
}
|
|
61371
61479
|
function reportPrimingConflict(resolutionType, recordCount) {
|
|
61480
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_CONFLICT_COUNT, recordCount, undefined, {
|
|
61481
|
+
resolutionType,
|
|
61482
|
+
});
|
|
61372
61483
|
}
|
|
61373
61484
|
/** Network */
|
|
61374
61485
|
function reportChunkCandidateUrlLength(urlLength) {
|
|
61486
|
+
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
61487
|
+
ldsMobileInstrumentation$2.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
61375
61488
|
}
|
|
61376
61489
|
|
|
61377
61490
|
/**
|
|
@@ -61385,13 +61498,19 @@ const withInstrumentation = (operation, config) => {
|
|
|
61385
61498
|
return operation();
|
|
61386
61499
|
}
|
|
61387
61500
|
const { tags, metricName, logError } = config;
|
|
61501
|
+
let hasError = false;
|
|
61388
61502
|
return operation()
|
|
61389
61503
|
.catch((err) => {
|
|
61504
|
+
hasError = true;
|
|
61390
61505
|
const error = normalizeError$2(err);
|
|
61391
61506
|
tags['errorMessage'] = error.message;
|
|
61507
|
+
if (logError) {
|
|
61508
|
+
ldsMobileInstrumentation$2.error(error);
|
|
61509
|
+
}
|
|
61392
61510
|
throw err;
|
|
61393
61511
|
})
|
|
61394
61512
|
.finally(() => {
|
|
61513
|
+
ldsMobileInstrumentation$2.incrementCounter(metricName, 1, hasError, tags);
|
|
61395
61514
|
});
|
|
61396
61515
|
};
|
|
61397
61516
|
|
|
@@ -61404,26 +61523,36 @@ function instrumentDraftQueue(queue) {
|
|
|
61404
61523
|
case DraftQueueEventType.QueueStateChanged:
|
|
61405
61524
|
switch (draftQueueEvent.state) {
|
|
61406
61525
|
case DraftQueueState.Error:
|
|
61526
|
+
reportDraftQueueState('error');
|
|
61407
61527
|
break;
|
|
61408
61528
|
case DraftQueueState.Started:
|
|
61529
|
+
reportDraftQueueState('started');
|
|
61409
61530
|
break;
|
|
61410
61531
|
case DraftQueueState.Stopped:
|
|
61532
|
+
reportDraftQueueState('stopped');
|
|
61411
61533
|
break;
|
|
61412
61534
|
case DraftQueueState.Waiting:
|
|
61535
|
+
reportDraftQueueState('waiting');
|
|
61413
61536
|
break;
|
|
61414
61537
|
}
|
|
61415
61538
|
break;
|
|
61416
61539
|
case DraftQueueEventType.ActionAdded:
|
|
61540
|
+
reportDraftActionEvent('added');
|
|
61417
61541
|
break;
|
|
61418
61542
|
case DraftQueueEventType.ActionUploading:
|
|
61543
|
+
reportDraftActionEvent('uploading');
|
|
61419
61544
|
break;
|
|
61420
61545
|
case DraftQueueEventType.ActionCompleted:
|
|
61546
|
+
reportDraftActionEvent('completed');
|
|
61421
61547
|
break;
|
|
61422
61548
|
case DraftQueueEventType.ActionDeleted:
|
|
61549
|
+
reportDraftActionEvent('deleted');
|
|
61423
61550
|
break;
|
|
61424
61551
|
case DraftQueueEventType.ActionFailed:
|
|
61552
|
+
reportDraftActionEvent('failed');
|
|
61425
61553
|
break;
|
|
61426
61554
|
case DraftQueueEventType.ActionUpdated:
|
|
61555
|
+
reportDraftActionEvent('updated');
|
|
61427
61556
|
break;
|
|
61428
61557
|
}
|
|
61429
61558
|
return Promise.resolve();
|
|
@@ -63248,10 +63377,12 @@ class RecordIngestor {
|
|
|
63248
63377
|
}
|
|
63249
63378
|
|
|
63250
63379
|
function instrumentPrimingSession(session) {
|
|
63380
|
+
reportPrimingSessionCreated();
|
|
63251
63381
|
session.on('error', ({ code, ids }) => {
|
|
63252
63382
|
reportPrimingError(code, ids.length);
|
|
63253
63383
|
});
|
|
63254
63384
|
session.on('primed', ({ length }) => {
|
|
63385
|
+
reportPrimingSuccess(length);
|
|
63255
63386
|
});
|
|
63256
63387
|
session.on('conflict', ({ ids, resolution }) => {
|
|
63257
63388
|
reportPrimingConflict(resolution, ids.length);
|
|
@@ -63944,7 +64075,7 @@ register$1({
|
|
|
63944
64075
|
id: '@salesforce/lds-network-adapter',
|
|
63945
64076
|
instrument: instrument$2,
|
|
63946
64077
|
});
|
|
63947
|
-
// version: 1.309.0-
|
|
64078
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
63948
64079
|
|
|
63949
64080
|
const { create: create$3, keys: keys$3 } = Object;
|
|
63950
64081
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -83980,7 +84111,7 @@ register$1({
|
|
|
83980
84111
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
83981
84112
|
instrument: instrument$1,
|
|
83982
84113
|
});
|
|
83983
|
-
// version: 1.309.0-
|
|
84114
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
83984
84115
|
|
|
83985
84116
|
// On core the unstable adapters are re-exported with different names,
|
|
83986
84117
|
// we want to match them here.
|
|
@@ -86236,7 +86367,7 @@ withDefaultLuvio((luvio) => {
|
|
|
86236
86367
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
86237
86368
|
graphQLImperative = ldsAdapter;
|
|
86238
86369
|
});
|
|
86239
|
-
// version: 1.309.0-
|
|
86370
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
86240
86371
|
|
|
86241
86372
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
86242
86373
|
__proto__: null,
|
|
@@ -86359,6 +86490,7 @@ function normalizeError(error) {
|
|
|
86359
86490
|
return new Error(stringify$1(error));
|
|
86360
86491
|
}
|
|
86361
86492
|
|
|
86493
|
+
const ldsMobileInstrumentation$1 = getInstrumentation();
|
|
86362
86494
|
/**
|
|
86363
86495
|
* Coerces a cache policy passed in from native to a luvio cache policy
|
|
86364
86496
|
* @param nativeCachePolicy The cache policy passed in from native
|
|
@@ -86640,9 +86772,14 @@ function invokeAdapterWithMetadata(adapterId, config, metadata, onResponse, nati
|
|
|
86640
86772
|
draftIds.length > 0) {
|
|
86641
86773
|
const draftId = draftIds[draftIds.length - 1];
|
|
86642
86774
|
const managerState = await draftManager.getQueue();
|
|
86643
|
-
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
|
+
}
|
|
86644
86781
|
draftManager
|
|
86645
|
-
.setMetadata(draftId, { ...
|
|
86782
|
+
.setMetadata(draftId, { ...draftItem.metadata, ...metadata })
|
|
86646
86783
|
.then(() => {
|
|
86647
86784
|
onResponse(responseValue);
|
|
86648
86785
|
})
|
|
@@ -86971,7 +87108,7 @@ const callbacks$1 = [];
|
|
|
86971
87108
|
function register(r) {
|
|
86972
87109
|
callbacks$1.forEach((callback) => callback(r));
|
|
86973
87110
|
}
|
|
86974
|
-
// version: 1.309.0-
|
|
87111
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
86975
87112
|
|
|
86976
87113
|
/**
|
|
86977
87114
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -91933,4 +92070,4 @@ const { luvio } = getRuntime();
|
|
|
91933
92070
|
setDefaultLuvio({ luvio });
|
|
91934
92071
|
|
|
91935
92072
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
91936
|
-
// version: 1.309.0-
|
|
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;
|
|
@@ -4271,7 +4271,7 @@
|
|
|
4271
4271
|
}
|
|
4272
4272
|
callbacks.push(callback);
|
|
4273
4273
|
}
|
|
4274
|
-
// version: 1.309.0-
|
|
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.309.0-
|
|
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".
|
|
@@ -16711,7 +16711,7 @@
|
|
|
16711
16711
|
const { apiFamily, name } = metadata;
|
|
16712
16712
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16713
16713
|
}
|
|
16714
|
-
// version: 1.309.0-
|
|
16714
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
16715
16715
|
|
|
16716
16716
|
/**
|
|
16717
16717
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -44818,7 +44818,7 @@
|
|
|
44818
44818
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44819
44819
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44820
44820
|
});
|
|
44821
|
-
// version: 1.309.0-
|
|
44821
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
44822
44822
|
|
|
44823
44823
|
var ldsIdempotencyWriteDisabled = {
|
|
44824
44824
|
isOpen: function (e) {
|
|
@@ -57150,14 +57150,14 @@
|
|
|
57150
57150
|
limit = args.first;
|
|
57151
57151
|
}
|
|
57152
57152
|
let offset = 0;
|
|
57153
|
-
|
|
57154
|
-
|
|
57155
|
-
if (!originalCursor) {
|
|
57156
|
-
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
57157
|
-
throw new Error('Internal Error: unable to determine `after` cursor value');
|
|
57158
|
-
}
|
|
57153
|
+
let originalCursor = context.mappedCursors.get(queryCacheKey);
|
|
57154
|
+
if (originalCursor) {
|
|
57159
57155
|
offset = decodeV1Cursor(originalCursor).i;
|
|
57160
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
|
+
}
|
|
57161
57161
|
// if the query wants to know `hasNextPage` then we need to request 1 additional record
|
|
57162
57162
|
let selections = info.fieldNodes
|
|
57163
57163
|
.map((n) => (n.selectionSet ? n.selectionSet.selections : []))
|
|
@@ -61333,32 +61333,118 @@
|
|
|
61333
61333
|
}
|
|
61334
61334
|
return new Error(stringify$1$1(err));
|
|
61335
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';
|
|
61336
61340
|
const GRAPHQL_EVAL_ROOT_QUERY_COUNT = 'gql-eval-root-query-count';
|
|
61337
61341
|
const GRAPHQL_EVAL_TOTAL_QUERY_COUNT = 'gql-eval-total-query-count';
|
|
61338
61342
|
const GRAPHQL_EVAL_MAX_CHILD_RELATIONSHIPS_COUNT = 'gql-eval-max-child-count';
|
|
61339
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';
|
|
61340
61355
|
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
61341
|
-
|
|
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();
|
|
61342
61370
|
function reportGraphqlQueryParseError(err) {
|
|
61343
|
-
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);
|
|
61344
61377
|
}
|
|
61345
61378
|
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
61346
|
-
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);
|
|
61347
61385
|
}
|
|
61348
61386
|
function reportGraphqlCreateSnapshotError(err) {
|
|
61349
|
-
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);
|
|
61350
61393
|
}
|
|
61351
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 });
|
|
61352
61400
|
}
|
|
61353
61401
|
function reportGraphqlQueryInstrumentation(data) {
|
|
61354
61402
|
const queryBuckets = [1, 2, 3, 4, 5, 10, 20, 50, 100];
|
|
61355
61403
|
const recordBuckets = [
|
|
61356
61404
|
1, 5, 10, 20, 50, 100, 1000, 2000, 5000, 10000, 50000, 100000, 1000000,
|
|
61357
61405
|
];
|
|
61358
|
-
ldsMobileInstrumentation$
|
|
61359
|
-
ldsMobileInstrumentation$
|
|
61360
|
-
ldsMobileInstrumentation$
|
|
61361
|
-
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
|
+
}
|
|
61362
61448
|
}
|
|
61363
61449
|
function reportDraftAwareContentDocumentVersionSynthesizeError(err) {
|
|
61364
61450
|
let error;
|
|
@@ -61368,16 +61454,43 @@
|
|
|
61368
61454
|
else {
|
|
61369
61455
|
error = normalizeError$2(err);
|
|
61370
61456
|
}
|
|
61371
|
-
|
|
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);
|
|
61372
61469
|
}
|
|
61373
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, {});
|
|
61374
61476
|
}
|
|
61375
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);
|
|
61376
61484
|
}
|
|
61377
61485
|
function reportPrimingConflict(resolutionType, recordCount) {
|
|
61486
|
+
ldsMobileInstrumentation$2.incrementCounter(PRIMING_TOTAL_CONFLICT_COUNT, recordCount, undefined, {
|
|
61487
|
+
resolutionType,
|
|
61488
|
+
});
|
|
61378
61489
|
}
|
|
61379
61490
|
/** Network */
|
|
61380
61491
|
function reportChunkCandidateUrlLength(urlLength) {
|
|
61492
|
+
const buckets = [8000, 10000, 12000, 14000, 16000];
|
|
61493
|
+
ldsMobileInstrumentation$2.bucketValue('chunk-candidate-url-length-histogram', urlLength, buckets);
|
|
61381
61494
|
}
|
|
61382
61495
|
|
|
61383
61496
|
/**
|
|
@@ -61391,13 +61504,19 @@
|
|
|
61391
61504
|
return operation();
|
|
61392
61505
|
}
|
|
61393
61506
|
const { tags, metricName, logError } = config;
|
|
61507
|
+
let hasError = false;
|
|
61394
61508
|
return operation()
|
|
61395
61509
|
.catch((err) => {
|
|
61510
|
+
hasError = true;
|
|
61396
61511
|
const error = normalizeError$2(err);
|
|
61397
61512
|
tags['errorMessage'] = error.message;
|
|
61513
|
+
if (logError) {
|
|
61514
|
+
ldsMobileInstrumentation$2.error(error);
|
|
61515
|
+
}
|
|
61398
61516
|
throw err;
|
|
61399
61517
|
})
|
|
61400
61518
|
.finally(() => {
|
|
61519
|
+
ldsMobileInstrumentation$2.incrementCounter(metricName, 1, hasError, tags);
|
|
61401
61520
|
});
|
|
61402
61521
|
};
|
|
61403
61522
|
|
|
@@ -61410,26 +61529,36 @@
|
|
|
61410
61529
|
case DraftQueueEventType.QueueStateChanged:
|
|
61411
61530
|
switch (draftQueueEvent.state) {
|
|
61412
61531
|
case DraftQueueState.Error:
|
|
61532
|
+
reportDraftQueueState('error');
|
|
61413
61533
|
break;
|
|
61414
61534
|
case DraftQueueState.Started:
|
|
61535
|
+
reportDraftQueueState('started');
|
|
61415
61536
|
break;
|
|
61416
61537
|
case DraftQueueState.Stopped:
|
|
61538
|
+
reportDraftQueueState('stopped');
|
|
61417
61539
|
break;
|
|
61418
61540
|
case DraftQueueState.Waiting:
|
|
61541
|
+
reportDraftQueueState('waiting');
|
|
61419
61542
|
break;
|
|
61420
61543
|
}
|
|
61421
61544
|
break;
|
|
61422
61545
|
case DraftQueueEventType.ActionAdded:
|
|
61546
|
+
reportDraftActionEvent('added');
|
|
61423
61547
|
break;
|
|
61424
61548
|
case DraftQueueEventType.ActionUploading:
|
|
61549
|
+
reportDraftActionEvent('uploading');
|
|
61425
61550
|
break;
|
|
61426
61551
|
case DraftQueueEventType.ActionCompleted:
|
|
61552
|
+
reportDraftActionEvent('completed');
|
|
61427
61553
|
break;
|
|
61428
61554
|
case DraftQueueEventType.ActionDeleted:
|
|
61555
|
+
reportDraftActionEvent('deleted');
|
|
61429
61556
|
break;
|
|
61430
61557
|
case DraftQueueEventType.ActionFailed:
|
|
61558
|
+
reportDraftActionEvent('failed');
|
|
61431
61559
|
break;
|
|
61432
61560
|
case DraftQueueEventType.ActionUpdated:
|
|
61561
|
+
reportDraftActionEvent('updated');
|
|
61433
61562
|
break;
|
|
61434
61563
|
}
|
|
61435
61564
|
return Promise.resolve();
|
|
@@ -63254,10 +63383,12 @@
|
|
|
63254
63383
|
}
|
|
63255
63384
|
|
|
63256
63385
|
function instrumentPrimingSession(session) {
|
|
63386
|
+
reportPrimingSessionCreated();
|
|
63257
63387
|
session.on('error', ({ code, ids }) => {
|
|
63258
63388
|
reportPrimingError(code, ids.length);
|
|
63259
63389
|
});
|
|
63260
63390
|
session.on('primed', ({ length }) => {
|
|
63391
|
+
reportPrimingSuccess(length);
|
|
63261
63392
|
});
|
|
63262
63393
|
session.on('conflict', ({ ids, resolution }) => {
|
|
63263
63394
|
reportPrimingConflict(resolution, ids.length);
|
|
@@ -63950,7 +64081,7 @@
|
|
|
63950
64081
|
id: '@salesforce/lds-network-adapter',
|
|
63951
64082
|
instrument: instrument$2,
|
|
63952
64083
|
});
|
|
63953
|
-
// version: 1.309.0-
|
|
64084
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
63954
64085
|
|
|
63955
64086
|
const { create: create$3, keys: keys$3 } = Object;
|
|
63956
64087
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -83986,7 +84117,7 @@
|
|
|
83986
84117
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
83987
84118
|
instrument: instrument$1,
|
|
83988
84119
|
});
|
|
83989
|
-
// version: 1.309.0-
|
|
84120
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
83990
84121
|
|
|
83991
84122
|
// On core the unstable adapters are re-exported with different names,
|
|
83992
84123
|
// we want to match them here.
|
|
@@ -86242,7 +86373,7 @@
|
|
|
86242
86373
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
86243
86374
|
graphQLImperative = ldsAdapter;
|
|
86244
86375
|
});
|
|
86245
|
-
// version: 1.309.0-
|
|
86376
|
+
// version: 1.309.0-dev11-e18434ec95
|
|
86246
86377
|
|
|
86247
86378
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
86248
86379
|
__proto__: null,
|
|
@@ -86365,6 +86496,7 @@
|
|
|
86365
86496
|
return new Error(stringify$1(error));
|
|
86366
86497
|
}
|
|
86367
86498
|
|
|
86499
|
+
const ldsMobileInstrumentation$1 = getInstrumentation();
|
|
86368
86500
|
/**
|
|
86369
86501
|
* Coerces a cache policy passed in from native to a luvio cache policy
|
|
86370
86502
|
* @param nativeCachePolicy The cache policy passed in from native
|
|
@@ -86646,9 +86778,14 @@
|
|
|
86646
86778
|
draftIds.length > 0) {
|
|
86647
86779
|
const draftId = draftIds[draftIds.length - 1];
|
|
86648
86780
|
const managerState = await draftManager.getQueue();
|
|
86649
|
-
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
|
+
}
|
|
86650
86787
|
draftManager
|
|
86651
|
-
.setMetadata(draftId, { ...
|
|
86788
|
+
.setMetadata(draftId, { ...draftItem.metadata, ...metadata })
|
|
86652
86789
|
.then(() => {
|
|
86653
86790
|
onResponse(responseValue);
|
|
86654
86791
|
})
|
|
@@ -86977,7 +87114,7 @@
|
|
|
86977
87114
|
function register(r) {
|
|
86978
87115
|
callbacks$1.forEach((callback) => callback(r));
|
|
86979
87116
|
}
|
|
86980
|
-
// version: 1.309.0-
|
|
87117
|
+
// version: 1.309.0-dev11-ffe70308a8
|
|
86981
87118
|
|
|
86982
87119
|
/**
|
|
86983
87120
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -91958,4 +92095,4 @@
|
|
|
91958
92095
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
91959
92096
|
|
|
91960
92097
|
}));
|
|
91961
|
-
// version: 1.309.0-
|
|
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.309.0-
|
|
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.309.0-
|
|
39
|
-
"@salesforce/lds-adapters-uiapi": "^1.309.0-
|
|
40
|
-
"@salesforce/lds-default-luvio": "^1.309.0-
|
|
41
|
-
"@salesforce/lds-drafts": "^1.309.0-
|
|
42
|
-
"@salesforce/lds-graphql-parser": "^1.309.0-
|
|
43
|
-
"@salesforce/lds-luvio-engine": "^1.309.0-
|
|
44
|
-
"@salesforce/lds-priming": "^1.309.0-
|
|
45
|
-
"@salesforce/lds-runtime-mobile": "^1.309.0-
|
|
46
|
-
"@salesforce/nimbus-plugin-lds": "^1.309.0-
|
|
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
|
}
|