@dotcms/types 0.0.1-beta.33 → 0.0.1-beta.35

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/README.md CHANGED
@@ -1,29 +1,96 @@
1
- # @dotcms/types
1
+ # DotCMS Type Definition Library
2
2
 
3
- ## Overview
3
+ 📦 [@dotcms/types on npm](https://www.npmjs.com/package/@dotcms/types)
4
+ 🛠️ [View source on GitHub](https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/types)
4
5
 
5
- This library contains shared TypeScript types and interfaces used across the dotCMS SDK libraries and the Universal Visual Editor. It serves as a central repository for type definitions to ensure consistency and type safety across the ecosystem.
6
+ ## Installation
6
7
 
7
- ## Purpose
8
+ ```bash
9
+ npm install @dotcms/types@next --save-dev
10
+ ```
8
11
 
9
- - Establish a single source of truth for common types
10
- - Maintain consistency across SDK libraries
11
- - Support the Universal Visual Editor with necessary type definitions
12
- - Reduce duplication and prevent drift between related interfaces
12
+ ## Overview
13
13
 
14
- ## Usage
14
+ This package contains TypeScript type definitions for the dotCMS ecosystem. Use it to enable type safety and an enhanced developer experience when working with dotCMS APIs and structured content.
15
15
 
16
- Import types directly from this library:
16
+ ## Commonly Used Types
17
17
 
18
- ```typescript
19
- import { Block, Contentlet } from '@dotcms/types';
18
+ ```ts
19
+ import {
20
+ DotCMSPageAsset,
21
+ DotCMSPageResponse,
22
+ UVEEventType,
23
+ DotCMSInlineEditingPayload
24
+ } from '@dotcms/types';
20
25
  ```
21
26
 
22
- ## Universal Visual Editor
27
+ ## Type Hierarchy (Jump to Definitions)
28
+
29
+ ### Page Types
30
+
31
+ * [DotCMSPageAsset](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L18)
32
+
33
+ * [DotCMSPage](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L515)
34
+ * [DotCMSPageAssetContainer](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L138)
35
+ * [DotCMSSite](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L733)
36
+ * [DotCMSTemplate](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L432)
37
+ * [DotCMSViewAs](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L598)
38
+ * [DotCMSVanityUrl](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L80)
39
+ * [DotCMSURLContentMap](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L41)
40
+ * [DotCMSLayout](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L622)
41
+ * [DotCMSPageContainerContentlets](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L1139)
42
+ * [DotCMSPageResponse](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L1175)
43
+ * [DotCMSComposedPageAsset](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L1189)
44
+ * [DotCMSComposedContent](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L1195)
45
+ * [DotCMSComposedPageResponse](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L1199)
46
+ * [DotCMSClientPageGetResponse](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/page/public.ts#L1208)
47
+
48
+ ### Block Editor Types
49
+
50
+ * [BlockEditorContent](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/components/block-editor-renderer/public.ts#L38)
51
+
52
+ * [BlockEditorNode](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/components/block-editor-renderer/public.ts#L18)
53
+ * [BlockEditorMark](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/components/block-editor-renderer/public.ts#L7)
54
+
55
+ ### Editor & UVE Types
56
+
57
+ * [UVEState](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L30)
58
+
59
+ * [UVE\_MODE](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L55)
60
+ * [UVEEventHandler](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L67)
61
+ * [UVEEventSubscriber](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L90)
62
+
63
+ * [UVEEventSubscription](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L81)
64
+ * [UVEUnsubscribeFunction](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L73)
65
+ * [UVEEventType](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L169)
66
+
67
+ * [UVEEventPayloadMap](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L199)
68
+ * [DotCMSPageRendererMode](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L44)
69
+ * [DotCMSUVEAction](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/editor/public.ts#L98)
70
+
71
+ ### Events
72
+
73
+ * [DotCMSInlineEditingPayload](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/events/public.ts#L13)
74
+
75
+ * [DotCMSInlineEditingType](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/events/public.ts#L1)
76
+
77
+ ### Client Request Types
78
+
79
+ * [DotCMSPageRequestParams](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/client/public.ts#L35)
80
+
81
+ * [DotCMSGraphQLParams](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/client/public.ts#L7)
82
+ * [RequestOptions](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/client/public.ts#L84)
83
+ * [DotCMSClientConfig](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/client/public.ts#L89)
84
+ * [DotCMSNavigationRequestParams](https://github.com/dotCMS/core/blob/main/core-web/libs/sdk/types/src/lib/client/public.ts#L119)
85
+
86
+ ## About
87
+
88
+ This package is maintained as part of the [dotCMS core repository](https://github.com/dotCMS/core).
23
89
 
24
- Types in this library provide the foundation for the Universal Visual Editor, including:
90
+ ### Keywords
25
91
 
26
- - Component definitions
27
- - Editor configuration schemas
28
- - Content type mappings
29
- - UI element specifications
92
+ * dotcms
93
+ * typescript
94
+ * types
95
+ * cms
96
+ * content-management-system
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/types",
3
- "version": "0.0.1-beta.33",
3
+ "version": "0.0.1-beta.35",
4
4
  "keywords": [
5
5
  "dotCMS",
6
6
  "CMS",
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Represents a map of container identifiers to their container objects
3
+ *
4
+ * @interface DotCMSPageAssetContainers
5
+ * @property {string} [key] - The identifier of the container
6
+ * @property {DotCMSPageAssetContainer} [value] - The container object
7
+ */
8
+ export interface DotCMSPageAssetContainers {
9
+ [key: string]: DotCMSPageAssetContainer;
10
+ }
1
11
  /**
2
12
  * Represents a DotCMS page asset that contains all the components and configuration needed to render a page
3
13
  *
@@ -15,17 +25,17 @@
15
25
  */
16
26
  export interface DotCMSPageAsset {
17
27
  canCreateTemplate?: boolean;
18
- containers: {
19
- [key: string]: DotCMSPageAssetContainer;
20
- };
28
+ numberContents?: number;
29
+ containers: DotCMSPageAssetContainers;
21
30
  layout: DotCMSLayout;
22
31
  page: DotCMSPage;
23
32
  site: DotCMSSite;
24
- template: DotCMSTemplate;
33
+ template: DotCMSTemplate | Pick<DotCMSTemplate, 'drawed' | 'theme' | 'anonymous' | 'identifier'>;
25
34
  viewAs?: DotCMSViewAs;
26
35
  vanityUrl?: DotCMSVanityUrl;
27
36
  urlContentMap?: DotCMSURLContentMap;
28
37
  params?: Record<string, unknown>;
38
+ runningExperimentId?: string;
29
39
  }
30
40
  /**
31
41
  * Represents a URL to content mapping configuration that extends the basic contentlet
@@ -76,13 +86,15 @@ export interface DotCMSVanityUrl {
76
86
  pattern: string;
77
87
  vanityUrlId: string;
78
88
  url: string;
89
+ uri?: string;
90
+ action?: number;
79
91
  siteId: string;
80
92
  languageId: number;
81
93
  forwardTo: string;
82
94
  response: number;
83
95
  order: number;
84
- temporaryRedirect: boolean;
85
- permanentRedirect: boolean;
96
+ temporaryRedirect?: boolean;
97
+ permanentRedirect?: boolean;
86
98
  forward: boolean;
87
99
  }
88
100
  /**
@@ -417,7 +429,7 @@ export interface DotCMSNavigationItem {
417
429
  * @property {boolean} new - Whether template is new
418
430
  * @property {boolean} canEdit - Whether current user can edit template
419
431
  */
420
- interface DotCMSTemplate {
432
+ export interface DotCMSTemplate {
421
433
  iDate: number;
422
434
  type: string;
423
435
  owner: string;
@@ -499,7 +511,7 @@ interface DotCMSTemplate {
499
511
  * @property {string} liveInode - Live version inode
500
512
  * @property {string} shortyLive - Short live version ID
501
513
  */
502
- interface DotCMSPage {
514
+ export interface DotCMSPage {
503
515
  template: string;
504
516
  modDate: number;
505
517
  metadata: string;
@@ -531,6 +543,8 @@ interface DotCMSPage {
531
543
  folder: string;
532
544
  deleted: boolean;
533
545
  sortOrder: number;
546
+ rendered?: string;
547
+ contentType: string;
534
548
  modUser: string;
535
549
  pageUrl: string;
536
550
  workingInode: string;
@@ -543,31 +557,46 @@ interface DotCMSPage {
543
557
  lockedByName: string;
544
558
  liveInode: string;
545
559
  shortyLive: string;
560
+ canSeeRules?: boolean;
546
561
  }
547
562
  /**
548
- * Represents view configuration settings for preview/editing modes
563
+ * Represents the language configuration for a DotCMS page
549
564
  *
550
- * @interface DotCMSViewAs
551
- * @property {Object} language - Language configuration
552
- * @property {number} language.id - Language identifier
553
- * @property {string} language.languageCode - ISO language code
554
- * @property {string} language.countryCode - ISO country code
555
- * @property {string} language.language - Language name
556
- * @property {string} language.country - Country name
557
- * @property {string} mode - View mode (e.g. PREVIEW_MODE, EDIT_MODE, LIVE)
565
+ * @export
566
+ * @interface DotCMSViewAsLanguage
567
+ * @property {number} id - Unique identifier for the language
568
+ * @property {string} languageCode - ISO 639-1 language code (e.g. 'en', 'es')
569
+ * @property {string} countryCode - ISO 3166-1 country code (e.g. 'US', 'ES')
570
+ * @property {string} language - Full name of the language (e.g. 'English', 'Spanish')
571
+ * @property {string} country - Full name of the country (e.g. 'United States', 'Spain')
558
572
  */
573
+ export interface DotCMSViewAsLanguage {
574
+ id: number;
575
+ languageCode: string;
576
+ countryCode: string;
577
+ language: string;
578
+ country: string;
579
+ }
559
580
  /**
560
- * Represents view configuration settings for preview/editing modes
581
+ * Represents the persona configuration for a DotCMS page
561
582
  *
562
- * @interface DotCMSViewAs
563
- * @property {Object} language - Language configuration for the view
564
- * @property {number} language.id - Unique identifier for the language
565
- * @property {string} language.languageCode - ISO 639-1 language code (e.g. 'en', 'es')
566
- * @property {string} language.countryCode - ISO 3166-1 country code (e.g. 'US', 'ES')
567
- * @property {string} language.language - Full name of the language (e.g. 'English', 'Spanish')
568
- * @property {string} language.country - Full name of the country (e.g. 'United States', 'Spain')
569
- * @property {string} mode - View mode for the page ('PREVIEW_MODE' | 'EDIT_MODE' | 'LIVE')
583
+ * @export
584
+ * @interface DotCMSViewAsPersona
585
+ * @property {number} modDate - Last modification date timestamp
586
+ * @property {string} inode - Unique inode identifier
587
+ * @property {string} name - Name of the persona
588
+ * @property {string} identifier - Unique identifier
589
+ * @property {string} keyTag - Key tag for the persona
590
+ * @property {string} photo - Photo of the persona
570
591
  */
592
+ export interface DotCMSViewAsPersona extends DotCMSBasicContentlet {
593
+ name: string;
594
+ keyTag: string;
595
+ personalized?: boolean;
596
+ photo?: {
597
+ versionPath: string;
598
+ };
599
+ }
571
600
  /**
572
601
  * Represents view configuration settings for preview/editing modes
573
602
  *
@@ -580,15 +609,11 @@ interface DotCMSPage {
580
609
  * @property {string} language.country - Full name of the country (e.g. 'United States', 'Spain')
581
610
  * @property {string} mode - View mode for the page ('PREVIEW_MODE' | 'EDIT_MODE' | 'LIVE')
582
611
  */
583
- interface DotCMSViewAs {
584
- language: {
585
- id: number;
586
- languageCode: string;
587
- countryCode: string;
588
- language: string;
589
- country: string;
590
- };
612
+ export interface DotCMSViewAs {
613
+ language: DotCMSViewAsLanguage;
591
614
  mode: string;
615
+ persona?: DotCMSViewAsPersona;
616
+ variantId?: string;
592
617
  }
593
618
  /**
594
619
  * Represents the layout configuration for a DotCMS page
@@ -603,7 +628,7 @@ interface DotCMSViewAs {
603
628
  * @property {DotPageAssetLayoutBody} body - The main content body configuration
604
629
  * @property {DotPageAssetLayoutSidebar} sidebar - The sidebar configuration
605
630
  */
606
- interface DotCMSLayout {
631
+ export interface DotCMSLayout {
607
632
  pageWidth: string;
608
633
  width: string;
609
634
  layout: string;
@@ -624,7 +649,7 @@ interface DotCMSLayout {
624
649
  * @property {string} code - Template code for rendering the structure
625
650
  * @property {string} contentTypeVar - Variable name of the content type
626
651
  */
627
- interface DotCMSContainerStructure {
652
+ export interface DotCMSContainerStructure {
628
653
  id: string;
629
654
  structureId: string;
630
655
  containerInode: string;
@@ -710,7 +735,7 @@ interface DotPageAssetLayoutBody {
710
735
  * @property {number} sortOrder - Sort order position
711
736
  * @property {DotCMSSiteContentType} contentType - Content type configuration
712
737
  */
713
- interface DotCMSSite {
738
+ export interface DotCMSSite {
714
739
  lowIndexPriority: boolean;
715
740
  name: string;
716
741
  default: boolean;
@@ -1036,7 +1061,8 @@ interface DotCMSSiteField {
1036
1061
  * @property {DotCMSLayout} layout - Layout configuration
1037
1062
  * @property {DotCMSViewAs} viewAs - View configuration
1038
1063
  * @property {DotCMSURLContentMap} urlContentMap - URL to content mapping
1039
- * @property {DotCMSSite} site - Site information
1064
+ * @property {Record<string, unknown>} host - Site information
1065
+ * @property {Record<string, unknown>} vanityUrl - Vanity URL information
1040
1066
  * @property {Record<string, unknown>} _map - Additional mapping data
1041
1067
  */
1042
1068
  export interface DotCMSGraphQLPage {
@@ -1076,17 +1102,22 @@ export interface DotCMSGraphQLPage {
1076
1102
  live: boolean;
1077
1103
  isContentlet: boolean;
1078
1104
  statusIcons: string;
1105
+ runningExperimentId?: string;
1106
+ canSeeRules?: boolean;
1079
1107
  conLanguage: {
1080
1108
  id: number;
1081
1109
  language: string;
1082
1110
  languageCode: string;
1083
1111
  };
1084
- template: Partial<DotCMSTemplate>;
1112
+ template: Pick<DotCMSTemplate, 'drawed' | 'theme' | 'anonymous' | 'identifier'>;
1085
1113
  containers: DotCMSGraphQLPageContainer[];
1086
1114
  layout: DotCMSLayout;
1087
1115
  viewAs: DotCMSViewAs;
1088
- urlContentMap: Record<string, unknown>;
1089
- site: DotCMSSite;
1116
+ urlContentMap: {
1117
+ _map: DotCMSURLContentMap;
1118
+ };
1119
+ host: DotCMSSite;
1120
+ vanityUrl: DotCMSVanityUrl;
1090
1121
  _map: Record<string, unknown>;
1091
1122
  }
1092
1123
  /**
@@ -1142,7 +1173,7 @@ export interface DotCMSGraphQLPageResponse {
1142
1173
  export interface DotCMSPageResponse {
1143
1174
  pageAsset: DotCMSPageAsset;
1144
1175
  content?: Record<string, unknown> | unknown;
1145
- errors?: DotCMSGraphQLError;
1176
+ error?: DotCMSGraphQLError;
1146
1177
  graphql: {
1147
1178
  query: string;
1148
1179
  variables: Record<string, unknown>;