@xanots/sdk 0.0.1

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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +384 -0
  3. package/dist/agent-file-refresh-7XCACU34.js +95 -0
  4. package/dist/bin.d.ts +1 -0
  5. package/dist/bin.js +184 -0
  6. package/dist/capture-HUV5BNTC.js +32 -0
  7. package/dist/chunk-26CNBZE2.js +963 -0
  8. package/dist/chunk-33ND6LKO.js +78 -0
  9. package/dist/chunk-3DUAGYGP.js +1550 -0
  10. package/dist/chunk-3IGNIP6R.js +89 -0
  11. package/dist/chunk-47WDWMBJ.js +14 -0
  12. package/dist/chunk-4BXJGVZ3.js +318 -0
  13. package/dist/chunk-4HT3BNZ7.js +675 -0
  14. package/dist/chunk-4YMD2OOZ.js +23 -0
  15. package/dist/chunk-5WGEURVI.js +156 -0
  16. package/dist/chunk-5YTBTF25.js +29 -0
  17. package/dist/chunk-6DHBYBTO.js +166 -0
  18. package/dist/chunk-76QBEIGO.js +66 -0
  19. package/dist/chunk-7DKX2SPN.js +100 -0
  20. package/dist/chunk-7REDODS2.js +468 -0
  21. package/dist/chunk-C56BC2FY.js +254 -0
  22. package/dist/chunk-DGSF2Q5H.js +60 -0
  23. package/dist/chunk-EMCAWMHC.js +3982 -0
  24. package/dist/chunk-EZG76F7R.js +159 -0
  25. package/dist/chunk-FJ6ZS5KB.js +3607 -0
  26. package/dist/chunk-GNPVYOPB.js +17 -0
  27. package/dist/chunk-HJPTWBLH.js +38 -0
  28. package/dist/chunk-IZW6MK3U.js +248 -0
  29. package/dist/chunk-LH6Z6KFV.js +247 -0
  30. package/dist/chunk-MZUI3JNX.js +93 -0
  31. package/dist/chunk-NDZFBZHC.js +167 -0
  32. package/dist/chunk-NOO35BQ2.js +37 -0
  33. package/dist/chunk-NUQCEOKA.js +13 -0
  34. package/dist/chunk-QTNO2WD6.js +56 -0
  35. package/dist/chunk-RVB7ITKN.js +49 -0
  36. package/dist/chunk-TRU5OHQ5.js +6904 -0
  37. package/dist/chunk-VKFQJEMW.js +814 -0
  38. package/dist/chunk-VTIL47DT.js +125 -0
  39. package/dist/chunk-WHOJWOSV.js +112 -0
  40. package/dist/chunk-WKP4D5MO.js +1692 -0
  41. package/dist/chunk-X4DVXBFY.js +38 -0
  42. package/dist/chunk-XQ22GLYS.js +118 -0
  43. package/dist/chunk-YDZYMZBE.js +670 -0
  44. package/dist/chunk-YGPIY3WT.js +1146 -0
  45. package/dist/chunk-YYRDLFSJ.js +602 -0
  46. package/dist/chunk-ZUTSMMAG.js +46 -0
  47. package/dist/cli.d.ts +331 -0
  48. package/dist/cli.js +33 -0
  49. package/dist/codegen-command-OOKK6AZK.js +40 -0
  50. package/dist/codegen.d.ts +114 -0
  51. package/dist/codegen.js +71 -0
  52. package/dist/completion-TIPPZN7H.js +298 -0
  53. package/dist/config-NL33PN4D.js +84 -0
  54. package/dist/deploy-command-4EQ7XX5G.js +451 -0
  55. package/dist/env-target-IFJ5QDHC.js +16 -0
  56. package/dist/ephemeral-command-3X3I4ULC.js +242 -0
  57. package/dist/index.d.ts +4477 -0
  58. package/dist/index.js +300 -0
  59. package/dist/init-command-R6H7ZXW5.js +27 -0
  60. package/dist/internal.d.ts +74 -0
  61. package/dist/internal.js +2065 -0
  62. package/dist/io-AMIKRLPC.js +11 -0
  63. package/dist/live-diff-Y3AKETHE.js +196 -0
  64. package/dist/lock-3CVKALKT.js +37 -0
  65. package/dist/lock-commands-XTR2YKLY.js +232 -0
  66. package/dist/login-command-ACJF6KWQ.js +167 -0
  67. package/dist/logout-command-MX3MJS5U.js +68 -0
  68. package/dist/loop-OM3P2Z6O.js +93 -0
  69. package/dist/marketplace-command-RATXTKXN.js +379 -0
  70. package/dist/meta-client-OW5WKWW7.js +170 -0
  71. package/dist/node.d.ts +59 -0
  72. package/dist/node.js +442 -0
  73. package/dist/profile-command-SWJ3SPKR.js +77 -0
  74. package/dist/release-command-VV5UVZKL.js +427 -0
  75. package/dist/response-CVAE2kMj.d.ts +1915 -0
  76. package/dist/routes-manifest-SP3ZXLMR.js +244 -0
  77. package/dist/runtime-V4C3AC3A.js +13 -0
  78. package/dist/sandbox-details-command-HJE5SPVG.js +18 -0
  79. package/dist/sandbox-export-command-QCJY4GMV.js +24 -0
  80. package/dist/static-host-D6KS7X45.js +138 -0
  81. package/dist/store-BQ97nKIF.d.ts +7760 -0
  82. package/dist/test-command-TSPBQHBM.js +383 -0
  83. package/dist/validate-command-4ERHJSCO.js +122 -0
  84. package/dist/verify-rollout-FAVQ6EJY.js +40 -0
  85. package/dist/workspace-K72NP7SX.js +49 -0
  86. package/dist/workspace-command-OF23DPNI.js +156 -0
  87. package/dist/workspace-export-AJMGN3CQ.js +10 -0
  88. package/llms/fields.md +104 -0
  89. package/llms/filters.md +183 -0
  90. package/llms/kinds-agent-mcp.md +11 -0
  91. package/llms/kinds-core.md +68 -0
  92. package/llms/kinds-realtime.md +76 -0
  93. package/llms/lambda.md +111 -0
  94. package/llms/legacy.md +43 -0
  95. package/llms/object-kinds.md +31 -0
  96. package/llms/statements-calls.md +23 -0
  97. package/llms/statements-catalog.md +309 -0
  98. package/llms/statements-data.md +58 -0
  99. package/llms/statements-runtime.md +48 -0
  100. package/llms/tests.md +58 -0
  101. package/llms/triggers.md +22 -0
  102. package/llms/values.md +29 -0
  103. package/llms-full.txt +1672 -0
  104. package/llms.txt +483 -0
  105. package/manifest.json +9592 -0
  106. package/package.json +110 -0
package/dist/cli.d.ts ADDED
@@ -0,0 +1,331 @@
1
+ /**
2
+ * One archive member (structurally an `ArchiveEntry`): its in-archive path and
3
+ * the serialized signed `type:"content"` envelope written there.
4
+ */
5
+ interface SeedContentFile {
6
+ /** `content/<table-guid>-<page>.json` (page 1-based, contiguous). */
7
+ name: string;
8
+ /** The serialized signed `type:"content"` envelope. */
9
+ content: string;
10
+ }
11
+ /** A seed value the schema says is not public, and where it came from. */
12
+ interface NonPublicSeedValue {
13
+ table: string;
14
+ column: string;
15
+ value: string;
16
+ /**
17
+ * Whether a static build can actually be searched for this value.
18
+ *
19
+ * `false` for a value below {@link MIN_SCANNABLE_LENGTH}, and for a non-string
20
+ * one. Those are collected rather than dropped (issue #45): being too short to
21
+ * search for is not the same as being safe, and the author is the only one who
22
+ * can judge which it is. The scanner skips them; the deploy path reports them.
23
+ */
24
+ scannable: boolean;
25
+ }
26
+
27
+ interface ParsedArgs {
28
+ command: string | undefined;
29
+ /**
30
+ * The verb of a noun-verb command (`sandbox deploy`, `profile me`): here
31
+ * `command` is the noun and `subcommand` is the verb.
32
+ * Undefined for the single-token verbs (`compile`/`export`/`lock`/…).
33
+ */
34
+ subcommand: string | undefined;
35
+ file: string | undefined;
36
+ out: string | undefined;
37
+ /** All non-flag arguments after the command (file is positionals[0]). */
38
+ positionals: string[];
39
+ /** `--lock` / `--lock=<path>`: opt into creating a lock file. */
40
+ lock: boolean;
41
+ /** The `--lock=<path>` override (default: `xano.lock` beside the entry). */
42
+ lockPath: string | undefined;
43
+ /**
44
+ * `--entry=<path>`: the workspace entry the lock sits beside, for the `lock`
45
+ * subcommands that take no entry file of their own (`rename`/`adopt`).
46
+ *
47
+ * Distinct from `--lock`, which names the lock FILE directly. This names the
48
+ * entry and lets the default be DERIVED the way `export --lock` and `prune`
49
+ * derive it — so the caller still supplied the anchor and nothing is guessed.
50
+ */
51
+ entryPath: string | undefined;
52
+ /** `--frozen-lock`: hard-fail if the export would change the lock (CI). */
53
+ frozenLock: boolean;
54
+ /**
55
+ * `--strict`: promote every export/deploy WARNING to a hard failure — the
56
+ * build diagnostics (a `bulk.update` that zero-fills omitted columns, an
57
+ * `ignoreEmpty` that drops its predicate; issue #15) as well as the CLI's own
58
+ * preflights (unresolvable filter names, issue #106; a stale `--emit`
59
+ * manifest). Warnings print either way; `--strict` decides whether a printed
60
+ * one still ships.
61
+ */
62
+ strict: boolean;
63
+ /** `--yes`/`-y`: confirm destructive lock maintenance non-interactively. */
64
+ yes: boolean;
65
+ /** `push --bundle <path>`: upload an already-exported bundle instead of a file entry. */
66
+ bundle: string | undefined;
67
+ /** `--reset`: accepted but redundant — every deploy is a full replace now. */
68
+ reset: boolean;
69
+ /**
70
+ * `--dest`: which environment to address.
71
+ *
72
+ * The parser accepts all three because `test` reads all three. `workspace` is
73
+ * refused by the commands that WRITE (`deploy`, `release`) at dispatch, with
74
+ * the explanation — not here, where the message could only say "bad value"
75
+ * for something that is a deliberate product boundary rather than a typo.
76
+ */
77
+ dest: "sandbox" | "ephemeral" | "workspace" | undefined;
78
+ /** `test --kind unit|workflow`: narrow to one test family (default: both). */
79
+ kind: "unit" | "workflow" | undefined;
80
+ /** `test run-all --concurrency <n>`: how many tests to run at once (default 1). */
81
+ concurrency: number | undefined;
82
+ /** `deploy --test`: run the environment's tests after the deploy lands. */
83
+ test: boolean;
84
+ /** `deploy --expires-hours <n>`: ephemeral create-time TTL (1–72, default 1 server-side). */
85
+ expiresHours: number | undefined;
86
+ /**
87
+ * `routes --emit <path>`: write the generated route module there instead of
88
+ * printing the table. Plain data + one interpolator, importing nothing, so a
89
+ * frontend gets the typed path/verb contract without the SDK runtime.
90
+ */
91
+ emit: string | undefined;
92
+ /** `deploy --static <dir>`: archive this directory and deploy it to the sandbox's static host. */
93
+ static: string | undefined;
94
+ /**
95
+ * `deploy --static-env KEY=VALUE` (repeatable): public config baked into EVERY
96
+ * html document of the static build as `window.<KEY>` globals. The backend URL is
97
+ * wired in automatically as `window.XANO_HOST`; these override/extend it.
98
+ * Served to the browser verbatim — public values only, never secrets.
99
+ */
100
+ staticEnv: Record<string, string>;
101
+ /**
102
+ * `deploy --static-host <name>`: the static-host NAME to deploy the frontend
103
+ * to (default `default`). Give each app a distinct host so deploys don't share
104
+ * and overwrite one `default` host — the shared host is why a first post-deploy
105
+ * load can serve a *previous* app's cached `index.html`.
106
+ */
107
+ staticHost: string | undefined;
108
+ /**
109
+ * `deploy --static-routing spa|multipage`: override how the host resolves URLs
110
+ * within the build. Normally unset — the shape is inferred from the bundle.
111
+ * Set it for a single-document site that wants real 404s, or a bundle carrying
112
+ * a stray `.html` that should still route entirely client-side.
113
+ */
114
+ staticRouting: "spa" | "multipage" | undefined;
115
+ /** `--origin <origin>`: Xano control-plane OAuth host. Default: $XANO_ORIGIN, then https://app.xano.com. */
116
+ authHost: string | undefined;
117
+ /** `--config <path>`: explicit credential file. Default: $XANO_CONFIG, then ./.xano/auth.json. */
118
+ authFile: string | undefined;
119
+ /**
120
+ * `--local`: use the project-local `./.xano/auth.json` cache instead of the
121
+ * shared `~/.xanots/auth.json` one (the default). `login --local` writes
122
+ * there; other commands read it. Without `--local`, reads still prefer an
123
+ * existing project-local cache before falling back to the global one, so a
124
+ * `--local` project keeps working without repeating the flag.
125
+ */
126
+ local: boolean;
127
+ /**
128
+ * `ephemeral list --all-workspaces`: enumerate ephemeral tenants across every
129
+ * workspace on the instance, not just the token's parent workspace.
130
+ */
131
+ allWorkspaces: boolean;
132
+ /** `ephemeral impersonate --guest`/`-g`: mint a read-only guest session (browse only). */
133
+ guest: boolean;
134
+ /** `ephemeral impersonate --url-only`/`-u`: print the dashboard URL instead of opening a browser. */
135
+ urlOnly: boolean;
136
+ /** `marketplace details --prompt`: print the add-on's agent prompt alone, for piping. */
137
+ prompt: boolean;
138
+ /** `login --port <n>`: fixed loopback callback port (default: an ephemeral port). */
139
+ port: number | undefined;
140
+ /** `login --scope "<space list>"`: OAuth scopes to request (default: the built-in xano-cli set). */
141
+ scope: string | undefined;
142
+ /** `validate --runtime`: after import + round-trip, run each deployed function and report. */
143
+ runtime: boolean;
144
+ /** `validate --capture`: write each round-tripped function's fetched JSON (candidate fixtures). */
145
+ capture: boolean;
146
+ /** `validate --verbose`: print full diffs / raw engine detail instead of a projected summary. */
147
+ verbose: boolean;
148
+ /** `validate --instance <url>`: override XANO_VALIDATE_INSTANCE for this run. */
149
+ instance: string | undefined;
150
+ /** `sandbox export --format <json|multidoc>`: which artifact to emit (validated at parse time). */
151
+ format: "json" | "multidoc" | undefined;
152
+ /** `sandbox export --path <p>`: output location (`-` for stdout; a dir or a full file path). */
153
+ path: string | undefined;
154
+ /** `sandbox export --name <n>`: output basename override (default `sandbox`). Also the `init`/`codegen` app name (default: target dir basename). */
155
+ name: string | undefined;
156
+ /**
157
+ * `init`/`codegen` `--ai <preset>` (repeatable, comma-separated): AI-assistant instruction
158
+ * files to scaffold (`claude`/`codex`/`cursor`/`none`). Empty = prompt in a TTY,
159
+ * else write none. Validated in the init command, not at parse time.
160
+ */
161
+ ai: string[];
162
+ /**
163
+ * `init`/`codegen` `--framework <id>`: which frontend to scaffold
164
+ * (`react`/`svelte`). Undefined = prompt in a TTY, else the default.
165
+ * Validated in `frontend-presets.ts`, not at parse time.
166
+ */
167
+ framework: string | undefined;
168
+ /** `init`/`codegen` `--force`: scaffold into a non-empty target directory (overwrite our own files). */
169
+ force: boolean;
170
+ /** `init`/`codegen` `--no-install`: skip the post-scaffold `npm install`. For `codegen` this also means the round trip cannot be verified, since loading the tree needs its dependencies. */
171
+ noInstall: boolean;
172
+ /**
173
+ * `deploy --no-verify`: skip the post-deploy liveness checks. Everything is
174
+ * still deployed; XanoTS just doesn't wait to confirm it came up — neither
175
+ * that the edge is serving *this* static build (via `X-Xano-Canonical`) nor
176
+ * that the workspace's microservices reached a ready state. Useful for fast
177
+ * iterative deploys or when the deployed URL isn't reachable from the CLI host.
178
+ */
179
+ noVerify: boolean;
180
+ /**
181
+ * `deploy --require-microservices`: fail the deploy when a microservice has
182
+ * not reported ready by the end of the wait, not just when the engine says it
183
+ * is broken. A microservice the engine reports as FAILED already exits
184
+ * non-zero without this — the flag is what turns "still starting" into a
185
+ * failure too, which is the reading CI wants.
186
+ */
187
+ requireMicroservices: boolean;
188
+ /**
189
+ * `codegen --report <grouped|full|json>`: how the findings are rendered.
190
+ *
191
+ * `grouped` (the default) prints one line per distinct root cause with a count
192
+ * and a collapsed object list; `full` prints every site; `json` prints the
193
+ * findings as data for a CI gate to read. The findings themselves are the same
194
+ * set in all three — this chooses the rendering, never what is reported.
195
+ */
196
+ report: string | undefined;
197
+ /**
198
+ * `deploy --allow-seed-in-static`: publish a static build even when it
199
+ * contains seed values the schema declares non-public. The refusal exists
200
+ * because the alternative is serving them at a public URL; this is the escape
201
+ * hatch for a workspace whose seed is deliberately demo data.
202
+ */
203
+ allowSeedInStatic: boolean;
204
+ /**
205
+ * `release --dry-run`: print what the release WOULD change and exit without
206
+ * sending it. A destructive release previews anyway; this is how you preview
207
+ * one that isn't, or preview without being prompted.
208
+ */
209
+ dryRun: boolean;
210
+ /**
211
+ * `release --prune`: also delete objects in the target workspace that your
212
+ * project no longer defines. Without it a release only adds and updates, so
213
+ * something deleted from your code lingers in the workspace.
214
+ */
215
+ prune: boolean;
216
+ /**
217
+ * `release --reset-data`: empty every table the bundle carries before
218
+ * importing. Pair with `--seed` to reload the bundle's rows afterwards;
219
+ * alone it leaves the tables empty.
220
+ */
221
+ resetData: boolean;
222
+ /**
223
+ * `release --seed`: write the bundle's table rows into the workspace. Off by
224
+ * default, so a release cannot overwrite live data you did not ask it to.
225
+ */
226
+ seed: boolean;
227
+ /**
228
+ * `release --replace`: the OLD behavior — wipe the workspace (objects, table
229
+ * data and history) and import the bundle in its place, instead of merging.
230
+ * Named rather than implicit so it can never be reached by accident.
231
+ */
232
+ replace: boolean;
233
+ /**
234
+ * `--json`: force the machine-readable JSON on stdout even at a terminal.
235
+ * Absent, the format is inferred from stdout being a TTY. Read through
236
+ * `isMachineOutput` (output.ts) — never by re-checking `isTTY` at a call site.
237
+ */
238
+ json: boolean;
239
+ /**
240
+ * `deploy --open`: open the deployed URL in the default browser once it lands.
241
+ * Honors `XANO_NO_BROWSER` like every other launch, since it shares the same
242
+ * helper.
243
+ */
244
+ open: boolean;
245
+ /**
246
+ * Leading-dash tokens the parser doesn't recognize. They are collected HERE
247
+ * rather than falling into {@link positionals} so an unknown flag can never be
248
+ * resolved as the entry `<file>` — the issue #173 failure mode, where
249
+ * `xanots deploy --help` was imported as a module path and died in Node's
250
+ * loader with a message about a missing file named `--help`.
251
+ */
252
+ unknownFlags: string[];
253
+ }
254
+ declare function parseArgs(argv: string[]): ParsedArgs;
255
+ /**
256
+ * A resolved help request: the deepest command path present, or the topic word
257
+ * that `xanots help <topic>` named and the registry does not know.
258
+ */
259
+ interface HelpRequest {
260
+ command?: string;
261
+ subcommand?: string;
262
+ /** Set only for `xanots help <unknown>` — see {@link resolveHelpRequest}. */
263
+ unknownTopic?: string;
264
+ }
265
+ /**
266
+ * Resolve a help request straight from the RAW argv, before any flag parsing.
267
+ *
268
+ * Deliberately pre-parse: `parseArgs` throws on removed flags and malformed
269
+ * values, so resolving help afterwards would mean `xanots deploy --profile x
270
+ * --help` died on the flag error instead of printing the help the user asked
271
+ * for. Returns the deepest command path present (`{}` for global help), or
272
+ * undefined when no help was requested.
273
+ */
274
+ declare function resolveHelpRequest(argv: string[]): HelpRequest | undefined;
275
+ declare function loadDefault(file: string): Promise<unknown>;
276
+ /**
277
+ * Resolve this package's version for `xanots version`. Walks up from the running
278
+ * module to the package root's `package.json` (`dist/cli.js` → `../`, the
279
+ * `src/emit/cli.ts` source → `../../`), matching on the package NAME so a stray
280
+ * ancestor `package.json` can't shadow it. Best-effort: returns `"unknown"` rather
281
+ * than throwing when it can't be located, since a version print must never fail.
282
+ */
283
+ declare function readVersion(): string;
284
+ /**
285
+ * Write the grouped command reference to STDOUT — help is requested output, not
286
+ * an error. The reference itself comes from the command registry via
287
+ * `help.ts`; nothing about the command surface is written down here.
288
+ */
289
+ declare function printHelp(): void;
290
+ declare function run(argv: string[]): Promise<void>;
291
+ /**
292
+ * Resolve the lock path for an entry file: `--lock=<path>` wins, else
293
+ * `xano.lock` beside the entry (matching `export`/`compile` defaults).
294
+ */
295
+ declare function resolveLockPath(args: ParsedArgs, file: string): string;
296
+ /** A compiled bundle plus any seed `content/` entries (empty unless requested). */
297
+ interface CompiledBundle {
298
+ bundle: string;
299
+ content: SeedContentFile[];
300
+ /**
301
+ * Names of tables that declared `seed` but whose rows were NOT built into
302
+ * `content` (i.e. `opts.seed` was false). Empty when `opts.seed` is true. Lets
303
+ * the `export` command warn that its artifact omits seed — so the CI pattern
304
+ * `export --out bundle.json` then `deploy --bundle bundle.json` doesn't drop
305
+ * seed silently (a `--bundle` deploy has no registry to resolve seed from).
306
+ */
307
+ omittedSeedTables: string[];
308
+ /**
309
+ * Seed values drawn from columns the schema declares non-public, for the
310
+ * `--static` publication guard. Empty unless seed was resolved.
311
+ */
312
+ nonPublicSeedValues: NonPublicSeedValue[];
313
+ }
314
+ /**
315
+ * Thin wrapper over {@link compileBundle} for the many callers that only need the
316
+ * bundle text (export, validate, sandbox-export). Seed content is not built here.
317
+ */
318
+ declare function exportBundleJson(args: ParsedArgs): Promise<string>;
319
+ /**
320
+ * Compile an entry file to its `packageExport` bundle, running the full lock
321
+ * pipeline (seed → export → write). With `opts.seed`, also resolve + validate the
322
+ * tables' seed rows into signed `content/` archive entries — done HERE, inside the
323
+ * same lock-seeded context as the export, so a seed file's `dbo` guid matches the
324
+ * table's guid in `workspace.json`. Only the deploy path passes `seed:true`, so a
325
+ * plain `export`/`validate` never resolves seed sources.
326
+ */
327
+ declare function compileBundle(args: ParsedArgs, opts?: {
328
+ seed?: boolean;
329
+ }): Promise<CompiledBundle>;
330
+
331
+ export { type CompiledBundle, type HelpRequest, type ParsedArgs, compileBundle, exportBundleJson, loadDefault, parseArgs, printHelp, readVersion, resolveHelpRequest, resolveLockPath, run };
package/dist/cli.js ADDED
@@ -0,0 +1,33 @@
1
+ import {
2
+ compileBundle,
3
+ exportBundleJson,
4
+ loadDefault,
5
+ parseArgs,
6
+ printHelp,
7
+ readVersion,
8
+ resolveHelpRequest,
9
+ resolveLockPath,
10
+ run
11
+ } from "./chunk-YGPIY3WT.js";
12
+ import "./chunk-IZW6MK3U.js";
13
+ import "./chunk-EZG76F7R.js";
14
+ import "./chunk-3DUAGYGP.js";
15
+ import "./chunk-YYRDLFSJ.js";
16
+ import "./chunk-EMCAWMHC.js";
17
+ import "./chunk-WHOJWOSV.js";
18
+ import "./chunk-LH6Z6KFV.js";
19
+ import "./chunk-HJPTWBLH.js";
20
+ import "./chunk-GNPVYOPB.js";
21
+ import "./chunk-4HT3BNZ7.js";
22
+ export {
23
+ compileBundle,
24
+ exportBundleJson,
25
+ loadDefault,
26
+ parseArgs,
27
+ printHelp,
28
+ readVersion,
29
+ resolveHelpRequest,
30
+ resolveLockPath,
31
+ run
32
+ };
33
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,40 @@
1
+ import {
2
+ blameGeneratedFile,
3
+ fetchWorkspaceBundle,
4
+ isMissingDependencyError,
5
+ runCodegenCommand,
6
+ verifyCrashEntry
7
+ } from "./chunk-TRU5OHQ5.js";
8
+ import "./chunk-26CNBZE2.js";
9
+ import "./chunk-QTNO2WD6.js";
10
+ import "./chunk-ZUTSMMAG.js";
11
+ import "./chunk-WKP4D5MO.js";
12
+ import "./chunk-VKFQJEMW.js";
13
+ import "./chunk-47WDWMBJ.js";
14
+ import "./chunk-X4DVXBFY.js";
15
+ import "./chunk-3IGNIP6R.js";
16
+ import "./chunk-C56BC2FY.js";
17
+ import "./chunk-7REDODS2.js";
18
+ import "./chunk-MZUI3JNX.js";
19
+ import "./chunk-RVB7ITKN.js";
20
+ import "./chunk-4BXJGVZ3.js";
21
+ import "./chunk-FJ6ZS5KB.js";
22
+ import "./chunk-YGPIY3WT.js";
23
+ import "./chunk-IZW6MK3U.js";
24
+ import "./chunk-EZG76F7R.js";
25
+ import "./chunk-3DUAGYGP.js";
26
+ import "./chunk-YYRDLFSJ.js";
27
+ import "./chunk-EMCAWMHC.js";
28
+ import "./chunk-WHOJWOSV.js";
29
+ import "./chunk-LH6Z6KFV.js";
30
+ import "./chunk-HJPTWBLH.js";
31
+ import "./chunk-GNPVYOPB.js";
32
+ import "./chunk-4HT3BNZ7.js";
33
+ export {
34
+ blameGeneratedFile,
35
+ fetchWorkspaceBundle,
36
+ isMissingDependencyError,
37
+ runCodegenCommand,
38
+ verifyCrashEntry
39
+ };
40
+ //# sourceMappingURL=codegen-command-OOKK6AZK.js.map
@@ -0,0 +1,114 @@
1
+ import { a1 as Statement, a8 as Tag, w as FilterXdo, a9 as TaggedValue, p as FieldDescriptor, Z as ResponseDef } from './response-CVAE2kMj.js';
2
+
3
+ /** A stored statement envelope as it appears in a Xano bundle's `run[]`. */
4
+ type RawEnvelope = Record<string, unknown>;
5
+ /**
6
+ * Wrap a stored statement envelope so it compiles back to itself verbatim.
7
+ *
8
+ * Every key present on `envelope` — including keys this SDK does not model —
9
+ * survives untouched, and a key the envelope does not carry is NOT invented: an
10
+ * engine that omits a key at its default gets that exact shape back.
11
+ *
12
+ * @param envelope A stored `run[]` entry. Must be an object carrying a `name`.
13
+ */
14
+ declare function raw(envelope: RawEnvelope): Statement;
15
+
16
+ /**
17
+ * `rawValue()` — the value-level escape hatch codegen emits for a stored value it
18
+ * cannot express through `c.*` / `ref` / `inp` / `withFilters`.
19
+ *
20
+ * `Value` is structurally just `{value, tag, filters}`, so an annotated literal
21
+ * is already byte-exact; this wrapper exists for two reasons a bare literal does
22
+ * not cover. It types the `tag` as a real `Tag` so the literal also checks out in
23
+ * a widening position (a `const` declaration in a shared file, not only a
24
+ * contextually-typed argument), and it makes every non-idiomatic value in a
25
+ * generated tree greppable by one name.
26
+ *
27
+ * Reached via `@xanots/sdk/codegen`, alongside `raw()` — same reasoning
28
+ * (KTD-10): a passthrough should not sit in tab-completion next to `c.text`.
29
+ */
30
+
31
+ /**
32
+ * A stored value as it appears in a bundle. `filters` defaults to none.
33
+ *
34
+ * `value` admits the NATIVE scalar spellings as well as the string one, because
35
+ * the engine stores both and this type describes what a bundle holds rather than
36
+ * what the SDK writes. The corpus is genuinely mixed — the same tag appears with
37
+ * a quoted and an unquoted value in one workspace — and codegen echoes whichever
38
+ * it found. Declaring it `string` alone made a pulled tree fail its own
39
+ * type-check (issue #133), which broke every npm script in the scaffold, since
40
+ * each one runs `tsc --noEmit` first.
41
+ *
42
+ * Coercing to the string form at emit would be the other repair. It is the wrong
43
+ * one for `null`: `normalize()` reconciles a numeric or boolean `value` with its
44
+ * string spelling, so those compare equal either way, but it does NOT do that for
45
+ * `null` — so emitting `"null"` for a stored `null` would change the bytes and
46
+ * fail the round trip.
47
+ */
48
+ interface RawValueInput {
49
+ readonly value: string | number | boolean | null;
50
+ readonly tag: Tag;
51
+ readonly filters?: readonly FilterXdo[];
52
+ }
53
+ /**
54
+ * Carry a stored tagged value through verbatim.
55
+ *
56
+ * The cast is the point of the escape hatch: `TaggedValue.value` is declared
57
+ * `string` because that is what every `c.*` constructor writes, while a bundle
58
+ * may hold a native scalar under the same key. Preserving the stored spelling is
59
+ * what keeps the round trip exact, so the runtime value is passed through
60
+ * untouched rather than being coerced to satisfy the declaration.
61
+ */
62
+ declare function rawValue(v: RawValueInput): TaggedValue;
63
+
64
+ /** A stored field envelope as it appears in a bundle's `schema[]` / `input[]`. */
65
+ type RawFieldEnvelope = Record<string, unknown>;
66
+ /**
67
+ * Carry a stored field envelope through encoding unchanged.
68
+ *
69
+ * The envelope's own `name` and `type` win over the map key it is attached to,
70
+ * and a key the envelope does not carry is NOT invented. Preservation is the
71
+ * whole contract: nothing about the stored shape is rewritten to match its
72
+ * surroundings, and nothing is added to it.
73
+ *
74
+ * @param envelope A stored `schema[]` / `input[]` entry. Must carry `name` and `type`.
75
+ */
76
+ declare function rawField(envelope: RawFieldEnvelope): FieldDescriptor;
77
+
78
+ /**
79
+ * `rawResponse()` — the response-level verbatim passthrough.
80
+ *
81
+ * The fourth and last escape hatch, alongside `raw()` for statements,
82
+ * `rawValue()` for values, and `rawField()` for fields. Together they mean a
83
+ * pulled workspace never loses data on the way into TypeScript: whatever the
84
+ * engine stored comes back out unchanged, whether or not this SDK models it.
85
+ *
86
+ * It is needed because `encodeResponse` writes `_xsid` and `disabled`
87
+ * unconditionally at their defaults. No authoring surface reaches either, so a
88
+ * stored `result[]` item that sets one differently cannot round-trip through the
89
+ * `response:` field in any form. This carries the whole `result[]` array
90
+ * instead.
91
+ *
92
+ * Reached via `@xanots/sdk/codegen`, never from the discoverable authoring
93
+ * namespace, for the same reason `raw()` stays off `s` (KTD-10).
94
+ */
95
+
96
+ /** A stored `result[]` entry as it appears in a bundle. */
97
+ type RawResponseEnvelope = Record<string, unknown>;
98
+ /**
99
+ * Carry a stored `result[]` array through encoding unchanged.
100
+ *
101
+ * A key an item does not carry is **NOT** invented. Preservation is the whole
102
+ * contract: only key ordering is normalized, and nothing is added.
103
+ *
104
+ * That absence rule is not incidental. `raw()` and `rawField()` both shipped
105
+ * completing absent keys with their defaults, which silently broke their own
106
+ * passthrough contract — the engine omits keys at their defaults, so filling
107
+ * them in changes the bytes on the way back. This preserves absence from the
108
+ * start rather than being fixed into it later.
109
+ *
110
+ * @param items Stored `result[]` entries. An empty array means "no response".
111
+ */
112
+ declare function rawResponse(items: readonly RawResponseEnvelope[]): ResponseDef;
113
+
114
+ export { type RawEnvelope, type RawFieldEnvelope, type RawResponseEnvelope, type RawValueInput, raw, rawField, rawResponse, rawValue };
@@ -0,0 +1,71 @@
1
+ import {
2
+ raw
3
+ } from "./chunk-RVB7ITKN.js";
4
+ import {
5
+ RAW_FIELD,
6
+ rawResponse
7
+ } from "./chunk-LH6Z6KFV.js";
8
+
9
+ // src/values/raw-value.ts
10
+ function rawValue(v) {
11
+ return { value: v.value, tag: v.tag, filters: [...v.filters ?? []] };
12
+ }
13
+
14
+ // src/fields/raw-field.ts
15
+ var CANONICAL_KEYS = [
16
+ "name",
17
+ "type",
18
+ "_xsid",
19
+ "description",
20
+ "nullable",
21
+ "default",
22
+ "merge",
23
+ "hidden",
24
+ "override",
25
+ "customize",
26
+ "required",
27
+ "values",
28
+ "mode",
29
+ "format",
30
+ "sensitive",
31
+ "list",
32
+ "vector",
33
+ "access",
34
+ "style",
35
+ "children",
36
+ "methods",
37
+ "market_item",
38
+ "is_settings_registry"
39
+ ];
40
+ function rawField(envelope) {
41
+ if (envelope == null || typeof envelope !== "object" || Array.isArray(envelope)) {
42
+ throw new Error(
43
+ 'rawField() expects a stored field envelope object \u2014 at minimum `{ name: "\u2026", type: "text" }` \u2014 but received ' + (envelope === null ? "null" : Array.isArray(envelope) ? "an array" : typeof envelope)
44
+ );
45
+ }
46
+ const { name, type } = envelope;
47
+ if (typeof name !== "string" || name === "") {
48
+ throw new Error('rawField() envelope is missing a `name`, e.g. `{ name: "email", type: "email" }`.');
49
+ }
50
+ if (typeof type !== "string" || type === "") {
51
+ throw new Error(`rawField() envelope for "${name}" is missing a \`type\`, e.g. "text" or "int".`);
52
+ }
53
+ const stored = {};
54
+ for (const key of CANONICAL_KEYS) {
55
+ if (Object.hasOwn(envelope, key)) stored[key] = envelope[key];
56
+ }
57
+ for (const key of Object.keys(envelope)) {
58
+ if (!Object.hasOwn(stored, key)) stored[key] = envelope[key];
59
+ }
60
+ return {
61
+ type,
62
+ options: { [RAW_FIELD]: stored }
63
+ };
64
+ }
65
+ export {
66
+ raw,
67
+ rawField,
68
+ rawResponse,
69
+ rawValue
70
+ };
71
+ //# sourceMappingURL=codegen.js.map