@salesforce/lds-adapters-sales-eci 1.213.0 → 1.213.1

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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -48,6 +48,24 @@ const snapshotRefreshOptions = {
48
48
  },
49
49
  }
50
50
  };
51
+ function generateParamConfigMetadata(name, required, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ coerceFn,
56
+ };
57
+ }
58
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
59
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
60
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
61
+ return {
62
+ displayName,
63
+ parameters: {
64
+ required,
65
+ optional,
66
+ }
67
+ };
68
+ }
51
69
  const keyPrefix = 'eci';
52
70
 
53
71
  const { isArray: ArrayIsArray } = Array;
@@ -218,26 +236,8 @@ const ingest$1 = function ConversationSummaryRepresentationIngest(input, path, l
218
236
  }
219
237
  }
220
238
  const key = keyBuilderFromType$1(luvio, input);
221
- const existingRecord = store.readEntry(key);
222
239
  const ttlToUse = TTL$1;
223
- let incomingRecord = normalize$1(input, store.readEntry(key), {
224
- fullPath: key,
225
- parent: path.parent,
226
- propertyName: path.propertyName,
227
- ttl: ttlToUse
228
- });
229
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
230
- luvio.storePublish(key, incomingRecord);
231
- }
232
- {
233
- const storeMetadataParams = {
234
- ttl: ttlToUse,
235
- namespace: "eci",
236
- version: VERSION$1,
237
- representationName: RepresentationType$1,
238
- };
239
- luvio.publishStoreMetadata(key, storeMetadataParams);
240
- }
240
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "eci", VERSION$1, RepresentationType$1, equals$1);
241
241
  return createLink(key);
242
242
  };
243
243
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -287,13 +287,11 @@ function createResourceRequest$1(config) {
287
287
  };
288
288
  }
289
289
 
290
- const generateConversationSummary_ConfigPropertyNames = {
291
- displayName: 'generateConversationSummary',
292
- parameters: {
293
- required: ['conversationId'],
294
- optional: []
295
- }
296
- };
290
+ const adapterName$1 = 'generateConversationSummary';
291
+ const generateConversationSummary_ConfigPropertyMetadata = [
292
+ generateParamConfigMetadata('conversationId', true),
293
+ ];
294
+ const generateConversationSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateConversationSummary_ConfigPropertyMetadata);
297
295
  function createResourceParams$1(config) {
298
296
  const resourceParams = {
299
297
  urlParams: {
@@ -403,7 +401,7 @@ function normalize(input, existing, path, luvio, store, timestamp) {
403
401
  existing: existing,
404
402
  },
405
403
  ttl: path.ttl
406
- }, luvio, store);
404
+ }, luvio, store, timestamp);
407
405
  }
408
406
  return input;
409
407
  }
@@ -452,26 +450,8 @@ const ingest = function ConversationSummaryListRepresentationIngest(input, path,
452
450
  }
453
451
  }
454
452
  const key = keyBuilderFromType(luvio, input);
455
- const existingRecord = store.readEntry(key);
456
453
  const ttlToUse = TTL;
457
- let incomingRecord = normalize(input, store.readEntry(key), {
458
- fullPath: key,
459
- parent: path.parent,
460
- propertyName: path.propertyName,
461
- ttl: ttlToUse
462
- }, luvio, store);
463
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
464
- luvio.storePublish(key, incomingRecord);
465
- }
466
- {
467
- const storeMetadataParams = {
468
- ttl: ttlToUse,
469
- namespace: "eci",
470
- version: VERSION,
471
- representationName: RepresentationType,
472
- };
473
- luvio.publishStoreMetadata(key, storeMetadataParams);
474
- }
454
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "eci", VERSION, RepresentationType, equals);
475
455
  return createLink(key);
476
456
  };
477
457
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -542,13 +522,11 @@ function createResourceRequest(config) {
542
522
  };
543
523
  }
544
524
 
545
- const getConversationSummaryRelatedList_ConfigPropertyNames = {
546
- displayName: 'getConversationSummaryRelatedList',
547
- parameters: {
548
- required: ['id'],
549
- optional: []
550
- }
551
- };
525
+ const adapterName = 'getConversationSummaryRelatedList';
526
+ const getConversationSummaryRelatedList_ConfigPropertyMetadata = [
527
+ generateParamConfigMetadata('id', true),
528
+ ];
529
+ const getConversationSummaryRelatedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getConversationSummaryRelatedList_ConfigPropertyMetadata);
552
530
  function createResourceParams(config) {
553
531
  const resourceParams = {
554
532
  urlParams: {
@@ -614,21 +592,7 @@ function buildNetworkSnapshot(luvio, config, options) {
614
592
  });
615
593
  }
616
594
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
617
- const { luvio, config } = context;
618
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
619
- const dispatchOptions = {
620
- resourceRequestContext: {
621
- requestCorrelator,
622
- luvioRequestMethod: undefined,
623
- },
624
- eventObservers
625
- };
626
- if (networkPriority !== 'normal') {
627
- dispatchOptions.overrides = {
628
- priority: networkPriority
629
- };
630
- }
631
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
595
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
632
596
  }
633
597
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
634
598
  const { luvio, config } = context;
@@ -1,4 +1,4 @@
1
- import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot } from '@luvio/engine';
1
+ import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot, AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata } from '@luvio/engine';
2
2
  export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
3
3
  declare const ObjectKeys: {
4
4
  (o: object): string[];
@@ -57,4 +57,6 @@ export declare const snapshotRefreshOptions: {
57
57
  export declare function stableJSONStringify(node: any): string | undefined;
58
58
  export declare function getFetchResponseStatusText(status: number): string;
59
59
  export declare function isUnfulfilledSnapshot<T, U>(snapshot: $64$luvio_engine_Snapshot<T, U>): snapshot is $64$luvio_engine_UnfulfilledSnapshot<T, U>;
60
+ export declare function generateParamConfigMetadata(name: string, required: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
61
+ export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
60
62
  export declare const keyPrefix = "eci";
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_postConversationSummaryAiGenerateByConversationId_ResourceRequestConfig } from '../resources/postConversationSummaryAiGenerateByConversationId';
3
- import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { ConversationSummaryRepresentation as types_ConversationSummaryRepresentation_ConversationSummaryRepresentation } from '../types/ConversationSummaryRepresentation';
5
5
  export declare const adapterName = "generateConversationSummary";
6
+ export declare const generateConversationSummary_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const generateConversationSummary_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GenerateConversationSummaryConfig {
8
9
  conversationId: string;
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted, UncoercedConfiguration as adapter$45$utils_UncoercedConfiguration } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, UncoercedConfiguration as adapter$45$utils_UncoercedConfiguration } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConversationSummaryRelatedById_ResourceRequestConfig } from '../resources/getConversationSummaryRelatedById';
3
- import { Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { ConversationSummaryListRepresentation as types_ConversationSummaryListRepresentation_ConversationSummaryListRepresentation, KeyParams as types_ConversationSummaryListRepresentation_KeyParams } from '../types/ConversationSummaryListRepresentation';
5
5
  export declare const adapterName = "getConversationSummaryRelatedList";
6
+ export declare const getConversationSummaryRelatedList_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getConversationSummaryRelatedList_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetConversationSummaryRelatedListConfig {
8
9
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sales-eci",
3
- "version": "1.213.0",
3
+ "version": "1.213.1",
4
4
  "description": "Einstein Conversation Insights",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/sales-eci.js",
package/sfdc/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /* proxy-compat-disable */
15
15
  import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
- import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -58,6 +58,24 @@ const snapshotRefreshOptions = {
58
58
  },
59
59
  }
60
60
  };
61
+ function generateParamConfigMetadata(name, required, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ coerceFn,
66
+ };
67
+ }
68
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
69
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
70
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
71
+ return {
72
+ displayName,
73
+ parameters: {
74
+ required,
75
+ optional,
76
+ }
77
+ };
78
+ }
61
79
  const keyPrefix = 'eci';
62
80
 
63
81
  const { isArray: ArrayIsArray } = Array;
@@ -228,26 +246,8 @@ const ingest$1 = function ConversationSummaryRepresentationIngest(input, path, l
228
246
  }
229
247
  }
230
248
  const key = keyBuilderFromType$1(luvio, input);
231
- const existingRecord = store.readEntry(key);
232
249
  const ttlToUse = TTL$1;
233
- let incomingRecord = normalize$1(input, store.readEntry(key), {
234
- fullPath: key,
235
- parent: path.parent,
236
- propertyName: path.propertyName,
237
- ttl: ttlToUse
238
- });
239
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
240
- luvio.storePublish(key, incomingRecord);
241
- }
242
- {
243
- const storeMetadataParams = {
244
- ttl: ttlToUse,
245
- namespace: "eci",
246
- version: VERSION$1,
247
- representationName: RepresentationType$1,
248
- };
249
- luvio.publishStoreMetadata(key, storeMetadataParams);
250
- }
250
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "eci", VERSION$1, RepresentationType$1, equals$1);
251
251
  return createLink(key);
252
252
  };
253
253
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -297,13 +297,11 @@ function createResourceRequest$1(config) {
297
297
  };
298
298
  }
299
299
 
300
- const generateConversationSummary_ConfigPropertyNames = {
301
- displayName: 'generateConversationSummary',
302
- parameters: {
303
- required: ['conversationId'],
304
- optional: []
305
- }
306
- };
300
+ const adapterName$1 = 'generateConversationSummary';
301
+ const generateConversationSummary_ConfigPropertyMetadata = [
302
+ generateParamConfigMetadata('conversationId', true),
303
+ ];
304
+ const generateConversationSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateConversationSummary_ConfigPropertyMetadata);
307
305
  function createResourceParams$1(config) {
308
306
  const resourceParams = {
309
307
  urlParams: {
@@ -413,7 +411,7 @@ function normalize(input, existing, path, luvio, store, timestamp) {
413
411
  existing: existing,
414
412
  },
415
413
  ttl: path.ttl
416
- }, luvio, store);
414
+ }, luvio, store, timestamp);
417
415
  }
418
416
  return input;
419
417
  }
@@ -462,26 +460,8 @@ const ingest = function ConversationSummaryListRepresentationIngest(input, path,
462
460
  }
463
461
  }
464
462
  const key = keyBuilderFromType(luvio, input);
465
- const existingRecord = store.readEntry(key);
466
463
  const ttlToUse = TTL;
467
- let incomingRecord = normalize(input, store.readEntry(key), {
468
- fullPath: key,
469
- parent: path.parent,
470
- propertyName: path.propertyName,
471
- ttl: ttlToUse
472
- }, luvio, store);
473
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
474
- luvio.storePublish(key, incomingRecord);
475
- }
476
- {
477
- const storeMetadataParams = {
478
- ttl: ttlToUse,
479
- namespace: "eci",
480
- version: VERSION,
481
- representationName: RepresentationType,
482
- };
483
- luvio.publishStoreMetadata(key, storeMetadataParams);
484
- }
464
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "eci", VERSION, RepresentationType, equals);
485
465
  return createLink(key);
486
466
  };
487
467
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -559,13 +539,11 @@ function createResourceRequestFromRepresentation(representation) {
559
539
  return createResourceRequest(config);
560
540
  }
561
541
 
562
- const getConversationSummaryRelatedList_ConfigPropertyNames = {
563
- displayName: 'getConversationSummaryRelatedList',
564
- parameters: {
565
- required: ['id'],
566
- optional: []
567
- }
568
- };
542
+ const adapterName = 'getConversationSummaryRelatedList';
543
+ const getConversationSummaryRelatedList_ConfigPropertyMetadata = [
544
+ generateParamConfigMetadata('id', true),
545
+ ];
546
+ const getConversationSummaryRelatedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getConversationSummaryRelatedList_ConfigPropertyMetadata);
569
547
  function createResourceParams(config) {
570
548
  const resourceParams = {
571
549
  urlParams: {
@@ -631,21 +609,7 @@ function buildNetworkSnapshot(luvio, config, options) {
631
609
  });
632
610
  }
633
611
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
634
- const { luvio, config } = context;
635
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
636
- const dispatchOptions = {
637
- resourceRequestContext: {
638
- requestCorrelator,
639
- luvioRequestMethod: undefined,
640
- },
641
- eventObservers
642
- };
643
- if (networkPriority !== 'normal') {
644
- dispatchOptions.overrides = {
645
- priority: networkPriority
646
- };
647
- }
648
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
612
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
649
613
  }
650
614
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
651
615
  const { luvio, config } = context;
@@ -735,4 +699,4 @@ withDefaultLuvio((luvio) => {
735
699
  });
736
700
 
737
701
  export { generateConversationSummary, getConversationSummaryRelatedList, getConversationSummaryRelatedListNotifyChange, getConversationSummaryRelatedList_imperative };
738
- // version: 1.213.0-951602080
702
+ // version: 1.213.1-79de10fe1