@tridion-sites/models 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -306,504 +306,690 @@ class BasicVersionInfo {
306
306
  }
307
307
  }
308
308
 
309
- const createBackendLink = (id, title) => {
310
- return {
311
- $type: 'Link',
312
- IdRef: id,
313
- Title: title,
314
- };
309
+ const eclUriItemTypes = ['undefined', 'mountpoint', 'folder', 'file', 'data', 'category', 'keyword'];
310
+ const parseEclUriItemType = (itemType) => {
311
+ const normalizedItemType = itemType.toLowerCase();
312
+ if (eclUriItemTypes.includes(normalizedItemType)) {
313
+ return normalizedItemType;
314
+ }
315
+ return undefined;
315
316
  };
316
317
 
317
- /**
318
- * Base class for links to Identifiable Objects.
319
- */
320
- class Link {
321
- constructor({ backendModel, idRef, isDynamicTarget }) {
322
- Object.defineProperty(this, "_backendModel", {
323
- enumerable: true,
324
- configurable: true,
325
- writable: true,
326
- value: void 0
327
- });
328
- Object.defineProperty(this, "_idRef", {
329
- enumerable: true,
330
- configurable: true,
331
- writable: true,
332
- value: void 0
333
- });
334
- Object.defineProperty(this, "_isDynamicTarget", {
335
- enumerable: true,
336
- configurable: true,
337
- writable: true,
338
- value: void 0
339
- });
340
- Object.defineProperty(this, "getInternalModel", {
341
- enumerable: true,
342
- configurable: true,
343
- writable: true,
344
- value: () => {
345
- return this._backendModel;
346
- }
347
- });
348
- this._backendModel = backendModel;
349
- this._idRef = idRef;
350
- this._isDynamicTarget = isDynamicTarget;
351
- }
352
- /**
353
- * Item URI of the referenced item.
354
- */
355
- get idRef() {
356
- return this._idRef;
357
- }
358
- /**
359
- * Title of the referenced item.
360
- */
361
- get title() {
362
- return this._backendModel.Title || this._idRef.asString;
363
- }
364
- /**
365
- * Description of the referenced object.
366
- */
367
- get description() {
368
- return this._backendModel.Description;
369
- }
370
- /**
371
- * Link's target status.
372
- */
373
- get targetStatus() {
374
- switch (this._backendModel.TargetStatus) {
375
- case LinkTargetStatus.NOT_AVAILABLE:
376
- return 'notAvailable';
377
- case LinkTargetStatus.NOT_FOUND:
378
- return 'notFound';
379
- case LinkTargetStatus.NO_PERMISSION:
380
- return 'noPermission';
381
- case LinkTargetStatus.UNKNOWN_BY_CLIENT:
382
- return 'unknownByClient';
383
- case undefined:
384
- return undefined;
385
- }
386
- }
387
- /**
388
- * Whether link's target has a dynamic version.
389
- */
390
- get isDynamicTarget() {
391
- return this._isDynamicTarget;
392
- }
393
- get hasValidTarget() {
394
- return (this.targetStatus !== 'noPermission' &&
395
- this.targetStatus !== 'notAvailable' &&
396
- this.targetStatus !== 'notFound');
397
- }
398
- }
399
- Object.defineProperty(Link, "create", {
400
- enumerable: true,
401
- configurable: true,
402
- writable: true,
403
- value: (itemUri, title, isDynamicTarget = false) => {
404
- return new Link({
405
- backendModel: createBackendLink(itemUri.asString, title),
406
- idRef: itemUri,
407
- isDynamicTarget,
408
- });
409
- }
318
+ const baseSystemWideItems = 0x10000;
319
+ const baseWorkflowItems = 0x20000;
320
+ const tcmUriItemType = {
321
+ none: 0x0,
322
+ publication: 0x1,
323
+ folder: 0x2,
324
+ structureGroup: 0x4,
325
+ system: 0x7,
326
+ schema: 0x8,
327
+ component: 0x10,
328
+ componentTemplate: 0x20,
329
+ page: 0x40,
330
+ pageTemplate: 0x80,
331
+ targetGroup: 0x100,
332
+ category: 0x200,
333
+ keyword: 0x400,
334
+ templateBuildingBlock: 0x800,
335
+ businessProcessType: 0x1000,
336
+ virtualFolder: 0x2000,
337
+ publicationTarget: baseSystemWideItems + 0x1,
338
+ targetType: baseSystemWideItems + 0x2,
339
+ targetDestination: baseSystemWideItems + 0x4,
340
+ multimediaType: baseSystemWideItems + 0x8,
341
+ user: baseSystemWideItems + 0x10,
342
+ group: baseSystemWideItems + 0x20,
343
+ directoryService: baseSystemWideItems + 0x80,
344
+ directionGroupMapping: baseSystemWideItems + 0x100,
345
+ batch: baseSystemWideItems + 0x200,
346
+ publishTransaction: baseSystemWideItems + 0x400,
347
+ workflowType: baseSystemWideItems + 0x800,
348
+ approvalStatus: baseWorkflowItems + 0x1,
349
+ processDefinition: baseWorkflowItems + 0x2,
350
+ processInstance: baseWorkflowItems + 0x4,
351
+ processHistory: baseWorkflowItems + 0x8,
352
+ activityDefinition: baseWorkflowItems + 0x10,
353
+ activityInstance: baseWorkflowItems + 0x20,
354
+ activityHistory: baseWorkflowItems + 0x40,
355
+ workItem: baseWorkflowItems + 0x80,
356
+ };
357
+ const itemTypeIdToItemType = new Map();
358
+ Object.entries(tcmUriItemType).forEach(entry => {
359
+ itemTypeIdToItemType.set(entry[1], entry[0]);
410
360
  });
411
-
412
- /**
413
- * Represents a link to an Identifiable Object with the option to set if it is allowed to edit the linked Object.
414
- */
415
- class LinkWithIsEditable extends Link {
416
- constructor(linkWithIsEditableArgs) {
417
- super(linkWithIsEditableArgs);
418
- Object.defineProperty(this, "getInternalModel", {
419
- enumerable: true,
420
- configurable: true,
421
- writable: true,
422
- value: () => {
423
- return this._backendModel;
424
- }
425
- });
426
- }
427
- /**
428
- * Whether the referenced object is editable.
429
- */
430
- get isEditable() {
431
- return this._backendModel.IsEditable || false;
432
- }
433
- }
434
-
435
- const listLinks = {
436
- items: 'tcm:items',
437
- categories: 'tcm:categories',
438
- keywords: 'tcm:keywords',
439
- classifiedItems: 'tcm:classifieditems',
440
- uses: 'tcm:uses',
441
- usedBy: 'tcm:usedby',
442
- history: 'tcm:history',
443
- publishedTo: 'tcm:publishedto',
444
- inBundles: 'tcm:inbundles',
445
- processDefinitions: 'tcm:processdefinitions',
446
- blueprintHierarchy: 'tcm:blueprinthierarchy',
447
- translationInfo: 'tm:translationinfo',
361
+ const parseItemType = (itemType) => {
362
+ const itemTypeId = parseInt(itemType, 10);
363
+ return itemTypeIdToItemType.get(itemTypeId);
448
364
  };
449
365
 
366
+ var _a$1;
450
367
  /**
451
- * Abstract base class for all objects that can be identified using a "TCM URI".
368
+ * Represents a native Tridion Content Manager URI which uniquely identifies a resource in the system.
369
+ *
370
+ * The structure of a TCM URI is PublicationID-ItemID[-ItemType][-vVersion].
452
371
  */
453
- class IdentifiableObject {
454
- constructor(identifiableObjectArgs) {
455
- Object.defineProperty(this, "_backendModel", {
456
- enumerable: true,
457
- configurable: true,
458
- writable: true,
459
- value: void 0
460
- });
461
- Object.defineProperty(this, "_id", {
462
- enumerable: true,
463
- configurable: true,
464
- writable: true,
465
- value: void 0
466
- });
467
- Object.defineProperty(this, "_loadInfo", {
372
+ class TcmUri {
373
+ constructor(publicationId, itemId, itemType, itemVersion) {
374
+ Object.defineProperty(this, "_publicationId", {
468
375
  enumerable: true,
469
376
  configurable: true,
470
377
  writable: true,
471
378
  value: void 0
472
379
  });
473
- Object.defineProperty(this, "_basicVersionInfo", {
380
+ Object.defineProperty(this, "_itemId", {
474
381
  enumerable: true,
475
382
  configurable: true,
476
383
  writable: true,
477
384
  value: void 0
478
385
  });
479
- Object.defineProperty(this, "_applicableActions", {
386
+ Object.defineProperty(this, "_itemType", {
480
387
  enumerable: true,
481
388
  configurable: true,
482
389
  writable: true,
483
390
  value: void 0
484
391
  });
485
- Object.defineProperty(this, "_listLinks", {
392
+ Object.defineProperty(this, "_itemVersion", {
486
393
  enumerable: true,
487
394
  configurable: true,
488
395
  writable: true,
489
396
  value: void 0
490
397
  });
491
- Object.defineProperty(this, "_securityDescriptor", {
398
+ Object.defineProperty(this, "_asString", {
492
399
  enumerable: true,
493
400
  configurable: true,
494
401
  writable: true,
495
402
  value: void 0
496
403
  });
497
- Object.defineProperty(this, "getInternalModel", {
404
+ Object.defineProperty(this, "getPublicationUri", {
498
405
  enumerable: true,
499
406
  configurable: true,
500
407
  writable: true,
501
408
  value: () => {
502
- return this._backendModel;
409
+ if (this._itemType === 'publication')
410
+ return this;
411
+ return TcmUri.createPublicationUri(this._publicationId);
503
412
  }
504
413
  });
505
- Object.defineProperty(this, "hasApplicableAction", {
414
+ Object.defineProperty(this, "getVersionlessUri", {
506
415
  enumerable: true,
507
416
  configurable: true,
508
417
  writable: true,
509
- value: (applicableAction) => {
510
- if (!this._applicableActions)
511
- return false;
512
- return this._applicableActions.some(action => { var _a; return ((_a = action.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === applicableActions[applicableAction]; });
418
+ value: () => {
419
+ return TcmUri.create(this._publicationId, this._itemId, this._itemType);
513
420
  }
514
421
  });
515
- Object.defineProperty(this, "hasListLink", {
422
+ Object.defineProperty(this, "getUriWithVersion", {
516
423
  enumerable: true,
517
424
  configurable: true,
518
425
  writable: true,
519
- value: (listLink) => {
520
- if (!this._listLinks)
521
- return false;
522
- return this._listLinks.some(link => { var _a; return ((_a = link.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === listLinks[listLink]; });
426
+ value: (version) => {
427
+ return TcmUri.create(this._publicationId, this._itemId, this._itemType, version);
523
428
  }
524
429
  });
525
- Object.defineProperty(this, "hasLoadError", {
430
+ Object.defineProperty(this, "getUriInPublication", {
526
431
  enumerable: true,
527
432
  configurable: true,
528
433
  writable: true,
529
- value: (specificError) => {
530
- var _a;
531
- if (!((_a = this.loadInfo) === null || _a === void 0 ? void 0 : _a.errorType) || this.loadInfo.errorType === 'none') {
532
- return false;
533
- }
534
- if (specificError) {
535
- return this.loadInfo.errorType === specificError;
536
- }
537
- return true;
434
+ value: (publicationUri) => {
435
+ return TcmUri.create(publicationUri._itemId, this._itemId, this._itemType, this._itemVersion);
538
436
  }
539
437
  });
540
- Object.defineProperty(this, "getLinkToItem", {
541
- enumerable: true,
542
- configurable: true,
543
- writable: true,
544
- value: () => {
545
- return Link.create(this._id, this.title);
546
- }
547
- });
548
- this._backendModel = identifiableObjectArgs.backendModel;
549
- this._id = identifiableObjectArgs.id;
550
- this._loadInfo = identifiableObjectArgs.loadInfo;
551
- this._basicVersionInfo = identifiableObjectArgs.basicVersionInfo;
552
- this._applicableActions = identifiableObjectArgs.applicableActions;
553
- this._listLinks = identifiableObjectArgs.listLinks;
554
- this._securityDescriptor = identifiableObjectArgs.securityDescriptor;
438
+ this._publicationId = publicationId;
439
+ this._itemId = itemId;
440
+ this._itemType = itemType;
441
+ this._itemVersion = itemVersion;
442
+ const parts = [this._publicationId.toString(), this._itemId.toString()];
443
+ if (this._itemType !== 'component') {
444
+ parts.push(tcmUriItemType[this._itemType].toString());
445
+ }
446
+ if (this._itemVersion !== undefined) {
447
+ parts.push(`v${this._itemVersion}`);
448
+ }
449
+ this._asString = `tcm:${parts.join('-')}`;
555
450
  }
556
- /**
557
- * Identifier (URI) of the object.
558
- */
559
- get id() {
560
- return this._id;
451
+ get publicationId() {
452
+ return this._publicationId;
561
453
  }
562
- /**
563
- * Title (display name) of the object.
564
- */
565
- get title() {
566
- return this._backendModel.Title;
454
+ get itemId() {
455
+ return this._itemId;
567
456
  }
568
- /**
569
- * Information about the error that was thrown while loading an item.
570
- */
571
- get loadInfo() {
572
- return this._loadInfo;
457
+ get itemType() {
458
+ return this._itemType;
573
459
  }
574
- /**
575
- * Whether the object is editable.
576
- */
577
- get isEditable() {
578
- return this._backendModel.IsEditable || false;
460
+ get version() {
461
+ return this._itemVersion;
579
462
  }
580
- /**
581
- * Version information of the object.
582
- */
583
- get versionInfo() {
584
- return this._basicVersionInfo;
463
+ get hasVersion() {
464
+ return this._itemVersion !== undefined;
585
465
  }
586
- /**
587
- * Information about the applicable actions which can be performed on the object in its current state.
588
- */
589
- get applicableActions() {
590
- return this._applicableActions;
466
+ get isNewUri() {
467
+ return this._itemId === 0;
591
468
  }
592
- /**
593
- * Extension properties dictionary which may be used by extensions.Key must comply with XML NCName datatype.This value is not persisted by Content Manager Kernel.
594
- */
595
- get extensionProperties() {
596
- return this._backendModel.ExtensionProperties;
469
+ get isNullUri() {
470
+ return (this._publicationId === TcmUri.null.publicationId &&
471
+ this._itemId === TcmUri.null.itemId &&
472
+ this._itemType === TcmUri.null.itemType);
597
473
  }
598
- get listLinks() {
599
- return this._listLinks;
474
+ get isSystemUri() {
475
+ return (this._publicationId === TcmUri.system.publicationId &&
476
+ this._itemId === TcmUri.system.itemId &&
477
+ this._itemType === TcmUri.system.itemType);
600
478
  }
601
- get securityDescriptor() {
602
- return this._securityDescriptor;
479
+ get isEditableVersion() {
480
+ return this.isNullUri || this._itemVersion === TcmUri._editableVersion;
481
+ }
482
+ get isDynamic() {
483
+ return this._itemVersion === 0;
484
+ }
485
+ get asString() {
486
+ return this._asString;
603
487
  }
604
488
  }
489
+ _a$1 = TcmUri;
490
+ Object.defineProperty(TcmUri, "_tcmUriCache", {
491
+ enumerable: true,
492
+ configurable: true,
493
+ writable: true,
494
+ value: new Map()
495
+ });
496
+ Object.defineProperty(TcmUri, "_tcmUriRegExp", {
497
+ enumerable: true,
498
+ configurable: true,
499
+ writable: true,
500
+ value: new RegExp(/^tcm:([0-9]+)-([0-9]+)(-([0-9]+))?(-v([0-9]+))?$/)
501
+ });
502
+ Object.defineProperty(TcmUri, "_editableVersion", {
503
+ enumerable: true,
504
+ configurable: true,
505
+ writable: true,
506
+ value: 0
507
+ });
508
+ Object.defineProperty(TcmUri, "create", {
509
+ enumerable: true,
510
+ configurable: true,
511
+ writable: true,
512
+ value: (publicationId, itemId, itemType, itemVersion) => {
513
+ const tcmUri = new TcmUri(publicationId, itemId, itemType, itemVersion);
514
+ const cachedTcmUri = TcmUri._tcmUriCache.get(tcmUri.asString);
515
+ if (cachedTcmUri)
516
+ return cachedTcmUri;
517
+ TcmUri._tcmUriCache.set(tcmUri.asString, tcmUri);
518
+ return tcmUri;
519
+ }
520
+ });
521
+ Object.defineProperty(TcmUri, "null", {
522
+ enumerable: true,
523
+ configurable: true,
524
+ writable: true,
525
+ value: TcmUri.create(0, 0, 'none')
526
+ });
527
+ Object.defineProperty(TcmUri, "system", {
528
+ enumerable: true,
529
+ configurable: true,
530
+ writable: true,
531
+ value: TcmUri.create(0, 0, 'system')
532
+ });
533
+ Object.defineProperty(TcmUri, "parse", {
534
+ enumerable: true,
535
+ configurable: true,
536
+ writable: true,
537
+ value: (input) => {
538
+ const cachedTcmUri = TcmUri._tcmUriCache.get(input);
539
+ if (cachedTcmUri)
540
+ return cachedTcmUri;
541
+ const result = _a$1._tcmUriRegExp.exec(input);
542
+ if (!result)
543
+ return undefined;
544
+ const pubIdPart = result[1];
545
+ const itemIdPart = result[2];
546
+ const itemTypePart = result[4];
547
+ const itemVersionPart = result[6];
548
+ if (!result || pubIdPart === undefined || itemIdPart === undefined)
549
+ return undefined;
550
+ const publicationId = parseInt(pubIdPart, 10);
551
+ if (isNaN(publicationId) || publicationId < 0)
552
+ return undefined;
553
+ const itemId = parseInt(itemIdPart, 10);
554
+ if (isNaN(itemId) || itemId < 0)
555
+ return undefined;
556
+ let itemType;
557
+ if (itemTypePart) {
558
+ const parsedItemType = parseItemType(itemTypePart);
559
+ if (!parsedItemType)
560
+ return undefined;
561
+ itemType = parsedItemType;
562
+ }
563
+ else {
564
+ itemType = 'component';
565
+ }
566
+ let version;
567
+ if (itemVersionPart) {
568
+ version = parseInt(itemVersionPart, 10);
569
+ if (isNaN(version) || version < 0)
570
+ return undefined;
571
+ }
572
+ return TcmUri.create(publicationId, itemId, itemType, version);
573
+ }
574
+ });
575
+ Object.defineProperty(TcmUri, "createPublicationUri", {
576
+ enumerable: true,
577
+ configurable: true,
578
+ writable: true,
579
+ value: (publicationId) => {
580
+ return TcmUri.create(0, publicationId, 'publication');
581
+ }
582
+ });
605
583
 
606
- /**
607
- * Represents the information about the error that was thrown while loading an item.
608
- */
609
- class LoadInfo {
610
- constructor({ backendModel, errorType, state }) {
611
- Object.defineProperty(this, "_backendModel", {
584
+ var _a;
585
+ class EclUri {
586
+ constructor(publicationId, mountPointId, itemId, itemType, subType, itemVersion) {
587
+ /**
588
+ * Id of the Tridion Publication this EclUri belongs to.
589
+ */
590
+ Object.defineProperty(this, "_publicationId", {
612
591
  enumerable: true,
613
592
  configurable: true,
614
593
  writable: true,
615
594
  value: void 0
616
595
  });
617
- Object.defineProperty(this, "_errorType", {
596
+ /**
597
+ * Mount Point identifier responsible for handling this URI.
598
+ * The ID of each Mount Point specified in configuration. It should not be changed once the Mount Point is in use.
599
+ */
600
+ Object.defineProperty(this, "_mountPointId", {
618
601
  enumerable: true,
619
602
  configurable: true,
620
603
  writable: true,
621
604
  value: void 0
622
605
  });
623
- Object.defineProperty(this, "_state", {
606
+ /**
607
+ * Provider-specified item id.
608
+ */
609
+ Object.defineProperty(this, "_itemId", {
624
610
  enumerable: true,
625
611
  configurable: true,
626
612
  writable: true,
627
613
  value: void 0
628
614
  });
629
- Object.defineProperty(this, "getInternalModel", {
615
+ /**
616
+ * External Content Library item type.
617
+ */
618
+ Object.defineProperty(this, "_itemType", {
619
+ enumerable: true,
620
+ configurable: true,
621
+ writable: true,
622
+ value: void 0
623
+ });
624
+ /**
625
+ * Provider-specified item type.
626
+ */
627
+ Object.defineProperty(this, "_subType", {
628
+ enumerable: true,
629
+ configurable: true,
630
+ writable: true,
631
+ value: void 0
632
+ });
633
+ /**
634
+ * Version number part of the URL;
635
+ * The version identifies the version number of the Tridion stub Component generated for this item (if any), not the
636
+ * version on the remote system.
637
+ */
638
+ Object.defineProperty(this, "_itemVersion", {
639
+ enumerable: true,
640
+ configurable: true,
641
+ writable: true,
642
+ value: void 0
643
+ });
644
+ Object.defineProperty(this, "_asString", {
645
+ enumerable: true,
646
+ configurable: true,
647
+ writable: true,
648
+ value: void 0
649
+ });
650
+ Object.defineProperty(this, "getPublicationUri", {
630
651
  enumerable: true,
631
652
  configurable: true,
632
653
  writable: true,
633
654
  value: () => {
634
- return this._backendModel;
655
+ return TcmUri.createPublicationUri(this._publicationId);
635
656
  }
636
657
  });
637
- this._backendModel = backendModel;
638
- this._errorType = errorType;
639
- this._state = state;
640
- }
641
- /**
642
- * Error message.
643
- */
644
- get errorMessage() {
645
- return this._backendModel.ErrorMessage || '';
646
- }
647
- /**
648
- * Error type.
649
- */
650
- get errorType() {
651
- return this._errorType;
652
- }
653
- /**
654
- * Load state of item.
655
- */
656
- get state() {
657
- return this._state;
658
- }
659
- }
660
-
661
- /**
662
- * Abstract base class for the data of all system-wide objects.
663
- */
664
- class SystemWideObject extends IdentifiableObject {
665
- constructor(systemWideObjectArgs) {
666
- super(systemWideObjectArgs);
667
- Object.defineProperty(this, "getInternalModel", {
658
+ Object.defineProperty(this, "getVersionlessUri", {
668
659
  enumerable: true,
669
660
  configurable: true,
670
661
  writable: true,
671
662
  value: () => {
672
- return this._backendModel;
663
+ return EclUri.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType);
673
664
  }
674
665
  });
675
- }
676
- }
677
-
678
- class ApprovalStatus extends SystemWideObject {
679
- constructor(approvalStatusArgs) {
680
- super(approvalStatusArgs);
681
- Object.defineProperty(this, "getInternalModel", {
666
+ Object.defineProperty(this, "getMountPointUri", {
682
667
  enumerable: true,
683
668
  configurable: true,
684
669
  writable: true,
685
670
  value: () => {
686
- return this._backendModel;
671
+ if (this._itemType === 'mountpoint')
672
+ return this;
673
+ return EclUri.create(this._publicationId, this._mountPointId, 'root', 'mountpoint', 'mp');
687
674
  }
688
675
  });
689
- }
690
- /**
691
- * Value indicating whether the Approval Status is deleted.
692
- *
693
- * If an Approval Status is deleted, it is not physically removed, but only flagged as deleted.
694
- * (and therefore suppressed from the list of Approval Statuses).
695
- */
696
- get isDeleted() {
697
- return this._backendModel.IsDeleted || false;
698
- }
699
- /**
700
- * Position of this Approval Status in the list of the Approval Statuses.
701
- *
702
- * The list of Approval Statuses is ordered, because Publication Targets can have a minimal Approval Status:
703
- * Approval Statuses with a Position lower than this minimal approval status won't be publishable.
704
- */
705
- get position() {
706
- return this._backendModel.Position;
707
- }
708
- }
709
-
710
- /**
711
- * Represents a Multimedia Type: a type of binary content
712
- */
713
- class MultimediaType extends SystemWideObject {
714
- constructor(multimediaTypeArgs) {
715
- super(multimediaTypeArgs);
716
- Object.defineProperty(this, "getInternalModel", {
676
+ Object.defineProperty(this, "getUriWithVersion", {
717
677
  enumerable: true,
718
678
  configurable: true,
719
679
  writable: true,
720
- value: () => {
721
- return this._backendModel;
680
+ value: (version) => {
681
+ return EclUri.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType, version);
722
682
  }
723
683
  });
724
- }
725
- /**
726
- * File extensions associated with this Multimedia type.
727
- */
728
- get fileExtensions() {
729
- return this._backendModel.FileExtensions;
730
- }
731
- /**
732
- * MIME type according to IETF RFC 2046.
733
- */
734
- get mimeType() {
735
- return this._backendModel.MimeType;
736
- }
737
- }
738
-
739
- /**
740
- * Represents a Repository: a context for BluePrinting.
741
- */
742
- class Repository extends SystemWideObject {
743
- constructor(_a) {
744
- var { backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, defaultMultimediaSchema, locationInfo, metadataSchema, minimalLocalizeApprovalStatus, parents, rootFolder, taskProcess, versionInfo } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "accessControlList", "businessProcessType", "contentSecurityDescriptor", "defaultMultimediaSchema", "locationInfo", "metadataSchema", "minimalLocalizeApprovalStatus", "parents", "rootFolder", "taskProcess", "versionInfo"]);
745
- super(Object.assign({ backendModel }, systemWideObjectArgs));
746
- Object.defineProperty(this, "_accessControlList", {
684
+ Object.defineProperty(this, "getUriInPublication", {
747
685
  enumerable: true,
748
686
  configurable: true,
749
687
  writable: true,
750
- value: void 0
688
+ value: (publicationUri) => {
689
+ return EclUri.create(publicationUri.itemId, this._mountPointId, this._itemId, this._itemType, this._subType, this._itemVersion);
690
+ }
751
691
  });
752
- Object.defineProperty(this, "_businessProcessType", {
692
+ this._publicationId = publicationId;
693
+ this._mountPointId = mountPointId;
694
+ this._itemId = itemId;
695
+ this._itemType = itemType;
696
+ this._subType = subType;
697
+ this._itemVersion = itemVersion;
698
+ const parts = [
699
+ this._publicationId.toString(),
700
+ this._mountPointId.toString(),
701
+ this._itemId.toString(),
702
+ this._subType.toString(),
703
+ this._itemType.toString(),
704
+ ];
705
+ if (this._itemVersion !== undefined) {
706
+ parts.push(`v${this._itemVersion}`);
707
+ }
708
+ this._asString = `ecl:${parts.join('-')}`;
709
+ }
710
+ get publicationId() {
711
+ return this._publicationId;
712
+ }
713
+ get itemId() {
714
+ return this._itemId;
715
+ }
716
+ get mountPointId() {
717
+ return this._mountPointId;
718
+ }
719
+ get itemType() {
720
+ return this._itemType;
721
+ }
722
+ get version() {
723
+ return this._itemVersion;
724
+ }
725
+ get hasVersion() {
726
+ return this._itemVersion !== undefined;
727
+ }
728
+ get isNullUri() {
729
+ return !this._mountPointId;
730
+ }
731
+ get isDynamic() {
732
+ return this._itemVersion === 0;
733
+ }
734
+ get asString() {
735
+ return this._asString;
736
+ }
737
+ }
738
+ _a = EclUri;
739
+ Object.defineProperty(EclUri, "_eclUriCache", {
740
+ enumerable: true,
741
+ configurable: true,
742
+ writable: true,
743
+ value: new Map()
744
+ });
745
+ Object.defineProperty(EclUri, "_eclUriRegExp", {
746
+ enumerable: true,
747
+ configurable: true,
748
+ writable: true,
749
+ value: new RegExp(/^ecl:(\d+)-([^\s-]+)-([^\s-]+)-([^\s-]*)-([^\s\(\)-]+)(-v(\d+))?$/)
750
+ });
751
+ Object.defineProperty(EclUri, "create", {
752
+ enumerable: true,
753
+ configurable: true,
754
+ writable: true,
755
+ value: (publicationId, mountPointId, itemId, itemType, subType, itemVersion) => {
756
+ const eclUri = new EclUri(publicationId, mountPointId, itemId, itemType, subType, itemVersion);
757
+ const cachedEclUri = EclUri._eclUriCache.get(eclUri.asString);
758
+ if (cachedEclUri)
759
+ return cachedEclUri;
760
+ EclUri._eclUriCache.set(eclUri.asString, eclUri);
761
+ return eclUri;
762
+ }
763
+ });
764
+ Object.defineProperty(EclUri, "parse", {
765
+ enumerable: true,
766
+ configurable: true,
767
+ writable: true,
768
+ value: (input) => {
769
+ const result = _a._eclUriRegExp.exec(input);
770
+ if (!result)
771
+ return undefined;
772
+ const pubIdPart = result[1];
773
+ const mountPointIdPart = result[2];
774
+ const itemIdPart = result[3];
775
+ const subTypePart = result[4];
776
+ const itemTypePart = result[5];
777
+ const itemVersionPart = result[7];
778
+ if (pubIdPart === undefined ||
779
+ mountPointIdPart === undefined ||
780
+ itemIdPart === undefined ||
781
+ subTypePart === undefined ||
782
+ itemTypePart === undefined)
783
+ return undefined;
784
+ const publicationId = parseInt(pubIdPart, 10);
785
+ if (isNaN(publicationId) || publicationId < 0)
786
+ return undefined;
787
+ const mountPointId = mountPointIdPart;
788
+ const itemId = itemIdPart;
789
+ const subType = subTypePart;
790
+ const itemType = parseEclUriItemType(itemTypePart);
791
+ if (!itemType)
792
+ return undefined;
793
+ let version;
794
+ if (itemVersionPart) {
795
+ version = parseInt(itemVersionPart, 10);
796
+ if (isNaN(version) || version < 0)
797
+ return undefined;
798
+ }
799
+ return EclUri.create(publicationId, mountPointId, itemId, itemType, subType, version);
800
+ }
801
+ });
802
+
803
+ class VirtualUri {
804
+ constructor(publicationUri, itemType) {
805
+ Object.defineProperty(this, "_publicationUri", {
753
806
  enumerable: true,
754
807
  configurable: true,
755
808
  writable: true,
756
809
  value: void 0
757
810
  });
758
- Object.defineProperty(this, "_contentSecurityDescriptor", {
811
+ Object.defineProperty(this, "_itemType", {
759
812
  enumerable: true,
760
813
  configurable: true,
761
814
  writable: true,
762
815
  value: void 0
763
816
  });
764
- Object.defineProperty(this, "_defaultMultimediaSchema", {
817
+ Object.defineProperty(this, "_asString", {
765
818
  enumerable: true,
766
819
  configurable: true,
767
820
  writable: true,
768
821
  value: void 0
769
822
  });
770
- Object.defineProperty(this, "_locationInfo", {
823
+ Object.defineProperty(this, "getPublicationUri", {
771
824
  enumerable: true,
772
825
  configurable: true,
773
826
  writable: true,
774
- value: void 0
827
+ value: () => {
828
+ return this._publicationUri;
829
+ }
775
830
  });
776
- Object.defineProperty(this, "_metadataSchema", {
831
+ Object.defineProperty(this, "getUriInPublication", {
777
832
  enumerable: true,
778
833
  configurable: true,
779
834
  writable: true,
780
- value: void 0
835
+ value: (publicationUri) => {
836
+ return VirtualUri.create(publicationUri, this._itemType);
837
+ }
781
838
  });
782
- Object.defineProperty(this, "_minimalLocalizeApprovalStatus", {
839
+ this._publicationUri = publicationUri;
840
+ this._itemType = itemType;
841
+ const namespace = this._itemType === 'businessProcessTypes' ? 'bptman-' : 'catman-';
842
+ this._asString = `${namespace}${this._publicationUri.asString}`;
843
+ }
844
+ get itemType() {
845
+ return this._itemType;
846
+ }
847
+ get isDynamic() {
848
+ return false;
849
+ }
850
+ get asString() {
851
+ return this._asString;
852
+ }
853
+ }
854
+ Object.defineProperty(VirtualUri, "_virtualUriCache", {
855
+ enumerable: true,
856
+ configurable: true,
857
+ writable: true,
858
+ value: new Map()
859
+ });
860
+ Object.defineProperty(VirtualUri, "create", {
861
+ enumerable: true,
862
+ configurable: true,
863
+ writable: true,
864
+ value: (publicationUri, itemType) => {
865
+ const virtualUri = new VirtualUri(publicationUri, itemType);
866
+ const cachedVirtualUri = VirtualUri._virtualUriCache.get(virtualUri.asString);
867
+ if (cachedVirtualUri)
868
+ return cachedVirtualUri;
869
+ VirtualUri._virtualUriCache.set(virtualUri.asString, virtualUri);
870
+ return virtualUri;
871
+ }
872
+ });
873
+ Object.defineProperty(VirtualUri, "parse", {
874
+ enumerable: true,
875
+ configurable: true,
876
+ writable: true,
877
+ value: (input) => {
878
+ let itemIdPart;
879
+ let itemType;
880
+ if (input.startsWith('bptman-')) {
881
+ itemIdPart = input.replace('bptman-', '');
882
+ itemType = 'businessProcessTypes';
883
+ }
884
+ if (input.startsWith('catman-')) {
885
+ itemIdPart = input.replace('catman-', '');
886
+ itemType = 'taxonomies';
887
+ }
888
+ if (!itemIdPart || !itemType)
889
+ return undefined;
890
+ const publicationUri = TcmUri.parse(itemIdPart);
891
+ if (!publicationUri)
892
+ return undefined;
893
+ return VirtualUri.create(publicationUri, itemType);
894
+ }
895
+ });
896
+
897
+ const tryParseItemUri = (backendId) => {
898
+ const tcmUri = TcmUri.parse(backendId);
899
+ if (tcmUri)
900
+ return tcmUri;
901
+ const eclUri = EclUri.parse(backendId);
902
+ if (eclUri)
903
+ return eclUri;
904
+ const virtualUri = VirtualUri.parse(backendId);
905
+ if (virtualUri)
906
+ return virtualUri;
907
+ return undefined;
908
+ };
909
+ const parseItemUri = (backendId) => {
910
+ const itemUri = tryParseItemUri(backendId);
911
+ if (!itemUri) {
912
+ throw new Error(`Unknown item uri format: ${backendId}`);
913
+ }
914
+ return itemUri;
915
+ };
916
+
917
+ const createBackendHateoasLink = (href, rel, type) => {
918
+ return {
919
+ $type: 'HateoasLink',
920
+ Href: href,
921
+ Rel: rel,
922
+ Type: type,
923
+ };
924
+ };
925
+
926
+ const createBackendLink = (id, title) => {
927
+ return {
928
+ $type: 'Link',
929
+ IdRef: id,
930
+ Title: title,
931
+ };
932
+ };
933
+
934
+ /**
935
+ * Represents the hateoas link.
936
+ */
937
+ class HateoasLink {
938
+ constructor(backendModel) {
939
+ Object.defineProperty(this, "_backendModel", {
783
940
  enumerable: true,
784
941
  configurable: true,
785
942
  writable: true,
786
943
  value: void 0
787
944
  });
788
- Object.defineProperty(this, "_parents", {
945
+ Object.defineProperty(this, "getInternalModel", {
789
946
  enumerable: true,
790
947
  configurable: true,
791
948
  writable: true,
792
- value: void 0
949
+ value: () => {
950
+ return this._backendModel;
951
+ }
793
952
  });
794
- Object.defineProperty(this, "_rootFolder", {
953
+ this._backendModel = backendModel;
954
+ }
955
+ /**
956
+ * Target resource URI.
957
+ */
958
+ get href() {
959
+ return this._backendModel.Href;
960
+ }
961
+ /**
962
+ * Link relation type, describes how the current context is related to the target resource.
963
+ */
964
+ get relationType() {
965
+ return this._backendModel.Rel;
966
+ }
967
+ /**
968
+ * Expected resource media type.
969
+ */
970
+ get type() {
971
+ return this._backendModel.Type;
972
+ }
973
+ }
974
+
975
+ /**
976
+ * Base class for links to Identifiable Objects.
977
+ */
978
+ class Link {
979
+ constructor({ backendModel, idRef, isDynamicTarget }) {
980
+ Object.defineProperty(this, "_backendModel", {
795
981
  enumerable: true,
796
982
  configurable: true,
797
983
  writable: true,
798
984
  value: void 0
799
985
  });
800
- Object.defineProperty(this, "_taskProcess", {
986
+ Object.defineProperty(this, "_idRef", {
801
987
  enumerable: true,
802
988
  configurable: true,
803
989
  writable: true,
804
990
  value: void 0
805
991
  });
806
- Object.defineProperty(this, "_versionInfo", {
992
+ Object.defineProperty(this, "_isDynamicTarget", {
807
993
  enumerable: true,
808
994
  configurable: true,
809
995
  writable: true,
@@ -817,244 +1003,380 @@ class Repository extends SystemWideObject {
817
1003
  return this._backendModel;
818
1004
  }
819
1005
  });
820
- this._accessControlList = accessControlList;
821
- this._businessProcessType = businessProcessType;
822
- this._contentSecurityDescriptor = contentSecurityDescriptor;
823
- this._defaultMultimediaSchema = defaultMultimediaSchema;
824
- this._locationInfo = locationInfo;
825
- this._metadataSchema = metadataSchema;
826
- this._minimalLocalizeApprovalStatus = minimalLocalizeApprovalStatus;
827
- this._parents = parents;
828
- this._rootFolder = rootFolder;
829
- this._taskProcess = taskProcess;
830
- this._versionInfo = versionInfo;
831
- }
832
- get accessControlList() {
833
- return this._accessControlList;
834
- }
835
- get businessProcessType() {
836
- return this._businessProcessType;
837
- }
838
- get contentSecurityDescriptor() {
839
- return this._contentSecurityDescriptor;
840
- }
841
- get defaultMultimediaSchema() {
842
- return this._defaultMultimediaSchema;
1006
+ this._backendModel = backendModel;
1007
+ this._idRef = idRef;
1008
+ this._isDynamicTarget = isDynamicTarget;
843
1009
  }
844
1010
  /**
845
- * Whether this Repository has child Repositories in a BluePrint hierarchy.
1011
+ * Item URI of the referenced item.
846
1012
  */
847
- get hasChildren() {
848
- return this._backendModel.HasChildren || false;
849
- }
850
- get key() {
851
- return this._backendModel.Key;
1013
+ get idRef() {
1014
+ return this._idRef;
852
1015
  }
853
- get locationInfo() {
854
- return this._locationInfo;
1016
+ /**
1017
+ * Title of the referenced item.
1018
+ */
1019
+ get title() {
1020
+ return this._backendModel.Title || this._idRef.asString;
855
1021
  }
856
- get metadata() {
857
- return this._backendModel.Metadata;
1022
+ /**
1023
+ * Description of the referenced object.
1024
+ */
1025
+ get description() {
1026
+ return this._backendModel.Description;
858
1027
  }
859
- get metadataSchema() {
860
- return this._metadataSchema;
1028
+ /**
1029
+ * Link's target status.
1030
+ */
1031
+ get targetStatus() {
1032
+ switch (this._backendModel.TargetStatus) {
1033
+ case LinkTargetStatus.NOT_AVAILABLE:
1034
+ return 'notAvailable';
1035
+ case LinkTargetStatus.NOT_FOUND:
1036
+ return 'notFound';
1037
+ case LinkTargetStatus.NO_PERMISSION:
1038
+ return 'noPermission';
1039
+ case LinkTargetStatus.UNKNOWN_BY_CLIENT:
1040
+ return 'unknownByClient';
1041
+ case undefined:
1042
+ return undefined;
1043
+ }
861
1044
  }
862
- get minimalLocalizeApprovalStatus() {
863
- return this._minimalLocalizeApprovalStatus;
1045
+ /**
1046
+ * Whether link's target has a dynamic version.
1047
+ */
1048
+ get isDynamicTarget() {
1049
+ return this._isDynamicTarget;
864
1050
  }
865
- get parents() {
866
- return this._parents;
1051
+ get hasValidTarget() {
1052
+ return (this.targetStatus !== 'noPermission' &&
1053
+ this.targetStatus !== 'notAvailable' &&
1054
+ this.targetStatus !== 'notFound');
867
1055
  }
868
- get rootFolder() {
869
- return this._rootFolder;
1056
+ }
1057
+ Object.defineProperty(Link, "create", {
1058
+ enumerable: true,
1059
+ configurable: true,
1060
+ writable: true,
1061
+ value: (itemUri, title, isDynamicTarget = false) => {
1062
+ return new Link({
1063
+ backendModel: createBackendLink(itemUri.asString, title),
1064
+ idRef: itemUri,
1065
+ isDynamicTarget,
1066
+ });
870
1067
  }
871
- get taskProcess() {
872
- return this._taskProcess;
1068
+ });
1069
+
1070
+ /**
1071
+ * Represents a link to an Identifiable Object with the option to set if it is allowed to edit the linked Object.
1072
+ */
1073
+ class LinkWithIsEditable extends Link {
1074
+ constructor(linkWithIsEditableArgs) {
1075
+ super(linkWithIsEditableArgs);
1076
+ Object.defineProperty(this, "getInternalModel", {
1077
+ enumerable: true,
1078
+ configurable: true,
1079
+ writable: true,
1080
+ value: () => {
1081
+ return this._backendModel;
1082
+ }
1083
+ });
873
1084
  }
874
- get versionInfo() {
875
- return this._versionInfo;
1085
+ /**
1086
+ * Whether the referenced object is editable.
1087
+ */
1088
+ get isEditable() {
1089
+ return this._backendModel.IsEditable || false;
876
1090
  }
877
1091
  }
878
1092
 
1093
+ const listLinks = {
1094
+ items: 'tcm:items',
1095
+ categories: 'tcm:categories',
1096
+ keywords: 'tcm:keywords',
1097
+ classifiedItems: 'tcm:classifieditems',
1098
+ uses: 'tcm:uses',
1099
+ usedBy: 'tcm:usedby',
1100
+ history: 'tcm:history',
1101
+ publishedTo: 'tcm:publishedto',
1102
+ inBundles: 'tcm:inbundles',
1103
+ processDefinitions: 'tcm:processdefinitions',
1104
+ blueprintHierarchy: 'tcm:blueprinthierarchy',
1105
+ translationInfo: 'tm:translationinfo',
1106
+ };
1107
+
879
1108
  /**
880
- * Publication: a "Repository" used for publishing.
1109
+ * Abstract base class for all objects that can be identified using a "TCM URI".
881
1110
  */
882
- class Publication extends Repository {
883
- constructor(_a) {
884
- var { backendModel, componentSnapshotTemplate, componentTemplateProcess, defaultComponentTemplate, defaultPageTemplate, defaultTemplateBuildingBlock, pageSnapshotTemplate, pageTemplateProcess, rootStructureGroup, templateBundleProcess } = _a, repositoryArgs = __rest(_a, ["backendModel", "componentSnapshotTemplate", "componentTemplateProcess", "defaultComponentTemplate", "defaultPageTemplate", "defaultTemplateBuildingBlock", "pageSnapshotTemplate", "pageTemplateProcess", "rootStructureGroup", "templateBundleProcess"]);
885
- super(Object.assign({ backendModel }, repositoryArgs));
886
- Object.defineProperty(this, "_componentSnapshotTemplate", {
1111
+ class IdentifiableObject {
1112
+ constructor(identifiableObjectArgs) {
1113
+ Object.defineProperty(this, "_backendModel", {
887
1114
  enumerable: true,
888
1115
  configurable: true,
889
1116
  writable: true,
890
1117
  value: void 0
891
1118
  });
892
- Object.defineProperty(this, "_componentTemplateProcess", {
1119
+ Object.defineProperty(this, "_id", {
893
1120
  enumerable: true,
894
1121
  configurable: true,
895
1122
  writable: true,
896
1123
  value: void 0
897
1124
  });
898
- Object.defineProperty(this, "_defaultComponentTemplate", {
1125
+ Object.defineProperty(this, "_loadInfo", {
899
1126
  enumerable: true,
900
1127
  configurable: true,
901
1128
  writable: true,
902
1129
  value: void 0
903
1130
  });
904
- Object.defineProperty(this, "_defaultPageTemplate", {
1131
+ Object.defineProperty(this, "_basicVersionInfo", {
905
1132
  enumerable: true,
906
1133
  configurable: true,
907
1134
  writable: true,
908
1135
  value: void 0
909
1136
  });
910
- Object.defineProperty(this, "_defaultTemplateBuildingBlock", {
1137
+ Object.defineProperty(this, "_applicableActions", {
911
1138
  enumerable: true,
912
1139
  configurable: true,
913
1140
  writable: true,
914
1141
  value: void 0
915
1142
  });
916
- Object.defineProperty(this, "_pageSnapshotTemplate", {
1143
+ Object.defineProperty(this, "_listLinks", {
917
1144
  enumerable: true,
918
1145
  configurable: true,
919
1146
  writable: true,
920
1147
  value: void 0
921
1148
  });
922
- Object.defineProperty(this, "_pageTemplateProcess", {
1149
+ Object.defineProperty(this, "_securityDescriptor", {
923
1150
  enumerable: true,
924
1151
  configurable: true,
925
1152
  writable: true,
926
1153
  value: void 0
927
1154
  });
928
- Object.defineProperty(this, "_rootStructureGroup", {
1155
+ Object.defineProperty(this, "getInternalModel", {
929
1156
  enumerable: true,
930
1157
  configurable: true,
931
1158
  writable: true,
932
- value: void 0
1159
+ value: () => {
1160
+ return this._backendModel;
1161
+ }
933
1162
  });
934
- Object.defineProperty(this, "_templateBundleProcess", {
1163
+ Object.defineProperty(this, "hasApplicableAction", {
935
1164
  enumerable: true,
936
1165
  configurable: true,
937
1166
  writable: true,
938
- value: void 0
1167
+ value: (applicableAction) => {
1168
+ if (!this._applicableActions)
1169
+ return false;
1170
+ return this._applicableActions.some(action => { var _a; return ((_a = action.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === applicableActions[applicableAction]; });
1171
+ }
939
1172
  });
940
- Object.defineProperty(this, "getInternalModel", {
1173
+ Object.defineProperty(this, "hasListLink", {
1174
+ enumerable: true,
1175
+ configurable: true,
1176
+ writable: true,
1177
+ value: (listLink) => {
1178
+ if (!this._listLinks)
1179
+ return false;
1180
+ return this._listLinks.some(link => { var _a; return ((_a = link.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === listLinks[listLink]; });
1181
+ }
1182
+ });
1183
+ Object.defineProperty(this, "hasLoadError", {
1184
+ enumerable: true,
1185
+ configurable: true,
1186
+ writable: true,
1187
+ value: (specificError) => {
1188
+ var _a;
1189
+ if (!((_a = this.loadInfo) === null || _a === void 0 ? void 0 : _a.errorType) || this.loadInfo.errorType === 'none') {
1190
+ return false;
1191
+ }
1192
+ if (specificError) {
1193
+ return this.loadInfo.errorType === specificError;
1194
+ }
1195
+ return true;
1196
+ }
1197
+ });
1198
+ Object.defineProperty(this, "getLinkToItem", {
941
1199
  enumerable: true,
942
1200
  configurable: true,
943
1201
  writable: true,
944
1202
  value: () => {
945
- return this._backendModel;
1203
+ return Link.create(this._id, this.title);
946
1204
  }
947
1205
  });
948
- this._componentSnapshotTemplate = componentSnapshotTemplate;
949
- this._componentTemplateProcess = componentTemplateProcess;
950
- this._defaultComponentTemplate = defaultComponentTemplate;
951
- this._defaultPageTemplate = defaultPageTemplate;
952
- this._defaultTemplateBuildingBlock = defaultTemplateBuildingBlock;
953
- this._pageSnapshotTemplate = pageSnapshotTemplate;
954
- this._pageTemplateProcess = pageTemplateProcess;
955
- this._rootStructureGroup = rootStructureGroup;
956
- this._templateBundleProcess = templateBundleProcess;
1206
+ this._backendModel = identifiableObjectArgs.backendModel;
1207
+ this._id = identifiableObjectArgs.id;
1208
+ this._loadInfo = identifiableObjectArgs.loadInfo;
1209
+ this._basicVersionInfo = identifiableObjectArgs.basicVersionInfo;
1210
+ this._applicableActions = identifiableObjectArgs.applicableActions;
1211
+ this._listLinks = identifiableObjectArgs.listLinks;
1212
+ this._securityDescriptor = identifiableObjectArgs.securityDescriptor;
957
1213
  }
958
1214
  /**
959
- * Component Template that is used to render the snapshot for a Component that is in Workflow.
1215
+ * Identifier (URI) of the object.
960
1216
  */
961
- get componentSnapshotTemplate() {
962
- return this._componentSnapshotTemplate;
1217
+ get id() {
1218
+ return this._id;
963
1219
  }
964
1220
  /**
965
- * Process Definition that defines the Workflow process which is triggered when Component Templates are edited.
1221
+ * Title (display name) of the object.
966
1222
  */
967
- get componentTemplateProcess() {
968
- return this._componentTemplateProcess;
1223
+ get title() {
1224
+ return this._backendModel.Title;
969
1225
  }
970
1226
  /**
971
- * The default Component Template is used to render previews of Components.
972
- * It also provides the default content for new Component Templates.
1227
+ * Information about the error that was thrown while loading an item.
973
1228
  */
974
- get defaultComponentTemplate() {
975
- return this._defaultComponentTemplate;
976
- }
977
- get defaultPageTemplate() {
978
- return this._defaultPageTemplate;
1229
+ get loadInfo() {
1230
+ return this._loadInfo;
979
1231
  }
980
1232
  /**
981
- * The default Template Building Block provides the default content for new Template Building Blocks.
1233
+ * Whether the object is editable.
982
1234
  */
983
- get defaultTemplateBuildingBlock() {
984
- return this._defaultTemplateBuildingBlock;
1235
+ get isEditable() {
1236
+ return this._backendModel.IsEditable || false;
985
1237
  }
986
1238
  /**
987
- * Locale of a publication.
1239
+ * Is this a new object? (created from the default data, not saved yet)
988
1240
  */
989
- get locale() {
990
- return this._backendModel.Locale;
1241
+ get isNew() {
1242
+ return this._id instanceof TcmUri && this._id.isNewUri;
991
1243
  }
992
1244
  /**
993
- * Path to the directory containing published binaries.
1245
+ * Version information of the object.
994
1246
  */
995
- get multimediaPath() {
996
- return this._backendModel.MultimediaPath;
1247
+ get versionInfo() {
1248
+ return this._basicVersionInfo;
997
1249
  }
998
1250
  /**
999
- * URL of the directory containing published binaries.
1251
+ * Information about the applicable actions which can be performed on the object in its current state.
1000
1252
  */
1001
- get multimediaUrl() {
1002
- return this._backendModel.MultimediaUrl;
1253
+ get applicableActions() {
1254
+ return this._applicableActions;
1003
1255
  }
1004
1256
  /**
1005
- * Page Template that is used to render the snapshot for a Page that is in Workflow.
1257
+ * Extension properties dictionary which may be used by extensions.Key must comply with XML NCName datatype.This value is not persisted by Content Manager Kernel.
1006
1258
  */
1007
- get pageSnapshotTemplate() {
1008
- return this._pageSnapshotTemplate;
1259
+ get extensionProperties() {
1260
+ return this._backendModel.ExtensionProperties;
1009
1261
  }
1010
- /**
1011
- * Process Definition that defines the Workflow process which is triggered when Page Templates are edited.
1012
- */
1013
- get pageTemplateProcess() {
1014
- return this._pageTemplateProcess;
1262
+ get listLinks() {
1263
+ return this._listLinks;
1264
+ }
1265
+ get securityDescriptor() {
1266
+ return this._securityDescriptor;
1267
+ }
1268
+ }
1269
+
1270
+ /**
1271
+ * Represents the information about the error that was thrown while loading an item.
1272
+ */
1273
+ class LoadInfo {
1274
+ constructor({ backendModel, errorType, state }) {
1275
+ Object.defineProperty(this, "_backendModel", {
1276
+ enumerable: true,
1277
+ configurable: true,
1278
+ writable: true,
1279
+ value: void 0
1280
+ });
1281
+ Object.defineProperty(this, "_errorType", {
1282
+ enumerable: true,
1283
+ configurable: true,
1284
+ writable: true,
1285
+ value: void 0
1286
+ });
1287
+ Object.defineProperty(this, "_state", {
1288
+ enumerable: true,
1289
+ configurable: true,
1290
+ writable: true,
1291
+ value: void 0
1292
+ });
1293
+ Object.defineProperty(this, "getInternalModel", {
1294
+ enumerable: true,
1295
+ configurable: true,
1296
+ writable: true,
1297
+ value: () => {
1298
+ return this._backendModel;
1299
+ }
1300
+ });
1301
+ this._backendModel = backendModel;
1302
+ this._errorType = errorType;
1303
+ this._state = state;
1015
1304
  }
1016
1305
  /**
1017
- * Publication/publish path.
1306
+ * Error message.
1018
1307
  */
1019
- get publicationPath() {
1020
- return this._backendModel.PublicationPath;
1308
+ get errorMessage() {
1309
+ return this._backendModel.ErrorMessage || '';
1021
1310
  }
1022
1311
  /**
1023
- * Type of a Publication.
1312
+ * Error type.
1024
1313
  */
1025
- get publicationType() {
1026
- return this._backendModel.PublicationType;
1314
+ get errorType() {
1315
+ return this._errorType;
1027
1316
  }
1028
1317
  /**
1029
- * Server-relative publication/publish URL.
1318
+ * Load state of item.
1030
1319
  */
1031
- get publicationUrl() {
1032
- return this._backendModel.PublicationUrl;
1320
+ get state() {
1321
+ return this._state;
1033
1322
  }
1034
- get rootStructureGroup() {
1035
- return this._rootStructureGroup;
1323
+ }
1324
+
1325
+ /**
1326
+ * Abstract base class for the data of all system-wide objects.
1327
+ */
1328
+ class SystemWideObject extends IdentifiableObject {
1329
+ constructor(systemWideObjectArgs) {
1330
+ super(systemWideObjectArgs);
1331
+ Object.defineProperty(this, "getInternalModel", {
1332
+ enumerable: true,
1333
+ configurable: true,
1334
+ writable: true,
1335
+ value: () => {
1336
+ return this._backendModel;
1337
+ }
1338
+ });
1339
+ }
1340
+ }
1341
+
1342
+ class ApprovalStatus extends SystemWideObject {
1343
+ constructor(approvalStatusArgs) {
1344
+ super(approvalStatusArgs);
1345
+ Object.defineProperty(this, "getInternalModel", {
1346
+ enumerable: true,
1347
+ configurable: true,
1348
+ writable: true,
1349
+ value: () => {
1350
+ return this._backendModel;
1351
+ }
1352
+ });
1036
1353
  }
1037
1354
  /**
1038
- * Whether to share Process Associations of Schemas and Structure Groups from a parent Publication.
1355
+ * Value indicating whether the Approval Status is deleted.
1356
+ *
1357
+ * If an Approval Status is deleted, it is not physically removed, but only flagged as deleted.
1358
+ * (and therefore suppressed from the list of Approval Statuses).
1039
1359
  */
1040
- get shareProcessAssociations() {
1041
- return this._backendModel.ShareProcessAssociations || false;
1360
+ get isDeleted() {
1361
+ return this._backendModel.IsDeleted || false;
1042
1362
  }
1043
1363
  /**
1044
- * If a Template Bundle Process is specified, Templates must be added to a Bundle before they can be checked in.
1045
- * The Bundle has to be of an appropriate type. That is: The Bundle's Schema has to be associated with this Process Definition.
1364
+ * Position of this Approval Status in the list of the Approval Statuses.
1365
+ *
1366
+ * The list of Approval Statuses is ordered, because Publication Targets can have a minimal Approval Status:
1367
+ * Approval Statuses with a Position lower than this minimal approval status won't be publishable.
1046
1368
  */
1047
- get templateBundleProcess() {
1048
- return this._templateBundleProcess;
1369
+ get position() {
1370
+ return this._backendModel.Position;
1049
1371
  }
1050
1372
  }
1051
1373
 
1052
1374
  /**
1053
- * Abstract base class for classes that represent a target for publishing: Target Type and Publication Target.
1375
+ * Represents a Multimedia Type: a type of binary content
1054
1376
  */
1055
- class PublishingTarget extends SystemWideObject {
1056
- constructor(publishingTargetArgs) {
1057
- super(publishingTargetArgs);
1377
+ class MultimediaType extends SystemWideObject {
1378
+ constructor(multimediaTypeArgs) {
1379
+ super(multimediaTypeArgs);
1058
1380
  Object.defineProperty(this, "getInternalModel", {
1059
1381
  enumerable: true,
1060
1382
  configurable: true,
@@ -1065,20 +1387,26 @@ class PublishingTarget extends SystemWideObject {
1065
1387
  });
1066
1388
  }
1067
1389
  /**
1068
- * Description of the Publishing Target.
1390
+ * File extensions associated with this Multimedia type.
1069
1391
  */
1070
- get description() {
1071
- return this._backendModel.Description;
1392
+ get fileExtensions() {
1393
+ return this._backendModel.FileExtensions;
1394
+ }
1395
+ /**
1396
+ * MIME type according to IETF RFC 2046.
1397
+ */
1398
+ get mimeType() {
1399
+ return this._backendModel.MimeType;
1072
1400
  }
1073
1401
  }
1074
1402
 
1075
1403
  /**
1076
- * Represents the data of a Target Type used as a target for publishing.
1404
+ * Represents a Repository: a context for BluePrinting.
1077
1405
  */
1078
- class TargetType extends PublishingTarget {
1406
+ class Repository extends SystemWideObject {
1079
1407
  constructor(_a) {
1080
- var { backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, minimalApprovalStatus, priority } = _a, publishingTargetArgs = __rest(_a, ["backendModel", "accessControlList", "businessProcessType", "contentSecurityDescriptor", "minimalApprovalStatus", "priority"]);
1081
- super(Object.assign({ backendModel }, publishingTargetArgs));
1408
+ var { backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, defaultMultimediaSchema, locationInfo, metadataSchema, minimalLocalizeApprovalStatus, parents, rootFolder, taskProcess, versionInfo } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "accessControlList", "businessProcessType", "contentSecurityDescriptor", "defaultMultimediaSchema", "locationInfo", "metadataSchema", "minimalLocalizeApprovalStatus", "parents", "rootFolder", "taskProcess", "versionInfo"]);
1409
+ super(Object.assign({ backendModel }, systemWideObjectArgs));
1082
1410
  Object.defineProperty(this, "_accessControlList", {
1083
1411
  enumerable: true,
1084
1412
  configurable: true,
@@ -1097,114 +1425,49 @@ class TargetType extends PublishingTarget {
1097
1425
  writable: true,
1098
1426
  value: void 0
1099
1427
  });
1100
- Object.defineProperty(this, "_minimalApprovalStatus", {
1428
+ Object.defineProperty(this, "_defaultMultimediaSchema", {
1101
1429
  enumerable: true,
1102
1430
  configurable: true,
1103
1431
  writable: true,
1104
1432
  value: void 0
1105
1433
  });
1106
- Object.defineProperty(this, "_priority", {
1434
+ Object.defineProperty(this, "_locationInfo", {
1107
1435
  enumerable: true,
1108
1436
  configurable: true,
1109
1437
  writable: true,
1110
1438
  value: void 0
1111
1439
  });
1112
- Object.defineProperty(this, "getInternalModel", {
1440
+ Object.defineProperty(this, "_metadataSchema", {
1113
1441
  enumerable: true,
1114
1442
  configurable: true,
1115
1443
  writable: true,
1116
- value: () => {
1117
- return this._backendModel;
1118
- }
1444
+ value: void 0
1119
1445
  });
1120
- this._accessControlList = accessControlList;
1121
- this._businessProcessType = businessProcessType;
1122
- this._contentSecurityDescriptor = contentSecurityDescriptor;
1123
- this._minimalApprovalStatus = minimalApprovalStatus;
1124
- this._priority = priority;
1125
- }
1126
- /**
1127
- * Access Control List which is used to restrict access to the Target Type.
1128
- *
1129
- * Notice that saving a Target Type with empty ACL is not supported. In such case the original ACL will not be modified during saving.
1130
- */
1131
- get accessControlList() {
1132
- return this._accessControlList;
1133
- }
1134
- /**
1135
- * Associated Business Process Type of this Target Type.
1136
- *
1137
- * When saving a Target Type in context of a Business Process Type this property is automatically set.
1138
- * The link to the Business Process Type is always returned in its Primary Blueprint Parent context.
1139
- */
1140
- get businessProcessType() {
1141
- return this._businessProcessType;
1142
- }
1143
- /**
1144
- * Security Descriptor which specifies the Rights and Permissions that the current user has on the content of this item.
1145
- */
1146
- get contentSecurityDescriptor() {
1147
- return this._contentSecurityDescriptor;
1148
- }
1149
- /**
1150
- * MinimalApprovalStatus of this Target Type.
1151
- *
1152
- * When rendering, items with approval status equal or "higher" than the minimal approval status of the Target Type will be rendered.
1153
- */
1154
- get minimalApprovalStatus() {
1155
- return this._minimalApprovalStatus;
1156
- }
1157
- /**
1158
- * Priority for this Target Type.
1159
- *
1160
- * When creating PublishTransaction this value is used if not overridden.
1161
- */
1162
- get priority() {
1163
- return this._priority;
1164
- }
1165
- /**
1166
- * Purpose of this Target Type in context of a Business Process Type.
1167
- *
1168
- * This property can be set in context of a Business Process Type.
1169
- * This value is case-sensitive.
1170
- */
1171
- get purpose() {
1172
- return this._backendModel.Purpose;
1173
- }
1174
- }
1175
-
1176
- /**
1177
- * Represents the data of a Batch.
1178
- */
1179
- class Batch extends SystemWideObject {
1180
- constructor(_a) {
1181
- var { backendModel, backendBatchOperation, operations, performer, status, type } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "backendBatchOperation", "operations", "performer", "status", "type"]);
1182
- super(Object.assign({ backendModel }, systemWideObjectArgs));
1183
- Object.defineProperty(this, "_backendBatchOperation", {
1446
+ Object.defineProperty(this, "_minimalLocalizeApprovalStatus", {
1184
1447
  enumerable: true,
1185
1448
  configurable: true,
1186
1449
  writable: true,
1187
1450
  value: void 0
1188
1451
  });
1189
- Object.defineProperty(this, "_performer", {
1452
+ Object.defineProperty(this, "_parents", {
1190
1453
  enumerable: true,
1191
1454
  configurable: true,
1192
1455
  writable: true,
1193
1456
  value: void 0
1194
1457
  });
1195
- Object.defineProperty(this, "_type", {
1458
+ Object.defineProperty(this, "_rootFolder", {
1196
1459
  enumerable: true,
1197
1460
  configurable: true,
1198
1461
  writable: true,
1199
1462
  value: void 0
1200
1463
  });
1201
- Object.defineProperty(this, "_operations", {
1464
+ Object.defineProperty(this, "_taskProcess", {
1202
1465
  enumerable: true,
1203
1466
  configurable: true,
1204
1467
  writable: true,
1205
1468
  value: void 0
1206
1469
  });
1207
- Object.defineProperty(this, "_status", {
1470
+ Object.defineProperty(this, "_versionInfo", {
1208
1471
  enumerable: true,
1209
1472
  configurable: true,
1210
1473
  writable: true,
@@ -1218,657 +1481,457 @@ class Batch extends SystemWideObject {
1218
1481
  return this._backendModel;
1219
1482
  }
1220
1483
  });
1221
- this._backendBatchOperation = backendBatchOperation;
1222
- this._performer = performer;
1223
- this._type = type;
1224
- this._operations = operations;
1225
- this._status = status;
1226
- }
1227
- get type() {
1228
- return this._type;
1229
- }
1230
- get status() {
1231
- return this._status;
1232
- }
1233
- get operations() {
1234
- return this._operations;
1235
- }
1236
- /**
1237
- * Additional parameters for invoking operation.
1238
- */
1239
- get parameters() {
1240
- var _a;
1241
- return (_a = this._backendBatchOperation) === null || _a === void 0 ? void 0 : _a.Parameters;
1242
- }
1243
- /**
1244
- * Whether all batch operations are finished.
1245
- */
1246
- get isFinished() {
1247
- return this.numberOfDoneOperations === this.totalNumberOfOperations;
1248
- }
1249
- /**
1250
- * Count of done operations.
1251
- */
1252
- get numberOfDoneOperations() {
1253
- return this._backendModel.NumberOfDoneOperations;
1254
- }
1255
- get performer() {
1256
- return this._performer;
1257
- }
1258
- /**
1259
- * Time in UTC, when the batch operation must be started.
1260
- */
1261
- get startAt() {
1262
- return this._backendModel.StartAt;
1263
- }
1264
- /**
1265
- * Total number of operations.
1266
- */
1267
- get totalNumberOfOperations() {
1268
- return this._backendModel.TotalNumberOfOperations;
1269
- }
1270
- }
1271
-
1272
- const eclUriItemTypes = ['undefined', 'mountpoint', 'folder', 'file', 'data', 'category', 'keyword'];
1273
- const parseEclUriItemType = (itemType) => {
1274
- const normalizedItemType = itemType.toLowerCase();
1275
- if (eclUriItemTypes.includes(normalizedItemType)) {
1276
- return normalizedItemType;
1484
+ this._accessControlList = accessControlList;
1485
+ this._businessProcessType = businessProcessType;
1486
+ this._contentSecurityDescriptor = contentSecurityDescriptor;
1487
+ this._defaultMultimediaSchema = defaultMultimediaSchema;
1488
+ this._locationInfo = locationInfo;
1489
+ this._metadataSchema = metadataSchema;
1490
+ this._minimalLocalizeApprovalStatus = minimalLocalizeApprovalStatus;
1491
+ this._parents = parents;
1492
+ this._rootFolder = rootFolder;
1493
+ this._taskProcess = taskProcess;
1494
+ this._versionInfo = versionInfo;
1277
1495
  }
1278
- return undefined;
1279
- };
1280
-
1281
- const baseSystemWideItems = 0x10000;
1282
- const baseWorkflowItems = 0x20000;
1283
- const tcmUriItemType = {
1284
- none: 0x0,
1285
- publication: 0x1,
1286
- folder: 0x2,
1287
- structureGroup: 0x4,
1288
- system: 0x7,
1289
- schema: 0x8,
1290
- component: 0x10,
1291
- componentTemplate: 0x20,
1292
- page: 0x40,
1293
- pageTemplate: 0x80,
1294
- targetGroup: 0x100,
1295
- category: 0x200,
1296
- keyword: 0x400,
1297
- templateBuildingBlock: 0x800,
1298
- businessProcessType: 0x1000,
1299
- virtualFolder: 0x2000,
1300
- publicationTarget: baseSystemWideItems + 0x1,
1301
- targetType: baseSystemWideItems + 0x2,
1302
- targetDestination: baseSystemWideItems + 0x4,
1303
- multimediaType: baseSystemWideItems + 0x8,
1304
- user: baseSystemWideItems + 0x10,
1305
- group: baseSystemWideItems + 0x20,
1306
- directoryService: baseSystemWideItems + 0x80,
1307
- directionGroupMapping: baseSystemWideItems + 0x100,
1308
- batch: baseSystemWideItems + 0x200,
1309
- publishTransaction: baseSystemWideItems + 0x400,
1310
- workflowType: baseSystemWideItems + 0x800,
1311
- approvalStatus: baseWorkflowItems + 0x1,
1312
- processDefinition: baseWorkflowItems + 0x2,
1313
- processInstance: baseWorkflowItems + 0x4,
1314
- processHistory: baseWorkflowItems + 0x8,
1315
- activityDefinition: baseWorkflowItems + 0x10,
1316
- activityInstance: baseWorkflowItems + 0x20,
1317
- activityHistory: baseWorkflowItems + 0x40,
1318
- workItem: baseWorkflowItems + 0x80,
1319
- };
1320
- const itemTypeIdToItemType = new Map();
1321
- Object.entries(tcmUriItemType).forEach(entry => {
1322
- itemTypeIdToItemType.set(entry[1], entry[0]);
1323
- });
1324
- const parseItemType = (itemType) => {
1325
- const itemTypeId = parseInt(itemType, 10);
1326
- return itemTypeIdToItemType.get(itemTypeId);
1327
- };
1496
+ get accessControlList() {
1497
+ return this._accessControlList;
1498
+ }
1499
+ get businessProcessType() {
1500
+ return this._businessProcessType;
1501
+ }
1502
+ get contentSecurityDescriptor() {
1503
+ return this._contentSecurityDescriptor;
1504
+ }
1505
+ get defaultMultimediaSchema() {
1506
+ return this._defaultMultimediaSchema;
1507
+ }
1508
+ /**
1509
+ * Whether this Repository has child Repositories in a BluePrint hierarchy.
1510
+ */
1511
+ get hasChildren() {
1512
+ return this._backendModel.HasChildren || false;
1513
+ }
1514
+ get key() {
1515
+ return this._backendModel.Key;
1516
+ }
1517
+ get locationInfo() {
1518
+ return this._locationInfo;
1519
+ }
1520
+ get metadata() {
1521
+ return this._backendModel.Metadata;
1522
+ }
1523
+ get metadataSchema() {
1524
+ return this._metadataSchema;
1525
+ }
1526
+ get minimalLocalizeApprovalStatus() {
1527
+ return this._minimalLocalizeApprovalStatus;
1528
+ }
1529
+ get parents() {
1530
+ return this._parents;
1531
+ }
1532
+ get rootFolder() {
1533
+ return this._rootFolder;
1534
+ }
1535
+ get taskProcess() {
1536
+ return this._taskProcess;
1537
+ }
1538
+ get versionInfo() {
1539
+ return this._versionInfo;
1540
+ }
1541
+ }
1328
1542
 
1329
- var _a$1;
1330
1543
  /**
1331
- * Represents a native Tridion Content Manager URI which uniquely identifies a resource in the system.
1332
- *
1333
- * The structure of a TCM URI is PublicationID-ItemID[-ItemType][-vVersion].
1544
+ * Publication: a "Repository" used for publishing.
1334
1545
  */
1335
- class TcmUri {
1336
- constructor(publicationId, itemId, itemType, itemVersion) {
1337
- Object.defineProperty(this, "_publicationId", {
1546
+ class Publication extends Repository {
1547
+ constructor(_a) {
1548
+ var { backendModel, componentSnapshotTemplate, componentTemplateProcess, defaultComponentTemplate, defaultPageTemplate, defaultTemplateBuildingBlock, pageSnapshotTemplate, pageTemplateProcess, rootStructureGroup, templateBundleProcess } = _a, repositoryArgs = __rest(_a, ["backendModel", "componentSnapshotTemplate", "componentTemplateProcess", "defaultComponentTemplate", "defaultPageTemplate", "defaultTemplateBuildingBlock", "pageSnapshotTemplate", "pageTemplateProcess", "rootStructureGroup", "templateBundleProcess"]);
1549
+ super(Object.assign({ backendModel }, repositoryArgs));
1550
+ Object.defineProperty(this, "_componentSnapshotTemplate", {
1338
1551
  enumerable: true,
1339
1552
  configurable: true,
1340
1553
  writable: true,
1341
1554
  value: void 0
1342
1555
  });
1343
- Object.defineProperty(this, "_itemId", {
1556
+ Object.defineProperty(this, "_componentTemplateProcess", {
1344
1557
  enumerable: true,
1345
1558
  configurable: true,
1346
1559
  writable: true,
1347
1560
  value: void 0
1348
1561
  });
1349
- Object.defineProperty(this, "_itemType", {
1562
+ Object.defineProperty(this, "_defaultComponentTemplate", {
1350
1563
  enumerable: true,
1351
1564
  configurable: true,
1352
1565
  writable: true,
1353
1566
  value: void 0
1354
1567
  });
1355
- Object.defineProperty(this, "_itemVersion", {
1568
+ Object.defineProperty(this, "_defaultPageTemplate", {
1356
1569
  enumerable: true,
1357
1570
  configurable: true,
1358
1571
  writable: true,
1359
1572
  value: void 0
1360
1573
  });
1361
- Object.defineProperty(this, "_asString", {
1574
+ Object.defineProperty(this, "_defaultTemplateBuildingBlock", {
1362
1575
  enumerable: true,
1363
1576
  configurable: true,
1364
1577
  writable: true,
1365
1578
  value: void 0
1366
1579
  });
1367
- Object.defineProperty(this, "getPublicationUri", {
1580
+ Object.defineProperty(this, "_pageSnapshotTemplate", {
1368
1581
  enumerable: true,
1369
1582
  configurable: true,
1370
1583
  writable: true,
1371
- value: () => {
1372
- if (this._itemType === 'publication')
1373
- return this;
1374
- return TcmUri.createPublicationUri(this._publicationId);
1375
- }
1584
+ value: void 0
1376
1585
  });
1377
- Object.defineProperty(this, "getVersionlessUri", {
1586
+ Object.defineProperty(this, "_pageTemplateProcess", {
1378
1587
  enumerable: true,
1379
1588
  configurable: true,
1380
1589
  writable: true,
1381
- value: () => {
1382
- return TcmUri.create(this._publicationId, this._itemId, this._itemType);
1383
- }
1590
+ value: void 0
1384
1591
  });
1385
- Object.defineProperty(this, "getUriWithVersion", {
1592
+ Object.defineProperty(this, "_rootStructureGroup", {
1386
1593
  enumerable: true,
1387
1594
  configurable: true,
1388
1595
  writable: true,
1389
- value: (version) => {
1390
- return TcmUri.create(this._publicationId, this._itemId, this._itemType, version);
1391
- }
1596
+ value: void 0
1392
1597
  });
1393
- Object.defineProperty(this, "getUriInPublication", {
1598
+ Object.defineProperty(this, "_templateBundleProcess", {
1394
1599
  enumerable: true,
1395
1600
  configurable: true,
1396
1601
  writable: true,
1397
- value: (publicationUri) => {
1398
- return TcmUri.create(publicationUri._itemId, this._itemId, this._itemType, this._itemVersion);
1602
+ value: void 0
1603
+ });
1604
+ Object.defineProperty(this, "getInternalModel", {
1605
+ enumerable: true,
1606
+ configurable: true,
1607
+ writable: true,
1608
+ value: () => {
1609
+ return this._backendModel;
1399
1610
  }
1400
1611
  });
1401
- this._publicationId = publicationId;
1402
- this._itemId = itemId;
1403
- this._itemType = itemType;
1404
- this._itemVersion = itemVersion;
1405
- const parts = [this._publicationId.toString(), this._itemId.toString()];
1406
- if (this._itemType !== 'component') {
1407
- parts.push(tcmUriItemType[this._itemType].toString());
1408
- }
1409
- if (this._itemVersion !== undefined) {
1410
- parts.push(`v${this._itemVersion}`);
1411
- }
1412
- this._asString = `tcm:${parts.join('-')}`;
1413
- }
1414
- get publicationId() {
1415
- return this._publicationId;
1416
- }
1417
- get itemId() {
1418
- return this._itemId;
1419
- }
1420
- get itemType() {
1421
- return this._itemType;
1422
- }
1423
- get version() {
1424
- return this._itemVersion;
1425
- }
1426
- get hasVersion() {
1427
- return this._itemVersion !== undefined;
1612
+ this._componentSnapshotTemplate = componentSnapshotTemplate;
1613
+ this._componentTemplateProcess = componentTemplateProcess;
1614
+ this._defaultComponentTemplate = defaultComponentTemplate;
1615
+ this._defaultPageTemplate = defaultPageTemplate;
1616
+ this._defaultTemplateBuildingBlock = defaultTemplateBuildingBlock;
1617
+ this._pageSnapshotTemplate = pageSnapshotTemplate;
1618
+ this._pageTemplateProcess = pageTemplateProcess;
1619
+ this._rootStructureGroup = rootStructureGroup;
1620
+ this._templateBundleProcess = templateBundleProcess;
1428
1621
  }
1429
- get isNullUri() {
1430
- return this._publicationId === 0 && this._itemId === 0 && this._itemType === 'none';
1622
+ /**
1623
+ * Component Template that is used to render the snapshot for a Component that is in Workflow.
1624
+ */
1625
+ get componentSnapshotTemplate() {
1626
+ return this._componentSnapshotTemplate;
1431
1627
  }
1432
- get isSystemUri() {
1433
- return this._publicationId === 0 && this._itemId === 0 && this._itemType === 'system';
1628
+ /**
1629
+ * Process Definition that defines the Workflow process which is triggered when Component Templates are edited.
1630
+ */
1631
+ get componentTemplateProcess() {
1632
+ return this._componentTemplateProcess;
1434
1633
  }
1435
- get isEditableVersion() {
1436
- return this.isNullUri || this._itemVersion === TcmUri._editableVersion;
1634
+ /**
1635
+ * The default Component Template is used to render previews of Components.
1636
+ * It also provides the default content for new Component Templates.
1637
+ */
1638
+ get defaultComponentTemplate() {
1639
+ return this._defaultComponentTemplate;
1437
1640
  }
1438
- get isDynamic() {
1439
- return this._itemVersion === 0;
1641
+ get defaultPageTemplate() {
1642
+ return this._defaultPageTemplate;
1440
1643
  }
1441
- get asString() {
1442
- return this._asString;
1644
+ /**
1645
+ * The default Template Building Block provides the default content for new Template Building Blocks.
1646
+ */
1647
+ get defaultTemplateBuildingBlock() {
1648
+ return this._defaultTemplateBuildingBlock;
1443
1649
  }
1444
- }
1445
- _a$1 = TcmUri;
1446
- Object.defineProperty(TcmUri, "_tcmUriCache", {
1447
- enumerable: true,
1448
- configurable: true,
1449
- writable: true,
1450
- value: new Map()
1451
- });
1452
- Object.defineProperty(TcmUri, "_tcmUriRegExp", {
1453
- enumerable: true,
1454
- configurable: true,
1455
- writable: true,
1456
- value: new RegExp(/^tcm:([0-9]+)-([0-9]+)(-([0-9]+))?(-v([0-9]+))?$/)
1457
- });
1458
- Object.defineProperty(TcmUri, "_editableVersion", {
1459
- enumerable: true,
1460
- configurable: true,
1461
- writable: true,
1462
- value: 0
1463
- });
1464
- Object.defineProperty(TcmUri, "create", {
1465
- enumerable: true,
1466
- configurable: true,
1467
- writable: true,
1468
- value: (publicationId, itemId, itemType, itemVersion) => {
1469
- const tcmUri = new TcmUri(publicationId, itemId, itemType, itemVersion);
1470
- const cachedTcmUri = TcmUri._tcmUriCache.get(tcmUri.asString);
1471
- if (cachedTcmUri)
1472
- return cachedTcmUri;
1473
- TcmUri._tcmUriCache.set(tcmUri.asString, tcmUri);
1474
- return tcmUri;
1650
+ /**
1651
+ * Locale of a publication.
1652
+ */
1653
+ get locale() {
1654
+ return this._backendModel.Locale;
1475
1655
  }
1476
- });
1477
- Object.defineProperty(TcmUri, "null", {
1478
- enumerable: true,
1479
- configurable: true,
1480
- writable: true,
1481
- value: TcmUri.create(0, 0, 'none')
1482
- });
1483
- Object.defineProperty(TcmUri, "system", {
1484
- enumerable: true,
1485
- configurable: true,
1486
- writable: true,
1487
- value: TcmUri.create(0, 0, 'system')
1488
- });
1489
- Object.defineProperty(TcmUri, "parse", {
1490
- enumerable: true,
1491
- configurable: true,
1492
- writable: true,
1493
- value: (input) => {
1494
- const cachedTcmUri = TcmUri._tcmUriCache.get(input);
1495
- if (cachedTcmUri)
1496
- return cachedTcmUri;
1497
- const result = _a$1._tcmUriRegExp.exec(input);
1498
- if (!result)
1499
- return undefined;
1500
- const pubIdPart = result[1];
1501
- const itemIdPart = result[2];
1502
- const itemTypePart = result[4];
1503
- const itemVersionPart = result[6];
1504
- if (!result || pubIdPart === undefined || itemIdPart === undefined)
1505
- return undefined;
1506
- const publicationId = parseInt(pubIdPart, 10);
1507
- if (isNaN(publicationId) || publicationId < 0)
1508
- return undefined;
1509
- const itemId = parseInt(itemIdPart, 10);
1510
- if (isNaN(itemId) || itemId < 0)
1511
- return undefined;
1512
- let itemType;
1513
- if (itemTypePart) {
1514
- const parsedItemType = parseItemType(itemTypePart);
1515
- if (!parsedItemType)
1516
- return undefined;
1517
- itemType = parsedItemType;
1518
- }
1519
- else {
1520
- itemType = 'component';
1521
- }
1522
- let version;
1523
- if (itemVersionPart) {
1524
- version = parseInt(itemVersionPart, 10);
1525
- if (isNaN(version) || version < 0)
1526
- return undefined;
1527
- }
1528
- return TcmUri.create(publicationId, itemId, itemType, version);
1656
+ /**
1657
+ * Path to the directory containing published binaries.
1658
+ */
1659
+ get multimediaPath() {
1660
+ return this._backendModel.MultimediaPath;
1529
1661
  }
1530
- });
1531
- Object.defineProperty(TcmUri, "createPublicationUri", {
1532
- enumerable: true,
1533
- configurable: true,
1534
- writable: true,
1535
- value: (publicationId) => {
1536
- return TcmUri.create(0, publicationId, 'publication');
1662
+ /**
1663
+ * URL of the directory containing published binaries.
1664
+ */
1665
+ get multimediaUrl() {
1666
+ return this._backendModel.MultimediaUrl;
1537
1667
  }
1538
- });
1668
+ /**
1669
+ * Page Template that is used to render the snapshot for a Page that is in Workflow.
1670
+ */
1671
+ get pageSnapshotTemplate() {
1672
+ return this._pageSnapshotTemplate;
1673
+ }
1674
+ /**
1675
+ * Process Definition that defines the Workflow process which is triggered when Page Templates are edited.
1676
+ */
1677
+ get pageTemplateProcess() {
1678
+ return this._pageTemplateProcess;
1679
+ }
1680
+ /**
1681
+ * Publication/publish path.
1682
+ */
1683
+ get publicationPath() {
1684
+ return this._backendModel.PublicationPath;
1685
+ }
1686
+ /**
1687
+ * Type of a Publication.
1688
+ */
1689
+ get publicationType() {
1690
+ return this._backendModel.PublicationType;
1691
+ }
1692
+ /**
1693
+ * Server-relative publication/publish URL.
1694
+ */
1695
+ get publicationUrl() {
1696
+ return this._backendModel.PublicationUrl;
1697
+ }
1698
+ get rootStructureGroup() {
1699
+ return this._rootStructureGroup;
1700
+ }
1701
+ /**
1702
+ * Whether to share Process Associations of Schemas and Structure Groups from a parent Publication.
1703
+ */
1704
+ get shareProcessAssociations() {
1705
+ return this._backendModel.ShareProcessAssociations || false;
1706
+ }
1707
+ /**
1708
+ * If a Template Bundle Process is specified, Templates must be added to a Bundle before they can be checked in.
1709
+ * The Bundle has to be of an appropriate type. That is: The Bundle's Schema has to be associated with this Process Definition.
1710
+ */
1711
+ get templateBundleProcess() {
1712
+ return this._templateBundleProcess;
1713
+ }
1714
+ }
1539
1715
 
1540
- var _a;
1541
- class EclUri {
1542
- constructor(publicationId, mountPointId, itemId, itemType, subType, itemVersion) {
1543
- /**
1544
- * Id of the Tridion Publication this EclUri belongs to.
1545
- */
1546
- Object.defineProperty(this, "_publicationId", {
1547
- enumerable: true,
1548
- configurable: true,
1549
- writable: true,
1550
- value: void 0
1551
- });
1552
- /**
1553
- * Mount Point identifier responsible for handling this URI.
1554
- * The ID of each Mount Point specified in configuration. It should not be changed once the Mount Point is in use.
1555
- */
1556
- Object.defineProperty(this, "_mountPointId", {
1716
+ /**
1717
+ * Abstract base class for classes that represent a target for publishing: Target Type and Publication Target.
1718
+ */
1719
+ class PublishingTarget extends SystemWideObject {
1720
+ constructor(publishingTargetArgs) {
1721
+ super(publishingTargetArgs);
1722
+ Object.defineProperty(this, "getInternalModel", {
1557
1723
  enumerable: true,
1558
1724
  configurable: true,
1559
1725
  writable: true,
1560
- value: void 0
1726
+ value: () => {
1727
+ return this._backendModel;
1728
+ }
1561
1729
  });
1562
- /**
1563
- * Provider-specified item id.
1564
- */
1565
- Object.defineProperty(this, "_itemId", {
1730
+ }
1731
+ /**
1732
+ * Description of the Publishing Target.
1733
+ */
1734
+ get description() {
1735
+ return this._backendModel.Description;
1736
+ }
1737
+ }
1738
+
1739
+ /**
1740
+ * Represents the data of a Target Type used as a target for publishing.
1741
+ */
1742
+ class TargetType extends PublishingTarget {
1743
+ constructor(_a) {
1744
+ var { backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, minimalApprovalStatus, priority } = _a, publishingTargetArgs = __rest(_a, ["backendModel", "accessControlList", "businessProcessType", "contentSecurityDescriptor", "minimalApprovalStatus", "priority"]);
1745
+ super(Object.assign({ backendModel }, publishingTargetArgs));
1746
+ Object.defineProperty(this, "_accessControlList", {
1566
1747
  enumerable: true,
1567
1748
  configurable: true,
1568
1749
  writable: true,
1569
1750
  value: void 0
1570
1751
  });
1571
- /**
1572
- * External Content Library item type.
1573
- */
1574
- Object.defineProperty(this, "_itemType", {
1752
+ Object.defineProperty(this, "_businessProcessType", {
1575
1753
  enumerable: true,
1576
1754
  configurable: true,
1577
1755
  writable: true,
1578
1756
  value: void 0
1579
1757
  });
1580
- /**
1581
- * Provider-specified item type.
1582
- */
1583
- Object.defineProperty(this, "_subType", {
1758
+ Object.defineProperty(this, "_contentSecurityDescriptor", {
1584
1759
  enumerable: true,
1585
1760
  configurable: true,
1586
1761
  writable: true,
1587
1762
  value: void 0
1588
1763
  });
1589
- /**
1590
- * Version number part of the URL;
1591
- * The version identifies the version number of the Tridion stub Component generated for this item (if any), not the
1592
- * version on the remote system.
1593
- */
1594
- Object.defineProperty(this, "_itemVersion", {
1764
+ Object.defineProperty(this, "_minimalApprovalStatus", {
1595
1765
  enumerable: true,
1596
1766
  configurable: true,
1597
1767
  writable: true,
1598
1768
  value: void 0
1599
1769
  });
1600
- Object.defineProperty(this, "_asString", {
1770
+ Object.defineProperty(this, "_priority", {
1601
1771
  enumerable: true,
1602
1772
  configurable: true,
1603
1773
  writable: true,
1604
1774
  value: void 0
1605
1775
  });
1606
- Object.defineProperty(this, "getPublicationUri", {
1607
- enumerable: true,
1608
- configurable: true,
1609
- writable: true,
1610
- value: () => {
1611
- return TcmUri.createPublicationUri(this._publicationId);
1612
- }
1613
- });
1614
- Object.defineProperty(this, "getVersionlessUri", {
1615
- enumerable: true,
1616
- configurable: true,
1617
- writable: true,
1618
- value: () => {
1619
- return EclUri.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType);
1620
- }
1621
- });
1622
- Object.defineProperty(this, "getMountPointUri", {
1776
+ Object.defineProperty(this, "getInternalModel", {
1623
1777
  enumerable: true,
1624
1778
  configurable: true,
1625
1779
  writable: true,
1626
1780
  value: () => {
1627
- if (this._itemType === 'mountpoint')
1628
- return this;
1629
- return EclUri.create(this._publicationId, this._mountPointId, 'root', 'mountpoint', 'mp');
1630
- }
1631
- });
1632
- Object.defineProperty(this, "getUriWithVersion", {
1633
- enumerable: true,
1634
- configurable: true,
1635
- writable: true,
1636
- value: (version) => {
1637
- return EclUri.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType, version);
1638
- }
1639
- });
1640
- Object.defineProperty(this, "getUriInPublication", {
1641
- enumerable: true,
1642
- configurable: true,
1643
- writable: true,
1644
- value: (publicationUri) => {
1645
- return EclUri.create(publicationUri.itemId, this._mountPointId, this._itemId, this._itemType, this._subType, this._itemVersion);
1781
+ return this._backendModel;
1646
1782
  }
1647
1783
  });
1648
- this._publicationId = publicationId;
1649
- this._mountPointId = mountPointId;
1650
- this._itemId = itemId;
1651
- this._itemType = itemType;
1652
- this._subType = subType;
1653
- this._itemVersion = itemVersion;
1654
- const parts = [
1655
- this._publicationId.toString(),
1656
- this._mountPointId.toString(),
1657
- this._itemId.toString(),
1658
- this._subType.toString(),
1659
- this._itemType.toString(),
1660
- ];
1661
- if (this._itemVersion !== undefined) {
1662
- parts.push(`v${this._itemVersion}`);
1663
- }
1664
- this._asString = `ecl:${parts.join('-')}`;
1665
- }
1666
- get publicationId() {
1667
- return this._publicationId;
1668
- }
1669
- get itemId() {
1670
- return this._itemId;
1671
- }
1672
- get mountPointId() {
1673
- return this._mountPointId;
1674
- }
1675
- get itemType() {
1676
- return this._itemType;
1677
- }
1678
- get version() {
1679
- return this._itemVersion;
1680
- }
1681
- get hasVersion() {
1682
- return this._itemVersion !== undefined;
1683
- }
1684
- get isNullUri() {
1685
- return !this._mountPointId;
1686
- }
1687
- get isDynamic() {
1688
- return this._itemVersion === 0;
1784
+ this._accessControlList = accessControlList;
1785
+ this._businessProcessType = businessProcessType;
1786
+ this._contentSecurityDescriptor = contentSecurityDescriptor;
1787
+ this._minimalApprovalStatus = minimalApprovalStatus;
1788
+ this._priority = priority;
1689
1789
  }
1690
- get asString() {
1691
- return this._asString;
1790
+ /**
1791
+ * Access Control List which is used to restrict access to the Target Type.
1792
+ *
1793
+ * Notice that saving a Target Type with empty ACL is not supported. In such case the original ACL will not be modified during saving.
1794
+ */
1795
+ get accessControlList() {
1796
+ return this._accessControlList;
1692
1797
  }
1693
- }
1694
- _a = EclUri;
1695
- Object.defineProperty(EclUri, "_eclUriCache", {
1696
- enumerable: true,
1697
- configurable: true,
1698
- writable: true,
1699
- value: new Map()
1700
- });
1701
- Object.defineProperty(EclUri, "_eclUriRegExp", {
1702
- enumerable: true,
1703
- configurable: true,
1704
- writable: true,
1705
- value: new RegExp(/^ecl:(\d+)-([^\s-]+)-([^\s-]+)-([^\s-]*)-([^\s\(\)-]+)(-v(\d+))?$/)
1706
- });
1707
- Object.defineProperty(EclUri, "create", {
1708
- enumerable: true,
1709
- configurable: true,
1710
- writable: true,
1711
- value: (publicationId, mountPointId, itemId, itemType, subType, itemVersion) => {
1712
- const eclUri = new EclUri(publicationId, mountPointId, itemId, itemType, subType, itemVersion);
1713
- const cachedEclUri = EclUri._eclUriCache.get(eclUri.asString);
1714
- if (cachedEclUri)
1715
- return cachedEclUri;
1716
- EclUri._eclUriCache.set(eclUri.asString, eclUri);
1717
- return eclUri;
1798
+ /**
1799
+ * Associated Business Process Type of this Target Type.
1800
+ *
1801
+ * When saving a Target Type in context of a Business Process Type this property is automatically set.
1802
+ * The link to the Business Process Type is always returned in its Primary Blueprint Parent context.
1803
+ */
1804
+ get businessProcessType() {
1805
+ return this._businessProcessType;
1718
1806
  }
1719
- });
1720
- Object.defineProperty(EclUri, "parse", {
1721
- enumerable: true,
1722
- configurable: true,
1723
- writable: true,
1724
- value: (input) => {
1725
- const result = _a._eclUriRegExp.exec(input);
1726
- if (!result)
1727
- return undefined;
1728
- const pubIdPart = result[1];
1729
- const mountPointIdPart = result[2];
1730
- const itemIdPart = result[3];
1731
- const subTypePart = result[4];
1732
- const itemTypePart = result[5];
1733
- const itemVersionPart = result[7];
1734
- if (pubIdPart === undefined ||
1735
- mountPointIdPart === undefined ||
1736
- itemIdPart === undefined ||
1737
- subTypePart === undefined ||
1738
- itemTypePart === undefined)
1739
- return undefined;
1740
- const publicationId = parseInt(pubIdPart, 10);
1741
- if (isNaN(publicationId) || publicationId < 0)
1742
- return undefined;
1743
- const mountPointId = mountPointIdPart;
1744
- const itemId = itemIdPart;
1745
- const subType = subTypePart;
1746
- const itemType = parseEclUriItemType(itemTypePart);
1747
- if (!itemType)
1748
- return undefined;
1749
- let version;
1750
- if (itemVersionPart) {
1751
- version = parseInt(itemVersionPart, 10);
1752
- if (isNaN(version) || version < 0)
1753
- return undefined;
1754
- }
1755
- return EclUri.create(publicationId, mountPointId, itemId, itemType, subType, version);
1807
+ /**
1808
+ * Security Descriptor which specifies the Rights and Permissions that the current user has on the content of this item.
1809
+ */
1810
+ get contentSecurityDescriptor() {
1811
+ return this._contentSecurityDescriptor;
1756
1812
  }
1757
- });
1813
+ /**
1814
+ * MinimalApprovalStatus of this Target Type.
1815
+ *
1816
+ * When rendering, items with approval status equal or "higher" than the minimal approval status of the Target Type will be rendered.
1817
+ */
1818
+ get minimalApprovalStatus() {
1819
+ return this._minimalApprovalStatus;
1820
+ }
1821
+ /**
1822
+ * Priority for this Target Type.
1823
+ *
1824
+ * When creating PublishTransaction this value is used if not overridden.
1825
+ */
1826
+ get priority() {
1827
+ return this._priority;
1828
+ }
1829
+ /**
1830
+ * Purpose of this Target Type in context of a Business Process Type.
1831
+ *
1832
+ * This property can be set in context of a Business Process Type.
1833
+ * This value is case-sensitive.
1834
+ */
1835
+ get purpose() {
1836
+ return this._backendModel.Purpose;
1837
+ }
1838
+ }
1758
1839
 
1759
- class VirtualUri {
1760
- constructor(publicationUri, itemType) {
1761
- Object.defineProperty(this, "_publicationUri", {
1840
+ /**
1841
+ * Represents the data of a Batch.
1842
+ */
1843
+ class Batch extends SystemWideObject {
1844
+ constructor(_a) {
1845
+ var { backendModel, backendBatchOperation, operations, performer, status, type } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "backendBatchOperation", "operations", "performer", "status", "type"]);
1846
+ super(Object.assign({ backendModel }, systemWideObjectArgs));
1847
+ Object.defineProperty(this, "_backendBatchOperation", {
1762
1848
  enumerable: true,
1763
1849
  configurable: true,
1764
1850
  writable: true,
1765
1851
  value: void 0
1766
1852
  });
1767
- Object.defineProperty(this, "_itemType", {
1853
+ Object.defineProperty(this, "_performer", {
1768
1854
  enumerable: true,
1769
1855
  configurable: true,
1770
1856
  writable: true,
1771
1857
  value: void 0
1772
1858
  });
1773
- Object.defineProperty(this, "_asString", {
1859
+ Object.defineProperty(this, "_type", {
1774
1860
  enumerable: true,
1775
1861
  configurable: true,
1776
1862
  writable: true,
1777
1863
  value: void 0
1778
1864
  });
1779
- Object.defineProperty(this, "getPublicationUri", {
1865
+ Object.defineProperty(this, "_operations", {
1780
1866
  enumerable: true,
1781
1867
  configurable: true,
1782
1868
  writable: true,
1783
- value: () => {
1784
- return this._publicationUri;
1785
- }
1869
+ value: void 0
1786
1870
  });
1787
- Object.defineProperty(this, "getUriInPublication", {
1871
+ Object.defineProperty(this, "_status", {
1788
1872
  enumerable: true,
1789
1873
  configurable: true,
1790
1874
  writable: true,
1791
- value: (publicationUri) => {
1792
- return VirtualUri.create(publicationUri, this._itemType);
1875
+ value: void 0
1876
+ });
1877
+ Object.defineProperty(this, "getInternalModel", {
1878
+ enumerable: true,
1879
+ configurable: true,
1880
+ writable: true,
1881
+ value: () => {
1882
+ return this._backendModel;
1793
1883
  }
1794
1884
  });
1795
- this._publicationUri = publicationUri;
1796
- this._itemType = itemType;
1797
- const namespace = this._itemType === 'businessProcessTypes' ? 'bptman-' : 'catman-';
1798
- this._asString = `${namespace}${this._publicationUri.asString}`;
1885
+ this._backendBatchOperation = backendBatchOperation;
1886
+ this._performer = performer;
1887
+ this._type = type;
1888
+ this._operations = operations;
1889
+ this._status = status;
1799
1890
  }
1800
- get itemType() {
1801
- return this._itemType;
1891
+ get type() {
1892
+ return this._type;
1802
1893
  }
1803
- get isDynamic() {
1804
- return false;
1894
+ get status() {
1895
+ return this._status;
1805
1896
  }
1806
- get asString() {
1807
- return this._asString;
1897
+ get operations() {
1898
+ return this._operations;
1808
1899
  }
1809
- }
1810
- Object.defineProperty(VirtualUri, "_virtualUriCache", {
1811
- enumerable: true,
1812
- configurable: true,
1813
- writable: true,
1814
- value: new Map()
1815
- });
1816
- Object.defineProperty(VirtualUri, "create", {
1817
- enumerable: true,
1818
- configurable: true,
1819
- writable: true,
1820
- value: (publicationUri, itemType) => {
1821
- const virtualUri = new VirtualUri(publicationUri, itemType);
1822
- const cachedVirtualUri = VirtualUri._virtualUriCache.get(virtualUri.asString);
1823
- if (cachedVirtualUri)
1824
- return cachedVirtualUri;
1825
- VirtualUri._virtualUriCache.set(virtualUri.asString, virtualUri);
1826
- return virtualUri;
1900
+ /**
1901
+ * Additional parameters for invoking operation.
1902
+ */
1903
+ get parameters() {
1904
+ var _a;
1905
+ return (_a = this._backendBatchOperation) === null || _a === void 0 ? void 0 : _a.Parameters;
1827
1906
  }
1828
- });
1829
- Object.defineProperty(VirtualUri, "parse", {
1830
- enumerable: true,
1831
- configurable: true,
1832
- writable: true,
1833
- value: (input) => {
1834
- let itemIdPart;
1835
- let itemType;
1836
- if (input.startsWith('bptman-')) {
1837
- itemIdPart = input.replace('bptman-', '');
1838
- itemType = 'businessProcessTypes';
1839
- }
1840
- if (input.startsWith('catman-')) {
1841
- itemIdPart = input.replace('catman-', '');
1842
- itemType = 'taxonomies';
1843
- }
1844
- if (!itemIdPart || !itemType)
1845
- return undefined;
1846
- const publicationUri = TcmUri.parse(itemIdPart);
1847
- if (!publicationUri)
1848
- return undefined;
1849
- return VirtualUri.create(publicationUri, itemType);
1907
+ /**
1908
+ * Whether all batch operations are finished.
1909
+ */
1910
+ get isFinished() {
1911
+ return this.numberOfDoneOperations === this.totalNumberOfOperations;
1850
1912
  }
1851
- });
1852
-
1853
- const tryParseItemUri = (backendId) => {
1854
- const tcmUri = TcmUri.parse(backendId);
1855
- if (tcmUri)
1856
- return tcmUri;
1857
- const eclUri = EclUri.parse(backendId);
1858
- if (eclUri)
1859
- return eclUri;
1860
- const virtualUri = VirtualUri.parse(backendId);
1861
- if (virtualUri)
1862
- return virtualUri;
1863
- return undefined;
1864
- };
1865
- const parseItemUri = (backendId) => {
1866
- const itemUri = tryParseItemUri(backendId);
1867
- if (!itemUri) {
1868
- throw new Error(`Unknown item uri format: ${backendId}`);
1913
+ /**
1914
+ * Count of done operations.
1915
+ */
1916
+ get numberOfDoneOperations() {
1917
+ return this._backendModel.NumberOfDoneOperations;
1869
1918
  }
1870
- return itemUri;
1871
- };
1919
+ get performer() {
1920
+ return this._performer;
1921
+ }
1922
+ /**
1923
+ * Time in UTC, when the batch operation must be started.
1924
+ */
1925
+ get startAt() {
1926
+ return this._backendModel.StartAt;
1927
+ }
1928
+ /**
1929
+ * Total number of operations.
1930
+ */
1931
+ get totalNumberOfOperations() {
1932
+ return this._backendModel.TotalNumberOfOperations;
1933
+ }
1934
+ }
1872
1935
 
1873
1936
  const mapBatchOperationState = (backendModel) => {
1874
1937
  switch (backendModel) {
@@ -2381,20 +2444,20 @@ const accessControlEntryMapping = {
2381
2444
 
2382
2445
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2383
2446
 
2384
- const createEnumObject = (values) => {
2385
- return values.reduce((acc, currentVal) => {
2386
- acc[currentVal] = currentVal;
2387
- return acc;
2388
- }, {});
2447
+ const createEnumObject = (values) => {
2448
+ return values.reduce((acc, currentVal) => {
2449
+ acc[currentVal] = currentVal;
2450
+ return acc;
2451
+ }, {});
2389
2452
  };
2390
2453
 
2391
- const isDefined = (value) => {
2392
- return value !== undefined && value !== null;
2454
+ const isDefined = (value) => {
2455
+ return value !== undefined && value !== null;
2393
2456
  };
2394
2457
 
2395
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2396
- const isExactInstanceOf = (value, ctor) => {
2397
- return Object.getPrototypeOf(value) === ctor.prototype;
2458
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2459
+ const isExactInstanceOf = (value, ctor) => {
2460
+ return Object.getPrototypeOf(value) === ctor.prototype;
2398
2461
  };
2399
2462
 
2400
2463
  const accessControlListMapping = {
@@ -2516,16 +2579,7 @@ const mapApprovalStatusConstructorArgs = mapSystemWideObjectConstructorArgs;
2516
2579
  const approvalStatusMapping = {
2517
2580
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ApprovalStatus',
2518
2581
  mapper: (mappingRegistry, backendModel) => {
2519
- const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor } = mapApprovalStatusConstructorArgs(mappingRegistry, backendModel);
2520
- return new ApprovalStatus({
2521
- backendModel,
2522
- applicableActions,
2523
- basicVersionInfo,
2524
- id,
2525
- listLinks,
2526
- loadInfo,
2527
- securityDescriptor,
2528
- });
2582
+ return new ApprovalStatus(Object.assign(Object.assign({}, mapApprovalStatusConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2529
2583
  },
2530
2584
  };
2531
2585
 
@@ -2533,16 +2587,14 @@ const mapMultimediaTypeConstructorArgs = mapSystemWideObjectConstructorArgs;
2533
2587
  const multimediaTypeMapping = {
2534
2588
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultimediaType',
2535
2589
  mapper: (mappingRegistry, backendModel) => {
2536
- const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor } = mapMultimediaTypeConstructorArgs(mappingRegistry, backendModel);
2537
- return new MultimediaType({
2538
- backendModel,
2539
- applicableActions,
2540
- basicVersionInfo,
2541
- id,
2542
- listLinks,
2543
- loadInfo,
2544
- securityDescriptor,
2545
- });
2590
+ return new MultimediaType(Object.assign(Object.assign({}, mapMultimediaTypeConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2591
+ },
2592
+ };
2593
+
2594
+ const hateoasLinkMapping = {
2595
+ identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'HateoasLink',
2596
+ mapper: (mappingRegistry, backendModel) => {
2597
+ return new HateoasLink(backendModel);
2546
2598
  },
2547
2599
  };
2548
2600
 
@@ -2641,32 +2693,12 @@ const mapRepositoryConstructorArgs = (mappingRegistry, backendModel) => {
2641
2693
  parents,
2642
2694
  rootFolder,
2643
2695
  taskProcess,
2644
- versionInfo });
2645
- };
2646
- const repositoryMapping = {
2647
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Repository',
2648
- mapper: (mappingRegistry, backendModel) => {
2649
- const { accessControlList, businessProcessType, contentSecurityDescriptor, defaultMultimediaSchema, locationInfo, metadataSchema, minimalLocalizeApprovalStatus, parents, rootFolder, taskProcess, versionInfo, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, } = mapRepositoryConstructorArgs(mappingRegistry, backendModel);
2650
- return new Repository({
2651
- accessControlList,
2652
- applicableActions,
2653
- backendModel,
2654
- basicVersionInfo,
2655
- businessProcessType,
2656
- contentSecurityDescriptor,
2657
- defaultMultimediaSchema,
2658
- id,
2659
- listLinks,
2660
- loadInfo,
2661
- locationInfo,
2662
- metadataSchema,
2663
- minimalLocalizeApprovalStatus,
2664
- parents,
2665
- rootFolder,
2666
- securityDescriptor,
2667
- taskProcess,
2668
- versionInfo,
2669
- });
2696
+ versionInfo });
2697
+ };
2698
+ const repositoryMapping = {
2699
+ identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Repository',
2700
+ mapper: (mappingRegistry, backendModel) => {
2701
+ return new Repository(Object.assign(Object.assign({}, mapRepositoryConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2670
2702
  },
2671
2703
  };
2672
2704
 
@@ -2712,36 +2744,7 @@ const mapPublicationConstructorArgs = (mappingRegistry, backendModel) => {
2712
2744
  const publicationMapping = {
2713
2745
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Publication',
2714
2746
  mapper: (mappingRegistry, backendModel) => {
2715
- const { accessControlList, applicableActions, basicVersionInfo, businessProcessType, componentSnapshotTemplate, componentTemplateProcess, contentSecurityDescriptor, defaultComponentTemplate, defaultMultimediaSchema, defaultPageTemplate, defaultTemplateBuildingBlock, id, listLinks, loadInfo, locationInfo, metadataSchema, minimalLocalizeApprovalStatus, pageSnapshotTemplate, pageTemplateProcess, parents, rootFolder, rootStructureGroup, securityDescriptor, taskProcess, templateBundleProcess, versionInfo, } = mapPublicationConstructorArgs(mappingRegistry, backendModel);
2716
- return new Publication({
2717
- accessControlList,
2718
- applicableActions,
2719
- backendModel,
2720
- basicVersionInfo,
2721
- businessProcessType,
2722
- componentSnapshotTemplate,
2723
- componentTemplateProcess,
2724
- contentSecurityDescriptor,
2725
- defaultComponentTemplate,
2726
- defaultMultimediaSchema,
2727
- defaultPageTemplate,
2728
- defaultTemplateBuildingBlock,
2729
- id,
2730
- listLinks,
2731
- loadInfo,
2732
- locationInfo,
2733
- metadataSchema,
2734
- minimalLocalizeApprovalStatus,
2735
- pageSnapshotTemplate,
2736
- pageTemplateProcess,
2737
- parents,
2738
- rootFolder,
2739
- rootStructureGroup,
2740
- securityDescriptor,
2741
- taskProcess,
2742
- templateBundleProcess,
2743
- versionInfo,
2744
- });
2747
+ return new Publication(Object.assign(Object.assign({}, mapPublicationConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2745
2748
  },
2746
2749
  };
2747
2750
 
@@ -2853,21 +2856,7 @@ const mapBatchConstructorArgs = (mappingRegistry, backendModel) => {
2853
2856
  const batchMapping = {
2854
2857
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Batch',
2855
2858
  mapper: (mappingRegistry, backendModel) => {
2856
- const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, performer, type, operations, status, backendBatchOperation, } = mapBatchConstructorArgs(mappingRegistry, backendModel);
2857
- return new Batch({
2858
- backendBatchOperation,
2859
- backendModel,
2860
- operations,
2861
- performer,
2862
- status,
2863
- type,
2864
- applicableActions,
2865
- basicVersionInfo,
2866
- id,
2867
- listLinks,
2868
- loadInfo,
2869
- securityDescriptor,
2870
- });
2859
+ return new Batch(Object.assign(Object.assign({}, mapBatchConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2871
2860
  },
2872
2861
  };
2873
2862
 
@@ -3615,7 +3604,7 @@ class FullVersionInfo extends LimitedVersionInfo {
3615
3604
  */
3616
3605
  class VersionedItem extends RepositoryLocalObject {
3617
3606
  constructor(_a) {
3618
- var { backendModel, dynamicVersionInfo, fullVersionInfo, isDynamic, isNew } = _a, rloArgs = __rest(_a, ["backendModel", "dynamicVersionInfo", "fullVersionInfo", "isDynamic", "isNew"]);
3607
+ var { backendModel, dynamicVersionInfo, fullVersionInfo, isDynamic } = _a, rloArgs = __rest(_a, ["backendModel", "dynamicVersionInfo", "fullVersionInfo", "isDynamic"]);
3619
3608
  super(Object.assign({ backendModel }, rloArgs));
3620
3609
  Object.defineProperty(this, "_dynamicVersionInfo", {
3621
3610
  enumerable: true,
@@ -3635,12 +3624,6 @@ class VersionedItem extends RepositoryLocalObject {
3635
3624
  writable: true,
3636
3625
  value: void 0
3637
3626
  });
3638
- Object.defineProperty(this, "_isNew", {
3639
- enumerable: true,
3640
- configurable: true,
3641
- writable: true,
3642
- value: void 0
3643
- });
3644
3627
  Object.defineProperty(this, "getInternalModel", {
3645
3628
  enumerable: true,
3646
3629
  configurable: true,
@@ -3652,10 +3635,10 @@ class VersionedItem extends RepositoryLocalObject {
3652
3635
  this._isDynamic = isDynamic;
3653
3636
  this._dynamicVersionInfo = dynamicVersionInfo;
3654
3637
  this._fullVersionInfo = fullVersionInfo;
3655
- this._isNew = isNew;
3656
3638
  }
3657
- get isNew() {
3658
- return this._isNew;
3639
+ get isNotCheckedInYet() {
3640
+ var _a;
3641
+ return ((_a = this._fullVersionInfo) === null || _a === void 0 ? void 0 : _a.isNew) || false;
3659
3642
  }
3660
3643
  get isDynamic() {
3661
3644
  return this._isDynamic;
@@ -3883,8 +3866,7 @@ const mapDynamicVersionInfoConstructorArgs = (mappingRegistry, backendModel) =>
3883
3866
  const dynamicVersionInfoMapping = {
3884
3867
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DynamicVersionInfo',
3885
3868
  mapper: (mappingRegistry, backendModel) => {
3886
- const { revisor, revisionDate } = mapDynamicVersionInfoConstructorArgs(mappingRegistry, backendModel);
3887
- return new DynamicVersionInfo({ revisor, backendModel, revisionDate });
3869
+ return new DynamicVersionInfo(Object.assign(Object.assign({}, mapDynamicVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3888
3870
  },
3889
3871
  };
3890
3872
 
@@ -3900,8 +3882,7 @@ const mapBlueprintInfoConstructorArgs = (mappingRegistry, backendModel) => {
3900
3882
  const blueprintInfoMapping = {
3901
3883
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BlueprintInfo',
3902
3884
  mapper: (mappingRegistry, backendModel) => {
3903
- const { owningRepository, primaryBlueprintParentItem } = mapBlueprintInfoConstructorArgs(mappingRegistry, backendModel);
3904
- return new BlueprintInfo({ backendModel, owningRepository, primaryBlueprintParentItem });
3885
+ return new BlueprintInfo(Object.assign(Object.assign({}, mapBlueprintInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3905
3886
  },
3906
3887
  };
3907
3888
 
@@ -3913,8 +3894,7 @@ const mapLimitedVersionInfoConstructorArgs = (mappingRegistry, backendModel) =>
3913
3894
  const limitedVersionInfoMapping = {
3914
3895
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LimitedVersionInfo',
3915
3896
  mapper: (mappingRegistry, backendModel) => {
3916
- const { creator, creationDate, revisionDate } = mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel);
3917
- return new LimitedVersionInfo({ backendModel, creator, creationDate, revisionDate });
3897
+ return new LimitedVersionInfo(Object.assign(Object.assign({}, mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3918
3898
  },
3919
3899
  };
3920
3900
 
@@ -3930,8 +3910,7 @@ const mapLocationInfoConstructorArgs = (mappingRegistry, backendModel) => {
3930
3910
  const locationInfoMapping = {
3931
3911
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LocationInfo',
3932
3912
  mapper: (mappingRegistry, backendModel) => {
3933
- const { contextRepository, organizationalItem } = mapLocationInfoConstructorArgs(mappingRegistry, backendModel);
3934
- return new LocationInfo({ backendModel, contextRepository, organizationalItem });
3913
+ return new LocationInfo(Object.assign(Object.assign({}, mapLocationInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3935
3914
  },
3936
3915
  };
3937
3916
 
@@ -3964,8 +3943,7 @@ const mapLockInfoConstructorArgs = (mappingRegistry, backendModel) => {
3964
3943
  const lockInfoMapping = {
3965
3944
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LockInfo',
3966
3945
  mapper: (mappingRegistry, backendModel) => {
3967
- const { lockUser, lockType, lockDate } = mapLockInfoConstructorArgs(mappingRegistry, backendModel);
3968
- return new LockInfo({ backendModel, lockType, lockUser, lockDate });
3946
+ return new LockInfo(Object.assign(Object.assign({}, mapLockInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3969
3947
  },
3970
3948
  };
3971
3949
 
@@ -4032,10 +4010,6 @@ const mapVersionedItemConstructorArgs = (mappingRegistry, backendModel) => {
4032
4010
  const fullVersionInfo = backendModel.VersionInfo
4033
4011
  ? mappingRegistry.map(backendModel.VersionInfo)
4034
4012
  : undefined;
4035
- const isNew = (fullVersionInfo === null || fullVersionInfo === void 0 ? void 0 : fullVersionInfo.isNew) ||
4036
- (repositoryLocalObjectConstructorArgs.id instanceof TcmUri &&
4037
- repositoryLocalObjectConstructorArgs.id.isNullUri) ||
4038
- false;
4039
4013
  let isDynamic = false;
4040
4014
  // If id of an item passed is dynamic, sets versionless uri to _id prop instead.
4041
4015
  if (repositoryLocalObjectConstructorArgs.id.isDynamic &&
@@ -4046,8 +4020,7 @@ const mapVersionedItemConstructorArgs = (mappingRegistry, backendModel) => {
4046
4020
  }
4047
4021
  return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { dynamicVersionInfo,
4048
4022
  fullVersionInfo,
4049
- isDynamic,
4050
- isNew });
4023
+ isDynamic });
4051
4024
  };
4052
4025
 
4053
4026
  const mapFullVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
@@ -4067,17 +4040,7 @@ const mapFullVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
4067
4040
  const fullVersionInfoMapping = {
4068
4041
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FullVersionInfo',
4069
4042
  mapper: (mappingRegistry, backendModel) => {
4070
- const { revisor, checkoutUser, lockType, creator, checkOutDate, creationDate, revisionDate } = mapFullVersionInfoConstructorArgs(mappingRegistry, backendModel);
4071
- return new FullVersionInfo({
4072
- backendModel,
4073
- checkOutDate,
4074
- checkoutUser,
4075
- creationDate,
4076
- creator,
4077
- lockType,
4078
- revisor,
4079
- revisionDate,
4080
- });
4043
+ return new FullVersionInfo(Object.assign(Object.assign({}, mapFullVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4081
4044
  },
4082
4045
  };
4083
4046
 
@@ -4115,30 +4078,7 @@ const componentMapping = {
4115
4078
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Component' &&
4116
4079
  ((backendModel === null || backendModel === void 0 ? void 0 : backendModel.ComponentType) === ComponentType.NORMAL || (backendModel === null || backendModel === void 0 ? void 0 : backendModel.ComponentType) === ComponentType.WIDGET),
4117
4080
  mapper: (mappingRegistry, backendModel) => {
4118
- const { applicableActions, approvalStatus, basicVersionInfo, blueprintInfo, componentType, dynamicVersionInfo, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, schema, securityDescriptor, workflowInfo, } = mapComponentConstructorArgs(mappingRegistry, backendModel);
4119
- return new Component({
4120
- applicableActions,
4121
- approvalStatus,
4122
- backendModel,
4123
- basicVersionInfo,
4124
- blueprintInfo,
4125
- componentType,
4126
- dynamicVersionInfo,
4127
- fullVersionInfo,
4128
- id,
4129
- isDynamic,
4130
- isLocked,
4131
- isNew,
4132
- limitedVersionInfo,
4133
- listLinks,
4134
- loadInfo,
4135
- locationInfo,
4136
- lockInfo,
4137
- metadataSchema,
4138
- schema,
4139
- securityDescriptor,
4140
- workflowInfo,
4141
- });
4081
+ return new Component(Object.assign(Object.assign({}, mapComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4142
4082
  },
4143
4083
  };
4144
4084
 
@@ -7115,32 +7055,7 @@ const mapSchemaConstructorArgs = (mappingRegistry, backendModel) => {
7115
7055
  const schemaMapping = {
7116
7056
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Schema',
7117
7057
  mapper: (mappingRegistry, backendModel) => {
7118
- const { allowedMultimediaTypes, applicableActions, basicVersionInfo, blueprintInfo, bundleProcess, componentProcess, dynamicVersionInfo, fields, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataFields, metadataSchema, purpose, securityDescriptor, } = mapSchemaConstructorArgs(mappingRegistry, backendModel);
7119
- return new Schema({
7120
- allowedMultimediaTypes,
7121
- applicableActions,
7122
- backendModel,
7123
- basicVersionInfo,
7124
- blueprintInfo,
7125
- bundleProcess,
7126
- componentProcess,
7127
- dynamicVersionInfo,
7128
- fields,
7129
- fullVersionInfo,
7130
- id,
7131
- isDynamic,
7132
- isLocked,
7133
- isNew,
7134
- limitedVersionInfo,
7135
- listLinks,
7136
- loadInfo,
7137
- locationInfo,
7138
- lockInfo,
7139
- metadataFields,
7140
- metadataSchema,
7141
- purpose,
7142
- securityDescriptor,
7143
- });
7058
+ return new Schema(Object.assign(Object.assign({}, mapSchemaConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7144
7059
  },
7145
7060
  };
7146
7061
 
@@ -7154,31 +7069,7 @@ const mapMultimediaComponentConstructorArgs = (mappingRegistry, backendModel) =>
7154
7069
  const multimediaComponentMapping = {
7155
7070
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Component' && (backendModel === null || backendModel === void 0 ? void 0 : backendModel.ComponentType) === ComponentType.MULTIMEDIA,
7156
7071
  mapper: (mappingRegistry, backendModel) => {
7157
- const { applicableActions, approvalStatus, basicVersionInfo, binaryContent, blueprintInfo, componentType, dynamicVersionInfo, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, schema, securityDescriptor, workflowInfo, } = mapMultimediaComponentConstructorArgs(mappingRegistry, backendModel);
7158
- return new MultimediaComponent({
7159
- applicableActions,
7160
- approvalStatus,
7161
- backendModel,
7162
- basicVersionInfo,
7163
- binaryContent,
7164
- blueprintInfo,
7165
- componentType,
7166
- dynamicVersionInfo,
7167
- fullVersionInfo,
7168
- id,
7169
- isDynamic,
7170
- isLocked,
7171
- isNew,
7172
- limitedVersionInfo,
7173
- listLinks,
7174
- loadInfo,
7175
- locationInfo,
7176
- lockInfo,
7177
- metadataSchema,
7178
- schema,
7179
- securityDescriptor,
7180
- workflowInfo,
7181
- });
7072
+ return new MultimediaComponent(Object.assign(Object.assign({}, mapMultimediaComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7182
7073
  },
7183
7074
  };
7184
7075
 
@@ -7192,32 +7083,7 @@ const mapExternalMultimediaComponentConstructorArgs = (mappingRegistry, backendM
7192
7083
  const externalMultimediaComponentMapping = {
7193
7084
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalComponent',
7194
7085
  mapper: (mappingRegistry, backendModel) => {
7195
- const { applicableActions, approvalStatus, basicVersionInfo, binaryContent, blueprintInfo, componentType, dynamicVersionInfo, externalMetadataSchemaFields, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, schema, securityDescriptor, workflowInfo, } = mapExternalMultimediaComponentConstructorArgs(mappingRegistry, backendModel);
7196
- return new ExternalMultimediaComponent({
7197
- applicableActions,
7198
- approvalStatus,
7199
- backendModel,
7200
- basicVersionInfo,
7201
- binaryContent,
7202
- blueprintInfo,
7203
- componentType,
7204
- dynamicVersionInfo,
7205
- externalMetadataSchemaFields,
7206
- fullVersionInfo,
7207
- id,
7208
- isDynamic,
7209
- isLocked,
7210
- isNew,
7211
- limitedVersionInfo,
7212
- listLinks,
7213
- loadInfo,
7214
- locationInfo,
7215
- lockInfo,
7216
- metadataSchema,
7217
- schema,
7218
- securityDescriptor,
7219
- workflowInfo,
7220
- });
7086
+ return new ExternalMultimediaComponent(Object.assign(Object.assign({}, mapExternalMultimediaComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7221
7087
  },
7222
7088
  };
7223
7089
 
@@ -7225,17 +7091,7 @@ const mapExternalVersionInfoConstructorArgs = mapFullVersionInfoConstructorArgs;
7225
7091
  const externalVersionInfoMapping = {
7226
7092
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalVersionInfo',
7227
7093
  mapper: (mappingRegistry, backendModel) => {
7228
- const { checkoutUser, creator, lockType, revisor, checkOutDate, creationDate, revisionDate } = mapExternalVersionInfoConstructorArgs(mappingRegistry, backendModel);
7229
- return new ExternalVersionInfo({
7230
- backendModel,
7231
- checkoutUser,
7232
- creator,
7233
- lockType,
7234
- revisor,
7235
- checkOutDate,
7236
- creationDate,
7237
- revisionDate,
7238
- });
7094
+ return new ExternalVersionInfo(Object.assign(Object.assign({}, mapExternalVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7239
7095
  },
7240
7096
  };
7241
7097
 
@@ -7446,54 +7302,6 @@ const externalKeywordMapping = {
7446
7302
  },
7447
7303
  };
7448
7304
 
7449
- /**
7450
- * Represents the hateoas link.
7451
- */
7452
- class HateoasLink {
7453
- constructor(backendModel) {
7454
- Object.defineProperty(this, "_backendModel", {
7455
- enumerable: true,
7456
- configurable: true,
7457
- writable: true,
7458
- value: void 0
7459
- });
7460
- Object.defineProperty(this, "getInternalModel", {
7461
- enumerable: true,
7462
- configurable: true,
7463
- writable: true,
7464
- value: () => {
7465
- return this._backendModel;
7466
- }
7467
- });
7468
- this._backendModel = backendModel;
7469
- }
7470
- /**
7471
- * Target resource URI.
7472
- */
7473
- get href() {
7474
- return this._backendModel.Href;
7475
- }
7476
- /**
7477
- * Link relation type, describes how the current context is related to the target resource.
7478
- */
7479
- get relationType() {
7480
- return this._backendModel.Rel;
7481
- }
7482
- /**
7483
- * Expected resource media type.
7484
- */
7485
- get type() {
7486
- return this._backendModel.Type;
7487
- }
7488
- }
7489
-
7490
- const hateoasLinkMapping = {
7491
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'HateoasLink',
7492
- mapper: (mappingRegistry, backendModel) => {
7493
- return new HateoasLink(backendModel);
7494
- },
7495
- };
7496
-
7497
7305
  /**
7498
7306
  * Abstract base class for the data of "organizational items": items used to organize the items in a Repository.
7499
7307
  */
@@ -7649,59 +7457,6 @@ class Bundle extends VirtualFolder {
7649
7457
  }
7650
7458
  }
7651
7459
 
7652
- let modelsLocale = {
7653
- businessProcessTypes: 'Business Process Types',
7654
- taxonomies: 'Taxonomies',
7655
- };
7656
- const configureLocale = (locale) => {
7657
- modelsLocale = locale;
7658
- };
7659
- const getLocale = () => modelsLocale;
7660
-
7661
- /**
7662
- * An item used to organize the business process types in a Repository.
7663
- */
7664
- class BusinessProcessTypes extends OrganizationalItem {
7665
- constructor(publicationId) {
7666
- super({
7667
- backendModel: {
7668
- $type: 'BusinessProcessTypes',
7669
- Id: VirtualUri.create(publicationId, 'businessProcessTypes').asString,
7670
- Title: getLocale().businessProcessTypes,
7671
- LocationInfo: {
7672
- OrganizationalItem: createBackendLink(TcmUri.null.asString),
7673
- ContextRepository: createBackendLink(publicationId.asString),
7674
- },
7675
- },
7676
- id: VirtualUri.create(publicationId, 'businessProcessTypes'),
7677
- accessControlList: undefined,
7678
- applicableActions: undefined,
7679
- basicVersionInfo: undefined,
7680
- blueprintInfo: undefined,
7681
- contentSecurityDescriptor: undefined,
7682
- isLocked: false,
7683
- limitedVersionInfo: undefined,
7684
- listLinks: undefined,
7685
- loadInfo: undefined,
7686
- locationInfo: undefined,
7687
- lockInfo: undefined,
7688
- metadataSchema: undefined,
7689
- securityDescriptor: undefined,
7690
- });
7691
- }
7692
- }
7693
- const changeOrgItemToBusinessProcessTypes = (item) => {
7694
- return produce(item, draft => {
7695
- var _a, _b;
7696
- if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
7697
- const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
7698
- if (!publicationId)
7699
- return;
7700
- draft.LocationInfo.OrganizationalItem = createBackendLink(VirtualUri.create(publicationId, 'businessProcessTypes').asString, getLocale().businessProcessTypes);
7701
- }
7702
- });
7703
- };
7704
-
7705
7460
  /**
7706
7461
  * Defines a type of (publishing) Business Process, including a set of publishing Target Types and workflows.
7707
7462
  *
@@ -7717,7 +7472,7 @@ const changeOrgItemToBusinessProcessTypes = (item) => {
7717
7472
  class BusinessProcessType extends OrganizationalItem {
7718
7473
  constructor(_a) {
7719
7474
  var { backendModel, bundleSchemas, targetTypes } = _a, orgItemArgs = __rest(_a, ["backendModel", "bundleSchemas", "targetTypes"]);
7720
- super(Object.assign({ backendModel: changeOrgItemToBusinessProcessTypes(backendModel) }, orgItemArgs));
7475
+ super(Object.assign({ backendModel }, orgItemArgs));
7721
7476
  Object.defineProperty(this, "_bundleSchemas", {
7722
7477
  enumerable: true,
7723
7478
  configurable: true,
@@ -7789,6 +7544,53 @@ class BusinessProcessType extends OrganizationalItem {
7789
7544
  }
7790
7545
  }
7791
7546
 
7547
+ /**
7548
+ * An item used to organize the business process types in a Repository.
7549
+ */
7550
+ class BusinessProcessTypes extends OrganizationalItem {
7551
+ constructor(_a) {
7552
+ var { backendModel } = _a, organizationalItemArgs = __rest(_a, ["backendModel"]);
7553
+ super(Object.assign({ backendModel }, organizationalItemArgs));
7554
+ }
7555
+ }
7556
+
7557
+ let modelsLocale = {
7558
+ businessProcessTypes: 'Business Process Types',
7559
+ taxonomies: 'Taxonomies',
7560
+ };
7561
+ const configureLocale = (locale) => {
7562
+ modelsLocale = locale;
7563
+ };
7564
+ const getLocale = () => modelsLocale;
7565
+
7566
+ const createBackendBusinessProcessTypes = (publicationId) => {
7567
+ return {
7568
+ $type: 'BusinessProcessTypes',
7569
+ Id: VirtualUri.create(publicationId, 'businessProcessTypes').asString,
7570
+ Title: getLocale().businessProcessTypes,
7571
+ LocationInfo: {
7572
+ $type: 'LocationInfo',
7573
+ OrganizationalItem: createBackendLink(TcmUri.null.asString),
7574
+ ContextRepository: createBackendLink(publicationId.asString),
7575
+ },
7576
+ ApplicableActions: [createBackendHateoasLink('', applicableActions.search)],
7577
+ };
7578
+ };
7579
+
7580
+ const createBackendTaxonomies = (publicationId) => {
7581
+ return {
7582
+ $type: 'Taxonomies',
7583
+ Id: VirtualUri.create(publicationId, 'taxonomies').asString,
7584
+ Title: getLocale().taxonomies,
7585
+ LocationInfo: {
7586
+ $type: 'LocationInfo',
7587
+ OrganizationalItem: createBackendLink(TcmUri.null.asString),
7588
+ ContextRepository: createBackendLink(publicationId.asString),
7589
+ },
7590
+ ApplicableActions: [createBackendHateoasLink('', applicableActions.search)],
7591
+ };
7592
+ };
7593
+
7792
7594
  /**
7793
7595
  * An item used to organize the items in a Repository.
7794
7596
  */
@@ -7869,63 +7671,13 @@ class ExternalContainer extends Folder {
7869
7671
  }
7870
7672
  }
7871
7673
 
7872
- /**
7873
- * An item used to organize the categories and keywords in a Repository.
7874
- */
7875
- class Taxonomies extends OrganizationalItem {
7876
- constructor(publicationId) {
7877
- super({
7878
- backendModel: {
7879
- $type: 'Taxonomies',
7880
- Id: VirtualUri.create(publicationId, 'taxonomies').asString,
7881
- Title: getLocale().taxonomies,
7882
- LocationInfo: {
7883
- OrganizationalItem: createBackendLink(TcmUri.null.asString),
7884
- ContextRepository: createBackendLink(publicationId.asString),
7885
- },
7886
- },
7887
- id: VirtualUri.create(publicationId, 'taxonomies'),
7888
- accessControlList: undefined,
7889
- applicableActions: [
7890
- new HateoasLink({
7891
- $type: 'HateoasLink',
7892
- Rel: 'tcm:Search',
7893
- Type: 'GET',
7894
- }),
7895
- ],
7896
- basicVersionInfo: undefined,
7897
- blueprintInfo: undefined,
7898
- contentSecurityDescriptor: undefined,
7899
- isLocked: false,
7900
- limitedVersionInfo: undefined,
7901
- listLinks: undefined,
7902
- loadInfo: undefined,
7903
- locationInfo: undefined,
7904
- lockInfo: undefined,
7905
- metadataSchema: undefined,
7906
- securityDescriptor: undefined,
7907
- });
7908
- }
7909
- }
7910
- const changeOrgItemToTaxonomies = (item) => {
7911
- return produce(item, draft => {
7912
- var _a, _b;
7913
- if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
7914
- const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
7915
- if (!publicationId)
7916
- return;
7917
- draft.LocationInfo.OrganizationalItem = createBackendLink(VirtualUri.create(publicationId, 'taxonomies').asString, getLocale().taxonomies);
7918
- }
7919
- });
7920
- };
7921
-
7922
7674
  /**
7923
7675
  * Represents the data of a Category of Keywords.
7924
7676
  */
7925
7677
  class KeywordCategory extends OrganizationalItem {
7926
7678
  constructor(_a) {
7927
7679
  var { backendModel, allowedParentCategories, keywordMetadataSchema } = _a, orgItemArgs = __rest(_a, ["backendModel", "allowedParentCategories", "keywordMetadataSchema"]);
7928
- super(Object.assign({ backendModel: changeOrgItemToTaxonomies(backendModel) }, orgItemArgs));
7680
+ super(Object.assign({ backendModel }, orgItemArgs));
7929
7681
  Object.defineProperty(this, "_allowedParentCategories", {
7930
7682
  enumerable: true,
7931
7683
  configurable: true,
@@ -8016,7 +7768,7 @@ class KeywordCategory extends OrganizationalItem {
8016
7768
  class ExternalKeywordCategory extends KeywordCategory {
8017
7769
  constructor(_a) {
8018
7770
  var { backendModel } = _a, keywordCategoryArgs = __rest(_a, ["backendModel"]);
8019
- super(Object.assign({ backendModel: changeOrgItemToTaxonomies(backendModel) }, keywordCategoryArgs));
7771
+ super(Object.assign({ backendModel }, keywordCategoryArgs));
8020
7772
  Object.defineProperty(this, "getInternalModel", {
8021
7773
  enumerable: true,
8022
7774
  configurable: true,
@@ -8226,6 +7978,16 @@ class StructureGroup extends OrganizationalItem {
8226
7978
  }
8227
7979
  }
8228
7980
 
7981
+ /**
7982
+ * An item used to organize the categories and keywords in a Repository.
7983
+ */
7984
+ class Taxonomies extends OrganizationalItem {
7985
+ constructor(_a) {
7986
+ var { backendModel } = _a, organizationalItemArgs = __rest(_a, ["backendModel"]);
7987
+ super(Object.assign({ backendModel }, organizationalItemArgs));
7988
+ }
7989
+ }
7990
+
8229
7991
  const mapOrganizationalItemConstructorArgs = (mappingRegistry, backendModel) => {
8230
7992
  const versionedItemConstructorArgs = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
8231
7993
  const accessControlList = backendModel.AccessControlList
@@ -8239,33 +8001,17 @@ const mapOrganizationalItemConstructorArgs = (mappingRegistry, backendModel) =>
8239
8001
  };
8240
8002
 
8241
8003
  const mapVirtualFolderConstructorArgs = (mappingRegistry, backendModel) => {
8242
- const { accessControlList, applicableActions, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, } = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8004
+ const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8243
8005
  const approvalStatus = backendModel.ApprovalStatus
8244
8006
  ? mappingRegistry.map(backendModel.ApprovalStatus)
8245
8007
  : undefined;
8246
8008
  const typeSchema = backendModel.TypeSchema ? mappingRegistry.map(backendModel.TypeSchema) : undefined;
8247
- const workflowInfo = backendModel.WorkflowInfo
8248
- ? mappingRegistry.map(backendModel.WorkflowInfo)
8249
- : undefined;
8250
- return {
8251
- accessControlList,
8252
- applicableActions,
8253
- approvalStatus,
8254
- basicVersionInfo,
8255
- blueprintInfo,
8256
- contentSecurityDescriptor,
8257
- id,
8258
- isLocked,
8259
- limitedVersionInfo,
8260
- listLinks,
8261
- loadInfo,
8262
- locationInfo,
8263
- lockInfo,
8264
- metadataSchema,
8265
- securityDescriptor,
8009
+ const workflowInfo = backendModel.WorkflowInfo
8010
+ ? mappingRegistry.map(backendModel.WorkflowInfo)
8011
+ : undefined;
8012
+ return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { approvalStatus,
8266
8013
  typeSchema,
8267
- workflowInfo,
8268
- };
8014
+ workflowInfo });
8269
8015
  };
8270
8016
 
8271
8017
  const mapBundleConstructorArgs = (mappingRegistry, backendModel) => {
@@ -8276,65 +8022,58 @@ const mapBundleConstructorArgs = (mappingRegistry, backendModel) => {
8276
8022
  const bundleMapping = {
8277
8023
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Bundle',
8278
8024
  mapper: (mappingRegistry, backendModel) => {
8279
- const { accessControlList, applicableActions, approvalStatus, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, id, isLocked, items, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, typeSchema, workflowInfo, } = mapBundleConstructorArgs(mappingRegistry, backendModel);
8280
- return new Bundle({
8281
- accessControlList,
8282
- applicableActions,
8283
- approvalStatus,
8284
- backendModel,
8285
- basicVersionInfo,
8286
- blueprintInfo,
8287
- contentSecurityDescriptor,
8288
- id,
8289
- isLocked,
8290
- items,
8291
- limitedVersionInfo,
8292
- listLinks,
8293
- loadInfo,
8294
- locationInfo,
8295
- lockInfo,
8296
- metadataSchema,
8297
- securityDescriptor,
8298
- typeSchema,
8299
- workflowInfo,
8300
- });
8025
+ return new Bundle(Object.assign(Object.assign({}, mapBundleConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8301
8026
  },
8302
8027
  };
8303
8028
 
8029
+ const changeOrgItemToBusinessProcessTypes = (item) => {
8030
+ return produce(item, draft => {
8031
+ var _a, _b;
8032
+ if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
8033
+ const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
8034
+ if (!publicationId)
8035
+ return;
8036
+ draft.LocationInfo.OrganizationalItem = createBackendLink(VirtualUri.create(publicationId, 'businessProcessTypes').asString, getLocale().businessProcessTypes);
8037
+ }
8038
+ });
8039
+ };
8040
+
8304
8041
  const mapBusinessProcessTypeConstructorArgs = (mappingRegistry, backendModel) => {
8305
8042
  var _a;
8306
- const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8307
- const bundleSchemas = mapLinks(mappingRegistry, backendModel.BundleSchemas);
8308
- const targetTypes = (_a = backendModel.TargetTypes) === null || _a === void 0 ? void 0 : _a.map(t => mappingRegistry.map(t)).filter(isDefined);
8043
+ const backendModelWithProperOrgItem = changeOrgItemToBusinessProcessTypes(backendModel);
8044
+ const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModelWithProperOrgItem);
8045
+ const bundleSchemas = mapLinks(mappingRegistry, backendModelWithProperOrgItem.BundleSchemas);
8046
+ const targetTypes = (_a = backendModelWithProperOrgItem.TargetTypes) === null || _a === void 0 ? void 0 : _a.map(t => mappingRegistry.map(t)).filter(isDefined);
8309
8047
  return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { bundleSchemas,
8310
8048
  targetTypes });
8311
8049
  };
8312
8050
  const businessProcessTypeMapping = {
8313
8051
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BusinessProcessType',
8314
8052
  mapper: (mappingRegistry, backendModel) => {
8315
- const { accessControlList, applicableActions, basicVersionInfo, blueprintInfo, bundleSchemas, contentSecurityDescriptor, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, targetTypes, } = mapBusinessProcessTypeConstructorArgs(mappingRegistry, backendModel);
8316
- return new BusinessProcessType({
8317
- accessControlList,
8318
- applicableActions,
8319
- backendModel,
8320
- basicVersionInfo,
8321
- blueprintInfo,
8322
- bundleSchemas,
8323
- contentSecurityDescriptor,
8324
- id,
8325
- isLocked,
8326
- limitedVersionInfo,
8327
- listLinks,
8328
- loadInfo,
8329
- locationInfo,
8330
- lockInfo,
8331
- metadataSchema,
8332
- securityDescriptor,
8333
- targetTypes,
8334
- });
8053
+ return new BusinessProcessType(Object.assign(Object.assign({}, mapBusinessProcessTypeConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToBusinessProcessTypes(backendModel) }));
8054
+ },
8055
+ };
8056
+
8057
+ const mapBusinessProcessTypesConstructorArgs = mapOrganizationalItemConstructorArgs;
8058
+ const businessProcessTypesMapping = {
8059
+ identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BusinessProcessTypes',
8060
+ mapper: (mappingRegistry, backendModel) => {
8061
+ return new BusinessProcessTypes(Object.assign(Object.assign({}, mapBusinessProcessTypesConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8335
8062
  },
8336
8063
  };
8337
8064
 
8065
+ const changeOrgItemToTaxonomies = (item) => {
8066
+ return produce(item, draft => {
8067
+ var _a, _b;
8068
+ if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
8069
+ const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
8070
+ if (!publicationId)
8071
+ return;
8072
+ draft.LocationInfo.OrganizationalItem = createBackendLink(VirtualUri.create(publicationId, 'taxonomies').asString, getLocale().taxonomies);
8073
+ }
8074
+ });
8075
+ };
8076
+
8338
8077
  const mapFolderConstructorArgs = (mappingRegistry, backendModel) => {
8339
8078
  const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8340
8079
  const linkedSchema = backendModel.LinkedSchema ? mappingRegistry.map(backendModel.LinkedSchema) : undefined;
@@ -8343,25 +8082,7 @@ const mapFolderConstructorArgs = (mappingRegistry, backendModel) => {
8343
8082
  const folderMapping = {
8344
8083
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Folder',
8345
8084
  mapper: (mappingRegistry, backendModel) => {
8346
- const { accessControlList, applicableActions, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, id, isLocked, limitedVersionInfo, linkedSchema, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, } = mapFolderConstructorArgs(mappingRegistry, backendModel);
8347
- return new Folder({
8348
- accessControlList,
8349
- applicableActions,
8350
- backendModel,
8351
- basicVersionInfo,
8352
- blueprintInfo,
8353
- contentSecurityDescriptor,
8354
- id,
8355
- isLocked,
8356
- limitedVersionInfo,
8357
- linkedSchema,
8358
- listLinks,
8359
- loadInfo,
8360
- locationInfo,
8361
- lockInfo,
8362
- metadataSchema,
8363
- securityDescriptor,
8364
- });
8085
+ return new Folder(Object.assign(Object.assign({}, mapFolderConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8365
8086
  },
8366
8087
  };
8367
8088
 
@@ -8369,33 +8090,16 @@ const mapExternalContainerConstructorArgs = mapFolderConstructorArgs;
8369
8090
  const externalContainerMapping = {
8370
8091
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalContainer',
8371
8092
  mapper: (mappingRegistry, backendModel) => {
8372
- const { accessControlList, applicableActions, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, id, isLocked, limitedVersionInfo, linkedSchema, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, } = mapExternalContainerConstructorArgs(mappingRegistry, backendModel);
8373
- return new ExternalContainer({
8374
- accessControlList,
8375
- applicableActions,
8376
- backendModel,
8377
- basicVersionInfo,
8378
- blueprintInfo,
8379
- contentSecurityDescriptor,
8380
- id,
8381
- isLocked,
8382
- limitedVersionInfo,
8383
- linkedSchema,
8384
- listLinks,
8385
- loadInfo,
8386
- locationInfo,
8387
- lockInfo,
8388
- metadataSchema,
8389
- securityDescriptor,
8390
- });
8093
+ return new ExternalContainer(Object.assign(Object.assign({}, mapExternalContainerConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8391
8094
  },
8392
8095
  };
8393
8096
 
8394
8097
  const mapKeywordCategoryConstructorArgs = (mappingRegistry, backendModel) => {
8395
- const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8396
- const allowedParentCategories = mapLinks(mappingRegistry, backendModel.AllowedParentCategories);
8397
- const keywordMetadataSchema = backendModel.KeywordMetadataSchema
8398
- ? mappingRegistry.map(backendModel.KeywordMetadataSchema)
8098
+ const backendModelWithProperOrgItem = changeOrgItemToTaxonomies(backendModel);
8099
+ const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModelWithProperOrgItem);
8100
+ const allowedParentCategories = mapLinks(mappingRegistry, backendModelWithProperOrgItem.AllowedParentCategories);
8101
+ const keywordMetadataSchema = backendModelWithProperOrgItem.KeywordMetadataSchema
8102
+ ? mappingRegistry.map(backendModelWithProperOrgItem.KeywordMetadataSchema)
8399
8103
  : undefined;
8400
8104
  return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { allowedParentCategories,
8401
8105
  keywordMetadataSchema });
@@ -8403,26 +8107,7 @@ const mapKeywordCategoryConstructorArgs = (mappingRegistry, backendModel) => {
8403
8107
  const keywordCategoryMapping = {
8404
8108
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Category',
8405
8109
  mapper: (mappingRegistry, backendModel) => {
8406
- const { accessControlList, allowedParentCategories, applicableActions, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, id, isLocked, keywordMetadataSchema, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, } = mapKeywordCategoryConstructorArgs(mappingRegistry, backendModel);
8407
- return new KeywordCategory({
8408
- accessControlList,
8409
- allowedParentCategories,
8410
- applicableActions,
8411
- backendModel,
8412
- basicVersionInfo,
8413
- blueprintInfo,
8414
- contentSecurityDescriptor,
8415
- id,
8416
- isLocked,
8417
- keywordMetadataSchema,
8418
- limitedVersionInfo,
8419
- listLinks,
8420
- loadInfo,
8421
- locationInfo,
8422
- lockInfo,
8423
- metadataSchema,
8424
- securityDescriptor,
8425
- });
8110
+ return new KeywordCategory(Object.assign(Object.assign({}, mapKeywordCategoryConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToTaxonomies(backendModel) }));
8426
8111
  },
8427
8112
  };
8428
8113
 
@@ -8430,26 +8115,7 @@ const mapExternalKeywordCategoryConstructorArgs = mapKeywordCategoryConstructorA
8430
8115
  const externalKeywordCategoryMapping = {
8431
8116
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalCategory',
8432
8117
  mapper: (mappingRegistry, backendModel) => {
8433
- const { accessControlList, allowedParentCategories, applicableActions, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, id, isLocked, keywordMetadataSchema, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, securityDescriptor, } = mapExternalKeywordCategoryConstructorArgs(mappingRegistry, backendModel);
8434
- return new ExternalKeywordCategory({
8435
- accessControlList,
8436
- allowedParentCategories,
8437
- applicableActions,
8438
- backendModel,
8439
- basicVersionInfo,
8440
- blueprintInfo,
8441
- contentSecurityDescriptor,
8442
- id,
8443
- isLocked,
8444
- keywordMetadataSchema,
8445
- limitedVersionInfo,
8446
- listLinks,
8447
- loadInfo,
8448
- locationInfo,
8449
- lockInfo,
8450
- metadataSchema,
8451
- securityDescriptor,
8452
- });
8118
+ return new ExternalKeywordCategory(Object.assign(Object.assign({}, mapExternalKeywordCategoryConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToTaxonomies(backendModel) }));
8453
8119
  },
8454
8120
  };
8455
8121
 
@@ -8457,35 +8123,15 @@ const mapPublishLocationInfoConstructorArgs = mapLocationInfoConstructorArgs;
8457
8123
  const publishLocationInfoMapping = {
8458
8124
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishLocationInfo',
8459
8125
  mapper: (mappingRegistry, backendModel) => {
8460
- const { contextRepository, organizationalItem } = mapPublishLocationInfoConstructorArgs(mappingRegistry, backendModel);
8461
- return new PublishLocationInfo({ backendModel, contextRepository, organizationalItem });
8126
+ return new PublishLocationInfo(Object.assign(Object.assign({}, mapPublishLocationInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8462
8127
  },
8463
8128
  };
8464
8129
 
8130
+ const mapSearchFolderConstructorArgs = mapVirtualFolderConstructorArgs;
8465
8131
  const searchFolderMapping = {
8466
8132
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SearchFolder',
8467
8133
  mapper: (mappingRegistry, backendModel) => {
8468
- const { accessControlList, contentSecurityDescriptor, approvalStatus, typeSchema, workflowInfo, blueprintInfo, limitedVersionInfo, locationInfo, lockInfo, metadataSchema, applicableActions, basicVersionInfo, id, isLocked, listLinks, loadInfo, securityDescriptor, } = mapVirtualFolderConstructorArgs(mappingRegistry, backendModel);
8469
- return new SearchFolder({
8470
- backendModel,
8471
- accessControlList,
8472
- contentSecurityDescriptor,
8473
- approvalStatus,
8474
- typeSchema,
8475
- workflowInfo,
8476
- blueprintInfo,
8477
- limitedVersionInfo,
8478
- locationInfo,
8479
- lockInfo,
8480
- metadataSchema,
8481
- applicableActions,
8482
- basicVersionInfo,
8483
- id,
8484
- isLocked,
8485
- listLinks,
8486
- loadInfo,
8487
- securityDescriptor,
8488
- });
8134
+ return new SearchFolder(Object.assign(Object.assign({}, mapSearchFolderConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8489
8135
  },
8490
8136
  };
8491
8137
 
@@ -8509,28 +8155,15 @@ const mapStructureGroupConstructorArgs = (mappingRegistry, backendModel) => {
8509
8155
  const structureGroupMapping = {
8510
8156
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'StructureGroup',
8511
8157
  mapper: (mappingRegistry, backendModel) => {
8512
- const { accessControlList, applicableActions, basicVersionInfo, blueprintInfo, contentSecurityDescriptor, defaultPageTemplate, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, pageBundleProcess, pageProcess, publishLocationInfo, securityDescriptor, } = mapStructureGroupConstructorArgs(mappingRegistry, backendModel);
8513
- return new StructureGroup({
8514
- accessControlList,
8515
- applicableActions,
8516
- backendModel,
8517
- basicVersionInfo,
8518
- blueprintInfo,
8519
- contentSecurityDescriptor,
8520
- defaultPageTemplate,
8521
- id,
8522
- isLocked,
8523
- limitedVersionInfo,
8524
- listLinks,
8525
- loadInfo,
8526
- locationInfo,
8527
- lockInfo,
8528
- metadataSchema,
8529
- pageBundleProcess,
8530
- pageProcess,
8531
- publishLocationInfo,
8532
- securityDescriptor,
8533
- });
8158
+ return new StructureGroup(Object.assign(Object.assign({}, mapStructureGroupConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8159
+ },
8160
+ };
8161
+
8162
+ const mapTaxonomiesConstructorArgs = mapOrganizationalItemConstructorArgs;
8163
+ const taxonomiesMapping = {
8164
+ identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Taxonomies',
8165
+ mapper: (mappingRegistry, backendModel) => {
8166
+ return new Taxonomies(Object.assign(Object.assign({}, mapTaxonomiesConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8534
8167
  },
8535
8168
  };
8536
8169
 
@@ -8859,8 +8492,7 @@ const mapComponentPresentationConstructorArgs = (mappingRegistry, backendModel)
8859
8492
  const componentPresentationMapping = {
8860
8493
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentPresentation',
8861
8494
  mapper: (mappingRegistry, backendModel) => {
8862
- const { component, componentTemplate, conditions } = mapComponentPresentationConstructorArgs(mappingRegistry, backendModel);
8863
- return new ComponentPresentation({ backendModel, component, componentTemplate, conditions });
8495
+ return new ComponentPresentation(Object.assign(Object.assign({}, mapComponentPresentationConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8864
8496
  },
8865
8497
  };
8866
8498
 
@@ -8882,8 +8514,7 @@ const mapEmbeddedRegionConstructorArgs = (mappingRegistry, backendModel) => {
8882
8514
  const embeddedRegionMapping = {
8883
8515
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'EmbeddedRegion',
8884
8516
  mapper: (mappingRegistry, backendModel) => {
8885
- const { componentPresentations, regions, regionSchema } = mapEmbeddedRegionConstructorArgs(mappingRegistry, backendModel);
8886
- return new EmbeddedRegion({ backendModel, componentPresentations, regionSchema, regions });
8517
+ return new EmbeddedRegion(Object.assign(Object.assign({}, mapEmbeddedRegionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8887
8518
  },
8888
8519
  };
8889
8520
 
@@ -8912,33 +8543,7 @@ const mapPageConstructorArgs = (mappingRegistry, backendModel) => {
8912
8543
  const pageMapping = {
8913
8544
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Page',
8914
8545
  mapper: (mappingRegistry, backendModel) => {
8915
- const { applicableActions, approvalStatus, basicVersionInfo, blueprintInfo, componentPresentations, dynamicVersionInfo, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, pageTemplate, publishLocationInfo, regions, regionSchema, securityDescriptor, workflowInfo, } = mapPageConstructorArgs(mappingRegistry, backendModel);
8916
- return new Page({
8917
- applicableActions,
8918
- approvalStatus,
8919
- backendModel,
8920
- basicVersionInfo,
8921
- blueprintInfo,
8922
- componentPresentations,
8923
- dynamicVersionInfo,
8924
- fullVersionInfo,
8925
- id,
8926
- isDynamic,
8927
- isLocked,
8928
- isNew,
8929
- limitedVersionInfo,
8930
- listLinks,
8931
- loadInfo,
8932
- locationInfo,
8933
- lockInfo,
8934
- metadataSchema,
8935
- pageTemplate,
8936
- publishLocationInfo,
8937
- regions,
8938
- regionSchema,
8939
- securityDescriptor,
8940
- workflowInfo,
8941
- });
8546
+ return new Page(Object.assign(Object.assign({}, mapPageConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8942
8547
  },
8943
8548
  };
8944
8549
 
@@ -8949,8 +8554,7 @@ const mapTargetGroupConditionConstructorArgs = (mappingRegistry, backendModel) =
8949
8554
  const targetGroupConditionMapping = {
8950
8555
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetGroupCondition',
8951
8556
  mapper: (mappingRegistry, backendModel) => {
8952
- const { targetGroup } = mapTargetGroupConditionConstructorArgs(mappingRegistry, backendModel);
8953
- return new TargetGroupCondition({ backendModel, targetGroup });
8557
+ return new TargetGroupCondition(Object.assign(Object.assign({}, mapTargetGroupConditionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8954
8558
  },
8955
8559
  };
8956
8560
 
@@ -9185,8 +8789,7 @@ const mapPublishInfoConstructorArgs = (mappingRegistry, backendModel) => {
9185
8789
  const publishInfoMapping = {
9186
8790
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInfo',
9187
8791
  mapper: (mappingRegistry, backendModel) => {
9188
- const { renderedWith, repository, targetType, user } = mapPublishInfoConstructorArgs(mappingRegistry, backendModel);
9189
- return new PublishInfo({ backendModel, renderedWith, repository, targetType, user });
8792
+ return new PublishInfo(Object.assign(Object.assign({}, mapPublishInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9190
8793
  },
9191
8794
  };
9192
8795
 
@@ -9198,8 +8801,7 @@ const mapPublishTransactionsCreationResultConstructorArgs = (mappingRegistry, ba
9198
8801
  const publishTransactionsCreationResultMapping = {
9199
8802
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransactionsCreationResult',
9200
8803
  mapper: (mappingRegistry, backendModel) => {
9201
- const { publishTransactionIds } = mapPublishTransactionsCreationResultConstructorArgs(mappingRegistry, backendModel);
9202
- return new PublishTransactionsCreationResult({ backendModel, publishTransactionIds });
8804
+ return new PublishTransactionsCreationResult(Object.assign(Object.assign({}, mapPublishTransactionsCreationResultConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9203
8805
  },
9204
8806
  };
9205
8807
 
@@ -9220,8 +8822,7 @@ const mapResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
9220
8822
  const resolvedItemMapping = {
9221
8823
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ResolvedItem',
9222
8824
  mapper: (mappingRegistry, backendModel) => {
9223
- const { item, publication, targetType, template } = mapResolvedItemConstructorArgs(mappingRegistry, backendModel);
9224
- return new ResolvedItem({ backendModel, item, publication, targetType, template });
8825
+ return new ResolvedItem(Object.assign(Object.assign({}, mapResolvedItemConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9225
8826
  },
9226
8827
  };
9227
8828
 
@@ -9655,31 +9256,12 @@ class TemplateBuildingBlock extends Template {
9655
9256
  }
9656
9257
 
9657
9258
  const mapTemplateConstructorArgs = (mappingRegistry, backendModel) => {
9658
- const { dynamicVersionInfo, fullVersionInfo, blueprintInfo, limitedVersionInfo, locationInfo, lockInfo, metadataSchema, applicableActions, basicVersionInfo, id, isDynamic, isLocked, isNew, listLinks, loadInfo, securityDescriptor, } = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
9659
9259
  const binaryContent = mappingRegistry.map(backendModel.BinaryContent);
9660
9260
  const parameterSchema = backendModel.ParameterSchema
9661
9261
  ? mappingRegistry.map(backendModel.ParameterSchema)
9662
9262
  : undefined;
9663
- return {
9664
- binaryContent,
9665
- parameterSchema,
9666
- dynamicVersionInfo,
9667
- fullVersionInfo,
9668
- blueprintInfo,
9669
- limitedVersionInfo,
9670
- locationInfo,
9671
- lockInfo,
9672
- metadataSchema,
9673
- applicableActions,
9674
- basicVersionInfo,
9675
- id,
9676
- isDynamic,
9677
- isLocked,
9678
- isNew,
9679
- listLinks,
9680
- loadInfo,
9681
- securityDescriptor,
9682
- };
9263
+ return Object.assign(Object.assign({}, mapVersionedItemConstructorArgs(mappingRegistry, backendModel)), { binaryContent,
9264
+ parameterSchema });
9683
9265
  };
9684
9266
 
9685
9267
  const mapPageTemplateConstructorArgs = (mappingRegistry, backendModel) => {
@@ -9698,31 +9280,7 @@ const mapPageTemplateConstructorArgs = (mappingRegistry, backendModel) => {
9698
9280
  const pageTemplateMapping = {
9699
9281
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PageTemplate',
9700
9282
  mapper: (mappingRegistry, backendModel) => {
9701
- const { applicableActions, approvalStatus, basicVersionInfo, binaryContent, blueprintInfo, dynamicVersionInfo, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, pageSchema, parameterSchema, securityDescriptor, workflowInfo, } = mapPageTemplateConstructorArgs(mappingRegistry, backendModel);
9702
- return new PageTemplate({
9703
- applicableActions,
9704
- approvalStatus,
9705
- backendModel,
9706
- basicVersionInfo,
9707
- binaryContent,
9708
- blueprintInfo,
9709
- dynamicVersionInfo,
9710
- fullVersionInfo,
9711
- id,
9712
- isDynamic,
9713
- isLocked,
9714
- isNew,
9715
- limitedVersionInfo,
9716
- listLinks,
9717
- loadInfo,
9718
- locationInfo,
9719
- lockInfo,
9720
- metadataSchema,
9721
- pageSchema,
9722
- parameterSchema,
9723
- securityDescriptor,
9724
- workflowInfo,
9725
- });
9283
+ return new PageTemplate(Object.assign(Object.assign({}, mapPageTemplateConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9726
9284
  },
9727
9285
  };
9728
9286
 
@@ -9744,32 +9302,7 @@ const mapComponentTemplateConstructorArgs = (mappingRegistry, backendModel) => {
9744
9302
  const componentTemplateMapping = {
9745
9303
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentTemplate',
9746
9304
  mapper: (mappingRegistry, backendModel) => {
9747
- const { binaryContent, parameterSchema, approvalStatus, workflowInfo, relatedSchemas, trackingCategories, dynamicVersionInfo, fullVersionInfo, blueprintInfo, limitedVersionInfo, locationInfo, lockInfo, metadataSchema, applicableActions, basicVersionInfo, id, isDynamic, isLocked, isNew, listLinks, loadInfo, securityDescriptor, } = mapComponentTemplateConstructorArgs(mappingRegistry, backendModel);
9748
- return new ComponentTemplate({
9749
- binaryContent,
9750
- parameterSchema,
9751
- backendModel,
9752
- approvalStatus,
9753
- workflowInfo,
9754
- relatedSchemas,
9755
- trackingCategories,
9756
- dynamicVersionInfo,
9757
- fullVersionInfo,
9758
- blueprintInfo,
9759
- limitedVersionInfo,
9760
- locationInfo,
9761
- lockInfo,
9762
- metadataSchema,
9763
- applicableActions,
9764
- basicVersionInfo,
9765
- id,
9766
- isDynamic,
9767
- isLocked,
9768
- isNew,
9769
- listLinks,
9770
- loadInfo,
9771
- securityDescriptor,
9772
- });
9305
+ return new ComponentTemplate(Object.assign(Object.assign({}, mapComponentTemplateConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9773
9306
  },
9774
9307
  };
9775
9308
 
@@ -9787,30 +9320,7 @@ const mapTemplateBuildingBlockConstructorArgs = (mappingRegistry, backendModel)
9787
9320
  const templateBuildingBlockMapping = {
9788
9321
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TemplateBuildingBlock',
9789
9322
  mapper: (mappingRegistry, backendModel) => {
9790
- const { applicableActions, approvalStatus, basicVersionInfo, binaryContent, blueprintInfo, dynamicVersionInfo, fullVersionInfo, id, isDynamic, isLocked, isNew, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadataSchema, parameterSchema, securityDescriptor, workflowInfo, } = mapTemplateBuildingBlockConstructorArgs(mappingRegistry, backendModel);
9791
- return new TemplateBuildingBlock({
9792
- applicableActions,
9793
- approvalStatus,
9794
- backendModel,
9795
- basicVersionInfo,
9796
- binaryContent,
9797
- blueprintInfo,
9798
- dynamicVersionInfo,
9799
- fullVersionInfo,
9800
- id,
9801
- isDynamic,
9802
- isLocked,
9803
- isNew,
9804
- limitedVersionInfo,
9805
- listLinks,
9806
- loadInfo,
9807
- locationInfo,
9808
- lockInfo,
9809
- metadataSchema,
9810
- parameterSchema,
9811
- securityDescriptor,
9812
- workflowInfo,
9813
- });
9323
+ return new TemplateBuildingBlock(Object.assign(Object.assign({}, mapTemplateBuildingBlockConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9814
9324
  },
9815
9325
  };
9816
9326
 
@@ -13450,7 +12960,7 @@ const mapWorkflowObjectConstructorArgs = (mappingRegistry, backendModel) => {
13450
12960
  return Object.assign(Object.assign({}, identifiableObjectConstructorArgs), { contextRepository });
13451
12961
  };
13452
12962
 
13453
- const mapActivityDefinitionConstrcutorArgs = (mappingRegistry, backendModel) => {
12963
+ const mapActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
13454
12964
  const { contextRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor } = mapWorkflowObjectConstructorArgs(mappingRegistry, backendModel);
13455
12965
  const activityConstraints = backendModel.ActivityConstraints
13456
12966
  ? mapActivityConstraints(backendModel.ActivityConstraints)
@@ -13475,20 +12985,7 @@ const mapActivityDefinitionConstrcutorArgs = (mappingRegistry, backendModel) =>
13475
12985
  const activityDefinitionMapping = {
13476
12986
  identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityDefinition',
13477
12987
  mapper: (mappingRegistry, backendModel) => {
13478
- const { activityConstraints, assignee, contextRepository, processDefinition, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, } = mapActivityDefinitionConstrcutorArgs(mappingRegistry, backendModel);
13479
- return new ActivityDefinition({
13480
- backendModel,
13481
- activityConstraints,
13482
- assignee,
13483
- contextRepository,
13484
- processDefinition,
13485
- applicableActions,
13486
- basicVersionInfo,
13487
- id,
13488
- listLinks,
13489
- loadInfo,
13490
- securityDescriptor,
13491
- });
12988
+ return new ActivityDefinition(Object.assign(Object.assign({}, mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
13492
12989
  },
13493
12990
  };
13494
12991
 
@@ -13805,7 +13302,7 @@ const processInstanceMapping = {
13805
13302
  };
13806
13303
 
13807
13304
  const mapTridionActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
13808
- const activityDefinition = mapActivityDefinitionConstrcutorArgs(mappingRegistry, backendModel);
13305
+ const activityDefinition = mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel);
13809
13306
  const activityType = backendModel.ActivityType ? mapActivityType(backendModel.ActivityType) : undefined;
13810
13307
  const finishApprovalStatus = backendModel.FinishApprovalStatus
13811
13308
  ? mappingRegistry.map(backendModel.FinishApprovalStatus)
@@ -13971,6 +13468,7 @@ const registerMappings = (mappingRegistry) => {
13971
13468
  mappingRegistry.register(blueprintInfoMapping);
13972
13469
  mappingRegistry.register(bundleMapping);
13973
13470
  mappingRegistry.register(businessProcessTypeMapping);
13471
+ mappingRegistry.register(businessProcessTypesMapping);
13974
13472
  mappingRegistry.register(classificationDetailMapping);
13975
13473
  mappingRegistry.register(classificationInfoMapping);
13976
13474
  mappingRegistry.register(componentLinkFieldDefinitionMapping);
@@ -14033,6 +13531,7 @@ const registerMappings = (mappingRegistry) => {
14033
13531
  mappingRegistry.register(targetGroupMapping);
14034
13532
  mappingRegistry.register(targetLanguageMapping);
14035
13533
  mappingRegistry.register(targetTypeMapping);
13534
+ mappingRegistry.register(taxonomiesMapping);
14036
13535
  mappingRegistry.register(templateBuildingBlockMapping);
14037
13536
  mappingRegistry.register(tmsLanguageMapping);
14038
13537
  mappingRegistry.register(tmsWorkflowMapping);
@@ -14617,4 +14116,4 @@ const mapToModels = (backendItems) => {
14617
14116
  return backendItems.map(i => tryMapToModel(i)).filter(isDefined);
14618
14117
  };
14619
14118
 
14620
- export { AccessControlEntry, AccessControlList, AccessToken, Activity, ActivityDefinition, ActivityHistory, ActivityInstance, ApiError, ApprovalStatus, BasicVersionInfo, Batch, BatchOperation, BinaryContent, BlueprintGraph, BlueprintGraphNode, BlueprintInfo, Bundle, BusinessProcessType, BusinessProcessTypes, ClaimMapping, ClassificationDetail, ClassificationInfo, Component, ComponentBase, ComponentLinkFieldDefinition, ComponentPresentation, ComponentTemplate, DateFieldDefinition, DateListDefinition, DynamicVersionInfo, EclUri, EmbeddedRegion, EmbeddedSchemaFieldDefinition, ExternalContainer, ExternalKeyword, ExternalKeywordCategory, ExternalLinkFieldDefinition, ExternalMultimediaComponent, ExternalVersionInfo, FinishActivityResult, Folder, FormattingFeatures, FullVersionInfo, GroupMembership, HateoasLink, IdentifiableObject, ItemBlueprintHierarchy, ItemBlueprintRloNodeData, ItemFieldDefinition, ItemPublishableFieldDefinition, Keyword, KeywordCategory, KeywordFieldDefinition, LimitedVersionInfo, Link, LinkWithIsEditable, ListDefinition, LoadInfo, LocationInfo, LockInfo, MultiLineTextFieldDefinition, MultimediaComponent, MultimediaLinkFieldDefinition, MultimediaType, NumberFieldDefinition, NumberListDefinition, OrganizationalItem, Page, PageTemplate, Process, ProcessDefinition, ProcessHistory, ProcessInstance, Publication, PublicationBlueprintHierarchy, PublishInfo, PublishLocationInfo, PublishTransactionsCreationResult, PublishUrlInfo, PublishingTarget, Region, Repository, RepositoryLocalObject, ResolvedItem, Schema, SearchFolder, SecurityDescriptor, SingleLineTextFieldDefinition, SingleLineTextListDefinition, StructureGroup, SystemPrivilege, SystemWideObject, TargetGroup, TargetGroupCondition, TargetLanguage, TargetType, Taxonomies, TcmUri, Template, TemplateBuildingBlock, TextFieldDefinition, TmsLanguage, TmsWorkflow, TmsWorkflowStep, TranslationDetails, TranslationErrorDetails, TranslationExceptionDetails, TranslationInfo, TranslationJob, TranslationJobInfo, TranslationJobItem, TranslationTargetPublication, TranslationWorkflowStatus, TridionActivityDefinition, TridionProcessDefinition, Trustee, User, UserFavoriteLink, UserGroup, UserLocaleInfo, UserPreferences, UserProfile, UserRuntimeInfo, ValidationError, ValidationResult, ValidationWarning, VersionedItem, VirtualFolder, VirtualUri, WorkItem, WorkflowInfo, WorkflowObject, XhtmlFieldDefinition, applicableActions, changeOrgItemToBusinessProcessTypes, changeOrgItemToTaxonomies, configureLocale, createBackendLink, determineBatchStatus, getItemContainerId, getItemLinkType, getItemType, isRloNode, itemLinkType, itemLinkTypes, itemType, itemTypes, listLinks, mapActivityStateToBackend, mapBatchOperationState, mapPublishPriorityToBackend, mapRetrieveReasonToBackend, mapRloItemTypeToBackend, mapStringSearchModeToBackend, mapStructureResolveOptionToBackend, mapToModel, mapToModels, mapTranslationErrorSeverityToBackend, mapTranslationJobPriorityToBackend, mapTranslationJobStateToBackend, mapTranslationJobTypeToBackend, mapTranslationStatusToBackend, parseItemUri, tryMapToModel, tryParseItemUri };
14119
+ export { AccessControlEntry, AccessControlList, AccessToken, Activity, ActivityDefinition, ActivityHistory, ActivityInstance, ApiError, ApprovalStatus, BasicVersionInfo, Batch, BatchOperation, BinaryContent, BlueprintGraph, BlueprintGraphNode, BlueprintInfo, Bundle, BusinessProcessType, BusinessProcessTypes, ClaimMapping, ClassificationDetail, ClassificationInfo, Component, ComponentBase, ComponentLinkFieldDefinition, ComponentPresentation, ComponentTemplate, DateFieldDefinition, DateListDefinition, DynamicVersionInfo, EclUri, EmbeddedRegion, EmbeddedSchemaFieldDefinition, ExternalContainer, ExternalKeyword, ExternalKeywordCategory, ExternalLinkFieldDefinition, ExternalMultimediaComponent, ExternalVersionInfo, FinishActivityResult, Folder, FormattingFeatures, FullVersionInfo, GroupMembership, HateoasLink, IdentifiableObject, ItemBlueprintHierarchy, ItemBlueprintRloNodeData, ItemFieldDefinition, ItemPublishableFieldDefinition, Keyword, KeywordCategory, KeywordFieldDefinition, LimitedVersionInfo, Link, LinkWithIsEditable, ListDefinition, LoadInfo, LocationInfo, LockInfo, MultiLineTextFieldDefinition, MultimediaComponent, MultimediaLinkFieldDefinition, MultimediaType, NumberFieldDefinition, NumberListDefinition, OrganizationalItem, Page, PageTemplate, Process, ProcessDefinition, ProcessHistory, ProcessInstance, Publication, PublicationBlueprintHierarchy, PublishInfo, PublishLocationInfo, PublishTransactionsCreationResult, PublishUrlInfo, PublishingTarget, Region, Repository, RepositoryLocalObject, ResolvedItem, Schema, SearchFolder, SecurityDescriptor, SingleLineTextFieldDefinition, SingleLineTextListDefinition, StructureGroup, SystemPrivilege, SystemWideObject, TargetGroup, TargetGroupCondition, TargetLanguage, TargetType, Taxonomies, TcmUri, Template, TemplateBuildingBlock, TextFieldDefinition, TmsLanguage, TmsWorkflow, TmsWorkflowStep, TranslationDetails, TranslationErrorDetails, TranslationExceptionDetails, TranslationInfo, TranslationJob, TranslationJobInfo, TranslationJobItem, TranslationTargetPublication, TranslationWorkflowStatus, TridionActivityDefinition, TridionProcessDefinition, Trustee, User, UserFavoriteLink, UserGroup, UserLocaleInfo, UserPreferences, UserProfile, UserRuntimeInfo, ValidationError, ValidationResult, ValidationWarning, VersionedItem, VirtualFolder, VirtualUri, WorkItem, WorkflowInfo, WorkflowObject, XhtmlFieldDefinition, applicableActions, configureLocale, createBackendBusinessProcessTypes, createBackendHateoasLink, createBackendLink, createBackendTaxonomies, determineBatchStatus, getItemContainerId, getItemLinkType, getItemType, isRloNode, itemLinkType, itemLinkTypes, itemType, itemTypes, listLinks, mapActivityStateToBackend, mapBatchOperationState, mapPublishPriorityToBackend, mapRetrieveReasonToBackend, mapRloItemTypeToBackend, mapStringSearchModeToBackend, mapStructureResolveOptionToBackend, mapToModel, mapToModels, mapTranslationErrorSeverityToBackend, mapTranslationJobPriorityToBackend, mapTranslationJobStateToBackend, mapTranslationJobTypeToBackend, mapTranslationStatusToBackend, parseItemUri, tryMapToModel, tryParseItemUri };