@se-studio/contentful-cms 1.3.7 → 2.0.0
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/CHANGELOG.md +12 -0
- package/HOSTED.md +25 -72
- package/INSTALL.md +2 -2
- package/README.md +1 -1
- package/dist/cli/program.js +2 -2
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/entry-search.d.ts.map +1 -1
- package/dist/commands/entry-search.js +4 -1
- package/dist/commands/entry-search.js.map +1 -1
- package/dist/commands/host-scaffold.d.ts +4 -0
- package/dist/commands/host-scaffold.d.ts.map +1 -0
- package/dist/commands/host-scaffold.js +73 -0
- package/dist/commands/host-scaffold.js.map +1 -0
- package/dist/commands/{mcpb-pack.d.ts → host-stage.d.ts} +2 -2
- package/dist/commands/host-stage.d.ts.map +1 -0
- package/dist/commands/host-stage.js +60 -0
- package/dist/commands/host-stage.js.map +1 -0
- package/dist/commands/host.d.ts +3 -0
- package/dist/commands/host.d.ts.map +1 -0
- package/dist/commands/host.js +9 -0
- package/dist/commands/host.js.map +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +26 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/sitemap.d.ts.map +1 -1
- package/dist/commands/sitemap.js +17 -2
- package/dist/commands/sitemap.js.map +1 -1
- package/dist/contentful/cda-sync.d.ts.map +1 -1
- package/dist/contentful/cda-sync.js +2 -0
- package/dist/contentful/cda-sync.js.map +1 -1
- package/dist/contentful/reference-record.d.ts +4 -0
- package/dist/contentful/reference-record.d.ts.map +1 -1
- package/dist/contentful/reference-record.js +7 -0
- package/dist/contentful/reference-record.js.map +1 -1
- package/dist/generated/hosted-guide.d.ts +1 -1
- package/dist/generated/hosted-guide.d.ts.map +1 -1
- package/dist/generated/hosted-guide.js +1 -1
- package/dist/generated/hosted-guide.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/hosted/index.d.ts +7 -0
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/hosted/index.js +7 -0
- package/dist/hosted/index.js.map +1 -1
- package/dist/hosted/next/claude-connect.d.ts +8 -0
- package/dist/hosted/next/claude-connect.d.ts.map +1 -0
- package/dist/hosted/next/claude-connect.js +23 -0
- package/dist/hosted/next/claude-connect.js.map +1 -0
- package/dist/hosted/next/context.d.ts +3 -0
- package/dist/hosted/next/context.d.ts.map +1 -0
- package/dist/hosted/next/context.js +11 -0
- package/dist/hosted/next/context.js.map +1 -0
- package/dist/hosted/next/editor-pack-path.d.ts +2 -0
- package/dist/hosted/next/editor-pack-path.d.ts.map +1 -0
- package/dist/hosted/next/editor-pack-path.js +6 -0
- package/dist/hosted/next/editor-pack-path.js.map +1 -0
- package/dist/hosted/next/page-styles.d.ts +6 -0
- package/dist/hosted/next/page-styles.d.ts.map +1 -0
- package/dist/hosted/next/page-styles.js +37 -0
- package/dist/hosted/next/page-styles.js.map +1 -0
- package/dist/hosted/next/pages/CmsEditPage.d.ts +2 -0
- package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -0
- package/dist/hosted/next/pages/CmsEditPage.js +22 -0
- package/dist/hosted/next/pages/CmsEditPage.js.map +1 -0
- package/dist/hosted/next/pages/ContentfulCallbackPage.d.ts +2 -0
- package/dist/hosted/next/pages/ContentfulCallbackPage.d.ts.map +1 -0
- package/dist/hosted/next/pages/ContentfulCallbackPage.js +45 -0
- package/dist/hosted/next/pages/ContentfulCallbackPage.js.map +1 -0
- package/dist/hosted/next/pages/HomePage.d.ts +2 -0
- package/dist/hosted/next/pages/HomePage.d.ts.map +1 -0
- package/dist/hosted/next/pages/HomePage.js +36 -0
- package/dist/hosted/next/pages/HomePage.js.map +1 -0
- package/dist/hosted/next/redis.d.ts +5 -0
- package/dist/hosted/next/redis.d.ts.map +1 -0
- package/dist/hosted/next/redis.js +23 -0
- package/dist/hosted/next/redis.js.map +1 -0
- package/dist/hosted/next/routes/connect.d.ts +2 -0
- package/dist/hosted/next/routes/connect.d.ts.map +1 -0
- package/dist/hosted/next/routes/connect.js +19 -0
- package/dist/hosted/next/routes/connect.js.map +1 -0
- package/dist/hosted/next/routes/health.d.ts +2 -0
- package/dist/hosted/next/routes/health.d.ts.map +1 -0
- package/dist/hosted/next/routes/health.js +51 -0
- package/dist/hosted/next/routes/health.js.map +1 -0
- package/dist/hosted/next/routes/link-contentful.d.ts +2 -0
- package/dist/hosted/next/routes/link-contentful.d.ts.map +1 -0
- package/dist/hosted/next/routes/link-contentful.js +6 -0
- package/dist/hosted/next/routes/link-contentful.js.map +1 -0
- package/dist/hosted/next/routes/mcp.d.ts +4 -0
- package/dist/hosted/next/routes/mcp.d.ts.map +1 -0
- package/dist/hosted/next/routes/mcp.js +52 -0
- package/dist/hosted/next/routes/mcp.js.map +1 -0
- package/dist/hosted/next/routes/oauth-authorization-server.d.ts +2 -0
- package/dist/hosted/next/routes/oauth-authorization-server.d.ts.map +1 -0
- package/dist/hosted/next/routes/oauth-authorization-server.js +5 -0
- package/dist/hosted/next/routes/oauth-authorization-server.js.map +1 -0
- package/dist/hosted/next/routes/oauth-authorize.d.ts +2 -0
- package/dist/hosted/next/routes/oauth-authorize.d.ts.map +1 -0
- package/dist/hosted/next/routes/oauth-authorize.js +6 -0
- package/dist/hosted/next/routes/oauth-authorize.js.map +1 -0
- package/dist/hosted/next/routes/oauth-protected-resource.d.ts +2 -0
- package/dist/hosted/next/routes/oauth-protected-resource.d.ts.map +1 -0
- package/dist/hosted/next/routes/oauth-protected-resource.js +5 -0
- package/dist/hosted/next/routes/oauth-protected-resource.js.map +1 -0
- package/dist/hosted/next/routes/oauth-register.d.ts +2 -0
- package/dist/hosted/next/routes/oauth-register.d.ts.map +1 -0
- package/dist/hosted/next/routes/oauth-register.js +6 -0
- package/dist/hosted/next/routes/oauth-register.js.map +1 -0
- package/dist/hosted/next/routes/oauth-token.d.ts +2 -0
- package/dist/hosted/next/routes/oauth-token.d.ts.map +1 -0
- package/dist/hosted/next/routes/oauth-token.js +6 -0
- package/dist/hosted/next/routes/oauth-token.js.map +1 -0
- package/dist/hosted/next/stage-site.d.ts +11 -0
- package/dist/hosted/next/stage-site.d.ts.map +1 -0
- package/dist/hosted/next/stage-site.js +49 -0
- package/dist/hosted/next/stage-site.js.map +1 -0
- package/dist/hosted/oauth/auth.d.ts +11 -0
- package/dist/hosted/oauth/auth.d.ts.map +1 -0
- package/dist/hosted/oauth/auth.js +41 -0
- package/dist/hosted/oauth/auth.js.map +1 -0
- package/dist/hosted/oauth/complete.d.ts +13 -0
- package/dist/hosted/oauth/complete.d.ts.map +1 -0
- package/dist/hosted/oauth/complete.js +40 -0
- package/dist/hosted/oauth/complete.js.map +1 -0
- package/dist/hosted/oauth/config.d.ts +7 -0
- package/dist/hosted/oauth/config.d.ts.map +1 -0
- package/dist/hosted/oauth/config.js +33 -0
- package/dist/hosted/oauth/config.js.map +1 -0
- package/dist/hosted/oauth/handlers.d.ts +18 -0
- package/dist/hosted/oauth/handlers.d.ts.map +1 -0
- package/dist/hosted/oauth/handlers.js +212 -0
- package/dist/hosted/oauth/handlers.js.map +1 -0
- package/dist/hosted/oauth/jwt.d.ts +9 -0
- package/dist/hosted/oauth/jwt.d.ts.map +1 -0
- package/dist/hosted/oauth/jwt.js +31 -0
- package/dist/hosted/oauth/jwt.js.map +1 -0
- package/dist/hosted/oauth/pkce.d.ts +3 -0
- package/dist/hosted/oauth/pkce.d.ts.map +1 -0
- package/dist/hosted/oauth/pkce.js +9 -0
- package/dist/hosted/oauth/pkce.js.map +1 -0
- package/dist/hosted/oauth/store.d.ts +35 -0
- package/dist/hosted/oauth/store.d.ts.map +1 -0
- package/dist/hosted/oauth/store.js +70 -0
- package/dist/hosted/oauth/store.js.map +1 -0
- package/dist/index/db.d.ts.map +1 -1
- package/dist/index/db.js +5 -1
- package/dist/index/db.js.map +1 -1
- package/dist/index/query.d.ts +4 -0
- package/dist/index/query.d.ts.map +1 -1
- package/dist/index/query.js +13 -2
- package/dist/index/query.js.map +1 -1
- package/dist/index/reference-lookup.d.ts.map +1 -1
- package/dist/index/reference-lookup.js +4 -0
- package/dist/index/reference-lookup.js.map +1 -1
- package/dist/index/schema.d.ts +5 -3
- package/dist/index/schema.d.ts.map +1 -1
- package/dist/index/schema.js +8 -3
- package/dist/index/schema.js.map +1 -1
- package/dist/index/sync.d.ts.map +1 -1
- package/dist/index/sync.js +5 -4
- package/dist/index/sync.js.map +1 -1
- package/dist/mcp/guide.js +5 -5
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.js +1 -1
- package/dist/mcp/tools/cms-edit.d.ts +1 -1
- package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
- package/dist/mcp/tools/cms-edit.js +10 -2
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/dist/output/json.d.ts.map +1 -1
- package/dist/output/json.js +1 -0
- package/dist/output/json.js.map +1 -1
- package/dist/project/types.d.ts +0 -8
- package/dist/project/types.d.ts.map +1 -1
- package/dist/project/types.js +0 -8
- package/dist/project/types.js.map +1 -1
- package/docs/help/fields-article.md +14 -0
- package/docs/help/index-sync.md +1 -0
- package/docs/mcp/hosted-guide.md +29 -5
- package/package.json +34 -6
- package/skills/core/SKILL.md +7 -0
- package/skills/setup/SKILL.md +12 -15
- package/dist/commands/mcpb-pack.d.ts.map +0 -1
- package/dist/commands/mcpb-pack.js +0 -60
- package/dist/commands/mcpb-pack.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @se-studio/contentful-cms Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Replace `.mcpb` bridge with OAuth-first hosted MCP. Add `@se-studio/contentful-cms/hosted/next` exports and `cms-edit host scaffold` / `cms-edit host stage` CLI commands. Remove `cms-edit mcpb pack` and the `mcpb/` package tree.
|
|
8
|
+
|
|
9
|
+
## 1.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Sort articles by publication `date` instead of `sys.updatedAt`. Index schema v4 stores article dates for fast `list --type article --sort date`. `search --type article` and `sitemap --sort date` also use publication date. MCP guide and skills clarify that `peek`/`open` support drafts (only `--published` is published-only).
|
|
14
|
+
|
|
3
15
|
## 1.3.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/HOSTED.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Hosted cms-edit for Claude Desktop
|
|
2
2
|
|
|
3
|
-
Use this guide when your team hosts cms-edit on Vercel (one deployment per client). **You do not need Node.js or
|
|
3
|
+
Use this guide when your team hosts cms-edit on Vercel (one deployment per client). **You do not need Node.js, tokens, or config files** — only Claude Desktop and a Contentful account.
|
|
4
4
|
|
|
5
|
-
Edits you make appear in Contentful under **your name**, because you
|
|
5
|
+
Edits you make appear in Contentful under **your name**, because you sign in with your own Contentful account.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## What SE sends you
|
|
10
10
|
|
|
11
|
-
1. A
|
|
11
|
+
1. A link to your site's setup page (e.g. `https://dev.content.se.studio/cms-edit`)
|
|
12
12
|
2. This guide
|
|
13
13
|
|
|
14
|
-
You do **not** need to edit JSON, install Node.js, or configure connector URLs yourself.
|
|
14
|
+
You do **not** need to edit JSON, install Node.js, create API tokens, or configure connector URLs yourself.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -22,61 +22,29 @@ For each editor:
|
|
|
22
22
|
1. Invite them to the Contentful space.
|
|
23
23
|
2. Assign the **AI Editor** role (draft edit only — no publish). See [README — Contentful Role Setup](./README.md#contentful-role-setup-required).
|
|
24
24
|
3. Deploy `apps/cms-edit-host` to Vercel for this client (see [cms-edit-host README](../../apps/cms-edit-host/README.md)).
|
|
25
|
-
4.
|
|
26
|
-
5. Send them the `.mcpb` file and this guide.
|
|
25
|
+
4. Send them the setup page URL and this guide.
|
|
27
26
|
|
|
28
27
|
---
|
|
29
28
|
|
|
30
|
-
## Step 1 —
|
|
29
|
+
## Step 1 — Install Claude Desktop
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
2. Open the correct space (top-left selector).
|
|
34
|
-
3. Go to **Settings → CMA tokens** (Content management tokens).
|
|
35
|
-
4. Click **Create personal access token**.
|
|
36
|
-
5. Name it `Claude Desktop` and click **Generate**.
|
|
37
|
-
6. **Copy the token now** — you will not see it again.
|
|
38
|
-
|
|
39
|
-
This token is tied to **you**. Changes you save through Claude will show your name in Contentful.
|
|
31
|
+
Install [Claude Desktop](https://claude.ai/download) if you have not already.
|
|
40
32
|
|
|
41
33
|
---
|
|
42
34
|
|
|
43
|
-
## Step 2 —
|
|
44
|
-
|
|
45
|
-
1. Install [Claude Desktop](https://claude.ai/download) if you have not already.
|
|
46
|
-
2. Install the extension SE sent you:
|
|
47
|
-
- **Option A:** Double-click the `.mcpb` file, or drag it into the Claude Desktop window.
|
|
48
|
-
- **Option B:** Open Claude Desktop → **Settings → Extensions** → **Install Extension…** → select the `.mcpb` file.
|
|
49
|
-
3. When prompted, paste your **Contentful personal access token** from Step 1.
|
|
50
|
-
4. Confirm the extension appears as **cms-edit (Your Site Name)** and is enabled.
|
|
51
|
-
5. Fully **quit** Claude Desktop and reopen it (on Mac: right-click Dock icon → Quit).
|
|
52
|
-
|
|
53
|
-
Your token is stored securely on your machine (Claude Desktop treats it as sensitive configuration).
|
|
54
|
-
|
|
55
|
-
### About the install warning
|
|
56
|
-
|
|
57
|
-
Claude Desktop may show a red warning when you install the extension:
|
|
58
|
-
|
|
59
|
-
> Installing will grant this extension access to everything on your computer. Any developer information shown has not been verified by Anthropic.
|
|
60
|
-
|
|
61
|
-
This is **Claude’s generic message for all local desktop extensions**, not something specific to cms-edit. You will see similar wording for any `.mcpb` file that is not listed in Anthropic’s verified extension directory.
|
|
62
|
-
|
|
63
|
-
**What actually installs on your computer:** a small proxy (~50 lines of logic) that:
|
|
35
|
+
## Step 2 — Connect to Claude
|
|
64
36
|
|
|
65
|
-
|
|
66
|
-
- Connects only to the fixed URL baked into your extension (your site’s `/api/mcp` endpoint)
|
|
67
|
-
- Attaches your Contentful token from the OS keychain on each HTTPS request
|
|
37
|
+
**Easiest:** Open the link SE sent you (e.g. `https://dev.content.se.studio/connect` or **Connect to Claude** on `/cms-edit`). This opens Claude with the connector name and URL prefilled — confirm, then sign in with Contentful.
|
|
68
38
|
|
|
69
|
-
|
|
39
|
+
**Manual:** Claude Desktop → **Customize → Connectors** → **Add custom connector** → paste the MCP URL (e.g. `https://dev.content.se.studio/api/mcp`) → **Connect** → sign in with Contentful.
|
|
70
40
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
The bridge source code is in the [SE monorepo](https://github.com/Something-Else-Studio/se-core-product) under `packages/contentful-cms/mcpb/bridge/` if you want to inspect it.
|
|
41
|
+
No extension install, no personal access token, no command line.
|
|
74
42
|
|
|
75
43
|
---
|
|
76
44
|
|
|
77
45
|
## Step 3 — Try it
|
|
78
46
|
|
|
79
|
-
**Getting started:** Ask Claude to read the **cms-edit guide** (`cms-edit://guide` resource) or use the **`cms_edit_verify`** prompt to check version and connectivity.
|
|
47
|
+
**Getting started:** Ask Claude to read the **cms-edit guide** (`cms-edit://guide` resource) or use the **`cms_edit_verify`** prompt to check version and connectivity.
|
|
80
48
|
|
|
81
49
|
In a new Claude conversation:
|
|
82
50
|
|
|
@@ -86,23 +54,15 @@ or:
|
|
|
86
54
|
|
|
87
55
|
> Open the homepage and show me the content tree.
|
|
88
56
|
|
|
89
|
-
or:
|
|
90
|
-
|
|
91
|
-
> List all pages on the site.
|
|
92
|
-
|
|
93
57
|
If Claude returns JSON with page content or a snapshot with `@c0`, `@c1` refs, you are connected.
|
|
94
58
|
|
|
95
|
-
**Homepage slug:** On SE Studio sites, Contentful stores the homepage as slug `index` (public URL `/`). Use `open --page-slug /` or `open --page-slug /index` — both work.
|
|
59
|
+
**Homepage slug:** On SE Studio sites, Contentful stores the homepage as slug `index` (public URL `/`). Use `open --page-slug /` or `open --page-slug /index` — both work. Site-specific exceptions are in `cms-edit://customer/routing`.
|
|
96
60
|
|
|
97
|
-
**Typical edit workflow:** `open --page-slug /` → `snapshot` → `read @c1` → `set @c1 heading "New title"` → `diff` → `save`.
|
|
98
|
-
|
|
99
|
-
To edit copy:
|
|
100
|
-
|
|
101
|
-
> Open `/pricing`, change the main heading to "Simple pricing", show me the diff, then save.
|
|
61
|
+
**Typical edit workflow:** `open --page-slug /` → `snapshot` → `read @c1` → `set @c1 heading "New title"` → `diff` → `save`.
|
|
102
62
|
|
|
103
63
|
Remember: **save creates drafts only**. You or a colleague must **publish in Contentful** for changes to go live.
|
|
104
64
|
|
|
105
|
-
**Do not pass `--space`** when using the hosted
|
|
65
|
+
**Do not pass `--space`** when using the hosted integration. The deployment is already configured for your site.
|
|
106
66
|
|
|
107
67
|
---
|
|
108
68
|
|
|
@@ -110,35 +70,28 @@ Remember: **save creates drafts only**. You or a colleague must **publish in Con
|
|
|
110
70
|
|
|
111
71
|
| Problem | What to do |
|
|
112
72
|
|---------|------------|
|
|
113
|
-
| **
|
|
114
|
-
| **No cms_edit tool in Claude** |
|
|
115
|
-
| **No active session** (after `open` worked) | Do not pass `--space`. MCP uses session `_mcp` automatically. Run `["diagnose"]` to inspect
|
|
116
|
-
| **Wrong space** | Your
|
|
117
|
-
| **
|
|
118
|
-
| **Check cms-edit version** | Ask Claude to use the `cms_edit_version` tool, or run `curl -s "https://YOUR-DEPLOYMENT.vercel.app/api/health" | jq .cmsEdit`. Version comes from the hosted server — no `.mcpb` reinstall needed. |
|
|
73
|
+
| **Connection stopped working** | Open Settings → Integrations and click **Connect** again to refresh your Contentful sign-in. |
|
|
74
|
+
| **No cms_edit tool in Claude** | Confirm the integration is connected under Settings → Integrations. |
|
|
75
|
+
| **No active session** (after `open` worked) | Do not pass `--space`. MCP uses session `_mcp` automatically. Run `["diagnose"]` to inspect state. |
|
|
76
|
+
| **Wrong space** | Your Contentful account must have access to this site's space. Ask SE if unsure. |
|
|
77
|
+
| **Check cms-edit version** | Ask Claude to use the `cms_edit_version` tool, or run `curl -s "https://YOUR-DEPLOYMENT.vercel.app/api/health" \| jq .cmsEdit`. |
|
|
119
78
|
|
|
120
79
|
### Health check
|
|
121
80
|
|
|
122
|
-
Ask SE to run (or run yourself if you have curl):
|
|
123
|
-
|
|
124
81
|
```bash
|
|
125
|
-
curl -s -
|
|
126
|
-
"https://YOUR-DEPLOYMENT.vercel.app/api/health"
|
|
82
|
+
curl -s "https://YOUR-DEPLOYMENT.vercel.app/api/health"
|
|
127
83
|
```
|
|
128
84
|
|
|
129
|
-
All checks should show `"ok": true`.
|
|
85
|
+
All checks should show `"ok": true`. If `redis` or `oauth` is not ok, contact SE to fix the deployment.
|
|
130
86
|
|
|
131
87
|
---
|
|
132
88
|
|
|
133
|
-
##
|
|
89
|
+
## Legacy: `.mcpb` extension (deprecated)
|
|
134
90
|
|
|
135
|
-
|
|
136
|
-
- The hosted server **does not store** your token; it is sent on each request over HTTPS.
|
|
137
|
-
- Use a token with the **AI Editor** role only — not an admin token.
|
|
138
|
-
- The local extension is a network proxy only; it does not access your filesystem. See [About the install warning](#about-the-install-warning) above.
|
|
91
|
+
Older deployments used a Claude Desktop **extension** (`.mcpb`) with a manual Contentful personal access token. New setups use **Integrations + OAuth** instead. If your extension stopped working, remove it (Settings → Extensions) and reconnect via your site's `/cms-edit` page.
|
|
139
92
|
|
|
140
93
|
---
|
|
141
94
|
|
|
142
95
|
## Local setup (developers)
|
|
143
96
|
|
|
144
|
-
Developers can still use the local MCP wizard: see [INSTALL.md](./INSTALL.md).
|
|
97
|
+
Developers can still use the local MCP wizard: see [INSTALL.md](./INSTALL.md).
|
package/INSTALL.md
CHANGED
|
@@ -6,14 +6,14 @@ There are two setup paths:
|
|
|
6
6
|
|
|
7
7
|
| Path | Who | Requirements |
|
|
8
8
|
|------|-----|--------------|
|
|
9
|
-
| **Hosted** | Content editors on a client site | Claude Desktop +
|
|
9
|
+
| **Hosted** | Content editors on a client site | Claude Desktop Integrations + onboarding URL from SE — **no Node.js** |
|
|
10
10
|
| **Local** | Developers / multi-space workflows | Node.js + setup wizard |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
## Hosted setup (content editors)
|
|
15
15
|
|
|
16
|
-
If SE sent you
|
|
16
|
+
If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`), follow [HOSTED.md](./HOSTED.md). Connect via Claude Integrations and sign in with Contentful — no terminal, Node.js, or personal access token required.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ npx @se-studio/contentful-cms@latest setup
|
|
|
31
31
|
|
|
32
32
|
It discovers your Contentful spaces and environments automatically from your management token, writes `~/.contentful-cms.json`, and updates the Claude Desktop config. See [INSTALL.md](./INSTALL.md) for a full walkthrough.
|
|
33
33
|
|
|
34
|
-
**Hosted mode (no Node.js for editors):** deploy
|
|
34
|
+
**Hosted mode (no Node.js for editors):** deploy a thin Next.js host to Vercel (`cms-edit host scaffold`), configure OAuth env vars, and send editors your `/cms-edit` onboarding URL plus [HOSTED.md](./HOSTED.md). Shared route logic lives in `@se-studio/contentful-cms/hosted/next`.
|
|
35
35
|
|
|
36
36
|
**Manual config** — if you'd prefer to configure by hand, add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
37
37
|
|
package/dist/cli/program.js
CHANGED
|
@@ -19,10 +19,10 @@ import { registerEntrySearchCommand } from '../commands/entry-search.js';
|
|
|
19
19
|
import { registerGuideCommand } from '../commands/guide.js';
|
|
20
20
|
import { registerHealthCommand } from '../commands/health.js';
|
|
21
21
|
import { registerHelpCommand } from '../commands/help.js';
|
|
22
|
+
import { registerHostCommand } from '../commands/host.js';
|
|
22
23
|
import { registerIndexCommand } from '../commands/index.js';
|
|
23
24
|
import { registerLinksCommand } from '../commands/links.js';
|
|
24
25
|
import { registerListCommand } from '../commands/list.js';
|
|
25
|
-
import { registerMcpbPackCommand } from '../commands/mcpb-pack.js';
|
|
26
26
|
import { registerMoveCommand } from '../commands/move.js';
|
|
27
27
|
import { registerNavCommand } from '../commands/nav.js';
|
|
28
28
|
import { registerOpenCommand } from '../commands/open.js';
|
|
@@ -154,7 +154,7 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
154
154
|
registerSkillCommand(program);
|
|
155
155
|
registerProjectCommand(program);
|
|
156
156
|
registerEditorPackCommand(program);
|
|
157
|
-
|
|
157
|
+
registerHostCommand(program);
|
|
158
158
|
registerHelpCommand(program);
|
|
159
159
|
program
|
|
160
160
|
.command('setup')
|
package/dist/cli/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,mB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AAO,CAAC,CAAC;IAC7B,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAE7B,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,iFAAiF,CAAC;SAC9F,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,cAAc,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;QAC5E,eAAe,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAC1F,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,cAAc,CACrB,QAA+B,EAC/B,OAA+B;IAE/B,OAAO,KAAK,EAAE,GAAG,IAAuC,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-search.d.ts","sourceRoot":"","sources":["../../src/commands/entry-search.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"entry-search.d.ts","sourceRoot":"","sources":["../../src/commands/entry-search.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwGjE"}
|
|
@@ -24,7 +24,7 @@ export function registerEntrySearchCommand(program) {
|
|
|
24
24
|
const queryParams = {
|
|
25
25
|
query,
|
|
26
26
|
limit,
|
|
27
|
-
order: '-sys.updatedAt',
|
|
27
|
+
order: opts.type === 'article' ? '-fields.date' : '-sys.updatedAt',
|
|
28
28
|
};
|
|
29
29
|
if (opts.type) {
|
|
30
30
|
queryParams['content_type'] = opts.type;
|
|
@@ -61,9 +61,12 @@ export function registerEntrySearchCommand(program) {
|
|
|
61
61
|
entry.sys.id);
|
|
62
62
|
const slug = fields['slug']?.[locale] ?? fields['slug']?.['en-US'];
|
|
63
63
|
const status = entry.sys.publishedVersion ? pc.green('published') : pc.cyan('draft');
|
|
64
|
+
const date = fields['date']?.[locale] ?? fields['date']?.['en-US'];
|
|
64
65
|
console.log(` ${pc.bold(entry.sys.id)} ${pc.blue(`[${ctId}]`)} ${title} ${status}`);
|
|
65
66
|
if (slug)
|
|
66
67
|
console.log(` ${pc.dim(`slug: /${slug}`)}`);
|
|
68
|
+
if (date)
|
|
69
|
+
console.log(` ${pc.dim(`Date: ${String(date)}`)}`);
|
|
67
70
|
console.log(` ${pc.dim(`Updated: ${entry.sys.updatedAt}`)}`);
|
|
68
71
|
}
|
|
69
72
|
console.log('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-search.js","sourceRoot":"","sources":["../../src/commands/entry-search.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAA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AAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0BlE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { isJsonMode } from '../output/mode.js';
|
|
5
|
+
const SCAFFOLD_FILES = {
|
|
6
|
+
'src/app/layout.tsx': `export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
7
|
+
return (
|
|
8
|
+
<html lang="en">
|
|
9
|
+
<body>{children}</body>
|
|
10
|
+
</html>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
`,
|
|
14
|
+
'src/app/page.tsx': `export { default } from '@se-studio/contentful-cms/hosted/next/pages/HomePage';
|
|
15
|
+
`,
|
|
16
|
+
'src/app/cms-edit/page.tsx': `export { default } from '@se-studio/contentful-cms/hosted/next/pages/CmsEditPage';
|
|
17
|
+
`,
|
|
18
|
+
'src/app/connect/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/connect';
|
|
19
|
+
`,
|
|
20
|
+
'src/app/oauth/contentful-callback/page.tsx': `export { default } from '@se-studio/contentful-cms/hosted/next/pages/ContentfulCallbackPage';
|
|
21
|
+
`,
|
|
22
|
+
'src/app/oauth/authorize/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/oauth-authorize';
|
|
23
|
+
`,
|
|
24
|
+
'src/app/oauth/token/route.ts': `export { POST } from '@se-studio/contentful-cms/hosted/next/routes/oauth-token';
|
|
25
|
+
`,
|
|
26
|
+
'src/app/oauth/register/route.ts': `export { POST } from '@se-studio/contentful-cms/hosted/next/routes/oauth-register';
|
|
27
|
+
`,
|
|
28
|
+
'src/app/api/mcp/route.ts': `export { GET, POST, DELETE } from '@se-studio/contentful-cms/hosted/next/routes/mcp';
|
|
29
|
+
`,
|
|
30
|
+
'src/app/api/health/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/health';
|
|
31
|
+
`,
|
|
32
|
+
'src/app/api/oauth/link-contentful/route.ts': `export { POST } from '@se-studio/contentful-cms/hosted/next/routes/link-contentful';
|
|
33
|
+
`,
|
|
34
|
+
'src/app/.well-known/oauth-authorization-server/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/oauth-authorization-server';
|
|
35
|
+
`,
|
|
36
|
+
'src/app/.well-known/oauth-protected-resource/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/oauth-protected-resource';
|
|
37
|
+
`,
|
|
38
|
+
'scripts/stage-site.mjs': `#!/usr/bin/env node
|
|
39
|
+
import { spawnSync } from 'node:child_process';
|
|
40
|
+
|
|
41
|
+
const result = spawnSync('cms-edit', ['host', 'stage', '--host-dir', process.cwd()], {
|
|
42
|
+
stdio: 'inherit',
|
|
43
|
+
env: process.env,
|
|
44
|
+
});
|
|
45
|
+
process.exit(result.status ?? 1);
|
|
46
|
+
`,
|
|
47
|
+
};
|
|
48
|
+
export function registerHostScaffoldCommand(hostCmd) {
|
|
49
|
+
hostCmd
|
|
50
|
+
.command('scaffold')
|
|
51
|
+
.description('Write thin Next.js route re-exports for cms-edit/host (OAuth-only)')
|
|
52
|
+
.option('--host-dir <path>', 'Path to cms-edit/host (default: cwd)')
|
|
53
|
+
.option('--force', 'Overwrite existing scaffold files')
|
|
54
|
+
.action((opts) => {
|
|
55
|
+
const hostDir = resolve(opts.hostDir ?? process.cwd());
|
|
56
|
+
const written = [];
|
|
57
|
+
for (const [relativePath, content] of Object.entries(SCAFFOLD_FILES)) {
|
|
58
|
+
const filePath = join(hostDir, relativePath);
|
|
59
|
+
if (existsSync(filePath) && !opts.force) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
63
|
+
writeFileSync(filePath, content);
|
|
64
|
+
written.push(relativePath);
|
|
65
|
+
}
|
|
66
|
+
if (isJsonMode()) {
|
|
67
|
+
console.log(JSON.stringify({ ok: true, hostDir, written }));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
console.log(`Scaffolded ${written.length} files in ${hostDir}`);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=host-scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-scaffold.js","sourceRoot":"","sources":["../../src/commands/host-scaffold.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,cAAc,GAA2B;IAC7C,oBAAoB,EAAE;;;;;;;CAOvB;IACC,kBAAkB,EAAE;CACrB;IACC,2BAA2B,EAAE;CAC9B;IACC,0BAA0B,EAAE;CAC7B;IACC,4CAA4C,EAAE;CAC/C;IACC,kCAAkC,EAAE;CACrC;IACC,8BAA8B,EAAE;CACjC;IACC,iCAAiC,EAAE;CACpC;IACC,0BAA0B,EAAE;CAC7B;IACC,6BAA6B,EAAE;CAChC;IACC,4CAA4C,EAAE;CAC/C;IACC,yDAAyD,EAAE;CAC5D;IACC,uDAAuD,EAAE;CAC1D;IACC,wBAAwB,EAAE;;;;;;;;CAQ3B;CACA,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAAC,OAAgB;IAC1D,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,oEAAoE,CAAC;SACjF,MAAM,CAAC,mBAAmB,EAAE,sCAAsC,CAAC;SACnE,MAAM,CAAC,SAAS,EAAE,mCAAmC,CAAC;SACtD,MAAM,CAAC,CAAC,IAA2C,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACvD,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC7C,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACxC,SAAS;YACX,CAAC;YACD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;QAED,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAC5D,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,CAAC,MAAM,aAAa,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
|
-
export declare function
|
|
4
|
-
//# sourceMappingURL=
|
|
3
|
+
export declare function registerHostStageCommand(hostCmd: Command): void;
|
|
4
|
+
//# sourceMappingURL=host-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-stage.d.ts","sourceRoot":"","sources":["../../src/commands/host-stage.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAIvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCzC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+B/D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
|
+
import { stageEditorPack } from '../hosted/next/stage-site.js';
|
|
5
|
+
import { isJsonMode } from '../output/mode.js';
|
|
6
|
+
function loadEnvLocal(hostDir) {
|
|
7
|
+
const envPath = join(hostDir, '.env.local');
|
|
8
|
+
if (!existsSync(envPath)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
for (const line of readFileSync(envPath, 'utf8').split('\n')) {
|
|
12
|
+
const trimmed = line.trim();
|
|
13
|
+
if (!trimmed || trimmed.startsWith('#')) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const eq = trimmed.indexOf('=');
|
|
17
|
+
if (eq === -1) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const key = trimmed.slice(0, eq).trim();
|
|
21
|
+
let value = trimmed.slice(eq + 1).trim();
|
|
22
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
23
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
24
|
+
value = value.slice(1, -1);
|
|
25
|
+
}
|
|
26
|
+
if (!(key in process.env)) {
|
|
27
|
+
process.env[key] = value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function registerHostStageCommand(hostCmd) {
|
|
32
|
+
hostCmd
|
|
33
|
+
.command('stage')
|
|
34
|
+
.description('Copy committed editor-pack/ into cms-edit/host before dev or Vercel build')
|
|
35
|
+
.option('--host-dir <path>', 'Path to cms-edit/host (default: cwd)')
|
|
36
|
+
.option('--repo-root <path>', 'Monorepo/site repo root (default: two levels above host)')
|
|
37
|
+
.action((opts) => {
|
|
38
|
+
const hostDir = resolve(opts.hostDir ?? process.cwd());
|
|
39
|
+
loadEnvLocal(hostDir);
|
|
40
|
+
const result = stageEditorPack({
|
|
41
|
+
hostDir,
|
|
42
|
+
repoRoot: opts.repoRoot,
|
|
43
|
+
});
|
|
44
|
+
if (result.skipped) {
|
|
45
|
+
const message = 'CMS_EDIT_ROOT not set — colocated editor-pack/ already in cms-edit-host/';
|
|
46
|
+
if (isJsonMode()) {
|
|
47
|
+
console.log(JSON.stringify({ ok: true, skipped: true, message }));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
console.log(message);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (isJsonMode()) {
|
|
54
|
+
console.log(JSON.stringify({ ok: true, projectKey: result.projectKey }));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
console.log(`Staged ${result.projectKey} editor-pack into ${hostDir}/`);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=host-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-stage.js","sourceRoot":"","sources":["../../src/commands/host-stage.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO;IACT,CAAC;IAED,KAAK,MAAM,IAAI,I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registerHostScaffoldCommand } from './host-scaffold.js';
|
|
2
|
+
import { registerHostStageCommand } from './host-stage.js';
|
|
3
|
+
export function registerHostCommand(program) {
|
|
4
|
+
const hostCmd = program.command('host').description('cms-edit hosted Next.js deploy helpers');
|
|
5
|
+
registerHostStageCommand(hostCmd);
|
|
6
|
+
registerHostScaffoldCommand(hostCmd);
|
|
7
|
+
return hostCmd;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/commands/host.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;IAE9F,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAClC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAErC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8BzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8P1D"}
|
package/dist/commands/list.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createSafeEnvironment } from '../contentful/client.js';
|
|
|
6
6
|
import { extractLinkedAssetId, printEntryLine, printIndexedMediaLine, } from '../contentful/list-entry-format.js';
|
|
7
7
|
import { parseSafeRegExpPattern } from '../contentful/regex.js';
|
|
8
8
|
import { ContentIndexSyncError, ReferenceCatalogAmbiguityError } from '../index/errors.js';
|
|
9
|
-
import { listReferenceEntries, mediaByAssetId, mediaForAssetFileNames } from '../index/query.js';
|
|
9
|
+
import { listReferenceEntries, mediaByAssetId, mediaForAssetFileNames, } from '../index/query.js';
|
|
10
10
|
import { ensureContentIndex } from '../index/require.js';
|
|
11
11
|
import { isCatalogContentType } from '../index/schema.js';
|
|
12
12
|
import { entryToJson, referenceEntryRowToJson } from '../output/json.js';
|
|
@@ -34,6 +34,7 @@ export function registerListCommand(program) {
|
|
|
34
34
|
.option('--asset-filename <name>', 'Filter media entries by linked asset fileName (exact)')
|
|
35
35
|
.option('--asset-filename-match <pattern>', 'Filter media by linked asset fileName (regex)')
|
|
36
36
|
.option('--json', 'Output as a JSON array including all fields')
|
|
37
|
+
.option('--sort <by>', 'Sort catalog entries by: label (default), updated, or date (articles only)', 'label')
|
|
37
38
|
.option('--published', 'Use published-only index for reference catalog (Delivery API)')
|
|
38
39
|
.option('--force-cma', 'Fetch from Contentful API instead of local index (reference types only)')
|
|
39
40
|
.action(async (opts, cmd) => {
|
|
@@ -44,6 +45,11 @@ export function registerListCommand(program) {
|
|
|
44
45
|
const env = await createSafeEnvironment(space);
|
|
45
46
|
const locale = space.defaultLocale;
|
|
46
47
|
const indexPreview = !opts.published;
|
|
48
|
+
const sort = parseListSort(opts.sort);
|
|
49
|
+
if (sort === 'date' && opts.type !== 'article') {
|
|
50
|
+
errorMsg('--sort date is only supported for --type article.');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
47
53
|
if (opts.assetFilename || opts.assetFilenameMatch) {
|
|
48
54
|
if (opts.type !== 'media') {
|
|
49
55
|
errorMsg('--asset-filename and --asset-filename-match require --type media.');
|
|
@@ -87,6 +93,7 @@ export function registerListCommand(program) {
|
|
|
87
93
|
const hardLimit = opts.limit ? Number.parseInt(opts.limit, 10) : undefined;
|
|
88
94
|
const rows = listReferenceEntries(space, opts.type, {
|
|
89
95
|
preview: indexPreview,
|
|
96
|
+
sort,
|
|
90
97
|
...(opts.slug ? { slug: opts.slug } : {}),
|
|
91
98
|
...(opts.tagTypeSlug ? { tagTypeSlug: opts.tagTypeSlug } : {}),
|
|
92
99
|
...(opts.tagTypeName ? { tagTypeName: opts.tagTypeName } : {}),
|
|
@@ -115,6 +122,8 @@ export function registerListCommand(program) {
|
|
|
115
122
|
if (row.articleTypeSlug) {
|
|
116
123
|
console.log(` ${pc.dim(`articleType: /${row.articleTypeSlug}`)}`);
|
|
117
124
|
}
|
|
125
|
+
if (row.date)
|
|
126
|
+
console.log(` ${pc.dim(`Date: ${row.date}`)}`);
|
|
118
127
|
console.log(` ${pc.dim(`Updated: ${row.updatedAt}`)}`);
|
|
119
128
|
}
|
|
120
129
|
console.log('');
|
|
@@ -150,7 +159,7 @@ export function registerListCommand(program) {
|
|
|
150
159
|
content_type: opts.type,
|
|
151
160
|
limit: thisLimit,
|
|
152
161
|
skip,
|
|
153
|
-
order:
|
|
162
|
+
order: cmaListOrder(sort),
|
|
154
163
|
...filterParams,
|
|
155
164
|
});
|
|
156
165
|
total = result.total;
|
|
@@ -201,6 +210,21 @@ export function registerListCommand(program) {
|
|
|
201
210
|
}
|
|
202
211
|
});
|
|
203
212
|
}
|
|
213
|
+
function parseListSort(value) {
|
|
214
|
+
if (!value || value === 'label')
|
|
215
|
+
return 'label';
|
|
216
|
+
if (value === 'updated' || value === 'date')
|
|
217
|
+
return value;
|
|
218
|
+
errorMsg(`Invalid --sort value "${value}". Use label, updated, or date.`);
|
|
219
|
+
process.exit(1);
|
|
220
|
+
}
|
|
221
|
+
function cmaListOrder(sort) {
|
|
222
|
+
if (sort === 'date')
|
|
223
|
+
return '-fields.date';
|
|
224
|
+
if (sort === 'updated')
|
|
225
|
+
return '-sys.updatedAt';
|
|
226
|
+
return 'sys.createdAt';
|
|
227
|
+
}
|
|
204
228
|
function printListOpenHint(contentType) {
|
|
205
229
|
const hints = {
|
|
206
230
|
page: 'cms-edit open --page-slug <slug>',
|