suppa-mcp-2 1.44.4 → 1.45.0

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.
@@ -0,0 +1,562 @@
1
+ // VENDORED from the front (origin/backend2/develop 41a0f90a2e, 2026-11-12) by scripts/sync-code-form.mjs — do not edit.
2
+ // The Code Form editor's own generators and rules: what suppa_form_code types a form's code with.
3
+ export const FRONT_COMMIT = "41a0f90a2e426b8a745353cf29685feab24202aa";
4
+ export const FORBIDDEN_IMPORT_TEXT = "Only relative imports, “{'@'}suppa/frontend-sdk” and shared modules (“{'@'}shared/…”) are allowed in Code Form.";
5
+
6
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/codeForm/typeGen/CodeFormTypeGenerator.ts
7
+ var PRESENTATION_TYPE_NAMES = {
8
+ desktop: { elements: "DesktopFormElements", api: "DesktopFormAPI" },
9
+ mobile: { elements: "MobileFormElements", api: "MobileFormAPI" }
10
+ };
11
+ function memberKey(name) {
12
+ return /^[A-Za-z_$][\w$]*$/.test(name) ? name : `'${escapeStringLiteral(name)}'`;
13
+ }
14
+ var LITERAL_ESCAPES = { "\\": "\\\\", "'": "\\'", "\n": "\\n", "\r": "\\r", "\u2028": "\\u2028", "\u2029": "\\u2029" };
15
+ function escapeStringLiteral(value) {
16
+ return value.replace(/[\\'\n\r\u2028\u2029]/g, (char) => LITERAL_ESCAPES[char]);
17
+ }
18
+ function generateElementMembers(elements) {
19
+ const seen = /* @__PURE__ */ new Set();
20
+ const lines = [];
21
+ for (const el of elements) {
22
+ const name = el.name?.trim();
23
+ if (!name || seen.has(name)) continue;
24
+ seen.add(name);
25
+ lines.push(` ${memberKey(name)}: ${elementApiType(el)};`);
26
+ }
27
+ return lines.join("\n");
28
+ }
29
+ function generateUnionElementMembers(first, second) {
30
+ const types = /* @__PURE__ */ new Map();
31
+ const collect = (list, side) => {
32
+ for (const el of list) {
33
+ const name = el.name?.trim();
34
+ if (!name || side.has(name)) continue;
35
+ side.add(name);
36
+ const apiType = elementApiType(el);
37
+ const existing = types.get(name);
38
+ if (!existing) types.set(name, [apiType]);
39
+ else if (!existing.includes(apiType)) existing.push(apiType);
40
+ }
41
+ };
42
+ const firstNames = /* @__PURE__ */ new Set();
43
+ const secondNames = /* @__PURE__ */ new Set();
44
+ collect(first, firstNames);
45
+ collect(second, secondNames);
46
+ const lines = [];
47
+ for (const [name, apiTypes] of types) {
48
+ const optional = firstNames.has(name) !== secondNames.has(name) ? "?" : "";
49
+ lines.push(` ${memberKey(name)}${optional}: ${apiTypes.join(" | ")};`);
50
+ }
51
+ return lines.join("\n");
52
+ }
53
+ function generateVariableMembers(variables) {
54
+ const seen = /* @__PURE__ */ new Set();
55
+ const lines = [];
56
+ for (const variable of variables) {
57
+ const name = variable.name?.trim();
58
+ if (!name || seen.has(name)) continue;
59
+ seen.add(name);
60
+ lines.push(` ${memberKey(name)}: ${variableApiType(variable)};`);
61
+ }
62
+ return lines.join("\n");
63
+ }
64
+ function generateGlobalsDts(input) {
65
+ const header = `
66
+ import type {
67
+ FormCodeAPI,
68
+ ElementApiFor,
69
+ VariableApiFor,
70
+ RelationVariable
71
+ } from '@suppa/frontend-sdk';
72
+ `.trimStart();
73
+ const variablesBlock = `export interface CurrentFormVariables {
74
+ ${generateVariableMembers(input.variables)}
75
+ }`;
76
+ const footer = `declare global {
77
+ const formAPI: CurrentFormAPI;
78
+ }
79
+
80
+ export {};
81
+ `;
82
+ const withSources = [...input.elements, ...input.otherElements ?? []].some((el) => el.customSources) ? `${CHART_SOURCES_DECLARATIONS}
83
+
84
+ ` : "";
85
+ const activeKey = input.presentation ?? "desktop";
86
+ if (!input.otherElements) {
87
+ return [
88
+ header,
89
+ `${withSources}export interface CurrentFormElements {
90
+ ${generateElementMembers(input.elements)}
91
+ }`,
92
+ variablesBlock,
93
+ `export type CurrentFormAPI = FormCodeAPI<CurrentFormElements, CurrentFormVariables> & { readonly presentation: '${activeKey}' };`,
94
+ footer
95
+ ].join("\n\n");
96
+ }
97
+ const desktopElements = activeKey === "desktop" ? input.elements : input.otherElements;
98
+ const mobileElements = activeKey === "desktop" ? input.otherElements : input.elements;
99
+ const desktop = PRESENTATION_TYPE_NAMES.desktop;
100
+ const mobile = PRESENTATION_TYPE_NAMES.mobile;
101
+ return [
102
+ header,
103
+ `${withSources}export interface ${desktop.elements} {
104
+ ${generateElementMembers(desktopElements)}
105
+ }`,
106
+ `export interface ${mobile.elements} {
107
+ ${generateElementMembers(mobileElements)}
108
+ }`,
109
+ `/** Union of both presentations \u2014 \`getElement()\` resolves against it: shared names required, exclusive names optional. */
110
+ export interface CurrentFormElements {
111
+ ${generateUnionElementMembers(desktopElements, mobileElements)}
112
+ }`,
113
+ variablesBlock,
114
+ `export type ${desktop.api} = FormCodeAPI<${desktop.elements}, CurrentFormVariables, CurrentFormElements> & { readonly presentation: 'desktop' };`,
115
+ `export type ${mobile.api} = FormCodeAPI<${mobile.elements}, CurrentFormVariables, CurrentFormElements> & { readonly presentation: 'mobile' };`,
116
+ `/** Discriminated by \`formAPI.presentation\`, while the intersected CurrentFormElements keeps top-level element autocomplete complete. */
117
+ export type CurrentFormAPI = (${desktop.api} | ${mobile.api}) & FormCodeAPI<CurrentFormElements, CurrentFormVariables, CurrentFormElements>;`,
118
+ footer
119
+ ].join("\n\n");
120
+ }
121
+ function elementApiType(el) {
122
+ const base = el.customSources ? `ChartWithSources<${chartSourcesType(el.customSources)}>` : `ElementApiFor<'${escapeStringLiteral(el.type)}'>`;
123
+ if (el.apiMembers === void 0) return base;
124
+ const shape = widgetApiShape(el.apiMembers);
125
+ return `${base} & { readonly api?: ${shape}; whenApi(options?: { timeout?: number; signal?: AbortSignal }): Promise<${shape} | null> }`;
126
+ }
127
+ var CUSTOM_SOURCE_STATE_MODULE = "import('@/formBuilderV2/elements/chart/custom/customSourceState')";
128
+ var CHART_SOURCES_DECLARATIONS = [
129
+ `/** A chart's source state as the runtime hands it out \u2014 frozen all the way down. */
130
+ export type FrozenChartState<T> = T extends (...args: never[]) => unknown ? T : T extends object ? { readonly [K in keyof T]: FrozenChartState<T[K]> } : T;`,
131
+ `/** A chart whose \`sources\` are exactly the sources this form declares for it \u2014 a typo in a source or measure name is a type error. */
132
+ export interface ChartWithSources<TSources extends Readonly<Record<string, ${CUSTOM_SOURCE_STATE_MODULE}.CustomChartSourceState>>> extends ElementApiFor<'chart'> {
133
+ readonly sources: TSources;
134
+ }`
135
+ ].join("\n\n");
136
+ function chartSourcesType(sources) {
137
+ const unique = sources.filter((source, index) => sources.findIndex((other) => other.name === source.name) === index);
138
+ const entries = unique.map((source) => {
139
+ const measures = [...new Set(source.measures)].map((key) => `${memberKey(key)}: ${CUSTOM_SOURCE_STATE_MODULE}.CustomChartMeasureState`).join("; ");
140
+ return `${memberKey(source.name)}: Omit<${CUSTOM_SOURCE_STATE_MODULE}.CustomChartSourceState, 'measures'> & { measures: { ${measures} } }`;
141
+ });
142
+ return `FrozenChartState<{ ${entries.join("; ")} }>`;
143
+ }
144
+ function widgetApiShape(members) {
145
+ if (!members || members.length === 0) return "Record<string, (...args: unknown[]) => unknown>";
146
+ const entries = members.map(
147
+ (member) => member.kind === "value" ? `readonly ${memberKey(member.name)}: unknown` : `${memberKey(member.name)}(...args: unknown[]): unknown`
148
+ );
149
+ return `{ ${entries.join("; ")} }`;
150
+ }
151
+ function variableApiType(variable) {
152
+ if (variable.type === "relation") {
153
+ const entity = variable.entity;
154
+ return entity ? `RelationVariable<'${escapeStringLiteral(entity)}'>` : `VariableApiFor<'relation'>`;
155
+ }
156
+ return `VariableApiFor<'${escapeStringLiteral(variable.type)}'>`;
157
+ }
158
+
159
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/elements/chart/custom/customChartSchema.ts
160
+ var PROTOTYPE_NAMES = new Set(Object.getOwnPropertyNames(Object.prototype));
161
+ function measureKeyOf(measure) {
162
+ return measure.key || measure.id;
163
+ }
164
+ function measureKeysOf(source) {
165
+ if (source.kind === "suppaSql") return (source.sqlValueColumns ?? []).map((column) => column.key).filter(Boolean);
166
+ return (source.values ?? []).map(measureKeyOf);
167
+ }
168
+ function customSourcesOfSchema(schema) {
169
+ if (schema.type !== "chart" || schema.chartType !== "custom") return void 0;
170
+ const sources = schema.dataSources && typeof schema.dataSources === "object" ? schema.dataSources : {};
171
+ return Object.entries(sources).map(([name, source]) => ({ name, measures: measureKeysOf(source) }));
172
+ }
173
+
174
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/shared/dynamicWidget/widgetApiKeys.ts
175
+ var DEFINE_API = "defineApi";
176
+ var MEMBER_KEY = /^(?:(get|set)\s+)?(?:async\s+)?\*?\s*(?:(['"])((?:[^'"\\]|\\.)+)\2|([\p{ID_Start}_$][\p{ID_Continue}$]*))\s*(\(|:)?/u;
177
+ var VALUE_LITERAL = /^(?:-?\d|['"`[{/]|true\b|false\b|null\b|undefined\b|new\b)/;
178
+ var REGEX_MAY_FOLLOW = /[({[,;:=!&|?+\-*%~^<>]/;
179
+ var KEYWORD_BEFORE_REGEX = /(?:^|[^\w$])(?:return|typeof|instanceof|in|of|new|delete|void|throw|case|do|else|yield|await)\s*$/;
180
+ function extractWidgetApiMembers(script) {
181
+ if (!script) return [];
182
+ let found = false;
183
+ let members = [];
184
+ walkCode(script, 0, script.length, (index) => {
185
+ if (!startsCall(script, index)) return;
186
+ const open = skipTrivia(script, index + DEFINE_API.length);
187
+ if (script[open] !== "(") return;
188
+ found = true;
189
+ const argument = skipTrivia(script, open + 1);
190
+ if (script[argument] !== "{") {
191
+ members = null;
192
+ return;
193
+ }
194
+ const inner = sliceBalanced(script, argument);
195
+ members = inner === null ? null : parseMembers(inner);
196
+ });
197
+ return found ? members : [];
198
+ }
199
+ function startsCall(source, index) {
200
+ if (!source.startsWith(DEFINE_API, index)) return false;
201
+ const before = index > 0 ? source[index - 1] : "";
202
+ if (before === "." || before === "$" || /[\w$]/.test(before)) return false;
203
+ return !/[\w$]/.test(source[index + DEFINE_API.length] ?? "");
204
+ }
205
+ function walkCode(source, from, to, visit) {
206
+ let i = from;
207
+ let previous = "";
208
+ while (i < to) {
209
+ const ch = source[i];
210
+ if (ch === "/" && (source[i + 1] === "/" || source[i + 1] === "*")) {
211
+ i = skipComment(source, i);
212
+ continue;
213
+ }
214
+ if (ch === "'" || ch === '"') {
215
+ i = skipQuoted(source, i);
216
+ previous = ch;
217
+ continue;
218
+ }
219
+ if (ch === "`") {
220
+ i = skipTemplate(source, i);
221
+ previous = ch;
222
+ continue;
223
+ }
224
+ if (ch === "/" && regexStartsHere(source, i, previous)) {
225
+ i = skipRegex(source, i);
226
+ previous = "/";
227
+ continue;
228
+ }
229
+ if (visit(i, ch) === "stop") return i;
230
+ if (!/\s/.test(ch)) previous = ch;
231
+ i += 1;
232
+ }
233
+ return -1;
234
+ }
235
+ function regexStartsHere(source, index, previous) {
236
+ if (previous === "" || REGEX_MAY_FOLLOW.test(previous)) return true;
237
+ return KEYWORD_BEFORE_REGEX.test(source.slice(Math.max(0, index - 16), index));
238
+ }
239
+ function skipComment(source, start) {
240
+ if (source[start + 1] === "/") {
241
+ const end2 = source.indexOf("\n", start);
242
+ return end2 === -1 ? source.length : end2 + 1;
243
+ }
244
+ const end = source.indexOf("*/", start + 2);
245
+ return end === -1 ? source.length : end + 2;
246
+ }
247
+ function skipQuoted(source, start) {
248
+ const quote = source[start];
249
+ let i = start + 1;
250
+ while (i < source.length) {
251
+ const ch = source[i];
252
+ if (ch === "\\") {
253
+ i += 2;
254
+ continue;
255
+ }
256
+ if (ch === quote) return i + 1;
257
+ i += 1;
258
+ }
259
+ return source.length;
260
+ }
261
+ function skipTemplate(source, start) {
262
+ let i = start + 1;
263
+ while (i < source.length) {
264
+ const ch = source[i];
265
+ if (ch === "\\") {
266
+ i += 2;
267
+ continue;
268
+ }
269
+ if (ch === "`") return i + 1;
270
+ if (ch === "$" && source[i + 1] === "{") {
271
+ i = skipBraced(source, i + 1);
272
+ continue;
273
+ }
274
+ i += 1;
275
+ }
276
+ return source.length;
277
+ }
278
+ function skipBraced(source, open) {
279
+ let depth = 0;
280
+ const end = walkCode(source, open, source.length, (_index, ch) => {
281
+ if (ch === "{") depth += 1;
282
+ else if (ch === "}") {
283
+ depth -= 1;
284
+ if (depth === 0) return "stop";
285
+ }
286
+ return void 0;
287
+ });
288
+ return end === -1 ? source.length : end + 1;
289
+ }
290
+ function skipRegex(source, start) {
291
+ let i = start + 1;
292
+ let inClass = false;
293
+ while (i < source.length) {
294
+ const ch = source[i];
295
+ if (ch === "\\") {
296
+ i += 2;
297
+ continue;
298
+ }
299
+ if (ch === "\n") return i;
300
+ if (ch === "[") inClass = true;
301
+ else if (ch === "]") inClass = false;
302
+ else if (ch === "/" && !inClass) return i + 1;
303
+ i += 1;
304
+ }
305
+ return source.length;
306
+ }
307
+ function skipTrivia(source, from) {
308
+ let i = from;
309
+ while (i < source.length) {
310
+ const ch = source[i];
311
+ if (ch === " " || ch === " " || ch === "\n" || ch === "\r") {
312
+ i += 1;
313
+ continue;
314
+ }
315
+ if (ch === "/" && (source[i + 1] === "/" || source[i + 1] === "*")) {
316
+ i = skipComment(source, i);
317
+ continue;
318
+ }
319
+ return i;
320
+ }
321
+ return i;
322
+ }
323
+ function sliceBalanced(source, open) {
324
+ let depth = 0;
325
+ const end = walkCode(source, open, source.length, (_index, ch) => {
326
+ if (ch === "{" || ch === "[" || ch === "(") depth += 1;
327
+ else if (ch === "}" || ch === "]" || ch === ")") {
328
+ depth -= 1;
329
+ if (depth === 0) return "stop";
330
+ }
331
+ return void 0;
332
+ });
333
+ return end === -1 ? null : source.slice(open + 1, end);
334
+ }
335
+ function parseMembers(inner) {
336
+ const byName = /* @__PURE__ */ new Map();
337
+ for (const part of splitTopLevel(inner)) {
338
+ const member = parseMember(part);
339
+ if (!member) continue;
340
+ byName.delete(member.name);
341
+ byName.set(member.name, member);
342
+ }
343
+ return [...byName.values()];
344
+ }
345
+ function splitTopLevel(inner) {
346
+ const parts = [];
347
+ let depth = 0;
348
+ let start = 0;
349
+ walkCode(inner, 0, inner.length, (index, ch) => {
350
+ if (ch === "{" || ch === "[" || ch === "(") depth += 1;
351
+ else if (ch === "}" || ch === "]" || ch === ")") depth -= 1;
352
+ else if (ch === "," && depth === 0) {
353
+ parts.push(inner.slice(start, index));
354
+ start = index + 1;
355
+ }
356
+ return void 0;
357
+ });
358
+ parts.push(inner.slice(start));
359
+ return parts;
360
+ }
361
+ function parseMember(part) {
362
+ const text = part.slice(skipTrivia(part, 0)).trim();
363
+ if (!text || text.startsWith("...")) return null;
364
+ const match = MEMBER_KEY.exec(text);
365
+ if (!match) return null;
366
+ const accessor = match[1];
367
+ const name = match[3] ?? match[4];
368
+ const delimiter = match[5];
369
+ if (!name) return null;
370
+ if (accessor) return { name, kind: "value" };
371
+ if (delimiter === "(") return { name, kind: "method" };
372
+ if (delimiter === ":") {
373
+ const value = text.slice(match[0].length).trim();
374
+ return { name, kind: VALUE_LITERAL.test(value) ? "value" : "method" };
375
+ }
376
+ return { name, kind: "method" };
377
+ }
378
+
379
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/codeForm/virtualProject/CodeFormVirtualProject.ts
380
+ var SDK_LIB_PATH = "file:///node_modules/@suppa/frontend-sdk/index.d.ts";
381
+ var USER_FILE_SCHEME = "file:///";
382
+ var CODE_FORM_LIB = ["es2023"];
383
+ var SHARED_COMPILER_OPTIONS = {
384
+ esModuleInterop: true,
385
+ strict: true,
386
+ noEmit: true,
387
+ skipLibCheck: true,
388
+ lib: CODE_FORM_LIB
389
+ };
390
+ var SDK_WORKSPACE_PATH = SDK_LIB_PATH.slice(USER_FILE_SCHEME.length);
391
+ function codeFormTsconfigOptions() {
392
+ return {
393
+ ...SHARED_COMPILER_OPTIONS,
394
+ lib: [...SHARED_COMPILER_OPTIONS.lib],
395
+ target: "ES2020",
396
+ module: "ESNext",
397
+ moduleResolution: "node",
398
+ types: [],
399
+ baseUrl: ".",
400
+ paths: { "@suppa/frontend-sdk": [SDK_WORKSPACE_PATH] }
401
+ };
402
+ }
403
+ function buildSharedModulesDts() {
404
+ return "declare module '@shared/*';\n";
405
+ }
406
+ function buildBaselineGlobalsDts() {
407
+ return `
408
+ import type { FormCodeAPI, ElementApiFor, VariableApiFor } from '@suppa/frontend-sdk';
409
+
410
+ export interface CurrentFormElements { [name: string]: ElementApiFor<string>; }
411
+ export interface CurrentFormVariables { [name: string]: VariableApiFor<string>; }
412
+ export type CurrentFormAPI = FormCodeAPI<CurrentFormElements, CurrentFormVariables>;
413
+
414
+ declare global {
415
+ const formAPI: CurrentFormAPI;
416
+ }
417
+
418
+ export {};
419
+ `.trimStart();
420
+ }
421
+ function buildEnvironmentDts() {
422
+ return `
423
+ interface CodeFormConsole {
424
+ log(...data: unknown[]): void;
425
+ info(...data: unknown[]): void;
426
+ warn(...data: unknown[]): void;
427
+ error(...data: unknown[]): void;
428
+ debug(...data: unknown[]): void;
429
+ trace(...data: unknown[]): void;
430
+ dir(...data: unknown[]): void;
431
+ table(...data: unknown[]): void;
432
+ group(...data: unknown[]): void;
433
+ groupCollapsed(...data: unknown[]): void;
434
+ groupEnd(): void;
435
+ time(label?: string): void;
436
+ timeEnd(label?: string): void;
437
+ count(label?: string): void;
438
+ assert(condition?: boolean, ...data: unknown[]): void;
439
+ clear(): void;
440
+ }
441
+
442
+ type CodeFormTimerId = number;
443
+
444
+ /** Response headers, narrowed to reading. \`get\` answers \`null\` for a header the response does not carry \u2014 AND for one it carries but CORS does not expose: a cross-origin response only reveals the safelisted headers plus whatever the server lists in \`Access-Control-Expose-Headers\`, so a \`null\` here is \xABnot readable\xBB, never \xABnot sent\xBB. */
445
+ interface CodeFormResponseHeaders {
446
+ get(name: string): string | null;
447
+ has(name: string): boolean;
448
+ forEach(callback: (value: string, name: string) => void): void;
449
+ }
450
+
451
+ /** What {@link fetch} resolves with, narrowed to what form code can actually use without the DOM lib (no \`Blob\`/\`FormData\` bodies coming back, no streams). **\`ok\` is false for 4xx/5xx and the promise still RESOLVES** \u2014 a fetch rejects only when the request never completed (network down, CORS refusal, abort), so an author who omits the status check has written a success path over an error page. */
452
+ interface CodeFormResponse {
453
+ readonly ok: boolean;
454
+ readonly status: number;
455
+ readonly statusText: string;
456
+ readonly url: string;
457
+ readonly headers: CodeFormResponseHeaders;
458
+ json(): Promise<unknown>;
459
+ text(): Promise<string>;
460
+ }
461
+
462
+ interface CodeFormRequestInit {
463
+ method?: string;
464
+ headers?: Record<string, string>;
465
+ body?: string | Blob | ArrayBuffer | ArrayBufferView | null;
466
+ /** Aborts the request in flight. Use the form's own \`formAPI.requestSignal\` to have it die with the form. */
467
+ signal?: AbortSignal;
468
+ /** \`'omit'\` for a third-party origin: it is what keeps the platform's cookies off a request that has no business carrying them. */
469
+ credentials?: 'omit' | 'same-origin' | 'include';
470
+ mode?: 'cors' | 'no-cors' | 'same-origin';
471
+ cache?: 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache';
472
+ redirect?: 'follow' | 'error' | 'manual';
473
+ referrerPolicy?: string;
474
+ }
475
+
476
+ declare global {
477
+ const console: CodeFormConsole;
478
+
479
+ function setTimeout(handler: (...args: unknown[]) => void, timeout?: number, ...args: unknown[]): CodeFormTimerId;
480
+ function clearTimeout(id?: CodeFormTimerId): void;
481
+ function setInterval(handler: (...args: unknown[]) => void, timeout?: number, ...args: unknown[]): CodeFormTimerId;
482
+ function clearInterval(id?: CodeFormTimerId): void;
483
+
484
+ /** Deep-copy a PLAIN value. For anything that came out of the form, prefer \`formAPI.utils.object.deepClone(value)\`: this throws \`DataCloneError\` on a Vue reactive proxy, which is what \`formAPI.variables.<name>.getValue()\` and \`formAPI.elements.<name>.getValue()\` hand you almost everywhere \u2014 and the rejection cannot be narrowed inside form code, because \`DOMException\` is declared in the DOM lib this sandbox deliberately omits. \`deepClone\` is this same call plus a recursive fallback for exactly the inputs it refuses. */
485
+ function structuredClone<T>(value: T): T;
486
+
487
+ /** HTTP to a THIRD-PARTY origin \u2014 a public API, a signed upload URL, a partner's webhook. **Platform data never goes through here: use \`formAPI.services.api.*\`**, which carries the tenant's auth, the request cache and its invalidation; a hand-written \`fetch\` at our own backend bypasses all three and is a bug, not a shortcut. Declared since it is the only way to reach an origin that is not ours, and the runtime has always had it \u2014 it was the TYPES that pretended otherwise, so the code that needed it was written blind (SuppaDrive's GCS upload, 2026-09). Two things to remember, both of which the DOM's own typings hide: a 4xx/5xx RESOLVES (check \`response.ok\`), and a header the server sent is readable cross-origin only when it is CORS-exposed. \`Blob\` bodies come from \`formAPI.services.files\` / dropped files; there is no \`FormData\` in this sandbox. */
488
+ function fetch(input: string, init?: CodeFormRequestInit): Promise<CodeFormResponse>;
489
+ }
490
+
491
+ export {};
492
+ `.trimStart();
493
+ }
494
+
495
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/codeForm/runtime/moduleSyntax.ts
496
+ var SHARED_PREFIX = "@shared/";
497
+ var SHARED_MODULE_NAME = /^[A-Za-z0-9_][A-Za-z0-9._-]*$/;
498
+ function sharedModuleName(specifier) {
499
+ if (!specifier.startsWith(SHARED_PREFIX)) return null;
500
+ const name = specifier.slice(SHARED_PREFIX.length);
501
+ return SHARED_MODULE_NAME.test(name) ? name : null;
502
+ }
503
+
504
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/codeForm/diagnostics/CodeFormDiagnostics.ts
505
+ var FORBIDDEN_IMPORT_MESSAGE_KEY = "formBuilder.code.forbiddenImport";
506
+ var STATIC_IMPORT_RE = /(?:\bimport\b|\bexport\b)(?:[^'"();]*?\bfrom\b)?\s*(['"])([^'"]+)\1/g;
507
+ var DYNAMIC_IMPORT_RE = /\bimport\s*\(\s*(['"])([^'"]+)\1\s*\)/g;
508
+ function detectForbiddenImports(code) {
509
+ const found = [];
510
+ collectForbidden(code, STATIC_IMPORT_RE, found);
511
+ collectForbidden(code, DYNAMIC_IMPORT_RE, found);
512
+ return found.sort((a, b) => a.line === b.line ? a.column - b.column : a.line - b.line);
513
+ }
514
+ function isAllowed(specifier) {
515
+ if (specifier.startsWith("./") || specifier.startsWith("../")) return true;
516
+ if (sharedModuleName(specifier)) return true;
517
+ return specifier === "@suppa/frontend-sdk" || specifier.startsWith("@suppa/frontend-sdk/");
518
+ }
519
+ function indexToPosition(code, index) {
520
+ let line = 1;
521
+ let lineStart = 0;
522
+ for (let i = 0; i < index; i++) {
523
+ if (code.charCodeAt(i) === 10) {
524
+ line += 1;
525
+ lineStart = i + 1;
526
+ }
527
+ }
528
+ return { line, column: index - lineStart + 1 };
529
+ }
530
+ function collectForbidden(code, regex, found) {
531
+ regex.lastIndex = 0;
532
+ let match;
533
+ while ((match = regex.exec(code)) !== null) {
534
+ const specifier = match[2];
535
+ if (isAllowed(specifier)) continue;
536
+ const specifierIndex = match.index + match[0].lastIndexOf(specifier);
537
+ const { line, column } = indexToPosition(code, specifierIndex);
538
+ found.push({
539
+ specifier,
540
+ line,
541
+ column,
542
+ endColumn: column + specifier.length,
543
+ messageKey: FORBIDDEN_IMPORT_MESSAGE_KEY
544
+ });
545
+ }
546
+ }
547
+
548
+ // ../../../../../../../../../../ANDRII~1.HER/AppData/Local/Temp/sync-code-form-Y0Gw0v/src/formBuilderV2/codeForm/files/CodeFormFileUtils.ts
549
+ var ENTRY_PATH = "src/index.ts";
550
+ export {
551
+ CODE_FORM_LIB,
552
+ ENTRY_PATH,
553
+ SDK_WORKSPACE_PATH,
554
+ buildBaselineGlobalsDts,
555
+ buildEnvironmentDts,
556
+ buildSharedModulesDts,
557
+ codeFormTsconfigOptions,
558
+ customSourcesOfSchema,
559
+ detectForbiddenImports,
560
+ extractWidgetApiMembers,
561
+ generateGlobalsDts
562
+ };
@@ -72,7 +72,7 @@ SELECT "id", "assignee", "tags" FROM TestTasks -- assignee:{i
72
72
 
73
73
  ```sql
74
74
  SELECT "id" FROM TestTasks WHERE "assignee.firstName" = $v -- :149
75
- SELECT id FROM Tasks WHERE "author.department.company.name" = 'Acme' -- 3-hop equality parser-round-trip.spec.ts:1907
75
+ SELECT id FROM Tasks WHERE "createdBy.department.company.name" = 'Acme' -- 3-hop equality (the spec says author; Tasks has createdBy) parser-round-trip.spec.ts:1907
76
76
  SELECT "id" FROM TestTasks WHERE "children.id" IS NOT NULL -- o2m existence planner-parity.spec.ts:172
77
77
  SELECT "id" FROM TestTasks WHERE "tags.label" = $v -- m2m subfield → EXISTS :185
78
78
  SELECT "id" FROM TestTasks WHERE "tags.taggedTasks.title" = 'x' -- deep m2m→backref chain :3478