@xano/sdk 1.0.14 → 1.0.16
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 +27 -0
- package/README.md +33 -37
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-3J6YRVFL.js → agent-file-refresh-DBHTEFYM.js} +12 -12
- package/dist/{agent-skill-command-VWDMQWCT.js → agent-skill-command-LHNTU7MH.js} +74 -73
- package/dist/{answer-shape-AVZSKBR6.js → answer-shape-ZRQS7ZC4.js} +5 -5
- package/dist/{backend-dir-ISP7RVF2.js → backend-dir-AXR43HNV.js} +11 -11
- package/dist/{backend-slot-DZAUHLTS.js → backend-slot-7BATLL3X.js} +4 -4
- package/dist/bin.js +64 -63
- package/dist/{branch-IJTBZZFO.js → branch-SJKKUCMZ.js} +9 -9
- package/dist/branch-commands-KGR52SZU.js +80 -0
- package/dist/bundle.d.ts +2 -2
- package/dist/bundle.js +15 -69
- package/dist/{capture-GW5KNKMB.js → capture-RYBJE25P.js} +5 -5
- package/dist/{chunk-Z3DQ7ULY.js → chunk-23GEFHRX.js} +236 -17
- package/dist/{chunk-3H7R4ISR.js → chunk-2DUYJR5N.js} +2 -2
- package/dist/{chunk-MFWF2NZJ.js → chunk-2H5BQRHF.js} +2 -2
- package/dist/{chunk-O44MJTLR.js → chunk-35SI4GBM.js} +3 -3
- package/dist/{chunk-QKHNJ7LE.js → chunk-3ZV23FVR.js} +5 -5
- package/dist/{chunk-HKI5Y5KW.js → chunk-47XIVDJ6.js} +14 -14
- package/dist/{chunk-ICK36EGF.js → chunk-4EVDCSEY.js} +2 -2
- package/dist/{chunk-FBSGFPZ4.js → chunk-4XGZ325S.js} +3 -3
- package/dist/{chunk-EYVIUX2T.js → chunk-4XYXUK5H.js} +76 -33
- package/dist/{chunk-MAXDJZQR.js → chunk-4ZBXS7YN.js} +8 -8
- package/dist/{chunk-ZMJRAMLA.js → chunk-52QAENY6.js} +14 -14
- package/dist/{chunk-2LF734YB.js → chunk-54CJ74BH.js} +4 -4
- package/dist/{chunk-3SZ7QRYA.js → chunk-57PGTPT3.js} +8 -8
- package/dist/{chunk-IKXXTRMN.js → chunk-64UVVLDT.js} +4 -4
- package/dist/{chunk-EQXHUWUO.js → chunk-6FCAFWD5.js} +2 -2
- package/dist/{chunk-4MX5LMPQ.js → chunk-6ODQ5GDZ.js} +2 -2
- package/dist/{chunk-HK554MDD.js → chunk-74YCPI4G.js} +7 -7
- package/dist/{chunk-Y5XAPLZS.js → chunk-7UQZ7C4W.js} +4 -4
- package/dist/{chunk-CJDPSCMX.js → chunk-7ZVQIKNL.js} +3 -3
- package/dist/{chunk-RVAEPPRH.js → chunk-AICWDCLJ.js} +2 -2
- package/dist/{chunk-WS4BA75E.js → chunk-AJBOGO5U.js} +4 -4
- package/dist/{chunk-2FDHIBEU.js → chunk-AJQFUJEQ.js} +8 -8
- package/dist/{chunk-2KOB4QPW.js → chunk-C7AYP4H6.js} +29 -20
- package/dist/{chunk-XCFQLP6G.js → chunk-DJMGDCVX.js} +8 -8
- package/dist/{chunk-VBSCWV5H.js → chunk-DLD4FVRP.js} +54 -54
- package/dist/{chunk-Q7DGTQ5G.js → chunk-E34VGSCI.js} +2 -1
- package/dist/{chunk-YR3MNGWZ.js → chunk-E5M5P23K.js} +8 -8
- package/dist/{chunk-HJZUI2ZU.js → chunk-EAZTRU75.js} +2 -2
- package/dist/{chunk-QX5XQEYB.js → chunk-EINZSVEU.js} +5 -5
- package/dist/{chunk-KMKUH2IO.js → chunk-EPB6FAR5.js} +5 -5
- package/dist/chunk-EUAU4QKI.js +67 -0
- package/dist/{chunk-IDOVZLPK.js → chunk-EXJ4Q5F6.js} +2 -2
- package/dist/{chunk-IHL2O7VY.js → chunk-F3JK5RIY.js} +3 -2
- package/dist/{chunk-W2QFR3ZJ.js → chunk-FIOC7RSU.js} +2 -2
- package/dist/{chunk-YEH5OIPF.js → chunk-FMXPV5JI.js} +39 -11
- package/dist/{chunk-GVHWIDEJ.js → chunk-FRJB3NTE.js} +10 -5
- package/dist/{chunk-VIRFG3WG.js → chunk-FTFAPKCW.js} +23 -7
- package/dist/{chunk-LL6ED5IB.js → chunk-FTS42N37.js} +2 -2
- package/dist/{chunk-MIS6F4HM.js → chunk-G2XSDIYS.js} +4 -4
- package/dist/{chunk-ZY55DO5P.js → chunk-G6BEJ3NA.js} +2 -2
- package/dist/{chunk-RYWNNJK5.js → chunk-GA6HTO3O.js} +2 -2
- package/dist/{chunk-JIKGT7DO.js → chunk-GE3JV5SI.js} +1 -1
- package/dist/{chunk-GCINMMFL.js → chunk-GJZMKMWO.js} +2 -2
- package/dist/{chunk-LW7TOIS7.js → chunk-GRZ62LLU.js} +8 -8
- package/dist/{chunk-6X73VFCX.js → chunk-GT7PZCTK.js} +2 -2
- package/dist/{chunk-HINRE3UM.js → chunk-HXPQXCOZ.js} +1821 -506
- package/dist/{chunk-ECQXASG3.js → chunk-IFHFJR5O.js} +2 -2
- package/dist/{chunk-P4OWRYE7.js → chunk-IOWNQEMW.js} +31 -31
- package/dist/{chunk-SUKO4SZG.js → chunk-ISIZFK5Q.js} +53 -47
- package/dist/{chunk-QJ25N4W6.js → chunk-IUJDUFT7.js} +4 -4
- package/dist/{chunk-L34DM6QB.js → chunk-JHAZK4RY.js} +3 -3
- package/dist/{chunk-YL3WVBR5.js → chunk-KGHJ74HF.js} +6 -6
- package/dist/{chunk-NUZXSIEA.js → chunk-L2O5KG5Q.js} +6 -6
- package/dist/{chunk-L4WG4BKJ.js → chunk-L3Q2QYIQ.js} +72 -72
- package/dist/{chunk-SAEIVQLP.js → chunk-LLBEPJBO.js} +3 -3
- package/dist/{chunk-NOW522B4.js → chunk-LWBGPPI5.js} +13 -13
- package/dist/{chunk-GOKRKTCX.js → chunk-MBSHONP3.js} +3 -3
- package/dist/{chunk-GKQTXUOW.js → chunk-MOVRSULZ.js} +2 -2
- package/dist/{chunk-QAEBBTYR.js → chunk-MSYMEP7Y.js} +7 -7
- package/dist/{chunk-Y453TW6J.js → chunk-NCERS5QH.js} +2 -2
- package/dist/{chunk-HXFLHA5K.js → chunk-NH5Z2NOD.js} +2 -2
- package/dist/{chunk-T3HNISBN.js → chunk-NJVY3GAX.js} +3 -3
- package/dist/{chunk-J62TYONQ.js → chunk-NQPPUNWP.js} +3 -3
- package/dist/{chunk-LJZIBT75.js → chunk-O7Z3LF44.js} +5 -5
- package/dist/{chunk-B7CPSWQX.js → chunk-OLXYZQR7.js} +7 -7
- package/dist/{chunk-7F3V6CFP.js → chunk-OQNYZ2OM.js} +3 -3
- package/dist/{chunk-DBDTQR23.js → chunk-OTQF4B37.js} +4 -4
- package/dist/{chunk-GBSHHNSD.js → chunk-PRSNMSVG.js} +3 -3
- package/dist/{chunk-DGYXCIBV.js → chunk-Q6AKSLD2.js} +2 -2
- package/dist/{chunk-YTQYP7UJ.js → chunk-Q7KXMIR3.js} +3 -3
- package/dist/{chunk-IWJ6GFST.js → chunk-QCVH32T2.js} +5 -5
- package/dist/{chunk-7FIMUFBP.js → chunk-QDPY7RN3.js} +3 -3
- package/dist/{chunk-DLDYQNGP.js → chunk-QIT2GGNB.js} +3 -3
- package/dist/{chunk-J3XLCYTQ.js → chunk-QSJH5AFU.js} +244 -173
- package/dist/{chunk-DERQSEB5.js → chunk-R7DS2TRZ.js} +38 -22
- package/dist/{chunk-BEKEOXNG.js → chunk-RGPHFHJU.js} +2 -2
- package/dist/{chunk-5FJ4M4HB.js → chunk-RHH6SCB4.js} +17 -32
- package/dist/{chunk-Z4BQPABS.js → chunk-RIT3WBBX.js} +4 -4
- package/dist/{chunk-45K2QZBR.js → chunk-RKNCISPM.js} +3 -3
- package/dist/{chunk-6LJS4M6P.js → chunk-RKTVXFBV.js} +5 -5
- package/dist/{chunk-AXNX4NWN.js → chunk-RLQX6LHW.js} +37 -37
- package/dist/{chunk-FIERONKM.js → chunk-ROWYW3JF.js} +2 -2
- package/dist/{chunk-LSJ3SQEU.js → chunk-RVWWNNZQ.js} +4 -4
- package/dist/{chunk-LPQZICYN.js → chunk-S7MVI4W7.js} +7 -7
- package/dist/{chunk-4MIV244X.js → chunk-SGEOXJIH.js} +9 -2
- package/dist/{chunk-QRMKQYCB.js → chunk-SINL5WMI.js} +2 -2
- package/dist/{chunk-Z6N5N4MN.js → chunk-SIW2HT2H.js} +21 -5
- package/dist/{chunk-IEDQT4Z3.js → chunk-SOAZIMWL.js} +12 -12
- package/dist/{chunk-RPBB7P4Q.js → chunk-SVQMDVND.js} +87 -16
- package/dist/{chunk-45ZUMF4E.js → chunk-TPUAXIPR.js} +2 -2
- package/dist/{chunk-HMYJOQXT.js → chunk-TXU34ELY.js} +25 -25
- package/dist/{chunk-MTBKTGZT.js → chunk-U4UAWGIT.js} +12 -8
- package/dist/{chunk-76SBT7KS.js → chunk-U56HK2RG.js} +7 -5
- package/dist/{chunk-RV2BDU7V.js → chunk-UDW2KAVF.js} +6 -6
- package/dist/{chunk-NDV6CBR7.js → chunk-UH5VQGNR.js} +2 -2
- package/dist/{chunk-75QC66XI.js → chunk-V2MIBJZU.js} +2 -2
- package/dist/{chunk-RDZBXTZ3.js → chunk-VAQPQXOI.js} +4 -4
- package/dist/{chunk-XPSDDTUZ.js → chunk-VCFRALU7.js} +3 -3
- package/dist/{chunk-5KJBWIDZ.js → chunk-VQDVEHDB.js} +2 -2
- package/dist/{chunk-6ILHYSLR.js → chunk-WAP5362D.js} +5 -5
- package/dist/{chunk-XY4OBD26.js → chunk-WGKKDGSA.js} +4 -4
- package/dist/{chunk-UQ2OD7D4.js → chunk-WVVUE7LU.js} +14 -7
- package/dist/{chunk-LB76VK6D.js → chunk-WXQ7BHVQ.js} +7 -7
- package/dist/{chunk-7REDHC4N.js → chunk-X5NF3ZXW.js} +69 -14
- package/dist/{chunk-5W7S2SCA.js → chunk-XAE4NIZ2.js} +4 -4
- package/dist/{chunk-SPLRKCFV.js → chunk-XDGLYIB2.js} +2 -2
- package/dist/{chunk-BSGU4HS6.js → chunk-XKMZYU5B.js} +96 -65
- package/dist/{chunk-OLQN4Z5R.js → chunk-Y3RH35KM.js} +47 -47
- package/dist/{chunk-YFQCDLCQ.js → chunk-YHT7TDSH.js} +14 -14
- package/dist/{chunk-KDEU5FUJ.js → chunk-YJXJOMXW.js} +3 -3
- package/dist/{chunk-N6LGLNAC.js → chunk-YPLHVRMS.js} +4 -4
- package/dist/{chunk-WS2X5BB2.js → chunk-YYBBJPCL.js} +5 -5
- package/dist/{chunk-ZOHEHIFS.js → chunk-YYDM4DNP.js} +2 -2
- package/dist/{chunk-MYIIBV6A.js → chunk-ZF4LCHCT.js} +5 -5
- package/dist/{chunk-GRXX2TOJ.js → chunk-ZHFSIQ6E.js} +2 -2
- package/dist/{chunk-CB67GIR3.js → chunk-ZJQFKBX7.js} +7 -7
- package/dist/{chunk-ZRXDPCMN.js → chunk-ZYZ7GRX3.js} +2 -2
- package/dist/{chunk-5TWLVFYB.js → chunk-ZZC5VSLP.js} +4 -4
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +62 -61
- package/dist/codegen-command-NAY6YAOD.js +183 -0
- package/dist/codegen.d.ts +3 -3
- package/dist/codegen.js +5 -5
- package/dist/{commands-5ILSWDSV.js → commands-Z2QZOORB.js} +3 -3
- package/dist/{completion-UNKBVVDT.js → completion-LFXXNQGR.js} +3 -3
- package/dist/{config-NTOASFCA.js → config-7GGINOFY.js} +4 -4
- package/dist/{deploy-command-WESYWFJN.js → deploy-command-PBM3S4ZL.js} +69 -68
- package/dist/{deploy-source-ZQQNMDFX.js → deploy-source-JW7DAN75.js} +32 -32
- package/dist/{dev-env-sync-4XJT7WOT.js → dev-env-sync-FHJTFH3V.js} +63 -62
- package/dist/{diagnostics-FNVNRYMB.js → diagnostics-T3RN3372.js} +2 -2
- package/dist/{display-name-hint-MYXCCAOP.js → display-name-hint-5GLJGPQ6.js} +11 -11
- package/dist/{emit-YLt3GfsZ.d.ts → emit-t-gDE1BL.d.ts} +181 -93
- package/dist/env-example-refresh-HHEGMFNH.js +136 -0
- package/dist/{env-pull-command-SK5FS477.js → env-pull-command-FFPNRVWD.js} +52 -52
- package/dist/{env-target-TEFSYACA.js → env-target-XHVRZXHX.js} +14 -14
- package/dist/{env-var-command-IJHKA2WJ.js → env-var-command-DJS62YRR.js} +41 -41
- package/dist/{ephemeral-VLPRDNEJ.js → ephemeral-2DXWP3VK.js} +9 -9
- package/dist/{ephemeral-command-WCO5J4SN.js → ephemeral-command-VLQIQ5TS.js} +52 -52
- package/dist/{ephemeral-state-RUOU2GFS.js → ephemeral-state-56XEDUJW.js} +12 -12
- package/dist/{generate-command-3WCOUOEQ.js → generate-command-PSDIIOTU.js} +89 -88
- package/dist/{gitignore-WYS3GMOX.js → gitignore-PMJ6MFNA.js} +15 -15
- package/dist/{guards-PPIBIMFZ.js → guards-YICHJKX3.js} +51 -15
- package/dist/{impersonate-command-UMYVQTCG.js → impersonate-command-IKV4KUYA.js} +37 -37
- package/dist/{import-T4ZTOTBT.js → import-VJQGIS33.js} +5 -5
- package/dist/index.d.ts +653 -222
- package/dist/index.js +29 -28
- package/dist/init-command-LEQIE6GC.js +143 -0
- package/dist/{init-modules-7KALFI5C.js → init-modules-G47Q7ABV.js} +8 -8
- package/dist/{init-web-DYE2FEXL.js → init-web-25QJ4JWB.js} +3 -3
- package/dist/internal.d.ts +55 -8
- package/dist/internal.js +692 -503
- package/dist/{io-PGTCBSIQ.js → io-47TFRYDB.js} +6 -6
- package/dist/{keep-data-merge-OVHCIEBG.js → keep-data-merge-XCPCX7BZ.js} +38 -38
- package/dist/{lambda-config-reconcile-VOBVZPWS.js → lambda-config-reconcile-CC5QIP6E.js} +3 -3
- package/dist/{landed-F7PCHGCK.js → landed-VIUFHLCJ.js} +5 -5
- package/dist/{landing-record-AIHNW4AZ.js → landing-record-JQ7HZDGI.js} +22 -22
- package/dist/{live-diff-UMSOGPX3.js → live-diff-KJ2TWWWT.js} +14 -14
- package/dist/{local-engine-choice-XDGTATKJ.js → local-engine-choice-DFAMYOIF.js} +35 -35
- package/dist/{local-engine-command-VQWNQ7UK.js → local-engine-command-5RP2J5QZ.js} +40 -40
- package/dist/{local-engine-deploy-4N4NFZ4T.js → local-engine-deploy-XAEDT55W.js} +12 -12
- package/dist/{local-engine-lookup-AQTUGSBT.js → local-engine-lookup-WBYTY2JE.js} +2 -2
- package/dist/{local-engine-mcp-bridge-AMYRH4SY.js → local-engine-mcp-bridge-3H5OXBWQ.js} +5 -5
- package/dist/{local-engine-mcp-command-AIMNMXQG.js → local-engine-mcp-command-JSYVVZKK.js} +42 -42
- package/dist/{local-engine-process-OD5OSWDG.js → local-engine-process-35B2KQED.js} +7 -7
- package/dist/{local-engine-update-check-G3YCBXRE.js → local-engine-update-check-VXJZSIJU.js} +5 -5
- package/dist/{lock-HDCHD2ON.js → lock-JBKTDEDO.js} +4 -4
- package/dist/{lock-commands-H3YV2D6M.js → lock-commands-7VO6YWOV.js} +67 -66
- package/dist/{login-command-NMM3JNDZ.js → login-command-WTZUBCW6.js} +27 -27
- package/dist/{logout-command-7DYC6G32.js → logout-command-5BJUNK3C.js} +17 -17
- package/dist/{loop-DJNIHC7O.js → loop-HILLODVH.js} +15 -15
- package/dist/{marketplace-command-UCSHDZGO.js → marketplace-command-NMOH4XOV.js} +30 -30
- package/dist/{marketplace-resolve-JR4BBJ6K.js → marketplace-resolve-63QWMQZU.js} +6 -6
- package/dist/{meta-client-CD3TXQP6.js → meta-client-MRAMWUKV.js} +15 -15
- package/dist/{module-manifest-63I5GRK4.js → module-manifest-NWJWAQLQ.js} +4 -4
- package/dist/node.d.ts +8 -8
- package/dist/node.js +71 -70
- package/dist/{operation-outcome-2ONIIDRU.js → operation-outcome-WK7UW6PJ.js} +24 -24
- package/dist/{output-target-67LHZKCO.js → output-target-5PYRCCK4.js} +16 -16
- package/dist/{plan-disclosure-T7DF4SRJ.js → plan-disclosure-6MG4YYJV.js} +28 -28
- package/dist/{plugin-contributions-YYEP7IWH.js → plugin-contributions-DD6R6RL6.js} +5 -5
- package/dist/{plugin-prompt-GKCQKNYI.js → plugin-prompt-UX2TT5NS.js} +5 -5
- package/dist/{plugin-questions-P7MA3TYI.js → plugin-questions-WE2F4ZC4.js} +4 -4
- package/dist/{preflight-command-TJ7FURXB.js → preflight-command-3BX2WW3S.js} +75 -74
- package/dist/{profile-command-LDPLTJEJ.js → profile-command-GSUX3UMB.js} +28 -28
- package/dist/{profile-pointer-JJ7K5O2R.js → profile-pointer-RCPHVTJV.js} +4 -4
- package/dist/{project-dependency-X3KCWBK5.js → project-dependency-TPVV3YIX.js} +7 -7
- package/dist/{project-sdk-YHJZRCNB.js → project-sdk-DKZBK5H5.js} +4 -4
- package/dist/promote-command-3LQTXWCD.js +149 -0
- package/dist/{prompt-QNMJIWNI.js → prompt-OYQHQWKI.js} +4 -4
- package/dist/{publish-command-IIRN6NWN.js → publish-command-3BQCV4NE.js} +72 -71
- package/dist/pull-command-B7OVWTZD.js +171 -0
- package/dist/{pull-superseded-6HADGGC5.js → pull-superseded-3SSM3JFT.js} +4 -4
- package/dist/{raw-where-gWGr-E4t.d.ts → raw-where-CinW0keO.d.ts} +32 -4
- package/dist/release-command-XSDICMJE.js +153 -0
- package/dist/{release-ns-command-YLCQPVH3.js → release-ns-command-EVAHK4CU.js} +96 -95
- package/dist/{retry-command-LFZYEVRU.js → retry-command-WP4ZI6CJ.js} +8 -8
- package/dist/{routes-manifest-R3TQRB24.js → routes-manifest-N73THJB3.js} +16 -16
- package/dist/routes-manifest-file-LDUDIVFJ.js +41 -0
- package/dist/scaffold.js +2 -2
- package/dist/{secrets-file-PCNAFXNV.js → secrets-file-7XWR7HW3.js} +15 -15
- package/dist/{secrets-fill-command-G7NQMRXU.js → secrets-fill-command-NKCGC75L.js} +66 -65
- package/dist/{seed-4CD55LB4.js → seed-YKTZDS2Q.js} +13 -13
- package/dist/{source-resolve-U4SJR7ZA.js → source-resolve-CQGDFQQC.js} +22 -22
- package/dist/{static-host-MO4VDHL7.js → static-host-3HPZKVKK.js} +5 -5
- package/dist/{status-command-CD72PXIT.js → status-command-TBMQ3GJP.js} +38 -38
- package/dist/{store-AJX4MC7Y.js → store-B63BQV6R.js} +6 -6
- package/dist/{store-BM7SQcUt.d.ts → store-in7gSpMS.d.ts} +297 -129
- package/dist/sync-baseline-GRS33AB5.js +38 -0
- package/dist/{sync-contributions-XK6LHISZ.js → sync-contributions-RKPLZPPO.js} +9 -9
- package/dist/{sync-record-NE62ERA3.js → sync-record-AWFCSS4D.js} +15 -15
- package/dist/{table-WPRAM4VW.js → table-ONGT3JGE.js} +12 -12
- package/dist/{tables-command-NMTKR52H.js → tables-command-UYQ277TJ.js} +41 -41
- package/dist/{tenant-IIYECNWO.js → tenant-IXIW3FOI.js} +10 -10
- package/dist/{tenant-command-XQAWT46C.js → tenant-command-7LWZUK2V.js} +104 -103
- package/dist/{test-command-W4AD4KT4.js → test-command-7KTT5EAF.js} +56 -45
- package/dist/{tests-JWQRHFCT.js → tests-N4MMBABH.js} +6 -6
- package/dist/{token-P3VQ6ITJ.js → token-3TCMW2AP.js} +13 -13
- package/dist/{toolchain-hooks-UAJBPSTC.js → toolchain-hooks-IJWV3ZQS.js} +18 -18
- package/dist/{toolchain-modules-S3MPHCUI.js → toolchain-modules-PBVBCPQJ.js} +5 -5
- package/dist/{toolchain-peers-FQJBTKEB.js → toolchain-peers-EMOYN4U7.js} +8 -8
- package/dist/{tracked-backend-WWEPNUD5.js → tracked-backend-YDUUQZQF.js} +34 -34
- package/dist/update-check-C6KDFGMT.js +141 -0
- package/dist/{upgrade-command-J6LRNHYF.js → upgrade-command-ZSBTSMBR.js} +68 -67
- package/dist/{whoami-command-KWRP2CII.js → whoami-command-L6ERHR5K.js} +16 -16
- package/dist/{workspace-3YNK4XO4.js → workspace-5DPSDM4A.js} +5 -5
- package/dist/{workspace-binding-TTDNXHO5.js → workspace-binding-MVOWGNYW.js} +15 -15
- package/dist/{workspace-command-W4ANGLCZ.js → workspace-command-PKQ5TDR7.js} +100 -99
- package/dist/{workspace-env-6LJGCTZA.js → workspace-env-UZJZUIYV.js} +18 -12
- package/dist/{workspace-export-PUEXKZNS.js → workspace-export-3KMWNZDD.js} +5 -5
- package/dist/{writable-LMMG4AFZ.js → writable-X7BCN7XE.js} +4 -4
- package/dist/xano-YB6Y2IJS.js +44 -0
- package/dist/{xanosdk-import-PNNMZ4SF.js → xanosdk-import-HHMQDK2I.js} +10 -10
- package/dist/{xanosdk-project-YW3BQY2E.js → xanosdk-project-CKEUNJU4.js} +13 -13
- package/dist/{xdo-D4OwfF2J.d.ts → xdo-DNGZGO1j.d.ts} +50 -12
- package/guides/authoring.md +1 -0
- package/guides/codes.md +33 -3
- package/guides/coverage.md +2 -2
- package/guides/object-kinds.md +1 -1
- package/guides/typed-frontend.md +9 -0
- package/llms/client.md +54 -36
- package/llms/errors.md +26 -6
- package/llms/fields.md +53 -30
- package/llms/filters.md +55 -46
- package/llms/kinds-agent-mcp.md +10 -9
- package/llms/kinds-core.md +19 -15
- package/llms/kinds-knowledge.md +4 -4
- package/llms/kinds-realtime.md +25 -23
- package/llms/lambda.md +42 -30
- package/llms/legacy.md +6 -7
- package/llms/lock.md +21 -17
- package/llms/object-kinds.md +9 -11
- package/llms/statements-calls.md +41 -20
- package/llms/statements-catalog.md +78 -71
- package/llms/statements-data.md +35 -25
- package/llms/statements-runtime.md +28 -18
- package/llms/tests.md +20 -7
- package/llms/toolchain.md +12 -9
- package/llms/triggers.md +14 -18
- package/llms/values.md +16 -9
- package/llms-full.txt +689 -549
- package/llms.txt +120 -137
- package/manifest.json +228 -246
- package/package.json +1 -1
- package/skills/xano-backend/SKILL.md +10 -12
- package/types/lambda-globals.d.ts +6 -1
- package/dist/branch-commands-75IYFTBS.js +0 -80
- package/dist/codegen-command-JWOW6HE5.js +0 -182
- package/dist/env-example-refresh-4V2OCDJE.js +0 -135
- package/dist/init-command-UR5MSXIH.js +0 -142
- package/dist/promote-command-RURHOLNR.js +0 -148
- package/dist/pull-command-ITO76ENU.js +0 -170
- package/dist/release-command-CVGIUD4M.js +0 -152
- package/dist/routes-manifest-file-GYNYFKAH.js +0 -41
- package/dist/sync-baseline-BJDKG4F2.js +0 -38
- package/dist/update-check-O7QC5TBB.js +0 -140
- package/dist/xano-Z3SRHYOR.js +0 -43
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
Runtime behavior (what the `as:` output holds, and misses):
|
|
6
6
|
|
|
7
|
-
- `db.get` binds **`null`** when no row matches (it does NOT throw)
|
|
8
|
-
- `db.edit` binds the **full, post-mutation row**. `db.add` binds the **full inserted row**, including the auto-assigned `id` and `created_at`.
|
|
9
|
-
- Unlike `db.get`, `db.edit` and `db.del` **throw** `NotFound` (HTTP 404) when no row matches the field. `db.add` throws on a unique-constraint violation: HTTP 500 `ERROR_FATAL` "Duplicate record detected…", earlier writes kept. No error type is 409.
|
|
7
|
+
- `db.get` binds **`null`** when no row matches (it does NOT throw); null-check it. On a hit it binds the **full row**. (`db.has` is the boolean existence test.)
|
|
8
|
+
- `db.edit` binds the **full, post-mutation row**. `db.add` binds the **full inserted row**, including the auto-assigned `id` and `created_at`. `db.del` **binds `null`**, not the deleted row.
|
|
9
|
+
- Unlike `db.get`, `db.edit` and `db.del` **throw** `NotFound` (HTTP 404) when no row matches the field. `db.add` throws on a unique-constraint violation: HTTP 500 `ERROR_FATAL` "Duplicate record detected…", earlier writes kept. No error type is 409.
|
|
10
|
+
- `s.try_catch` catches it — and `s.precondition`/`guard.*` failures, answering 200 (`caught("code")`: `ERROR_CODE_NOT_FOUND`, …) — so re-raise with an `s.precondition` in `catch` to keep a status.
|
|
11
|
+
- No partial unique index: NULLs never collide, so null the key (or delete the row) to free it. ⚠ A unique-index column that may be ABSENT must be `nullable: true` — a NON-nullable column stores an omitted/null cell as its zero value (`""`/`0`), which is NOT null and DOES collide, so only ONE row can omit it (the second 500s `Duplicate record detected`). An "optional composite key" needs the columns `nullable: true`.
|
|
10
12
|
- **`InferResponse<typeof query>`** derives an endpoint's response type. It resolves object-literal responses to those keys; a `response: ref("x")` returning a variable bound by a TOP-LEVEL db op on a `table()` resolves to that op's result:
|
|
11
13
|
| statement | resolves to | on a miss |
|
|
12
14
|
|---|---|---|
|
|
@@ -16,42 +18,50 @@ Runtime behavior (what the `as:` output holds, and misses):
|
|
|
16
18
|
| `db.has` | `boolean` | — |
|
|
17
19
|
| `db.bulk.delete` | `number` (count) | — |
|
|
18
20
|
| `db.increment` | `Row[]` (updated rows), or `number` with `returnType: "count"` | `[]` / `0` |
|
|
19
|
-
| `db.del`, `db.bulk.add`/`bulk.update`, raw `direct_query` | `unknown` (the
|
|
20
|
-
- A `get`/`query` `output: [...]` selection narrows to a `Pick` (still `| null` for `get`). A dotted `ref("row.col")` into a `db.get` row
|
|
21
|
+
| `db.del`, `db.bulk.add`/`bulk.update`, raw `direct_query` | `unknown` (untyped; `bulk.add` binds the new ids, `bulk.update` the rows) | — |
|
|
22
|
+
- A `get`/`query` `output: [...]` selection narrows to a `Pick` (still `| null` for `get`). A dotted `ref("row.col")` into a `db.get` row types `Col` (a miss 500s); `ref(path, { safe: true })` types `Col | null`.
|
|
21
23
|
- A value reshaped by a lambda, or a variable built by control flow, also resolves to `unknown`.
|
|
22
24
|
- A CALL binds the TARGET's response type: `s.function.call`/`s.function.run`/`s.api.call`/`s.tool.call` given a def HANDLE brand their `as` with `InferResponse` of the target, so `ref("out.field")` types to that field. What the target resolves to is what propagates — declare `responseShape` on the TARGET to fix every caller at once. A target named by STRING has no def to read and stays `unknown`; an async `s.function.run` binds its job id (`string`), not the result.
|
|
23
25
|
- In an object-literal response the KEYS are always known; a `c.*` constant VALUE types like an `s.set_var` of it (`{ success: c.bool(true) }` → `{ success: boolean }`).
|
|
24
|
-
- A NESTED member resolves to any depth
|
|
26
|
+
- A NESTED member resolves to any depth, in either spelling — `{ user: obj({ id: ref("row.id") }) }` and the raw literal `{ user: { id: ref("row.id") } }` both derive `{ user: { id: Col } }`. A raw scalar NESTED member types itself (`{ stats: { count: 3 } }` → `{ stats: { count: number } }`), but a TOP-LEVEL member must be a `Value` — a bare scalar there (`{ count: 3 }`) is a type error and `query()` throws at load, so write `{ count: c.int(3) }`.
|
|
25
27
|
- Runs on every response-bearing kind — `query`, `defineFunction`, `realtimeMessage`, `tool`, `middleware`, and the response-bearing triggers — each of which also accepts `responseShape`. A trigger builds its stack and response through CALLBACKS (`stack: (t) => [...]`), and the trace follows through them.
|
|
26
|
-
-
|
|
27
|
-
- The shapes that never derive, and the one line that closes each: rows built in `s.lambda` (JS is opaque to the walk) → `responseShape: [] as Row[]`; a var bound ONLY inside branches → `responseShape` (a branch/case/loop/`try`/`catch` re-binding unions in; one in EVERY branch replaces); a call whose target is named by STRING → give the TARGET a `responseShape` (a handle then carries it) or declare it here. Use `responseShape` as the FIRST move here.
|
|
28
|
+
- The FIRST move for any `unknown`: declare `responseShape` on the def (`responseShape: null as InferRow<typeof t> | null`) — available on EVERY kind listed above, `query` included; the declaration ALWAYS overrides derivation. The shapes that never derive, and the one line that closes each: rows built in `s.lambda` (JS is opaque to the walk) → `responseShape: [] as Row[]`; a var bound ONLY inside branches → `responseShape` (a branch/case/loop/`try`/`catch` re-binding unions in; one in EVERY branch replaces); a call whose target is named by STRING → give the TARGET a `responseShape` (a handle then carries it) or declare it here.
|
|
28
29
|
- An `s.set_var` holding a `c.*` CONSTANT brands its binding with that constant's JS type, so `ref("n")` after `s.set_var("n", c.int(1))` resolves to `number` (widened: `c.bool(false)` → `boolean`; `s.update_var` re-binds). A filter chain — the value's own or `asFilters` — then retypes it (`[fl.to_int()]` → `number`). A bare `ref`/`inp` stays `unknown`.
|
|
29
|
-
- ⚠ A
|
|
30
|
+
- ⚠ A var bound ONLY inside a branch body — an `s.conditional` `then`/`else`/`elif`, an `s.switch` case, a loop body (`s.for`/`s.foreach`) that ran zero times, or an `s.try_catch` `try` — does NOT exist when that path is skipped, so a later `ref` to it 500s `Missing var entry: <name>` (NOT null). `{ safe: true }` does NOT suppress it (it has no effect on a bare, dot-free name), and export warns `stack.var-conditionally-bound`. Declare the var on the ENCLOSING path first: `s.set_var("x", c.null())` before the block.
|
|
31
|
+
- ⚠ A hand-written `s.precondition` does not narrow the STATIC type. One (or a conditional) proving a `db.get` row non-null leaves `InferResponse` at `Row | null`. `guard.found("row")` DOES narrow: it emits the same non-null check (404) and drops `| null` from `row` — whole, dotted, and addon grafts alike — after it. `guard.owner` narrows the same way. Reach for `responseShape` only when neither fits.
|
|
32
|
+
- ⚠ `InferResponse` reads the `response` field ALONE — an `s.return(value)` ANYWHERE in the stack (an early cache hit, an idempotent replay, a `respond.status(409)` + `s.return` fast path) is INVISIBLE to it, including ones nested in `s.conditional`/`switch`/`foreach`/`try`. So the type covers only the fall-through `response`, and a typed client misses every early body. Declare `responseShape` as the UNION of every body the endpoint can serve: `responseShape: null as { value: number } | { cached: boolean }` (without one, export warns `response.return-outside-type`).
|
|
30
33
|
- ⚠ A `resultStrategy: "replace"` middleware attached `post` reshapes the endpoint's output at runtime, which the static walk cannot see. Declare `responseShape` when a post middleware rewrites the response. A `merge` one makes a LIST response an index-keyed object; its keys are not inferred.
|
|
31
|
-
- ⚠ **Spreading a `Statement[]` helper into a stack kills the whole walk.**
|
|
34
|
+
- ⚠ **Spreading a `Statement[]` helper into a stack kills the whole walk.** `...myHelper()` where the helper returns `Statement[]` widens the stack's TUPLE type, and EVERY `as` in that stack — including ones declared after the spread — stops resolving. The response then types as `StackTupleWidened`. Fix: return `statements(s.a(...), s.b(...))` from the helper (preserves the tuple). A helper that builds its array in a LOOP cannot be a tuple; declare `responseShape` there.
|
|
32
35
|
- **Addons** enrich returned rows. `db.query`/`get`/`add`/`edit`/`patch` accept `addon: [{ addon, as, input?, output?, children? }]`; `db.add_or_edit`/`del`/`has`/`truncate` take no `addon`.
|
|
33
36
|
- `addon` is the target (name or def handle). `as` is the destination on the row — a bare alias (`"_user"`) or a dotted `offset.alias`, authored relative to a row. Under a metadata paging envelope the `items[]` offset is prefixed automatically; writing it yourself is tolerated and not double-prefixed.
|
|
34
37
|
- `envelope: true` grafts once onto a paged query's envelope instead of each row.
|
|
35
|
-
- `input` maps addon inputs — bind a parent-row column with `out(col)`. `output` restricts addon columns. `children` nests addons.
|
|
38
|
+
- `input` maps addon inputs — bind a parent-row column with `out(col)`. `output` restricts addon columns. `children` nests addons onto each graft element (typed).
|
|
36
39
|
- The DEFINITION side — the `addon({...})` factory and `registerAddons` — is a def shape in `llms/kinds-core.md`.
|
|
37
|
-
- Attaching a typed `addon({ table, output })` handle merges its alias (the last `as` segment) onto the row in `InferResponse`: `{cols}
|
|
40
|
+
- Attaching a typed `addon({ table, output })` handle merges its alias (the last `as` segment) onto the row in `InferResponse`: an OPTIONAL `{cols}` for `single` (absent, not null, on no match), `{cols}[]` for `list`, `number` for `count`, `boolean` for `exists`, and for `aggregate` an array keyed by the `group`/`eval` aliases — ONE optional object when `eval` has no `group` (`unknown` values; `unknown` when neither is declared).
|
|
38
41
|
- An attachment-level `output` narrows an object/array graft further. A bare-NAME reference grafts `unknown` — narrow it at the call site.
|
|
39
42
|
- ⚠ An alias that shadows an existing column on the queried table throws at build time; rename with a `_` prefix.
|
|
40
43
|
- **Middleware attachment** runs a reusable `middleware({...})` before/after a host's own stack. Distinct from `s.middleware.call` (inline invoke).
|
|
41
44
|
- Attach with the host's `middleware: { pre, post }` field on `query`/`function`/`task`/`tool`/`apiGroup` (NOT triggers): each phase is an ordered list of middleware refs (def handle or name), or `{ middleware, active: false }` to keep an entry disabled.
|
|
42
45
|
- Providing a phase **overrides** it (sets the stored `pre_customize`/`post_customize` flag); omitting a phase **inherits** the parent tier's chain — the engine resolves Query → API Group → Workspace at request time (override, not merge; the API-Group tier applies to queries — functions/tasks/tools have no API-group binding and inherit straight from the workspace).
|
|
43
46
|
- Prefer a def handle over a bare name when the middleware pins an explicit `guid`.
|
|
47
|
+
- `exceptionPolicy` governs what a **throw** in the middleware stack does to the request. `"rethrow"` is the **default** — the throw aborts the request and surfaces the authored `error`/status (a tripped `s.redis.ratelimit` → HTTP 429); the `post` chain still runs. `"silent"` swallows the throw, so a guard set to it is **not enforced** — advisory middleware only. `"critical"` is `"rethrow"` plus skipping the `post` chain.
|
|
44
48
|
- `pre: middleware.clear()` (an empty list) overrides with nothing — stop inheriting.
|
|
45
49
|
- Workspace-level defaults are the terminal tier: `workspaceConfig({ middleware: { query: { pre }, function, task, tool } })` emits the flat `{host}_{phase}` map (no `_customize` flags) — setting it replaces the whole workspace map, so unlisted hosts are cleared; omit the field to leave existing workspace middleware untouched.
|
|
46
50
|
- **Middleware request context.** A `pre` middleware runs **after** auth resolution, so `auth()` is available inside the middleware when the host is authenticated (its `auth` names an auth table); on a public host there is no caller identity for it to resolve.
|
|
47
|
-
-
|
|
48
|
-
-
|
|
51
|
+
- A rate limit keyed by `auth("id")` is per-user on an authenticated endpoint; on a public endpoint `auth()` cannot resolve, so the request FAILS with a 403 on the first call, under `max`, with the host never running.
|
|
52
|
+
- `export()` **warns** (never blocks) when a middleware whose stack references `auth()` reaches a host where `auth()` may be null — a `query` with no auth table, a `task` (scheduled, never authenticated), or a `function`/`tool` (whose auth is caller-dependent). An authenticated query (its own `auth` table set) is skipped.
|
|
49
53
|
- Inherited attachment (API group, workspace tier) warns too.
|
|
50
54
|
- **Rate-limit recipe (the canonical middleware).** Author it with `s.redis.ratelimit` and a **composite key** built via the filter chain — `"prefix" + auth("id")` does not exist, you build the key: `middleware({ name: "write_rl", exceptionPolicy: "rethrow", stack: [ s.redis.ratelimit({ key: withFilters(c.text("rl:write:"), fl.concat(auth("id"))), max: c.int(10), ttl: c.int(30), error: c.text("Too fast.") }) ] })`.
|
|
51
|
-
- `exceptionPolicy
|
|
55
|
+
- The default `exceptionPolicy: "rethrow"` aborts a tripped limit with HTTP 429; `"silent"` lets the over-limit request through. Without `error` it never aborts — the request always runs on (`export()` warns) — but the bound value is NOT constant `false`: it binds `true` while the caller is under `max` and `false` once over (branch on it with that polarity).
|
|
52
56
|
- Attach it with `middleware: { pre: [writeRl] }` on an **authenticated** host; on a public host key off `sys.remoteIp()`.
|
|
53
57
|
- **Shared-bucket rule:** co-attaching one middleware object to N hosts means all N share the *same* key ⇒ *one* counter — `max: 10` is a global per-user budget across them, not 10-per-host. Vary the key (fold in the host/action name) for an independent limit per host.
|
|
54
|
-
- **
|
|
58
|
+
- **Redis (`s.redis.*`) semantics.** ⚠ `set` REFUSES a null or `""` `data` with HTTP 400 `Missing param: data`, so you cannot negative-cache an empty/absent result — store a sentinel (`c.text("__none__")`) instead. A stored `false` reads back from `get` as `false`, INDISTINGUISHABLE from a miss — use `has` to tell them apart. `ttl: 0` means FOREVER (no expiry); a NEGATIVE `ttl` is a 500 `Unable to store data in cache`. `incr`/`decr` on a missing key start at 0 and bind the new value (a negative `by` works). List ops: `push`/`unshift` bind the new LENGTH; `pop`/`shift` bind one element, or a list with `count` (last-first, `pop count 2` → `[5,4]`); on an empty or missing key they bind `false` (not null); `count` on a missing key is `0`, `range` is `[]` (and `range` with no start/stop is the whole list); `remove` with no `count` drops EVERY occurrence, with `count` it binds the number removed. `keys({ search })` is a GLOB binding the full key names. Objects and lists round-trip through `set`/`get` and the list ops.
|
|
59
|
+
- **File resources** — the value the `s.storage.*` and `s.zip.*` statements pass BETWEEN each other. A file resource is a short-lived (~24 h) TOKEN, not storage. PRODUCED by `inp("file")` (an `input.file`), `s.storage.create_file_resource`, `s.zip.create_archive`, and an extract entry's `.resource`. CONSUMED by `s.storage.read_file_resource`, the `s.storage.create_*` statements, and `s.zip.add_to_archive`/`view_contents`/`extract`. ⚠ A STORED file is NOT one: a `f.attachment()` cell / a `create_attachment` result / a cell's `url` passed to `read_file_resource` or `s.zip.*` 500s `Invalid file resource` — a stored file's bytes are not readable back through these. ⚠ `s.zip.extract` binds `[{ name, size, last_modified, resource }]`; pass the entry's `.resource` (`ref("extracted.0.resource")`) to `read_file_resource`, NOT the entry itself (500). ⚠ In a RESPONSE a file resource serializes as an opaque token STRING, not an object, and it EXPIRES — persisting one in a table/redis looks fine and breaks later. `read_file_resource` binds `{ name, size, mime, data }` where `data` is RAW bytes — `fl.base64_encode()` it in the stack before a JSON response (which mangles raw binary). `create_file_resource` refuses a `/` in `filename` (400 `Invalid characters detected.`), though a `zip.add_to_archive` ENTRY name accepts `dir/b.txt`.
|
|
60
|
+
- **Zip archives (`s.zip.*`)** — build then PERSIST. `s.zip.create_archive({ filename, password?, password_encryption?, as: "zip" })` binds an archive handle; `s.zip.add_to_archive`/`delete_from_archive` bind NOTHING and MUTATE the var passed as `zip` IN PLACE (loop over files, `create_file_resource` each, then `add_to_archive({ file: ref("res"), filename, zip: ref("zip") })`). ⚠ `view_contents`/`extract` on an archive with NO entries 500s (`Invalid or uninitialized Zip object` / `Fatal Error`) — guard a possibly-empty export with a count check. `view_contents` binds `[{ name, size, last_modified }]`, `extract` `[{ name, size, last_modified, resource }]` (the `.resource` is a file resource; see **File resources**). PERSIST the archive with `s.storage.create_attachment({ value: ref("zip") })` (a bare file resource in a response expires). `password` with no `password_encryption` writes standard ZipCrypto; `AES-256` writes method 99, which macOS `unzip` cannot read; the password is per-entry and checked on extract. `delete_from_archive` of a name not in the archive is a silent no-op. ⚠ `create_archive` needs a PAID (non-free) instance. (Uploaded archives must arrive as Content-Type `application/zip` — see `llms/errors.md`.)
|
|
61
|
+
- **`s.math.*` MUTATES a variable in place** — `s.math.add`/`sub`/`mul`/`div`/`mod`/`bitwise.*` take `{ name, value }` and REWRITE the existing var `name` (declare it with `s.set_var` first; an undeclared `name` 500s `Missing var entry`). There is NO `as` — the catalog's `[output]` on `add`/`bitwise.*` is an engine artifact, the result is the mutated var. Numeric TEXT coerces (`"5" + 3` → `8`) and a null var acts as `0`; a non-numeric operand (`true`, `"abc"`, a list) 500s `Numbers are required for mathematical operations`. `div` of int/int yields a DECIMAL unless it divides exactly (`7/2` → `3.5`, `6/3` → `2`); `div`/`mod` by `0` is a catchable `ERROR_FATAL` (`Division by zero`/`Modulo by zero`). Integer overflow past signed-64-bit SILENTLY becomes a float (`9223372036854775807 + 1` → `9.22e18`), losing exactness; `bitwise.*` truncate a decimal operand and use two's complement on negatives. Same rules on the `fl.*` equivalents.
|
|
62
|
+
- **`s.math.mod` / `fl.mod` is INTEGER modulo** — unlike its siblings `add`/`sub`/`mul`/`div`, which handle decimals exactly, `mod` TRUNCATES both operands toward zero before the remainder, so a decimal modulo returns WRONG data at HTTP 200: `c.decimal(5.5) mod c.decimal(2.5)` → `1` (the true remainder is `0.5`), and the sign follows the dividend (`-7 mod 3 = -1`). A divisor with `|x| < 1` truncates to 0 and 500s `Modulo by zero`. `c.expression("5.5 % 2.5")` and `withFilters(…, fl.mod(2.5))` do the same (engine-wide PHP `%`). For a REAL decimal remainder compute `a - b*floor(a/b)` with the decimal `div`/`mul`/`sub`, or a lambda.
|
|
63
|
+
- **Math failure modes** (`fl.*` aggregates and arithmetic, same engine as `s.math.*`). ⚠ On an EMPTY list the aggregates DISAGREE: `fl.sum` → `0`, `fl.product` → `1`, `fl.min`/`fl.max` → `null`, but `fl.avg` 500s `Infinite value` (an `avg` over a filtered list that comes back empty fails the whole request) — guard it with `fl.count()` or a conditional. `fl.ln(0)` raises a catchable `ERROR_FATAL` `Infinite value`. ⚠ A NaN or ±INF result does NOT raise: `fl.sqrt`/`fl.ln`/`fl.log`/`fl.log10` of a NEGATIVE, `fl.pow` of a negative base to a fractional power or past the float range, `fl.acos`/`fl.asin` outside [-1, 1], `fl.acosh` below 1, `fl.atanh` at or beyond ±1. A response carrying one serializes to nothing and answers HTTP 200 with an EMPTY body (a JSON client throws on parse, far from the cause), so guard the operand's domain with an `s.conditional` BEFORE the filter. `fl.number_format` on a text value 500s.
|
|
64
|
+
- **Date filter failure modes** — the request-time date filters fail QUIETLY on null/empty/unparseable input. A NULL or omitted timestamp reads as epoch 0, so `fl.epochms_date` formats it as `1970-01-01 …` and `fl.epochms_transform` shifts from 1970 — GUARD a nullable timestamp (`s.conditional` on `= null`) before formatting. `fl.epochms_from_format` returns `""` on a parse MISS (treat `""` as failure) and a numeric STRING (not an int) on a hit. `fl.to_epochms` binds `0` for `""` but 400s `Invalid timestamp format.` on non-empty garbage (the one that fails the request, not silently). `fl.epochms_transform` quirks: `llms/filters.md`.
|
|
55
65
|
|
|
56
66
|
- **Request history** controls per-object execution capture (the request/task/trigger debugger). Authored as a single scalar `history` field on any primitive: `false` off, `true` on at the default capture depth, a number = capture depth (how many statement executions are recorded per history record — NOT record retention), `"all"` unlimited.
|
|
57
67
|
- **Omit `history` to inherit** — the engine resolves object → container → workspace at request time (a query inherits from its API group, a tool from its toolset envelope, everything else straight from the workspace). Any authored value stops inheriting for that object.
|
|
@@ -62,8 +72,8 @@ Runtime behavior (what the `as:` output holds, and misses):
|
|
|
62
72
|
- **Workspace environment variables** set a tenant's env vars through the workspace object: `workspaceConfig({ env: { STRIPE_KEY: "", APP_BASE_URL: "" } })`, passed to `registerWorkspace()` — unattached, it declares nothing. Author them as a name→value MAP, declaring each NAME with an EMPTY value. Read a var back with `env("NAME")` (→ `$env.NAME`), which compiles to tag "setting" with the plain name.
|
|
63
73
|
- Values are SECRETS and do NOT belong here: they live in `xano/.env`, which is gitignored and survives a `npx @xano/sdk pull`, and every command that compiles a bundle reads it with no flag. Fill it by hand from `xano/.env.example`, or run `npx @xano/sdk env pull`. CI passes `--backend-env-file <path>` or `--env-var KEY=VALUE` instead. A compiled bundle carries the values in cleartext — don't commit one.
|
|
64
74
|
- What a deploy sends is the RESOLVED map (the declared names, then ONE file — `xano/.env`, or `--backend-env-file <path>` which REPLACES it, never both — then `--env-var`), not the literal object written here. `deploy` REPLACES the tenant's env with it, so a declared name with no value anywhere REFUSES the deploy rather than clearing the live value — fill the name in rather than putting the value back in source, and reach for `--allow-empty-env=NAME` only when clearing is what you mean.
|
|
75
|
+
- A merge (`deploy --to`) is ADD-ONLY for env, matched BY NAME — it creates names the target lacks but does NOT update or remove ones it has, so the target's value wins. A release carries no env values, so a NEW name reads null after `promote`/`tenant deploy` until `env set` (both name it first). A `--replace` deploy DROPS every env var the target holds that the config does not declare (named, and confirmed, before it runs). Omit `env` entirely to leave existing env untouched. The separate `settings` field is a plain object.
|
|
65
76
|
|
|
66
77
|
- **Workspace documentation** gates the workspace's hosted docs: `workspaceConfig({ documentation: { require_token: true } })`. `require_token: true` IS the declaration that a token exists; the value lives in `xano/.secrets.json`, keyed by the object it gates rather than by a name, and a literal `token` FAILS the export. It is NOT a backend env var — `env()` cannot read it. Other members are carried verbatim.
|
|
67
|
-
- ⚠ OMIT the block and NO `documentation` key is emitted, leaving the target's live block as it is; the
|
|
78
|
+
- ⚠ OMIT the block and NO `documentation` key is emitted, leaving the target's live block as it is; the `realtime` block follows the same rule. An `apiGroup`'s `documentation` follows the OPPOSITE rule — see its def shape.
|
|
68
79
|
- A declared gate with no token emits no block at all and REFUSES a `deploy`; `--allow-empty-doc-token=<scope>` clears that gate deliberately (scope = `workspace`, or an API group's NAME). `npx @xano/sdk pull` writes `xano/.secrets.json`, and `--no-secrets` writes none.
|
|
69
|
-
- A merge (`deploy --to`) is ADD-ONLY, matched BY NAME — it creates names the target lacks but does NOT update or remove ones it has, so the target's value wins. Two gaps: a release carries no env values, so a NEW name reads null after `promote`/`tenant deploy` until `env set` (both name it first) — and a `--replace` deploy rebuilds it so every env var the target holds that the config does not declare is DROPPED (named, and confirmed, before it runs). Omit `env` entirely to leave existing env untouched. The separate `settings` field is a plain object.
|
package/llms/tests.md
CHANGED
|
@@ -9,9 +9,10 @@ Named input sets run against one object, with assertions on its response — the
|
|
|
9
9
|
- `name` is unique within the object and is the key a statement's `mock` resolves against; a duplicate throws.
|
|
10
10
|
- `id` defaults to a derivation from the owning object plus the name. A pulled test carries the id Xano minted, emitted explicitly.
|
|
11
11
|
- `datasource` defaults to `""` — an EMPTY datasource. Any other value names one the engine CLONES before the run; `"live"` warns `test.live-datasource` on the owning def.
|
|
12
|
-
-
|
|
12
|
+
- That empty default means **no `table({ seed })` rows exist while a unit test runs**, as for a `workflowTest()`: every `db` read misses, so `resp("0.id")` fails though the deployed endpoint returns those rows. Create the rows INSIDE the run (a `defineFunction` fixture the stack calls first) or `mock` the read.
|
|
13
|
+
- **To read `table({ seed })` rows on an EPHEMERAL**, set `datasource: "live"`: there it holds only the seed fixtures (plus rows `--keep-data` kept); the run's writes are dropped. `diagnostics.allow` accepts its warning. ⚠ `datasource` is STORED, not a per-run flag: a test left on `"live"` clones the REAL database once it runs against an instance, so clear it before you promote.
|
|
13
14
|
- `input` is `{ <input name>: Value }` — tagged values (`c.*`, `ref`, …), never plain JS scalars.
|
|
14
|
-
- `token` runs the test as an authenticated caller. A pull does NOT bring it back: it is an expiring credential, reported as a deliberate omission.
|
|
15
|
+
- `token` runs the test as an authenticated caller. A pull does NOT bring it back: it is an expiring credential, reported as a deliberate omission. A token is signed per instance and expires: a literal one passes only on the backend that minted it, fails `Invalid token.` anywhere else, and commits a live credential to source. Keep `token` for a throwaway local check; for `query({ auth })` logic use the `defineFunction` route under **What a `workflowTest()` run actually sees**.
|
|
15
16
|
|
|
16
17
|
### Assertions: `expect.*`, not `s.expect.*`
|
|
17
18
|
|
|
@@ -19,7 +20,10 @@ Named input sets run against one object, with assertions on its response — the
|
|
|
19
20
|
- Subject first — argument order is the assertion: `expect.to_equal(resp(), c.int(2))`.
|
|
20
21
|
- `resp()` is the response under test; `resp("id")` drills, `resp("a-b")` takes the bracket escape.
|
|
21
22
|
- Subject only: `to_be_defined`, `to_not_be_defined`, `to_be_empty`, `to_be_null`, `to_not_be_null`, `to_be_true`, `to_be_false`, `to_be_in_the_future`, `to_be_in_the_past`.
|
|
23
|
+
- ⚠ `to_be_in_the_past`/`to_be_in_the_future` compare at WHOLE-SECOND resolution and treat the SAME second as neither — a timestamp taken during the request under test (`c.now()`, a `created_at` the endpoint just wrote) fails `to_be_in_the_past` nearly every run. Assert `expect.to_be_less_than(resp("ts"), c.now())` instead (or `to_be_defined` plus a range).
|
|
22
24
|
- Subject + operand: `to_equal`, `to_not_equal`, `to_be_greater_than`, `to_be_less_than`, `to_contain`, `to_start_with`, `to_end_with`, `to_match` (operand is a delimiter-wrapped pattern — build it with `c.regex`).
|
|
25
|
+
- `to_be_empty` passes ONLY for `""`, `[]` and `{}` — `0`, `null` and `false` FAIL it; use `to_be_null` for null and `to_equal(…, c.int(0))` for zero.
|
|
26
|
+
- `to_equal`/`to_not_equal` compare LOOSELY: `"5"` equals `5`, and `5` equals `5.0`. To pin a value's TYPE, assert on a filter (`withFilters(resp("x"), fl.is_text())`), not `to_equal`.
|
|
23
27
|
- `expect.to_be_within(subject, min, max)` — both bounds EXCLUSIVE; a subject equal to either fails.
|
|
24
28
|
- `expect.to_throw(exception?)` takes NO subject. With an argument the error message must CONTAIN that text (case-insensitive substring); with none, any error passes. `exception` is a `Value` — `expect.to_throw(c.text("Wrong password"))`, not a bare string (a bare one fails to compile with TS2345).
|
|
25
29
|
|
|
@@ -38,14 +42,23 @@ A statement returns a value instead of doing its work, for one named test.
|
|
|
38
42
|
|
|
39
43
|
### What a `workflowTest()` run actually sees
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
Isolation rules; each fails a correct test with a misleading message.
|
|
42
46
|
|
|
43
|
-
- The run uses an EMPTY datasource by default (`datasource: ""`), so **no `table({ seed })` rows exist while it runs** (same as a unit test
|
|
44
|
-
- `s.api.call`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
- The run uses an EMPTY datasource by default (`datasource: ""`), so **no `table({ seed })` rows exist while it runs** (same as a unit test): a read of seeded row 1 fails with its own precondition message, not an empty-database error. Build fixtures INSIDE the test, or set `datasource: "live"` under the ephemeral-only rule in the first section.
|
|
48
|
+
- `s.api.call` reports a failing endpoint by WHERE it fails, so no single assertion covers every failure. `s.function.run` raises on every failure instead.
|
|
49
|
+
|
|
50
|
+
| Failure | What `as` gets | Assert with |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| INPUT error (missing required input, wrong type) | nothing: the call RAISES and fails the test (`Missing param: msg`); later `s.expect.*` never run | `s.expect.to_throw({ body: [s.api.call({ api, input: {}, as: "r" })], exception: c.text("Missing param") })` |
|
|
53
|
+
| STACK error (`s.precondition`/`guard.*`) | the envelope `{ code, message, payload }`; the run carries on | `s.expect.to_contain({ expr: ref("r.code"), value: c.text("ERROR_CODE_ACCESS_DENIED") })` |
|
|
54
|
+
| `s.throw` | a codeless `{ payload, statement }`: `ref("r.code")` fails `Unable to locate var` | `ref("r.payload")` |
|
|
55
|
+
|
|
56
|
+
- `s.expect.to_throw` catches a call only when the error carries a MESSAGE. `ERROR_CODE_ACCESS_DENIED` arrives with an empty one, so `to_throw` around an auth-refused call reports `to_throw failed - response is ok`.
|
|
57
|
+
- `s.expect.to_throw({ body, exception? })` runs `body` in an ISOLATED var stack, so a variable bound EARLIER in the test is not visible inside it — bind what the body needs inside the body. An outer one raises `Missing var entry: <name>` there, which the test reports as `to_throw` not matching (`export()` warns). `exception` is a `Value` (`c.text("already exists")`), matched as in `expect.to_throw`; omit it to accept any error.
|
|
47
58
|
- An endpoint's `auth` gate is NOT enforced on `s.api.call`. A `query({ auth: users })` runs anyway and fails only where its stack dereferences `auth(...)`. A stack that never touches `auth(...)` runs unauthenticated and passes.
|
|
48
59
|
- Neither `auth.token` nor an `Authorization` entry in `headers` authenticates the call — a token that answers 200 over real HTTP is refused here. To cover auth-gated logic, move the body into a `defineFunction` taking the user id and `s.function.call` that; the gate itself is not reachable from a workflow test.
|
|
60
|
+
- Table triggers do not fire on writes made during a test run (unit or workflow); a test asserting a trigger's side effect finds 0 rows. Triggers fire only on a deployed/ephemeral instance, async after commit (`llms/triggers.md`). Test the trigger's stack directly with `s.trigger.call({ trigger, input: { new: obj({…}), old: obj({…}), action: c.text("insert"), datasource: c.text("live") } })` — a synthetic `new`/`old`/`action`; `datasource` is REQUIRED — then assert on what it wrote.
|
|
61
|
+
- A failing RUN's `message` is the authored message: a `s.precondition`/`guard.*` that raised inside a `.call` reports its own text (`"Bookings must start in the future."`), an `s.throw` its `name`.
|
|
49
62
|
|
|
50
63
|
### Running them
|
|
51
64
|
|
package/llms/toolchain.md
CHANGED
|
@@ -6,20 +6,23 @@
|
|
|
6
6
|
`xano/index.ts`. An installed one runs on `export` and `deploy` (after the compile,
|
|
7
7
|
before the upload) and is verified, never rewritten, under `--frozen-lock`. Config
|
|
8
8
|
lives in this project's `package.json` `"xanosdk"` block, keyed by package name.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
|
|
10
|
+
- `marketplace install <pkg>` is not just `npm install`: it asks the module its questions
|
|
11
|
+
and writes that block plus the `.gitattributes` lines it contributes. It also adds the
|
|
12
|
+
module's non-SDK peers (e.g. `zod`) as direct dependencies.
|
|
13
|
+
- A module that arrived any other way (a plain `npm install`, a merged PR) is configured by
|
|
14
|
+
running that same command on it; until then `export`/`deploy` report it unconfigured and it runs on
|
|
15
|
+
shipped defaults.
|
|
16
|
+
- `marketplace reinstall <pkg>` re-asks with the current settings as the defaults and
|
|
17
|
+
re-enables a disabled one.
|
|
18
|
+
- `marketplace remove <pkg>` drops block, lines and dependency together. A plain
|
|
19
|
+
`npm uninstall` leaves the block, and a package it names that is no longer installed
|
|
20
|
+
fails every `--frozen-lock` run.
|
|
17
21
|
|
|
18
22
|
**A module's section of `xano/routes.gen.ts`.** A module with a `routesManifest` hook (types:
|
|
19
23
|
`@xano/sdk/plugin`) writes a block between `// xanosdk:begin <pkg>` and `// xanosdk:end <pkg>`
|
|
20
24
|
after the core sections, on every write of the file (`routes --emit`, `xano:routes`, `pull`,
|
|
21
25
|
`generate`, `marketplace install|reinstall|remove`). Edits inside the block are overwritten.
|
|
22
|
-
Install also adds the module's non-SDK peers (e.g. `zod`) as direct dependencies.
|
|
23
26
|
The hook is synchronous and pure: given
|
|
24
27
|
the request inputs under the manifest's keys and its config, it returns `{ imports?, source }`,
|
|
25
28
|
imports as bare package names (`@xano/sdk*`, relative and `node:` are refused). A module that
|
package/llms/triggers.md
CHANGED
|
@@ -2,35 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
> Read when authoring any trigger. A trigger's `stack` is a callback rather than the plain array every other kind takes, so the shape does not carry over.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
not editable) and arrive through the typed **stack handle** `t` — you can't
|
|
10
|
-
reference them without it. (`response` too — a callback, or a plain value that
|
|
11
|
-
reads none.) `t` exposes exactly that trigger type's inputs; a wrong
|
|
12
|
-
name is a compile error, not a runtime surprise. The seven trigger types are
|
|
5
|
+
A trigger has no user-declared `input`: its inputs are **implied by type** and arrive through the typed
|
|
6
|
+
**stack handle** `t`, so `stack` is a callback — `stack: (t) => [...]` (a plain list works when it
|
|
7
|
+
reads none; `response` likewise). `t` exposes exactly that trigger type's inputs; a wrong name is a
|
|
8
|
+
compile error. The seven trigger types are
|
|
13
9
|
distinct root factories (not a namespace): `{tableTrigger, realtimeServerTrigger,
|
|
14
10
|
realtimeChannelTrigger, mcpServerTrigger, agentTrigger, workspaceTrigger,
|
|
15
11
|
errorTrigger}({ name, guid?, description?, active?, tags?, history?, ... })`.
|
|
16
12
|
`history` is per trigger (omit to inherit the workspace's `history.trigger`, default
|
|
17
13
|
off); a trigger's own failure reaches the error log only while it is on.
|
|
18
14
|
|
|
19
|
-
- `tableTrigger({ name, table?, datasources?, actions?: {insert?,update?,delete?,truncate?}, stack })` — database/table trigger. `t.new` / `t.old` are the row **after** / **before** the change; `t.action` (`insert|update|delete|truncate`), `t.datasource`. Bind `table` to a `table()` handle and `t.new("col")` / `t.old("col")` are typed to that row (misspelled column = compile error). ⚠ Insert's `old` and delete's `new` are `{}`, not null — branch on `t.action
|
|
15
|
+
- `tableTrigger({ name, table?, datasources?, actions?: {insert?,update?,delete?,truncate?}, stack })` — database/table trigger. `t.new` / `t.old` are the row **after** / **before** the change; `t.action` (`insert|update|delete|truncate`), `t.datasource`. Bind `table` to a `table()` handle and `t.new("col")` / `t.old("col")` are typed to that row (misspelled column = compile error). ⚠ Insert's `old` and delete's `new` are `{}`, not null, and drilling one (`t.old("col")`) RAISES and aborts the run — branch on `t.action` with an `s.conditional`. Config-only (no response). ⚠ A table trigger runs AFTER the write COMMITS, from an event queue, so it is NOT the usual in-transaction trigger: it CANNOT veto the write (a top-level `s.precondition`/`s.throw` fails only inside the trigger — visible via an `errorTrigger` when history is on, never to the writing request, which already answered 200 with the row stored) and its own edits do NOT reach that request's response (a `slug` it computes lands on the row a moment later, not in the POST body). Validate in the WRITING stack or a shared `defineFunction`; use the trigger only for after-the-fact side effects. ⚠ Writes made WHILE a trigger runs fire NO table triggers (the runner disables them for the whole stack), on the SAME or any OTHER table — so a trigger may safely edit its own table (no loop), but triggers do NOT chain: a trigger on `orders` that writes `stock` fires no `stock` trigger. Chain by calling the follow-up logic as a `defineFunction`.
|
|
20
16
|
- `realtimeServerTrigger({ name, realtimeServer, actions?: {connect?,disconnect?}, stack?, response?, responseShape? })` — realtime SERVER lifecycle (a client connecting to / disconnecting from the server, not a message). Inputs: `t.action` (`connect|disconnect`), `t.realtime_server`, `t.client`. Bind `realtimeServer` to a `realtimeServer()` handle (or its name).
|
|
21
|
-
- `connect` GATES the connection — a denial sends an `error` and CLOSES the socket with code 4401 before it is ever ready
|
|
22
|
-
- A CRASH DENIES too
|
|
17
|
+
- `connect` GATES the connection — a denial sends an `error` and CLOSES the socket with code 4401 before it is ever ready. Same return shape as a channel `join` below (EMPTY/FALSY DENIES — including a gating trigger with NO `response`, which refuses every client).
|
|
18
|
+
- A CRASH DENIES too. Failure is a LOCKOUT, not a breach (an unguarded drill into a null `db.get` raises → everyone refused).
|
|
23
19
|
- Gating is OPT-IN: a server with no `connect` trigger accepts every connection.
|
|
24
|
-
- `disconnect` is OBSERVATIONAL (return ignored, throws swallowed
|
|
20
|
+
- `disconnect` is OBSERVATIONAL (return ignored, throws swallowed).
|
|
25
21
|
- Both are SERVER-scoped, so `s.realtime.get_session` works but carries no channel path and no bound params.
|
|
26
|
-
- `realtimeChannelTrigger({ name, channel, actions?: {join?,leave?,deliver?}, stack?, response?, responseShape? })` — realtime CHANNEL lifecycle. Inputs: `t.action` (`join|leave|deliver`), `t.channel`, `t.payload`, `t.client`. Bind `channel` to a `realtimeChannel()` handle — a bare path is NOT accepted (it is unique only within its server).
|
|
27
|
-
- `join` GATES the join (it runs before membership) — return `{ allowed: c.bool(true) }` (optional `reason` reaches the client) or any truthy value to admit, and an EMPTY OR FALSY RETURN DENIES, so a stack that just falls through — or a gating trigger with NO `response` — refuses everyone, and a CRASH DENIES too. ONCE the object carries an `allowed` key admission needs STRICTLY `true` — `1`/`"yes"` there DENIES. Compute it as `c.expression("…")` or a `ref()` to a `set_var` boolean (`expr()` is not a `response` value).
|
|
28
|
-
- A lifecycle trigger's inputs are PINNED to those four, so a channel PATH PARAM is NOT among them — `inp("room_id")` RAISES, which crashes the gate and so REFUSES every client; take the param from `s.realtime.get_session` (`ref("session.params.room_id")`).
|
|
22
|
+
- `realtimeChannelTrigger({ name, channel, actions?: {join?,leave?,deliver?}, stack?, response?, responseShape? })` — realtime CHANNEL lifecycle. Inputs: `t.action` (`join|leave|deliver`), `t.channel`, `t.payload`, `t.client`. Bind `channel` to a `realtimeChannel()` handle — a bare path is NOT accepted (it is unique only within its server). Each action has its own return posture:
|
|
23
|
+
- `join` GATES the join (it runs before membership) — return `{ allowed: c.bool(true) }` (optional `reason` reaches the client) or any truthy value to admit, and an EMPTY OR FALSY RETURN DENIES, so a stack that just falls through — or a gating trigger with NO `response` — refuses everyone, and a CRASH DENIES too. ONCE the object carries an `allowed` key admission needs STRICTLY `true` — `1`/`"yes"` there DENIES. Compute it as `c.expression("…")` or a `ref()` to a `set_var` boolean (`expr()` is not a `response` value). This is the inverse of a crashing message, which still delivers, and of `deliver`. ⚠ It runs ONCE: revoking access later (a deleted membership row) does NOT unsubscribe the open socket. Evict it from the endpoint that revokes the membership with `s.realtime.kick` (`llms/kinds-realtime.md`).
|
|
24
|
+
- A lifecycle trigger's inputs are PINNED to those four, so a channel PATH PARAM is NOT among them — `inp("room_id")` RAISES, which crashes the gate and so REFUSES every client; take the param from `s.realtime.get_session` (`ref("session.params.room_id")`). ⚠ It is RAW TEXT — path params are not validated or coerced at join (`rooms/abc` joins an `input.int()` channel; `session.params.room_id` is `"42"`, a string), so a numeric gate must CAST it (`fl.to_int()`) and refuse a non-numeric value itself. The declared type is enforced only when a MESSAGE reads `inp(...)`, per frame, after the join.
|
|
29
25
|
- A gate establishes NO auth: `auth("id")` reads 0 when authenticated, `ref("auth.id")` raises — identity is `t.client("permissions.row_id")` or the session. A SERVER connect/disconnect has no channel, so no params at all.
|
|
30
26
|
- `leave` is OBSERVATIONAL (return ignored, throws swallowed).
|
|
31
|
-
- `deliver` GATES delivery PER RECIPIENT — the per-viewer redaction tool
|
|
32
|
-
-
|
|
27
|
+
- `deliver` GATES delivery PER RECIPIENT — the per-viewer redaction tool, a stack per recipient per message. ⚠ It runs only when the channel sets `delivery.perRecipient` (`llms/kinds-realtime.md`); without it every subscriber receives the UNREDACTED payload, with no error.
|
|
28
|
+
- ⚠ `deliver`'s return values do not read like a filter: ONLY an explicit NULL drops the message for that recipient; an OBJECT replaces that recipient's payload; anything else — including `false`, `0`, `""` — delivers it unchanged, as does a crash. Return null, not `false`, to suppress.
|
|
33
29
|
- The delivered payload arrives NESTED, so read `t.payload("<field>")`, and `t.client` is the SENDER while `s.realtime.get_session` describes the RECIPIENT this run is for.
|
|
34
|
-
- `mcpServerTrigger({ name, mcpServer, stack?, response?, responseShape? })` / `agentTrigger({ name, agent, stack?, response?, responseShape? })` — toolset connection. Bind with the `mcpServer()`/`agent()` def handle (or its name) — it resolves to the toolset guid at export. Raw numeric `objId` is
|
|
30
|
+
- `mcpServerTrigger({ name, mcpServer, stack?, response?, responseShape? })` / `agentTrigger({ name, agent, stack?, response?, responseShape? })` — toolset connection. Bind with the `mcpServer()`/`agent()` def handle (or its name) — it resolves to the toolset guid at export. Raw numeric `objId` is a rarely-right escape hatch; binding nothing deploys a trigger that never fires. Inputs: `t.toolset` (`t.toolset("name")`), `t.tools`; an MCP server's also `t.prompts`/`t.resources`: return one filtered to narrow what the connection lists, omit it to list all — but ⚠ a keyed response MUST keep `toolset` and `tools` (omitting either breaks the server for every client) — and `t.auth`, the signed-in user `{dbo, id, extras}` when the server has `oauth` (null otherwise). Response-bearing; the default returns every list input.
|
|
35
31
|
- `workspaceTrigger({ name, actions?: {branch_live?,branch_merge?,branch_new?}, stack? })` — branch lifecycle. Inputs: `t.to_branch`, `t.from_branch`, `t.action`. Config-only.
|
|
36
32
|
- `errorTrigger({ name, stack? })` — error-signature trigger. Inputs: `t.event` (`new|regression|fixed`), `t.id`, `t.signature`, `t.error` (`t.error("code")`/`t.error("message")`), `t.caller`, `t.statement`, `t.actor`, `t.count`, `t.first_seen`, `t.last_seen`, `t.fixed_at`. Config-only.
|
package/llms/values.md
CHANGED
|
@@ -3,23 +3,30 @@
|
|
|
3
3
|
> Read when you need a literal, a reference, or a tag you have not used before — `c.*`, `ref`, `inp`, `auth`, `col`, and what each one encodes to.
|
|
4
4
|
|
|
5
5
|
- `c.text(s: string) => Value` — String constant → tag "const".
|
|
6
|
-
- `c.int(n: number | bigint | string) => Value` — Integer constant → tag "const:int". The engine stores integers as STRINGS and has no 53-bit limit, so pass a string or bigint for anything past Number.MAX_SAFE_INTEGER — c.int("9223372036854775807") is exact where the number literal for it is already …808. A number that is not a safe integer THROWS rather than encoding the rounded value.
|
|
6
|
+
- `c.int(n: number | bigint | string) => Value` — Integer constant → tag "const:int". The engine stores integers as STRINGS and has no 53-bit limit, so pass a string or bigint for anything past Number.MAX_SAFE_INTEGER — c.int("9223372036854775807") is exact where the number literal for it is already …808. A number that is not a safe integer THROWS rather than encoding the rounded value. For the int64 clamp of an `f.int` column see `llms/fields.md`.
|
|
7
7
|
- `c.decimal(n: number | string) => Value` — Decimal constant → tag "const:decimal". Pass a string only to keep a stored spelling a number cannot reproduce (c.decimal("10.00") keeps its trailing zeros).
|
|
8
|
-
- `c.blank(tag: "const:<type>") => Value` — The editor's UNCONFIGURED value box (stored value ""), emitted by codegen for a pulled workspace — do not author it. NOT a zero or an empty collection: the engine reads "" and "0" differently, so c.blank("const:int") ≠ c.int(0) and neither canonicalizes into the other.
|
|
8
|
+
- `c.blank(tag: "const:<type>") => Value` — The editor's UNCONFIGURED value box (stored value ""), emitted by codegen for a pulled workspace — do not author it. NOT a zero or an empty collection: the engine reads "" and "0" differently, so c.blank("const:int") ≠ c.int(0) and neither canonicalizes into the other. Valid for every constant tag except `const` and `const:obj`; their blanks are `c.text("")` and `c.obj(null)`.
|
|
9
9
|
- `c.bool(b: boolean) => Value` — Boolean constant → tag "const:bool".
|
|
10
10
|
- `c.null(tag?: "const:null" | "const:obj") => Value` — Null constant, stored value "null". Bare c.null() is tag "const:null". c.null("const:obj") is the OBJECT-TYPED null the engine writes into a db.* statement's @meta slot — different stored bytes from c.obj(null), which is the blank object (value ""), though both evaluate to null. Codegen emits whichever spelling the workspace stored; do not swap one for the other.
|
|
11
|
-
- `c.obj(o?: Json | null) => Value` — Object constant → tag "const:obj". A populated one stores an empty {} carrying one `set` filter per key
|
|
11
|
+
- `c.obj(o?: Json | null) => Value` — Object constant → tag "const:obj". A populated one stores an empty {} carrying one `set` filter per key (a populated JSON string fails the request with ERROR_FATAL "Unable to decode."). ⚠ A ZERO-BASED numeric key is an INDEX: c.obj({"0":"a"}) evaluates to the list ["a"] ({"2":…} stays a key) — write c.array([...]) for a list, or prefix the keys ("k0") for an object; `export()` warns. c.obj() is the empty object {}. c.obj(null) is a pulled-workspace blank that evaluates to null; do not author it. Plain JSON literals only — a nested tagged value (inp/ref/auth/c.*) is rejected; for a computed object use a record of values.
|
|
12
12
|
- `c.array(a: Json[]) => Value` — Array constant (JSON string) → tag "const:array". Plain JSON literals only — a nested tagged value is rejected, same as c.obj.
|
|
13
|
-
- `c.expression(source: string) => Value` — Xano Expression Engine source, passed through VERBATIM → tag "const:expr2". The string IS the expression: c.expression('"Hi, " ~ $input.name'), c.expression("$var.price * $var.qty").
|
|
14
|
-
- `c.now() => Value` — Current time as epoch-ms — the engine-native const:epochms constant
|
|
15
|
-
- `obj(fields: Record<string, Value | nested>) => ObjValue<typeof fields>` — Dynamic object value → tag "const:expr2" (an object-literal expression string)
|
|
13
|
+
- `c.expression(source: string) => Value` — Xano Expression Engine source, passed through VERBATIM → tag "const:expr2". The string IS the expression: c.expression('"Hi, " ~ $input.name'), c.expression("$var.price * $var.qty"). ⚠ Unvalidated: not parsed, typed (invisible to InferResponse), or renamed with refs; a typo surfaces at runtime. Use only for syntax typed surfaces lack (`~`, inline arithmetic, conditionals); otherwise prefer ref/inp/col, withFilters+fl.*, and obj() (which builds a checked expression). Not the expr() condition builder.
|
|
14
|
+
- `c.now() => Value` — Current time as epoch-ms — the engine-native const:epochms constant. Valid inline as a where/cmp operand.
|
|
15
|
+
- `obj(fields: Record<string, Value | nested>) => ObjValue<typeof fields>` — Dynamic object value → tag "const:expr2" (an object-literal expression string); the dynamic sibling of c.obj.
|
|
16
|
+
- Members: inp/ref/auth values, env()/setting()/sys.*, c.now(), c.* constants, nested records, or arrays. Each may carry a FILTER CHAIN (withFilters + fl.*), rendered as the expression pipe `$var.row|get:"a.b"`. A null-safe ref(path, { safe: true }) works in a member directly. An inner obj() nests, same bytes as a raw record.
|
|
17
|
+
- InferResponse (through a set_var too) resolves each member like a top-level response key: `response: { user: obj({ id: ref("row.id") }) }` derives `{ user: { id: Col } }`, and a raw nested object literal (`response: { user: { id: ref("row.id") } }`, auto-wrapped through this) derives the same.
|
|
18
|
+
- A constant record or list has two spellings that both work and render identically: bare (`{ a: 1 }`, `[]`) or `c.obj(...)`/`c.array([...])` — prefer the bare form.
|
|
19
|
+
- Rejected: the blank `c.obj(null)` is refused here (write c.null() or c.obj()); a filter ARGUMENT that carries its own chain or is a c.now(); a DISABLED filter; the output/response/trycatch/toolset/reg tags (a type error) — set_var those first and ref() them.
|
|
16
20
|
- `ref(name: string, opts?: { safe?: boolean }) => Value` — Reference a stack variable → tag "var". Pass { safe: true } for null-safe nested access — a dotted ref("owner.user_id", { safe: true }) compiles through the get filter so it resolves to null instead of raising "Unable to locate var" when the base is null.
|
|
17
|
-
- `inp(name: string) => Value` — Reference a function/endpoint input → tag "input". Resolves ONLY against the `input` block of the def it sits in — a value produced earlier in the stack is `ref("var.field")`, not `inp("field")`. A name that is not declared here deploys clean and fails at runtime with ERROR_FATAL "Unable to locate input: <name>" on every branch that reads it; `export()` warns, and `--strict` fails the build. Sending the name in the request does NOT rescue it
|
|
21
|
+
- `inp(name: string) => Value` — Reference a function/endpoint input → tag "input". Resolves ONLY against the `input` block of the def it sits in — a value produced earlier in the stack is `ref("var.field")`, not `inp("field")`. A name that is not declared here deploys clean and fails at runtime with ERROR_FATAL "Unable to locate input: <name>" on every branch that reads it; `export()` warns, and `--strict` fails the build. Sending the name in the request does NOT rescue it. A dotted path drills INTO a declared input (`inp("action.amount")` needs a declared `action`). ⚠ An omitted/`null` optional input binds its EMPTY value (`""`/`0`/`false`/`[]`/`{}`; `""` for an enum), not null — only a type whose input defaults to `nullable: true` (vector, uuid, date, timestamp, file types; `llms/fields.md`) or one set `nullable: true` binds null. An omitted optional `input.geo.*` is not bound at all.
|
|
18
22
|
- `col(name: string) => Value` — Reference a table column → tag "col".
|
|
19
|
-
- `auth(path
|
|
23
|
+
- `auth(path: string) => Value` — Reference the authenticated identity (auth("id") → $auth.id) → tag "auth". The PATH is required: the engine cannot read a bare auth, so auth("") throws. A token minted with extras exposes its claims at auth("extras.<key>") (auth("extras") is the whole map); a key absent from the token is a 500, not null.
|
|
20
24
|
- `caught(path?: "code" | "message" | "name" | "result") => Value` — Read the caught error inside an s.try_catch CATCH arm → tag "trycatch". Valid ONLY there — it reads empty in the try/finally arms and outside the statement. Those four fields are all the engine binds; bare caught() is the whole error record. `code` is the error type: `ERROR_FATAL` for an engine error, a precondition's `error_type` (`ERROR_CODE_ACCESS_DENIED`, …), `ERROR_CODE_THROWN_ERROR` for `s.throw`. `message` is the error text (a precondition's `error`, the engine's, an LLM provider's) EXCEPT for `s.throw`, where it is the fixed "Throw Error Statement" and your value is in `result`. `name` is `s.throw`'s `name` (empty without one), else a label (`Exception`, `Access Denied`). ⚠ An `s.ai.agent.run` provider failure binds `result: { name: "AI_APICallError", statusCode, isRetryable, data }`; branch a fallback on `withFilters(caught("result"), fl.get("statusCode"))` (401: the key was refused). The path takes only the four names; reach deeper with `fl.get`.
|
|
21
25
|
- `toolset(path: "token" | "params" | `params.${string}`) => Value` — Read a toolset-scoped binding inside a tool → tag "toolset". The engine binds two: token (the calling URL's token, null when absent) and params (its parameters, as an object); a dotted params.<key> reads one parameter out of that object. Bound only while a tool runs under its toolset — anywhere else it reads empty.
|
|
22
|
-
- `env(name: string) => Value` — Read a WORKSPACE environment variable (set via workspaceConfig({ env }) or the dashboard) → `$env.NAME`. Compiles to tag "setting" with the plain name.
|
|
26
|
+
- `env(name: string) => Value` — Read a WORKSPACE environment variable (set via workspaceConfig({ env }) or the dashboard) → `$env.NAME`. Compiles to tag "setting" with the plain name.
|
|
27
|
+
- Every value is TEXT (or null), edge whitespace trimmed on read: compare a flag against c.text("true"), not c.bool(true) (under loose `=`, FLAG=false equals c.bool(true)); a numeric use needs fl.to_int/fl.to_decimal.
|
|
28
|
+
- env("remote_ip") reads a user var named remote_ip, not the caller IP — use sys.remoteIp().
|
|
29
|
+
- A name that does not exist resolves to NULL rather than erroring, so a typo deploys clean: prefer typedEnv(config), which turns the names that config declares into properties (E.STRIPE_KEY). Once a config declares env, export() warns stack.env-undeclared on any env() or bare setting() outside the declared set.
|
|
23
30
|
- `setting(name: string) => Value` — Reference a workspace setting → tag "setting". Built-in system vars are $-prefixed settings, e.g. setting("$remote_ip"); prefer the typed sys.* accessors.
|
|
24
31
|
- `sys.*() => Value` — Built-in system / request-context variables → tag "setting" ($-prefixed). Accessors: remoteIp, requestMethod, requestUri, requestQueryString, httpHeaders, requestAuthToken, apiBaseUrl, datasource, branch, tenant, release, platform, isDebugger. In XanoScript these are $env.$remote_ip etc.; sys.remoteIp() is the public-endpoint rate-limit key (auth("id") is null there). sys.httpHeaders() keys arrive Title-Cased whatever the client sent: a client sending `x-sync-secret` is read as `X-Sync-Secret`, so `get:"x-sync-secret"` is null in production — read the Title-Cased name. s.api.call sends header names the same way, so a workflow test sees what a real request delivers.
|
|
25
32
|
- `filter(name: string, ...args: Value[]) => FilterXdo` — Build a filter-chain entry by raw name (escape hatch).
|