@salesforce/lds-adapters-sales-eci 1.227.1 → 1.228.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sfdc/index.js CHANGED
@@ -14,10 +14,10 @@
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, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$2, typeCheckConfig as typeCheckConfig$2, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
- const { keys: ObjectKeys, create: ObjectCreate } = Object;
20
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
21
21
  const { isArray: ArrayIsArray$1 } = Array;
22
22
  /**
23
23
  * Validates an adapter config is well-formed.
@@ -41,7 +41,7 @@ function validateConfig(config, adapter, oneOf) {
41
41
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
42
  }
43
43
  const supported = required.concat(optional);
44
- if (ObjectKeys(config).some(key => !supported.includes(key))) {
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
45
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
46
  }
47
47
  }
@@ -81,6 +81,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
81
81
  }
82
82
  const keyPrefix = 'eci';
83
83
 
84
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
84
85
  const { isArray: ArrayIsArray } = Array;
85
86
  function equalsArray(a, b, equalsItem) {
86
87
  const aLength = a.length;
@@ -95,15 +96,34 @@ function equalsArray(a, b, equalsItem) {
95
96
  }
96
97
  return true;
97
98
  }
99
+ function equalsObject(a, b, equalsProp) {
100
+ const aKeys = ObjectKeys(a).sort();
101
+ const bKeys = ObjectKeys(b).sort();
102
+ const aKeysLength = aKeys.length;
103
+ const bKeysLength = bKeys.length;
104
+ if (aKeysLength !== bKeysLength) {
105
+ return false;
106
+ }
107
+ for (let i = 0; i < aKeys.length; i++) {
108
+ const key = aKeys[i];
109
+ if (key !== bKeys[i]) {
110
+ return false;
111
+ }
112
+ if (equalsProp(a[key], b[key]) === false) {
113
+ return false;
114
+ }
115
+ }
116
+ return true;
117
+ }
98
118
  function createLink(ref) {
99
119
  return {
100
120
  __ref: serializeStructuredKey(ref),
101
121
  };
102
122
  }
103
123
 
104
- const TTL$1 = 60000;
105
- const VERSION$1 = "10bf968dbd562928dfa701c7f6a854b2";
106
- function validate$1(obj, path = 'ConversationSummaryRepresentation') {
124
+ const TTL$2 = 60000;
125
+ const VERSION$2 = "10bf968dbd562928dfa701c7f6a854b2";
126
+ function validate$2(obj, path = 'ConversationSummaryRepresentation') {
107
127
  const v_error = (() => {
108
128
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
109
129
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -204,23 +224,23 @@ function validate$1(obj, path = 'ConversationSummaryRepresentation') {
204
224
  })();
205
225
  return v_error === undefined ? null : v_error;
206
226
  }
207
- const RepresentationType$1 = 'ConversationSummaryRepresentation';
208
- function keyBuilder$3(luvio, config) {
209
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.conversation_sumamry_id;
227
+ const RepresentationType$2 = 'ConversationSummaryRepresentation';
228
+ function keyBuilder$5(luvio, config) {
229
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.conversation_sumamry_id;
210
230
  }
211
231
  function keyBuilderFromType$1(luvio, object) {
212
232
  const keyParams = {
213
233
  conversation_sumamry_id: object.id
214
234
  };
215
- return keyBuilder$3(luvio, keyParams);
235
+ return keyBuilder$5(luvio, keyParams);
216
236
  }
217
- function normalize$1(input, existing, path, luvio, store, timestamp) {
237
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
218
238
  return input;
219
239
  }
220
- const select$3 = function ConversationSummaryRepresentationSelect() {
240
+ const select$5 = function ConversationSummaryRepresentationSelect() {
221
241
  return {
222
242
  kind: 'Fragment',
223
- version: VERSION$1,
243
+ version: VERSION$2,
224
244
  private: [],
225
245
  selections: [
226
246
  {
@@ -250,7 +270,7 @@ const select$3 = function ConversationSummaryRepresentationSelect() {
250
270
  ]
251
271
  };
252
272
  };
253
- function equals$1(existing, incoming) {
273
+ function equals$2(existing, incoming) {
254
274
  const existing_conversationRecordId = existing.conversationRecordId;
255
275
  const incoming_conversationRecordId = incoming.conversationRecordId;
256
276
  if (!(existing_conversationRecordId === incoming_conversationRecordId)) {
@@ -283,41 +303,41 @@ function equals$1(existing, incoming) {
283
303
  }
284
304
  return true;
285
305
  }
286
- const ingest$1 = function ConversationSummaryRepresentationIngest(input, path, luvio, store, timestamp) {
306
+ const ingest$2 = function ConversationSummaryRepresentationIngest(input, path, luvio, store, timestamp) {
287
307
  if (process.env.NODE_ENV !== 'production') {
288
- const validateError = validate$1(input);
308
+ const validateError = validate$2(input);
289
309
  if (validateError !== null) {
290
310
  throw validateError;
291
311
  }
292
312
  }
293
313
  const key = keyBuilderFromType$1(luvio, input);
294
- const ttlToUse = TTL$1;
295
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "eci", VERSION$1, RepresentationType$1, equals$1);
314
+ const ttlToUse = TTL$2;
315
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "eci", VERSION$2, RepresentationType$2, equals$2);
296
316
  return createLink(key);
297
317
  };
298
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
318
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
299
319
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
300
320
  const rootKey = keyBuilderFromType$1(luvio, input);
301
321
  rootKeySet.set(rootKey, {
302
322
  namespace: keyPrefix,
303
- representationName: RepresentationType$1,
323
+ representationName: RepresentationType$2,
304
324
  mergeable: false
305
325
  });
306
326
  }
307
327
 
308
- function select$2(luvio, params) {
309
- return select$3();
328
+ function select$4(luvio, params) {
329
+ return select$5();
310
330
  }
311
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
312
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
331
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
332
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
313
333
  }
314
- function ingestSuccess$1(luvio, resourceParams, response) {
334
+ function ingestSuccess$2(luvio, resourceParams, response) {
315
335
  const { body } = response;
316
336
  const key = keyBuilderFromType$1(luvio, body);
317
- luvio.storeIngest(key, ingest$1, body);
337
+ luvio.storeIngest(key, ingest$2, body);
318
338
  const snapshot = luvio.storeLookup({
319
339
  recordId: key,
320
- node: select$2(),
340
+ node: select$4(),
321
341
  variables: {},
322
342
  });
323
343
  if (process.env.NODE_ENV !== 'production') {
@@ -328,7 +348,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
328
348
  deepFreeze(snapshot.data);
329
349
  return snapshot;
330
350
  }
331
- function createResourceRequest$1(config) {
351
+ function createResourceRequest$2(config) {
332
352
  const headers = {};
333
353
  return {
334
354
  baseUri: '/services/data/v59.0',
@@ -342,41 +362,41 @@ function createResourceRequest$1(config) {
342
362
  };
343
363
  }
344
364
 
345
- const adapterName$1 = 'generateConversationSummary';
365
+ const adapterName$2 = 'generateConversationSummary';
346
366
  const generateConversationSummary_ConfigPropertyMetadata = [
347
367
  generateParamConfigMetadata('conversationId', true, 0 /* UrlParameter */, 0 /* String */),
348
368
  ];
349
- const generateConversationSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateConversationSummary_ConfigPropertyMetadata);
350
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(generateConversationSummary_ConfigPropertyMetadata);
351
- function typeCheckConfig$1(untrustedConfig) {
369
+ const generateConversationSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateConversationSummary_ConfigPropertyMetadata);
370
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(generateConversationSummary_ConfigPropertyMetadata);
371
+ function typeCheckConfig$2(untrustedConfig) {
352
372
  const config = {};
353
- typeCheckConfig$2(untrustedConfig, config, generateConversationSummary_ConfigPropertyMetadata);
373
+ typeCheckConfig$3(untrustedConfig, config, generateConversationSummary_ConfigPropertyMetadata);
354
374
  return config;
355
375
  }
356
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
376
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
357
377
  if (!untrustedIsObject(untrustedConfig)) {
358
378
  return null;
359
379
  }
360
380
  if (process.env.NODE_ENV !== 'production') {
361
381
  validateConfig(untrustedConfig, configPropertyNames);
362
382
  }
363
- const config = typeCheckConfig$1(untrustedConfig);
383
+ const config = typeCheckConfig$2(untrustedConfig);
364
384
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
365
385
  return null;
366
386
  }
367
387
  return config;
368
388
  }
369
- function buildNetworkSnapshot$1(luvio, config, options) {
370
- const resourceParams = createResourceParams$1(config);
371
- const request = createResourceRequest$1(resourceParams);
389
+ function buildNetworkSnapshot$2(luvio, config, options) {
390
+ const resourceParams = createResourceParams$2(config);
391
+ const request = createResourceRequest$2(resourceParams);
372
392
  return luvio.dispatchResourceRequest(request, options)
373
393
  .then((response) => {
374
394
  return luvio.handleSuccessResponse(() => {
375
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
395
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
376
396
  return luvio.storeBroadcast().then(() => snapshot);
377
397
  }, () => {
378
398
  const cache = new StoreKeyMap();
379
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
399
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
380
400
  return cache;
381
401
  });
382
402
  }, (response) => {
@@ -386,22 +406,34 @@ function buildNetworkSnapshot$1(luvio, config, options) {
386
406
  }
387
407
  const generateConversationSummaryAdapterFactory = (luvio) => {
388
408
  return function generateConversationSummary(untrustedConfig) {
389
- const config = validateAdapterConfig$1(untrustedConfig, generateConversationSummary_ConfigPropertyNames);
409
+ const config = validateAdapterConfig$2(untrustedConfig, generateConversationSummary_ConfigPropertyNames);
390
410
  // Invalid or incomplete config
391
411
  if (config === null) {
392
412
  throw new Error('Invalid config for "generateConversationSummary"');
393
413
  }
394
- return buildNetworkSnapshot$1(luvio, config);
414
+ return buildNetworkSnapshot$2(luvio, config);
395
415
  };
396
416
  };
397
417
 
398
- const TTL = 60000;
399
- const VERSION = "a9e3d8764d06757767b6c4311caa4e5c";
400
- function validate(obj, path = 'ConversationSummaryListRepresentation') {
418
+ const TTL$1 = 60000;
419
+ const VERSION$1 = "233fbc0cf53c7a50800a3e8b63d661be";
420
+ function validate$1(obj, path = 'ConversationSummaryListRepresentation') {
401
421
  const v_error = (() => {
402
422
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
403
423
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
404
424
  }
425
+ const obj_conversationIds = obj.conversationIds;
426
+ const path_conversationIds = path + '.conversationIds';
427
+ if (!ArrayIsArray(obj_conversationIds)) {
428
+ return new TypeError('Expected "array" but received "' + typeof obj_conversationIds + '" (at "' + path_conversationIds + '")');
429
+ }
430
+ for (let i = 0; i < obj_conversationIds.length; i++) {
431
+ const obj_conversationIds_item = obj_conversationIds[i];
432
+ const path_conversationIds_item = path_conversationIds + '[' + i + ']';
433
+ if (typeof obj_conversationIds_item !== 'string') {
434
+ return new TypeError('Expected "string" but received "' + typeof obj_conversationIds_item + '" (at "' + path_conversationIds_item + '")');
435
+ }
436
+ }
405
437
  const obj_conversationSummaryList = obj.conversationSummaryList;
406
438
  const path_conversationSummaryList = path + '.conversationSummaryList';
407
439
  if (!ArrayIsArray(obj_conversationSummaryList)) {
@@ -422,23 +454,23 @@ function validate(obj, path = 'ConversationSummaryListRepresentation') {
422
454
  })();
423
455
  return v_error === undefined ? null : v_error;
424
456
  }
425
- const RepresentationType = 'ConversationSummaryListRepresentation';
426
- function keyBuilder$2(luvio, config) {
427
- return keyPrefix + '::' + RepresentationType + ':' + config.id;
457
+ const RepresentationType$1 = 'ConversationSummaryListRepresentation';
458
+ function keyBuilder$4(luvio, config) {
459
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
428
460
  }
429
461
  function keyBuilderFromType(luvio, object) {
430
462
  const keyParams = {
431
463
  id: object.id
432
464
  };
433
- return keyBuilder$2(luvio, keyParams);
465
+ return keyBuilder$4(luvio, keyParams);
434
466
  }
435
- function normalize(input, existing, path, luvio, store, timestamp) {
467
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
436
468
  const input_conversationSummaryList = input.conversationSummaryList;
437
469
  const input_conversationSummaryList_id = path.fullPath + '__conversationSummaryList';
438
470
  for (let i = 0; i < input_conversationSummaryList.length; i++) {
439
471
  const input_conversationSummaryList_item = input_conversationSummaryList[i];
440
472
  let input_conversationSummaryList_item_id = input_conversationSummaryList_id + '__' + i;
441
- input_conversationSummaryList[i] = ingest$1(input_conversationSummaryList_item, {
473
+ input_conversationSummaryList[i] = ingest$2(input_conversationSummaryList_item, {
442
474
  fullPath: input_conversationSummaryList_item_id,
443
475
  propertyName: i,
444
476
  parent: {
@@ -451,17 +483,22 @@ function normalize(input, existing, path, luvio, store, timestamp) {
451
483
  }
452
484
  return input;
453
485
  }
454
- const select$1 = function ConversationSummaryListRepresentationSelect() {
486
+ const select$3 = function ConversationSummaryListRepresentationSelect() {
455
487
  return {
456
488
  kind: 'Fragment',
457
- version: VERSION,
489
+ version: VERSION$1,
458
490
  private: [],
459
491
  selections: [
492
+ {
493
+ name: 'conversationIds',
494
+ kind: 'Scalar',
495
+ plural: true
496
+ },
460
497
  {
461
498
  name: 'conversationSummaryList',
462
499
  kind: 'Link',
463
500
  plural: true,
464
- fragment: select$3()
501
+ fragment: select$5()
465
502
  },
466
503
  {
467
504
  name: 'id',
@@ -470,12 +507,22 @@ const select$1 = function ConversationSummaryListRepresentationSelect() {
470
507
  ]
471
508
  };
472
509
  };
473
- function equals(existing, incoming) {
510
+ function equals$1(existing, incoming) {
474
511
  const existing_id = existing.id;
475
512
  const incoming_id = incoming.id;
476
513
  if (!(existing_id === incoming_id)) {
477
514
  return false;
478
515
  }
516
+ const existing_conversationIds = existing.conversationIds;
517
+ const incoming_conversationIds = incoming.conversationIds;
518
+ const equals_conversationIds_items = equalsArray(existing_conversationIds, incoming_conversationIds, (existing_conversationIds_item, incoming_conversationIds_item) => {
519
+ if (!(existing_conversationIds_item === incoming_conversationIds_item)) {
520
+ return false;
521
+ }
522
+ });
523
+ if (equals_conversationIds_items === false) {
524
+ return false;
525
+ }
479
526
  const existing_conversationSummaryList = existing.conversationSummaryList;
480
527
  const incoming_conversationSummaryList = incoming.conversationSummaryList;
481
528
  const equals_conversationSummaryList_items = equalsArray(existing_conversationSummaryList, incoming_conversationSummaryList, (existing_conversationSummaryList_item, incoming_conversationSummaryList_item) => {
@@ -488,50 +535,50 @@ function equals(existing, incoming) {
488
535
  }
489
536
  return true;
490
537
  }
491
- const ingest = function ConversationSummaryListRepresentationIngest(input, path, luvio, store, timestamp) {
538
+ const ingest$1 = function ConversationSummaryListRepresentationIngest(input, path, luvio, store, timestamp) {
492
539
  if (process.env.NODE_ENV !== 'production') {
493
- const validateError = validate(input);
540
+ const validateError = validate$1(input);
494
541
  if (validateError !== null) {
495
542
  throw validateError;
496
543
  }
497
544
  }
498
545
  const key = keyBuilderFromType(luvio, input);
499
- const ttlToUse = TTL;
500
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "eci", VERSION, RepresentationType, equals);
546
+ const ttlToUse = TTL$1;
547
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "eci", VERSION$1, RepresentationType$1, equals$1);
501
548
  return createLink(key);
502
549
  };
503
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
550
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
504
551
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
505
552
  const rootKey = keyBuilderFromType(luvio, input);
506
553
  rootKeySet.set(rootKey, {
507
554
  namespace: keyPrefix,
508
- representationName: RepresentationType,
555
+ representationName: RepresentationType$1,
509
556
  mergeable: false
510
557
  });
511
558
  const input_conversationSummaryList_length = input.conversationSummaryList.length;
512
559
  for (let i = 0; i < input_conversationSummaryList_length; i++) {
513
- getTypeCacheKeys$1(rootKeySet, luvio, input.conversationSummaryList[i]);
560
+ getTypeCacheKeys$2(rootKeySet, luvio, input.conversationSummaryList[i]);
514
561
  }
515
562
  }
516
563
 
517
- function select(luvio, params) {
518
- return select$1();
564
+ function select$2(luvio, params) {
565
+ return select$3();
519
566
  }
520
- function keyBuilder$1(luvio, params) {
521
- return keyBuilder$2(luvio, {
567
+ function keyBuilder$3(luvio, params) {
568
+ return keyBuilder$4(luvio, {
522
569
  id: params.urlParams.id
523
570
  });
524
571
  }
525
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
526
- getTypeCacheKeys(storeKeyMap, luvio, response);
572
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
573
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
527
574
  }
528
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
575
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
529
576
  const { body } = response;
530
- const key = keyBuilder$1(luvio, resourceParams);
531
- luvio.storeIngest(key, ingest, body);
577
+ const key = keyBuilder$3(luvio, resourceParams);
578
+ luvio.storeIngest(key, ingest$1, body);
532
579
  const snapshot = luvio.storeLookup({
533
580
  recordId: key,
534
- node: select(),
581
+ node: select$2(),
535
582
  variables: {},
536
583
  }, snapshotRefresh);
537
584
  if (process.env.NODE_ENV !== 'production') {
@@ -542,19 +589,19 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
542
589
  deepFreeze(snapshot.data);
543
590
  return snapshot;
544
591
  }
545
- function ingestError(luvio, params, error, snapshotRefresh) {
546
- const key = keyBuilder$1(luvio, params);
592
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
593
+ const key = keyBuilder$3(luvio, params);
547
594
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
548
595
  const storeMetadataParams = {
549
- ttl: TTL,
596
+ ttl: TTL$1,
550
597
  namespace: keyPrefix,
551
- version: VERSION,
552
- representationName: RepresentationType
598
+ version: VERSION$1,
599
+ representationName: RepresentationType$1
553
600
  };
554
601
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
555
602
  return errorSnapshot;
556
603
  }
557
- function createResourceRequest(config) {
604
+ function createResourceRequest$1(config) {
558
605
  const headers = {};
559
606
  return {
560
607
  baseUri: '/services/data/v59.0',
@@ -572,97 +619,97 @@ function createResourceRequestFromRepresentation(representation) {
572
619
  urlParams: {},
573
620
  };
574
621
  config.urlParams.id = representation.id;
575
- return createResourceRequest(config);
622
+ return createResourceRequest$1(config);
576
623
  }
577
624
 
578
- const adapterName = 'getConversationSummaryRelatedList';
625
+ const adapterName$1 = 'getConversationSummaryRelatedList';
579
626
  const getConversationSummaryRelatedList_ConfigPropertyMetadata = [
580
627
  generateParamConfigMetadata('id', true, 0 /* UrlParameter */, 0 /* String */),
581
628
  ];
582
- const getConversationSummaryRelatedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getConversationSummaryRelatedList_ConfigPropertyMetadata);
583
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(getConversationSummaryRelatedList_ConfigPropertyMetadata);
584
- function keyBuilder(luvio, config) {
585
- const resourceParams = createResourceParams(config);
586
- return keyBuilder$1(luvio, resourceParams);
629
+ const getConversationSummaryRelatedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getConversationSummaryRelatedList_ConfigPropertyMetadata);
630
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getConversationSummaryRelatedList_ConfigPropertyMetadata);
631
+ function keyBuilder$2(luvio, config) {
632
+ const resourceParams = createResourceParams$1(config);
633
+ return keyBuilder$3(luvio, resourceParams);
587
634
  }
588
- function typeCheckConfig(untrustedConfig) {
635
+ function typeCheckConfig$1(untrustedConfig) {
589
636
  const config = {};
590
- typeCheckConfig$2(untrustedConfig, config, getConversationSummaryRelatedList_ConfigPropertyMetadata);
637
+ typeCheckConfig$3(untrustedConfig, config, getConversationSummaryRelatedList_ConfigPropertyMetadata);
591
638
  return config;
592
639
  }
593
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
640
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
594
641
  if (!untrustedIsObject(untrustedConfig)) {
595
642
  return null;
596
643
  }
597
644
  if (process.env.NODE_ENV !== 'production') {
598
645
  validateConfig(untrustedConfig, configPropertyNames);
599
646
  }
600
- const config = typeCheckConfig(untrustedConfig);
647
+ const config = typeCheckConfig$1(untrustedConfig);
601
648
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
602
649
  return null;
603
650
  }
604
651
  return config;
605
652
  }
606
- function adapterFragment(luvio, config) {
607
- createResourceParams(config);
608
- return select();
653
+ function adapterFragment$1(luvio, config) {
654
+ createResourceParams$1(config);
655
+ return select$2();
609
656
  }
610
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
611
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
657
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
658
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
612
659
  config,
613
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
660
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
614
661
  });
615
662
  return luvio.storeBroadcast().then(() => snapshot);
616
663
  }
617
- function onFetchResponseError(luvio, config, resourceParams, response) {
618
- const snapshot = ingestError(luvio, resourceParams, response, {
664
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
665
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
619
666
  config,
620
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
667
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
621
668
  });
622
669
  return luvio.storeBroadcast().then(() => snapshot);
623
670
  }
624
- function buildNetworkSnapshot(luvio, config, options) {
625
- const resourceParams = createResourceParams(config);
626
- const request = createResourceRequest(resourceParams);
671
+ function buildNetworkSnapshot$1(luvio, config, options) {
672
+ const resourceParams = createResourceParams$1(config);
673
+ const request = createResourceRequest$1(resourceParams);
627
674
  return luvio.dispatchResourceRequest(request, options)
628
675
  .then((response) => {
629
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
676
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
630
677
  const cache = new StoreKeyMap();
631
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
678
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
632
679
  return cache;
633
680
  });
634
681
  }, (response) => {
635
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
682
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
636
683
  });
637
684
  }
638
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
639
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
685
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
686
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
640
687
  }
641
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
688
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
642
689
  const { luvio, config } = context;
643
690
  const selector = {
644
- recordId: keyBuilder(luvio, config),
645
- node: adapterFragment(luvio, config),
691
+ recordId: keyBuilder$2(luvio, config),
692
+ node: adapterFragment$1(luvio, config),
646
693
  variables: {},
647
694
  };
648
695
  const cacheSnapshot = storeLookup(selector, {
649
696
  config,
650
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
697
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
651
698
  });
652
699
  return cacheSnapshot;
653
700
  }
654
701
  const getConversationSummaryRelatedListAdapterFactory = (luvio) => function eci__getConversationSummaryRelatedList(untrustedConfig, requestContext) {
655
- const config = validateAdapterConfig(untrustedConfig, getConversationSummaryRelatedList_ConfigPropertyNames);
702
+ const config = validateAdapterConfig$1(untrustedConfig, getConversationSummaryRelatedList_ConfigPropertyNames);
656
703
  // Invalid or incomplete config
657
704
  if (config === null) {
658
705
  return null;
659
706
  }
660
707
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
661
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
708
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
662
709
  };
663
710
  const notifyChangeFactory = (luvio, options) => {
664
711
  return function getConversationSummaryRelatedByIdNotifyChange(configs) {
665
- const keys = configs.map(c => keyBuilder$2(luvio, c));
712
+ const keys = configs.map(c => keyBuilder$4(luvio, c));
666
713
  luvio.getNotifyChangeStoreEntries(keys).then(entries => {
667
714
  for (let i = 0, len = entries.length; i < len; i++) {
668
715
  const { key, record: val } = entries[i];
@@ -671,21 +718,21 @@ const notifyChangeFactory = (luvio, options) => {
671
718
  .then((response) => {
672
719
  return luvio.handleSuccessResponse(() => {
673
720
  const { body } = response;
674
- luvio.storeIngest(key, ingest, body);
721
+ luvio.storeIngest(key, ingest$1, body);
675
722
  return luvio.storeBroadcast();
676
723
  }, () => {
677
724
  const cache = new StoreKeyMap();
678
- getTypeCacheKeys(cache, luvio, response.body);
725
+ getTypeCacheKeys$1(cache, luvio, response.body);
679
726
  return cache;
680
727
  });
681
728
  }, (error) => {
682
729
  return luvio.handleErrorResponse(() => {
683
730
  const errorSnapshot = luvio.errorSnapshot(error);
684
731
  luvio.storeIngestError(key, errorSnapshot, {
685
- ttl: TTL,
732
+ ttl: TTL$1,
686
733
  namespace: keyPrefix,
687
- version: VERSION,
688
- representationName: RepresentationType
734
+ version: VERSION$1,
735
+ representationName: RepresentationType$1
689
736
  });
690
737
  return luvio.storeBroadcast().then(() => errorSnapshot);
691
738
  });
@@ -695,15 +742,270 @@ const notifyChangeFactory = (luvio, options) => {
695
742
  };
696
743
  };
697
744
 
745
+ const TTL = 2592000000;
746
+ const VERSION = "b6caaeb6ce6369783e9b10315a598d75";
747
+ function validate(obj, path = 'ConversationTranscriptRepresentation') {
748
+ const v_error = (() => {
749
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
750
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
751
+ }
752
+ const obj_error = obj.error;
753
+ const path_error = path + '.error';
754
+ if (typeof obj_error !== 'object' || ArrayIsArray(obj_error) || obj_error === null) {
755
+ return new TypeError('Expected "object" but received "' + typeof obj_error + '" (at "' + path_error + '")');
756
+ }
757
+ const obj_error_keys = ObjectKeys(obj_error);
758
+ for (let i = 0; i < obj_error_keys.length; i++) {
759
+ const key = obj_error_keys[i];
760
+ const obj_error_prop = obj_error[key];
761
+ const path_error_prop = path_error + '["' + key + '"]';
762
+ if (typeof obj_error_prop !== 'string') {
763
+ return new TypeError('Expected "string" but received "' + typeof obj_error_prop + '" (at "' + path_error_prop + '")');
764
+ }
765
+ }
766
+ const obj_transcriptData = obj.transcriptData;
767
+ const path_transcriptData = path + '.transcriptData';
768
+ let obj_transcriptData_union0 = null;
769
+ const obj_transcriptData_union0_error = (() => {
770
+ if (typeof obj_transcriptData !== 'string') {
771
+ return new TypeError('Expected "string" but received "' + typeof obj_transcriptData + '" (at "' + path_transcriptData + '")');
772
+ }
773
+ })();
774
+ if (obj_transcriptData_union0_error != null) {
775
+ obj_transcriptData_union0 = obj_transcriptData_union0_error.message;
776
+ }
777
+ let obj_transcriptData_union1 = null;
778
+ const obj_transcriptData_union1_error = (() => {
779
+ if (obj_transcriptData !== null) {
780
+ return new TypeError('Expected "null" but received "' + typeof obj_transcriptData + '" (at "' + path_transcriptData + '")');
781
+ }
782
+ })();
783
+ if (obj_transcriptData_union1_error != null) {
784
+ obj_transcriptData_union1 = obj_transcriptData_union1_error.message;
785
+ }
786
+ if (obj_transcriptData_union0 && obj_transcriptData_union1) {
787
+ let message = 'Object doesn\'t match union (at "' + path_transcriptData + '")';
788
+ message += '\n' + obj_transcriptData_union0.split('\n').map((line) => '\t' + line).join('\n');
789
+ message += '\n' + obj_transcriptData_union1.split('\n').map((line) => '\t' + line).join('\n');
790
+ return new TypeError(message);
791
+ }
792
+ })();
793
+ return v_error === undefined ? null : v_error;
794
+ }
795
+ const RepresentationType = 'ConversationTranscriptRepresentation';
796
+ function normalize(input, existing, path, luvio, store, timestamp) {
797
+ return input;
798
+ }
799
+ const select$1 = function ConversationTranscriptRepresentationSelect() {
800
+ return {
801
+ kind: 'Fragment',
802
+ version: VERSION,
803
+ private: [],
804
+ selections: [
805
+ {
806
+ name: 'error',
807
+ kind: 'Scalar',
808
+ map: true
809
+ },
810
+ {
811
+ name: 'transcriptData',
812
+ kind: 'Scalar'
813
+ }
814
+ ]
815
+ };
816
+ };
817
+ function equals(existing, incoming) {
818
+ const existing_error = existing.error;
819
+ const incoming_error = incoming.error;
820
+ const equals_error_props = equalsObject(existing_error, incoming_error, (existing_error_prop, incoming_error_prop) => {
821
+ if (!(existing_error_prop === incoming_error_prop)) {
822
+ return false;
823
+ }
824
+ });
825
+ if (equals_error_props === false) {
826
+ return false;
827
+ }
828
+ const existing_transcriptData = existing.transcriptData;
829
+ const incoming_transcriptData = incoming.transcriptData;
830
+ if (!(existing_transcriptData === incoming_transcriptData)) {
831
+ return false;
832
+ }
833
+ return true;
834
+ }
835
+ const ingest = function ConversationTranscriptRepresentationIngest(input, path, luvio, store, timestamp) {
836
+ if (process.env.NODE_ENV !== 'production') {
837
+ const validateError = validate(input);
838
+ if (validateError !== null) {
839
+ throw validateError;
840
+ }
841
+ }
842
+ const key = path.fullPath;
843
+ const ttlToUse = TTL;
844
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "eci", VERSION, RepresentationType, equals);
845
+ return createLink(key);
846
+ };
847
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
848
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
849
+ const rootKey = fullPathFactory();
850
+ rootKeySet.set(rootKey, {
851
+ namespace: keyPrefix,
852
+ representationName: RepresentationType,
853
+ mergeable: false
854
+ });
855
+ }
856
+
857
+ function select(luvio, params) {
858
+ return select$1();
859
+ }
860
+ function keyBuilder$1(luvio, params) {
861
+ return keyPrefix + '::ConversationTranscriptRepresentation:(' + 'includeData:' + params.queryParams.includeData + ',' + 'sfdcCallIdOrRecordingId:' + params.urlParams.sfdcCallIdOrRecordingId + ')';
862
+ }
863
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
864
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
865
+ }
866
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
867
+ const { body } = response;
868
+ const key = keyBuilder$1(luvio, resourceParams);
869
+ luvio.storeIngest(key, ingest, body);
870
+ const snapshot = luvio.storeLookup({
871
+ recordId: key,
872
+ node: select(),
873
+ variables: {},
874
+ }, snapshotRefresh);
875
+ if (process.env.NODE_ENV !== 'production') {
876
+ if (snapshot.state !== 'Fulfilled') {
877
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
878
+ }
879
+ }
880
+ deepFreeze(snapshot.data);
881
+ return snapshot;
882
+ }
883
+ function ingestError(luvio, params, error, snapshotRefresh) {
884
+ const key = keyBuilder$1(luvio, params);
885
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
886
+ const storeMetadataParams = {
887
+ ttl: TTL,
888
+ namespace: keyPrefix,
889
+ version: VERSION,
890
+ representationName: RepresentationType
891
+ };
892
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
893
+ return errorSnapshot;
894
+ }
895
+ function createResourceRequest(config) {
896
+ const headers = {};
897
+ return {
898
+ baseUri: '/services/data/v59.0',
899
+ basePath: '/conversation/transcript/' + config.urlParams.sfdcCallIdOrRecordingId + '',
900
+ method: 'get',
901
+ body: null,
902
+ urlParams: config.urlParams,
903
+ queryParams: config.queryParams,
904
+ headers,
905
+ priority: 'normal',
906
+ };
907
+ }
908
+
909
+ const adapterName = 'getTranscript';
910
+ const getTranscript_ConfigPropertyMetadata = [
911
+ generateParamConfigMetadata('sfdcCallIdOrRecordingId', true, 0 /* UrlParameter */, 0 /* String */),
912
+ generateParamConfigMetadata('includeData', false, 1 /* QueryParameter */, 1 /* Boolean */),
913
+ ];
914
+ const getTranscript_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getTranscript_ConfigPropertyMetadata);
915
+ const createResourceParams = /*#__PURE__*/ createResourceParams$3(getTranscript_ConfigPropertyMetadata);
916
+ function keyBuilder(luvio, config) {
917
+ const resourceParams = createResourceParams(config);
918
+ return keyBuilder$1(luvio, resourceParams);
919
+ }
920
+ function typeCheckConfig(untrustedConfig) {
921
+ const config = {};
922
+ typeCheckConfig$3(untrustedConfig, config, getTranscript_ConfigPropertyMetadata);
923
+ return config;
924
+ }
925
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
926
+ if (!untrustedIsObject(untrustedConfig)) {
927
+ return null;
928
+ }
929
+ if (process.env.NODE_ENV !== 'production') {
930
+ validateConfig(untrustedConfig, configPropertyNames);
931
+ }
932
+ const config = typeCheckConfig(untrustedConfig);
933
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
934
+ return null;
935
+ }
936
+ return config;
937
+ }
938
+ function adapterFragment(luvio, config) {
939
+ createResourceParams(config);
940
+ return select();
941
+ }
942
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
943
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
944
+ config,
945
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
946
+ });
947
+ return luvio.storeBroadcast().then(() => snapshot);
948
+ }
949
+ function onFetchResponseError(luvio, config, resourceParams, response) {
950
+ const snapshot = ingestError(luvio, resourceParams, response, {
951
+ config,
952
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
953
+ });
954
+ return luvio.storeBroadcast().then(() => snapshot);
955
+ }
956
+ function buildNetworkSnapshot(luvio, config, options) {
957
+ const resourceParams = createResourceParams(config);
958
+ const request = createResourceRequest(resourceParams);
959
+ return luvio.dispatchResourceRequest(request, options)
960
+ .then((response) => {
961
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
962
+ const cache = new StoreKeyMap();
963
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
964
+ return cache;
965
+ });
966
+ }, (response) => {
967
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
968
+ });
969
+ }
970
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
971
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
972
+ }
973
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
974
+ const { luvio, config } = context;
975
+ const selector = {
976
+ recordId: keyBuilder(luvio, config),
977
+ node: adapterFragment(luvio, config),
978
+ variables: {},
979
+ };
980
+ const cacheSnapshot = storeLookup(selector, {
981
+ config,
982
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
983
+ });
984
+ return cacheSnapshot;
985
+ }
986
+ const getTranscriptAdapterFactory = (luvio) => function eci__getTranscript(untrustedConfig, requestContext) {
987
+ const config = validateAdapterConfig(untrustedConfig, getTranscript_ConfigPropertyNames);
988
+ // Invalid or incomplete config
989
+ if (config === null) {
990
+ return null;
991
+ }
992
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
993
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
994
+ };
995
+
698
996
  let generateConversationSummary;
699
997
  let getConversationSummaryRelatedList;
700
998
  let getConversationSummaryRelatedListNotifyChange;
999
+ let getTranscript;
701
1000
  // Imperative GET Adapters
702
1001
  let getConversationSummaryRelatedList_imperative;
1002
+ let getTranscript_imperative;
703
1003
  const getConversationSummaryRelatedListMetadata = { apiFamily: 'eci', name: 'getConversationSummaryRelatedList', ttl: 60000 };
1004
+ const getTranscriptMetadata = { apiFamily: 'eci', name: 'getTranscript', ttl: 2592000000 };
704
1005
  function bindExportsTo(luvio) {
705
1006
  // LDS Adapters
706
1007
  const getConversationSummaryRelatedList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getConversationSummaryRelatedList', getConversationSummaryRelatedListAdapterFactory), getConversationSummaryRelatedListMetadata);
1008
+ const getTranscript_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getTranscript', getTranscriptAdapterFactory), getTranscriptMetadata);
707
1009
  function unwrapSnapshotData(factory) {
708
1010
  const adapter = factory(luvio);
709
1011
  return (config) => adapter(config).then(snapshot => snapshot.data);
@@ -712,8 +1014,10 @@ function bindExportsTo(luvio) {
712
1014
  generateConversationSummary: unwrapSnapshotData(generateConversationSummaryAdapterFactory),
713
1015
  getConversationSummaryRelatedList: createWireAdapterConstructor(luvio, getConversationSummaryRelatedList_ldsAdapter, getConversationSummaryRelatedListMetadata),
714
1016
  getConversationSummaryRelatedListNotifyChange: createLDSAdapter(luvio, 'getConversationSummaryRelatedListNotifyChange', notifyChangeFactory),
1017
+ getTranscript: createWireAdapterConstructor(luvio, getTranscript_ldsAdapter, getTranscriptMetadata),
715
1018
  // Imperative GET Adapters
716
- getConversationSummaryRelatedList_imperative: createImperativeAdapter(luvio, getConversationSummaryRelatedList_ldsAdapter, getConversationSummaryRelatedListMetadata)
1019
+ getConversationSummaryRelatedList_imperative: createImperativeAdapter(luvio, getConversationSummaryRelatedList_ldsAdapter, getConversationSummaryRelatedListMetadata),
1020
+ getTranscript_imperative: createImperativeAdapter(luvio, getTranscript_ldsAdapter, getTranscriptMetadata)
717
1021
  };
718
1022
  }
719
1023
  withDefaultLuvio((luvio) => {
@@ -721,9 +1025,11 @@ withDefaultLuvio((luvio) => {
721
1025
  generateConversationSummary,
722
1026
  getConversationSummaryRelatedList,
723
1027
  getConversationSummaryRelatedListNotifyChange,
724
- getConversationSummaryRelatedList_imperative
1028
+ getTranscript,
1029
+ getConversationSummaryRelatedList_imperative,
1030
+ getTranscript_imperative
725
1031
  } = bindExportsTo(luvio));
726
1032
  });
727
1033
 
728
- export { generateConversationSummary, getConversationSummaryRelatedList, getConversationSummaryRelatedListNotifyChange, getConversationSummaryRelatedList_imperative };
729
- // version: 1.227.1-a3108f583
1034
+ export { generateConversationSummary, getConversationSummaryRelatedList, getConversationSummaryRelatedListNotifyChange, getConversationSummaryRelatedList_imperative, getTranscript, getTranscript_imperative };
1035
+ // version: 1.228.0-946298e9a