dotcms 0.0.21 → 0.2.1

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 (93) hide show
  1. package/README.md +33 -74
  2. package/index.js +1351 -0
  3. package/package.json +23 -10
  4. package/src/index.d.ts +0 -30
  5. package/src/index.js +0 -40
  6. package/src/index.js.map +0 -1
  7. package/src/lib/api/DotApiAuthorization.d.ts +0 -11
  8. package/src/lib/api/DotApiAuthorization.js +0 -47
  9. package/src/lib/api/DotApiAuthorization.js.map +0 -1
  10. package/src/lib/api/DotApiConfiguration.d.ts +0 -11
  11. package/src/lib/api/DotApiConfiguration.js +0 -32
  12. package/src/lib/api/DotApiConfiguration.js.map +0 -1
  13. package/src/lib/api/DotApiContent.d.ts +0 -14
  14. package/src/lib/api/DotApiContent.js +0 -59
  15. package/src/lib/api/DotApiContent.js.map +0 -1
  16. package/src/lib/api/DotApiContentType.d.ts +0 -12
  17. package/src/lib/api/DotApiContentType.js +0 -35
  18. package/src/lib/api/DotApiContentType.js.map +0 -1
  19. package/src/lib/api/DotApiElasticSearch.d.ts +0 -15
  20. package/src/lib/api/DotApiElasticSearch.js +0 -37
  21. package/src/lib/api/DotApiElasticSearch.js.map +0 -1
  22. package/src/lib/api/DotApiEvent.d.ts +0 -8
  23. package/src/lib/api/DotApiEvent.js +0 -20
  24. package/src/lib/api/DotApiEvent.js.map +0 -1
  25. package/src/lib/api/DotApiForm.d.ts +0 -17
  26. package/src/lib/api/DotApiForm.js +0 -25
  27. package/src/lib/api/DotApiForm.js.map +0 -1
  28. package/src/lib/api/DotApiLanguage.d.ts +0 -13
  29. package/src/lib/api/DotApiLanguage.js +0 -33
  30. package/src/lib/api/DotApiLanguage.js.map +0 -1
  31. package/src/lib/api/DotApiNavigation.d.ts +0 -11
  32. package/src/lib/api/DotApiNavigation.js +0 -34
  33. package/src/lib/api/DotApiNavigation.js.map +0 -1
  34. package/src/lib/api/DotApiPage.d.ts +0 -18
  35. package/src/lib/api/DotApiPage.js +0 -51
  36. package/src/lib/api/DotApiPage.js.map +0 -1
  37. package/src/lib/api/DotApiSite.d.ts +0 -10
  38. package/src/lib/api/DotApiSite.js +0 -31
  39. package/src/lib/api/DotApiSite.js.map +0 -1
  40. package/src/lib/api/DotApiWidget.d.ts +0 -13
  41. package/src/lib/api/DotApiWidget.js +0 -33
  42. package/src/lib/api/DotApiWidget.js.map +0 -1
  43. package/src/lib/models/DotCMSAuthorization.model.d.ts +0 -6
  44. package/src/lib/models/DotCMSAuthorization.model.js +0 -3
  45. package/src/lib/models/DotCMSAuthorization.model.js.map +0 -1
  46. package/src/lib/models/DotCMSConfiguration.model.d.ts +0 -53
  47. package/src/lib/models/DotCMSConfiguration.model.js +0 -3
  48. package/src/lib/models/DotCMSConfiguration.model.js.map +0 -1
  49. package/src/lib/models/DotCMSContent.model.d.ts +0 -13
  50. package/src/lib/models/DotCMSContent.model.js +0 -3
  51. package/src/lib/models/DotCMSContent.model.js.map +0 -1
  52. package/src/lib/models/DotCMSElasticSearch.model.d.ts +0 -48
  53. package/src/lib/models/DotCMSElasticSearch.model.js +0 -3
  54. package/src/lib/models/DotCMSElasticSearch.model.js.map +0 -1
  55. package/src/lib/models/DotCMSError.model.d.ts +0 -4
  56. package/src/lib/models/DotCMSError.model.js +0 -3
  57. package/src/lib/models/DotCMSError.model.js.map +0 -1
  58. package/src/lib/models/DotCMSEvent.model.d.ts +0 -4
  59. package/src/lib/models/DotCMSEvent.model.js +0 -3
  60. package/src/lib/models/DotCMSEvent.model.js.map +0 -1
  61. package/src/lib/models/DotCMSForm.model.d.ts +0 -14
  62. package/src/lib/models/DotCMSForm.model.js +0 -3
  63. package/src/lib/models/DotCMSForm.model.js.map +0 -1
  64. package/src/lib/models/DotCMSHttpClient.model.d.ts +0 -10
  65. package/src/lib/models/DotCMSHttpClient.model.js +0 -3
  66. package/src/lib/models/DotCMSHttpClient.model.js.map +0 -1
  67. package/src/lib/models/DotCMSLanguage.model.d.ts +0 -7
  68. package/src/lib/models/DotCMSLanguage.model.js +0 -3
  69. package/src/lib/models/DotCMSLanguage.model.js.map +0 -1
  70. package/src/lib/models/DotCMSNavigation.model.d.ts +0 -13
  71. package/src/lib/models/DotCMSNavigation.model.js +0 -3
  72. package/src/lib/models/DotCMSNavigation.model.js.map +0 -1
  73. package/src/lib/models/DotCMSPage.model.d.ts +0 -245
  74. package/src/lib/models/DotCMSPage.model.js +0 -3
  75. package/src/lib/models/DotCMSPage.model.js.map +0 -1
  76. package/src/lib/models/DotCMSPageFormat.model.d.ts +0 -4
  77. package/src/lib/models/DotCMSPageFormat.model.js +0 -3
  78. package/src/lib/models/DotCMSPageFormat.model.js.map +0 -1
  79. package/src/lib/models/DotCMSSite.model.d.ts +0 -156
  80. package/src/lib/models/DotCMSSite.model.js +0 -3
  81. package/src/lib/models/DotCMSSite.model.js.map +0 -1
  82. package/src/lib/models/index.d.ts +0 -13
  83. package/src/lib/models/index.js +0 -17
  84. package/src/lib/models/index.js.map +0 -1
  85. package/src/lib/utils/DotCMSHttpClient.d.ts +0 -6
  86. package/src/lib/utils/DotCMSHttpClient.js +0 -14
  87. package/src/lib/utils/DotCMSHttpClient.js.map +0 -1
  88. package/src/lib/utils/getEsQuery.d.ts +0 -2
  89. package/src/lib/utils/getEsQuery.js +0 -39
  90. package/src/lib/utils/getEsQuery.js.map +0 -1
  91. package/src/lib/utils/request.d.ts +0 -2
  92. package/src/lib/utils/request.js +0 -48
  93. package/src/lib/utils/request.js.map +0 -1
package/README.md CHANGED
@@ -1,95 +1,54 @@
1
- # JavaScript SDK for DotCMS API's
1
+ # dotcms
2
2
 
3
- This library allows you to interact with DotCMS API's easily from the browser, nodejs and React Native. [Full Documentation](https://dotcms.github.io/core-web/dotcms/)
3
+ One command to connect an AI coding agent to a dotCMS instance.
4
4
 
5
- ## Install
6
-
7
- `npm install dotcms --save`
8
-
9
- or
10
-
11
- `yarn install dotcms`
12
-
13
- ## Usage
14
-
15
- ```javascript
16
- import { initDotCMS } from 'dotcms';
17
-
18
- const dotcms = initDotCMS({
19
- hostId: 'DOTCMS_SITE_IDENTIFIER',
20
- host: 'YOUR_DOTCMS_INSTANCE',
21
- token: 'YOUR AUTH TOKEN'
22
- });
23
-
24
- // Example
25
- dotcms.page
26
- .get({
27
- url: '/about-us'
28
- })
29
- .then((data) => {
30
- console.log(data);
31
- })
32
- .catch((err) => {
33
- console.error(err.status, err.message);
34
- });
5
+ ```bash
6
+ npx dotcms agent setup
35
7
  ```
36
8
 
37
- ## Examples
9
+ It asks where your instance is, how to authenticate, and which editors to wire up — then mints
10
+ and verifies a token, writes the dotCMS MCP server into each editor's own config file, installs
11
+ the dotCMS skills, and launches the server to confirm it responds before reporting success.
38
12
 
39
- ### Next.js
13
+ Replaces four manual steps: find the admin panel, mint a token by hand, hand-edit whichever
14
+ config file your editor reads, install the skills separately.
40
15
 
41
- Next.js gives you the best developer experience with all the features you need for production. [Read more](https://nextjs.org/)
16
+ ## Supported editors
42
17
 
43
- #### Fetching data in the client
18
+ Claude Code · Cursor · VS Code (Copilot) · Codex · Antigravity · Devin · OpenCode
44
19
 
45
- ```javascript
46
- import { useEffect, useState } from 'react';
47
- import { initDotCMS } from 'dotcms';
20
+ Installed editors are detected and used by default; `--agent <id>` selects specific ones.
48
21
 
49
- const dotcms = initDotCMS({
50
- host: 'YOUR_DOTCMS_INSTANCE',
51
- token: 'YOUR AUTH TOKEN'
52
- });
22
+ ## Authentication
53
23
 
54
- export default function Home() {
55
- const [state, setState] = useState(null);
24
+ Two mutually exclusive modes. Passing both is a usage error, not a silent preference.
56
25
 
57
- useEffect(async () => {
58
- const page = await dotcms.page.get({
59
- url: '/index'
60
- });
61
- setState(page);
62
- }, []);
26
+ ```bash
27
+ # mint a token from credentials
28
+ npx dotcms agent setup --url https://demo.dotcms.com --user admin@dotcms.com --password ''
63
29
 
64
- return state && <h1>{state.page.title}</h1>;
65
- }
30
+ # or use a token you already have
31
+ npx dotcms agent setup --url https://demo.dotcms.com --authToken '…'
66
32
  ```
67
33
 
68
- #### Fetching data in the server
34
+ The URL plus one auth mode are the only required inputs — supply both and the command runs
35
+ without prompting, whether or not a terminal is attached.
69
36
 
70
- ```javascript
71
- import { useEffect, useState } from 'react';
72
- import { initDotCMS } from 'dotcms';
37
+ > Passing a secret as a flag makes it visible in the process list and shell history. Prefer
38
+ > `DOTCMS_PASSWORD` / `DOTCMS_AUTH_TOKEN`, or let it prompt.
73
39
 
74
- export default function Home(props) {
75
- return <h1>{props.page.title}</h1>;
76
- }
40
+ ## Scope
77
41
 
78
- export async function getServerSideProps(context) {
79
- const page = await dotcms.page.get({
80
- url: context.req.url // you can map the urls with dotcms
81
- });
82
-
83
- return {
84
- props: page // will be passed to the page component as props
85
- };
86
- }
87
- ```
42
+ Writes to the **current folder** by default, so each project can point at its own instance.
43
+ `-g/--global` writes to your user account instead. Folder scope offers to add the files it
44
+ touched to `.gitignore`, because they contain a token.
88
45
 
89
- More about [data fetching](https://nextjs.org/docs/basic-features/data-fetching) in Nextjs.
46
+ ## Where the token goes
90
47
 
91
- ## Running unit tests
48
+ Only into the editor config files listed in the summary, restricted to your user where the
49
+ platform supports it. It is never logged in full, never passed as a process argument, and a
50
+ password is never written anywhere.
92
51
 
93
- Run `nx test dotcms` to execute the unit tests.
52
+ ## Status
94
53
 
95
- This library was generated with [Nx](https://nx.dev).
54
+ Not yet released. See `specs/37390-dotcms-agent-setup/` for the specification.