@tridion-sites/models 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { LinkTargetStatus, BatchOperationState, Permissions, Rights, StringSearchMode, ErrorType, LoadInfoState, WhereUsedCommentToken, PublishPriority, LockType, RLOItemType, ComponentType, SchemaPurpose, DeployerAction, PublishAction, PublishTransactionState, StructureResolveOption, SynchronizeFlags, ResolveOptions, RetrieveReason, TranslationStatus, ErrorSeverity, TranslationJobDisplayState, TranslationJobPriority, TranslationJobState, TranslationJobType, ActivityConstraints, ActivityType, ActivityState, ProcessFinishReason, ListDetails, DependencyDirection } from '@tridion-sites/open-api-client';
1
+ import { LinkTargetStatus, BatchOperationState, Permissions, Rights, StringSearchMode, ErrorType, LoadInfoState, WhereUsedCommentToken, PublishPriority, LockType, RLOItemType, ComponentType, SchemaPurpose, DeployerAction, PublishAction, PublishTransactionState, StructureResolveOption, SynchronizeFlags, ResolveOptions, RetrieveReason, TranslationStatus, ErrorSeverity, TranslationJobDisplayState, TranslationJobPriority, TranslationJobState, TranslationJobType, ActivityConstraints, ActivityType, ActivityState, ProcessFinishReason, SearchBlueprintStatus, ListDetails, DependencyDirection } from '@tridion-sites/open-api-client';
2
2
  import { produce } from 'immer';
3
3
 
4
4
  /**
@@ -156,8 +156,7 @@ class SecurityDescriptor {
156
156
  configurable: true,
157
157
  writable: true,
158
158
  value: (right) => {
159
- var _a, _b;
160
- return !!((_a = this._rights) === null || _a === void 0 ? void 0 : _a.includes('all')) || !!((_b = this._rights) === null || _b === void 0 ? void 0 : _b.includes(right));
159
+ return !!this._rights?.includes('all') || !!this._rights?.includes(right);
161
160
  }
162
161
  });
163
162
  /**
@@ -170,8 +169,7 @@ class SecurityDescriptor {
170
169
  configurable: true,
171
170
  writable: true,
172
171
  value: (permission) => {
173
- var _a, _b;
174
- return !!((_a = this._permissions) === null || _a === void 0 ? void 0 : _a.includes('all')) || !!((_b = this._permissions) === null || _b === void 0 ? void 0 : _b.includes(permission));
172
+ return !!this._permissions?.includes('all') || !!this._permissions?.includes(permission);
175
173
  }
176
174
  });
177
175
  Object.defineProperty(this, "getInternalModel", {
@@ -200,40 +198,6 @@ class SecurityDescriptor {
200
198
  }
201
199
  }
202
200
 
203
- /******************************************************************************
204
- Copyright (c) Microsoft Corporation.
205
-
206
- Permission to use, copy, modify, and/or distribute this software for any
207
- purpose with or without fee is hereby granted.
208
-
209
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
210
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
211
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
212
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
213
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
214
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
215
- PERFORMANCE OF THIS SOFTWARE.
216
- ***************************************************************************** */
217
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
218
-
219
-
220
- function __rest(s, e) {
221
- var t = {};
222
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
223
- t[p] = s[p];
224
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
225
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
226
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
227
- t[p[i]] = s[p[i]];
228
- }
229
- return t;
230
- }
231
-
232
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
233
- var e = new Error(message);
234
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
235
- };
236
-
237
201
  const applicableActions = {
238
202
  view: 'tcm:view',
239
203
  edit: 'tcm:edit',
@@ -259,9 +223,17 @@ const applicableActions = {
259
223
  assignActivity: 'tcm:assignactivity',
260
224
  startActivity: 'tcm:startactivity',
261
225
  finishActivity: 'tcm:finishactivity',
226
+ finishProcess: 'tcm:finishprocess',
262
227
  restartActivity: 'tcm:restartactivity',
228
+ // Translation Manager
263
229
  pushTranslation: 'tm:pushtranslation',
264
230
  pullTranslation: 'tm:pulltranslation',
231
+ deleteTranslation: 'tm:delete',
232
+ retryTranslation: 'tm:retry',
233
+ viewTranslation: 'tm:view',
234
+ editTranslation: 'tm:edit',
235
+ copyTranslation: 'tm:copy',
236
+ sendTranslation: 'tm:send',
265
237
  };
266
238
 
267
239
  /**
@@ -370,7 +342,7 @@ const parseItemType = (itemType) => {
370
342
  return itemTypeIdToItemType.get(itemTypeId);
371
343
  };
372
344
 
373
- var _a$1;
345
+ var _a$2;
374
346
  /**
375
347
  * Represents a native Tridion Content Manager URI which uniquely identifies a resource in the system.
376
348
  *
@@ -415,7 +387,7 @@ class TcmUri {
415
387
  value: () => {
416
388
  if (this._itemType === 'publication')
417
389
  return this;
418
- return _a$1.createPublicationUri(this._publicationId);
390
+ return _a$2.createPublicationUri(this._publicationId);
419
391
  }
420
392
  });
421
393
  Object.defineProperty(this, "getVersionlessUri", {
@@ -423,7 +395,7 @@ class TcmUri {
423
395
  configurable: true,
424
396
  writable: true,
425
397
  value: () => {
426
- return _a$1.create(this._publicationId, this._itemId, this._itemType);
398
+ return _a$2.create(this._publicationId, this._itemId, this._itemType);
427
399
  }
428
400
  });
429
401
  Object.defineProperty(this, "getUriWithVersion", {
@@ -431,7 +403,7 @@ class TcmUri {
431
403
  configurable: true,
432
404
  writable: true,
433
405
  value: (version) => {
434
- return _a$1.create(this._publicationId, this._itemId, this._itemType, version);
406
+ return _a$2.create(this._publicationId, this._itemId, this._itemType, version);
435
407
  }
436
408
  });
437
409
  Object.defineProperty(this, "getUriInPublication", {
@@ -439,7 +411,7 @@ class TcmUri {
439
411
  configurable: true,
440
412
  writable: true,
441
413
  value: (publicationUri) => {
442
- return _a$1.create(publicationUri._itemId, this._itemId, this._itemType, this._itemVersion);
414
+ return _a$2.create(publicationUri._itemId, this._itemId, this._itemType, this._itemVersion);
443
415
  }
444
416
  });
445
417
  this._publicationId = publicationId;
@@ -455,6 +427,9 @@ class TcmUri {
455
427
  }
456
428
  this._asString = `tcm:${parts.join('-')}`;
457
429
  }
430
+ static get uriPrefix() {
431
+ return this._tcmUriPrefix;
432
+ }
458
433
  get publicationId() {
459
434
  return this._publicationId;
460
435
  }
@@ -474,17 +449,17 @@ class TcmUri {
474
449
  return this._itemId === 0;
475
450
  }
476
451
  get isNullUri() {
477
- return (this._publicationId === _a$1.null.publicationId &&
478
- this._itemId === _a$1.null.itemId &&
479
- this._itemType === _a$1.null.itemType);
452
+ return (this._publicationId === _a$2.null.publicationId &&
453
+ this._itemId === _a$2.null.itemId &&
454
+ this._itemType === _a$2.null.itemType);
480
455
  }
481
456
  get isSystemUri() {
482
- return (this._publicationId === _a$1.system.publicationId &&
483
- this._itemId === _a$1.system.itemId &&
484
- this._itemType === _a$1.system.itemType);
457
+ return (this._publicationId === _a$2.system.publicationId &&
458
+ this._itemId === _a$2.system.itemId &&
459
+ this._itemType === _a$2.system.itemType);
485
460
  }
486
461
  get isEditableVersion() {
487
- return this.isNullUri || this._itemVersion === _a$1._editableVersion;
462
+ return this.isNullUri || this._itemVersion === _a$2._editableVersion;
488
463
  }
489
464
  get isDynamic() {
490
465
  return this._itemVersion === 0;
@@ -493,13 +468,19 @@ class TcmUri {
493
468
  return this._asString;
494
469
  }
495
470
  }
496
- _a$1 = TcmUri;
471
+ _a$2 = TcmUri;
497
472
  Object.defineProperty(TcmUri, "_tcmUriCache", {
498
473
  enumerable: true,
499
474
  configurable: true,
500
475
  writable: true,
501
476
  value: new Map()
502
477
  });
478
+ Object.defineProperty(TcmUri, "_tcmUriPrefix", {
479
+ enumerable: true,
480
+ configurable: true,
481
+ writable: true,
482
+ value: 'tcm'
483
+ });
503
484
  Object.defineProperty(TcmUri, "_tcmUriRegExp", {
504
485
  enumerable: true,
505
486
  configurable: true,
@@ -517,11 +498,11 @@ Object.defineProperty(TcmUri, "create", {
517
498
  configurable: true,
518
499
  writable: true,
519
500
  value: (publicationId, itemId, itemType, itemVersion) => {
520
- const tcmUri = new _a$1(publicationId, itemId, itemType, itemVersion);
521
- const cachedTcmUri = _a$1._tcmUriCache.get(tcmUri.asString);
501
+ const tcmUri = new _a$2(publicationId, itemId, itemType, itemVersion);
502
+ const cachedTcmUri = _a$2._tcmUriCache.get(tcmUri.asString);
522
503
  if (cachedTcmUri)
523
504
  return cachedTcmUri;
524
- _a$1._tcmUriCache.set(tcmUri.asString, tcmUri);
505
+ _a$2._tcmUriCache.set(tcmUri.asString, tcmUri);
525
506
  return tcmUri;
526
507
  }
527
508
  });
@@ -529,23 +510,23 @@ Object.defineProperty(TcmUri, "null", {
529
510
  enumerable: true,
530
511
  configurable: true,
531
512
  writable: true,
532
- value: _a$1.create(0, 0, 'none')
513
+ value: _a$2.create(0, 0, 'none')
533
514
  });
534
515
  Object.defineProperty(TcmUri, "system", {
535
516
  enumerable: true,
536
517
  configurable: true,
537
518
  writable: true,
538
- value: _a$1.create(0, 0, 'system')
519
+ value: _a$2.create(0, 0, 'system')
539
520
  });
540
521
  Object.defineProperty(TcmUri, "parse", {
541
522
  enumerable: true,
542
523
  configurable: true,
543
524
  writable: true,
544
525
  value: (input) => {
545
- const cachedTcmUri = _a$1._tcmUriCache.get(input);
526
+ const cachedTcmUri = _a$2._tcmUriCache.get(input);
546
527
  if (cachedTcmUri)
547
528
  return cachedTcmUri;
548
- const result = _a$1._tcmUriRegExp.exec(input);
529
+ const result = _a$2._tcmUriRegExp.exec(input);
549
530
  if (!result)
550
531
  return undefined;
551
532
  const pubIdPart = result[1];
@@ -576,7 +557,7 @@ Object.defineProperty(TcmUri, "parse", {
576
557
  if (isNaN(version) || version < 0)
577
558
  return undefined;
578
559
  }
579
- return _a$1.create(publicationId, itemId, itemType, version);
560
+ return _a$2.create(publicationId, itemId, itemType, version);
580
561
  }
581
562
  });
582
563
  Object.defineProperty(TcmUri, "createPublicationUri", {
@@ -584,11 +565,11 @@ Object.defineProperty(TcmUri, "createPublicationUri", {
584
565
  configurable: true,
585
566
  writable: true,
586
567
  value: (publicationId) => {
587
- return _a$1.create(0, publicationId, 'publication');
568
+ return _a$2.create(0, publicationId, 'publication');
588
569
  }
589
570
  });
590
571
 
591
- var _a;
572
+ var _a$1;
592
573
  class EclUri {
593
574
  constructor(publicationId, mountPointId, itemId, itemType, subType, itemVersion) {
594
575
  /**
@@ -667,7 +648,7 @@ class EclUri {
667
648
  configurable: true,
668
649
  writable: true,
669
650
  value: () => {
670
- return _a.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType);
651
+ return _a$1.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType);
671
652
  }
672
653
  });
673
654
  Object.defineProperty(this, "getMountPointUri", {
@@ -677,7 +658,7 @@ class EclUri {
677
658
  value: () => {
678
659
  if (this._itemType === 'mountpoint')
679
660
  return this;
680
- return _a.create(this._publicationId, this._mountPointId, 'root', 'mountpoint', 'mp');
661
+ return _a$1.create(this._publicationId, this._mountPointId, 'root', 'mountpoint', 'mp');
681
662
  }
682
663
  });
683
664
  Object.defineProperty(this, "getUriWithVersion", {
@@ -685,7 +666,7 @@ class EclUri {
685
666
  configurable: true,
686
667
  writable: true,
687
668
  value: (version) => {
688
- return _a.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType, version);
669
+ return _a$1.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType, version);
689
670
  }
690
671
  });
691
672
  Object.defineProperty(this, "getUriInPublication", {
@@ -693,7 +674,7 @@ class EclUri {
693
674
  configurable: true,
694
675
  writable: true,
695
676
  value: (publicationUri) => {
696
- return _a.create(publicationUri.itemId, this._mountPointId, this._itemId, this._itemType, this._subType, this._itemVersion);
677
+ return _a$1.create(publicationUri.itemId, this._mountPointId, this._itemId, this._itemType, this._subType, this._itemVersion);
697
678
  }
698
679
  });
699
680
  this._publicationId = publicationId;
@@ -714,6 +695,9 @@ class EclUri {
714
695
  }
715
696
  this._asString = `ecl:${parts.join('-')}`;
716
697
  }
698
+ static get uriPrefix() {
699
+ return this._eclUriPrefix;
700
+ }
717
701
  get publicationId() {
718
702
  return this._publicationId;
719
703
  }
@@ -742,29 +726,35 @@ class EclUri {
742
726
  return this._asString;
743
727
  }
744
728
  }
745
- _a = EclUri;
729
+ _a$1 = EclUri;
746
730
  Object.defineProperty(EclUri, "_eclUriCache", {
747
731
  enumerable: true,
748
732
  configurable: true,
749
733
  writable: true,
750
734
  value: new Map()
751
735
  });
736
+ Object.defineProperty(EclUri, "_eclUriPrefix", {
737
+ enumerable: true,
738
+ configurable: true,
739
+ writable: true,
740
+ value: 'ecl'
741
+ });
752
742
  Object.defineProperty(EclUri, "_eclUriRegExp", {
753
743
  enumerable: true,
754
744
  configurable: true,
755
745
  writable: true,
756
- value: new RegExp(/^ecl:(\d+)-([^\s-]+)-([^\s-]+)-([^\s-]*)-([^\s\(\)-]+)(-v(\d+))?$/)
746
+ value: new RegExp(/^ecl:(\d+)-([^-]+)-([^-]+)-([^-]+)-(\w+)(-v(\d+))?$/)
757
747
  });
758
748
  Object.defineProperty(EclUri, "create", {
759
749
  enumerable: true,
760
750
  configurable: true,
761
751
  writable: true,
762
752
  value: (publicationId, mountPointId, itemId, itemType, subType, itemVersion) => {
763
- const eclUri = new _a(publicationId, mountPointId, itemId, itemType, subType, itemVersion);
764
- const cachedEclUri = _a._eclUriCache.get(eclUri.asString);
753
+ const eclUri = new _a$1(publicationId, mountPointId, itemId, itemType, subType, itemVersion);
754
+ const cachedEclUri = _a$1._eclUriCache.get(eclUri.asString);
765
755
  if (cachedEclUri)
766
756
  return cachedEclUri;
767
- _a._eclUriCache.set(eclUri.asString, eclUri);
757
+ _a$1._eclUriCache.set(eclUri.asString, eclUri);
768
758
  return eclUri;
769
759
  }
770
760
  });
@@ -773,7 +763,7 @@ Object.defineProperty(EclUri, "parse", {
773
763
  configurable: true,
774
764
  writable: true,
775
765
  value: (input) => {
776
- const result = _a._eclUriRegExp.exec(input);
766
+ const result = _a$1._eclUriRegExp.exec(input);
777
767
  if (!result)
778
768
  return undefined;
779
769
  const pubIdPart = result[1];
@@ -803,10 +793,128 @@ Object.defineProperty(EclUri, "parse", {
803
793
  if (isNaN(version) || version < 0)
804
794
  return undefined;
805
795
  }
806
- return _a.create(publicationId, mountPointId, itemId, itemType, subType, version);
796
+ return _a$1.create(publicationId, mountPointId, itemId, itemType, subType, version);
797
+ }
798
+ });
799
+
800
+ var _a;
801
+ class TmUri {
802
+ constructor(itemId) {
803
+ /**
804
+ * TM-specified item id.
805
+ */
806
+ Object.defineProperty(this, "_itemId", {
807
+ enumerable: true,
808
+ configurable: true,
809
+ writable: true,
810
+ value: void 0
811
+ });
812
+ Object.defineProperty(this, "_asString", {
813
+ enumerable: true,
814
+ configurable: true,
815
+ writable: true,
816
+ value: void 0
817
+ });
818
+ /**
819
+ * Don't use it, will be removed later. Added to align api with other uris.
820
+ *
821
+ * @deprecated
822
+ */
823
+ Object.defineProperty(this, "getPublicationUri", {
824
+ enumerable: true,
825
+ configurable: true,
826
+ writable: true,
827
+ value: () => {
828
+ return TcmUri.createPublicationUri(0);
829
+ }
830
+ });
831
+ /**
832
+ * Don't use it, will be removed later. Added to align api with other uris.
833
+ *
834
+ * @deprecated
835
+ */
836
+ Object.defineProperty(this, "getUriInPublication", {
837
+ enumerable: true,
838
+ configurable: true,
839
+ writable: true,
840
+ value: (publicationUri) => {
841
+ return _a.create(this._itemId);
842
+ }
843
+ });
844
+ this._itemId = itemId;
845
+ this._asString = `tm:0-${this._itemId}-2`;
846
+ }
847
+ static get uriPrefix() {
848
+ return this._tmUriPrefix;
849
+ }
850
+ get itemType() {
851
+ return 'translationJob';
852
+ }
853
+ get itemId() {
854
+ return this._itemId;
855
+ }
856
+ get asString() {
857
+ return this._asString;
858
+ }
859
+ /**
860
+ * Don't use it, will be removed later. Added to align api with other uris.
861
+ *
862
+ * @deprecated
863
+ */
864
+ get isDynamic() {
865
+ return false;
866
+ }
867
+ }
868
+ _a = TmUri;
869
+ Object.defineProperty(TmUri, "_tmUriCache", {
870
+ enumerable: true,
871
+ configurable: true,
872
+ writable: true,
873
+ value: new Map()
874
+ });
875
+ Object.defineProperty(TmUri, "_tmUriPrefix", {
876
+ enumerable: true,
877
+ configurable: true,
878
+ writable: true,
879
+ value: 'tm'
880
+ });
881
+ Object.defineProperty(TmUri, "_tmUriRegExp", {
882
+ enumerable: true,
883
+ configurable: true,
884
+ writable: true,
885
+ value: new RegExp(/^tm:0-(\d+)-2$/)
886
+ });
887
+ Object.defineProperty(TmUri, "create", {
888
+ enumerable: true,
889
+ configurable: true,
890
+ writable: true,
891
+ value: (itemId) => {
892
+ const tmUri = new _a(itemId);
893
+ const cachedTmUri = _a._tmUriCache.get(tmUri.asString);
894
+ if (cachedTmUri)
895
+ return cachedTmUri;
896
+ _a._tmUriCache.set(tmUri.asString, tmUri);
897
+ return tmUri;
898
+ }
899
+ });
900
+ Object.defineProperty(TmUri, "parse", {
901
+ enumerable: true,
902
+ configurable: true,
903
+ writable: true,
904
+ value: (input) => {
905
+ const result = _a._tmUriRegExp.exec(input);
906
+ if (!result)
907
+ return undefined;
908
+ const itemIdPart = result[1];
909
+ if (itemIdPart === undefined)
910
+ return undefined;
911
+ const itemId = parseInt(itemIdPart);
912
+ return _a.create(itemId);
807
913
  }
808
914
  });
809
915
 
916
+ const BUSINESS_PROCESS_TYPES_NAMESPACE = 'bptman-';
917
+ const TAXONOMIES_NAMESPACE = 'catman-';
810
918
  class VirtualUri {
811
919
  constructor(publicationUri, itemType) {
812
920
  Object.defineProperty(this, "_publicationUri", {
@@ -848,6 +956,9 @@ class VirtualUri {
848
956
  const namespace = this._itemType === 'businessProcessTypes' ? 'bptman-' : 'catman-';
849
957
  this._asString = `${namespace}${this._publicationUri.asString}`;
850
958
  }
959
+ get itemId() {
960
+ return this._publicationUri.asString;
961
+ }
851
962
  get itemType() {
852
963
  return this._itemType;
853
964
  }
@@ -884,12 +995,12 @@ Object.defineProperty(VirtualUri, "parse", {
884
995
  value: (input) => {
885
996
  let itemIdPart;
886
997
  let itemType;
887
- if (input.startsWith('bptman-')) {
888
- itemIdPart = input.replace('bptman-', '');
998
+ if (input.startsWith(BUSINESS_PROCESS_TYPES_NAMESPACE)) {
999
+ itemIdPart = input.replace(BUSINESS_PROCESS_TYPES_NAMESPACE, '');
889
1000
  itemType = 'businessProcessTypes';
890
1001
  }
891
- if (input.startsWith('catman-')) {
892
- itemIdPart = input.replace('catman-', '');
1002
+ if (input.startsWith(TAXONOMIES_NAMESPACE)) {
1003
+ itemIdPart = input.replace(TAXONOMIES_NAMESPACE, '');
893
1004
  itemType = 'taxonomies';
894
1005
  }
895
1006
  if (!itemIdPart || !itemType)
@@ -911,6 +1022,9 @@ const tryParseItemUri = (backendId) => {
911
1022
  const virtualUri = VirtualUri.parse(backendId);
912
1023
  if (virtualUri)
913
1024
  return virtualUri;
1025
+ const tmUri = TmUri.parse(backendId);
1026
+ if (tmUri)
1027
+ return tmUri;
914
1028
  return undefined;
915
1029
  };
916
1030
  const parseItemUri = (backendId) => {
@@ -1180,7 +1294,7 @@ class IdentifiableObject {
1180
1294
  value: (applicableAction) => {
1181
1295
  if (!this._applicableActions)
1182
1296
  return false;
1183
- return this._applicableActions.some(action => { var _a; return ((_a = action.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === applicableActions[applicableAction]; });
1297
+ return this._applicableActions.some(action => action.relationType?.toLowerCase() === applicableActions[applicableAction]);
1184
1298
  }
1185
1299
  });
1186
1300
  Object.defineProperty(this, "hasListLink", {
@@ -1190,7 +1304,7 @@ class IdentifiableObject {
1190
1304
  value: (listLink) => {
1191
1305
  if (!this._listLinks)
1192
1306
  return false;
1193
- return this._listLinks.some(link => { var _a; return ((_a = link.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === listLinks[listLink]; });
1307
+ return this._listLinks.some(link => link.relationType?.toLowerCase() === listLinks[listLink]);
1194
1308
  }
1195
1309
  });
1196
1310
  Object.defineProperty(this, "hasLoadError", {
@@ -1198,8 +1312,7 @@ class IdentifiableObject {
1198
1312
  configurable: true,
1199
1313
  writable: true,
1200
1314
  value: (specificError) => {
1201
- var _a;
1202
- if (!((_a = this.loadInfo) === null || _a === void 0 ? void 0 : _a.errorType) || this.loadInfo.errorType === 'none') {
1315
+ if (!this.loadInfo?.errorType || this.loadInfo.errorType === 'none') {
1203
1316
  return false;
1204
1317
  }
1205
1318
  if (specificError) {
@@ -1463,9 +1576,8 @@ class MultimediaType extends SystemWideObject {
1463
1576
  * Represents a Repository: a context for BluePrinting.
1464
1577
  */
1465
1578
  class Repository extends SystemWideObject {
1466
- constructor(_a) {
1467
- 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"]);
1468
- super(Object.assign({ backendModel }, systemWideObjectArgs));
1579
+ constructor({ backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, defaultMultimediaSchema, locationInfo, metadataSchema, minimalLocalizeApprovalStatus, parents, rootFolder, taskProcess, versionInfo, ...systemWideObjectArgs }) {
1580
+ super({ backendModel, ...systemWideObjectArgs });
1469
1581
  Object.defineProperty(this, "_accessControlList", {
1470
1582
  enumerable: true,
1471
1583
  configurable: true,
@@ -1603,9 +1715,8 @@ class Repository extends SystemWideObject {
1603
1715
  * Publication: a "Repository" used for publishing.
1604
1716
  */
1605
1717
  class Publication extends Repository {
1606
- constructor(_a) {
1607
- 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"]);
1608
- super(Object.assign({ backendModel }, repositoryArgs));
1718
+ constructor({ backendModel, componentSnapshotTemplate, componentTemplateProcess, defaultComponentTemplate, defaultPageTemplate, defaultTemplateBuildingBlock, pageSnapshotTemplate, pageTemplateProcess, rootStructureGroup, templateBundleProcess, ...repositoryArgs }) {
1719
+ super({ backendModel, ...repositoryArgs });
1609
1720
  Object.defineProperty(this, "_componentSnapshotTemplate", {
1610
1721
  enumerable: true,
1611
1722
  configurable: true,
@@ -1799,9 +1910,8 @@ class PublishingTarget extends SystemWideObject {
1799
1910
  * Represents the data of a Target Type used as a target for publishing.
1800
1911
  */
1801
1912
  class TargetType extends PublishingTarget {
1802
- constructor(_a) {
1803
- var { backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, minimalApprovalStatus, priority } = _a, publishingTargetArgs = __rest(_a, ["backendModel", "accessControlList", "businessProcessType", "contentSecurityDescriptor", "minimalApprovalStatus", "priority"]);
1804
- super(Object.assign({ backendModel }, publishingTargetArgs));
1913
+ constructor({ backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, minimalApprovalStatus, priority, ...publishingTargetArgs }) {
1914
+ super({ backendModel, ...publishingTargetArgs });
1805
1915
  Object.defineProperty(this, "_accessControlList", {
1806
1916
  enumerable: true,
1807
1917
  configurable: true,
@@ -1900,9 +2010,8 @@ class TargetType extends PublishingTarget {
1900
2010
  * Represents the data of a Batch.
1901
2011
  */
1902
2012
  class Batch extends SystemWideObject {
1903
- constructor(_a) {
1904
- var { backendModel, backendBatchOperation, operations, performer, status, type } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "backendBatchOperation", "operations", "performer", "status", "type"]);
1905
- super(Object.assign({ backendModel }, systemWideObjectArgs));
2013
+ constructor({ backendModel, backendBatchOperation, operations, performer, status, type, ...systemWideObjectArgs }) {
2014
+ super({ backendModel, ...systemWideObjectArgs });
1906
2015
  Object.defineProperty(this, "_backendBatchOperation", {
1907
2016
  enumerable: true,
1908
2017
  configurable: true,
@@ -1960,8 +2069,7 @@ class Batch extends SystemWideObject {
1960
2069
  * Additional parameters for invoking operation.
1961
2070
  */
1962
2071
  get parameters() {
1963
- var _a;
1964
- return (_a = this._backendBatchOperation) === null || _a === void 0 ? void 0 : _a.Parameters;
2072
+ return this._backendBatchOperation?.Parameters;
1965
2073
  }
1966
2074
  /**
1967
2075
  * Whether all batch operations are finished.
@@ -2128,7 +2236,6 @@ class ValidationWarning extends ValidationResult {
2128
2236
 
2129
2237
  class ValidationApiError extends ApiError {
2130
2238
  constructor(backendModel) {
2131
- var _a, _b;
2132
2239
  super(backendModel);
2133
2240
  Object.defineProperty(this, "_backendModel", {
2134
2241
  enumerable: true,
@@ -2149,8 +2256,8 @@ class ValidationApiError extends ApiError {
2149
2256
  value: void 0
2150
2257
  });
2151
2258
  this._backendModel = backendModel;
2152
- this._validationErrors = ((_a = backendModel.body.Data.ValidationErrors) === null || _a === void 0 ? void 0 : _a.map(e => new ValidationError(e))) || [];
2153
- this._validationWarnings = ((_b = backendModel.body.Data.ValidationWarnings) === null || _b === void 0 ? void 0 : _b.map(w => new ValidationWarning(w))) || [];
2259
+ this._validationErrors = backendModel.body.Data.ValidationErrors?.map(e => new ValidationError(e)) || [];
2260
+ this._validationWarnings = backendModel.body.Data.ValidationWarnings?.map(w => new ValidationWarning(w)) || [];
2154
2261
  }
2155
2262
  get validationWarnings() {
2156
2263
  return this._validationWarnings;
@@ -2186,7 +2293,6 @@ const mapBatchOperationState = (backendModel) => {
2186
2293
 
2187
2294
  class BatchOperation {
2188
2295
  constructor(backendModel, subject) {
2189
- var _a, _b;
2190
2296
  Object.defineProperty(this, "_backendModel", {
2191
2297
  enumerable: true,
2192
2298
  configurable: true,
@@ -2225,8 +2331,8 @@ class BatchOperation {
2225
2331
  });
2226
2332
  this._backendModel = backendModel;
2227
2333
  this._state = backendModel.State ? mapBatchOperationState(backendModel.State) : undefined;
2228
- this._validationErrors = (_a = backendModel.ValidationErrors) === null || _a === void 0 ? void 0 : _a.map(e => new ValidationError(e));
2229
- this._validationWarnings = (_b = backendModel.ValidationWarnings) === null || _b === void 0 ? void 0 : _b.map(w => new ValidationWarning(w));
2334
+ this._validationErrors = backendModel.ValidationErrors?.map(e => new ValidationError(e));
2335
+ this._validationWarnings = backendModel.ValidationWarnings?.map(w => new ValidationWarning(w));
2230
2336
  this._subject = subject;
2231
2337
  this._createdItems = backendModel.CreatedItems
2232
2338
  ? backendModel.CreatedItems.map(i => parseItemUri(i))
@@ -2498,12 +2604,104 @@ class MappingRegistry {
2498
2604
  this._mappings.push(mapping);
2499
2605
  }
2500
2606
  map(fromModel) {
2501
- var _a;
2502
- const modelMapper = (_a = this._mappings.find(map => map.identifier(fromModel))) === null || _a === void 0 ? void 0 : _a.mapper;
2503
- return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper(this, fromModel);
2607
+ const modelMapper = this._mappings.find(map => map.identifier(fromModel))?.mapper;
2608
+ return modelMapper?.(this, fromModel);
2609
+ }
2610
+ }
2611
+
2612
+ const mapDate = (rawDate) => {
2613
+ const date = new Date(rawDate);
2614
+ // If called with an invalid date string, it returns a Date object whose `toString()` method returns the literal string `Invalid Date`.
2615
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date
2616
+ if (date.toString() === 'Invalid Date')
2617
+ return undefined;
2618
+ return date;
2619
+ };
2620
+
2621
+ const contentMapping = (mappingRegistry, contentObject) => {
2622
+ if (typeof contentObject !== 'object' || contentObject === null) {
2623
+ throw new Error('Please make sure that content property is of type `Record<string, any>`');
2624
+ }
2625
+ const mappedContent = {};
2626
+ for (const key in contentObject) {
2627
+ const value = contentObject[key];
2628
+ if (typeof value === 'object' && value !== null) {
2629
+ if (Array.isArray(value)) {
2630
+ mappedContent[key] = value.map(itemValue => {
2631
+ if (typeof itemValue !== 'object' || itemValue === null) {
2632
+ return itemValue;
2633
+ }
2634
+ if ('$type' in itemValue) {
2635
+ return mappingRegistry.map(itemValue);
2636
+ }
2637
+ return contentMapping(mappingRegistry, itemValue);
2638
+ });
2639
+ continue;
2640
+ }
2641
+ // Map to a Model if object has `$type`
2642
+ if ('$type' in value) {
2643
+ mappedContent[key] = mappingRegistry.map(value);
2644
+ continue;
2645
+ }
2646
+ if (mappedContent[key] === undefined) {
2647
+ // Otherwise it is just another level of properties and we should go deeper (Or such type is not in our mapping registry, e.g. EmbeddedFieldDefinition)
2648
+ mappedContent[key] = contentMapping(mappingRegistry, value);
2649
+ continue;
2650
+ }
2651
+ }
2652
+ else {
2653
+ // Value is a primitive (e.g. string, number, boolean)
2654
+ mappedContent[key] = value;
2655
+ }
2656
+ }
2657
+ return mappedContent;
2658
+ };
2659
+
2660
+ class Settings {
2661
+ constructor({ backendModel, data }) {
2662
+ Object.defineProperty(this, "_backendModel", {
2663
+ enumerable: true,
2664
+ configurable: true,
2665
+ writable: true,
2666
+ value: void 0
2667
+ });
2668
+ Object.defineProperty(this, "_data", {
2669
+ enumerable: true,
2670
+ configurable: true,
2671
+ writable: true,
2672
+ value: void 0
2673
+ });
2674
+ Object.defineProperty(this, "getInternalModel", {
2675
+ enumerable: true,
2676
+ configurable: true,
2677
+ writable: true,
2678
+ value: () => {
2679
+ return this._backendModel;
2680
+ }
2681
+ });
2682
+ this._backendModel = backendModel;
2683
+ this._data = data;
2684
+ }
2685
+ get data() {
2686
+ return this._data;
2504
2687
  }
2505
2688
  }
2506
2689
 
2690
+ const mapSettingsConstructorArgs = (registry, backendModel) => {
2691
+ const data = contentMapping(registry, backendModel.Data);
2692
+ return { data };
2693
+ };
2694
+ const settingsMapping = {
2695
+ identifier: backendModel => backendModel?.$type === 'Settings',
2696
+ mapper: (registry, backendModel) => {
2697
+ const { data } = mapSettingsConstructorArgs(registry, backendModel);
2698
+ return new Settings({
2699
+ backendModel,
2700
+ data,
2701
+ });
2702
+ },
2703
+ };
2704
+
2507
2705
  const permissionMapping = (backendModel) => {
2508
2706
  switch (backendModel) {
2509
2707
  case Permissions.ALL:
@@ -2575,13 +2773,12 @@ const rightMapping = (backendModel) => {
2575
2773
  };
2576
2774
 
2577
2775
  const accessControlEntryMapping = {
2578
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AccessControlEntry',
2776
+ identifier: backendModel => backendModel?.$type === 'AccessControlEntry',
2579
2777
  mapper: (mappingRegistry, backendModel) => {
2580
- var _a, _b, _c, _d;
2581
- const allowedPermissions = (_a = backendModel.AllowedPermissions) === null || _a === void 0 ? void 0 : _a.map(p => permissionMapping(p));
2582
- const allowedRights = (_b = backendModel.AllowedRights) === null || _b === void 0 ? void 0 : _b.map(r => rightMapping(r));
2583
- const deniedPermissions = (_c = backendModel.DeniedPermissions) === null || _c === void 0 ? void 0 : _c.map(p => permissionMapping(p));
2584
- const deniedRights = (_d = backendModel.DeniedRights) === null || _d === void 0 ? void 0 : _d.map(r => rightMapping(r));
2778
+ const allowedPermissions = backendModel.AllowedPermissions?.map(p => permissionMapping(p));
2779
+ const allowedRights = backendModel.AllowedRights?.map(r => rightMapping(r));
2780
+ const deniedPermissions = backendModel.DeniedPermissions?.map(p => permissionMapping(p));
2781
+ const deniedRights = backendModel.DeniedRights?.map(r => rightMapping(r));
2585
2782
  const trustee = backendModel.Trustee ? mappingRegistry.map(backendModel.Trustee) : undefined;
2586
2783
  return new AccessControlEntry({
2587
2784
  allowedPermissions,
@@ -2613,20 +2810,18 @@ const isExactInstanceOf = (value, ctor) => {
2613
2810
  };
2614
2811
 
2615
2812
  const accessControlListMapping = {
2616
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AccessControlList',
2813
+ identifier: backendModel => backendModel?.$type === 'AccessControlList',
2617
2814
  mapper: (mappingRegistry, backendModel) => {
2618
- var _a;
2619
- const accessControlEntries = (_a = backendModel.AccessControlEntries) === null || _a === void 0 ? void 0 : _a.map(e => mappingRegistry.map(e)).filter(isDefined);
2815
+ const accessControlEntries = backendModel.AccessControlEntries?.map(e => mappingRegistry.map(e)).filter(isDefined);
2620
2816
  return new AccessControlList({ accessControlEntries, backendModel });
2621
2817
  },
2622
2818
  };
2623
2819
 
2624
2820
  const securityDescriptorMapping = {
2625
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SecurityDescriptor',
2821
+ identifier: backendModel => backendModel?.$type === 'SecurityDescriptor',
2626
2822
  mapper: (mappingRegistry, backendModel) => {
2627
- var _a, _b;
2628
- const permissions = (_a = backendModel.Permissions) === null || _a === void 0 ? void 0 : _a.map(p => permissionMapping(p));
2629
- const rights = (_b = backendModel.Rights) === null || _b === void 0 ? void 0 : _b.map(r => rightMapping(r));
2823
+ const permissions = backendModel.Permissions?.map(p => permissionMapping(p));
2824
+ const rights = backendModel.Rights?.map(r => rightMapping(r));
2630
2825
  return new SecurityDescriptor({ backendModel, permissions, rights });
2631
2826
  },
2632
2827
  };
@@ -2644,47 +2839,13 @@ const mapStringSearchModeToBackend = (backendModel) => {
2644
2839
  }
2645
2840
  };
2646
2841
 
2647
- const mapDate = (rawDate) => {
2648
- const date = new Date(rawDate);
2649
- // If called with an invalid date string, it returns a Date object whose `toString()` method returns the literal string `Invalid Date`.
2650
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date
2651
- if (date.toString() === 'Invalid Date')
2652
- return undefined;
2653
- return date;
2654
- };
2655
-
2656
- const contentMapping = (mappingRegistry, contentObject) => {
2657
- if (typeof contentObject !== 'object' || contentObject === null) {
2658
- throw new Error('Please make sure that content property is of type `Record<string, any>`');
2659
- }
2660
- const mappedContent = {};
2661
- for (const key in contentObject) {
2662
- const value = contentObject[key];
2663
- if (typeof value === 'object' && value !== null) {
2664
- // Map to a Model if object has `$type`
2665
- if ('$type' in value) {
2666
- mappedContent[key] = mappingRegistry.map(value);
2667
- }
2668
- else {
2669
- // Otherwise it is just another level of properties and we should go deeper
2670
- mappedContent[key] = contentMapping(mappingRegistry, value);
2671
- }
2672
- }
2673
- else {
2674
- // Value is a primitive (e.g. string, number, boolean)
2675
- mappedContent[key] = value;
2676
- }
2677
- }
2678
- return mappedContent;
2679
- };
2680
-
2681
2842
  const mapBasicVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
2682
2843
  const creationDate = backendModel.CreationDate ? mapDate(backendModel.CreationDate) : undefined;
2683
2844
  const revisionDate = backendModel.RevisionDate ? mapDate(backendModel.RevisionDate) : undefined;
2684
2845
  return { creationDate, revisionDate };
2685
2846
  };
2686
2847
  const basicVersionInfoMapping = {
2687
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BasicVersionInfo',
2848
+ identifier: backendModel => backendModel?.$type === 'BasicVersionInfo',
2688
2849
  mapper: (mappingRegistry, backendModel) => {
2689
2850
  const { creationDate, revisionDate } = mapBasicVersionInfoConstructorArgs(mappingRegistry, backendModel);
2690
2851
  return new BasicVersionInfo({ backendModel, creationDate, revisionDate });
@@ -2719,14 +2880,13 @@ const mapErrorTypeToBackend = (errorType) => {
2719
2880
  };
2720
2881
 
2721
2882
  const mapIdentifiableObjectConstructorArgs = (mappingRegistry, backendModel) => {
2722
- var _a, _b;
2723
2883
  const id = parseItemUri(backendModel.Id);
2724
2884
  const loadInfo = backendModel.LoadInfo ? mappingRegistry.map(backendModel.LoadInfo) : undefined;
2725
2885
  const basicVersionInfo = backendModel.VersionInfo
2726
2886
  ? mappingRegistry.map(backendModel.VersionInfo)
2727
2887
  : undefined;
2728
- const applicableActions = (_a = backendModel.ApplicableActions) === null || _a === void 0 ? void 0 : _a.map(action => mappingRegistry.map(action)).filter(isDefined);
2729
- const listLinks = (_b = backendModel.ListLinks) === null || _b === void 0 ? void 0 : _b.map(link => mappingRegistry.map(link)).filter(isDefined);
2888
+ const applicableActions = backendModel.ApplicableActions?.map(action => mappingRegistry.map(action)).filter(isDefined);
2889
+ const listLinks = backendModel.ListLinks?.map(link => mappingRegistry.map(link)).filter(isDefined);
2730
2890
  const securityDescriptor = backendModel.SecurityDescriptor
2731
2891
  ? mappingRegistry.map(backendModel.SecurityDescriptor)
2732
2892
  : undefined;
@@ -2769,7 +2929,7 @@ const mapLoadInfoConstructorArgs = (mappingRegistry, backendModel) => {
2769
2929
  return { errorType, state };
2770
2930
  };
2771
2931
  const loadInfoMapping = {
2772
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LoadInfo',
2932
+ identifier: backendModel => backendModel?.$type === 'LoadInfo',
2773
2933
  mapper: (mappingRegistry, backendModel) => {
2774
2934
  const { errorType, state } = mapLoadInfoConstructorArgs(mappingRegistry, backendModel);
2775
2935
  return new LoadInfo({ backendModel, errorType, state });
@@ -2796,7 +2956,7 @@ const mapWhereUsedListInfoConstructorArgs = (mappingRegistry, backendModel) => {
2796
2956
  return { commentToken };
2797
2957
  };
2798
2958
  const whereUsedListInfoMapping = {
2799
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'WhereUsedListInfo',
2959
+ identifier: backendModel => backendModel?.$type === 'WhereUsedListInfo',
2800
2960
  mapper: (mappingRegistry, backendModel) => {
2801
2961
  const { commentToken } = mapWhereUsedListInfoConstructorArgs(mappingRegistry, backendModel);
2802
2962
  return new WhereUsedListInfo({ backendModel, commentToken });
@@ -2807,22 +2967,28 @@ const mapSystemWideObjectConstructorArgs = mapIdentifiableObjectConstructorArgs;
2807
2967
 
2808
2968
  const mapApprovalStatusConstructorArgs = mapSystemWideObjectConstructorArgs;
2809
2969
  const approvalStatusMapping = {
2810
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ApprovalStatus',
2970
+ identifier: backendModel => backendModel?.$type === 'ApprovalStatus',
2811
2971
  mapper: (mappingRegistry, backendModel) => {
2812
- return new ApprovalStatus(Object.assign(Object.assign({}, mapApprovalStatusConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2972
+ return new ApprovalStatus({
2973
+ ...mapApprovalStatusConstructorArgs(mappingRegistry, backendModel),
2974
+ backendModel,
2975
+ });
2813
2976
  },
2814
2977
  };
2815
2978
 
2816
2979
  const mapMultimediaTypeConstructorArgs = mapSystemWideObjectConstructorArgs;
2817
2980
  const multimediaTypeMapping = {
2818
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultimediaType',
2981
+ identifier: backendModel => backendModel?.$type === 'MultimediaType',
2819
2982
  mapper: (mappingRegistry, backendModel) => {
2820
- return new MultimediaType(Object.assign(Object.assign({}, mapMultimediaTypeConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2983
+ return new MultimediaType({
2984
+ ...mapMultimediaTypeConstructorArgs(mappingRegistry, backendModel),
2985
+ backendModel,
2986
+ });
2821
2987
  },
2822
2988
  };
2823
2989
 
2824
2990
  const hateoasLinkMapping = {
2825
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'HateoasLink',
2991
+ identifier: backendModel => backendModel?.$type === 'HateoasLink',
2826
2992
  mapper: (mappingRegistry, backendModel) => {
2827
2993
  return new HateoasLink(backendModel);
2828
2994
  },
@@ -2831,7 +2997,7 @@ const hateoasLinkMapping = {
2831
2997
  const mapLinkConstructorArgs = (mappingRegistry, backendModel) => {
2832
2998
  let idRef = backendModel && tryParseItemUri(backendModel.IdRef);
2833
2999
  let isDynamicTarget = false;
2834
- if ((idRef === null || idRef === void 0 ? void 0 : idRef.isDynamic) && (idRef instanceof TcmUri || idRef instanceof EclUri)) {
3000
+ if ((idRef instanceof TcmUri || idRef instanceof EclUri) && idRef?.isDynamic) {
2835
3001
  idRef = idRef.getVersionlessUri();
2836
3002
  isDynamicTarget = true;
2837
3003
  }
@@ -2840,7 +3006,7 @@ const mapLinkConstructorArgs = (mappingRegistry, backendModel) => {
2840
3006
  return { idRef, isDynamicTarget };
2841
3007
  };
2842
3008
  const linkMapping = {
2843
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Link',
3009
+ identifier: backendModel => backendModel?.$type === 'Link',
2844
3010
  mapper: (mappingRegistry, backendModel) => {
2845
3011
  const linkConstructorArgs = mapLinkConstructorArgs(mappingRegistry, backendModel);
2846
3012
  if (!linkConstructorArgs) {
@@ -2874,7 +3040,7 @@ const mapLinks = (mappingRegistry, backendLinks) => {
2874
3040
 
2875
3041
  const mapLinkWithIsEditableConstructorArgs = mapLinkConstructorArgs;
2876
3042
  const linkWithEditableMapping = {
2877
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LinkWithIsEditable',
3043
+ identifier: backendModel => backendModel?.$type === 'LinkWithIsEditable',
2878
3044
  mapper: (mappingRegistry, backendModel) => {
2879
3045
  const linkWithIsEditableConstructorArgs = mapLinkWithIsEditableConstructorArgs(mappingRegistry, backendModel);
2880
3046
  if (!linkWithIsEditableConstructorArgs)
@@ -2913,7 +3079,9 @@ const mapRepositoryConstructorArgs = (mappingRegistry, backendModel) => {
2913
3079
  const versionInfo = backendModel.VersionInfo
2914
3080
  ? mappingRegistry.map(backendModel.VersionInfo)
2915
3081
  : undefined;
2916
- return Object.assign(Object.assign({}, systemWideObjectConstructorArgs), { accessControlList,
3082
+ return {
3083
+ ...systemWideObjectConstructorArgs,
3084
+ accessControlList,
2917
3085
  businessProcessType,
2918
3086
  contentSecurityDescriptor,
2919
3087
  defaultMultimediaSchema,
@@ -2923,12 +3091,16 @@ const mapRepositoryConstructorArgs = (mappingRegistry, backendModel) => {
2923
3091
  parents,
2924
3092
  rootFolder,
2925
3093
  taskProcess,
2926
- versionInfo });
3094
+ versionInfo,
3095
+ };
2927
3096
  };
2928
3097
  const repositoryMapping = {
2929
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Repository',
3098
+ identifier: backendModel => backendModel?.$type === 'Repository',
2930
3099
  mapper: (mappingRegistry, backendModel) => {
2931
- return new Repository(Object.assign(Object.assign({}, mapRepositoryConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3100
+ return new Repository({
3101
+ ...mapRepositoryConstructorArgs(mappingRegistry, backendModel),
3102
+ backendModel,
3103
+ });
2932
3104
  },
2933
3105
  };
2934
3106
 
@@ -2961,7 +3133,9 @@ const mapPublicationConstructorArgs = (mappingRegistry, backendModel) => {
2961
3133
  const templateBundleProcess = backendModel.TemplateBundleProcess
2962
3134
  ? mappingRegistry.map(backendModel.TemplateBundleProcess)
2963
3135
  : undefined;
2964
- return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { componentSnapshotTemplate,
3136
+ return {
3137
+ ...repositoryLocalObjectConstructorArgs,
3138
+ componentSnapshotTemplate,
2965
3139
  componentTemplateProcess,
2966
3140
  defaultComponentTemplate,
2967
3141
  defaultPageTemplate,
@@ -2969,12 +3143,16 @@ const mapPublicationConstructorArgs = (mappingRegistry, backendModel) => {
2969
3143
  pageSnapshotTemplate,
2970
3144
  pageTemplateProcess,
2971
3145
  rootStructureGroup,
2972
- templateBundleProcess });
3146
+ templateBundleProcess,
3147
+ };
2973
3148
  };
2974
3149
  const publicationMapping = {
2975
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Publication',
3150
+ identifier: backendModel => backendModel?.$type === 'Publication',
2976
3151
  mapper: (mappingRegistry, backendModel) => {
2977
- return new Publication(Object.assign(Object.assign({}, mapPublicationConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3152
+ return new Publication({
3153
+ ...mapPublicationConstructorArgs(mappingRegistry, backendModel),
3154
+ backendModel,
3155
+ });
2978
3156
  },
2979
3157
  };
2980
3158
 
@@ -3000,7 +3178,7 @@ const mapPublishPriorityToBackend = (model) => {
3000
3178
  };
3001
3179
 
3002
3180
  const targetTypeMapping = {
3003
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetType',
3181
+ identifier: backendModel => backendModel?.$type === 'TargetType',
3004
3182
  mapper: (mappingRegistry, backendModel) => {
3005
3183
  const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo } = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
3006
3184
  const accessControlList = backendModel.AccessControlList
@@ -3038,8 +3216,7 @@ const batchOperationMapping = (mappingRegistry, backendModel) => {
3038
3216
  if (!backendModel.Statuses)
3039
3217
  return undefined;
3040
3218
  return backendModel.Statuses.map(status => {
3041
- var _a;
3042
- const subjectLink = (_a = backendModel.SubjectLinks) === null || _a === void 0 ? void 0 : _a.find(s => s.IdRef === status.SubjectId);
3219
+ const subjectLink = backendModel.SubjectLinks?.find(s => s.IdRef === status.SubjectId);
3043
3220
  const link = mappingRegistry.map(subjectLink);
3044
3221
  return new BatchOperation(status, link);
3045
3222
  });
@@ -3069,25 +3246,30 @@ const batchTypeMapping = (backendType) => {
3069
3246
  };
3070
3247
 
3071
3248
  const mapBatchConstructorArgs = (mappingRegistry, backendModel) => {
3072
- var _a;
3073
3249
  const systemWideObjectConstructorArgs = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
3074
3250
  const performer = backendModel.Performer ? mappingRegistry.map(backendModel.Performer) : undefined;
3075
- const backendBatchOperation = (_a = backendModel.Operations) === null || _a === void 0 ? void 0 : _a[0];
3076
- const type = (backendBatchOperation === null || backendBatchOperation === void 0 ? void 0 : backendBatchOperation.Operation) ? batchTypeMapping(backendBatchOperation.Operation) : undefined;
3251
+ const backendBatchOperation = backendModel.Operations?.[0];
3252
+ const type = backendBatchOperation?.Operation ? batchTypeMapping(backendBatchOperation.Operation) : undefined;
3077
3253
  const operations = backendBatchOperation
3078
3254
  ? batchOperationMapping(mappingRegistry, backendBatchOperation)
3079
3255
  : undefined;
3080
3256
  const status = operations ? determineBatchStatus(operations) : undefined;
3081
- return Object.assign(Object.assign({}, systemWideObjectConstructorArgs), { performer,
3257
+ return {
3258
+ ...systemWideObjectConstructorArgs,
3259
+ performer,
3082
3260
  type,
3083
3261
  operations,
3084
3262
  status,
3085
- backendBatchOperation });
3263
+ backendBatchOperation,
3264
+ };
3086
3265
  };
3087
3266
  const batchMapping = {
3088
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Batch',
3267
+ identifier: backendModel => backendModel?.$type === 'Batch',
3089
3268
  mapper: (mappingRegistry, backendModel) => {
3090
- return new Batch(Object.assign(Object.assign({}, mapBatchConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3269
+ return new Batch({
3270
+ ...mapBatchConstructorArgs(mappingRegistry, backendModel),
3271
+ backendModel,
3272
+ });
3091
3273
  },
3092
3274
  };
3093
3275
 
@@ -3200,7 +3382,7 @@ const mapBinaryContentConstructorArgs = (mappingRegistry, backendModel) => {
3200
3382
  return { multimediaType };
3201
3383
  };
3202
3384
  const binaryContentMapping = {
3203
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BinaryContent',
3385
+ identifier: backendModel => backendModel?.$type === 'BinaryContent',
3204
3386
  mapper: (mappingRegistry, backendModel) => {
3205
3387
  const { multimediaType } = mapBinaryContentConstructorArgs(mappingRegistry, backendModel);
3206
3388
  return new BinaryContent({ backendModel, multimediaType });
@@ -3277,7 +3459,7 @@ const mapClassificationDetailConstructorArgs = (mappingRegistry, backendModel) =
3277
3459
  return { category, keywords };
3278
3460
  };
3279
3461
  const classificationDetailMapping = {
3280
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ClassificationDetail',
3462
+ identifier: backendModel => backendModel?.$type === 'ClassificationDetail',
3281
3463
  mapper: (mappingRegistry, backendModel) => {
3282
3464
  const { category, keywords } = mapClassificationDetailConstructorArgs(mappingRegistry, backendModel);
3283
3465
  return new ClassificationDetail({ backendModel, category, keywords });
@@ -3334,13 +3516,12 @@ class ClassificationInfo {
3334
3516
  }
3335
3517
 
3336
3518
  const mapClassificationInfoConstructorArgs = (mappingRegistry, backendModel) => {
3337
- var _a;
3338
- const details = (_a = backendModel.Details) === null || _a === void 0 ? void 0 : _a.map(c => mappingRegistry.map(c)).filter(isDefined);
3519
+ const details = backendModel.Details?.map(c => mappingRegistry.map(c)).filter(isDefined);
3339
3520
  const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
3340
3521
  return { details, item };
3341
3522
  };
3342
3523
  const classificationInfoMapping = {
3343
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ClassificationInfo',
3524
+ identifier: backendModel => backendModel?.$type === 'ClassificationInfo',
3344
3525
  mapper: (mappingRegistry, backendModel) => {
3345
3526
  const { details, item } = mapClassificationInfoConstructorArgs(mappingRegistry, backendModel);
3346
3527
  return new ClassificationInfo({ backendModel, details, item });
@@ -3467,8 +3648,7 @@ class BlueprintInfo {
3467
3648
  * Limited version info for Repository-Local Objects.
3468
3649
  */
3469
3650
  class LimitedVersionInfo extends BasicVersionInfo {
3470
- constructor(_a) {
3471
- var { creator } = _a, basicVersionInfoArgs = __rest(_a, ["creator"]);
3651
+ constructor({ creator, ...basicVersionInfoArgs }) {
3472
3652
  super(basicVersionInfoArgs);
3473
3653
  Object.defineProperty(this, "_creator", {
3474
3654
  enumerable: true,
@@ -3615,15 +3795,17 @@ class LockInfo {
3615
3795
  get lockUser() {
3616
3796
  return this._lockUser;
3617
3797
  }
3798
+ hasLockType(lockType) {
3799
+ return this._lockType.includes(lockType);
3800
+ }
3618
3801
  }
3619
3802
 
3620
3803
  /**
3621
3804
  * Abstract base class for the data of repository-local data objects: data objects that reside in a "Repository".
3622
3805
  */
3623
3806
  class RepositoryLocalObject extends IdentifiableObject {
3624
- constructor(_a) {
3625
- var { backendModel, blueprintInfo, isLocked, limitedVersionInfo, locationInfo, lockInfo, metadata, metadataSchema } = _a, identifiableObjectArgs = __rest(_a, ["backendModel", "blueprintInfo", "isLocked", "limitedVersionInfo", "locationInfo", "lockInfo", "metadata", "metadataSchema"]);
3626
- super(Object.assign({ backendModel }, identifiableObjectArgs));
3807
+ constructor({ backendModel, blueprintInfo, isLocked, limitedVersionInfo, locationInfo, lockInfo, metadata, metadataSchema, ...identifiableObjectArgs }) {
3808
+ super({ backendModel, ...identifiableObjectArgs });
3627
3809
  Object.defineProperty(this, "_limitedVersionInfo", {
3628
3810
  enumerable: true,
3629
3811
  configurable: true,
@@ -3671,8 +3853,7 @@ class RepositoryLocalObject extends IdentifiableObject {
3671
3853
  configurable: true,
3672
3854
  writable: true,
3673
3855
  value: (lockType) => {
3674
- var _a;
3675
- return !!((_a = this._lockInfo) === null || _a === void 0 ? void 0 : _a.lockType.includes(lockType));
3856
+ return !!this._lockInfo?.lockType.includes(lockType);
3676
3857
  }
3677
3858
  });
3678
3859
  Object.defineProperty(this, "isLockedByCurrentUser", {
@@ -3680,10 +3861,9 @@ class RepositoryLocalObject extends IdentifiableObject {
3680
3861
  configurable: true,
3681
3862
  writable: true,
3682
3863
  value: (currentUser) => {
3683
- var _a, _b;
3684
3864
  if (!currentUser.user)
3685
3865
  return false;
3686
- return ((_b = (_a = this._lockInfo) === null || _a === void 0 ? void 0 : _a.lockUser) === null || _b === void 0 ? void 0 : _b.idRef) === currentUser.user.id;
3866
+ return this._lockInfo?.lockUser?.idRef === currentUser.user.id;
3687
3867
  }
3688
3868
  });
3689
3869
  Object.defineProperty(this, "getInternalModel", {
@@ -3741,9 +3921,8 @@ class RepositoryLocalObject extends IdentifiableObject {
3741
3921
  * Limited version info for Repository-Local Objects.
3742
3922
  */
3743
3923
  class FullVersionInfo extends LimitedVersionInfo {
3744
- constructor(_a) {
3745
- var { backendModel, checkoutUser, lockType, revisor, checkOutDate } = _a, limitedVersionInfoArgs = __rest(_a, ["backendModel", "checkoutUser", "lockType", "revisor", "checkOutDate"]);
3746
- super(Object.assign({ backendModel }, limitedVersionInfoArgs));
3924
+ constructor({ backendModel, checkoutUser, lockType, revisor, checkOutDate, ...limitedVersionInfoArgs }) {
3925
+ super({ backendModel, ...limitedVersionInfoArgs });
3747
3926
  Object.defineProperty(this, "_checkoutUser", {
3748
3927
  enumerable: true,
3749
3928
  configurable: true,
@@ -3841,9 +4020,8 @@ class FullVersionInfo extends LimitedVersionInfo {
3841
4020
  * Abstract base class for Versioned Items.
3842
4021
  */
3843
4022
  class VersionedItem extends RepositoryLocalObject {
3844
- constructor(_a) {
3845
- var { backendModel, dynamicVersionInfo, fullVersionInfo, isDynamic } = _a, rloArgs = __rest(_a, ["backendModel", "dynamicVersionInfo", "fullVersionInfo", "isDynamic"]);
3846
- super(Object.assign({ backendModel }, rloArgs));
4023
+ constructor({ backendModel, dynamicVersionInfo, fullVersionInfo, isDynamic, ...rloArgs }) {
4024
+ super({ backendModel, ...rloArgs });
3847
4025
  Object.defineProperty(this, "_dynamicVersionInfo", {
3848
4026
  enumerable: true,
3849
4027
  configurable: true,
@@ -3875,8 +4053,7 @@ class VersionedItem extends RepositoryLocalObject {
3875
4053
  this._fullVersionInfo = fullVersionInfo;
3876
4054
  }
3877
4055
  get isAwaitingFirstCheckIn() {
3878
- var _a;
3879
- return ((_a = this._fullVersionInfo) === null || _a === void 0 ? void 0 : _a.isNew) || false;
4056
+ return this._fullVersionInfo?.isNew || false;
3880
4057
  }
3881
4058
  get isDynamic() {
3882
4059
  return this._isDynamic;
@@ -3892,15 +4069,17 @@ class VersionedItem extends RepositoryLocalObject {
3892
4069
  this._fullVersionInfo.version === this._fullVersionInfo.lastVersion &&
3893
4070
  this._fullVersionInfo.revision === 0);
3894
4071
  }
4072
+ get isHistoricVersion() {
4073
+ return !!this._fullVersionInfo && this._fullVersionInfo.version !== this._fullVersionInfo.lastVersion;
4074
+ }
3895
4075
  }
3896
4076
 
3897
4077
  /**
3898
4078
  * Represents the data of a Component: a generic holder of content and metadata.
3899
4079
  */
3900
4080
  class ComponentBase extends VersionedItem {
3901
- constructor(_a) {
3902
- var { backendModel, approvalStatus, componentType, schema, workflowInfo } = _a, componentBaseArgs = __rest(_a, ["backendModel", "approvalStatus", "componentType", "schema", "workflowInfo"]);
3903
- super(Object.assign({ backendModel }, componentBaseArgs));
4081
+ constructor({ backendModel, approvalStatus, componentType, schema, workflowInfo, ...componentBaseArgs }) {
4082
+ super({ backendModel, ...componentBaseArgs });
3904
4083
  Object.defineProperty(this, "_approvalStatus", {
3905
4084
  enumerable: true,
3906
4085
  configurable: true,
@@ -3982,9 +4161,8 @@ class ComponentBase extends VersionedItem {
3982
4161
  * Represents the data of a regular Component: content and metadata fields.
3983
4162
  */
3984
4163
  class Component extends ComponentBase {
3985
- constructor(_a) {
3986
- var { content, backendModel } = _a, componentBaseArgs = __rest(_a, ["content", "backendModel"]);
3987
- super(Object.assign({ backendModel }, componentBaseArgs));
4164
+ constructor({ content, backendModel, ...componentBaseArgs }) {
4165
+ super({ backendModel, ...componentBaseArgs });
3988
4166
  Object.defineProperty(this, "_content", {
3989
4167
  enumerable: true,
3990
4168
  configurable: true,
@@ -4002,8 +4180,7 @@ class Component extends ComponentBase {
4002
4180
  * Represents the data of a Multimedia Component: binary content data and metadata fields.
4003
4181
  */
4004
4182
  class MultimediaComponent extends ComponentBase {
4005
- constructor(_a) {
4006
- var { binaryContent } = _a, componentBaseArgs = __rest(_a, ["binaryContent"]);
4183
+ constructor({ binaryContent, ...componentBaseArgs }) {
4007
4184
  super(componentBaseArgs);
4008
4185
  Object.defineProperty(this, "_binaryContent", {
4009
4186
  enumerable: true,
@@ -4025,8 +4202,7 @@ class MultimediaComponent extends ComponentBase {
4025
4202
  * Represents an External Multimedia Component: an item provided from external system.
4026
4203
  */
4027
4204
  class ExternalMultimediaComponent extends MultimediaComponent {
4028
- constructor(_a) {
4029
- var { externalMetadataSchemaFields } = _a, multimediaComponentArgs = __rest(_a, ["externalMetadataSchemaFields"]);
4205
+ constructor({ externalMetadataSchemaFields, ...multimediaComponentArgs }) {
4030
4206
  super(multimediaComponentArgs);
4031
4207
  Object.defineProperty(this, "_externalMetadataSchemaFields", {
4032
4208
  enumerable: true,
@@ -4110,9 +4286,12 @@ const mapDynamicVersionInfoConstructorArgs = (mappingRegistry, backendModel) =>
4110
4286
  return { revisor, revisionDate };
4111
4287
  };
4112
4288
  const dynamicVersionInfoMapping = {
4113
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DynamicVersionInfo',
4289
+ identifier: backendModel => backendModel?.$type === 'DynamicVersionInfo',
4114
4290
  mapper: (mappingRegistry, backendModel) => {
4115
- return new DynamicVersionInfo(Object.assign(Object.assign({}, mapDynamicVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4291
+ return new DynamicVersionInfo({
4292
+ ...mapDynamicVersionInfoConstructorArgs(mappingRegistry, backendModel),
4293
+ backendModel,
4294
+ });
4116
4295
  },
4117
4296
  };
4118
4297
 
@@ -4126,21 +4305,27 @@ const mapBlueprintInfoConstructorArgs = (mappingRegistry, backendModel) => {
4126
4305
  return { owningRepository, primaryBlueprintParentItem };
4127
4306
  };
4128
4307
  const blueprintInfoMapping = {
4129
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BlueprintInfo',
4308
+ identifier: backendModel => backendModel?.$type === 'BlueprintInfo',
4130
4309
  mapper: (mappingRegistry, backendModel) => {
4131
- return new BlueprintInfo(Object.assign(Object.assign({}, mapBlueprintInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4310
+ return new BlueprintInfo({
4311
+ ...mapBlueprintInfoConstructorArgs(mappingRegistry, backendModel),
4312
+ backendModel,
4313
+ });
4132
4314
  },
4133
4315
  };
4134
4316
 
4135
4317
  const mapLimitedVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
4136
4318
  const basicVersionInfoConstructorArgs = mapBasicVersionInfoConstructorArgs(mappingRegistry, backendModel);
4137
4319
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
4138
- return Object.assign(Object.assign({}, basicVersionInfoConstructorArgs), { creator });
4320
+ return { ...basicVersionInfoConstructorArgs, creator };
4139
4321
  };
4140
4322
  const limitedVersionInfoMapping = {
4141
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LimitedVersionInfo',
4323
+ identifier: backendModel => backendModel?.$type === 'LimitedVersionInfo',
4142
4324
  mapper: (mappingRegistry, backendModel) => {
4143
- return new LimitedVersionInfo(Object.assign(Object.assign({}, mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4325
+ return new LimitedVersionInfo({
4326
+ ...mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel),
4327
+ backendModel,
4328
+ });
4144
4329
  },
4145
4330
  };
4146
4331
 
@@ -4154,9 +4339,12 @@ const mapLocationInfoConstructorArgs = (mappingRegistry, backendModel) => {
4154
4339
  return { contextRepository, organizationalItem };
4155
4340
  };
4156
4341
  const locationInfoMapping = {
4157
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LocationInfo',
4342
+ identifier: backendModel => backendModel?.$type === 'LocationInfo',
4158
4343
  mapper: (mappingRegistry, backendModel) => {
4159
- return new LocationInfo(Object.assign(Object.assign({}, mapLocationInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4344
+ return new LocationInfo({
4345
+ ...mapLocationInfoConstructorArgs(mappingRegistry, backendModel),
4346
+ backendModel,
4347
+ });
4160
4348
  },
4161
4349
  };
4162
4350
 
@@ -4198,16 +4386,18 @@ const mapLockTypeToBackend = (model) => {
4198
4386
  };
4199
4387
 
4200
4388
  const mapLockInfoConstructorArgs = (mappingRegistry, backendModel) => {
4201
- var _a;
4202
4389
  const lockUser = backendModel.LockUser ? mappingRegistry.map(backendModel.LockUser) : undefined;
4203
- const lockType = ((_a = backendModel.LockType) === null || _a === void 0 ? void 0 : _a.map(l => mapLockType(l))) || [];
4390
+ const lockType = backendModel.LockType?.map(l => mapLockType(l)) || [];
4204
4391
  const lockDate = backendModel.LockDate ? mapDate(backendModel.LockDate) : undefined;
4205
4392
  return { lockUser, lockType, lockDate };
4206
4393
  };
4207
4394
  const lockInfoMapping = {
4208
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LockInfo',
4395
+ identifier: backendModel => backendModel?.$type === 'LockInfo',
4209
4396
  mapper: (mappingRegistry, backendModel) => {
4210
- return new LockInfo(Object.assign(Object.assign({}, mapLockInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4397
+ return new LockInfo({
4398
+ ...mapLockInfoConstructorArgs(mappingRegistry, backendModel),
4399
+ backendModel,
4400
+ });
4211
4401
  },
4212
4402
  };
4213
4403
 
@@ -4226,15 +4416,18 @@ const mapRepositoryLocalObjectConstructorArgs = (mappingRegistry, backendModel)
4226
4416
  ? mappingRegistry.map(backendModel.LocationInfo)
4227
4417
  : undefined;
4228
4418
  const lockInfo = backendModel.LockInfo ? mappingRegistry.map(backendModel.LockInfo) : undefined;
4229
- const isLocked = !!(lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.lockType.length) && !(lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.lockType.includes('none'));
4419
+ const isLocked = !!lockInfo?.lockType.length && !lockInfo?.lockType.includes('none');
4230
4420
  const metadata = backendModel.Metadata ? contentMapping(mappingRegistry, backendModel.Metadata) : undefined;
4231
- return Object.assign(Object.assign({}, identifiableObjectConstructorArgs), { blueprintInfo,
4421
+ return {
4422
+ ...identifiableObjectConstructorArgs,
4423
+ blueprintInfo,
4232
4424
  isLocked,
4233
4425
  limitedVersionInfo,
4234
4426
  locationInfo,
4235
4427
  lockInfo,
4236
4428
  metadataSchema,
4237
- metadata });
4429
+ metadata,
4430
+ };
4238
4431
  };
4239
4432
 
4240
4433
  const mapRloItemTypeToBackend = (rloItemType) => {
@@ -4284,35 +4477,43 @@ const mapVersionedItemConstructorArgs = (mappingRegistry, backendModel) => {
4284
4477
  : undefined;
4285
4478
  let isDynamic = false;
4286
4479
  // If id of an item passed is dynamic, sets versionless uri to _id prop instead.
4287
- if (repositoryLocalObjectConstructorArgs.id.isDynamic &&
4288
- (repositoryLocalObjectConstructorArgs.id instanceof TcmUri ||
4289
- repositoryLocalObjectConstructorArgs.id instanceof EclUri)) {
4480
+ if ((repositoryLocalObjectConstructorArgs.id instanceof TcmUri ||
4481
+ repositoryLocalObjectConstructorArgs.id instanceof EclUri) &&
4482
+ repositoryLocalObjectConstructorArgs.id.isDynamic) {
4290
4483
  repositoryLocalObjectConstructorArgs.id = repositoryLocalObjectConstructorArgs.id.getVersionlessUri();
4291
4484
  isDynamic = true;
4292
4485
  }
4293
- return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { dynamicVersionInfo,
4486
+ return {
4487
+ ...repositoryLocalObjectConstructorArgs,
4488
+ dynamicVersionInfo,
4294
4489
  fullVersionInfo,
4295
- isDynamic });
4490
+ isDynamic,
4491
+ };
4296
4492
  };
4297
4493
 
4298
4494
  const mapFullVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
4299
- var _a;
4300
4495
  const limitedVersionInfoConstructorArgs = mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel);
4301
4496
  const checkoutUser = backendModel.CheckOutUser ? mappingRegistry.map(backendModel.CheckOutUser) : undefined;
4302
- const lockType = (_a = backendModel.LockType) === null || _a === void 0 ? void 0 : _a.map(l => mapLockType(l));
4497
+ const lockType = backendModel.LockType?.map(l => mapLockType(l));
4303
4498
  const revisor = backendModel.Revisor ? mappingRegistry.map(backendModel.Revisor) : undefined;
4304
4499
  const checkOutDate = backendModel.CheckOutDate ? mapDate(backendModel.CheckOutDate) : undefined;
4305
4500
  const revisionDate = backendModel.RevisionDate ? mapDate(backendModel.RevisionDate) : undefined;
4306
- return Object.assign(Object.assign({}, limitedVersionInfoConstructorArgs), { checkOutDate,
4501
+ return {
4502
+ ...limitedVersionInfoConstructorArgs,
4503
+ checkOutDate,
4307
4504
  checkoutUser,
4308
4505
  lockType,
4309
4506
  revisor,
4310
- revisionDate });
4507
+ revisionDate,
4508
+ };
4311
4509
  };
4312
4510
  const fullVersionInfoMapping = {
4313
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FullVersionInfo',
4511
+ identifier: backendModel => backendModel?.$type === 'FullVersionInfo',
4314
4512
  mapper: (mappingRegistry, backendModel) => {
4315
- return new FullVersionInfo(Object.assign(Object.assign({}, mapFullVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4513
+ return new FullVersionInfo({
4514
+ ...mapFullVersionInfoConstructorArgs(mappingRegistry, backendModel),
4515
+ backendModel,
4516
+ });
4316
4517
  },
4317
4518
  };
4318
4519
 
@@ -4339,20 +4540,26 @@ const mapComponentBaseConstructorArgs = (mappingRegistry, backendModel) => {
4339
4540
  const workflowInfo = backendModel.WorkflowInfo
4340
4541
  ? mappingRegistry.map(backendModel.WorkflowInfo)
4341
4542
  : undefined;
4342
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { approvalStatus,
4543
+ return {
4544
+ ...versionedItemConstructorArgs,
4545
+ approvalStatus,
4343
4546
  componentType,
4344
4547
  schema,
4345
- workflowInfo });
4548
+ workflowInfo,
4549
+ };
4346
4550
  };
4347
4551
 
4348
4552
  const mapComponentConstructorArgs = mapComponentBaseConstructorArgs;
4349
4553
  // Maps multimedia component as a fallback
4350
4554
  const componentMapping = {
4351
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Component',
4555
+ identifier: backendModel => backendModel?.$type === 'Component',
4352
4556
  mapper: (mappingRegistry, backendModel) => {
4353
4557
  const content = backendModel.Content ? contentMapping(mappingRegistry, backendModel.Content) : undefined;
4354
- return new Component(Object.assign(Object.assign({}, mapComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel,
4355
- content }));
4558
+ return new Component({
4559
+ ...mapComponentConstructorArgs(mappingRegistry, backendModel),
4560
+ backendModel,
4561
+ content,
4562
+ });
4356
4563
  },
4357
4564
  };
4358
4565
 
@@ -4632,8 +4839,7 @@ class ListDefinition {
4632
4839
  * Provides information about whether/how to present a list of allowed date field values.
4633
4840
  */
4634
4841
  class DateListDefinition extends ListDefinition {
4635
- constructor(_a) {
4636
- var { entries: entires } = _a, listProps = __rest(_a, ["entries"]);
4842
+ constructor({ entries: entires, ...listProps }) {
4637
4843
  super(listProps);
4638
4844
  Object.defineProperty(this, "_entries", {
4639
4845
  enumerable: true,
@@ -5135,9 +5341,8 @@ class XhtmlFieldDefinition extends TextFieldDefinition {
5135
5341
  * Schema defines structure of content and/or metadata.
5136
5342
  */
5137
5343
  class Schema extends VersionedItem {
5138
- constructor(_a) {
5139
- var { backendModel, allowedMultimediaTypes, bundleProcess, componentProcess, fields, metadataFields, purpose } = _a, versionedItemProps = __rest(_a, ["backendModel", "allowedMultimediaTypes", "bundleProcess", "componentProcess", "fields", "metadataFields", "purpose"]);
5140
- super(Object.assign({ backendModel }, versionedItemProps));
5344
+ constructor({ backendModel, allowedMultimediaTypes, bundleProcess, componentProcess, fields, metadataFields, purpose, ...versionedItemProps }) {
5345
+ super({ backendModel, ...versionedItemProps });
5141
5346
  Object.defineProperty(this, "_allowedMultimediaTypes", {
5142
5347
  enumerable: true,
5143
5348
  configurable: true,
@@ -5255,28 +5460,28 @@ class Schema extends VersionedItem {
5255
5460
  }
5256
5461
 
5257
5462
  const externalLinkFieldDefinitionMapping = {
5258
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalLinkFieldDefinition',
5463
+ identifier: backendModel => backendModel?.$type === 'ExternalLinkFieldDefinition',
5259
5464
  mapper: (mappingRegistry, backendModel) => {
5260
5465
  return new ExternalLinkFieldDefinition(backendModel);
5261
5466
  },
5262
5467
  };
5263
5468
 
5264
5469
  const formattingFeaturesMapping = {
5265
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FormattingFeatures',
5470
+ identifier: backendModel => backendModel?.$type === 'FormattingFeatures',
5266
5471
  mapper: (mappingRegistry, backendModel) => {
5267
5472
  return new FormattingFeatures(backendModel);
5268
5473
  },
5269
5474
  };
5270
5475
 
5271
5476
  const multilineTextFieldDefinitionMapping = {
5272
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultiLineTextFieldDefinition',
5477
+ identifier: backendModel => backendModel?.$type === 'MultiLineTextFieldDefinition',
5273
5478
  mapper: (mappingRegistry, backendModel) => {
5274
5479
  return new MultiLineTextFieldDefinition(backendModel);
5275
5480
  },
5276
5481
  };
5277
5482
 
5278
5483
  const singleLineTextFieldDefinitionMapping = {
5279
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SingleLineTextFieldDefinition',
5484
+ identifier: backendModel => backendModel?.$type === 'SingleLineTextFieldDefinition',
5280
5485
  mapper: (mappingRegistry, backendModel) => {
5281
5486
  const list = backendModel.List
5282
5487
  ? mappingRegistry.map(backendModel.List)
@@ -5286,7 +5491,7 @@ const singleLineTextFieldDefinitionMapping = {
5286
5491
  };
5287
5492
 
5288
5493
  const singleLineTextListDefinitionMapping = {
5289
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SingleLineTextListDefinition',
5494
+ identifier: backendModel => backendModel?.$type === 'SingleLineTextListDefinition',
5290
5495
  mapper: (mappingRegistry, backendModel) => {
5291
5496
  const type = backendModel.Type ? mappingRegistry.map(backendModel.Type) : undefined;
5292
5497
  return new SingleLineTextListDefinition({ backendModel, type });
@@ -5294,7 +5499,7 @@ const singleLineTextListDefinitionMapping = {
5294
5499
  };
5295
5500
 
5296
5501
  const xhtmlFieldDefinitionMapping = {
5297
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'XhtmlFieldDefinition',
5502
+ identifier: backendModel => backendModel?.$type === 'XhtmlFieldDefinition',
5298
5503
  mapper: (mappingRegistry, backendModel) => {
5299
5504
  const formattingFeatures = backendModel.FormattingFeatures
5300
5505
  ? mappingRegistry.map(backendModel.FormattingFeatures)
@@ -5309,7 +5514,7 @@ const mapComponentLinkFieldDefinitionConstructorArgs = (mappingRegistry, backend
5309
5514
  return { allowedTargetSchemas, defaultValue };
5310
5515
  };
5311
5516
  const componentLinkFieldDefinitionMapping = {
5312
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentLinkFieldDefinition',
5517
+ identifier: backendModel => backendModel?.$type === 'ComponentLinkFieldDefinition',
5313
5518
  mapper: (mappingRegistry, backendModel) => {
5314
5519
  const { allowedTargetSchemas, defaultValue } = mapComponentLinkFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
5315
5520
  return new ComponentLinkFieldDefinition({ backendModel, allowedTargetSchemas, defaultValue });
@@ -5323,7 +5528,7 @@ const mapDateFieldDefinitionConstructorArgs = (mappingRegistry, backendModel) =>
5323
5528
  return { list, maxValue, minValue };
5324
5529
  };
5325
5530
  const dateFieldDefinitionMapping = {
5326
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DateFieldDefinition',
5531
+ identifier: backendModel => backendModel?.$type === 'DateFieldDefinition',
5327
5532
  mapper: (mappingRegistry, backendModel) => {
5328
5533
  const { list, maxValue, minValue } = mapDateFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
5329
5534
  return new DateFieldDefinition({ backendModel, list, maxValue, minValue });
@@ -5331,13 +5536,12 @@ const dateFieldDefinitionMapping = {
5331
5536
  };
5332
5537
 
5333
5538
  const mapDateListDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
5334
- var _a;
5335
5539
  const type = backendModel.Type ? mappingRegistry.map(backendModel.Type) : undefined;
5336
- const entries = (_a = backendModel.Entries) === null || _a === void 0 ? void 0 : _a.map(mapDate).filter(isDefined);
5540
+ const entries = backendModel.Entries?.map(mapDate).filter(isDefined);
5337
5541
  return { type, entries };
5338
5542
  };
5339
5543
  const dateListDefinitionMapping = {
5340
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DateListDefinition',
5544
+ identifier: backendModel => backendModel?.$type === 'DateListDefinition',
5341
5545
  mapper: (mappingRegistry, backendModel) => {
5342
5546
  const { type, entries } = mapDateListDefinitionConstructorArgs(mappingRegistry, backendModel);
5343
5547
  return new DateListDefinition({ backendModel, type, entries });
@@ -7209,7 +7413,7 @@ const mapObject = (object, mappingFunction) => {
7209
7413
  };
7210
7414
 
7211
7415
  const mapFieldsDefinitionDictionary = (mappingRegistry, backendModel) => {
7212
- const modelToMap = __rest(backendModel, ["$type"]);
7416
+ const { $type, ...modelToMap } = backendModel;
7213
7417
  if (Object.keys(modelToMap).length === 0) {
7214
7418
  return undefined;
7215
7419
  }
@@ -7228,7 +7432,7 @@ const mapEmbeddedSchemaFieldDefinitionConstructorArgs = (mappingRegistry, backen
7228
7432
  return { embeddedFields, embeddedSchema };
7229
7433
  };
7230
7434
  const embeddedSchemaFieldDefinitionMapping = {
7231
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'EmbeddedSchemaFieldDefinition',
7435
+ identifier: backendModel => backendModel?.$type === 'EmbeddedSchemaFieldDefinition',
7232
7436
  mapper: (mappingRegistry, backendModel) => {
7233
7437
  const { embeddedFields, embeddedSchema } = mapEmbeddedSchemaFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7234
7438
  return new EmbeddedSchemaFieldDefinition({ backendModel, embeddedFields, embeddedSchema });
@@ -7242,7 +7446,7 @@ const mapKeywordFieldDefinitionConstructorArgs = (mappingRegistry, backendModel)
7242
7446
  return { category, defaultValue, list };
7243
7447
  };
7244
7448
  const keywordFieldDefinitionMapping = {
7245
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'KeywordFieldDefinition',
7449
+ identifier: backendModel => backendModel?.$type === 'KeywordFieldDefinition',
7246
7450
  mapper: (mappingRegistry, backendModel) => {
7247
7451
  const { category, defaultValue, list } = mapKeywordFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7248
7452
  return new KeywordFieldDefinition({ backendModel, category, defaultValue, list });
@@ -7254,7 +7458,7 @@ const mapListDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
7254
7458
  return { type };
7255
7459
  };
7256
7460
  const listDefinitionMapping = {
7257
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ListDefinition',
7461
+ identifier: backendModel => backendModel?.$type === 'ListDefinition',
7258
7462
  mapper: (mappingRegistry, backendModel) => {
7259
7463
  const { type } = mapListDefinitionConstructorArgs(mappingRegistry, backendModel);
7260
7464
  return new ListDefinition({ backendModel, type });
@@ -7267,7 +7471,7 @@ const mapMultimediaLinkFieldDefinitionConstructorArgs = (mappingRegistry, backen
7267
7471
  return { allowedTargetSchemas, defaultValue };
7268
7472
  };
7269
7473
  const multimediaLinkFieldDefinitionMapping = {
7270
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultimediaLinkFieldDefinition',
7474
+ identifier: backendModel => backendModel?.$type === 'MultimediaLinkFieldDefinition',
7271
7475
  mapper: (mappingRegistry, backendModel) => {
7272
7476
  const { allowedTargetSchemas, defaultValue } = mapMultimediaLinkFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7273
7477
  return new MultimediaLinkFieldDefinition({ backendModel, allowedTargetSchemas, defaultValue });
@@ -7279,7 +7483,7 @@ const mapNumberFieldDefinitionConstructorArgs = (mappingRegistry, backendModel)
7279
7483
  return { list };
7280
7484
  };
7281
7485
  const numberFieldDefinitionMapping = {
7282
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'NumberFieldDefinition',
7486
+ identifier: backendModel => backendModel?.$type === 'NumberFieldDefinition',
7283
7487
  mapper: (mappingRegistry, backendModel) => {
7284
7488
  const { list } = mapNumberFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7285
7489
  return new NumberFieldDefinition({ backendModel, list });
@@ -7310,6 +7514,30 @@ const mapSchemaPurpose = (backendModel) => {
7310
7514
  return 'unknownByClient';
7311
7515
  }
7312
7516
  };
7517
+ const mapSchemaPurposeBackend = (backendModel) => {
7518
+ switch (backendModel) {
7519
+ case 'bundle':
7520
+ return SchemaPurpose.BUNDLE;
7521
+ case 'component':
7522
+ return SchemaPurpose.COMPONENT;
7523
+ case 'embedded':
7524
+ return SchemaPurpose.EMBEDDED;
7525
+ case 'metadata':
7526
+ return SchemaPurpose.METADATA;
7527
+ case 'multimedia':
7528
+ return SchemaPurpose.MULTIMEDIA;
7529
+ case 'protocol':
7530
+ return SchemaPurpose.PROTOCOL;
7531
+ case 'region':
7532
+ return SchemaPurpose.REGION;
7533
+ case 'templateParameters':
7534
+ return SchemaPurpose.TEMPLATE_PARAMETERS;
7535
+ case 'virtualFolderType':
7536
+ return SchemaPurpose.VIRTUAL_FOLDER_TYPE;
7537
+ case 'unknownByClient':
7538
+ return SchemaPurpose.UNKNOWN_BY_CLIENT;
7539
+ }
7540
+ };
7313
7541
 
7314
7542
  const mapSchemaConstructorArgs = (mappingRegistry, backendModel) => {
7315
7543
  const versionedItemConstructorArgs = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
@@ -7327,17 +7555,23 @@ const mapSchemaConstructorArgs = (mappingRegistry, backendModel) => {
7327
7555
  ? mapFieldsDefinitionDictionary(mappingRegistry, backendModel.MetadataFields)
7328
7556
  : undefined;
7329
7557
  const purpose = backendModel.Purpose ? mapSchemaPurpose(backendModel.Purpose) : undefined;
7330
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { allowedMultimediaTypes,
7558
+ return {
7559
+ ...versionedItemConstructorArgs,
7560
+ allowedMultimediaTypes,
7331
7561
  bundleProcess,
7332
7562
  componentProcess,
7333
7563
  fields,
7334
7564
  metadataFields,
7335
- purpose });
7565
+ purpose,
7566
+ };
7336
7567
  };
7337
7568
  const schemaMapping = {
7338
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Schema',
7569
+ identifier: backendModel => backendModel?.$type === 'Schema',
7339
7570
  mapper: (mappingRegistry, backendModel) => {
7340
- return new Schema(Object.assign(Object.assign({}, mapSchemaConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7571
+ return new Schema({
7572
+ ...mapSchemaConstructorArgs(mappingRegistry, backendModel),
7573
+ backendModel,
7574
+ });
7341
7575
  },
7342
7576
  };
7343
7577
 
@@ -7346,12 +7580,18 @@ const mapMultimediaComponentConstructorArgs = (mappingRegistry, backendModel) =>
7346
7580
  const binaryContent = backendModel.BinaryContent
7347
7581
  ? mappingRegistry.map(backendModel.BinaryContent)
7348
7582
  : undefined;
7349
- return Object.assign(Object.assign({}, componentBaseConstructorArgs), { binaryContent });
7583
+ return {
7584
+ ...componentBaseConstructorArgs,
7585
+ binaryContent,
7586
+ };
7350
7587
  };
7351
7588
  const multimediaComponentMapping = {
7352
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Component' && (backendModel === null || backendModel === void 0 ? void 0 : backendModel.ComponentType) === ComponentType.MULTIMEDIA,
7589
+ identifier: backendModel => backendModel?.$type === 'Component' && backendModel?.ComponentType === ComponentType.MULTIMEDIA,
7353
7590
  mapper: (mappingRegistry, backendModel) => {
7354
- return new MultimediaComponent(Object.assign(Object.assign({}, mapMultimediaComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7591
+ return new MultimediaComponent({
7592
+ ...mapMultimediaComponentConstructorArgs(mappingRegistry, backendModel),
7593
+ backendModel,
7594
+ });
7355
7595
  },
7356
7596
  };
7357
7597
 
@@ -7360,20 +7600,29 @@ const mapExternalMultimediaComponentConstructorArgs = (mappingRegistry, backendM
7360
7600
  const externalMetadataSchemaFields = backendModel.ExternalMetadataSchemaFields
7361
7601
  ? mapFieldsDefinitionDictionary(mappingRegistry, backendModel.ExternalMetadataSchemaFields)
7362
7602
  : undefined;
7363
- return Object.assign(Object.assign({}, multimediaComponentConstructorArgs), { externalMetadataSchemaFields });
7603
+ return {
7604
+ ...multimediaComponentConstructorArgs,
7605
+ externalMetadataSchemaFields,
7606
+ };
7364
7607
  };
7365
7608
  const externalMultimediaComponentMapping = {
7366
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalComponent',
7609
+ identifier: backendModel => backendModel?.$type === 'ExternalComponent',
7367
7610
  mapper: (mappingRegistry, backendModel) => {
7368
- return new ExternalMultimediaComponent(Object.assign(Object.assign({}, mapExternalMultimediaComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7611
+ return new ExternalMultimediaComponent({
7612
+ ...mapExternalMultimediaComponentConstructorArgs(mappingRegistry, backendModel),
7613
+ backendModel,
7614
+ });
7369
7615
  },
7370
7616
  };
7371
7617
 
7372
7618
  const mapExternalVersionInfoConstructorArgs = mapFullVersionInfoConstructorArgs;
7373
7619
  const externalVersionInfoMapping = {
7374
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalVersionInfo',
7620
+ identifier: backendModel => backendModel?.$type === 'ExternalVersionInfo',
7375
7621
  mapper: (mappingRegistry, backendModel) => {
7376
- return new ExternalVersionInfo(Object.assign(Object.assign({}, mapExternalVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7622
+ return new ExternalVersionInfo({
7623
+ ...mapExternalVersionInfoConstructorArgs(mappingRegistry, backendModel),
7624
+ backendModel,
7625
+ });
7377
7626
  },
7378
7627
  };
7379
7628
 
@@ -7445,13 +7694,12 @@ class DependencyGraphNode {
7445
7694
  }
7446
7695
 
7447
7696
  const mapDependencyGraphNodeConstructorArgs = (mappingRegistry, backendModel) => {
7448
- var _a;
7449
- const dependencies = (_a = backendModel.Dependencies) === null || _a === void 0 ? void 0 : _a.map(c => mappingRegistry.map(c)).filter(isDefined);
7697
+ const dependencies = backendModel.Dependencies?.map(c => mappingRegistry.map(c)).filter(isDefined);
7450
7698
  const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
7451
7699
  return { dependencies, item };
7452
7700
  };
7453
7701
  const dependencyGraphNodeMapping = {
7454
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DependencyGraphNode',
7702
+ identifier: backendModel => backendModel?.$type === 'DependencyGraphNode',
7455
7703
  mapper: (mappingRegistry, backendModel) => {
7456
7704
  const { dependencies, item } = mapDependencyGraphNodeConstructorArgs(mappingRegistry, backendModel);
7457
7705
  return new DependencyGraphNode({ backendModel, dependencies, item });
@@ -7462,9 +7710,8 @@ const dependencyGraphNodeMapping = {
7462
7710
  * Represents the data of a Keyword used to classify items.
7463
7711
  */
7464
7712
  class Keyword extends RepositoryLocalObject {
7465
- constructor(_a) {
7466
- var { backendModel, parentKeywords, relatedKeywords } = _a, rloArgs = __rest(_a, ["backendModel", "parentKeywords", "relatedKeywords"]);
7467
- super(Object.assign({ backendModel }, rloArgs));
7713
+ constructor({ backendModel, parentKeywords, relatedKeywords, ...rloArgs }) {
7714
+ super({ backendModel, ...rloArgs });
7468
7715
  Object.defineProperty(this, "_parentKeywords", {
7469
7716
  enumerable: true,
7470
7717
  configurable: true,
@@ -7541,9 +7788,8 @@ class Keyword extends RepositoryLocalObject {
7541
7788
  * Represents an External Keyword (mapped to an external Taxonomy Management System).
7542
7789
  */
7543
7790
  class ExternalKeyword extends Keyword {
7544
- constructor(_a) {
7545
- var { backendModel, externalMetadataSchemaFields } = _a, keywordArgs = __rest(_a, ["backendModel", "externalMetadataSchemaFields"]);
7546
- super(Object.assign({ backendModel }, keywordArgs));
7791
+ constructor({ backendModel, externalMetadataSchemaFields, ...keywordArgs }) {
7792
+ super({ backendModel, ...keywordArgs });
7547
7793
  Object.defineProperty(this, "_externalMetadataSchemaFields", {
7548
7794
  enumerable: true,
7549
7795
  configurable: true,
@@ -7606,11 +7852,14 @@ const mapKeywordConstructorArgs = (mappingRegistry, backendModel) => {
7606
7852
  const versionedItemConstructorArgs = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
7607
7853
  const parentKeywords = mapLinks(mappingRegistry, backendModel.ParentKeywords);
7608
7854
  const relatedKeywords = mapLinks(mappingRegistry, backendModel.RelatedKeywords);
7609
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { parentKeywords,
7610
- relatedKeywords });
7855
+ return {
7856
+ ...versionedItemConstructorArgs,
7857
+ parentKeywords,
7858
+ relatedKeywords,
7859
+ };
7611
7860
  };
7612
7861
  const keywordMapping = {
7613
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Keyword',
7862
+ identifier: backendModel => backendModel?.$type === 'Keyword',
7614
7863
  mapper: (mappingRegistry, backendModel) => {
7615
7864
  const { applicableActions, basicVersionInfo, blueprintInfo, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, parentKeywords, relatedKeywords, securityDescriptor, listInfo, } = mapKeywordConstructorArgs(mappingRegistry, backendModel);
7616
7865
  return new Keyword({
@@ -7640,10 +7889,13 @@ const mapExternalKeywordConstructorArgs = (mappingRegistry, backendModel) => {
7640
7889
  const externalMetadataSchemaFields = backendModel.ExternalMetadataSchemaFields
7641
7890
  ? mapFieldsDefinitionDictionary(mappingRegistry, backendModel.ExternalMetadataSchemaFields)
7642
7891
  : undefined;
7643
- return Object.assign(Object.assign({}, keywordConstructorArgs), { externalMetadataSchemaFields });
7892
+ return {
7893
+ ...keywordConstructorArgs,
7894
+ externalMetadataSchemaFields,
7895
+ };
7644
7896
  };
7645
7897
  const externalKeywordMapping = {
7646
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalKeyword',
7898
+ identifier: backendModel => backendModel?.$type === 'ExternalKeyword',
7647
7899
  mapper: (mappingRegistry, backendModel) => {
7648
7900
  const { applicableActions, basicVersionInfo, blueprintInfo, externalMetadataSchemaFields, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, parentKeywords, relatedKeywords, securityDescriptor, listInfo, } = mapExternalKeywordConstructorArgs(mappingRegistry, backendModel);
7649
7901
  return new ExternalKeyword({
@@ -7673,9 +7925,8 @@ const externalKeywordMapping = {
7673
7925
  * Abstract base class for the data of "organizational items": items used to organize the items in a Repository.
7674
7926
  */
7675
7927
  class OrganizationalItem extends RepositoryLocalObject {
7676
- constructor(_a) {
7677
- var { backendModel, accessControlList, contentSecurityDescriptor } = _a, rloArgs = __rest(_a, ["backendModel", "accessControlList", "contentSecurityDescriptor"]);
7678
- super(Object.assign({ backendModel }, rloArgs));
7928
+ constructor({ backendModel, accessControlList, contentSecurityDescriptor, ...rloArgs }) {
7929
+ super({ backendModel, ...rloArgs });
7679
7930
  Object.defineProperty(this, "_accessControlList", {
7680
7931
  enumerable: true,
7681
7932
  configurable: true,
@@ -7731,9 +7982,8 @@ class OrganizationalItem extends RepositoryLocalObject {
7731
7982
  * Organizational Item that dynamically collects its contents.
7732
7983
  */
7733
7984
  class VirtualFolder extends OrganizationalItem {
7734
- constructor(_a) {
7735
- var { backendModel, approvalStatus, typeSchema, workflowInfo } = _a, orgItemArgs = __rest(_a, ["backendModel", "approvalStatus", "typeSchema", "workflowInfo"]);
7736
- super(Object.assign({ backendModel }, orgItemArgs));
7985
+ constructor({ backendModel, approvalStatus, typeSchema, workflowInfo, ...orgItemArgs }) {
7986
+ super({ backendModel, ...orgItemArgs });
7737
7987
  Object.defineProperty(this, "_approvalStatus", {
7738
7988
  enumerable: true,
7739
7989
  configurable: true,
@@ -7797,9 +8047,8 @@ class VirtualFolder extends OrganizationalItem {
7797
8047
  * Represents a Bundle which is used to group Repository Local Objects for Release Management purposes.
7798
8048
  */
7799
8049
  class Bundle extends VirtualFolder {
7800
- constructor(_a) {
7801
- var { backendModel, items } = _a, bundleArgs = __rest(_a, ["backendModel", "items"]);
7802
- super(Object.assign({ backendModel }, bundleArgs));
8050
+ constructor({ backendModel, items, ...bundleArgs }) {
8051
+ super({ backendModel, ...bundleArgs });
7803
8052
  Object.defineProperty(this, "_items", {
7804
8053
  enumerable: true,
7805
8054
  configurable: true,
@@ -7837,9 +8086,8 @@ class Bundle extends VirtualFolder {
7837
8086
  * then, the Business Process Type should be loaded with LoadFlags.Expanded.
7838
8087
  */
7839
8088
  class BusinessProcessType extends OrganizationalItem {
7840
- constructor(_a) {
7841
- var { backendModel, bundleSchemas, targetTypes } = _a, orgItemArgs = __rest(_a, ["backendModel", "bundleSchemas", "targetTypes"]);
7842
- super(Object.assign({ backendModel }, orgItemArgs));
8089
+ constructor({ backendModel, bundleSchemas, targetTypes, ...orgItemArgs }) {
8090
+ super({ backendModel, ...orgItemArgs });
7843
8091
  Object.defineProperty(this, "_bundleSchemas", {
7844
8092
  enumerable: true,
7845
8093
  configurable: true,
@@ -7915,9 +8163,11 @@ class BusinessProcessType extends OrganizationalItem {
7915
8163
  * An item used to organize the business process types in a Repository.
7916
8164
  */
7917
8165
  class BusinessProcessTypes extends OrganizationalItem {
7918
- constructor(_a) {
7919
- var { backendModel } = _a, organizationalItemArgs = __rest(_a, ["backendModel"]);
7920
- super(Object.assign({ backendModel }, organizationalItemArgs));
8166
+ constructor({ backendModel, ...organizationalItemArgs }) {
8167
+ super({
8168
+ backendModel,
8169
+ ...organizationalItemArgs,
8170
+ });
7921
8171
  }
7922
8172
  }
7923
8173
 
@@ -7962,9 +8212,8 @@ const createBackendTaxonomies = (publicationId) => {
7962
8212
  * An item used to organize the items in a Repository.
7963
8213
  */
7964
8214
  class Folder extends OrganizationalItem {
7965
- constructor(_a) {
7966
- var { backendModel, linkedSchema } = _a, orgItemArgs = __rest(_a, ["backendModel", "linkedSchema"]);
7967
- super(Object.assign({ backendModel }, orgItemArgs));
8215
+ constructor({ backendModel, linkedSchema, ...orgItemArgs }) {
8216
+ super({ backendModel, ...orgItemArgs });
7968
8217
  Object.defineProperty(this, "_linkedSchema", {
7969
8218
  enumerable: true,
7970
8219
  configurable: true,
@@ -8042,9 +8291,8 @@ class ExternalContainer extends Folder {
8042
8291
  * Represents the data of a Category of Keywords.
8043
8292
  */
8044
8293
  class KeywordCategory extends OrganizationalItem {
8045
- constructor(_a) {
8046
- var { backendModel, allowedParentCategories, keywordMetadataSchema } = _a, orgItemArgs = __rest(_a, ["backendModel", "allowedParentCategories", "keywordMetadataSchema"]);
8047
- super(Object.assign({ backendModel }, orgItemArgs));
8294
+ constructor({ backendModel, allowedParentCategories, keywordMetadataSchema, ...orgItemArgs }) {
8295
+ super({ backendModel, ...orgItemArgs });
8048
8296
  Object.defineProperty(this, "_allowedParentCategories", {
8049
8297
  enumerable: true,
8050
8298
  configurable: true,
@@ -8133,9 +8381,8 @@ class KeywordCategory extends OrganizationalItem {
8133
8381
  * Represents an External Category (mapped to an external Taxonomy Management System).
8134
8382
  */
8135
8383
  class ExternalKeywordCategory extends KeywordCategory {
8136
- constructor(_a) {
8137
- var { backendModel } = _a, keywordCategoryArgs = __rest(_a, ["backendModel"]);
8138
- super(Object.assign({ backendModel }, keywordCategoryArgs));
8384
+ constructor({ backendModel, ...keywordCategoryArgs }) {
8385
+ super({ backendModel, ...keywordCategoryArgs });
8139
8386
  Object.defineProperty(this, "getInternalModel", {
8140
8387
  enumerable: true,
8141
8388
  configurable: true,
@@ -8163,9 +8410,8 @@ class ExternalKeywordCategory extends KeywordCategory {
8163
8410
  * Represents a publishing location information for the objects that reside in Structure Groups.
8164
8411
  */
8165
8412
  class PublishLocationInfo extends LocationInfo {
8166
- constructor(_a) {
8167
- var { backendModel } = _a, locationInfoArgs = __rest(_a, ["backendModel"]);
8168
- super(Object.assign({ backendModel }, locationInfoArgs));
8413
+ constructor({ backendModel, ...locationInfoArgs }) {
8414
+ super({ backendModel, ...locationInfoArgs });
8169
8415
  Object.defineProperty(this, "getInternalModel", {
8170
8416
  enumerable: true,
8171
8417
  configurable: true,
@@ -8226,9 +8472,8 @@ class SearchFolder extends VirtualFolder {
8226
8472
  * Organizational Item used to build the Publication's target structure.
8227
8473
  */
8228
8474
  class StructureGroup extends OrganizationalItem {
8229
- constructor(_a) {
8230
- var { backendModel, defaultPageTemplate, publishLocationInfo, pageBundleProcess, pageProcess } = _a, orgItemArgs = __rest(_a, ["backendModel", "defaultPageTemplate", "publishLocationInfo", "pageBundleProcess", "pageProcess"]);
8231
- super(Object.assign({ backendModel }, orgItemArgs));
8475
+ constructor({ backendModel, defaultPageTemplate, publishLocationInfo, pageBundleProcess, pageProcess, ...orgItemArgs }) {
8476
+ super({ backendModel, ...orgItemArgs });
8232
8477
  Object.defineProperty(this, "_defaultPageTemplate", {
8233
8478
  enumerable: true,
8234
8479
  configurable: true,
@@ -8349,9 +8594,11 @@ class StructureGroup extends OrganizationalItem {
8349
8594
  * An item used to organize the categories and keywords in a Repository.
8350
8595
  */
8351
8596
  class Taxonomies extends OrganizationalItem {
8352
- constructor(_a) {
8353
- var { backendModel } = _a, organizationalItemArgs = __rest(_a, ["backendModel"]);
8354
- super(Object.assign({ backendModel }, organizationalItemArgs));
8597
+ constructor({ backendModel, ...organizationalItemArgs }) {
8598
+ super({
8599
+ backendModel,
8600
+ ...organizationalItemArgs,
8601
+ });
8355
8602
  }
8356
8603
  }
8357
8604
 
@@ -8363,8 +8610,11 @@ const mapOrganizationalItemConstructorArgs = (mappingRegistry, backendModel) =>
8363
8610
  const contentSecurityDescriptor = backendModel.ContentSecurityDescriptor
8364
8611
  ? mappingRegistry.map(backendModel.ContentSecurityDescriptor)
8365
8612
  : undefined;
8366
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { accessControlList,
8367
- contentSecurityDescriptor });
8613
+ return {
8614
+ ...versionedItemConstructorArgs,
8615
+ accessControlList,
8616
+ contentSecurityDescriptor,
8617
+ };
8368
8618
  };
8369
8619
 
8370
8620
  const mapVirtualFolderConstructorArgs = (mappingRegistry, backendModel) => {
@@ -8376,27 +8626,35 @@ const mapVirtualFolderConstructorArgs = (mappingRegistry, backendModel) => {
8376
8626
  const workflowInfo = backendModel.WorkflowInfo
8377
8627
  ? mappingRegistry.map(backendModel.WorkflowInfo)
8378
8628
  : undefined;
8379
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { approvalStatus,
8629
+ return {
8630
+ ...organizationalItemConstructorArgs,
8631
+ approvalStatus,
8380
8632
  typeSchema,
8381
- workflowInfo });
8633
+ workflowInfo,
8634
+ };
8382
8635
  };
8383
8636
 
8384
8637
  const mapBundleConstructorArgs = (mappingRegistry, backendModel) => {
8385
8638
  const virtualFolderConstructorArgs = mapVirtualFolderConstructorArgs(mappingRegistry, backendModel);
8386
8639
  const items = mapLinks(mappingRegistry, backendModel.Items);
8387
- return Object.assign(Object.assign({}, virtualFolderConstructorArgs), { items });
8640
+ return {
8641
+ ...virtualFolderConstructorArgs,
8642
+ items,
8643
+ };
8388
8644
  };
8389
8645
  const bundleMapping = {
8390
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Bundle',
8646
+ identifier: backendModel => backendModel?.$type === 'Bundle',
8391
8647
  mapper: (mappingRegistry, backendModel) => {
8392
- return new Bundle(Object.assign(Object.assign({}, mapBundleConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8648
+ return new Bundle({
8649
+ ...mapBundleConstructorArgs(mappingRegistry, backendModel),
8650
+ backendModel,
8651
+ });
8393
8652
  },
8394
8653
  };
8395
8654
 
8396
8655
  const changeOrgItemToBusinessProcessTypes = (item) => {
8397
8656
  return produce(item, draft => {
8398
- var _a, _b;
8399
- if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
8657
+ if (draft.LocationInfo?.ContextRepository?.IdRef) {
8400
8658
  const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
8401
8659
  if (!publicationId)
8402
8660
  return;
@@ -8406,33 +8664,40 @@ const changeOrgItemToBusinessProcessTypes = (item) => {
8406
8664
  };
8407
8665
 
8408
8666
  const mapBusinessProcessTypeConstructorArgs = (mappingRegistry, backendModel) => {
8409
- var _a;
8410
8667
  const backendModelWithProperOrgItem = changeOrgItemToBusinessProcessTypes(backendModel);
8411
8668
  const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModelWithProperOrgItem);
8412
8669
  const bundleSchemas = mapLinks(mappingRegistry, backendModelWithProperOrgItem.BundleSchemas);
8413
- const targetTypes = (_a = backendModelWithProperOrgItem.TargetTypes) === null || _a === void 0 ? void 0 : _a.map(t => mappingRegistry.map(t)).filter(isDefined);
8414
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { bundleSchemas,
8415
- targetTypes });
8670
+ const targetTypes = backendModelWithProperOrgItem.TargetTypes?.map(t => mappingRegistry.map(t)).filter(isDefined);
8671
+ return {
8672
+ ...organizationalItemConstructorArgs,
8673
+ bundleSchemas,
8674
+ targetTypes,
8675
+ };
8416
8676
  };
8417
8677
  const businessProcessTypeMapping = {
8418
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BusinessProcessType',
8678
+ identifier: backendModel => backendModel?.$type === 'BusinessProcessType',
8419
8679
  mapper: (mappingRegistry, backendModel) => {
8420
- return new BusinessProcessType(Object.assign(Object.assign({}, mapBusinessProcessTypeConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToBusinessProcessTypes(backendModel) }));
8680
+ return new BusinessProcessType({
8681
+ ...mapBusinessProcessTypeConstructorArgs(mappingRegistry, backendModel),
8682
+ backendModel: changeOrgItemToBusinessProcessTypes(backendModel),
8683
+ });
8421
8684
  },
8422
8685
  };
8423
8686
 
8424
8687
  const mapBusinessProcessTypesConstructorArgs = mapOrganizationalItemConstructorArgs;
8425
8688
  const businessProcessTypesMapping = {
8426
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BusinessProcessTypes',
8689
+ identifier: backendModel => backendModel?.$type === 'BusinessProcessTypes',
8427
8690
  mapper: (mappingRegistry, backendModel) => {
8428
- return new BusinessProcessTypes(Object.assign(Object.assign({}, mapBusinessProcessTypesConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8691
+ return new BusinessProcessTypes({
8692
+ ...mapBusinessProcessTypesConstructorArgs(mappingRegistry, backendModel),
8693
+ backendModel,
8694
+ });
8429
8695
  },
8430
8696
  };
8431
8697
 
8432
8698
  const changeOrgItemToTaxonomies = (item) => {
8433
8699
  return produce(item, draft => {
8434
- var _a, _b;
8435
- if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
8700
+ if (draft.LocationInfo?.ContextRepository?.IdRef) {
8436
8701
  const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
8437
8702
  if (!publicationId)
8438
8703
  return;
@@ -8444,20 +8709,29 @@ const changeOrgItemToTaxonomies = (item) => {
8444
8709
  const mapFolderConstructorArgs = (mappingRegistry, backendModel) => {
8445
8710
  const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8446
8711
  const linkedSchema = backendModel.LinkedSchema ? mappingRegistry.map(backendModel.LinkedSchema) : undefined;
8447
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { linkedSchema });
8712
+ return {
8713
+ ...organizationalItemConstructorArgs,
8714
+ linkedSchema,
8715
+ };
8448
8716
  };
8449
8717
  const folderMapping = {
8450
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Folder',
8718
+ identifier: backendModel => backendModel?.$type === 'Folder',
8451
8719
  mapper: (mappingRegistry, backendModel) => {
8452
- return new Folder(Object.assign(Object.assign({}, mapFolderConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8720
+ return new Folder({
8721
+ ...mapFolderConstructorArgs(mappingRegistry, backendModel),
8722
+ backendModel,
8723
+ });
8453
8724
  },
8454
8725
  };
8455
8726
 
8456
8727
  const mapExternalContainerConstructorArgs = mapFolderConstructorArgs;
8457
8728
  const externalContainerMapping = {
8458
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalContainer',
8729
+ identifier: backendModel => backendModel?.$type === 'ExternalContainer',
8459
8730
  mapper: (mappingRegistry, backendModel) => {
8460
- return new ExternalContainer(Object.assign(Object.assign({}, mapExternalContainerConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8731
+ return new ExternalContainer({
8732
+ ...mapExternalContainerConstructorArgs(mappingRegistry, backendModel),
8733
+ backendModel,
8734
+ });
8461
8735
  },
8462
8736
  };
8463
8737
 
@@ -8468,37 +8742,52 @@ const mapKeywordCategoryConstructorArgs = (mappingRegistry, backendModel) => {
8468
8742
  const keywordMetadataSchema = backendModelWithProperOrgItem.KeywordMetadataSchema
8469
8743
  ? mappingRegistry.map(backendModelWithProperOrgItem.KeywordMetadataSchema)
8470
8744
  : undefined;
8471
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { allowedParentCategories,
8472
- keywordMetadataSchema });
8745
+ return {
8746
+ ...organizationalItemConstructorArgs,
8747
+ allowedParentCategories,
8748
+ keywordMetadataSchema,
8749
+ };
8473
8750
  };
8474
8751
  const keywordCategoryMapping = {
8475
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Category',
8752
+ identifier: backendModel => backendModel?.$type === 'Category',
8476
8753
  mapper: (mappingRegistry, backendModel) => {
8477
- return new KeywordCategory(Object.assign(Object.assign({}, mapKeywordCategoryConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToTaxonomies(backendModel) }));
8754
+ return new KeywordCategory({
8755
+ ...mapKeywordCategoryConstructorArgs(mappingRegistry, backendModel),
8756
+ backendModel: changeOrgItemToTaxonomies(backendModel),
8757
+ });
8478
8758
  },
8479
8759
  };
8480
8760
 
8481
8761
  const mapExternalKeywordCategoryConstructorArgs = mapKeywordCategoryConstructorArgs;
8482
8762
  const externalKeywordCategoryMapping = {
8483
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalCategory',
8763
+ identifier: backendModel => backendModel?.$type === 'ExternalCategory',
8484
8764
  mapper: (mappingRegistry, backendModel) => {
8485
- return new ExternalKeywordCategory(Object.assign(Object.assign({}, mapExternalKeywordCategoryConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToTaxonomies(backendModel) }));
8765
+ return new ExternalKeywordCategory({
8766
+ ...mapExternalKeywordCategoryConstructorArgs(mappingRegistry, backendModel),
8767
+ backendModel: changeOrgItemToTaxonomies(backendModel),
8768
+ });
8486
8769
  },
8487
8770
  };
8488
8771
 
8489
8772
  const mapPublishLocationInfoConstructorArgs = mapLocationInfoConstructorArgs;
8490
8773
  const publishLocationInfoMapping = {
8491
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishLocationInfo',
8774
+ identifier: backendModel => backendModel?.$type === 'PublishLocationInfo',
8492
8775
  mapper: (mappingRegistry, backendModel) => {
8493
- return new PublishLocationInfo(Object.assign(Object.assign({}, mapPublishLocationInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8776
+ return new PublishLocationInfo({
8777
+ ...mapPublishLocationInfoConstructorArgs(mappingRegistry, backendModel),
8778
+ backendModel,
8779
+ });
8494
8780
  },
8495
8781
  };
8496
8782
 
8497
8783
  const mapSearchFolderConstructorArgs = mapVirtualFolderConstructorArgs;
8498
8784
  const searchFolderMapping = {
8499
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SearchFolder',
8785
+ identifier: backendModel => backendModel?.$type === 'SearchFolder',
8500
8786
  mapper: (mappingRegistry, backendModel) => {
8501
- return new SearchFolder(Object.assign(Object.assign({}, mapSearchFolderConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8787
+ return new SearchFolder({
8788
+ ...mapSearchFolderConstructorArgs(mappingRegistry, backendModel),
8789
+ backendModel,
8790
+ });
8502
8791
  },
8503
8792
  };
8504
8793
 
@@ -8514,23 +8803,29 @@ const mapStructureGroupConstructorArgs = (mappingRegistry, backendModel) => {
8514
8803
  ? mappingRegistry.map(backendModel.PageBundleProcess)
8515
8804
  : undefined;
8516
8805
  const pageProcess = backendModel.PageProcess ? mappingRegistry.map(backendModel.PageProcess) : undefined;
8517
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { defaultPageTemplate,
8806
+ return {
8807
+ ...organizationalItemConstructorArgs,
8808
+ defaultPageTemplate,
8518
8809
  pageBundleProcess,
8519
8810
  pageProcess,
8520
- publishLocationInfo });
8811
+ publishLocationInfo,
8812
+ };
8521
8813
  };
8522
8814
  const structureGroupMapping = {
8523
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'StructureGroup',
8815
+ identifier: backendModel => backendModel?.$type === 'StructureGroup',
8524
8816
  mapper: (mappingRegistry, backendModel) => {
8525
- return new StructureGroup(Object.assign(Object.assign({}, mapStructureGroupConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8817
+ return new StructureGroup({
8818
+ ...mapStructureGroupConstructorArgs(mappingRegistry, backendModel),
8819
+ backendModel,
8820
+ });
8526
8821
  },
8527
8822
  };
8528
8823
 
8529
8824
  const mapTaxonomiesConstructorArgs = mapOrganizationalItemConstructorArgs;
8530
8825
  const taxonomiesMapping = {
8531
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Taxonomies',
8826
+ identifier: backendModel => backendModel?.$type === 'Taxonomies',
8532
8827
  mapper: (mappingRegistry, backendModel) => {
8533
- return new Taxonomies(Object.assign(Object.assign({}, mapTaxonomiesConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8828
+ return new Taxonomies({ ...mapTaxonomiesConstructorArgs(mappingRegistry, backendModel), backendModel });
8534
8829
  },
8535
8830
  };
8536
8831
 
@@ -8676,9 +8971,8 @@ class EmbeddedRegion extends Region {
8676
8971
  * Represents the data of a Page: an artifact in the Publication's target structure.
8677
8972
  */
8678
8973
  class Page extends VersionedItem {
8679
- constructor(_a) {
8680
- var { backendModel, approvalStatus, componentPresentations, pageTemplate, publishLocationInfo, regionSchema, regions, workflowInfo } = _a, versionedItemArgs = __rest(_a, ["backendModel", "approvalStatus", "componentPresentations", "pageTemplate", "publishLocationInfo", "regionSchema", "regions", "workflowInfo"]);
8681
- super(Object.assign({ backendModel }, versionedItemArgs));
8974
+ constructor({ backendModel, approvalStatus, componentPresentations, pageTemplate, publishLocationInfo, regionSchema, regions, workflowInfo, ...versionedItemArgs }) {
8975
+ super({ backendModel, ...versionedItemArgs });
8682
8976
  Object.defineProperty(this, "_approvalStatus", {
8683
8977
  enumerable: true,
8684
8978
  configurable: true,
@@ -8848,18 +9142,20 @@ class TargetGroupCondition {
8848
9142
  }
8849
9143
 
8850
9144
  const mapComponentPresentationConstructorArgs = (mappingRegistry, backendModel) => {
8851
- var _a;
8852
9145
  const component = backendModel.Component ? mappingRegistry.map(backendModel.Component) : undefined;
8853
9146
  const componentTemplate = backendModel.ComponentTemplate
8854
9147
  ? mappingRegistry.map(backendModel.ComponentTemplate)
8855
9148
  : undefined;
8856
- const conditions = (_a = backendModel.Conditions) === null || _a === void 0 ? void 0 : _a.map(c => mappingRegistry.map(c)).filter(isDefined);
9149
+ const conditions = backendModel.Conditions?.map(c => mappingRegistry.map(c)).filter(isDefined);
8857
9150
  return { component, componentTemplate, conditions };
8858
9151
  };
8859
9152
  const componentPresentationMapping = {
8860
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentPresentation',
9153
+ identifier: backendModel => backendModel?.$type === 'ComponentPresentation',
8861
9154
  mapper: (mappingRegistry, backendModel) => {
8862
- return new ComponentPresentation(Object.assign(Object.assign({}, mapComponentPresentationConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9155
+ return new ComponentPresentation({
9156
+ ...mapComponentPresentationConstructorArgs(mappingRegistry, backendModel),
9157
+ backendModel,
9158
+ });
8863
9159
  },
8864
9160
  };
8865
9161
 
@@ -8872,26 +9168,27 @@ const mapRegions = (backendRegions, mappingRegistry) => {
8872
9168
  };
8873
9169
 
8874
9170
  const mapEmbeddedRegionConstructorArgs = (mappingRegistry, backendModel) => {
8875
- var _a;
8876
- const componentPresentations = (_a = backendModel.ComponentPresentations) === null || _a === void 0 ? void 0 : _a.map(cp => mappingRegistry.map(cp)).filter(isDefined);
9171
+ const componentPresentations = backendModel.ComponentPresentations?.map(cp => mappingRegistry.map(cp)).filter(isDefined);
8877
9172
  const regions = backendModel.Regions ? mapRegions(backendModel.Regions, mappingRegistry) : undefined;
8878
9173
  const regionSchema = backendModel.RegionSchema ? mappingRegistry.map(backendModel.RegionSchema) : undefined;
8879
9174
  return { componentPresentations, regions, regionSchema };
8880
9175
  };
8881
9176
  const embeddedRegionMapping = {
8882
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'EmbeddedRegion',
9177
+ identifier: backendModel => backendModel?.$type === 'EmbeddedRegion',
8883
9178
  mapper: (mappingRegistry, backendModel) => {
8884
- return new EmbeddedRegion(Object.assign(Object.assign({}, mapEmbeddedRegionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9179
+ return new EmbeddedRegion({
9180
+ ...mapEmbeddedRegionConstructorArgs(mappingRegistry, backendModel),
9181
+ backendModel,
9182
+ });
8885
9183
  },
8886
9184
  };
8887
9185
 
8888
9186
  const mapPageConstructorArgs = (mappingRegistry, backendModel) => {
8889
- var _a;
8890
9187
  const versionedItemConstructorArgs = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
8891
9188
  const approvalStatus = backendModel.ApprovalStatus
8892
9189
  ? mappingRegistry.map(backendModel.ApprovalStatus)
8893
9190
  : undefined;
8894
- const componentPresentations = (_a = backendModel.ComponentPresentations) === null || _a === void 0 ? void 0 : _a.map(cp => mappingRegistry.map(cp)).filter(isDefined);
9191
+ const componentPresentations = backendModel.ComponentPresentations?.map(cp => mappingRegistry.map(cp)).filter(isDefined);
8895
9192
  const publishLocationInfo = mappingRegistry.map(backendModel.LocationInfo);
8896
9193
  const pageTemplate = mappingRegistry.map(backendModel.PageTemplate);
8897
9194
  const regions = backendModel.Regions ? mapRegions(backendModel.Regions, mappingRegistry) : undefined;
@@ -8899,18 +9196,24 @@ const mapPageConstructorArgs = (mappingRegistry, backendModel) => {
8899
9196
  const workflowInfo = backendModel.WorkflowInfo
8900
9197
  ? mappingRegistry.map(backendModel.WorkflowInfo)
8901
9198
  : undefined;
8902
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { approvalStatus,
9199
+ return {
9200
+ ...versionedItemConstructorArgs,
9201
+ approvalStatus,
8903
9202
  componentPresentations,
8904
9203
  pageTemplate,
8905
9204
  publishLocationInfo,
8906
9205
  regions,
8907
9206
  regionSchema,
8908
- workflowInfo });
9207
+ workflowInfo,
9208
+ };
8909
9209
  };
8910
9210
  const pageMapping = {
8911
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Page',
9211
+ identifier: backendModel => backendModel?.$type === 'Page',
8912
9212
  mapper: (mappingRegistry, backendModel) => {
8913
- return new Page(Object.assign(Object.assign({}, mapPageConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9213
+ return new Page({
9214
+ ...mapPageConstructorArgs(mappingRegistry, backendModel),
9215
+ backendModel,
9216
+ });
8914
9217
  },
8915
9218
  };
8916
9219
 
@@ -8919,9 +9222,12 @@ const mapTargetGroupConditionConstructorArgs = (mappingRegistry, backendModel) =
8919
9222
  return { targetGroup };
8920
9223
  };
8921
9224
  const targetGroupConditionMapping = {
8922
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetGroupCondition',
9225
+ identifier: backendModel => backendModel?.$type === 'TargetGroupCondition',
8923
9226
  mapper: (mappingRegistry, backendModel) => {
8924
- return new TargetGroupCondition(Object.assign(Object.assign({}, mapTargetGroupConditionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9227
+ return new TargetGroupCondition({
9228
+ ...mapTargetGroupConditionConstructorArgs(mappingRegistry, backendModel),
9229
+ backendModel,
9230
+ });
8925
9231
  },
8926
9232
  };
8927
9233
 
@@ -9221,9 +9527,8 @@ class PublishInstruction extends PublishInstructionBase {
9221
9527
  }
9222
9528
 
9223
9529
  class PublishTransaction extends SystemWideObject {
9224
- constructor(_a) {
9225
- var { backendModel, creator, deployerAction, instruction, items, priority, publishContexts, state, targetType, stateChangeDateTime } = _a, systemWideObjectConstructorArgs = __rest(_a, ["backendModel", "creator", "deployerAction", "instruction", "items", "priority", "publishContexts", "state", "targetType", "stateChangeDateTime"]);
9226
- super(Object.assign({ backendModel }, systemWideObjectConstructorArgs));
9530
+ constructor({ backendModel, creator, deployerAction, instruction, items, priority, publishContexts, state, targetType, stateChangeDateTime, ...systemWideObjectConstructorArgs }) {
9531
+ super({ backendModel, ...systemWideObjectConstructorArgs });
9227
9532
  Object.defineProperty(this, "_backendModel", {
9228
9533
  enumerable: true,
9229
9534
  configurable: true,
@@ -9508,6 +9813,64 @@ class PublishUrlInfo {
9508
9813
  }
9509
9814
  }
9510
9815
 
9816
+ class RenderedItem {
9817
+ constructor({ backendModel, item, template }) {
9818
+ Object.defineProperty(this, "_backendModel", {
9819
+ enumerable: true,
9820
+ configurable: true,
9821
+ writable: true,
9822
+ value: void 0
9823
+ });
9824
+ Object.defineProperty(this, "_item", {
9825
+ enumerable: true,
9826
+ configurable: true,
9827
+ writable: true,
9828
+ value: void 0
9829
+ });
9830
+ Object.defineProperty(this, "_template", {
9831
+ enumerable: true,
9832
+ configurable: true,
9833
+ writable: true,
9834
+ value: void 0
9835
+ });
9836
+ Object.defineProperty(this, "getInternalModel", {
9837
+ enumerable: true,
9838
+ configurable: true,
9839
+ writable: true,
9840
+ value: () => {
9841
+ return this._backendModel;
9842
+ }
9843
+ });
9844
+ this._backendModel = backendModel;
9845
+ this._item = item;
9846
+ this._template = template;
9847
+ }
9848
+ /**
9849
+ * Gets the data pipeline JSON (if any)
9850
+ */
9851
+ get dataPipelineJson() {
9852
+ return this._backendModel.DataPipelineJson;
9853
+ }
9854
+ /**
9855
+ * Gets a link to the item that was rendered.
9856
+ */
9857
+ get item() {
9858
+ return this._item;
9859
+ }
9860
+ /**
9861
+ * Gets the rendered output of the template (if any)
9862
+ */
9863
+ get renderedOutput() {
9864
+ return this._backendModel.RenderedOutput;
9865
+ }
9866
+ /**
9867
+ * Gets a link to the template with which the item was rendered (if any).
9868
+ */
9869
+ get template() {
9870
+ return this._template;
9871
+ }
9872
+ }
9873
+
9511
9874
  class ResolvedItem {
9512
9875
  constructor({ backendModel, item, publication, targetType, template }) {
9513
9876
  Object.defineProperty(this, "_backendModel", {
@@ -9645,9 +10008,8 @@ class ResolveInstructionBase {
9645
10008
  }
9646
10009
 
9647
10010
  class ResolveInstruction extends ResolveInstructionBase {
9648
- constructor(_a) {
9649
- var { backendModel } = _a, resolveInstructionBaseConstructorArgs = __rest(_a, ["backendModel"]);
9650
- super(Object.assign({ backendModel }, resolveInstructionBaseConstructorArgs));
10011
+ constructor({ backendModel, ...resolveInstructionBaseConstructorArgs }) {
10012
+ super({ backendModel, ...resolveInstructionBaseConstructorArgs });
9651
10013
  Object.defineProperty(this, "_backendModel", {
9652
10014
  enumerable: true,
9653
10015
  configurable: true,
@@ -9746,24 +10108,29 @@ const mapProcessedItemConstructorArgs = (mappingRegistry, backendModel) => {
9746
10108
  return { resolvedItem };
9747
10109
  };
9748
10110
  const processedItemMapping = {
9749
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessedItem',
10111
+ identifier: backendModel => backendModel?.$type === 'ProcessedItem',
9750
10112
  mapper: (mappingRegistry, backendModel) => {
9751
- return new ProcessedItem(Object.assign(Object.assign({}, mapProcessedItemConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10113
+ return new ProcessedItem({
10114
+ ...mapProcessedItemConstructorArgs(mappingRegistry, backendModel),
10115
+ backendModel,
10116
+ });
9752
10117
  },
9753
10118
  };
9754
10119
 
9755
10120
  const mapPublishContextConstructorArgs = (mappingRegistry, backendModel) => {
9756
- var _a, _b;
9757
- const processedItems = (_a = backendModel.ProcessedItems) === null || _a === void 0 ? void 0 : _a.map(i => mappingRegistry.map(i)).filter(isDefined);
10121
+ const processedItems = backendModel.ProcessedItems?.map(i => mappingRegistry.map(i)).filter(isDefined);
9758
10122
  const publication = backendModel.Publication ? mappingRegistry.map(backendModel.Publication) : undefined;
9759
- const resolvedItems = (_b = backendModel.ResolvedItems) === null || _b === void 0 ? void 0 : _b.map(i => mappingRegistry.map(i)).filter(isDefined);
10123
+ const resolvedItems = backendModel.ResolvedItems?.map(i => mappingRegistry.map(i)).filter(isDefined);
9760
10124
  const targetType = backendModel.TargetType ? mappingRegistry.map(backendModel.Publication) : undefined;
9761
10125
  return { processedItems, publication, resolvedItems, targetType };
9762
10126
  };
9763
10127
  const publishContextMapping = {
9764
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishContext',
10128
+ identifier: backendModel => backendModel?.$type === 'PublishContext',
9765
10129
  mapper: (mappingRegistry, backendModel) => {
9766
- return new PublishContext(Object.assign(Object.assign({}, mapPublishContextConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10130
+ return new PublishContext({
10131
+ ...mapPublishContextConstructorArgs(mappingRegistry, backendModel),
10132
+ backendModel,
10133
+ });
9767
10134
  },
9768
10135
  };
9769
10136
 
@@ -9775,9 +10142,12 @@ const mapPublishInfoConstructorArgs = (mappingRegistry, backendModel) => {
9775
10142
  return { renderedWith, repository, targetType, user };
9776
10143
  };
9777
10144
  const publishInfoMapping = {
9778
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInfo',
10145
+ identifier: backendModel => backendModel?.$type === 'PublishInfo',
9779
10146
  mapper: (mappingRegistry, backendModel) => {
9780
- return new PublishInfo(Object.assign(Object.assign({}, mapPublishInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10147
+ return new PublishInfo({
10148
+ ...mapPublishInfoConstructorArgs(mappingRegistry, backendModel),
10149
+ backendModel,
10150
+ });
9781
10151
  },
9782
10152
  };
9783
10153
 
@@ -9789,9 +10159,12 @@ const mapPublishInstructionConstructorArgs = (mappingRegistry, backendModel) =>
9789
10159
  return { deployAt, resolveInstruction };
9790
10160
  };
9791
10161
  const publishInstructionMapping = {
9792
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInstruction',
10162
+ identifier: backendModel => backendModel?.$type === 'PublishInstruction',
9793
10163
  mapper: (mappingRegistry, backendModel) => {
9794
- return new PublishInstruction(Object.assign(Object.assign({}, mapPublishInstructionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10164
+ return new PublishInstruction({
10165
+ ...mapPublishInstructionConstructorArgs(mappingRegistry, backendModel),
10166
+ backendModel,
10167
+ });
9795
10168
  },
9796
10169
  };
9797
10170
 
@@ -9810,7 +10183,7 @@ const mapPublishTransactionInfoConstructorArgs = (mappingRegistry, backendModel)
9810
10183
  return { publishAction, scheduleTime };
9811
10184
  };
9812
10185
  const publishTransactionListInfoMapping = {
9813
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransactionListInfo',
10186
+ identifier: backendModel => backendModel?.$type === 'PublishTransactionListInfo',
9814
10187
  mapper: (mappingRegistry, backendModel) => {
9815
10188
  const { publishAction, scheduleTime } = mapPublishTransactionInfoConstructorArgs(mappingRegistry, backendModel);
9816
10189
  return new PublishTransactionListInfo({ backendModel, publishAction, scheduleTime });
@@ -9903,7 +10276,6 @@ const mapPublishTransactionStateToBackend = (model) => {
9903
10276
  };
9904
10277
 
9905
10278
  const mapPublishTransactionConstructorArgs = (mappingRegistry, backendModel) => {
9906
- var _a;
9907
10279
  const systemWideObjectConstructorArgs = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
9908
10280
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
9909
10281
  const deployerAction = backendModel.DeployerAction ? mapDeployerAction(backendModel.DeployerAction) : undefined;
@@ -9912,13 +10284,15 @@ const mapPublishTransactionConstructorArgs = (mappingRegistry, backendModel) =>
9912
10284
  : undefined;
9913
10285
  const items = mapLinks(mappingRegistry, backendModel.Items);
9914
10286
  const priority = backendModel.Priority ? mapPublishPriority(backendModel.Priority) : undefined;
9915
- const publishContexts = (_a = backendModel.PublishContexts) === null || _a === void 0 ? void 0 : _a.map(p => mappingRegistry.map(p)).filter(isDefined);
10287
+ const publishContexts = backendModel.PublishContexts?.map(p => mappingRegistry.map(p)).filter(isDefined);
9916
10288
  const state = backendModel.State ? mapPublishTransactionState(backendModel.State) : undefined;
9917
10289
  const targetType = backendModel.TargetType ? mappingRegistry.map(backendModel.TargetType) : undefined;
9918
10290
  const stateChangeDateTime = backendModel.StateChangeDateTime
9919
10291
  ? mapDate(backendModel.StateChangeDateTime)
9920
10292
  : undefined;
9921
- return Object.assign(Object.assign({}, systemWideObjectConstructorArgs), { creator,
10293
+ return {
10294
+ ...systemWideObjectConstructorArgs,
10295
+ creator,
9922
10296
  deployerAction,
9923
10297
  instruction,
9924
10298
  items,
@@ -9926,34 +10300,55 @@ const mapPublishTransactionConstructorArgs = (mappingRegistry, backendModel) =>
9926
10300
  publishContexts,
9927
10301
  state,
9928
10302
  targetType,
9929
- stateChangeDateTime });
10303
+ stateChangeDateTime,
10304
+ };
9930
10305
  };
9931
10306
  const publishTransactionMapping = {
9932
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransaction',
10307
+ identifier: backendModel => backendModel?.$type === 'PublishTransaction',
9933
10308
  mapper: (mappingRegistry, backendModel) => {
9934
- return new PublishTransaction(Object.assign(Object.assign({}, mapPublishTransactionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10309
+ return new PublishTransaction({
10310
+ ...mapPublishTransactionConstructorArgs(mappingRegistry, backendModel),
10311
+ backendModel,
10312
+ });
9935
10313
  },
9936
10314
  };
9937
10315
 
9938
10316
  const mapPublishTransactionsCreationResultConstructorArgs = (mappingRegistry, backendModel) => {
9939
- var _a;
9940
- const publishTransactionIds = (_a = backendModel.PublishTransactionIds) === null || _a === void 0 ? void 0 : _a.map(id => tryParseItemUri(id)).filter(isDefined);
10317
+ const publishTransactionIds = backendModel.PublishTransactionIds?.map(id => tryParseItemUri(id)).filter(isDefined);
9941
10318
  return { publishTransactionIds };
9942
10319
  };
9943
10320
  const publishTransactionsCreationResultMapping = {
9944
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransactionsCreationResult',
10321
+ identifier: backendModel => backendModel?.$type === 'PublishTransactionsCreationResult',
9945
10322
  mapper: (mappingRegistry, backendModel) => {
9946
- return new PublishTransactionsCreationResult(Object.assign(Object.assign({}, mapPublishTransactionsCreationResultConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10323
+ return new PublishTransactionsCreationResult({
10324
+ ...mapPublishTransactionsCreationResultConstructorArgs(mappingRegistry, backendModel),
10325
+ backendModel,
10326
+ });
9947
10327
  },
9948
10328
  };
9949
10329
 
9950
10330
  const publishUrlInfoMapping = {
9951
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInfo',
10331
+ identifier: backendModel => backendModel?.$type === 'PublishInfo',
9952
10332
  mapper: (mappingRegistry, backendModel) => {
9953
10333
  return new PublishUrlInfo(backendModel);
9954
10334
  },
9955
10335
  };
9956
10336
 
10337
+ const mapRenderedItemConstructorArgs = (mappingRegistry, backendModel) => {
10338
+ const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
10339
+ const template = backendModel.Template ? mappingRegistry.map(backendModel.Template) : undefined;
10340
+ return { item, template };
10341
+ };
10342
+ const renderedItemMapping = {
10343
+ identifier: backendModel => backendModel?.$type === 'RenderedItem',
10344
+ mapper: (mappingRegistry, backendModel) => {
10345
+ return new RenderedItem({
10346
+ ...mapRenderedItemConstructorArgs(mappingRegistry, backendModel),
10347
+ backendModel,
10348
+ });
10349
+ },
10350
+ };
10351
+
9957
10352
  const mapResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
9958
10353
  const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
9959
10354
  const publication = backendModel.Publication ? mappingRegistry.map(backendModel.Publication) : undefined;
@@ -9962,9 +10357,12 @@ const mapResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
9962
10357
  return { item, publication, targetType, template };
9963
10358
  };
9964
10359
  const resolvedItemMapping = {
9965
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ResolvedItem',
10360
+ identifier: backendModel => backendModel?.$type === 'ResolvedItem',
9966
10361
  mapper: (mappingRegistry, backendModel) => {
9967
- return new ResolvedItem(Object.assign(Object.assign({}, mapResolvedItemConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10362
+ return new ResolvedItem({
10363
+ ...mapResolvedItemConstructorArgs(mappingRegistry, backendModel),
10364
+ backendModel,
10365
+ });
9968
10366
  },
9969
10367
  };
9970
10368
 
@@ -9994,19 +10392,21 @@ const mapStructureResolveOptionToBackend = (model) => {
9994
10392
  };
9995
10393
 
9996
10394
  const mapResolveInstructionBaseConstructorArgs = (mappingRegistry, backendModel) => {
9997
- var _a;
9998
10395
  const structureResolveOption = backendModel.StructureResolveOption
9999
10396
  ? mapStructureResolveOption(backendModel.StructureResolveOption)
10000
10397
  : undefined;
10001
- const publishInChildPublications = (_a = backendModel.PublishInChildPublications) === null || _a === void 0 ? void 0 : _a.map(id => parseItemUri(id));
10398
+ const publishInChildPublications = backendModel.PublishInChildPublications?.map(id => parseItemUri(id));
10002
10399
  return { structureResolveOption, publishInChildPublications };
10003
10400
  };
10004
10401
 
10005
10402
  const mapResolveInstructionConstructorArgs = mapResolveInstructionBaseConstructorArgs;
10006
10403
  const resolveInstructionMapping = {
10007
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ResolveInstruction',
10404
+ identifier: backendModel => backendModel?.$type === 'ResolveInstruction',
10008
10405
  mapper: (mappingRegistry, backendModel) => {
10009
- return new ResolveInstruction(Object.assign(Object.assign({}, mapResolveInstructionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10406
+ return new ResolveInstruction({
10407
+ ...mapResolveInstructionConstructorArgs(mappingRegistry, backendModel),
10408
+ backendModel,
10409
+ });
10010
10410
  },
10011
10411
  };
10012
10412
 
@@ -10018,9 +10418,12 @@ const mapUnpublishInstructionConstructorArgs = (mappingRegistry, backendModel) =
10018
10418
  return { startAt, resolveInstruction };
10019
10419
  };
10020
10420
  const unpublishInstructionMapping = {
10021
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UnPublishInstruction',
10421
+ identifier: backendModel => backendModel?.$type === 'UnPublishInstruction',
10022
10422
  mapper: (mappingRegistry, backendModel) => {
10023
- return new UnpublishInstruction(Object.assign(Object.assign({}, mapUnpublishInstructionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10423
+ return new UnpublishInstruction({
10424
+ ...mapUnpublishInstructionConstructorArgs(mappingRegistry, backendModel),
10425
+ backendModel,
10426
+ });
10024
10427
  },
10025
10428
  };
10026
10429
 
@@ -10037,8 +10440,7 @@ class SynchronizationAction {
10037
10440
  configurable: true,
10038
10441
  writable: true,
10039
10442
  value: (synchronizationAction) => {
10040
- var _a;
10041
- return !!((_a = this.synchronizationActionApplied) === null || _a === void 0 ? void 0 : _a.includes(synchronizationAction));
10443
+ return !!this.synchronizationActionApplied?.includes(synchronizationAction);
10042
10444
  }
10043
10445
  });
10044
10446
  Object.defineProperty(this, "getInternalModel", {
@@ -10146,10 +10548,9 @@ const mapSynchronizeFlagsToBackend = (model) => {
10146
10548
  };
10147
10549
 
10148
10550
  const synchronizationActionMapping = {
10149
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SynchronizationAction',
10551
+ identifier: backendModel => backendModel?.$type === 'SynchronizationAction',
10150
10552
  mapper: (mappingRegistry, backendModel) => {
10151
- var _a;
10152
- const synchronizationActionApplied = (_a = backendModel.SynchronizationActionApplied) === null || _a === void 0 ? void 0 : _a.map(p => mapSynchronizeFlags(p));
10553
+ const synchronizationActionApplied = backendModel.SynchronizationActionApplied?.map(p => mapSynchronizeFlags(p));
10153
10554
  return new SynchronizationAction({
10154
10555
  backendModel,
10155
10556
  synchronizationActionApplied,
@@ -10198,10 +10599,9 @@ class SynchronizationResult {
10198
10599
  }
10199
10600
 
10200
10601
  const synchronizationResultMapping = {
10201
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SynchronizationResult',
10602
+ identifier: backendModel => backendModel?.$type === 'SynchronizationResult',
10202
10603
  mapper: (mappingRegistry, backendModel) => {
10203
- var _a;
10204
- const synchronizationActions = (_a = backendModel.SynchronizationActions) === null || _a === void 0 ? void 0 : _a.map(p => mappingRegistry.map(p)).filter(isDefined);
10604
+ const synchronizationActions = backendModel.SynchronizationActions?.map(p => mappingRegistry.map(p)).filter(isDefined);
10205
10605
  const synchronizedItem = backendModel.SynchronizedItem
10206
10606
  ? mappingRegistry.map(backendModel.SynchronizedItem)
10207
10607
  : undefined;
@@ -10255,16 +10655,16 @@ class SystemPrivilege {
10255
10655
  }
10256
10656
 
10257
10657
  const systemPrivilegeMapping = {
10258
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SystemPrivilege',
10658
+ identifier: backendModel => backendModel?.$type === 'SystemPrivilege',
10259
10659
  mapper: (mappingRegistry, backendModel) => {
10260
10660
  return new SystemPrivilege(backendModel);
10261
10661
  },
10262
10662
  };
10263
10663
 
10264
10664
  const systemPrivilegesDictionaryMapping = {
10265
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SystemPrivilegesDictionary',
10665
+ identifier: backendModel => backendModel?.$type === 'SystemPrivilegesDictionary',
10266
10666
  mapper: (mappingRegistry, backendModel) => {
10267
- const dictionary = __rest(backendModel, ["$type"]);
10667
+ const { $type, ...dictionary } = backendModel;
10268
10668
  return mapObject(dictionary, (value) => mapLinks(mappingRegistry, value) || []);
10269
10669
  },
10270
10670
  };
@@ -10295,7 +10695,7 @@ class TargetGroup extends RepositoryLocalObject {
10295
10695
 
10296
10696
  const mapTargetGroupConstructorArgs = mapRepositoryLocalObjectConstructorArgs;
10297
10697
  const targetGroupMapping = {
10298
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetGroup',
10698
+ identifier: backendModel => backendModel?.$type === 'TargetGroup',
10299
10699
  mapper: (mappingRegistry, backendModel) => {
10300
10700
  const { applicableActions, basicVersionInfo, blueprintInfo, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, securityDescriptor, listInfo, } = mapTargetGroupConstructorArgs(mappingRegistry, backendModel);
10301
10701
  return new TargetGroup({
@@ -10322,9 +10722,8 @@ const targetGroupMapping = {
10322
10722
  * Abstract base class for the data of Templates.
10323
10723
  */
10324
10724
  class Template extends VersionedItem {
10325
- constructor(_a) {
10326
- var { backendModel, binaryContent, parameterSchema } = _a, versionedItemArgs = __rest(_a, ["backendModel", "binaryContent", "parameterSchema"]);
10327
- super(Object.assign({ backendModel }, versionedItemArgs));
10725
+ constructor({ backendModel, binaryContent, parameterSchema, ...versionedItemArgs }) {
10726
+ super({ backendModel, ...versionedItemArgs });
10328
10727
  Object.defineProperty(this, "_binaryContent", {
10329
10728
  enumerable: true,
10330
10729
  configurable: true,
@@ -10391,9 +10790,8 @@ class Template extends VersionedItem {
10391
10790
  * Represents a Component Template: a template used to render a Component into a Component Presentation.
10392
10791
  */
10393
10792
  class ComponentTemplate extends Template {
10394
- constructor(_a) {
10395
- var { backendModel, approvalStatus, relatedSchemas, trackingCategories, workflowInfo } = _a, templateArgs = __rest(_a, ["backendModel", "approvalStatus", "relatedSchemas", "trackingCategories", "workflowInfo"]);
10396
- super(Object.assign({ backendModel }, templateArgs));
10793
+ constructor({ backendModel, approvalStatus, relatedSchemas, trackingCategories, workflowInfo, ...templateArgs }) {
10794
+ super({ backendModel, ...templateArgs });
10397
10795
  Object.defineProperty(this, "_approvalStatus", {
10398
10796
  enumerable: true,
10399
10797
  configurable: true,
@@ -10524,9 +10922,8 @@ class ComponentTemplate extends Template {
10524
10922
  * Represents a Page Template: a template used to render a Page.
10525
10923
  */
10526
10924
  class PageTemplate extends Template {
10527
- constructor(_a) {
10528
- var { backendModel, approvalStatus, pageSchema, workflowInfo } = _a, templateArgs = __rest(_a, ["backendModel", "approvalStatus", "pageSchema", "workflowInfo"]);
10529
- super(Object.assign({ backendModel }, templateArgs));
10925
+ constructor({ backendModel, approvalStatus, pageSchema, workflowInfo, ...templateArgs }) {
10926
+ super({ backendModel, ...templateArgs });
10530
10927
  Object.defineProperty(this, "_approvalStatus", {
10531
10928
  enumerable: true,
10532
10929
  configurable: true,
@@ -10591,9 +10988,8 @@ class PageTemplate extends Template {
10591
10988
  * Represents a Template Building Block: a re-usable template module.
10592
10989
  */
10593
10990
  class TemplateBuildingBlock extends Template {
10594
- constructor(_a) {
10595
- var { backendModel, approvalStatus, workflowInfo } = _a, templateArgs = __rest(_a, ["backendModel", "approvalStatus", "workflowInfo"]);
10596
- super(Object.assign({ backendModel }, templateArgs));
10991
+ constructor({ backendModel, approvalStatus, workflowInfo, ...templateArgs }) {
10992
+ super({ backendModel, ...templateArgs });
10597
10993
  Object.defineProperty(this, "_approvalStatus", {
10598
10994
  enumerable: true,
10599
10995
  configurable: true,
@@ -10636,8 +11032,11 @@ const mapTemplateConstructorArgs = (mappingRegistry, backendModel) => {
10636
11032
  const parameterSchema = backendModel.ParameterSchema
10637
11033
  ? mappingRegistry.map(backendModel.ParameterSchema)
10638
11034
  : undefined;
10639
- return Object.assign(Object.assign({}, mapVersionedItemConstructorArgs(mappingRegistry, backendModel)), { binaryContent,
10640
- parameterSchema });
11035
+ return {
11036
+ ...mapVersionedItemConstructorArgs(mappingRegistry, backendModel),
11037
+ binaryContent,
11038
+ parameterSchema,
11039
+ };
10641
11040
  };
10642
11041
 
10643
11042
  const mapPageTemplateConstructorArgs = (mappingRegistry, backendModel) => {
@@ -10649,14 +11048,20 @@ const mapPageTemplateConstructorArgs = (mappingRegistry, backendModel) => {
10649
11048
  const workflowInfo = backendModel.WorkflowInfo
10650
11049
  ? mappingRegistry.map(backendModel.WorkflowInfo)
10651
11050
  : undefined;
10652
- return Object.assign(Object.assign({}, templateConstructorArgs), { approvalStatus,
11051
+ return {
11052
+ ...templateConstructorArgs,
11053
+ approvalStatus,
10653
11054
  pageSchema,
10654
- workflowInfo });
11055
+ workflowInfo,
11056
+ };
10655
11057
  };
10656
11058
  const pageTemplateMapping = {
10657
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PageTemplate',
11059
+ identifier: backendModel => backendModel?.$type === 'PageTemplate',
10658
11060
  mapper: (mappingRegistry, backendModel) => {
10659
- return new PageTemplate(Object.assign(Object.assign({}, mapPageTemplateConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
11061
+ return new PageTemplate({
11062
+ ...mapPageTemplateConstructorArgs(mappingRegistry, backendModel),
11063
+ backendModel,
11064
+ });
10660
11065
  },
10661
11066
  };
10662
11067
 
@@ -10670,15 +11075,21 @@ const mapComponentTemplateConstructorArgs = (mappingRegistry, backendModel) => {
10670
11075
  const workflowInfo = backendModel.WorkflowInfo
10671
11076
  ? mappingRegistry.map(backendModel.WorkflowInfo)
10672
11077
  : undefined;
10673
- return Object.assign(Object.assign({}, templateConstructorArgs), { approvalStatus,
11078
+ return {
11079
+ ...templateConstructorArgs,
11080
+ approvalStatus,
10674
11081
  workflowInfo,
10675
11082
  relatedSchemas,
10676
- trackingCategories });
11083
+ trackingCategories,
11084
+ };
10677
11085
  };
10678
11086
  const componentTemplateMapping = {
10679
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentTemplate',
11087
+ identifier: backendModel => backendModel?.$type === 'ComponentTemplate',
10680
11088
  mapper: (mappingRegistry, backendModel) => {
10681
- return new ComponentTemplate(Object.assign(Object.assign({}, mapComponentTemplateConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
11089
+ return new ComponentTemplate({
11090
+ ...mapComponentTemplateConstructorArgs(mappingRegistry, backendModel),
11091
+ backendModel,
11092
+ });
10682
11093
  },
10683
11094
  };
10684
11095
 
@@ -10690,13 +11101,19 @@ const mapTemplateBuildingBlockConstructorArgs = (mappingRegistry, backendModel)
10690
11101
  const workflowInfo = backendModel.WorkflowInfo
10691
11102
  ? mappingRegistry.map(backendModel.WorkflowInfo)
10692
11103
  : undefined;
10693
- return Object.assign(Object.assign({}, templateConstructorArgs), { approvalStatus,
10694
- workflowInfo });
11104
+ return {
11105
+ ...templateConstructorArgs,
11106
+ approvalStatus,
11107
+ workflowInfo,
11108
+ };
10695
11109
  };
10696
11110
  const templateBuildingBlockMapping = {
10697
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TemplateBuildingBlock',
11111
+ identifier: backendModel => backendModel?.$type === 'TemplateBuildingBlock',
10698
11112
  mapper: (mappingRegistry, backendModel) => {
10699
- return new TemplateBuildingBlock(Object.assign(Object.assign({}, mapTemplateBuildingBlockConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
11113
+ return new TemplateBuildingBlock({
11114
+ ...mapTemplateBuildingBlockConstructorArgs(mappingRegistry, backendModel),
11115
+ backendModel,
11116
+ });
10700
11117
  },
10701
11118
  };
10702
11119
 
@@ -11327,7 +11744,7 @@ class TranslationInfo {
11327
11744
  }
11328
11745
 
11329
11746
  class TranslationJob {
11330
- constructor({ addedItems, backendModel, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, requiredDate, revisionDate, revisor, state, targetLanguages, type, workflowStatus, }) {
11747
+ constructor({ addedItems, backendModel, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, requiredDate, revisionDate, revisor, state, targetLanguages, type, workflowStatus, contextRepository, }) {
11331
11748
  Object.defineProperty(this, "_backendModel", {
11332
11749
  enumerable: true,
11333
11750
  configurable: true,
@@ -11430,6 +11847,12 @@ class TranslationJob {
11430
11847
  writable: true,
11431
11848
  value: void 0
11432
11849
  });
11850
+ Object.defineProperty(this, "_contextRepository", {
11851
+ enumerable: true,
11852
+ configurable: true,
11853
+ writable: true,
11854
+ value: void 0
11855
+ });
11433
11856
  Object.defineProperty(this, "getInternalModel", {
11434
11857
  enumerable: true,
11435
11858
  configurable: true,
@@ -11455,6 +11878,7 @@ class TranslationJob {
11455
11878
  this._creationDate = creationDate;
11456
11879
  this._requiredDate = requiredDate;
11457
11880
  this._revisionDate = revisionDate;
11881
+ this._contextRepository = contextRepository;
11458
11882
  }
11459
11883
  get id() {
11460
11884
  return this._backendModel.Id;
@@ -11477,10 +11901,10 @@ class TranslationJob {
11477
11901
  return this._configurationItemUri;
11478
11902
  }
11479
11903
  /**
11480
- * Title of the Publication containing the <seealso cref="P:Tridion.TranslationManager.OpenApi.V2.Dto.TranslationJob.ConfigurationItemUri" />.
11904
+ * Link to the Context Repository.
11481
11905
  */
11482
- get contextPublicationTitle() {
11483
- return this._backendModel.ContextPublicationTitle;
11906
+ get contextRepository() {
11907
+ return this._contextRepository;
11484
11908
  }
11485
11909
  /**
11486
11910
  * The date the Translation Job was created (in UTC).
@@ -11999,101 +12423,444 @@ class TranslationWorkflowStatus {
11999
12423
  }
12000
12424
  }
12001
12425
 
12002
- const mapTargetLanguageConstructorArgs = (mappingRegistry, backendModel) => {
12003
- var _a, _b;
12004
- const availableWorkflows = (_a = backendModel.AvailableWorkflows) === null || _a === void 0 ? void 0 : _a.map(w => mappingRegistry.map(w)).filter(isDefined);
12005
- const selectedWorkflow = backendModel.SelectedWorkflow
12006
- ? mappingRegistry.map(backendModel.SelectedWorkflow)
12007
- : undefined;
12008
- const targetPublications = (_b = backendModel.TargetPublications) === null || _b === void 0 ? void 0 : _b.map(p => mappingRegistry.map(p)).filter(isDefined);
12009
- return { availableWorkflows, selectedWorkflow, targetPublications };
12010
- };
12011
- const targetLanguageMapping = {
12012
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetLanguage',
12013
- mapper: (mappingRegistry, backendModel) => {
12014
- const { availableWorkflows, selectedWorkflow, targetPublications } = mapTargetLanguageConstructorArgs(mappingRegistry, backendModel);
12015
- return new TargetLanguage({
12016
- availableWorkflows,
12017
- backendModel,
12018
- selectedWorkflow,
12019
- targetPublications,
12426
+ /**
12427
+ * `TranslationJob` class that extends `IdentifiableObject`, that uses `ItemUri` instead of number as an id.
12428
+ *
12429
+ * @note
12430
+ * Please note that the rest of `IdentifiableObject` props will be undefined always.
12431
+ *
12432
+ * To get original object use `getOriginalInternalModel()`, as `getInternalModel()` result will include `Id` in a format `tm:0-1234`.
12433
+ *
12434
+ * @example
12435
+ * TranslationJob.id: number | undefined;
12436
+ * IdentifiableTranslationJob.id: ItemUri;
12437
+ */
12438
+ class IdentifiableTranslationJob extends IdentifiableObject {
12439
+ constructor({ addedItems, backendModel, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, requiredDate, revisionDate, revisor, state, targetLanguages, type, workflowStatus, contextRepository, ...identifiableObjectArgs }) {
12440
+ super({ backendModel, ...identifiableObjectArgs });
12441
+ Object.defineProperty(this, "_backendModel", {
12442
+ enumerable: true,
12443
+ configurable: true,
12444
+ writable: true,
12445
+ value: void 0
12020
12446
  });
12021
- },
12022
- };
12023
-
12024
- const tmsLanguageMapping = {
12025
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TmsLanguage',
12026
- mapper: (mappingRegistry, backendModel) => {
12027
- return new TmsLanguage(backendModel);
12028
- },
12029
- };
12030
-
12031
- const mapTmsWorkflowConstructorArgs = (mappingRegistry, backendModel) => {
12032
- var _a;
12033
- const steps = (_a = backendModel.Steps) === null || _a === void 0 ? void 0 : _a.map(s => mappingRegistry.map(s)).filter(isDefined);
12034
- return { steps };
12035
- };
12036
- const tmsWorkflowMapping = {
12037
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TmsWorkflow',
12038
- mapper: (mappingRegistry, backendModel) => {
12039
- const { steps } = mapTmsWorkflowConstructorArgs(mappingRegistry, backendModel);
12040
- return new TmsWorkflow({ backendModel, steps });
12041
- },
12042
- };
12043
-
12044
- const tmsWorkflowStepMapping = {
12045
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TmsWorkflowStep',
12046
- mapper: (mappingRegistry, backendModel) => {
12047
- return new TmsWorkflowStep(backendModel);
12048
- },
12049
- };
12050
-
12051
- const mapTranslationStatus = (backendModel) => {
12052
- switch (backendModel) {
12053
- case TranslationStatus.NOT_TRANSLATED:
12054
- return 'notTranslated';
12055
- case TranslationStatus.IN_PROGRESS:
12056
- return 'inProgress';
12057
- case TranslationStatus.UP_TO_DATE:
12058
- return 'upToDate';
12059
- case TranslationStatus.NEW_SOURCE_VERSION_EXISTS:
12060
- return 'newSourceVersionExists';
12061
- case TranslationStatus.NEW_TARGET_VERSION_EXISTS:
12062
- return 'newTargetVersionExists';
12063
- case TranslationStatus.UNKNOWN_BY_CLIENT:
12064
- return 'unknownByClient';
12065
- }
12066
- };
12067
- const mapTranslationStatusToBackend = (model) => {
12068
- switch (model) {
12069
- case 'notTranslated':
12070
- return TranslationStatus.NOT_TRANSLATED;
12071
- case 'inProgress':
12072
- return TranslationStatus.IN_PROGRESS;
12073
- case 'upToDate':
12074
- return TranslationStatus.UP_TO_DATE;
12075
- case 'newSourceVersionExists':
12076
- return TranslationStatus.NEW_SOURCE_VERSION_EXISTS;
12077
- case 'newTargetVersionExists':
12078
- return TranslationStatus.NEW_TARGET_VERSION_EXISTS;
12079
- case 'unknownByClient':
12080
- return TranslationStatus.UNKNOWN_BY_CLIENT;
12081
- }
12082
- };
12083
-
12084
- const mapTranslationDetailsConstructorArgs = (mappingRegistry, backendModel) => {
12085
- var _a;
12086
- const completedTranslationInfo = backendModel.CompletedTranslationInfo
12087
- ? mappingRegistry.map(backendModel.CompletedTranslationInfo)
12088
- : undefined;
12089
- const inProgressTranslationInfo = (_a = backendModel.InProgressTranslationInfo) === null || _a === void 0 ? void 0 : _a.map(tji => mappingRegistry.map(tji)).filter(isDefined);
12090
- const sourceItemUri = backendModel.SourceItemUri ? parseItemUri(backendModel.SourceItemUri) : undefined;
12091
- const sourcePublicationUri = backendModel.SourcePublicationUri
12092
- ? parseItemUri(backendModel.SourcePublicationUri)
12093
- : undefined;
12094
- const status = backendModel.Status ? mapTranslationStatus(backendModel.Status) : undefined;
12095
- const targetItemUri = backendModel.TargetItemUri ? parseItemUri(backendModel.TargetItemUri) : undefined;
12096
- const targetPublicationUri = backendModel.TargetPublicationUri
12447
+ Object.defineProperty(this, "_addedItems", {
12448
+ enumerable: true,
12449
+ configurable: true,
12450
+ writable: true,
12451
+ value: void 0
12452
+ });
12453
+ Object.defineProperty(this, "_creator", {
12454
+ enumerable: true,
12455
+ configurable: true,
12456
+ writable: true,
12457
+ value: void 0
12458
+ });
12459
+ Object.defineProperty(this, "_configurationItemUri", {
12460
+ enumerable: true,
12461
+ configurable: true,
12462
+ writable: true,
12463
+ value: void 0
12464
+ });
12465
+ Object.defineProperty(this, "_displayState", {
12466
+ enumerable: true,
12467
+ configurable: true,
12468
+ writable: true,
12469
+ value: void 0
12470
+ });
12471
+ Object.defineProperty(this, "_errors", {
12472
+ enumerable: true,
12473
+ configurable: true,
12474
+ writable: true,
12475
+ value: void 0
12476
+ });
12477
+ Object.defineProperty(this, "_errorSeverityLevel", {
12478
+ enumerable: true,
12479
+ configurable: true,
12480
+ writable: true,
12481
+ value: void 0
12482
+ });
12483
+ Object.defineProperty(this, "_language", {
12484
+ enumerable: true,
12485
+ configurable: true,
12486
+ writable: true,
12487
+ value: void 0
12488
+ });
12489
+ Object.defineProperty(this, "_priority", {
12490
+ enumerable: true,
12491
+ configurable: true,
12492
+ writable: true,
12493
+ value: void 0
12494
+ });
12495
+ Object.defineProperty(this, "_revisor", {
12496
+ enumerable: true,
12497
+ configurable: true,
12498
+ writable: true,
12499
+ value: void 0
12500
+ });
12501
+ Object.defineProperty(this, "_state", {
12502
+ enumerable: true,
12503
+ configurable: true,
12504
+ writable: true,
12505
+ value: void 0
12506
+ });
12507
+ Object.defineProperty(this, "_targetLanguages", {
12508
+ enumerable: true,
12509
+ configurable: true,
12510
+ writable: true,
12511
+ value: void 0
12512
+ });
12513
+ Object.defineProperty(this, "_type", {
12514
+ enumerable: true,
12515
+ configurable: true,
12516
+ writable: true,
12517
+ value: void 0
12518
+ });
12519
+ Object.defineProperty(this, "_workflowStatus", {
12520
+ enumerable: true,
12521
+ configurable: true,
12522
+ writable: true,
12523
+ value: void 0
12524
+ });
12525
+ Object.defineProperty(this, "_creationDate", {
12526
+ enumerable: true,
12527
+ configurable: true,
12528
+ writable: true,
12529
+ value: void 0
12530
+ });
12531
+ Object.defineProperty(this, "_requiredDate", {
12532
+ enumerable: true,
12533
+ configurable: true,
12534
+ writable: true,
12535
+ value: void 0
12536
+ });
12537
+ Object.defineProperty(this, "_revisionDate", {
12538
+ enumerable: true,
12539
+ configurable: true,
12540
+ writable: true,
12541
+ value: void 0
12542
+ });
12543
+ Object.defineProperty(this, "_contextRepository", {
12544
+ enumerable: true,
12545
+ configurable: true,
12546
+ writable: true,
12547
+ value: void 0
12548
+ });
12549
+ Object.defineProperty(this, "getOriginalInternalModel", {
12550
+ enumerable: true,
12551
+ configurable: true,
12552
+ writable: true,
12553
+ value: () => {
12554
+ const originalId = typeof this._id.itemId === 'number' ? this._id.itemId : undefined;
12555
+ return {
12556
+ ...this._backendModel,
12557
+ $type: 'TranslationJob',
12558
+ Id: originalId,
12559
+ };
12560
+ }
12561
+ });
12562
+ Object.defineProperty(this, "getInternalModel", {
12563
+ enumerable: true,
12564
+ configurable: true,
12565
+ writable: true,
12566
+ value: () => {
12567
+ return this._backendModel;
12568
+ }
12569
+ });
12570
+ this._backendModel = backendModel;
12571
+ this._addedItems = addedItems;
12572
+ this._creator = creator;
12573
+ this._configurationItemUri = configurationItemUri;
12574
+ this._displayState = displayState;
12575
+ this._errors = errors;
12576
+ this._errorSeverityLevel = errorSeverityLevel;
12577
+ this._language = language;
12578
+ this._priority = priority;
12579
+ this._revisor = revisor;
12580
+ this._state = state;
12581
+ this._targetLanguages = targetLanguages;
12582
+ this._type = type;
12583
+ this._workflowStatus = workflowStatus;
12584
+ this._creationDate = creationDate;
12585
+ this._requiredDate = requiredDate;
12586
+ this._revisionDate = revisionDate;
12587
+ this._contextRepository = contextRepository;
12588
+ }
12589
+ get title() {
12590
+ return this._backendModel.Title;
12591
+ }
12592
+ /**
12593
+ * Collection containing the `AddedItem`s that have been added to this Translation Job.
12594
+ * The `AddedItem`s represent either an Item that will be translated (for example a Component) or
12595
+ * an Item that contains the Items that will be translated (for example a Folder).
12596
+ */
12597
+ get addedItems() {
12598
+ return this._addedItems;
12599
+ }
12600
+ /**
12601
+ * TCM URI of the item containing the `TranslationConfiguration` used for this Translation Job.
12602
+ */
12603
+ get configurationItemUri() {
12604
+ return this._configurationItemUri;
12605
+ }
12606
+ /**
12607
+ * Link to the Context Repository.
12608
+ */
12609
+ get contextRepository() {
12610
+ return this._contextRepository;
12611
+ }
12612
+ /**
12613
+ * The date the Translation Job was created (in UTC).
12614
+ */
12615
+ get creationDate() {
12616
+ return this._creationDate;
12617
+ }
12618
+ /**
12619
+ * A link to the user who created the Translation Job.
12620
+ */
12621
+ get creator() {
12622
+ return this._creator;
12623
+ }
12624
+ get displayState() {
12625
+ return this._displayState;
12626
+ }
12627
+ /**
12628
+ * Collection of errors registered to this job.
12629
+ */
12630
+ get errors() {
12631
+ return this._errors;
12632
+ }
12633
+ get errorSeverityLevel() {
12634
+ return this._errorSeverityLevel;
12635
+ }
12636
+ get hasError() {
12637
+ return this._backendModel.HasError || false;
12638
+ }
12639
+ /**
12640
+ * Value indicating whether items that have already been translated should be included in the job.
12641
+ */
12642
+ get includeItemsAlreadyTranslated() {
12643
+ return this._backendModel.IncludeItemsAlreadyTranslated || false;
12644
+ }
12645
+ /**
12646
+ * Value indicating if the Translation Job currently have one or more `TranslationJobQuote`s awaiting authorization (see remarks).
12647
+ */
12648
+ get isAwaitingAuthorization() {
12649
+ return this._backendModel.IsAwaitingAuthorization || false;
12650
+ }
12651
+ get language() {
12652
+ return this._language;
12653
+ }
12654
+ /**
12655
+ * Metadata associated with the Translation Job.
12656
+ */
12657
+ get metadata() {
12658
+ return this._backendModel.Metadata;
12659
+ }
12660
+ /**
12661
+ * TCM URI of the metadata schema used for this Translation Job.
12662
+ */
12663
+ get metadataSchemaUri() {
12664
+ return this._backendModel.MetadataSchemaUri;
12665
+ }
12666
+ /**
12667
+ * The priority of the Translation Job. This value will only have an affect if `SupportsPriority` returns true.
12668
+ */
12669
+ get priority() {
12670
+ return this._priority;
12671
+ }
12672
+ get progressPercentage() {
12673
+ return this._backendModel.ProgressPercentage;
12674
+ }
12675
+ /**
12676
+ * The due date for this job.
12677
+ */
12678
+ get requiredDate() {
12679
+ return this._requiredDate;
12680
+ }
12681
+ get revisionDate() {
12682
+ return this._revisionDate;
12683
+ }
12684
+ /**
12685
+ * A link to the user who last modified the Translation Job.
12686
+ */
12687
+ get revisor() {
12688
+ return this._revisor;
12689
+ }
12690
+ get state() {
12691
+ return this._state;
12692
+ }
12693
+ /**
12694
+ * Show if `TranslationJob` support setting of priority.
12695
+ */
12696
+ get supportsPriority() {
12697
+ return this._backendModel.SupportsPriority || false;
12698
+ }
12699
+ /**
12700
+ * Show if `TranslationJob` support setting required rate.
12701
+ */
12702
+ get supportsRequiredDate() {
12703
+ return this._backendModel.SupportsRequiredDate || false;
12704
+ }
12705
+ /**
12706
+ * List of target languages available for this `TranslationJob`.
12707
+ */
12708
+ get targetLanguages() {
12709
+ return this._targetLanguages;
12710
+ }
12711
+ /**
12712
+ * Value indicating if the Translation Job is a translation to the Publication of the `ConfigurationItemUri`
12713
+ * (Pull job) or from the Publication (Push job).
12714
+ */
12715
+ get type() {
12716
+ return this._type;
12717
+ }
12718
+ /**
12719
+ * Item count of language/workflowstep pairs.
12720
+ */
12721
+ get workflowStatus() {
12722
+ return this._workflowStatus;
12723
+ }
12724
+ }
12725
+
12726
+ class TranslationResolvedItem {
12727
+ constructor({ backendModel, sourceItem, targetLanguages }) {
12728
+ Object.defineProperty(this, "_backendModel", {
12729
+ enumerable: true,
12730
+ configurable: true,
12731
+ writable: true,
12732
+ value: void 0
12733
+ });
12734
+ Object.defineProperty(this, "_sourceItem", {
12735
+ enumerable: true,
12736
+ configurable: true,
12737
+ writable: true,
12738
+ value: void 0
12739
+ });
12740
+ Object.defineProperty(this, "_targetLanguages", {
12741
+ enumerable: true,
12742
+ configurable: true,
12743
+ writable: true,
12744
+ value: void 0
12745
+ });
12746
+ Object.defineProperty(this, "getInternalModel", {
12747
+ enumerable: true,
12748
+ configurable: true,
12749
+ writable: true,
12750
+ value: () => {
12751
+ return this._backendModel;
12752
+ }
12753
+ });
12754
+ this._backendModel = backendModel;
12755
+ this._targetLanguages = targetLanguages;
12756
+ this._sourceItem = sourceItem;
12757
+ }
12758
+ get isValidForTranslation() {
12759
+ return !!this._backendModel.IsValidForTranslation;
12760
+ }
12761
+ get comment() {
12762
+ return this._backendModel.Comment;
12763
+ }
12764
+ get sourceItem() {
12765
+ return this._sourceItem;
12766
+ }
12767
+ get targetLanguages() {
12768
+ return this._targetLanguages;
12769
+ }
12770
+ }
12771
+
12772
+ const mapTargetLanguageConstructorArgs = (mappingRegistry, backendModel) => {
12773
+ const availableWorkflows = backendModel.AvailableWorkflows?.map(w => mappingRegistry.map(w)).filter(isDefined);
12774
+ const selectedWorkflow = backendModel.SelectedWorkflow
12775
+ ? mappingRegistry.map(backendModel.SelectedWorkflow)
12776
+ : undefined;
12777
+ const targetPublications = backendModel.TargetPublications?.map(p => mappingRegistry.map(p)).filter(isDefined);
12778
+ return { availableWorkflows, selectedWorkflow, targetPublications };
12779
+ };
12780
+ const targetLanguageMapping = {
12781
+ identifier: backendModel => backendModel?.$type === 'TargetLanguage' || backendModel?.$type === 'ResolvedItemTargetLanguage',
12782
+ mapper: (mappingRegistry, backendModel) => {
12783
+ const { availableWorkflows, selectedWorkflow, targetPublications } = mapTargetLanguageConstructorArgs(mappingRegistry, backendModel);
12784
+ return new TargetLanguage({
12785
+ availableWorkflows,
12786
+ backendModel,
12787
+ selectedWorkflow,
12788
+ targetPublications,
12789
+ });
12790
+ },
12791
+ };
12792
+
12793
+ const tmsLanguageMapping = {
12794
+ identifier: backendModel => backendModel?.$type === 'TmsLanguage',
12795
+ mapper: (mappingRegistry, backendModel) => {
12796
+ return new TmsLanguage(backendModel);
12797
+ },
12798
+ };
12799
+
12800
+ const mapTmsWorkflowConstructorArgs = (mappingRegistry, backendModel) => {
12801
+ const steps = backendModel.Steps?.map(s => mappingRegistry.map(s)).filter(isDefined);
12802
+ return { steps };
12803
+ };
12804
+ const tmsWorkflowMapping = {
12805
+ identifier: backendModel => backendModel?.$type === 'TmsWorkflow',
12806
+ mapper: (mappingRegistry, backendModel) => {
12807
+ const { steps } = mapTmsWorkflowConstructorArgs(mappingRegistry, backendModel);
12808
+ return new TmsWorkflow({ backendModel, steps });
12809
+ },
12810
+ };
12811
+
12812
+ const tmsWorkflowStepMapping = {
12813
+ identifier: backendModel => backendModel?.$type === 'TmsWorkflowStep',
12814
+ mapper: (mappingRegistry, backendModel) => {
12815
+ return new TmsWorkflowStep(backendModel);
12816
+ },
12817
+ };
12818
+
12819
+ const mapTranslationStatus = (backendModel) => {
12820
+ switch (backendModel) {
12821
+ case TranslationStatus.NOT_TRANSLATED:
12822
+ return 'notTranslated';
12823
+ case TranslationStatus.IN_PROGRESS:
12824
+ return 'inProgress';
12825
+ case TranslationStatus.UP_TO_DATE:
12826
+ return 'upToDate';
12827
+ case TranslationStatus.NEW_SOURCE_VERSION_EXISTS:
12828
+ return 'newSourceVersionExists';
12829
+ case TranslationStatus.NEW_TARGET_VERSION_EXISTS:
12830
+ return 'newTargetVersionExists';
12831
+ case TranslationStatus.UNKNOWN_BY_CLIENT:
12832
+ return 'unknownByClient';
12833
+ }
12834
+ };
12835
+ const mapTranslationStatusToBackend = (model) => {
12836
+ switch (model) {
12837
+ case 'notTranslated':
12838
+ return TranslationStatus.NOT_TRANSLATED;
12839
+ case 'inProgress':
12840
+ return TranslationStatus.IN_PROGRESS;
12841
+ case 'upToDate':
12842
+ return TranslationStatus.UP_TO_DATE;
12843
+ case 'newSourceVersionExists':
12844
+ return TranslationStatus.NEW_SOURCE_VERSION_EXISTS;
12845
+ case 'newTargetVersionExists':
12846
+ return TranslationStatus.NEW_TARGET_VERSION_EXISTS;
12847
+ case 'unknownByClient':
12848
+ return TranslationStatus.UNKNOWN_BY_CLIENT;
12849
+ }
12850
+ };
12851
+
12852
+ const mapTranslationDetailsConstructorArgs = (mappingRegistry, backendModel) => {
12853
+ const completedTranslationInfo = backendModel.CompletedTranslationInfo
12854
+ ? mappingRegistry.map(backendModel.CompletedTranslationInfo)
12855
+ : undefined;
12856
+ const inProgressTranslationInfo = backendModel.InProgressTranslationInfo?.map(tji => mappingRegistry.map(tji)).filter(isDefined);
12857
+ const sourceItemUri = backendModel.SourceItemUri ? parseItemUri(backendModel.SourceItemUri) : undefined;
12858
+ const sourcePublicationUri = backendModel.SourcePublicationUri
12859
+ ? parseItemUri(backendModel.SourcePublicationUri)
12860
+ : undefined;
12861
+ const status = backendModel.Status ? mapTranslationStatus(backendModel.Status) : undefined;
12862
+ const targetItemUri = backendModel.TargetItemUri ? parseItemUri(backendModel.TargetItemUri) : undefined;
12863
+ const targetPublicationUri = backendModel.TargetPublicationUri
12097
12864
  ? parseItemUri(backendModel.TargetPublicationUri)
12098
12865
  : undefined;
12099
12866
  return {
@@ -12107,7 +12874,7 @@ const mapTranslationDetailsConstructorArgs = (mappingRegistry, backendModel) =>
12107
12874
  };
12108
12875
  };
12109
12876
  const translationDetailsMapping = {
12110
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationDetails',
12877
+ identifier: backendModel => backendModel?.$type === 'TranslationDetails',
12111
12878
  mapper: (mappingRegistry, backendModel) => {
12112
12879
  const { completedTranslationInfo, inProgressTranslationInfo, sourceItemUri, sourcePublicationUri, status, targetItemUri, targetPublicationUri, } = mapTranslationDetailsConstructorArgs(mappingRegistry, backendModel);
12113
12880
  return new TranslationDetails({
@@ -12155,7 +12922,7 @@ const mapTranslationErrorDetailsConstructorArgs = (mappingRegistry, backendModel
12155
12922
  const severity = backendModel.Severity ? mapTranslationErrorSeverity(backendModel.Severity) : undefined;
12156
12923
  const itemSourceUri = backendModel.TcmItemSourceUri ? parseItemUri(backendModel.TcmItemSourceUri) : undefined;
12157
12924
  const itemTargetUri = backendModel.TcmItemTargetUri ? parseItemUri(backendModel.TcmItemTargetUri) : undefined;
12158
- const jobUri = backendModel.TmsJobId ? parseItemUri(backendModel.TmsJobId) : undefined;
12925
+ const jobUri = backendModel.JobId ? TmUri.create(backendModel.JobId) : undefined;
12159
12926
  return {
12160
12927
  exceptionDetails,
12161
12928
  itemSourceUri,
@@ -12165,7 +12932,7 @@ const mapTranslationErrorDetailsConstructorArgs = (mappingRegistry, backendModel
12165
12932
  };
12166
12933
  };
12167
12934
  const translationErrorDetailsMapping = {
12168
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationErrorDetails',
12935
+ identifier: backendModel => backendModel?.$type === 'ErrorDetails',
12169
12936
  mapper: (mappingRegistry, backendModel) => {
12170
12937
  const { exceptionDetails, itemSourceUri, itemTargetUri, jobUri, severity } = mapTranslationErrorDetailsConstructorArgs(mappingRegistry, backendModel);
12171
12938
  return new TranslationErrorDetails({
@@ -12186,7 +12953,7 @@ const mapTranslationExceptionDetailsConstructorArgs = (mappingRegistry, backendM
12186
12953
  return { innerException };
12187
12954
  };
12188
12955
  const translationExceptionDetailsMapping = {
12189
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationExceptionDetails',
12956
+ identifier: backendModel => backendModel?.$type === 'ExceptionDetails',
12190
12957
  mapper: (mappingRegistry, backendModel) => {
12191
12958
  const { innerException } = mapTranslationExceptionDetailsConstructorArgs(mappingRegistry, backendModel);
12192
12959
  return new TranslationExceptionDetails({ backendModel, innerException });
@@ -12194,18 +12961,17 @@ const translationExceptionDetailsMapping = {
12194
12961
  };
12195
12962
 
12196
12963
  const mapTranslationInfoConstructorArgs = (mappingRegistry, backendModel) => {
12197
- var _a;
12198
12964
  const contextLanguage = backendModel.ContextLanguage
12199
12965
  ? mappingRegistry.map(backendModel.ContextLanguage)
12200
12966
  : undefined;
12201
12967
  const translationFrom = backendModel.TranslationFrom
12202
12968
  ? mappingRegistry.map(backendModel.TranslationFrom)
12203
12969
  : undefined;
12204
- const translationTo = (_a = backendModel.TranslationTo) === null || _a === void 0 ? void 0 : _a.map(td => mappingRegistry.map(td)).filter(isDefined);
12970
+ const translationTo = backendModel.TranslationTo?.map(td => mappingRegistry.map(td)).filter(isDefined);
12205
12971
  return { contextLanguage, translationFrom, translationTo };
12206
12972
  };
12207
12973
  const translationInfoMapping = {
12208
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationInfo',
12974
+ identifier: backendModel => backendModel?.$type === 'TranslationInfo',
12209
12975
  mapper: (mappingRegistry, backendModel) => {
12210
12976
  const { contextLanguage, translationFrom, translationTo } = mapTranslationInfoConstructorArgs(mappingRegistry, backendModel);
12211
12977
  return new TranslationInfo({ backendModel, contextLanguage, translationFrom, translationTo });
@@ -12270,7 +13036,7 @@ const mapTranslationJobInfoConstructorArgs = (mappingRegistry, backendModel) =>
12270
13036
  };
12271
13037
  };
12272
13038
  const translationJobInfoMapping = {
12273
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationJobInfo',
13039
+ identifier: backendModel => backendModel?.$type === 'TranslationJobInfo',
12274
13040
  mapper: (mappingRegistry, backendModel) => {
12275
13041
  const { retrievedFromTranslationDate, retrieveReason, sendForTranslationDate, sourceItemUri, sourcePublicationUri, sourceRevisionDate, targetItemUri, targetRevisionDate, } = mapTranslationJobInfoConstructorArgs(mappingRegistry, backendModel);
12276
13042
  return new TranslationJobInfo({
@@ -12288,13 +13054,12 @@ const translationJobInfoMapping = {
12288
13054
  };
12289
13055
 
12290
13056
  const mapTranslationJobItemConstructorArgs = (mappingRegistry, backendModel) => {
12291
- var _a;
12292
13057
  const idRef = backendModel.IdRef ? parseItemUri(backendModel.IdRef) : undefined;
12293
- const resolveOptions = (_a = backendModel.ResolveOptions) === null || _a === void 0 ? void 0 : _a.map(o => mapResolveOptions(o));
13058
+ const resolveOptions = backendModel.ResolveOptions?.map(o => mapResolveOptions(o));
12294
13059
  return { idRef, resolveOptions };
12295
13060
  };
12296
13061
  const translationJobItemMapping = {
12297
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AddedItem',
13062
+ identifier: backendModel => backendModel?.$type === 'AddedItem',
12298
13063
  mapper: (mappingRegistry, backendModel) => {
12299
13064
  const { idRef, resolveOptions } = mapTranslationJobItemConstructorArgs(mappingRegistry, backendModel);
12300
13065
  return new TranslationJobItem({ backendModel, idRef, resolveOptions });
@@ -12401,8 +13166,7 @@ const mapTranslationJobTypeToBackend = (model) => {
12401
13166
  };
12402
13167
 
12403
13168
  const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12404
- var _a, _b, _c, _d, _e;
12405
- const addedItems = (_a = backendModel.AddedItems) === null || _a === void 0 ? void 0 : _a.map(i => mappingRegistry.map(i)).filter(isDefined);
13169
+ const addedItems = backendModel.AddedItems?.map(i => mappingRegistry.map(i)).filter(isDefined);
12406
13170
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
12407
13171
  const configurationItemUri = backendModel.ConfigurationItemUri
12408
13172
  ? parseItemUri(backendModel.ConfigurationItemUri)
@@ -12410,7 +13174,7 @@ const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12410
13174
  const displayState = backendModel.DisplayState
12411
13175
  ? mapTranslationJobDisplayState(backendModel.DisplayState)
12412
13176
  : undefined;
12413
- const errors = (_b = backendModel.Errors) === null || _b === void 0 ? void 0 : _b.map(e => mappingRegistry.map(e)).filter(isDefined);
13177
+ const errors = backendModel.Errors?.map(e => mappingRegistry.map(e)).filter(isDefined);
12414
13178
  const errorSeverityLevel = backendModel.ErrorSeverityLevel
12415
13179
  ? mapTranslationErrorSeverity(backendModel.ErrorSeverityLevel)
12416
13180
  : undefined;
@@ -12418,12 +13182,15 @@ const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12418
13182
  const priority = backendModel.Priority ? mapTranslationJobPriority(backendModel.Priority) : undefined;
12419
13183
  const revisor = backendModel.Revisor ? mappingRegistry.map(backendModel.Revisor) : undefined;
12420
13184
  const state = backendModel.State ? mapTranslationJobState(backendModel.State) : undefined;
12421
- const targetLanguages = (_c = backendModel.TargetLanguages) === null || _c === void 0 ? void 0 : _c.map(l => mappingRegistry.map(l)).filter(isDefined);
12422
- const type = (_d = backendModel.Type) === null || _d === void 0 ? void 0 : _d.map(t => mapTranslationJobType(t));
12423
- const workflowStatus = (_e = backendModel.WorkflowStatus) === null || _e === void 0 ? void 0 : _e.map(s => mappingRegistry.map(s)).filter(isDefined);
13185
+ const targetLanguages = backendModel.TargetLanguages?.map(l => mappingRegistry.map(l)).filter(isDefined);
13186
+ const type = backendModel.Type?.map(t => mapTranslationJobType(t));
13187
+ const workflowStatus = backendModel.WorkflowStatus?.map(s => mappingRegistry.map(s)).filter(isDefined);
12424
13188
  const creationDate = backendModel.CreationDate ? mapDate(backendModel.CreationDate) : undefined;
12425
13189
  const requiredDate = backendModel.RequiredDate ? mapDate(backendModel.RequiredDate) : undefined;
12426
13190
  const revisionDate = backendModel.RevisionDate ? mapDate(backendModel.RevisionDate) : undefined;
13191
+ const contextRepository = backendModel.ContextRepository
13192
+ ? mappingRegistry.map(backendModel.ContextRepository)
13193
+ : undefined;
12427
13194
  return {
12428
13195
  addedItems,
12429
13196
  configurationItemUri,
@@ -12441,12 +13208,13 @@ const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12441
13208
  targetLanguages,
12442
13209
  type,
12443
13210
  workflowStatus,
13211
+ contextRepository,
12444
13212
  };
12445
13213
  };
12446
13214
  const translationJobMapping = {
12447
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationJob',
13215
+ identifier: backendModel => backendModel?.$type === 'TranslationJob',
12448
13216
  mapper: (mappingRegistry, backendModel) => {
12449
- const { addedItems, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, revisor, state, targetLanguages, type, workflowStatus, requiredDate, revisionDate, } = mapTranslationJobConstructorArgs(mappingRegistry, backendModel);
13217
+ const { addedItems, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, revisor, state, targetLanguages, type, workflowStatus, requiredDate, revisionDate, contextRepository, } = mapTranslationJobConstructorArgs(mappingRegistry, backendModel);
12450
13218
  return new TranslationJob({
12451
13219
  addedItems,
12452
13220
  backendModel,
@@ -12465,6 +13233,7 @@ const translationJobMapping = {
12465
13233
  targetLanguages,
12466
13234
  type,
12467
13235
  workflowStatus,
13236
+ contextRepository,
12468
13237
  });
12469
13238
  },
12470
13239
  };
@@ -12477,7 +13246,7 @@ const mapTranslationTargetPublicationConstructorArgs = (mappingRegistry, backend
12477
13246
  return { configurationItemUri, idRef };
12478
13247
  };
12479
13248
  const translationTargetPublicationMapping = {
12480
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetPublication',
13249
+ identifier: backendModel => backendModel?.$type === 'TargetPublication',
12481
13250
  mapper: (mappingRegistry, backendModel) => {
12482
13251
  const { configurationItemUri, idRef } = mapTranslationTargetPublicationConstructorArgs(mappingRegistry, backendModel);
12483
13252
  return new TranslationTargetPublication({ backendModel, configurationItemUri, idRef });
@@ -12492,20 +13261,79 @@ const mapTranslationWorkflowStatusConstructorArgs = (mappingRegistry, backendMod
12492
13261
  return { language, workflowStep };
12493
13262
  };
12494
13263
  const translationWorkflowStatusMapping = {
12495
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationWorkflowStatus',
13264
+ identifier: backendModel => backendModel?.$type === 'TranslationWorkflowStatus',
12496
13265
  mapper: (mappingRegistry, backendModel) => {
12497
13266
  const { language, workflowStep } = mapTranslationWorkflowStatusConstructorArgs(mappingRegistry, backendModel);
12498
13267
  return new TranslationWorkflowStatus({ backendModel, language, workflowStep });
12499
13268
  },
12500
13269
  };
12501
13270
 
13271
+ const mapIdentifiableTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
13272
+ const virtualId = backendModel.Id ? TmUri.create(backendModel.Id) : TcmUri.null;
13273
+ const backendTranslationJobWithId = {
13274
+ ...backendModel,
13275
+ Id: virtualId.asString,
13276
+ };
13277
+ return {
13278
+ ...mapTranslationJobConstructorArgs(mappingRegistry, backendModel),
13279
+ ...mapIdentifiableObjectConstructorArgs(mappingRegistry, backendTranslationJobWithId),
13280
+ };
13281
+ };
13282
+ const identifiableTranslationJobMapping = {
13283
+ identifier: backendModel => backendModel?.$type === 'IdentifiableTranslationJob',
13284
+ mapper: (mappingRegistry, backendModel) => {
13285
+ const { addedItems, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, revisor, state, targetLanguages, type, workflowStatus, requiredDate, revisionDate, ...identifiableObjectProps } = mapIdentifiableTranslationJobConstructorArgs(mappingRegistry, backendModel);
13286
+ return new IdentifiableTranslationJob({
13287
+ ...identifiableObjectProps,
13288
+ addedItems,
13289
+ backendModel: {
13290
+ ...backendModel,
13291
+ Id: identifiableObjectProps.id.asString,
13292
+ },
13293
+ configurationItemUri,
13294
+ creationDate,
13295
+ creator,
13296
+ displayState,
13297
+ errors,
13298
+ errorSeverityLevel,
13299
+ language,
13300
+ priority,
13301
+ requiredDate,
13302
+ revisionDate,
13303
+ revisor,
13304
+ state,
13305
+ targetLanguages,
13306
+ type,
13307
+ workflowStatus,
13308
+ });
13309
+ },
13310
+ };
13311
+
13312
+ const mapTranslationResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
13313
+ const sourceItem = backendModel.SourceItem
13314
+ ? mappingRegistry.map(backendModel.SourceItem)
13315
+ : undefined;
13316
+ const targetLanguages = backendModel.TargetLanguages?.map(tl => mappingRegistry.map(tl)).filter(isDefined);
13317
+ return { sourceItem, targetLanguages };
13318
+ };
13319
+ const translationResolvedItemMapping = {
13320
+ identifier: backendModel => backendModel?.$type === 'TmResolvedItem',
13321
+ mapper: (mappingRegistry, backendModel) => {
13322
+ const { sourceItem, targetLanguages } = mapTranslationResolvedItemConstructorArgs(mappingRegistry, backendModel);
13323
+ return new TranslationResolvedItem({
13324
+ backendModel,
13325
+ sourceItem,
13326
+ targetLanguages,
13327
+ });
13328
+ },
13329
+ };
13330
+
12502
13331
  /**
12503
13332
  * Abstract base class for the data of "Trustees": the data of Users or Groups.
12504
13333
  */
12505
13334
  class Trustee extends SystemWideObject {
12506
- constructor(_a) {
12507
- var { backendModel, groupMemberships } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "groupMemberships"]);
12508
- super(Object.assign({ backendModel }, systemWideObjectArgs));
13335
+ constructor({ backendModel, groupMemberships, ...systemWideObjectArgs }) {
13336
+ super({ backendModel, ...systemWideObjectArgs });
12509
13337
  Object.defineProperty(this, "_groupMemberships", {
12510
13338
  enumerable: true,
12511
13339
  configurable: true,
@@ -12543,9 +13371,8 @@ class Trustee extends SystemWideObject {
12543
13371
  }
12544
13372
 
12545
13373
  class User extends Trustee {
12546
- constructor(_a) {
12547
- var { backendModel } = _a, trusteeArgs = __rest(_a, ["backendModel"]);
12548
- super(Object.assign({ backendModel }, trusteeArgs));
13374
+ constructor({ backendModel, ...trusteeArgs }) {
13375
+ super({ backendModel, ...trusteeArgs });
12549
13376
  Object.defineProperty(this, "getInternalModel", {
12550
13377
  enumerable: true,
12551
13378
  configurable: true,
@@ -12582,9 +13409,8 @@ class User extends Trustee {
12582
13409
  }
12583
13410
 
12584
13411
  class AccessToken extends User {
12585
- constructor(_a) {
12586
- var { backendModel, inheritedSystemPrivileges } = _a, userArgs = __rest(_a, ["backendModel", "inheritedSystemPrivileges"]);
12587
- super(Object.assign({ backendModel }, userArgs));
13412
+ constructor({ backendModel, inheritedSystemPrivileges, ...userArgs }) {
13413
+ super({ backendModel, ...userArgs });
12588
13414
  Object.defineProperty(this, "_backendModel", {
12589
13415
  enumerable: true,
12590
13416
  configurable: true,
@@ -12731,9 +13557,8 @@ class UserFavoriteLink {
12731
13557
  * Represents a data of Group of Users.
12732
13558
  */
12733
13559
  class UserGroup extends Trustee {
12734
- constructor(_a) {
12735
- var { backendModel, inheritedSystemPrivileges, scope, systemPrivileges } = _a, trusteeArgs = __rest(_a, ["backendModel", "inheritedSystemPrivileges", "scope", "systemPrivileges"]);
12736
- super(Object.assign({ backendModel }, trusteeArgs));
13560
+ constructor({ backendModel, inheritedSystemPrivileges, scope, systemPrivileges, ...trusteeArgs }) {
13561
+ super({ backendModel, ...trusteeArgs });
12737
13562
  Object.defineProperty(this, "_scope", {
12738
13563
  enumerable: true,
12739
13564
  configurable: true,
@@ -13057,9 +13882,8 @@ class UserRuntimeInfo {
13057
13882
  }
13058
13883
 
13059
13884
  const mapTrusteeConstructorArgs = (mappingRegistry, backendModel) => {
13060
- var _a;
13061
13885
  const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo } = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
13062
- const groupMemberships = (_a = backendModel.GroupMemberships) === null || _a === void 0 ? void 0 : _a.map(m => mappingRegistry.map(m)).filter(isDefined);
13886
+ const groupMemberships = backendModel.GroupMemberships?.map(m => mappingRegistry.map(m)).filter(isDefined);
13063
13887
  return {
13064
13888
  applicableActions,
13065
13889
  basicVersionInfo,
@@ -13074,7 +13898,7 @@ const mapTrusteeConstructorArgs = (mappingRegistry, backendModel) => {
13074
13898
 
13075
13899
  const mapUserConstructorArgs = mapTrusteeConstructorArgs;
13076
13900
  const userMapping = {
13077
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'User',
13901
+ identifier: backendModel => backendModel?.$type === 'User',
13078
13902
  mapper: (mappingRegistry, backendModel) => {
13079
13903
  const { groupMemberships, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapUserConstructorArgs(mappingRegistry, backendModel);
13080
13904
  return new User({
@@ -13096,10 +13920,13 @@ const mapAccessTokenConstructorArgs = (mappingRegistry, backendModel) => {
13096
13920
  const inheritedSystemPrivileges = backendModel.InheritedSystemPrivileges
13097
13921
  ? mappingRegistry.map(backendModel.InheritedSystemPrivileges)
13098
13922
  : undefined;
13099
- return Object.assign(Object.assign({}, userProps), { inheritedSystemPrivileges });
13923
+ return {
13924
+ ...userProps,
13925
+ inheritedSystemPrivileges,
13926
+ };
13100
13927
  };
13101
13928
  const accessTokenMapping = {
13102
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AccessToken',
13929
+ identifier: backendModel => backendModel?.$type === 'AccessToken',
13103
13930
  mapper: (mappingRegistry, backendModel) => {
13104
13931
  const { applicableActions, basicVersionInfo, groupMemberships, id, inheritedSystemPrivileges, listLinks, loadInfo, securityDescriptor, listInfo, } = mapAccessTokenConstructorArgs(mappingRegistry, backendModel);
13105
13932
  return new AccessToken({
@@ -13118,13 +13945,12 @@ const accessTokenMapping = {
13118
13945
  };
13119
13946
 
13120
13947
  const mapGroupMembershipConstructorArgs = (mappingRegistry, backendModel) => {
13121
- var _a;
13122
13948
  const group = backendModel.Group ? mappingRegistry.map(backendModel.Group) : undefined;
13123
- const scope = (_a = backendModel.Scope) === null || _a === void 0 ? void 0 : _a.map(s => mappingRegistry.map(s)).filter(isDefined);
13949
+ const scope = backendModel.Scope?.map(s => mappingRegistry.map(s)).filter(isDefined);
13124
13950
  return { group, scope };
13125
13951
  };
13126
13952
  const groupMembershipMapping = {
13127
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'GroupMembership',
13953
+ identifier: backendModel => backendModel?.$type === 'GroupMembership',
13128
13954
  mapper: (mappingRegistry, backendModel) => {
13129
13955
  const { group, scope } = mapGroupMembershipConstructorArgs(mappingRegistry, backendModel);
13130
13956
  return new GroupMembership({ backendModel, group, scope });
@@ -13136,7 +13962,7 @@ const mapUserFavoriteLinkConstructorArgs = (mappingRegistry, backendModel) => {
13136
13962
  return { idRef };
13137
13963
  };
13138
13964
  const userFavoriteLinkMapping = {
13139
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FavoriteLink',
13965
+ identifier: backendModel => backendModel?.$type === 'FavoriteLink',
13140
13966
  mapper: (mappingRegistry, backendModel) => {
13141
13967
  const { idRef } = mapUserFavoriteLinkConstructorArgs(mappingRegistry, backendModel);
13142
13968
  return new UserFavoriteLink({ backendModel, idRef });
@@ -13144,19 +13970,21 @@ const userFavoriteLinkMapping = {
13144
13970
  };
13145
13971
 
13146
13972
  const mapUserGroupConstructorArgs = (mappingRegistry, backendModel) => {
13147
- var _a, _b;
13148
13973
  const trusteeConstructorArgs = mapTrusteeConstructorArgs(mappingRegistry, backendModel);
13149
- const scope = (_a = backendModel.Scope) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
13150
- const systemPrivileges = (_b = backendModel.SystemPrivileges) === null || _b === void 0 ? void 0 : _b.map(k => mappingRegistry.map(k)).filter(isDefined);
13974
+ const scope = backendModel.Scope?.map(k => mappingRegistry.map(k)).filter(isDefined);
13975
+ const systemPrivileges = backendModel.SystemPrivileges?.map(k => mappingRegistry.map(k)).filter(isDefined);
13151
13976
  const inheritedSystemPrivileges = backendModel.InheritedSystemPrivileges
13152
13977
  ? mappingRegistry.map(backendModel.InheritedSystemPrivileges)
13153
13978
  : undefined;
13154
- return Object.assign(Object.assign({}, trusteeConstructorArgs), { scope,
13979
+ return {
13980
+ ...trusteeConstructorArgs,
13981
+ scope,
13155
13982
  systemPrivileges,
13156
- inheritedSystemPrivileges });
13983
+ inheritedSystemPrivileges,
13984
+ };
13157
13985
  };
13158
13986
  const userGroupMapping = {
13159
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Group',
13987
+ identifier: backendModel => backendModel?.$type === 'Group',
13160
13988
  mapper: (mappingRegistry, backendModel) => {
13161
13989
  const { applicableActions, basicVersionInfo, groupMemberships, id, inheritedSystemPrivileges, listLinks, loadInfo, scope, securityDescriptor, systemPrivileges, listInfo, } = mapUserGroupConstructorArgs(mappingRegistry, backendModel);
13162
13990
  return new UserGroup({
@@ -13177,7 +14005,7 @@ const userGroupMapping = {
13177
14005
  };
13178
14006
 
13179
14007
  const userLocaleInfoMapping = {
13180
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserLocaleInfo',
14008
+ identifier: backendModel => backendModel?.$type === 'UserLocaleInfo',
13181
14009
  mapper: (mappingRegistry, backendModel) => new UserLocaleInfo(backendModel),
13182
14010
  };
13183
14011
 
@@ -13190,12 +14018,13 @@ const isValidFavoriteLink = (link) => {
13190
14018
  return true;
13191
14019
  };
13192
14020
  const mapUserPreferencesConstructorArgs = (mappingRegistry, backendModel) => {
13193
- var _a;
13194
- const favorites = ((_a = backendModel.Favorites) === null || _a === void 0 ? void 0 : _a.filter(isValidFavoriteLink).map(link => mappingRegistry.map(link)).filter(isDefined)) || [];
14021
+ const favorites = backendModel.Favorites?.filter(isValidFavoriteLink)
14022
+ .map(link => mappingRegistry.map(link))
14023
+ .filter(isDefined) || [];
13195
14024
  return { favorites };
13196
14025
  };
13197
14026
  const userPreferencesMapping = {
13198
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserPreferences',
14027
+ identifier: backendModel => backendModel?.$type === 'UserPreferences',
13199
14028
  mapper: (mappingRegistry, backendModel) => {
13200
14029
  const { favorites } = mapUserPreferencesConstructorArgs(mappingRegistry, backendModel);
13201
14030
  return new UserPreferences({ backendModel, favorites });
@@ -13211,7 +14040,7 @@ const mapUserProfileConstructorArgs = (mappingRegistry, backendModel) => {
13211
14040
  return { preferences, runtimeInfo, user };
13212
14041
  };
13213
14042
  const userProfileMapping = {
13214
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserProfile',
14043
+ identifier: backendModel => backendModel?.$type === 'UserProfile',
13215
14044
  mapper: (mappingRegistry, backendModel) => {
13216
14045
  const { preferences, runtimeInfo, user } = mapUserProfileConstructorArgs(mappingRegistry, backendModel);
13217
14046
  return new UserProfile({ backendModel, preferences, runtimeInfo, user });
@@ -13223,7 +14052,7 @@ const mapUserRuntimeInfoConstructorArgs = (mappingRegistry, backendModel) => {
13223
14052
  return { locale };
13224
14053
  };
13225
14054
  const userUserRuntimeInfoMapping = {
13226
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserRuntimeInfo',
14055
+ identifier: backendModel => backendModel?.$type === 'UserRuntimeInfo',
13227
14056
  mapper: (mappingRegistry, backendModel) => {
13228
14057
  const { locale } = mapUserRuntimeInfoConstructorArgs(mappingRegistry, backendModel);
13229
14058
  return new UserRuntimeInfo({ backendModel, locale });
@@ -13249,9 +14078,8 @@ const mapActivityConstraints = (backendModel) => {
13249
14078
  * Abstract Base class for the data of workflow items except for "ProcessDefinition" and "ApprovalStatus".
13250
14079
  */
13251
14080
  class WorkflowObject extends IdentifiableObject {
13252
- constructor(_a) {
13253
- var { backendModel, contextRepository } = _a, identifiableObjectArgs = __rest(_a, ["backendModel", "contextRepository"]);
13254
- super(Object.assign({ backendModel }, identifiableObjectArgs));
14081
+ constructor({ backendModel, contextRepository, ...identifiableObjectArgs }) {
14082
+ super({ backendModel, ...identifiableObjectArgs });
13255
14083
  Object.defineProperty(this, "_contextRepository", {
13256
14084
  enumerable: true,
13257
14085
  configurable: true,
@@ -13280,9 +14108,8 @@ class WorkflowObject extends IdentifiableObject {
13280
14108
  * Abstract base class for the data of Activities.
13281
14109
  */
13282
14110
  class Activity extends WorkflowObject {
13283
- constructor(_a) {
13284
- var { assignee, assignmentDate, backendModel, dueDate, finishDate, owner, primarySubject, process, startDate, suspendDate, workItems } = _a, workflowObjectArgs = __rest(_a, ["assignee", "assignmentDate", "backendModel", "dueDate", "finishDate", "owner", "primarySubject", "process", "startDate", "suspendDate", "workItems"]);
13285
- super(Object.assign({ backendModel }, workflowObjectArgs));
14111
+ constructor({ assignee, assignmentDate, backendModel, dueDate, finishDate, owner, primarySubject, process, startDate, suspendDate, workItems, ...workflowObjectArgs }) {
14112
+ super({ backendModel, ...workflowObjectArgs });
13286
14113
  Object.defineProperty(this, "_assignee", {
13287
14114
  enumerable: true,
13288
14115
  configurable: true,
@@ -13451,9 +14278,8 @@ class Activity extends WorkflowObject {
13451
14278
  }
13452
14279
 
13453
14280
  class ActivityDefinition extends WorkflowObject {
13454
- constructor(_a) {
13455
- var { backendModel, activityConstraints, assignee, processDefinition } = _a, workflowObjectArgs = __rest(_a, ["backendModel", "activityConstraints", "assignee", "processDefinition"]);
13456
- super(Object.assign({ backendModel }, workflowObjectArgs));
14281
+ constructor({ backendModel, activityConstraints, assignee, processDefinition, ...workflowObjectArgs }) {
14282
+ super({ backendModel, ...workflowObjectArgs });
13457
14283
  Object.defineProperty(this, "_activityConstraints", {
13458
14284
  enumerable: true,
13459
14285
  configurable: true,
@@ -13521,9 +14347,8 @@ class ActivityDefinition extends WorkflowObject {
13521
14347
  * Representing data of the Activity History. This is the part of "ProcessHistory".
13522
14348
  */
13523
14349
  class ActivityHistory extends Activity {
13524
- constructor(_a) {
13525
- var { activityType, approvalStatus, backendModel } = _a, activityArgs = __rest(_a, ["activityType", "approvalStatus", "backendModel"]);
13526
- super(Object.assign({ backendModel }, activityArgs));
14350
+ constructor({ activityType, approvalStatus, backendModel, ...activityArgs }) {
14351
+ super({ backendModel, ...activityArgs });
13527
14352
  Object.defineProperty(this, "_activityType", {
13528
14353
  enumerable: true,
13529
14354
  configurable: true,
@@ -13577,9 +14402,8 @@ class ActivityHistory extends Activity {
13577
14402
  * Represents an Activity Instance: a current Activity which is part of a Process Instance.
13578
14403
  */
13579
14404
  class ActivityInstance extends Activity {
13580
- constructor(_a) {
13581
- var { backendModel, activityConstraints, activityDefinition, activityState, approvalStatus, processDefinition, workflowType } = _a, acticityArgs = __rest(_a, ["backendModel", "activityConstraints", "activityDefinition", "activityState", "approvalStatus", "processDefinition", "workflowType"]);
13582
- super(Object.assign({ backendModel }, acticityArgs));
14405
+ constructor({ backendModel, activityConstraints, activityDefinition, activityState, approvalStatus, processDefinition, workflowType, ...activityArgs }) {
14406
+ super({ backendModel, ...activityArgs });
13583
14407
  Object.defineProperty(this, "_activityConstraints", {
13584
14408
  enumerable: true,
13585
14409
  configurable: true,
@@ -13718,9 +14542,8 @@ class FinishActivityResult {
13718
14542
  * Abstract base class for the data of Processes.
13719
14543
  */
13720
14544
  class Process extends WorkflowObject {
13721
- constructor(_a) {
13722
- var { backendModel, activities, creator, subjects, workflowType } = _a, workflowObjectArgs = __rest(_a, ["backendModel", "activities", "creator", "subjects", "workflowType"]);
13723
- super(Object.assign({ backendModel }, workflowObjectArgs));
14545
+ constructor({ backendModel, activities, creator, subjects, workflowType, ...workflowObjectArgs }) {
14546
+ super({ backendModel, ...workflowObjectArgs });
13724
14547
  Object.defineProperty(this, "_activities", {
13725
14548
  enumerable: true,
13726
14549
  configurable: true,
@@ -13798,9 +14621,8 @@ class Process extends WorkflowObject {
13798
14621
  }
13799
14622
 
13800
14623
  class ProcessDefinition extends RepositoryLocalObject {
13801
- constructor(_a) {
13802
- var { backendModel, activityDefinitions } = _a, rloArgs = __rest(_a, ["backendModel", "activityDefinitions"]);
13803
- super(Object.assign({ backendModel }, rloArgs));
14624
+ constructor({ backendModel, activityDefinitions, ...rloArgs }) {
14625
+ super({ backendModel, ...rloArgs });
13804
14626
  Object.defineProperty(this, "_activityDefinitions", {
13805
14627
  enumerable: true,
13806
14628
  configurable: true,
@@ -13836,9 +14658,8 @@ class ProcessDefinition extends RepositoryLocalObject {
13836
14658
  * Representing data of a Process History.
13837
14659
  */
13838
14660
  class ProcessHistory extends Process {
13839
- constructor(_a) {
13840
- var { backendModel, finishReason, finishDate } = _a, processArgs = __rest(_a, ["backendModel", "finishReason", "finishDate"]);
13841
- super(Object.assign({ backendModel }, processArgs));
14661
+ constructor({ backendModel, finishReason, finishDate, ...processArgs }) {
14662
+ super({ backendModel, ...processArgs });
13842
14663
  Object.defineProperty(this, "_finishReason", {
13843
14664
  enumerable: true,
13844
14665
  configurable: true,
@@ -13886,9 +14707,8 @@ class ProcessHistory extends Process {
13886
14707
  * Represents the data of a Process Instance: a current Process.
13887
14708
  */
13888
14709
  class ProcessInstance extends Process {
13889
- constructor(_a) {
13890
- var { backendModel, processDefinition } = _a, processArgs = __rest(_a, ["backendModel", "processDefinition"]);
13891
- super(Object.assign({ backendModel }, processArgs));
14710
+ constructor({ backendModel, processDefinition, ...processArgs }) {
14711
+ super({ backendModel, ...processArgs });
13892
14712
  Object.defineProperty(this, "_processDefinition", {
13893
14713
  enumerable: true,
13894
14714
  configurable: true,
@@ -13923,9 +14743,8 @@ class ProcessInstance extends Process {
13923
14743
  * Represents the data of a Tridion proprietary Activity Definition.
13924
14744
  */
13925
14745
  class TridionActivityDefinition extends ActivityDefinition {
13926
- constructor(_a) {
13927
- var { backendModel, activityType, finishApprovalStatus, nextActivityDefinitions } = _a, activityDefinitionArgs = __rest(_a, ["backendModel", "activityType", "finishApprovalStatus", "nextActivityDefinitions"]);
13928
- super(Object.assign({ backendModel }, activityDefinitionArgs));
14746
+ constructor({ backendModel, activityType, finishApprovalStatus, nextActivityDefinitions, ...activityDefinitionArgs }) {
14747
+ super({ backendModel, ...activityDefinitionArgs });
13929
14748
  Object.defineProperty(this, "_activityType", {
13930
14749
  enumerable: true,
13931
14750
  configurable: true,
@@ -14050,8 +14869,7 @@ class TridionProcessDefinition extends ProcessDefinition {
14050
14869
  * A Microsoft Visio diagram, or an empty byte array.
14051
14870
  */
14052
14871
  get diagram() {
14053
- var _a;
14054
- if ((_a = this._backendModel.Diagram) === null || _a === void 0 ? void 0 : _a.length) {
14872
+ if (this._backendModel.Diagram?.length) {
14055
14873
  return this._backendModel.Diagram;
14056
14874
  }
14057
14875
  return undefined;
@@ -14242,9 +15060,8 @@ class WorkflowInfo {
14242
15060
  * Represents the data of a Work Item: the association between an item participating in workflow and an Activity.
14243
15061
  */
14244
15062
  class WorkItem extends WorkflowObject {
14245
- constructor(_a) {
14246
- var { backendModel, activity, owner, process, subject, subjectOwningRepository } = _a, workflowObjectArgs = __rest(_a, ["backendModel", "activity", "owner", "process", "subject", "subjectOwningRepository"]);
14247
- super(Object.assign({ backendModel }, workflowObjectArgs));
15063
+ constructor({ backendModel, activity, owner, process, subject, subjectOwningRepository, ...workflowObjectArgs }) {
15064
+ super({ backendModel, ...workflowObjectArgs });
14248
15065
  Object.defineProperty(this, "_activity", {
14249
15066
  enumerable: true,
14250
15067
  configurable: true,
@@ -14343,7 +15160,10 @@ const mapWorkflowObjectConstructorArgs = (mappingRegistry, backendModel) => {
14343
15160
  const contextRepository = backendModel.ContextRepository
14344
15161
  ? mappingRegistry.map(backendModel.ContextRepository)
14345
15162
  : undefined;
14346
- return Object.assign(Object.assign({}, identifiableObjectConstructorArgs), { contextRepository });
15163
+ return {
15164
+ ...identifiableObjectConstructorArgs,
15165
+ contextRepository,
15166
+ };
14347
15167
  };
14348
15168
 
14349
15169
  const mapActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
@@ -14370,14 +15190,16 @@ const mapActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) =>
14370
15190
  };
14371
15191
  };
14372
15192
  const activityDefinitionMapping = {
14373
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityDefinition',
15193
+ identifier: backendModel => backendModel?.$type === 'ActivityDefinition',
14374
15194
  mapper: (mappingRegistry, backendModel) => {
14375
- return new ActivityDefinition(Object.assign(Object.assign({}, mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
15195
+ return new ActivityDefinition({
15196
+ ...mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel),
15197
+ backendModel,
15198
+ });
14376
15199
  },
14377
15200
  };
14378
15201
 
14379
15202
  const mapActivityConstructorArgs = (mappingRegistry, backendModel) => {
14380
- var _a;
14381
15203
  const { contextRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapWorkflowObjectConstructorArgs(mappingRegistry, backendModel);
14382
15204
  const assignee = backendModel.Assignee ? mappingRegistry.map(backendModel.Assignee) : undefined;
14383
15205
  const owner = backendModel.Owner ? mappingRegistry.map(backendModel.Owner) : undefined;
@@ -14385,7 +15207,7 @@ const mapActivityConstructorArgs = (mappingRegistry, backendModel) => {
14385
15207
  ? mappingRegistry.map(backendModel.PrimarySubject)
14386
15208
  : undefined;
14387
15209
  const process = backendModel.Process ? mappingRegistry.map(backendModel.Process) : undefined;
14388
- const workItems = (_a = backendModel.WorkItems) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
15210
+ const workItems = backendModel.WorkItems?.map(k => mappingRegistry.map(k)).filter(isDefined);
14389
15211
  const assignmentDate = backendModel.AssignmentDate ? mapDate(backendModel.AssignmentDate) : undefined;
14390
15212
  const dueDate = backendModel.DueDate ? mapDate(backendModel.DueDate) : undefined;
14391
15213
  const finishDate = backendModel.FinishDate ? mapDate(backendModel.FinishDate) : undefined;
@@ -14428,11 +15250,14 @@ const mapActivityHistoryConstructorArgs = (mappingRegistry, backendModel) => {
14428
15250
  const approvalStatus = backendModel.ApprovalStatus
14429
15251
  ? mappingRegistry.map(backendModel.ApprovalStatus)
14430
15252
  : undefined;
14431
- return Object.assign(Object.assign({}, activityConstructorArgs), { activityType,
14432
- approvalStatus });
15253
+ return {
15254
+ ...activityConstructorArgs,
15255
+ activityType,
15256
+ approvalStatus,
15257
+ };
14433
15258
  };
14434
15259
  const activityHistoryMapping = {
14435
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityHistory',
15260
+ identifier: backendModel => backendModel?.$type === 'ActivityHistory',
14436
15261
  mapper: (mappingRegistry, backendModel) => {
14437
15262
  const { activityType, applicableActions, approvalStatus, assignee, assignmentDate, basicVersionInfo, contextRepository, dueDate, finishDate, id, listLinks, loadInfo, owner, primarySubject, process, securityDescriptor, startDate, suspendDate, workItems, listInfo, } = mapActivityHistoryConstructorArgs(mappingRegistry, backendModel);
14438
15263
  return new ActivityHistory({
@@ -14499,9 +15324,8 @@ const mapActivityStateToBackend = (model) => {
14499
15324
  };
14500
15325
 
14501
15326
  const mapActivityInstanceConstructorArgs = (mappingRegistry, backendModel) => {
14502
- var _a;
14503
15327
  const activityConstructorArgs = mapActivityConstructorArgs(mappingRegistry, backendModel);
14504
- const activityConstraints = (_a = backendModel.ActivityConstraints) === null || _a === void 0 ? void 0 : _a.map(c => mapActivityConstraints(c));
15328
+ const activityConstraints = backendModel.ActivityConstraints?.map(c => mapActivityConstraints(c));
14505
15329
  const activityDefinition = backendModel.ActivityDefinition
14506
15330
  ? mappingRegistry.map(backendModel.ActivityDefinition)
14507
15331
  : undefined;
@@ -14513,15 +15337,18 @@ const mapActivityInstanceConstructorArgs = (mappingRegistry, backendModel) => {
14513
15337
  const approvalStatus = backendModel.ApprovalStatus
14514
15338
  ? mappingRegistry.map(backendModel.ApprovalStatus)
14515
15339
  : undefined;
14516
- return Object.assign(Object.assign({}, activityConstructorArgs), { activityConstraints,
15340
+ return {
15341
+ ...activityConstructorArgs,
15342
+ activityConstraints,
14517
15343
  activityDefinition,
14518
15344
  activityState,
14519
15345
  approvalStatus,
14520
15346
  processDefinition,
14521
- workflowType });
15347
+ workflowType,
15348
+ };
14522
15349
  };
14523
15350
  const activityInstanceMapping = {
14524
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityInstance',
15351
+ identifier: backendModel => backendModel?.$type === 'ActivityInstance',
14525
15352
  mapper: (mappingRegistry, backendModel) => {
14526
15353
  const { activityConstraints, activityDefinition, activityState, applicableActions, approvalStatus, assignee, assignmentDate, basicVersionInfo, contextRepository, dueDate, finishDate, id, listLinks, loadInfo, owner, primarySubject, process, processDefinition, securityDescriptor, startDate, suspendDate, workflowType, workItems, listInfo, } = mapActivityInstanceConstructorArgs(mappingRegistry, backendModel);
14527
15354
  return new ActivityInstance({
@@ -14561,7 +15388,7 @@ const mapFinishActivityResultConstructorArgs = (mappingRegistry, backendModel) =
14561
15388
  return { nextActivityInstance };
14562
15389
  };
14563
15390
  const finishActivityResultMapping = {
14564
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FinishActivityResult',
15391
+ identifier: backendModel => backendModel?.$type === 'FinishActivityResult',
14565
15392
  mapper: (mappingRegistry, backendModel) => {
14566
15393
  const { nextActivityInstance } = mapFinishActivityResultConstructorArgs(mappingRegistry, backendModel);
14567
15394
  return new FinishActivityResult({ backendModel, nextActivityInstance });
@@ -14569,13 +15396,15 @@ const finishActivityResultMapping = {
14569
15396
  };
14570
15397
 
14571
15398
  const mapProcessDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
14572
- var _a;
14573
15399
  const repositoryLocalObjectConstructorArgs = mapRepositoryLocalObjectConstructorArgs(mappingRegistry, backendModel);
14574
- const activityDefinitions = (_a = backendModel.ActivityDefinitions) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
14575
- return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { activityDefinitions });
15400
+ const activityDefinitions = backendModel.ActivityDefinitions?.map(k => mappingRegistry.map(k)).filter(isDefined);
15401
+ return {
15402
+ ...repositoryLocalObjectConstructorArgs,
15403
+ activityDefinitions,
15404
+ };
14576
15405
  };
14577
15406
  const processDefinitionMapping = {
14578
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessDefinition',
15407
+ identifier: backendModel => backendModel?.$type === 'ProcessDefinition',
14579
15408
  mapper: (mappingRegistry, backendModel) => {
14580
15409
  const { activityDefinitions, applicableActions, basicVersionInfo, blueprintInfo, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, securityDescriptor, listInfo, } = mapProcessDefinitionConstructorArgs(mappingRegistry, backendModel);
14581
15410
  return new ProcessDefinition({
@@ -14613,9 +15442,8 @@ const mapProcessFinishReason = (backendModel) => {
14613
15442
  };
14614
15443
 
14615
15444
  const mapProcessConstructorArgs = (mappingRegistry, backendModel) => {
14616
- var _a;
14617
15445
  const { contextRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapWorkflowObjectConstructorArgs(mappingRegistry, backendModel);
14618
- const activities = (_a = backendModel.Activities) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
15446
+ const activities = backendModel.Activities?.map(k => mappingRegistry.map(k)).filter(isDefined);
14619
15447
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
14620
15448
  const subjects = mapLinks(mappingRegistry, backendModel.Subjects);
14621
15449
  const workflowType = backendModel.WorkflowType ? mappingRegistry.map(backendModel.WorkflowType) : undefined;
@@ -14639,11 +15467,14 @@ const mapProcessHistoryConstructorArgs = (mappingRegistry, backendModel) => {
14639
15467
  const processConstructorArgs = mapProcessConstructorArgs(mappingRegistry, backendModel);
14640
15468
  const finishReason = backendModel.FinishReason ? mapProcessFinishReason(backendModel.FinishReason) : undefined;
14641
15469
  const finishDate = backendModel.FinishDate ? mapDate(backendModel.FinishDate) : undefined;
14642
- return Object.assign(Object.assign({}, processConstructorArgs), { finishReason,
14643
- finishDate });
15470
+ return {
15471
+ ...processConstructorArgs,
15472
+ finishReason,
15473
+ finishDate,
15474
+ };
14644
15475
  };
14645
15476
  const processHistoryMapping = {
14646
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessHistory',
15477
+ identifier: backendModel => backendModel?.$type === 'ProcessHistory',
14647
15478
  mapper: (mappingRegistry, backendModel) => {
14648
15479
  const { activities, applicableActions, basicVersionInfo, contextRepository, creator, finishDate, finishReason, id, listLinks, loadInfo, securityDescriptor, subjects, workflowType, listInfo, } = mapProcessHistoryConstructorArgs(mappingRegistry, backendModel);
14649
15480
  return new ProcessHistory({
@@ -14671,10 +15502,13 @@ const mapProcessInstanceConstructorArgs = (mappingRegistry, backendModel) => {
14671
15502
  const processDefinition = backendModel.ProcessDefinition
14672
15503
  ? mappingRegistry.map(backendModel.ProcessDefinition)
14673
15504
  : undefined;
14674
- return Object.assign(Object.assign({}, processConstructorArgs), { processDefinition });
15505
+ return {
15506
+ ...processConstructorArgs,
15507
+ processDefinition,
15508
+ };
14675
15509
  };
14676
15510
  const processInstanceMapping = {
14677
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessInstance',
15511
+ identifier: backendModel => backendModel?.$type === 'ProcessInstance',
14678
15512
  mapper: (mappingRegistry, backendModel) => {
14679
15513
  const { activities, applicableActions, basicVersionInfo, contextRepository, creator, id, listLinks, loadInfo, processDefinition, securityDescriptor, subjects, workflowType, listInfo, } = mapProcessInstanceConstructorArgs(mappingRegistry, backendModel);
14680
15514
  return new ProcessInstance({
@@ -14697,23 +15531,25 @@ const processInstanceMapping = {
14697
15531
  };
14698
15532
 
14699
15533
  const mapTridionActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
14700
- var _a, _b, _c;
14701
15534
  const activityDefinition = mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel);
14702
15535
  const activityType = backendModel.ActivityType ? mapActivityType(backendModel.ActivityType) : undefined;
14703
15536
  const finishApprovalStatus = backendModel.FinishApprovalStatus
14704
15537
  ? mappingRegistry.map(backendModel.FinishApprovalStatus)
14705
15538
  : undefined;
14706
- const activityDefinitionsToHide = new Set(((_b = (_a = backendModel.ExtensionProperties) === null || _a === void 0 ? void 0 : _a['tm_ActivityTransitionsToHide']) === null || _b === void 0 ? void 0 : _b.split(',')) || []);
14707
- const filteredActivityDefinitions = (_c = backendModel.NextActivityDefinitions) === null || _c === void 0 ? void 0 : _c.filter(activityDefinition => {
15539
+ const activityDefinitionsToHide = new Set(backendModel.ExtensionProperties?.['tm_ActivityTransitionsToHide']?.split(',') || []);
15540
+ const filteredActivityDefinitions = backendModel.NextActivityDefinitions?.filter(activityDefinition => {
14708
15541
  return !activityDefinitionsToHide.has(activityDefinition.IdRef);
14709
15542
  });
14710
15543
  const nextActivityDefinitions = mapLinks(mappingRegistry, filteredActivityDefinitions);
14711
- return Object.assign(Object.assign({}, activityDefinition), { activityType,
15544
+ return {
15545
+ ...activityDefinition,
15546
+ activityType,
14712
15547
  finishApprovalStatus,
14713
- nextActivityDefinitions });
15548
+ nextActivityDefinitions,
15549
+ };
14714
15550
  };
14715
15551
  const tridionActivityDefinitionMapping = {
14716
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TridionActivityDefinition',
15552
+ identifier: backendModel => backendModel?.$type === 'TridionActivityDefinition',
14717
15553
  mapper: (mappingRegistry, backendModel) => {
14718
15554
  const { activityConstraints, activityType, applicableActions, assignee, basicVersionInfo, contextRepository, finishApprovalStatus, id, listLinks, loadInfo, nextActivityDefinitions, processDefinition, securityDescriptor, listInfo, } = mapTridionActivityDefinitionConstructorArgs(mappingRegistry, backendModel);
14719
15555
  return new TridionActivityDefinition({
@@ -14738,10 +15574,10 @@ const tridionActivityDefinitionMapping = {
14738
15574
 
14739
15575
  const mapTridionProcessDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
14740
15576
  const processDefinitionArgs = mapProcessDefinitionConstructorArgs(mappingRegistry, backendModel);
14741
- return Object.assign({}, processDefinitionArgs);
15577
+ return { ...processDefinitionArgs };
14742
15578
  };
14743
15579
  const tridionProcessDefinitionMapping = {
14744
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TridionProcessDefinition',
15580
+ identifier: backendModel => backendModel?.$type === 'TridionProcessDefinition',
14745
15581
  mapper: (mappingRegistry, backendModel) => {
14746
15582
  const { activityDefinitions, applicableActions, id, isLocked, listLinks, loadInfo, securityDescriptor, basicVersionInfo, limitedVersionInfo, blueprintInfo, locationInfo, lockInfo, metadata, metadataSchema, listInfo, } = mapTridionProcessDefinitionConstructorArgs(mappingRegistry, backendModel);
14747
15583
  return new TridionProcessDefinition({
@@ -14800,7 +15636,7 @@ const mapWorkflowInfoConstructorArgs = (mappingRegistry, backendModel) => {
14800
15636
  };
14801
15637
  };
14802
15638
  const workflowInfoMapping = {
14803
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'WorkflowInfo',
15639
+ identifier: backendModel => backendModel?.$type === 'WorkflowInfo',
14804
15640
  mapper: (mappingRegistry, backendModel) => {
14805
15641
  const { activityConstraints, activityInstance, activityState, assignee, assignmentDate, creationDate, dueDate, finishDate, performer, processInstance, startDate, } = mapWorkflowInfoConstructorArgs(mappingRegistry, backendModel);
14806
15642
  return new WorkflowInfo({
@@ -14829,14 +15665,17 @@ const mapWorkflowItemConstructorArgs = (mappingRegistry, backendModel) => {
14829
15665
  const subjectOwningRepository = backendModel.SubjectOwningRepository
14830
15666
  ? mappingRegistry.map(backendModel.SubjectOwningRepository)
14831
15667
  : undefined;
14832
- return Object.assign(Object.assign({}, workflowObjectConstructorArgs), { activity,
15668
+ return {
15669
+ ...workflowObjectConstructorArgs,
15670
+ activity,
14833
15671
  owner,
14834
15672
  process,
14835
15673
  subject,
14836
- subjectOwningRepository });
15674
+ subjectOwningRepository,
15675
+ };
14837
15676
  };
14838
15677
  const workflowItemMapping = {
14839
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'WorkItem',
15678
+ identifier: backendModel => backendModel?.$type === 'WorkItem',
14840
15679
  mapper: (mappingRegistry, backendModel) => {
14841
15680
  const { activity, contextRepository, owner, process, subject, subjectOwningRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapWorkflowItemConstructorArgs(mappingRegistry, backendModel);
14842
15681
  return new WorkItem({
@@ -14897,6 +15736,7 @@ const registerMappings = (mappingRegistry) => {
14897
15736
  mappingRegistry.register(fullVersionInfoMapping);
14898
15737
  mappingRegistry.register(groupMembershipMapping);
14899
15738
  mappingRegistry.register(hateoasLinkMapping);
15739
+ mappingRegistry.register(identifiableTranslationJobMapping);
14900
15740
  mappingRegistry.register(keywordCategoryMapping);
14901
15741
  mappingRegistry.register(keywordFieldDefinitionMapping);
14902
15742
  mappingRegistry.register(keywordMapping);
@@ -14926,6 +15766,7 @@ const registerMappings = (mappingRegistry) => {
14926
15766
  mappingRegistry.register(publishTransactionListInfoMapping);
14927
15767
  mappingRegistry.register(publishTransactionsCreationResultMapping);
14928
15768
  mappingRegistry.register(publishUrlInfoMapping);
15769
+ mappingRegistry.register(renderedItemMapping);
14929
15770
  mappingRegistry.register(repositoryMapping);
14930
15771
  mappingRegistry.register(resolvedItemMapping);
14931
15772
  mappingRegistry.register(resolveInstructionMapping);
@@ -14955,6 +15796,7 @@ const registerMappings = (mappingRegistry) => {
14955
15796
  mappingRegistry.register(translationJobInfoMapping);
14956
15797
  mappingRegistry.register(translationJobItemMapping);
14957
15798
  mappingRegistry.register(translationJobMapping);
15799
+ mappingRegistry.register(translationResolvedItemMapping);
14958
15800
  mappingRegistry.register(translationTargetPublicationMapping);
14959
15801
  mappingRegistry.register(translationWorkflowStatusMapping);
14960
15802
  mappingRegistry.register(tridionActivityDefinitionMapping);
@@ -14971,6 +15813,7 @@ const registerMappings = (mappingRegistry) => {
14971
15813
  mappingRegistry.register(workflowInfoMapping);
14972
15814
  mappingRegistry.register(workflowItemMapping);
14973
15815
  mappingRegistry.register(xhtmlFieldDefinitionMapping);
15816
+ mappingRegistry.register(settingsMapping);
14974
15817
  };
14975
15818
 
14976
15819
  const mappingRegistry = new MappingRegistry();
@@ -14983,7 +15826,7 @@ const tryMapToModel = (backendItem) => {
14983
15826
  const mapToModel = (backendItem) => {
14984
15827
  const model = tryMapToModel(backendItem);
14985
15828
  if (!model) {
14986
- throw new Error(`Unknown model type: ${backendItem === null || backendItem === void 0 ? void 0 : backendItem.$type}`);
15829
+ throw new Error(`Unknown model type: ${backendItem?.$type}`);
14987
15830
  }
14988
15831
  return model;
14989
15832
  };
@@ -15092,17 +15935,16 @@ const linkGraphNodes$1 = (graph, backendNodes) => {
15092
15935
  * Connect repositoryLocalObjects inside every node with each other (shared/localized from etc.)
15093
15936
  */
15094
15937
  const linkItems = (graph) => {
15095
- var _a, _b, _c, _d, _e;
15096
15938
  for (const node of graph.nodes) {
15097
15939
  if (!isRloNode(node))
15098
15940
  continue;
15099
- if (((_a = node.data.item.blueprintInfo) === null || _a === void 0 ? void 0 : _a.isShared) || ((_b = node.data.item.blueprintInfo) === null || _b === void 0 ? void 0 : _b.isLocalized)) {
15941
+ if (node.data.item.blueprintInfo?.isShared || node.data.item.blueprintInfo?.isLocalized) {
15100
15942
  for (const ancestor of graph.ancestorsByPriority(node.id)) {
15101
15943
  if (!isRloNode(ancestor.node))
15102
15944
  continue;
15103
- if (((_c = ancestor.node.data.item.blueprintInfo) === null || _c === void 0 ? void 0 : _c.isLocalized) ||
15104
- (!((_d = ancestor.node.data.item.blueprintInfo) === null || _d === void 0 ? void 0 : _d.isShared) &&
15105
- !((_e = ancestor.node.data.item.blueprintInfo) === null || _e === void 0 ? void 0 : _e.isLocalized))) {
15945
+ if (ancestor.node.data.item.blueprintInfo?.isLocalized ||
15946
+ (!ancestor.node.data.item.blueprintInfo?.isShared &&
15947
+ !ancestor.node.data.item.blueprintInfo?.isLocalized)) {
15106
15948
  const nodeData = node.data;
15107
15949
  const ancestorNodeData = ancestor.node.data;
15108
15950
  nodeData.linkSourceItem(ancestorNodeData);
@@ -15122,6 +15964,35 @@ const constructItemGraph = (backendModel) => {
15122
15964
  return graph;
15123
15965
  };
15124
15966
 
15967
+ const mapSearchBlueprintStatus = (backendModel) => {
15968
+ switch (backendModel) {
15969
+ case SearchBlueprintStatus.LOCAL:
15970
+ return 'local';
15971
+ case SearchBlueprintStatus.SHARED:
15972
+ return 'shared';
15973
+ case SearchBlueprintStatus.LOCALIZED:
15974
+ return 'localized';
15975
+ case SearchBlueprintStatus.UNSPECIFIED:
15976
+ return 'unspecified';
15977
+ case SearchBlueprintStatus.UNKNOWN_BY_CLIENT:
15978
+ return 'unknownByClient';
15979
+ }
15980
+ };
15981
+ const mapSearchBlueprintStatusToBackend = (model) => {
15982
+ switch (model) {
15983
+ case 'local':
15984
+ return SearchBlueprintStatus.LOCAL;
15985
+ case 'shared':
15986
+ return SearchBlueprintStatus.SHARED;
15987
+ case 'localized':
15988
+ return SearchBlueprintStatus.LOCALIZED;
15989
+ case 'unspecified':
15990
+ return SearchBlueprintStatus.UNSPECIFIED;
15991
+ case 'unknownByClient':
15992
+ return SearchBlueprintStatus.UNKNOWN_BY_CLIENT;
15993
+ }
15994
+ };
15995
+
15125
15996
  const mapListDetailsLevelToBackend = (backendValue) => {
15126
15997
  switch (backendValue) {
15127
15998
  case 'contentless':
@@ -15375,6 +16246,7 @@ const itemLinkTypes = [
15375
16246
  'user',
15376
16247
  'userGroup',
15377
16248
  'virtualFolder',
16249
+ 'translationJob',
15378
16250
  ];
15379
16251
  const itemLinkType = createEnumObject(itemLinkTypes);
15380
16252
  const itemTypes = [
@@ -15389,12 +16261,11 @@ const itemTypes = [
15389
16261
  const itemType = createEnumObject(itemTypes);
15390
16262
 
15391
16263
  const getItemContainerId = (item) => {
15392
- var _a, _b, _c, _d, _e;
15393
- if (item instanceof Keyword && ((_a = item.parentKeywords) === null || _a === void 0 ? void 0 : _a.length)) {
16264
+ if (item instanceof Keyword && item.parentKeywords?.length) {
15394
16265
  return item.parentKeywords[0].idRef;
15395
16266
  }
15396
16267
  if (item instanceof RepositoryLocalObject) {
15397
- return ((_c = (_b = item.locationInfo) === null || _b === void 0 ? void 0 : _b.organizationalItem) === null || _c === void 0 ? void 0 : _c.idRef) || ((_e = (_d = item.locationInfo) === null || _d === void 0 ? void 0 : _d.contextRepository) === null || _e === void 0 ? void 0 : _e.idRef);
16268
+ return item.locationInfo?.organizationalItem?.idRef || item.locationInfo?.contextRepository?.idRef;
15398
16269
  }
15399
16270
  return undefined;
15400
16271
  };
@@ -15460,6 +16331,12 @@ const getItemLinkType = (itemLink) => {
15460
16331
  return 'externalKeyword';
15461
16332
  }
15462
16333
  }
16334
+ if (itemLink.idRef instanceof TmUri) {
16335
+ switch (itemLink.idRef.itemType) {
16336
+ case 'translationJob':
16337
+ return 'translationJob';
16338
+ }
16339
+ }
15463
16340
  if (itemLink.idRef instanceof VirtualUri) {
15464
16341
  switch (itemLink.idRef.itemType) {
15465
16342
  case 'businessProcessTypes':
@@ -15474,7 +16351,7 @@ const getItemLinkType = (itemLink) => {
15474
16351
  const getItemType = (item) => {
15475
16352
  if (isExactInstanceOf(item, Keyword))
15476
16353
  return item.isAbstract ? 'abstractKeyword' : 'keyword';
15477
- if (isExactInstanceOf(item, ProcessDefinition))
16354
+ if (isExactInstanceOf(item, TridionProcessDefinition))
15478
16355
  return 'processDefinition';
15479
16356
  if (isExactInstanceOf(item, TargetGroup))
15480
16357
  return 'targetGroup';
@@ -15532,7 +16409,11 @@ const getItemType = (item) => {
15532
16409
  return 'publication';
15533
16410
  if (isExactInstanceOf(item, TemplateBuildingBlock))
15534
16411
  return 'templateBuildingBlock';
16412
+ if (isExactInstanceOf(item, TranslationJob))
16413
+ return 'translationJob';
16414
+ if (isExactInstanceOf(item, IdentifiableTranslationJob))
16415
+ return 'translationJob';
15535
16416
  return undefined;
15536
16417
  };
15537
16418
 
15538
- 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, DependencyGraphNode, 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, ProcessedItem, Publication, PublicationBlueprintHierarchy, PublishContext, PublishInfo, PublishInstruction, PublishInstructionBase, PublishLocationInfo, PublishTransaction, PublishTransactionListInfo, PublishTransactionsCreationResult, PublishUrlInfo, PublishingTarget, Region, Repository, RepositoryLocalObject, ResolveInstruction, ResolveInstructionBase, ResolvedItem, Schema, SearchFolder, SecurityDescriptor, SingleLineTextFieldDefinition, SingleLineTextListDefinition, StructureGroup, SynchronizationAction, SynchronizationResult, 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, UnpublishInstruction, User, UserFavoriteLink, UserGroup, UserLocaleInfo, UserPreferences, UserProfile, UserRuntimeInfo, ValidationApiError, ValidationError, ValidationResult, ValidationWarning, VersionedItem, VirtualFolder, VirtualUri, WhereUsedListInfo, WorkItem, WorkflowInfo, WorkflowObject, XhtmlFieldDefinition, applicableActions, configureLocale, createBackendBusinessProcessTypes, createBackendHateoasLink, createBackendLink, createBackendTaxonomies, determineBatchStatus, getItemContainerId, getItemLinkType, getItemType, isRloNode, itemLinkType, itemLinkTypes, itemType, itemTypes, listLinks, mapActivityStateToBackend, mapBatchOperationState, mapDependencyDirectionToBackend, mapErrorTypeToBackend, mapListDetailsLevelToBackend, mapLoadInfoStateToBackend, mapLockTypeToBackend, mapPublishPriorityToBackend, mapPublishTransactionStateToBackend, mapRetrieveReasonToBackend, mapRloItemTypeToBackend, mapStringSearchModeToBackend, mapStructureResolveOptionToBackend, mapSynchronizeFlagsToBackend, mapToModel, mapToModels, mapTranslationErrorSeverityToBackend, mapTranslationJobPriorityToBackend, mapTranslationJobStateToBackend, mapTranslationJobTypeToBackend, mapTranslationStatusToBackend, parseItemUri, tryMapToModel, tryParseItemUri };
16419
+ 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, DependencyGraphNode, DynamicVersionInfo, EclUri, EmbeddedRegion, EmbeddedSchemaFieldDefinition, ExternalContainer, ExternalKeyword, ExternalKeywordCategory, ExternalLinkFieldDefinition, ExternalMultimediaComponent, ExternalVersionInfo, FinishActivityResult, Folder, FormattingFeatures, FullVersionInfo, GroupMembership, HateoasLink, IdentifiableObject, IdentifiableTranslationJob, 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, ProcessedItem, Publication, PublicationBlueprintHierarchy, PublishContext, PublishInfo, PublishInstruction, PublishInstructionBase, PublishLocationInfo, PublishTransaction, PublishTransactionListInfo, PublishTransactionsCreationResult, PublishUrlInfo, PublishingTarget, Region, RenderedItem, Repository, RepositoryLocalObject, ResolveInstruction, ResolveInstructionBase, ResolvedItem, Schema, SearchFolder, SecurityDescriptor, Settings, SingleLineTextFieldDefinition, SingleLineTextListDefinition, StructureGroup, SynchronizationAction, SynchronizationResult, SystemPrivilege, SystemWideObject, TargetGroup, TargetGroupCondition, TargetLanguage, TargetType, Taxonomies, TcmUri, Template, TemplateBuildingBlock, TextFieldDefinition, TmUri, TmsLanguage, TmsWorkflow, TmsWorkflowStep, TranslationDetails, TranslationErrorDetails, TranslationExceptionDetails, TranslationInfo, TranslationJob, TranslationJobInfo, TranslationJobItem, TranslationResolvedItem, TranslationTargetPublication, TranslationWorkflowStatus, TridionActivityDefinition, TridionProcessDefinition, Trustee, UnpublishInstruction, User, UserFavoriteLink, UserGroup, UserLocaleInfo, UserPreferences, UserProfile, UserRuntimeInfo, ValidationApiError, ValidationError, ValidationResult, ValidationWarning, VersionedItem, VirtualFolder, VirtualUri, WhereUsedListInfo, WorkItem, WorkflowInfo, WorkflowObject, XhtmlFieldDefinition, applicableActions, configureLocale, createBackendBusinessProcessTypes, createBackendHateoasLink, createBackendLink, createBackendTaxonomies, determineBatchStatus, getItemContainerId, getItemLinkType, getItemType, isRloNode, itemLinkType, itemLinkTypes, itemType, itemTypes, listLinks, mapActivityStateToBackend, mapBatchOperationState, mapDependencyDirectionToBackend, mapErrorTypeToBackend, mapListDetailsLevelToBackend, mapLoadInfoStateToBackend, mapLockTypeToBackend, mapPublishPriorityToBackend, mapPublishTransactionStateToBackend, mapRetrieveReasonToBackend, mapRloItemTypeToBackend, mapSchemaPurposeBackend, mapSearchBlueprintStatus, mapSearchBlueprintStatusToBackend, mapStringSearchModeToBackend, mapStructureResolveOptionToBackend, mapSynchronizeFlagsToBackend, mapToModel, mapToModels, mapTranslationErrorSeverityToBackend, mapTranslationJobPriorityToBackend, mapTranslationJobStateToBackend, mapTranslationJobTypeToBackend, mapTranslationStatusToBackend, parseItemUri, tryMapToModel, tryParseItemUri };