@dotcms/client 0.0.1-alpha.16 → 0.0.1-alpha.17

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.
Files changed (2) hide show
  1. package/README.md +111 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # @dotcms/client
2
+
3
+ `@dotcms/client` is the official dotCMS JavaScript library designed to simplify interactions with the DotCMS REST APIs.
4
+
5
+ This client library provides a streamlined, promise-based interface to fetch pages and navigation API.
6
+
7
+ ## Features
8
+
9
+ - Easy-to-use methods to interact with the [DotCMS Page](https://www.dotcms.com/docs/latest/page-rest-api-layout-as-a-service-laas) and [Navigation APIs](https://www.dotcms.com/docs/latest/navigation-rest-api).
10
+ - Support for custom actions to communicate with the DotCMS page editor.
11
+ - Comprehensive TypeScript typings for better development experience.
12
+
13
+ ## Installation
14
+
15
+ Install the package via npm:
16
+
17
+ ```bash
18
+ npm install @dotcms/client
19
+ ```
20
+
21
+ Or using Yarn:
22
+
23
+ ```bash
24
+ yarn add @dotcms/client
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ First, initialize the client with your DotCMS instance details.
30
+
31
+ ```javascript
32
+ import { dotcmsClient } from '@dotcms/client';
33
+
34
+ const client = dotcmsClient.init({
35
+ dotcmsUrl: 'https://your-dotcms-instance.com',
36
+ authToken: 'your-auth-token',
37
+ siteId: 'your-site-id'
38
+ });
39
+ ```
40
+
41
+ ### Fetching a Page
42
+
43
+ Retrieve the elements of any page in your DotCMS system in JSON format.
44
+
45
+ ```javascript
46
+ const pageData = await client.page.get({
47
+ path: '/your-page-path',
48
+ language_id: 1,
49
+ personaId: 'optional-persona-id'
50
+ });
51
+
52
+ console.log(pageData);
53
+ ```
54
+
55
+ ### Fetching Navigation
56
+
57
+ Retrieve information about the DotCMS file and folder tree.
58
+
59
+ ```javascript
60
+ const navData = await client.nav.get({
61
+ path: '/',
62
+ depth: 2,
63
+ languageId: 1
64
+ });
65
+
66
+ console.log(navData);
67
+ ```
68
+
69
+ ## API Reference
70
+
71
+ Detailed documentation of the `@dotcms/client` methods, parameters, and types can be found below:
72
+
73
+ ### `dotcmsClient.init(config: ClientConfig): DotCmsClient`
74
+
75
+ Initializes the DotCMS client with the specified configuration.
76
+
77
+ ### `DotCmsClient.page.get(options: PageApiOptions): Promise<unknown>`
78
+
79
+ Retrieves the specified page's elements from your DotCMS system in JSON format.
80
+
81
+ ### `DotCmsClient.nav.get(options: NavApiOptions): Promise<unknown>`
82
+
83
+ Retrieves information about the DotCMS file and folder tree.
84
+
85
+ ## Contributing
86
+
87
+ GitHub pull requests are the preferred method to contribute code to dotCMS. Before any pull requests can be accepted, an automated tool will ask you to agree to the [dotCMS Contributor's Agreement](https://gist.github.com/wezell/85ef45298c48494b90d92755b583acb3).
88
+
89
+ ## Licensing
90
+
91
+ dotCMS comes in multiple editions and as such is dual licensed. The dotCMS Community Edition is licensed under the GPL 3.0 and is freely available for download, customization and deployment for use within organizations of all stripes. dotCMS Enterprise Editions (EE) adds a number of enterprise features and is available via a supported, indemnified commercial license from dotCMS. For the differences between the editions, see [the feature page](http://dotcms.com/cms-platform/features).
92
+
93
+ ## Support
94
+
95
+ If you need help or have any questions, please [open an issue](https://github.com/dotCMS/core/issues/new/choose) in the GitHub repository.
96
+
97
+ ## Documentation
98
+
99
+ Always refer to the official [DotCMS documentation](https://www.dotcms.com/docs/latest/) for comprehensive guides and API references.
100
+
101
+ ## Getting Help
102
+
103
+ | Source | Location |
104
+ | --------------- | ------------------------------------------------------------------- |
105
+ | Installation | [Installation](https://dotcms.com/docs/latest/installation) |
106
+ | Documentation | [Documentation](https://dotcms.com/docs/latest/table-of-contents) |
107
+ | Videos | [Helpful Videos](http://dotcms.com/videos/) |
108
+ | Code Examples | [Codeshare](https://dotcms.com/codeshare/) |
109
+ | Forums/Listserv | [via Google Groups](https://groups.google.com/forum/#!forum/dotCMS) |
110
+ | Twitter | @dotCMS |
111
+ | Main Site | [dotCMS.com](https://dotcms.com/) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/client",
3
- "version": "0.0.1-alpha.16",
3
+ "version": "0.0.1-alpha.17",
4
4
  "type": "module",
5
5
  "description": "Official JavaScript library for interacting with DotCMS REST APIs.",
6
6
  "repository": {