@xano/sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/CHANGELOG.md +788 -0
  2. package/LICENSE +21 -0
  3. package/README.md +541 -0
  4. package/dist/.build-fingerprint +1 -0
  5. package/dist/agent-file-refresh-ZEMK33AX.js +38 -0
  6. package/dist/answer-shape-K67TAAPY.js +33 -0
  7. package/dist/backend-dir-2U53CIAL.js +39 -0
  8. package/dist/backend-slot-7QXW2QYC.js +28 -0
  9. package/dist/bin.d.ts +1 -0
  10. package/dist/bin.js +255 -0
  11. package/dist/branch-NCRNWQBQ.js +61 -0
  12. package/dist/branch-commands-ACIRCEQJ.js +79 -0
  13. package/dist/bundle.d.ts +223 -0
  14. package/dist/bundle.js +153 -0
  15. package/dist/capture-WAXPD7DR.js +41 -0
  16. package/dist/chunk-27GWNP2I.js +23 -0
  17. package/dist/chunk-2CMJZDCL.js +177 -0
  18. package/dist/chunk-2EZ3ZJZZ.js +302 -0
  19. package/dist/chunk-2GNFDZA2.js +390 -0
  20. package/dist/chunk-2MNLRIOX.js +11 -0
  21. package/dist/chunk-2TFRR6JV.js +104 -0
  22. package/dist/chunk-2ZUEE4EK.js +408 -0
  23. package/dist/chunk-36JUQZVQ.js +22 -0
  24. package/dist/chunk-3DRXWLJ5.js +83 -0
  25. package/dist/chunk-3JDU4VRL.js +137 -0
  26. package/dist/chunk-3KZCLN4Z.js +241 -0
  27. package/dist/chunk-3LDULPRE.js +168 -0
  28. package/dist/chunk-3M4LFYNQ.js +111 -0
  29. package/dist/chunk-3XI5CTUE.js +22 -0
  30. package/dist/chunk-3YW23UFH.js +50 -0
  31. package/dist/chunk-45UIT5T2.js +862 -0
  32. package/dist/chunk-4BW2SG2N.js +46 -0
  33. package/dist/chunk-4KHEMC32.js +79 -0
  34. package/dist/chunk-4POWHT2K.js +321 -0
  35. package/dist/chunk-4Q2GN7NW.js +192 -0
  36. package/dist/chunk-5A2PLKZB.js +70 -0
  37. package/dist/chunk-5FBYXK5P.js +159 -0
  38. package/dist/chunk-5HVXPTU4.js +323 -0
  39. package/dist/chunk-5QU2P5CA.js +304 -0
  40. package/dist/chunk-5V5XU32D.js +191 -0
  41. package/dist/chunk-5ZSO4T2G.js +10 -0
  42. package/dist/chunk-622HUCZT.js +10 -0
  43. package/dist/chunk-65HWOMGV.js +177 -0
  44. package/dist/chunk-6ELFRN3P.js +365 -0
  45. package/dist/chunk-6HO3NCSJ.js +1055 -0
  46. package/dist/chunk-6IUMKYWI.js +457 -0
  47. package/dist/chunk-6KEB3C3U.js +65 -0
  48. package/dist/chunk-6MR5TI5V.js +987 -0
  49. package/dist/chunk-6NNTNXN7.js +157 -0
  50. package/dist/chunk-6PBR37LN.js +97 -0
  51. package/dist/chunk-6QXLMMT3.js +155 -0
  52. package/dist/chunk-6ZGJCBZS.js +224 -0
  53. package/dist/chunk-73IVBKMA.js +250 -0
  54. package/dist/chunk-7G3CTU7I.js +286 -0
  55. package/dist/chunk-A3UDOZB6.js +222 -0
  56. package/dist/chunk-A6E77GDW.js +85 -0
  57. package/dist/chunk-AHJWCYQO.js +660 -0
  58. package/dist/chunk-AKNCFVKZ.js +36 -0
  59. package/dist/chunk-AM4FKL4J.js +237 -0
  60. package/dist/chunk-AN6BL47T.js +26 -0
  61. package/dist/chunk-AOSYVMUS.js +147 -0
  62. package/dist/chunk-APWXY5SL.js +182 -0
  63. package/dist/chunk-AWEIIR2U.js +218 -0
  64. package/dist/chunk-AWQ7BQTQ.js +73 -0
  65. package/dist/chunk-BAUZOWGX.js +393 -0
  66. package/dist/chunk-BHACRS6R.js +940 -0
  67. package/dist/chunk-BWPNT55T.js +680 -0
  68. package/dist/chunk-C6RIMRU4.js +187 -0
  69. package/dist/chunk-CGVQZXYG.js +263 -0
  70. package/dist/chunk-CIMQZRRE.js +162 -0
  71. package/dist/chunk-CJHQKJU4.js +113 -0
  72. package/dist/chunk-CTMO46PK.js +1897 -0
  73. package/dist/chunk-D53J55C5.js +106 -0
  74. package/dist/chunk-D7VGG3WS.js +90 -0
  75. package/dist/chunk-DAD3ONIS.js +245 -0
  76. package/dist/chunk-DGWHAVRG.js +162 -0
  77. package/dist/chunk-DX4QR4B2.js +483 -0
  78. package/dist/chunk-EHP3WPEG.js +21 -0
  79. package/dist/chunk-ELP2HMXC.js +432 -0
  80. package/dist/chunk-ERVIASGL.js +21 -0
  81. package/dist/chunk-ET4Y4XCB.js +865 -0
  82. package/dist/chunk-ETO6LGLD.js +4750 -0
  83. package/dist/chunk-EUUUMY7J.js +24 -0
  84. package/dist/chunk-FQJ2TTHP.js +218 -0
  85. package/dist/chunk-FQOF7E2E.js +133 -0
  86. package/dist/chunk-FWD7AL6N.js +21 -0
  87. package/dist/chunk-FXFV3KU6.js +138 -0
  88. package/dist/chunk-FXRQOWTE.js +171 -0
  89. package/dist/chunk-G554NZNI.js +210 -0
  90. package/dist/chunk-GSGDWJB5.js +13 -0
  91. package/dist/chunk-H2V3N23D.js +66 -0
  92. package/dist/chunk-H5C7MBCR.js +159 -0
  93. package/dist/chunk-HHN734BU.js +371 -0
  94. package/dist/chunk-HRVBLCVJ.js +243 -0
  95. package/dist/chunk-HVRUQXGD.js +1264 -0
  96. package/dist/chunk-I4F5TCJH.js +130 -0
  97. package/dist/chunk-IDOTCMDV.js +57 -0
  98. package/dist/chunk-IGOLHKWF.js +427 -0
  99. package/dist/chunk-JGE7CAWB.js +148 -0
  100. package/dist/chunk-JTUKLCXS.js +92 -0
  101. package/dist/chunk-JZGVVJSI.js +66 -0
  102. package/dist/chunk-K4WX6UUU.js +923 -0
  103. package/dist/chunk-K5BBGTYZ.js +217 -0
  104. package/dist/chunk-K6RXBGUB.js +427 -0
  105. package/dist/chunk-KTSDSD36.js +165 -0
  106. package/dist/chunk-L5JYN3NM.js +1038 -0
  107. package/dist/chunk-LIEOKXKD.js +354 -0
  108. package/dist/chunk-LLNZGEFK.js +51 -0
  109. package/dist/chunk-LPECSJ2J.js +55 -0
  110. package/dist/chunk-LQCMKAJ7.js +413 -0
  111. package/dist/chunk-LRN4ZJCQ.js +1145 -0
  112. package/dist/chunk-MJ4ZVHKN.js +17 -0
  113. package/dist/chunk-MXHSQOC4.js +3061 -0
  114. package/dist/chunk-N5GKCWE5.js +367 -0
  115. package/dist/chunk-NA3PXMEF.js +10 -0
  116. package/dist/chunk-NAQDMEHV.js +76 -0
  117. package/dist/chunk-NWKXM5RD.js +109 -0
  118. package/dist/chunk-NZOWWHU5.js +196 -0
  119. package/dist/chunk-OHX6MIUZ.js +184 -0
  120. package/dist/chunk-OOXWYAA4.js +15 -0
  121. package/dist/chunk-OPHB5ORL.js +1990 -0
  122. package/dist/chunk-OXA6PSZT.js +1725 -0
  123. package/dist/chunk-P2HAGF6H.js +73 -0
  124. package/dist/chunk-PTHVMXZI.js +3036 -0
  125. package/dist/chunk-PZ5AY32C.js +10 -0
  126. package/dist/chunk-Q325JKYB.js +189 -0
  127. package/dist/chunk-Q7DGTQ5G.js +255 -0
  128. package/dist/chunk-QCNYHBL7.js +601 -0
  129. package/dist/chunk-QO6BVGS5.js +145 -0
  130. package/dist/chunk-QXTKSOFI.js +76 -0
  131. package/dist/chunk-ROY4YAEQ.js +66 -0
  132. package/dist/chunk-RTJRZFFY.js +447 -0
  133. package/dist/chunk-SAVJUS2X.js +128 -0
  134. package/dist/chunk-SFLHVCKX.js +173 -0
  135. package/dist/chunk-STSFNCY4.js +127 -0
  136. package/dist/chunk-SWBF2LTK.js +170 -0
  137. package/dist/chunk-T5KELPAR.js +109 -0
  138. package/dist/chunk-TFFGOFVZ.js +1481 -0
  139. package/dist/chunk-TLHIFK4M.js +256 -0
  140. package/dist/chunk-TLQE7ZN3.js +156 -0
  141. package/dist/chunk-TPHWJ7UG.js +1981 -0
  142. package/dist/chunk-TRJCALW3.js +291 -0
  143. package/dist/chunk-TTEIYD5P.js +133 -0
  144. package/dist/chunk-U64O2MXY.js +407 -0
  145. package/dist/chunk-UCQ2VUTG.js +630 -0
  146. package/dist/chunk-UTI5G6OJ.js +44 -0
  147. package/dist/chunk-UVHDMMIP.js +188 -0
  148. package/dist/chunk-UZ6QQWJT.js +120 -0
  149. package/dist/chunk-VAX3UZOY.js +686 -0
  150. package/dist/chunk-W3HBUKFO.js +57 -0
  151. package/dist/chunk-WKQLGKCL.js +2823 -0
  152. package/dist/chunk-WQFNASK4.js +560 -0
  153. package/dist/chunk-WRBKLYSJ.js +224 -0
  154. package/dist/chunk-WTPZRR4I.js +17 -0
  155. package/dist/chunk-WZDJ2LLX.js +2385 -0
  156. package/dist/chunk-X2NL4KUO.js +14 -0
  157. package/dist/chunk-X4DVXBFY.js +38 -0
  158. package/dist/chunk-X677DMZM.js +7050 -0
  159. package/dist/chunk-XBKMWY7F.js +612 -0
  160. package/dist/chunk-XNCP4KYO.js +78 -0
  161. package/dist/chunk-XVBGLISP.js +35 -0
  162. package/dist/chunk-XW6KISBB.js +1192 -0
  163. package/dist/chunk-YGZHHAAB.js +8156 -0
  164. package/dist/chunk-YHEFQUQB.js +186 -0
  165. package/dist/chunk-YLDALTWZ.js +653 -0
  166. package/dist/chunk-YU4HSQW7.js +229 -0
  167. package/dist/chunk-ZDPP6RKB.js +27 -0
  168. package/dist/chunk-ZFDZKNGG.js +194 -0
  169. package/dist/chunk-ZIY7RNUT.js +49 -0
  170. package/dist/chunk-ZYJP6BOO.js +30 -0
  171. package/dist/cli.d.ts +1111 -0
  172. package/dist/cli.js +165 -0
  173. package/dist/codegen-command-VR2GWR6C.js +173 -0
  174. package/dist/codegen.d.ts +115 -0
  175. package/dist/codegen.js +19 -0
  176. package/dist/commands-GJMJ4XYZ.js +76 -0
  177. package/dist/completion-ZQLO6PB6.js +738 -0
  178. package/dist/config-MBYGCAFK.js +136 -0
  179. package/dist/deploy-command-JVZPWHMK.js +180 -0
  180. package/dist/deploy-source-3W45CXMP.js +81 -0
  181. package/dist/dev-env-sync-HN44K4D5.js +188 -0
  182. package/dist/diagnostics-UEAAHWVF.js +30 -0
  183. package/dist/display-name-hint-ABBPVQIR.js +46 -0
  184. package/dist/emit-CyhBDxli.d.ts +7007 -0
  185. package/dist/env-example-refresh-ET5HMMDW.js +126 -0
  186. package/dist/env-pull-command-TNMNB3CV.js +323 -0
  187. package/dist/env-target-O4HRKTGZ.js +40 -0
  188. package/dist/env-var-command-ZIRDCAZA.js +427 -0
  189. package/dist/ephemeral-P7F3PMAD.js +54 -0
  190. package/dist/ephemeral-command-CLJJKOFT.js +592 -0
  191. package/dist/ephemeral-state-PYCBSOGX.js +61 -0
  192. package/dist/file-lock-PT74GWYW.js +10 -0
  193. package/dist/generate-command-AYEOLA26.js +510 -0
  194. package/dist/gitignore-3SJ3WNRG.js +51 -0
  195. package/dist/guards-4EBNCZDC.js +162 -0
  196. package/dist/hosted-file-PSHJB3HX.js +28 -0
  197. package/dist/impersonate-command-5JAS3WSV.js +152 -0
  198. package/dist/import-EQSFU6JC.js +19 -0
  199. package/dist/index.d.ts +5470 -0
  200. package/dist/index.js +371 -0
  201. package/dist/init-command-X2FR4UAK.js +125 -0
  202. package/dist/init-modules-RY7UHAOL.js +50 -0
  203. package/dist/init-web-M4YZSZK6.js +42 -0
  204. package/dist/internal.d.ts +179 -0
  205. package/dist/internal.js +2634 -0
  206. package/dist/io-RC56QSN5.js +26 -0
  207. package/dist/keep-data-merge-7MPLVAVI.js +1119 -0
  208. package/dist/lambda-config-reconcile-OUZ4OYAB.js +116 -0
  209. package/dist/landed-753YLJ5H.js +40 -0
  210. package/dist/landing-record-SU52SKXU.js +61 -0
  211. package/dist/live-diff-YONW2VI3.js +65 -0
  212. package/dist/local-engine-choice-CH5X3W7E.js +79 -0
  213. package/dist/local-engine-command-Z3OL7VOD.js +766 -0
  214. package/dist/local-engine-config-5U3SC434.js +39 -0
  215. package/dist/local-engine-deploy-PCQ4SNPB.js +39 -0
  216. package/dist/local-engine-process-EHTE5LLU.js +63 -0
  217. package/dist/local-engine-state-A4FTRFAF.js +32 -0
  218. package/dist/local-engine-update-check-6L645VBL.js +162 -0
  219. package/dist/lock-MRRHW5GS.js +87 -0
  220. package/dist/lock-commands-2QG25HL7.js +963 -0
  221. package/dist/login-command-QPYRWOXZ.js +538 -0
  222. package/dist/logout-command-WOIQLDP6.js +56 -0
  223. package/dist/loop-ALIZLOSX.js +191 -0
  224. package/dist/marketplace-command-K5YL42NO.js +977 -0
  225. package/dist/marketplace-resolve-LY32JES5.js +40 -0
  226. package/dist/meta-client-YXGPW53C.js +244 -0
  227. package/dist/module-manifest-JFGHU2TC.js +38 -0
  228. package/dist/near-key.d.ts +13 -0
  229. package/dist/near-key.js +8 -0
  230. package/dist/node.d.ts +95 -0
  231. package/dist/node.js +969 -0
  232. package/dist/operation-outcome-TZSESNC7.js +51 -0
  233. package/dist/output-target-AL3I44GG.js +47 -0
  234. package/dist/package-manager-PRAHUSCN.js +34 -0
  235. package/dist/plan-disclosure-6G4MLZKD.js +114 -0
  236. package/dist/plugin-contributions-WRNY5ABG.js +28 -0
  237. package/dist/plugin-prompt-4VA3B4FF.js +20 -0
  238. package/dist/plugin-questions-JTSYA74Q.js +24 -0
  239. package/dist/plugin.d.ts +396 -0
  240. package/dist/plugin.js +1 -0
  241. package/dist/preflight-command-2T5Z36MI.js +321 -0
  242. package/dist/profile-command-AH3PIM4X.js +800 -0
  243. package/dist/profile-pointer-GRWJU3YD.js +31 -0
  244. package/dist/profile-select-74TRDEPD.js +23 -0
  245. package/dist/project-dependency-KSH63ODT.js +35 -0
  246. package/dist/project-sdk-REPPOIBD.js +24 -0
  247. package/dist/promote-command-PCWT5N6S.js +140 -0
  248. package/dist/prompt-II3F3LND.js +27 -0
  249. package/dist/publish-command-TTDUUJI5.js +414 -0
  250. package/dist/pull-command-VBO7C4S3.js +161 -0
  251. package/dist/pull-superseded-GJWLG7XO.js +20 -0
  252. package/dist/release-command-N4ZPKMHR.js +146 -0
  253. package/dist/release-ns-command-3KFDMZ6G.js +1745 -0
  254. package/dist/response-HlXahv4K.d.ts +925 -0
  255. package/dist/retry-command-AS5EVREX.js +34 -0
  256. package/dist/routes-manifest-SNWUVBT6.js +43 -0
  257. package/dist/runtime-XETHVF33.js +14 -0
  258. package/dist/scaffold.d.ts +1911 -0
  259. package/dist/scaffold.js +107 -0
  260. package/dist/secrets-file-LVZD6IIM.js +56 -0
  261. package/dist/secrets-fill-command-TTCPSVXN.js +218 -0
  262. package/dist/seed-VU7C3QYS.js +46 -0
  263. package/dist/sent-writes-N7X4OVXT.js +22 -0
  264. package/dist/source-resolve-S2XA3XZF.js +83 -0
  265. package/dist/static-host-B2Y6AG3W.js +352 -0
  266. package/dist/status-command-RUDXTF7I.js +554 -0
  267. package/dist/store-6VNCD4D7.js +20 -0
  268. package/dist/store-ARM6VMO5.js +98 -0
  269. package/dist/store-DuYfzKlW.d.ts +3144 -0
  270. package/dist/suggest-6FOOYKHG.js +12 -0
  271. package/dist/sveltekit.d.ts +154 -0
  272. package/dist/sveltekit.js +109 -0
  273. package/dist/sync-contributions-UCEROO26.js +415 -0
  274. package/dist/table-ENAVMITR.js +42 -0
  275. package/dist/tables-command-GUPXXSB5.js +156 -0
  276. package/dist/tenant-IIHPOHGP.js +42 -0
  277. package/dist/tenant-command-D5HGI2X4.js +965 -0
  278. package/dist/test-command-TIKZMDPZ.js +476 -0
  279. package/dist/tests-BGGIOK3L.js +26 -0
  280. package/dist/token-NICJUTMT.js +72 -0
  281. package/dist/toolchain-hooks-GHKLUJOH.js +96 -0
  282. package/dist/toolchain-modules-5EAZUONB.js +24 -0
  283. package/dist/tracked-backend-EIBUMDZA.js +80 -0
  284. package/dist/update-check-2W2NLDTC.js +136 -0
  285. package/dist/upgrade-command-QHNFWM7O.js +531 -0
  286. package/dist/verify-rollout-DRCK5TDD.js +61 -0
  287. package/dist/whoami-command-STGINTXH.js +51 -0
  288. package/dist/workspace-2CLHU2LK.js +93 -0
  289. package/dist/workspace-binding-56PIIPCP.js +54 -0
  290. package/dist/workspace-command-JEXQETJD.js +535 -0
  291. package/dist/workspace-env-F2RFMSC5.js +70 -0
  292. package/dist/workspace-export-OJSH2HIW.js +21 -0
  293. package/dist/writable-VA7OISSK.js +25 -0
  294. package/dist/xano-ICFUSPFR.js +42 -0
  295. package/dist/xanosdk-import-GN42TO2B.js +56 -0
  296. package/dist/xanosdk-project-S6DXJONQ.js +41 -0
  297. package/dist/xdo-CxDr2Q1C.d.ts +1371 -0
  298. package/guides/README.md +33 -0
  299. package/guides/authoring.md +921 -0
  300. package/guides/cli.md +401 -0
  301. package/guides/codegen.md +177 -0
  302. package/guides/codes.md +404 -0
  303. package/guides/coverage.md +74 -0
  304. package/guides/deploying.md +1525 -0
  305. package/guides/environment.md +400 -0
  306. package/guides/marketplace.md +415 -0
  307. package/guides/module-contract.md +558 -0
  308. package/guides/object-kinds.md +433 -0
  309. package/guides/project-structure.md +43 -0
  310. package/guides/scaffold.md +351 -0
  311. package/guides/typed-frontend.md +242 -0
  312. package/llms/client.md +63 -0
  313. package/llms/errors.md +56 -0
  314. package/llms/fields.md +176 -0
  315. package/llms/filters.md +183 -0
  316. package/llms/kinds-agent-mcp.md +30 -0
  317. package/llms/kinds-core.md +100 -0
  318. package/llms/kinds-knowledge.md +20 -0
  319. package/llms/kinds-realtime.md +76 -0
  320. package/llms/lambda.md +94 -0
  321. package/llms/legacy.md +44 -0
  322. package/llms/lock.md +40 -0
  323. package/llms/object-kinds.md +34 -0
  324. package/llms/statements-calls.md +62 -0
  325. package/llms/statements-catalog.md +320 -0
  326. package/llms/statements-data.md +66 -0
  327. package/llms/statements-runtime.md +68 -0
  328. package/llms/tests.md +59 -0
  329. package/llms/toolchain.md +16 -0
  330. package/llms/triggers.md +36 -0
  331. package/llms/values.md +29 -0
  332. package/llms-full.txt +2085 -0
  333. package/llms.txt +493 -0
  334. package/manifest.json +11224 -0
  335. package/package.json +162 -0
  336. package/types/lambda-globals.d.ts +129 -0
@@ -0,0 +1,24 @@
1
+ import {
2
+ readEnvVar
3
+ } from "./chunk-X2NL4KUO.js";
4
+
5
+ // src/util/home-path.ts
6
+ import { homedir } from "os";
7
+ import { join } from "path";
8
+ function expandHome(path) {
9
+ if (path === void 0 || !isHomeRelative(path)) return path;
10
+ return join(homedir(), path.slice(1));
11
+ }
12
+ function isHomeRelative(path) {
13
+ return /^~(?:$|[\\/])/.test(path);
14
+ }
15
+ function readPathEnvVar(name) {
16
+ return expandHome(readEnvVar(name));
17
+ }
18
+
19
+ export {
20
+ expandHome,
21
+ isHomeRelative,
22
+ readPathEnvVar
23
+ };
24
+ //# sourceMappingURL=chunk-EUUUMY7J.js.map
@@ -0,0 +1,218 @@
1
+ import {
2
+ retryCommand,
3
+ withheldNote
4
+ } from "./chunk-T5KELPAR.js";
5
+ import {
6
+ contextFlags
7
+ } from "./chunk-NAQDMEHV.js";
8
+ import {
9
+ READ_AFTERMATH,
10
+ SENT_AFTERMATH,
11
+ closeSentence
12
+ } from "./chunk-YLDALTWZ.js";
13
+ import {
14
+ UsageError,
15
+ detail,
16
+ pastePath,
17
+ warn
18
+ } from "./chunk-PTHVMXZI.js";
19
+ import {
20
+ shellQuote
21
+ } from "./chunk-5ZSO4T2G.js";
22
+
23
+ // src/emit/static-teardown.ts
24
+ async function readStaticTeardown(auth, target, recorded) {
25
+ const { listServingStaticHosts } = await import("./static-host-B2Y6AG3W.js");
26
+ try {
27
+ const serving = await listServingStaticHosts({ ...target, accessToken: auth.access_token });
28
+ const urls = serving.map((s) => s.url);
29
+ return { teardown: urls.length > 0 ? { urls, verified: true } : void 0, live: urls };
30
+ } catch (err) {
31
+ const error = withoutReadAftermath(err instanceof Error ? err.message : String(err));
32
+ return {
33
+ teardown: { urls: recorded === void 0 ? [] : [recorded], verified: false, reason: error },
34
+ live: void 0,
35
+ error
36
+ };
37
+ }
38
+ }
39
+ async function recheckDoubtedFrontend(read, doubted) {
40
+ const { teardown, live } = read;
41
+ if (doubted === void 0 || live === void 0 || teardown === void 0 || !live.includes(doubted)) {
42
+ return { read, unchecked: false };
43
+ }
44
+ const { probeFrontend } = await import("./verify-rollout-DRCK5TDD.js");
45
+ const state = await probeFrontend(doubted);
46
+ if (state === "serving") return { read, unchecked: false };
47
+ if (state === "down") {
48
+ const urls = teardown.urls.filter((u) => u !== doubted);
49
+ return {
50
+ read: { ...read, live: live.filter((u) => u !== doubted), teardown: urls.length > 0 ? { ...teardown, urls } : void 0 },
51
+ unchecked: false
52
+ };
53
+ }
54
+ const reason = `${doubted} could not be reached to check \u2014 an earlier failed replace may already have taken it down.`;
55
+ return { read: { ...read, teardown: { ...teardown, verified: false, reason } }, unchecked: true };
56
+ }
57
+ function withoutReadAftermath(message) {
58
+ return message.split("\n").filter((line) => line !== READ_AFTERMATH).join("\n");
59
+ }
60
+ function warnStaticTeardown(read, where, opts) {
61
+ const { teardown } = read;
62
+ if (teardown === void 0) return false;
63
+ const reason = closeSentence(read.error ?? teardown.reason ?? "The read failed for an unknown reason.");
64
+ if (teardown.urls.length === 0) {
65
+ if (opts.publishing) {
66
+ detail(
67
+ `Could not read ${where}'s static hosting, so this cannot say whether a frontend serves there; this replace takes down any that does, and \`--static\` publishes the new one after the import.`
68
+ );
69
+ detail(reason);
70
+ } else {
71
+ warn(
72
+ `Could not read ${where}'s static hosting, so this cannot say whether a frontend serves there \u2014 this replace takes down any that does.`,
73
+ "static.teardown-unknown",
74
+ [
75
+ reason,
76
+ `Re-run with \`--static <dir>\` to publish again (the URL may change), or ${opts.keepHint}.`
77
+ ]
78
+ );
79
+ }
80
+ return true;
81
+ }
82
+ const urls = teardown.urls.join(", ");
83
+ const one = teardown.urls.length === 1;
84
+ if (opts.publishing) {
85
+ detail(
86
+ `This replace clears the frontend${one ? "" : "s"} serving at ${urls}; \`--static\` publishes the new one after the import (the URL may change).`
87
+ );
88
+ } else {
89
+ warn(
90
+ `This replace takes the frontend${one ? "" : "s"} at ${urls} down \u2014 a replace clears ${where}'s static hosting, and this one publishes none.`,
91
+ "static.teardown",
92
+ [`Re-run with \`--static <dir>\` to publish again (the URL may change), or ${opts.keepHint}.`]
93
+ );
94
+ }
95
+ if (!teardown.verified && read.live !== void 0) detail(`Unverified: ${reason}`);
96
+ else if (!teardown.verified) {
97
+ detail(
98
+ `Unverified: ${where}'s static hosting could not be read, so this is this project's record of its last publish there \u2014 it may already be down.`
99
+ );
100
+ detail(reason);
101
+ }
102
+ return true;
103
+ }
104
+ function staticRemovedField(teardown, republished) {
105
+ if (teardown === void 0) return {};
106
+ const urls = teardown.urls.filter((u) => u !== republished);
107
+ return urls.length === 0 && teardown.verified ? {} : { staticRemoved: { ...teardown, urls } };
108
+ }
109
+ function namedStaticHost(args) {
110
+ if (args.static === void 0 || args.staticHost === void 0 || args.staticHost === "default") return void 0;
111
+ return args.staticHost;
112
+ }
113
+ function refuseStaticHostAReplaceClears(args, replaces, command = "deploy") {
114
+ const host = namedStaticHost(args);
115
+ if (host === void 0 || !replaces) return;
116
+ throw new UsageError(
117
+ `\`--static-host ${shellQuote(host)}\` names a host this replace deletes: a replace clears every static host on its target, and the publish after it re-creates only \`default\`. Nothing was deployed. Drop \`--static-host\` to publish to \`default\`${survivingRemedy(args, command)}`,
118
+ { hintFor: { command } }
119
+ );
120
+ }
121
+ function survivingRemedy(args, command) {
122
+ if (command === "release" || args.replace) return `, or drop \`--replace\` so the host survives.`;
123
+ const host = shellQuote(namedStaticHost(args) ?? "");
124
+ if (args.keepData && !args.reset) {
125
+ return `. A new environment holds only \`default\`: deploy once, create the static host \`${host}\` in the dashboard, then deploy with \`--keep-data --static-host ${host}\`.`;
126
+ }
127
+ const merge = retryCommand(args, { add: ["--keep-data"], drop: ["--reset"] });
128
+ return `, or merge so the host survives \u2014 once the environment has a static host named \`${host}\` (created in the dashboard; a deploy creates only \`default\`): \`${merge.command}\`.${withheldNote(merge.withheld)}`;
129
+ }
130
+ async function assertStaticHostExists(args, auth, target) {
131
+ const host = namedStaticHost(args);
132
+ if (host === void 0) return;
133
+ const { listStaticHostNames, StaticHostNotFoundError } = await import("./static-host-B2Y6AG3W.js");
134
+ let names;
135
+ try {
136
+ names = await listStaticHostNames({ ...target, accessToken: auth.access_token });
137
+ } catch {
138
+ return;
139
+ }
140
+ if (!names.includes(host)) throw new StaticHostNotFoundError(host, names, "Nothing was deployed or published.");
141
+ }
142
+ function staticRetryHint(dir, to, args, err) {
143
+ const badHost = err instanceof Error && err.name === "StaticHostNotFoundError";
144
+ return `Retry just the static step: \`${staticRetryCommand(dir, to, args, err)}\`` + (badHost ? ` (that publishes to \`default\`; add \`--static-host <name>\` for a host the target holds)` : "");
145
+ }
146
+ function staticRetryCommand(dir, to, args, err) {
147
+ const badHost = err instanceof Error && err.name === "StaticHostNotFoundError";
148
+ return (
149
+ // Spelled from where the user typed: a run moved to its project's root
150
+ // found `dir` from there, and a pasted `publish` resolves it from here.
151
+ `xanosdk publish ${shellQuote(pastePath(dir))} --to ${shellQuote(to)}` + (args.staticHost && !badHost ? ` --static-host ${shellQuote(args.staticHost)}` : "") + (args.staticRouting ? ` --static-routing ${args.staticRouting}` : "") + Object.entries(args.staticEnv).map(([k, v]) => ` --static-env ${shellQuote(`${k}=${v}`)}`).join("") + contextFlags({ authFile: args.authFile, local: args.local ?? false, profile: args.profile })
152
+ );
153
+ }
154
+ function noteStaticTakenDown(teardown, unknown = false) {
155
+ if (teardown === void 0 || teardown.urls.length === 0) return;
156
+ const one = teardown.urls.length === 1;
157
+ warn(
158
+ `The replace took down the frontend${one ? "" : "s"} at ${teardown.urls.join(", ")}, and the publish that was to replace ${one ? "it" : "them"} ` + (unknown ? `may or may not have landed \u2014 at a URL of its own if it did; the retry prints where the frontend serves.` : `failed \u2014 nothing serves there until a publish succeeds.`) + (teardown.verified ? "" : " (Unverified: this project's record of its last publish there.)"),
159
+ "static.teardown"
160
+ );
161
+ }
162
+ async function readFrontendsAfterFailure(auth, target, warned) {
163
+ const { live } = await readStaticTeardown(auth, target, void 0);
164
+ const { probeFrontend } = await import("./verify-rollout-DRCK5TDD.js");
165
+ const states = {};
166
+ for (const url of warned) {
167
+ states[url] = live !== void 0 && !live.includes(url) ? "down" : await probeFrontend(url);
168
+ }
169
+ return states;
170
+ }
171
+ function staticAfterFailedReplace(warned, states, opts) {
172
+ const again = `ublish again with \`${opts.publish}\`, or re-run the deploy with \`--static <dir>\`.`;
173
+ const remedy = `P${again}`;
174
+ const head = opts.unknown ? "The import's outcome is unknown" : "The import was refused";
175
+ const by = (s) => warned.filter((u) => (states[u] ?? "unknown") === s);
176
+ const down = by("down");
177
+ const unasked = by("unknown");
178
+ const plural = (urls) => urls.length === 1 ? { s: "", it: "it" } : { s: "s", it: "them" };
179
+ const unaskedText = (lead) => {
180
+ const p2 = plural(unasked);
181
+ return `${lead}the frontend${p2.s} at ${unasked.join(", ")} could not be reached to check \u2014 the clear that opens a replace may already have taken ${p2.it} down. Open ${p2.it} to check; if nothing serves there: p${again}`;
182
+ };
183
+ if (down.length > 0) {
184
+ const p2 = plural(down);
185
+ const text = `${head}, but the clear that opens a replace already took the frontend${p2.s} at ${down.join(", ")} down \u2014 nothing serves there now. ${remedy}` + (unasked.length > 0 ? ` ${unaskedText("And ")}` : "");
186
+ return { text, down };
187
+ }
188
+ if (unasked.length > 0) return { text: unaskedText(`${head}, and `), down };
189
+ const p = plural(warned);
190
+ return {
191
+ text: `${head}, and the frontend${p.s} at ${warned.join(", ")} still serve${p.s === "" ? "s" : ""}.`,
192
+ down
193
+ };
194
+ }
195
+ var EXIT_STATIC_FAILED = 3;
196
+ function unknownStaticOutcome(message, unknown) {
197
+ if (!unknown) return message;
198
+ const said = "The upload was sent, so it may or may not have published. A publish replaces the host's build, so the retry below settles it either way and prints the URL it serves at.";
199
+ return message.includes(SENT_AFTERMATH) ? message.replace(SENT_AFTERMATH, said) : `${message}
200
+ ${said}`;
201
+ }
202
+
203
+ export {
204
+ readStaticTeardown,
205
+ recheckDoubtedFrontend,
206
+ warnStaticTeardown,
207
+ staticRemovedField,
208
+ refuseStaticHostAReplaceClears,
209
+ assertStaticHostExists,
210
+ staticRetryHint,
211
+ staticRetryCommand,
212
+ noteStaticTakenDown,
213
+ readFrontendsAfterFailure,
214
+ staticAfterFailedReplace,
215
+ EXIT_STATIC_FAILED,
216
+ unknownStaticOutcome
217
+ };
218
+ //# sourceMappingURL=chunk-FQJ2TTHP.js.map
@@ -0,0 +1,133 @@
1
+ import {
2
+ envFlagSet
3
+ } from "./chunk-X2NL4KUO.js";
4
+
5
+ // src/auth/loopback.ts
6
+ import { createServer } from "http";
7
+ import { spawn } from "child_process";
8
+ var DEFAULT_TIMEOUT_MS = 5 * 60 * 1e3;
9
+ function loopbackRedirectUri(port, callbackPath) {
10
+ return `http://127.0.0.1:${port}${callbackPath}`;
11
+ }
12
+ function formatDuration(ms) {
13
+ const seconds = Math.round(ms / 1e3);
14
+ if (seconds < 60) return `${seconds} second${seconds === 1 ? "" : "s"}`;
15
+ const minutes = Math.round(seconds / 60);
16
+ return `${minutes} minute${minutes === 1 ? "" : "s"}`;
17
+ }
18
+ var CLOSE_TAB_HTML = '<!doctype html><meta charset=utf-8><title>xanosdk</title><body style="font-family:system-ui;padding:3rem;text-align:center"><h1>Authentication complete</h1><p>You can close this tab and return to the terminal.</p></body>';
19
+ function startCallbackServer(opts) {
20
+ const { callbackPath, expectedState, port, timeoutMs = DEFAULT_TIMEOUT_MS } = opts;
21
+ return new Promise((resolveListener, rejectListener) => {
22
+ let resolveResult;
23
+ let rejectResult;
24
+ const waitForCallback = new Promise((res, rej) => {
25
+ resolveResult = res;
26
+ rejectResult = rej;
27
+ });
28
+ waitForCallback.catch(() => {
29
+ });
30
+ let redirectUri = "";
31
+ const server = createServer((req, res) => {
32
+ const url = new URL(req.url ?? "/", "http://127.0.0.1");
33
+ if (url.pathname !== callbackPath) {
34
+ respond(res, 404, "Not found");
35
+ return;
36
+ }
37
+ const state = url.searchParams.get("state");
38
+ if (state !== expectedState) {
39
+ respond(res, 400, "Unexpected or missing state \u2014 ignoring this request.");
40
+ return;
41
+ }
42
+ const error = url.searchParams.get("error");
43
+ if (error) {
44
+ const authError = new Error(
45
+ `Authorization server returned error: ${error}`
46
+ );
47
+ authError.error = error;
48
+ respond(res, 400, "Authorization failed. Check the terminal for details.", () => finish(authError));
49
+ return;
50
+ }
51
+ const code = url.searchParams.get("code");
52
+ if (!code) {
53
+ respond(
54
+ res,
55
+ 400,
56
+ "Missing authorization code.",
57
+ () => finish(new Error("Callback carried no authorization code."))
58
+ );
59
+ return;
60
+ }
61
+ res.writeHead(200, { "Content-Type": "text/html", Connection: "close" }).end(CLOSE_TAB_HTML, () => {
62
+ finish(void 0, { code, callbackUrl: `${redirectUri}?${url.searchParams.toString()}` });
63
+ });
64
+ });
65
+ const sockets = /* @__PURE__ */ new Set();
66
+ server.on("connection", (socket) => {
67
+ sockets.add(socket);
68
+ socket.on("close", () => sockets.delete(socket));
69
+ socket.on("error", () => {
70
+ });
71
+ });
72
+ const timer = setTimeout(() => {
73
+ finish(new Error(`Timed out after ${formatDuration(timeoutMs)} waiting for the browser redirect.`));
74
+ }, timeoutMs);
75
+ timer.unref?.();
76
+ let settled = false;
77
+ function finish(err, result) {
78
+ if (settled) return;
79
+ settled = true;
80
+ clearTimeout(timer);
81
+ server.close();
82
+ for (const socket of sockets) socket.destroy();
83
+ if (err) rejectResult(err);
84
+ else resolveResult(result);
85
+ }
86
+ server.on("error", (err) => {
87
+ if (!settled) rejectListener(err);
88
+ });
89
+ server.listen(port ?? 0, "127.0.0.1", () => {
90
+ const boundPort = server.address().port;
91
+ redirectUri = loopbackRedirectUri(boundPort, callbackPath);
92
+ resolveListener({
93
+ redirectUri,
94
+ waitForCallback,
95
+ close: () => finish(new Error("Login cancelled."))
96
+ });
97
+ });
98
+ });
99
+ }
100
+ function respond(res, status, message, onFlush) {
101
+ res.writeHead(status, { "Content-Type": "text/html", Connection: "close" }).end(
102
+ `<!doctype html><meta charset=utf-8><body style="font-family:system-ui;padding:3rem;text-align:center">${message}</body>`,
103
+ onFlush
104
+ );
105
+ }
106
+ function browserCommand(platform, url) {
107
+ switch (platform) {
108
+ case "darwin":
109
+ return { cmd: "open", args: [url] };
110
+ case "win32":
111
+ return { cmd: "cmd", args: ["/c", "start", "", url.replace(/&/g, "^&")] };
112
+ default:
113
+ return { cmd: "xdg-open", args: [url] };
114
+ }
115
+ }
116
+ function openBrowser(url) {
117
+ if (envFlagSet("XANO_NO_BROWSER")) return;
118
+ const { cmd, args } = browserCommand(process.platform, url);
119
+ try {
120
+ const child = spawn(cmd, args, { stdio: "ignore", detached: true });
121
+ child.on("error", () => {
122
+ });
123
+ child.unref();
124
+ } catch {
125
+ }
126
+ }
127
+
128
+ export {
129
+ loopbackRedirectUri,
130
+ startCallbackServer,
131
+ openBrowser
132
+ };
133
+ //# sourceMappingURL=chunk-FQOF7E2E.js.map
@@ -0,0 +1,21 @@
1
+ // src/emit/command-line.ts
2
+ function shellWord(word) {
3
+ if (/^[A-Za-z0-9._:@/=+-]+$/.test(word)) return word;
4
+ if (CONTROL.test(word)) return `$'${word.replace(/[\\']/g, "\\$&").replace(CONTROLS, ansiEscape)}'`;
5
+ return `'${word.replace(/'/g, `'\\''`)}'`;
6
+ }
7
+ var CONTROL = /[\x00-\x1f\x7f-\x9f]/;
8
+ var CONTROLS = new RegExp(CONTROL.source, "g");
9
+ var ANSI_NAMED = { "\n": "\\n", "\r": "\\r", " ": "\\t" };
10
+ function ansiEscape(c) {
11
+ return ANSI_NAMED[c] ?? [...Buffer.from(c, "utf8")].map((b) => `\\x${b.toString(16).padStart(2, "0")}`).join("");
12
+ }
13
+ function credentialFlags(args) {
14
+ return (args.profile === void 0 ? "" : ` --profile ${shellWord(args.profile)}`) + (args.authFile === void 0 ? "" : ` --config ${shellWord(args.authFile)}`);
15
+ }
16
+
17
+ export {
18
+ shellWord,
19
+ credentialFlags
20
+ };
21
+ //# sourceMappingURL=chunk-FWD7AL6N.js.map
@@ -0,0 +1,138 @@
1
+ import {
2
+ rawResponse
3
+ } from "./chunk-AKNCFVKZ.js";
4
+ import {
5
+ RAW_ENVELOPE
6
+ } from "./chunk-YU4HSQW7.js";
7
+ import {
8
+ RAW_FIELD
9
+ } from "./chunk-TTEIYD5P.js";
10
+ import {
11
+ describeEntry
12
+ } from "./chunk-CIMQZRRE.js";
13
+ import {
14
+ __export
15
+ } from "./chunk-PZ5AY32C.js";
16
+
17
+ // src/codegen-entry.ts
18
+ var codegen_entry_exports = {};
19
+ __export(codegen_entry_exports, {
20
+ raw: () => raw,
21
+ rawField: () => rawField,
22
+ rawResponse: () => rawResponse,
23
+ rawValue: () => rawValue
24
+ });
25
+
26
+ // src/statements/special/raw.ts
27
+ var CANONICAL_KEYS = [
28
+ "as",
29
+ "name",
30
+ "_xsid",
31
+ "addon",
32
+ "input",
33
+ "mocks",
34
+ "output",
35
+ "context",
36
+ "runtime",
37
+ "disabled",
38
+ "description",
39
+ "settings_registry"
40
+ ];
41
+ function raw(envelope) {
42
+ if (envelope == null || typeof envelope !== "object" || Array.isArray(envelope)) {
43
+ throw new Error(
44
+ 'raw() expects a stored statement envelope object \u2014 at minimum `{ name: "mvp:\u2026", context: {\u2026} }` \u2014 but received ' + (envelope === null ? "null" : Array.isArray(envelope) ? "an array" : typeof envelope)
45
+ );
46
+ }
47
+ const name = envelope.name;
48
+ if (typeof name !== "string" || name === "") {
49
+ throw new Error(
50
+ 'raw() envelope is missing a `name`. A stored statement envelope must carry its `mvp:` name, e.g. `{ name: "mvp:set_var", context: {\u2026} }`.'
51
+ );
52
+ }
53
+ const stored = {};
54
+ for (const key of CANONICAL_KEYS) {
55
+ if (key in envelope) stored[key] = envelope[key];
56
+ }
57
+ for (const key of Object.keys(envelope)) {
58
+ if (!(key in stored)) stored[key] = envelope[key];
59
+ }
60
+ return {
61
+ name,
62
+ context: stored.context,
63
+ [RAW_ENVELOPE]: stored
64
+ };
65
+ }
66
+
67
+ // src/values/raw-value.ts
68
+ function rawValue(v) {
69
+ if (typeof v !== "object" || v === null || Array.isArray(v) || typeof v.tag !== "string") {
70
+ throw new Error(
71
+ `rawValue() takes a stored tagged value \u2014 { value, tag, filters? } \u2014 got ${describeEntry(v)}.`
72
+ );
73
+ }
74
+ if (v.filters !== void 0 && v.filters !== null && !Array.isArray(v.filters)) {
75
+ throw new Error(`rawValue(): \`filters\` must be a list of stored filters \u2014 got ${describeEntry(v.filters)}.`);
76
+ }
77
+ return { value: v.value, tag: v.tag, filters: [...v.filters ?? []] };
78
+ }
79
+
80
+ // src/fields/raw-field.ts
81
+ var CANONICAL_KEYS2 = [
82
+ "name",
83
+ "type",
84
+ "_xsid",
85
+ "description",
86
+ "nullable",
87
+ "default",
88
+ "merge",
89
+ "hidden",
90
+ "override",
91
+ "customize",
92
+ "required",
93
+ "values",
94
+ "mode",
95
+ "format",
96
+ "sensitive",
97
+ "list",
98
+ "vector",
99
+ "access",
100
+ "style",
101
+ "children",
102
+ "methods",
103
+ "market_item",
104
+ "is_settings_registry"
105
+ ];
106
+ function rawField(envelope) {
107
+ if (envelope == null || typeof envelope !== "object" || Array.isArray(envelope)) {
108
+ throw new Error(
109
+ 'rawField() expects a stored field envelope object \u2014 at minimum `{ name: "\u2026", type: "text" }` \u2014 but received ' + (envelope === null ? "null" : Array.isArray(envelope) ? "an array" : typeof envelope)
110
+ );
111
+ }
112
+ const { name, type } = envelope;
113
+ if (typeof name !== "string" || name === "") {
114
+ throw new Error('rawField() envelope is missing a `name`, e.g. `{ name: "email", type: "email" }`.');
115
+ }
116
+ if (typeof type !== "string" || type === "") {
117
+ throw new Error(`rawField() envelope for "${name}" is missing a \`type\`, e.g. "text" or "int".`);
118
+ }
119
+ const stored = {};
120
+ for (const key of CANONICAL_KEYS2) {
121
+ if (Object.hasOwn(envelope, key)) stored[key] = envelope[key];
122
+ }
123
+ for (const key of Object.keys(envelope)) {
124
+ if (!Object.hasOwn(stored, key)) stored[key] = envelope[key];
125
+ }
126
+ return {
127
+ type,
128
+ options: { [RAW_FIELD]: stored }
129
+ };
130
+ }
131
+
132
+ export {
133
+ raw,
134
+ rawValue,
135
+ rawField,
136
+ codegen_entry_exports
137
+ };
138
+ //# sourceMappingURL=chunk-FXFV3KU6.js.map