@dotcms/types 0.0.1-beta.32 → 0.0.1-beta.34

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.32",
3
+ "version": "0.0.1-beta.34",
4
4
  "keywords": [
5
5
  "dotCMS",
6
6
  "CMS",
@@ -1,7 +1,35 @@
1
+ import { UVE_MODE } from '../editor/public';
1
2
  /**
2
- * The parameters for the Page API.
3
+ * The GraphQL parameters for a page request.
3
4
  * @public
4
5
  */
6
+ export interface DotCMSGraphQLParams {
7
+ /**
8
+ * The GraphQL query for the page.
9
+ * @property {string} page - The GraphQL query for the page.
10
+ */
11
+ page?: string;
12
+ /**
13
+ * A record of GraphQL queries for content.
14
+ * @property {Record<string, string>} content - A record of GraphQL queries for content.
15
+ */
16
+ content?: Record<string, string>;
17
+ /**
18
+ * Variables for the GraphQL queries.
19
+ * @property {Record<string, string>} variables - Variables for the GraphQL queries.
20
+ */
21
+ variables?: Record<string, string>;
22
+ /**
23
+ * An array of GraphQL fragment strings.
24
+ * @property {string[]} fragments - An array of GraphQL fragment strings.
25
+ */
26
+ fragments?: string[];
27
+ }
28
+ /**
29
+ * Parameters for making a page request to DotCMS.
30
+ * @public
31
+ * @interface DotCMSPageRequestParams
32
+ */
5
33
  export interface DotCMSPageRequestParams {
6
34
  /**
7
35
  * The id of the site you want to interact with. Defaults to the one from the config if not provided.
@@ -10,7 +38,7 @@ export interface DotCMSPageRequestParams {
10
38
  /**
11
39
  * The mode of the page you want to retrieve. Defaults to the site's default mode if not provided.
12
40
  */
13
- mode?: 'EDIT_MODE' | 'PREVIEW_MODE' | 'LIVE';
41
+ mode?: keyof typeof UVE_MODE;
14
42
  /**
15
43
  * The language id of the page you want to retrieve. Defaults to the site's default language if not provided.
16
44
  */
@@ -38,12 +66,7 @@ export interface DotCMSPageRequestParams {
38
66
  /**
39
67
  * The GraphQL options for the page.
40
68
  */
41
- graphql?: {
42
- page?: string;
43
- content?: Record<string, string>;
44
- variables?: Record<string, string>;
45
- fragments?: string[];
46
- };
69
+ graphql?: DotCMSGraphQLParams;
47
70
  }
48
71
  /**
49
72
  * Options for configuring fetch requests, excluding body and method properties.
@@ -197,14 +197,3 @@ export interface EditableContainerData {
197
197
  maxContentlets: number;
198
198
  variantId?: string;
199
199
  }
200
- /**
201
- * Configuration for the UVE
202
- * @interface DotCMSUVEConfig
203
- */
204
- export interface DotCMSUVEConfig {
205
- graphql?: {
206
- query: string;
207
- variables: Record<string, unknown>;
208
- };
209
- params?: Record<string, unknown>;
210
- }
@@ -341,7 +341,7 @@ export interface DotCMSBasicContentlet {
341
341
  title: string;
342
342
  titleImage: string;
343
343
  text?: string;
344
- url: string;
344
+ url?: string;
345
345
  working: boolean;
346
346
  body?: string;
347
347
  contentTypeIcon?: string;
@@ -349,15 +349,15 @@ export interface DotCMSBasicContentlet {
349
349
  widgetTitle?: string;
350
350
  onNumberOfPages?: string;
351
351
  __icon__?: string;
352
- [key: string]: any;
352
+ _map?: Record<string, unknown>;
353
353
  }
354
354
  /**
355
355
  * Represents a navigation item in the DotCMS navigation structure
356
356
  *
357
- * @interface DotcmsNavigationItem
357
+ * @interface DotCMSNavigationItem
358
358
  * @property {string} [code] - Optional unique code identifier for the navigation item
359
359
  * @property {string} folder - The folder path where this navigation item is located
360
- * @property {DotcmsNavigationItem[]} [children] - Optional array of child navigation items
360
+ * @property {DotCMSNavigationItem[]} [children] - Optional array of child navigation items
361
361
  * @property {string} host - The host/site this navigation item belongs to
362
362
  * @property {number} languageId - The language ID for this navigation item
363
363
  * @property {string} href - The URL/link that this navigation item points to
@@ -367,10 +367,10 @@ export interface DotCMSBasicContentlet {
367
367
  * @property {string} target - The target attribute for the link (e.g. "_blank", "_self")
368
368
  * @property {number} order - The sort order position of this item in the navigation
369
369
  */
370
- export interface DotcmsNavigationItem {
370
+ export interface DotCMSNavigationItem {
371
371
  code?: string;
372
372
  folder: string;
373
- children?: DotcmsNavigationItem[];
373
+ children?: DotCMSNavigationItem[];
374
374
  host: string;
375
375
  languageId: number;
376
376
  href: string;