@xano/sdk 1.0.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.
- package/CHANGELOG.md +788 -0
- package/LICENSE +21 -0
- package/README.md +541 -0
- package/dist/.build-fingerprint +1 -0
- package/dist/agent-file-refresh-ZEMK33AX.js +38 -0
- package/dist/answer-shape-K67TAAPY.js +33 -0
- package/dist/backend-dir-2U53CIAL.js +39 -0
- package/dist/backend-slot-7QXW2QYC.js +28 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +255 -0
- package/dist/branch-NCRNWQBQ.js +61 -0
- package/dist/branch-commands-ACIRCEQJ.js +79 -0
- package/dist/bundle.d.ts +223 -0
- package/dist/bundle.js +153 -0
- package/dist/capture-WAXPD7DR.js +41 -0
- package/dist/chunk-27GWNP2I.js +23 -0
- package/dist/chunk-2CMJZDCL.js +177 -0
- package/dist/chunk-2EZ3ZJZZ.js +302 -0
- package/dist/chunk-2GNFDZA2.js +390 -0
- package/dist/chunk-2MNLRIOX.js +11 -0
- package/dist/chunk-2TFRR6JV.js +104 -0
- package/dist/chunk-2ZUEE4EK.js +408 -0
- package/dist/chunk-36JUQZVQ.js +22 -0
- package/dist/chunk-3DRXWLJ5.js +83 -0
- package/dist/chunk-3JDU4VRL.js +137 -0
- package/dist/chunk-3KZCLN4Z.js +241 -0
- package/dist/chunk-3LDULPRE.js +168 -0
- package/dist/chunk-3M4LFYNQ.js +111 -0
- package/dist/chunk-3XI5CTUE.js +22 -0
- package/dist/chunk-3YW23UFH.js +50 -0
- package/dist/chunk-45UIT5T2.js +862 -0
- package/dist/chunk-4BW2SG2N.js +46 -0
- package/dist/chunk-4KHEMC32.js +79 -0
- package/dist/chunk-4POWHT2K.js +321 -0
- package/dist/chunk-4Q2GN7NW.js +192 -0
- package/dist/chunk-5A2PLKZB.js +70 -0
- package/dist/chunk-5FBYXK5P.js +159 -0
- package/dist/chunk-5HVXPTU4.js +323 -0
- package/dist/chunk-5QU2P5CA.js +304 -0
- package/dist/chunk-5V5XU32D.js +191 -0
- package/dist/chunk-5ZSO4T2G.js +10 -0
- package/dist/chunk-622HUCZT.js +10 -0
- package/dist/chunk-65HWOMGV.js +177 -0
- package/dist/chunk-6ELFRN3P.js +365 -0
- package/dist/chunk-6HO3NCSJ.js +1055 -0
- package/dist/chunk-6IUMKYWI.js +457 -0
- package/dist/chunk-6KEB3C3U.js +65 -0
- package/dist/chunk-6MR5TI5V.js +987 -0
- package/dist/chunk-6NNTNXN7.js +157 -0
- package/dist/chunk-6PBR37LN.js +97 -0
- package/dist/chunk-6QXLMMT3.js +155 -0
- package/dist/chunk-6ZGJCBZS.js +224 -0
- package/dist/chunk-73IVBKMA.js +250 -0
- package/dist/chunk-7G3CTU7I.js +286 -0
- package/dist/chunk-A3UDOZB6.js +222 -0
- package/dist/chunk-A6E77GDW.js +85 -0
- package/dist/chunk-AHJWCYQO.js +660 -0
- package/dist/chunk-AKNCFVKZ.js +36 -0
- package/dist/chunk-AM4FKL4J.js +237 -0
- package/dist/chunk-AN6BL47T.js +26 -0
- package/dist/chunk-AOSYVMUS.js +147 -0
- package/dist/chunk-APWXY5SL.js +182 -0
- package/dist/chunk-AWEIIR2U.js +218 -0
- package/dist/chunk-AWQ7BQTQ.js +73 -0
- package/dist/chunk-BAUZOWGX.js +393 -0
- package/dist/chunk-BHACRS6R.js +940 -0
- package/dist/chunk-BWPNT55T.js +680 -0
- package/dist/chunk-C6RIMRU4.js +187 -0
- package/dist/chunk-CGVQZXYG.js +263 -0
- package/dist/chunk-CIMQZRRE.js +162 -0
- package/dist/chunk-CJHQKJU4.js +113 -0
- package/dist/chunk-CTMO46PK.js +1897 -0
- package/dist/chunk-D53J55C5.js +106 -0
- package/dist/chunk-D7VGG3WS.js +90 -0
- package/dist/chunk-DAD3ONIS.js +245 -0
- package/dist/chunk-DGWHAVRG.js +162 -0
- package/dist/chunk-DX4QR4B2.js +483 -0
- package/dist/chunk-EHP3WPEG.js +21 -0
- package/dist/chunk-ELP2HMXC.js +432 -0
- package/dist/chunk-ERVIASGL.js +21 -0
- package/dist/chunk-ET4Y4XCB.js +865 -0
- package/dist/chunk-ETO6LGLD.js +4750 -0
- package/dist/chunk-EUUUMY7J.js +24 -0
- package/dist/chunk-FQJ2TTHP.js +218 -0
- package/dist/chunk-FQOF7E2E.js +133 -0
- package/dist/chunk-FWD7AL6N.js +21 -0
- package/dist/chunk-FXFV3KU6.js +138 -0
- package/dist/chunk-FXRQOWTE.js +171 -0
- package/dist/chunk-G554NZNI.js +210 -0
- package/dist/chunk-GSGDWJB5.js +13 -0
- package/dist/chunk-H2V3N23D.js +66 -0
- package/dist/chunk-H5C7MBCR.js +159 -0
- package/dist/chunk-HHN734BU.js +371 -0
- package/dist/chunk-HRVBLCVJ.js +243 -0
- package/dist/chunk-HVRUQXGD.js +1264 -0
- package/dist/chunk-I4F5TCJH.js +130 -0
- package/dist/chunk-IDOTCMDV.js +57 -0
- package/dist/chunk-IGOLHKWF.js +427 -0
- package/dist/chunk-JGE7CAWB.js +148 -0
- package/dist/chunk-JTUKLCXS.js +92 -0
- package/dist/chunk-JZGVVJSI.js +66 -0
- package/dist/chunk-K4WX6UUU.js +923 -0
- package/dist/chunk-K5BBGTYZ.js +217 -0
- package/dist/chunk-K6RXBGUB.js +427 -0
- package/dist/chunk-KTSDSD36.js +165 -0
- package/dist/chunk-L5JYN3NM.js +1038 -0
- package/dist/chunk-LIEOKXKD.js +354 -0
- package/dist/chunk-LLNZGEFK.js +51 -0
- package/dist/chunk-LPECSJ2J.js +55 -0
- package/dist/chunk-LQCMKAJ7.js +413 -0
- package/dist/chunk-LRN4ZJCQ.js +1145 -0
- package/dist/chunk-MJ4ZVHKN.js +17 -0
- package/dist/chunk-MXHSQOC4.js +3061 -0
- package/dist/chunk-N5GKCWE5.js +367 -0
- package/dist/chunk-NA3PXMEF.js +10 -0
- package/dist/chunk-NAQDMEHV.js +76 -0
- package/dist/chunk-NWKXM5RD.js +109 -0
- package/dist/chunk-NZOWWHU5.js +196 -0
- package/dist/chunk-OHX6MIUZ.js +184 -0
- package/dist/chunk-OOXWYAA4.js +15 -0
- package/dist/chunk-OPHB5ORL.js +1990 -0
- package/dist/chunk-OXA6PSZT.js +1725 -0
- package/dist/chunk-P2HAGF6H.js +73 -0
- package/dist/chunk-PTHVMXZI.js +3036 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-Q325JKYB.js +189 -0
- package/dist/chunk-Q7DGTQ5G.js +255 -0
- package/dist/chunk-QCNYHBL7.js +601 -0
- package/dist/chunk-QO6BVGS5.js +145 -0
- package/dist/chunk-QXTKSOFI.js +76 -0
- package/dist/chunk-ROY4YAEQ.js +66 -0
- package/dist/chunk-RTJRZFFY.js +447 -0
- package/dist/chunk-SAVJUS2X.js +128 -0
- package/dist/chunk-SFLHVCKX.js +173 -0
- package/dist/chunk-STSFNCY4.js +127 -0
- package/dist/chunk-SWBF2LTK.js +170 -0
- package/dist/chunk-T5KELPAR.js +109 -0
- package/dist/chunk-TFFGOFVZ.js +1481 -0
- package/dist/chunk-TLHIFK4M.js +256 -0
- package/dist/chunk-TLQE7ZN3.js +156 -0
- package/dist/chunk-TPHWJ7UG.js +1981 -0
- package/dist/chunk-TRJCALW3.js +291 -0
- package/dist/chunk-TTEIYD5P.js +133 -0
- package/dist/chunk-U64O2MXY.js +407 -0
- package/dist/chunk-UCQ2VUTG.js +630 -0
- package/dist/chunk-UTI5G6OJ.js +44 -0
- package/dist/chunk-UVHDMMIP.js +188 -0
- package/dist/chunk-UZ6QQWJT.js +120 -0
- package/dist/chunk-VAX3UZOY.js +686 -0
- package/dist/chunk-W3HBUKFO.js +57 -0
- package/dist/chunk-WKQLGKCL.js +2823 -0
- package/dist/chunk-WQFNASK4.js +560 -0
- package/dist/chunk-WRBKLYSJ.js +224 -0
- package/dist/chunk-WTPZRR4I.js +17 -0
- package/dist/chunk-WZDJ2LLX.js +2385 -0
- package/dist/chunk-X2NL4KUO.js +14 -0
- package/dist/chunk-X4DVXBFY.js +38 -0
- package/dist/chunk-X677DMZM.js +7050 -0
- package/dist/chunk-XBKMWY7F.js +612 -0
- package/dist/chunk-XNCP4KYO.js +78 -0
- package/dist/chunk-XVBGLISP.js +35 -0
- package/dist/chunk-XW6KISBB.js +1192 -0
- package/dist/chunk-YGZHHAAB.js +8156 -0
- package/dist/chunk-YHEFQUQB.js +186 -0
- package/dist/chunk-YLDALTWZ.js +653 -0
- package/dist/chunk-YU4HSQW7.js +229 -0
- package/dist/chunk-ZDPP6RKB.js +27 -0
- package/dist/chunk-ZFDZKNGG.js +194 -0
- package/dist/chunk-ZIY7RNUT.js +49 -0
- package/dist/chunk-ZYJP6BOO.js +30 -0
- package/dist/cli.d.ts +1111 -0
- package/dist/cli.js +165 -0
- package/dist/codegen-command-VR2GWR6C.js +173 -0
- package/dist/codegen.d.ts +115 -0
- package/dist/codegen.js +19 -0
- package/dist/commands-GJMJ4XYZ.js +76 -0
- package/dist/completion-ZQLO6PB6.js +738 -0
- package/dist/config-MBYGCAFK.js +136 -0
- package/dist/deploy-command-JVZPWHMK.js +180 -0
- package/dist/deploy-source-3W45CXMP.js +81 -0
- package/dist/dev-env-sync-HN44K4D5.js +188 -0
- package/dist/diagnostics-UEAAHWVF.js +30 -0
- package/dist/display-name-hint-ABBPVQIR.js +46 -0
- package/dist/emit-CyhBDxli.d.ts +7007 -0
- package/dist/env-example-refresh-ET5HMMDW.js +126 -0
- package/dist/env-pull-command-TNMNB3CV.js +323 -0
- package/dist/env-target-O4HRKTGZ.js +40 -0
- package/dist/env-var-command-ZIRDCAZA.js +427 -0
- package/dist/ephemeral-P7F3PMAD.js +54 -0
- package/dist/ephemeral-command-CLJJKOFT.js +592 -0
- package/dist/ephemeral-state-PYCBSOGX.js +61 -0
- package/dist/file-lock-PT74GWYW.js +10 -0
- package/dist/generate-command-AYEOLA26.js +510 -0
- package/dist/gitignore-3SJ3WNRG.js +51 -0
- package/dist/guards-4EBNCZDC.js +162 -0
- package/dist/hosted-file-PSHJB3HX.js +28 -0
- package/dist/impersonate-command-5JAS3WSV.js +152 -0
- package/dist/import-EQSFU6JC.js +19 -0
- package/dist/index.d.ts +5470 -0
- package/dist/index.js +371 -0
- package/dist/init-command-X2FR4UAK.js +125 -0
- package/dist/init-modules-RY7UHAOL.js +50 -0
- package/dist/init-web-M4YZSZK6.js +42 -0
- package/dist/internal.d.ts +179 -0
- package/dist/internal.js +2634 -0
- package/dist/io-RC56QSN5.js +26 -0
- package/dist/keep-data-merge-7MPLVAVI.js +1119 -0
- package/dist/lambda-config-reconcile-OUZ4OYAB.js +116 -0
- package/dist/landed-753YLJ5H.js +40 -0
- package/dist/landing-record-SU52SKXU.js +61 -0
- package/dist/live-diff-YONW2VI3.js +65 -0
- package/dist/local-engine-choice-CH5X3W7E.js +79 -0
- package/dist/local-engine-command-Z3OL7VOD.js +766 -0
- package/dist/local-engine-config-5U3SC434.js +39 -0
- package/dist/local-engine-deploy-PCQ4SNPB.js +39 -0
- package/dist/local-engine-process-EHTE5LLU.js +63 -0
- package/dist/local-engine-state-A4FTRFAF.js +32 -0
- package/dist/local-engine-update-check-6L645VBL.js +162 -0
- package/dist/lock-MRRHW5GS.js +87 -0
- package/dist/lock-commands-2QG25HL7.js +963 -0
- package/dist/login-command-QPYRWOXZ.js +538 -0
- package/dist/logout-command-WOIQLDP6.js +56 -0
- package/dist/loop-ALIZLOSX.js +191 -0
- package/dist/marketplace-command-K5YL42NO.js +977 -0
- package/dist/marketplace-resolve-LY32JES5.js +40 -0
- package/dist/meta-client-YXGPW53C.js +244 -0
- package/dist/module-manifest-JFGHU2TC.js +38 -0
- package/dist/near-key.d.ts +13 -0
- package/dist/near-key.js +8 -0
- package/dist/node.d.ts +95 -0
- package/dist/node.js +969 -0
- package/dist/operation-outcome-TZSESNC7.js +51 -0
- package/dist/output-target-AL3I44GG.js +47 -0
- package/dist/package-manager-PRAHUSCN.js +34 -0
- package/dist/plan-disclosure-6G4MLZKD.js +114 -0
- package/dist/plugin-contributions-WRNY5ABG.js +28 -0
- package/dist/plugin-prompt-4VA3B4FF.js +20 -0
- package/dist/plugin-questions-JTSYA74Q.js +24 -0
- package/dist/plugin.d.ts +396 -0
- package/dist/plugin.js +1 -0
- package/dist/preflight-command-2T5Z36MI.js +321 -0
- package/dist/profile-command-AH3PIM4X.js +800 -0
- package/dist/profile-pointer-GRWJU3YD.js +31 -0
- package/dist/profile-select-74TRDEPD.js +23 -0
- package/dist/project-dependency-KSH63ODT.js +35 -0
- package/dist/project-sdk-REPPOIBD.js +24 -0
- package/dist/promote-command-PCWT5N6S.js +140 -0
- package/dist/prompt-II3F3LND.js +27 -0
- package/dist/publish-command-TTDUUJI5.js +414 -0
- package/dist/pull-command-VBO7C4S3.js +161 -0
- package/dist/pull-superseded-GJWLG7XO.js +20 -0
- package/dist/release-command-N4ZPKMHR.js +146 -0
- package/dist/release-ns-command-3KFDMZ6G.js +1745 -0
- package/dist/response-HlXahv4K.d.ts +925 -0
- package/dist/retry-command-AS5EVREX.js +34 -0
- package/dist/routes-manifest-SNWUVBT6.js +43 -0
- package/dist/runtime-XETHVF33.js +14 -0
- package/dist/scaffold.d.ts +1911 -0
- package/dist/scaffold.js +107 -0
- package/dist/secrets-file-LVZD6IIM.js +56 -0
- package/dist/secrets-fill-command-TTCPSVXN.js +218 -0
- package/dist/seed-VU7C3QYS.js +46 -0
- package/dist/sent-writes-N7X4OVXT.js +22 -0
- package/dist/source-resolve-S2XA3XZF.js +83 -0
- package/dist/static-host-B2Y6AG3W.js +352 -0
- package/dist/status-command-RUDXTF7I.js +554 -0
- package/dist/store-6VNCD4D7.js +20 -0
- package/dist/store-ARM6VMO5.js +98 -0
- package/dist/store-DuYfzKlW.d.ts +3144 -0
- package/dist/suggest-6FOOYKHG.js +12 -0
- package/dist/sveltekit.d.ts +154 -0
- package/dist/sveltekit.js +109 -0
- package/dist/sync-contributions-UCEROO26.js +415 -0
- package/dist/table-ENAVMITR.js +42 -0
- package/dist/tables-command-GUPXXSB5.js +156 -0
- package/dist/tenant-IIHPOHGP.js +42 -0
- package/dist/tenant-command-D5HGI2X4.js +965 -0
- package/dist/test-command-TIKZMDPZ.js +476 -0
- package/dist/tests-BGGIOK3L.js +26 -0
- package/dist/token-NICJUTMT.js +72 -0
- package/dist/toolchain-hooks-GHKLUJOH.js +96 -0
- package/dist/toolchain-modules-5EAZUONB.js +24 -0
- package/dist/tracked-backend-EIBUMDZA.js +80 -0
- package/dist/update-check-2W2NLDTC.js +136 -0
- package/dist/upgrade-command-QHNFWM7O.js +531 -0
- package/dist/verify-rollout-DRCK5TDD.js +61 -0
- package/dist/whoami-command-STGINTXH.js +51 -0
- package/dist/workspace-2CLHU2LK.js +93 -0
- package/dist/workspace-binding-56PIIPCP.js +54 -0
- package/dist/workspace-command-JEXQETJD.js +535 -0
- package/dist/workspace-env-F2RFMSC5.js +70 -0
- package/dist/workspace-export-OJSH2HIW.js +21 -0
- package/dist/writable-VA7OISSK.js +25 -0
- package/dist/xano-ICFUSPFR.js +42 -0
- package/dist/xanosdk-import-GN42TO2B.js +56 -0
- package/dist/xanosdk-project-S6DXJONQ.js +41 -0
- package/dist/xdo-CxDr2Q1C.d.ts +1371 -0
- package/guides/README.md +33 -0
- package/guides/authoring.md +921 -0
- package/guides/cli.md +401 -0
- package/guides/codegen.md +177 -0
- package/guides/codes.md +404 -0
- package/guides/coverage.md +74 -0
- package/guides/deploying.md +1525 -0
- package/guides/environment.md +400 -0
- package/guides/marketplace.md +415 -0
- package/guides/module-contract.md +558 -0
- package/guides/object-kinds.md +433 -0
- package/guides/project-structure.md +43 -0
- package/guides/scaffold.md +351 -0
- package/guides/typed-frontend.md +242 -0
- package/llms/client.md +63 -0
- package/llms/errors.md +56 -0
- package/llms/fields.md +176 -0
- package/llms/filters.md +183 -0
- package/llms/kinds-agent-mcp.md +30 -0
- package/llms/kinds-core.md +100 -0
- package/llms/kinds-knowledge.md +20 -0
- package/llms/kinds-realtime.md +76 -0
- package/llms/lambda.md +94 -0
- package/llms/legacy.md +44 -0
- package/llms/lock.md +40 -0
- package/llms/object-kinds.md +34 -0
- package/llms/statements-calls.md +62 -0
- package/llms/statements-catalog.md +320 -0
- package/llms/statements-data.md +66 -0
- package/llms/statements-runtime.md +68 -0
- package/llms/tests.md +59 -0
- package/llms/toolchain.md +16 -0
- package/llms/triggers.md +36 -0
- package/llms/values.md +29 -0
- package/llms-full.txt +2085 -0
- package/llms.txt +493 -0
- package/manifest.json +11224 -0
- package/package.json +162 -0
- package/types/lambda-globals.d.ts +129 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,1111 @@
|
|
|
1
|
+
import { B as Bundle, L as LockFile, X as Xano, c9 as emit } from './emit-CyhBDxli.js';
|
|
2
|
+
import './response-HlXahv4K.js';
|
|
3
|
+
import './xdo-CxDr2Q1C.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `UsageError` — a failure the user can fix by typing something different.
|
|
7
|
+
*
|
|
8
|
+
* The distinction that matters at the process boundary: a UsageError means the
|
|
9
|
+
* CLI never got far enough to try, so printing the relevant help block is
|
|
10
|
+
* useful. Every other error means the command ran and failed, where a wall of
|
|
11
|
+
* usage text is noise. `bin.ts` renders the two differently on that basis.
|
|
12
|
+
*
|
|
13
|
+
* Thrown (not printed) so `run()` stays a library function — the exported entry
|
|
14
|
+
* that tests drive directly — with rendering and exit codes owned by the bin.
|
|
15
|
+
* The renderer lives here too ({@link reportFailure}) rather than in `bin.ts`,
|
|
16
|
+
* which is unimportable from a test: it calls `run()` at module scope.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Which help block belongs with this failure. An empty object means the global
|
|
21
|
+
* command reference; omitting `helpFor` entirely means no block at all, for the
|
|
22
|
+
* failures whose message already says everything useful.
|
|
23
|
+
*/
|
|
24
|
+
interface HelpTarget {
|
|
25
|
+
command?: string;
|
|
26
|
+
subcommand?: string;
|
|
27
|
+
}
|
|
28
|
+
declare class UsageError extends Error {
|
|
29
|
+
readonly name = "UsageError";
|
|
30
|
+
/** The help block to print under the message. */
|
|
31
|
+
readonly helpFor: HelpTarget | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* A one-line pointer to this help page, in place of the block. For a conflict
|
|
34
|
+
* between flags that each parsed fine: the message already names which to
|
|
35
|
+
* drop, and a full usage block under it buries that sentence. {@link helpFor}
|
|
36
|
+
* is for a mistake in the command's SHAPE, where the block lists what works.
|
|
37
|
+
*/
|
|
38
|
+
readonly hintFor: HelpTarget | undefined;
|
|
39
|
+
/** A closest-match hint (`Did you mean: details`), when one is close enough. */
|
|
40
|
+
readonly suggestion: string | undefined;
|
|
41
|
+
constructor(message: string, opts?: {
|
|
42
|
+
helpFor?: HelpTarget;
|
|
43
|
+
hintFor?: HelpTarget;
|
|
44
|
+
suggestion?: string;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* One archive member (structurally an `ArchiveEntry`): its in-archive path and
|
|
50
|
+
* the serialized signed `type:"content"` envelope written there.
|
|
51
|
+
*/
|
|
52
|
+
interface SeedContentFile {
|
|
53
|
+
/** `content/<table-guid>-<page>.json` (page 1-based, contiguous). */
|
|
54
|
+
name: string;
|
|
55
|
+
/** The serialized signed `type:"content"` envelope. */
|
|
56
|
+
content: string;
|
|
57
|
+
}
|
|
58
|
+
/** A seed value the schema says is not public, and where it came from. */
|
|
59
|
+
interface NonPublicSeedValue {
|
|
60
|
+
table: string;
|
|
61
|
+
column: string;
|
|
62
|
+
value: string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether a static build can actually be searched for this value.
|
|
65
|
+
*
|
|
66
|
+
* `false` for a value below {@link MIN_SCANNABLE_LENGTH}, and for a non-string
|
|
67
|
+
* one. Those are collected rather than dropped: being too short to
|
|
68
|
+
* search for is not the same as being safe, and the author is the only one who
|
|
69
|
+
* can judge which it is. The scanner skips them; the deploy path reports them.
|
|
70
|
+
*/
|
|
71
|
+
scannable: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* How the table supplies its seed, which decides how a value can have reached
|
|
74
|
+
* a frontend build — and so what the refusal tells the author to change.
|
|
75
|
+
*/
|
|
76
|
+
source: SeedSourceKind;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `inline` rows ride with the table def into any bundle that imports it; a
|
|
80
|
+
* `thunk`'s `import()` is one a bundler follows; a `file` (`seedFile`) is a
|
|
81
|
+
* plain path no bundler reads, so a match there came from the frontend itself.
|
|
82
|
+
*/
|
|
83
|
+
type SeedSourceKind = "inline" | "file" | "thunk";
|
|
84
|
+
|
|
85
|
+
/** One archive member: its in-archive path and the UTF-8 text stored at it. */
|
|
86
|
+
interface ArchiveEntry {
|
|
87
|
+
name: string;
|
|
88
|
+
/** Text members (the bundle, seed pages) are UTF-8; a hosted file's bytes ride as-is. */
|
|
89
|
+
content: string | Uint8Array;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Whose environment this is. Structurally satisfied by `ResolvedAuth`, so every
|
|
94
|
+
* caller passes the `auth` it already holds.
|
|
95
|
+
*/
|
|
96
|
+
interface EnvScope {
|
|
97
|
+
workspaceId: number | string;
|
|
98
|
+
/** Instance origin the credential addresses. Part of the key — see the header. */
|
|
99
|
+
instance: string;
|
|
100
|
+
/**
|
|
101
|
+
* `undefined` on the two environment-credential paths, which have no profile
|
|
102
|
+
* map behind them. They key as `default`, which is where they landed before
|
|
103
|
+
* profiles existed: an env credential and a stored `default` profile pointed
|
|
104
|
+
* at the same `(instance, workspace)` ARE the same tenant target, so sharing
|
|
105
|
+
* the key changes nothing and keeps every existing CI record findable.
|
|
106
|
+
*/
|
|
107
|
+
profile?: {
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface ParsedArgs {
|
|
113
|
+
command: string | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* The verb of a noun-verb command (`workspace export`, `profile me`): here
|
|
116
|
+
* `command` is the noun and `subcommand` is the verb.
|
|
117
|
+
* Undefined for the single-token verbs (`compile`/`export`/`lock`/…).
|
|
118
|
+
*/
|
|
119
|
+
subcommand: string | undefined;
|
|
120
|
+
file: string | undefined;
|
|
121
|
+
out: string | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The command line as parsed (global flags typed in front already moved
|
|
124
|
+
* behind the command), for a hint that re-says the WHOLE command — a retry
|
|
125
|
+
* that dropped the run's own flags would refuse, or do something else.
|
|
126
|
+
* Absent on args built by hand (tests).
|
|
127
|
+
*/
|
|
128
|
+
argv?: readonly string[];
|
|
129
|
+
/** All non-flag arguments after the command (file is positionals[0]). */
|
|
130
|
+
positionals: string[];
|
|
131
|
+
/**
|
|
132
|
+
* Where in {@link argv} each positional was typed, by the parser's own
|
|
133
|
+
* reading: a rerun that leaves one out (`env set`'s secret value) removes it
|
|
134
|
+
* by position — a search by value found an equal flag value first.
|
|
135
|
+
*/
|
|
136
|
+
positionalArgv?: readonly number[];
|
|
137
|
+
/**
|
|
138
|
+
* `--lock` / `--lock=<path>`.
|
|
139
|
+
*
|
|
140
|
+
* The lock is maintained by DEFAULT, so the bare form no longer opts into
|
|
141
|
+
* anything — it is accepted and redundant, because scaffolded trees and
|
|
142
|
+
* examples still pass it and erroring on them buys nothing. The flag survives
|
|
143
|
+
* for `--lock=<path>`, which is the real remaining job: naming the lock file
|
|
144
|
+
* when the default (beside the entry) is not the one you mean.
|
|
145
|
+
*/
|
|
146
|
+
lock: boolean;
|
|
147
|
+
/** The `--lock=<path>` override (default: `xano.lock` beside the entry). */
|
|
148
|
+
lockPath: string | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* `--no-lock`: build with NO lock at all — nothing read, nothing written,
|
|
151
|
+
* identities derived from names.
|
|
152
|
+
*
|
|
153
|
+
* The escape hatch for a throwaway run and for a tree with no lock that
|
|
154
|
+
* cannot be written. It is REFUSED over a parseable lock (see
|
|
155
|
+
* `compileBundle`): honoring it there would emit name-derived guids that
|
|
156
|
+
* disagree with the pinned ones, which is a delete-and-recreate against
|
|
157
|
+
* whatever the bundle is released to, reported as success.
|
|
158
|
+
*/
|
|
159
|
+
noLock: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* `--entry=<path>`: the workspace entry the lock sits beside, for the `lock`
|
|
162
|
+
* subcommands that take no entry file of their own (`rename`/`adopt`).
|
|
163
|
+
*
|
|
164
|
+
* Distinct from `--lock`, which names the lock FILE directly. This names the
|
|
165
|
+
* entry and lets the default be DERIVED the way `export` and `prune` derive
|
|
166
|
+
* it — so the caller still supplied the anchor and nothing is guessed.
|
|
167
|
+
*/
|
|
168
|
+
entryPath: string | undefined;
|
|
169
|
+
/** `--frozen-lock`: hard-fail if the export would change the lock (CI). */
|
|
170
|
+
frozenLock: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* `--allow-lock-orphans`: keep `--frozen-lock` from failing over entries no
|
|
173
|
+
* exported object matches. For a workspace adopted with `lock import` and
|
|
174
|
+
* ported to TypeScript a piece at a time, where the unported objects are
|
|
175
|
+
* live and their pinned identities must NOT be pruned away.
|
|
176
|
+
*/
|
|
177
|
+
allowLockOrphans: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Not a flag: set by a command whose compile only answers a question — the
|
|
180
|
+
* drift comparison of `release create`, a `reset-tables` dry run. The build
|
|
181
|
+
* reads the lock exactly as a real one does, so its identities are the ones a
|
|
182
|
+
* release would send, and writes nothing: no lock, no "commit it" notice.
|
|
183
|
+
*/
|
|
184
|
+
lockReadOnly?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* `--strict`: promote every export/deploy WARNING to a hard failure — the
|
|
187
|
+
* build diagnostics (a `bulk.update` that zero-fills omitted columns, an
|
|
188
|
+
* `ignoreEmpty` that drops its predicate) as well as the CLI's own
|
|
189
|
+
* preflights (unresolvable filter names; a stale `--emit`
|
|
190
|
+
* manifest). Warnings print either way; `--strict` decides whether a printed
|
|
191
|
+
* one still ships.
|
|
192
|
+
*/
|
|
193
|
+
strict: boolean;
|
|
194
|
+
/** `--yes`/`-y`: confirm destructive lock maintenance non-interactively. */
|
|
195
|
+
yes: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* `--check`: the reporting half of a command whose default is to act.
|
|
198
|
+
* `upgrade --check` reports whether a newer `@xano/sdk` is published and
|
|
199
|
+
* exits non-zero when one is, instead of installing it. `export --check` runs
|
|
200
|
+
* every check an export runs and fails instead of changing the lock, but
|
|
201
|
+
* writes nothing — no bundle, no lock — and so needs no secrets.
|
|
202
|
+
*/
|
|
203
|
+
check: boolean;
|
|
204
|
+
/** `push --bundle <path>`: upload an already-exported bundle instead of a file entry. */
|
|
205
|
+
bundle: string | undefined;
|
|
206
|
+
/** True when `bundle` came from the positional `<file>` (a `.json`), not `--bundle`: a refusal names what was typed. */
|
|
207
|
+
bundlePositional?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* `deploy --reset`: replace the environment and re-seed it. Only changes
|
|
210
|
+
* anything alongside {@link keepData}, which it overrides.
|
|
211
|
+
*/
|
|
212
|
+
reset: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* `deploy --keep-data`: merge into the environment an earlier deploy filled,
|
|
215
|
+
* keeping its table rows, instead of replacing it. Falls back to a seeded
|
|
216
|
+
* replace when there is nothing to keep. Refused with `--to`, which merges
|
|
217
|
+
* already.
|
|
218
|
+
*/
|
|
219
|
+
keepData: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* `test --on <backend>`: which backend a suite runs on. Kept as the raw
|
|
222
|
+
* string; the command parses it against the slot the registry declares.
|
|
223
|
+
* Refused on every other command as undeclared.
|
|
224
|
+
*/
|
|
225
|
+
on: string | undefined;
|
|
226
|
+
/** `test --kind unit|workflow`: narrow to one test family (default: both). */
|
|
227
|
+
kind: "unit" | "workflow" | undefined;
|
|
228
|
+
/** `test run-all --concurrency <n>`: how many tests to run at once (default 1). */
|
|
229
|
+
concurrency: number | undefined;
|
|
230
|
+
/** `deploy --test`: run the environment's tests after the deploy lands. */
|
|
231
|
+
test: boolean;
|
|
232
|
+
/** `deploy --expires-hours <n>`: ephemeral create-time TTL (1–24, default 1 server-side). */
|
|
233
|
+
expiresHours: number | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* `routes --emit <path>`: write the generated route module there instead of
|
|
236
|
+
* printing the table. Plain data + one interpolator, importing nothing, so a
|
|
237
|
+
* frontend gets the typed path/verb contract without the SDK runtime.
|
|
238
|
+
*/
|
|
239
|
+
/** `compile --export <name>`: which named export of a several-def module to compile. */
|
|
240
|
+
exportName: string | undefined;
|
|
241
|
+
emit: string | undefined;
|
|
242
|
+
/** `deploy --static <dir>`: archive this directory and deploy it to the environment's static host. */
|
|
243
|
+
static: string | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* `deploy --static-env KEY=VALUE` (repeatable): public config baked into EVERY
|
|
246
|
+
* html document of the static build as `window.<KEY>` globals. The backend URL is
|
|
247
|
+
* wired in automatically as `window.XANO_HOST`; these override/extend it.
|
|
248
|
+
* Served to the browser verbatim — public values only, never secrets.
|
|
249
|
+
*/
|
|
250
|
+
staticEnv: Record<string, string>;
|
|
251
|
+
/**
|
|
252
|
+
* `--env-var KEY=VALUE` (repeatable): one BACKEND workspace environment
|
|
253
|
+
* variable, merged over `workspaceConfig({ env })` for this run.
|
|
254
|
+
*
|
|
255
|
+
* The opposite of `--static-env` in every way that matters, and NOT the same
|
|
256
|
+
* thing as a backend selector (`--to`/`--from`/`--on`). `--static-env`
|
|
257
|
+
* bakes PUBLIC config into the html a browser downloads; this sets a workspace
|
|
258
|
+
* secret the engine reads server-side with `env("NAME")`, and the value exists
|
|
259
|
+
* only in this process — never written to disk, never in the repo, never
|
|
260
|
+
* printed back. Highest precedence: it beats both files.
|
|
261
|
+
*/
|
|
262
|
+
envVars: Record<string, string>;
|
|
263
|
+
/**
|
|
264
|
+
* `--backend-env-file <path>`: backend env values read from a dotenv-style
|
|
265
|
+
* `KEY=VALUE` file INSTEAD of the default `xano/.env`.
|
|
266
|
+
*
|
|
267
|
+
* It REPLACES the default rather than layering over it: pointing at a CI
|
|
268
|
+
* secret mount must not also ship whatever is in a developer's local file.
|
|
269
|
+
*/
|
|
270
|
+
envFile: string | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* `--allow-empty-env=NAME[,NAME]`: declared names this run may send empty.
|
|
273
|
+
*
|
|
274
|
+
* Per-name on purpose. A global opt-out would be found by exactly the person
|
|
275
|
+
* under time pressure whose pipeline just refused, and would then silently
|
|
276
|
+
* clear any name added upstream afterwards — re-enabling the corruption the
|
|
277
|
+
* refusal exists to prevent, while reporting it as expected.
|
|
278
|
+
*/
|
|
279
|
+
allowEmptyEnv: readonly string[];
|
|
280
|
+
/**
|
|
281
|
+
* `--allow-empty-doc-token=<scope>`: scopes this run may send empty, clearing
|
|
282
|
+
* that doc site's gate on the target. Repeat the flag for more than one.
|
|
283
|
+
*
|
|
284
|
+
* Separate from {@link ParsedArgs.allowEmptyEnv} on purpose: excusing a
|
|
285
|
+
* backend env var and opening a doc site are different decisions, and one flag
|
|
286
|
+
* covering both would let a user who meant the first do the second.
|
|
287
|
+
*
|
|
288
|
+
* The scope is `workspace` or an API group's NAME — what a user can type from
|
|
289
|
+
* what they can see. Not comma-split, unlike `--allow-empty-env`: a group name
|
|
290
|
+
* is a remote string and may contain a comma, and a name nobody can address is
|
|
291
|
+
* a gate nobody can open.
|
|
292
|
+
*/
|
|
293
|
+
allowEmptyDocToken: readonly string[];
|
|
294
|
+
/**
|
|
295
|
+
* `--doc-token <scope>=<value>`: one documentation token, inline.
|
|
296
|
+
*
|
|
297
|
+
* For CI, which has no `xano/.secrets.json` because that file is gitignored.
|
|
298
|
+
* Wins over whichever file supplied the same scope, exactly as `--env-var`
|
|
299
|
+
* does. Prefer `--secrets-file` where possible: a value on the command line
|
|
300
|
+
* lands in shell history, in the process argument list, and in any CI log that
|
|
301
|
+
* echoes the command.
|
|
302
|
+
*
|
|
303
|
+
* Keyed by the same scope label the opt-out takes, and split on the FIRST `=`
|
|
304
|
+
* so the TOKEN may contain one — base64 values end in `=` padding, and any
|
|
305
|
+
* other split would truncate exactly the values most likely to be passed here.
|
|
306
|
+
* A group NAME containing `=` cannot be addressed by this flag as a result;
|
|
307
|
+
* the sidecar reaches it by guid, which has no such problem.
|
|
308
|
+
*/
|
|
309
|
+
docTokens: Record<string, string>;
|
|
310
|
+
/**
|
|
311
|
+
* `--secrets-file <path>`: read documentation tokens from here instead of the
|
|
312
|
+
* default `xano/.secrets.json`.
|
|
313
|
+
*
|
|
314
|
+
* REPLACES the default rather than layering over it, the rule `--backend-env-file`
|
|
315
|
+
* already sets: pointing at a CI secret mount must not also ship a developer's
|
|
316
|
+
* local file.
|
|
317
|
+
*/
|
|
318
|
+
secretsFile: string | undefined;
|
|
319
|
+
/** `--backend-dir <path>`: the directory a `pull` replaces, when discovery cannot name it. */
|
|
320
|
+
backendDir: string | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* `pull --no-secrets`: find the documentation tokens, report them, write none.
|
|
323
|
+
*
|
|
324
|
+
* For a machine where a secret on disk is not wanted — a shared box, a CI
|
|
325
|
+
* checkout that only needs the source. The tree is unaffected: it declares the
|
|
326
|
+
* gates either way, and a later deploy refuses rather than clearing one.
|
|
327
|
+
*/
|
|
328
|
+
noSecrets: boolean;
|
|
329
|
+
/**
|
|
330
|
+
* `deploy --static-host <name>`: the static-host NAME to deploy the frontend
|
|
331
|
+
* to (default `default`). Give each app a distinct host so deploys don't share
|
|
332
|
+
* and overwrite one `default` host — the shared host is why a first post-deploy
|
|
333
|
+
* load can serve a *previous* app's cached `index.html`.
|
|
334
|
+
*/
|
|
335
|
+
staticHost: string | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* `deploy --static-routing spa|multipage`: override how the host resolves URLs
|
|
338
|
+
* within the build. Normally unset — the shape is inferred from the bundle.
|
|
339
|
+
* Set it for a single-document site that wants real 404s, or a bundle carrying
|
|
340
|
+
* a stray `.html` that should still route entirely client-side.
|
|
341
|
+
*/
|
|
342
|
+
staticRouting: "spa" | "multipage" | undefined;
|
|
343
|
+
/** `--origin <origin>`: Xano control-plane OAuth host. Default: $XANO_ORIGIN, then https://app.xano.com. */
|
|
344
|
+
authHost: string | undefined;
|
|
345
|
+
/** `--config <path>`: explicit credential file. Default: $XANO_CONFIG, then ./.xano/auth.json. */
|
|
346
|
+
authFile: string | undefined;
|
|
347
|
+
/**
|
|
348
|
+
* `--local`: use the project-local `./.xano/auth.json` cache instead of the
|
|
349
|
+
* shared `~/.xanosdk/auth.json` one (the default). `login --local` writes
|
|
350
|
+
* there; other commands read it. Without `--local`, reads still prefer an
|
|
351
|
+
* existing project-local cache before falling back to the global one, so a
|
|
352
|
+
* `--local` project keeps working without repeating the flag.
|
|
353
|
+
*/
|
|
354
|
+
local: boolean;
|
|
355
|
+
/** `logout --all`: clear every stored profile, not just the active one. */
|
|
356
|
+
all: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* `profile add --workspace-id <n>`: the numeric workspace a stored meta API
|
|
359
|
+
* token acts on. Kept as the raw STRING so the validator can quote what was
|
|
360
|
+
* actually typed rather than `NaN` — the same reason the env triple does.
|
|
361
|
+
*/
|
|
362
|
+
workspaceId: string | undefined;
|
|
363
|
+
/**
|
|
364
|
+
* `--profile <name>` / `-p <name>`: which stored credential profile to act as.
|
|
365
|
+
*
|
|
366
|
+
* `undefined` means the flag was not given — deliberately NOT collapsed into
|
|
367
|
+
* the name `default`, because the rungs below it (the project's
|
|
368
|
+
* `xano.profile.json`, `$XANO_PROFILE`, the credential file's own `default`
|
|
369
|
+
* key) each need to know that nobody typed one. Resolved in exactly one
|
|
370
|
+
* place, `getAccessToken`.
|
|
371
|
+
*
|
|
372
|
+
* This is the ONE rung above the project's pin, and the only way to act as a
|
|
373
|
+
* profile the pinned project did not choose — which is why it discloses the
|
|
374
|
+
* override rather than being refused.
|
|
375
|
+
*/
|
|
376
|
+
profile: string | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* `ephemeral list --all-workspaces`: enumerate ephemeral tenants across every
|
|
379
|
+
* workspace on the instance, not just the token's parent workspace.
|
|
380
|
+
*/
|
|
381
|
+
allWorkspaces: boolean;
|
|
382
|
+
/** `impersonate --guest`/`-g`: mint a read-only guest session (browse only). */
|
|
383
|
+
guest: boolean;
|
|
384
|
+
/** `impersonate --url-only`/`-u`: print the dashboard URL instead of opening a browser. */
|
|
385
|
+
urlOnly: boolean;
|
|
386
|
+
/** `marketplace details --prompt`: print the add-on's agent prompt alone, for piping. */
|
|
387
|
+
prompt: boolean;
|
|
388
|
+
/** `login --port <n>`: loopback callback port (default: `DEFAULT_PORT`, 47100). */
|
|
389
|
+
port: number | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* `login --paste`: skip the loopback callback server and read the redirect back
|
|
392
|
+
* from the user, for a host whose 127.0.0.1 the browser cannot reach (remote
|
|
393
|
+
* shell, container, Codespace). Distinct from `XANO_NO_BROWSER`, which only
|
|
394
|
+
* suppresses the browser launch and still needs the redirect to arrive.
|
|
395
|
+
*/
|
|
396
|
+
paste: boolean;
|
|
397
|
+
/** `login --scope "<space list>"`: OAuth scopes to request (default: the built-in xano-cli set). */
|
|
398
|
+
scope: string | undefined;
|
|
399
|
+
/** `preflight --runtime`: after import + round-trip, run each deployed function and report. */
|
|
400
|
+
runtime: boolean;
|
|
401
|
+
/** `preflight --capture`: write each round-tripped function's fetched JSON (candidate fixtures). */
|
|
402
|
+
capture: boolean;
|
|
403
|
+
/** `local-engine cache clear --legacy-runtime`: remove the runtime copies earlier builds left in the user's own cache directory. */
|
|
404
|
+
legacyRuntime: boolean;
|
|
405
|
+
/** `preflight --verbose`: print full diffs / raw engine detail instead of a projected summary. */
|
|
406
|
+
verbose: boolean;
|
|
407
|
+
/** `preflight --instance <url>`: override XANO_VALIDATE_INSTANCE for this run. */
|
|
408
|
+
instance: string | undefined;
|
|
409
|
+
/**
|
|
410
|
+
* `--format <json|multidoc>`: which artifact to emit (validated at parse
|
|
411
|
+
* time). `multidoc` asks the engine to render the environment it already has
|
|
412
|
+
* (`ephemeral export` only).
|
|
413
|
+
*/
|
|
414
|
+
format: "json" | "multidoc" | undefined;
|
|
415
|
+
/** `<env> export --path <p>`: output location (`-` for stdout; a dir or a full file path). */
|
|
416
|
+
path: string | undefined;
|
|
417
|
+
/** `<env> export --name <n>`: output basename override. Also the `init` app name (default: target dir basename). */
|
|
418
|
+
name: string | undefined;
|
|
419
|
+
/** `init` `--no-agents-md`: do not write the `AGENTS.md` agent brief. */
|
|
420
|
+
noAgentsMd: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* `init` `--marketplace <pkg>` (repeatable, comma-separated): marketplace
|
|
423
|
+
* add-ons to install into the new project and register in `xano/index.ts`.
|
|
424
|
+
*
|
|
425
|
+
* One flag rather than a follow-up command so that the whole project is one
|
|
426
|
+
* reproducible line — which is the promise onboarding makes when it prints
|
|
427
|
+
* the command it ran. Validated in `init-modules.ts`, not at parse time.
|
|
428
|
+
*/
|
|
429
|
+
marketplace: string[];
|
|
430
|
+
/**
|
|
431
|
+
* `init --from <source>`: where `xano/` comes from — `workspace`,
|
|
432
|
+
* `ephemeral:<name>`, or a path to a bundle JSON already on disk. Undefined
|
|
433
|
+
* writes the empty-but-valid starter backend instead.
|
|
434
|
+
*
|
|
435
|
+
* Kept as the raw string here and resolved in `init-command.ts`, so the one
|
|
436
|
+
* place that knows the spellings is the one that reports a bad one.
|
|
437
|
+
*/
|
|
438
|
+
from: string | undefined;
|
|
439
|
+
/**
|
|
440
|
+
* `init` `--framework <id>`: which frontend to scaffold
|
|
441
|
+
* (`react`/`svelte`). Undefined = prompt in a TTY, else the default.
|
|
442
|
+
* Validated in `frontend-presets.ts`, not at parse time.
|
|
443
|
+
*/
|
|
444
|
+
framework: string | undefined;
|
|
445
|
+
/**
|
|
446
|
+
* `init` `--theme <id>`: the shadcn/ui palette to render into the
|
|
447
|
+
* scaffold's stylesheet — a `<base>` or `<base>-<accent>` pair, a registry
|
|
448
|
+
* theme URL, or a path to a registry item JSON file. Undefined = plain
|
|
449
|
+
* shadcn. Validated in `theme-presets.ts`, not at parse time.
|
|
450
|
+
*/
|
|
451
|
+
theme: string | undefined;
|
|
452
|
+
/** `init` `--radius <len>`: corner radius override, bare number = rem. */
|
|
453
|
+
radius: string | undefined;
|
|
454
|
+
/**
|
|
455
|
+
* `init` `--dark <mode>`: what switches the scaffold into its dark
|
|
456
|
+
* palette — `system` (default), `toggle`, or `off`.
|
|
457
|
+
*/
|
|
458
|
+
dark: string | undefined;
|
|
459
|
+
/** `init` `--font <id>`: the body typeface (Tailwind's `--font-sans`). */
|
|
460
|
+
font: string | undefined;
|
|
461
|
+
/** `init` `--font-mono <id>`: the code typeface. */
|
|
462
|
+
fontMono: string | undefined;
|
|
463
|
+
/** `init` `--font-heading <id>`: the heading typeface; absent inherits the body face. */
|
|
464
|
+
fontHeading: string | undefined;
|
|
465
|
+
/** `init` `--icons <id>`: the icon set (`lucide` default, `tabler`, `phosphor`). */
|
|
466
|
+
icons: string | undefined;
|
|
467
|
+
/** `init` `--force`: scaffold into a non-empty target directory (overwrite our own files). */
|
|
468
|
+
force: boolean;
|
|
469
|
+
/** `init` `--no-install`: skip the post-scaffold `npm install`. Under `--from` this also means the round trip cannot be verified, since loading the tree needs its dependencies. */
|
|
470
|
+
noInstall: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* `deploy --skip-liveness`: skip the post-deploy liveness checks. Everything
|
|
473
|
+
* is still deployed; Xano SDK just doesn't wait to confirm it came up — neither
|
|
474
|
+
* that the edge is serving *this* static build (via `X-Xano-Canonical`) nor
|
|
475
|
+
* that the workspace's microservices reached a ready state. Useful for fast
|
|
476
|
+
* iterative deploys or when the deployed URL isn't reachable from the CLI host.
|
|
477
|
+
*/
|
|
478
|
+
skipLiveness: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* `init --from … --skip-roundtrip`: skip the offline check that the tree just
|
|
481
|
+
* written re-exports as the bundle it was decoded from. Entirely local — no
|
|
482
|
+
* network, no deploy, no workspace mutation — which is why it is not the same
|
|
483
|
+
* flag as {@link skipLiveness} despite both once being spelled `--no-verify`.
|
|
484
|
+
*/
|
|
485
|
+
skipRoundtrip: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* `lock prune --identity-only`: drop the named entries without loading the
|
|
488
|
+
* entry file. Separate from the other two flags, and the least related to
|
|
489
|
+
* them: nothing is verified either way, the question is
|
|
490
|
+
* whether the workspace is evaluated at all.
|
|
491
|
+
*/
|
|
492
|
+
identityOnly: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* `deploy --require-microservices`: fail the deploy when a microservice has
|
|
495
|
+
* not reported ready by the end of the wait, not just when the engine says it
|
|
496
|
+
* is broken. A microservice the engine reports as FAILED already exits
|
|
497
|
+
* non-zero without this — the flag is what turns "still starting" into a
|
|
498
|
+
* failure too, which is the reading CI wants.
|
|
499
|
+
*/
|
|
500
|
+
requireMicroservices: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* `init --from … --report <grouped|full|json>`: how the findings are rendered.
|
|
503
|
+
*
|
|
504
|
+
* `grouped` (the default) prints one line per distinct root cause with a count
|
|
505
|
+
* and a collapsed object list; `full` prints every site; `json` prints the
|
|
506
|
+
* findings as data for a CI gate to read. The findings themselves are the same
|
|
507
|
+
* set in all three — this chooses the rendering, never what is reported.
|
|
508
|
+
*/
|
|
509
|
+
report: string | undefined;
|
|
510
|
+
/**
|
|
511
|
+
* `deploy --no-dev-env`: do not point the project's dev env file
|
|
512
|
+
* (`.env.local`) at the backend this deploy made. The write is a managed
|
|
513
|
+
* block that leaves the rest of the file alone, so the opt-out is for the
|
|
514
|
+
* developer who wants that variable to stay exactly where they put it —
|
|
515
|
+
* pinned at a colleague's environment, say, or at a local engine.
|
|
516
|
+
*/
|
|
517
|
+
noDevEnv: boolean;
|
|
518
|
+
/**
|
|
519
|
+
* `deploy --to … --dry-run`: print what the deploy WOULD change and exit without
|
|
520
|
+
* sending it. A destructive deploy previews anyway; this is how you preview
|
|
521
|
+
* one that isn't, or preview without being prompted.
|
|
522
|
+
*/
|
|
523
|
+
dryRun: boolean;
|
|
524
|
+
/**
|
|
525
|
+
* `deploy --to … --prune`: also delete objects this project landed on the target and
|
|
526
|
+
* no longer defines. Without it a merge only adds and updates, so
|
|
527
|
+
* something deleted from your code lingers in the workspace.
|
|
528
|
+
*/
|
|
529
|
+
prune: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* `deploy --to … --reset-data`: empty every table the bundle carries before
|
|
532
|
+
* importing. Pair with `--seed` to reload the bundle's rows afterwards;
|
|
533
|
+
* alone it leaves the tables empty.
|
|
534
|
+
*/
|
|
535
|
+
resetData: boolean;
|
|
536
|
+
/**
|
|
537
|
+
* `deploy --to … --seed`: write the bundle's table rows into the workspace. Off by
|
|
538
|
+
* default, so a deploy cannot overwrite live data you did not ask it to.
|
|
539
|
+
*/
|
|
540
|
+
seed: boolean;
|
|
541
|
+
/**
|
|
542
|
+
* `workspace reset-tables --table <guid>`: which tables to reset, by guid.
|
|
543
|
+
*
|
|
544
|
+
* Repeatable, and a LIST rather than a comma-joined string: a table name may
|
|
545
|
+
* contain a comma and a guid is the only safe key, so nothing here is ever
|
|
546
|
+
* split on a separator. Absent rather than empty when the flag was not given,
|
|
547
|
+
* so "named no tables" and "named zero tables" stay the same refusal.
|
|
548
|
+
*/
|
|
549
|
+
table?: string[];
|
|
550
|
+
/**
|
|
551
|
+
* `workspace reset-tables --write`: actually perform the reset.
|
|
552
|
+
*
|
|
553
|
+
* The INVERSE of the usual `--dry-run`, and deliberately so: this empties a
|
|
554
|
+
* table on a real workspace, so the outcome of forgetting the flag has to be
|
|
555
|
+
* the harmless one. Every other destructive command in this CLI is guarded by
|
|
556
|
+
* a confirmation the user answers; this one is guarded by a flag they have to
|
|
557
|
+
* type, and then the confirmation as well.
|
|
558
|
+
*/
|
|
559
|
+
write: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* `release create --seed=<guids>`: which tables' rows to carry, by guid.
|
|
562
|
+
*
|
|
563
|
+
* A SEPARATE field from {@link seed} rather than widening it, because `seed`
|
|
564
|
+
* is a single global boolean the deploy path reads as `records`. Widening it
|
|
565
|
+
* would make `xanosdk deploy --seed=<guid>` parse as a bare true with the value
|
|
566
|
+
* silently dropped — the failure the parser refuses for `--format`.
|
|
567
|
+
*
|
|
568
|
+
* Guids, not ids and not names. A stale id almost always EXISTS on the next
|
|
569
|
+
* backend and resolves to a real but different table; a stale guid is absent
|
|
570
|
+
* from the listing and refuses. See `TableSummary.guid`. Raw here; validated
|
|
571
|
+
* and resolved to that host's ids against the SOURCE's own table listing by
|
|
572
|
+
* the command.
|
|
573
|
+
*/
|
|
574
|
+
seedTableGuids: string | undefined;
|
|
575
|
+
/**
|
|
576
|
+
* `deploy --to … --replace`: wipe the workspace (objects, table data and history)
|
|
577
|
+
* and import the bundle in its place, instead of merging.
|
|
578
|
+
* Named rather than implicit so it can never be reached by accident.
|
|
579
|
+
*/
|
|
580
|
+
replace: boolean;
|
|
581
|
+
/**
|
|
582
|
+
* `deploy --to … --branch <label>`: land on this branch instead of the live one.
|
|
583
|
+
*
|
|
584
|
+
* The staging boundary for a workspace that has no second workspace. Branches
|
|
585
|
+
* scope LOGIC only — see {@link allowSharedSchemaChanges}.
|
|
586
|
+
*/
|
|
587
|
+
branch: string | undefined;
|
|
588
|
+
/**
|
|
589
|
+
* `deploy --to … --branch <label> --set-live`: promote the branch the moment the
|
|
590
|
+
* import lands, in the same call.
|
|
591
|
+
*/
|
|
592
|
+
setLive: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* `promote --set-live --expect-live <label>`: refuse unless `<label>` is the
|
|
595
|
+
* live branch — before landing, and again immediately before switching.
|
|
596
|
+
*/
|
|
597
|
+
expectLive: string | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* `release transfer --to-profile <name>`: the stored credential profile whose
|
|
600
|
+
* instance and workspace receive the release. Resolved on its own, beside the
|
|
601
|
+
* credential the command runs as, which stays the source.
|
|
602
|
+
*/
|
|
603
|
+
toProfile: string | undefined;
|
|
604
|
+
/**
|
|
605
|
+
* `deploy --to … --branch <label> --allow-shared-schema-changes`: proceed even
|
|
606
|
+
* though the bundle changes tables or microservices.
|
|
607
|
+
*
|
|
608
|
+
* Those carry no branch dimension, so they reach PRODUCTION whichever branch
|
|
609
|
+
* is targeted. A separate flag rather than a prompt, because the failure mode
|
|
610
|
+
* is not knowing — and `--yes` in CI answers a prompt without reading it.
|
|
611
|
+
*/
|
|
612
|
+
allowSharedSchemaChanges: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* `deploy --to … --replace --allow-branch-deletion`: proceed even though the clear
|
|
615
|
+
* will permanently delete the workspace's non-live branches.
|
|
616
|
+
*
|
|
617
|
+
* The engine's clear deletes by WORKSPACE, so every branch goes, and nothing
|
|
618
|
+
* brings one back — the same statement clears the saved versions that would
|
|
619
|
+
* otherwise be the way back. A separate flag rather than a prompt, for the
|
|
620
|
+
* same reason as {@link allowSharedSchemaChanges}: the failure mode is not
|
|
621
|
+
* knowing, and `--yes` in CI answers a prompt without reading it.
|
|
622
|
+
*/
|
|
623
|
+
allowBranchDeletion: boolean;
|
|
624
|
+
/**
|
|
625
|
+
* `deploy --to … --backup-branch[=<label>]`: clone the live branch before importing,
|
|
626
|
+
* so a bad promote is one `set-live` away from being undone.
|
|
627
|
+
*/
|
|
628
|
+
backupBranch: string | boolean | undefined;
|
|
629
|
+
/**
|
|
630
|
+
* `deploy --to <destination>`: reach a REAL destination — `workspace`, or
|
|
631
|
+
* `tenant:<name>` — instead of the throwaway environment a deploy defaults to.
|
|
632
|
+
*
|
|
633
|
+
* The documented escape hatch from the release flow, and deliberately a flag
|
|
634
|
+
* rather than a default: the recommended paths to a real destination are
|
|
635
|
+
* `promote` and `tenant deploy`, which go through a release. Absent, a deploy
|
|
636
|
+
* writes to an ephemeral and cannot reach anything else.
|
|
637
|
+
*/
|
|
638
|
+
to: string | undefined;
|
|
639
|
+
/**
|
|
640
|
+
* `deploy --local-engine`: send this deploy to a Xano engine running on THIS
|
|
641
|
+
* machine instead of to an ephemeral.
|
|
642
|
+
*
|
|
643
|
+
* A DESTINATION, not a modifier — mutually exclusive with {@link to}, and
|
|
644
|
+
* refused alongside `--static`, which has no host to publish to here.
|
|
645
|
+
*/
|
|
646
|
+
localEngine: boolean;
|
|
647
|
+
/**
|
|
648
|
+
* `deploy --local-engine=<version|url|path>`: an OVERRIDE engine — a
|
|
649
|
+
* published version (`v0.1.8`, the `v` optional), an `http(s)` URL to fetch it
|
|
650
|
+
* from, or the path to an engine archive already on disk (`~` and relative
|
|
651
|
+
* paths both resolve). An override never reads or writes the project's pin
|
|
652
|
+
* and skips the update check. XANOSDK_LOCAL_ENGINE_OVERRIDE supplies the same
|
|
653
|
+
* value from the environment when the flag carries none.
|
|
654
|
+
*
|
|
655
|
+
* Absent (a bare `--local-engine`), the run uses the project's pinned engine
|
|
656
|
+
* version from `package.json` (`"xanosdk": { "@xano/sdk": { "localEngine" } }`),
|
|
657
|
+
* or on the first run the latest published engine, which it then pins. A
|
|
658
|
+
* newer published engine is offered on a terminal and never applied without
|
|
659
|
+
* an explicit yes.
|
|
660
|
+
*/
|
|
661
|
+
localEngineUrl: string | undefined;
|
|
662
|
+
/**
|
|
663
|
+
* `local-engine update --version <v>` / `local-engine cache clear --version <v>`:
|
|
664
|
+
* the engine version to move the pin to, or the cached one to remove. Taken as
|
|
665
|
+
* typed; the command normalizes it (`0.1.5` → `v0.1.5`). Only the first token
|
|
666
|
+
* spells the CLI's own version (`xanosdk --version`), so this cannot collide.
|
|
667
|
+
*/
|
|
668
|
+
engineVersion: string | undefined;
|
|
669
|
+
/** `release create --description <text>`: what this release is for. */
|
|
670
|
+
description: string | undefined;
|
|
671
|
+
/**
|
|
672
|
+
* `publish --release <name>`: the release whose frontend this is. Context, not
|
|
673
|
+
* content — a release carries no frontend, so this only names what the
|
|
674
|
+
* publish is checked and reported against.
|
|
675
|
+
*/
|
|
676
|
+
release: string | undefined;
|
|
677
|
+
/**
|
|
678
|
+
* `--json`: force the machine-readable JSON on stdout even at a terminal.
|
|
679
|
+
* Absent, the format is inferred from stdout being a TTY. Read through
|
|
680
|
+
* `isMachineOutput` (output.ts) — never by re-checking `isTTY` at a call site.
|
|
681
|
+
*/
|
|
682
|
+
json: boolean;
|
|
683
|
+
/**
|
|
684
|
+
* `--no-refresh`: skip the agent-guidance refresh a compile runs as a
|
|
685
|
+
* courtesy. Global, because that courtesy rides on `export`, `deploy`,
|
|
686
|
+
* `release`, and `preflight` alike — and it writes to the user's tree, so
|
|
687
|
+
* "build without touching my files" has to be sayable on any of them.
|
|
688
|
+
*/
|
|
689
|
+
noRefresh: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* `deploy --open`: open the deployed URL in the default browser once it lands.
|
|
692
|
+
* Honors `XANO_NO_BROWSER` like every other launch, since it shares the same
|
|
693
|
+
* helper.
|
|
694
|
+
*/
|
|
695
|
+
open: boolean;
|
|
696
|
+
/**
|
|
697
|
+
* Leading-dash tokens the parser doesn't recognize. They are collected HERE
|
|
698
|
+
* rather than falling into {@link positionals} so an unknown flag can never be
|
|
699
|
+
* resolved as the entry `<file>`: otherwise `xanosdk deploy --help` is
|
|
700
|
+
* imported as a module path and dies in Node's loader with a message about a
|
|
701
|
+
* missing file named `--help`.
|
|
702
|
+
*/
|
|
703
|
+
unknownFlags: string[];
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* `-p=beta` → `--profile=beta`: the attached form of a VALUE-taking short flag,
|
|
707
|
+
* spelled as its long flag so the loop's `--x=` branch reads it. Read off the
|
|
708
|
+
* registry spec (`--profile, -p <name>`), so every such short is covered; a
|
|
709
|
+
* boolean short (`-y=…`) is left alone and refused as the unknown token it is.
|
|
710
|
+
*/
|
|
711
|
+
declare function expandShortAttached(arg: string): string;
|
|
712
|
+
/**
|
|
713
|
+
* What an env var name may be — the shape the backend's own editor accepts
|
|
714
|
+
* (letters, digits and `_`, not starting with a digit), which is also the only
|
|
715
|
+
* shape `xano/.env` can hold. Said wherever a name is refused, so the rule
|
|
716
|
+
* reads the same from `--env-var`, `workspaceConfig({ env })` and the file.
|
|
717
|
+
*/
|
|
718
|
+
declare function envNameRule(): string;
|
|
719
|
+
declare function parseArgs(argv: string[]): ParsedArgs;
|
|
720
|
+
/**
|
|
721
|
+
* A resolved help request: the deepest command path present, or the topic word
|
|
722
|
+
* that `xanosdk help <topic>` named and the registry does not know.
|
|
723
|
+
*/
|
|
724
|
+
interface HelpRequest {
|
|
725
|
+
command?: string;
|
|
726
|
+
subcommand?: string;
|
|
727
|
+
/** Set only for `xanosdk help <unknown>` — see {@link resolveHelpRequest}. */
|
|
728
|
+
unknownTopic?: string;
|
|
729
|
+
/** Set only for `xanosdk <unknown> --help` with a command-shaped word. */
|
|
730
|
+
unknownCommand?: string;
|
|
731
|
+
/** Set only for `xanosdk <family> <not-a-verb> --help`, beside `command`. */
|
|
732
|
+
unknownSubcommand?: string;
|
|
733
|
+
/** The words after {@link unknownSubcommand}, for a moved verb's rename hint. */
|
|
734
|
+
positionals?: string[];
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Resolve a help request straight from the RAW argv, before any flag parsing.
|
|
738
|
+
*
|
|
739
|
+
* Deliberately pre-parse: `parseArgs` throws on removed flags and malformed
|
|
740
|
+
* values, so resolving help afterwards would mean `xanosdk deploy --profile x
|
|
741
|
+
* --help` died on the flag error instead of printing the help the user asked
|
|
742
|
+
* for. Returns the deepest command path present (`{}` for global help), or
|
|
743
|
+
* undefined when no help was requested.
|
|
744
|
+
*/
|
|
745
|
+
declare function resolveHelpRequest(argv: string[]): HelpRequest | undefined;
|
|
746
|
+
declare function loadDefault(file: string): Promise<unknown>;
|
|
747
|
+
/**
|
|
748
|
+
* How to get `tsx` for the project around `file`: a project whose package.json
|
|
749
|
+
* already declares it has only not installed its dependencies (a fresh clone),
|
|
750
|
+
* so the step is its own install — from where the command was typed. Exported for the tests.
|
|
751
|
+
*/
|
|
752
|
+
declare function tsxRemedy(file: string): Promise<string>;
|
|
753
|
+
/**
|
|
754
|
+
* Refuse an entry file that is not there — `SDK_USAGE`, exit 1, as every
|
|
755
|
+
* missing local input. Exported so a command that reads a credential
|
|
756
|
+
* (`preflight`, `workspace diff`) answers a typo before "not signed in".
|
|
757
|
+
*/
|
|
758
|
+
declare function assertEntryExists(file: string): void;
|
|
759
|
+
/**
|
|
760
|
+
* Load an entry file with the CLI's loader, returning its whole module
|
|
761
|
+
* namespace. A throw from the author's own code closes with the line that
|
|
762
|
+
* threw — a factory validates before its owning def exists ({@link withAuthoringSite}).
|
|
763
|
+
*/
|
|
764
|
+
declare function loadModule(file: string): Promise<Record<string, unknown>>;
|
|
765
|
+
/**
|
|
766
|
+
* Resolve this package's version for `xanosdk version`. Walks up from the running
|
|
767
|
+
* module to the package root's `package.json` (`dist/cli.js` → `../`, the
|
|
768
|
+
* `src/emit/cli.ts` source → `../../`), matching on the package NAME so a stray
|
|
769
|
+
* ancestor `package.json` can't shadow it. Best-effort: returns `"unknown"` rather
|
|
770
|
+
* than throwing when it can't be located, since a version print must never fail.
|
|
771
|
+
*
|
|
772
|
+
* MEMOIZED, because this stopped being a once-per-command question. The version
|
|
773
|
+
* is read by the update notice, by the scaffold's templates, by the bundle
|
|
774
|
+
* and preflight hooks, and by the toolchain loader's peer-range check — several
|
|
775
|
+
* of them in the same run — and the answer cannot change while the process
|
|
776
|
+
* lives: it is this installation's own manifest. Without the cache a single
|
|
777
|
+
* `deploy` walks up to six directories, reading and parsing at each, more than
|
|
778
|
+
* once for a fact it already had. `"unknown"` is cached too; a version that
|
|
779
|
+
* could not be located once will not be located a moment later, and re-walking
|
|
780
|
+
* on every call is precisely the cost this removes.
|
|
781
|
+
*/
|
|
782
|
+
declare function readVersion(): string;
|
|
783
|
+
/**
|
|
784
|
+
* The `emit` of the `@xano/sdk` copy the ENTRY resolves, when that is not
|
|
785
|
+
* this CLI's own copy.
|
|
786
|
+
*
|
|
787
|
+
* A def is built by the SDK its module imports, and its statements are
|
|
788
|
+
* registered in THAT copy's statement registry. A global or repo-checkout
|
|
789
|
+
* `xanosdk` compiling a project with its own install is two copies: encoding
|
|
790
|
+
* the project's def with this CLI's `emit` looks every statement up in a
|
|
791
|
+
* registry that never saw them. `export` never hits this because it calls the
|
|
792
|
+
* workspace's own `export()` method; `compile` takes a lone def, which has no
|
|
793
|
+
* method to call, so the project's `emit` is imported instead. The same copy
|
|
794
|
+
* (or none resolvable, e.g. an entry outside any project) keeps this CLI's.
|
|
795
|
+
*/
|
|
796
|
+
declare function emitterFor(file: string): Promise<typeof emit>;
|
|
797
|
+
/**
|
|
798
|
+
* Write the grouped command reference to STDOUT — help is requested output, not
|
|
799
|
+
* an error. The reference itself comes from the command registry via
|
|
800
|
+
* `help.ts`; nothing about the command surface is written down here.
|
|
801
|
+
*/
|
|
802
|
+
declare function printHelp(): void;
|
|
803
|
+
/**
|
|
804
|
+
* The two fix-up commands for one orphan, spelled so they RUN as printed.
|
|
805
|
+
*
|
|
806
|
+
* Neither resolves the lock the way `export` just did. `lock rename` takes no
|
|
807
|
+
* entry file at all, so it looks for `xano.lock` in the current directory —
|
|
808
|
+
* which in the scaffolded layout (`xano/xano.lock`, CI at the repo root, where
|
|
809
|
+
* this text prints) is the one place it is not. `lock prune` takes the entry
|
|
810
|
+
* file and derives the lock from it, so it needs the entry named. A remedy a
|
|
811
|
+
* reader pastes and gets an error from is worse than no remedy: it reads as the
|
|
812
|
+
* tool being broken rather than as the command being incomplete.
|
|
813
|
+
*/
|
|
814
|
+
declare function orphanFixUps(key: string, entryFile: string, lockPath: string, kinds?: ReadonlyMap<string, string>,
|
|
815
|
+
/** Orphaned entries whose keys compose this one's name: its rename moves them, its prune drops them too. */
|
|
816
|
+
children?: readonly string[],
|
|
817
|
+
/** The one candidate for the new name, when there is exactly one: printed in place of the placeholder. */
|
|
818
|
+
only?: string): string[];
|
|
819
|
+
/** The keys among `keys` whose names compose `key`'s (an api group's queries): a `lock rename` of it moves them. */
|
|
820
|
+
declare function composedChildren(key: string, keys: readonly string[]): string[];
|
|
821
|
+
/**
|
|
822
|
+
* {@link renameCandidates} for every orphan of one run. A new name filled in
|
|
823
|
+
* for two orphans at once is a guess between them — following it for the
|
|
824
|
+
* wrong one moves that object's guid onto the other — so it is listed under
|
|
825
|
+
* each instead, and the reader picks.
|
|
826
|
+
*/
|
|
827
|
+
/** An orphan's likely new name, as {@link renameCandidates} reads it. */
|
|
828
|
+
interface RenameCandidates {
|
|
829
|
+
hint: string;
|
|
830
|
+
/** The one candidate, filled into the printed `lock rename`. */
|
|
831
|
+
only?: string;
|
|
832
|
+
/** The one candidate, shared with other orphans (an adopted one's). */
|
|
833
|
+
shared?: string;
|
|
834
|
+
/** The newcomers {@link hint} names when it names more than one, or one no rename is filled in for. */
|
|
835
|
+
candidates?: {
|
|
836
|
+
noun: string;
|
|
837
|
+
names: readonly string[];
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* The one candidate pins its own guid in its def: no `lock rename` carries
|
|
841
|
+
* the identity onto it, so the def is pointed at the orphan's `guid` instead.
|
|
842
|
+
*/
|
|
843
|
+
inCode?: {
|
|
844
|
+
name: string;
|
|
845
|
+
guid: string;
|
|
846
|
+
pins: string;
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
/** The rename fix-up for {@link RenameCandidates.inCode}: set the def's guid, not the lock's. */
|
|
850
|
+
declare function setGuidFixUp(inCode: NonNullable<RenameCandidates["inCode"]>): string;
|
|
851
|
+
declare function renameCandidatesFor(orphans: readonly string[], previous: LockFile, observed: Record<string, unknown>, kinds?: ReadonlyMap<string, string>): Map<string, RenameCandidates>;
|
|
852
|
+
declare function run(argv: string[]): Promise<void>;
|
|
853
|
+
/**
|
|
854
|
+
* Every `NAME=value` word on the command line, shown as `NAME=…` in a refusal.
|
|
855
|
+
*
|
|
856
|
+
* `deploy STRIPE=sk_live_…` is a positional, and the refusal quoted it whole —
|
|
857
|
+
* `Cannot find entry file "STRIPE=sk_live_…"`, `No release named …` — in every
|
|
858
|
+
* command that reads its first positional as a path or a name. The value is
|
|
859
|
+
* the one part that may be a secret, and nothing a refusal says needs it. Where
|
|
860
|
+
* the command takes `--env-var`, the flag the reader most likely meant is named.
|
|
861
|
+
*/
|
|
862
|
+
declare function maskAssignments(err: unknown, argv: readonly string[]): unknown;
|
|
863
|
+
/**
|
|
864
|
+
* A failure's `--json` document carries the run's warnings too, as
|
|
865
|
+
* `error.details.warnings` — where `publish` already put its own. An export's
|
|
866
|
+
* failed checks arrive as a list (`DiagnosticError`); the document names it
|
|
867
|
+
* `details.diagnostics`, so the warnings have an object to sit in beside it —
|
|
868
|
+
* a `--strict` refusal otherwise dropped every warning the run had printed.
|
|
869
|
+
* A failure whose details are some other non-object is left as it is.
|
|
870
|
+
*/
|
|
871
|
+
declare function carryRunWarnings(err: unknown): unknown;
|
|
872
|
+
/**
|
|
873
|
+
* `env set NAME VALUE` with VALUE removed from the command line by the
|
|
874
|
+
* position the parser read it at — never by searching for the value, which
|
|
875
|
+
* found an equal `-p`/`--to` value (or the name) first and reprinted the
|
|
876
|
+
* secret. A value piped on stdin was never on it. Exported for the tests.
|
|
877
|
+
*/
|
|
878
|
+
declare function withoutSecretValue(args: ParsedArgs): ParsedArgs;
|
|
879
|
+
/** Whether this run prints no path relative to the project root — see {@link PATHLESS_VERBS}. */
|
|
880
|
+
declare function isPathlessRun(args: Pick<ParsedArgs, "command" | "subcommand">): boolean;
|
|
881
|
+
/**
|
|
882
|
+
* `--version`/`-v` written after a command that has no `--version` of its own:
|
|
883
|
+
* the global flag help and completion list, so it prints the CLI's version.
|
|
884
|
+
* `whoami --version` said "--version expects an engine version", and
|
|
885
|
+
* `status -v` "Unknown flag -v". Not when a value follows (`deploy --version
|
|
886
|
+
* v0.1.5` is an engine version on the wrong command, refused as such), not on
|
|
887
|
+
* a verb that DOES take one (`local-engine update --version v0.1.5`), not past
|
|
888
|
+
* `--`, and never on `env set`, whose value may be `-v`.
|
|
889
|
+
*/
|
|
890
|
+
declare function globalVersionAsked(argv: readonly string[]): boolean;
|
|
891
|
+
/**
|
|
892
|
+
* `status -v extra`, `tables --version local-engine`: the global version flag
|
|
893
|
+
* followed by a positional. Neither reading is safe to guess — the run the
|
|
894
|
+
* reader wanted, or the version — so it is one usage error naming both ways
|
|
895
|
+
* out, never "Unknown flag -v. Did you mean: --version". An engine-version-
|
|
896
|
+
* shaped value (`whoami --version v0.1.5`) keeps its own refusal: that is an
|
|
897
|
+
* engine version on a command that takes none.
|
|
898
|
+
*/
|
|
899
|
+
declare function globalVersionMisuse(argv: readonly string[]): UsageError | undefined;
|
|
900
|
+
/**
|
|
901
|
+
* Bring a project's agent guidance back in line with the installed version.
|
|
902
|
+
*
|
|
903
|
+
* Called from {@link compileBundle}, which is the workspace compile behind
|
|
904
|
+
* `export`, `deploy`, `release`, and `preflight` — `deploy` being the one an
|
|
905
|
+
* agent's loop actually runs. An earlier version hung this off the `export`
|
|
906
|
+
* tail alone, so an agent running `npm run xano:deploy` never got a refresh.
|
|
907
|
+
*
|
|
908
|
+
* `compile` and `paths`/`routes` do NOT route through here: they answer narrow
|
|
909
|
+
* questions about a single def or a route table rather than building a
|
|
910
|
+
* workspace, and neither is a loop worth writing to a user's tree from.
|
|
911
|
+
*
|
|
912
|
+
* It only ever updates a managed block that already exists, is silent in CI and
|
|
913
|
+
* when no coding agent is detected, and never fails the compile — see
|
|
914
|
+
* `agent-file-refresh.ts` for the gates. `--no-refresh` turns it off outright,
|
|
915
|
+
* because this is still a write to the user's tree from a command they ran to
|
|
916
|
+
* BUILD something. Lazily imported so the browser-safe bundle never pulls in fs.
|
|
917
|
+
*/
|
|
918
|
+
declare function refreshAgentGuidance(args: ParsedArgs): Promise<void>;
|
|
919
|
+
/**
|
|
920
|
+
* Resolve the lock path for an entry file: `--lock=<path>` wins, else
|
|
921
|
+
* `xano.lock` beside the entry (matching `export`/`compile` defaults).
|
|
922
|
+
*/
|
|
923
|
+
/**
|
|
924
|
+
* The nearest `xano.lock` at or above a file's directory, falling back to the
|
|
925
|
+
* beside-the-file location `export` would write. `compile` seeds names and
|
|
926
|
+
* guids from it, and a single def lives a directory or two below the workspace
|
|
927
|
+
* entry the lock sits beside.
|
|
928
|
+
*/
|
|
929
|
+
declare function nearestLockPath(file: string): string;
|
|
930
|
+
/**
|
|
931
|
+
* The refusal for a `--lock=<path>` whose directory is not there, or undefined
|
|
932
|
+
* when it is (or no `--lock` was named). The lock is written through a temp
|
|
933
|
+
* file beside it, so a missing directory failed as a raw ENOENT on that temp
|
|
934
|
+
* path, with "make the directory writable" for a remedy.
|
|
935
|
+
*/
|
|
936
|
+
declare function missingLockDir(args: Pick<ParsedArgs, "lockPath">): string | undefined;
|
|
937
|
+
declare function resolveLockPath(args: ParsedArgs, file: string): string;
|
|
938
|
+
declare function noteLockCreated(lockPath: string, args?: Pick<ParsedArgs, "command" | "to" | "localEngine">, opts?: {
|
|
939
|
+
adopt?: boolean;
|
|
940
|
+
}): void;
|
|
941
|
+
/**
|
|
942
|
+
* Bring an existing route manifest up to date with the workspace, quietly —
|
|
943
|
+
* for a command that changed the workspace as a side effect (`marketplace
|
|
944
|
+
* remove` taking a module's endpoints with it) and must not leave the committed
|
|
945
|
+
* file listing routes that are gone. The same reading `routes --emit` makes,
|
|
946
|
+
* without its output. Also counts the lock entries the workspace no longer
|
|
947
|
+
* exports, which the same change orphans.
|
|
948
|
+
*
|
|
949
|
+
* "skipped" when the manifest cannot be brought up to date here (an api group
|
|
950
|
+
* whose canonical resolves nowhere), which the caller reports with the command.
|
|
951
|
+
*/
|
|
952
|
+
declare function refreshRouteManifest(entry: string, emit: string): Promise<{
|
|
953
|
+
manifest: "written" | "unchanged" | "skipped" | "absent";
|
|
954
|
+
lockOrphans: number;
|
|
955
|
+
}>;
|
|
956
|
+
/** A compiled bundle plus any seed `content/` entries (empty unless requested). */
|
|
957
|
+
interface CompiledBundle {
|
|
958
|
+
bundle: string;
|
|
959
|
+
/** The same bundle before serialization, for a consumer that renders rather than writes it. */
|
|
960
|
+
bundleObject: Bundle;
|
|
961
|
+
content: SeedContentFile[];
|
|
962
|
+
/**
|
|
963
|
+
* The bytes of every `hostedFile(...)` the bundle references, as `vault/`
|
|
964
|
+
* archive members. Always built: the bundle's file library lists them, so an
|
|
965
|
+
* archive without them cannot land.
|
|
966
|
+
*/
|
|
967
|
+
files: ArchiveEntry[];
|
|
968
|
+
/**
|
|
969
|
+
* Names of tables that declared `seed` but whose rows were NOT built into
|
|
970
|
+
* `content` (i.e. `opts.seed` was false). Empty when `opts.seed` is true. Lets
|
|
971
|
+
* the `export` command warn that its artifact omits seed — so the CI pattern
|
|
972
|
+
* `export --out bundle.json` then `deploy --bundle bundle.json` doesn't drop
|
|
973
|
+
* seed silently (a `--bundle` deploy has no registry to resolve seed from).
|
|
974
|
+
*/
|
|
975
|
+
omittedSeedTables: string[];
|
|
976
|
+
/**
|
|
977
|
+
* Seed values drawn from columns the schema declares non-public, for the
|
|
978
|
+
* `--static` publication guard. Empty unless seed was resolved.
|
|
979
|
+
*/
|
|
980
|
+
nonPublicSeedValues: NonPublicSeedValue[];
|
|
981
|
+
/**
|
|
982
|
+
* The lock this compile maintained — its path as the CLI names it, and whether
|
|
983
|
+
* this run changed it on disk — or null for a `--no-lock` build.
|
|
984
|
+
*/
|
|
985
|
+
lock: {
|
|
986
|
+
path: string;
|
|
987
|
+
changed: boolean;
|
|
988
|
+
} | null;
|
|
989
|
+
/** The build warnings this compile printed, for a `--json` document to carry. */
|
|
990
|
+
warnings: Array<{
|
|
991
|
+
code: string;
|
|
992
|
+
message: string;
|
|
993
|
+
}>;
|
|
994
|
+
/**
|
|
995
|
+
* The env names the SOURCE declares (`workspaceConfig({ env })`) — not the
|
|
996
|
+
* bundle's, which also carries names `--env-var` or `--backend-env-file`
|
|
997
|
+
* added for this one build. What a committed `.env.example` lists.
|
|
998
|
+
*/
|
|
999
|
+
declaredEnvNames: string[];
|
|
1000
|
+
/**
|
|
1001
|
+
* The lock as THIS compile classified it — the merged model, whether or not
|
|
1002
|
+
* it has been written yet. Absent for a `--no-lock` build.
|
|
1003
|
+
*
|
|
1004
|
+
* What a release pins is read from here, not from the file: a deferred write
|
|
1005
|
+
* (`deferLockWrite`) or a read-only run (`lockReadOnly`, a dry run) leaves
|
|
1006
|
+
* the file one export behind, and a `canonical` the code names on an object
|
|
1007
|
+
* new to it would otherwise ride the first release as a preference.
|
|
1008
|
+
*/
|
|
1009
|
+
classifiedLock?: LockFile;
|
|
1010
|
+
/**
|
|
1011
|
+
* Present only when the compile was asked to defer its lock write
|
|
1012
|
+
* (`deferLockWrite`) and there is one to make: writes the lock and says so.
|
|
1013
|
+
* The caller runs it once its own pre-write refusals have passed, so a
|
|
1014
|
+
* refused run leaves `xano.lock` untouched.
|
|
1015
|
+
*/
|
|
1016
|
+
commitLock?: (opts?: CommitLockOptions) => void;
|
|
1017
|
+
/**
|
|
1018
|
+
* Present only when the compile was asked to defer its orphan warning
|
|
1019
|
+
* (`deferOrphanWarning`): says it, once, leaving out the keys a `--prune` the
|
|
1020
|
+
* caller has since planned deletes. A dry run writes no lock, so this is how
|
|
1021
|
+
* its preview drops the "renamed? / deleted?" fix-ups for them (E2E pass 25).
|
|
1022
|
+
*/
|
|
1023
|
+
warnLockOrphans?: (pruned?: ReadonlySet<string>) => void;
|
|
1024
|
+
/**
|
|
1025
|
+
* Present beside {@link commitLock}: says the orphan warning the deferred
|
|
1026
|
+
* write would have said, for a run refused before it — the "renamed? / deleted?"
|
|
1027
|
+
* fix-ups are as true of a refused deploy as of an export. Once: the write
|
|
1028
|
+
* that follows does not repeat it.
|
|
1029
|
+
*/
|
|
1030
|
+
warnOrphansUncommitted?: () => void;
|
|
1031
|
+
}
|
|
1032
|
+
/** What a deferring caller knows by the time it commits the lock. */
|
|
1033
|
+
interface CommitLockOptions {
|
|
1034
|
+
/**
|
|
1035
|
+
* Lock keys a confirmed `--prune` is about to delete. Their entries match no
|
|
1036
|
+
* exported object BECAUSE the project deleted them, so the orphan warning's
|
|
1037
|
+
* "renamed? / deleted?" fix-ups are not said for them.
|
|
1038
|
+
*/
|
|
1039
|
+
readonly pruned?: ReadonlySet<string>;
|
|
1040
|
+
/**
|
|
1041
|
+
* The destination as it resolved, when that says more than `--to` did: a
|
|
1042
|
+
* `tenant:<handle>` that is an ephemeral is `ephemeral:<handle>`, so a new
|
|
1043
|
+
* lock's adopt pointer names the export that reads one (E2E pass 26).
|
|
1044
|
+
*/
|
|
1045
|
+
readonly to?: string;
|
|
1046
|
+
/**
|
|
1047
|
+
* The run's plan only created, and met no conflict: the destination held
|
|
1048
|
+
* nothing of this project's to adopt, so a new lock says no adopt pointer
|
|
1049
|
+
* (E2E pass 28: a first `--to` deploy that only created still said it).
|
|
1050
|
+
*/
|
|
1051
|
+
readonly nothingToAdopt?: boolean;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Thin wrapper over {@link compileBundle} for the many callers that only need the
|
|
1055
|
+
* bundle text (export, preflight). Seed content is not built here.
|
|
1056
|
+
*
|
|
1057
|
+
* Exported from `@xano/sdk/node`, so this is a PUBLIC surface and it inherits
|
|
1058
|
+
* the default: calling it writes and maintains `xano.lock` beside the entry
|
|
1059
|
+
* file, and it can fail for the reasons a locked build fails (an unwritable
|
|
1060
|
+
* directory, a lock that does not parse). That is deliberate — the default is
|
|
1061
|
+
* about what compiling an entry file means, not about which process asked — but
|
|
1062
|
+
* a programmatic caller that wants bytes and nothing else should pass
|
|
1063
|
+
* `--no-lock` through its `ParsedArgs`.
|
|
1064
|
+
*/
|
|
1065
|
+
declare function exportBundleJson(args: ParsedArgs): Promise<string>;
|
|
1066
|
+
/**
|
|
1067
|
+
* Compile an entry file to its `packageExport` bundle, running the full lock
|
|
1068
|
+
* pipeline (seed → export → write). With `opts.seed`, also resolve + validate the
|
|
1069
|
+
* tables' seed rows into signed `content/` archive entries — done HERE, inside the
|
|
1070
|
+
* same lock-seeded context as the export, so a seed file's `dbo` guid matches the
|
|
1071
|
+
* table's guid in `workspace.json`. Only the deploy path passes `seed:true`, so a
|
|
1072
|
+
* plain `export`/`validate` never resolves seed sources.
|
|
1073
|
+
*/
|
|
1074
|
+
declare function compileBundle(args: ParsedArgs, opts?: {
|
|
1075
|
+
seed?: boolean;
|
|
1076
|
+
deferLockWrite?: boolean;
|
|
1077
|
+
deferOrphanWarning?: boolean;
|
|
1078
|
+
}): Promise<CompiledBundle>;
|
|
1079
|
+
/**
|
|
1080
|
+
* A stand-in token for every declared documentation scope, for a compile whose
|
|
1081
|
+
* bytes are never signed for anyone: `routes`, and `export --check`.
|
|
1082
|
+
*
|
|
1083
|
+
* A stand-in, not an opt-out to empty: an emptied gate reads to the export's
|
|
1084
|
+
* guards as docs about to go PUBLIC — a warning `--strict` promotes into a
|
|
1085
|
+
* failure over a bundle nobody ships. With a value in place a gate reads as the
|
|
1086
|
+
* gate it is, and every other finding still stands. No secrets file is read,
|
|
1087
|
+
* because a fresh clone and a CI checkout have none. The value never leaves the
|
|
1088
|
+
* process that made it.
|
|
1089
|
+
*/
|
|
1090
|
+
declare function checkStandInTokens(def: Xano): {
|
|
1091
|
+
values: Record<string, string>;
|
|
1092
|
+
allowEmpty: ReadonlySet<string>;
|
|
1093
|
+
};
|
|
1094
|
+
/** Record the credential scope this run acts as. `undefined` forgets it. */
|
|
1095
|
+
declare function noteRunScope(scope: EnvScope | undefined): void;
|
|
1096
|
+
/**
|
|
1097
|
+
* The workspace documentation-gate refusal a `--keep-data` compile deferred,
|
|
1098
|
+
* for a deploy whose arm is a REPLACE after all — new, recreated or
|
|
1099
|
+
* unvouched-for: a replace writes the workspace's documentation block, and
|
|
1100
|
+
* without the token the gate is gone. Undefined when nothing was deferred.
|
|
1101
|
+
*/
|
|
1102
|
+
declare function docTokenRefusalIfReplaced(replaceWhy: string): string | undefined;
|
|
1103
|
+
/**
|
|
1104
|
+
* The refusal a `--keep-data` compile deferred, for a deploy whose arm turned
|
|
1105
|
+
* out to be a REPLACE of an environment that holds data (`--keep-data` had
|
|
1106
|
+
* nothing it could vouch for): there, an empty value does clear the live one.
|
|
1107
|
+
* Undefined when nothing was deferred.
|
|
1108
|
+
*/
|
|
1109
|
+
declare function envRefusalIfReplaced(replaceWhy: string): string | undefined;
|
|
1110
|
+
|
|
1111
|
+
export { type CommitLockOptions, type CompiledBundle, type HelpRequest, type ParsedArgs, assertEntryExists, carryRunWarnings, checkStandInTokens, compileBundle, composedChildren, docTokenRefusalIfReplaced, emitterFor, envNameRule, envRefusalIfReplaced, expandShortAttached, exportBundleJson, globalVersionAsked, globalVersionMisuse, isPathlessRun, loadDefault, loadModule, maskAssignments, missingLockDir, nearestLockPath, noteLockCreated, noteRunScope, orphanFixUps, parseArgs, printHelp, readVersion, refreshAgentGuidance, refreshRouteManifest, renameCandidatesFor, resolveHelpRequest, resolveLockPath, run, setGuidFixUp, tsxRemedy, withoutSecretValue };
|