@salesforce/lds-worker-api 1.131.4 → 1.131.5

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.
@@ -761,4 +761,4 @@ if (process.env.NODE_ENV !== 'production') {
761
761
  }
762
762
 
763
763
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
764
- // version: 1.131.4-b5124bf19
764
+ // version: 1.131.5-85e8eb5ad
@@ -3776,7 +3776,7 @@ function withDefaultLuvio(callback) {
3776
3776
  }
3777
3777
  callbacks.push(callback);
3778
3778
  }
3779
- // version: 1.131.4-b5124bf19
3779
+ // version: 1.131.5-85e8eb5ad
3780
3780
 
3781
3781
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3782
3782
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15200,7 +15200,7 @@ function parseAndVisit(source) {
15200
15200
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15201
15201
  return luvioDocumentNode;
15202
15202
  }
15203
- // version: 1.131.4-b5124bf19
15203
+ // version: 1.131.5-85e8eb5ad
15204
15204
 
15205
15205
  function unwrap(data) {
15206
15206
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16113,7 +16113,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16113
16113
  const { apiFamily, name } = metadata;
16114
16114
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16115
16115
  }
16116
- // version: 1.131.4-b5124bf19
16116
+ // version: 1.131.5-85e8eb5ad
16117
16117
 
16118
16118
  /**
16119
16119
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44413,7 +44413,7 @@ withDefaultLuvio((luvio) => {
44413
44413
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44414
44414
  });
44415
44415
  });
44416
- // version: 1.131.4-cc304bf50
44416
+ // version: 1.131.5-4a677353b
44417
44417
 
44418
44418
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44419
44419
 
@@ -50678,16 +50678,23 @@ function makeEnvironmentDraftAware(luvio, env, durableStore, handlers, draftQueu
50678
50678
 
50679
50679
  const API_NAMESPACE = 'UiApi';
50680
50680
  const RECORD_REPRESENTATION_NAME$1 = 'RecordRepresentation';
50681
+ const RECORD_VIEW_ENTITY_REPRESENTATION_NAME = 'RecordViewEntityRepresentation';
50681
50682
  const RECORD_ID_PREFIX = `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:`;
50683
+ const RECORD_VIEW_ENTITY_ID_PREFIX = `${API_NAMESPACE}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME}:Name`;
50682
50684
  const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
50683
50685
  function isStoreKeyRecordId(key) {
50684
50686
  return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1;
50685
50687
  }
50688
+ function isStoreKeyRecordViewEntity(key) {
50689
+ return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) > -1 &&
50690
+ key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1);
50691
+ }
50686
50692
  function isStoreKeyRecordField(key) {
50687
50693
  return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) > -1;
50688
50694
  }
50689
50695
  function extractRecordIdFromStoreKey(key) {
50690
- if (key === undefined || key.indexOf(RECORD_ID_PREFIX) === -1) {
50696
+ if (key === undefined ||
50697
+ (key.indexOf(RECORD_ID_PREFIX) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) === -1)) {
50691
50698
  return undefined;
50692
50699
  }
50693
50700
  const parts = key.split(':');
@@ -50702,7 +50709,8 @@ function isStoreRecordError(storeRecord) {
50702
50709
  }
50703
50710
  function isEntryDurableRecordRepresentation(entry, key) {
50704
50711
  // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
50705
- return isStoreKeyRecordId(key) && entry.data.__type === undefined;
50712
+ return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity(key)) &&
50713
+ entry.data.__type === undefined);
50706
50714
  }
50707
50715
 
50708
50716
  /**
@@ -56209,6 +56217,15 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
56209
56217
  links,
56210
56218
  };
56211
56219
  }
56220
+ function getDenormalizedKey(originalKey, recordId, luvio) {
56221
+ // this will likely need to be handled when moving to structured keys
56222
+ // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
56223
+ // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
56224
+ if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX)) {
56225
+ return RECORD_VIEW_ENTITY_ID_PREFIX + recordId;
56226
+ }
56227
+ return keyBuilder$1Q(luvio, { recordId });
56228
+ }
56212
56229
  function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata) {
56213
56230
  const getEntries = function (entries, segment) {
56214
56231
  // this HOF only inspects records in the default segment
@@ -56228,7 +56245,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
56228
56245
  const recordId = extractRecordIdFromStoreKey(id);
56229
56246
  if (recordId !== undefined) {
56230
56247
  if (recordEntries[recordId] === undefined) {
56231
- const key = keyBuilder$1Q(luvio, { recordId });
56248
+ const key = getDenormalizedKey(id, recordId, luvio);
56232
56249
  recordEntries[recordId] = true;
56233
56250
  filteredEntryIds.push(key);
56234
56251
  }
@@ -56272,7 +56289,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
56272
56289
  const recordId = extractRecordIdFromStoreKey(key);
56273
56290
  // do not put normalized field values
56274
56291
  if (recordId !== undefined) {
56275
- const recordKey = keyBuilder$1Q(luvio, { recordId });
56292
+ const recordKey = getDenormalizedKey(key, recordId, luvio);
56276
56293
  if (putRecords[recordId] === true) {
56277
56294
  continue;
56278
56295
  }
@@ -60025,7 +60042,7 @@ register({
60025
60042
  id: '@salesforce/lds-network-adapter',
60026
60043
  instrument: instrument$1,
60027
60044
  });
60028
- // version: 1.131.4-b5124bf19
60045
+ // version: 1.131.5-85e8eb5ad
60029
60046
 
60030
60047
  const { create: create$2, keys: keys$2 } = Object;
60031
60048
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -74333,7 +74350,7 @@ register({
74333
74350
  configuration: { ...configurationForGraphQLAdapters },
74334
74351
  instrument,
74335
74352
  });
74336
- // version: 1.131.4-cc304bf50
74353
+ // version: 1.131.5-4a677353b
74337
74354
 
74338
74355
  // On core the unstable adapters are re-exported with different names,
74339
74356
 
@@ -76462,7 +76479,7 @@ withDefaultLuvio((luvio) => {
76462
76479
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
76463
76480
  graphQLImperative = ldsAdapter;
76464
76481
  });
76465
- // version: 1.131.4-cc304bf50
76482
+ // version: 1.131.5-4a677353b
76466
76483
 
76467
76484
  var gqlApi = /*#__PURE__*/Object.freeze({
76468
76485
  __proto__: null,
@@ -77154,4 +77171,4 @@ const { luvio } = getRuntime();
77154
77171
  setDefaultLuvio({ luvio });
77155
77172
 
77156
77173
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
77157
- // version: 1.131.4-b5124bf19
77174
+ // version: 1.131.5-85e8eb5ad
@@ -0,0 +1,18 @@
1
+ import type { IdleDetector, Activity } from 'o11y/dist/modules/o11y/client/interfaces';
2
+ export declare const idleDetector: IdleDetector;
3
+ export declare const activity: Partial<Activity>;
4
+ type MetricsTags = Record<string, number | string | boolean>;
5
+ declare function startActivity(_name: string): Activity;
6
+ export declare const mockInstrumentation: {
7
+ startActivity: typeof startActivity;
8
+ error: () => void;
9
+ trackValue: (_operation: string, _value: number, _hasError?: boolean, _tags?: MetricsTags) => void;
10
+ incrementCounter: (_operation: string, _increment?: number, _hasError?: boolean, _tags?: MetricsTags) => void;
11
+ };
12
+ export declare const getInstrumentation: () => {
13
+ startActivity: typeof startActivity;
14
+ error: () => void;
15
+ trackValue: (_operation: string, _value: number, _hasError?: boolean, _tags?: MetricsTags) => void;
16
+ incrementCounter: (_operation: string, _increment?: number, _hasError?: boolean, _tags?: MetricsTags) => void;
17
+ };
18
+ export {};
@@ -3782,7 +3782,7 @@
3782
3782
  }
3783
3783
  callbacks.push(callback);
3784
3784
  }
3785
- // version: 1.131.4-b5124bf19
3785
+ // version: 1.131.5-85e8eb5ad
3786
3786
 
3787
3787
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3788
3788
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15206,7 +15206,7 @@
15206
15206
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15207
15207
  return luvioDocumentNode;
15208
15208
  }
15209
- // version: 1.131.4-b5124bf19
15209
+ // version: 1.131.5-85e8eb5ad
15210
15210
 
15211
15211
  function unwrap(data) {
15212
15212
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16119,7 +16119,7 @@
16119
16119
  const { apiFamily, name } = metadata;
16120
16120
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16121
16121
  }
16122
- // version: 1.131.4-b5124bf19
16122
+ // version: 1.131.5-85e8eb5ad
16123
16123
 
16124
16124
  /**
16125
16125
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44419,7 +44419,7 @@
44419
44419
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44420
44420
  });
44421
44421
  });
44422
- // version: 1.131.4-cc304bf50
44422
+ // version: 1.131.5-4a677353b
44423
44423
 
44424
44424
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44425
44425
 
@@ -50684,16 +50684,23 @@
50684
50684
 
50685
50685
  const API_NAMESPACE = 'UiApi';
50686
50686
  const RECORD_REPRESENTATION_NAME$1 = 'RecordRepresentation';
50687
+ const RECORD_VIEW_ENTITY_REPRESENTATION_NAME = 'RecordViewEntityRepresentation';
50687
50688
  const RECORD_ID_PREFIX = `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:`;
50689
+ const RECORD_VIEW_ENTITY_ID_PREFIX = `${API_NAMESPACE}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME}:Name`;
50688
50690
  const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
50689
50691
  function isStoreKeyRecordId(key) {
50690
50692
  return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1;
50691
50693
  }
50694
+ function isStoreKeyRecordViewEntity(key) {
50695
+ return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) > -1 &&
50696
+ key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1);
50697
+ }
50692
50698
  function isStoreKeyRecordField(key) {
50693
50699
  return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) > -1;
50694
50700
  }
50695
50701
  function extractRecordIdFromStoreKey(key) {
50696
- if (key === undefined || key.indexOf(RECORD_ID_PREFIX) === -1) {
50702
+ if (key === undefined ||
50703
+ (key.indexOf(RECORD_ID_PREFIX) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) === -1)) {
50697
50704
  return undefined;
50698
50705
  }
50699
50706
  const parts = key.split(':');
@@ -50708,7 +50715,8 @@
50708
50715
  }
50709
50716
  function isEntryDurableRecordRepresentation(entry, key) {
50710
50717
  // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
50711
- return isStoreKeyRecordId(key) && entry.data.__type === undefined;
50718
+ return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity(key)) &&
50719
+ entry.data.__type === undefined);
50712
50720
  }
50713
50721
 
50714
50722
  /**
@@ -56215,6 +56223,15 @@
56215
56223
  links,
56216
56224
  };
56217
56225
  }
56226
+ function getDenormalizedKey(originalKey, recordId, luvio) {
56227
+ // this will likely need to be handled when moving to structured keys
56228
+ // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
56229
+ // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
56230
+ if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX)) {
56231
+ return RECORD_VIEW_ENTITY_ID_PREFIX + recordId;
56232
+ }
56233
+ return keyBuilder$1Q(luvio, { recordId });
56234
+ }
56218
56235
  function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata) {
56219
56236
  const getEntries = function (entries, segment) {
56220
56237
  // this HOF only inspects records in the default segment
@@ -56234,7 +56251,7 @@
56234
56251
  const recordId = extractRecordIdFromStoreKey(id);
56235
56252
  if (recordId !== undefined) {
56236
56253
  if (recordEntries[recordId] === undefined) {
56237
- const key = keyBuilder$1Q(luvio, { recordId });
56254
+ const key = getDenormalizedKey(id, recordId, luvio);
56238
56255
  recordEntries[recordId] = true;
56239
56256
  filteredEntryIds.push(key);
56240
56257
  }
@@ -56278,7 +56295,7 @@
56278
56295
  const recordId = extractRecordIdFromStoreKey(key);
56279
56296
  // do not put normalized field values
56280
56297
  if (recordId !== undefined) {
56281
- const recordKey = keyBuilder$1Q(luvio, { recordId });
56298
+ const recordKey = getDenormalizedKey(key, recordId, luvio);
56282
56299
  if (putRecords[recordId] === true) {
56283
56300
  continue;
56284
56301
  }
@@ -60031,7 +60048,7 @@
60031
60048
  id: '@salesforce/lds-network-adapter',
60032
60049
  instrument: instrument$1,
60033
60050
  });
60034
- // version: 1.131.4-b5124bf19
60051
+ // version: 1.131.5-85e8eb5ad
60035
60052
 
60036
60053
  const { create: create$2, keys: keys$2 } = Object;
60037
60054
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -74339,7 +74356,7 @@
74339
74356
  configuration: { ...configurationForGraphQLAdapters },
74340
74357
  instrument,
74341
74358
  });
74342
- // version: 1.131.4-cc304bf50
74359
+ // version: 1.131.5-4a677353b
74343
74360
 
74344
74361
  // On core the unstable adapters are re-exported with different names,
74345
74362
 
@@ -76468,7 +76485,7 @@
76468
76485
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
76469
76486
  graphQLImperative = ldsAdapter;
76470
76487
  });
76471
- // version: 1.131.4-cc304bf50
76488
+ // version: 1.131.5-4a677353b
76472
76489
 
76473
76490
  var gqlApi = /*#__PURE__*/Object.freeze({
76474
76491
  __proto__: null,
@@ -77177,4 +77194,4 @@
77177
77194
  Object.defineProperty(exports, '__esModule', { value: true });
77178
77195
 
77179
77196
  }));
77180
- // version: 1.131.4-b5124bf19
77197
+ // version: 1.131.5-85e8eb5ad
@@ -0,0 +1,18 @@
1
+ import type { IdleDetector, Activity } from 'o11y/dist/modules/o11y/client/interfaces';
2
+ export declare const idleDetector: IdleDetector;
3
+ export declare const activity: Partial<Activity>;
4
+ type MetricsTags = Record<string, number | string | boolean>;
5
+ declare function startActivity(_name: string): Activity;
6
+ export declare const mockInstrumentation: {
7
+ startActivity: typeof startActivity;
8
+ error: () => void;
9
+ trackValue: (_operation: string, _value: number, _hasError?: boolean, _tags?: MetricsTags) => void;
10
+ incrementCounter: (_operation: string, _increment?: number, _hasError?: boolean, _tags?: MetricsTags) => void;
11
+ };
12
+ export declare const getInstrumentation: () => {
13
+ startActivity: typeof startActivity;
14
+ error: () => void;
15
+ trackValue: (_operation: string, _value: number, _hasError?: boolean, _tags?: MetricsTags) => void;
16
+ incrementCounter: (_operation: string, _increment?: number, _hasError?: boolean, _tags?: MetricsTags) => void;
17
+ };
18
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.131.4",
3
+ "version": "1.131.5",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",