@xano/sdk 1.0.15 → 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 +14 -0
- package/README.md +33 -37
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-ZRGNOA6Q.js → agent-file-refresh-DBHTEFYM.js} +12 -12
- package/dist/{agent-skill-command-DV26SDA2.js → agent-skill-command-LHNTU7MH.js} +74 -73
- package/dist/{answer-shape-AVZSKBR6.js → answer-shape-ZRQS7ZC4.js} +5 -5
- package/dist/{backend-dir-NTMXWE5R.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-66ZU2CD5.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-ZYECXDVV.js → chunk-3ZV23FVR.js} +5 -5
- package/dist/{chunk-N72XNQNJ.js → chunk-47XIVDJ6.js} +14 -14
- package/dist/{chunk-ICK36EGF.js → chunk-4EVDCSEY.js} +2 -2
- package/dist/{chunk-AXMUYBWQ.js → chunk-4XGZ325S.js} +3 -3
- package/dist/{chunk-P7GKTV7N.js → chunk-4XYXUK5H.js} +75 -32
- package/dist/{chunk-AE5CRAKS.js → chunk-4ZBXS7YN.js} +8 -8
- package/dist/{chunk-JWASCOHO.js → chunk-52QAENY6.js} +14 -14
- package/dist/{chunk-2LF734YB.js → chunk-54CJ74BH.js} +4 -4
- package/dist/{chunk-TT6LN55R.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-G4WRZU5T.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-FOBVJ2UR.js → chunk-AJQFUJEQ.js} +8 -8
- package/dist/{chunk-DH6O5NQU.js → chunk-C7AYP4H6.js} +29 -20
- package/dist/{chunk-SXMZNSQ6.js → chunk-DJMGDCVX.js} +8 -8
- package/dist/{chunk-K6SWZ6H4.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-V7WCTXEH.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-FKQX6KU7.js → chunk-F3JK5RIY.js} +2 -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-VXHXSGPU.js → chunk-GRZ62LLU.js} +8 -8
- package/dist/{chunk-6X73VFCX.js → chunk-GT7PZCTK.js} +2 -2
- package/dist/{chunk-SH4RY6QX.js → chunk-HXPQXCOZ.js} +1536 -413
- package/dist/{chunk-ECQXASG3.js → chunk-IFHFJR5O.js} +2 -2
- package/dist/{chunk-7ZQ73AHJ.js → chunk-IOWNQEMW.js} +31 -31
- package/dist/{chunk-YCKKL5PD.js → chunk-ISIZFK5Q.js} +53 -47
- package/dist/{chunk-HCNIB3EC.js → chunk-IUJDUFT7.js} +4 -4
- package/dist/{chunk-74OPNM2Z.js → chunk-JHAZK4RY.js} +3 -3
- package/dist/{chunk-OZWAITII.js → chunk-KGHJ74HF.js} +6 -6
- package/dist/{chunk-XLP4CNSF.js → chunk-L2O5KG5Q.js} +6 -6
- package/dist/{chunk-NNI5R6V6.js → chunk-L3Q2QYIQ.js} +72 -72
- package/dist/{chunk-UNFQN3TT.js → chunk-LLBEPJBO.js} +3 -3
- package/dist/{chunk-VUWR5YLE.js → chunk-LWBGPPI5.js} +13 -13
- package/dist/{chunk-RBTZEHXF.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-ZF2CBXT5.js → chunk-NQPPUNWP.js} +3 -3
- package/dist/{chunk-5SKWGCAJ.js → chunk-O7Z3LF44.js} +5 -5
- package/dist/{chunk-ASQX477B.js → chunk-OLXYZQR7.js} +7 -7
- package/dist/{chunk-5SJQAJLF.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-WXKSB2N3.js → chunk-Q7KXMIR3.js} +3 -3
- package/dist/{chunk-B6AFJVG4.js → chunk-QCVH32T2.js} +5 -5
- package/dist/{chunk-7FIMUFBP.js → chunk-QDPY7RN3.js} +3 -3
- package/dist/{chunk-MGG4CHO4.js → chunk-QIT2GGNB.js} +3 -3
- package/dist/{chunk-QW7NGUYW.js → chunk-QSJH5AFU.js} +244 -173
- package/dist/{chunk-3GZMP7II.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-M7O3T7IM.js → chunk-RIT3WBBX.js} +4 -4
- package/dist/{chunk-45K2QZBR.js → chunk-RKNCISPM.js} +3 -3
- package/dist/{chunk-NPYYDTXS.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-A2N2C2WD.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-R3GPRNBT.js → chunk-SVQMDVND.js} +87 -16
- package/dist/{chunk-45ZUMF4E.js → chunk-TPUAXIPR.js} +2 -2
- package/dist/{chunk-SL55XKVL.js → chunk-TXU34ELY.js} +25 -25
- package/dist/{chunk-GDJCWQIK.js → chunk-U4UAWGIT.js} +12 -8
- package/dist/{chunk-76SBT7KS.js → chunk-U56HK2RG.js} +7 -5
- package/dist/{chunk-RXNMZM6H.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-ZDVVIJPU.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-6EFXPTHT.js → chunk-WAP5362D.js} +5 -5
- package/dist/{chunk-XY4OBD26.js → chunk-WGKKDGSA.js} +4 -4
- package/dist/{chunk-TXFOQZUQ.js → chunk-WVVUE7LU.js} +14 -7
- package/dist/{chunk-JAYHFXWH.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-7AKH4QDJ.js → chunk-XKMZYU5B.js} +96 -65
- package/dist/{chunk-UVHSMANV.js → chunk-Y3RH35KM.js} +47 -47
- package/dist/{chunk-GIQIMWTK.js → chunk-YHT7TDSH.js} +14 -14
- package/dist/{chunk-FXZEZAV2.js → chunk-YJXJOMXW.js} +3 -3
- package/dist/{chunk-ZPJXWMHK.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-ZC6H2ERE.js → chunk-ZF4LCHCT.js} +5 -5
- package/dist/{chunk-GRXX2TOJ.js → chunk-ZHFSIQ6E.js} +2 -2
- package/dist/{chunk-SHHXLI2K.js → chunk-ZJQFKBX7.js} +7 -7
- package/dist/{chunk-ZRXDPCMN.js → chunk-ZYZ7GRX3.js} +2 -2
- package/dist/{chunk-CJGLAQRD.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-BYAZZF37.js → deploy-command-PBM3S4ZL.js} +69 -68
- package/dist/{deploy-source-QCPZWNJO.js → deploy-source-JW7DAN75.js} +32 -32
- package/dist/{dev-env-sync-6MHK3UHC.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-KUIEKBTM.js → env-pull-command-FFPNRVWD.js} +52 -52
- package/dist/{env-target-Y77RLRS5.js → env-target-XHVRZXHX.js} +14 -14
- package/dist/{env-var-command-BZWJD75C.js → env-var-command-DJS62YRR.js} +41 -41
- package/dist/{ephemeral-VLPRDNEJ.js → ephemeral-2DXWP3VK.js} +9 -9
- package/dist/{ephemeral-command-SYKDPALW.js → ephemeral-command-VLQIQ5TS.js} +52 -52
- package/dist/{ephemeral-state-RUOU2GFS.js → ephemeral-state-56XEDUJW.js} +12 -12
- package/dist/{generate-command-CSQDQZSW.js → generate-command-PSDIIOTU.js} +89 -88
- package/dist/{gitignore-OQGYM7DO.js → gitignore-PMJ6MFNA.js} +15 -15
- package/dist/{guards-JUYBDLZY.js → guards-YICHJKX3.js} +51 -15
- package/dist/{impersonate-command-HSFCZBV6.js → impersonate-command-IKV4KUYA.js} +37 -37
- package/dist/{import-T4ZTOTBT.js → import-VJQGIS33.js} +5 -5
- package/dist/index.d.ts +552 -117
- package/dist/index.js +29 -28
- package/dist/init-command-LEQIE6GC.js +143 -0
- package/dist/{init-modules-BL2SR5RK.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-SHF75FC7.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-7EOLEKH3.js → landing-record-JQ7HZDGI.js} +22 -22
- package/dist/{live-diff-M2OLXKM6.js → live-diff-KJ2TWWWT.js} +14 -14
- package/dist/{local-engine-choice-TOC3UYZZ.js → local-engine-choice-DFAMYOIF.js} +35 -35
- package/dist/{local-engine-command-6KSRDZBR.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-XTP3EATV.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-437P6BHY.js → lock-commands-7VO6YWOV.js} +67 -66
- package/dist/{login-command-BNRDAVFV.js → login-command-WTZUBCW6.js} +27 -27
- package/dist/{logout-command-FCGCHB7Y.js → logout-command-5BJUNK3C.js} +17 -17
- package/dist/{loop-WOAEXMTC.js → loop-HILLODVH.js} +15 -15
- package/dist/{marketplace-command-SUBJZPJV.js → marketplace-command-NMOH4XOV.js} +30 -30
- package/dist/{marketplace-resolve-JR4BBJ6K.js → marketplace-resolve-63QWMQZU.js} +6 -6
- package/dist/{meta-client-AYJS3RQ3.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-ORQPVJKB.js → operation-outcome-WK7UW6PJ.js} +24 -24
- package/dist/{output-target-KNHHNDM3.js → output-target-5PYRCCK4.js} +16 -16
- package/dist/{plan-disclosure-4DUFRGCP.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-32GFVKSN.js → preflight-command-3BX2WW3S.js} +75 -74
- package/dist/{profile-command-U2XTKOMF.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-5ZVZ6IYT.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-LDN5DOKQ.js → release-ns-command-EVAHK4CU.js} +96 -95
- package/dist/{retry-command-LFZYEVRU.js → retry-command-WP4ZI6CJ.js} +8 -8
- package/dist/{routes-manifest-BMAOL6WN.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-7QM3ORGX.js → secrets-file-7XWR7HW3.js} +15 -15
- package/dist/{secrets-fill-command-OZ537VOD.js → secrets-fill-command-NKCGC75L.js} +66 -65
- package/dist/{seed-ATGBOEJP.js → seed-YKTZDS2Q.js} +13 -13
- package/dist/{source-resolve-QYSWA3QR.js → source-resolve-CQGDFQQC.js} +22 -22
- package/dist/{static-host-MO4VDHL7.js → static-host-3HPZKVKK.js} +5 -5
- package/dist/{status-command-IEB4K7ME.js → status-command-TBMQ3GJP.js} +38 -38
- package/dist/{store-AJX4MC7Y.js → store-B63BQV6R.js} +6 -6
- package/dist/{store-DspGMsFY.d.ts → store-in7gSpMS.d.ts} +185 -11
- package/dist/sync-baseline-GRS33AB5.js +38 -0
- package/dist/{sync-contributions-DLV5JZUK.js → sync-contributions-RKPLZPPO.js} +9 -9
- package/dist/{sync-record-NE62ERA3.js → sync-record-AWFCSS4D.js} +15 -15
- package/dist/{table-TFD4ZQXA.js → table-ONGT3JGE.js} +12 -12
- package/dist/{tables-command-IMCVPUFY.js → tables-command-UYQ277TJ.js} +41 -41
- package/dist/{tenant-IIYECNWO.js → tenant-IXIW3FOI.js} +10 -10
- package/dist/{tenant-command-77KG76MU.js → tenant-command-7LWZUK2V.js} +104 -103
- package/dist/{test-command-NSPU4RUO.js → test-command-7KTT5EAF.js} +56 -45
- package/dist/{tests-JWQRHFCT.js → tests-N4MMBABH.js} +6 -6
- package/dist/{token-BDHD7GU3.js → token-3TCMW2AP.js} +13 -13
- package/dist/{toolchain-hooks-QHJRDCRW.js → toolchain-hooks-IJWV3ZQS.js} +18 -18
- package/dist/{toolchain-modules-LY7BMYG6.js → toolchain-modules-PBVBCPQJ.js} +5 -5
- package/dist/{toolchain-peers-FQJBTKEB.js → toolchain-peers-EMOYN4U7.js} +8 -8
- package/dist/{tracked-backend-BIR7YJCE.js → tracked-backend-YDUUQZQF.js} +34 -34
- package/dist/update-check-C6KDFGMT.js +141 -0
- package/dist/{upgrade-command-YCADQCIA.js → upgrade-command-ZSBTSMBR.js} +68 -67
- package/dist/{whoami-command-IZCTUPM4.js → whoami-command-L6ERHR5K.js} +16 -16
- package/dist/{workspace-TK52V7WO.js → workspace-5DPSDM4A.js} +5 -5
- package/dist/{workspace-binding-3UT6PP4B.js → workspace-binding-MVOWGNYW.js} +15 -15
- package/dist/{workspace-command-46OCB6XT.js → workspace-command-PKQ5TDR7.js} +100 -99
- package/dist/{workspace-env-PVPOWFNZ.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-XXJT365U.js → xanosdk-import-HHMQDK2I.js} +10 -10
- package/dist/{xanosdk-project-CJKRLQ6U.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 +32 -25
- 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 +643 -503
- package/llms.txt +120 -137
- package/manifest.json +147 -95
- 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-4PJEBNRK.js +0 -80
- package/dist/codegen-command-RDD4GL35.js +0 -182
- package/dist/env-example-refresh-MQWHY7ZS.js +0 -135
- package/dist/init-command-6Z7QNVDY.js +0 -142
- package/dist/promote-command-OO56IZBT.js +0 -148
- package/dist/pull-command-LT5PCEIW.js +0 -170
- package/dist/release-command-RBUOXIH7.js +0 -152
- package/dist/routes-manifest-file-MPOVKD6N.js +0 -41
- package/dist/sync-baseline-IB7MABZO.js +0 -38
- package/dist/update-check-JDARCXAX.js +0 -140
- package/dist/xano-EOUVXNQX.js +0 -43
package/llms/statements-calls.md
CHANGED
|
@@ -4,59 +4,80 @@
|
|
|
4
4
|
|
|
5
5
|
Auth & calls:
|
|
6
6
|
|
|
7
|
-
- `s.security.create_auth_token({ table, id, extras?, expiration?, as? })` — `extras` defaults to `{}`, `expiration` (seconds, a `Value`: `c.int(3600)`) to 86400 (`c.int(0)` = never).
|
|
7
|
+
- `s.security.create_auth_token({ table, id, extras?, expiration?, as? })` — `extras` defaults to `{}`, `expiration` (seconds, a `Value`: `c.int(3600)`) to 86400 (`c.int(0)` = never). ⚠ Feeding `expiration` from an OPTIONAL int input mints a NEVER-expiring token when the client omits it: an omitted optional int binds `0`, and `0` means never — so `expiration: inp("ttl")` with an optional `ttl` silently issues permanent credentials. Declare `input.int({ default: 86400 })`, or leave `expiration` out in an `s.conditional` else branch when the input is null.
|
|
8
8
|
- **Marketplace first:** `@xano-sdk/auth` registers a complete auth surface — signup/login/me endpoints plus their `user`/`account`/`event_log` tables — via `registerAuth(ws, { canonical: "authn" })`. Authentication only, not authorization. Inspect with `npx @xano/sdk marketplace details @xano-sdk/auth --prompt`.
|
|
9
9
|
- **The auth loop end to end** — what that module implements; author it directly for a custom flow. An auth TABLE (`table({ auth: true })`) backs identity; a PUBLIC login query verifies and mints a token; every protected query names that table as `auth:` and reads the caller with `auth(...)`.
|
|
10
|
-
- Signup: `s.db.add({ table: users, row: { email: inp("email"), password: inp("password") } })` — the `f.password()` column hashes on write; take the submission as `input.text()` on signup AND login (
|
|
11
|
-
- Login: `s.db.get({ table: users, fieldName: "email", fieldValue: inp("email"), output: ["id", "password"], as: "u" })` — the `output` naming `password` is REQUIRED (the column is `access: "internal"` and absent from the row otherwise) → `s.precondition({ expr: expr(ref("u", { safe: true }), "!=", c.null()), error: c.text("
|
|
12
|
-
- Client: send it as an `Authorization: Bearer <token>` header. A `query({ auth: users })` refuses a request without a valid one before its stack runs; inside the stack `auth("id")` is the caller's row id (`response: { id: auth("id") }` is the whole `me` endpoint).
|
|
13
|
-
-
|
|
10
|
+
- Signup: `s.db.add({ table: users, row: { email: inp("email"), password: inp("password") } })` — the `f.password()` column hashes on write; take the submission as `input.text()` on signup AND login (a password input double-hashes; `llms.txt` Gotchas).
|
|
11
|
+
- Login: `s.db.get({ table: users, fieldName: "email", fieldValue: inp("email"), output: ["id", "password"], as: "u" })` — the `output` naming `password` is REQUIRED (the column is `access: "internal"` and absent from the row otherwise) → `s.precondition({ expr: expr(ref("u", { safe: true }), "!=", c.null()), error: c.text("Invalid email or password."), error_type: "unauthorized" })` → `s.security.check_password({ text_password: inp("password"), hash_password: ref("u.password"), as: "ok" })` → precondition on `ok`, same error → `s.security.create_auth_token({ table: users, id: ref("u.id"), as: "token" })` → `response: { token: ref("token") }`. ⚠ One error for both: a 404/401 split enumerates accounts.
|
|
12
|
+
- Client: send it as an `Authorization: Bearer <token>` header. A `query({ auth: users })` refuses a request without a valid one before its stack runs; inside the stack `auth("id")` is the caller's row id (`response: { id: auth("id") }` is the whole `me` endpoint). ⚠ The gate is STATELESS: it checks only the token's SIGNATURE and EXPIRY, never that the row still exists. A DELETED or disabled user's token keeps passing every `auth:` query until it expires (24 h by default), and `create_auth_token` mints for ANY id, so `auth("id")` can name a row that is gone — reads and ownership writes then serve or create rows for a ghost user. There is NO revocation; a short `expiration` is the only lever. Where it matters, verify the row exists: `s.db.get({ table: users, fieldValue: auth("id"), as: "__actor" })` → `guard.found("__actor", { errorType: "unauthorized" })` (`guard.role` already does this, answering 401 `Not signed in.`).
|
|
13
|
+
- Claims: a token minted with `extras` is read back as `auth("extras.<key>")` (`auth("extras")` is the whole map). ⚠ A key ABSENT from the token (an older token, or one minted without it) is a 500 `Unable to locate auth: extras.<key>`, not null — mint the same keys every time. And claims are a SNAPSHOT frozen at mint: a role change does not reach existing tokens, so authorize off the row (`guard.role`) when the value can change, not off a claim.
|
|
14
|
+
- **Authorization, on top of that.** `guard.role(users, "admin")` and `guard.owner("note", "user_id")` each return a fixed-arity TUPLE of statements — spread them (`stack: [...guard.role(users, "admin"), …]`).
|
|
14
15
|
- `guard.role(table, role | roles[], { field?, as?, errorType?, message?, missingErrorType?, missingMessage? })` — fetches the caller's own row by `auth("id")` into `__actor`, asserts it EXISTS (401), then asserts its `role` is in the set (403). Roles type from the enum column; an unknown role or `field` throws. The existence step matters: a role check on a null actor row is not reliably false.
|
|
15
|
-
- `guard.owner(rowVar, ownerField = "user_id", { … })` — asserts the row bound to `rowVar` is non-null (404), THEN compares its owner column to `auth("id")` (also 404). Drilling before the existence check is a 500, not a denial: `db.get` binds `null` on a miss and `ref("note.user_id")` against it raises `Unable to locate var`. Takes the var NAME and the column separately
|
|
16
|
+
- `guard.owner(rowVar, ownerField = "user_id", { … })` — asserts the row bound to `rowVar` is non-null (404), THEN compares its owner column to `auth("id")` (also 404). Drilling before the existence check is a 500, not a denial: `db.get` binds `null` on a miss and `ref("note.user_id")` against it raises `Unable to locate var`. Takes the var NAME and the column separately; a dotted path is refused.
|
|
16
17
|
- `guard.found(rowVar, { errorType?, message? })` — ONE statement: asserts the row bound to `rowVar` is non-null (404, `"Not found."`), and NARROWS it — after it, `InferResponse` drops the `| null` from `rowVar`. `guard.owner`'s existence step is this statement.
|
|
17
18
|
- `guard.require(condition, { errorType?, message? })` for anything else — same shape, and it defaults to 403 where a bare `s.precondition` defaults to `standard`, i.e. **500**.
|
|
18
19
|
- `s.security.create_uuid({ as? })` — bind a fresh UUID (v4). Takes nothing else. There is NO `create_guid` (internal, unpushable).
|
|
19
20
|
- **Receiving a webhook** — no `auth`, no declared `input` (the signature covers the raw bytes): `s.util.get_raw_input({ encoding: "none", as: "raw" })` → `s.set_var("mac", withFilters(ref("raw"), fl.hmac_sha256(env("WH_SECRET"))))` → `s.set_var("sig", withFilters(sys.httpHeaders(), fl.get("X-Signature")))` (Title-Cased) → an `s.precondition` (`error_type: "unauthorized"`) comparing the two TIMING-SAFELY by HMACing both again — `expr(withFilters(ref("sig"), fl.hmac_sha256(env("WH_SECRET"))), "=", withFilters(ref("mac"), fl.hmac_sha256(env("WH_SECRET"))))` — BEFORE `fl.json_decode()` reads `raw`. Claim the event id with `s.redis.set({ …, create_only: c.bool(true) })` and answer 200 to a replay.
|
|
20
|
-
-
|
|
21
|
-
|
|
21
|
+
- **Verifying a token (JWS/JWE)** — ⚠ `s.security.jws_decode`/`jwe_decode`/`decrypt`/`check_password` THROW a 500 `ERROR_FATAL` on EVERY failure (a tampered/garbage/empty/wrong-key token, a wrong `signature_algorithm`, an expired token `The token expired.`, a failed `check_claims` `Invalid value for claim: <k>`, a bad `decrypt` key/iv, a non-hash to `check_password`), NOT a falsy result — so a bare decode answers 500 for every bad token where 401 is wanted. Wrap it: `s.try_catch({ try: [s.security.jws_decode({ token: inp("token"), key: env("JWT_SECRET"), signature_algorithm: "HS256", check_claims: obj({ role: c.text("admin") }), as: "claims" })], catch: [s.precondition({ expr: expr(c.bool(true), "=", c.bool(false)), error_type: "unauthorized", error: c.text("Invalid token.") })] })` — a good token binds `claims` and runs on; any failure lands in `catch`, which raises a clean 401. `check_claims` is an object of EXACT-match claims; `exp`/`nbf` are checked automatically.
|
|
22
|
+
- **`s.security.*` defaults are WEAK — pass them explicitly** (the catalog prints none; these are the engine's). `encrypt`/`decrypt` default `algorithm` to `aes-128-cbc`, so a 32-byte key is CUT to 16 (AES-128, not -256) — pass `algorithm: "aes-256-cbc"`. AES keys are NOT length-checked (a short key is zero-padded and still encrypts at 200), and a non-string `data` 500s — `fl.json_encode` an object first. `jws_encode`/`jwe_encode` default `ttl: 0`, which mints a token with NO `exp` claim (it NEVER expires) — set a `ttl` in seconds. `create_rsa_key` defaults `bits: 1024`, below the 2048 minimum — pass `bits: 2048`+. `random_bytes` defaults `length: 1`; `random_number` bounds are INCLUSIVE and `min > max` 500s; `create_password` with a `character_count` below the required classes 500s.
|
|
23
|
+
- `s.function.run({ fn, input?, as?, runtime? })` / `s.function.call({ fn, input?, as? })` — run another function.
|
|
24
|
+
- **Inputs:** `input` is keyed by the target's input names (an undeclared one is a type and export error, a mistyped `c.*` constant a type error; generic over `fn`, pass `Record<string, Value>`; `2` binds an int — `c.decimal(2)` for a decimal).
|
|
25
|
+
- ⚠ **The two DIFFER ON FAILURE.** `s.function.run` RAISES — a `precondition`/500 in the target propagates, so the caller fails with that status, and an uncaught `s.throw` in it answers with its `status` (200 without one). `s.function.call` does NOT raise OUTSIDE a workflow test: it BINDS the error envelope `{ code, message, payload }` to `as` (still typed as the SUCCESS shape, so the mismatch is silent) and the stack answers 200 carrying it. Use `s.function.run` whenever a failing target must stop the caller; reach for `s.function.call` only to INSPECT a possible failure (branch on `ref("r.code")` before trusting the result). INSIDE a workflow test `s.function.call` DOES raise, like `s.api.call`/`s.task.call`.
|
|
26
|
+
- ⚠ **Omitted inputs:** `s.function.run` binds an input it OMITS from the CALLING def's same-named declared input — an endpoint declaring `discount` hands `?discount=100` through, or `0` when the client sends none. An endpoint/tool/prompt declaring NO inputs binds it from the raw request. `ignored()` always takes the target's default. Pass inputs explicitly (`statement.omitted-input` warns).
|
|
27
|
+
- ⚠ Forwarding a caller's OPTIONAL input (`input: { b: inp("b") }`) passes its EMPTY value (`0`/`""`) when the client omits it, NOT 'absent', so the TARGET's `default` never applies and you get wrong data at 200; declare the caller's input `nullable: true` (an omitted one then binds `null`, which DOES take the target's default) or repeat the default on the caller.
|
|
28
|
+
- ⚠ **Depth:** calls nest at most ~25 deep per request (the engine's variable-stack limit); deeper, including legitimate bounded recursion (a tree walk, factorial, self-paginating call), fails with HTTP 500 `Infinite recursion detected` — recurse iteratively (`s.while` over an explicit list) or batch.
|
|
29
|
+
- `runtime?` runs it in the BACKGROUND: `{ mode: "async-shared" }` or `{ mode: "async-dedicated", cpu?, memory?, timeout?, maxRetry? }` (resources read at dedicated only). Omit `runtime` for a normal call; same on `s.ai.agent.run`.
|
|
30
|
+
- An async run keeps its caller: `auth()` inside it is the dispatching request's, and from a public endpoint it has none.
|
|
31
|
+
- An async call DOES NOT return the result — it dispatches and continues, and `as` binds the job id (a UUID `string`). Collect with `s.await({ ids, timeout, as })`, binding `{ "<jobId>": result }` (read each with `fl.get(ref("<idVar>"))`); a too-short `timeout` or unknown id is a 500 `Async timeout`, no partial result.
|
|
32
|
+
- ⚠ `s.await` NEVER RAISES for a FAILED job (only the timeout/unknown-id case 500s) — a crashed job's slot holds the error envelope in place of the result, served at HTTP 200, and `try_catch` cannot see it. Read each slot (`fl.get(ref("<idVar>"))`) and treat a present `code`/`statement`/`state` as a failure before trusting the result:
|
|
33
|
+
- `{ code, message, payload }` for a precondition/engine error
|
|
34
|
+
- `{ payload, statement }` for `s.throw` (no `code`)
|
|
35
|
+
- `{ state: "terminated" }` for one stopped by `terminate`
|
|
36
|
+
- ⚠ `ids` is a single `Value`, so a bare `[ref("j1"), ref("j2")]` fails `tsc` — pass one id as `ref("j1")`, or a list by building it first: `s.set_var("ids", obj({ list: [ref("j1"), ref("j2")] }))` then `s.await({ ids: ref("ids.list"), timeout: c.int(10), as })`.
|
|
37
|
+
- Defaults: `ids` omitted → `{}` at once, `timeout` 10s; awaiting the same id twice returns the same result. `terminate: c.true()` asks every still-outstanding job to STOP at its next statement boundary when the await times out (its slot then reads `{ state: "terminated" }`); the await still throws `Async timeout`.
|
|
22
38
|
- `s.api.call({ api, input?, headers?, auth?, as? })` — invoke an endpoint. WORKFLOW-TEST ONLY (see Gotchas in `llms.txt`).
|
|
23
|
-
- `api` takes the `query()` def HANDLE (or a `{ name, guid }` pair) — a bare name is refused
|
|
39
|
+
- `api` takes the `query()` def HANDLE (or a `{ name, guid }` pair) — a bare name is refused (identity = api group + verb + name).
|
|
24
40
|
- `headers` REPLACES the request headers the callee sees and takes the same shapes as `s.api.request`'s, or one `Value`.
|
|
25
|
-
- `auth` is `{ token, ignoreExpiration? }`: `token` must be a BARE STRING — a tagged `Value` deploys clean and then fails the run with `Param: token - Text filter requires an integer, float, string or boolean value
|
|
26
|
-
- Neither slot authenticates the call
|
|
41
|
+
- `auth` is `{ token, ignoreExpiration? }`: `token` must be a BARE STRING — a tagged `Value` deploys clean and then fails the run with `Param: token - Text filter requires an integer, float, string or boolean value`.
|
|
42
|
+
- Neither slot authenticates the call; see `llms/tests.md` for what a workflow-test run actually sees.
|
|
27
43
|
- `s.api.request({ url, method?, params?, headers?, timeout?, follow_location?, verify_host?, verify_peer?, ca_certificate?, certificate?, certificate_pass?, private_key?, private_key_pass?, description?, output?, as? })` — external HTTP request (`mvp:api_request`). Ergonomic types, each also accepting a dynamic `Value`:
|
|
28
|
-
- `method` suggests the
|
|
44
|
+
- `method` suggests the 8 verbs (GET/POST/PUT/DELETE/HEAD/OPTIONS/PATCH/QUERY). QUERY (RFC 10008) is the safe method that sends `params` as its body.
|
|
29
45
|
- `params` a plain JSON object **or** a FLAT record whose values are tagged `Value`s (`{ count: ref("count") }`, each lifted via a `set` filter — the same record-of-values shape `response: { key: value }` takes); a tagged value NESTED inside an object or array THROWS at encode, so wrap a structured body in `obj({...})`, which encodes any depth as one `const:expr2` (→ query string for GET/HEAD/OPTIONS, body otherwise).
|
|
30
46
|
- `headers` a `{ "Name": value }` record whose values may be tagged (`{ "x-api-key": env("KEY") }`, each pair joined to a `"Name: value"` line) **or** a `string[]` of full header lines — prefer a header over a `?key=` query param for a credential — a URL reaches access logs and proxies.
|
|
31
47
|
- ⚠ Neither spelling is envelope-safe: the `as` envelope's `request` half mirrors `url`, `params` AND `headers`, so never return it raw from a credentialed request — read `response.result`.
|
|
32
48
|
- A NAME outside the header-token charset is refused, and a LITERAL value (string or `c.text`) carrying CR/LF/NUL is refused; a value may hold `:` and spaces (`Bearer a: b` is a valid value). A TAGGED value cannot be checked at build time, so strip CRLF from caller-controlled input before this slot. Literal pairs are emitted before computed ones, whatever the key order.
|
|
33
49
|
- No `User-Agent` is sent unless `headers` carries one. An API requiring one answers **403** as ordinary `response.result` (no throw; every mapped field reads `null`). Send one (`headers: { "User-Agent": c.text("my-app") }`) and gate on `ref("<var>.response.status")` = 200 with `s.precondition`.
|
|
34
|
-
- A transport failure (timeout, DNS) does not throw — `s.try_catch` never catches it: `response.status` is `0`, with `response.error` set. Retry on `status == 0 || status >= 500`; `status < 500`
|
|
50
|
+
- A transport failure (timeout, DNS) does not throw — `s.try_catch` never catches it: `response.status` is `0`, with `response.error` set. Retry on `status == 0 || status >= 500`; a bare `status < 500` check treats a transport failure (status 0) as success.
|
|
35
51
|
- `timeout` a `number` in seconds (1–86400), and `follow_location`/`verify_host`/`verify_peer` booleans.
|
|
36
52
|
- `description` and `output` filters ride the envelope. Cert pairings (certificate↔private_key, ca_certificate→verify_peer) are checked at build time when provable.
|
|
37
53
|
- The `as` result is typed as the `{request, response}` envelope (`response.status: number`, `response.result: unknown`), so `InferResponse` resolves a `ref` to it. Same typed result on `webflow.request` and `microservice.request`.
|
|
38
54
|
- `s.stream.from_request({ url, method?, …tls, as? })` — streaming external HTTP request (`mvp:streaming_api_request`); same typed field surface as `s.api.request` (no description/output envelope). `url` is REQUIRED.
|
|
39
|
-
- `s.util.send_email({ to
|
|
55
|
+
- `s.util.send_email({ to?, subject, message, from?, cc?, bcc?, reply_to?, service_provider?, api_key?, scheduled_at?, as? })` — send email from the stack. `subject` and `message` are required at runtime, and so are `to` and `from` with `"resend"`. Use it over a hand-rolled `s.api.request` to a mail provider.
|
|
56
|
+
- `service_provider: "xano"` — the built-in mailer: needs NO `api_key` and no configuration, and does not require a verified sender. ⚠ It delivers ONLY to the workspace owner: `to`/`cc`/`bcc`/`reply_to`/`scheduled_at` are ignored and `from` is fixed — alerts to yourself, never mail to a user.
|
|
57
|
+
- `service_provider: "resend"` — mail to any recipient; pass the key as `api_key: env("RESEND_API_KEY")`.
|
|
58
|
+
- ⚠ A failed send does NOT raise: `as` binds `{ status: "error", error }` (success binds `status: "success"`). Branch on `ref("<as>.status")`.
|
|
40
59
|
- `s.webflow.request({ path, method?, …tls, as? })` — Webflow API request (`mvp:connect_webflow_api_request`); like `s.api.request` but addressed by `path` (host is engine-supplied), and `path` is REQUIRED — the engine rejects an empty one. No `headers`: the engine builds its own from the workspace's Webflow connection and ignores an authored value.
|
|
41
|
-
- `s.task.call`
|
|
42
|
-
- `s.
|
|
60
|
+
- `s.task.call({ task, as? })` — runs the task's stack once, now; takes NO `input` (a task declares none). `as` binds the task's `s.return` value (null without one), which is how a `workflowTest` asserts a task has a result. WORKFLOW-TEST ONLY (see Gotchas in `llms.txt`).
|
|
61
|
+
- `s.tool.call` / `s.trigger.call` / `s.middleware.call` / `s.addon.call` — same `{ <target>, input?, as? }` shape against the named kind. `s.trigger.call` is WORKFLOW-TEST ONLY (see Gotchas in `llms.txt`); the other three run from any stack, but `s.tool.call` passes NO caller: `auth()` in the tool fails ACCESS_DENIED. ⚠ Like `s.function.call`, a FAILING tool never raises: its error envelope binds to `as` at 200; `s.function.run` a shared function to stop the caller.
|
|
62
|
+
- `s.trigger.call`'s `input` is UNTYPED and must carry the inputs the target trigger reads, which the `t` accessor names: a `tableTrigger` needs `action` (`"insert"`/`"edit"`/`"delete"`), `datasource` (REQUIRED — without it the run fails `Missing param: datasource`), and `new`/`old` row objects; a misspelled key type-checks and is just ignored.
|
|
63
|
+
- `s.action.call({ actionId, input?, registry?, as? })` / `s.action.package.call({ traceId, versionId, slug, input?, registry?, as? })` — invoke an installed action. Ids are SUPPLIED, never derived from a name: an action is installed onto the instance, so its identity is assigned at install and differs per instance — read them off a call in a pulled workspace. The package form needs all three parts: pass them together; any subset addresses nothing. `registry` is the action's own settings, `input` the per-call arguments.
|
|
43
64
|
- `s.cloud.job({ image, command, args?, secret?, template?, await?, as? })` — launch a containerized job. `image`/`command` are REQUIRED; omitted → `Missing param`. ⚠ `await` is SECONDS (default 60), not a boolean.
|
|
44
65
|
- `s.cloud.job.status({ id, as? })` · `s.cloud.job.await({ ids, timeout, as? })` — poll one job, or block on several (`ids` a list `Value`, `timeout` in seconds; both required).
|
|
45
66
|
|
|
46
67
|
Microservices (the `microservice()` def and the statement that calls it):
|
|
47
68
|
|
|
48
69
|
- `microservice({ name, kind, … })` — two mutually exclusive shapes via `kind`: `builtin` declares containers (image/ports/resources/env/command/args) plus optional `ingresses`, and `helm` points at a chart and its `values` — passing both throws.
|
|
49
|
-
-
|
|
70
|
+
- Unstable API — every export of a workspace declaring one prints a notice saying so.
|
|
50
71
|
- `configs`/`volumes` are typed and `@deprecated` but NOT deployable: the engine rejects an import carrying either, so `export()` fails the build rather than letting the deploy fatal.
|
|
51
72
|
- Put a value the workload reads in a container's `env`, and storage in a container's own `volumes` (`emptyDir`/`persistent`/`config`).
|
|
52
73
|
- Container names are free-form — they need not match the microservice name, which is what a stack addresses.
|
|
53
|
-
-
|
|
74
|
+
- ⚠ Secrets are copied verbatim: `chart.values` and `registryAuth.dockerconfigjson` are carried into the bundle, and into a pulled tree. `process.env.X` in the def is NOT a way out: it resolves at EXPORT and writes the literal in.
|
|
54
75
|
- Reference a `workspaceConfig({ env })` var instead and only the NAME travels — the engine substitutes at DEPLOY. Two spellings: `env: [{ name: "API_KEY", fromEnv: "STRIPE_SECRET" }]` on a builtin container (`value`/`fromEnv` exclusive; both → build error), or `${env.NAME}` inside a helm `chart.values` (a VALUE at any depth, never a key). A name the workspace does not define FAILS the deploy rather than resolving blank.
|
|
55
|
-
- `registryAuth.dockerconfigjson` has NO such form: either leave it unset and pull a public image, or treat the bundle and any tree pulled from it as secret material — out of git, or rotate after. Export prints a notice per microservice carrying a literal; `--strict` does not
|
|
76
|
+
- `registryAuth.dockerconfigjson` has NO such form: either leave it unset and pull a public image, or treat the bundle and any tree pulled from it as secret material — out of git, or rotate after. Export prints a notice per microservice carrying a literal; `--strict` does not fail on it.
|
|
56
77
|
- `s.microservice.request({ host, path, port?, method?, params?, headers?, timeout?, follow_location?, as? })` — in-cluster microservice call (`mvp:microservice_request`); no TLS fields.
|
|
57
78
|
- ONLY `host`+`path` required; the rest default to the engine's values (`GET`/`{}`/`[]`/`10`/`true`), always emitted.
|
|
58
79
|
- Pass the `microservice()` DEF as `host` — it binds by NAME (how the engine resolves it), so a rename fixes every call site and the port is checked before deploy.
|
|
59
80
|
- `port?` folds into `host` as `"name:port"`: a def exposing ONE `servicePort` resolves automatically, SEVERAL requires it.
|
|
60
81
|
- A raw `"name:port"` string works, unvalidated, and is the only way to reach an instance-level microservice.
|
|
61
82
|
- `tenantDeploy: "manual"` on the def imports the row without starting the workload.
|
|
62
|
-
- `s.workflow_test.call({ workflowTest, datasource?, as? })` — run another workflow test from inside one, which is the only place it runs (see Gotchas in `llms.txt`).
|
|
83
|
+
- `s.workflow_test.call({ workflowTest, datasource?, as? })` — run another workflow test from inside one, which is the only place it runs (see Gotchas in `llms.txt`). NO `input`; `datasource?` has the kind's clone caveat.
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> Read for the field signature of a specific statement — every surface, grouped by `s.*` namespace.
|
|
4
4
|
|
|
5
|
+
`[special]`: hand-written signature (`llms.txt` Specials, `llms/statements-*`). `[output]`: the engine's output flag; in-place mutators carrying it (`s.math.add`, `bitwise.*`) still take no `as`.
|
|
6
|
+
|
|
5
7
|
### (top-level)
|
|
6
8
|
|
|
7
|
-
`s.throw` raises a named error `s.try_catch` catches; uncaught, it answers HTTP 200 `{ payload, statement: "Throw Error" }
|
|
9
|
+
`s.throw` raises a named error `s.try_catch` catches; uncaught, it answers HTTP 200 `{ payload, statement: "Throw Error" }`, or its `status` (100–599) when it sets one. Inside `s.db.transaction` a throw or failed precondition rolls it back.
|
|
8
10
|
|
|
9
11
|
- `s.await({ as?: string; ids?: value; timeout?: value; terminate?: value })`
|
|
10
12
|
- `s.foreach_break` [special]
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
- `s.precondition({ expr: comparison; error_type?: "standard" | "notfound" | "toomanyrequests" | "accessdenied" | "unauthorized" | "badrequest" | "inputerror"; error?: value; payload?: value })`
|
|
20
22
|
- `s.return` [special]
|
|
21
23
|
- `s.switch` [special]
|
|
22
|
-
- `s.throw({ name?: string; value: value })`
|
|
24
|
+
- `s.throw({ name?: string; value: value; status?: number })`
|
|
23
25
|
- `s.try_catch` [special]
|
|
24
26
|
- `s.update_var` [special]
|
|
25
27
|
- `s.set_var` [special]
|
|
@@ -49,6 +51,8 @@
|
|
|
49
51
|
|
|
50
52
|
### array
|
|
51
53
|
|
|
54
|
+
`by` is a `$this` expression, NOT a column name: `by: ref("$this.id")` (warns `stack.array-key-constant`). A predicate's `if` binds `$this` only; `$index` only in `partition` (warns `stack.array-index-unbound`).
|
|
55
|
+
|
|
52
56
|
- `s.array.difference({ as?: string; expr: value; value: value; by?: value })`
|
|
53
57
|
- `s.array.every({ expr: value; as?: string; if: comparison })` [output] → as: boolean
|
|
54
58
|
- `s.array.filter_count({ expr: value; as?: string; if: comparison })`
|
|
@@ -133,14 +137,14 @@
|
|
|
133
137
|
|
|
134
138
|
### debug
|
|
135
139
|
|
|
136
|
-
`s.debug.stop` is a REAL terminator
|
|
140
|
+
`s.debug.stop` is a REAL terminator: it ends the request with HTTP 200 `{ payload, statement: "Stop & Debug" }` (use `s.precondition` for an error status). Also exported flat as `die()`; there is no `s.die`.
|
|
137
141
|
|
|
138
142
|
- `s.debug.log({ value: value })`
|
|
139
143
|
- `s.debug.stop({ value: value })`
|
|
140
144
|
|
|
141
145
|
### expect
|
|
142
146
|
|
|
143
|
-
Assertions.
|
|
147
|
+
Assertions. Use only in a `workflowTest({...})` stack, asserting on what a `.call` bound with `as`; elsewhere a failure aborts the request with HTTP 500 and the assertion's message (`to_equal failed - expected value 2 does not equal 1`). `to_throw` sees only an error carrying a MESSAGE, so an empty-message failure (`ERROR_CODE_ACCESS_DENIED`) reports "response is ok", and `to_be_within` EXCLUDES both bounds — `min < expr < max`.
|
|
144
148
|
|
|
145
149
|
- `s.expect.to_be_defined({ expr: value })`
|
|
146
150
|
- `s.expect.to_be_empty({ expr: value })`
|
|
@@ -169,10 +173,10 @@ Assertions. **Put them in a `workflowTest({...})` stack** — assert on what a `
|
|
|
169
173
|
|
|
170
174
|
### math
|
|
171
175
|
|
|
172
|
-
- `s.math.add({ name: string; value: value })` [output]
|
|
173
|
-
- `s.math.bitwise.and({ name: string; value: value })` [output]
|
|
174
|
-
- `s.math.bitwise.or({ name: string; value: value })` [output]
|
|
175
|
-
- `s.math.bitwise.xor({ name: string; value: value })` [output]
|
|
176
|
+
- `s.math.add({ name: string; value: value })` [output]
|
|
177
|
+
- `s.math.bitwise.and({ name: string; value: value })` [output]
|
|
178
|
+
- `s.math.bitwise.or({ name: string; value: value })` [output]
|
|
179
|
+
- `s.math.bitwise.xor({ name: string; value: value })` [output]
|
|
176
180
|
- `s.math.div({ name: string; value: value })`
|
|
177
181
|
- `s.math.mod({ name: string; value: value })`
|
|
178
182
|
- `s.math.mul({ name: string; value: value })`
|
|
@@ -196,14 +200,15 @@ Assertions. **Put them in a `workflowTest({...})` stack** — assert on what a `
|
|
|
196
200
|
|
|
197
201
|
### object
|
|
198
202
|
|
|
199
|
-
- `s.object.entries({ as?: string; value: value })` [output] → as:
|
|
200
|
-
- `s.object.keys({ as?: string; value: value })` [output] → as: string[]
|
|
203
|
+
- `s.object.entries({ as?: string; value: value })` [output] → as: { key: string | number; value: unknown }[] (each entry is a { key, value } OBJECT, NOT a [key, value] tuple; an integer-like key comes back as a number)
|
|
204
|
+
- `s.object.keys({ as?: string; value: value })` [output] → as: (string | number)[] (an integer-like key comes back as a NUMBER (PHP coerces it), not a string)
|
|
201
205
|
- `s.object.values({ as?: string; value: value })` [output] → as: unknown[]
|
|
202
206
|
|
|
203
207
|
### realtime
|
|
204
208
|
|
|
205
209
|
- `s.realtime.get_session({ as?: string })`
|
|
206
210
|
- `s.realtime.publish` [special]
|
|
211
|
+
- `s.realtime.kick` [special]
|
|
207
212
|
|
|
208
213
|
### redis
|
|
209
214
|
|
|
@@ -225,25 +230,25 @@ Assertions. **Put them in a `workflowTest({...})` stack** — assert on what a `
|
|
|
225
230
|
|
|
226
231
|
### security
|
|
227
232
|
|
|
228
|
-
- `s.security.check_password({ as?: string; text_password: value; hash_password: value })` [output] → as: boolean (true when the plaintext matches the stored hash. ⚠ input.password
|
|
233
|
+
- `s.security.check_password({ as?: string; text_password: value; hash_password: value })` [output] → as: boolean (true when the plaintext matches the stored hash. ⚠ not input.password — pass input.text() plaintext. ⚠ THROWS 500 on a non-hash hash_password (Invalid password syntax.))
|
|
229
234
|
- `s.security.create_auth_token` [special]
|
|
230
235
|
- `s.security.create_curve_key({ as?: string; curve?: "P-256" | "P-384" | "P-521"; format?: "object" | "base64" })`
|
|
231
236
|
- `s.security.create_password({ as?: string; character_count?: value; require_lowercase?: value; require_uppercase?: value; require_digit?: value; require_symbol?: value; symbol_whitelist?: value })`
|
|
232
237
|
- `s.security.create_rsa_key({ as?: string; bits?: value; format?: "object" | "base64" })`
|
|
233
238
|
- `s.security.create_secret_key({ as?: string; bits?: value; format?: "object" | "base64" })`
|
|
234
239
|
- `s.security.create_uuid({ as?: string })`
|
|
235
|
-
- `s.security.decrypt({ as?: string; data: value; algorithm?: "aes-128-cbc" | "aes-192-cbc" | "aes-256-cbc" | "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; key: value; iv: value })`
|
|
240
|
+
- `s.security.decrypt({ as?: string; data: value; algorithm?: "aes-128-cbc" | "aes-192-cbc" | "aes-256-cbc" | "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; key: value; iv: value })` → as: unknown (the plaintext; takes encrypt's RAW bytes (fl.base64_decode() a stored base64 first). ⚠ THROWS 500 on a wrong key/iv or non-ciphertext — wrap in s.try_catch)
|
|
236
241
|
- `s.security.encrypt({ as?: string; data: value; algorithm?: "aes-128-cbc" | "aes-192-cbc" | "aes-256-cbc" | "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; key: value; iv: value })`
|
|
237
|
-
- `s.security.jwe_decode({ as?: string; token: value; key: value; check_claims?: value; key_algorithm?: "A128KW" | "A192KW" | "A256KW" | "A128GCMKW" | "A192GCMKW" | "A256GCMKW" | "ECDH-ES+A128KW" | "ECDH-ES+A192KW" | "ECDH-ES+A256KW"; content_algorithm?: "A128GCM" | "A192GCM" | "A256GCM" | "A128CBC-HS256" | "A192CBC-HS384" | "A256CBC-HS512"; timeDrift?: value })`
|
|
242
|
+
- `s.security.jwe_decode({ as?: string; token: value; key: value; check_claims?: value; key_algorithm?: "A128KW" | "A192KW" | "A256KW" | "A128GCMKW" | "A192GCMKW" | "A256GCMKW" | "ECDH-ES+A128KW" | "ECDH-ES+A192KW" | "ECDH-ES+A256KW"; content_algorithm?: "A128GCM" | "A192GCM" | "A256GCM" | "A128CBC-HS256" | "A192CBC-HS384" | "A256CBC-HS512"; timeDrift?: value })` → as: unknown (the decoded claims. ⚠ THROWS 500 ERROR_FATAL on ANY failure (bad/expired token, wrong key/algorithm, failed check_claims) — wrap in s.try_catch for a 401 (statements-calls.md))
|
|
238
243
|
- `s.security.jwe_encode({ as?: string; headers?: value; claims?: value; key: value; key_algorithm?: "A128KW" | "A192KW" | "A256KW" | "A128GCMKW" | "A192GCMKW" | "A256GCMKW" | "ECDH-ES+A128KW" | "ECDH-ES+A192KW" | "ECDH-ES+A256KW"; content_algorithm?: "A128GCM" | "A192GCM" | "A256GCM" | "A128CBC-HS256" | "A192CBC-HS384" | "A256CBC-HS512"; ttl?: value })`
|
|
239
|
-
- `s.security.jws_decode({ as?: string; token: value; key: value; check_claims?: value; signature_algorithm?: "PS256" | "PS384" | "PS512" | "RS256" | "RS384" | "RS512" | "HS256" | "HS384" | "HS512" | "ES256" | "ES384" | "ES512"; timeDrift?: value })`
|
|
244
|
+
- `s.security.jws_decode({ as?: string; token: value; key: value; check_claims?: value; signature_algorithm?: "PS256" | "PS384" | "PS512" | "RS256" | "RS384" | "RS512" | "HS256" | "HS384" | "HS512" | "ES256" | "ES384" | "ES512"; timeDrift?: value })` → as: unknown (the decoded claims. ⚠ THROWS 500 ERROR_FATAL on ANY failure (bad/garbage/expired/tampered token, wrong key/signature_algorithm, failed check_claims) — wrap in s.try_catch for a 401 (statements-calls.md))
|
|
240
245
|
- `s.security.jws_encode({ as?: string; headers?: value; claims?: value; key: value; signature_algorithm?: "PS256" | "PS384" | "PS512" | "RS256" | "RS384" | "RS512" | "HS256" | "HS384" | "HS512" | "ES256" | "ES384" | "ES512"; ttl?: value })`
|
|
241
|
-
- `s.security.random_bytes({ as?: string; length?: value })`
|
|
246
|
+
- `s.security.random_bytes({ as?: string; length?: value })` → as: string (RAW bytes (encrypt too) — fl.bin2hex()/fl.base64_encode() before returning or storing; raw binary mangles in a JSON/text response)
|
|
242
247
|
- `s.security.random_number({ as?: string; min?: value; max?: value })`
|
|
243
248
|
|
|
244
249
|
### storage
|
|
245
250
|
|
|
246
|
-
- `s.storage.create_attachment({ as?: string; value: value; access?: "public" | "private" = "public"; filename?: value; include_meta?: boolean; type?: value })`
|
|
251
|
+
- `s.storage.create_attachment({ as?: string; value: value; access?: "public" | "private" = "public"; filename?: value; include_meta?: boolean; type?: value })` → as: XanoFileRef (the stored file VALUE ({ access, path, name, type, size, mime, meta }) — write it into an f.attachment() cell. ⚠ include_meta: true binds the file's internal RECORD instead (id, guid, sig, the storage BUCKET name): never store it as the file value or return it (warns storage.include-meta-returned). type (also optional) coerces the kind when it is image/video/audio)
|
|
247
252
|
- `s.storage.create_audio({ as?: string; value: value; access?: "public" | "private" = "public"; filename?: value })` [output]
|
|
248
253
|
- `s.storage.create_file_resource({ as?: string; filename: value; filedata: value })` [output]
|
|
249
254
|
- `s.storage.create_image({ as?: string; value: value; access?: "public" | "private" = "public"; filename?: value })` [output]
|
|
@@ -264,16 +269,18 @@ Assertions. **Put them in a `workflowTest({...})` stack** — assert on what a `
|
|
|
264
269
|
|
|
265
270
|
### text
|
|
266
271
|
|
|
272
|
+
`name` is an EXISTING variable the statement acts on. `trim`/`ltrim`/`rtrim`/`append`/`prepend` rewrite it IN PLACE and take no `as` (a non-text var is coerced, a null reads as `""`); on the trims `value` is a SET OF CHARACTERS to strip, not a substring (`"abcHIcba"` trimmed by `"abc"` → `"HI"`). The predicates (`contains`/`icontains`/`starts_with`/`istarts_with`/`ends_with`/`iends_with`) leave `name` unchanged and bind a boolean to `as` — without `as` they compute nothing (warns `stack.predicate-unbound`); an empty or omitted needle is `true`. An undeclared `name` 500s `Missing var entry`.
|
|
273
|
+
|
|
267
274
|
- `s.text.append({ name: string; value: value })`
|
|
268
|
-
- `s.text.contains({ name: string; as?: string; value: value })`
|
|
269
|
-
- `s.text.ends_with({ name: string; as?: string; value: value })`
|
|
270
|
-
- `s.text.icontains({ name: string; as?: string; value: value })`
|
|
271
|
-
- `s.text.iends_with({ name: string; as?: string; value: value })`
|
|
272
|
-
- `s.text.istarts_with({ name: string; as?: string; value: value })`
|
|
275
|
+
- `s.text.contains({ name: string; as?: string; value: value })` → as: boolean
|
|
276
|
+
- `s.text.ends_with({ name: string; as?: string; value: value })` → as: boolean
|
|
277
|
+
- `s.text.icontains({ name: string; as?: string; value: value })` → as: boolean
|
|
278
|
+
- `s.text.iends_with({ name: string; as?: string; value: value })` → as: boolean
|
|
279
|
+
- `s.text.istarts_with({ name: string; as?: string; value: value })` → as: boolean
|
|
273
280
|
- `s.text.ltrim({ name: string; value: value })`
|
|
274
281
|
- `s.text.prepend({ name: string; value: value })`
|
|
275
282
|
- `s.text.rtrim({ name: string; value: value })`
|
|
276
|
-
- `s.text.starts_with({ name: string; as?: string; value: value })`
|
|
283
|
+
- `s.text.starts_with({ name: string; as?: string; value: value })` → as: boolean
|
|
277
284
|
- `s.text.trim({ name: string; value: value })`
|
|
278
285
|
|
|
279
286
|
### tool
|
|
@@ -286,11 +293,11 @@ Assertions. **Put them in a `workflowTest({...})` stack** — assert on what a `
|
|
|
286
293
|
|
|
287
294
|
### util
|
|
288
295
|
|
|
289
|
-
`s.util.sleep`'s `value` is in SECONDS; a decimal is allowed (`c.decimal(0.5)` = 500 ms).
|
|
296
|
+
`s.util.sleep`'s `value` is in SECONDS; a decimal is allowed (`c.decimal(0.5)` = 500 ms); a negative value returns at once. `s.util.set_header`'s `value` is a WHOLE `"Name: value"` line (there is no `name` field) — `c.text("X-Thing: on")`; a line with no colon sends an empty header, and a `Content-Type` line is IGNORED when the response is an object/JSON (it applies to a `c.text()` response). `s.util.template_engine`'s `value` is a Twig template with `$var`/`$input` in scope (`"Hello {{ $var.who }}"`); output is NOT HTML-escaped, a missing var renders `""`, and a syntax error 500s.
|
|
290
297
|
|
|
291
298
|
- `s.util.geo_distance({ as?: string; latitude_1: value; longitude_1: value; latitude_2: value; longitude_2: value })` → as: number (great-circle distance in METRES (a decimal) — divide by 1000 for km. Identical points return 0)
|
|
292
|
-
- `s.util.get_all_input({ as?: string })` → as: unknown (inside an ATTACHED middleware it is a { type, vars } envelope whose vars DIFFERS BY PHASE: pre → the request inputs; post → { status, result }
|
|
293
|
-
- `s.util.get_env({ as?: string })`
|
|
299
|
+
- `s.util.get_all_input({ as?: string })` → as: unknown (inside an ATTACHED middleware it is a { type, vars } envelope whose vars DIFFERS BY PHASE: pre → the request inputs; post → { status, result }, NOT the request — read the request in post with s.util.get_raw_input. ⚠ status is the STRING "ok" | "exception" (NOT an HTTP code), so store it in a text column, not f.int(); on "exception", result is the { code, message, payload } error and payload is set. See llms/kinds-core.md)
|
|
300
|
+
- `s.util.get_env({ as?: string })` → as: Record<string, string> (every workspace env var (declared AND dashboard) as one { NAME: value } object, each value TEXT — so this binds every SECRET; never return it to a client or write it to a row)
|
|
294
301
|
- `s.util.get_input` [special]
|
|
295
302
|
- `s.util.get_raw_input` [special]
|
|
296
303
|
- `s.util.get_vars({ as?: string })`
|
package/llms/statements-data.md
CHANGED
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
Array blocks (an `if`/`transform` is applied per item):
|
|
6
6
|
|
|
7
7
|
- `s.array.map({ source, as?, transform? })` — `transform` is either a per-item `Value` expression (each item maps to that value) or a **record of values** (each item maps to an object with those keys), or a list of `{ key, value }` pairs, for a key computed per item or two rows sharing one. Use `ref("$this")` for the item and `ref("$index")` for its position. A `transform` value, filter arguments included, can read `ref("$this.<path>")` and any outer stack variable or input. These are THIS statement's own bindings, in a value expression — not the JavaScript lambda contract (see **Lambda bodies**), which binds a different set per surface and is written with `lam.fn`.
|
|
8
|
-
- `s.array.union({ source, with, as?, transform? })` — set-union two arrays. `with` is REQUIRED; omitted → `Unable to locate input: `.
|
|
8
|
+
- `s.array.union({ source, with, as?, transform? })` — set-union two arrays. `with` is REQUIRED; omitted → `Unable to locate input: `. `transform` is a per-item DEDUPE KEY over `$this`, not a map: the result keeps the original items, first occurrence wins (`transform: ref("$this.id")` unions records by `id`).
|
|
9
|
+
- **Array predicates** (`s.array.filter`/`filter_count`/`find`/`find_index`/`has`/`every`/`partition`) share one shape: `{ expr, if, as }`. The `if` comparison reads the current item as `ref("$this")` (or `ref("$this.<path>")`) and resolves any outer var/input; `$index` is bound ONLY inside `partition`, not the others. Results: `filter` → the matching list; `filter_count` → an int; `find` → the item or `null` on a miss; `find_index` → the index or `-1` on a miss (on an OBJECT source it returns the matching KEY, e.g. `"x"`); `has` → a bool; `every` → a bool, `true` on `[]`; `partition` → `{ "true": [...], "false": [...] }` (STRING keys). ⚠ An OBJECT source iterates its VALUES (keys dropped from `filter`'s result), and a null, omitted or scalar source behaves like `[]`. The predicate uses the engine's LOOSE comparison, so `"abc" > 3` and `"1" = 1` are both true.
|
|
10
|
+
- **Set ops** `s.array.difference`/`intersection` take `{ expr, value, by?, as }` (`s.array.union`'s shape is the bullet above). All three compare STRICTLY (`"3"` ≠ `3`), unlike the predicates — and they DEDUPE the source: `[1,1,2,"3"]` − `[3]` → `[1,2,"3"]`, `[1,2,2,3]` ∪ `[3,4]` → `[1,2,3,4]`. Without `by`, records compare whole; `by` is a `$this` expression (`by: ref("$this.id")`), not a column name.
|
|
11
|
+
- `s.array.group_by({ expr, by?, as })` binds an OBJECT keyed by each item's `by` value (a missing key read with `{ safe: true }` groups under `""`). ⚠ WITHOUT `by` on a list of records it 500s (`Cannot access offset of type array on array`) — always pass `by` for records.
|
|
12
|
+
- **In-place array mutators** `s.array.push`/`unshift`/`merge`/`pop`/`shift` take `{ name, value? }` and REWRITE the var named `name` (no `as`); `name` may be a dotted path (`"o.items"`). `pop`/`shift` on `[]` bind `null`. ⚠ `push` of a LIST appends it as ONE element (`[…, [9,9]]`) where `merge` SPREADS it in; `push` onto a scalar var throws, and onto an object var it adds numeric keys.
|
|
13
|
+
- `s.object.keys`/`values`/`entries({ value, as })` on `{}`, null, an omitted var or a string all bind `[]`; on a LIST they treat the indexes as keys. `entries` yields `{ key, value }` OBJECTS (not `[key, value]` tuples), and an integer-like key comes back as a NUMBER (PHP coerces it), for all three.
|
|
9
14
|
|
|
10
15
|
DB reads/writes (`table` is a def handle or name; `fieldName` defaults to the
|
|
11
16
|
primary key `id`):
|
|
@@ -15,54 +20,59 @@ primary key `id`):
|
|
|
15
20
|
- `s.db.del({ table, fieldName?, fieldValue, as? })` — delete by field match.
|
|
16
21
|
- `s.db.add({ table, row?, data?, output?, as? })` — insert; `row` is a partial keyed by column.
|
|
17
22
|
- A row CELL takes a tagged `Value`, a nested object of sub-keys, or a bare JS literal typed against that column: `row: { is_hidden: true, notes: "…" }` encodes exactly as `{ is_hidden: c.bool(true), notes: c.text("…") }`. The tag comes from the COLUMN, not the literal — `10` on an `f.decimal()` column is `const:decimal`, not `const:int` — so a literal contradicting its column is a compile error on a `f.*`-schema table (`{ is_hidden: "yes" }` on an `f.bool()` column) and throws at encode on a raw-`ColumnDef[]` one. An `f.enum()` column keeps its member union. A column with no literal form — obj/json/list/geo/vector/file — still needs `c.obj`/`c.array`.
|
|
18
|
-
- `null` is accepted on EVERY column
|
|
19
|
-
- Omitting a key on `add` writes the column's type default — declared `default` if set, `[]` for a list, `{}` for obj/json, else `null
|
|
23
|
+
- `null` is accepted on EVERY column at encode and encodes `const:null`; a column's `nullable` is not consulted there. ⚠ The engine does not refuse it either: on a NON-NULLABLE column an explicit `null` is the SAME as omitting the key — it stores the column's `default`, else the type's zero value (`""`/`0`/`false`/…). Only a `nullable: true` column STORES null.
|
|
24
|
+
- Omitting a key on `add` writes the column's type default — declared `default` if set, `[]` for a list, `{}` for obj/json, else `null`, which is EMITTED, not what the row holds: a `nullable` column keeps `null`, a non-nullable one lands on its type's zero value (`""`, `0`, `false`). ⚠ Except `f.date`: it stores TODAY's date, absent from `add`'s `as` — make an optional date `nullable: true`. On `edit` an omitted key keeps its stored value.
|
|
20
25
|
- An `f.password()` cell takes the PLAINTEXT — the column hashes on write, so a pre-hashed value, or a hashing filter on the cell, stores a hash of a hash that `security.check_password` can never match.
|
|
21
|
-
- A `table({ seed })` cell hashes the same way: the import writes the plaintext through the column's own rules, so a seeded credential matches under `security.check_password` exactly as an added one does.
|
|
26
|
+
- A `table({ seed })` cell hashes the same way: the import writes the plaintext through the column's own rules, so a seeded credential matches under `security.check_password` exactly as an added one does. Seeded credentials work as fixtures; their plaintext is committed to the repo.
|
|
22
27
|
- `s.db.edit({ table, fieldName?, fieldValue, row?, data?, output?, as? })` — update by field match.
|
|
23
|
-
- `s.db.patch({ table, fieldName?, fieldValue, data, output?, as? })` — merge a partial. ⚠ Unlike `db.edit`'s `row`, `data` is a single object `Value` — write `obj({ unread: c.int(0) })`, not the column-keyed record `row` takes.
|
|
24
|
-
|
|
28
|
+
- `s.db.patch({ table, fieldName?, fieldValue, data, output?, as? })` — merge a partial. ⚠ Unlike `db.edit`'s `row`, `data` is a single object `Value` — write `obj({ unread: c.int(0) })`, not the column-keyed record `row` takes. ⚠ A json/object column value is DEEP-merged key by key, not replaced: patching `{ meta: { k: 1 } }` onto `meta = { origin: "WA" }` stores `{ origin: "WA", k: 1 }`, so a patch can NEVER drop a key from a json column — use `db.edit` with `row: { meta: … }` to replace one wholesale.
|
|
29
|
+
- `output` on `db.get`/`add`/`edit`/`patch` restricts the columns of the RETURNED row only — on a write it does not change
|
|
25
30
|
what is written. Not offered on `db.del`/`db.has` (their result is a scalar) or on
|
|
26
31
|
`db.add_or_edit` (no output envelope).
|
|
27
32
|
- `s.db.add_or_edit({ table, fieldName?, fieldValue, row?, data?, as? })` — upsert.
|
|
28
33
|
- `s.db.query({ table, where?, additionalWhere?, bind?, sort?, paging?, external?, returnType?, distinct?, eval?, output?, lock?, addon?, as? })` — search.
|
|
29
|
-
- `where` / `additionalWhere` — `expr(...)
|
|
30
|
-
- ⚠ `ignoreEmpty` DROPS the predicate when the operand is empty (not zero rows).
|
|
34
|
+
- `where` / `additionalWhere` — `expr(...)` or an `expr[]` (ANDed); never a value. Rides `context.search`.
|
|
35
|
+
- ⚠ `ignoreEmpty` DROPS the predicate when the operand is empty (not zero rows). "Empty" is PHP `empty()` — `null`, `""`, `"0"`, `0`, `false`, `[]`:
|
|
36
|
+
- `0`/`false` also drop it: an optional numeric/bool filter can't match zero or false (`max_price=0` returns the whole table), and an omitted `input.int()`/`input.bool()` binds `0`/`false`. Use `ignoreEmpty` only for an optional TEXT/LIST filter; for a number/bool use a `nullable: true` input + `s.conditional` on `!= null`.
|
|
37
|
+
- On `in` an empty list returns the UNFILTERED set, so never scope to permitted ids with it (a `bulk.delete` only it scopes throws).
|
|
38
|
+
- `not in` an empty list is the mirror trap, matching NO rows, so an exclusion filter returns nothing when nothing is excluded — guard both empty cases.
|
|
31
39
|
- For the full operator set use `cmp(left, op, right, { ignoreEmpty? })` — `op`: `in`/`not in`/`like`/`ilike`/`between`/`contains`/`includes`/`overlaps`/`@>`/`~`/`search`/… plus the `expr` comparisons. Database-only — a runtime condition takes the `expr` set only.
|
|
32
|
-
- ⚠ `like`/`ilike` take the operand as the PATTERN, verbatim: a bare term matches only an exact whole-string equal, and the endpoint answers HTTP 200 with zero rows
|
|
40
|
+
- ⚠ `like`/`ilike` take the operand as the PATTERN, verbatim: a bare term matches only an exact whole-string equal, and the endpoint answers HTTP 200 with zero rows, no error. For substring matching use `includes`/`not includes`, which wrap the operand in `%…%` themselves and match case-INSENSITIVELY. Prefer them over a hand-built `"%" + term + "%"`, which is non-empty even for an empty term and so defeats `ignoreEmpty`; `includes` composes with it. `contains`/`@>`/`overlaps` are JSON/array containment, not text — on a text column they 400 `ParseError: Invalid value for param`.
|
|
41
|
+
- **Filter a LIST column** (`f.text({ array: true })`) to rows that hold a value — the "posts tagged X" query — with `contains`/`overlaps` and a LIST on the right. ⚠ A SCALAR on the right 400s `Invalid value for param` every request, whether a literal (`c.text("x")`) or a scalar-typed `inp("tag")`/`ref()` (`export()` warns `db.filter-operand-invalid`) — wrap the single value in a list first. For an OPTIONAL value add `fl.filter_empty_text` so an omitted one matches nothing (not `[""]`, which `array_push` would leave): `s.set_var("tag_list", withFilters(c.array([]), fl.array_push(inp("tag")), fl.filter_empty_text()))` then `cmp(col("tags"), "contains", ref("tag_list"), { ignoreEmpty: true })`. (`in` cannot take the list column on the RIGHT — one side must be a scalar.)
|
|
33
42
|
- Compose nested boolean logic with `and(...)` / `or(...)` groups (also available on `addon()` `where`).
|
|
34
43
|
- An operand may be a bare value (`col`/`inp`/`ref`/`auth`/`c.*`) OR a **filtered** value (`withFilters(...)`) inline — the engine compiles the string and arithmetic filters (`trim`, `concat`, `upper`, `lower`, …) into the SQL.
|
|
35
44
|
- ⚠ The REQUEST-TIME timestamp filters have no SQL form and kill the request with a bare fatal naming nothing: `epochms_transform`, `epochms_add_ms`, `epochms_add_secs`, `epochms_date`, `epochms_from_format`. For a relative cutoff use the SQL-side family instead (`qf.epochms_add_day(7)`, `qf.epochms_sub_month(1)`, `qf.epochms_year("UTC")`, …) — or compute it in an earlier `s.set_var` and `ref()` that. `export --strict` reports it; a bare `c.now()` operand is always fine.
|
|
36
45
|
- `bind: [{ table, as?, join?, where? }]` — joins (`context.bind[]`). `join` defaults to `"inner"`. `as` defaults to the table name; two joins to the same table need distinct aliases.
|
|
37
|
-
- ⚠ In `where`/`sort`/`eval` a JOINED column takes a dotted path (`col("team_row.id")`); THIS query's own columns stay **bare** (`col("team")`). Qualifying your own by table name needs `tableAlias` (same rule as `aggregate`)
|
|
46
|
+
- ⚠ In `where`/`sort`/`eval` a JOINED column takes a dotted path (`col("team_row.id")`); THIS query's own columns stay **bare** (`col("team")`). Qualifying your own by table name needs `tableAlias` (same rule as `aggregate`); without it the engine 400s `ParseError: Invalid value for param` naming the OTHER operand, so export throws.
|
|
38
47
|
- `bind: [{ table: team, as: "team_row", join: "left", where: expr(col("team"), "=", col("team_row.id")) }]`
|
|
39
48
|
- `bind: [{ expand: "blog.categories", as: "cat" }]` joins one row per element of a LIST column already in the query; read it as `col("cat.<key>")`.
|
|
40
49
|
- ⚠ A join does NOT put the joined table's columns on the returned row — with or without a `bind`, a row is the QUERIED table's columns, which is what `InferResponse` types. There is no `row.team_row`. To read a joined column, PROJECT it with an `eval` whose `name` is the dotted path: `eval: [{ name: "team_row.name", as: "team_name" }]` puts `team_name` on the row and on the inferred type. A bare `name` there is `Unsupported parameter reference` at runtime (it qualifies to the base table), and a dotted joined column in `output` is dropped with no error.
|
|
41
|
-
- `returnType` — `"list"` (default) | `"single"` | `"count"` | `"exists"` | `"stream"` | `"aggregate"`. Drives `context.return.type` AND the `InferResponse` shape: `count`→`number`, `exists`→`boolean`, `single`→`Row|null`, `stream
|
|
42
|
-
- `eval: [{ name, as, filters? }]` — computed columns (`context.eval[]`). Each `as` grafts onto the row as
|
|
43
|
-
- An `eval`/`sort`/`where` filter pipeline compiles to **SQL**: `trim`/`lower`/`concat` work there too, plus a DIFFERENT registry than `fl.*`: the vector family, geo `distance`/`within`/`covers`, `search_rank`, the timestamp family, the aggregators. Build these with **`qf.*`** — `filters: [qf.vector_cos_distance(inp("q"))]` — which emits the same `{ name, arg }` step with the name, the argument COUNT and any enumerated argument checked at the call site. `qf` carries what the engine registers
|
|
44
|
-
- **Vector similarity search** — the ONLY way to query an `f.vector` column (no `SearchOp` does distance). `eval: [{ name: "embedding", as: "distance", filters: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
50
|
+
- `returnType` — `"list"` (default) | `"single"` | `"count"` | `"exists"` | `"stream"` | `"aggregate"`. Drives `context.return.type` AND the `InferResponse` shape: `count`→`number`, `exists`→`boolean`, `single`→`Row|null`, `stream`→ a cursor only `s.foreach` reads (returned, it serves `"@stream"`; warns `db.stream-returned`), `list`→`Row[]`/envelope, `aggregate`→rows keyed by the `aggregate.group`/`eval` aliases. ⚠ A bare `count` of ZERO has no reliable shape: it answers `0` or an EMPTY body (a client JSON parse error). Wrap it: `response: { count: ref("n") }`.
|
|
51
|
+
- `eval: [{ name, as, filters? }]` — computed columns (`context.eval[]`). Each `as` grafts onto the row in `InferResponse` as `unknown`, or as the joined column for an unfiltered `<bind as>.<col>` (`| null` under `left`); shadowing a real column throws. ⚠ `output` is applied to the eval columns too: with a non-empty `output`, LIST the alias there (`output: ["id", "<alias>"]`) or the engine drops it from the result (`export()` warns `db.eval-unselected`; an ADDON alias survives an omitting `output`, an eval alias does not). Write `name` **bare** (`"embedding"`) — it is alias-qualified on emit exactly like `aggregate` (a bare eval name is `Unsupported param format` at runtime), and the statement declares the alias it used. An `as` alias is `sort`able in the SAME query. ⚠ An eval over a LIST column (`f.text({ array: true })`) is PER-ELEMENT (the engine unnests the column), so its `filters` must START with an AGGREGATE (`qf.count()` for the element count, `qf.to_list()`, …): a non-aggregate first filter like `qf.array_length()` 500s `Aggregate filter must be processed first` at request time, with no export warning.
|
|
52
|
+
- An `eval`/`sort`/`where` filter pipeline compiles to **SQL**: `trim`/`lower`/`concat` work there too, plus a DIFFERENT registry than `fl.*`: the vector family, geo `distance`/`within`/`covers`, `search_rank`, the timestamp family, the aggregators. Build these with **`qf.*`** — `filters: [qf.vector_cos_distance(inp("q"))]` — which emits the same `{ name, arg }` step with the name, the argument COUNT and any enumerated argument checked at the call site. `qf` carries what the engine registers: the per-part extractors take a timezone (`qf.epochms_month("UTC")`), `qf.round`'s precision is required, `qf.time`'s part is an enum. `QUERY_FILTER_NAMES`/`QUERY_AGGREGATE_NAMES` list the set; the raw `{ name, arg }` form still works for anything `qf` does not carry (`vector_distance`, which has no registered engine class).
|
|
53
|
+
- **Vector similarity search** — the ONLY way to query an `f.vector` column (no `SearchOp` does distance). `eval: [{ name: "embedding", as: "distance", filters: [qf.vector_cos_distance(inp("q"))] }]` + `sort: [{ sortBy: "distance", dir: "asc" }]` ranks in the DATABASE over the column's index. Match the filter to the index `op` (`vector_cos_distance`↔`vector_cosine_ops`, `vector_l2_distance`↔`vector_l2_ops`, `vector_l1_distance`↔`vector_l1_ops`, `vector_inner_product`↔`vector_ip_ops`); `vector_cos_similarity` is the inverse, so sort it `desc`. The same filter on a `where` operand cuts off BY distance instead of by row count.
|
|
54
|
+
- **Full-text search** — query a `type: "search"` index by the `name` you gave it, spelled as a column `"$<name>"`: `where: cmp(col("$ft"), "search", inp("q"))`, rank with `eval: [{ name: "$ft", as: "rank", filters: [qf.search_rank(inp("q"))] }]` + `sort: [{ sortBy: "rank", dir: "desc" }]` (the field `priority` weights the rank). ⚠ A `"search"` cmp on a PLAIN column (`col("title")`, no `$`) 500s, and an UNNAMED search index can't be referenced at all (warns `table.search-index-unnamed`).
|
|
55
|
+
- `aggregate: { group?, eval?, sort?, paging? }` (with `returnType:"aggregate"`) builds `context.return.aggregate`. `group`/`eval` are `{ name, as, filters? }`, an aggregator like `sum`/`count` riding `filters`. Some aggregators resolve ONLY here, not in a runtime value pipeline: `count_distinct`, `median`, `to_list`/`to_distinct_list` (each with `_asc`/`_desc`), and `vector_distance`. ⚠ `avg` over a group whose values are ALL null returns `0`, not `null` (an unrated item reads as rated zero); a group with SOME nulls correctly averages only the non-nulls.
|
|
56
|
+
- ⚠ Write each `name` as a **bare** column (`"status"`). It is alias-qualified to `"<alias>.status"` on emit — the engine rejects an unqualified column in an aggregate with `Unsupported param format`. ⚠ A JOINED column cannot be named here (refused at build): project it with a query `eval` (`{ name: "pr.name", as: "pname" }`) and name that alias BARE (`group: [{ name: "pname", as: "pname" }]`).
|
|
57
|
+
- It qualifies with `tableAlias`, else the table's name, and the statement declares that alias (`context.dbo.as`) itself.
|
|
48
58
|
- `sort: [{ sortBy: <col>, dir?: "asc"|"desc"|"rand" }]` and `paging: { page?, per_page?, offset?, totals?, metadata?, search?, sort? }` ride `context.return.list`.
|
|
49
59
|
- ⚠ `paging` with a page/per_page/offset field and `metadata` on (the DEFAULT) wraps the result in an envelope `{ items: Row[], curPage, nextPage, prevPage, offset, perPage, itemsReceived }` — plus `itemsTotal`/`pageTotal` when `totals: true` — instead of a bare `Row[]`. `InferResponse` reflects it. `paging: { metadata: false }` keeps the bare array.
|
|
50
60
|
- ⚠ Under the ENVELOPE, `output` selects from the envelope, not the row: write `output: ["itemsReceived", "curPage", "items.id", "items.title"]`. A bare column list matches no envelope key, so every key is dropped and the response is `[]` at HTTP 200 with no error (and `ref("<var>.items")` then fails on a var that is gone). With `metadata: false` the statement binds the rows, so bare columns are the right form there. `export()` warns on a row-rooted selection under an envelope; `--strict` fails it.
|
|
51
61
|
- Read `nextPage` (`number|null`) as the typed has-next signal.
|
|
52
62
|
- **Input-bound paging:** `page`/`per_page`/`offset` also accept a `Value` (`inp("page")`), riding `context.simpleExternal` while the static block stays the engine gate (`enabled:true`). `paging.search`/`sort` are `Value` dynamic overrides.
|
|
53
63
|
- A `search`/`sort`-only `paging` (no numeric field) does NOT paginate.
|
|
54
|
-
- `external: { value, permissions? }` — the
|
|
64
|
+
- `external: { value, permissions? }` — the whole paging config as one value (forces the gate on). It falls back to input-bound `paging` when it resolves empty, so supplying both is valid.
|
|
55
65
|
- `distinct` — `"auto"` (default) | `"yes"` | `"no"`, riding `context.return.<list|stream>.distinct`.
|
|
56
66
|
- `s.db.truncate({ table, reset?, as? })` · `s.db.schema({ table, path, as? })`.
|
|
57
67
|
- `s.db.direct_query({ sql, responseType?, args?, parser?, as? })` — `sql` is a **raw string** (not a `Value`); binds go in `args: Value[]`. `parser: "template_engine"` renders the body as a template first — how a query interpolates a column or table name a bound arg cannot carry; omit it for the default.
|
|
58
68
|
- Template placeholders are Twig over the request scope: `{{ $input.name }}` for an input, `{{ $var.name }}` for a stack variable. ⚠ A BARE `{{ name }}` renders as the empty string — HTTP 200, no error, a query that silently ran with a blank where the value belonged. A bound `?` arg carries a VALUE without the template at all.
|
|
59
|
-
- ⚠ A table's PHYSICAL name is **not stable across deploys**. A deploy is a full replace
|
|
60
|
-
- `s.db.external.<engine>.direct_query({ sql, connectionString, responseType?, args?, parser?, as? })` — same shape against an EXTERNAL database; `<engine>` is `postgres`/`mysql`/`mssql`/`oracle`/`snowflake`. `connectionString` is a `Value` — reach for `env(...)`, not a literal — stored as `context.connection_string_flex`. A bare string stores
|
|
61
|
-
- `s.db.transaction({ body })` — run a `Statement[]` atomically. It returns nothing, so it takes no `as`: read what the body binds. An `s.return` in the body ends the WHOLE stack with that value, and the writes before it commit.
|
|
69
|
+
- ⚠ A table's PHYSICAL name is **not stable across deploys**. A deploy is a full replace that recreates every table, so the id in its name changes on every deploy. Never store, cache, hardcode or fixture one: resolve it from `information_schema` inside the same request that uses it.
|
|
70
|
+
- `s.db.external.<engine>.direct_query({ sql, connectionString, responseType?, args?, parser?, as? })` — same shape against an EXTERNAL database; `<engine>` is `postgres`/`mysql`/`mssql`/`oracle`/`snowflake`. `connectionString` is a `Value` — reach for `env(...)`, not a literal — stored as `context.connection_string_flex`. A bare string stores `context.connection_string` instead (an env-var name unless it looks like a URL); each form round-trips as itself.
|
|
71
|
+
- `s.db.transaction({ body })` — run a `Statement[]` atomically. It returns nothing, so it takes no `as`: read what the body binds. An `s.return` in the body ends the WHOLE stack with that value, and the writes before it commit. ⚠ Atomic, not exclusive: a check-then-insert DOUBLE-BOOKS under concurrency (`lock: true` on the check locks only rows it returns). First lock a shared PARENT row: `s.db.get({ table: rooms, fieldValue: inp("room_id"), lock: true, as: "room" })`.
|
|
62
72
|
- The body shares the enclosing stack: a variable it binds (`as: "order"` on an `s.db.add`) is still bound AFTER the transaction.
|
|
63
73
|
- `s.db.bulk.add({ table, items, allowIdField?, as? })` / `s.db.bulk.update` / `s.db.bulk.patch` — `items` is an array `Value`.
|
|
64
|
-
- ⚠ `bulk.add` **drops `id` on every row unless `allowIdField: true`** (silently, next sequence value instead) — the opposite of `seed`, where `id` pins. Rows referenced by a foreign key need `allowIdField: true`; literal `items` carrying `id` without it throw. `bulk.update`/`patch` keep `id` (their match key).
|
|
65
|
-
- ⚠ **`bulk.update` is a whole-row REPLACE: every column an item OMITS is zeroed** (`""`/`0`/`null`), HTTP 200, no error — `{ id: 7, status: "done" }` blanks the rest of row 7. **Use `s.db.bulk.patch`** for the partial write "update these rows" means. `export()` warns on a STATIC `items` missing columns (`--strict` fails); a `ref`/`inp` `items` is uninspectable.
|
|
66
|
-
- `s.db.bulk.delete({ table, where?, allRows?, as? })` — deletes rows by a `context.search` filter. `where` is the same surface as `s.db.query` (`expr(...)`/`cmp(...)`, `and(...)`/`or(...)` groups, an array of those ANDed
|
|
67
|
-
- `s.db.increment({ table, where, fieldName, value, returnType?, output?, addon?, as? })` — adds `value` (a number or `Value`; negative decrements) to one `int`/`decimal` column on every row `where` matches, in ONE atomic locked UPDATE. **Use it for counters, stock, balances and tallies**: `db.get` → math → `db.edit` loses updates under concurrency, and so do `db.bulk.patch`/`update`. A guard in `where` (`expr(col("stock"), ">=", c.int(1))`) is re-checked under the row lock. `returnType: "count"` binds the changed-row count instead of the rows, and then takes no `output`/`addon`.
|
|
74
|
+
- ⚠ `bulk.add` **drops `id` on every row unless `allowIdField: true`** (silently, next sequence value instead) — the opposite of `seed`, where `id` pins. Rows referenced by a foreign key need `allowIdField: true`; literal `items` carrying `id` without it throw. `bulk.update`/`patch` keep `id` (their match key). A unique violation rolls back the WHOLE batch: 500 "SQL Error: 23505, UNIQUE VIOLATION".
|
|
75
|
+
- ⚠ **`bulk.update` is a whole-row REPLACE: every column an item OMITS is zeroed** (`""`/`0`/`null`), HTTP 200, no error — `{ id: 7, status: "done" }` blanks the rest of row 7. It also resets `created_at`. **Use `s.db.bulk.patch`** for the partial write "update these rows" means. `export()` warns on a STATIC `items` missing columns (`--strict` fails); a `ref`/`inp` `items` is uninspectable.
|
|
76
|
+
- `s.db.bulk.delete({ table, where?, allRows?, as? })` — deletes rows by a `context.search` filter. `where` is the same surface as `s.db.query` (`expr(...)`/`cmp(...)`, `and(...)`/`or(...)` groups, an array of those ANDed) and encodes through the identical `{expression:[…]}` search shape. ⚠ A filter that constrains nothing (missing, empty, or `x OR and()`) deletes **every** row, so it **throws**: pass the filter, or `allRows: true` for a deliberate wipe (both together also throw). `allRows` emits the empty search the engine requires and returns the deleted count; reach for `s.db.truncate({ table, reset: true })` when the id sequence should restart too.
|
|
77
|
+
- `s.db.increment({ table, where, fieldName, value, returnType?, output?, addon?, as? })` — adds `value` (a number or `Value`; negative decrements) to one `int`/`decimal` column on every row `where` matches, in ONE atomic locked UPDATE. **Use it for counters, stock, balances and tallies**: `db.get` → math → `db.edit` loses updates under concurrency, and so do `db.bulk.patch`/`update`. A guard in `where` (`expr(col("stock"), ">=", c.int(1))`) is re-checked under the row lock. To guard one column against ANOTHER of the same row (`used < max_uses`), set `tableAlias` on the statement and qualify the RIGHT operand with it (`expr(col("used"), "<", col("cpn.max_uses"))` with `tableAlias: "cpn"`) (a bare right-hand column throws at export). `returnType: "count"` binds the changed-row count instead of the rows, and then takes no `output`/`addon`.
|
|
68
78
|
- ⚠ A `where` that constrains nothing (missing, empty, or `x OR and()`) changes NO rows and **throws**. A null stored value counts as 0. A fractional `value` on an `int` column, a non-numeric or list column, the `id` key, and a result that overflows the column are rejected with no rows changed.
|