fedincms-cli 0.0.2 → 0.0.4
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
package/templates/skill/SKILL.md
CHANGED
|
@@ -7,9 +7,7 @@ description: 通过 Fedin CMS 脚本管理内容类型与条目:列出/获取/
|
|
|
7
7
|
|
|
8
8
|
## 前提
|
|
9
9
|
|
|
10
|
-
- 项目已通过 `fedincms init cms_website_key=xxxxx` 初始化,站点 ID 与用户 ID
|
|
11
|
-
- 若需调用 API,请在项目根 `.env` 中配置 `SUPABASE_CMS_API_URL`、`SUPABASE_CONTENT_API_URL`、`SUPABASE_ANON_KEY`。
|
|
12
|
-
- 脚本为单文件打包(依赖已内联),**无需**在 `scripts/` 下执行 `npm install`。
|
|
10
|
+
- 项目已通过 `fedincms init cms_website_key=xxxxx` 初始化,站点 ID 与用户 ID 已从密钥解密并写入脚本。
|
|
13
11
|
|
|
14
12
|
## 执行约定
|
|
15
13
|
|
|
@@ -27,8 +25,8 @@ description: 通过 Fedin CMS 脚本管理内容类型与条目:列出/获取/
|
|
|
27
25
|
| 列内容类型 | `list_content_types` | - | - |
|
|
28
26
|
| 获取条目列表 | `get_entries` | `--uid=<uid>` | `--options='{"pagination":{"page":1,"pageSize":10},"sort":["updated_at:desc"]}'` |
|
|
29
27
|
| 获取单条条目 | `get_entry` | `--uid=<uid>` `--id=<id>` | - |
|
|
30
|
-
| 创建条目 | `create_entry` | `--uid=<uid>` `--data='...'`
|
|
31
|
-
| 更新条目 | `update_entry` | `--uid=<uid>` `--id=<id>` `--data='...'`
|
|
28
|
+
| 创建条目 | `create_entry` | `--uid=<uid>` `--data='...'` | `--status=draft\|published` |
|
|
29
|
+
| 更新条目 | `update_entry` | `--uid=<uid>` `--id=<id>` `--data='...'` | `--status=` |
|
|
32
30
|
| 删除条目 | `delete_entry` | `--uid=<uid>` `--id=<id>` | - |
|
|
33
31
|
| 获取内容类型 schema | `get_content_type_schema` | `--contentType=<uid>` | - |
|
|
34
32
|
| 创建内容类型 | `create_content_type` | `--uid=` `--title=` | `--description=` |
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
在指定内容类型下创建一条条目。
|
|
48
48
|
|
|
49
49
|
- **命令**:`create_entry`
|
|
50
|
-
- **必填**:`--uid=<contentTypeUid>`,`--data='{"title":"Hello","body":"World"}'`
|
|
50
|
+
- **必填**:`--uid=<contentTypeUid>`,`--data='{"title":"Hello","body":"World"}'`
|
|
51
51
|
- **可选**:`--status=draft` 或 `published`(默认 `published`)
|
|
52
52
|
|
|
53
53
|
---
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
更新指定内容类型下的一条条目。
|
|
58
58
|
|
|
59
59
|
- **命令**:`update_entry`
|
|
60
|
-
- **必填**:`--uid=<contentTypeUid>`,`--id=<entryId>`,`--data='{"title":"Updated"}'`
|
|
60
|
+
- **必填**:`--uid=<contentTypeUid>`,`--id=<entryId>`,`--data='{"title":"Updated"}'`
|
|
61
61
|
- **可选**:`--status=draft` 或 `published`
|
|
62
62
|
|
|
63
63
|
---
|
|
@@ -112,4 +112,3 @@
|
|
|
112
112
|
## 复杂 JSON 参数
|
|
113
113
|
|
|
114
114
|
- 使用 `--options='...'`、`--data='...'` 时,JSON 字符串需正确转义(如 shell 中单引号包裹)。
|
|
115
|
-
- 支持从文件读取:`--data-file=./payload.json`。
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
"use strict";
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __commonJS = (cb, mod) => function __require() {
|
|
@@ -15593,11 +15592,6 @@ async function main() {
|
|
|
15593
15592
|
const a = parseArgv(argv.slice(1));
|
|
15594
15593
|
const get = (key) => a[key];
|
|
15595
15594
|
const getData = () => {
|
|
15596
|
-
if (a.dataFile) {
|
|
15597
|
-
const p = path.resolve(process.cwd(), a.dataFile);
|
|
15598
|
-
const raw = fs.readFileSync(p, "utf8");
|
|
15599
|
-
return JSON.parse(raw);
|
|
15600
|
-
}
|
|
15601
15595
|
let d = a.data;
|
|
15602
15596
|
if (typeof d === "string") try {
|
|
15603
15597
|
d = JSON.parse(d);
|