multisite-cms-mcp 1.5.11 → 1.5.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-field-types.d.ts","sourceRoot":"","sources":["../../src/tools/get-field-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAqE5C,CAAC;AAEF;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"get-field-types.d.ts","sourceRoot":"","sources":["../../src/tools/get-field-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAqE5C,CAAC;AAEF;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAqDrD"}
|
|
@@ -69,13 +69,13 @@ exports.AVAILABLE_FIELD_TYPES = [
|
|
|
69
69
|
{
|
|
70
70
|
value: 'select',
|
|
71
71
|
label: 'Select',
|
|
72
|
-
description: 'Dropdown with predefined options. Requires "options" parameter
|
|
72
|
+
description: 'Dropdown with predefined options. Requires "options" parameter: comma-separated string like "Option1, Option2, Option3".',
|
|
73
73
|
requiresOptions: true,
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
value: 'multiSelect',
|
|
77
77
|
label: 'Multi-Select',
|
|
78
|
-
description: 'Multiple selections from options. Requires "options" parameter
|
|
78
|
+
description: 'Multiple selections from options. Requires "options" parameter: comma-separated string like "Tag1, Tag2, Tag3".',
|
|
79
79
|
requiresOptions: true,
|
|
80
80
|
},
|
|
81
81
|
{
|
|
@@ -122,11 +122,23 @@ When calling \`sync_schema\` to add fields, specify the \`type\` parameter:
|
|
|
122
122
|
"fields": [
|
|
123
123
|
{ "slug": "heroImage", "name": "Hero Image", "type": "image" },
|
|
124
124
|
{ "slug": "featured", "name": "Featured", "type": "boolean" },
|
|
125
|
-
{ "slug": "category", "name": "Category", "type": "select", "options": "Tech,Business,Lifestyle" }
|
|
125
|
+
{ "slug": "category", "name": "Category", "type": "select", "options": "Tech, Business, Lifestyle" },
|
|
126
|
+
{ "slug": "tags", "name": "Tags", "type": "multiSelect", "options": "Featured, Popular, New, Sale" },
|
|
127
|
+
{ "slug": "author", "name": "Author", "type": "relation", "referenceCollection": "authors" }
|
|
126
128
|
]
|
|
127
129
|
}
|
|
128
130
|
]
|
|
129
131
|
}
|
|
130
132
|
\`\`\`
|
|
133
|
+
|
|
134
|
+
## Select/MultiSelect Options Format
|
|
135
|
+
|
|
136
|
+
For **select** and **multiSelect** fields, provide options as a comma-separated string:
|
|
137
|
+
|
|
138
|
+
✅ CORRECT: \`"options": "Red, Green, Blue"\`
|
|
139
|
+
✅ CORRECT: \`"options": "Option1,Option2,Option3"\`
|
|
140
|
+
|
|
141
|
+
❌ WRONG: \`"options": ["Red", "Green", "Blue"]\` (Don't use JSON array)
|
|
142
|
+
❌ WRONG: \`"options": "\\"Red,Green,Blue\\""\` (Don't wrap in extra quotes)
|
|
131
143
|
`;
|
|
132
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-schema.d.ts","sourceRoot":"","sources":["../../src/tools/sync-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,UAAU,WAAW;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"sync-schema.d.ts","sourceRoot":"","sources":["../../src/tools/sync-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,UAAU,WAAW;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;CAC7B;AA2KD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA8VxE"}
|
|
@@ -23,6 +23,32 @@ This tool requires authentication to create collections and fields.
|
|
|
23
23
|
Use \`list_projects\` to verify your authentication status.
|
|
24
24
|
`;
|
|
25
25
|
// ============ Helper Functions ============
|
|
26
|
+
/**
|
|
27
|
+
* Normalize select/multiSelect options to array format before sending to API.
|
|
28
|
+
* Handles comma-separated strings and converts to JSON array.
|
|
29
|
+
*/
|
|
30
|
+
function normalizeOptionsForApi(options, fieldType) {
|
|
31
|
+
if (!options)
|
|
32
|
+
return undefined;
|
|
33
|
+
// Only process select/multiSelect fields
|
|
34
|
+
if (fieldType !== 'select' && fieldType !== 'multiSelect') {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
// If it already looks like a JSON array, validate and return
|
|
38
|
+
if (options.startsWith('[')) {
|
|
39
|
+
try {
|
|
40
|
+
const parsed = JSON.parse(options);
|
|
41
|
+
if (Array.isArray(parsed))
|
|
42
|
+
return options;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Invalid JSON, fall through to comma-separated handling
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Convert comma-separated string to JSON array
|
|
49
|
+
const arr = options.split(',').map(s => s.trim()).filter(Boolean);
|
|
50
|
+
return JSON.stringify(arr);
|
|
51
|
+
}
|
|
26
52
|
/**
|
|
27
53
|
* Validate a field type against available types
|
|
28
54
|
*/
|
|
@@ -315,6 +341,8 @@ ${resolved.error}
|
|
|
315
341
|
skipped.fields++;
|
|
316
342
|
continue;
|
|
317
343
|
}
|
|
344
|
+
// Normalize options for select/multiSelect fields before sending
|
|
345
|
+
const normalizedOptions = normalizeOptionsForApi(job.field.options, job.field.type);
|
|
318
346
|
// Create the field with retry logic
|
|
319
347
|
let fieldRes = await (0, api_client_1.apiRequest)(`/api/collections/${collectionId}/fields`, {
|
|
320
348
|
tenantId,
|
|
@@ -325,7 +353,7 @@ ${resolved.error}
|
|
|
325
353
|
type: job.field.type,
|
|
326
354
|
description: job.field.description,
|
|
327
355
|
isRequired: job.field.isRequired,
|
|
328
|
-
options:
|
|
356
|
+
options: normalizedOptions,
|
|
329
357
|
referenceCollection: job.field.referenceCollection,
|
|
330
358
|
},
|
|
331
359
|
});
|
|
@@ -342,7 +370,7 @@ ${resolved.error}
|
|
|
342
370
|
type: job.field.type,
|
|
343
371
|
description: job.field.description,
|
|
344
372
|
isRequired: job.field.isRequired,
|
|
345
|
-
options:
|
|
373
|
+
options: normalizedOptions,
|
|
346
374
|
referenceCollection: job.field.referenceCollection,
|
|
347
375
|
},
|
|
348
376
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "multisite-cms-mcp",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.12",
|
|
4
4
|
"description": "MCP server for Fast Mode CMS. Convert websites, validate packages, and deploy directly to Fast Mode. Includes authentication, project creation, schema sync, and one-click deployment.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|