@contentrain/skills 0.9.0 → 0.9.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/skills",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "AI agent skills for Contentrain — workflow procedures, framework integration guides",
|
|
6
6
|
"type": "module",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"tsdown": "^0.21.0",
|
|
62
62
|
"typescript": "^5.7.0",
|
|
63
63
|
"vitest": "^3.0.0",
|
|
64
|
-
"@contentrain/mcp": "3.3.
|
|
64
|
+
"@contentrain/mcp": "3.3.1",
|
|
65
65
|
"@contentrain/rules": "0.7.1",
|
|
66
|
-
"@contentrain/wp-import": "0.2.
|
|
66
|
+
"@contentrain/wp-import": "0.2.2"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "tsdown src/index.ts --format esm,cjs --dts",
|
|
@@ -143,7 +143,7 @@ works bundled behaves the same on CDN.
|
|
|
143
143
|
| `in` | `.where('category', 'in', ['a','b'])` | In array |
|
|
144
144
|
| `contains` | `.where('tags', 'contains', 'vue')` | String/array contains |
|
|
145
145
|
|
|
146
|
-
### CDN Entry Metadata, Media &
|
|
146
|
+
### CDN Entry Metadata, Media, Forms & Comments
|
|
147
147
|
|
|
148
148
|
```typescript
|
|
149
149
|
// Entry metadata (status, publish_at, expire_at)
|
|
@@ -154,10 +154,16 @@ const media = client.media()
|
|
|
154
154
|
const asset = await media.asset('hero.jpg')
|
|
155
155
|
const url = media.url(asset, 'thumb')
|
|
156
156
|
|
|
157
|
-
// Forms (
|
|
157
|
+
// Forms — public /api/forms/v1, no API key (values go under `data`; captcha + honeypot beside it)
|
|
158
158
|
const form = client.form()
|
|
159
|
-
const config = await form.config('contact')
|
|
160
|
-
const result = await form.submit('contact', { name: 'Alice' })
|
|
159
|
+
const config = await form.config('contact') // fields keyed by id, captcha, captchaSiteKey, honeypotField
|
|
160
|
+
const result = await form.submit('contact', { name: 'Alice' }, { captchaToken, honeypot: '' })
|
|
161
|
+
// { success, message } | { success: false, errors: [{ field, message }] }; 403/404/429 throw ContentrainError
|
|
162
|
+
|
|
163
|
+
// Comments — public /api/comments/v1, approved comments only, body is plain text (render escaped)
|
|
164
|
+
const comments = client.comments()
|
|
165
|
+
const thread = await comments.thread('posts', entryId, { locale: 'en' })
|
|
166
|
+
await comments.submit('posts', entryId, { author: { name: 'Ada', email }, body: 'Great post', parentId }, { locale: 'en' })
|
|
161
167
|
|
|
162
168
|
// Conversation API (external AI content operations)
|
|
163
169
|
const conv = client.conversation()
|