@tridion-sites/models 2.2.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +22 -4
- package/dist/index.js +39 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1520,6 +1520,7 @@ export declare class EclUri implements Uri {
|
|
|
1520
1520
|
private static _eclUriCache;
|
|
1521
1521
|
private static _eclUriPrefix;
|
|
1522
1522
|
private static _eclUriRegExp;
|
|
1523
|
+
private static _editableVersion;
|
|
1523
1524
|
private constructor();
|
|
1524
1525
|
static get uriPrefix(): string;
|
|
1525
1526
|
private static create;
|
|
@@ -1532,6 +1533,10 @@ export declare class EclUri implements Uri {
|
|
|
1532
1533
|
get hasVersion(): boolean;
|
|
1533
1534
|
get isNullUri(): boolean;
|
|
1534
1535
|
get isDynamic(): boolean;
|
|
1536
|
+
/**
|
|
1537
|
+
* If the item version is 0, then the item is editable. (e.g. ecl:5-vim-295361341-vid-file-v0)
|
|
1538
|
+
*/
|
|
1539
|
+
get isEditableVersion(): boolean;
|
|
1535
1540
|
get asString(): string;
|
|
1536
1541
|
getPublicationUri: () => TcmUri;
|
|
1537
1542
|
getVersionlessUri: () => EclUri;
|
|
@@ -2084,6 +2089,8 @@ export declare class IdentifiableTranslationJob extends IdentifiableObject {
|
|
|
2084
2089
|
get metadata(): FieldsValueDictionary | undefined;
|
|
2085
2090
|
/**
|
|
2086
2091
|
* TCM URI of the metadata schema used for this Translation Job.
|
|
2092
|
+
*
|
|
2093
|
+
* @deprecated will be mapped to `ItemUri` in the next major release.
|
|
2087
2094
|
*/
|
|
2088
2095
|
get metadataSchemaUri(): string | undefined;
|
|
2089
2096
|
/**
|
|
@@ -2241,6 +2248,7 @@ export declare const itemLinkType: {
|
|
|
2241
2248
|
virtualFolder: "virtualFolder";
|
|
2242
2249
|
multimediaType: "multimediaType";
|
|
2243
2250
|
user: "user";
|
|
2251
|
+
publishTransaction: "publishTransaction";
|
|
2244
2252
|
processDefinition: "processDefinition";
|
|
2245
2253
|
processInstance: "processInstance";
|
|
2246
2254
|
processHistory: "processHistory";
|
|
@@ -2257,7 +2265,7 @@ export declare const itemLinkType: {
|
|
|
2257
2265
|
userGroup: "userGroup";
|
|
2258
2266
|
};
|
|
2259
2267
|
|
|
2260
|
-
export declare const itemLinkTypes: readonly ["activityInstance", "businessProcessType", "businessProcessTypes", "component", "componentTemplate", "externalFolder", "externalKeyword", "externalKeywordCategory", "externalMountpoint", "externalMultimediaComponent", "folder", "keyword", "keywordCategory", "multimediaType", "page", "pageTemplate", "processDefinition", "processHistory", "processInstance", "publication", "schema", "structureGroup", "targetGroup", "taxonomies", "templateBuildingBlock", "user", "userGroup", "virtualFolder", "translationJob"];
|
|
2268
|
+
export declare const itemLinkTypes: readonly ["activityInstance", "businessProcessType", "businessProcessTypes", "component", "componentTemplate", "externalFolder", "externalKeyword", "externalKeywordCategory", "externalMountpoint", "externalMultimediaComponent", "folder", "keyword", "keywordCategory", "multimediaType", "page", "pageTemplate", "processDefinition", "processHistory", "processInstance", "publication", "publishTransaction", "schema", "structureGroup", "targetGroup", "taxonomies", "templateBuildingBlock", "user", "userGroup", "virtualFolder", "translationJob"];
|
|
2261
2269
|
|
|
2262
2270
|
/**
|
|
2263
2271
|
* Abstract base class for Item Field Definitions for the field types that can be published.
|
|
@@ -2294,6 +2302,7 @@ export declare const itemType: {
|
|
|
2294
2302
|
virtualFolder: "virtualFolder";
|
|
2295
2303
|
multimediaType: "multimediaType";
|
|
2296
2304
|
user: "user";
|
|
2305
|
+
publishTransaction: "publishTransaction";
|
|
2297
2306
|
processDefinition: "processDefinition";
|
|
2298
2307
|
processInstance: "processInstance";
|
|
2299
2308
|
processHistory: "processHistory";
|
|
@@ -2316,7 +2325,7 @@ export declare const itemType: {
|
|
|
2316
2325
|
searchFolder: "searchFolder";
|
|
2317
2326
|
};
|
|
2318
2327
|
|
|
2319
|
-
export declare const itemTypes: readonly ["activityInstance", "businessProcessType", "businessProcessTypes", "component", "componentTemplate", "externalFolder", "externalKeyword", "externalKeywordCategory", "externalMountpoint", "externalMultimediaComponent", "folder", "keyword", "keywordCategory", "multimediaType", "page", "pageTemplate", "processDefinition", "processHistory", "processInstance", "publication", "schema", "structureGroup", "targetGroup", "taxonomies", "templateBuildingBlock", "user", "userGroup", "virtualFolder", "translationJob", "abstractExternalKeyword", "abstractKeyword", "bundle", "multimediaComponent", "multimediaSchema", "searchFolder"];
|
|
2328
|
+
export declare const itemTypes: readonly ["activityInstance", "businessProcessType", "businessProcessTypes", "component", "componentTemplate", "externalFolder", "externalKeyword", "externalKeywordCategory", "externalMountpoint", "externalMultimediaComponent", "folder", "keyword", "keywordCategory", "multimediaType", "page", "pageTemplate", "processDefinition", "processHistory", "processInstance", "publication", "publishTransaction", "schema", "structureGroup", "targetGroup", "taxonomies", "templateBuildingBlock", "user", "userGroup", "virtualFolder", "translationJob", "abstractExternalKeyword", "abstractKeyword", "bundle", "multimediaComponent", "multimediaSchema", "searchFolder"];
|
|
2320
2329
|
|
|
2321
2330
|
export declare type ItemUri = TcmUri | EclUri | VirtualUri | TmUri;
|
|
2322
2331
|
|
|
@@ -4533,6 +4542,9 @@ export declare class TcmUri implements Uri {
|
|
|
4533
4542
|
get isNewUri(): boolean;
|
|
4534
4543
|
get isNullUri(): boolean;
|
|
4535
4544
|
get isSystemUri(): boolean;
|
|
4545
|
+
/**
|
|
4546
|
+
* If the item version is 0, then the item is editable. (e.g. tcm:1-1-v0)
|
|
4547
|
+
*/
|
|
4536
4548
|
get isEditableVersion(): boolean;
|
|
4537
4549
|
get isDynamic(): boolean;
|
|
4538
4550
|
get asString(): string;
|
|
@@ -4542,7 +4554,7 @@ export declare class TcmUri implements Uri {
|
|
|
4542
4554
|
getUriInPublication: (publicationUri: TcmUri) => TcmUri;
|
|
4543
4555
|
}
|
|
4544
4556
|
|
|
4545
|
-
declare type TcmUriItemType = keyof typeof tcmUriItemType;
|
|
4557
|
+
export declare type TcmUriItemType = keyof typeof tcmUriItemType;
|
|
4546
4558
|
|
|
4547
4559
|
declare const tcmUriItemType: {
|
|
4548
4560
|
none: number;
|
|
@@ -5737,7 +5749,8 @@ export declare class UserProfile {
|
|
|
5737
5749
|
private _user;
|
|
5738
5750
|
private _runtimeInfo;
|
|
5739
5751
|
private _preferences;
|
|
5740
|
-
|
|
5752
|
+
private _inheritedSystemPrivileges;
|
|
5753
|
+
constructor({ backendModel, user, runtimeInfo, preferences, inheritedSystemPrivileges, }: UserProfileConstructorArgs);
|
|
5741
5754
|
/**
|
|
5742
5755
|
* User display name.
|
|
5743
5756
|
*/
|
|
@@ -5758,6 +5771,10 @@ export declare class UserProfile {
|
|
|
5758
5771
|
* User preferences.
|
|
5759
5772
|
*/
|
|
5760
5773
|
get preferences(): UserPreferences | undefined;
|
|
5774
|
+
/**
|
|
5775
|
+
* Dictionary containing system privilege keys and their associated groups.
|
|
5776
|
+
*/
|
|
5777
|
+
get inheritedSystemPrivileges(): Record<string, any> | undefined;
|
|
5761
5778
|
getInternalModel: () => UserProfile_2;
|
|
5762
5779
|
}
|
|
5763
5780
|
|
|
@@ -5766,6 +5783,7 @@ export declare interface UserProfileConstructorArgs {
|
|
|
5766
5783
|
user: User | undefined;
|
|
5767
5784
|
runtimeInfo: UserRuntimeInfo | undefined;
|
|
5768
5785
|
preferences: UserPreferences | undefined;
|
|
5786
|
+
inheritedSystemPrivileges: Record<string, any> | undefined;
|
|
5769
5787
|
}
|
|
5770
5788
|
|
|
5771
5789
|
/**
|
package/dist/index.js
CHANGED
|
@@ -458,6 +458,9 @@ class TcmUri {
|
|
|
458
458
|
this._itemId === _a$2.system.itemId &&
|
|
459
459
|
this._itemType === _a$2.system.itemType);
|
|
460
460
|
}
|
|
461
|
+
/**
|
|
462
|
+
* If the item version is 0, then the item is editable. (e.g. tcm:1-1-v0)
|
|
463
|
+
*/
|
|
461
464
|
get isEditableVersion() {
|
|
462
465
|
return this.isNullUri || this._itemVersion === _a$2._editableVersion;
|
|
463
466
|
}
|
|
@@ -722,6 +725,12 @@ class EclUri {
|
|
|
722
725
|
get isDynamic() {
|
|
723
726
|
return this._itemVersion === 0;
|
|
724
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
|
+
}
|
|
725
734
|
get asString() {
|
|
726
735
|
return this._asString;
|
|
727
736
|
}
|
|
@@ -745,6 +754,12 @@ Object.defineProperty(EclUri, "_eclUriRegExp", {
|
|
|
745
754
|
writable: true,
|
|
746
755
|
value: new RegExp(/^ecl:(\d+)-([^-]+)-([^-]+)-([^-]+)-(\w+)(-v(\d+))?$/)
|
|
747
756
|
});
|
|
757
|
+
Object.defineProperty(EclUri, "_editableVersion", {
|
|
758
|
+
enumerable: true,
|
|
759
|
+
configurable: true,
|
|
760
|
+
writable: true,
|
|
761
|
+
value: 0
|
|
762
|
+
});
|
|
748
763
|
Object.defineProperty(EclUri, "create", {
|
|
749
764
|
enumerable: true,
|
|
750
765
|
configurable: true,
|
|
@@ -12659,6 +12674,8 @@ class IdentifiableTranslationJob extends IdentifiableObject {
|
|
|
12659
12674
|
}
|
|
12660
12675
|
/**
|
|
12661
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.
|
|
12662
12679
|
*/
|
|
12663
12680
|
get metadataSchemaUri() {
|
|
12664
12681
|
return this._backendModel.MetadataSchemaUri;
|
|
@@ -13269,7 +13286,7 @@ const translationWorkflowStatusMapping = {
|
|
|
13269
13286
|
};
|
|
13270
13287
|
|
|
13271
13288
|
const mapIdentifiableTranslationJobConstructorArgs = (mappingRegistry, backendModel) => {
|
|
13272
|
-
const virtualId = backendModel.Id ? TmUri.create(backendModel.Id) :
|
|
13289
|
+
const virtualId = backendModel.Id !== undefined ? TmUri.create(backendModel.Id) : TmUri.create(0);
|
|
13273
13290
|
const backendTranslationJobWithId = {
|
|
13274
13291
|
...backendModel,
|
|
13275
13292
|
Id: virtualId.asString,
|
|
@@ -13757,7 +13774,7 @@ class UserPreferences {
|
|
|
13757
13774
|
}
|
|
13758
13775
|
|
|
13759
13776
|
class UserProfile {
|
|
13760
|
-
constructor({ backendModel, user, runtimeInfo, preferences }) {
|
|
13777
|
+
constructor({ backendModel, user, runtimeInfo, preferences, inheritedSystemPrivileges, }) {
|
|
13761
13778
|
Object.defineProperty(this, "_backendModel", {
|
|
13762
13779
|
enumerable: true,
|
|
13763
13780
|
configurable: true,
|
|
@@ -13782,6 +13799,12 @@ class UserProfile {
|
|
|
13782
13799
|
writable: true,
|
|
13783
13800
|
value: void 0
|
|
13784
13801
|
});
|
|
13802
|
+
Object.defineProperty(this, "_inheritedSystemPrivileges", {
|
|
13803
|
+
enumerable: true,
|
|
13804
|
+
configurable: true,
|
|
13805
|
+
writable: true,
|
|
13806
|
+
value: void 0
|
|
13807
|
+
});
|
|
13785
13808
|
Object.defineProperty(this, "getInternalModel", {
|
|
13786
13809
|
enumerable: true,
|
|
13787
13810
|
configurable: true,
|
|
@@ -13794,6 +13817,7 @@ class UserProfile {
|
|
|
13794
13817
|
this._user = user;
|
|
13795
13818
|
this._runtimeInfo = runtimeInfo;
|
|
13796
13819
|
this._preferences = preferences;
|
|
13820
|
+
this._inheritedSystemPrivileges = inheritedSystemPrivileges;
|
|
13797
13821
|
}
|
|
13798
13822
|
/**
|
|
13799
13823
|
* User display name.
|
|
@@ -13825,6 +13849,12 @@ class UserProfile {
|
|
|
13825
13849
|
get preferences() {
|
|
13826
13850
|
return this._preferences;
|
|
13827
13851
|
}
|
|
13852
|
+
/**
|
|
13853
|
+
* Dictionary containing system privilege keys and their associated groups.
|
|
13854
|
+
*/
|
|
13855
|
+
get inheritedSystemPrivileges() {
|
|
13856
|
+
return this._inheritedSystemPrivileges;
|
|
13857
|
+
}
|
|
13828
13858
|
}
|
|
13829
13859
|
|
|
13830
13860
|
/**
|
|
@@ -14037,13 +14067,14 @@ const mapUserProfileConstructorArgs = (mappingRegistry, backendModel) => {
|
|
|
14037
14067
|
const preferences = backendModel.Preferences
|
|
14038
14068
|
? mappingRegistry.map(backendModel.Preferences)
|
|
14039
14069
|
: undefined;
|
|
14040
|
-
|
|
14070
|
+
const inheritedSystemPrivileges = backendModel.User?.InheritedSystemPrivileges;
|
|
14071
|
+
return { preferences, runtimeInfo, user, inheritedSystemPrivileges };
|
|
14041
14072
|
};
|
|
14042
14073
|
const userProfileMapping = {
|
|
14043
14074
|
identifier: backendModel => backendModel?.$type === 'UserProfile',
|
|
14044
14075
|
mapper: (mappingRegistry, backendModel) => {
|
|
14045
|
-
const { preferences, runtimeInfo, user } = mapUserProfileConstructorArgs(mappingRegistry, backendModel);
|
|
14046
|
-
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 });
|
|
14047
14078
|
},
|
|
14048
14079
|
};
|
|
14049
14080
|
|
|
@@ -16238,6 +16269,7 @@ const itemLinkTypes = [
|
|
|
16238
16269
|
'processHistory',
|
|
16239
16270
|
'processInstance',
|
|
16240
16271
|
'publication',
|
|
16272
|
+
'publishTransaction',
|
|
16241
16273
|
'schema',
|
|
16242
16274
|
'structureGroup',
|
|
16243
16275
|
'targetGroup',
|
|
@@ -16407,6 +16439,8 @@ const getItemType = (item) => {
|
|
|
16407
16439
|
return 'processInstance';
|
|
16408
16440
|
if (isExactInstanceOf(item, Publication))
|
|
16409
16441
|
return 'publication';
|
|
16442
|
+
if (isExactInstanceOf(item, PublishTransaction))
|
|
16443
|
+
return 'publishTransaction';
|
|
16410
16444
|
if (isExactInstanceOf(item, TemplateBuildingBlock))
|
|
16411
16445
|
return 'templateBuildingBlock';
|
|
16412
16446
|
if (isExactInstanceOf(item, TranslationJob))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tridion-sites/models",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Tridion Sites models",
|
|
5
5
|
"author": "RWS",
|
|
6
6
|
"homepage": "https://www.rws.com",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/core": "7.28.4",
|
|
32
32
|
"@babel/preset-env": "7.28.3",
|
|
33
|
-
"@babel/preset-typescript": "7.
|
|
33
|
+
"@babel/preset-typescript": "7.28.5",
|
|
34
34
|
"@rollup/plugin-commonjs": "25.0.8",
|
|
35
35
|
"@rollup/plugin-json": "6.1.0",
|
|
36
36
|
"@rollup/plugin-node-resolve": "15.3.1",
|
|
37
37
|
"@rollup/plugin-typescript": "11.1.6",
|
|
38
38
|
"@tridion-sites/utils": "0.0.0",
|
|
39
|
-
"@tridion/graphene": "
|
|
39
|
+
"@tridion/graphene": "4.0.0",
|
|
40
40
|
"@types/jest": "29.5.13",
|
|
41
41
|
"babel-jest": "29.7.0",
|
|
42
42
|
"jest": "29.7.0",
|