@cmssy/mcp-server 0.5.0 → 0.7.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/README.md +51 -0
- package/dist/queries.d.ts +24 -9
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +223 -9
- package/dist/queries.js.map +1 -1
- package/dist/responses.d.ts +71 -0
- package/dist/responses.d.ts.map +1 -0
- package/dist/responses.js +87 -0
- package/dist/responses.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +565 -144
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -43,6 +43,32 @@ Instead of CLI args, you can set:
|
|
|
43
43
|
- `CMSSY_WORKSPACE_ID` — Workspace ID
|
|
44
44
|
- `CMSSY_API_URL` — API URL (required, e.g. `https://api.your-cmssy.com`)
|
|
45
45
|
|
|
46
|
+
## Response shape (write tools)
|
|
47
|
+
|
|
48
|
+
As of 0.6.0, most write tools accept an optional `response` arg:
|
|
49
|
+
|
|
50
|
+
- `response: "minimal"` (default) - returns a small ack (~200 bytes):
|
|
51
|
+
`{id, slug, hasUnpublishedChanges, updatedAt}` for page tools,
|
|
52
|
+
`{pageId, blockId, hasUnpublishedChanges, updatedAt}` for block tools,
|
|
53
|
+
`{id, slug, status, updatedAt}` for form tools,
|
|
54
|
+
`{id, slug, updatedAt}` for model tools,
|
|
55
|
+
`{id, status, updatedAt}` for record tools.
|
|
56
|
+
- `response: "full"` - returns the full mutation response (pre-0.6 behavior).
|
|
57
|
+
|
|
58
|
+
Use `"full"` only if you need the post-write state inline; otherwise issue a
|
|
59
|
+
follow-up `get_page`/`get_form`/`get_model`/`get_record`. This keeps agent
|
|
60
|
+
context windows from being eaten by echoed content.
|
|
61
|
+
|
|
62
|
+
Tools that accept `response`: `create_page`, `update_page_blocks`,
|
|
63
|
+
`update_page_settings`, `publish_page`, `unpublish_page`, `revert_to_published`,
|
|
64
|
+
`update_page_layout`, `add_block_to_page`, `update_block_content`,
|
|
65
|
+
`remove_block_from_page`, `create_form`, `update_form`, `create_model`,
|
|
66
|
+
`update_model`, `create_record`, `update_record`.
|
|
67
|
+
|
|
68
|
+
`patch_block_content` and the various `delete_*` / status-only tools
|
|
69
|
+
(`update_form_submission_status`, `import_records`, `create_model_from_template`)
|
|
70
|
+
already returned a compact ack and don't take `response`.
|
|
71
|
+
|
|
46
72
|
## Available Tools
|
|
47
73
|
|
|
48
74
|
### Read Tools
|
|
@@ -109,6 +135,31 @@ Requires `@cmssy/cli`-registered workspace with `PAGES_EDIT` permission.
|
|
|
109
135
|
Default `fieldPath` is `"content"` (the HTML body on docs-article); override
|
|
110
136
|
if patching a different string field.
|
|
111
137
|
|
|
138
|
+
### Model Tools (Custom Data Models)
|
|
139
|
+
|
|
140
|
+
AI agents can define ModelDefinitions and CRUD their records. Schema/fields
|
|
141
|
+
follow `PropertyField` from `@cmssy/types`; records are validated against the
|
|
142
|
+
model on every write.
|
|
143
|
+
|
|
144
|
+
| Tool | Description |
|
|
145
|
+
| ---------------------------- | -------------------------------------------------------------------------- |
|
|
146
|
+
| `list_models` | List all ModelDefinitions in the workspace |
|
|
147
|
+
| `get_model` | Get a model by id (ObjectId) or slug |
|
|
148
|
+
| `create_model` | Create a model (name, slug, fields, optional statusField) |
|
|
149
|
+
| `update_model` | Update any field of a model (fields change triggers schema migrate) |
|
|
150
|
+
| `delete_model` | Delete a model — **cascades to all its records** |
|
|
151
|
+
| `list_records` | List records with filter (JSON), sort, pagination, optional populate |
|
|
152
|
+
| `get_record` | Get a record by id |
|
|
153
|
+
| `create_record` | Create a record; `data` keyed by model field keys |
|
|
154
|
+
| `update_record` | Update a record's data and/or transition its status |
|
|
155
|
+
| `delete_record` | Delete a record |
|
|
156
|
+
| `import_records` | Bulk import up to 1000 records; returns `{ importedCount, errors }` |
|
|
157
|
+
| `list_model_templates` | List available templates (E-commerce, Blog, etc.) |
|
|
158
|
+
| `create_model_from_template` | Install a template; returns `{ templateId, installedCount, skippedSlugs }` |
|
|
159
|
+
|
|
160
|
+
Requires workspace permissions `MODELS_VIEW` (read) / `MODELS_CREATE` /
|
|
161
|
+
`MODELS_EDIT` / `MODELS_DELETE` depending on the operation.
|
|
162
|
+
|
|
112
163
|
## Resources
|
|
113
164
|
|
|
114
165
|
| URI | Description |
|
package/dist/queries.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare const PAGES_QUERY = "\n query Pages($search: String) {\n pages(search: $search) {\n id\n name\n slug\n description\n displayName\n published\n publishedAt\n
|
|
2
|
-
export declare const PAGE_BY_ID_QUERY = "\n query PageById($pageId: ID!) {\n page(pageId: $pageId) {\n id\n name\n slug\n description\n displayName\n seoTitle\n seoDescription\n seoKeywords\n published\n publishedAt\n
|
|
1
|
+
export declare const PAGES_QUERY = "\n query Pages($search: String) {\n pages(search: $search) {\n id\n name\n slug\n description\n displayName\n published\n publishedAt\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n pageType\n parentId\n order\n createdAt\n updatedAt\n }\n }\n";
|
|
2
|
+
export declare const PAGE_BY_ID_QUERY = "\n query PageById($pageId: ID!) {\n page(pageId: $pageId) {\n id\n name\n slug\n description\n displayName\n seoTitle\n seoDescription\n seoKeywords\n published\n publishedAt\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n pageType\n parentId\n order\n blocks {\n id\n type\n content\n settings\n style\n advanced\n translations\n defaultLanguage\n metadata {\n createdAt\n updatedAt\n createdBy\n version\n }\n blockVersion\n }\n publishedBlocks {\n id\n type\n content\n settings\n style\n advanced\n translations\n defaultLanguage\n metadata {\n createdAt\n updatedAt\n createdBy\n version\n }\n blockVersion\n }\n layoutBlocks {\n id type position order isActive\n content settings style advanced\n translations defaultLanguage\n metadata { createdAt updatedAt createdBy version }\n blockVersion\n }\n publishedLayoutBlocks {\n id type position order isActive\n content settings style advanced\n translations defaultLanguage\n metadata { createdAt updatedAt createdBy version }\n blockVersion\n }\n layoutOverrides { position action blockId }\n inheritsLayout\n createdAt\n updatedAt\n }\n }\n";
|
|
3
3
|
export declare const WORKSPACE_BLOCKS_QUERY: string;
|
|
4
4
|
export declare const WORKSPACE_BLOCK_BY_TYPE_QUERY: string;
|
|
5
5
|
export declare const SITE_CONFIG_QUERY = "\n query SiteConfig {\n siteConfig {\n id\n defaultLanguage\n enabledLanguages\n siteName\n enabledFeatures\n }\n }\n";
|
|
6
6
|
export declare const CURRENT_WORKSPACE_QUERY = "\n query CurrentWorkspace {\n currentWorkspace {\n id\n name\n slug\n plan\n limits {\n maxPages\n maxUsers\n maxStorageMb\n maxAiTokensMonth\n maxWorkspacesOwned\n canUseCustomDomain\n canRemoveBranding\n canUseCustomScripts\n maxCustomBlocks\n maxCustomBlocksStorageMb\n }\n }\n }\n";
|
|
7
7
|
export declare const MEDIA_ASSETS_QUERY = "\n query MediaAssets($limit: Int, $offset: Int) {\n mediaAssets(limit: $limit, offset: $offset) {\n items {\n id\n url\n filename\n type\n mimeType\n size\n width\n height\n alt\n tags\n }\n total\n hasMore\n }\n }\n";
|
|
8
|
-
export declare const SAVE_PAGE_MUTATION = "\n mutation SavePage($input: SavePageInput!) {\n savePage(input: $input) {\n id\n name\n slug\n description\n displayName\n seoTitle\n seoDescription\n seoKeywords\n published\n
|
|
9
|
-
export declare const PATCH_BLOCK_CONTENT_MUTATION = "\n mutation PatchBlockContent($input: PatchBlockContentInput!) {\n patchBlockContent(input: $input) {\n id\n slug\n
|
|
10
|
-
export declare const UPDATE_PAGE_SETTINGS_MUTATION = "\n mutation UpdatePageSettings($input: UpdatePageSettingsInput!) {\n updatePageSettings(input: $input) {\n id\n name\n slug\n description\n displayName\n seoTitle\n seoDescription\n seoKeywords\n pageType\n parentId\n updatedAt\n }\n }\n";
|
|
11
|
-
export declare const TOGGLE_PUBLISH_MUTATION = "\n mutation TogglePublish($id: ID!) {\n togglePublish(id: $id) {\n id\n published\n publishedAt\n
|
|
12
|
-
export declare const PUBLISH_PAGE_MUTATION = "\n mutation PublishPage($id: ID!, $blocks: [BlockDataInput!]!) {\n publishPage(id: $id, blocks: $blocks) {\n id\n published\n publishedAt\n
|
|
13
|
-
export declare const REVERT_TO_PUBLISHED_MUTATION = "\n mutation RevertToPublished($id: ID!) {\n revertToPublished(id: $id) {\n id\n name\n slug\n
|
|
8
|
+
export declare const SAVE_PAGE_MUTATION = "\n mutation SavePage($input: SavePageInput!) {\n savePage(input: $input) {\n id\n name\n slug\n description\n displayName\n seoTitle\n seoDescription\n seoKeywords\n published\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n pageType\n parentId\n blocks {\n id\n type\n content\n settings\n style\n advanced\n translations\n defaultLanguage\n metadata {\n createdAt\n updatedAt\n createdBy\n version\n }\n blockVersion\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
9
|
+
export declare const PATCH_BLOCK_CONTENT_MUTATION = "\n mutation PatchBlockContent($input: PatchBlockContentInput!) {\n patchBlockContent(input: $input) {\n id\n slug\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n updatedAt\n }\n }\n";
|
|
10
|
+
export declare const UPDATE_PAGE_SETTINGS_MUTATION = "\n mutation UpdatePageSettings($input: UpdatePageSettingsInput!) {\n updatePageSettings(input: $input) {\n id\n name\n slug\n description\n displayName\n seoTitle\n seoDescription\n seoKeywords\n pageType\n parentId\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n updatedAt\n }\n }\n";
|
|
11
|
+
export declare const TOGGLE_PUBLISH_MUTATION = "\n mutation TogglePublish($id: ID!) {\n togglePublish(id: $id) {\n id\n slug\n published\n publishedAt\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n updatedAt\n }\n }\n";
|
|
12
|
+
export declare const PUBLISH_PAGE_MUTATION = "\n mutation PublishPage($id: ID!, $blocks: [BlockDataInput!]!) {\n publishPage(id: $id, blocks: $blocks) {\n id\n slug\n published\n publishedAt\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n updatedAt\n blocks {\n id\n type\n content\n settings\n style\n advanced\n translations\n defaultLanguage\n metadata {\n createdAt\n updatedAt\n createdBy\n version\n }\n blockVersion\n }\n }\n }\n";
|
|
13
|
+
export declare const REVERT_TO_PUBLISHED_MUTATION = "\n mutation RevertToPublished($id: ID!) {\n revertToPublished(id: $id) {\n id\n name\n slug\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n updatedAt\n blocks {\n id type content settings style advanced\n translations defaultLanguage blockVersion\n }\n }\n }\n";
|
|
14
14
|
export declare const REMOVE_PAGE_MUTATION = "\n mutation RemovePage($id: ID!) {\n removePage(id: $id)\n }\n";
|
|
15
|
-
export declare const UPDATE_PAGE_LAYOUT_MUTATION = "\n mutation UpdatePageLayout($input: UpdatePageLayoutInput!) {\n updatePageLayout(input: $input) {\n id\n layoutBlocks {\n id type position order isActive\n content settings style advanced\n translations defaultLanguage\n metadata { createdAt updatedAt createdBy version }\n blockVersion\n }\n layoutOverrides { position action blockId }\n inheritsLayout\n }\n }\n";
|
|
15
|
+
export declare const UPDATE_PAGE_LAYOUT_MUTATION = "\n mutation UpdatePageLayout($input: UpdatePageLayoutInput!) {\n updatePageLayout(input: $input) {\n id\n slug\n hasUnpublishedContentChanges\n hasUnpublishedLayoutChanges\n updatedAt\n layoutBlocks {\n id type position order isActive\n content settings style advanced\n translations defaultLanguage\n metadata { createdAt updatedAt createdBy version }\n blockVersion\n }\n layoutOverrides { position action blockId }\n inheritsLayout\n }\n }\n";
|
|
16
16
|
export declare const FORMS_QUERY = "\n query Forms($status: String, $skip: Int, $limit: Int) {\n forms(status: $status, skip: $skip, limit: $limit) {\n forms { \n id\n name\n slug\n description\n status\n fields {\n id name fieldType\n label placeholder helpText\n defaultValue\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n options { value label disabled }\n width order showIf\n }\n settings {\n actionType webhookUrl emailRecipients newsletterListId\n submitButtonLabel successMessage errorMessage\n redirectUrl enableCaptcha requireLogin\n saveSubmissions sendEmailNotification emailConfigurationId\n }\n submissionCount\n createdAt updatedAt createdBy updatedBy\n }\n total\n hasMore\n }\n }\n";
|
|
17
17
|
export declare const FORM_BY_ID_QUERY = "\n query Form($formId: ID!) {\n form(formId: $formId) {\n \n id\n name\n slug\n description\n status\n fields {\n id name fieldType\n label placeholder helpText\n defaultValue\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n options { value label disabled }\n width order showIf\n }\n settings {\n actionType webhookUrl emailRecipients newsletterListId\n submitButtonLabel successMessage errorMessage\n redirectUrl enableCaptcha requireLogin\n saveSubmissions sendEmailNotification emailConfigurationId\n }\n submissionCount\n createdAt updatedAt createdBy updatedBy\n\n }\n }\n";
|
|
18
18
|
export declare const FORM_SUBMISSIONS_QUERY = "\n query FormSubmissions($formId: ID, $status: String, $skip: Int, $limit: Int) {\n formSubmissions(formId: $formId, status: $status, skip: $skip, limit: $limit) {\n submissions {\n id formId formSlug data status\n ipAddress userAgent referrer customerId\n processedAt emailSent webhookSent createdAt\n }\n total\n hasMore\n }\n }\n";
|
|
@@ -22,4 +22,19 @@ export declare const UPDATE_FORM_MUTATION = "\n mutation UpdateForm($formId: ID
|
|
|
22
22
|
export declare const DELETE_FORM_MUTATION = "\n mutation DeleteForm($formId: ID!) {\n deleteForm(formId: $formId)\n }\n";
|
|
23
23
|
export declare const UPDATE_FORM_SUBMISSION_STATUS_MUTATION = "\n mutation UpdateFormSubmissionStatus($submissionId: ID!, $status: String!) {\n updateFormSubmissionStatus(submissionId: $submissionId, status: $status)\n }\n";
|
|
24
24
|
export declare const DELETE_FORM_SUBMISSION_MUTATION = "\n mutation DeleteFormSubmission($submissionId: ID!) {\n deleteFormSubmission(submissionId: $submissionId)\n }\n";
|
|
25
|
+
export declare const MODEL_DEFINITIONS_QUERY = "\n query ModelDefinitions {\n modelDefinitions {\n \n id\n workspaceId\n name\n slug\n description\n icon\n color\n displayField\n defaultSort { field direction }\n fields { \n key\n label\n type\n required\n description\n defaultValue\n options\n fields\n itemType\n itemFields\n relationTo\n relationType\n acceptedTypes\n multiple\n schemaProperty\n minLength\n maxLength\n minValue\n maxValue\n pattern\n }\n statusField {\n enabled\n values\n defaultValue\n transitions { from to }\n }\n createdAt\n updatedAt\n createdBy\n recordCount\n\n }\n }\n";
|
|
26
|
+
export declare const MODEL_DEFINITIONS_BY_SLUG_INDEX_QUERY = "\n query ModelDefinitionsSlugIndex {\n modelDefinitions {\n id\n slug\n }\n }\n";
|
|
27
|
+
export declare const MODEL_DEFINITION_BY_ID_QUERY = "\n query ModelDefinition($id: ID!) {\n modelDefinition(id: $id) {\n \n id\n workspaceId\n name\n slug\n description\n icon\n color\n displayField\n defaultSort { field direction }\n fields { \n key\n label\n type\n required\n description\n defaultValue\n options\n fields\n itemType\n itemFields\n relationTo\n relationType\n acceptedTypes\n multiple\n schemaProperty\n minLength\n maxLength\n minValue\n maxValue\n pattern\n }\n statusField {\n enabled\n values\n defaultValue\n transitions { from to }\n }\n createdAt\n updatedAt\n createdBy\n recordCount\n\n }\n }\n";
|
|
28
|
+
export declare const MODEL_RECORDS_QUERY = "\n query ModelRecords(\n $modelId: ID!\n $filter: JSON\n $limit: Int\n $offset: Int\n $sort: String\n $populate: [String!]\n ) {\n modelRecords(\n modelId: $modelId\n filter: $filter\n limit: $limit\n offset: $offset\n sort: $sort\n populate: $populate\n ) {\n items { \n id\n workspaceId\n modelId\n data\n status\n createdAt\n updatedAt\n createdBy\n updatedBy\n }\n total\n hasMore\n }\n }\n";
|
|
29
|
+
export declare const MODEL_RECORD_BY_ID_QUERY = "\n query ModelRecord($id: ID!) {\n modelRecord(id: $id) {\n \n id\n workspaceId\n modelId\n data\n status\n createdAt\n updatedAt\n createdBy\n updatedBy\n\n }\n }\n";
|
|
30
|
+
export declare const MODEL_TEMPLATES_QUERY = "\n query ModelTemplates {\n modelTemplates {\n id\n name\n description\n icon\n category\n models {\n name\n slug\n description\n icon\n fieldCount\n hasStatus\n }\n }\n }\n";
|
|
31
|
+
export declare const CREATE_MODEL_DEFINITION_MUTATION = "\n mutation CreateModelDefinition($input: CreateModelDefinitionInput!) {\n createModelDefinition(input: $input) {\n \n id\n workspaceId\n name\n slug\n description\n icon\n color\n displayField\n defaultSort { field direction }\n fields { \n key\n label\n type\n required\n description\n defaultValue\n options\n fields\n itemType\n itemFields\n relationTo\n relationType\n acceptedTypes\n multiple\n schemaProperty\n minLength\n maxLength\n minValue\n maxValue\n pattern\n }\n statusField {\n enabled\n values\n defaultValue\n transitions { from to }\n }\n createdAt\n updatedAt\n createdBy\n recordCount\n\n }\n }\n";
|
|
32
|
+
export declare const UPDATE_MODEL_DEFINITION_MUTATION = "\n mutation UpdateModelDefinition($input: UpdateModelDefinitionInput!) {\n updateModelDefinition(input: $input) {\n \n id\n workspaceId\n name\n slug\n description\n icon\n color\n displayField\n defaultSort { field direction }\n fields { \n key\n label\n type\n required\n description\n defaultValue\n options\n fields\n itemType\n itemFields\n relationTo\n relationType\n acceptedTypes\n multiple\n schemaProperty\n minLength\n maxLength\n minValue\n maxValue\n pattern\n }\n statusField {\n enabled\n values\n defaultValue\n transitions { from to }\n }\n createdAt\n updatedAt\n createdBy\n recordCount\n\n }\n }\n";
|
|
33
|
+
export declare const DELETE_MODEL_DEFINITION_MUTATION = "\n mutation DeleteModelDefinition($id: ID!) {\n deleteModelDefinition(id: $id)\n }\n";
|
|
34
|
+
export declare const CREATE_MODEL_RECORD_MUTATION = "\n mutation CreateModelRecord($input: CreateModelRecordInput!) {\n createModelRecord(input: $input) {\n \n id\n workspaceId\n modelId\n data\n status\n createdAt\n updatedAt\n createdBy\n updatedBy\n\n }\n }\n";
|
|
35
|
+
export declare const UPDATE_MODEL_RECORD_MUTATION = "\n mutation UpdateModelRecord($input: UpdateModelRecordInput!) {\n updateModelRecord(input: $input) {\n \n id\n workspaceId\n modelId\n data\n status\n createdAt\n updatedAt\n createdBy\n updatedBy\n\n }\n }\n";
|
|
36
|
+
export declare const UPDATE_MODEL_RECORD_STATUS_MUTATION = "\n mutation UpdateModelRecordStatus($input: UpdateModelRecordStatusInput!) {\n updateModelRecordStatus(input: $input) {\n \n id\n workspaceId\n modelId\n data\n status\n createdAt\n updatedAt\n createdBy\n updatedBy\n\n }\n }\n";
|
|
37
|
+
export declare const DELETE_MODEL_RECORD_MUTATION = "\n mutation DeleteModelRecord($id: ID!) {\n deleteModelRecord(id: $id)\n }\n";
|
|
38
|
+
export declare const IMPORT_MODEL_RECORDS_MUTATION = "\n mutation ImportModelRecords($input: ImportModelRecordsInput!) {\n importModelRecords(input: $input) {\n importedCount\n errors { row message }\n }\n }\n";
|
|
39
|
+
export declare const INSTALL_MODEL_TEMPLATE_MUTATION = "\n mutation InstallModelTemplate($templateId: String!) {\n installModelTemplate(templateId: $templateId) {\n templateId\n installedCount\n skippedSlugs\n }\n }\n";
|
|
25
40
|
//# sourceMappingURL=queries.d.ts.map
|
package/dist/queries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,qVAmBvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,ohDAwE5B,CAAC;AAIF,eAAO,MAAM,sBAAsB,QAkBlC,CAAC;AAEF,eAAO,MAAM,6BAA6B,QAkBzC,CAAC;AAIF,eAAO,MAAM,iBAAiB,2JAU7B,CAAC;AAIF,eAAO,MAAM,uBAAuB,6YAqBnC,CAAC;AAIF,eAAO,MAAM,kBAAkB,+TAmB9B,CAAC;AAIF,eAAO,MAAM,kBAAkB,yqBAqC9B,CAAC;AAOF,eAAO,MAAM,4BAA4B,0OAUxC,CAAC;AAEF,eAAO,MAAM,6BAA6B,wXAkBzC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yOAYnC,CAAC;AAEF,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ayName
|
|
12
12
|
published
|
|
13
13
|
publishedAt
|
|
14
|
-
|
|
14
|
+
hasUnpublishedContentChanges
|
|
15
|
+
hasUnpublishedLayoutChanges
|
|
15
16
|
pageType
|
|
16
17
|
parentId
|
|
17
18
|
order
|
|
@@ -33,7 +34,8 @@ export const PAGE_BY_ID_QUERY = `
|
|
|
33
34
|
seoKeywords
|
|
34
35
|
published
|
|
35
36
|
publishedAt
|
|
36
|
-
|
|
37
|
+
hasUnpublishedContentChanges
|
|
38
|
+
hasUnpublishedLayoutChanges
|
|
37
39
|
pageType
|
|
38
40
|
parentId
|
|
39
41
|
order
|
|
@@ -103,7 +105,7 @@ export const WORKSPACE_BLOCKS_QUERY = `
|
|
|
103
105
|
icon
|
|
104
106
|
category
|
|
105
107
|
layoutPosition
|
|
106
|
-
|
|
108
|
+
useClient
|
|
107
109
|
schemaFields {
|
|
108
110
|
${SCHEMA_FIELDS_FRAGMENT}
|
|
109
111
|
}
|
|
@@ -122,7 +124,7 @@ export const WORKSPACE_BLOCK_BY_TYPE_QUERY = `
|
|
|
122
124
|
icon
|
|
123
125
|
category
|
|
124
126
|
layoutPosition
|
|
125
|
-
|
|
127
|
+
useClient
|
|
126
128
|
schemaFields {
|
|
127
129
|
${SCHEMA_FIELDS_FRAGMENT}
|
|
128
130
|
}
|
|
@@ -200,7 +202,8 @@ export const SAVE_PAGE_MUTATION = `
|
|
|
200
202
|
seoDescription
|
|
201
203
|
seoKeywords
|
|
202
204
|
published
|
|
203
|
-
|
|
205
|
+
hasUnpublishedContentChanges
|
|
206
|
+
hasUnpublishedLayoutChanges
|
|
204
207
|
pageType
|
|
205
208
|
parentId
|
|
206
209
|
blocks {
|
|
@@ -235,7 +238,8 @@ export const PATCH_BLOCK_CONTENT_MUTATION = `
|
|
|
235
238
|
patchBlockContent(input: $input) {
|
|
236
239
|
id
|
|
237
240
|
slug
|
|
238
|
-
|
|
241
|
+
hasUnpublishedContentChanges
|
|
242
|
+
hasUnpublishedLayoutChanges
|
|
239
243
|
updatedAt
|
|
240
244
|
}
|
|
241
245
|
}
|
|
@@ -253,6 +257,8 @@ export const UPDATE_PAGE_SETTINGS_MUTATION = `
|
|
|
253
257
|
seoKeywords
|
|
254
258
|
pageType
|
|
255
259
|
parentId
|
|
260
|
+
hasUnpublishedContentChanges
|
|
261
|
+
hasUnpublishedLayoutChanges
|
|
256
262
|
updatedAt
|
|
257
263
|
}
|
|
258
264
|
}
|
|
@@ -261,9 +267,12 @@ export const TOGGLE_PUBLISH_MUTATION = `
|
|
|
261
267
|
mutation TogglePublish($id: ID!) {
|
|
262
268
|
togglePublish(id: $id) {
|
|
263
269
|
id
|
|
270
|
+
slug
|
|
264
271
|
published
|
|
265
272
|
publishedAt
|
|
266
|
-
|
|
273
|
+
hasUnpublishedContentChanges
|
|
274
|
+
hasUnpublishedLayoutChanges
|
|
275
|
+
updatedAt
|
|
267
276
|
}
|
|
268
277
|
}
|
|
269
278
|
`;
|
|
@@ -271,9 +280,12 @@ export const PUBLISH_PAGE_MUTATION = `
|
|
|
271
280
|
mutation PublishPage($id: ID!, $blocks: [BlockDataInput!]!) {
|
|
272
281
|
publishPage(id: $id, blocks: $blocks) {
|
|
273
282
|
id
|
|
283
|
+
slug
|
|
274
284
|
published
|
|
275
285
|
publishedAt
|
|
276
|
-
|
|
286
|
+
hasUnpublishedContentChanges
|
|
287
|
+
hasUnpublishedLayoutChanges
|
|
288
|
+
updatedAt
|
|
277
289
|
blocks {
|
|
278
290
|
id
|
|
279
291
|
type
|
|
@@ -300,7 +312,9 @@ export const REVERT_TO_PUBLISHED_MUTATION = `
|
|
|
300
312
|
id
|
|
301
313
|
name
|
|
302
314
|
slug
|
|
303
|
-
|
|
315
|
+
hasUnpublishedContentChanges
|
|
316
|
+
hasUnpublishedLayoutChanges
|
|
317
|
+
updatedAt
|
|
304
318
|
blocks {
|
|
305
319
|
id type content settings style advanced
|
|
306
320
|
translations defaultLanguage blockVersion
|
|
@@ -317,6 +331,10 @@ export const UPDATE_PAGE_LAYOUT_MUTATION = `
|
|
|
317
331
|
mutation UpdatePageLayout($input: UpdatePageLayoutInput!) {
|
|
318
332
|
updatePageLayout(input: $input) {
|
|
319
333
|
id
|
|
334
|
+
slug
|
|
335
|
+
hasUnpublishedContentChanges
|
|
336
|
+
hasUnpublishedLayoutChanges
|
|
337
|
+
updatedAt
|
|
320
338
|
layoutBlocks {
|
|
321
339
|
id type position order isActive
|
|
322
340
|
content settings style advanced
|
|
@@ -421,4 +439,200 @@ export const DELETE_FORM_SUBMISSION_MUTATION = `
|
|
|
421
439
|
deleteFormSubmission(submissionId: $submissionId)
|
|
422
440
|
}
|
|
423
441
|
`;
|
|
442
|
+
// ─── Model Queries ───────────────────────────────────────────
|
|
443
|
+
// PropertyField is self-recursive (fields/itemFields are JSON on the wire
|
|
444
|
+
// to avoid infinite schema recursion). Keep this in sync with page-type.ts
|
|
445
|
+
// resolver's PropertyField object type.
|
|
446
|
+
const PROPERTY_FIELD_FRAGMENT = `
|
|
447
|
+
key
|
|
448
|
+
label
|
|
449
|
+
type
|
|
450
|
+
required
|
|
451
|
+
description
|
|
452
|
+
defaultValue
|
|
453
|
+
options
|
|
454
|
+
fields
|
|
455
|
+
itemType
|
|
456
|
+
itemFields
|
|
457
|
+
relationTo
|
|
458
|
+
relationType
|
|
459
|
+
acceptedTypes
|
|
460
|
+
multiple
|
|
461
|
+
schemaProperty
|
|
462
|
+
minLength
|
|
463
|
+
maxLength
|
|
464
|
+
minValue
|
|
465
|
+
maxValue
|
|
466
|
+
pattern
|
|
467
|
+
`;
|
|
468
|
+
const MODEL_DEFINITION_FRAGMENT = `
|
|
469
|
+
id
|
|
470
|
+
workspaceId
|
|
471
|
+
name
|
|
472
|
+
slug
|
|
473
|
+
description
|
|
474
|
+
icon
|
|
475
|
+
color
|
|
476
|
+
displayField
|
|
477
|
+
defaultSort { field direction }
|
|
478
|
+
fields { ${PROPERTY_FIELD_FRAGMENT} }
|
|
479
|
+
statusField {
|
|
480
|
+
enabled
|
|
481
|
+
values
|
|
482
|
+
defaultValue
|
|
483
|
+
transitions { from to }
|
|
484
|
+
}
|
|
485
|
+
createdAt
|
|
486
|
+
updatedAt
|
|
487
|
+
createdBy
|
|
488
|
+
recordCount
|
|
489
|
+
`;
|
|
490
|
+
const MODEL_RECORD_FRAGMENT = `
|
|
491
|
+
id
|
|
492
|
+
workspaceId
|
|
493
|
+
modelId
|
|
494
|
+
data
|
|
495
|
+
status
|
|
496
|
+
createdAt
|
|
497
|
+
updatedAt
|
|
498
|
+
createdBy
|
|
499
|
+
updatedBy
|
|
500
|
+
`;
|
|
501
|
+
export const MODEL_DEFINITIONS_QUERY = `
|
|
502
|
+
query ModelDefinitions {
|
|
503
|
+
modelDefinitions {
|
|
504
|
+
${MODEL_DEFINITION_FRAGMENT}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
`;
|
|
508
|
+
// Lightweight companion to MODEL_DEFINITIONS_QUERY: used by get_model's
|
|
509
|
+
// slug fallback to avoid pulling full field schemas for every model when
|
|
510
|
+
// all we need is the id for a follow-up lookup.
|
|
511
|
+
export const MODEL_DEFINITIONS_BY_SLUG_INDEX_QUERY = `
|
|
512
|
+
query ModelDefinitionsSlugIndex {
|
|
513
|
+
modelDefinitions {
|
|
514
|
+
id
|
|
515
|
+
slug
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
`;
|
|
519
|
+
export const MODEL_DEFINITION_BY_ID_QUERY = `
|
|
520
|
+
query ModelDefinition($id: ID!) {
|
|
521
|
+
modelDefinition(id: $id) {
|
|
522
|
+
${MODEL_DEFINITION_FRAGMENT}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
`;
|
|
526
|
+
export const MODEL_RECORDS_QUERY = `
|
|
527
|
+
query ModelRecords(
|
|
528
|
+
$modelId: ID!
|
|
529
|
+
$filter: JSON
|
|
530
|
+
$limit: Int
|
|
531
|
+
$offset: Int
|
|
532
|
+
$sort: String
|
|
533
|
+
$populate: [String!]
|
|
534
|
+
) {
|
|
535
|
+
modelRecords(
|
|
536
|
+
modelId: $modelId
|
|
537
|
+
filter: $filter
|
|
538
|
+
limit: $limit
|
|
539
|
+
offset: $offset
|
|
540
|
+
sort: $sort
|
|
541
|
+
populate: $populate
|
|
542
|
+
) {
|
|
543
|
+
items { ${MODEL_RECORD_FRAGMENT} }
|
|
544
|
+
total
|
|
545
|
+
hasMore
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
`;
|
|
549
|
+
export const MODEL_RECORD_BY_ID_QUERY = `
|
|
550
|
+
query ModelRecord($id: ID!) {
|
|
551
|
+
modelRecord(id: $id) {
|
|
552
|
+
${MODEL_RECORD_FRAGMENT}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
`;
|
|
556
|
+
export const MODEL_TEMPLATES_QUERY = `
|
|
557
|
+
query ModelTemplates {
|
|
558
|
+
modelTemplates {
|
|
559
|
+
id
|
|
560
|
+
name
|
|
561
|
+
description
|
|
562
|
+
icon
|
|
563
|
+
category
|
|
564
|
+
models {
|
|
565
|
+
name
|
|
566
|
+
slug
|
|
567
|
+
description
|
|
568
|
+
icon
|
|
569
|
+
fieldCount
|
|
570
|
+
hasStatus
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
`;
|
|
575
|
+
// ─── Model Mutations ─────────────────────────────────────────
|
|
576
|
+
export const CREATE_MODEL_DEFINITION_MUTATION = `
|
|
577
|
+
mutation CreateModelDefinition($input: CreateModelDefinitionInput!) {
|
|
578
|
+
createModelDefinition(input: $input) {
|
|
579
|
+
${MODEL_DEFINITION_FRAGMENT}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
`;
|
|
583
|
+
export const UPDATE_MODEL_DEFINITION_MUTATION = `
|
|
584
|
+
mutation UpdateModelDefinition($input: UpdateModelDefinitionInput!) {
|
|
585
|
+
updateModelDefinition(input: $input) {
|
|
586
|
+
${MODEL_DEFINITION_FRAGMENT}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
`;
|
|
590
|
+
export const DELETE_MODEL_DEFINITION_MUTATION = `
|
|
591
|
+
mutation DeleteModelDefinition($id: ID!) {
|
|
592
|
+
deleteModelDefinition(id: $id)
|
|
593
|
+
}
|
|
594
|
+
`;
|
|
595
|
+
export const CREATE_MODEL_RECORD_MUTATION = `
|
|
596
|
+
mutation CreateModelRecord($input: CreateModelRecordInput!) {
|
|
597
|
+
createModelRecord(input: $input) {
|
|
598
|
+
${MODEL_RECORD_FRAGMENT}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
`;
|
|
602
|
+
export const UPDATE_MODEL_RECORD_MUTATION = `
|
|
603
|
+
mutation UpdateModelRecord($input: UpdateModelRecordInput!) {
|
|
604
|
+
updateModelRecord(input: $input) {
|
|
605
|
+
${MODEL_RECORD_FRAGMENT}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
`;
|
|
609
|
+
export const UPDATE_MODEL_RECORD_STATUS_MUTATION = `
|
|
610
|
+
mutation UpdateModelRecordStatus($input: UpdateModelRecordStatusInput!) {
|
|
611
|
+
updateModelRecordStatus(input: $input) {
|
|
612
|
+
${MODEL_RECORD_FRAGMENT}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
`;
|
|
616
|
+
export const DELETE_MODEL_RECORD_MUTATION = `
|
|
617
|
+
mutation DeleteModelRecord($id: ID!) {
|
|
618
|
+
deleteModelRecord(id: $id)
|
|
619
|
+
}
|
|
620
|
+
`;
|
|
621
|
+
export const IMPORT_MODEL_RECORDS_MUTATION = `
|
|
622
|
+
mutation ImportModelRecords($input: ImportModelRecordsInput!) {
|
|
623
|
+
importModelRecords(input: $input) {
|
|
624
|
+
importedCount
|
|
625
|
+
errors { row message }
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
`;
|
|
629
|
+
export const INSTALL_MODEL_TEMPLATE_MUTATION = `
|
|
630
|
+
mutation InstallModelTemplate($templateId: String!) {
|
|
631
|
+
installModelTemplate(templateId: $templateId) {
|
|
632
|
+
templateId
|
|
633
|
+
installedCount
|
|
634
|
+
skippedSlugs
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
`;
|
|
424
638
|
//# sourceMappingURL=queries.js.map
|
package/dist/queries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,sBAAsB,GAAG,0BAA0B,EAAE,CAAC;AAE5D,gEAAgE;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,sBAAsB,GAAG,0BAA0B,EAAE,CAAC;AAE5D,gEAAgE;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;CAmB1B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE/B,CAAC;AAEF,gEAAgE;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;UAY5B,sBAAsB;;;;;;CAM/B,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG;;;;;;;;;;;;UAYnC,sBAAsB;;;;;;CAM/B,CAAC;AAEF,gEAAgE;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;CAUhC,CAAC;AAEF,gEAAgE;AAEhE,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBtC,CAAC;AAEF,gEAAgE;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAG;;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qB;;;CAG5B,CAAC;AAEF,MAAM,CAAC,MAAM,mCAAmC,GAAG;;;QAG3C,qBAAqB;;;CAG5B,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG;;;;;;;CAO5C,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;;;;;CAQ9C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const responseModeSchema: z.ZodDefault<z.ZodOptional<z.ZodEnum<["minimal", "full"]>>>;
|
|
3
|
+
export type ResponseMode = "minimal" | "full";
|
|
4
|
+
interface PageLike {
|
|
5
|
+
id: string;
|
|
6
|
+
slug?: string | null;
|
|
7
|
+
hasUnpublishedContentChanges?: boolean | null;
|
|
8
|
+
hasUnpublishedLayoutChanges?: boolean | null;
|
|
9
|
+
updatedAt?: string | null;
|
|
10
|
+
published?: boolean | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PageMinimal {
|
|
13
|
+
id: string;
|
|
14
|
+
slug?: string;
|
|
15
|
+
hasUnpublishedChanges?: boolean;
|
|
16
|
+
updatedAt?: string;
|
|
17
|
+
published?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function pageMinimal(page: PageLike, extras?: {
|
|
20
|
+
published?: boolean;
|
|
21
|
+
}): PageMinimal;
|
|
22
|
+
export interface PageBlockMinimal {
|
|
23
|
+
pageId: string;
|
|
24
|
+
blockId: string;
|
|
25
|
+
hasUnpublishedChanges?: boolean;
|
|
26
|
+
updatedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function pageBlockMinimal(page: PageLike, blockId: string): PageBlockMinimal;
|
|
29
|
+
interface FormLike {
|
|
30
|
+
id: string;
|
|
31
|
+
slug?: string | null;
|
|
32
|
+
status?: string | null;
|
|
33
|
+
updatedAt?: string | null;
|
|
34
|
+
}
|
|
35
|
+
export interface FormMinimal {
|
|
36
|
+
id: string;
|
|
37
|
+
slug?: string;
|
|
38
|
+
status?: string;
|
|
39
|
+
updatedAt?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function formMinimal(form: FormLike): FormMinimal;
|
|
42
|
+
interface ModelLike {
|
|
43
|
+
id: string;
|
|
44
|
+
slug?: string | null;
|
|
45
|
+
updatedAt?: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface ModelMinimal {
|
|
48
|
+
id: string;
|
|
49
|
+
slug?: string;
|
|
50
|
+
updatedAt?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function modelMinimal(model: ModelLike): ModelMinimal;
|
|
53
|
+
interface RecordLike {
|
|
54
|
+
id: string;
|
|
55
|
+
status?: string | null;
|
|
56
|
+
updatedAt?: string | null;
|
|
57
|
+
}
|
|
58
|
+
export interface RecordMinimal {
|
|
59
|
+
id: string;
|
|
60
|
+
status?: string;
|
|
61
|
+
updatedAt?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function recordMinimal(record: RecordLike): RecordMinimal;
|
|
64
|
+
export declare function jsonText<T>(mode: ResponseMode, full: T, toMinimal: (full: T) => unknown): {
|
|
65
|
+
content: Array<{
|
|
66
|
+
type: "text";
|
|
67
|
+
text: string;
|
|
68
|
+
}>;
|
|
69
|
+
};
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../src/responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kBAAkB,6DAM5B,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9C,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4BAA4B,CAAC,EAAE,OAAO,GAAG,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AC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAK3D;AAED,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAK/D;AAOD,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAC9B;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAQpD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// `response: "minimal"` is the default starting in 0.6.0 to keep agent
|
|
3
|
+
// context windows from being eaten by echoed page/block content.
|
|
4
|
+
// Pass "full" only when the caller actually needs the post-write state
|
|
5
|
+
// inline; otherwise issue a follow-up read tool call.
|
|
6
|
+
export const responseModeSchema = z
|
|
7
|
+
.enum(["minimal", "full"])
|
|
8
|
+
.optional()
|
|
9
|
+
.default("minimal")
|
|
10
|
+
.describe("Response shape. 'minimal' (default) returns a small ack (~200 bytes). 'full' returns the full mutation response.");
|
|
11
|
+
// The backend split the single dirty flag into per-axis flags (content
|
|
12
|
+
// vs layout). The MCP ack keeps a single `hasUnpublishedChanges` for a
|
|
13
|
+
// stable external shape: true when either axis has unpublished changes.
|
|
14
|
+
function combinedUnpublished(page) {
|
|
15
|
+
const c = page.hasUnpublishedContentChanges;
|
|
16
|
+
const l = page.hasUnpublishedLayoutChanges;
|
|
17
|
+
if (c == null && l == null)
|
|
18
|
+
return undefined;
|
|
19
|
+
return Boolean(c) || Boolean(l);
|
|
20
|
+
}
|
|
21
|
+
export function pageMinimal(page, extras) {
|
|
22
|
+
const out = { id: page.id };
|
|
23
|
+
if (page.slug != null)
|
|
24
|
+
out.slug = page.slug;
|
|
25
|
+
const unpublished = combinedUnpublished(page);
|
|
26
|
+
if (unpublished != null)
|
|
27
|
+
out.hasUnpublishedChanges = unpublished;
|
|
28
|
+
if (page.updatedAt != null)
|
|
29
|
+
out.updatedAt = page.updatedAt;
|
|
30
|
+
// `published` is only emitted when the caller explicitly requests it —
|
|
31
|
+
// i.e. publish_page / unpublish_page. Other mutations (savePage etc.)
|
|
32
|
+
// may echo `published` as part of their selection set, but including it
|
|
33
|
+
// in the minimal ack would make the shape depend on which mutation
|
|
34
|
+
// served the request. Keeping it opt-in keeps the minimal schema stable.
|
|
35
|
+
if (extras?.published !== undefined)
|
|
36
|
+
out.published = extras.published;
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
export function pageBlockMinimal(page, blockId) {
|
|
40
|
+
const out = { pageId: page.id, blockId };
|
|
41
|
+
const unpublished = combinedUnpublished(page);
|
|
42
|
+
if (unpublished != null)
|
|
43
|
+
out.hasUnpublishedChanges = unpublished;
|
|
44
|
+
if (page.updatedAt != null)
|
|
45
|
+
out.updatedAt = page.updatedAt;
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
export function formMinimal(form) {
|
|
49
|
+
const out = { id: form.id };
|
|
50
|
+
if (form.slug != null)
|
|
51
|
+
out.slug = form.slug;
|
|
52
|
+
if (form.status != null)
|
|
53
|
+
out.status = form.status;
|
|
54
|
+
if (form.updatedAt != null)
|
|
55
|
+
out.updatedAt = form.updatedAt;
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
export function modelMinimal(model) {
|
|
59
|
+
const out = { id: model.id };
|
|
60
|
+
if (model.slug != null)
|
|
61
|
+
out.slug = model.slug;
|
|
62
|
+
if (model.updatedAt != null)
|
|
63
|
+
out.updatedAt = model.updatedAt;
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
export function recordMinimal(record) {
|
|
67
|
+
const out = { id: record.id };
|
|
68
|
+
if (record.status != null)
|
|
69
|
+
out.status = record.status;
|
|
70
|
+
if (record.updatedAt != null)
|
|
71
|
+
out.updatedAt = record.updatedAt;
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
// Tiny wrapper so call sites stay one-liners instead of repeating
|
|
75
|
+
// `JSON.stringify(mode === "full" ? data : minimal(data), ...)`.
|
|
76
|
+
// Minimal mode emits compact JSON - the whole point is keeping the ack
|
|
77
|
+
// small, and pretty-print whitespace was eating ~25-40% of the payload.
|
|
78
|
+
// Full mode keeps pretty-print for human-readable debugging.
|
|
79
|
+
export function jsonText(mode, full, toMinimal) {
|
|
80
|
+
const text = mode === "full"
|
|
81
|
+
? JSON.stringify(full, null, 2)
|
|
82
|
+
: JSON.stringify(toMinimal(full));
|
|
83
|
+
return {
|
|
84
|
+
content: [{ type: "text", text }],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../src/responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uEAAuE;AACvE,iEAAiE;AACjE,uEAAuE;AACvE,sDAAsD;AACtD,MAAM,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AC7C,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI;QAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACtD,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI;QAAE,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IAC/D,OAAO,GAAG,CAAC;AACb,CAAC;AAED,kEAAkE;AAClE,iEAAiE;AACjE,uEAAuE;AACvE,wEAAwE;AACxE,6DAA6D;AAC7D,MAAM,UAAU,QAAQ,CACtB,IAAkB,EAClB,IAAO,EACP,SAA+B;IAE/B,MAAM,IAAI,GACR,IAAI,KAAK,MAAM;QACb,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA2FlD,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,aAo4E/C"}
|