suppa-mcp-2 1.40.2 → 1.40.3
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/dist/tools/entity.js +12 -1
- package/package.json +1 -1
package/dist/tools/entity.js
CHANGED
|
@@ -1736,6 +1736,15 @@ export async function buildFieldDef(entityName, fieldName, fieldType, title, opt
|
|
|
1736
1736
|
notApplicable.push(`defaultValue was NOT set: it does not apply to a unique field. The field was created ` +
|
|
1737
1737
|
"WITHOUT a default.");
|
|
1738
1738
|
}
|
|
1739
|
+
else if (defaultValue !== null && defaultValue !== undefined) {
|
|
1740
|
+
// The caller passed something that carries no value — "", " ", or []. The update path
|
|
1741
|
+
// REFUSES this outright; this path used to drop it without a word, which is the silent drop
|
|
1742
|
+
// the comment above says was already fixed for notNull and unique. Reporting it keeps the two
|
|
1743
|
+
// paths telling the caller the same thing about the same input.
|
|
1744
|
+
notApplicable.push(`defaultValue was NOT set: ${Array.isArray(defaultValue) ? "an empty array" : JSON.stringify(String(defaultValue))} carries no value, and the builder rejects one — suppa_update_field refuses the same input ` +
|
|
1745
|
+
"outright. The field was created WITHOUT a default. Pass the value every row without an " +
|
|
1746
|
+
'explicit one gets ("0", "\'draft\'", "now()"), or omit default_value.');
|
|
1747
|
+
}
|
|
1739
1748
|
// Sent exactly as validated: subTypeProblem() judged the TRIMMED value, and
|
|
1740
1749
|
// ' date ' used to pass that check and then go out with the spaces.
|
|
1741
1750
|
if (typeof subType === "string" && subType.trim() !== "") {
|
|
@@ -2020,8 +2029,10 @@ export async function updateField(entityName, fieldName, opts = {}) {
|
|
|
2020
2029
|
// Same rule as add-fields: an empty string is not a default and the builder
|
|
2021
2030
|
// rejects it. It used to be sent here verbatim.
|
|
2022
2031
|
if (String(opts.defaultValue).trim() === "") {
|
|
2032
|
+
// `[]` stringifies to "" too, and calling it "an empty string" names the wrong problem.
|
|
2033
|
+
const what = Array.isArray(opts.defaultValue) ? "an empty array" : "an empty string";
|
|
2023
2034
|
return jsonResponse({
|
|
2024
|
-
error: `Refused: default_value is
|
|
2035
|
+
error: `Refused: default_value is ${what} — that is not a default, and the builder ` +
|
|
2025
2036
|
`rejects one on '${entityName}.${fieldName}' just as it does on add-fields. Nothing was ` +
|
|
2026
2037
|
"sent. Pass the value every row without an explicit one gets (\"0\", \"'draft'\", " +
|
|
2027
2038
|
'"now()"), or omit default_value to leave the current default as it is.',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suppa-mcp-2",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.3",
|
|
4
4
|
"description": "MCP server for the Suppa platform (modern.suppa.me) — Tasks, Docs/Pages, Entities & Schema, Forms, Automations, and file attachments, with multi-tenant Google auth. Node port of PyPI suppa-mcp.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|