@xanots/sdk 0.0.9 → 0.0.11
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/CHANGELOG.md +34 -0
- package/README.md +66 -21
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-4W37DGXS.js → agent-file-refresh-QNKN5RYD.js} +3 -3
- package/dist/bin.js +10 -8
- package/dist/{branch-commands-PBQ36L4A.js → branch-commands-2BLOC2GR.js} +13 -11
- package/dist/bundle.d.ts +218 -0
- package/dist/bundle.js +143 -0
- package/dist/{capture-7PO6SGB4.js → capture-4WVJY4DQ.js} +2 -2
- package/dist/{chunk-OW2QZEWL.js → chunk-22TKBSDV.js} +2 -2
- package/dist/{chunk-ZOYMZZ3S.js → chunk-3INK4Y4E.js} +1 -1
- package/dist/{chunk-NDZFBZHC.js → chunk-3UABJA4X.js} +1 -1
- package/dist/{chunk-6Z5CNWFC.js → chunk-4IF54NU5.js} +37 -6
- package/dist/{chunk-KSV7VOEX.js → chunk-4Q7ZOHH7.js} +3 -3
- package/dist/{chunk-QTNO2WD6.js → chunk-7ZYW652H.js} +1 -1
- package/dist/{chunk-4PTSTDIG.js → chunk-AIZKXUNP.js} +2 -2
- package/dist/{chunk-P5C2YKAM.js → chunk-ANUDXFEX.js} +18 -27
- package/dist/{chunk-4BXJGVZ3.js → chunk-BC2C5GVI.js} +2 -69
- package/dist/chunk-BSK7ELHU.js +70 -0
- package/dist/chunk-CTD5ZCV6.js +28 -0
- package/dist/{chunk-5HCDZ2XN.js → chunk-DBFU47BJ.js} +2 -2
- package/dist/{chunk-OKNSR7MT.js → chunk-DIA7CT7J.js} +129 -150
- package/dist/chunk-EHP3WPEG.js +21 -0
- package/dist/{chunk-JQLR64UC.js → chunk-F6CYJ7TN.js} +21 -6
- package/dist/{chunk-BKDJN76G.js → chunk-FE5I6S6N.js} +1 -1
- package/dist/{chunk-5YQOIFT4.js → chunk-G4EJMQLD.js} +2 -2
- package/dist/{chunk-L6TPHWAU.js → chunk-HYBN4H3F.js} +60 -86
- package/dist/{chunk-QIWBCS7N.js → chunk-JGCWTCA7.js} +2 -2
- package/dist/{chunk-MDXR5E5Q.js → chunk-K5IOND4K.js} +2 -2
- package/dist/{chunk-4PE4ZAB7.js → chunk-KA6G2L7U.js} +5 -5
- package/dist/chunk-OHX6MIUZ.js +184 -0
- package/dist/{chunk-UDL46O35.js → chunk-OWGCOGKK.js} +155 -3
- package/dist/{chunk-QONOJO45.js → chunk-QK7ZQJLP.js} +140 -20
- package/dist/{chunk-3QW5NFZJ.js → chunk-QKM4U5UK.js} +3 -3
- package/dist/{chunk-7OXFMCTX.js → chunk-QYMAZRAU.js} +7 -7
- package/dist/{chunk-K3YSQDXJ.js → chunk-RCT7UX7B.js} +92 -75
- package/dist/{chunk-T4XPCJRF.js → chunk-TCFIPDB3.js} +1 -1
- package/dist/{chunk-ZZLPTHT5.js → chunk-UOZMSF4C.js} +15 -8
- package/dist/{chunk-7JDT4PBU.js → chunk-VAF6A3YD.js} +5 -179
- package/dist/{chunk-6DHBYBTO.js → chunk-VNQM3V2C.js} +1 -2
- package/dist/chunk-WGPXT2G2.js +22 -0
- package/dist/{chunk-6AAT2AYQ.js → chunk-WP4OZZV4.js} +2 -2
- package/dist/{chunk-OYMR5AMJ.js → chunk-XEOX6AM7.js} +2 -2
- package/dist/{chunk-MU3O43L2.js → chunk-YBC3IKMF.js} +2 -2
- package/dist/chunk-ZQ2PKR6R.js +40 -0
- package/dist/cli.d.ts +57 -31
- package/dist/cli.js +9 -7
- package/dist/codegen-command-FUT2KJB6.js +49 -0
- package/dist/codegen.d.ts +2 -1
- package/dist/{completion-A6BZ3XGU.js → completion-WF46272M.js} +2 -2
- package/dist/{config-NL33PN4D.js → config-476F3PT5.js} +1 -1
- package/dist/{deploy-command-5TTI4TUP.js → deploy-command-IP7V7GT4.js} +69 -100
- package/dist/{ephemeral-command-7TK52YQM.js → ephemeral-command-U4AQ3TXX.js} +25 -28
- package/dist/index.d.ts +6 -4
- package/dist/index.js +10 -9
- package/dist/init-command-NPVL32L6.js +34 -0
- package/dist/{onboard-command-EHOHKQQU.js → init-web-3JNFG6GI.js} +10 -10
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +86 -73
- package/dist/io-P2H75UV2.js +12 -0
- package/dist/{live-diff-QK4KC2FJ.js → live-diff-IXKBVG4K.js} +3 -3
- package/dist/{lock-GFXD6G2E.js → lock-46FWYE4D.js} +3 -2
- package/dist/{lock-commands-ET7NIOLH.js → lock-commands-ZZKZ4LZJ.js} +23 -21
- package/dist/{login-command-DFCURZLC.js → login-command-Z6CHTA57.js} +7 -7
- package/dist/{logout-command-WXVZQCAV.js → logout-command-ER6IKAYJ.js} +2 -2
- package/dist/{loop-7SAIGRCZ.js → loop-D5NPL4VH.js} +3 -3
- package/dist/{marketplace-command-BCOAAN2I.js → marketplace-command-P4IPLJ6J.js} +6 -6
- package/dist/{meta-client-57ZWVHST.js → meta-client-K2J4XH64.js} +6 -6
- package/dist/node.d.ts +5 -4
- package/dist/node.js +15 -13
- package/dist/{validate-command-SK5FPCV7.js → preflight-command-K346GPTY.js} +20 -18
- package/dist/{profile-command-QJAAUZIV.js → profile-command-LJSBDV2L.js} +5 -5
- package/dist/{release-command-4EXVLYV2.js → release-command-IMNTIVWK.js} +42 -38
- package/dist/response-BQVQ24l1.d.ts +844 -0
- package/dist/{routes-manifest-SP3ZXLMR.js → routes-manifest-PWZHDOI5.js} +2 -2
- package/dist/scaffold.js +2 -2
- package/dist/{static-host-D6KS7X45.js → static-host-3WMV7IZO.js} +1 -1
- package/dist/status-command-AL47VG7H.js +162 -0
- package/dist/{store-CUCBSYLj.d.ts → store-BLyNeQ8S.d.ts} +21 -8
- package/dist/{test-command-2F5LKMI6.js → test-command-YAZLKLGQ.js} +45 -28
- package/dist/{upgrade-command-QL523I62.js → upgrade-command-BN3EHAOI.js} +16 -14
- package/dist/{workspace-K72NP7SX.js → workspace-2COHDBM3.js} +1 -1
- package/dist/{workspace-command-HYA6JEKK.js → workspace-command-MNK7Y7MQ.js} +36 -34
- package/dist/{workspace-export-AJMGN3CQ.js → workspace-export-DURY5WYL.js} +2 -2
- package/dist/{response-CVAE2kMj.d.ts → xdo-BjJj5W_E.d.ts} +1 -837
- package/guides/README.md +2 -2
- package/guides/cli.md +17 -19
- package/guides/codegen.md +21 -5
- package/guides/coverage.md +1 -1
- package/guides/deploying.md +31 -34
- package/guides/environment.md +4 -4
- package/guides/object-kinds.md +3 -3
- package/guides/project-structure.md +1 -1
- package/guides/scaffold.md +25 -2
- package/guides/typed-frontend.md +2 -2
- package/llms/filters.md +11 -10
- package/llms/kinds-agent-mcp.md +1 -1
- package/llms/kinds-core.md +2 -2
- package/llms/kinds-realtime.md +1 -1
- package/llms/lock.md +5 -5
- package/llms/statements-data.md +3 -1
- package/llms/tests.md +1 -1
- package/llms/values.md +1 -1
- package/llms-full.txt +65 -63
- package/llms.txt +40 -41
- package/manifest.json +96 -427
- package/package.json +7 -2
- package/dist/chunk-3EYUR3TX.js +0 -100
- package/dist/chunk-JQJPFUZI.js +0 -118
- package/dist/chunk-YNZFIY4J.js +0 -78
- package/dist/codegen-command-YSCSCVT5.js +0 -43
- package/dist/env-target-4T7AT347.js +0 -16
- package/dist/init-command-OVFFW4QS.js +0 -30
- package/dist/io-M7XZEMK7.js +0 -11
- package/dist/sandbox-details-command-EDO56IY3.js +0 -18
- package/dist/sandbox-export-command-MO6DEZ7Z.js +0 -24
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
linkedTableOf,
|
|
3
|
+
tableRefOf
|
|
4
|
+
} from "./chunk-EHP3WPEG.js";
|
|
5
|
+
import {
|
|
6
|
+
deepEqual,
|
|
7
|
+
normalize
|
|
8
|
+
} from "./chunk-3INK4Y4E.js";
|
|
9
|
+
import {
|
|
10
|
+
STATEMENT_SURFACES,
|
|
11
|
+
sPathOf
|
|
12
|
+
} from "./chunk-BC2C5GVI.js";
|
|
13
|
+
import {
|
|
14
|
+
sha1Bytes
|
|
15
|
+
} from "./chunk-OHX6MIUZ.js";
|
|
16
|
+
|
|
17
|
+
// src/bundle/catalog.ts
|
|
18
|
+
var cached;
|
|
19
|
+
function statementCatalog() {
|
|
20
|
+
if (cached) return cached;
|
|
21
|
+
const map = /* @__PURE__ */ new Map();
|
|
22
|
+
for (const [surface, storedName] of STATEMENT_SURFACES) {
|
|
23
|
+
const existing = map.get(storedName);
|
|
24
|
+
if (existing) {
|
|
25
|
+
map.set(storedName, { ...existing, surfaces: [...existing.surfaces, surface] });
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
map.set(storedName, {
|
|
29
|
+
storedName,
|
|
30
|
+
surface,
|
|
31
|
+
sPath: sPathOf(surface),
|
|
32
|
+
surfaces: [surface]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
cached = map;
|
|
36
|
+
return map;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/bundle/walk.ts
|
|
40
|
+
var SUB_STACK_KEYS = ["if", "elif", "else", "then", "run"];
|
|
41
|
+
var SUB_STACK_LABELS = {
|
|
42
|
+
"mvp:conditional": { if: "then", elif: "elif", else: "else" },
|
|
43
|
+
"mvp:conditional_elif": { if: "then" },
|
|
44
|
+
"mvp:switch": { elif: "cases", else: "default" },
|
|
45
|
+
"mvp:switch_case": { if: "body" },
|
|
46
|
+
"mvp:try_catch": { if: "try", else: "catch", then: "finally" }
|
|
47
|
+
};
|
|
48
|
+
var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
49
|
+
function runOf(value) {
|
|
50
|
+
if (!isRecord(value)) return null;
|
|
51
|
+
const run = value.run;
|
|
52
|
+
return Array.isArray(run) ? run : null;
|
|
53
|
+
}
|
|
54
|
+
function subStacks(raw) {
|
|
55
|
+
const context = raw?.context;
|
|
56
|
+
if (!isRecord(context)) return [];
|
|
57
|
+
const labels = SUB_STACK_LABELS[raw.name] ?? {};
|
|
58
|
+
const found = [];
|
|
59
|
+
const push = (key, value) => {
|
|
60
|
+
const run = key === "run" ? Array.isArray(value) ? value : null : runOf(value);
|
|
61
|
+
if (!run) return;
|
|
62
|
+
found.push({ key, label: labels[key] ?? (key === "run" ? "body" : key), run });
|
|
63
|
+
};
|
|
64
|
+
for (const key of SUB_STACK_KEYS) {
|
|
65
|
+
if (Object.hasOwn(context, key)) push(key, context[key]);
|
|
66
|
+
}
|
|
67
|
+
for (const key of Object.keys(context)) {
|
|
68
|
+
if (!SUB_STACK_KEYS.includes(key)) push(key, context[key]);
|
|
69
|
+
}
|
|
70
|
+
return found;
|
|
71
|
+
}
|
|
72
|
+
function statementPath(segments) {
|
|
73
|
+
return segments.join(".");
|
|
74
|
+
}
|
|
75
|
+
function walk(run) {
|
|
76
|
+
const out = [];
|
|
77
|
+
const pending = [];
|
|
78
|
+
for (let i = run.length - 1; i >= 0; i--) {
|
|
79
|
+
pending.push({ raw: run[i], path: statementPath([i]), depth: 0 });
|
|
80
|
+
}
|
|
81
|
+
while (pending.length > 0) {
|
|
82
|
+
const frame = pending.pop();
|
|
83
|
+
out.push(frame);
|
|
84
|
+
const children = [];
|
|
85
|
+
for (const sub of subStacks(frame.raw)) {
|
|
86
|
+
for (let i = 0; i < sub.run.length; i++) {
|
|
87
|
+
children.push({
|
|
88
|
+
raw: sub.run[i],
|
|
89
|
+
path: statementPath([frame.path, sub.key, i]),
|
|
90
|
+
depth: frame.depth + 1
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
for (let i = children.length - 1; i >= 0; i--) pending.push(children[i]);
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/bundle/hash.ts
|
|
100
|
+
var isRecord2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
101
|
+
function withoutIgnoredInputs(value) {
|
|
102
|
+
if (Array.isArray(value)) return value.map(withoutIgnoredInputs);
|
|
103
|
+
if (!isRecord2(value)) return value;
|
|
104
|
+
const out = {};
|
|
105
|
+
for (const [key, member] of Object.entries(value)) {
|
|
106
|
+
if (key === "input" && Array.isArray(member)) {
|
|
107
|
+
out[key] = member.filter((entry) => !(isRecord2(entry) && entry.ignore === true)).map(withoutIgnoredInputs);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
out[key] = withoutIgnoredInputs(member);
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
function canonicalJson(value) {
|
|
115
|
+
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
116
|
+
if (isRecord2(value)) {
|
|
117
|
+
const parts = Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key])}`);
|
|
118
|
+
return `{${parts.join(",")}}`;
|
|
119
|
+
}
|
|
120
|
+
return value === void 0 ? "null" : JSON.stringify(value);
|
|
121
|
+
}
|
|
122
|
+
var HEX = "0123456789abcdef";
|
|
123
|
+
function structuralHash(raw) {
|
|
124
|
+
const reduced = withoutIgnoredInputs(normalize(raw));
|
|
125
|
+
const bytes = sha1Bytes(canonicalJson(reduced));
|
|
126
|
+
let hex = "";
|
|
127
|
+
for (const byte of bytes) hex += HEX[byte >> 4] + HEX[byte & 15];
|
|
128
|
+
return hex;
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
SUB_STACK_KEYS,
|
|
132
|
+
canonicalJson,
|
|
133
|
+
deepEqual,
|
|
134
|
+
linkedTableOf,
|
|
135
|
+
normalize,
|
|
136
|
+
statementCatalog,
|
|
137
|
+
statementPath,
|
|
138
|
+
structuralHash,
|
|
139
|
+
subStacks,
|
|
140
|
+
tableRefOf,
|
|
141
|
+
walk
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fixtureDirForKind
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCFIPDB3.js";
|
|
4
4
|
|
|
5
5
|
// src/validate/capture.ts
|
|
6
6
|
import { mkdirSync, writeFileSync } from "fs";
|
|
@@ -29,4 +29,4 @@ function safeName(name) {
|
|
|
29
29
|
export {
|
|
30
30
|
captureFixtures
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=capture-
|
|
32
|
+
//# sourceMappingURL=capture-4WVJY4DQ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RCT7UX7B.js";
|
|
4
4
|
import {
|
|
5
5
|
atomicWrite
|
|
6
6
|
} from "./chunk-GNPVYOPB.js";
|
|
@@ -170,4 +170,4 @@ export {
|
|
|
170
170
|
upgradeCommand,
|
|
171
171
|
maybeNotifyUpdate
|
|
172
172
|
};
|
|
173
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-22TKBSDV.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
presetFilePath,
|
|
3
3
|
resolveAiPresets,
|
|
4
4
|
scaffoldProject
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KA6G2L7U.js";
|
|
6
6
|
import {
|
|
7
7
|
runNpmCapturingStderr
|
|
8
8
|
} from "./chunk-ZSYZTGJH.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
allFrontendPresets,
|
|
12
12
|
findFrontendPreset,
|
|
13
13
|
resolveFrameworkFlag
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YBC3IKMF.js";
|
|
15
15
|
import {
|
|
16
16
|
initLanding,
|
|
17
17
|
renderApiTs,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
renderViteConfig,
|
|
28
28
|
renderXanoExampleMd,
|
|
29
29
|
renderXanoIndex
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ANUDXFEX.js";
|
|
31
31
|
import {
|
|
32
32
|
DEFAULT_DARK_MODE,
|
|
33
33
|
defaultThemeChoice,
|
|
@@ -41,10 +41,14 @@ import {
|
|
|
41
41
|
} from "./chunk-Q77KNEUL.js";
|
|
42
42
|
import {
|
|
43
43
|
readVersion
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-RCT7UX7B.js";
|
|
45
|
+
import {
|
|
46
|
+
ENV_SPELLINGS,
|
|
47
|
+
parseEnvSelector
|
|
48
|
+
} from "./chunk-CTD5ZCV6.js";
|
|
45
49
|
import {
|
|
46
50
|
UsageError
|
|
47
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
48
52
|
import {
|
|
49
53
|
blank,
|
|
50
54
|
detail,
|
|
@@ -393,7 +397,33 @@ function buildFileSet(vars, preset, choice) {
|
|
|
393
397
|
{ path: "xano/EXAMPLE.md", content: renderXanoExampleMd(vars) }
|
|
394
398
|
];
|
|
395
399
|
}
|
|
400
|
+
function resolveFromSource(raw) {
|
|
401
|
+
const env = parseEnvSelector(raw);
|
|
402
|
+
if (env !== void 0) return env;
|
|
403
|
+
if (/\.json$/i.test(raw) || /[\\/]/.test(raw)) return { kind: "file", path: raw };
|
|
404
|
+
throw new UsageError(
|
|
405
|
+
`--from does not take "${raw}". Sources are ${ENV_SPELLINGS}, or a path to a bundle .json (\`xanots ephemeral list\` shows the environment names; bare \`ephemeral\` is the one this project last deployed to).`,
|
|
406
|
+
{ helpFor: { command: "init" } }
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
function rejectPullOnlyFlags(args) {
|
|
410
|
+
const passed = [
|
|
411
|
+
...args.report !== void 0 ? ["--report"] : [],
|
|
412
|
+
...args.skipRoundtrip ? ["--skip-roundtrip"] : []
|
|
413
|
+
];
|
|
414
|
+
if (passed.length === 0) return;
|
|
415
|
+
throw new UsageError(
|
|
416
|
+
`${passed.join(" and ")} ${passed.length === 1 ? "describes" : "describe"} the pull that \`--from\` performs, so ${passed.length === 1 ? "it does" : "they do"} nothing without it. Add \`--from <source>\`, or drop ${passed.length === 1 ? "the flag" : "them"}.`,
|
|
417
|
+
{ helpFor: { command: "init" } }
|
|
418
|
+
);
|
|
419
|
+
}
|
|
396
420
|
async function runInitCommand(args) {
|
|
421
|
+
if (args.from !== void 0) {
|
|
422
|
+
const source = resolveFromSource(args.from);
|
|
423
|
+
const { runInitFromCommand } = await import("./codegen-command-FUT2KJB6.js");
|
|
424
|
+
return runInitFromCommand(args, source);
|
|
425
|
+
}
|
|
426
|
+
rejectPullOnlyFlags(args);
|
|
397
427
|
const targetArg = args.positionals[0] ?? ".";
|
|
398
428
|
const targetDir = resolve(targetArg);
|
|
399
429
|
const appName = sanitizeAppName(args.name ?? basename(targetDir));
|
|
@@ -468,6 +498,7 @@ export {
|
|
|
468
498
|
resolveThemeChoice,
|
|
469
499
|
sanitizeAppName,
|
|
470
500
|
projectShellFiles,
|
|
501
|
+
resolveFromSource,
|
|
471
502
|
runInitCommand
|
|
472
503
|
};
|
|
473
|
-
//# sourceMappingURL=chunk-
|
|
504
|
+
//# sourceMappingURL=chunk-4IF54NU5.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compileBundle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RCT7UX7B.js";
|
|
4
4
|
import {
|
|
5
5
|
missingArgument
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
7
7
|
|
|
8
8
|
// src/emit/bundle-input.ts
|
|
9
9
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
assertBundleInput,
|
|
35
35
|
loadBundleText
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-4Q7ZOHH7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UsageError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
4
4
|
import {
|
|
5
5
|
style
|
|
6
6
|
} from "./chunk-EZG76F7R.js";
|
|
@@ -56,4 +56,4 @@ export {
|
|
|
56
56
|
confirm,
|
|
57
57
|
promptLine
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-AIZKXUNP.js.map
|
|
@@ -36,7 +36,7 @@ function renderPackageJson({ appName, sdkVersion }, preset, choice = defaultThem
|
|
|
36
36
|
// delete-and-recreate instead of rename-in-place. The lock has to be
|
|
37
37
|
// adopted BEFORE the identities matter — by the time a rename lands
|
|
38
38
|
// against data anyone cares about, the guids have already drifted and
|
|
39
|
-
// recovery is `xanots lock
|
|
39
|
+
// recovery is `xanots lock import`. The scaffold is the earliest possible
|
|
40
40
|
// moment, so it opts in from the first export (issue #26). Once the file
|
|
41
41
|
// exists every export uses it, flag or not.
|
|
42
42
|
"xano:export": `${check} && xanots export ./xano/index.ts --out workspace.json --lock`,
|
|
@@ -226,7 +226,9 @@ npm run xano:deploy # build the frontend, then ship it with the backend
|
|
|
226
226
|
- \`npm run xano:deploy\` deploys the backend and the built frontend to a live
|
|
227
227
|
**ephemeral** environment and prints its URL. Run it again to refresh the same
|
|
228
228
|
environment; if it expired, a fresh one is created and the new URL is called out.
|
|
229
|
-
-
|
|
229
|
+
- \`xanots status\` says who you are signed in as, which workspace you are bound to, and
|
|
230
|
+
which environment this project last deployed to \u2014 its URL, and when it expires. You
|
|
231
|
+
never have to remember the environment's name.
|
|
230
232
|
- \`npm run xano:test\` runs the tests the DEPLOYED environment carries \u2014 the \`tests\`
|
|
231
233
|
on a query/function/middleware and any \`workflowTest()\`. It compiles nothing, so
|
|
232
234
|
deploy first. A failing suite exits 5, distinct from a crash. \`xanots deploy
|
|
@@ -243,7 +245,7 @@ public URLs).
|
|
|
243
245
|
|
|
244
246
|
It is created by \`npm run xano:export\` or \`npm run xano:deploy\`, and **must be
|
|
245
247
|
committed**. Adopt it from the first export: once identities have drifted, the
|
|
246
|
-
recovery path is \`xanots lock
|
|
248
|
+
recovery path is \`xanots lock import <live-bundle.json> --lock=xano/xano.lock\`
|
|
247
249
|
against the deployed workspace.
|
|
248
250
|
|
|
249
251
|
\`\`\`bash
|
|
@@ -252,7 +254,7 @@ npm run xano:check # CI: fail if the export would change xano.lock
|
|
|
252
254
|
|
|
253
255
|
To rename an object: rename it in code, run \`npm run xano:export\` (stderr prints
|
|
254
256
|
the exact fix-up), run \`xanots lock rename <kind> <old> <new> --lock=xano/xano.lock\`,
|
|
255
|
-
then export again. \`lock rename\` and \`lock
|
|
257
|
+
then export again. \`lock rename\` and \`lock import\` need that flag here \u2014 they take no
|
|
256
258
|
entry file, so they look for the lock in the current directory, while
|
|
257
259
|
\`lock prune ./xano/index.ts\` derives it from the entry like \`export\` does.
|
|
258
260
|
|
|
@@ -267,7 +269,7 @@ body \u2014 change a def and the frontend types follow.
|
|
|
267
269
|
> file with \`tsx <file.ts>\` **from inside the project root** \u2014 not \`tsx -e\`, not
|
|
268
270
|
> bare \`node file.ts\`, and not from another directory (they mis-resolve the
|
|
269
271
|
> intra-workspace \`.js\` imports and the \`@xanots/sdk\` specifier). Or use
|
|
270
|
-
> \`xanots
|
|
272
|
+
> \`xanots routes xano/index.ts\` to list every endpoint's verb + path.
|
|
271
273
|
|
|
272
274
|
## The frontend
|
|
273
275
|
|
|
@@ -450,17 +452,8 @@ kind.
|
|
|
450
452
|
### Event-driven objects
|
|
451
453
|
|
|
452
454
|
A scheduled \`task\`, an \`mcpServer\`, and every trigger **fire normally on an
|
|
453
|
-
ephemeral** \u2014 \`deploy\`
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
Under \`--dest sandbox\` they **deploy but do not fire**: they import cleanly, never
|
|
457
|
-
execute, and there's no way to fire one manually (a table insert/update/delete does
|
|
458
|
-
NOT run its trigger). Only synchronously-invoked objects \u2014 queries, functions, and
|
|
459
|
-
the agents an endpoint calls with \`s.ai.agent.run\` \u2014 run there. If you must stay on
|
|
460
|
-
the sandbox, factor the body into a \`defineFunction\` you can also call directly
|
|
461
|
-
(e.g. from a query via \`s.function.run\`) and put the assertions on THAT \u2014 a
|
|
462
|
-
\`tests\` entry on the function, or a \`workflowTest\` that calls it. See
|
|
463
|
-
\`llms.txt\` for the full guidance.
|
|
455
|
+
ephemeral** \u2014 where \`deploy\` sends them \u2014 so test them by deploying and letting
|
|
456
|
+
them run.
|
|
464
457
|
|
|
465
458
|
## Wire the frontend
|
|
466
459
|
|
|
@@ -478,15 +471,13 @@ Keep the client bundle lean (**split route metadata from stack-heavy authoring**
|
|
|
478
471
|
\u2014 drags that whole graph in. For those, don't import the def in the browser:
|
|
479
472
|
declare its \`{ path, verb }\` as plain metadata (see the \`ROUTES\` example in
|
|
480
473
|
\`api.ts\`) and verify it against the compiled bundle with
|
|
481
|
-
\`npx xanots
|
|
474
|
+
\`npx xanots routes xano/index.ts\`.
|
|
482
475
|
`;
|
|
483
476
|
}
|
|
484
477
|
function describeOrigin(o) {
|
|
485
478
|
switch (o.source) {
|
|
486
479
|
case "workspace":
|
|
487
480
|
return `workspace ${o.origin}`;
|
|
488
|
-
case "sandbox":
|
|
489
|
-
return "the sandbox workspace";
|
|
490
481
|
case "ephemeral":
|
|
491
482
|
return `ephemeral "${o.origin}"`;
|
|
492
483
|
case "file":
|
|
@@ -500,7 +491,7 @@ function renderCodegenMarker({ sdkVersion }, origin, generatedAt, report) {
|
|
|
500
491
|
origin: origin.origin,
|
|
501
492
|
sdkVersion,
|
|
502
493
|
generatedAt,
|
|
503
|
-
note: "Written by `xanots
|
|
494
|
+
note: "Written by `xanots init --from`. Its presence lets a re-run refresh xano/ in place.",
|
|
504
495
|
// The findings, so parity is trackable release over release and gateable
|
|
505
496
|
// in CI without scraping stderr. Omitted rather than written empty when
|
|
506
497
|
// the caller has none to record.
|
|
@@ -536,11 +527,11 @@ npm run xano:deploy # typecheck, build the frontend, ship both
|
|
|
536
527
|
|
|
537
528
|
## Read this before deploying
|
|
538
529
|
|
|
539
|
-
- **\`xano/\` is disposable.** Re-running \`xanots
|
|
530
|
+
- **\`xano/\` is disposable.** Re-running \`xanots init --from\` on this directory
|
|
540
531
|
rewrites it wholesale \u2014 no merge, no diff, no preservation of hand edits. The rest of
|
|
541
532
|
the project (this README, \`package.json\`, \`frontend/\`) is yours and is left alone.
|
|
542
533
|
- **Deploying is a full replace.** The import path clears the target workspace and
|
|
543
|
-
re-imports. Send this only to an **ephemeral
|
|
534
|
+
re-imports. Send this only to an **ephemeral** environment \u2014 never to a
|
|
544
535
|
workspace holding data you care about. That is why \`npm run xano:deploy\` targets an
|
|
545
536
|
ephemeral env and there is no deploy-to-your-real-workspace command.
|
|
546
537
|
- **This is schema only.** Table rows are not carried, and neither are payload sections
|
|
@@ -555,7 +546,7 @@ ${secrets}
|
|
|
555
546
|
npm run dev # run the starter frontend
|
|
556
547
|
npm run typecheck # the whole project, both halves
|
|
557
548
|
npm run xano:export # compile the backend to workspace.json (don't commit it)
|
|
558
|
-
npx xanots
|
|
549
|
+
npx xanots routes xano/index.ts # list every endpoint's verb + path
|
|
559
550
|
\`\`\`
|
|
560
551
|
|
|
561
552
|
[\`frontend/src/lib/api.ts\`](frontend/src/lib/api.ts) shows the one contract: derive
|
|
@@ -644,7 +635,7 @@ function codegenLanding({ appName }, origin) {
|
|
|
644
635
|
],
|
|
645
636
|
[
|
|
646
637
|
{ text: "List the endpoints: " },
|
|
647
|
-
{ code: "npx xanots
|
|
638
|
+
{ code: "npx xanots routes xano/index.ts" },
|
|
648
639
|
{ text: ", then wire them up in " },
|
|
649
640
|
{ code: "frontend/src/lib/api.ts" },
|
|
650
641
|
{ text: "." }
|
|
@@ -821,7 +812,7 @@ function renderApiTs() {
|
|
|
821
812
|
// those s.*/c.* factory calls run at module load and can't be tree-shaken out.
|
|
822
813
|
// \u2022 For such a stack-heavy endpoint, don't import its def in the browser at all \u2014
|
|
823
814
|
// declare its { path, verb } in the ROUTES table below and verify it against
|
|
824
|
-
// the compiled bundle with \`npx xanots
|
|
815
|
+
// the compiled bundle with \`npx xanots routes xano/index.ts\`.
|
|
825
816
|
//
|
|
826
817
|
// This starter has no endpoints yet. Once you add one in xano/, wire it like:
|
|
827
818
|
//
|
|
@@ -847,7 +838,7 @@ function renderApiTs() {
|
|
|
847
838
|
// }
|
|
848
839
|
//
|
|
849
840
|
// The stack-heavy escape hatch \u2014 plain metadata, no def import, no bundle cost.
|
|
850
|
-
// Keep it in sync with \`npx xanots
|
|
841
|
+
// Keep it in sync with \`npx xanots routes xano/index.ts\` (it prints verb + path):
|
|
851
842
|
//
|
|
852
843
|
// export const ROUTES = {
|
|
853
844
|
// triageRequest: { path: "/api:notes/triage_request", verb: "POST" },
|
|
@@ -887,4 +878,4 @@ export {
|
|
|
887
878
|
renderCnUtil,
|
|
888
879
|
renderApiTs
|
|
889
880
|
};
|
|
890
|
-
//# sourceMappingURL=chunk-
|
|
881
|
+
//# sourceMappingURL=chunk-ANUDXFEX.js.map
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
// src/fields/generated/field-methods.generated.ts
|
|
2
|
-
var FIELD_METHODS = {
|
|
3
|
-
"decimal": {
|
|
4
|
-
"max": "int",
|
|
5
|
-
"min": "int"
|
|
6
|
-
},
|
|
7
|
-
"email": {
|
|
8
|
-
"lower": "bool",
|
|
9
|
-
"trim": "bool"
|
|
10
|
-
},
|
|
11
|
-
"int": {
|
|
12
|
-
"max": "int",
|
|
13
|
-
"min": "int"
|
|
14
|
-
},
|
|
15
|
-
"password": {
|
|
16
|
-
"max": "int",
|
|
17
|
-
"min": "int",
|
|
18
|
-
"minAlpha": "int",
|
|
19
|
-
"minDigit": "int",
|
|
20
|
-
"minLowerAlpha": "int",
|
|
21
|
-
"minSymbol": "int",
|
|
22
|
-
"minUpperAlpha": "int",
|
|
23
|
-
"salt": "text"
|
|
24
|
-
},
|
|
25
|
-
"tableRef": {
|
|
26
|
-
"max": "int",
|
|
27
|
-
"min": "int"
|
|
28
|
-
},
|
|
29
|
-
"text": {
|
|
30
|
-
"alphaOk": "bool",
|
|
31
|
-
"digitOk": "bool",
|
|
32
|
-
"lower": "bool",
|
|
33
|
-
"max": "int",
|
|
34
|
-
"min": "int",
|
|
35
|
-
"ok": "text",
|
|
36
|
-
"pattern": "text",
|
|
37
|
-
"startsWith": "text",
|
|
38
|
-
"trim": "bool",
|
|
39
|
-
"upper": "bool"
|
|
40
|
-
},
|
|
41
|
-
"vector": {
|
|
42
|
-
"max": "int",
|
|
43
|
-
"min": "int"
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
1
|
// src/statements/surfaces.ts
|
|
48
2
|
var STATEMENT_SURFACES = [
|
|
49
3
|
["action.call", "mvp:action"],
|
|
@@ -288,31 +242,10 @@ function sPathOf(surfaceKey) {
|
|
|
288
242
|
return SPATH_OVERRIDES[surfaceKey] ?? surfaceKey.replace(/^stack\|/, "");
|
|
289
243
|
}
|
|
290
244
|
|
|
291
|
-
// src/statements/superseded.ts
|
|
292
|
-
var SUPERSEDED_STATEMENTS = /* @__PURE__ */ new Map([
|
|
293
|
-
// Four crypto families, each phased forward with breaking changes between
|
|
294
|
-
// versions. The engine still registers a class for every one of them.
|
|
295
|
-
["mvp:crypto_jwe_decode", "mvp:crypto_jwe_decode2"],
|
|
296
|
-
["mvp:crypto_jwe_encode", "mvp:crypto_jwe_encode3"],
|
|
297
|
-
["mvp:crypto_jwe_encode2", "mvp:crypto_jwe_encode3"],
|
|
298
|
-
["mvp:crypto_jws_decode", "mvp:crypto_jws_decode2"],
|
|
299
|
-
["mvp:crypto_jws_encode", "mvp:crypto_jws_encode2"],
|
|
300
|
-
// Retired outright — an old third-party log connector with no successor.
|
|
301
|
-
["mvp:connect_ncscale_send_log", ""]
|
|
302
|
-
]);
|
|
303
|
-
function supersededBy(storedName, surfaceOf) {
|
|
304
|
-
const successor = SUPERSEDED_STATEMENTS.get(storedName);
|
|
305
|
-
if (successor === void 0 || successor === "") return null;
|
|
306
|
-
return surfaceOf(successor) ?? successor;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
245
|
export {
|
|
310
|
-
FIELD_METHODS,
|
|
311
246
|
STATEMENT_SURFACES,
|
|
312
247
|
TOTAL_STATEMENTS,
|
|
313
248
|
IMPLEMENTED_STATEMENTS,
|
|
314
|
-
sPathOf
|
|
315
|
-
SUPERSEDED_STATEMENTS,
|
|
316
|
-
supersededBy
|
|
249
|
+
sPathOf
|
|
317
250
|
};
|
|
318
|
-
//# sourceMappingURL=chunk-
|
|
251
|
+
//# sourceMappingURL=chunk-BC2C5GVI.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/fields/generated/field-methods.generated.ts
|
|
2
|
+
var FIELD_METHODS = {
|
|
3
|
+
"decimal": {
|
|
4
|
+
"max": "int",
|
|
5
|
+
"min": "int"
|
|
6
|
+
},
|
|
7
|
+
"email": {
|
|
8
|
+
"lower": "bool",
|
|
9
|
+
"trim": "bool"
|
|
10
|
+
},
|
|
11
|
+
"int": {
|
|
12
|
+
"max": "int",
|
|
13
|
+
"min": "int"
|
|
14
|
+
},
|
|
15
|
+
"password": {
|
|
16
|
+
"max": "int",
|
|
17
|
+
"min": "int",
|
|
18
|
+
"minAlpha": "int",
|
|
19
|
+
"minDigit": "int",
|
|
20
|
+
"minLowerAlpha": "int",
|
|
21
|
+
"minSymbol": "int",
|
|
22
|
+
"minUpperAlpha": "int",
|
|
23
|
+
"salt": "text"
|
|
24
|
+
},
|
|
25
|
+
"tableRef": {
|
|
26
|
+
"max": "int",
|
|
27
|
+
"min": "int"
|
|
28
|
+
},
|
|
29
|
+
"text": {
|
|
30
|
+
"alphaOk": "bool",
|
|
31
|
+
"digitOk": "bool",
|
|
32
|
+
"lower": "bool",
|
|
33
|
+
"max": "int",
|
|
34
|
+
"min": "int",
|
|
35
|
+
"ok": "text",
|
|
36
|
+
"pattern": "text",
|
|
37
|
+
"startsWith": "text",
|
|
38
|
+
"trim": "bool",
|
|
39
|
+
"upper": "bool"
|
|
40
|
+
},
|
|
41
|
+
"vector": {
|
|
42
|
+
"max": "int",
|
|
43
|
+
"min": "int"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/statements/superseded.ts
|
|
48
|
+
var SUPERSEDED_STATEMENTS = /* @__PURE__ */ new Map([
|
|
49
|
+
// Four crypto families, each phased forward with breaking changes between
|
|
50
|
+
// versions. The engine still registers a class for every one of them.
|
|
51
|
+
["mvp:crypto_jwe_decode", "mvp:crypto_jwe_decode2"],
|
|
52
|
+
["mvp:crypto_jwe_encode", "mvp:crypto_jwe_encode3"],
|
|
53
|
+
["mvp:crypto_jwe_encode2", "mvp:crypto_jwe_encode3"],
|
|
54
|
+
["mvp:crypto_jws_decode", "mvp:crypto_jws_decode2"],
|
|
55
|
+
["mvp:crypto_jws_encode", "mvp:crypto_jws_encode2"],
|
|
56
|
+
// Retired outright — an old third-party log connector with no successor.
|
|
57
|
+
["mvp:connect_ncscale_send_log", ""]
|
|
58
|
+
]);
|
|
59
|
+
function supersededBy(storedName, surfaceOf) {
|
|
60
|
+
const successor = SUPERSEDED_STATEMENTS.get(storedName);
|
|
61
|
+
if (successor === void 0 || successor === "") return null;
|
|
62
|
+
return surfaceOf(successor) ?? successor;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
FIELD_METHODS,
|
|
67
|
+
SUPERSEDED_STATEMENTS,
|
|
68
|
+
supersededBy
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=chunk-BSK7ELHU.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UsageError
|
|
3
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
4
|
+
|
|
5
|
+
// src/emit/env-selector.ts
|
|
6
|
+
var ENV_SPELLINGS = "workspace, ephemeral, or ephemeral:<name>";
|
|
7
|
+
function parseEnvSelector(raw) {
|
|
8
|
+
if (raw === "workspace") return { kind: "workspace" };
|
|
9
|
+
if (raw === "ephemeral") return { kind: "ephemeral" };
|
|
10
|
+
if (raw.startsWith("ephemeral:")) {
|
|
11
|
+
const name = raw.slice("ephemeral:".length);
|
|
12
|
+
return name === "" ? void 0 : { kind: "ephemeral", name };
|
|
13
|
+
}
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
function unknownEnv(flag, raw, helpFor) {
|
|
17
|
+
return new UsageError(
|
|
18
|
+
`${flag} does not take "${raw}". Environments are ${ENV_SPELLINGS} (\`xanots ephemeral list\` shows the names; bare \`ephemeral\` is the one this project last deployed to).`,
|
|
19
|
+
{ helpFor }
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
ENV_SPELLINGS,
|
|
25
|
+
parseEnvSelector,
|
|
26
|
+
unknownEnv
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-CTD5ZCV6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deepEqual,
|
|
3
3
|
normalize
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3INK4Y4E.js";
|
|
5
5
|
|
|
6
6
|
// src/deploy/live-diff.ts
|
|
7
7
|
function rows(bundle, key) {
|
|
@@ -254,4 +254,4 @@ export {
|
|
|
254
254
|
sharedSchemaChanges,
|
|
255
255
|
compareToLive
|
|
256
256
|
};
|
|
257
|
-
//# sourceMappingURL=chunk-
|
|
257
|
+
//# sourceMappingURL=chunk-DBFU47BJ.js.map
|