suppa-mcp-2 1.40.1 → 1.40.2
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
CHANGED
|
@@ -135,21 +135,12 @@ export function defaultValueMayBeSent(unique = false) {
|
|
|
135
135
|
// the searchable option participate."). `searchable` (and searchPriority) are
|
|
136
136
|
// therefore the ones worth setting deliberately; the rest already hold the
|
|
137
137
|
// value most fields want.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
* default to false and are the two worth setting deliberately.
|
|
145
|
-
*/
|
|
146
|
-
export const DEFAULT_TRUE_FIELD_OPTIONS = {
|
|
147
|
-
canGroup: true,
|
|
148
|
-
canSort: true,
|
|
149
|
-
canFilter: true,
|
|
150
|
-
showInTable: true,
|
|
151
|
-
editFromTable: true,
|
|
152
|
-
};
|
|
138
|
+
// The five DISPLAY flags — canGroup, canSort, canFilter, showInTable, editFromTable — are the
|
|
139
|
+
// ones the platform's own client sends on every field it creates (`fieldDraft.DEFAULT_TRUE_OPTIONS`
|
|
140
|
+
// in the entity builder, `setDefaultTrueOptions` in the legacy admin). Whether an omission means
|
|
141
|
+
// "true" or "false" is unsettled — see the decision point in buildFieldDefinition, which leaves
|
|
142
|
+
// the write path alone and says so rather than guessing. No constant here: an exported set with no
|
|
143
|
+
// consumer is how a decision nobody made starts to look like one that was.
|
|
153
144
|
/** Boolean members of the Field Options object. */
|
|
154
145
|
export const FIELD_OPTION_BOOLEAN_KEYS = [
|
|
155
146
|
"searchable", // builder.txt:66 — "Available for search."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suppa-mcp-2",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.2",
|
|
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": {
|
|
@@ -455,6 +455,21 @@ function offKitSpacing(schema, skipIds) {
|
|
|
455
455
|
/** Container types whose children are placed in GRID cells and carry their own column count. */
|
|
456
456
|
const GRID_PARENT_TYPES = new Set(["container", "tabsContainer", "accordionContainer", "stepsContainer"]);
|
|
457
457
|
|
|
458
|
+
/**
|
|
459
|
+
* A grid's column count, read the way the rest of this package already reads it.
|
|
460
|
+
*
|
|
461
|
+
* `columnsOf()` and `polishList()` in form-core both require a finite number `>= 1` and floor it,
|
|
462
|
+
* treating anything else as absent. This check used a bare `typeof === "number"`, so a 0, a
|
|
463
|
+
* negative or a 2.5 flowed into both the arithmetic and the advice — and "write width 2.5, which is
|
|
464
|
+
* full width here" is not a remedy an author can follow. Out-of-range counts now read as absent,
|
|
465
|
+
* which is what the normalizer does with them.
|
|
466
|
+
*
|
|
467
|
+
* @returns {number|null} a usable count, or null when none was declared (the grid then holds 1)
|
|
468
|
+
*/
|
|
469
|
+
function gridColumns(v) {
|
|
470
|
+
return typeof v === "number" && Number.isFinite(v) && v >= 1 ? Math.floor(v) : null;
|
|
471
|
+
}
|
|
472
|
+
|
|
458
473
|
/**
|
|
459
474
|
* A grid child cannot span more columns than its parent grid has.
|
|
460
475
|
*
|
|
@@ -465,13 +480,15 @@ const GRID_PARENT_TYPES = new Set(["container", "tabsContainer", "accordionConta
|
|
|
465
480
|
* is precisely the shape this check now refuses. Rare in the wild, so it reads as a defect and not
|
|
466
481
|
* a convention: 7 occurrences across 4 of the 103 dev forms that have a `schema` column.
|
|
467
482
|
*/
|
|
468
|
-
function spanOverflow(schema, settings, skipIds) {
|
|
483
|
+
function spanOverflow(schema, settings, skipIds, presentation = "schema") {
|
|
469
484
|
const out = [];
|
|
470
485
|
const list = Array.isArray(schema) ? schema : [];
|
|
471
486
|
const byId = new Map();
|
|
472
487
|
for (const el of list) if (el && typeof el === "object" && el.id !== undefined) byId.set(el.id, el);
|
|
473
|
-
const rootCols = settings && typeof settings === "object"
|
|
474
|
-
|
|
488
|
+
const rootCols = gridColumns(settings && typeof settings === "object" ? settings.columnsNumber : undefined);
|
|
489
|
+
// The mobile presentation is laid out against the SAME root count: form-core hands its own
|
|
490
|
+
// `formColumns` to both lists (`normalizeSchemaList(draft.mobileSchema, formColumns, …)`).
|
|
491
|
+
const where0 = presentation === "mobileSchema" ? "mobileSchema — " : "";
|
|
475
492
|
|
|
476
493
|
for (const el of list) {
|
|
477
494
|
if (!el || typeof el !== "object") continue;
|
|
@@ -494,17 +511,18 @@ function spanOverflow(schema, settings, skipIds) {
|
|
|
494
511
|
const parent = byId.get(pid);
|
|
495
512
|
if (!parent || typeof parent !== "object") continue; // dangling parents are reported elsewhere
|
|
496
513
|
if (!GRID_PARENT_TYPES.has(parent.type)) continue; // a flex parent places by `order`
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
514
|
+
const declared = gridColumns(parent.columnsNumber);
|
|
515
|
+
cols = declared === null ? 1 : declared;
|
|
516
|
+
where = declared === null
|
|
517
|
+
? `\`${parent.name || parent.id}\`, whose \`columnsNumber\` is unset and therefore 1`
|
|
518
|
+
: `\`${parent.name || parent.id}\` (columnsNumber: ${declared})`;
|
|
501
519
|
}
|
|
502
520
|
if (width > cols) {
|
|
503
521
|
out.push({
|
|
504
522
|
code: "span_exceeds_parent_columns",
|
|
505
523
|
elementId: el.name || el.id || el.type,
|
|
506
524
|
detail:
|
|
507
|
-
|
|
525
|
+
`${where0}layout.${bp}.width is ${width} but its parent grid has ${cols} column${cols === 1 ? "" : "s"} — ` +
|
|
508
526
|
`${where}. Column count is per grid and defaults to 1: set the count you intend on the grid ` +
|
|
509
527
|
`FIRST, then span against it. Either raise that grid's column count to ${width} (1-12) and ` +
|
|
510
528
|
`re-span its other children in the same turn, or write width ${cols}, which is full width here.`,
|
|
@@ -801,6 +819,16 @@ export async function validateForm(input, { baseline = null, normalize = false }
|
|
|
801
819
|
// missing breakpoint records) and none for what it does not.
|
|
802
820
|
const docErrors = [
|
|
803
821
|
...spanOverflow(draft.schema, draft.settings, baselineIds),
|
|
822
|
+
// The mobile presentation is a component set of its own, and it was passing unchecked: a
|
|
823
|
+
// mobileSchema element spanning 12 in a 4-column grid returned ok:true with zero findings,
|
|
824
|
+
// while the identical shape on the desktop schema was an error. Both lists are laid out
|
|
825
|
+
// against the same `settings.columnsNumber`, so the same check applies to both.
|
|
826
|
+
//
|
|
827
|
+
// Swept over all 217 live dev forms: NONE carries a non-empty `mobileSchema`, so this branch
|
|
828
|
+
// adds zero findings to anything on the tenant today. That is coverage, not evidence — unlike
|
|
829
|
+
// the desktop branch (7 hits on 4 forms), it rests on the shared column model above and on the
|
|
830
|
+
// same documented invariant, not on a measurement of forms that exercise it.
|
|
831
|
+
...spanOverflow(draft.mobileSchema, draft.settings, baselineIds, "mobileSchema"),
|
|
804
832
|
...crossPresentationIds(draft.schema, draft.mobileSchema),
|
|
805
833
|
...connectionsWithoutId(draft.connections),
|
|
806
834
|
];
|