@se-studio/contentful-cms 1.0.91 → 1.2.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 +54 -0
- package/README.md +56 -2
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +10 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/asset.d.ts.map +1 -1
- package/dist/commands/asset.js +233 -56
- package/dist/commands/asset.js.map +1 -1
- package/dist/commands/create-from-json.d.ts.map +1 -1
- package/dist/commands/create-from-json.js +63 -69
- package/dist/commands/create-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy-from-json.d.ts +4 -0
- package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -0
- package/dist/commands/create-taxonomy-from-json.js +79 -0
- package/dist/commands/create-taxonomy-from-json.js.map +1 -0
- package/dist/commands/create-taxonomy.d.ts +29 -0
- package/dist/commands/create-taxonomy.d.ts.map +1 -0
- package/dist/commands/create-taxonomy.js +191 -0
- package/dist/commands/create-taxonomy.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +17 -36
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/ensure.d.ts +4 -0
- package/dist/commands/ensure.d.ts.map +1 -0
- package/dist/commands/ensure.js +95 -0
- package/dist/commands/ensure.js.map +1 -0
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/index-dump.d.ts +15 -0
- package/dist/commands/index-dump.d.ts.map +1 -0
- package/dist/commands/index-dump.js +207 -0
- package/dist/commands/index-dump.js.map +1 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +102 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +147 -20
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/resolve-options.d.ts +20 -0
- package/dist/commands/resolve-options.d.ts.map +1 -0
- package/dist/commands/resolve-options.js +51 -0
- package/dist/commands/resolve-options.js.map +1 -0
- package/dist/commands/resolve.d.ts.map +1 -1
- package/dist/commands/resolve.js +138 -27
- package/dist/commands/resolve.js.map +1 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +11 -35
- package/dist/commands/skill.js.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +10 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/types.d.ts +14 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/contentful/asset-link-from-json.d.ts +17 -0
- package/dist/contentful/asset-link-from-json.d.ts.map +1 -0
- package/dist/contentful/asset-link-from-json.js +41 -0
- package/dist/contentful/asset-link-from-json.js.map +1 -0
- package/dist/contentful/assets.d.ts +19 -8
- package/dist/contentful/assets.d.ts.map +1 -1
- package/dist/contentful/assets.js +82 -31
- package/dist/contentful/assets.js.map +1 -1
- package/dist/contentful/cda-sync.d.ts +43 -0
- package/dist/contentful/cda-sync.d.ts.map +1 -0
- package/dist/contentful/cda-sync.js +157 -0
- package/dist/contentful/cda-sync.js.map +1 -0
- package/dist/contentful/delivery-token.d.ts +17 -0
- package/dist/contentful/delivery-token.d.ts.map +1 -0
- package/dist/contentful/delivery-token.js +103 -0
- package/dist/contentful/delivery-token.js.map +1 -0
- package/dist/contentful/entry-fields.d.ts +71 -0
- package/dist/contentful/entry-fields.d.ts.map +1 -0
- package/dist/contentful/entry-fields.js +341 -0
- package/dist/contentful/entry-fields.js.map +1 -0
- package/dist/contentful/fetch.d.ts +11 -1
- package/dist/contentful/fetch.d.ts.map +1 -1
- package/dist/contentful/fetch.js +30 -6
- package/dist/contentful/fetch.js.map +1 -1
- package/dist/contentful/field-value-from-json.d.ts +24 -0
- package/dist/contentful/field-value-from-json.d.ts.map +1 -0
- package/dist/contentful/field-value-from-json.js +205 -0
- package/dist/contentful/field-value-from-json.js.map +1 -0
- package/dist/contentful/list-entry-format.d.ts +18 -0
- package/dist/contentful/list-entry-format.d.ts.map +1 -0
- package/dist/contentful/list-entry-format.js +45 -0
- package/dist/contentful/list-entry-format.js.map +1 -0
- package/dist/contentful/media.d.ts +24 -0
- package/dist/contentful/media.d.ts.map +1 -0
- package/dist/contentful/media.js +70 -0
- package/dist/contentful/media.js.map +1 -0
- package/dist/contentful/reference-record.d.ts +32 -0
- package/dist/contentful/reference-record.d.ts.map +1 -0
- package/dist/contentful/reference-record.js +58 -0
- package/dist/contentful/reference-record.js.map +1 -0
- package/dist/contentful/regex.d.ts +14 -0
- package/dist/contentful/regex.d.ts.map +1 -0
- package/dist/contentful/regex.js +38 -0
- package/dist/contentful/regex.js.map +1 -0
- package/dist/contentful/resolve-content-type.d.ts +9 -0
- package/dist/contentful/resolve-content-type.d.ts.map +1 -0
- package/dist/contentful/resolve-content-type.js +38 -0
- package/dist/contentful/resolve-content-type.js.map +1 -0
- package/dist/contentful/upload-fetch.d.ts +11 -0
- package/dist/contentful/upload-fetch.d.ts.map +1 -0
- package/dist/contentful/upload-fetch.js +26 -0
- package/dist/contentful/upload-fetch.js.map +1 -0
- package/dist/contentful/upload-limits.d.ts +7 -0
- package/dist/contentful/upload-limits.d.ts.map +1 -0
- package/dist/contentful/upload-limits.js +13 -0
- package/dist/contentful/upload-limits.js.map +1 -0
- 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.d.ts.map +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/generated/version.js.map +1 -1
- package/dist/index/db.d.ts +12 -0
- package/dist/index/db.d.ts.map +1 -0
- package/dist/index/db.js +29 -0
- package/dist/index/db.js.map +1 -0
- package/dist/index/errors.d.ts +18 -0
- package/dist/index/errors.d.ts.map +1 -0
- package/dist/index/errors.js +18 -0
- package/dist/index/errors.js.map +1 -0
- package/dist/index/mode.d.ts +7 -0
- package/dist/index/mode.d.ts.map +1 -0
- package/dist/index/mode.js +9 -0
- package/dist/index/mode.js.map +1 -0
- package/dist/index/paths.d.ts +6 -0
- package/dist/index/paths.d.ts.map +1 -0
- package/dist/index/paths.js +23 -0
- package/dist/index/paths.js.map +1 -0
- package/dist/index/query.d.ts +105 -0
- package/dist/index/query.d.ts.map +1 -0
- package/dist/index/query.js +338 -0
- package/dist/index/query.js.map +1 -0
- package/dist/index/reference-lookup.d.ts +18 -0
- package/dist/index/reference-lookup.d.ts.map +1 -0
- package/dist/index/reference-lookup.js +107 -0
- package/dist/index/reference-lookup.js.map +1 -0
- package/dist/index/require.d.ts +21 -0
- package/dist/index/require.d.ts.map +1 -0
- package/dist/index/require.js +54 -0
- package/dist/index/require.js.map +1 -0
- package/dist/index/run-sync.d.ts +18 -0
- package/dist/index/run-sync.d.ts.map +1 -0
- package/dist/index/run-sync.js +48 -0
- package/dist/index/run-sync.js.map +1 -0
- package/dist/index/schema.d.ts +6 -0
- package/dist/index/schema.d.ts.map +1 -0
- package/dist/index/schema.js +48 -0
- package/dist/index/schema.js.map +1 -0
- package/dist/index/sync-lock.d.ts +8 -0
- package/dist/index/sync-lock.d.ts.map +1 -0
- package/dist/index/sync-lock.js +85 -0
- package/dist/index/sync-lock.js.map +1 -0
- package/dist/index/sync.d.ts +42 -0
- package/dist/index/sync.d.ts.map +1 -0
- package/dist/index/sync.js +235 -0
- package/dist/index/sync.js.map +1 -0
- package/dist/mcp/guide.d.ts +2 -2
- package/dist/mcp/guide.d.ts.map +1 -1
- package/dist/mcp/guide.js +3 -0
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +61 -0
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/output/json.d.ts +6 -0
- package/dist/output/json.d.ts.map +1 -1
- package/dist/output/json.js +21 -0
- package/dist/output/json.js.map +1 -1
- package/dist/output/terminal-table.d.ts +15 -0
- package/dist/output/terminal-table.d.ts.map +1 -0
- package/dist/output/terminal-table.js +60 -0
- package/dist/output/terminal-table.js.map +1 -0
- package/dist/setup/wizard.d.ts.map +1 -1
- package/dist/setup/wizard.js +23 -1
- package/dist/setup/wizard.js.map +1 -1
- package/dist/skills/install.d.ts +13 -0
- package/dist/skills/install.d.ts.map +1 -0
- package/dist/skills/install.js +37 -0
- package/dist/skills/install.js.map +1 -0
- package/docs/FUNCTIONAL_SPEC.md +11 -0
- package/docs/MEDIA_INDEX_PLAN.md +256 -0
- package/docs/SKILLS.md +29 -0
- package/docs/help/create-from-json.md +54 -2
- package/docs/help/fields-article.md +5 -0
- package/docs/help/fields-component.md +11 -1
- package/docs/help/fields-page.md +2 -0
- package/docs/help/fields-taxonomy.md +154 -0
- package/docs/help/index-sync.md +108 -0
- package/docs/help/index.md +16 -0
- package/docs/help/taxonomy-from-json.md +115 -0
- package/docs/mcp/hosted-guide.md +16 -1
- package/package.json +9 -4
- package/skills/README.md +30 -0
- package/skills/core/SKILL.md +873 -0
- package/skills/manifest.json +5 -0
- package/skills/setup/SKILL.md +129 -0
- package/skills/templates/SKILL.md +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-fetch.d.ts","sourceRoot":"","sources":["../../src/contentful/upload-fetch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqBjF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { assertUploadBufferSize, MAX_UPLOAD_BYTES, uploadSizeLimitMessage, } from './upload-limits.js';
|
|
2
|
+
export { MAX_UPLOAD_BYTES } from './upload-limits.js';
|
|
3
|
+
export const UPLOAD_FETCH_TIMEOUT_MS = 30_000;
|
|
4
|
+
/**
|
|
5
|
+
* Fetches a remote URL for asset upload with timeout and size limits.
|
|
6
|
+
*/
|
|
7
|
+
export async function fetchUploadSource(url) {
|
|
8
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(UPLOAD_FETCH_TIMEOUT_MS) });
|
|
9
|
+
if (!response.ok) {
|
|
10
|
+
throw new Error(`Failed to fetch URL (${String(response.status)}): ${url}`);
|
|
11
|
+
}
|
|
12
|
+
const contentLength = response.headers.get('content-length');
|
|
13
|
+
if (contentLength) {
|
|
14
|
+
const declaredSize = Number.parseInt(contentLength, 10);
|
|
15
|
+
if (!Number.isNaN(declaredSize) && declaredSize > MAX_UPLOAD_BYTES) {
|
|
16
|
+
throw new Error(`Remote file ${uploadSizeLimitMessage(declaredSize)}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const buffer = Buffer.from(await response.arrayBuffer());
|
|
20
|
+
assertUploadBufferSize(buffer);
|
|
21
|
+
return {
|
|
22
|
+
buffer,
|
|
23
|
+
contentType: response.headers.get('content-type')?.split(';')[0]?.trim() ?? null,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=upload-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-fetch.js","sourceRoot":"","sources":["../../src/contentful/upload-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAO9C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAW;IACjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAC5F,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC7D,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,YAAY,GAAG,gBAAgB,EAAE,CAAC;YACnE,MAAM,IAAI,KAAK,CAAC,eAAe,sBAAsB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACzD,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE/B,OAAO;QACL,MAAM;QACN,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI;KACjF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Maximum upload size for asset sources (local file, URL, base64). */
|
|
2
|
+
export declare const MAX_UPLOAD_BYTES: number;
|
|
3
|
+
export declare const MAX_UPLOAD_MB: number;
|
|
4
|
+
export declare function uploadSizeLimitMessage(byteLength: number): string;
|
|
5
|
+
/** Throws when buffer exceeds {@link MAX_UPLOAD_BYTES}. */
|
|
6
|
+
export declare function assertUploadBufferSize(buffer: Buffer): void;
|
|
7
|
+
//# sourceMappingURL=upload-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-limits.d.ts","sourceRoot":"","sources":["../../src/contentful/upload-limits.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AAEjD,eAAO,MAAM,aAAa,QAAmC,CAAC;AAE9D,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI3D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Maximum upload size for asset sources (local file, URL, base64). */
|
|
2
|
+
export const MAX_UPLOAD_BYTES = 10 * 1024 * 1024;
|
|
3
|
+
export const MAX_UPLOAD_MB = MAX_UPLOAD_BYTES / (1024 * 1024);
|
|
4
|
+
export function uploadSizeLimitMessage(byteLength) {
|
|
5
|
+
return `File exceeds ${String(MAX_UPLOAD_MB)}MB limit (${String(byteLength)} bytes).`;
|
|
6
|
+
}
|
|
7
|
+
/** Throws when buffer exceeds {@link MAX_UPLOAD_BYTES}. */
|
|
8
|
+
export function assertUploadBufferSize(buffer) {
|
|
9
|
+
if (buffer.length > MAX_UPLOAD_BYTES) {
|
|
10
|
+
throw new Error(uploadSizeLimitMessage(buffer.length));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=upload-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-limits.js","sourceRoot":"","sources":["../../src/contentful/upload-limits.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAE9D,MAAM,UAAU,sBAAsB,CAAC,UAAkB;IACvD,OAAO,gBAAgB,MAAM,CAAC,aAAa,CAAC,aAAa,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC;AACxF,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,IAAI,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff \u2192 save |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open \u2192 snapshot \u2192 read \u2192 set/rtf \u2192 diff \u2192 save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\n\n### 2. Snapshot \u2014 see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, \u2026 refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Explore the homepage\n\n```\n[\"open\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted extension rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages \u2014 pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"/pricing\"]` or `[\"peek\", \"<entry-id>\", \"--id\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` \u2014 reports store, userId, active session key |\n\n- **`peek` is one-shot** \u2014 prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Entry IDs need `--id`** for both `open` and `peek` (bare IDs are treated as slugs).\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** \u2014 there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop \u2192 Settings \u2192 Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` \u2014 `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType
|
|
1
|
+
export declare const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff \u2192 save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open \u2192 snapshot \u2192 read \u2192 set/rtf \u2192 diff \u2192 save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\n\n### 2. Snapshot \u2014 see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, \u2026 refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted extension rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages \u2014 pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"/pricing\"]` or `[\"peek\", \"<entry-id>\", \"--id\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` \u2014 reports store, userId, active session key |\n\n- **`peek` is one-shot** \u2014 prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Entry IDs need `--id`** for both `open` and `peek` (bare IDs are treated as slugs).\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** \u2014 there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop \u2192 Settings \u2192 Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` \u2014 `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open <slug>`, `open <id> --id`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`, `peek <slug>`, `peek <id> --id`\n\n**Diagnostics:** `diagnose` \u2014 session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug \u2026 --title \u2026`, `add <type> --content-type \u2026 --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
|
|
2
2
|
//# sourceMappingURL=hosted-guide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-guide.d.ts","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"hosted-guide.d.ts","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,0yMAA2sM,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated by scripts/generate-embedded-assets.mjs — do not edit manually.
|
|
2
|
-
export const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff → save |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open → snapshot → read → set/rtf → diff → save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\n\n### 2. Snapshot — see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, … refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Explore the homepage\n\n```\n[\"open\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted extension rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"/pricing\"]` or `[\"peek\", \"<entry-id>\", \"--id\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` — reports store, userId, active session key |\n\n- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Entry IDs need `--id`** for both `open` and `peek` (bare IDs are treated as slugs).\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop → Settings → Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` — `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType
|
|
2
|
+
export const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff → save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open → snapshot → read → set/rtf → diff → save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\n\n### 2. Snapshot — see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, … refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted extension rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"/pricing\"]` or `[\"peek\", \"<entry-id>\", \"--id\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` — reports store, userId, active session key |\n\n- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Entry IDs need `--id`** for both `open` and `peek` (bare IDs are treated as slugs).\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop → Settings → Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` — `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open <slug>`, `open <id> --id`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`, `peek <slug>`, `peek <id> --id`\n\n**Diagnostics:** `diagnose` — session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug … --title …`, `add <type> --content-type … --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
|
|
3
3
|
//# sourceMappingURL=hosted-guide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-guide.js","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"hosted-guide.js","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,wsMAAwsM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/generated/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/generated/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,gBAAgB,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/generated/version.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/generated/version.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
export type ContentIndexDatabase = DatabaseSync;
|
|
3
|
+
/** @deprecated Use {@link ContentIndexDatabase}. */
|
|
4
|
+
export type MediaIndexDatabase = ContentIndexDatabase;
|
|
5
|
+
export declare function openIndexDatabase(dbPath: string, options?: {
|
|
6
|
+
memory?: boolean;
|
|
7
|
+
}): ContentIndexDatabase;
|
|
8
|
+
/** SQLite user-defined function for filename regex (pattern, value) → 0|1 */
|
|
9
|
+
export declare function registerRegexpFunction(db: DatabaseSync): void;
|
|
10
|
+
export declare function getMeta(db: ContentIndexDatabase, key: string): string | null;
|
|
11
|
+
export declare function setMeta(db: ContentIndexDatabase, key: string, value: string): void;
|
|
12
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/index/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEhD,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,oBAAoB,CAKtB;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAS7D;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK5E;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAIlF"}
|
package/dist/index/db.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import { DDL } from './schema.js';
|
|
3
|
+
export function openIndexDatabase(dbPath, options) {
|
|
4
|
+
const db = new DatabaseSync(options?.memory ? ':memory:' : dbPath);
|
|
5
|
+
db.exec(DDL);
|
|
6
|
+
registerRegexpFunction(db);
|
|
7
|
+
return db;
|
|
8
|
+
}
|
|
9
|
+
/** SQLite user-defined function for filename regex (pattern, value) → 0|1 */
|
|
10
|
+
export function registerRegexpFunction(db) {
|
|
11
|
+
db.function('regexp', { deterministic: true }, (pattern, value) => {
|
|
12
|
+
if (pattern == null || value == null)
|
|
13
|
+
return 0;
|
|
14
|
+
try {
|
|
15
|
+
return new RegExp(String(pattern)).test(String(value)) ? 1 : 0;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function getMeta(db, key) {
|
|
23
|
+
const row = db.prepare('SELECT value FROM meta WHERE key = ?').get(key);
|
|
24
|
+
return row?.value ?? null;
|
|
25
|
+
}
|
|
26
|
+
export function setMeta(db, key, value) {
|
|
27
|
+
db.prepare('INSERT INTO meta (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.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AAO,GAAG,EAAE,KAAK,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EAAwB,EAAE,GAAW,EAAE,KAAa;IAC1E,EAAE,CAAC,OAAO,CACR,mGAAmG,CACpG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class ContentIndexSyncError extends Error {
|
|
2
|
+
constructor(message: string, options?: {
|
|
3
|
+
cause?: unknown;
|
|
4
|
+
});
|
|
5
|
+
}
|
|
6
|
+
export declare class ReferenceCatalogAmbiguityError extends Error {
|
|
7
|
+
readonly matches: Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
slug: string | null;
|
|
11
|
+
}>;
|
|
12
|
+
constructor(message: string, matches: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
slug: string | null;
|
|
16
|
+
}>);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/index/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAO3D;AAED,qBAAa,8BAA+B,SAAQ,KAAK;aAGrC,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;gBADlF,OAAO,EAAE,MAAM,EACC,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAKrF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class ContentIndexSyncError extends Error {
|
|
2
|
+
constructor(message, options) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'ContentIndexSyncError';
|
|
5
|
+
if (options?.cause !== undefined) {
|
|
6
|
+
this.cause = options.cause;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class ReferenceCatalogAmbiguityError extends Error {
|
|
11
|
+
matches;
|
|
12
|
+
constructor(message, matches) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.matches = matches;
|
|
15
|
+
this.name = 'ReferenceCatalogAmbiguityError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/index/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;CACF;AAED,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAGrC;IAFlB,YACE,OAAe,EACC,OAAkE;QAElF,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,YAAO,GAAP,OAAO,CAA2D;QAGlF,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cms-edit indexes draft content via the Preview API by default (matches CMA upload workflow).
|
|
3
|
+
* Pass `preview: false` for a published-only index (`index sync --published`).
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_INDEX_PREVIEW = true;
|
|
6
|
+
export declare function resolveIndexPreview(explicit?: boolean): boolean;
|
|
7
|
+
//# sourceMappingURL=mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../src/index/mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAE/D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cms-edit indexes draft content via the Preview API by default (matches CMA upload workflow).
|
|
3
|
+
* Pass `preview: false` for a published-only index (`index sync --published`).
|
|
4
|
+
*/
|
|
5
|
+
export const DEFAULT_INDEX_PREVIEW = true;
|
|
6
|
+
export function resolveIndexPreview(explicit) {
|
|
7
|
+
return explicit ?? DEFAULT_INDEX_PREVIEW;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../src/index/mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,MAAM,UAAU,mBAAmB,CAAC,QAAkB;IACpD,OAAO,QAAQ,IAAI,qBAAqB,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SpaceConfig } from '../config/types.js';
|
|
2
|
+
export declare function getIndexDirectory(space: SpaceConfig, preview?: boolean): string;
|
|
3
|
+
export declare function getIndexDbPath(space: SpaceConfig, preview?: boolean): string;
|
|
4
|
+
export declare function ensureIndexDirectory(space: SpaceConfig, preview?: boolean): string;
|
|
5
|
+
export declare function indexExists(space: SpaceConfig, preview?: boolean): boolean;
|
|
6
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/index/paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOtD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAG/E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAE5E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAIlF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAE1E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as os from 'node:os';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { resolveIndexPreview } from './mode.js';
|
|
5
|
+
function indexRoot() {
|
|
6
|
+
return process.env['CMS_EDIT_INDEX_HOME'] ?? os.homedir();
|
|
7
|
+
}
|
|
8
|
+
export function getIndexDirectory(space, preview) {
|
|
9
|
+
const base = path.join(indexRoot(), '.contentful-cms', 'index', space.spaceId, space.environment);
|
|
10
|
+
return resolveIndexPreview(preview) ? base : `${base}-published`;
|
|
11
|
+
}
|
|
12
|
+
export function getIndexDbPath(space, preview) {
|
|
13
|
+
return path.join(getIndexDirectory(space, preview), 'media.db');
|
|
14
|
+
}
|
|
15
|
+
export function ensureIndexDirectory(space, preview) {
|
|
16
|
+
const dir = getIndexDirectory(space, preview);
|
|
17
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
18
|
+
return dir;
|
|
19
|
+
}
|
|
20
|
+
export function indexExists(space, preview) {
|
|
21
|
+
return fs.existsSync(getIndexDbPath(space, resolveIndexPreview(preview)));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/index/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAkB,EAAE,OAAiB;IACrE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAClG,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,YAAY,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAkB,EAAE,OAAiB;IAClE,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAkB,EAAE,OAAiB;IACxE,MAAM,GAAG,GAAG,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9C,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAkB,EAAE,OAAiB;IAC/D,OAAO,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { SpaceConfig } from '../config/types.js';
|
|
2
|
+
import type { AssetSummary } from '../contentful/assets.js';
|
|
3
|
+
export interface IndexedMediaRow {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
assetId: string;
|
|
7
|
+
assetFileName: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AuditMissingRow {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
fileName: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function getIndexSyncedAt(space: SpaceConfig, preview?: boolean): string | null;
|
|
16
|
+
export declare function searchAssetsInIndex(space: SpaceConfig, opts: {
|
|
17
|
+
preview?: boolean;
|
|
18
|
+
query?: string;
|
|
19
|
+
exactFileName?: string;
|
|
20
|
+
fileNamePattern?: RegExp;
|
|
21
|
+
mimeTypePrefix?: string;
|
|
22
|
+
limit?: number;
|
|
23
|
+
skip?: number;
|
|
24
|
+
}): AssetSummary[];
|
|
25
|
+
export declare function findAssetByFileNameInIndex(space: SpaceConfig, fileName: string, preview?: boolean): AssetSummary | null;
|
|
26
|
+
export declare function mediaByAssetId(space: SpaceConfig, assetId: string, preview?: boolean): IndexedMediaRow[];
|
|
27
|
+
export declare function mediaForAssetFileNames(space: SpaceConfig, opts: {
|
|
28
|
+
preview?: boolean;
|
|
29
|
+
exactFileName?: string;
|
|
30
|
+
fileNamePattern?: RegExp;
|
|
31
|
+
limit?: number;
|
|
32
|
+
}): {
|
|
33
|
+
assets: AssetSummary[];
|
|
34
|
+
media: IndexedMediaRow[];
|
|
35
|
+
};
|
|
36
|
+
export interface IndexMetaEntry {
|
|
37
|
+
key: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
40
|
+
export interface DumpAssetRow {
|
|
41
|
+
id: string;
|
|
42
|
+
fileName: string;
|
|
43
|
+
title: string;
|
|
44
|
+
contentType: string;
|
|
45
|
+
width: number | null;
|
|
46
|
+
height: number | null;
|
|
47
|
+
size: number | null;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function readAllIndexMeta(space: SpaceConfig, preview?: boolean): IndexMetaEntry[];
|
|
51
|
+
export declare function assetContentTypeCounts(space: SpaceConfig, preview?: boolean): Array<{
|
|
52
|
+
contentType: string;
|
|
53
|
+
count: number;
|
|
54
|
+
}>;
|
|
55
|
+
export declare function countAssetsInIndex(space: SpaceConfig, preview?: boolean, mimeTypePrefix?: string): number;
|
|
56
|
+
export declare function countMediaInIndex(space: SpaceConfig, preview?: boolean): number;
|
|
57
|
+
export declare function listAssetsForDump(space: SpaceConfig, opts?: {
|
|
58
|
+
preview?: boolean;
|
|
59
|
+
limit?: number;
|
|
60
|
+
skip?: number;
|
|
61
|
+
mimeTypePrefix?: string;
|
|
62
|
+
}): DumpAssetRow[];
|
|
63
|
+
export declare function listMediaForDump(space: SpaceConfig, opts?: {
|
|
64
|
+
preview?: boolean;
|
|
65
|
+
limit?: number;
|
|
66
|
+
skip?: number;
|
|
67
|
+
}): IndexedMediaRow[];
|
|
68
|
+
export declare function auditMissingAlt(space: SpaceConfig, opts?: {
|
|
69
|
+
preview?: boolean;
|
|
70
|
+
limit?: number;
|
|
71
|
+
}): {
|
|
72
|
+
checked: number;
|
|
73
|
+
missing: AuditMissingRow[];
|
|
74
|
+
};
|
|
75
|
+
export interface ReferenceEntryRow {
|
|
76
|
+
id: string;
|
|
77
|
+
contentType: string;
|
|
78
|
+
slug: string | null;
|
|
79
|
+
label: string;
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
}
|
|
82
|
+
/** Ensures index lookup rows refer to a single entry; throws on duplicate slug/label matches. */
|
|
83
|
+
export declare function assertUniqueReferenceRows(rows: ReferenceEntryRow[], message: string): ReferenceEntryRow;
|
|
84
|
+
export declare function listReferencesBySlug(space: SpaceConfig, contentType: string, slug: string, preview?: boolean): ReferenceEntryRow[];
|
|
85
|
+
export declare function listReferencesByLabel(space: SpaceConfig, contentType: string, label: string, preview?: boolean): ReferenceEntryRow[];
|
|
86
|
+
export declare function findReferenceBySlug(space: SpaceConfig, contentType: string, slug: string, preview?: boolean): ReferenceEntryRow | null;
|
|
87
|
+
export declare function findReferenceByLabel(space: SpaceConfig, contentType: string, label: string, preview?: boolean): ReferenceEntryRow | null;
|
|
88
|
+
export declare function listReferenceEntries(space: SpaceConfig, contentType: string, opts?: {
|
|
89
|
+
preview?: boolean;
|
|
90
|
+
limit?: number;
|
|
91
|
+
slug?: string;
|
|
92
|
+
label?: string;
|
|
93
|
+
}): ReferenceEntryRow[];
|
|
94
|
+
export declare function countReferenceEntries(space: SpaceConfig, contentType?: string, preview?: boolean): number;
|
|
95
|
+
export declare function referenceContentTypeCounts(space: SpaceConfig, preview?: boolean): Array<{
|
|
96
|
+
contentType: string;
|
|
97
|
+
count: number;
|
|
98
|
+
}>;
|
|
99
|
+
export declare function listReferencesForDump(space: SpaceConfig, opts?: {
|
|
100
|
+
preview?: boolean;
|
|
101
|
+
contentType?: string;
|
|
102
|
+
limit?: number;
|
|
103
|
+
skip?: number;
|
|
104
|
+
}): ReferenceEntryRow[];
|
|
105
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/index/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,C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