suppa-mcp-2 1.42.5 → 1.42.6
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/LICENSE +21 -21
- package/dist/server.js +5 -3
- package/dist/tools/automation.js +68 -20
- package/package.json +1 -1
- package/skills/suppa-entity-code/references/registration.md +274 -274
- package/skills/suppa-entity-code/references/seeds.md +173 -173
- package/skills/suppa-entity-code/references/v1-mapping.md +102 -102
- package/skills/suppa-entity-code/templates/entity.template.ts +125 -125
- package/skills/suppa-entity-code/templates/seed.template.ts +61 -61
- package/skills/suppa-entity-code/templates/tabular-part.template.ts +101 -101
- package/skills/suppa-form-v2/scripts/widget-code.mjs +449 -449
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Andrii Herasymchuk
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrii Herasymchuk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/server.js
CHANGED
|
@@ -2076,9 +2076,11 @@ export function buildToolTable() {
|
|
|
2076
2076
|
reg("suppa_create_automation", {
|
|
2077
2077
|
description: "Create a DRAFT automation workflow (AutomationWorkflow). Writes only draft\n" +
|
|
2078
2078
|
" columns (name/nodes/connections/settings) with isActive=false — it is NOT live\n" +
|
|
2079
|
-
" until published (suppa_publish_automation). Runs pre-flight validation (
|
|
2080
|
-
" trigger
|
|
2081
|
-
"
|
|
2079
|
+
" until published (suppa_publish_automation). Runs pre-flight validation (at least\n" +
|
|
2080
|
+
" one trigger — triggerEntity, triggerManual, triggerWebhook, triggerSchedule,\n" +
|
|
2081
|
+
" formSubmission or any the live catalog lists; several are allowed, in any position —\n" +
|
|
2082
|
+
" unique node ids, connections reference known nodes, DAG, trigger and suppa node\n" +
|
|
2083
|
+
" params); on failure nothing is written and the errors are returned.",
|
|
2082
2084
|
inputSchema: {
|
|
2083
2085
|
name: z.string().describe("Automation name."),
|
|
2084
2086
|
nodes_json: z
|
package/dist/tools/automation.js
CHANGED
|
@@ -826,14 +826,40 @@ export async function searchEntities(query, limit = 20) {
|
|
|
826
826
|
// hasUnpublishedChanges/triggerEntityName) are NEVER written here — publishing
|
|
827
827
|
// promotes the draft into those via the automation-service.
|
|
828
828
|
// ===========================================================================
|
|
829
|
-
// Trigger node types
|
|
830
|
-
// `trigger
|
|
829
|
+
// Trigger node types — the live catalog's category 'trigger' (GET /api/automation/nodes on dev,
|
|
830
|
+
// 2026-10-15) plus `trigger`, the legacy/abstract type kept for backward compatibility. The builder's
|
|
831
|
+
// own test is the same: category 'trigger', else the `trigger` prefix (FE workflowBuilder/
|
|
832
|
+
// testRunWaiting.ts isTriggerNodeType) — formSubmission carries no prefix, which is how it was missed.
|
|
833
|
+
// A workflow needs at least one. It may have several (the builder saves drafts with two and three),
|
|
834
|
+
// and one need not be the first node: array order is not graph order — a PUBLISHED version on dev
|
|
835
|
+
// (workflow 8) carries its trigger as the fifth node. Until 1.42.5 this refused both.
|
|
831
836
|
const _TRIGGER_TYPES = new Set([
|
|
832
837
|
"triggerEntity",
|
|
833
838
|
"triggerManual",
|
|
834
839
|
"triggerWebhook",
|
|
840
|
+
"triggerSchedule",
|
|
841
|
+
"formSubmission",
|
|
835
842
|
"trigger",
|
|
836
843
|
]);
|
|
844
|
+
const _isTriggerType = (type, extra) => _TRIGGER_TYPES.has(type) || extra.has(type) || type.startsWith("trigger");
|
|
845
|
+
/**
|
|
846
|
+
* The trigger types the tenant's live catalog lists beyond the known ones — a trigger type added to
|
|
847
|
+
* the automation-service is then accepted without a new release. Best-effort: an older build without
|
|
848
|
+
* the catalog, or a catalog that cannot be read, adds nothing.
|
|
849
|
+
*/
|
|
850
|
+
async function _catalogTriggerTypes() {
|
|
851
|
+
try {
|
|
852
|
+
const catalog = await _fetchNodeCatalog();
|
|
853
|
+
return new Set((catalog ?? [])
|
|
854
|
+
.filter((n) => isPlainObject(n) && n.category === "trigger" && typeof n.type === "string")
|
|
855
|
+
.map((n) => String(n.type)));
|
|
856
|
+
}
|
|
857
|
+
catch {
|
|
858
|
+
return new Set();
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
/** A value written as an expression (`={{ … }}`) rather than a literal. */
|
|
862
|
+
const _isExpression = (v) => typeof v === "string" && (v.startsWith("=") || v.includes("{{"));
|
|
837
863
|
// Data-operation actions a `suppa` node may perform.
|
|
838
864
|
const _SUPPA_ACTIONS = new Set([
|
|
839
865
|
"select",
|
|
@@ -885,7 +911,7 @@ function _hasCycle(adj) {
|
|
|
885
911
|
* readable error strings; an empty list means the workflow is well-formed.
|
|
886
912
|
* Never throws — every branch guards against non-dict nodes/params.
|
|
887
913
|
*/
|
|
888
|
-
export function _validateWorkflow(nodes, connections) {
|
|
914
|
+
export function _validateWorkflow(nodes, connections, extraTriggerTypes = new Set()) {
|
|
889
915
|
const errors = [];
|
|
890
916
|
if (!Array.isArray(nodes) || nodes.length === 0) {
|
|
891
917
|
errors.push("nodes must be a non-empty array");
|
|
@@ -921,21 +947,11 @@ export function _validateWorkflow(nodes, connections) {
|
|
|
921
947
|
for (const d of sortedStrings(dups)) {
|
|
922
948
|
errors.push(`duplicate node id: ${d}`);
|
|
923
949
|
}
|
|
924
|
-
//
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
930
|
-
});
|
|
931
|
-
if (triggerIdx.length === 0) {
|
|
932
|
-
errors.push("no trigger node found (exactly one trigger required)");
|
|
933
|
-
}
|
|
934
|
-
else if (triggerIdx.length > 1) {
|
|
935
|
-
errors.push(`multiple trigger nodes found (${triggerIdx.length}); exactly one required`);
|
|
936
|
-
}
|
|
937
|
-
else if (triggerIdx[0] !== 0) {
|
|
938
|
-
errors.push("trigger node must be the first node");
|
|
950
|
+
// at least one trigger, anywhere in the array
|
|
951
|
+
const hasTrigger = nodes.some((n) => isPlainObject(n) && typeof n.type === "string" && _isTriggerType(n.type, extraTriggerTypes));
|
|
952
|
+
if (!hasTrigger) {
|
|
953
|
+
const known = sortedStrings(new Set([..._TRIGGER_TYPES, ...extraTriggerTypes]));
|
|
954
|
+
errors.push(`no trigger node found — a workflow starts at one or more of: ${known.join(", ")}`);
|
|
939
955
|
}
|
|
940
956
|
// per-node parameter requirements
|
|
941
957
|
for (const n of nodes) {
|
|
@@ -952,6 +968,38 @@ export function _validateWorkflow(nodes, connections) {
|
|
|
952
968
|
if (n.type === "triggerWebhook" && !params.webhookPath) {
|
|
953
969
|
errors.push(`trigger node '${idLabel}' (triggerWebhook) requires parameters.webhookPath`);
|
|
954
970
|
}
|
|
971
|
+
// FE workflowBuilder/docs/nodes.md "Form Submission": formId is a literal number — publish E18 when
|
|
972
|
+
// missing or behind an expression; the event is fixed (after-insert), so `events` is E19.
|
|
973
|
+
if (n.type === "formSubmission") {
|
|
974
|
+
const formId = params.formId;
|
|
975
|
+
const literal = typeof formId === "number" || (typeof formId === "string" && /^\d+$/.test(formId));
|
|
976
|
+
if (!literal || Number(formId) <= 0) {
|
|
977
|
+
errors.push(`trigger node '${idLabel}' (formSubmission) requires parameters.formId — the id of a published form ` +
|
|
978
|
+
`with no entity, as a literal number${_isExpression(formId) ? " (an expression is refused at publish, E18)" : ""}`);
|
|
979
|
+
}
|
|
980
|
+
if ("events" in params) {
|
|
981
|
+
errors.push(`trigger node '${idLabel}' (formSubmission) takes no parameters.events — the event is fixed to the submission (publish E19)`);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
// FE nodes.md "Schedule Trigger": mode recurring (a five-field UTC cron) or once (runAt, epoch ms).
|
|
985
|
+
if (n.type === "triggerSchedule") {
|
|
986
|
+
const mode = params.mode;
|
|
987
|
+
if (mode !== "recurring" && mode !== "once") {
|
|
988
|
+
errors.push(`trigger node '${idLabel}' (triggerSchedule) requires parameters.mode: 'recurring' or 'once'`);
|
|
989
|
+
}
|
|
990
|
+
else if (mode === "recurring") {
|
|
991
|
+
const cron = params.cron;
|
|
992
|
+
if (typeof cron !== "string" || !cron.trim()) {
|
|
993
|
+
errors.push(`trigger node '${idLabel}' (triggerSchedule, recurring) requires parameters.cron — a five-field cron, in UTC`);
|
|
994
|
+
}
|
|
995
|
+
else if (cron.trim().split(/\s+/).length !== 5) {
|
|
996
|
+
errors.push(`trigger node '${idLabel}' (triggerSchedule) cron '${cron}' must be five fields (minute hour day month weekday, UTC) — a seconds field is rejected`);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
else if (typeof params.runAt !== "number") {
|
|
1000
|
+
errors.push(`trigger node '${idLabel}' (triggerSchedule, once) requires parameters.runAt — epoch milliseconds`);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
955
1003
|
// suppa data node: identified by type 'suppa' or a present `action` param.
|
|
956
1004
|
const isSuppa = n.type === "suppa" || "action" in params;
|
|
957
1005
|
if (isSuppa) {
|
|
@@ -1028,7 +1076,7 @@ export async function createAutomation(name, nodesJson, connectionsJson, setting
|
|
|
1028
1076
|
catch (ex) {
|
|
1029
1077
|
return jsonResponse({ error: ex instanceof Error ? ex.message : String(ex) });
|
|
1030
1078
|
}
|
|
1031
|
-
const errors = _validateWorkflow(nodes, connections);
|
|
1079
|
+
const errors = _validateWorkflow(nodes, connections, await _catalogTriggerTypes());
|
|
1032
1080
|
if (errors.length) {
|
|
1033
1081
|
return jsonResponse({ error: "validation failed", errors });
|
|
1034
1082
|
}
|
|
@@ -1094,7 +1142,7 @@ export async function updateAutomation(automationId, name = null, nodesJson, con
|
|
|
1094
1142
|
// (the missing half is read from the current record). A name-only or settings-
|
|
1095
1143
|
// only update must not be blocked by a stored graph that predates the validator.
|
|
1096
1144
|
if (nodesSupplied || connectionsSupplied) {
|
|
1097
|
-
const errors = _validateWorkflow(nodes, connections);
|
|
1145
|
+
const errors = _validateWorkflow(nodes, connections, await _catalogTriggerTypes());
|
|
1098
1146
|
if (errors.length) {
|
|
1099
1147
|
return jsonResponse({ error: "validation failed", errors });
|
|
1100
1148
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suppa-mcp-2",
|
|
3
|
-
"version": "1.42.
|
|
3
|
+
"version": "1.42.6",
|
|
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": {
|