@dotcms/client 0.0.1-beta.14 → 0.0.1-beta.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/client",
3
- "version": "0.0.1-beta.14",
3
+ "version": "0.0.1-beta.16",
4
4
  "description": "Official JavaScript library for interacting with DotCMS REST APIs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,14 +1,68 @@
1
- export interface DotCMSPageAsset {
1
+ import { Contentlet } from '../content/shared/types';
2
+ /**
3
+ * Represents a DotCMS page asset with its associated data and configurations
4
+ *
5
+ * @template T - Type parameter for URL content mapping, defaults to unknown
6
+ * @interface DotCMSPageAsset
7
+ *
8
+ * @example
9
+ * // Using DotCMSPageAsset without urlContentMap type
10
+ *
11
+ * const basicPageAsset: DotCMSPageAsset = {
12
+ * canCreateTemplate: true,
13
+ * containers: {},
14
+ * layout: {...},
15
+ * page: {...},
16
+ * site: {...},
17
+ * template: {...},
18
+ * ...
19
+ * };
20
+ *
21
+ * @example
22
+ * // Using DotCMSPageAsset with urlContentMap type
23
+ * interface SomeContentlet {
24
+ * urlContentMap: {
25
+ * slug: string;
26
+ * category: string;
27
+ * }
28
+ * }
29
+ *
30
+ * const pageWithUrlMap: DotCMSPageAsset<{ urlContentMap: SomeContentlet }> = {
31
+ * containers: {},
32
+ * layout: {...},
33
+ * page: {...},
34
+ * site: {...},
35
+ * template: {...},
36
+ * // This is the contentlet SomeContentlet type
37
+ * urlContentMap: {
38
+ * slug: "/blog/post-1",
39
+ * category: "blog"
40
+ * }
41
+ * };
42
+ */
43
+ export interface DotCMSPageAsset<T = unknown> {
44
+ /** Whether a template can be created for this page */
2
45
  canCreateTemplate?: boolean;
46
+ /** Map of containers on the page indexed by container ID */
3
47
  containers: {
4
48
  [key: string]: DotCMSPageAssetContainer;
5
49
  };
50
+ /** Layout configuration for the page */
6
51
  layout: DotCMSLayout;
52
+ /** Page metadata and properties */
7
53
  page: DotCMSPage;
54
+ /** Site information */
8
55
  site: DotCMSSite;
56
+ /** Template configuration */
9
57
  template: DotCMSTemplate;
58
+ /** View configuration */
10
59
  viewAs?: DotCMSViewAs;
60
+ /** Vanity URL configuration if applicable */
11
61
  vanityUrl?: DotCMSVanityUrl;
62
+ /** Content mapping for the page URL */
63
+ urlContentMap?: T extends {
64
+ urlContentMap: infer U;
65
+ } ? Contentlet<U> : Contentlet<T>;
12
66
  }
13
67
  export interface DotPageAssetLayoutRow {
14
68
  identifier: number;