@salesforce/lds-adapters-cms-authoring 1.154.0 → 1.156.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.
@@ -59,7 +59,7 @@ function createLink(ref) {
59
59
  };
60
60
  }
61
61
 
62
- function validate$D(obj, path = 'ManagedContentDeploymentInputRepresentation') {
62
+ function validate$F(obj, path = 'ManagedContentDeploymentInputRepresentation') {
63
63
  const v_error = (() => {
64
64
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
65
65
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -143,7 +143,7 @@ function validate$D(obj, path = 'ManagedContentDeploymentInputRepresentation') {
143
143
  return v_error === undefined ? null : v_error;
144
144
  }
145
145
 
146
- function validate$C(obj, path = 'ManagedContentDeploymentItemRepresentation') {
146
+ function validate$E(obj, path = 'ManagedContentDeploymentItemRepresentation') {
147
147
  const v_error = (() => {
148
148
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
149
149
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -198,9 +198,9 @@ function validate$C(obj, path = 'ManagedContentDeploymentItemRepresentation') {
198
198
  return v_error === undefined ? null : v_error;
199
199
  }
200
200
 
201
- const TTL$f = 1000;
202
- const VERSION$f = "ca653daea9600118e6167b9b4ff4d07c";
203
- function validate$B(obj, path = 'ManagedContentDeploymentRepresentation') {
201
+ const TTL$g = 1000;
202
+ const VERSION$g = "ca653daea9600118e6167b9b4ff4d07c";
203
+ function validate$D(obj, path = 'ManagedContentDeploymentRepresentation') {
204
204
  const v_error = (() => {
205
205
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
206
206
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -270,7 +270,7 @@ function validate$B(obj, path = 'ManagedContentDeploymentRepresentation') {
270
270
  for (let i = 0; i < obj_deploymentItems.length; i++) {
271
271
  const obj_deploymentItems_item = obj_deploymentItems[i];
272
272
  const path_deploymentItems_item = path_deploymentItems + '[' + i + ']';
273
- const referencepath_deploymentItems_itemValidationError = validate$C(obj_deploymentItems_item, path_deploymentItems_item);
273
+ const referencepath_deploymentItems_itemValidationError = validate$E(obj_deploymentItems_item, path_deploymentItems_item);
274
274
  if (referencepath_deploymentItems_itemValidationError !== null) {
275
275
  let message = 'Object doesn\'t match ManagedContentDeploymentItemRepresentation (at "' + path_deploymentItems_item + '")\n';
276
276
  message += referencepath_deploymentItems_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -384,88 +384,88 @@ function validate$B(obj, path = 'ManagedContentDeploymentRepresentation') {
384
384
  })();
385
385
  return v_error === undefined ? null : v_error;
386
386
  }
387
- const RepresentationType$f = 'ManagedContentDeploymentRepresentation';
388
- function keyBuilder$w(luvio, config) {
389
- return keyPrefix + '::' + RepresentationType$f + ':' + config.id;
387
+ const RepresentationType$g = 'ManagedContentDeploymentRepresentation';
388
+ function keyBuilder$y(luvio, config) {
389
+ return keyPrefix + '::' + RepresentationType$g + ':' + config.id;
390
390
  }
391
391
  function keyBuilderFromType$9(luvio, object) {
392
392
  const keyParams = {
393
393
  id: object.deploymentId
394
394
  };
395
- return keyBuilder$w(luvio, keyParams);
395
+ return keyBuilder$y(luvio, keyParams);
396
396
  }
397
- function normalize$f(input, existing, path, luvio, store, timestamp) {
397
+ function normalize$g(input, existing, path, luvio, store, timestamp) {
398
398
  return input;
399
399
  }
400
- const select$A = function ManagedContentDeploymentRepresentationSelect() {
400
+ const select$C = function ManagedContentDeploymentRepresentationSelect() {
401
401
  return {
402
402
  kind: 'Fragment',
403
- version: VERSION$f,
403
+ version: VERSION$g,
404
404
  private: [],
405
405
  opaque: true
406
406
  };
407
407
  };
408
- function equals$f(existing, incoming) {
408
+ function equals$g(existing, incoming) {
409
409
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
410
410
  return false;
411
411
  }
412
412
  return true;
413
413
  }
414
- const ingest$f = function ManagedContentDeploymentRepresentationIngest(input, path, luvio, store, timestamp) {
414
+ const ingest$g = function ManagedContentDeploymentRepresentationIngest(input, path, luvio, store, timestamp) {
415
415
  if (process.env.NODE_ENV !== 'production') {
416
- const validateError = validate$B(input);
416
+ const validateError = validate$D(input);
417
417
  if (validateError !== null) {
418
418
  throw validateError;
419
419
  }
420
420
  }
421
421
  const key = keyBuilderFromType$9(luvio, input);
422
422
  const existingRecord = store.readEntry(key);
423
- const ttlToUse = TTL$f;
424
- let incomingRecord = normalize$f(input, store.readEntry(key), {
423
+ const ttlToUse = TTL$g;
424
+ let incomingRecord = normalize$g(input, store.readEntry(key), {
425
425
  fullPath: key,
426
426
  parent: path.parent,
427
427
  propertyName: path.propertyName,
428
428
  ttl: ttlToUse
429
429
  });
430
- if (existingRecord === undefined || equals$f(existingRecord, incomingRecord) === false) {
430
+ if (existingRecord === undefined || equals$g(existingRecord, incomingRecord) === false) {
431
431
  luvio.storePublish(key, incomingRecord);
432
432
  }
433
433
  {
434
434
  const storeMetadataParams = {
435
435
  ttl: ttlToUse,
436
436
  namespace: "CMSAuthoring",
437
- version: VERSION$f,
438
- representationName: RepresentationType$f,
437
+ version: VERSION$g,
438
+ representationName: RepresentationType$g,
439
439
  };
440
440
  luvio.publishStoreMetadata(key, storeMetadataParams);
441
441
  }
442
442
  return createLink(key);
443
443
  };
444
- function getTypeCacheKeys$f(luvio, input, fullPathFactory) {
444
+ function getTypeCacheKeys$g(luvio, input, fullPathFactory) {
445
445
  const rootKeySet = new StoreKeyMap();
446
446
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
447
447
  const rootKey = keyBuilderFromType$9(luvio, input);
448
448
  rootKeySet.set(rootKey, {
449
449
  namespace: keyPrefix,
450
- representationName: RepresentationType$f,
450
+ representationName: RepresentationType$g,
451
451
  mergeable: false
452
452
  });
453
453
  return rootKeySet;
454
454
  }
455
455
 
456
- function select$z(luvio, params) {
457
- return select$A();
456
+ function select$B(luvio, params) {
457
+ return select$C();
458
458
  }
459
- function getResponseCacheKeys$l(luvio, resourceParams, response) {
460
- return getTypeCacheKeys$f(luvio, response);
459
+ function getResponseCacheKeys$m(luvio, resourceParams, response) {
460
+ return getTypeCacheKeys$g(luvio, response);
461
461
  }
462
- function ingestSuccess$l(luvio, resourceParams, response) {
462
+ function ingestSuccess$m(luvio, resourceParams, response) {
463
463
  const { body } = response;
464
464
  const key = keyBuilderFromType$9(luvio, body);
465
- luvio.storeIngest(key, ingest$f, body);
465
+ luvio.storeIngest(key, ingest$g, body);
466
466
  const snapshot = luvio.storeLookup({
467
467
  recordId: key,
468
- node: select$z(),
468
+ node: select$B(),
469
469
  variables: {},
470
470
  });
471
471
  if (process.env.NODE_ENV !== 'production') {
@@ -476,7 +476,7 @@ function ingestSuccess$l(luvio, resourceParams, response) {
476
476
  deepFreeze(snapshot.data);
477
477
  return snapshot;
478
478
  }
479
- function createResourceRequest$l(config) {
479
+ function createResourceRequest$m(config) {
480
480
  const headers = {};
481
481
  return {
482
482
  baseUri: '/services/data/v59.0',
@@ -497,7 +497,7 @@ const createDeployment_ConfigPropertyNames = {
497
497
  optional: []
498
498
  }
499
499
  };
500
- function createResourceParams$l(config) {
500
+ function createResourceParams$m(config) {
501
501
  const resourceParams = {
502
502
  body: {
503
503
  DeploymentInput: config.DeploymentInput
@@ -505,37 +505,37 @@ function createResourceParams$l(config) {
505
505
  };
506
506
  return resourceParams;
507
507
  }
508
- function typeCheckConfig$l(untrustedConfig) {
508
+ function typeCheckConfig$m(untrustedConfig) {
509
509
  const config = {};
510
510
  const untrustedConfig_DeploymentInput = untrustedConfig.DeploymentInput;
511
- const referenceManagedContentDeploymentInputRepresentationValidationError = validate$D(untrustedConfig_DeploymentInput);
511
+ const referenceManagedContentDeploymentInputRepresentationValidationError = validate$F(untrustedConfig_DeploymentInput);
512
512
  if (referenceManagedContentDeploymentInputRepresentationValidationError === null) {
513
513
  config.DeploymentInput = untrustedConfig_DeploymentInput;
514
514
  }
515
515
  return config;
516
516
  }
517
- function validateAdapterConfig$l(untrustedConfig, configPropertyNames) {
517
+ function validateAdapterConfig$m(untrustedConfig, configPropertyNames) {
518
518
  if (!untrustedIsObject(untrustedConfig)) {
519
519
  return null;
520
520
  }
521
521
  if (process.env.NODE_ENV !== 'production') {
522
522
  validateConfig(untrustedConfig, configPropertyNames);
523
523
  }
524
- const config = typeCheckConfig$l(untrustedConfig);
524
+ const config = typeCheckConfig$m(untrustedConfig);
525
525
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
526
526
  return null;
527
527
  }
528
528
  return config;
529
529
  }
530
- function buildNetworkSnapshot$l(luvio, config, options) {
531
- const resourceParams = createResourceParams$l(config);
532
- const request = createResourceRequest$l(resourceParams);
530
+ function buildNetworkSnapshot$m(luvio, config, options) {
531
+ const resourceParams = createResourceParams$m(config);
532
+ const request = createResourceRequest$m(resourceParams);
533
533
  return luvio.dispatchResourceRequest(request, options)
534
534
  .then((response) => {
535
535
  return luvio.handleSuccessResponse(() => {
536
- const snapshot = ingestSuccess$l(luvio, resourceParams, response);
536
+ const snapshot = ingestSuccess$m(luvio, resourceParams, response);
537
537
  return luvio.storeBroadcast().then(() => snapshot);
538
- }, () => getResponseCacheKeys$l(luvio, resourceParams, response.body));
538
+ }, () => getResponseCacheKeys$m(luvio, resourceParams, response.body));
539
539
  }, (response) => {
540
540
  deepFreeze(response);
541
541
  throw response;
@@ -543,14 +543,407 @@ function buildNetworkSnapshot$l(luvio, config, options) {
543
543
  }
544
544
  const createDeploymentAdapterFactory = (luvio) => {
545
545
  return function createDeployment(untrustedConfig) {
546
- const config = validateAdapterConfig$l(untrustedConfig, createDeployment_ConfigPropertyNames);
546
+ const config = validateAdapterConfig$m(untrustedConfig, createDeployment_ConfigPropertyNames);
547
547
  // Invalid or incomplete config
548
548
  if (config === null) {
549
549
  throw new Error('Invalid config for "createDeployment"');
550
550
  }
551
- return buildNetworkSnapshot$l(luvio, config);
551
+ return buildNetworkSnapshot$m(luvio, config);
552
+ };
553
+ };
554
+
555
+ function validate$C(obj, path = 'ManagedContentSpaceFolderItemV1Representation') {
556
+ const v_error = (() => {
557
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
558
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
559
+ }
560
+ if (obj.contentKey !== undefined) {
561
+ const obj_contentKey = obj.contentKey;
562
+ const path_contentKey = path + '.contentKey';
563
+ if (typeof obj_contentKey !== 'string') {
564
+ return new TypeError('Expected "string" but received "' + typeof obj_contentKey + '" (at "' + path_contentKey + '")');
565
+ }
566
+ }
567
+ const obj_createdBy = obj.createdBy;
568
+ const path_createdBy = path + '.createdBy';
569
+ if (typeof obj_createdBy !== 'string') {
570
+ return new TypeError('Expected "string" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
571
+ }
572
+ const obj_createdDate = obj.createdDate;
573
+ const path_createdDate = path + '.createdDate';
574
+ if (typeof obj_createdDate !== 'string') {
575
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
576
+ }
577
+ if (obj.hasChildFolders !== undefined) {
578
+ const obj_hasChildFolders = obj.hasChildFolders;
579
+ const path_hasChildFolders = path + '.hasChildFolders';
580
+ if (typeof obj_hasChildFolders !== 'boolean') {
581
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasChildFolders + '" (at "' + path_hasChildFolders + '")');
582
+ }
583
+ }
584
+ if (obj.id !== undefined) {
585
+ const obj_id = obj.id;
586
+ const path_id = path + '.id';
587
+ if (typeof obj_id !== 'string') {
588
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
589
+ }
590
+ }
591
+ const obj_isFolder = obj.isFolder;
592
+ const path_isFolder = path + '.isFolder';
593
+ if (typeof obj_isFolder !== 'boolean') {
594
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isFolder + '" (at "' + path_isFolder + '")');
595
+ }
596
+ const obj_lastModifiedBy = obj.lastModifiedBy;
597
+ const path_lastModifiedBy = path + '.lastModifiedBy';
598
+ if (typeof obj_lastModifiedBy !== 'string') {
599
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedBy + '" (at "' + path_lastModifiedBy + '")');
600
+ }
601
+ const obj_lastModifiedDate = obj.lastModifiedDate;
602
+ const path_lastModifiedDate = path + '.lastModifiedDate';
603
+ if (typeof obj_lastModifiedDate !== 'string') {
604
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
605
+ }
606
+ if (obj.managedContentType !== undefined) {
607
+ const obj_managedContentType = obj.managedContentType;
608
+ const path_managedContentType = path + '.managedContentType';
609
+ if (typeof obj_managedContentType !== 'string') {
610
+ return new TypeError('Expected "string" but received "' + typeof obj_managedContentType + '" (at "' + path_managedContentType + '")');
611
+ }
612
+ }
613
+ if (obj.managedContentVersionId !== undefined) {
614
+ const obj_managedContentVersionId = obj.managedContentVersionId;
615
+ const path_managedContentVersionId = path + '.managedContentVersionId';
616
+ if (typeof obj_managedContentVersionId !== 'string') {
617
+ return new TypeError('Expected "string" but received "' + typeof obj_managedContentVersionId + '" (at "' + path_managedContentVersionId + '")');
618
+ }
619
+ }
620
+ if (obj.publishedDate !== undefined) {
621
+ const obj_publishedDate = obj.publishedDate;
622
+ const path_publishedDate = path + '.publishedDate';
623
+ if (typeof obj_publishedDate !== 'string') {
624
+ return new TypeError('Expected "string" but received "' + typeof obj_publishedDate + '" (at "' + path_publishedDate + '")');
625
+ }
626
+ }
627
+ if (obj.status !== undefined) {
628
+ const obj_status = obj.status;
629
+ const path_status = path + '.status';
630
+ if (typeof obj_status !== 'string') {
631
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
632
+ }
633
+ }
634
+ const obj_title = obj.title;
635
+ const path_title = path + '.title';
636
+ if (typeof obj_title !== 'string') {
637
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
638
+ }
639
+ })();
640
+ return v_error === undefined ? null : v_error;
641
+ }
642
+
643
+ const TTL$f = 100;
644
+ const VERSION$f = "65ec3c1fc4ab506ab3c620f99afb6d88";
645
+ function validate$B(obj, path = 'ManagedContentSpaceFolderItemV1CollectionRepresentation') {
646
+ const v_error = (() => {
647
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
648
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
649
+ }
650
+ const obj_folderId = obj.folderId;
651
+ const path_folderId = path + '.folderId';
652
+ if (typeof obj_folderId !== 'string') {
653
+ return new TypeError('Expected "string" but received "' + typeof obj_folderId + '" (at "' + path_folderId + '")');
654
+ }
655
+ const obj_folderItems = obj.folderItems;
656
+ const path_folderItems = path + '.folderItems';
657
+ if (!ArrayIsArray(obj_folderItems)) {
658
+ return new TypeError('Expected "array" but received "' + typeof obj_folderItems + '" (at "' + path_folderItems + '")');
659
+ }
660
+ for (let i = 0; i < obj_folderItems.length; i++) {
661
+ const obj_folderItems_item = obj_folderItems[i];
662
+ const path_folderItems_item = path_folderItems + '[' + i + ']';
663
+ const referencepath_folderItems_itemValidationError = validate$C(obj_folderItems_item, path_folderItems_item);
664
+ if (referencepath_folderItems_itemValidationError !== null) {
665
+ let message = 'Object doesn\'t match ManagedContentSpaceFolderItemV1Representation (at "' + path_folderItems_item + '")\n';
666
+ message += referencepath_folderItems_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
667
+ return new TypeError(message);
668
+ }
669
+ }
670
+ const obj_parentFolderId = obj.parentFolderId;
671
+ const path_parentFolderId = path + '.parentFolderId';
672
+ if (typeof obj_parentFolderId !== 'string') {
673
+ return new TypeError('Expected "string" but received "' + typeof obj_parentFolderId + '" (at "' + path_parentFolderId + '")');
674
+ }
675
+ })();
676
+ return v_error === undefined ? null : v_error;
677
+ }
678
+ const RepresentationType$f = 'ManagedContentSpaceFolderItemV1CollectionRepresentation';
679
+ function normalize$f(input, existing, path, luvio, store, timestamp) {
680
+ return input;
681
+ }
682
+ const select$A = function ManagedContentSpaceFolderItemV1CollectionRepresentationSelect() {
683
+ return {
684
+ kind: 'Fragment',
685
+ version: VERSION$f,
686
+ private: [],
687
+ opaque: true
552
688
  };
553
689
  };
690
+ function equals$f(existing, incoming) {
691
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
692
+ return false;
693
+ }
694
+ return true;
695
+ }
696
+ const ingest$f = function ManagedContentSpaceFolderItemV1CollectionRepresentationIngest(input, path, luvio, store, timestamp) {
697
+ if (process.env.NODE_ENV !== 'production') {
698
+ const validateError = validate$B(input);
699
+ if (validateError !== null) {
700
+ throw validateError;
701
+ }
702
+ }
703
+ const key = path.fullPath;
704
+ const existingRecord = store.readEntry(key);
705
+ const ttlToUse = TTL$f;
706
+ let incomingRecord = normalize$f(input, store.readEntry(key), {
707
+ fullPath: key,
708
+ parent: path.parent,
709
+ propertyName: path.propertyName,
710
+ ttl: ttlToUse
711
+ });
712
+ if (existingRecord === undefined || equals$f(existingRecord, incomingRecord) === false) {
713
+ luvio.storePublish(key, incomingRecord);
714
+ }
715
+ {
716
+ const storeMetadataParams = {
717
+ ttl: ttlToUse,
718
+ namespace: "CMSAuthoring",
719
+ version: VERSION$f,
720
+ representationName: RepresentationType$f,
721
+ };
722
+ luvio.publishStoreMetadata(key, storeMetadataParams);
723
+ }
724
+ return createLink(key);
725
+ };
726
+ function getTypeCacheKeys$f(luvio, input, fullPathFactory) {
727
+ const rootKeySet = new StoreKeyMap();
728
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
729
+ const rootKey = fullPathFactory();
730
+ rootKeySet.set(rootKey, {
731
+ namespace: keyPrefix,
732
+ representationName: RepresentationType$f,
733
+ mergeable: false
734
+ });
735
+ return rootKeySet;
736
+ }
737
+
738
+ function select$z(luvio, params) {
739
+ return select$A();
740
+ }
741
+ function keyBuilder$x(luvio, params) {
742
+ return keyPrefix + '::ManagedContentSpaceFolderItemV1CollectionRepresentation:(' + 'contentTypeFilter:' + params.queryParams.contentTypeFilter + ',' + 'contentTypes:' + params.queryParams.contentTypes + ',' + 'filter:' + params.queryParams.filter + ',' + 'managedContentType:' + params.queryParams.managedContentType + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'queryTerm:' + params.queryParams.queryTerm + ',' + 'showPublishedOnly:' + params.queryParams.showPublishedOnly + ',' + 'sortBy:' + params.queryParams.sortBy + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'folderId:' + params.urlParams.folderId + ')';
743
+ }
744
+ function getResponseCacheKeys$l(luvio, resourceParams, response) {
745
+ return getTypeCacheKeys$f(luvio, response, () => keyBuilder$x(luvio, resourceParams));
746
+ }
747
+ function ingestSuccess$l(luvio, resourceParams, response, snapshotRefresh) {
748
+ const { body } = response;
749
+ const key = keyBuilder$x(luvio, resourceParams);
750
+ luvio.storeIngest(key, ingest$f, body);
751
+ const snapshot = luvio.storeLookup({
752
+ recordId: key,
753
+ node: select$z(),
754
+ variables: {},
755
+ }, snapshotRefresh);
756
+ if (process.env.NODE_ENV !== 'production') {
757
+ if (snapshot.state !== 'Fulfilled') {
758
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
759
+ }
760
+ }
761
+ deepFreeze(snapshot.data);
762
+ return snapshot;
763
+ }
764
+ function ingestError$b(luvio, params, error, snapshotRefresh) {
765
+ const key = keyBuilder$x(luvio, params);
766
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
767
+ const storeMetadataParams = {
768
+ ttl: TTL$f,
769
+ namespace: keyPrefix,
770
+ version: VERSION$f,
771
+ representationName: RepresentationType$f
772
+ };
773
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
774
+ return errorSnapshot;
775
+ }
776
+ function createResourceRequest$l(config) {
777
+ const headers = {};
778
+ return {
779
+ baseUri: '/services/data/v59.0',
780
+ basePath: '/cms/folders/' + config.urlParams.folderId + '/items',
781
+ method: 'get',
782
+ body: null,
783
+ urlParams: config.urlParams,
784
+ queryParams: config.queryParams,
785
+ headers,
786
+ priority: 'normal',
787
+ };
788
+ }
789
+
790
+ const getManagedContentSpaceFolderItemsV1_ConfigPropertyNames = {
791
+ displayName: 'getManagedContentSpaceFolderItemsV1',
792
+ parameters: {
793
+ required: ['folderId'],
794
+ optional: ['contentTypeFilter', 'contentTypes', 'filter', 'managedContentType', 'page', 'pageSize', 'queryTerm', 'showPublishedOnly', 'sortBy', 'sortOrder']
795
+ }
796
+ };
797
+ function createResourceParams$l(config) {
798
+ const resourceParams = {
799
+ urlParams: {
800
+ folderId: config.folderId
801
+ },
802
+ queryParams: {
803
+ contentTypeFilter: config.contentTypeFilter, contentTypes: config.contentTypes, filter: config.filter, managedContentType: config.managedContentType, page: config.page, pageSize: config.pageSize, queryTerm: config.queryTerm, showPublishedOnly: config.showPublishedOnly, sortBy: config.sortBy, sortOrder: config.sortOrder
804
+ }
805
+ };
806
+ return resourceParams;
807
+ }
808
+ function keyBuilder$w(luvio, config) {
809
+ const resourceParams = createResourceParams$l(config);
810
+ return keyBuilder$x(luvio, resourceParams);
811
+ }
812
+ function typeCheckConfig$l(untrustedConfig) {
813
+ const config = {};
814
+ const untrustedConfig_folderId = untrustedConfig.folderId;
815
+ if (typeof untrustedConfig_folderId === 'string') {
816
+ config.folderId = untrustedConfig_folderId;
817
+ }
818
+ const untrustedConfig_contentTypeFilter = untrustedConfig.contentTypeFilter;
819
+ if (typeof untrustedConfig_contentTypeFilter === 'string') {
820
+ config.contentTypeFilter = untrustedConfig_contentTypeFilter;
821
+ }
822
+ const untrustedConfig_contentTypes = untrustedConfig.contentTypes;
823
+ if (ArrayIsArray$1(untrustedConfig_contentTypes)) {
824
+ const untrustedConfig_contentTypes_array = [];
825
+ for (let i = 0, arrayLength = untrustedConfig_contentTypes.length; i < arrayLength; i++) {
826
+ const untrustedConfig_contentTypes_item = untrustedConfig_contentTypes[i];
827
+ if (typeof untrustedConfig_contentTypes_item === 'string') {
828
+ untrustedConfig_contentTypes_array.push(untrustedConfig_contentTypes_item);
829
+ }
830
+ }
831
+ config.contentTypes = untrustedConfig_contentTypes_array;
832
+ }
833
+ const untrustedConfig_filter = untrustedConfig.filter;
834
+ if (typeof untrustedConfig_filter === 'string') {
835
+ config.filter = untrustedConfig_filter;
836
+ }
837
+ const untrustedConfig_managedContentType = untrustedConfig.managedContentType;
838
+ if (typeof untrustedConfig_managedContentType === 'string') {
839
+ config.managedContentType = untrustedConfig_managedContentType;
840
+ }
841
+ const untrustedConfig_page = untrustedConfig.page;
842
+ if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
843
+ config.page = untrustedConfig_page;
844
+ }
845
+ const untrustedConfig_pageSize = untrustedConfig.pageSize;
846
+ if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
847
+ config.pageSize = untrustedConfig_pageSize;
848
+ }
849
+ const untrustedConfig_queryTerm = untrustedConfig.queryTerm;
850
+ if (typeof untrustedConfig_queryTerm === 'string') {
851
+ config.queryTerm = untrustedConfig_queryTerm;
852
+ }
853
+ const untrustedConfig_showPublishedOnly = untrustedConfig.showPublishedOnly;
854
+ if (typeof untrustedConfig_showPublishedOnly === 'boolean') {
855
+ config.showPublishedOnly = untrustedConfig_showPublishedOnly;
856
+ }
857
+ const untrustedConfig_sortBy = untrustedConfig.sortBy;
858
+ if (typeof untrustedConfig_sortBy === 'string') {
859
+ config.sortBy = untrustedConfig_sortBy;
860
+ }
861
+ const untrustedConfig_sortOrder = untrustedConfig.sortOrder;
862
+ if (typeof untrustedConfig_sortOrder === 'string') {
863
+ config.sortOrder = untrustedConfig_sortOrder;
864
+ }
865
+ return config;
866
+ }
867
+ function validateAdapterConfig$l(untrustedConfig, configPropertyNames) {
868
+ if (!untrustedIsObject(untrustedConfig)) {
869
+ return null;
870
+ }
871
+ if (process.env.NODE_ENV !== 'production') {
872
+ validateConfig(untrustedConfig, configPropertyNames);
873
+ }
874
+ const config = typeCheckConfig$l(untrustedConfig);
875
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
876
+ return null;
877
+ }
878
+ return config;
879
+ }
880
+ function adapterFragment$b(luvio, config) {
881
+ createResourceParams$l(config);
882
+ return select$z();
883
+ }
884
+ function onFetchResponseSuccess$d(luvio, config, resourceParams, response) {
885
+ const snapshot = ingestSuccess$l(luvio, resourceParams, response, {
886
+ config,
887
+ resolve: () => buildNetworkSnapshot$l(luvio, config, snapshotRefreshOptions)
888
+ });
889
+ return luvio.storeBroadcast().then(() => snapshot);
890
+ }
891
+ function onFetchResponseError$b(luvio, config, resourceParams, response) {
892
+ const snapshot = ingestError$b(luvio, resourceParams, response, {
893
+ config,
894
+ resolve: () => buildNetworkSnapshot$l(luvio, config, snapshotRefreshOptions)
895
+ });
896
+ return luvio.storeBroadcast().then(() => snapshot);
897
+ }
898
+ function buildNetworkSnapshot$l(luvio, config, options) {
899
+ const resourceParams = createResourceParams$l(config);
900
+ const request = createResourceRequest$l(resourceParams);
901
+ return luvio.dispatchResourceRequest(request, options)
902
+ .then((response) => {
903
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$d(luvio, config, resourceParams, response), () => getResponseCacheKeys$l(luvio, resourceParams, response.body));
904
+ }, (response) => {
905
+ return luvio.handleErrorResponse(() => onFetchResponseError$b(luvio, config, resourceParams, response));
906
+ });
907
+ }
908
+ function buildNetworkSnapshotCachePolicy$b(context, coercedAdapterRequestContext) {
909
+ const { luvio, config } = context;
910
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
911
+ const dispatchOptions = {
912
+ resourceRequestContext: {
913
+ requestCorrelator,
914
+ luvioRequestMethod: undefined,
915
+ },
916
+ eventObservers
917
+ };
918
+ if (networkPriority !== 'normal') {
919
+ dispatchOptions.overrides = {
920
+ priority: networkPriority
921
+ };
922
+ }
923
+ return buildNetworkSnapshot$l(luvio, config, dispatchOptions);
924
+ }
925
+ function buildCachedSnapshotCachePolicy$b(context, storeLookup) {
926
+ const { luvio, config } = context;
927
+ const selector = {
928
+ recordId: keyBuilder$w(luvio, config),
929
+ node: adapterFragment$b(luvio, config),
930
+ variables: {},
931
+ };
932
+ const cacheSnapshot = storeLookup(selector, {
933
+ config,
934
+ resolve: () => buildNetworkSnapshot$l(luvio, config, snapshotRefreshOptions)
935
+ });
936
+ return cacheSnapshot;
937
+ }
938
+ const getManagedContentSpaceFolderItemsV1AdapterFactory = (luvio) => function CMSAuthoring__getManagedContentSpaceFolderItemsV1(untrustedConfig, requestContext) {
939
+ const config = validateAdapterConfig$l(untrustedConfig, getManagedContentSpaceFolderItemsV1_ConfigPropertyNames);
940
+ // Invalid or incomplete config
941
+ if (config === null) {
942
+ return null;
943
+ }
944
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
945
+ buildCachedSnapshotCachePolicy$b, buildNetworkSnapshotCachePolicy$b);
946
+ };
554
947
 
555
948
  function validate$A(obj, path = 'ManagedContentTypeSummaryRepresentation') {
556
949
  const v_error = (() => {
@@ -6863,4 +7256,4 @@ const createManagedContentImportV2JobAdapterFactory = (luvio) => {
6863
7256
  };
6864
7257
  };
6865
7258
 
6866
- export { createDeploymentAdapterFactory, createManagedContentAdapterFactory, createManagedContentExportV2JobAdapterFactory, createManagedContentImportV2JobAdapterFactory, createManagedContentVariantAdapterFactory, createTranslationV2JobAdapterFactory, deleteManagedContentVariantAdapterFactory, getCollectionItemsAdapterFactory, getManagedContentAdapterFactory, getManagedContentByFolderIdAdapterFactory, getManagedContentReferencedByAdapterFactory, getManagedContentSpaceAdapterFactory, getManagedContentSpacesAdapterFactory, getManagedContentVariantAdapterFactory, getManagedContentVariantReferencesAdapterFactory, getManagedContentVariantRenditionAdapterFactory, getManagedContentVariantVersionsAdapterFactory, getSearchResultsAdapterFactory, patchManagedContentSpaceAdapterFactory, publishManagedContentAdapterFactory, replaceManagedContentVariantAdapterFactory, unpublishManagedContentAdapterFactory };
7259
+ export { createDeploymentAdapterFactory, createManagedContentAdapterFactory, createManagedContentExportV2JobAdapterFactory, createManagedContentImportV2JobAdapterFactory, createManagedContentVariantAdapterFactory, createTranslationV2JobAdapterFactory, deleteManagedContentVariantAdapterFactory, getCollectionItemsAdapterFactory, getManagedContentAdapterFactory, getManagedContentByFolderIdAdapterFactory, getManagedContentReferencedByAdapterFactory, getManagedContentSpaceAdapterFactory, getManagedContentSpaceFolderItemsV1AdapterFactory, getManagedContentSpacesAdapterFactory, getManagedContentVariantAdapterFactory, getManagedContentVariantReferencesAdapterFactory, getManagedContentVariantRenditionAdapterFactory, getManagedContentVariantVersionsAdapterFactory, getSearchResultsAdapterFactory, patchManagedContentSpaceAdapterFactory, publishManagedContentAdapterFactory, replaceManagedContentVariantAdapterFactory, unpublishManagedContentAdapterFactory };