@tridion-sites/models 2.1.0 → 2.3.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
@@ -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;
@@ -477,17 +449,20 @@ class TcmUri {
477
449
  return this._itemId === 0;
478
450
  }
479
451
  get isNullUri() {
480
- return (this._publicationId === _a$1.null.publicationId &&
481
- this._itemId === _a$1.null.itemId &&
482
- 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);
483
455
  }
484
456
  get isSystemUri() {
485
- return (this._publicationId === _a$1.system.publicationId &&
486
- this._itemId === _a$1.system.itemId &&
487
- 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);
488
460
  }
461
+ /**
462
+ * If the item version is 0, then the item is editable. (e.g. tcm:1-1-v0)
463
+ */
489
464
  get isEditableVersion() {
490
- return this.isNullUri || this._itemVersion === _a$1._editableVersion;
465
+ return this.isNullUri || this._itemVersion === _a$2._editableVersion;
491
466
  }
492
467
  get isDynamic() {
493
468
  return this._itemVersion === 0;
@@ -496,7 +471,7 @@ class TcmUri {
496
471
  return this._asString;
497
472
  }
498
473
  }
499
- _a$1 = TcmUri;
474
+ _a$2 = TcmUri;
500
475
  Object.defineProperty(TcmUri, "_tcmUriCache", {
501
476
  enumerable: true,
502
477
  configurable: true,
@@ -526,11 +501,11 @@ Object.defineProperty(TcmUri, "create", {
526
501
  configurable: true,
527
502
  writable: true,
528
503
  value: (publicationId, itemId, itemType, itemVersion) => {
529
- const tcmUri = new _a$1(publicationId, itemId, itemType, itemVersion);
530
- const cachedTcmUri = _a$1._tcmUriCache.get(tcmUri.asString);
504
+ const tcmUri = new _a$2(publicationId, itemId, itemType, itemVersion);
505
+ const cachedTcmUri = _a$2._tcmUriCache.get(tcmUri.asString);
531
506
  if (cachedTcmUri)
532
507
  return cachedTcmUri;
533
- _a$1._tcmUriCache.set(tcmUri.asString, tcmUri);
508
+ _a$2._tcmUriCache.set(tcmUri.asString, tcmUri);
534
509
  return tcmUri;
535
510
  }
536
511
  });
@@ -538,23 +513,23 @@ Object.defineProperty(TcmUri, "null", {
538
513
  enumerable: true,
539
514
  configurable: true,
540
515
  writable: true,
541
- value: _a$1.create(0, 0, 'none')
516
+ value: _a$2.create(0, 0, 'none')
542
517
  });
543
518
  Object.defineProperty(TcmUri, "system", {
544
519
  enumerable: true,
545
520
  configurable: true,
546
521
  writable: true,
547
- value: _a$1.create(0, 0, 'system')
522
+ value: _a$2.create(0, 0, 'system')
548
523
  });
549
524
  Object.defineProperty(TcmUri, "parse", {
550
525
  enumerable: true,
551
526
  configurable: true,
552
527
  writable: true,
553
528
  value: (input) => {
554
- const cachedTcmUri = _a$1._tcmUriCache.get(input);
529
+ const cachedTcmUri = _a$2._tcmUriCache.get(input);
555
530
  if (cachedTcmUri)
556
531
  return cachedTcmUri;
557
- const result = _a$1._tcmUriRegExp.exec(input);
532
+ const result = _a$2._tcmUriRegExp.exec(input);
558
533
  if (!result)
559
534
  return undefined;
560
535
  const pubIdPart = result[1];
@@ -585,7 +560,7 @@ Object.defineProperty(TcmUri, "parse", {
585
560
  if (isNaN(version) || version < 0)
586
561
  return undefined;
587
562
  }
588
- return _a$1.create(publicationId, itemId, itemType, version);
563
+ return _a$2.create(publicationId, itemId, itemType, version);
589
564
  }
590
565
  });
591
566
  Object.defineProperty(TcmUri, "createPublicationUri", {
@@ -593,11 +568,11 @@ Object.defineProperty(TcmUri, "createPublicationUri", {
593
568
  configurable: true,
594
569
  writable: true,
595
570
  value: (publicationId) => {
596
- return _a$1.create(0, publicationId, 'publication');
571
+ return _a$2.create(0, publicationId, 'publication');
597
572
  }
598
573
  });
599
574
 
600
- var _a;
575
+ var _a$1;
601
576
  class EclUri {
602
577
  constructor(publicationId, mountPointId, itemId, itemType, subType, itemVersion) {
603
578
  /**
@@ -676,7 +651,7 @@ class EclUri {
676
651
  configurable: true,
677
652
  writable: true,
678
653
  value: () => {
679
- return _a.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType);
654
+ return _a$1.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType);
680
655
  }
681
656
  });
682
657
  Object.defineProperty(this, "getMountPointUri", {
@@ -686,7 +661,7 @@ class EclUri {
686
661
  value: () => {
687
662
  if (this._itemType === 'mountpoint')
688
663
  return this;
689
- return _a.create(this._publicationId, this._mountPointId, 'root', 'mountpoint', 'mp');
664
+ return _a$1.create(this._publicationId, this._mountPointId, 'root', 'mountpoint', 'mp');
690
665
  }
691
666
  });
692
667
  Object.defineProperty(this, "getUriWithVersion", {
@@ -694,7 +669,7 @@ class EclUri {
694
669
  configurable: true,
695
670
  writable: true,
696
671
  value: (version) => {
697
- return _a.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType, version);
672
+ return _a$1.create(this._publicationId, this._mountPointId, this._itemId, this._itemType, this._subType, version);
698
673
  }
699
674
  });
700
675
  Object.defineProperty(this, "getUriInPublication", {
@@ -702,7 +677,7 @@ class EclUri {
702
677
  configurable: true,
703
678
  writable: true,
704
679
  value: (publicationUri) => {
705
- return _a.create(publicationUri.itemId, this._mountPointId, this._itemId, this._itemType, this._subType, this._itemVersion);
680
+ return _a$1.create(publicationUri.itemId, this._mountPointId, this._itemId, this._itemType, this._subType, this._itemVersion);
706
681
  }
707
682
  });
708
683
  this._publicationId = publicationId;
@@ -750,11 +725,17 @@ class EclUri {
750
725
  get isDynamic() {
751
726
  return this._itemVersion === 0;
752
727
  }
728
+ /**
729
+ * If the item version is 0, then the item is editable. (e.g. ecl:5-vim-295361341-vid-file-v0)
730
+ */
731
+ get isEditableVersion() {
732
+ return this._itemVersion === _a$1._editableVersion;
733
+ }
753
734
  get asString() {
754
735
  return this._asString;
755
736
  }
756
737
  }
757
- _a = EclUri;
738
+ _a$1 = EclUri;
758
739
  Object.defineProperty(EclUri, "_eclUriCache", {
759
740
  enumerable: true,
760
741
  configurable: true,
@@ -773,16 +754,22 @@ Object.defineProperty(EclUri, "_eclUriRegExp", {
773
754
  writable: true,
774
755
  value: new RegExp(/^ecl:(\d+)-([^-]+)-([^-]+)-([^-]+)-(\w+)(-v(\d+))?$/)
775
756
  });
757
+ Object.defineProperty(EclUri, "_editableVersion", {
758
+ enumerable: true,
759
+ configurable: true,
760
+ writable: true,
761
+ value: 0
762
+ });
776
763
  Object.defineProperty(EclUri, "create", {
777
764
  enumerable: true,
778
765
  configurable: true,
779
766
  writable: true,
780
767
  value: (publicationId, mountPointId, itemId, itemType, subType, itemVersion) => {
781
- const eclUri = new _a(publicationId, mountPointId, itemId, itemType, subType, itemVersion);
782
- const cachedEclUri = _a._eclUriCache.get(eclUri.asString);
768
+ const eclUri = new _a$1(publicationId, mountPointId, itemId, itemType, subType, itemVersion);
769
+ const cachedEclUri = _a$1._eclUriCache.get(eclUri.asString);
783
770
  if (cachedEclUri)
784
771
  return cachedEclUri;
785
- _a._eclUriCache.set(eclUri.asString, eclUri);
772
+ _a$1._eclUriCache.set(eclUri.asString, eclUri);
786
773
  return eclUri;
787
774
  }
788
775
  });
@@ -791,7 +778,7 @@ Object.defineProperty(EclUri, "parse", {
791
778
  configurable: true,
792
779
  writable: true,
793
780
  value: (input) => {
794
- const result = _a._eclUriRegExp.exec(input);
781
+ const result = _a$1._eclUriRegExp.exec(input);
795
782
  if (!result)
796
783
  return undefined;
797
784
  const pubIdPart = result[1];
@@ -821,10 +808,128 @@ Object.defineProperty(EclUri, "parse", {
821
808
  if (isNaN(version) || version < 0)
822
809
  return undefined;
823
810
  }
824
- return _a.create(publicationId, mountPointId, itemId, itemType, subType, version);
811
+ return _a$1.create(publicationId, mountPointId, itemId, itemType, subType, version);
812
+ }
813
+ });
814
+
815
+ var _a;
816
+ class TmUri {
817
+ constructor(itemId) {
818
+ /**
819
+ * TM-specified item id.
820
+ */
821
+ Object.defineProperty(this, "_itemId", {
822
+ enumerable: true,
823
+ configurable: true,
824
+ writable: true,
825
+ value: void 0
826
+ });
827
+ Object.defineProperty(this, "_asString", {
828
+ enumerable: true,
829
+ configurable: true,
830
+ writable: true,
831
+ value: void 0
832
+ });
833
+ /**
834
+ * Don't use it, will be removed later. Added to align api with other uris.
835
+ *
836
+ * @deprecated
837
+ */
838
+ Object.defineProperty(this, "getPublicationUri", {
839
+ enumerable: true,
840
+ configurable: true,
841
+ writable: true,
842
+ value: () => {
843
+ return TcmUri.createPublicationUri(0);
844
+ }
845
+ });
846
+ /**
847
+ * Don't use it, will be removed later. Added to align api with other uris.
848
+ *
849
+ * @deprecated
850
+ */
851
+ Object.defineProperty(this, "getUriInPublication", {
852
+ enumerable: true,
853
+ configurable: true,
854
+ writable: true,
855
+ value: (publicationUri) => {
856
+ return _a.create(this._itemId);
857
+ }
858
+ });
859
+ this._itemId = itemId;
860
+ this._asString = `tm:0-${this._itemId}-2`;
861
+ }
862
+ static get uriPrefix() {
863
+ return this._tmUriPrefix;
864
+ }
865
+ get itemType() {
866
+ return 'translationJob';
867
+ }
868
+ get itemId() {
869
+ return this._itemId;
870
+ }
871
+ get asString() {
872
+ return this._asString;
873
+ }
874
+ /**
875
+ * Don't use it, will be removed later. Added to align api with other uris.
876
+ *
877
+ * @deprecated
878
+ */
879
+ get isDynamic() {
880
+ return false;
881
+ }
882
+ }
883
+ _a = TmUri;
884
+ Object.defineProperty(TmUri, "_tmUriCache", {
885
+ enumerable: true,
886
+ configurable: true,
887
+ writable: true,
888
+ value: new Map()
889
+ });
890
+ Object.defineProperty(TmUri, "_tmUriPrefix", {
891
+ enumerable: true,
892
+ configurable: true,
893
+ writable: true,
894
+ value: 'tm'
895
+ });
896
+ Object.defineProperty(TmUri, "_tmUriRegExp", {
897
+ enumerable: true,
898
+ configurable: true,
899
+ writable: true,
900
+ value: new RegExp(/^tm:0-(\d+)-2$/)
901
+ });
902
+ Object.defineProperty(TmUri, "create", {
903
+ enumerable: true,
904
+ configurable: true,
905
+ writable: true,
906
+ value: (itemId) => {
907
+ const tmUri = new _a(itemId);
908
+ const cachedTmUri = _a._tmUriCache.get(tmUri.asString);
909
+ if (cachedTmUri)
910
+ return cachedTmUri;
911
+ _a._tmUriCache.set(tmUri.asString, tmUri);
912
+ return tmUri;
913
+ }
914
+ });
915
+ Object.defineProperty(TmUri, "parse", {
916
+ enumerable: true,
917
+ configurable: true,
918
+ writable: true,
919
+ value: (input) => {
920
+ const result = _a._tmUriRegExp.exec(input);
921
+ if (!result)
922
+ return undefined;
923
+ const itemIdPart = result[1];
924
+ if (itemIdPart === undefined)
925
+ return undefined;
926
+ const itemId = parseInt(itemIdPart);
927
+ return _a.create(itemId);
825
928
  }
826
929
  });
827
930
 
931
+ const BUSINESS_PROCESS_TYPES_NAMESPACE = 'bptman-';
932
+ const TAXONOMIES_NAMESPACE = 'catman-';
828
933
  class VirtualUri {
829
934
  constructor(publicationUri, itemType) {
830
935
  Object.defineProperty(this, "_publicationUri", {
@@ -866,6 +971,9 @@ class VirtualUri {
866
971
  const namespace = this._itemType === 'businessProcessTypes' ? 'bptman-' : 'catman-';
867
972
  this._asString = `${namespace}${this._publicationUri.asString}`;
868
973
  }
974
+ get itemId() {
975
+ return this._publicationUri.asString;
976
+ }
869
977
  get itemType() {
870
978
  return this._itemType;
871
979
  }
@@ -902,12 +1010,12 @@ Object.defineProperty(VirtualUri, "parse", {
902
1010
  value: (input) => {
903
1011
  let itemIdPart;
904
1012
  let itemType;
905
- if (input.startsWith('bptman-')) {
906
- itemIdPart = input.replace('bptman-', '');
1013
+ if (input.startsWith(BUSINESS_PROCESS_TYPES_NAMESPACE)) {
1014
+ itemIdPart = input.replace(BUSINESS_PROCESS_TYPES_NAMESPACE, '');
907
1015
  itemType = 'businessProcessTypes';
908
1016
  }
909
- if (input.startsWith('catman-')) {
910
- itemIdPart = input.replace('catman-', '');
1017
+ if (input.startsWith(TAXONOMIES_NAMESPACE)) {
1018
+ itemIdPart = input.replace(TAXONOMIES_NAMESPACE, '');
911
1019
  itemType = 'taxonomies';
912
1020
  }
913
1021
  if (!itemIdPart || !itemType)
@@ -929,6 +1037,9 @@ const tryParseItemUri = (backendId) => {
929
1037
  const virtualUri = VirtualUri.parse(backendId);
930
1038
  if (virtualUri)
931
1039
  return virtualUri;
1040
+ const tmUri = TmUri.parse(backendId);
1041
+ if (tmUri)
1042
+ return tmUri;
932
1043
  return undefined;
933
1044
  };
934
1045
  const parseItemUri = (backendId) => {
@@ -1198,7 +1309,7 @@ class IdentifiableObject {
1198
1309
  value: (applicableAction) => {
1199
1310
  if (!this._applicableActions)
1200
1311
  return false;
1201
- return this._applicableActions.some(action => { var _a; return ((_a = action.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === applicableActions[applicableAction]; });
1312
+ return this._applicableActions.some(action => action.relationType?.toLowerCase() === applicableActions[applicableAction]);
1202
1313
  }
1203
1314
  });
1204
1315
  Object.defineProperty(this, "hasListLink", {
@@ -1208,7 +1319,7 @@ class IdentifiableObject {
1208
1319
  value: (listLink) => {
1209
1320
  if (!this._listLinks)
1210
1321
  return false;
1211
- return this._listLinks.some(link => { var _a; return ((_a = link.relationType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === listLinks[listLink]; });
1322
+ return this._listLinks.some(link => link.relationType?.toLowerCase() === listLinks[listLink]);
1212
1323
  }
1213
1324
  });
1214
1325
  Object.defineProperty(this, "hasLoadError", {
@@ -1216,8 +1327,7 @@ class IdentifiableObject {
1216
1327
  configurable: true,
1217
1328
  writable: true,
1218
1329
  value: (specificError) => {
1219
- var _a;
1220
- if (!((_a = this.loadInfo) === null || _a === void 0 ? void 0 : _a.errorType) || this.loadInfo.errorType === 'none') {
1330
+ if (!this.loadInfo?.errorType || this.loadInfo.errorType === 'none') {
1221
1331
  return false;
1222
1332
  }
1223
1333
  if (specificError) {
@@ -1481,9 +1591,8 @@ class MultimediaType extends SystemWideObject {
1481
1591
  * Represents a Repository: a context for BluePrinting.
1482
1592
  */
1483
1593
  class Repository extends SystemWideObject {
1484
- constructor(_a) {
1485
- 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"]);
1486
- super(Object.assign({ backendModel }, systemWideObjectArgs));
1594
+ constructor({ backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, defaultMultimediaSchema, locationInfo, metadataSchema, minimalLocalizeApprovalStatus, parents, rootFolder, taskProcess, versionInfo, ...systemWideObjectArgs }) {
1595
+ super({ backendModel, ...systemWideObjectArgs });
1487
1596
  Object.defineProperty(this, "_accessControlList", {
1488
1597
  enumerable: true,
1489
1598
  configurable: true,
@@ -1621,9 +1730,8 @@ class Repository extends SystemWideObject {
1621
1730
  * Publication: a "Repository" used for publishing.
1622
1731
  */
1623
1732
  class Publication extends Repository {
1624
- constructor(_a) {
1625
- 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"]);
1626
- super(Object.assign({ backendModel }, repositoryArgs));
1733
+ constructor({ backendModel, componentSnapshotTemplate, componentTemplateProcess, defaultComponentTemplate, defaultPageTemplate, defaultTemplateBuildingBlock, pageSnapshotTemplate, pageTemplateProcess, rootStructureGroup, templateBundleProcess, ...repositoryArgs }) {
1734
+ super({ backendModel, ...repositoryArgs });
1627
1735
  Object.defineProperty(this, "_componentSnapshotTemplate", {
1628
1736
  enumerable: true,
1629
1737
  configurable: true,
@@ -1817,9 +1925,8 @@ class PublishingTarget extends SystemWideObject {
1817
1925
  * Represents the data of a Target Type used as a target for publishing.
1818
1926
  */
1819
1927
  class TargetType extends PublishingTarget {
1820
- constructor(_a) {
1821
- var { backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, minimalApprovalStatus, priority } = _a, publishingTargetArgs = __rest(_a, ["backendModel", "accessControlList", "businessProcessType", "contentSecurityDescriptor", "minimalApprovalStatus", "priority"]);
1822
- super(Object.assign({ backendModel }, publishingTargetArgs));
1928
+ constructor({ backendModel, accessControlList, businessProcessType, contentSecurityDescriptor, minimalApprovalStatus, priority, ...publishingTargetArgs }) {
1929
+ super({ backendModel, ...publishingTargetArgs });
1823
1930
  Object.defineProperty(this, "_accessControlList", {
1824
1931
  enumerable: true,
1825
1932
  configurable: true,
@@ -1918,9 +2025,8 @@ class TargetType extends PublishingTarget {
1918
2025
  * Represents the data of a Batch.
1919
2026
  */
1920
2027
  class Batch extends SystemWideObject {
1921
- constructor(_a) {
1922
- var { backendModel, backendBatchOperation, operations, performer, status, type } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "backendBatchOperation", "operations", "performer", "status", "type"]);
1923
- super(Object.assign({ backendModel }, systemWideObjectArgs));
2028
+ constructor({ backendModel, backendBatchOperation, operations, performer, status, type, ...systemWideObjectArgs }) {
2029
+ super({ backendModel, ...systemWideObjectArgs });
1924
2030
  Object.defineProperty(this, "_backendBatchOperation", {
1925
2031
  enumerable: true,
1926
2032
  configurable: true,
@@ -1978,8 +2084,7 @@ class Batch extends SystemWideObject {
1978
2084
  * Additional parameters for invoking operation.
1979
2085
  */
1980
2086
  get parameters() {
1981
- var _a;
1982
- return (_a = this._backendBatchOperation) === null || _a === void 0 ? void 0 : _a.Parameters;
2087
+ return this._backendBatchOperation?.Parameters;
1983
2088
  }
1984
2089
  /**
1985
2090
  * Whether all batch operations are finished.
@@ -2146,7 +2251,6 @@ class ValidationWarning extends ValidationResult {
2146
2251
 
2147
2252
  class ValidationApiError extends ApiError {
2148
2253
  constructor(backendModel) {
2149
- var _a, _b;
2150
2254
  super(backendModel);
2151
2255
  Object.defineProperty(this, "_backendModel", {
2152
2256
  enumerable: true,
@@ -2167,8 +2271,8 @@ class ValidationApiError extends ApiError {
2167
2271
  value: void 0
2168
2272
  });
2169
2273
  this._backendModel = backendModel;
2170
- this._validationErrors = ((_a = backendModel.body.Data.ValidationErrors) === null || _a === void 0 ? void 0 : _a.map(e => new ValidationError(e))) || [];
2171
- this._validationWarnings = ((_b = backendModel.body.Data.ValidationWarnings) === null || _b === void 0 ? void 0 : _b.map(w => new ValidationWarning(w))) || [];
2274
+ this._validationErrors = backendModel.body.Data.ValidationErrors?.map(e => new ValidationError(e)) || [];
2275
+ this._validationWarnings = backendModel.body.Data.ValidationWarnings?.map(w => new ValidationWarning(w)) || [];
2172
2276
  }
2173
2277
  get validationWarnings() {
2174
2278
  return this._validationWarnings;
@@ -2204,7 +2308,6 @@ const mapBatchOperationState = (backendModel) => {
2204
2308
 
2205
2309
  class BatchOperation {
2206
2310
  constructor(backendModel, subject) {
2207
- var _a, _b;
2208
2311
  Object.defineProperty(this, "_backendModel", {
2209
2312
  enumerable: true,
2210
2313
  configurable: true,
@@ -2243,8 +2346,8 @@ class BatchOperation {
2243
2346
  });
2244
2347
  this._backendModel = backendModel;
2245
2348
  this._state = backendModel.State ? mapBatchOperationState(backendModel.State) : undefined;
2246
- this._validationErrors = (_a = backendModel.ValidationErrors) === null || _a === void 0 ? void 0 : _a.map(e => new ValidationError(e));
2247
- this._validationWarnings = (_b = backendModel.ValidationWarnings) === null || _b === void 0 ? void 0 : _b.map(w => new ValidationWarning(w));
2349
+ this._validationErrors = backendModel.ValidationErrors?.map(e => new ValidationError(e));
2350
+ this._validationWarnings = backendModel.ValidationWarnings?.map(w => new ValidationWarning(w));
2248
2351
  this._subject = subject;
2249
2352
  this._createdItems = backendModel.CreatedItems
2250
2353
  ? backendModel.CreatedItems.map(i => parseItemUri(i))
@@ -2516,12 +2619,104 @@ class MappingRegistry {
2516
2619
  this._mappings.push(mapping);
2517
2620
  }
2518
2621
  map(fromModel) {
2519
- var _a;
2520
- const modelMapper = (_a = this._mappings.find(map => map.identifier(fromModel))) === null || _a === void 0 ? void 0 : _a.mapper;
2521
- return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper(this, fromModel);
2622
+ const modelMapper = this._mappings.find(map => map.identifier(fromModel))?.mapper;
2623
+ return modelMapper?.(this, fromModel);
2624
+ }
2625
+ }
2626
+
2627
+ const mapDate = (rawDate) => {
2628
+ const date = new Date(rawDate);
2629
+ // If called with an invalid date string, it returns a Date object whose `toString()` method returns the literal string `Invalid Date`.
2630
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date
2631
+ if (date.toString() === 'Invalid Date')
2632
+ return undefined;
2633
+ return date;
2634
+ };
2635
+
2636
+ const contentMapping = (mappingRegistry, contentObject) => {
2637
+ if (typeof contentObject !== 'object' || contentObject === null) {
2638
+ throw new Error('Please make sure that content property is of type `Record<string, any>`');
2639
+ }
2640
+ const mappedContent = {};
2641
+ for (const key in contentObject) {
2642
+ const value = contentObject[key];
2643
+ if (typeof value === 'object' && value !== null) {
2644
+ if (Array.isArray(value)) {
2645
+ mappedContent[key] = value.map(itemValue => {
2646
+ if (typeof itemValue !== 'object' || itemValue === null) {
2647
+ return itemValue;
2648
+ }
2649
+ if ('$type' in itemValue) {
2650
+ return mappingRegistry.map(itemValue);
2651
+ }
2652
+ return contentMapping(mappingRegistry, itemValue);
2653
+ });
2654
+ continue;
2655
+ }
2656
+ // Map to a Model if object has `$type`
2657
+ if ('$type' in value) {
2658
+ mappedContent[key] = mappingRegistry.map(value);
2659
+ continue;
2660
+ }
2661
+ if (mappedContent[key] === undefined) {
2662
+ // 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)
2663
+ mappedContent[key] = contentMapping(mappingRegistry, value);
2664
+ continue;
2665
+ }
2666
+ }
2667
+ else {
2668
+ // Value is a primitive (e.g. string, number, boolean)
2669
+ mappedContent[key] = value;
2670
+ }
2671
+ }
2672
+ return mappedContent;
2673
+ };
2674
+
2675
+ class Settings {
2676
+ constructor({ backendModel, data }) {
2677
+ Object.defineProperty(this, "_backendModel", {
2678
+ enumerable: true,
2679
+ configurable: true,
2680
+ writable: true,
2681
+ value: void 0
2682
+ });
2683
+ Object.defineProperty(this, "_data", {
2684
+ enumerable: true,
2685
+ configurable: true,
2686
+ writable: true,
2687
+ value: void 0
2688
+ });
2689
+ Object.defineProperty(this, "getInternalModel", {
2690
+ enumerable: true,
2691
+ configurable: true,
2692
+ writable: true,
2693
+ value: () => {
2694
+ return this._backendModel;
2695
+ }
2696
+ });
2697
+ this._backendModel = backendModel;
2698
+ this._data = data;
2699
+ }
2700
+ get data() {
2701
+ return this._data;
2522
2702
  }
2523
2703
  }
2524
2704
 
2705
+ const mapSettingsConstructorArgs = (registry, backendModel) => {
2706
+ const data = contentMapping(registry, backendModel.Data);
2707
+ return { data };
2708
+ };
2709
+ const settingsMapping = {
2710
+ identifier: backendModel => backendModel?.$type === 'Settings',
2711
+ mapper: (registry, backendModel) => {
2712
+ const { data } = mapSettingsConstructorArgs(registry, backendModel);
2713
+ return new Settings({
2714
+ backendModel,
2715
+ data,
2716
+ });
2717
+ },
2718
+ };
2719
+
2525
2720
  const permissionMapping = (backendModel) => {
2526
2721
  switch (backendModel) {
2527
2722
  case Permissions.ALL:
@@ -2593,13 +2788,12 @@ const rightMapping = (backendModel) => {
2593
2788
  };
2594
2789
 
2595
2790
  const accessControlEntryMapping = {
2596
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AccessControlEntry',
2791
+ identifier: backendModel => backendModel?.$type === 'AccessControlEntry',
2597
2792
  mapper: (mappingRegistry, backendModel) => {
2598
- var _a, _b, _c, _d;
2599
- const allowedPermissions = (_a = backendModel.AllowedPermissions) === null || _a === void 0 ? void 0 : _a.map(p => permissionMapping(p));
2600
- const allowedRights = (_b = backendModel.AllowedRights) === null || _b === void 0 ? void 0 : _b.map(r => rightMapping(r));
2601
- const deniedPermissions = (_c = backendModel.DeniedPermissions) === null || _c === void 0 ? void 0 : _c.map(p => permissionMapping(p));
2602
- const deniedRights = (_d = backendModel.DeniedRights) === null || _d === void 0 ? void 0 : _d.map(r => rightMapping(r));
2793
+ const allowedPermissions = backendModel.AllowedPermissions?.map(p => permissionMapping(p));
2794
+ const allowedRights = backendModel.AllowedRights?.map(r => rightMapping(r));
2795
+ const deniedPermissions = backendModel.DeniedPermissions?.map(p => permissionMapping(p));
2796
+ const deniedRights = backendModel.DeniedRights?.map(r => rightMapping(r));
2603
2797
  const trustee = backendModel.Trustee ? mappingRegistry.map(backendModel.Trustee) : undefined;
2604
2798
  return new AccessControlEntry({
2605
2799
  allowedPermissions,
@@ -2631,20 +2825,18 @@ const isExactInstanceOf = (value, ctor) => {
2631
2825
  };
2632
2826
 
2633
2827
  const accessControlListMapping = {
2634
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AccessControlList',
2828
+ identifier: backendModel => backendModel?.$type === 'AccessControlList',
2635
2829
  mapper: (mappingRegistry, backendModel) => {
2636
- var _a;
2637
- const accessControlEntries = (_a = backendModel.AccessControlEntries) === null || _a === void 0 ? void 0 : _a.map(e => mappingRegistry.map(e)).filter(isDefined);
2830
+ const accessControlEntries = backendModel.AccessControlEntries?.map(e => mappingRegistry.map(e)).filter(isDefined);
2638
2831
  return new AccessControlList({ accessControlEntries, backendModel });
2639
2832
  },
2640
2833
  };
2641
2834
 
2642
2835
  const securityDescriptorMapping = {
2643
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SecurityDescriptor',
2836
+ identifier: backendModel => backendModel?.$type === 'SecurityDescriptor',
2644
2837
  mapper: (mappingRegistry, backendModel) => {
2645
- var _a, _b;
2646
- const permissions = (_a = backendModel.Permissions) === null || _a === void 0 ? void 0 : _a.map(p => permissionMapping(p));
2647
- const rights = (_b = backendModel.Rights) === null || _b === void 0 ? void 0 : _b.map(r => rightMapping(r));
2838
+ const permissions = backendModel.Permissions?.map(p => permissionMapping(p));
2839
+ const rights = backendModel.Rights?.map(r => rightMapping(r));
2648
2840
  return new SecurityDescriptor({ backendModel, permissions, rights });
2649
2841
  },
2650
2842
  };
@@ -2662,47 +2854,13 @@ const mapStringSearchModeToBackend = (backendModel) => {
2662
2854
  }
2663
2855
  };
2664
2856
 
2665
- const mapDate = (rawDate) => {
2666
- const date = new Date(rawDate);
2667
- // If called with an invalid date string, it returns a Date object whose `toString()` method returns the literal string `Invalid Date`.
2668
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date
2669
- if (date.toString() === 'Invalid Date')
2670
- return undefined;
2671
- return date;
2672
- };
2673
-
2674
- const contentMapping = (mappingRegistry, contentObject) => {
2675
- if (typeof contentObject !== 'object' || contentObject === null) {
2676
- throw new Error('Please make sure that content property is of type `Record<string, any>`');
2677
- }
2678
- const mappedContent = {};
2679
- for (const key in contentObject) {
2680
- const value = contentObject[key];
2681
- if (typeof value === 'object' && value !== null) {
2682
- // Map to a Model if object has `$type`
2683
- if ('$type' in value) {
2684
- mappedContent[key] = mappingRegistry.map(value);
2685
- }
2686
- if (mappedContent[key] === undefined) {
2687
- // 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)
2688
- mappedContent[key] = contentMapping(mappingRegistry, value);
2689
- }
2690
- }
2691
- else {
2692
- // Value is a primitive (e.g. string, number, boolean)
2693
- mappedContent[key] = value;
2694
- }
2695
- }
2696
- return mappedContent;
2697
- };
2698
-
2699
2857
  const mapBasicVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
2700
2858
  const creationDate = backendModel.CreationDate ? mapDate(backendModel.CreationDate) : undefined;
2701
2859
  const revisionDate = backendModel.RevisionDate ? mapDate(backendModel.RevisionDate) : undefined;
2702
2860
  return { creationDate, revisionDate };
2703
2861
  };
2704
2862
  const basicVersionInfoMapping = {
2705
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BasicVersionInfo',
2863
+ identifier: backendModel => backendModel?.$type === 'BasicVersionInfo',
2706
2864
  mapper: (mappingRegistry, backendModel) => {
2707
2865
  const { creationDate, revisionDate } = mapBasicVersionInfoConstructorArgs(mappingRegistry, backendModel);
2708
2866
  return new BasicVersionInfo({ backendModel, creationDate, revisionDate });
@@ -2737,14 +2895,13 @@ const mapErrorTypeToBackend = (errorType) => {
2737
2895
  };
2738
2896
 
2739
2897
  const mapIdentifiableObjectConstructorArgs = (mappingRegistry, backendModel) => {
2740
- var _a, _b;
2741
2898
  const id = parseItemUri(backendModel.Id);
2742
2899
  const loadInfo = backendModel.LoadInfo ? mappingRegistry.map(backendModel.LoadInfo) : undefined;
2743
2900
  const basicVersionInfo = backendModel.VersionInfo
2744
2901
  ? mappingRegistry.map(backendModel.VersionInfo)
2745
2902
  : undefined;
2746
- const applicableActions = (_a = backendModel.ApplicableActions) === null || _a === void 0 ? void 0 : _a.map(action => mappingRegistry.map(action)).filter(isDefined);
2747
- const listLinks = (_b = backendModel.ListLinks) === null || _b === void 0 ? void 0 : _b.map(link => mappingRegistry.map(link)).filter(isDefined);
2903
+ const applicableActions = backendModel.ApplicableActions?.map(action => mappingRegistry.map(action)).filter(isDefined);
2904
+ const listLinks = backendModel.ListLinks?.map(link => mappingRegistry.map(link)).filter(isDefined);
2748
2905
  const securityDescriptor = backendModel.SecurityDescriptor
2749
2906
  ? mappingRegistry.map(backendModel.SecurityDescriptor)
2750
2907
  : undefined;
@@ -2787,7 +2944,7 @@ const mapLoadInfoConstructorArgs = (mappingRegistry, backendModel) => {
2787
2944
  return { errorType, state };
2788
2945
  };
2789
2946
  const loadInfoMapping = {
2790
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LoadInfo',
2947
+ identifier: backendModel => backendModel?.$type === 'LoadInfo',
2791
2948
  mapper: (mappingRegistry, backendModel) => {
2792
2949
  const { errorType, state } = mapLoadInfoConstructorArgs(mappingRegistry, backendModel);
2793
2950
  return new LoadInfo({ backendModel, errorType, state });
@@ -2814,7 +2971,7 @@ const mapWhereUsedListInfoConstructorArgs = (mappingRegistry, backendModel) => {
2814
2971
  return { commentToken };
2815
2972
  };
2816
2973
  const whereUsedListInfoMapping = {
2817
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'WhereUsedListInfo',
2974
+ identifier: backendModel => backendModel?.$type === 'WhereUsedListInfo',
2818
2975
  mapper: (mappingRegistry, backendModel) => {
2819
2976
  const { commentToken } = mapWhereUsedListInfoConstructorArgs(mappingRegistry, backendModel);
2820
2977
  return new WhereUsedListInfo({ backendModel, commentToken });
@@ -2825,22 +2982,28 @@ const mapSystemWideObjectConstructorArgs = mapIdentifiableObjectConstructorArgs;
2825
2982
 
2826
2983
  const mapApprovalStatusConstructorArgs = mapSystemWideObjectConstructorArgs;
2827
2984
  const approvalStatusMapping = {
2828
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ApprovalStatus',
2985
+ identifier: backendModel => backendModel?.$type === 'ApprovalStatus',
2829
2986
  mapper: (mappingRegistry, backendModel) => {
2830
- return new ApprovalStatus(Object.assign(Object.assign({}, mapApprovalStatusConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2987
+ return new ApprovalStatus({
2988
+ ...mapApprovalStatusConstructorArgs(mappingRegistry, backendModel),
2989
+ backendModel,
2990
+ });
2831
2991
  },
2832
2992
  };
2833
2993
 
2834
2994
  const mapMultimediaTypeConstructorArgs = mapSystemWideObjectConstructorArgs;
2835
2995
  const multimediaTypeMapping = {
2836
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultimediaType',
2996
+ identifier: backendModel => backendModel?.$type === 'MultimediaType',
2837
2997
  mapper: (mappingRegistry, backendModel) => {
2838
- return new MultimediaType(Object.assign(Object.assign({}, mapMultimediaTypeConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
2998
+ return new MultimediaType({
2999
+ ...mapMultimediaTypeConstructorArgs(mappingRegistry, backendModel),
3000
+ backendModel,
3001
+ });
2839
3002
  },
2840
3003
  };
2841
3004
 
2842
3005
  const hateoasLinkMapping = {
2843
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'HateoasLink',
3006
+ identifier: backendModel => backendModel?.$type === 'HateoasLink',
2844
3007
  mapper: (mappingRegistry, backendModel) => {
2845
3008
  return new HateoasLink(backendModel);
2846
3009
  },
@@ -2849,7 +3012,7 @@ const hateoasLinkMapping = {
2849
3012
  const mapLinkConstructorArgs = (mappingRegistry, backendModel) => {
2850
3013
  let idRef = backendModel && tryParseItemUri(backendModel.IdRef);
2851
3014
  let isDynamicTarget = false;
2852
- if ((idRef === null || idRef === void 0 ? void 0 : idRef.isDynamic) && (idRef instanceof TcmUri || idRef instanceof EclUri)) {
3015
+ if ((idRef instanceof TcmUri || idRef instanceof EclUri) && idRef?.isDynamic) {
2853
3016
  idRef = idRef.getVersionlessUri();
2854
3017
  isDynamicTarget = true;
2855
3018
  }
@@ -2858,7 +3021,7 @@ const mapLinkConstructorArgs = (mappingRegistry, backendModel) => {
2858
3021
  return { idRef, isDynamicTarget };
2859
3022
  };
2860
3023
  const linkMapping = {
2861
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Link',
3024
+ identifier: backendModel => backendModel?.$type === 'Link',
2862
3025
  mapper: (mappingRegistry, backendModel) => {
2863
3026
  const linkConstructorArgs = mapLinkConstructorArgs(mappingRegistry, backendModel);
2864
3027
  if (!linkConstructorArgs) {
@@ -2892,7 +3055,7 @@ const mapLinks = (mappingRegistry, backendLinks) => {
2892
3055
 
2893
3056
  const mapLinkWithIsEditableConstructorArgs = mapLinkConstructorArgs;
2894
3057
  const linkWithEditableMapping = {
2895
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LinkWithIsEditable',
3058
+ identifier: backendModel => backendModel?.$type === 'LinkWithIsEditable',
2896
3059
  mapper: (mappingRegistry, backendModel) => {
2897
3060
  const linkWithIsEditableConstructorArgs = mapLinkWithIsEditableConstructorArgs(mappingRegistry, backendModel);
2898
3061
  if (!linkWithIsEditableConstructorArgs)
@@ -2931,7 +3094,9 @@ const mapRepositoryConstructorArgs = (mappingRegistry, backendModel) => {
2931
3094
  const versionInfo = backendModel.VersionInfo
2932
3095
  ? mappingRegistry.map(backendModel.VersionInfo)
2933
3096
  : undefined;
2934
- return Object.assign(Object.assign({}, systemWideObjectConstructorArgs), { accessControlList,
3097
+ return {
3098
+ ...systemWideObjectConstructorArgs,
3099
+ accessControlList,
2935
3100
  businessProcessType,
2936
3101
  contentSecurityDescriptor,
2937
3102
  defaultMultimediaSchema,
@@ -2941,12 +3106,16 @@ const mapRepositoryConstructorArgs = (mappingRegistry, backendModel) => {
2941
3106
  parents,
2942
3107
  rootFolder,
2943
3108
  taskProcess,
2944
- versionInfo });
3109
+ versionInfo,
3110
+ };
2945
3111
  };
2946
3112
  const repositoryMapping = {
2947
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Repository',
3113
+ identifier: backendModel => backendModel?.$type === 'Repository',
2948
3114
  mapper: (mappingRegistry, backendModel) => {
2949
- return new Repository(Object.assign(Object.assign({}, mapRepositoryConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3115
+ return new Repository({
3116
+ ...mapRepositoryConstructorArgs(mappingRegistry, backendModel),
3117
+ backendModel,
3118
+ });
2950
3119
  },
2951
3120
  };
2952
3121
 
@@ -2979,7 +3148,9 @@ const mapPublicationConstructorArgs = (mappingRegistry, backendModel) => {
2979
3148
  const templateBundleProcess = backendModel.TemplateBundleProcess
2980
3149
  ? mappingRegistry.map(backendModel.TemplateBundleProcess)
2981
3150
  : undefined;
2982
- return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { componentSnapshotTemplate,
3151
+ return {
3152
+ ...repositoryLocalObjectConstructorArgs,
3153
+ componentSnapshotTemplate,
2983
3154
  componentTemplateProcess,
2984
3155
  defaultComponentTemplate,
2985
3156
  defaultPageTemplate,
@@ -2987,12 +3158,16 @@ const mapPublicationConstructorArgs = (mappingRegistry, backendModel) => {
2987
3158
  pageSnapshotTemplate,
2988
3159
  pageTemplateProcess,
2989
3160
  rootStructureGroup,
2990
- templateBundleProcess });
3161
+ templateBundleProcess,
3162
+ };
2991
3163
  };
2992
3164
  const publicationMapping = {
2993
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Publication',
3165
+ identifier: backendModel => backendModel?.$type === 'Publication',
2994
3166
  mapper: (mappingRegistry, backendModel) => {
2995
- return new Publication(Object.assign(Object.assign({}, mapPublicationConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3167
+ return new Publication({
3168
+ ...mapPublicationConstructorArgs(mappingRegistry, backendModel),
3169
+ backendModel,
3170
+ });
2996
3171
  },
2997
3172
  };
2998
3173
 
@@ -3018,7 +3193,7 @@ const mapPublishPriorityToBackend = (model) => {
3018
3193
  };
3019
3194
 
3020
3195
  const targetTypeMapping = {
3021
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetType',
3196
+ identifier: backendModel => backendModel?.$type === 'TargetType',
3022
3197
  mapper: (mappingRegistry, backendModel) => {
3023
3198
  const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo } = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
3024
3199
  const accessControlList = backendModel.AccessControlList
@@ -3056,8 +3231,7 @@ const batchOperationMapping = (mappingRegistry, backendModel) => {
3056
3231
  if (!backendModel.Statuses)
3057
3232
  return undefined;
3058
3233
  return backendModel.Statuses.map(status => {
3059
- var _a;
3060
- const subjectLink = (_a = backendModel.SubjectLinks) === null || _a === void 0 ? void 0 : _a.find(s => s.IdRef === status.SubjectId);
3234
+ const subjectLink = backendModel.SubjectLinks?.find(s => s.IdRef === status.SubjectId);
3061
3235
  const link = mappingRegistry.map(subjectLink);
3062
3236
  return new BatchOperation(status, link);
3063
3237
  });
@@ -3087,25 +3261,30 @@ const batchTypeMapping = (backendType) => {
3087
3261
  };
3088
3262
 
3089
3263
  const mapBatchConstructorArgs = (mappingRegistry, backendModel) => {
3090
- var _a;
3091
3264
  const systemWideObjectConstructorArgs = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
3092
3265
  const performer = backendModel.Performer ? mappingRegistry.map(backendModel.Performer) : undefined;
3093
- const backendBatchOperation = (_a = backendModel.Operations) === null || _a === void 0 ? void 0 : _a[0];
3094
- const type = (backendBatchOperation === null || backendBatchOperation === void 0 ? void 0 : backendBatchOperation.Operation) ? batchTypeMapping(backendBatchOperation.Operation) : undefined;
3266
+ const backendBatchOperation = backendModel.Operations?.[0];
3267
+ const type = backendBatchOperation?.Operation ? batchTypeMapping(backendBatchOperation.Operation) : undefined;
3095
3268
  const operations = backendBatchOperation
3096
3269
  ? batchOperationMapping(mappingRegistry, backendBatchOperation)
3097
3270
  : undefined;
3098
3271
  const status = operations ? determineBatchStatus(operations) : undefined;
3099
- return Object.assign(Object.assign({}, systemWideObjectConstructorArgs), { performer,
3272
+ return {
3273
+ ...systemWideObjectConstructorArgs,
3274
+ performer,
3100
3275
  type,
3101
3276
  operations,
3102
3277
  status,
3103
- backendBatchOperation });
3278
+ backendBatchOperation,
3279
+ };
3104
3280
  };
3105
3281
  const batchMapping = {
3106
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Batch',
3282
+ identifier: backendModel => backendModel?.$type === 'Batch',
3107
3283
  mapper: (mappingRegistry, backendModel) => {
3108
- return new Batch(Object.assign(Object.assign({}, mapBatchConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
3284
+ return new Batch({
3285
+ ...mapBatchConstructorArgs(mappingRegistry, backendModel),
3286
+ backendModel,
3287
+ });
3109
3288
  },
3110
3289
  };
3111
3290
 
@@ -3218,7 +3397,7 @@ const mapBinaryContentConstructorArgs = (mappingRegistry, backendModel) => {
3218
3397
  return { multimediaType };
3219
3398
  };
3220
3399
  const binaryContentMapping = {
3221
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BinaryContent',
3400
+ identifier: backendModel => backendModel?.$type === 'BinaryContent',
3222
3401
  mapper: (mappingRegistry, backendModel) => {
3223
3402
  const { multimediaType } = mapBinaryContentConstructorArgs(mappingRegistry, backendModel);
3224
3403
  return new BinaryContent({ backendModel, multimediaType });
@@ -3295,7 +3474,7 @@ const mapClassificationDetailConstructorArgs = (mappingRegistry, backendModel) =
3295
3474
  return { category, keywords };
3296
3475
  };
3297
3476
  const classificationDetailMapping = {
3298
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ClassificationDetail',
3477
+ identifier: backendModel => backendModel?.$type === 'ClassificationDetail',
3299
3478
  mapper: (mappingRegistry, backendModel) => {
3300
3479
  const { category, keywords } = mapClassificationDetailConstructorArgs(mappingRegistry, backendModel);
3301
3480
  return new ClassificationDetail({ backendModel, category, keywords });
@@ -3352,13 +3531,12 @@ class ClassificationInfo {
3352
3531
  }
3353
3532
 
3354
3533
  const mapClassificationInfoConstructorArgs = (mappingRegistry, backendModel) => {
3355
- var _a;
3356
- const details = (_a = backendModel.Details) === null || _a === void 0 ? void 0 : _a.map(c => mappingRegistry.map(c)).filter(isDefined);
3534
+ const details = backendModel.Details?.map(c => mappingRegistry.map(c)).filter(isDefined);
3357
3535
  const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
3358
3536
  return { details, item };
3359
3537
  };
3360
3538
  const classificationInfoMapping = {
3361
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ClassificationInfo',
3539
+ identifier: backendModel => backendModel?.$type === 'ClassificationInfo',
3362
3540
  mapper: (mappingRegistry, backendModel) => {
3363
3541
  const { details, item } = mapClassificationInfoConstructorArgs(mappingRegistry, backendModel);
3364
3542
  return new ClassificationInfo({ backendModel, details, item });
@@ -3485,8 +3663,7 @@ class BlueprintInfo {
3485
3663
  * Limited version info for Repository-Local Objects.
3486
3664
  */
3487
3665
  class LimitedVersionInfo extends BasicVersionInfo {
3488
- constructor(_a) {
3489
- var { creator } = _a, basicVersionInfoArgs = __rest(_a, ["creator"]);
3666
+ constructor({ creator, ...basicVersionInfoArgs }) {
3490
3667
  super(basicVersionInfoArgs);
3491
3668
  Object.defineProperty(this, "_creator", {
3492
3669
  enumerable: true,
@@ -3642,9 +3819,8 @@ class LockInfo {
3642
3819
  * Abstract base class for the data of repository-local data objects: data objects that reside in a "Repository".
3643
3820
  */
3644
3821
  class RepositoryLocalObject extends IdentifiableObject {
3645
- constructor(_a) {
3646
- var { backendModel, blueprintInfo, isLocked, limitedVersionInfo, locationInfo, lockInfo, metadata, metadataSchema } = _a, identifiableObjectArgs = __rest(_a, ["backendModel", "blueprintInfo", "isLocked", "limitedVersionInfo", "locationInfo", "lockInfo", "metadata", "metadataSchema"]);
3647
- super(Object.assign({ backendModel }, identifiableObjectArgs));
3822
+ constructor({ backendModel, blueprintInfo, isLocked, limitedVersionInfo, locationInfo, lockInfo, metadata, metadataSchema, ...identifiableObjectArgs }) {
3823
+ super({ backendModel, ...identifiableObjectArgs });
3648
3824
  Object.defineProperty(this, "_limitedVersionInfo", {
3649
3825
  enumerable: true,
3650
3826
  configurable: true,
@@ -3692,8 +3868,7 @@ class RepositoryLocalObject extends IdentifiableObject {
3692
3868
  configurable: true,
3693
3869
  writable: true,
3694
3870
  value: (lockType) => {
3695
- var _a;
3696
- return !!((_a = this._lockInfo) === null || _a === void 0 ? void 0 : _a.lockType.includes(lockType));
3871
+ return !!this._lockInfo?.lockType.includes(lockType);
3697
3872
  }
3698
3873
  });
3699
3874
  Object.defineProperty(this, "isLockedByCurrentUser", {
@@ -3701,10 +3876,9 @@ class RepositoryLocalObject extends IdentifiableObject {
3701
3876
  configurable: true,
3702
3877
  writable: true,
3703
3878
  value: (currentUser) => {
3704
- var _a, _b;
3705
3879
  if (!currentUser.user)
3706
3880
  return false;
3707
- return ((_b = (_a = this._lockInfo) === null || _a === void 0 ? void 0 : _a.lockUser) === null || _b === void 0 ? void 0 : _b.idRef) === currentUser.user.id;
3881
+ return this._lockInfo?.lockUser?.idRef === currentUser.user.id;
3708
3882
  }
3709
3883
  });
3710
3884
  Object.defineProperty(this, "getInternalModel", {
@@ -3762,9 +3936,8 @@ class RepositoryLocalObject extends IdentifiableObject {
3762
3936
  * Limited version info for Repository-Local Objects.
3763
3937
  */
3764
3938
  class FullVersionInfo extends LimitedVersionInfo {
3765
- constructor(_a) {
3766
- var { backendModel, checkoutUser, lockType, revisor, checkOutDate } = _a, limitedVersionInfoArgs = __rest(_a, ["backendModel", "checkoutUser", "lockType", "revisor", "checkOutDate"]);
3767
- super(Object.assign({ backendModel }, limitedVersionInfoArgs));
3939
+ constructor({ backendModel, checkoutUser, lockType, revisor, checkOutDate, ...limitedVersionInfoArgs }) {
3940
+ super({ backendModel, ...limitedVersionInfoArgs });
3768
3941
  Object.defineProperty(this, "_checkoutUser", {
3769
3942
  enumerable: true,
3770
3943
  configurable: true,
@@ -3862,9 +4035,8 @@ class FullVersionInfo extends LimitedVersionInfo {
3862
4035
  * Abstract base class for Versioned Items.
3863
4036
  */
3864
4037
  class VersionedItem extends RepositoryLocalObject {
3865
- constructor(_a) {
3866
- var { backendModel, dynamicVersionInfo, fullVersionInfo, isDynamic } = _a, rloArgs = __rest(_a, ["backendModel", "dynamicVersionInfo", "fullVersionInfo", "isDynamic"]);
3867
- super(Object.assign({ backendModel }, rloArgs));
4038
+ constructor({ backendModel, dynamicVersionInfo, fullVersionInfo, isDynamic, ...rloArgs }) {
4039
+ super({ backendModel, ...rloArgs });
3868
4040
  Object.defineProperty(this, "_dynamicVersionInfo", {
3869
4041
  enumerable: true,
3870
4042
  configurable: true,
@@ -3896,8 +4068,7 @@ class VersionedItem extends RepositoryLocalObject {
3896
4068
  this._fullVersionInfo = fullVersionInfo;
3897
4069
  }
3898
4070
  get isAwaitingFirstCheckIn() {
3899
- var _a;
3900
- return ((_a = this._fullVersionInfo) === null || _a === void 0 ? void 0 : _a.isNew) || false;
4071
+ return this._fullVersionInfo?.isNew || false;
3901
4072
  }
3902
4073
  get isDynamic() {
3903
4074
  return this._isDynamic;
@@ -3922,9 +4093,8 @@ class VersionedItem extends RepositoryLocalObject {
3922
4093
  * Represents the data of a Component: a generic holder of content and metadata.
3923
4094
  */
3924
4095
  class ComponentBase extends VersionedItem {
3925
- constructor(_a) {
3926
- var { backendModel, approvalStatus, componentType, schema, workflowInfo } = _a, componentBaseArgs = __rest(_a, ["backendModel", "approvalStatus", "componentType", "schema", "workflowInfo"]);
3927
- super(Object.assign({ backendModel }, componentBaseArgs));
4096
+ constructor({ backendModel, approvalStatus, componentType, schema, workflowInfo, ...componentBaseArgs }) {
4097
+ super({ backendModel, ...componentBaseArgs });
3928
4098
  Object.defineProperty(this, "_approvalStatus", {
3929
4099
  enumerable: true,
3930
4100
  configurable: true,
@@ -4006,9 +4176,8 @@ class ComponentBase extends VersionedItem {
4006
4176
  * Represents the data of a regular Component: content and metadata fields.
4007
4177
  */
4008
4178
  class Component extends ComponentBase {
4009
- constructor(_a) {
4010
- var { content, backendModel } = _a, componentBaseArgs = __rest(_a, ["content", "backendModel"]);
4011
- super(Object.assign({ backendModel }, componentBaseArgs));
4179
+ constructor({ content, backendModel, ...componentBaseArgs }) {
4180
+ super({ backendModel, ...componentBaseArgs });
4012
4181
  Object.defineProperty(this, "_content", {
4013
4182
  enumerable: true,
4014
4183
  configurable: true,
@@ -4026,8 +4195,7 @@ class Component extends ComponentBase {
4026
4195
  * Represents the data of a Multimedia Component: binary content data and metadata fields.
4027
4196
  */
4028
4197
  class MultimediaComponent extends ComponentBase {
4029
- constructor(_a) {
4030
- var { binaryContent } = _a, componentBaseArgs = __rest(_a, ["binaryContent"]);
4198
+ constructor({ binaryContent, ...componentBaseArgs }) {
4031
4199
  super(componentBaseArgs);
4032
4200
  Object.defineProperty(this, "_binaryContent", {
4033
4201
  enumerable: true,
@@ -4049,8 +4217,7 @@ class MultimediaComponent extends ComponentBase {
4049
4217
  * Represents an External Multimedia Component: an item provided from external system.
4050
4218
  */
4051
4219
  class ExternalMultimediaComponent extends MultimediaComponent {
4052
- constructor(_a) {
4053
- var { externalMetadataSchemaFields } = _a, multimediaComponentArgs = __rest(_a, ["externalMetadataSchemaFields"]);
4220
+ constructor({ externalMetadataSchemaFields, ...multimediaComponentArgs }) {
4054
4221
  super(multimediaComponentArgs);
4055
4222
  Object.defineProperty(this, "_externalMetadataSchemaFields", {
4056
4223
  enumerable: true,
@@ -4134,9 +4301,12 @@ const mapDynamicVersionInfoConstructorArgs = (mappingRegistry, backendModel) =>
4134
4301
  return { revisor, revisionDate };
4135
4302
  };
4136
4303
  const dynamicVersionInfoMapping = {
4137
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DynamicVersionInfo',
4304
+ identifier: backendModel => backendModel?.$type === 'DynamicVersionInfo',
4138
4305
  mapper: (mappingRegistry, backendModel) => {
4139
- return new DynamicVersionInfo(Object.assign(Object.assign({}, mapDynamicVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4306
+ return new DynamicVersionInfo({
4307
+ ...mapDynamicVersionInfoConstructorArgs(mappingRegistry, backendModel),
4308
+ backendModel,
4309
+ });
4140
4310
  },
4141
4311
  };
4142
4312
 
@@ -4150,21 +4320,27 @@ const mapBlueprintInfoConstructorArgs = (mappingRegistry, backendModel) => {
4150
4320
  return { owningRepository, primaryBlueprintParentItem };
4151
4321
  };
4152
4322
  const blueprintInfoMapping = {
4153
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BlueprintInfo',
4323
+ identifier: backendModel => backendModel?.$type === 'BlueprintInfo',
4154
4324
  mapper: (mappingRegistry, backendModel) => {
4155
- return new BlueprintInfo(Object.assign(Object.assign({}, mapBlueprintInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4325
+ return new BlueprintInfo({
4326
+ ...mapBlueprintInfoConstructorArgs(mappingRegistry, backendModel),
4327
+ backendModel,
4328
+ });
4156
4329
  },
4157
4330
  };
4158
4331
 
4159
4332
  const mapLimitedVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
4160
4333
  const basicVersionInfoConstructorArgs = mapBasicVersionInfoConstructorArgs(mappingRegistry, backendModel);
4161
4334
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
4162
- return Object.assign(Object.assign({}, basicVersionInfoConstructorArgs), { creator });
4335
+ return { ...basicVersionInfoConstructorArgs, creator };
4163
4336
  };
4164
4337
  const limitedVersionInfoMapping = {
4165
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LimitedVersionInfo',
4338
+ identifier: backendModel => backendModel?.$type === 'LimitedVersionInfo',
4166
4339
  mapper: (mappingRegistry, backendModel) => {
4167
- return new LimitedVersionInfo(Object.assign(Object.assign({}, mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4340
+ return new LimitedVersionInfo({
4341
+ ...mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel),
4342
+ backendModel,
4343
+ });
4168
4344
  },
4169
4345
  };
4170
4346
 
@@ -4178,9 +4354,12 @@ const mapLocationInfoConstructorArgs = (mappingRegistry, backendModel) => {
4178
4354
  return { contextRepository, organizationalItem };
4179
4355
  };
4180
4356
  const locationInfoMapping = {
4181
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LocationInfo',
4357
+ identifier: backendModel => backendModel?.$type === 'LocationInfo',
4182
4358
  mapper: (mappingRegistry, backendModel) => {
4183
- return new LocationInfo(Object.assign(Object.assign({}, mapLocationInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4359
+ return new LocationInfo({
4360
+ ...mapLocationInfoConstructorArgs(mappingRegistry, backendModel),
4361
+ backendModel,
4362
+ });
4184
4363
  },
4185
4364
  };
4186
4365
 
@@ -4222,16 +4401,18 @@ const mapLockTypeToBackend = (model) => {
4222
4401
  };
4223
4402
 
4224
4403
  const mapLockInfoConstructorArgs = (mappingRegistry, backendModel) => {
4225
- var _a;
4226
4404
  const lockUser = backendModel.LockUser ? mappingRegistry.map(backendModel.LockUser) : undefined;
4227
- const lockType = ((_a = backendModel.LockType) === null || _a === void 0 ? void 0 : _a.map(l => mapLockType(l))) || [];
4405
+ const lockType = backendModel.LockType?.map(l => mapLockType(l)) || [];
4228
4406
  const lockDate = backendModel.LockDate ? mapDate(backendModel.LockDate) : undefined;
4229
4407
  return { lockUser, lockType, lockDate };
4230
4408
  };
4231
4409
  const lockInfoMapping = {
4232
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'LockInfo',
4410
+ identifier: backendModel => backendModel?.$type === 'LockInfo',
4233
4411
  mapper: (mappingRegistry, backendModel) => {
4234
- return new LockInfo(Object.assign(Object.assign({}, mapLockInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4412
+ return new LockInfo({
4413
+ ...mapLockInfoConstructorArgs(mappingRegistry, backendModel),
4414
+ backendModel,
4415
+ });
4235
4416
  },
4236
4417
  };
4237
4418
 
@@ -4250,15 +4431,18 @@ const mapRepositoryLocalObjectConstructorArgs = (mappingRegistry, backendModel)
4250
4431
  ? mappingRegistry.map(backendModel.LocationInfo)
4251
4432
  : undefined;
4252
4433
  const lockInfo = backendModel.LockInfo ? mappingRegistry.map(backendModel.LockInfo) : undefined;
4253
- const isLocked = !!(lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.lockType.length) && !(lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.lockType.includes('none'));
4434
+ const isLocked = !!lockInfo?.lockType.length && !lockInfo?.lockType.includes('none');
4254
4435
  const metadata = backendModel.Metadata ? contentMapping(mappingRegistry, backendModel.Metadata) : undefined;
4255
- return Object.assign(Object.assign({}, identifiableObjectConstructorArgs), { blueprintInfo,
4436
+ return {
4437
+ ...identifiableObjectConstructorArgs,
4438
+ blueprintInfo,
4256
4439
  isLocked,
4257
4440
  limitedVersionInfo,
4258
4441
  locationInfo,
4259
4442
  lockInfo,
4260
4443
  metadataSchema,
4261
- metadata });
4444
+ metadata,
4445
+ };
4262
4446
  };
4263
4447
 
4264
4448
  const mapRloItemTypeToBackend = (rloItemType) => {
@@ -4308,35 +4492,43 @@ const mapVersionedItemConstructorArgs = (mappingRegistry, backendModel) => {
4308
4492
  : undefined;
4309
4493
  let isDynamic = false;
4310
4494
  // If id of an item passed is dynamic, sets versionless uri to _id prop instead.
4311
- if (repositoryLocalObjectConstructorArgs.id.isDynamic &&
4312
- (repositoryLocalObjectConstructorArgs.id instanceof TcmUri ||
4313
- repositoryLocalObjectConstructorArgs.id instanceof EclUri)) {
4495
+ if ((repositoryLocalObjectConstructorArgs.id instanceof TcmUri ||
4496
+ repositoryLocalObjectConstructorArgs.id instanceof EclUri) &&
4497
+ repositoryLocalObjectConstructorArgs.id.isDynamic) {
4314
4498
  repositoryLocalObjectConstructorArgs.id = repositoryLocalObjectConstructorArgs.id.getVersionlessUri();
4315
4499
  isDynamic = true;
4316
4500
  }
4317
- return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { dynamicVersionInfo,
4501
+ return {
4502
+ ...repositoryLocalObjectConstructorArgs,
4503
+ dynamicVersionInfo,
4318
4504
  fullVersionInfo,
4319
- isDynamic });
4505
+ isDynamic,
4506
+ };
4320
4507
  };
4321
4508
 
4322
4509
  const mapFullVersionInfoConstructorArgs = (mappingRegistry, backendModel) => {
4323
- var _a;
4324
4510
  const limitedVersionInfoConstructorArgs = mapLimitedVersionInfoConstructorArgs(mappingRegistry, backendModel);
4325
4511
  const checkoutUser = backendModel.CheckOutUser ? mappingRegistry.map(backendModel.CheckOutUser) : undefined;
4326
- const lockType = (_a = backendModel.LockType) === null || _a === void 0 ? void 0 : _a.map(l => mapLockType(l));
4512
+ const lockType = backendModel.LockType?.map(l => mapLockType(l));
4327
4513
  const revisor = backendModel.Revisor ? mappingRegistry.map(backendModel.Revisor) : undefined;
4328
4514
  const checkOutDate = backendModel.CheckOutDate ? mapDate(backendModel.CheckOutDate) : undefined;
4329
4515
  const revisionDate = backendModel.RevisionDate ? mapDate(backendModel.RevisionDate) : undefined;
4330
- return Object.assign(Object.assign({}, limitedVersionInfoConstructorArgs), { checkOutDate,
4516
+ return {
4517
+ ...limitedVersionInfoConstructorArgs,
4518
+ checkOutDate,
4331
4519
  checkoutUser,
4332
4520
  lockType,
4333
4521
  revisor,
4334
- revisionDate });
4522
+ revisionDate,
4523
+ };
4335
4524
  };
4336
4525
  const fullVersionInfoMapping = {
4337
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FullVersionInfo',
4526
+ identifier: backendModel => backendModel?.$type === 'FullVersionInfo',
4338
4527
  mapper: (mappingRegistry, backendModel) => {
4339
- return new FullVersionInfo(Object.assign(Object.assign({}, mapFullVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
4528
+ return new FullVersionInfo({
4529
+ ...mapFullVersionInfoConstructorArgs(mappingRegistry, backendModel),
4530
+ backendModel,
4531
+ });
4340
4532
  },
4341
4533
  };
4342
4534
 
@@ -4363,20 +4555,26 @@ const mapComponentBaseConstructorArgs = (mappingRegistry, backendModel) => {
4363
4555
  const workflowInfo = backendModel.WorkflowInfo
4364
4556
  ? mappingRegistry.map(backendModel.WorkflowInfo)
4365
4557
  : undefined;
4366
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { approvalStatus,
4558
+ return {
4559
+ ...versionedItemConstructorArgs,
4560
+ approvalStatus,
4367
4561
  componentType,
4368
4562
  schema,
4369
- workflowInfo });
4563
+ workflowInfo,
4564
+ };
4370
4565
  };
4371
4566
 
4372
4567
  const mapComponentConstructorArgs = mapComponentBaseConstructorArgs;
4373
4568
  // Maps multimedia component as a fallback
4374
4569
  const componentMapping = {
4375
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Component',
4570
+ identifier: backendModel => backendModel?.$type === 'Component',
4376
4571
  mapper: (mappingRegistry, backendModel) => {
4377
4572
  const content = backendModel.Content ? contentMapping(mappingRegistry, backendModel.Content) : undefined;
4378
- return new Component(Object.assign(Object.assign({}, mapComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel,
4379
- content }));
4573
+ return new Component({
4574
+ ...mapComponentConstructorArgs(mappingRegistry, backendModel),
4575
+ backendModel,
4576
+ content,
4577
+ });
4380
4578
  },
4381
4579
  };
4382
4580
 
@@ -4656,8 +4854,7 @@ class ListDefinition {
4656
4854
  * Provides information about whether/how to present a list of allowed date field values.
4657
4855
  */
4658
4856
  class DateListDefinition extends ListDefinition {
4659
- constructor(_a) {
4660
- var { entries: entires } = _a, listProps = __rest(_a, ["entries"]);
4857
+ constructor({ entries: entires, ...listProps }) {
4661
4858
  super(listProps);
4662
4859
  Object.defineProperty(this, "_entries", {
4663
4860
  enumerable: true,
@@ -5159,9 +5356,8 @@ class XhtmlFieldDefinition extends TextFieldDefinition {
5159
5356
  * Schema defines structure of content and/or metadata.
5160
5357
  */
5161
5358
  class Schema extends VersionedItem {
5162
- constructor(_a) {
5163
- var { backendModel, allowedMultimediaTypes, bundleProcess, componentProcess, fields, metadataFields, purpose } = _a, versionedItemProps = __rest(_a, ["backendModel", "allowedMultimediaTypes", "bundleProcess", "componentProcess", "fields", "metadataFields", "purpose"]);
5164
- super(Object.assign({ backendModel }, versionedItemProps));
5359
+ constructor({ backendModel, allowedMultimediaTypes, bundleProcess, componentProcess, fields, metadataFields, purpose, ...versionedItemProps }) {
5360
+ super({ backendModel, ...versionedItemProps });
5165
5361
  Object.defineProperty(this, "_allowedMultimediaTypes", {
5166
5362
  enumerable: true,
5167
5363
  configurable: true,
@@ -5279,28 +5475,28 @@ class Schema extends VersionedItem {
5279
5475
  }
5280
5476
 
5281
5477
  const externalLinkFieldDefinitionMapping = {
5282
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalLinkFieldDefinition',
5478
+ identifier: backendModel => backendModel?.$type === 'ExternalLinkFieldDefinition',
5283
5479
  mapper: (mappingRegistry, backendModel) => {
5284
5480
  return new ExternalLinkFieldDefinition(backendModel);
5285
5481
  },
5286
5482
  };
5287
5483
 
5288
5484
  const formattingFeaturesMapping = {
5289
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FormattingFeatures',
5485
+ identifier: backendModel => backendModel?.$type === 'FormattingFeatures',
5290
5486
  mapper: (mappingRegistry, backendModel) => {
5291
5487
  return new FormattingFeatures(backendModel);
5292
5488
  },
5293
5489
  };
5294
5490
 
5295
5491
  const multilineTextFieldDefinitionMapping = {
5296
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultiLineTextFieldDefinition',
5492
+ identifier: backendModel => backendModel?.$type === 'MultiLineTextFieldDefinition',
5297
5493
  mapper: (mappingRegistry, backendModel) => {
5298
5494
  return new MultiLineTextFieldDefinition(backendModel);
5299
5495
  },
5300
5496
  };
5301
5497
 
5302
5498
  const singleLineTextFieldDefinitionMapping = {
5303
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SingleLineTextFieldDefinition',
5499
+ identifier: backendModel => backendModel?.$type === 'SingleLineTextFieldDefinition',
5304
5500
  mapper: (mappingRegistry, backendModel) => {
5305
5501
  const list = backendModel.List
5306
5502
  ? mappingRegistry.map(backendModel.List)
@@ -5310,7 +5506,7 @@ const singleLineTextFieldDefinitionMapping = {
5310
5506
  };
5311
5507
 
5312
5508
  const singleLineTextListDefinitionMapping = {
5313
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SingleLineTextListDefinition',
5509
+ identifier: backendModel => backendModel?.$type === 'SingleLineTextListDefinition',
5314
5510
  mapper: (mappingRegistry, backendModel) => {
5315
5511
  const type = backendModel.Type ? mappingRegistry.map(backendModel.Type) : undefined;
5316
5512
  return new SingleLineTextListDefinition({ backendModel, type });
@@ -5318,7 +5514,7 @@ const singleLineTextListDefinitionMapping = {
5318
5514
  };
5319
5515
 
5320
5516
  const xhtmlFieldDefinitionMapping = {
5321
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'XhtmlFieldDefinition',
5517
+ identifier: backendModel => backendModel?.$type === 'XhtmlFieldDefinition',
5322
5518
  mapper: (mappingRegistry, backendModel) => {
5323
5519
  const formattingFeatures = backendModel.FormattingFeatures
5324
5520
  ? mappingRegistry.map(backendModel.FormattingFeatures)
@@ -5333,7 +5529,7 @@ const mapComponentLinkFieldDefinitionConstructorArgs = (mappingRegistry, backend
5333
5529
  return { allowedTargetSchemas, defaultValue };
5334
5530
  };
5335
5531
  const componentLinkFieldDefinitionMapping = {
5336
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentLinkFieldDefinition',
5532
+ identifier: backendModel => backendModel?.$type === 'ComponentLinkFieldDefinition',
5337
5533
  mapper: (mappingRegistry, backendModel) => {
5338
5534
  const { allowedTargetSchemas, defaultValue } = mapComponentLinkFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
5339
5535
  return new ComponentLinkFieldDefinition({ backendModel, allowedTargetSchemas, defaultValue });
@@ -5347,7 +5543,7 @@ const mapDateFieldDefinitionConstructorArgs = (mappingRegistry, backendModel) =>
5347
5543
  return { list, maxValue, minValue };
5348
5544
  };
5349
5545
  const dateFieldDefinitionMapping = {
5350
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DateFieldDefinition',
5546
+ identifier: backendModel => backendModel?.$type === 'DateFieldDefinition',
5351
5547
  mapper: (mappingRegistry, backendModel) => {
5352
5548
  const { list, maxValue, minValue } = mapDateFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
5353
5549
  return new DateFieldDefinition({ backendModel, list, maxValue, minValue });
@@ -5355,13 +5551,12 @@ const dateFieldDefinitionMapping = {
5355
5551
  };
5356
5552
 
5357
5553
  const mapDateListDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
5358
- var _a;
5359
5554
  const type = backendModel.Type ? mappingRegistry.map(backendModel.Type) : undefined;
5360
- const entries = (_a = backendModel.Entries) === null || _a === void 0 ? void 0 : _a.map(mapDate).filter(isDefined);
5555
+ const entries = backendModel.Entries?.map(mapDate).filter(isDefined);
5361
5556
  return { type, entries };
5362
5557
  };
5363
5558
  const dateListDefinitionMapping = {
5364
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DateListDefinition',
5559
+ identifier: backendModel => backendModel?.$type === 'DateListDefinition',
5365
5560
  mapper: (mappingRegistry, backendModel) => {
5366
5561
  const { type, entries } = mapDateListDefinitionConstructorArgs(mappingRegistry, backendModel);
5367
5562
  return new DateListDefinition({ backendModel, type, entries });
@@ -7233,7 +7428,7 @@ const mapObject = (object, mappingFunction) => {
7233
7428
  };
7234
7429
 
7235
7430
  const mapFieldsDefinitionDictionary = (mappingRegistry, backendModel) => {
7236
- const modelToMap = __rest(backendModel, ["$type"]);
7431
+ const { $type, ...modelToMap } = backendModel;
7237
7432
  if (Object.keys(modelToMap).length === 0) {
7238
7433
  return undefined;
7239
7434
  }
@@ -7252,7 +7447,7 @@ const mapEmbeddedSchemaFieldDefinitionConstructorArgs = (mappingRegistry, backen
7252
7447
  return { embeddedFields, embeddedSchema };
7253
7448
  };
7254
7449
  const embeddedSchemaFieldDefinitionMapping = {
7255
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'EmbeddedSchemaFieldDefinition',
7450
+ identifier: backendModel => backendModel?.$type === 'EmbeddedSchemaFieldDefinition',
7256
7451
  mapper: (mappingRegistry, backendModel) => {
7257
7452
  const { embeddedFields, embeddedSchema } = mapEmbeddedSchemaFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7258
7453
  return new EmbeddedSchemaFieldDefinition({ backendModel, embeddedFields, embeddedSchema });
@@ -7266,7 +7461,7 @@ const mapKeywordFieldDefinitionConstructorArgs = (mappingRegistry, backendModel)
7266
7461
  return { category, defaultValue, list };
7267
7462
  };
7268
7463
  const keywordFieldDefinitionMapping = {
7269
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'KeywordFieldDefinition',
7464
+ identifier: backendModel => backendModel?.$type === 'KeywordFieldDefinition',
7270
7465
  mapper: (mappingRegistry, backendModel) => {
7271
7466
  const { category, defaultValue, list } = mapKeywordFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7272
7467
  return new KeywordFieldDefinition({ backendModel, category, defaultValue, list });
@@ -7278,7 +7473,7 @@ const mapListDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
7278
7473
  return { type };
7279
7474
  };
7280
7475
  const listDefinitionMapping = {
7281
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ListDefinition',
7476
+ identifier: backendModel => backendModel?.$type === 'ListDefinition',
7282
7477
  mapper: (mappingRegistry, backendModel) => {
7283
7478
  const { type } = mapListDefinitionConstructorArgs(mappingRegistry, backendModel);
7284
7479
  return new ListDefinition({ backendModel, type });
@@ -7291,7 +7486,7 @@ const mapMultimediaLinkFieldDefinitionConstructorArgs = (mappingRegistry, backen
7291
7486
  return { allowedTargetSchemas, defaultValue };
7292
7487
  };
7293
7488
  const multimediaLinkFieldDefinitionMapping = {
7294
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'MultimediaLinkFieldDefinition',
7489
+ identifier: backendModel => backendModel?.$type === 'MultimediaLinkFieldDefinition',
7295
7490
  mapper: (mappingRegistry, backendModel) => {
7296
7491
  const { allowedTargetSchemas, defaultValue } = mapMultimediaLinkFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7297
7492
  return new MultimediaLinkFieldDefinition({ backendModel, allowedTargetSchemas, defaultValue });
@@ -7303,7 +7498,7 @@ const mapNumberFieldDefinitionConstructorArgs = (mappingRegistry, backendModel)
7303
7498
  return { list };
7304
7499
  };
7305
7500
  const numberFieldDefinitionMapping = {
7306
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'NumberFieldDefinition',
7501
+ identifier: backendModel => backendModel?.$type === 'NumberFieldDefinition',
7307
7502
  mapper: (mappingRegistry, backendModel) => {
7308
7503
  const { list } = mapNumberFieldDefinitionConstructorArgs(mappingRegistry, backendModel);
7309
7504
  return new NumberFieldDefinition({ backendModel, list });
@@ -7375,17 +7570,23 @@ const mapSchemaConstructorArgs = (mappingRegistry, backendModel) => {
7375
7570
  ? mapFieldsDefinitionDictionary(mappingRegistry, backendModel.MetadataFields)
7376
7571
  : undefined;
7377
7572
  const purpose = backendModel.Purpose ? mapSchemaPurpose(backendModel.Purpose) : undefined;
7378
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { allowedMultimediaTypes,
7573
+ return {
7574
+ ...versionedItemConstructorArgs,
7575
+ allowedMultimediaTypes,
7379
7576
  bundleProcess,
7380
7577
  componentProcess,
7381
7578
  fields,
7382
7579
  metadataFields,
7383
- purpose });
7580
+ purpose,
7581
+ };
7384
7582
  };
7385
7583
  const schemaMapping = {
7386
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Schema',
7584
+ identifier: backendModel => backendModel?.$type === 'Schema',
7387
7585
  mapper: (mappingRegistry, backendModel) => {
7388
- return new Schema(Object.assign(Object.assign({}, mapSchemaConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7586
+ return new Schema({
7587
+ ...mapSchemaConstructorArgs(mappingRegistry, backendModel),
7588
+ backendModel,
7589
+ });
7389
7590
  },
7390
7591
  };
7391
7592
 
@@ -7394,12 +7595,18 @@ const mapMultimediaComponentConstructorArgs = (mappingRegistry, backendModel) =>
7394
7595
  const binaryContent = backendModel.BinaryContent
7395
7596
  ? mappingRegistry.map(backendModel.BinaryContent)
7396
7597
  : undefined;
7397
- return Object.assign(Object.assign({}, componentBaseConstructorArgs), { binaryContent });
7598
+ return {
7599
+ ...componentBaseConstructorArgs,
7600
+ binaryContent,
7601
+ };
7398
7602
  };
7399
7603
  const multimediaComponentMapping = {
7400
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Component' && (backendModel === null || backendModel === void 0 ? void 0 : backendModel.ComponentType) === ComponentType.MULTIMEDIA,
7604
+ identifier: backendModel => backendModel?.$type === 'Component' && backendModel?.ComponentType === ComponentType.MULTIMEDIA,
7401
7605
  mapper: (mappingRegistry, backendModel) => {
7402
- return new MultimediaComponent(Object.assign(Object.assign({}, mapMultimediaComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7606
+ return new MultimediaComponent({
7607
+ ...mapMultimediaComponentConstructorArgs(mappingRegistry, backendModel),
7608
+ backendModel,
7609
+ });
7403
7610
  },
7404
7611
  };
7405
7612
 
@@ -7408,20 +7615,29 @@ const mapExternalMultimediaComponentConstructorArgs = (mappingRegistry, backendM
7408
7615
  const externalMetadataSchemaFields = backendModel.ExternalMetadataSchemaFields
7409
7616
  ? mapFieldsDefinitionDictionary(mappingRegistry, backendModel.ExternalMetadataSchemaFields)
7410
7617
  : undefined;
7411
- return Object.assign(Object.assign({}, multimediaComponentConstructorArgs), { externalMetadataSchemaFields });
7618
+ return {
7619
+ ...multimediaComponentConstructorArgs,
7620
+ externalMetadataSchemaFields,
7621
+ };
7412
7622
  };
7413
7623
  const externalMultimediaComponentMapping = {
7414
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalComponent',
7624
+ identifier: backendModel => backendModel?.$type === 'ExternalComponent',
7415
7625
  mapper: (mappingRegistry, backendModel) => {
7416
- return new ExternalMultimediaComponent(Object.assign(Object.assign({}, mapExternalMultimediaComponentConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7626
+ return new ExternalMultimediaComponent({
7627
+ ...mapExternalMultimediaComponentConstructorArgs(mappingRegistry, backendModel),
7628
+ backendModel,
7629
+ });
7417
7630
  },
7418
7631
  };
7419
7632
 
7420
7633
  const mapExternalVersionInfoConstructorArgs = mapFullVersionInfoConstructorArgs;
7421
7634
  const externalVersionInfoMapping = {
7422
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalVersionInfo',
7635
+ identifier: backendModel => backendModel?.$type === 'ExternalVersionInfo',
7423
7636
  mapper: (mappingRegistry, backendModel) => {
7424
- return new ExternalVersionInfo(Object.assign(Object.assign({}, mapExternalVersionInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
7637
+ return new ExternalVersionInfo({
7638
+ ...mapExternalVersionInfoConstructorArgs(mappingRegistry, backendModel),
7639
+ backendModel,
7640
+ });
7425
7641
  },
7426
7642
  };
7427
7643
 
@@ -7493,13 +7709,12 @@ class DependencyGraphNode {
7493
7709
  }
7494
7710
 
7495
7711
  const mapDependencyGraphNodeConstructorArgs = (mappingRegistry, backendModel) => {
7496
- var _a;
7497
- const dependencies = (_a = backendModel.Dependencies) === null || _a === void 0 ? void 0 : _a.map(c => mappingRegistry.map(c)).filter(isDefined);
7712
+ const dependencies = backendModel.Dependencies?.map(c => mappingRegistry.map(c)).filter(isDefined);
7498
7713
  const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
7499
7714
  return { dependencies, item };
7500
7715
  };
7501
7716
  const dependencyGraphNodeMapping = {
7502
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'DependencyGraphNode',
7717
+ identifier: backendModel => backendModel?.$type === 'DependencyGraphNode',
7503
7718
  mapper: (mappingRegistry, backendModel) => {
7504
7719
  const { dependencies, item } = mapDependencyGraphNodeConstructorArgs(mappingRegistry, backendModel);
7505
7720
  return new DependencyGraphNode({ backendModel, dependencies, item });
@@ -7510,9 +7725,8 @@ const dependencyGraphNodeMapping = {
7510
7725
  * Represents the data of a Keyword used to classify items.
7511
7726
  */
7512
7727
  class Keyword extends RepositoryLocalObject {
7513
- constructor(_a) {
7514
- var { backendModel, parentKeywords, relatedKeywords } = _a, rloArgs = __rest(_a, ["backendModel", "parentKeywords", "relatedKeywords"]);
7515
- super(Object.assign({ backendModel }, rloArgs));
7728
+ constructor({ backendModel, parentKeywords, relatedKeywords, ...rloArgs }) {
7729
+ super({ backendModel, ...rloArgs });
7516
7730
  Object.defineProperty(this, "_parentKeywords", {
7517
7731
  enumerable: true,
7518
7732
  configurable: true,
@@ -7589,9 +7803,8 @@ class Keyword extends RepositoryLocalObject {
7589
7803
  * Represents an External Keyword (mapped to an external Taxonomy Management System).
7590
7804
  */
7591
7805
  class ExternalKeyword extends Keyword {
7592
- constructor(_a) {
7593
- var { backendModel, externalMetadataSchemaFields } = _a, keywordArgs = __rest(_a, ["backendModel", "externalMetadataSchemaFields"]);
7594
- super(Object.assign({ backendModel }, keywordArgs));
7806
+ constructor({ backendModel, externalMetadataSchemaFields, ...keywordArgs }) {
7807
+ super({ backendModel, ...keywordArgs });
7595
7808
  Object.defineProperty(this, "_externalMetadataSchemaFields", {
7596
7809
  enumerable: true,
7597
7810
  configurable: true,
@@ -7654,11 +7867,14 @@ const mapKeywordConstructorArgs = (mappingRegistry, backendModel) => {
7654
7867
  const versionedItemConstructorArgs = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
7655
7868
  const parentKeywords = mapLinks(mappingRegistry, backendModel.ParentKeywords);
7656
7869
  const relatedKeywords = mapLinks(mappingRegistry, backendModel.RelatedKeywords);
7657
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { parentKeywords,
7658
- relatedKeywords });
7659
- };
7870
+ return {
7871
+ ...versionedItemConstructorArgs,
7872
+ parentKeywords,
7873
+ relatedKeywords,
7874
+ };
7875
+ };
7660
7876
  const keywordMapping = {
7661
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Keyword',
7877
+ identifier: backendModel => backendModel?.$type === 'Keyword',
7662
7878
  mapper: (mappingRegistry, backendModel) => {
7663
7879
  const { applicableActions, basicVersionInfo, blueprintInfo, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, parentKeywords, relatedKeywords, securityDescriptor, listInfo, } = mapKeywordConstructorArgs(mappingRegistry, backendModel);
7664
7880
  return new Keyword({
@@ -7688,10 +7904,13 @@ const mapExternalKeywordConstructorArgs = (mappingRegistry, backendModel) => {
7688
7904
  const externalMetadataSchemaFields = backendModel.ExternalMetadataSchemaFields
7689
7905
  ? mapFieldsDefinitionDictionary(mappingRegistry, backendModel.ExternalMetadataSchemaFields)
7690
7906
  : undefined;
7691
- return Object.assign(Object.assign({}, keywordConstructorArgs), { externalMetadataSchemaFields });
7907
+ return {
7908
+ ...keywordConstructorArgs,
7909
+ externalMetadataSchemaFields,
7910
+ };
7692
7911
  };
7693
7912
  const externalKeywordMapping = {
7694
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalKeyword',
7913
+ identifier: backendModel => backendModel?.$type === 'ExternalKeyword',
7695
7914
  mapper: (mappingRegistry, backendModel) => {
7696
7915
  const { applicableActions, basicVersionInfo, blueprintInfo, externalMetadataSchemaFields, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, parentKeywords, relatedKeywords, securityDescriptor, listInfo, } = mapExternalKeywordConstructorArgs(mappingRegistry, backendModel);
7697
7916
  return new ExternalKeyword({
@@ -7721,9 +7940,8 @@ const externalKeywordMapping = {
7721
7940
  * Abstract base class for the data of "organizational items": items used to organize the items in a Repository.
7722
7941
  */
7723
7942
  class OrganizationalItem extends RepositoryLocalObject {
7724
- constructor(_a) {
7725
- var { backendModel, accessControlList, contentSecurityDescriptor } = _a, rloArgs = __rest(_a, ["backendModel", "accessControlList", "contentSecurityDescriptor"]);
7726
- super(Object.assign({ backendModel }, rloArgs));
7943
+ constructor({ backendModel, accessControlList, contentSecurityDescriptor, ...rloArgs }) {
7944
+ super({ backendModel, ...rloArgs });
7727
7945
  Object.defineProperty(this, "_accessControlList", {
7728
7946
  enumerable: true,
7729
7947
  configurable: true,
@@ -7779,9 +7997,8 @@ class OrganizationalItem extends RepositoryLocalObject {
7779
7997
  * Organizational Item that dynamically collects its contents.
7780
7998
  */
7781
7999
  class VirtualFolder extends OrganizationalItem {
7782
- constructor(_a) {
7783
- var { backendModel, approvalStatus, typeSchema, workflowInfo } = _a, orgItemArgs = __rest(_a, ["backendModel", "approvalStatus", "typeSchema", "workflowInfo"]);
7784
- super(Object.assign({ backendModel }, orgItemArgs));
8000
+ constructor({ backendModel, approvalStatus, typeSchema, workflowInfo, ...orgItemArgs }) {
8001
+ super({ backendModel, ...orgItemArgs });
7785
8002
  Object.defineProperty(this, "_approvalStatus", {
7786
8003
  enumerable: true,
7787
8004
  configurable: true,
@@ -7845,9 +8062,8 @@ class VirtualFolder extends OrganizationalItem {
7845
8062
  * Represents a Bundle which is used to group Repository Local Objects for Release Management purposes.
7846
8063
  */
7847
8064
  class Bundle extends VirtualFolder {
7848
- constructor(_a) {
7849
- var { backendModel, items } = _a, bundleArgs = __rest(_a, ["backendModel", "items"]);
7850
- super(Object.assign({ backendModel }, bundleArgs));
8065
+ constructor({ backendModel, items, ...bundleArgs }) {
8066
+ super({ backendModel, ...bundleArgs });
7851
8067
  Object.defineProperty(this, "_items", {
7852
8068
  enumerable: true,
7853
8069
  configurable: true,
@@ -7885,9 +8101,8 @@ class Bundle extends VirtualFolder {
7885
8101
  * then, the Business Process Type should be loaded with LoadFlags.Expanded.
7886
8102
  */
7887
8103
  class BusinessProcessType extends OrganizationalItem {
7888
- constructor(_a) {
7889
- var { backendModel, bundleSchemas, targetTypes } = _a, orgItemArgs = __rest(_a, ["backendModel", "bundleSchemas", "targetTypes"]);
7890
- super(Object.assign({ backendModel }, orgItemArgs));
8104
+ constructor({ backendModel, bundleSchemas, targetTypes, ...orgItemArgs }) {
8105
+ super({ backendModel, ...orgItemArgs });
7891
8106
  Object.defineProperty(this, "_bundleSchemas", {
7892
8107
  enumerable: true,
7893
8108
  configurable: true,
@@ -7963,9 +8178,11 @@ class BusinessProcessType extends OrganizationalItem {
7963
8178
  * An item used to organize the business process types in a Repository.
7964
8179
  */
7965
8180
  class BusinessProcessTypes extends OrganizationalItem {
7966
- constructor(_a) {
7967
- var { backendModel } = _a, organizationalItemArgs = __rest(_a, ["backendModel"]);
7968
- super(Object.assign({ backendModel }, organizationalItemArgs));
8181
+ constructor({ backendModel, ...organizationalItemArgs }) {
8182
+ super({
8183
+ backendModel,
8184
+ ...organizationalItemArgs,
8185
+ });
7969
8186
  }
7970
8187
  }
7971
8188
 
@@ -8010,9 +8227,8 @@ const createBackendTaxonomies = (publicationId) => {
8010
8227
  * An item used to organize the items in a Repository.
8011
8228
  */
8012
8229
  class Folder extends OrganizationalItem {
8013
- constructor(_a) {
8014
- var { backendModel, linkedSchema } = _a, orgItemArgs = __rest(_a, ["backendModel", "linkedSchema"]);
8015
- super(Object.assign({ backendModel }, orgItemArgs));
8230
+ constructor({ backendModel, linkedSchema, ...orgItemArgs }) {
8231
+ super({ backendModel, ...orgItemArgs });
8016
8232
  Object.defineProperty(this, "_linkedSchema", {
8017
8233
  enumerable: true,
8018
8234
  configurable: true,
@@ -8090,9 +8306,8 @@ class ExternalContainer extends Folder {
8090
8306
  * Represents the data of a Category of Keywords.
8091
8307
  */
8092
8308
  class KeywordCategory extends OrganizationalItem {
8093
- constructor(_a) {
8094
- var { backendModel, allowedParentCategories, keywordMetadataSchema } = _a, orgItemArgs = __rest(_a, ["backendModel", "allowedParentCategories", "keywordMetadataSchema"]);
8095
- super(Object.assign({ backendModel }, orgItemArgs));
8309
+ constructor({ backendModel, allowedParentCategories, keywordMetadataSchema, ...orgItemArgs }) {
8310
+ super({ backendModel, ...orgItemArgs });
8096
8311
  Object.defineProperty(this, "_allowedParentCategories", {
8097
8312
  enumerable: true,
8098
8313
  configurable: true,
@@ -8181,9 +8396,8 @@ class KeywordCategory extends OrganizationalItem {
8181
8396
  * Represents an External Category (mapped to an external Taxonomy Management System).
8182
8397
  */
8183
8398
  class ExternalKeywordCategory extends KeywordCategory {
8184
- constructor(_a) {
8185
- var { backendModel } = _a, keywordCategoryArgs = __rest(_a, ["backendModel"]);
8186
- super(Object.assign({ backendModel }, keywordCategoryArgs));
8399
+ constructor({ backendModel, ...keywordCategoryArgs }) {
8400
+ super({ backendModel, ...keywordCategoryArgs });
8187
8401
  Object.defineProperty(this, "getInternalModel", {
8188
8402
  enumerable: true,
8189
8403
  configurable: true,
@@ -8211,9 +8425,8 @@ class ExternalKeywordCategory extends KeywordCategory {
8211
8425
  * Represents a publishing location information for the objects that reside in Structure Groups.
8212
8426
  */
8213
8427
  class PublishLocationInfo extends LocationInfo {
8214
- constructor(_a) {
8215
- var { backendModel } = _a, locationInfoArgs = __rest(_a, ["backendModel"]);
8216
- super(Object.assign({ backendModel }, locationInfoArgs));
8428
+ constructor({ backendModel, ...locationInfoArgs }) {
8429
+ super({ backendModel, ...locationInfoArgs });
8217
8430
  Object.defineProperty(this, "getInternalModel", {
8218
8431
  enumerable: true,
8219
8432
  configurable: true,
@@ -8274,9 +8487,8 @@ class SearchFolder extends VirtualFolder {
8274
8487
  * Organizational Item used to build the Publication's target structure.
8275
8488
  */
8276
8489
  class StructureGroup extends OrganizationalItem {
8277
- constructor(_a) {
8278
- var { backendModel, defaultPageTemplate, publishLocationInfo, pageBundleProcess, pageProcess } = _a, orgItemArgs = __rest(_a, ["backendModel", "defaultPageTemplate", "publishLocationInfo", "pageBundleProcess", "pageProcess"]);
8279
- super(Object.assign({ backendModel }, orgItemArgs));
8490
+ constructor({ backendModel, defaultPageTemplate, publishLocationInfo, pageBundleProcess, pageProcess, ...orgItemArgs }) {
8491
+ super({ backendModel, ...orgItemArgs });
8280
8492
  Object.defineProperty(this, "_defaultPageTemplate", {
8281
8493
  enumerable: true,
8282
8494
  configurable: true,
@@ -8397,9 +8609,11 @@ class StructureGroup extends OrganizationalItem {
8397
8609
  * An item used to organize the categories and keywords in a Repository.
8398
8610
  */
8399
8611
  class Taxonomies extends OrganizationalItem {
8400
- constructor(_a) {
8401
- var { backendModel } = _a, organizationalItemArgs = __rest(_a, ["backendModel"]);
8402
- super(Object.assign({ backendModel }, organizationalItemArgs));
8612
+ constructor({ backendModel, ...organizationalItemArgs }) {
8613
+ super({
8614
+ backendModel,
8615
+ ...organizationalItemArgs,
8616
+ });
8403
8617
  }
8404
8618
  }
8405
8619
 
@@ -8411,8 +8625,11 @@ const mapOrganizationalItemConstructorArgs = (mappingRegistry, backendModel) =>
8411
8625
  const contentSecurityDescriptor = backendModel.ContentSecurityDescriptor
8412
8626
  ? mappingRegistry.map(backendModel.ContentSecurityDescriptor)
8413
8627
  : undefined;
8414
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { accessControlList,
8415
- contentSecurityDescriptor });
8628
+ return {
8629
+ ...versionedItemConstructorArgs,
8630
+ accessControlList,
8631
+ contentSecurityDescriptor,
8632
+ };
8416
8633
  };
8417
8634
 
8418
8635
  const mapVirtualFolderConstructorArgs = (mappingRegistry, backendModel) => {
@@ -8424,27 +8641,35 @@ const mapVirtualFolderConstructorArgs = (mappingRegistry, backendModel) => {
8424
8641
  const workflowInfo = backendModel.WorkflowInfo
8425
8642
  ? mappingRegistry.map(backendModel.WorkflowInfo)
8426
8643
  : undefined;
8427
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { approvalStatus,
8644
+ return {
8645
+ ...organizationalItemConstructorArgs,
8646
+ approvalStatus,
8428
8647
  typeSchema,
8429
- workflowInfo });
8648
+ workflowInfo,
8649
+ };
8430
8650
  };
8431
8651
 
8432
8652
  const mapBundleConstructorArgs = (mappingRegistry, backendModel) => {
8433
8653
  const virtualFolderConstructorArgs = mapVirtualFolderConstructorArgs(mappingRegistry, backendModel);
8434
8654
  const items = mapLinks(mappingRegistry, backendModel.Items);
8435
- return Object.assign(Object.assign({}, virtualFolderConstructorArgs), { items });
8655
+ return {
8656
+ ...virtualFolderConstructorArgs,
8657
+ items,
8658
+ };
8436
8659
  };
8437
8660
  const bundleMapping = {
8438
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Bundle',
8661
+ identifier: backendModel => backendModel?.$type === 'Bundle',
8439
8662
  mapper: (mappingRegistry, backendModel) => {
8440
- return new Bundle(Object.assign(Object.assign({}, mapBundleConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8663
+ return new Bundle({
8664
+ ...mapBundleConstructorArgs(mappingRegistry, backendModel),
8665
+ backendModel,
8666
+ });
8441
8667
  },
8442
8668
  };
8443
8669
 
8444
8670
  const changeOrgItemToBusinessProcessTypes = (item) => {
8445
8671
  return produce(item, draft => {
8446
- var _a, _b;
8447
- if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
8672
+ if (draft.LocationInfo?.ContextRepository?.IdRef) {
8448
8673
  const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
8449
8674
  if (!publicationId)
8450
8675
  return;
@@ -8454,33 +8679,40 @@ const changeOrgItemToBusinessProcessTypes = (item) => {
8454
8679
  };
8455
8680
 
8456
8681
  const mapBusinessProcessTypeConstructorArgs = (mappingRegistry, backendModel) => {
8457
- var _a;
8458
8682
  const backendModelWithProperOrgItem = changeOrgItemToBusinessProcessTypes(backendModel);
8459
8683
  const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModelWithProperOrgItem);
8460
8684
  const bundleSchemas = mapLinks(mappingRegistry, backendModelWithProperOrgItem.BundleSchemas);
8461
- const targetTypes = (_a = backendModelWithProperOrgItem.TargetTypes) === null || _a === void 0 ? void 0 : _a.map(t => mappingRegistry.map(t)).filter(isDefined);
8462
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { bundleSchemas,
8463
- targetTypes });
8685
+ const targetTypes = backendModelWithProperOrgItem.TargetTypes?.map(t => mappingRegistry.map(t)).filter(isDefined);
8686
+ return {
8687
+ ...organizationalItemConstructorArgs,
8688
+ bundleSchemas,
8689
+ targetTypes,
8690
+ };
8464
8691
  };
8465
8692
  const businessProcessTypeMapping = {
8466
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BusinessProcessType',
8693
+ identifier: backendModel => backendModel?.$type === 'BusinessProcessType',
8467
8694
  mapper: (mappingRegistry, backendModel) => {
8468
- return new BusinessProcessType(Object.assign(Object.assign({}, mapBusinessProcessTypeConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToBusinessProcessTypes(backendModel) }));
8695
+ return new BusinessProcessType({
8696
+ ...mapBusinessProcessTypeConstructorArgs(mappingRegistry, backendModel),
8697
+ backendModel: changeOrgItemToBusinessProcessTypes(backendModel),
8698
+ });
8469
8699
  },
8470
8700
  };
8471
8701
 
8472
8702
  const mapBusinessProcessTypesConstructorArgs = mapOrganizationalItemConstructorArgs;
8473
8703
  const businessProcessTypesMapping = {
8474
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'BusinessProcessTypes',
8704
+ identifier: backendModel => backendModel?.$type === 'BusinessProcessTypes',
8475
8705
  mapper: (mappingRegistry, backendModel) => {
8476
- return new BusinessProcessTypes(Object.assign(Object.assign({}, mapBusinessProcessTypesConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8706
+ return new BusinessProcessTypes({
8707
+ ...mapBusinessProcessTypesConstructorArgs(mappingRegistry, backendModel),
8708
+ backendModel,
8709
+ });
8477
8710
  },
8478
8711
  };
8479
8712
 
8480
8713
  const changeOrgItemToTaxonomies = (item) => {
8481
8714
  return produce(item, draft => {
8482
- var _a, _b;
8483
- if ((_b = (_a = draft.LocationInfo) === null || _a === void 0 ? void 0 : _a.ContextRepository) === null || _b === void 0 ? void 0 : _b.IdRef) {
8715
+ if (draft.LocationInfo?.ContextRepository?.IdRef) {
8484
8716
  const publicationId = TcmUri.parse(draft.LocationInfo.ContextRepository.IdRef);
8485
8717
  if (!publicationId)
8486
8718
  return;
@@ -8492,20 +8724,29 @@ const changeOrgItemToTaxonomies = (item) => {
8492
8724
  const mapFolderConstructorArgs = (mappingRegistry, backendModel) => {
8493
8725
  const organizationalItemConstructorArgs = mapOrganizationalItemConstructorArgs(mappingRegistry, backendModel);
8494
8726
  const linkedSchema = backendModel.LinkedSchema ? mappingRegistry.map(backendModel.LinkedSchema) : undefined;
8495
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { linkedSchema });
8727
+ return {
8728
+ ...organizationalItemConstructorArgs,
8729
+ linkedSchema,
8730
+ };
8496
8731
  };
8497
8732
  const folderMapping = {
8498
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Folder',
8733
+ identifier: backendModel => backendModel?.$type === 'Folder',
8499
8734
  mapper: (mappingRegistry, backendModel) => {
8500
- return new Folder(Object.assign(Object.assign({}, mapFolderConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8735
+ return new Folder({
8736
+ ...mapFolderConstructorArgs(mappingRegistry, backendModel),
8737
+ backendModel,
8738
+ });
8501
8739
  },
8502
8740
  };
8503
8741
 
8504
8742
  const mapExternalContainerConstructorArgs = mapFolderConstructorArgs;
8505
8743
  const externalContainerMapping = {
8506
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalContainer',
8744
+ identifier: backendModel => backendModel?.$type === 'ExternalContainer',
8507
8745
  mapper: (mappingRegistry, backendModel) => {
8508
- return new ExternalContainer(Object.assign(Object.assign({}, mapExternalContainerConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8746
+ return new ExternalContainer({
8747
+ ...mapExternalContainerConstructorArgs(mappingRegistry, backendModel),
8748
+ backendModel,
8749
+ });
8509
8750
  },
8510
8751
  };
8511
8752
 
@@ -8516,37 +8757,52 @@ const mapKeywordCategoryConstructorArgs = (mappingRegistry, backendModel) => {
8516
8757
  const keywordMetadataSchema = backendModelWithProperOrgItem.KeywordMetadataSchema
8517
8758
  ? mappingRegistry.map(backendModelWithProperOrgItem.KeywordMetadataSchema)
8518
8759
  : undefined;
8519
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { allowedParentCategories,
8520
- keywordMetadataSchema });
8760
+ return {
8761
+ ...organizationalItemConstructorArgs,
8762
+ allowedParentCategories,
8763
+ keywordMetadataSchema,
8764
+ };
8521
8765
  };
8522
8766
  const keywordCategoryMapping = {
8523
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Category',
8767
+ identifier: backendModel => backendModel?.$type === 'Category',
8524
8768
  mapper: (mappingRegistry, backendModel) => {
8525
- return new KeywordCategory(Object.assign(Object.assign({}, mapKeywordCategoryConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToTaxonomies(backendModel) }));
8769
+ return new KeywordCategory({
8770
+ ...mapKeywordCategoryConstructorArgs(mappingRegistry, backendModel),
8771
+ backendModel: changeOrgItemToTaxonomies(backendModel),
8772
+ });
8526
8773
  },
8527
8774
  };
8528
8775
 
8529
8776
  const mapExternalKeywordCategoryConstructorArgs = mapKeywordCategoryConstructorArgs;
8530
8777
  const externalKeywordCategoryMapping = {
8531
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ExternalCategory',
8778
+ identifier: backendModel => backendModel?.$type === 'ExternalCategory',
8532
8779
  mapper: (mappingRegistry, backendModel) => {
8533
- return new ExternalKeywordCategory(Object.assign(Object.assign({}, mapExternalKeywordCategoryConstructorArgs(mappingRegistry, backendModel)), { backendModel: changeOrgItemToTaxonomies(backendModel) }));
8780
+ return new ExternalKeywordCategory({
8781
+ ...mapExternalKeywordCategoryConstructorArgs(mappingRegistry, backendModel),
8782
+ backendModel: changeOrgItemToTaxonomies(backendModel),
8783
+ });
8534
8784
  },
8535
8785
  };
8536
8786
 
8537
8787
  const mapPublishLocationInfoConstructorArgs = mapLocationInfoConstructorArgs;
8538
8788
  const publishLocationInfoMapping = {
8539
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishLocationInfo',
8789
+ identifier: backendModel => backendModel?.$type === 'PublishLocationInfo',
8540
8790
  mapper: (mappingRegistry, backendModel) => {
8541
- return new PublishLocationInfo(Object.assign(Object.assign({}, mapPublishLocationInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8791
+ return new PublishLocationInfo({
8792
+ ...mapPublishLocationInfoConstructorArgs(mappingRegistry, backendModel),
8793
+ backendModel,
8794
+ });
8542
8795
  },
8543
8796
  };
8544
8797
 
8545
8798
  const mapSearchFolderConstructorArgs = mapVirtualFolderConstructorArgs;
8546
8799
  const searchFolderMapping = {
8547
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SearchFolder',
8800
+ identifier: backendModel => backendModel?.$type === 'SearchFolder',
8548
8801
  mapper: (mappingRegistry, backendModel) => {
8549
- return new SearchFolder(Object.assign(Object.assign({}, mapSearchFolderConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8802
+ return new SearchFolder({
8803
+ ...mapSearchFolderConstructorArgs(mappingRegistry, backendModel),
8804
+ backendModel,
8805
+ });
8550
8806
  },
8551
8807
  };
8552
8808
 
@@ -8562,23 +8818,29 @@ const mapStructureGroupConstructorArgs = (mappingRegistry, backendModel) => {
8562
8818
  ? mappingRegistry.map(backendModel.PageBundleProcess)
8563
8819
  : undefined;
8564
8820
  const pageProcess = backendModel.PageProcess ? mappingRegistry.map(backendModel.PageProcess) : undefined;
8565
- return Object.assign(Object.assign({}, organizationalItemConstructorArgs), { defaultPageTemplate,
8821
+ return {
8822
+ ...organizationalItemConstructorArgs,
8823
+ defaultPageTemplate,
8566
8824
  pageBundleProcess,
8567
8825
  pageProcess,
8568
- publishLocationInfo });
8826
+ publishLocationInfo,
8827
+ };
8569
8828
  };
8570
8829
  const structureGroupMapping = {
8571
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'StructureGroup',
8830
+ identifier: backendModel => backendModel?.$type === 'StructureGroup',
8572
8831
  mapper: (mappingRegistry, backendModel) => {
8573
- return new StructureGroup(Object.assign(Object.assign({}, mapStructureGroupConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8832
+ return new StructureGroup({
8833
+ ...mapStructureGroupConstructorArgs(mappingRegistry, backendModel),
8834
+ backendModel,
8835
+ });
8574
8836
  },
8575
8837
  };
8576
8838
 
8577
8839
  const mapTaxonomiesConstructorArgs = mapOrganizationalItemConstructorArgs;
8578
8840
  const taxonomiesMapping = {
8579
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Taxonomies',
8841
+ identifier: backendModel => backendModel?.$type === 'Taxonomies',
8580
8842
  mapper: (mappingRegistry, backendModel) => {
8581
- return new Taxonomies(Object.assign(Object.assign({}, mapTaxonomiesConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
8843
+ return new Taxonomies({ ...mapTaxonomiesConstructorArgs(mappingRegistry, backendModel), backendModel });
8582
8844
  },
8583
8845
  };
8584
8846
 
@@ -8724,9 +8986,8 @@ class EmbeddedRegion extends Region {
8724
8986
  * Represents the data of a Page: an artifact in the Publication's target structure.
8725
8987
  */
8726
8988
  class Page extends VersionedItem {
8727
- constructor(_a) {
8728
- var { backendModel, approvalStatus, componentPresentations, pageTemplate, publishLocationInfo, regionSchema, regions, workflowInfo } = _a, versionedItemArgs = __rest(_a, ["backendModel", "approvalStatus", "componentPresentations", "pageTemplate", "publishLocationInfo", "regionSchema", "regions", "workflowInfo"]);
8729
- super(Object.assign({ backendModel }, versionedItemArgs));
8989
+ constructor({ backendModel, approvalStatus, componentPresentations, pageTemplate, publishLocationInfo, regionSchema, regions, workflowInfo, ...versionedItemArgs }) {
8990
+ super({ backendModel, ...versionedItemArgs });
8730
8991
  Object.defineProperty(this, "_approvalStatus", {
8731
8992
  enumerable: true,
8732
8993
  configurable: true,
@@ -8896,18 +9157,20 @@ class TargetGroupCondition {
8896
9157
  }
8897
9158
 
8898
9159
  const mapComponentPresentationConstructorArgs = (mappingRegistry, backendModel) => {
8899
- var _a;
8900
9160
  const component = backendModel.Component ? mappingRegistry.map(backendModel.Component) : undefined;
8901
9161
  const componentTemplate = backendModel.ComponentTemplate
8902
9162
  ? mappingRegistry.map(backendModel.ComponentTemplate)
8903
9163
  : undefined;
8904
- const conditions = (_a = backendModel.Conditions) === null || _a === void 0 ? void 0 : _a.map(c => mappingRegistry.map(c)).filter(isDefined);
9164
+ const conditions = backendModel.Conditions?.map(c => mappingRegistry.map(c)).filter(isDefined);
8905
9165
  return { component, componentTemplate, conditions };
8906
9166
  };
8907
9167
  const componentPresentationMapping = {
8908
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentPresentation',
9168
+ identifier: backendModel => backendModel?.$type === 'ComponentPresentation',
8909
9169
  mapper: (mappingRegistry, backendModel) => {
8910
- return new ComponentPresentation(Object.assign(Object.assign({}, mapComponentPresentationConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9170
+ return new ComponentPresentation({
9171
+ ...mapComponentPresentationConstructorArgs(mappingRegistry, backendModel),
9172
+ backendModel,
9173
+ });
8911
9174
  },
8912
9175
  };
8913
9176
 
@@ -8920,26 +9183,27 @@ const mapRegions = (backendRegions, mappingRegistry) => {
8920
9183
  };
8921
9184
 
8922
9185
  const mapEmbeddedRegionConstructorArgs = (mappingRegistry, backendModel) => {
8923
- var _a;
8924
- const componentPresentations = (_a = backendModel.ComponentPresentations) === null || _a === void 0 ? void 0 : _a.map(cp => mappingRegistry.map(cp)).filter(isDefined);
9186
+ const componentPresentations = backendModel.ComponentPresentations?.map(cp => mappingRegistry.map(cp)).filter(isDefined);
8925
9187
  const regions = backendModel.Regions ? mapRegions(backendModel.Regions, mappingRegistry) : undefined;
8926
9188
  const regionSchema = backendModel.RegionSchema ? mappingRegistry.map(backendModel.RegionSchema) : undefined;
8927
9189
  return { componentPresentations, regions, regionSchema };
8928
9190
  };
8929
9191
  const embeddedRegionMapping = {
8930
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'EmbeddedRegion',
9192
+ identifier: backendModel => backendModel?.$type === 'EmbeddedRegion',
8931
9193
  mapper: (mappingRegistry, backendModel) => {
8932
- return new EmbeddedRegion(Object.assign(Object.assign({}, mapEmbeddedRegionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9194
+ return new EmbeddedRegion({
9195
+ ...mapEmbeddedRegionConstructorArgs(mappingRegistry, backendModel),
9196
+ backendModel,
9197
+ });
8933
9198
  },
8934
9199
  };
8935
9200
 
8936
9201
  const mapPageConstructorArgs = (mappingRegistry, backendModel) => {
8937
- var _a;
8938
9202
  const versionedItemConstructorArgs = mapVersionedItemConstructorArgs(mappingRegistry, backendModel);
8939
9203
  const approvalStatus = backendModel.ApprovalStatus
8940
9204
  ? mappingRegistry.map(backendModel.ApprovalStatus)
8941
9205
  : undefined;
8942
- const componentPresentations = (_a = backendModel.ComponentPresentations) === null || _a === void 0 ? void 0 : _a.map(cp => mappingRegistry.map(cp)).filter(isDefined);
9206
+ const componentPresentations = backendModel.ComponentPresentations?.map(cp => mappingRegistry.map(cp)).filter(isDefined);
8943
9207
  const publishLocationInfo = mappingRegistry.map(backendModel.LocationInfo);
8944
9208
  const pageTemplate = mappingRegistry.map(backendModel.PageTemplate);
8945
9209
  const regions = backendModel.Regions ? mapRegions(backendModel.Regions, mappingRegistry) : undefined;
@@ -8947,18 +9211,24 @@ const mapPageConstructorArgs = (mappingRegistry, backendModel) => {
8947
9211
  const workflowInfo = backendModel.WorkflowInfo
8948
9212
  ? mappingRegistry.map(backendModel.WorkflowInfo)
8949
9213
  : undefined;
8950
- return Object.assign(Object.assign({}, versionedItemConstructorArgs), { approvalStatus,
9214
+ return {
9215
+ ...versionedItemConstructorArgs,
9216
+ approvalStatus,
8951
9217
  componentPresentations,
8952
9218
  pageTemplate,
8953
9219
  publishLocationInfo,
8954
9220
  regions,
8955
9221
  regionSchema,
8956
- workflowInfo });
9222
+ workflowInfo,
9223
+ };
8957
9224
  };
8958
9225
  const pageMapping = {
8959
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Page',
9226
+ identifier: backendModel => backendModel?.$type === 'Page',
8960
9227
  mapper: (mappingRegistry, backendModel) => {
8961
- return new Page(Object.assign(Object.assign({}, mapPageConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9228
+ return new Page({
9229
+ ...mapPageConstructorArgs(mappingRegistry, backendModel),
9230
+ backendModel,
9231
+ });
8962
9232
  },
8963
9233
  };
8964
9234
 
@@ -8967,9 +9237,12 @@ const mapTargetGroupConditionConstructorArgs = (mappingRegistry, backendModel) =
8967
9237
  return { targetGroup };
8968
9238
  };
8969
9239
  const targetGroupConditionMapping = {
8970
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetGroupCondition',
9240
+ identifier: backendModel => backendModel?.$type === 'TargetGroupCondition',
8971
9241
  mapper: (mappingRegistry, backendModel) => {
8972
- return new TargetGroupCondition(Object.assign(Object.assign({}, mapTargetGroupConditionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
9242
+ return new TargetGroupCondition({
9243
+ ...mapTargetGroupConditionConstructorArgs(mappingRegistry, backendModel),
9244
+ backendModel,
9245
+ });
8973
9246
  },
8974
9247
  };
8975
9248
 
@@ -9269,9 +9542,8 @@ class PublishInstruction extends PublishInstructionBase {
9269
9542
  }
9270
9543
 
9271
9544
  class PublishTransaction extends SystemWideObject {
9272
- constructor(_a) {
9273
- 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"]);
9274
- super(Object.assign({ backendModel }, systemWideObjectConstructorArgs));
9545
+ constructor({ backendModel, creator, deployerAction, instruction, items, priority, publishContexts, state, targetType, stateChangeDateTime, ...systemWideObjectConstructorArgs }) {
9546
+ super({ backendModel, ...systemWideObjectConstructorArgs });
9275
9547
  Object.defineProperty(this, "_backendModel", {
9276
9548
  enumerable: true,
9277
9549
  configurable: true,
@@ -9556,6 +9828,64 @@ class PublishUrlInfo {
9556
9828
  }
9557
9829
  }
9558
9830
 
9831
+ class RenderedItem {
9832
+ constructor({ backendModel, item, template }) {
9833
+ Object.defineProperty(this, "_backendModel", {
9834
+ enumerable: true,
9835
+ configurable: true,
9836
+ writable: true,
9837
+ value: void 0
9838
+ });
9839
+ Object.defineProperty(this, "_item", {
9840
+ enumerable: true,
9841
+ configurable: true,
9842
+ writable: true,
9843
+ value: void 0
9844
+ });
9845
+ Object.defineProperty(this, "_template", {
9846
+ enumerable: true,
9847
+ configurable: true,
9848
+ writable: true,
9849
+ value: void 0
9850
+ });
9851
+ Object.defineProperty(this, "getInternalModel", {
9852
+ enumerable: true,
9853
+ configurable: true,
9854
+ writable: true,
9855
+ value: () => {
9856
+ return this._backendModel;
9857
+ }
9858
+ });
9859
+ this._backendModel = backendModel;
9860
+ this._item = item;
9861
+ this._template = template;
9862
+ }
9863
+ /**
9864
+ * Gets the data pipeline JSON (if any)
9865
+ */
9866
+ get dataPipelineJson() {
9867
+ return this._backendModel.DataPipelineJson;
9868
+ }
9869
+ /**
9870
+ * Gets a link to the item that was rendered.
9871
+ */
9872
+ get item() {
9873
+ return this._item;
9874
+ }
9875
+ /**
9876
+ * Gets the rendered output of the template (if any)
9877
+ */
9878
+ get renderedOutput() {
9879
+ return this._backendModel.RenderedOutput;
9880
+ }
9881
+ /**
9882
+ * Gets a link to the template with which the item was rendered (if any).
9883
+ */
9884
+ get template() {
9885
+ return this._template;
9886
+ }
9887
+ }
9888
+
9559
9889
  class ResolvedItem {
9560
9890
  constructor({ backendModel, item, publication, targetType, template }) {
9561
9891
  Object.defineProperty(this, "_backendModel", {
@@ -9693,9 +10023,8 @@ class ResolveInstructionBase {
9693
10023
  }
9694
10024
 
9695
10025
  class ResolveInstruction extends ResolveInstructionBase {
9696
- constructor(_a) {
9697
- var { backendModel } = _a, resolveInstructionBaseConstructorArgs = __rest(_a, ["backendModel"]);
9698
- super(Object.assign({ backendModel }, resolveInstructionBaseConstructorArgs));
10026
+ constructor({ backendModel, ...resolveInstructionBaseConstructorArgs }) {
10027
+ super({ backendModel, ...resolveInstructionBaseConstructorArgs });
9699
10028
  Object.defineProperty(this, "_backendModel", {
9700
10029
  enumerable: true,
9701
10030
  configurable: true,
@@ -9794,24 +10123,29 @@ const mapProcessedItemConstructorArgs = (mappingRegistry, backendModel) => {
9794
10123
  return { resolvedItem };
9795
10124
  };
9796
10125
  const processedItemMapping = {
9797
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessedItem',
10126
+ identifier: backendModel => backendModel?.$type === 'ProcessedItem',
9798
10127
  mapper: (mappingRegistry, backendModel) => {
9799
- return new ProcessedItem(Object.assign(Object.assign({}, mapProcessedItemConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10128
+ return new ProcessedItem({
10129
+ ...mapProcessedItemConstructorArgs(mappingRegistry, backendModel),
10130
+ backendModel,
10131
+ });
9800
10132
  },
9801
10133
  };
9802
10134
 
9803
10135
  const mapPublishContextConstructorArgs = (mappingRegistry, backendModel) => {
9804
- var _a, _b;
9805
- const processedItems = (_a = backendModel.ProcessedItems) === null || _a === void 0 ? void 0 : _a.map(i => mappingRegistry.map(i)).filter(isDefined);
10136
+ const processedItems = backendModel.ProcessedItems?.map(i => mappingRegistry.map(i)).filter(isDefined);
9806
10137
  const publication = backendModel.Publication ? mappingRegistry.map(backendModel.Publication) : undefined;
9807
- const resolvedItems = (_b = backendModel.ResolvedItems) === null || _b === void 0 ? void 0 : _b.map(i => mappingRegistry.map(i)).filter(isDefined);
10138
+ const resolvedItems = backendModel.ResolvedItems?.map(i => mappingRegistry.map(i)).filter(isDefined);
9808
10139
  const targetType = backendModel.TargetType ? mappingRegistry.map(backendModel.Publication) : undefined;
9809
10140
  return { processedItems, publication, resolvedItems, targetType };
9810
10141
  };
9811
10142
  const publishContextMapping = {
9812
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishContext',
10143
+ identifier: backendModel => backendModel?.$type === 'PublishContext',
9813
10144
  mapper: (mappingRegistry, backendModel) => {
9814
- return new PublishContext(Object.assign(Object.assign({}, mapPublishContextConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10145
+ return new PublishContext({
10146
+ ...mapPublishContextConstructorArgs(mappingRegistry, backendModel),
10147
+ backendModel,
10148
+ });
9815
10149
  },
9816
10150
  };
9817
10151
 
@@ -9823,9 +10157,12 @@ const mapPublishInfoConstructorArgs = (mappingRegistry, backendModel) => {
9823
10157
  return { renderedWith, repository, targetType, user };
9824
10158
  };
9825
10159
  const publishInfoMapping = {
9826
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInfo',
10160
+ identifier: backendModel => backendModel?.$type === 'PublishInfo',
9827
10161
  mapper: (mappingRegistry, backendModel) => {
9828
- return new PublishInfo(Object.assign(Object.assign({}, mapPublishInfoConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10162
+ return new PublishInfo({
10163
+ ...mapPublishInfoConstructorArgs(mappingRegistry, backendModel),
10164
+ backendModel,
10165
+ });
9829
10166
  },
9830
10167
  };
9831
10168
 
@@ -9837,9 +10174,12 @@ const mapPublishInstructionConstructorArgs = (mappingRegistry, backendModel) =>
9837
10174
  return { deployAt, resolveInstruction };
9838
10175
  };
9839
10176
  const publishInstructionMapping = {
9840
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInstruction',
10177
+ identifier: backendModel => backendModel?.$type === 'PublishInstruction',
9841
10178
  mapper: (mappingRegistry, backendModel) => {
9842
- return new PublishInstruction(Object.assign(Object.assign({}, mapPublishInstructionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10179
+ return new PublishInstruction({
10180
+ ...mapPublishInstructionConstructorArgs(mappingRegistry, backendModel),
10181
+ backendModel,
10182
+ });
9843
10183
  },
9844
10184
  };
9845
10185
 
@@ -9858,7 +10198,7 @@ const mapPublishTransactionInfoConstructorArgs = (mappingRegistry, backendModel)
9858
10198
  return { publishAction, scheduleTime };
9859
10199
  };
9860
10200
  const publishTransactionListInfoMapping = {
9861
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransactionListInfo',
10201
+ identifier: backendModel => backendModel?.$type === 'PublishTransactionListInfo',
9862
10202
  mapper: (mappingRegistry, backendModel) => {
9863
10203
  const { publishAction, scheduleTime } = mapPublishTransactionInfoConstructorArgs(mappingRegistry, backendModel);
9864
10204
  return new PublishTransactionListInfo({ backendModel, publishAction, scheduleTime });
@@ -9951,7 +10291,6 @@ const mapPublishTransactionStateToBackend = (model) => {
9951
10291
  };
9952
10292
 
9953
10293
  const mapPublishTransactionConstructorArgs = (mappingRegistry, backendModel) => {
9954
- var _a;
9955
10294
  const systemWideObjectConstructorArgs = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
9956
10295
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
9957
10296
  const deployerAction = backendModel.DeployerAction ? mapDeployerAction(backendModel.DeployerAction) : undefined;
@@ -9960,13 +10299,15 @@ const mapPublishTransactionConstructorArgs = (mappingRegistry, backendModel) =>
9960
10299
  : undefined;
9961
10300
  const items = mapLinks(mappingRegistry, backendModel.Items);
9962
10301
  const priority = backendModel.Priority ? mapPublishPriority(backendModel.Priority) : undefined;
9963
- const publishContexts = (_a = backendModel.PublishContexts) === null || _a === void 0 ? void 0 : _a.map(p => mappingRegistry.map(p)).filter(isDefined);
10302
+ const publishContexts = backendModel.PublishContexts?.map(p => mappingRegistry.map(p)).filter(isDefined);
9964
10303
  const state = backendModel.State ? mapPublishTransactionState(backendModel.State) : undefined;
9965
10304
  const targetType = backendModel.TargetType ? mappingRegistry.map(backendModel.TargetType) : undefined;
9966
10305
  const stateChangeDateTime = backendModel.StateChangeDateTime
9967
10306
  ? mapDate(backendModel.StateChangeDateTime)
9968
10307
  : undefined;
9969
- return Object.assign(Object.assign({}, systemWideObjectConstructorArgs), { creator,
10308
+ return {
10309
+ ...systemWideObjectConstructorArgs,
10310
+ creator,
9970
10311
  deployerAction,
9971
10312
  instruction,
9972
10313
  items,
@@ -9974,34 +10315,55 @@ const mapPublishTransactionConstructorArgs = (mappingRegistry, backendModel) =>
9974
10315
  publishContexts,
9975
10316
  state,
9976
10317
  targetType,
9977
- stateChangeDateTime });
10318
+ stateChangeDateTime,
10319
+ };
9978
10320
  };
9979
10321
  const publishTransactionMapping = {
9980
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransaction',
10322
+ identifier: backendModel => backendModel?.$type === 'PublishTransaction',
9981
10323
  mapper: (mappingRegistry, backendModel) => {
9982
- return new PublishTransaction(Object.assign(Object.assign({}, mapPublishTransactionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10324
+ return new PublishTransaction({
10325
+ ...mapPublishTransactionConstructorArgs(mappingRegistry, backendModel),
10326
+ backendModel,
10327
+ });
9983
10328
  },
9984
10329
  };
9985
10330
 
9986
10331
  const mapPublishTransactionsCreationResultConstructorArgs = (mappingRegistry, backendModel) => {
9987
- var _a;
9988
- const publishTransactionIds = (_a = backendModel.PublishTransactionIds) === null || _a === void 0 ? void 0 : _a.map(id => tryParseItemUri(id)).filter(isDefined);
10332
+ const publishTransactionIds = backendModel.PublishTransactionIds?.map(id => tryParseItemUri(id)).filter(isDefined);
9989
10333
  return { publishTransactionIds };
9990
10334
  };
9991
10335
  const publishTransactionsCreationResultMapping = {
9992
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishTransactionsCreationResult',
10336
+ identifier: backendModel => backendModel?.$type === 'PublishTransactionsCreationResult',
9993
10337
  mapper: (mappingRegistry, backendModel) => {
9994
- return new PublishTransactionsCreationResult(Object.assign(Object.assign({}, mapPublishTransactionsCreationResultConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10338
+ return new PublishTransactionsCreationResult({
10339
+ ...mapPublishTransactionsCreationResultConstructorArgs(mappingRegistry, backendModel),
10340
+ backendModel,
10341
+ });
9995
10342
  },
9996
10343
  };
9997
10344
 
9998
10345
  const publishUrlInfoMapping = {
9999
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PublishInfo',
10346
+ identifier: backendModel => backendModel?.$type === 'PublishInfo',
10000
10347
  mapper: (mappingRegistry, backendModel) => {
10001
10348
  return new PublishUrlInfo(backendModel);
10002
10349
  },
10003
10350
  };
10004
10351
 
10352
+ const mapRenderedItemConstructorArgs = (mappingRegistry, backendModel) => {
10353
+ const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
10354
+ const template = backendModel.Template ? mappingRegistry.map(backendModel.Template) : undefined;
10355
+ return { item, template };
10356
+ };
10357
+ const renderedItemMapping = {
10358
+ identifier: backendModel => backendModel?.$type === 'RenderedItem',
10359
+ mapper: (mappingRegistry, backendModel) => {
10360
+ return new RenderedItem({
10361
+ ...mapRenderedItemConstructorArgs(mappingRegistry, backendModel),
10362
+ backendModel,
10363
+ });
10364
+ },
10365
+ };
10366
+
10005
10367
  const mapResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
10006
10368
  const item = backendModel.Item ? mappingRegistry.map(backendModel.Item) : undefined;
10007
10369
  const publication = backendModel.Publication ? mappingRegistry.map(backendModel.Publication) : undefined;
@@ -10010,9 +10372,12 @@ const mapResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
10010
10372
  return { item, publication, targetType, template };
10011
10373
  };
10012
10374
  const resolvedItemMapping = {
10013
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ResolvedItem',
10375
+ identifier: backendModel => backendModel?.$type === 'ResolvedItem',
10014
10376
  mapper: (mappingRegistry, backendModel) => {
10015
- return new ResolvedItem(Object.assign(Object.assign({}, mapResolvedItemConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10377
+ return new ResolvedItem({
10378
+ ...mapResolvedItemConstructorArgs(mappingRegistry, backendModel),
10379
+ backendModel,
10380
+ });
10016
10381
  },
10017
10382
  };
10018
10383
 
@@ -10042,19 +10407,21 @@ const mapStructureResolveOptionToBackend = (model) => {
10042
10407
  };
10043
10408
 
10044
10409
  const mapResolveInstructionBaseConstructorArgs = (mappingRegistry, backendModel) => {
10045
- var _a;
10046
10410
  const structureResolveOption = backendModel.StructureResolveOption
10047
10411
  ? mapStructureResolveOption(backendModel.StructureResolveOption)
10048
10412
  : undefined;
10049
- const publishInChildPublications = (_a = backendModel.PublishInChildPublications) === null || _a === void 0 ? void 0 : _a.map(id => parseItemUri(id));
10413
+ const publishInChildPublications = backendModel.PublishInChildPublications?.map(id => parseItemUri(id));
10050
10414
  return { structureResolveOption, publishInChildPublications };
10051
10415
  };
10052
10416
 
10053
10417
  const mapResolveInstructionConstructorArgs = mapResolveInstructionBaseConstructorArgs;
10054
10418
  const resolveInstructionMapping = {
10055
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ResolveInstruction',
10419
+ identifier: backendModel => backendModel?.$type === 'ResolveInstruction',
10056
10420
  mapper: (mappingRegistry, backendModel) => {
10057
- return new ResolveInstruction(Object.assign(Object.assign({}, mapResolveInstructionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10421
+ return new ResolveInstruction({
10422
+ ...mapResolveInstructionConstructorArgs(mappingRegistry, backendModel),
10423
+ backendModel,
10424
+ });
10058
10425
  },
10059
10426
  };
10060
10427
 
@@ -10066,9 +10433,12 @@ const mapUnpublishInstructionConstructorArgs = (mappingRegistry, backendModel) =
10066
10433
  return { startAt, resolveInstruction };
10067
10434
  };
10068
10435
  const unpublishInstructionMapping = {
10069
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UnPublishInstruction',
10436
+ identifier: backendModel => backendModel?.$type === 'UnPublishInstruction',
10070
10437
  mapper: (mappingRegistry, backendModel) => {
10071
- return new UnpublishInstruction(Object.assign(Object.assign({}, mapUnpublishInstructionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
10438
+ return new UnpublishInstruction({
10439
+ ...mapUnpublishInstructionConstructorArgs(mappingRegistry, backendModel),
10440
+ backendModel,
10441
+ });
10072
10442
  },
10073
10443
  };
10074
10444
 
@@ -10085,8 +10455,7 @@ class SynchronizationAction {
10085
10455
  configurable: true,
10086
10456
  writable: true,
10087
10457
  value: (synchronizationAction) => {
10088
- var _a;
10089
- return !!((_a = this.synchronizationActionApplied) === null || _a === void 0 ? void 0 : _a.includes(synchronizationAction));
10458
+ return !!this.synchronizationActionApplied?.includes(synchronizationAction);
10090
10459
  }
10091
10460
  });
10092
10461
  Object.defineProperty(this, "getInternalModel", {
@@ -10194,10 +10563,9 @@ const mapSynchronizeFlagsToBackend = (model) => {
10194
10563
  };
10195
10564
 
10196
10565
  const synchronizationActionMapping = {
10197
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SynchronizationAction',
10566
+ identifier: backendModel => backendModel?.$type === 'SynchronizationAction',
10198
10567
  mapper: (mappingRegistry, backendModel) => {
10199
- var _a;
10200
- const synchronizationActionApplied = (_a = backendModel.SynchronizationActionApplied) === null || _a === void 0 ? void 0 : _a.map(p => mapSynchronizeFlags(p));
10568
+ const synchronizationActionApplied = backendModel.SynchronizationActionApplied?.map(p => mapSynchronizeFlags(p));
10201
10569
  return new SynchronizationAction({
10202
10570
  backendModel,
10203
10571
  synchronizationActionApplied,
@@ -10246,10 +10614,9 @@ class SynchronizationResult {
10246
10614
  }
10247
10615
 
10248
10616
  const synchronizationResultMapping = {
10249
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SynchronizationResult',
10617
+ identifier: backendModel => backendModel?.$type === 'SynchronizationResult',
10250
10618
  mapper: (mappingRegistry, backendModel) => {
10251
- var _a;
10252
- const synchronizationActions = (_a = backendModel.SynchronizationActions) === null || _a === void 0 ? void 0 : _a.map(p => mappingRegistry.map(p)).filter(isDefined);
10619
+ const synchronizationActions = backendModel.SynchronizationActions?.map(p => mappingRegistry.map(p)).filter(isDefined);
10253
10620
  const synchronizedItem = backendModel.SynchronizedItem
10254
10621
  ? mappingRegistry.map(backendModel.SynchronizedItem)
10255
10622
  : undefined;
@@ -10303,16 +10670,16 @@ class SystemPrivilege {
10303
10670
  }
10304
10671
 
10305
10672
  const systemPrivilegeMapping = {
10306
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SystemPrivilege',
10673
+ identifier: backendModel => backendModel?.$type === 'SystemPrivilege',
10307
10674
  mapper: (mappingRegistry, backendModel) => {
10308
10675
  return new SystemPrivilege(backendModel);
10309
10676
  },
10310
10677
  };
10311
10678
 
10312
10679
  const systemPrivilegesDictionaryMapping = {
10313
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'SystemPrivilegesDictionary',
10680
+ identifier: backendModel => backendModel?.$type === 'SystemPrivilegesDictionary',
10314
10681
  mapper: (mappingRegistry, backendModel) => {
10315
- const dictionary = __rest(backendModel, ["$type"]);
10682
+ const { $type, ...dictionary } = backendModel;
10316
10683
  return mapObject(dictionary, (value) => mapLinks(mappingRegistry, value) || []);
10317
10684
  },
10318
10685
  };
@@ -10343,7 +10710,7 @@ class TargetGroup extends RepositoryLocalObject {
10343
10710
 
10344
10711
  const mapTargetGroupConstructorArgs = mapRepositoryLocalObjectConstructorArgs;
10345
10712
  const targetGroupMapping = {
10346
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetGroup',
10713
+ identifier: backendModel => backendModel?.$type === 'TargetGroup',
10347
10714
  mapper: (mappingRegistry, backendModel) => {
10348
10715
  const { applicableActions, basicVersionInfo, blueprintInfo, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, securityDescriptor, listInfo, } = mapTargetGroupConstructorArgs(mappingRegistry, backendModel);
10349
10716
  return new TargetGroup({
@@ -10370,9 +10737,8 @@ const targetGroupMapping = {
10370
10737
  * Abstract base class for the data of Templates.
10371
10738
  */
10372
10739
  class Template extends VersionedItem {
10373
- constructor(_a) {
10374
- var { backendModel, binaryContent, parameterSchema } = _a, versionedItemArgs = __rest(_a, ["backendModel", "binaryContent", "parameterSchema"]);
10375
- super(Object.assign({ backendModel }, versionedItemArgs));
10740
+ constructor({ backendModel, binaryContent, parameterSchema, ...versionedItemArgs }) {
10741
+ super({ backendModel, ...versionedItemArgs });
10376
10742
  Object.defineProperty(this, "_binaryContent", {
10377
10743
  enumerable: true,
10378
10744
  configurable: true,
@@ -10439,9 +10805,8 @@ class Template extends VersionedItem {
10439
10805
  * Represents a Component Template: a template used to render a Component into a Component Presentation.
10440
10806
  */
10441
10807
  class ComponentTemplate extends Template {
10442
- constructor(_a) {
10443
- var { backendModel, approvalStatus, relatedSchemas, trackingCategories, workflowInfo } = _a, templateArgs = __rest(_a, ["backendModel", "approvalStatus", "relatedSchemas", "trackingCategories", "workflowInfo"]);
10444
- super(Object.assign({ backendModel }, templateArgs));
10808
+ constructor({ backendModel, approvalStatus, relatedSchemas, trackingCategories, workflowInfo, ...templateArgs }) {
10809
+ super({ backendModel, ...templateArgs });
10445
10810
  Object.defineProperty(this, "_approvalStatus", {
10446
10811
  enumerable: true,
10447
10812
  configurable: true,
@@ -10572,9 +10937,8 @@ class ComponentTemplate extends Template {
10572
10937
  * Represents a Page Template: a template used to render a Page.
10573
10938
  */
10574
10939
  class PageTemplate extends Template {
10575
- constructor(_a) {
10576
- var { backendModel, approvalStatus, pageSchema, workflowInfo } = _a, templateArgs = __rest(_a, ["backendModel", "approvalStatus", "pageSchema", "workflowInfo"]);
10577
- super(Object.assign({ backendModel }, templateArgs));
10940
+ constructor({ backendModel, approvalStatus, pageSchema, workflowInfo, ...templateArgs }) {
10941
+ super({ backendModel, ...templateArgs });
10578
10942
  Object.defineProperty(this, "_approvalStatus", {
10579
10943
  enumerable: true,
10580
10944
  configurable: true,
@@ -10639,9 +11003,8 @@ class PageTemplate extends Template {
10639
11003
  * Represents a Template Building Block: a re-usable template module.
10640
11004
  */
10641
11005
  class TemplateBuildingBlock extends Template {
10642
- constructor(_a) {
10643
- var { backendModel, approvalStatus, workflowInfo } = _a, templateArgs = __rest(_a, ["backendModel", "approvalStatus", "workflowInfo"]);
10644
- super(Object.assign({ backendModel }, templateArgs));
11006
+ constructor({ backendModel, approvalStatus, workflowInfo, ...templateArgs }) {
11007
+ super({ backendModel, ...templateArgs });
10645
11008
  Object.defineProperty(this, "_approvalStatus", {
10646
11009
  enumerable: true,
10647
11010
  configurable: true,
@@ -10684,8 +11047,11 @@ const mapTemplateConstructorArgs = (mappingRegistry, backendModel) => {
10684
11047
  const parameterSchema = backendModel.ParameterSchema
10685
11048
  ? mappingRegistry.map(backendModel.ParameterSchema)
10686
11049
  : undefined;
10687
- return Object.assign(Object.assign({}, mapVersionedItemConstructorArgs(mappingRegistry, backendModel)), { binaryContent,
10688
- parameterSchema });
11050
+ return {
11051
+ ...mapVersionedItemConstructorArgs(mappingRegistry, backendModel),
11052
+ binaryContent,
11053
+ parameterSchema,
11054
+ };
10689
11055
  };
10690
11056
 
10691
11057
  const mapPageTemplateConstructorArgs = (mappingRegistry, backendModel) => {
@@ -10697,14 +11063,20 @@ const mapPageTemplateConstructorArgs = (mappingRegistry, backendModel) => {
10697
11063
  const workflowInfo = backendModel.WorkflowInfo
10698
11064
  ? mappingRegistry.map(backendModel.WorkflowInfo)
10699
11065
  : undefined;
10700
- return Object.assign(Object.assign({}, templateConstructorArgs), { approvalStatus,
11066
+ return {
11067
+ ...templateConstructorArgs,
11068
+ approvalStatus,
10701
11069
  pageSchema,
10702
- workflowInfo });
11070
+ workflowInfo,
11071
+ };
10703
11072
  };
10704
11073
  const pageTemplateMapping = {
10705
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'PageTemplate',
11074
+ identifier: backendModel => backendModel?.$type === 'PageTemplate',
10706
11075
  mapper: (mappingRegistry, backendModel) => {
10707
- return new PageTemplate(Object.assign(Object.assign({}, mapPageTemplateConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
11076
+ return new PageTemplate({
11077
+ ...mapPageTemplateConstructorArgs(mappingRegistry, backendModel),
11078
+ backendModel,
11079
+ });
10708
11080
  },
10709
11081
  };
10710
11082
 
@@ -10718,15 +11090,21 @@ const mapComponentTemplateConstructorArgs = (mappingRegistry, backendModel) => {
10718
11090
  const workflowInfo = backendModel.WorkflowInfo
10719
11091
  ? mappingRegistry.map(backendModel.WorkflowInfo)
10720
11092
  : undefined;
10721
- return Object.assign(Object.assign({}, templateConstructorArgs), { approvalStatus,
11093
+ return {
11094
+ ...templateConstructorArgs,
11095
+ approvalStatus,
10722
11096
  workflowInfo,
10723
11097
  relatedSchemas,
10724
- trackingCategories });
11098
+ trackingCategories,
11099
+ };
10725
11100
  };
10726
11101
  const componentTemplateMapping = {
10727
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ComponentTemplate',
11102
+ identifier: backendModel => backendModel?.$type === 'ComponentTemplate',
10728
11103
  mapper: (mappingRegistry, backendModel) => {
10729
- return new ComponentTemplate(Object.assign(Object.assign({}, mapComponentTemplateConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
11104
+ return new ComponentTemplate({
11105
+ ...mapComponentTemplateConstructorArgs(mappingRegistry, backendModel),
11106
+ backendModel,
11107
+ });
10730
11108
  },
10731
11109
  };
10732
11110
 
@@ -10738,13 +11116,19 @@ const mapTemplateBuildingBlockConstructorArgs = (mappingRegistry, backendModel)
10738
11116
  const workflowInfo = backendModel.WorkflowInfo
10739
11117
  ? mappingRegistry.map(backendModel.WorkflowInfo)
10740
11118
  : undefined;
10741
- return Object.assign(Object.assign({}, templateConstructorArgs), { approvalStatus,
10742
- workflowInfo });
11119
+ return {
11120
+ ...templateConstructorArgs,
11121
+ approvalStatus,
11122
+ workflowInfo,
11123
+ };
10743
11124
  };
10744
11125
  const templateBuildingBlockMapping = {
10745
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TemplateBuildingBlock',
11126
+ identifier: backendModel => backendModel?.$type === 'TemplateBuildingBlock',
10746
11127
  mapper: (mappingRegistry, backendModel) => {
10747
- return new TemplateBuildingBlock(Object.assign(Object.assign({}, mapTemplateBuildingBlockConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
11128
+ return new TemplateBuildingBlock({
11129
+ ...mapTemplateBuildingBlockConstructorArgs(mappingRegistry, backendModel),
11130
+ backendModel,
11131
+ });
10748
11132
  },
10749
11133
  };
10750
11134
 
@@ -11375,7 +11759,7 @@ class TranslationInfo {
11375
11759
  }
11376
11760
 
11377
11761
  class TranslationJob {
11378
- constructor({ addedItems, backendModel, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, requiredDate, revisionDate, revisor, state, targetLanguages, type, workflowStatus, }) {
11762
+ constructor({ addedItems, backendModel, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, requiredDate, revisionDate, revisor, state, targetLanguages, type, workflowStatus, contextRepository, }) {
11379
11763
  Object.defineProperty(this, "_backendModel", {
11380
11764
  enumerable: true,
11381
11765
  configurable: true,
@@ -11478,6 +11862,12 @@ class TranslationJob {
11478
11862
  writable: true,
11479
11863
  value: void 0
11480
11864
  });
11865
+ Object.defineProperty(this, "_contextRepository", {
11866
+ enumerable: true,
11867
+ configurable: true,
11868
+ writable: true,
11869
+ value: void 0
11870
+ });
11481
11871
  Object.defineProperty(this, "getInternalModel", {
11482
11872
  enumerable: true,
11483
11873
  configurable: true,
@@ -11503,6 +11893,7 @@ class TranslationJob {
11503
11893
  this._creationDate = creationDate;
11504
11894
  this._requiredDate = requiredDate;
11505
11895
  this._revisionDate = revisionDate;
11896
+ this._contextRepository = contextRepository;
11506
11897
  }
11507
11898
  get id() {
11508
11899
  return this._backendModel.Id;
@@ -11525,10 +11916,10 @@ class TranslationJob {
11525
11916
  return this._configurationItemUri;
11526
11917
  }
11527
11918
  /**
11528
- * Title of the Publication containing the <seealso cref="P:Tridion.TranslationManager.OpenApi.V2.Dto.TranslationJob.ConfigurationItemUri" />.
11919
+ * Link to the Context Repository.
11529
11920
  */
11530
- get contextPublicationTitle() {
11531
- return this._backendModel.ContextPublicationTitle;
11921
+ get contextRepository() {
11922
+ return this._contextRepository;
11532
11923
  }
11533
11924
  /**
11534
11925
  * The date the Translation Job was created (in UTC).
@@ -12047,100 +12438,445 @@ class TranslationWorkflowStatus {
12047
12438
  }
12048
12439
  }
12049
12440
 
12050
- const mapTargetLanguageConstructorArgs = (mappingRegistry, backendModel) => {
12051
- var _a, _b;
12052
- const availableWorkflows = (_a = backendModel.AvailableWorkflows) === null || _a === void 0 ? void 0 : _a.map(w => mappingRegistry.map(w)).filter(isDefined);
12053
- const selectedWorkflow = backendModel.SelectedWorkflow
12054
- ? mappingRegistry.map(backendModel.SelectedWorkflow)
12055
- : undefined;
12056
- const targetPublications = (_b = backendModel.TargetPublications) === null || _b === void 0 ? void 0 : _b.map(p => mappingRegistry.map(p)).filter(isDefined);
12057
- return { availableWorkflows, selectedWorkflow, targetPublications };
12058
- };
12059
- const targetLanguageMapping = {
12060
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetLanguage',
12061
- mapper: (mappingRegistry, backendModel) => {
12062
- const { availableWorkflows, selectedWorkflow, targetPublications } = mapTargetLanguageConstructorArgs(mappingRegistry, backendModel);
12063
- return new TargetLanguage({
12064
- availableWorkflows,
12065
- backendModel,
12066
- selectedWorkflow,
12067
- targetPublications,
12441
+ /**
12442
+ * `TranslationJob` class that extends `IdentifiableObject`, that uses `ItemUri` instead of number as an id.
12443
+ *
12444
+ * @note
12445
+ * Please note that the rest of `IdentifiableObject` props will be undefined always.
12446
+ *
12447
+ * To get original object use `getOriginalInternalModel()`, as `getInternalModel()` result will include `Id` in a format `tm:0-1234`.
12448
+ *
12449
+ * @example
12450
+ * TranslationJob.id: number | undefined;
12451
+ * IdentifiableTranslationJob.id: ItemUri;
12452
+ */
12453
+ class IdentifiableTranslationJob extends IdentifiableObject {
12454
+ constructor({ addedItems, backendModel, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, requiredDate, revisionDate, revisor, state, targetLanguages, type, workflowStatus, contextRepository, ...identifiableObjectArgs }) {
12455
+ super({ backendModel, ...identifiableObjectArgs });
12456
+ Object.defineProperty(this, "_backendModel", {
12457
+ enumerable: true,
12458
+ configurable: true,
12459
+ writable: true,
12460
+ value: void 0
12068
12461
  });
12069
- },
12070
- };
12071
-
12072
- const tmsLanguageMapping = {
12073
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TmsLanguage',
12074
- mapper: (mappingRegistry, backendModel) => {
12075
- return new TmsLanguage(backendModel);
12076
- },
12077
- };
12078
-
12079
- const mapTmsWorkflowConstructorArgs = (mappingRegistry, backendModel) => {
12080
- var _a;
12081
- const steps = (_a = backendModel.Steps) === null || _a === void 0 ? void 0 : _a.map(s => mappingRegistry.map(s)).filter(isDefined);
12082
- return { steps };
12083
- };
12084
- const tmsWorkflowMapping = {
12085
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TmsWorkflow',
12086
- mapper: (mappingRegistry, backendModel) => {
12087
- const { steps } = mapTmsWorkflowConstructorArgs(mappingRegistry, backendModel);
12088
- return new TmsWorkflow({ backendModel, steps });
12089
- },
12090
- };
12091
-
12092
- const tmsWorkflowStepMapping = {
12093
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TmsWorkflowStep',
12094
- mapper: (mappingRegistry, backendModel) => {
12095
- return new TmsWorkflowStep(backendModel);
12096
- },
12097
- };
12098
-
12099
- const mapTranslationStatus = (backendModel) => {
12100
- switch (backendModel) {
12101
- case TranslationStatus.NOT_TRANSLATED:
12102
- return 'notTranslated';
12103
- case TranslationStatus.IN_PROGRESS:
12104
- return 'inProgress';
12105
- case TranslationStatus.UP_TO_DATE:
12106
- return 'upToDate';
12107
- case TranslationStatus.NEW_SOURCE_VERSION_EXISTS:
12108
- return 'newSourceVersionExists';
12109
- case TranslationStatus.NEW_TARGET_VERSION_EXISTS:
12110
- return 'newTargetVersionExists';
12111
- case TranslationStatus.UNKNOWN_BY_CLIENT:
12112
- return 'unknownByClient';
12113
- }
12114
- };
12115
- const mapTranslationStatusToBackend = (model) => {
12116
- switch (model) {
12117
- case 'notTranslated':
12118
- return TranslationStatus.NOT_TRANSLATED;
12119
- case 'inProgress':
12120
- return TranslationStatus.IN_PROGRESS;
12121
- case 'upToDate':
12122
- return TranslationStatus.UP_TO_DATE;
12123
- case 'newSourceVersionExists':
12124
- return TranslationStatus.NEW_SOURCE_VERSION_EXISTS;
12125
- case 'newTargetVersionExists':
12126
- return TranslationStatus.NEW_TARGET_VERSION_EXISTS;
12127
- case 'unknownByClient':
12128
- return TranslationStatus.UNKNOWN_BY_CLIENT;
12129
- }
12130
- };
12131
-
12132
- const mapTranslationDetailsConstructorArgs = (mappingRegistry, backendModel) => {
12133
- var _a;
12134
- const completedTranslationInfo = backendModel.CompletedTranslationInfo
12135
- ? mappingRegistry.map(backendModel.CompletedTranslationInfo)
12136
- : undefined;
12137
- const inProgressTranslationInfo = (_a = backendModel.InProgressTranslationInfo) === null || _a === void 0 ? void 0 : _a.map(tji => mappingRegistry.map(tji)).filter(isDefined);
12138
- const sourceItemUri = backendModel.SourceItemUri ? parseItemUri(backendModel.SourceItemUri) : undefined;
12139
- const sourcePublicationUri = backendModel.SourcePublicationUri
12140
- ? parseItemUri(backendModel.SourcePublicationUri)
12141
- : undefined;
12142
- const status = backendModel.Status ? mapTranslationStatus(backendModel.Status) : undefined;
12143
- const targetItemUri = backendModel.TargetItemUri ? parseItemUri(backendModel.TargetItemUri) : undefined;
12462
+ Object.defineProperty(this, "_addedItems", {
12463
+ enumerable: true,
12464
+ configurable: true,
12465
+ writable: true,
12466
+ value: void 0
12467
+ });
12468
+ Object.defineProperty(this, "_creator", {
12469
+ enumerable: true,
12470
+ configurable: true,
12471
+ writable: true,
12472
+ value: void 0
12473
+ });
12474
+ Object.defineProperty(this, "_configurationItemUri", {
12475
+ enumerable: true,
12476
+ configurable: true,
12477
+ writable: true,
12478
+ value: void 0
12479
+ });
12480
+ Object.defineProperty(this, "_displayState", {
12481
+ enumerable: true,
12482
+ configurable: true,
12483
+ writable: true,
12484
+ value: void 0
12485
+ });
12486
+ Object.defineProperty(this, "_errors", {
12487
+ enumerable: true,
12488
+ configurable: true,
12489
+ writable: true,
12490
+ value: void 0
12491
+ });
12492
+ Object.defineProperty(this, "_errorSeverityLevel", {
12493
+ enumerable: true,
12494
+ configurable: true,
12495
+ writable: true,
12496
+ value: void 0
12497
+ });
12498
+ Object.defineProperty(this, "_language", {
12499
+ enumerable: true,
12500
+ configurable: true,
12501
+ writable: true,
12502
+ value: void 0
12503
+ });
12504
+ Object.defineProperty(this, "_priority", {
12505
+ enumerable: true,
12506
+ configurable: true,
12507
+ writable: true,
12508
+ value: void 0
12509
+ });
12510
+ Object.defineProperty(this, "_revisor", {
12511
+ enumerable: true,
12512
+ configurable: true,
12513
+ writable: true,
12514
+ value: void 0
12515
+ });
12516
+ Object.defineProperty(this, "_state", {
12517
+ enumerable: true,
12518
+ configurable: true,
12519
+ writable: true,
12520
+ value: void 0
12521
+ });
12522
+ Object.defineProperty(this, "_targetLanguages", {
12523
+ enumerable: true,
12524
+ configurable: true,
12525
+ writable: true,
12526
+ value: void 0
12527
+ });
12528
+ Object.defineProperty(this, "_type", {
12529
+ enumerable: true,
12530
+ configurable: true,
12531
+ writable: true,
12532
+ value: void 0
12533
+ });
12534
+ Object.defineProperty(this, "_workflowStatus", {
12535
+ enumerable: true,
12536
+ configurable: true,
12537
+ writable: true,
12538
+ value: void 0
12539
+ });
12540
+ Object.defineProperty(this, "_creationDate", {
12541
+ enumerable: true,
12542
+ configurable: true,
12543
+ writable: true,
12544
+ value: void 0
12545
+ });
12546
+ Object.defineProperty(this, "_requiredDate", {
12547
+ enumerable: true,
12548
+ configurable: true,
12549
+ writable: true,
12550
+ value: void 0
12551
+ });
12552
+ Object.defineProperty(this, "_revisionDate", {
12553
+ enumerable: true,
12554
+ configurable: true,
12555
+ writable: true,
12556
+ value: void 0
12557
+ });
12558
+ Object.defineProperty(this, "_contextRepository", {
12559
+ enumerable: true,
12560
+ configurable: true,
12561
+ writable: true,
12562
+ value: void 0
12563
+ });
12564
+ Object.defineProperty(this, "getOriginalInternalModel", {
12565
+ enumerable: true,
12566
+ configurable: true,
12567
+ writable: true,
12568
+ value: () => {
12569
+ const originalId = typeof this._id.itemId === 'number' ? this._id.itemId : undefined;
12570
+ return {
12571
+ ...this._backendModel,
12572
+ $type: 'TranslationJob',
12573
+ Id: originalId,
12574
+ };
12575
+ }
12576
+ });
12577
+ Object.defineProperty(this, "getInternalModel", {
12578
+ enumerable: true,
12579
+ configurable: true,
12580
+ writable: true,
12581
+ value: () => {
12582
+ return this._backendModel;
12583
+ }
12584
+ });
12585
+ this._backendModel = backendModel;
12586
+ this._addedItems = addedItems;
12587
+ this._creator = creator;
12588
+ this._configurationItemUri = configurationItemUri;
12589
+ this._displayState = displayState;
12590
+ this._errors = errors;
12591
+ this._errorSeverityLevel = errorSeverityLevel;
12592
+ this._language = language;
12593
+ this._priority = priority;
12594
+ this._revisor = revisor;
12595
+ this._state = state;
12596
+ this._targetLanguages = targetLanguages;
12597
+ this._type = type;
12598
+ this._workflowStatus = workflowStatus;
12599
+ this._creationDate = creationDate;
12600
+ this._requiredDate = requiredDate;
12601
+ this._revisionDate = revisionDate;
12602
+ this._contextRepository = contextRepository;
12603
+ }
12604
+ get title() {
12605
+ return this._backendModel.Title;
12606
+ }
12607
+ /**
12608
+ * Collection containing the `AddedItem`s that have been added to this Translation Job.
12609
+ * The `AddedItem`s represent either an Item that will be translated (for example a Component) or
12610
+ * an Item that contains the Items that will be translated (for example a Folder).
12611
+ */
12612
+ get addedItems() {
12613
+ return this._addedItems;
12614
+ }
12615
+ /**
12616
+ * TCM URI of the item containing the `TranslationConfiguration` used for this Translation Job.
12617
+ */
12618
+ get configurationItemUri() {
12619
+ return this._configurationItemUri;
12620
+ }
12621
+ /**
12622
+ * Link to the Context Repository.
12623
+ */
12624
+ get contextRepository() {
12625
+ return this._contextRepository;
12626
+ }
12627
+ /**
12628
+ * The date the Translation Job was created (in UTC).
12629
+ */
12630
+ get creationDate() {
12631
+ return this._creationDate;
12632
+ }
12633
+ /**
12634
+ * A link to the user who created the Translation Job.
12635
+ */
12636
+ get creator() {
12637
+ return this._creator;
12638
+ }
12639
+ get displayState() {
12640
+ return this._displayState;
12641
+ }
12642
+ /**
12643
+ * Collection of errors registered to this job.
12644
+ */
12645
+ get errors() {
12646
+ return this._errors;
12647
+ }
12648
+ get errorSeverityLevel() {
12649
+ return this._errorSeverityLevel;
12650
+ }
12651
+ get hasError() {
12652
+ return this._backendModel.HasError || false;
12653
+ }
12654
+ /**
12655
+ * Value indicating whether items that have already been translated should be included in the job.
12656
+ */
12657
+ get includeItemsAlreadyTranslated() {
12658
+ return this._backendModel.IncludeItemsAlreadyTranslated || false;
12659
+ }
12660
+ /**
12661
+ * Value indicating if the Translation Job currently have one or more `TranslationJobQuote`s awaiting authorization (see remarks).
12662
+ */
12663
+ get isAwaitingAuthorization() {
12664
+ return this._backendModel.IsAwaitingAuthorization || false;
12665
+ }
12666
+ get language() {
12667
+ return this._language;
12668
+ }
12669
+ /**
12670
+ * Metadata associated with the Translation Job.
12671
+ */
12672
+ get metadata() {
12673
+ return this._backendModel.Metadata;
12674
+ }
12675
+ /**
12676
+ * TCM URI of the metadata schema used for this Translation Job.
12677
+ *
12678
+ * @deprecated will be mapped to `ItemUri` in the next major release.
12679
+ */
12680
+ get metadataSchemaUri() {
12681
+ return this._backendModel.MetadataSchemaUri;
12682
+ }
12683
+ /**
12684
+ * The priority of the Translation Job. This value will only have an affect if `SupportsPriority` returns true.
12685
+ */
12686
+ get priority() {
12687
+ return this._priority;
12688
+ }
12689
+ get progressPercentage() {
12690
+ return this._backendModel.ProgressPercentage;
12691
+ }
12692
+ /**
12693
+ * The due date for this job.
12694
+ */
12695
+ get requiredDate() {
12696
+ return this._requiredDate;
12697
+ }
12698
+ get revisionDate() {
12699
+ return this._revisionDate;
12700
+ }
12701
+ /**
12702
+ * A link to the user who last modified the Translation Job.
12703
+ */
12704
+ get revisor() {
12705
+ return this._revisor;
12706
+ }
12707
+ get state() {
12708
+ return this._state;
12709
+ }
12710
+ /**
12711
+ * Show if `TranslationJob` support setting of priority.
12712
+ */
12713
+ get supportsPriority() {
12714
+ return this._backendModel.SupportsPriority || false;
12715
+ }
12716
+ /**
12717
+ * Show if `TranslationJob` support setting required rate.
12718
+ */
12719
+ get supportsRequiredDate() {
12720
+ return this._backendModel.SupportsRequiredDate || false;
12721
+ }
12722
+ /**
12723
+ * List of target languages available for this `TranslationJob`.
12724
+ */
12725
+ get targetLanguages() {
12726
+ return this._targetLanguages;
12727
+ }
12728
+ /**
12729
+ * Value indicating if the Translation Job is a translation to the Publication of the `ConfigurationItemUri`
12730
+ * (Pull job) or from the Publication (Push job).
12731
+ */
12732
+ get type() {
12733
+ return this._type;
12734
+ }
12735
+ /**
12736
+ * Item count of language/workflowstep pairs.
12737
+ */
12738
+ get workflowStatus() {
12739
+ return this._workflowStatus;
12740
+ }
12741
+ }
12742
+
12743
+ class TranslationResolvedItem {
12744
+ constructor({ backendModel, sourceItem, targetLanguages }) {
12745
+ Object.defineProperty(this, "_backendModel", {
12746
+ enumerable: true,
12747
+ configurable: true,
12748
+ writable: true,
12749
+ value: void 0
12750
+ });
12751
+ Object.defineProperty(this, "_sourceItem", {
12752
+ enumerable: true,
12753
+ configurable: true,
12754
+ writable: true,
12755
+ value: void 0
12756
+ });
12757
+ Object.defineProperty(this, "_targetLanguages", {
12758
+ enumerable: true,
12759
+ configurable: true,
12760
+ writable: true,
12761
+ value: void 0
12762
+ });
12763
+ Object.defineProperty(this, "getInternalModel", {
12764
+ enumerable: true,
12765
+ configurable: true,
12766
+ writable: true,
12767
+ value: () => {
12768
+ return this._backendModel;
12769
+ }
12770
+ });
12771
+ this._backendModel = backendModel;
12772
+ this._targetLanguages = targetLanguages;
12773
+ this._sourceItem = sourceItem;
12774
+ }
12775
+ get isValidForTranslation() {
12776
+ return !!this._backendModel.IsValidForTranslation;
12777
+ }
12778
+ get comment() {
12779
+ return this._backendModel.Comment;
12780
+ }
12781
+ get sourceItem() {
12782
+ return this._sourceItem;
12783
+ }
12784
+ get targetLanguages() {
12785
+ return this._targetLanguages;
12786
+ }
12787
+ }
12788
+
12789
+ const mapTargetLanguageConstructorArgs = (mappingRegistry, backendModel) => {
12790
+ const availableWorkflows = backendModel.AvailableWorkflows?.map(w => mappingRegistry.map(w)).filter(isDefined);
12791
+ const selectedWorkflow = backendModel.SelectedWorkflow
12792
+ ? mappingRegistry.map(backendModel.SelectedWorkflow)
12793
+ : undefined;
12794
+ const targetPublications = backendModel.TargetPublications?.map(p => mappingRegistry.map(p)).filter(isDefined);
12795
+ return { availableWorkflows, selectedWorkflow, targetPublications };
12796
+ };
12797
+ const targetLanguageMapping = {
12798
+ identifier: backendModel => backendModel?.$type === 'TargetLanguage' || backendModel?.$type === 'ResolvedItemTargetLanguage',
12799
+ mapper: (mappingRegistry, backendModel) => {
12800
+ const { availableWorkflows, selectedWorkflow, targetPublications } = mapTargetLanguageConstructorArgs(mappingRegistry, backendModel);
12801
+ return new TargetLanguage({
12802
+ availableWorkflows,
12803
+ backendModel,
12804
+ selectedWorkflow,
12805
+ targetPublications,
12806
+ });
12807
+ },
12808
+ };
12809
+
12810
+ const tmsLanguageMapping = {
12811
+ identifier: backendModel => backendModel?.$type === 'TmsLanguage',
12812
+ mapper: (mappingRegistry, backendModel) => {
12813
+ return new TmsLanguage(backendModel);
12814
+ },
12815
+ };
12816
+
12817
+ const mapTmsWorkflowConstructorArgs = (mappingRegistry, backendModel) => {
12818
+ const steps = backendModel.Steps?.map(s => mappingRegistry.map(s)).filter(isDefined);
12819
+ return { steps };
12820
+ };
12821
+ const tmsWorkflowMapping = {
12822
+ identifier: backendModel => backendModel?.$type === 'TmsWorkflow',
12823
+ mapper: (mappingRegistry, backendModel) => {
12824
+ const { steps } = mapTmsWorkflowConstructorArgs(mappingRegistry, backendModel);
12825
+ return new TmsWorkflow({ backendModel, steps });
12826
+ },
12827
+ };
12828
+
12829
+ const tmsWorkflowStepMapping = {
12830
+ identifier: backendModel => backendModel?.$type === 'TmsWorkflowStep',
12831
+ mapper: (mappingRegistry, backendModel) => {
12832
+ return new TmsWorkflowStep(backendModel);
12833
+ },
12834
+ };
12835
+
12836
+ const mapTranslationStatus = (backendModel) => {
12837
+ switch (backendModel) {
12838
+ case TranslationStatus.NOT_TRANSLATED:
12839
+ return 'notTranslated';
12840
+ case TranslationStatus.IN_PROGRESS:
12841
+ return 'inProgress';
12842
+ case TranslationStatus.UP_TO_DATE:
12843
+ return 'upToDate';
12844
+ case TranslationStatus.NEW_SOURCE_VERSION_EXISTS:
12845
+ return 'newSourceVersionExists';
12846
+ case TranslationStatus.NEW_TARGET_VERSION_EXISTS:
12847
+ return 'newTargetVersionExists';
12848
+ case TranslationStatus.UNKNOWN_BY_CLIENT:
12849
+ return 'unknownByClient';
12850
+ }
12851
+ };
12852
+ const mapTranslationStatusToBackend = (model) => {
12853
+ switch (model) {
12854
+ case 'notTranslated':
12855
+ return TranslationStatus.NOT_TRANSLATED;
12856
+ case 'inProgress':
12857
+ return TranslationStatus.IN_PROGRESS;
12858
+ case 'upToDate':
12859
+ return TranslationStatus.UP_TO_DATE;
12860
+ case 'newSourceVersionExists':
12861
+ return TranslationStatus.NEW_SOURCE_VERSION_EXISTS;
12862
+ case 'newTargetVersionExists':
12863
+ return TranslationStatus.NEW_TARGET_VERSION_EXISTS;
12864
+ case 'unknownByClient':
12865
+ return TranslationStatus.UNKNOWN_BY_CLIENT;
12866
+ }
12867
+ };
12868
+
12869
+ const mapTranslationDetailsConstructorArgs = (mappingRegistry, backendModel) => {
12870
+ const completedTranslationInfo = backendModel.CompletedTranslationInfo
12871
+ ? mappingRegistry.map(backendModel.CompletedTranslationInfo)
12872
+ : undefined;
12873
+ const inProgressTranslationInfo = backendModel.InProgressTranslationInfo?.map(tji => mappingRegistry.map(tji)).filter(isDefined);
12874
+ const sourceItemUri = backendModel.SourceItemUri ? parseItemUri(backendModel.SourceItemUri) : undefined;
12875
+ const sourcePublicationUri = backendModel.SourcePublicationUri
12876
+ ? parseItemUri(backendModel.SourcePublicationUri)
12877
+ : undefined;
12878
+ const status = backendModel.Status ? mapTranslationStatus(backendModel.Status) : undefined;
12879
+ const targetItemUri = backendModel.TargetItemUri ? parseItemUri(backendModel.TargetItemUri) : undefined;
12144
12880
  const targetPublicationUri = backendModel.TargetPublicationUri
12145
12881
  ? parseItemUri(backendModel.TargetPublicationUri)
12146
12882
  : undefined;
@@ -12155,7 +12891,7 @@ const mapTranslationDetailsConstructorArgs = (mappingRegistry, backendModel) =>
12155
12891
  };
12156
12892
  };
12157
12893
  const translationDetailsMapping = {
12158
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationDetails',
12894
+ identifier: backendModel => backendModel?.$type === 'TranslationDetails',
12159
12895
  mapper: (mappingRegistry, backendModel) => {
12160
12896
  const { completedTranslationInfo, inProgressTranslationInfo, sourceItemUri, sourcePublicationUri, status, targetItemUri, targetPublicationUri, } = mapTranslationDetailsConstructorArgs(mappingRegistry, backendModel);
12161
12897
  return new TranslationDetails({
@@ -12203,7 +12939,7 @@ const mapTranslationErrorDetailsConstructorArgs = (mappingRegistry, backendModel
12203
12939
  const severity = backendModel.Severity ? mapTranslationErrorSeverity(backendModel.Severity) : undefined;
12204
12940
  const itemSourceUri = backendModel.TcmItemSourceUri ? parseItemUri(backendModel.TcmItemSourceUri) : undefined;
12205
12941
  const itemTargetUri = backendModel.TcmItemTargetUri ? parseItemUri(backendModel.TcmItemTargetUri) : undefined;
12206
- const jobUri = backendModel.TmsJobId ? parseItemUri(backendModel.TmsJobId) : undefined;
12942
+ const jobUri = backendModel.JobId ? TmUri.create(backendModel.JobId) : undefined;
12207
12943
  return {
12208
12944
  exceptionDetails,
12209
12945
  itemSourceUri,
@@ -12213,7 +12949,7 @@ const mapTranslationErrorDetailsConstructorArgs = (mappingRegistry, backendModel
12213
12949
  };
12214
12950
  };
12215
12951
  const translationErrorDetailsMapping = {
12216
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationErrorDetails',
12952
+ identifier: backendModel => backendModel?.$type === 'ErrorDetails',
12217
12953
  mapper: (mappingRegistry, backendModel) => {
12218
12954
  const { exceptionDetails, itemSourceUri, itemTargetUri, jobUri, severity } = mapTranslationErrorDetailsConstructorArgs(mappingRegistry, backendModel);
12219
12955
  return new TranslationErrorDetails({
@@ -12234,7 +12970,7 @@ const mapTranslationExceptionDetailsConstructorArgs = (mappingRegistry, backendM
12234
12970
  return { innerException };
12235
12971
  };
12236
12972
  const translationExceptionDetailsMapping = {
12237
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationExceptionDetails',
12973
+ identifier: backendModel => backendModel?.$type === 'ExceptionDetails',
12238
12974
  mapper: (mappingRegistry, backendModel) => {
12239
12975
  const { innerException } = mapTranslationExceptionDetailsConstructorArgs(mappingRegistry, backendModel);
12240
12976
  return new TranslationExceptionDetails({ backendModel, innerException });
@@ -12242,18 +12978,17 @@ const translationExceptionDetailsMapping = {
12242
12978
  };
12243
12979
 
12244
12980
  const mapTranslationInfoConstructorArgs = (mappingRegistry, backendModel) => {
12245
- var _a;
12246
12981
  const contextLanguage = backendModel.ContextLanguage
12247
12982
  ? mappingRegistry.map(backendModel.ContextLanguage)
12248
12983
  : undefined;
12249
12984
  const translationFrom = backendModel.TranslationFrom
12250
12985
  ? mappingRegistry.map(backendModel.TranslationFrom)
12251
12986
  : undefined;
12252
- const translationTo = (_a = backendModel.TranslationTo) === null || _a === void 0 ? void 0 : _a.map(td => mappingRegistry.map(td)).filter(isDefined);
12987
+ const translationTo = backendModel.TranslationTo?.map(td => mappingRegistry.map(td)).filter(isDefined);
12253
12988
  return { contextLanguage, translationFrom, translationTo };
12254
12989
  };
12255
12990
  const translationInfoMapping = {
12256
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationInfo',
12991
+ identifier: backendModel => backendModel?.$type === 'TranslationInfo',
12257
12992
  mapper: (mappingRegistry, backendModel) => {
12258
12993
  const { contextLanguage, translationFrom, translationTo } = mapTranslationInfoConstructorArgs(mappingRegistry, backendModel);
12259
12994
  return new TranslationInfo({ backendModel, contextLanguage, translationFrom, translationTo });
@@ -12318,7 +13053,7 @@ const mapTranslationJobInfoConstructorArgs = (mappingRegistry, backendModel) =>
12318
13053
  };
12319
13054
  };
12320
13055
  const translationJobInfoMapping = {
12321
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationJobInfo',
13056
+ identifier: backendModel => backendModel?.$type === 'TranslationJobInfo',
12322
13057
  mapper: (mappingRegistry, backendModel) => {
12323
13058
  const { retrievedFromTranslationDate, retrieveReason, sendForTranslationDate, sourceItemUri, sourcePublicationUri, sourceRevisionDate, targetItemUri, targetRevisionDate, } = mapTranslationJobInfoConstructorArgs(mappingRegistry, backendModel);
12324
13059
  return new TranslationJobInfo({
@@ -12336,13 +13071,12 @@ const translationJobInfoMapping = {
12336
13071
  };
12337
13072
 
12338
13073
  const mapTranslationJobItemConstructorArgs = (mappingRegistry, backendModel) => {
12339
- var _a;
12340
13074
  const idRef = backendModel.IdRef ? parseItemUri(backendModel.IdRef) : undefined;
12341
- const resolveOptions = (_a = backendModel.ResolveOptions) === null || _a === void 0 ? void 0 : _a.map(o => mapResolveOptions(o));
13075
+ const resolveOptions = backendModel.ResolveOptions?.map(o => mapResolveOptions(o));
12342
13076
  return { idRef, resolveOptions };
12343
13077
  };
12344
13078
  const translationJobItemMapping = {
12345
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AddedItem',
13079
+ identifier: backendModel => backendModel?.$type === 'AddedItem',
12346
13080
  mapper: (mappingRegistry, backendModel) => {
12347
13081
  const { idRef, resolveOptions } = mapTranslationJobItemConstructorArgs(mappingRegistry, backendModel);
12348
13082
  return new TranslationJobItem({ backendModel, idRef, resolveOptions });
@@ -12449,8 +13183,7 @@ const mapTranslationJobTypeToBackend = (model) => {
12449
13183
  };
12450
13184
 
12451
13185
  const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12452
- var _a, _b, _c, _d, _e;
12453
- const addedItems = (_a = backendModel.AddedItems) === null || _a === void 0 ? void 0 : _a.map(i => mappingRegistry.map(i)).filter(isDefined);
13186
+ const addedItems = backendModel.AddedItems?.map(i => mappingRegistry.map(i)).filter(isDefined);
12454
13187
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
12455
13188
  const configurationItemUri = backendModel.ConfigurationItemUri
12456
13189
  ? parseItemUri(backendModel.ConfigurationItemUri)
@@ -12458,7 +13191,7 @@ const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12458
13191
  const displayState = backendModel.DisplayState
12459
13192
  ? mapTranslationJobDisplayState(backendModel.DisplayState)
12460
13193
  : undefined;
12461
- const errors = (_b = backendModel.Errors) === null || _b === void 0 ? void 0 : _b.map(e => mappingRegistry.map(e)).filter(isDefined);
13194
+ const errors = backendModel.Errors?.map(e => mappingRegistry.map(e)).filter(isDefined);
12462
13195
  const errorSeverityLevel = backendModel.ErrorSeverityLevel
12463
13196
  ? mapTranslationErrorSeverity(backendModel.ErrorSeverityLevel)
12464
13197
  : undefined;
@@ -12466,12 +13199,15 @@ const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12466
13199
  const priority = backendModel.Priority ? mapTranslationJobPriority(backendModel.Priority) : undefined;
12467
13200
  const revisor = backendModel.Revisor ? mappingRegistry.map(backendModel.Revisor) : undefined;
12468
13201
  const state = backendModel.State ? mapTranslationJobState(backendModel.State) : undefined;
12469
- const targetLanguages = (_c = backendModel.TargetLanguages) === null || _c === void 0 ? void 0 : _c.map(l => mappingRegistry.map(l)).filter(isDefined);
12470
- const type = (_d = backendModel.Type) === null || _d === void 0 ? void 0 : _d.map(t => mapTranslationJobType(t));
12471
- const workflowStatus = (_e = backendModel.WorkflowStatus) === null || _e === void 0 ? void 0 : _e.map(s => mappingRegistry.map(s)).filter(isDefined);
13202
+ const targetLanguages = backendModel.TargetLanguages?.map(l => mappingRegistry.map(l)).filter(isDefined);
13203
+ const type = backendModel.Type?.map(t => mapTranslationJobType(t));
13204
+ const workflowStatus = backendModel.WorkflowStatus?.map(s => mappingRegistry.map(s)).filter(isDefined);
12472
13205
  const creationDate = backendModel.CreationDate ? mapDate(backendModel.CreationDate) : undefined;
12473
13206
  const requiredDate = backendModel.RequiredDate ? mapDate(backendModel.RequiredDate) : undefined;
12474
13207
  const revisionDate = backendModel.RevisionDate ? mapDate(backendModel.RevisionDate) : undefined;
13208
+ const contextRepository = backendModel.ContextRepository
13209
+ ? mappingRegistry.map(backendModel.ContextRepository)
13210
+ : undefined;
12475
13211
  return {
12476
13212
  addedItems,
12477
13213
  configurationItemUri,
@@ -12489,12 +13225,13 @@ const mapTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
12489
13225
  targetLanguages,
12490
13226
  type,
12491
13227
  workflowStatus,
13228
+ contextRepository,
12492
13229
  };
12493
13230
  };
12494
13231
  const translationJobMapping = {
12495
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationJob',
13232
+ identifier: backendModel => backendModel?.$type === 'TranslationJob',
12496
13233
  mapper: (mappingRegistry, backendModel) => {
12497
- const { addedItems, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, revisor, state, targetLanguages, type, workflowStatus, requiredDate, revisionDate, } = mapTranslationJobConstructorArgs(mappingRegistry, backendModel);
13234
+ const { addedItems, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, revisor, state, targetLanguages, type, workflowStatus, requiredDate, revisionDate, contextRepository, } = mapTranslationJobConstructorArgs(mappingRegistry, backendModel);
12498
13235
  return new TranslationJob({
12499
13236
  addedItems,
12500
13237
  backendModel,
@@ -12513,6 +13250,7 @@ const translationJobMapping = {
12513
13250
  targetLanguages,
12514
13251
  type,
12515
13252
  workflowStatus,
13253
+ contextRepository,
12516
13254
  });
12517
13255
  },
12518
13256
  };
@@ -12525,7 +13263,7 @@ const mapTranslationTargetPublicationConstructorArgs = (mappingRegistry, backend
12525
13263
  return { configurationItemUri, idRef };
12526
13264
  };
12527
13265
  const translationTargetPublicationMapping = {
12528
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TargetPublication',
13266
+ identifier: backendModel => backendModel?.$type === 'TargetPublication',
12529
13267
  mapper: (mappingRegistry, backendModel) => {
12530
13268
  const { configurationItemUri, idRef } = mapTranslationTargetPublicationConstructorArgs(mappingRegistry, backendModel);
12531
13269
  return new TranslationTargetPublication({ backendModel, configurationItemUri, idRef });
@@ -12540,20 +13278,79 @@ const mapTranslationWorkflowStatusConstructorArgs = (mappingRegistry, backendMod
12540
13278
  return { language, workflowStep };
12541
13279
  };
12542
13280
  const translationWorkflowStatusMapping = {
12543
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TranslationWorkflowStatus',
13281
+ identifier: backendModel => backendModel?.$type === 'TranslationWorkflowStatus',
12544
13282
  mapper: (mappingRegistry, backendModel) => {
12545
13283
  const { language, workflowStep } = mapTranslationWorkflowStatusConstructorArgs(mappingRegistry, backendModel);
12546
13284
  return new TranslationWorkflowStatus({ backendModel, language, workflowStep });
12547
13285
  },
12548
13286
  };
12549
13287
 
13288
+ const mapIdentifiableTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
13289
+ const virtualId = backendModel.Id !== undefined ? TmUri.create(backendModel.Id) : TmUri.create(0);
13290
+ const backendTranslationJobWithId = {
13291
+ ...backendModel,
13292
+ Id: virtualId.asString,
13293
+ };
13294
+ return {
13295
+ ...mapTranslationJobConstructorArgs(mappingRegistry, backendModel),
13296
+ ...mapIdentifiableObjectConstructorArgs(mappingRegistry, backendTranslationJobWithId),
13297
+ };
13298
+ };
13299
+ const identifiableTranslationJobMapping = {
13300
+ identifier: backendModel => backendModel?.$type === 'IdentifiableTranslationJob',
13301
+ mapper: (mappingRegistry, backendModel) => {
13302
+ const { addedItems, configurationItemUri, creationDate, creator, displayState, errors, errorSeverityLevel, language, priority, revisor, state, targetLanguages, type, workflowStatus, requiredDate, revisionDate, ...identifiableObjectProps } = mapIdentifiableTranslationJobConstructorArgs(mappingRegistry, backendModel);
13303
+ return new IdentifiableTranslationJob({
13304
+ ...identifiableObjectProps,
13305
+ addedItems,
13306
+ backendModel: {
13307
+ ...backendModel,
13308
+ Id: identifiableObjectProps.id.asString,
13309
+ },
13310
+ configurationItemUri,
13311
+ creationDate,
13312
+ creator,
13313
+ displayState,
13314
+ errors,
13315
+ errorSeverityLevel,
13316
+ language,
13317
+ priority,
13318
+ requiredDate,
13319
+ revisionDate,
13320
+ revisor,
13321
+ state,
13322
+ targetLanguages,
13323
+ type,
13324
+ workflowStatus,
13325
+ });
13326
+ },
13327
+ };
13328
+
13329
+ const mapTranslationResolvedItemConstructorArgs = (mappingRegistry, backendModel) => {
13330
+ const sourceItem = backendModel.SourceItem
13331
+ ? mappingRegistry.map(backendModel.SourceItem)
13332
+ : undefined;
13333
+ const targetLanguages = backendModel.TargetLanguages?.map(tl => mappingRegistry.map(tl)).filter(isDefined);
13334
+ return { sourceItem, targetLanguages };
13335
+ };
13336
+ const translationResolvedItemMapping = {
13337
+ identifier: backendModel => backendModel?.$type === 'TmResolvedItem',
13338
+ mapper: (mappingRegistry, backendModel) => {
13339
+ const { sourceItem, targetLanguages } = mapTranslationResolvedItemConstructorArgs(mappingRegistry, backendModel);
13340
+ return new TranslationResolvedItem({
13341
+ backendModel,
13342
+ sourceItem,
13343
+ targetLanguages,
13344
+ });
13345
+ },
13346
+ };
13347
+
12550
13348
  /**
12551
13349
  * Abstract base class for the data of "Trustees": the data of Users or Groups.
12552
13350
  */
12553
13351
  class Trustee extends SystemWideObject {
12554
- constructor(_a) {
12555
- var { backendModel, groupMemberships } = _a, systemWideObjectArgs = __rest(_a, ["backendModel", "groupMemberships"]);
12556
- super(Object.assign({ backendModel }, systemWideObjectArgs));
13352
+ constructor({ backendModel, groupMemberships, ...systemWideObjectArgs }) {
13353
+ super({ backendModel, ...systemWideObjectArgs });
12557
13354
  Object.defineProperty(this, "_groupMemberships", {
12558
13355
  enumerable: true,
12559
13356
  configurable: true,
@@ -12591,9 +13388,8 @@ class Trustee extends SystemWideObject {
12591
13388
  }
12592
13389
 
12593
13390
  class User extends Trustee {
12594
- constructor(_a) {
12595
- var { backendModel } = _a, trusteeArgs = __rest(_a, ["backendModel"]);
12596
- super(Object.assign({ backendModel }, trusteeArgs));
13391
+ constructor({ backendModel, ...trusteeArgs }) {
13392
+ super({ backendModel, ...trusteeArgs });
12597
13393
  Object.defineProperty(this, "getInternalModel", {
12598
13394
  enumerable: true,
12599
13395
  configurable: true,
@@ -12630,9 +13426,8 @@ class User extends Trustee {
12630
13426
  }
12631
13427
 
12632
13428
  class AccessToken extends User {
12633
- constructor(_a) {
12634
- var { backendModel, inheritedSystemPrivileges } = _a, userArgs = __rest(_a, ["backendModel", "inheritedSystemPrivileges"]);
12635
- super(Object.assign({ backendModel }, userArgs));
13429
+ constructor({ backendModel, inheritedSystemPrivileges, ...userArgs }) {
13430
+ super({ backendModel, ...userArgs });
12636
13431
  Object.defineProperty(this, "_backendModel", {
12637
13432
  enumerable: true,
12638
13433
  configurable: true,
@@ -12779,9 +13574,8 @@ class UserFavoriteLink {
12779
13574
  * Represents a data of Group of Users.
12780
13575
  */
12781
13576
  class UserGroup extends Trustee {
12782
- constructor(_a) {
12783
- var { backendModel, inheritedSystemPrivileges, scope, systemPrivileges } = _a, trusteeArgs = __rest(_a, ["backendModel", "inheritedSystemPrivileges", "scope", "systemPrivileges"]);
12784
- super(Object.assign({ backendModel }, trusteeArgs));
13577
+ constructor({ backendModel, inheritedSystemPrivileges, scope, systemPrivileges, ...trusteeArgs }) {
13578
+ super({ backendModel, ...trusteeArgs });
12785
13579
  Object.defineProperty(this, "_scope", {
12786
13580
  enumerable: true,
12787
13581
  configurable: true,
@@ -12980,7 +13774,7 @@ class UserPreferences {
12980
13774
  }
12981
13775
 
12982
13776
  class UserProfile {
12983
- constructor({ backendModel, user, runtimeInfo, preferences }) {
13777
+ constructor({ backendModel, user, runtimeInfo, preferences, inheritedSystemPrivileges, }) {
12984
13778
  Object.defineProperty(this, "_backendModel", {
12985
13779
  enumerable: true,
12986
13780
  configurable: true,
@@ -13005,6 +13799,12 @@ class UserProfile {
13005
13799
  writable: true,
13006
13800
  value: void 0
13007
13801
  });
13802
+ Object.defineProperty(this, "_inheritedSystemPrivileges", {
13803
+ enumerable: true,
13804
+ configurable: true,
13805
+ writable: true,
13806
+ value: void 0
13807
+ });
13008
13808
  Object.defineProperty(this, "getInternalModel", {
13009
13809
  enumerable: true,
13010
13810
  configurable: true,
@@ -13017,6 +13817,7 @@ class UserProfile {
13017
13817
  this._user = user;
13018
13818
  this._runtimeInfo = runtimeInfo;
13019
13819
  this._preferences = preferences;
13820
+ this._inheritedSystemPrivileges = inheritedSystemPrivileges;
13020
13821
  }
13021
13822
  /**
13022
13823
  * User display name.
@@ -13048,6 +13849,12 @@ class UserProfile {
13048
13849
  get preferences() {
13049
13850
  return this._preferences;
13050
13851
  }
13852
+ /**
13853
+ * Dictionary containing system privilege keys and their associated groups.
13854
+ */
13855
+ get inheritedSystemPrivileges() {
13856
+ return this._inheritedSystemPrivileges;
13857
+ }
13051
13858
  }
13052
13859
 
13053
13860
  /**
@@ -13105,9 +13912,8 @@ class UserRuntimeInfo {
13105
13912
  }
13106
13913
 
13107
13914
  const mapTrusteeConstructorArgs = (mappingRegistry, backendModel) => {
13108
- var _a;
13109
13915
  const { applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo } = mapSystemWideObjectConstructorArgs(mappingRegistry, backendModel);
13110
- const groupMemberships = (_a = backendModel.GroupMemberships) === null || _a === void 0 ? void 0 : _a.map(m => mappingRegistry.map(m)).filter(isDefined);
13916
+ const groupMemberships = backendModel.GroupMemberships?.map(m => mappingRegistry.map(m)).filter(isDefined);
13111
13917
  return {
13112
13918
  applicableActions,
13113
13919
  basicVersionInfo,
@@ -13122,7 +13928,7 @@ const mapTrusteeConstructorArgs = (mappingRegistry, backendModel) => {
13122
13928
 
13123
13929
  const mapUserConstructorArgs = mapTrusteeConstructorArgs;
13124
13930
  const userMapping = {
13125
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'User',
13931
+ identifier: backendModel => backendModel?.$type === 'User',
13126
13932
  mapper: (mappingRegistry, backendModel) => {
13127
13933
  const { groupMemberships, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapUserConstructorArgs(mappingRegistry, backendModel);
13128
13934
  return new User({
@@ -13144,10 +13950,13 @@ const mapAccessTokenConstructorArgs = (mappingRegistry, backendModel) => {
13144
13950
  const inheritedSystemPrivileges = backendModel.InheritedSystemPrivileges
13145
13951
  ? mappingRegistry.map(backendModel.InheritedSystemPrivileges)
13146
13952
  : undefined;
13147
- return Object.assign(Object.assign({}, userProps), { inheritedSystemPrivileges });
13953
+ return {
13954
+ ...userProps,
13955
+ inheritedSystemPrivileges,
13956
+ };
13148
13957
  };
13149
13958
  const accessTokenMapping = {
13150
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'AccessToken',
13959
+ identifier: backendModel => backendModel?.$type === 'AccessToken',
13151
13960
  mapper: (mappingRegistry, backendModel) => {
13152
13961
  const { applicableActions, basicVersionInfo, groupMemberships, id, inheritedSystemPrivileges, listLinks, loadInfo, securityDescriptor, listInfo, } = mapAccessTokenConstructorArgs(mappingRegistry, backendModel);
13153
13962
  return new AccessToken({
@@ -13166,13 +13975,12 @@ const accessTokenMapping = {
13166
13975
  };
13167
13976
 
13168
13977
  const mapGroupMembershipConstructorArgs = (mappingRegistry, backendModel) => {
13169
- var _a;
13170
13978
  const group = backendModel.Group ? mappingRegistry.map(backendModel.Group) : undefined;
13171
- const scope = (_a = backendModel.Scope) === null || _a === void 0 ? void 0 : _a.map(s => mappingRegistry.map(s)).filter(isDefined);
13979
+ const scope = backendModel.Scope?.map(s => mappingRegistry.map(s)).filter(isDefined);
13172
13980
  return { group, scope };
13173
13981
  };
13174
13982
  const groupMembershipMapping = {
13175
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'GroupMembership',
13983
+ identifier: backendModel => backendModel?.$type === 'GroupMembership',
13176
13984
  mapper: (mappingRegistry, backendModel) => {
13177
13985
  const { group, scope } = mapGroupMembershipConstructorArgs(mappingRegistry, backendModel);
13178
13986
  return new GroupMembership({ backendModel, group, scope });
@@ -13184,7 +13992,7 @@ const mapUserFavoriteLinkConstructorArgs = (mappingRegistry, backendModel) => {
13184
13992
  return { idRef };
13185
13993
  };
13186
13994
  const userFavoriteLinkMapping = {
13187
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FavoriteLink',
13995
+ identifier: backendModel => backendModel?.$type === 'FavoriteLink',
13188
13996
  mapper: (mappingRegistry, backendModel) => {
13189
13997
  const { idRef } = mapUserFavoriteLinkConstructorArgs(mappingRegistry, backendModel);
13190
13998
  return new UserFavoriteLink({ backendModel, idRef });
@@ -13192,19 +14000,21 @@ const userFavoriteLinkMapping = {
13192
14000
  };
13193
14001
 
13194
14002
  const mapUserGroupConstructorArgs = (mappingRegistry, backendModel) => {
13195
- var _a, _b;
13196
14003
  const trusteeConstructorArgs = mapTrusteeConstructorArgs(mappingRegistry, backendModel);
13197
- const scope = (_a = backendModel.Scope) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
13198
- const systemPrivileges = (_b = backendModel.SystemPrivileges) === null || _b === void 0 ? void 0 : _b.map(k => mappingRegistry.map(k)).filter(isDefined);
14004
+ const scope = backendModel.Scope?.map(k => mappingRegistry.map(k)).filter(isDefined);
14005
+ const systemPrivileges = backendModel.SystemPrivileges?.map(k => mappingRegistry.map(k)).filter(isDefined);
13199
14006
  const inheritedSystemPrivileges = backendModel.InheritedSystemPrivileges
13200
14007
  ? mappingRegistry.map(backendModel.InheritedSystemPrivileges)
13201
14008
  : undefined;
13202
- return Object.assign(Object.assign({}, trusteeConstructorArgs), { scope,
14009
+ return {
14010
+ ...trusteeConstructorArgs,
14011
+ scope,
13203
14012
  systemPrivileges,
13204
- inheritedSystemPrivileges });
14013
+ inheritedSystemPrivileges,
14014
+ };
13205
14015
  };
13206
14016
  const userGroupMapping = {
13207
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'Group',
14017
+ identifier: backendModel => backendModel?.$type === 'Group',
13208
14018
  mapper: (mappingRegistry, backendModel) => {
13209
14019
  const { applicableActions, basicVersionInfo, groupMemberships, id, inheritedSystemPrivileges, listLinks, loadInfo, scope, securityDescriptor, systemPrivileges, listInfo, } = mapUserGroupConstructorArgs(mappingRegistry, backendModel);
13210
14020
  return new UserGroup({
@@ -13225,7 +14035,7 @@ const userGroupMapping = {
13225
14035
  };
13226
14036
 
13227
14037
  const userLocaleInfoMapping = {
13228
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserLocaleInfo',
14038
+ identifier: backendModel => backendModel?.$type === 'UserLocaleInfo',
13229
14039
  mapper: (mappingRegistry, backendModel) => new UserLocaleInfo(backendModel),
13230
14040
  };
13231
14041
 
@@ -13238,12 +14048,13 @@ const isValidFavoriteLink = (link) => {
13238
14048
  return true;
13239
14049
  };
13240
14050
  const mapUserPreferencesConstructorArgs = (mappingRegistry, backendModel) => {
13241
- var _a;
13242
- const favorites = ((_a = backendModel.Favorites) === null || _a === void 0 ? void 0 : _a.filter(isValidFavoriteLink).map(link => mappingRegistry.map(link)).filter(isDefined)) || [];
14051
+ const favorites = backendModel.Favorites?.filter(isValidFavoriteLink)
14052
+ .map(link => mappingRegistry.map(link))
14053
+ .filter(isDefined) || [];
13243
14054
  return { favorites };
13244
14055
  };
13245
14056
  const userPreferencesMapping = {
13246
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserPreferences',
14057
+ identifier: backendModel => backendModel?.$type === 'UserPreferences',
13247
14058
  mapper: (mappingRegistry, backendModel) => {
13248
14059
  const { favorites } = mapUserPreferencesConstructorArgs(mappingRegistry, backendModel);
13249
14060
  return new UserPreferences({ backendModel, favorites });
@@ -13256,13 +14067,14 @@ const mapUserProfileConstructorArgs = (mappingRegistry, backendModel) => {
13256
14067
  const preferences = backendModel.Preferences
13257
14068
  ? mappingRegistry.map(backendModel.Preferences)
13258
14069
  : undefined;
13259
- return { preferences, runtimeInfo, user };
14070
+ const inheritedSystemPrivileges = backendModel.User?.InheritedSystemPrivileges;
14071
+ return { preferences, runtimeInfo, user, inheritedSystemPrivileges };
13260
14072
  };
13261
14073
  const userProfileMapping = {
13262
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserProfile',
14074
+ identifier: backendModel => backendModel?.$type === 'UserProfile',
13263
14075
  mapper: (mappingRegistry, backendModel) => {
13264
- const { preferences, runtimeInfo, user } = mapUserProfileConstructorArgs(mappingRegistry, backendModel);
13265
- return new UserProfile({ backendModel, preferences, runtimeInfo, user });
14076
+ const { preferences, runtimeInfo, user, inheritedSystemPrivileges } = mapUserProfileConstructorArgs(mappingRegistry, backendModel);
14077
+ return new UserProfile({ backendModel, preferences, runtimeInfo, user, inheritedSystemPrivileges });
13266
14078
  },
13267
14079
  };
13268
14080
 
@@ -13271,7 +14083,7 @@ const mapUserRuntimeInfoConstructorArgs = (mappingRegistry, backendModel) => {
13271
14083
  return { locale };
13272
14084
  };
13273
14085
  const userUserRuntimeInfoMapping = {
13274
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'UserRuntimeInfo',
14086
+ identifier: backendModel => backendModel?.$type === 'UserRuntimeInfo',
13275
14087
  mapper: (mappingRegistry, backendModel) => {
13276
14088
  const { locale } = mapUserRuntimeInfoConstructorArgs(mappingRegistry, backendModel);
13277
14089
  return new UserRuntimeInfo({ backendModel, locale });
@@ -13297,9 +14109,8 @@ const mapActivityConstraints = (backendModel) => {
13297
14109
  * Abstract Base class for the data of workflow items except for "ProcessDefinition" and "ApprovalStatus".
13298
14110
  */
13299
14111
  class WorkflowObject extends IdentifiableObject {
13300
- constructor(_a) {
13301
- var { backendModel, contextRepository } = _a, identifiableObjectArgs = __rest(_a, ["backendModel", "contextRepository"]);
13302
- super(Object.assign({ backendModel }, identifiableObjectArgs));
14112
+ constructor({ backendModel, contextRepository, ...identifiableObjectArgs }) {
14113
+ super({ backendModel, ...identifiableObjectArgs });
13303
14114
  Object.defineProperty(this, "_contextRepository", {
13304
14115
  enumerable: true,
13305
14116
  configurable: true,
@@ -13328,9 +14139,8 @@ class WorkflowObject extends IdentifiableObject {
13328
14139
  * Abstract base class for the data of Activities.
13329
14140
  */
13330
14141
  class Activity extends WorkflowObject {
13331
- constructor(_a) {
13332
- 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"]);
13333
- super(Object.assign({ backendModel }, workflowObjectArgs));
14142
+ constructor({ assignee, assignmentDate, backendModel, dueDate, finishDate, owner, primarySubject, process, startDate, suspendDate, workItems, ...workflowObjectArgs }) {
14143
+ super({ backendModel, ...workflowObjectArgs });
13334
14144
  Object.defineProperty(this, "_assignee", {
13335
14145
  enumerable: true,
13336
14146
  configurable: true,
@@ -13499,9 +14309,8 @@ class Activity extends WorkflowObject {
13499
14309
  }
13500
14310
 
13501
14311
  class ActivityDefinition extends WorkflowObject {
13502
- constructor(_a) {
13503
- var { backendModel, activityConstraints, assignee, processDefinition } = _a, workflowObjectArgs = __rest(_a, ["backendModel", "activityConstraints", "assignee", "processDefinition"]);
13504
- super(Object.assign({ backendModel }, workflowObjectArgs));
14312
+ constructor({ backendModel, activityConstraints, assignee, processDefinition, ...workflowObjectArgs }) {
14313
+ super({ backendModel, ...workflowObjectArgs });
13505
14314
  Object.defineProperty(this, "_activityConstraints", {
13506
14315
  enumerable: true,
13507
14316
  configurable: true,
@@ -13569,9 +14378,8 @@ class ActivityDefinition extends WorkflowObject {
13569
14378
  * Representing data of the Activity History. This is the part of "ProcessHistory".
13570
14379
  */
13571
14380
  class ActivityHistory extends Activity {
13572
- constructor(_a) {
13573
- var { activityType, approvalStatus, backendModel } = _a, activityArgs = __rest(_a, ["activityType", "approvalStatus", "backendModel"]);
13574
- super(Object.assign({ backendModel }, activityArgs));
14381
+ constructor({ activityType, approvalStatus, backendModel, ...activityArgs }) {
14382
+ super({ backendModel, ...activityArgs });
13575
14383
  Object.defineProperty(this, "_activityType", {
13576
14384
  enumerable: true,
13577
14385
  configurable: true,
@@ -13625,9 +14433,8 @@ class ActivityHistory extends Activity {
13625
14433
  * Represents an Activity Instance: a current Activity which is part of a Process Instance.
13626
14434
  */
13627
14435
  class ActivityInstance extends Activity {
13628
- constructor(_a) {
13629
- var { backendModel, activityConstraints, activityDefinition, activityState, approvalStatus, processDefinition, workflowType } = _a, activityArgs = __rest(_a, ["backendModel", "activityConstraints", "activityDefinition", "activityState", "approvalStatus", "processDefinition", "workflowType"]);
13630
- super(Object.assign({ backendModel }, activityArgs));
14436
+ constructor({ backendModel, activityConstraints, activityDefinition, activityState, approvalStatus, processDefinition, workflowType, ...activityArgs }) {
14437
+ super({ backendModel, ...activityArgs });
13631
14438
  Object.defineProperty(this, "_activityConstraints", {
13632
14439
  enumerable: true,
13633
14440
  configurable: true,
@@ -13766,9 +14573,8 @@ class FinishActivityResult {
13766
14573
  * Abstract base class for the data of Processes.
13767
14574
  */
13768
14575
  class Process extends WorkflowObject {
13769
- constructor(_a) {
13770
- var { backendModel, activities, creator, subjects, workflowType } = _a, workflowObjectArgs = __rest(_a, ["backendModel", "activities", "creator", "subjects", "workflowType"]);
13771
- super(Object.assign({ backendModel }, workflowObjectArgs));
14576
+ constructor({ backendModel, activities, creator, subjects, workflowType, ...workflowObjectArgs }) {
14577
+ super({ backendModel, ...workflowObjectArgs });
13772
14578
  Object.defineProperty(this, "_activities", {
13773
14579
  enumerable: true,
13774
14580
  configurable: true,
@@ -13846,9 +14652,8 @@ class Process extends WorkflowObject {
13846
14652
  }
13847
14653
 
13848
14654
  class ProcessDefinition extends RepositoryLocalObject {
13849
- constructor(_a) {
13850
- var { backendModel, activityDefinitions } = _a, rloArgs = __rest(_a, ["backendModel", "activityDefinitions"]);
13851
- super(Object.assign({ backendModel }, rloArgs));
14655
+ constructor({ backendModel, activityDefinitions, ...rloArgs }) {
14656
+ super({ backendModel, ...rloArgs });
13852
14657
  Object.defineProperty(this, "_activityDefinitions", {
13853
14658
  enumerable: true,
13854
14659
  configurable: true,
@@ -13884,9 +14689,8 @@ class ProcessDefinition extends RepositoryLocalObject {
13884
14689
  * Representing data of a Process History.
13885
14690
  */
13886
14691
  class ProcessHistory extends Process {
13887
- constructor(_a) {
13888
- var { backendModel, finishReason, finishDate } = _a, processArgs = __rest(_a, ["backendModel", "finishReason", "finishDate"]);
13889
- super(Object.assign({ backendModel }, processArgs));
14692
+ constructor({ backendModel, finishReason, finishDate, ...processArgs }) {
14693
+ super({ backendModel, ...processArgs });
13890
14694
  Object.defineProperty(this, "_finishReason", {
13891
14695
  enumerable: true,
13892
14696
  configurable: true,
@@ -13934,9 +14738,8 @@ class ProcessHistory extends Process {
13934
14738
  * Represents the data of a Process Instance: a current Process.
13935
14739
  */
13936
14740
  class ProcessInstance extends Process {
13937
- constructor(_a) {
13938
- var { backendModel, processDefinition } = _a, processArgs = __rest(_a, ["backendModel", "processDefinition"]);
13939
- super(Object.assign({ backendModel }, processArgs));
14741
+ constructor({ backendModel, processDefinition, ...processArgs }) {
14742
+ super({ backendModel, ...processArgs });
13940
14743
  Object.defineProperty(this, "_processDefinition", {
13941
14744
  enumerable: true,
13942
14745
  configurable: true,
@@ -13971,9 +14774,8 @@ class ProcessInstance extends Process {
13971
14774
  * Represents the data of a Tridion proprietary Activity Definition.
13972
14775
  */
13973
14776
  class TridionActivityDefinition extends ActivityDefinition {
13974
- constructor(_a) {
13975
- var { backendModel, activityType, finishApprovalStatus, nextActivityDefinitions } = _a, activityDefinitionArgs = __rest(_a, ["backendModel", "activityType", "finishApprovalStatus", "nextActivityDefinitions"]);
13976
- super(Object.assign({ backendModel }, activityDefinitionArgs));
14777
+ constructor({ backendModel, activityType, finishApprovalStatus, nextActivityDefinitions, ...activityDefinitionArgs }) {
14778
+ super({ backendModel, ...activityDefinitionArgs });
13977
14779
  Object.defineProperty(this, "_activityType", {
13978
14780
  enumerable: true,
13979
14781
  configurable: true,
@@ -14098,8 +14900,7 @@ class TridionProcessDefinition extends ProcessDefinition {
14098
14900
  * A Microsoft Visio diagram, or an empty byte array.
14099
14901
  */
14100
14902
  get diagram() {
14101
- var _a;
14102
- if ((_a = this._backendModel.Diagram) === null || _a === void 0 ? void 0 : _a.length) {
14903
+ if (this._backendModel.Diagram?.length) {
14103
14904
  return this._backendModel.Diagram;
14104
14905
  }
14105
14906
  return undefined;
@@ -14290,9 +15091,8 @@ class WorkflowInfo {
14290
15091
  * Represents the data of a Work Item: the association between an item participating in workflow and an Activity.
14291
15092
  */
14292
15093
  class WorkItem extends WorkflowObject {
14293
- constructor(_a) {
14294
- var { backendModel, activity, owner, process, subject, subjectOwningRepository } = _a, workflowObjectArgs = __rest(_a, ["backendModel", "activity", "owner", "process", "subject", "subjectOwningRepository"]);
14295
- super(Object.assign({ backendModel }, workflowObjectArgs));
15094
+ constructor({ backendModel, activity, owner, process, subject, subjectOwningRepository, ...workflowObjectArgs }) {
15095
+ super({ backendModel, ...workflowObjectArgs });
14296
15096
  Object.defineProperty(this, "_activity", {
14297
15097
  enumerable: true,
14298
15098
  configurable: true,
@@ -14391,7 +15191,10 @@ const mapWorkflowObjectConstructorArgs = (mappingRegistry, backendModel) => {
14391
15191
  const contextRepository = backendModel.ContextRepository
14392
15192
  ? mappingRegistry.map(backendModel.ContextRepository)
14393
15193
  : undefined;
14394
- return Object.assign(Object.assign({}, identifiableObjectConstructorArgs), { contextRepository });
15194
+ return {
15195
+ ...identifiableObjectConstructorArgs,
15196
+ contextRepository,
15197
+ };
14395
15198
  };
14396
15199
 
14397
15200
  const mapActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
@@ -14418,14 +15221,16 @@ const mapActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) =>
14418
15221
  };
14419
15222
  };
14420
15223
  const activityDefinitionMapping = {
14421
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityDefinition',
15224
+ identifier: backendModel => backendModel?.$type === 'ActivityDefinition',
14422
15225
  mapper: (mappingRegistry, backendModel) => {
14423
- return new ActivityDefinition(Object.assign(Object.assign({}, mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel)), { backendModel }));
15226
+ return new ActivityDefinition({
15227
+ ...mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel),
15228
+ backendModel,
15229
+ });
14424
15230
  },
14425
15231
  };
14426
15232
 
14427
15233
  const mapActivityConstructorArgs = (mappingRegistry, backendModel) => {
14428
- var _a;
14429
15234
  const { contextRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapWorkflowObjectConstructorArgs(mappingRegistry, backendModel);
14430
15235
  const assignee = backendModel.Assignee ? mappingRegistry.map(backendModel.Assignee) : undefined;
14431
15236
  const owner = backendModel.Owner ? mappingRegistry.map(backendModel.Owner) : undefined;
@@ -14433,7 +15238,7 @@ const mapActivityConstructorArgs = (mappingRegistry, backendModel) => {
14433
15238
  ? mappingRegistry.map(backendModel.PrimarySubject)
14434
15239
  : undefined;
14435
15240
  const process = backendModel.Process ? mappingRegistry.map(backendModel.Process) : undefined;
14436
- const workItems = (_a = backendModel.WorkItems) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
15241
+ const workItems = backendModel.WorkItems?.map(k => mappingRegistry.map(k)).filter(isDefined);
14437
15242
  const assignmentDate = backendModel.AssignmentDate ? mapDate(backendModel.AssignmentDate) : undefined;
14438
15243
  const dueDate = backendModel.DueDate ? mapDate(backendModel.DueDate) : undefined;
14439
15244
  const finishDate = backendModel.FinishDate ? mapDate(backendModel.FinishDate) : undefined;
@@ -14476,11 +15281,14 @@ const mapActivityHistoryConstructorArgs = (mappingRegistry, backendModel) => {
14476
15281
  const approvalStatus = backendModel.ApprovalStatus
14477
15282
  ? mappingRegistry.map(backendModel.ApprovalStatus)
14478
15283
  : undefined;
14479
- return Object.assign(Object.assign({}, activityConstructorArgs), { activityType,
14480
- approvalStatus });
15284
+ return {
15285
+ ...activityConstructorArgs,
15286
+ activityType,
15287
+ approvalStatus,
15288
+ };
14481
15289
  };
14482
15290
  const activityHistoryMapping = {
14483
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityHistory',
15291
+ identifier: backendModel => backendModel?.$type === 'ActivityHistory',
14484
15292
  mapper: (mappingRegistry, backendModel) => {
14485
15293
  const { activityType, applicableActions, approvalStatus, assignee, assignmentDate, basicVersionInfo, contextRepository, dueDate, finishDate, id, listLinks, loadInfo, owner, primarySubject, process, securityDescriptor, startDate, suspendDate, workItems, listInfo, } = mapActivityHistoryConstructorArgs(mappingRegistry, backendModel);
14486
15294
  return new ActivityHistory({
@@ -14547,9 +15355,8 @@ const mapActivityStateToBackend = (model) => {
14547
15355
  };
14548
15356
 
14549
15357
  const mapActivityInstanceConstructorArgs = (mappingRegistry, backendModel) => {
14550
- var _a;
14551
15358
  const activityConstructorArgs = mapActivityConstructorArgs(mappingRegistry, backendModel);
14552
- const activityConstraints = (_a = backendModel.ActivityConstraints) === null || _a === void 0 ? void 0 : _a.map(c => mapActivityConstraints(c));
15359
+ const activityConstraints = backendModel.ActivityConstraints?.map(c => mapActivityConstraints(c));
14553
15360
  const activityDefinition = backendModel.ActivityDefinition
14554
15361
  ? mappingRegistry.map(backendModel.ActivityDefinition)
14555
15362
  : undefined;
@@ -14561,15 +15368,18 @@ const mapActivityInstanceConstructorArgs = (mappingRegistry, backendModel) => {
14561
15368
  const approvalStatus = backendModel.ApprovalStatus
14562
15369
  ? mappingRegistry.map(backendModel.ApprovalStatus)
14563
15370
  : undefined;
14564
- return Object.assign(Object.assign({}, activityConstructorArgs), { activityConstraints,
15371
+ return {
15372
+ ...activityConstructorArgs,
15373
+ activityConstraints,
14565
15374
  activityDefinition,
14566
15375
  activityState,
14567
15376
  approvalStatus,
14568
15377
  processDefinition,
14569
- workflowType });
15378
+ workflowType,
15379
+ };
14570
15380
  };
14571
15381
  const activityInstanceMapping = {
14572
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ActivityInstance',
15382
+ identifier: backendModel => backendModel?.$type === 'ActivityInstance',
14573
15383
  mapper: (mappingRegistry, backendModel) => {
14574
15384
  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);
14575
15385
  return new ActivityInstance({
@@ -14609,7 +15419,7 @@ const mapFinishActivityResultConstructorArgs = (mappingRegistry, backendModel) =
14609
15419
  return { nextActivityInstance };
14610
15420
  };
14611
15421
  const finishActivityResultMapping = {
14612
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'FinishActivityResult',
15422
+ identifier: backendModel => backendModel?.$type === 'FinishActivityResult',
14613
15423
  mapper: (mappingRegistry, backendModel) => {
14614
15424
  const { nextActivityInstance } = mapFinishActivityResultConstructorArgs(mappingRegistry, backendModel);
14615
15425
  return new FinishActivityResult({ backendModel, nextActivityInstance });
@@ -14617,13 +15427,15 @@ const finishActivityResultMapping = {
14617
15427
  };
14618
15428
 
14619
15429
  const mapProcessDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
14620
- var _a;
14621
15430
  const repositoryLocalObjectConstructorArgs = mapRepositoryLocalObjectConstructorArgs(mappingRegistry, backendModel);
14622
- const activityDefinitions = (_a = backendModel.ActivityDefinitions) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
14623
- return Object.assign(Object.assign({}, repositoryLocalObjectConstructorArgs), { activityDefinitions });
15431
+ const activityDefinitions = backendModel.ActivityDefinitions?.map(k => mappingRegistry.map(k)).filter(isDefined);
15432
+ return {
15433
+ ...repositoryLocalObjectConstructorArgs,
15434
+ activityDefinitions,
15435
+ };
14624
15436
  };
14625
15437
  const processDefinitionMapping = {
14626
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessDefinition',
15438
+ identifier: backendModel => backendModel?.$type === 'ProcessDefinition',
14627
15439
  mapper: (mappingRegistry, backendModel) => {
14628
15440
  const { activityDefinitions, applicableActions, basicVersionInfo, blueprintInfo, id, isLocked, limitedVersionInfo, listLinks, loadInfo, locationInfo, lockInfo, metadata, metadataSchema, securityDescriptor, listInfo, } = mapProcessDefinitionConstructorArgs(mappingRegistry, backendModel);
14629
15441
  return new ProcessDefinition({
@@ -14661,9 +15473,8 @@ const mapProcessFinishReason = (backendModel) => {
14661
15473
  };
14662
15474
 
14663
15475
  const mapProcessConstructorArgs = (mappingRegistry, backendModel) => {
14664
- var _a;
14665
15476
  const { contextRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapWorkflowObjectConstructorArgs(mappingRegistry, backendModel);
14666
- const activities = (_a = backendModel.Activities) === null || _a === void 0 ? void 0 : _a.map(k => mappingRegistry.map(k)).filter(isDefined);
15477
+ const activities = backendModel.Activities?.map(k => mappingRegistry.map(k)).filter(isDefined);
14667
15478
  const creator = backendModel.Creator ? mappingRegistry.map(backendModel.Creator) : undefined;
14668
15479
  const subjects = mapLinks(mappingRegistry, backendModel.Subjects);
14669
15480
  const workflowType = backendModel.WorkflowType ? mappingRegistry.map(backendModel.WorkflowType) : undefined;
@@ -14687,11 +15498,14 @@ const mapProcessHistoryConstructorArgs = (mappingRegistry, backendModel) => {
14687
15498
  const processConstructorArgs = mapProcessConstructorArgs(mappingRegistry, backendModel);
14688
15499
  const finishReason = backendModel.FinishReason ? mapProcessFinishReason(backendModel.FinishReason) : undefined;
14689
15500
  const finishDate = backendModel.FinishDate ? mapDate(backendModel.FinishDate) : undefined;
14690
- return Object.assign(Object.assign({}, processConstructorArgs), { finishReason,
14691
- finishDate });
15501
+ return {
15502
+ ...processConstructorArgs,
15503
+ finishReason,
15504
+ finishDate,
15505
+ };
14692
15506
  };
14693
15507
  const processHistoryMapping = {
14694
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessHistory',
15508
+ identifier: backendModel => backendModel?.$type === 'ProcessHistory',
14695
15509
  mapper: (mappingRegistry, backendModel) => {
14696
15510
  const { activities, applicableActions, basicVersionInfo, contextRepository, creator, finishDate, finishReason, id, listLinks, loadInfo, securityDescriptor, subjects, workflowType, listInfo, } = mapProcessHistoryConstructorArgs(mappingRegistry, backendModel);
14697
15511
  return new ProcessHistory({
@@ -14719,10 +15533,13 @@ const mapProcessInstanceConstructorArgs = (mappingRegistry, backendModel) => {
14719
15533
  const processDefinition = backendModel.ProcessDefinition
14720
15534
  ? mappingRegistry.map(backendModel.ProcessDefinition)
14721
15535
  : undefined;
14722
- return Object.assign(Object.assign({}, processConstructorArgs), { processDefinition });
15536
+ return {
15537
+ ...processConstructorArgs,
15538
+ processDefinition,
15539
+ };
14723
15540
  };
14724
15541
  const processInstanceMapping = {
14725
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'ProcessInstance',
15542
+ identifier: backendModel => backendModel?.$type === 'ProcessInstance',
14726
15543
  mapper: (mappingRegistry, backendModel) => {
14727
15544
  const { activities, applicableActions, basicVersionInfo, contextRepository, creator, id, listLinks, loadInfo, processDefinition, securityDescriptor, subjects, workflowType, listInfo, } = mapProcessInstanceConstructorArgs(mappingRegistry, backendModel);
14728
15545
  return new ProcessInstance({
@@ -14745,23 +15562,25 @@ const processInstanceMapping = {
14745
15562
  };
14746
15563
 
14747
15564
  const mapTridionActivityDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
14748
- var _a, _b, _c;
14749
15565
  const activityDefinition = mapActivityDefinitionConstructorArgs(mappingRegistry, backendModel);
14750
15566
  const activityType = backendModel.ActivityType ? mapActivityType(backendModel.ActivityType) : undefined;
14751
15567
  const finishApprovalStatus = backendModel.FinishApprovalStatus
14752
15568
  ? mappingRegistry.map(backendModel.FinishApprovalStatus)
14753
15569
  : undefined;
14754
- 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(',')) || []);
14755
- const filteredActivityDefinitions = (_c = backendModel.NextActivityDefinitions) === null || _c === void 0 ? void 0 : _c.filter(activityDefinition => {
15570
+ const activityDefinitionsToHide = new Set(backendModel.ExtensionProperties?.['tm_ActivityTransitionsToHide']?.split(',') || []);
15571
+ const filteredActivityDefinitions = backendModel.NextActivityDefinitions?.filter(activityDefinition => {
14756
15572
  return !activityDefinitionsToHide.has(activityDefinition.IdRef);
14757
15573
  });
14758
15574
  const nextActivityDefinitions = mapLinks(mappingRegistry, filteredActivityDefinitions);
14759
- return Object.assign(Object.assign({}, activityDefinition), { activityType,
15575
+ return {
15576
+ ...activityDefinition,
15577
+ activityType,
14760
15578
  finishApprovalStatus,
14761
- nextActivityDefinitions });
15579
+ nextActivityDefinitions,
15580
+ };
14762
15581
  };
14763
15582
  const tridionActivityDefinitionMapping = {
14764
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TridionActivityDefinition',
15583
+ identifier: backendModel => backendModel?.$type === 'TridionActivityDefinition',
14765
15584
  mapper: (mappingRegistry, backendModel) => {
14766
15585
  const { activityConstraints, activityType, applicableActions, assignee, basicVersionInfo, contextRepository, finishApprovalStatus, id, listLinks, loadInfo, nextActivityDefinitions, processDefinition, securityDescriptor, listInfo, } = mapTridionActivityDefinitionConstructorArgs(mappingRegistry, backendModel);
14767
15586
  return new TridionActivityDefinition({
@@ -14786,10 +15605,10 @@ const tridionActivityDefinitionMapping = {
14786
15605
 
14787
15606
  const mapTridionProcessDefinitionConstructorArgs = (mappingRegistry, backendModel) => {
14788
15607
  const processDefinitionArgs = mapProcessDefinitionConstructorArgs(mappingRegistry, backendModel);
14789
- return Object.assign({}, processDefinitionArgs);
15608
+ return { ...processDefinitionArgs };
14790
15609
  };
14791
15610
  const tridionProcessDefinitionMapping = {
14792
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'TridionProcessDefinition',
15611
+ identifier: backendModel => backendModel?.$type === 'TridionProcessDefinition',
14793
15612
  mapper: (mappingRegistry, backendModel) => {
14794
15613
  const { activityDefinitions, applicableActions, id, isLocked, listLinks, loadInfo, securityDescriptor, basicVersionInfo, limitedVersionInfo, blueprintInfo, locationInfo, lockInfo, metadata, metadataSchema, listInfo, } = mapTridionProcessDefinitionConstructorArgs(mappingRegistry, backendModel);
14795
15614
  return new TridionProcessDefinition({
@@ -14848,7 +15667,7 @@ const mapWorkflowInfoConstructorArgs = (mappingRegistry, backendModel) => {
14848
15667
  };
14849
15668
  };
14850
15669
  const workflowInfoMapping = {
14851
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'WorkflowInfo',
15670
+ identifier: backendModel => backendModel?.$type === 'WorkflowInfo',
14852
15671
  mapper: (mappingRegistry, backendModel) => {
14853
15672
  const { activityConstraints, activityInstance, activityState, assignee, assignmentDate, creationDate, dueDate, finishDate, performer, processInstance, startDate, } = mapWorkflowInfoConstructorArgs(mappingRegistry, backendModel);
14854
15673
  return new WorkflowInfo({
@@ -14877,14 +15696,17 @@ const mapWorkflowItemConstructorArgs = (mappingRegistry, backendModel) => {
14877
15696
  const subjectOwningRepository = backendModel.SubjectOwningRepository
14878
15697
  ? mappingRegistry.map(backendModel.SubjectOwningRepository)
14879
15698
  : undefined;
14880
- return Object.assign(Object.assign({}, workflowObjectConstructorArgs), { activity,
15699
+ return {
15700
+ ...workflowObjectConstructorArgs,
15701
+ activity,
14881
15702
  owner,
14882
15703
  process,
14883
15704
  subject,
14884
- subjectOwningRepository });
15705
+ subjectOwningRepository,
15706
+ };
14885
15707
  };
14886
15708
  const workflowItemMapping = {
14887
- identifier: backendModel => (backendModel === null || backendModel === void 0 ? void 0 : backendModel.$type) === 'WorkItem',
15709
+ identifier: backendModel => backendModel?.$type === 'WorkItem',
14888
15710
  mapper: (mappingRegistry, backendModel) => {
14889
15711
  const { activity, contextRepository, owner, process, subject, subjectOwningRepository, applicableActions, basicVersionInfo, id, listLinks, loadInfo, securityDescriptor, listInfo, } = mapWorkflowItemConstructorArgs(mappingRegistry, backendModel);
14890
15712
  return new WorkItem({
@@ -14945,6 +15767,7 @@ const registerMappings = (mappingRegistry) => {
14945
15767
  mappingRegistry.register(fullVersionInfoMapping);
14946
15768
  mappingRegistry.register(groupMembershipMapping);
14947
15769
  mappingRegistry.register(hateoasLinkMapping);
15770
+ mappingRegistry.register(identifiableTranslationJobMapping);
14948
15771
  mappingRegistry.register(keywordCategoryMapping);
14949
15772
  mappingRegistry.register(keywordFieldDefinitionMapping);
14950
15773
  mappingRegistry.register(keywordMapping);
@@ -14974,6 +15797,7 @@ const registerMappings = (mappingRegistry) => {
14974
15797
  mappingRegistry.register(publishTransactionListInfoMapping);
14975
15798
  mappingRegistry.register(publishTransactionsCreationResultMapping);
14976
15799
  mappingRegistry.register(publishUrlInfoMapping);
15800
+ mappingRegistry.register(renderedItemMapping);
14977
15801
  mappingRegistry.register(repositoryMapping);
14978
15802
  mappingRegistry.register(resolvedItemMapping);
14979
15803
  mappingRegistry.register(resolveInstructionMapping);
@@ -15003,6 +15827,7 @@ const registerMappings = (mappingRegistry) => {
15003
15827
  mappingRegistry.register(translationJobInfoMapping);
15004
15828
  mappingRegistry.register(translationJobItemMapping);
15005
15829
  mappingRegistry.register(translationJobMapping);
15830
+ mappingRegistry.register(translationResolvedItemMapping);
15006
15831
  mappingRegistry.register(translationTargetPublicationMapping);
15007
15832
  mappingRegistry.register(translationWorkflowStatusMapping);
15008
15833
  mappingRegistry.register(tridionActivityDefinitionMapping);
@@ -15019,6 +15844,7 @@ const registerMappings = (mappingRegistry) => {
15019
15844
  mappingRegistry.register(workflowInfoMapping);
15020
15845
  mappingRegistry.register(workflowItemMapping);
15021
15846
  mappingRegistry.register(xhtmlFieldDefinitionMapping);
15847
+ mappingRegistry.register(settingsMapping);
15022
15848
  };
15023
15849
 
15024
15850
  const mappingRegistry = new MappingRegistry();
@@ -15031,7 +15857,7 @@ const tryMapToModel = (backendItem) => {
15031
15857
  const mapToModel = (backendItem) => {
15032
15858
  const model = tryMapToModel(backendItem);
15033
15859
  if (!model) {
15034
- throw new Error(`Unknown model type: ${backendItem === null || backendItem === void 0 ? void 0 : backendItem.$type}`);
15860
+ throw new Error(`Unknown model type: ${backendItem?.$type}`);
15035
15861
  }
15036
15862
  return model;
15037
15863
  };
@@ -15140,17 +15966,16 @@ const linkGraphNodes$1 = (graph, backendNodes) => {
15140
15966
  * Connect repositoryLocalObjects inside every node with each other (shared/localized from etc.)
15141
15967
  */
15142
15968
  const linkItems = (graph) => {
15143
- var _a, _b, _c, _d, _e;
15144
15969
  for (const node of graph.nodes) {
15145
15970
  if (!isRloNode(node))
15146
15971
  continue;
15147
- 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)) {
15972
+ if (node.data.item.blueprintInfo?.isShared || node.data.item.blueprintInfo?.isLocalized) {
15148
15973
  for (const ancestor of graph.ancestorsByPriority(node.id)) {
15149
15974
  if (!isRloNode(ancestor.node))
15150
15975
  continue;
15151
- if (((_c = ancestor.node.data.item.blueprintInfo) === null || _c === void 0 ? void 0 : _c.isLocalized) ||
15152
- (!((_d = ancestor.node.data.item.blueprintInfo) === null || _d === void 0 ? void 0 : _d.isShared) &&
15153
- !((_e = ancestor.node.data.item.blueprintInfo) === null || _e === void 0 ? void 0 : _e.isLocalized))) {
15976
+ if (ancestor.node.data.item.blueprintInfo?.isLocalized ||
15977
+ (!ancestor.node.data.item.blueprintInfo?.isShared &&
15978
+ !ancestor.node.data.item.blueprintInfo?.isLocalized)) {
15154
15979
  const nodeData = node.data;
15155
15980
  const ancestorNodeData = ancestor.node.data;
15156
15981
  nodeData.linkSourceItem(ancestorNodeData);
@@ -15444,6 +16269,7 @@ const itemLinkTypes = [
15444
16269
  'processHistory',
15445
16270
  'processInstance',
15446
16271
  'publication',
16272
+ 'publishTransaction',
15447
16273
  'schema',
15448
16274
  'structureGroup',
15449
16275
  'targetGroup',
@@ -15452,6 +16278,7 @@ const itemLinkTypes = [
15452
16278
  'user',
15453
16279
  'userGroup',
15454
16280
  'virtualFolder',
16281
+ 'translationJob',
15455
16282
  ];
15456
16283
  const itemLinkType = createEnumObject(itemLinkTypes);
15457
16284
  const itemTypes = [
@@ -15466,12 +16293,11 @@ const itemTypes = [
15466
16293
  const itemType = createEnumObject(itemTypes);
15467
16294
 
15468
16295
  const getItemContainerId = (item) => {
15469
- var _a, _b, _c, _d, _e;
15470
- if (item instanceof Keyword && ((_a = item.parentKeywords) === null || _a === void 0 ? void 0 : _a.length)) {
16296
+ if (item instanceof Keyword && item.parentKeywords?.length) {
15471
16297
  return item.parentKeywords[0].idRef;
15472
16298
  }
15473
16299
  if (item instanceof RepositoryLocalObject) {
15474
- 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);
16300
+ return item.locationInfo?.organizationalItem?.idRef || item.locationInfo?.contextRepository?.idRef;
15475
16301
  }
15476
16302
  return undefined;
15477
16303
  };
@@ -15537,6 +16363,12 @@ const getItemLinkType = (itemLink) => {
15537
16363
  return 'externalKeyword';
15538
16364
  }
15539
16365
  }
16366
+ if (itemLink.idRef instanceof TmUri) {
16367
+ switch (itemLink.idRef.itemType) {
16368
+ case 'translationJob':
16369
+ return 'translationJob';
16370
+ }
16371
+ }
15540
16372
  if (itemLink.idRef instanceof VirtualUri) {
15541
16373
  switch (itemLink.idRef.itemType) {
15542
16374
  case 'businessProcessTypes':
@@ -15607,9 +16439,15 @@ const getItemType = (item) => {
15607
16439
  return 'processInstance';
15608
16440
  if (isExactInstanceOf(item, Publication))
15609
16441
  return 'publication';
16442
+ if (isExactInstanceOf(item, PublishTransaction))
16443
+ return 'publishTransaction';
15610
16444
  if (isExactInstanceOf(item, TemplateBuildingBlock))
15611
16445
  return 'templateBuildingBlock';
16446
+ if (isExactInstanceOf(item, TranslationJob))
16447
+ return 'translationJob';
16448
+ if (isExactInstanceOf(item, IdentifiableTranslationJob))
16449
+ return 'translationJob';
15612
16450
  return undefined;
15613
16451
  };
15614
16452
 
15615
- 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, mapSchemaPurposeBackend, mapSearchBlueprintStatus, mapSearchBlueprintStatusToBackend, mapStringSearchModeToBackend, mapStructureResolveOptionToBackend, mapSynchronizeFlagsToBackend, mapToModel, mapToModels, mapTranslationErrorSeverityToBackend, mapTranslationJobPriorityToBackend, mapTranslationJobStateToBackend, mapTranslationJobTypeToBackend, mapTranslationStatusToBackend, parseItemUri, tryMapToModel, tryParseItemUri };
16453
+ 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 };