@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
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
# Environment & identity
|
|
2
|
+
|
|
3
|
+
The environment variables Xano SDK reads on your machine, the workspace env vars your deployed stack reads at runtime, and how `xano.lock` pins object identity across deploys. Every build writes the lock; commit it.
|
|
4
|
+
|
|
5
|
+
## Environment variables
|
|
6
|
+
|
|
7
|
+
Every variable the CLI and SDK read. All are optional — the defaults in the right column
|
|
8
|
+
are what you get when the variable is unset.
|
|
9
|
+
|
|
10
|
+
**Authentication** (see [Signing in & deploying](deploying.md) for the full precedence ladder)
|
|
11
|
+
|
|
12
|
+
| Variable | What it does |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `XANO_INSTANCE_URL` | Instance origin for the meta credential (CI, agents), e.g. `https://your-instance.xano.io`. Set with `XANO_WORKSPACE_ID` + `XANO_META_TOKEN` — all three together, or none. |
|
|
15
|
+
| `XANO_WORKSPACE_ID` | Numeric workspace the meta credential acts on. |
|
|
16
|
+
| `XANO_META_TOKEN` | Meta API bearer token. With the two above it forms a complete credential that outranks every other source, reads no file, and never rotates. |
|
|
17
|
+
| `XANO_REFRESH_TOKEN` | OAuth refresh token for non-interactive runs (CI, agents). Paired with `XANO_CLIENT_ID`; the target instance comes from the token's own `aud` claim. Rotates on use — prefer the meta credential above. |
|
|
18
|
+
| `XANO_CLIENT_ID` | OAuth client id that goes with `XANO_REFRESH_TOKEN`. Both are copied once out of the profile in `auth.json` after a local `xanosdk login`. |
|
|
19
|
+
| `XANO_CONFIG` | Explicit path to the credential file. Wins over both default locations — the same thing `--config <path>` does. Refused beside `--local`, which names a different file. |
|
|
20
|
+
| `XANO_PROFILE` | Which stored credential profile to act as, when no `--profile` names one. Outranked by the flag, by the project's `xano.profile.json` pin, and by an environment credential (which displaces it with a note on stderr). |
|
|
21
|
+
| `XANO_GLOBAL_CONFIG` | Moves the **shared** credential cache off `~/.xanosdk/auth.json`. Only changes where the global cache lives; the project-local `./.xano/auth.json` and the `XANO_CONFIG`/`--config` override are unaffected. |
|
|
22
|
+
| `XANO_CLIENT_FILE` | Moves the OAuth **client-registration** cache off `~/.xano/xanosdk-clients.json`. That file holds the `client_id` minted per auth host + redirect URI, not a credential. |
|
|
23
|
+
| `XANO_ORIGIN` | OAuth host to sign in against, instead of the default — the same thing `--origin` does. An origin only (`https://host`): a path, query or fragment is refused. |
|
|
24
|
+
| `XANO_NO_BROWSER` | Set to anything non-empty and `xanosdk login` will **not** launch a browser; it prints the authorize URL to stderr for you to open yourself. The loopback server still runs and still waits for the redirect, so the flow completes only if the browser you open it in can reach this machine's `127.0.0.1`. For a machine that has no browser to launch. When the browser is on a **different** machine, that redirect cannot arrive — use `xanosdk login --paste` instead. |
|
|
25
|
+
|
|
26
|
+
**`xanosdk preflight`** — its own target, deliberately separate from the deploy login
|
|
27
|
+
|
|
28
|
+
| Variable | What it does |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `XANO_VALIDATE_INSTANCE` | Base URL of the instance to validate against (`https://your-instance.xano.io`, or `http://localhost:8080` for local Docker). Required; `--instance <url>` overrides it. |
|
|
31
|
+
| `XANO_VALIDATE_TOKEN` | Meta API bearer token for that instance. Required. |
|
|
32
|
+
| `XANO_VALIDATE_WORKSPACE_ID` | Parent workspace the run's throwaway environment is created under. Defaults to `1`. |
|
|
33
|
+
|
|
34
|
+
**Output & diagnostics**
|
|
35
|
+
|
|
36
|
+
| Variable | What it does |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `XANOSDK_DEBUG` | Appends the untouched underlying error to a failure message, instead of only the mapped explanation. |
|
|
39
|
+
| `NO_COLOR` | Suppresses ANSI color on the stderr progress output ([no-color.org](https://no-color.org)). Color is off by default whenever stderr is not a TTY. |
|
|
40
|
+
| `FORCE_COLOR` | Forces color on even when stderr is not a TTY; `FORCE_COLOR=0` forces it off and beats `NO_COLOR`'s absence either way. |
|
|
41
|
+
|
|
42
|
+
**Update notifier**
|
|
43
|
+
|
|
44
|
+
| Variable | What it does |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `XANOSDK_NO_UPDATE_CHECK` | Turns the "a newer version is out" notice off (it reads the registry at most once an hour). |
|
|
47
|
+
| `NO_UPDATE_NOTIFIER` | The de-facto convention, honored identically. `CI` being set also silences the notice. |
|
|
48
|
+
| `XANOSDK_INSTALL_MODE` | `global` or `local` — pins whether the notice suggests `npm i -g` or `xanosdk upgrade` (a project-local install), instead of detecting it. |
|
|
49
|
+
| `XANOSDK_UPDATE_REGISTRY` | Registry URL the check reads, instead of the npm endpoint for `@xano/sdk`. |
|
|
50
|
+
| `XANOSDK_UPDATE_CACHE` | Moves the check's cache file off `~/.xanosdk/update-check.json`. |
|
|
51
|
+
|
|
52
|
+
**Local engine** (see [Deploying to a local engine](deploying.md#deploying-to-a-local-engine))
|
|
53
|
+
|
|
54
|
+
| Variable | What it does |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `XANOSDK_LOCAL_ENGINE_OVERRIDE` | An engine to run instead of the project's pinned one, for every `deploy --local-engine` in this shell: a version (`v0.1.8`), an `https://` URL to an engine archive (plain `http://` only from this machine), or an archive path. A value on `--local-engine=` beats it; it never reads or moves the pin. |
|
|
57
|
+
| `XANOSDK_LOCAL_ENGINE_TOKEN` | Bearer credential sent with an override URL's download — only to that URL's own origin, never to another host a redirect leads to. |
|
|
58
|
+
| `XANOSDK_LOCAL_ENGINE_HOME` | Moves everything the local engine writes off `~/.xanosdk/local-engine`: the engine cache, the running-engine records, and the engine's own logs and runtime data — see [where the engine keeps its data](deploying.md#where-the-engine-keeps-its-data). |
|
|
59
|
+
| `XANOSDK_ENGINE_RELEASES_URL` | A different engine release service for version lookups. Its engines are fetched fresh each deploy, the pin is not read or written, and `xanosdk local-engine update` refuses while it is set. |
|
|
60
|
+
|
|
61
|
+
**Escape hatches**
|
|
62
|
+
|
|
63
|
+
| Variable | What it does |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `XANOSDK_MARKETPLACE_URL` | Base URL the `xanosdk marketplace` reads hit, instead of the published catalogue. Repoints the three read verbs without waiting for a release. |
|
|
66
|
+
| `XANOSDK_PROVE_DIFF` | A file path. Codegen appends one JSON line per statement that fell back to `raw()` — the arm that declined and the key paths where the re-encode disagreed. The decline *reason* is on the report either way; this adds the machine-readable detail. |
|
|
67
|
+
|
|
68
|
+
> `process.env` read inside a **workspace definition** is a different thing entirely: it
|
|
69
|
+
> resolves at export time and bakes the literal into the bundle. For a value the deployed
|
|
70
|
+
> stack reads at runtime, use `workspaceConfig({ env })` + `env("NAME")`, covered in the next
|
|
71
|
+
> section.
|
|
72
|
+
|
|
73
|
+
## Workspace environment variables
|
|
74
|
+
|
|
75
|
+
Everything above is read by the **CLI, on your machine**. A *workspace* env var is a different
|
|
76
|
+
set entirely: it lives in the backend, the deployed stack reads it at request time with
|
|
77
|
+
`env("NAME")`, and the CLI only ever carries it to the engine. Nothing in the table above
|
|
78
|
+
affects one.
|
|
79
|
+
|
|
80
|
+
Names are declared in source; values are not.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
workspaceConfig({ name: "my-app", env: { STRIPE_KEY: "" } });
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# xano/.env: gitignored, and the default a bundle-producing command reads with no flag.
|
|
88
|
+
STRIPE_KEY=sk_test_REPLACE_ME
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A pull carries the **names** into the config and leaves the values in the backend, so a
|
|
92
|
+
checked-out project never holds a secret it did not fetch on purpose.
|
|
93
|
+
|
|
94
|
+
**The files**
|
|
95
|
+
|
|
96
|
+
| Path | What it is |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `xano/.env` | Where the values live. Gitignored by the scaffold, and preserved across a `xanosdk pull` rather than rewritten. Read with no flag by the commands that compile a bundle: `deploy`, `export`, `preflight`, and `release create` when its optional `--bundle` comparison compiles one. |
|
|
99
|
+
| `xano/.env.example` | Generated beside it, listing the declared names as commented lines. Committed. Copy it to `xano/.env` on a fresh clone and fill in the values. The lines stay commented on purpose, so an unedited copy meets the refusal below rather than sending empty strings to your backend. |
|
|
100
|
+
|
|
101
|
+
`xano/` is the scaffold's backend directory. The file is read from the directory of the
|
|
102
|
+
entry you compile: an entry anywhere under a top-level `<dir>/` (`src/index.ts`, `backend/index.ts`) reads
|
|
103
|
+
`<dir>/.env`, and an entry at the project root reads `xano/.env`. A tree `generate` wrote
|
|
104
|
+
reads the `.env` beside its own `index.ts`. The info line each compile prints names the file
|
|
105
|
+
it looked for.
|
|
106
|
+
|
|
107
|
+
**Filling it**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
xanosdk env pull # fetch the values from the source this project last deployed to
|
|
111
|
+
xanosdk env pull --from tenant:prod # name the source explicitly
|
|
112
|
+
xanosdk env pull --from workspace --yes # and skip the confirmation
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The source is a backend that is running: `workspace`, `ephemeral[:<name>]`,
|
|
116
|
+
`local-engine[:<name>]`, or `tenant:<name>` — the [backend grammar](cli.md#naming-a-backend)
|
|
117
|
+
every command shares. Left off, it is the ephemeral or local engine this project last
|
|
118
|
+
deployed to. A bundle path is refused, because its env is whatever it was built with,
|
|
119
|
+
which is the stale set this command exists to replace.
|
|
120
|
+
|
|
121
|
+
`env pull` overwrites an existing `xano/.env`, so it confirms first and names the source it is
|
|
122
|
+
about to read. A developer expecting dev secrets should not silently take production's. `--yes`
|
|
123
|
+
skips that confirmation, including the list of local values the pull would drop. Creating a
|
|
124
|
+
missing `xano/.env` replaces nothing, so it is not asked about; a file already holding exactly
|
|
125
|
+
the source's values is up to date, and nothing is asked or written.
|
|
126
|
+
|
|
127
|
+
It is the only command that writes `xano/.env`, but not the only place a secret lands on
|
|
128
|
+
disk: signing in stores your tokens in the credential file, and a compiled bundle carries the
|
|
129
|
+
resolved env values in cleartext (see the `--bundle` note below).
|
|
130
|
+
|
|
131
|
+
**Changing one value on a running backend**
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
printf %s "$STRIPE_KEY" | xanosdk env set STRIPE_KEY --to workspace --yes # value on stdin
|
|
135
|
+
xanosdk env set FEATURE_FLAG on --to local-engine # or as the second argument
|
|
136
|
+
xanosdk env unset STRIPE_KEY --to tenant:prod-eu # remove it
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`env set` creates the variable or replaces its value, and `env unset` removes it. Every other
|
|
140
|
+
variable on the backend stays as it is, and nothing is deployed. Use these to rotate a secret:
|
|
141
|
+
a deploy can't do that job. A merge deploy only adds names that aren't there yet, and
|
|
142
|
+
`--replace` rewrites the whole workspace.
|
|
143
|
+
|
|
144
|
+
The destination is `--to workspace`, `--to ephemeral[:<name>]`, `--to tenant:<name>`, or
|
|
145
|
+
`--to local-engine[:<name>]` for a local engine. With none of these, the command writes to
|
|
146
|
+
the ephemeral or local engine this project last deployed to. It never falls back to your
|
|
147
|
+
workspace or a tenant, and a local engine needs no Xano account. A write to
|
|
148
|
+
the workspace or a tenant asks for confirmation first, and `--yes` skips it; that flag is
|
|
149
|
+
required when there is no terminal, including when the value is piped in. Ephemerals and the
|
|
150
|
+
local engine are throwaway, so the command doesn't ask.
|
|
151
|
+
|
|
152
|
+
The value is never printed. Pipe it on stdin to keep it out of shell history. One trailing
|
|
153
|
+
newline is dropped, so `echo` works too. An empty value is refused unless
|
|
154
|
+
`--allow-empty-env=NAME` names that variable, because an empty value usually means a shell
|
|
155
|
+
variable wasn't set. To remove a variable, use `env unset`. `unset` on a name the backend
|
|
156
|
+
doesn't have reports that nothing was there and exits zero.
|
|
157
|
+
|
|
158
|
+
Neither command touches `xano/.env`. The next deploy still sends what that file holds, so
|
|
159
|
+
update it too if the change should outlive the next deploy.
|
|
160
|
+
|
|
161
|
+
**Overriding it**, on any command that compiles a bundle:
|
|
162
|
+
|
|
163
|
+
| Flag | What it does |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `--env-var KEY=VALUE` | One value, for this process only. Never written to `xano/.env`, never printed back. Repeatable. Highest precedence: it beats whichever file supplied values, the default `xano/.env` or an explicit `--backend-env-file`. On `export` the value is still compiled into the bundle that command writes. A secret on the command line also lands in shell history and the process table, so prefer `--backend-env-file` in CI. |
|
|
166
|
+
| `--backend-env-file <path>` | Read values from this dotenv-style file **instead of** `xano/.env`. It replaces the default rather than layering over it, so pointing at a CI secret mount cannot also ship a developer's local file. The flip side: a name that only `xano/.env` had is now unsupplied. |
|
|
167
|
+
| `--allow-empty-env=NAME[,NAME]` | Send these declared names empty on purpose, **clearing whatever the target holds for them**. Per-name only; there is deliberately no bare form. |
|
|
168
|
+
| `--allow-empty-doc-token=NAME[,NAME]` | The same, for a documentation token — but it **opens** something: the target's doc-site gate is cleared and those docs become publicly readable. Per-name only, no bare form. |
|
|
169
|
+
|
|
170
|
+
**A deploy replaces the workspace's env set.** So a declared name left empty in the config
|
|
171
|
+
that no file and no flag supplies would clear the live value, and `deploy` refuses instead,
|
|
172
|
+
naming the variables. That refusal fires on the ordinary path (a fresh clone has no
|
|
173
|
+
`xano/.env`), and it is a refusal rather than a warning because the cleared value is not
|
|
174
|
+
recoverable from anything the project holds. A name the config itself spells a real value for
|
|
175
|
+
is supplied by the config and is never refused. `export` and `preflight` report instead of
|
|
176
|
+
refusing: one writes a file, the other imports into a throwaway tenant. A `--keep-data` deploy
|
|
177
|
+
merges, and a merge only adds names the target does not hold, so an empty value clears nothing
|
|
178
|
+
and is not refused — unless `--keep-data` cannot keep that environment's data and the deploy
|
|
179
|
+
replaces it after all. A `deploy --to` without `--replace` merges the same add-only way, and it
|
|
180
|
+
still refuses: a name the target does not hold would be created there with no value, on a
|
|
181
|
+
backend someone keeps. A `--dry-run` sends nothing, so it reports the refusal the real deploy
|
|
182
|
+
would make as a warning and prints its plan. `xanosdk env pull` warns about each declared name
|
|
183
|
+
the backend holds no value for, since the file it writes has none for it either.
|
|
184
|
+
|
|
185
|
+
**The refusal only covers declared names.** A variable that exists in the backend but is not
|
|
186
|
+
in `workspaceConfig({ env })`, and is not among the values being sent, is dropped by the same
|
|
187
|
+
replacement with no refusal and no warning, because nothing declares it to check. Two ordinary
|
|
188
|
+
routes reach that state: someone adds a variable in the backend after your last pull, and
|
|
189
|
+
swapping `xano/.env` for an `--backend-env-file` that holds only the declared names. So declare every
|
|
190
|
+
name the stack reads, and carry the rest across when you swap files.
|
|
191
|
+
|
|
192
|
+
The refusal is part of the **compile**, so `xanosdk deploy --bundle <path>` does not get it. A
|
|
193
|
+
pre-built bundle carries whatever env it was built with and sends exactly that, so a
|
|
194
|
+
build-once-deploy-the-artifact pipeline resolves its values at build time: pass
|
|
195
|
+
`--backend-env-file`/`--env-var` to the `export` that produces the bundle. Two consequences worth
|
|
196
|
+
knowing before you build that pipeline:
|
|
197
|
+
|
|
198
|
+
- **The bundle is a secret-bearing file.** A compiled bundle carries the resolved values in
|
|
199
|
+
cleartext. Keep it out of git and out of shared build artifacts, and delete it after the
|
|
200
|
+
deploy. The scaffold gitignores `workspace.json`, but not an arbitrary `--out` path.
|
|
201
|
+
- **Nothing re-checks the env at that deploy.** `--env-var`, `--backend-env-file`, and
|
|
202
|
+
`--allow-empty-env` are accepted on a `--bundle` deploy and do nothing, because there is no
|
|
203
|
+
compile to resolve them into. Rebuild the bundle instead, and rebuild it whenever a declared
|
|
204
|
+
name is added: the `export` that skipped a value only warns, and the deploy that ships it
|
|
205
|
+
does not check again.
|
|
206
|
+
|
|
207
|
+
**Documentation tokens go in a different file.** `xano/.env` is backend-only. The token gating
|
|
208
|
+
a hosted doc site lives in `xano/.secrets.json`, also gitignored, also preserved across a pull.
|
|
209
|
+
|
|
210
|
+
The split is not arbitrary, and the rule tells you where a future secret lands. A backend
|
|
211
|
+
variable is addressed by **name** — `env("NAME")` is how a stack reads it, so the name *is* its
|
|
212
|
+
identity, and a dotenv file is the right shape. A documentation token is addressed by the
|
|
213
|
+
**object** that holds it: this workspace, that API group. It has no name of its own, so it is
|
|
214
|
+
stored under that object's identity instead, and `env(...)` cannot read it from anywhere.
|
|
215
|
+
|
|
216
|
+
That file is SDK-owned. `xanosdk pull` writes it and every build reads it back, so a pull
|
|
217
|
+
followed by a deploy restores the gate with no manual step — which is the whole reason it
|
|
218
|
+
exists. Nobody edits it by hand; `--no-secrets` on a pull finds the tokens and writes none, for
|
|
219
|
+
a machine where a secret on disk is not wanted.
|
|
220
|
+
|
|
221
|
+
A pull only answers for an object that already HAS a token. A gate you declare in source — a new
|
|
222
|
+
API group, or a doc site you decided to close — has none to fetch, and that is what
|
|
223
|
+
`xanosdk secrets fill` is for:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
xanosdk secrets fill # every declared gate with no value gets one
|
|
227
|
+
xanosdk secrets fill ./xano/index.ts # name the entry when you are not in the project root
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
It mints a cryptographically random token per gate, the same shape a platform-minted one has,
|
|
231
|
+
and only ever **adds**: a value already in the file is never replaced, because replacing one
|
|
232
|
+
invalidates every doc-site link already handed out and may be the value the live gate is using
|
|
233
|
+
right now. An entry no scope in your source claims is left alone for the same reason. When
|
|
234
|
+
every gate is already filled it writes nothing at all, so a re-run is a no-op rather than a
|
|
235
|
+
file change. A minted token gates nothing until a deploy sends it — the file having a value and
|
|
236
|
+
the doc site wanting that value are two different moments. Because it is gitignored, a teammate's clone
|
|
237
|
+
and CI both have none: those pass `--secrets-file <path>` (which *replaces* the default, the
|
|
238
|
+
way `--backend-env-file` does) or `--doc-token "<scope>=<value>"` for one scope. A scope is `workspace`
|
|
239
|
+
or an API group's **name**; the flags take one per occurrence and repeat, and refuse a name two
|
|
240
|
+
groups answer to rather than guessing which you meant. Prefer the file: a token on the command
|
|
241
|
+
line is visible in shell history, the process list, and any CI log that echoes the command.
|
|
242
|
+
|
|
243
|
+
A pull refuses to write the file when git says the path is not ignored, and reports the drop
|
|
244
|
+
rather than failing — the tree it wrote is fine, it just carries no tokens. When git cannot be
|
|
245
|
+
asked at all (no repository, no git on `PATH`) it writes: there is nothing there that could
|
|
246
|
+
commit the secret.
|
|
247
|
+
|
|
248
|
+
The refusal works the same way as the backend one, with one difference worth knowing: an
|
|
249
|
+
unsupplied gate emits **no `documentation` block at all** rather than an empty token. On the
|
|
250
|
+
**workspace** that leaves the target's gate as it is instead of clearing it, which is what stops
|
|
251
|
+
a two-step `export` then `deploy --bundle` pipeline from clearing a gate no refusal could fire
|
|
252
|
+
on.
|
|
253
|
+
|
|
254
|
+
On an **API group** an absent key is not a non-action — the engine writes its default, which
|
|
255
|
+
clears that group's gate. There is no safe bundle to write, so a group that publishes docs and
|
|
256
|
+
declares a gate with no token supplied **fails the export** on every command, not just
|
|
257
|
+
`deploy`. Only `--allow-empty-doc-token=<scope>` turns an unsupplied gate into a deliberately
|
|
258
|
+
cleared one.
|
|
259
|
+
|
|
260
|
+
One thing to clear out by hand if you used an earlier build: a `XANO_DOCS_TOKEN…` line left in
|
|
261
|
+
`xano/.env` from when tokens lived there is now an ordinary **backend** variable, because that file
|
|
262
|
+
is backend-only again. It will be sent as part of the workspace's env, where `env("NAME")` reads it
|
|
263
|
+
from every request. Delete the line — the value belongs in `xano/.secrets.json`, and `xanosdk pull`
|
|
264
|
+
puts it there.
|
|
265
|
+
|
|
266
|
+
An entry the file holds that no scope in your source claims is **reported and never deleted** —
|
|
267
|
+
usually a renamed API group in a project with no lock. The SDK cannot tell a rename from a group
|
|
268
|
+
you commented out, and it cannot re-fetch a secret it throws away.
|
|
269
|
+
|
|
270
|
+
Do not confuse any of this with `deploy --static-env`, which bakes **public** config into the
|
|
271
|
+
HTML a browser downloads. One is a workspace secret; the other is visible to everyone.
|
|
272
|
+
|
|
273
|
+
`typedEnv()`, the `stack.env-undeclared` warning, and what a release does with env across
|
|
274
|
+
environments are in [Authoring reference](authoring.md).
|
|
275
|
+
|
|
276
|
+
## Identity & the xano.lock file
|
|
277
|
+
|
|
278
|
+
Every top-level object carries a stable `guid` — Xano's identity anchor. On a sync import
|
|
279
|
+
the engine matches an incoming object to an existing one **by guid** and updates it in
|
|
280
|
+
place; no match means a new object. So re-running `export`/`deploy` on the same code maps
|
|
281
|
+
cleanly onto the same workspace — **no duplicates**. By default the guid derives from the
|
|
282
|
+
object's `name` — for a **query**, from its api group, verb, and name together, which is
|
|
283
|
+
the engine's own uniqueness for an endpoint, so `GET items` and `POST items` are distinct
|
|
284
|
+
objects and a path may repeat across groups. Set an explicit `guid` to pin identity across
|
|
285
|
+
a rename, or to adopt an existing workspace object into code.
|
|
286
|
+
|
|
287
|
+
**`xano.lock`** freezes the whole workspace's identities at once — every auto-derived guid,
|
|
288
|
+
plus the `canonical` URL tokens of API groups and toolsets (which the engine otherwise
|
|
289
|
+
randomizes, giving the same code different public URLs per environment). Every command that
|
|
290
|
+
compiles an entry file writes it — `export`, `deploy`, `release`, `preflight`, with no flag —
|
|
291
|
+
and updates it on every build, atomically, before the bundle. **Commit it next to your code.**
|
|
292
|
+
`npm run xano:check` is the CI guard (`xanosdk export ./xano/index.ts --check --strict`, which implies
|
|
293
|
+
`--frozen-lock`, writes nothing, and needs neither `xano/.env` nor `xano/.secrets.json`): it fails rather than change the lock,
|
|
294
|
+
so an uncommitted identity change is caught in review instead of on a deploy. It also fails
|
|
295
|
+
while the lock carries an entry no exported object matches. That entry is how a rename looks
|
|
296
|
+
before its fix-up — the old name keeps the identity while the new name mints a fresh one, so
|
|
297
|
+
the next sync deletes the object and creates another in its place. A plain `export` only warns
|
|
298
|
+
and writes the entry down, and from then on nothing tells a rename from a deletion, so the
|
|
299
|
+
check asks you to say which: `lock rename` to finish the rename, `lock prune` to drop an entry
|
|
300
|
+
whose object really is gone. If you adopted a live workspace with `lock import` and are porting it
|
|
301
|
+
a piece at a time, those unported entries pin objects that are still serving and must not be
|
|
302
|
+
pruned — pass `--allow-lock-orphans` to accept them and keep the rest of the check. An installed
|
|
303
|
+
toolchain module's own frozen check rides on the same run, so a stale artifact it owns fails
|
|
304
|
+
there too, instead of being rewritten.
|
|
305
|
+
|
|
306
|
+
`compile` and `paths`/`routes` only *read* a lock; they never write one, so listing your
|
|
307
|
+
routes never mints a URL token it would then discard.
|
|
308
|
+
|
|
309
|
+
**`--no-lock`** builds without one, for a throwaway run or a tree that cannot be written.
|
|
310
|
+
Identities then derive from names, the instance invents public URLs your project will not
|
|
311
|
+
learn, and `deploy --to workspace --prune` is unavailable. It is *refused* over a lock that already
|
|
312
|
+
parses — building name-derived guids against a lock that pins different ones is a
|
|
313
|
+
delete-and-recreate of every object, reported as success. If the lock itself is corrupt,
|
|
314
|
+
`--no-lock` is the way past it.
|
|
315
|
+
|
|
316
|
+
**Releasing to a workspace that already exists?** Adopt what it already serves *first*:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
xanosdk lock import <its-packageExport.json> --lock=xano/xano.lock
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Without that step your first locked build mints its own URL token for every API group that
|
|
323
|
+
names no `canonical` in code. The workspace keeps the slug it already serves — an unpinned
|
|
324
|
+
value is a preference, and an update keeps the stored one — so the lock would record a URL
|
|
325
|
+
that is not the one being served, and would keep recording it. Adopting first makes the lock
|
|
326
|
+
true. A brand-new workspace has nothing to adopt and needs no such step.
|
|
327
|
+
|
|
328
|
+
**One directory, one lock.** The lock lands beside the *entry file*, so two entry files in
|
|
329
|
+
the same directory share it — each build then reports the other's objects as orphans, and a
|
|
330
|
+
`lock prune` would delete them. Give each entry its own directory, or name its lock
|
|
331
|
+
explicitly with `--lock=<path>`.
|
|
332
|
+
|
|
333
|
+
Precedence at emit is always **explicit in-code value → lock entry → name derivation**.
|
|
334
|
+
|
|
335
|
+
**When the lock is actually load-bearing.** Because the default derivation is deterministic
|
|
336
|
+
— `md5("<type>:<name>")`, and `md5("query:<group>|<verb>|<name>")` for a query — a project
|
|
337
|
+
that created all of its own objects can regenerate a
|
|
338
|
+
byte-identical lock from its own source. Delete that lock, release again, and the same guids
|
|
339
|
+
come back: the objects match and update in place. For that project the lock is a *cache*, and
|
|
340
|
+
losing it costs nothing.
|
|
341
|
+
|
|
342
|
+
The lock is load-bearing exactly where a live guid **diverges** from that derivation, which
|
|
343
|
+
happens two ways:
|
|
344
|
+
|
|
345
|
+
- **Adopted** objects — anything built in the Xano UI first and taken over with `lock import`.
|
|
346
|
+
The engine assigned those guids randomly; nothing in your code can re-derive them.
|
|
347
|
+
- **Renamed** objects — `lock rename` pins the original guid under the new name, so the
|
|
348
|
+
derivation no longer reproduces it.
|
|
349
|
+
|
|
350
|
+
For those entries the lock is irreplaceable, and losing it means the next release matches
|
|
351
|
+
nothing and creates a duplicate of every diverged object. A workspace adopted wholesale from
|
|
352
|
+
the UI can be almost entirely divergent, so treat *that* lock as the critical artifact.
|
|
353
|
+
Either way, commit it — the cache is worth having, and you generally will not know which
|
|
354
|
+
entries have diverged without looking.
|
|
355
|
+
|
|
356
|
+
**Renames** — with a lock, a rename in code no longer means delete+create on sync. The
|
|
357
|
+
export warns about the orphaned entry and names the fix-up:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# code: defineFunction({ name: "signup" }) → { name: "register" }
|
|
361
|
+
xanosdk export ./xano/index.ts # stderr: lock entry "function:signup" matches no exported object…
|
|
362
|
+
xanosdk lock rename --entry=xano/index.ts function signup register
|
|
363
|
+
xanosdk export ./xano/index.ts # emits signup's original guid under "register" → engine renames in place
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**Merge conflicts** — two branches that both touched the lock can conflict in git, and a
|
|
367
|
+
lock still holding `<<<<<<<` markers is refused by every command, saying so. Resolve it as
|
|
368
|
+
the union of both sides: keep every entry under `objects` (and `landed`) from each, then
|
|
369
|
+
delete the markers. If both branches renamed the same object — one to `stock`, the other to
|
|
370
|
+
`goods` — the union holds one guid under two keys, which every command refuses, naming both.
|
|
371
|
+
Keep the name your code exports and drop the other; both commands read such a lock:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
xanosdk lock rename --entry=xano/index.ts table stock goods # moves stock's identity onto goods
|
|
375
|
+
xanosdk lock prune --identity-only --yes table:stock --lock=xano/xano.lock # or just drop it
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
`rename`/`adopt` take no entry file, so on their own they look for `xano.lock` in the
|
|
379
|
+
**current directory**. Pass `--entry=<path>` to derive it beside the entry the way
|
|
380
|
+
`export`/`deploy`/`prune` do, or `--lock=<path>` to name the file outright. They never
|
|
381
|
+
reach for a lock you did not point them at — when they spot one next door they say so and
|
|
382
|
+
stop, rather than writing a file you did not name.
|
|
383
|
+
|
|
384
|
+
**After `--replace`** — a replace rebuilds the workspace with fresh engine identities, so the
|
|
385
|
+
lock is stale the moment it finishes and the next ordinary merge would match nothing and
|
|
386
|
+
try to create everything. `xanosdk deploy ./xano/index.ts --to workspace --replace` now re-pins the lock from the rebuilt
|
|
387
|
+
workspace itself and tells you to commit it. If there is no lock to re-pin, it says so —
|
|
388
|
+
without one, the next merge duplicates every object.
|
|
389
|
+
|
|
390
|
+
**Importing a live workspace's identities** — `xanosdk lock import <bundle.json>` seeds the lock from a
|
|
391
|
+
real engine `packageExport`, capturing the live workspace's random guids by `(type, name)`
|
|
392
|
+
so code takes over an existing workspace and the first sync updates in place instead of
|
|
393
|
+
duplicating.
|
|
394
|
+
|
|
395
|
+
**CI** — `xanosdk export ./xano/index.ts --check --strict` (the scaffolded `npm run xano:check`) runs every
|
|
396
|
+
check an export runs and writes nothing, so it needs no secrets. It implies `--frozen-lock`, which
|
|
397
|
+
fails instead of changing the lock, so a canonical
|
|
398
|
+
minted in a throwaway container can never silently diverge public URLs. Mint locally, commit
|
|
399
|
+
the lock. It fails on an entry no exported object matches too, which is the state a rename
|
|
400
|
+
leaves behind until `lock rename` moves the identity across (or `lock prune` drops it).
|