@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,592 @@
1
+ import {
2
+ printMicroserviceSection,
3
+ readMicroservices
4
+ } from "./chunk-FXRQOWTE.js";
5
+ import {
6
+ readUnanswered
7
+ } from "./chunk-AWEIIR2U.js";
8
+ import {
9
+ confirm
10
+ } from "./chunk-65HWOMGV.js";
11
+ import {
12
+ exportWorkspaceBundle
13
+ } from "./chunk-CJHQKJU4.js";
14
+ import "./chunk-3DRXWLJ5.js";
15
+ import "./chunk-X4DVXBFY.js";
16
+ import "./chunk-TRJCALW3.js";
17
+ import {
18
+ heldElsewhereError,
19
+ refuseUnreachableWorkspace,
20
+ whereaboutsOf
21
+ } from "./chunk-KTSDSD36.js";
22
+ import {
23
+ resolveOutputTarget,
24
+ secretsPhrase,
25
+ writeExportFile
26
+ } from "./chunk-SAVJUS2X.js";
27
+ import {
28
+ secretsCarriedBy,
29
+ secretsInMultidoc
30
+ } from "./chunk-45UIT5T2.js";
31
+ import "./chunk-HRVBLCVJ.js";
32
+ import "./chunk-YHEFQUQB.js";
33
+ import {
34
+ assertOneName
35
+ } from "./chunk-ZIY7RNUT.js";
36
+ import "./chunk-DAD3ONIS.js";
37
+ import {
38
+ projectDirFrom
39
+ } from "./chunk-6NNTNXN7.js";
40
+ import {
41
+ LookupFailedError,
42
+ SourceError,
43
+ isServerError,
44
+ isUnansweredLookup,
45
+ lookupFailed,
46
+ unansweredCause
47
+ } from "./chunk-QCNYHBL7.js";
48
+ import "./chunk-2ZUEE4EK.js";
49
+ import "./chunk-AN6BL47T.js";
50
+ import {
51
+ getAccessToken
52
+ } from "./chunk-ET4Y4XCB.js";
53
+ import "./chunk-SWBF2LTK.js";
54
+ import {
55
+ displayNameHint,
56
+ displayNameOwner,
57
+ isShared,
58
+ nearBackendLines,
59
+ nearBackendName,
60
+ sharedDisplayHint
61
+ } from "./chunk-UZ6QQWJT.js";
62
+ import "./chunk-A3UDOZB6.js";
63
+ import "./chunk-2MNLRIOX.js";
64
+ import "./chunk-3M4LFYNQ.js";
65
+ import "./chunk-AM4FKL4J.js";
66
+ import {
67
+ clearEnvironment,
68
+ clearEnvironmentsNamed,
69
+ clearEphemeralLanding,
70
+ getEnvironment,
71
+ readEphemeralState
72
+ } from "./chunk-5QU2P5CA.js";
73
+ import "./chunk-ZYJP6BOO.js";
74
+ import "./chunk-QO6BVGS5.js";
75
+ import "./chunk-JZGVVJSI.js";
76
+ import {
77
+ deleteEphemeral,
78
+ getEphemeral,
79
+ isExpired,
80
+ listAllEphemeral,
81
+ listEphemeral,
82
+ namedEphemeral
83
+ } from "./chunk-7G3CTU7I.js";
84
+ import {
85
+ multidocAnswer
86
+ } from "./chunk-6PBR37LN.js";
87
+ import "./chunk-T5KELPAR.js";
88
+ import "./chunk-622HUCZT.js";
89
+ import {
90
+ contextFlags
91
+ } from "./chunk-NAQDMEHV.js";
92
+ import "./chunk-5A2PLKZB.js";
93
+ import "./chunk-AHJWCYQO.js";
94
+ import "./chunk-DX4QR4B2.js";
95
+ import "./chunk-6QXLMMT3.js";
96
+ import "./chunk-ZFDZKNGG.js";
97
+ import "./chunk-FWD7AL6N.js";
98
+ import "./chunk-2GNFDZA2.js";
99
+ import "./chunk-JTUKLCXS.js";
100
+ import {
101
+ describeWrite
102
+ } from "./chunk-4KHEMC32.js";
103
+ import "./chunk-ROY4YAEQ.js";
104
+ import "./chunk-TLQE7ZN3.js";
105
+ import "./chunk-WRBKLYSJ.js";
106
+ import "./chunk-3LDULPRE.js";
107
+ import "./chunk-XW6KISBB.js";
108
+ import {
109
+ writeData
110
+ } from "./chunk-AWQ7BQTQ.js";
111
+ import "./chunk-EUUUMY7J.js";
112
+ import {
113
+ TransportError,
114
+ fetchReadOrExplain,
115
+ httpFailureError
116
+ } from "./chunk-YLDALTWZ.js";
117
+ import "./chunk-5FBYXK5P.js";
118
+ import "./chunk-LLNZGEFK.js";
119
+ import "./chunk-QXTKSOFI.js";
120
+ import "./chunk-X2NL4KUO.js";
121
+ import "./chunk-UCQ2VUTG.js";
122
+ import "./chunk-DGWHAVRG.js";
123
+ import {
124
+ UsageError,
125
+ discloseWriteTarget,
126
+ formatExpiration,
127
+ formatFields,
128
+ info,
129
+ isBackendHandle,
130
+ isMachineOutput,
131
+ printHuman,
132
+ safeText,
133
+ stdoutStyle,
134
+ step,
135
+ success,
136
+ unknownSubcommand,
137
+ verbBackendName,
138
+ warn,
139
+ writeJson,
140
+ writeTargetPayload
141
+ } from "./chunk-PTHVMXZI.js";
142
+ import "./chunk-2CMJZDCL.js";
143
+ import "./chunk-5V5XU32D.js";
144
+ import "./chunk-GSGDWJB5.js";
145
+ import "./chunk-ERVIASGL.js";
146
+ import "./chunk-4POWHT2K.js";
147
+ import "./chunk-H2V3N23D.js";
148
+ import "./chunk-UTI5G6OJ.js";
149
+ import "./chunk-2EZ3ZJZZ.js";
150
+ import "./chunk-6MR5TI5V.js";
151
+ import {
152
+ shellQuote
153
+ } from "./chunk-5ZSO4T2G.js";
154
+ import "./chunk-XNCP4KYO.js";
155
+ import "./chunk-YU4HSQW7.js";
156
+ import "./chunk-TFFGOFVZ.js";
157
+ import "./chunk-L5JYN3NM.js";
158
+ import "./chunk-G554NZNI.js";
159
+ import "./chunk-N5GKCWE5.js";
160
+ import "./chunk-OXA6PSZT.js";
161
+ import "./chunk-VAX3UZOY.js";
162
+ import "./chunk-NZOWWHU5.js";
163
+ import "./chunk-4BW2SG2N.js";
164
+ import "./chunk-TTEIYD5P.js";
165
+ import "./chunk-CIMQZRRE.js";
166
+ import "./chunk-OHX6MIUZ.js";
167
+ import "./chunk-36JUQZVQ.js";
168
+ import "./chunk-PZ5AY32C.js";
169
+
170
+ // src/emit/ephemeral-command.ts
171
+ import { basename, join, sep } from "path";
172
+ var TIMEOUT_MS = 12e4;
173
+ function goneError(name, clearedState, liveness = "gone", flags = "") {
174
+ const tail = clearedState ? " (cleared its local record)" : "";
175
+ return new SourceError(
176
+ `Ephemeral "${name}" has expired or no longer exists. Run \`xanosdk deploy${flags}\` to create a fresh one.${tail}`,
177
+ liveness,
178
+ "ephemeral"
179
+ );
180
+ }
181
+ async function resolveLive(auth, parentWorkspaceId, name, flags = "", verb = "get", verbFlags = "") {
182
+ const summary = await lookup(auth, parentWorkspaceId, name);
183
+ if (summary === null || isExpired(summary.expiresAt)) {
184
+ const owner = summary === null ? await displayNameOwner(auth, "ephemeral", name) : void 0;
185
+ if (owner !== void 0) throw displayNameError(name, owner, "", (n) => `xanosdk ephemeral ${verb} ${shellQuote(n)}${verbFlags}${flags}`);
186
+ const cleared = summary === null ? await clearMissedRecord(
187
+ auth,
188
+ name,
189
+ (where) => heldElsewhereError(auth, where, name, "no local record was cleared", `xanosdk ephemeral ${verb} ${shellQuote(name)}${verbFlags}${flags}`, {
190
+ verb,
191
+ name
192
+ })
193
+ ) : clearStaleRecord(auth, name);
194
+ const err = summary === null && !cleared ? unknownError(name, flags) : goneError(name, cleared, summary === null ? "gone" : "expired", flags);
195
+ const near = summary === null ? await nearEphemeral(auth, name) : void 0;
196
+ if (near === void 0) throw err;
197
+ throw new SourceError(
198
+ `${err.message}${nearBackendLines(near, (n) => `\`xanosdk ephemeral ${verb} ${shellQuote(n)}${verbFlags}${flags}\`.`)}`,
199
+ err instanceof SourceError ? err.liveness : "gone",
200
+ "ephemeral",
201
+ near.name,
202
+ near.names
203
+ );
204
+ }
205
+ return summary;
206
+ }
207
+ async function nearEphemeral(auth, name) {
208
+ return nearBackendName(auth, ["ephemeral"], name).catch(() => void 0);
209
+ }
210
+ async function nearForDelete(auth, kinds, name, noun) {
211
+ if (!isBackendHandle(name)) return nearBackendName(auth, kinds, name).catch(() => void 0);
212
+ return nearBackendName(auth, kinds, name, true).catch((err) => {
213
+ throw isUnansweredLookup(err) ? deleteLookupFailed(noun, name, err) : err;
214
+ });
215
+ }
216
+ async function clearMissedRecord(auth, name, elsewhere) {
217
+ await refuseUnreachableWorkspace(auth);
218
+ const where = await whereaboutsOf(auth, name, "ephemeral");
219
+ if (where.at === "elsewhere") throw elsewhere(where);
220
+ return where.at === "nowhere" && clearStaleRecord(auth, name);
221
+ }
222
+ async function confirmMissEverywhere(auth, name, kinds, noun, command) {
223
+ await refuseUnreachableWorkspace(auth);
224
+ const where = await whereaboutsOf(auth, name, kinds);
225
+ const nothing = "nothing was deleted, and no local record was cleared";
226
+ if (where.at === "elsewhere") {
227
+ throw heldElsewhereError(auth, where, name, nothing, command, {
228
+ verb: "delete",
229
+ name,
230
+ deleted: false,
231
+ alreadyGone: false,
232
+ declined: false,
233
+ clearedLandingRecord: false
234
+ });
235
+ }
236
+ if (where.at === "unknown") {
237
+ throw new LookupFailedError(
238
+ `Could not confirm ${noun} "${name}" is gone from every workspace this credential reaches (${where.detail}) \u2014 ${nothing}`,
239
+ "unreachable",
240
+ noun
241
+ ).withRerun(command);
242
+ }
243
+ }
244
+ async function lookup(auth, parentWorkspaceId, name, deleting = false) {
245
+ try {
246
+ return await getEphemeral(auth, { parentWorkspaceId, name });
247
+ } catch (err) {
248
+ if (isUnansweredLookup(err)) throw (deleting ? deleteLookupFailed : lookupFailed)("ephemeral", name, err);
249
+ throw err;
250
+ }
251
+ }
252
+ function deleteLookupFailed(kind, name, err) {
253
+ return asDeleteLookupFailure(lookupFailed(kind, name, err));
254
+ }
255
+ function asDeleteLookupFailure(err) {
256
+ if (!(err instanceof LookupFailedError)) return err;
257
+ return new LookupFailedError(
258
+ err.head.replace(/nothing was created or changed$/, "nothing was deleted"),
259
+ err.liveness,
260
+ err.kind
261
+ );
262
+ }
263
+ function unknownError(name, flags = "") {
264
+ return new SourceError(
265
+ `No ephemeral named "${name}". \`xanosdk ephemeral list${flags}\` shows the ones that exist.`,
266
+ "gone",
267
+ "ephemeral"
268
+ );
269
+ }
270
+ function displayNameError(name, owner, tail, rerun) {
271
+ if (isShared(owner)) {
272
+ const names = owner.owners.map((o) => o.name);
273
+ return new SourceError(
274
+ `No ephemeral named "${name}"${tail}.
275
+ ${sharedDisplayHint(name, owner, (o) => `\`${rerun(o.name)}\`.`)}`,
276
+ "gone",
277
+ "ephemeral",
278
+ names[0],
279
+ names
280
+ );
281
+ }
282
+ return new SourceError(
283
+ `No ephemeral named "${name}"${tail}.
284
+ ${displayNameHint("ephemeral", name, owner, `run \`${rerun(owner)}\`.`)}`,
285
+ "gone",
286
+ "ephemeral",
287
+ owner
288
+ );
289
+ }
290
+ function clearStaleRecord(auth, name, deleted = false) {
291
+ const tracked = getEnvironment(readEphemeralState(process.cwd()), auth);
292
+ const landing = clearEphemeralLanding(process.cwd(), auth.instance, name);
293
+ const own = tracked?.name === name && clearEnvironment(process.cwd(), auth);
294
+ const any = deleted && clearEnvironmentsNamed(process.cwd(), auth.instance, name);
295
+ return own || any || landing;
296
+ }
297
+ async function runEphemeralCommand(args) {
298
+ switch (args.subcommand) {
299
+ case "list":
300
+ return runList(args);
301
+ case "get":
302
+ return runGet(args);
303
+ case "delete":
304
+ return runDelete(args);
305
+ case "export":
306
+ return runExport(args);
307
+ default:
308
+ throw unknownSubcommand("ephemeral", args.subcommand, args.positionals);
309
+ }
310
+ }
311
+ async function runList(args) {
312
+ const auth = await getAccessToken(args);
313
+ const rows = await (args.allWorkspaces ? listAllEphemeral(auth) : listEphemeral(auth, { parentWorkspaceId: auth.workspaceId })).catch((err) => {
314
+ throw readUnanswered("ephemeral", "list ephemerals", "an empty list", err);
315
+ });
316
+ if (isMachineOutput(args)) {
317
+ writeJson({
318
+ ephemerals: rows.map((r) => ({ ...r, selector: `ephemeral:${r.name}`, workspaceId: r.workspaceId ?? auth.workspaceId }))
319
+ });
320
+ return;
321
+ }
322
+ const s = stdoutStyle();
323
+ if (rows.length === 0) {
324
+ process.stdout.write("No ephemeral tenants found\n");
325
+ return;
326
+ }
327
+ const lines = rows.map((r) => {
328
+ const exp = formatExpiration(r.expiresAt);
329
+ const expTxt = exp === "expired" ? s.red("expired") : s.dim(`expires ${exp}`);
330
+ const state = r.state ? s.dim(`[${safeText(r.state)}]`) : "";
331
+ const ws = args.allWorkspaces && r.workspaceId ? s.dim(` (workspace ${r.workspaceId})`) : "";
332
+ const label = r.display && r.display !== r.name ? ` ${s.dim(safeText(r.display))}` : "";
333
+ return ` ${s.bold(safeText(r.name))}${label} ${state} ${expTxt}${ws}`;
334
+ });
335
+ printHuman(lines.join("\n") + "\n");
336
+ }
337
+ async function runGet(args) {
338
+ const name = requireName(args, "get");
339
+ const auth = await getAccessToken(args);
340
+ const parentWorkspaceId = auth.workspaceId;
341
+ const summary = await resolveLive(auth, parentWorkspaceId, name, contextFlags(args), "get", args.json === true ? " --json" : "");
342
+ const microservices = summary.url === void 0 ? [] : await readMicroservices(auth, summary.url);
343
+ if (isMachineOutput(args)) {
344
+ writeJson({ ...summary, microservices, selector: `ephemeral:${summary.name}`, workspaceId: parentWorkspaceId });
345
+ return;
346
+ }
347
+ const s = stdoutStyle();
348
+ const rows = [];
349
+ if (summary.url) rows.push(["Base URL", s.bold(s.cyan(summary.url))]);
350
+ const label = summary.display && summary.display !== summary.name ? ` ${s.dim(summary.display)}` : "";
351
+ rows.push(["Tenant", `${s.bold(summary.name)}${label}`]);
352
+ if (summary.state) rows.push(["State", summary.state]);
353
+ rows.push(["Expires", s.dim(formatExpiration(summary.expiresAt))]);
354
+ printHuman("\n" + formatFields(rows));
355
+ printMicroserviceSection(microservices);
356
+ }
357
+ async function runDelete(args) {
358
+ const name = requireName(args, "delete");
359
+ const auth = await getAccessToken(args);
360
+ const parentWorkspaceId = auth.workspaceId;
361
+ const found = await lookup(auth, parentWorkspaceId, name, true);
362
+ const jsonFlag = args.json === true ? " --json" : "";
363
+ if (found === null) {
364
+ const owner = await displayNameOwner(auth, "ephemeral", name);
365
+ if (owner !== void 0) {
366
+ const yes = args.yes && !isShared(owner) ? " --yes" : "";
367
+ throw displayNameError(name, owner, " \u2014 nothing was deleted", (n) => `xanosdk ephemeral delete ${shellQuote(n)}${jsonFlag}${contextFlags(args)}${yes}`);
368
+ }
369
+ }
370
+ const near = found === null ? await nearForDelete(auth, ["ephemeral"], name, "ephemeral") : void 0;
371
+ if (found === null && (!isBackendHandle(name) || near !== void 0)) {
372
+ const meant = near === void 0 ? "" : nearBackendLines(near, deleteFix(args, jsonFlag));
373
+ throw new SourceError(
374
+ `No ephemeral named "${name}" \u2014 nothing was deleted. \`xanosdk ephemeral list${contextFlags(args)}\` shows the ones that exist.${meant}`,
375
+ "gone",
376
+ "ephemeral",
377
+ near?.name,
378
+ near?.names
379
+ );
380
+ }
381
+ if (found === null) {
382
+ const yes = args.yes ? " --yes" : "";
383
+ await confirmMissEverywhere(auth, name, "ephemeral", "ephemeral", `xanosdk ephemeral delete ${shellQuote(name)}${yes}${jsonFlag}${contextFlags(args)}`);
384
+ }
385
+ const named = found === null ? `ephemeral "${name}"` : namedEphemeral(found);
386
+ const refusing = !args.yes && found !== null && process.stdin.isTTY !== true;
387
+ if (found !== null) {
388
+ step(`${refusing ? "Would delete" : "Deleting"} ${named}`);
389
+ discloseWriteTarget({ base: auth.instance, workspaceId: auth.workspaceId });
390
+ }
391
+ const display = found?.display !== void 0 && found.display !== name ? found.display : void 0;
392
+ const destination = {
393
+ ...writeTargetPayload({ base: auth.instance, workspaceId: auth.workspaceId, kind: "ephemeral", label: name }),
394
+ url: found?.url ?? null,
395
+ display: display ?? null
396
+ };
397
+ if (!args.yes && found !== null) {
398
+ const ok = await confirm(`Delete ${named}? This destroys it and everything it serves.`, {
399
+ flag: "--yes",
400
+ // As `tenant delete` refuses off a terminal: the details, and this delete with `--yes`.
401
+ refusal: {
402
+ details: { verb: "delete", name, deleted: false, alreadyGone: false, declined: false, clearedLandingRecord: false },
403
+ rerun: `xanosdk ephemeral delete ${shellQuote(name)} --yes${args.json === true ? " --json" : ""}${contextFlags(args)}`
404
+ }
405
+ });
406
+ if (!ok) {
407
+ info("Deletion cancelled \u2014 nothing was deleted.");
408
+ if (isMachineOutput(args)) {
409
+ writeJson({ verb: "delete", destination, name, deleted: false, alreadyGone: false, declined: true, clearedLandingRecord: false });
410
+ }
411
+ return;
412
+ }
413
+ }
414
+ const { alreadyGone } = found === null ? { alreadyGone: true } : await describeWrite(
415
+ { what: `the delete of ${named}`, resolveWith: `xanosdk ephemeral get ${shellQuote(name)}${contextFlags(args)}` },
416
+ () => deleteEphemeral(auth, { parentWorkspaceId, name, verified: found.type === "ephemeral" })
417
+ ).catch((err) => {
418
+ const recordKept = getEnvironment(readEphemeralState(process.cwd()), auth)?.name === name;
419
+ throw unknownDeleteOutcome(err, named, name, contextFlags(args), "ephemeral", recordKept);
420
+ });
421
+ const cleared = clearStaleRecord(auth, name, found !== null);
422
+ if (alreadyGone) {
423
+ const meant = near === void 0 ? "" : nearBackendLines(near, deleteFix(args, jsonFlag)).replace(/\n/g, " ");
424
+ warn(
425
+ found === null && !cleared ? `No ephemeral named "${name}" \u2014 nothing was deleted.${meant}` : `Ephemeral "${name}" was already gone${cleared ? " (cleared its local record)" : ""}.${meant}`,
426
+ "ephemeral.not-found"
427
+ );
428
+ } else {
429
+ success(`Deleted ${named}${cleared ? " (cleared its local record)" : ""}`);
430
+ }
431
+ if (isMachineOutput(args)) {
432
+ writeJson({
433
+ verb: "delete",
434
+ destination,
435
+ name,
436
+ deleted: !alreadyGone,
437
+ alreadyGone,
438
+ declined: false,
439
+ clearedLandingRecord: cleared,
440
+ ...near === void 0 ? {} : { suggestion: near.name }
441
+ });
442
+ }
443
+ }
444
+ function unknownDeleteOutcome(err, named, name, flags, noun = "ephemeral", recordKept = noun !== "release") {
445
+ if (!(err instanceof Error)) return err;
446
+ const head = err.message.split("\n")[0];
447
+ if (/\nNothing was sent — retry\.$/.test(err.message)) {
448
+ const again = `xanosdk ${noun} delete ${shellQuote(name)}${flags} --yes`;
449
+ return new Error(`${head}
450
+ Nothing was sent \u2014 nothing was deleted. Once it is reachable, run \`${again}\` again.`, {
451
+ cause: err
452
+ });
453
+ }
454
+ if (!/may or may not have taken effect/.test(err.message)) return err;
455
+ const check = `xanosdk ${noun} ${noun === "release" ? "show" : "get"} ${shellQuote(name)}${flags}`;
456
+ return new Error(
457
+ `${head}
458
+ ${named.charAt(0).toUpperCase()}${named.slice(1)} may or may not have been deleted \u2014 check with \`${check}\` before retrying.${recordKept ? " Its local record was kept." : ""}`,
459
+ { cause: err }
460
+ );
461
+ }
462
+ async function runExport(args) {
463
+ const typed = args.positionals[0] === void 0 ? void 0 : requireName(args, "export");
464
+ const format = args.format ?? "json";
465
+ const ext = format === "multidoc" ? "xs" : "json";
466
+ const path = args.path ?? defaultExportDir();
467
+ const provisional = resolveOutputTarget({ path, name: args.name ?? typed ?? "ephemeral", ext });
468
+ refuseIgnoredName(args, provisional, ext);
469
+ const auth = await getAccessToken(args);
470
+ const { resolveEphemeralName } = await import("./env-target-O4HRKTGZ.js");
471
+ const name = typed ?? await resolveEphemeralName(auth, void 0);
472
+ const target = typed !== void 0 || args.name !== void 0 ? provisional : resolveOutputTarget({ path, name, ext });
473
+ const parentWorkspaceId = auth.workspaceId;
474
+ const exportFlags = (args.path !== void 0 ? ` --path ${shellQuote(args.path)}` : "") + (args.format !== void 0 ? ` --format ${shellQuote(args.format)}` : "") + (args.name !== void 0 ? ` --name ${shellQuote(args.name)}` : "") + (args.json === true ? " --json" : "");
475
+ const summary = await resolveLive(auth, parentWorkspaceId, name, contextFlags(args), "export", exportFlags);
476
+ let content;
477
+ let secrets;
478
+ if (format === "multidoc") {
479
+ content = await fetchEphemeralMultidoc(auth, parentWorkspaceId, name);
480
+ secrets = secretsInMultidoc(content);
481
+ } else {
482
+ const bundle = await fetchEphemeralBundle(auth, summary, name);
483
+ content = JSON.stringify(bundle, null, 2);
484
+ secrets = secretsCarriedBy(bundle);
485
+ }
486
+ if (target.kind === "stdout") {
487
+ writeData(process.stdout, content + "\n");
488
+ if (secrets.length > 0) {
489
+ warn(
490
+ `The export carries ${secretsPhrase(secrets)} in cleartext \u2014 written to stdout, where no file permission protects it; do not commit or log it.`,
491
+ "secrets.cleartext-stdout"
492
+ );
493
+ }
494
+ return;
495
+ }
496
+ writeExportFile(target.path, content + "\n", secrets);
497
+ if (isMachineOutput(args)) writeJson({ path: target.path, format });
498
+ success(`Exported ephemeral ${name}${format === "multidoc" ? " (multidoc)" : ""} \u2192 ${target.path}`);
499
+ }
500
+ function defaultExportDir(cwd = process.cwd()) {
501
+ return join(projectDirFrom(cwd) ?? cwd, ".xano", "exports") + sep;
502
+ }
503
+ function refuseIgnoredName(args, target, ext) {
504
+ if (args.name === void 0) return;
505
+ if (target.kind === "stdout") {
506
+ throw new UsageError(
507
+ "`--name` names the exported file, and `--path -` writes the export to stdout instead of a file. Drop one: `--path -` to pipe it, or `--name` (with or without a `--path` directory) to write a file.",
508
+ { hintFor: { command: "ephemeral", subcommand: "export" } }
509
+ );
510
+ }
511
+ if (basename(target.path) !== `${args.name}.${ext}`) {
512
+ throw new UsageError(
513
+ `\`--name\` names the exported file, and \`--path ${args.path}\` already names one. Drop one: \`--path <file>\` alone, or \`--name\` with a \`--path\` directory (or none, for the current one).`,
514
+ { hintFor: { command: "ephemeral", subcommand: "export" } }
515
+ );
516
+ }
517
+ }
518
+ async function fetchEphemeralMultidoc(auth, parentWorkspaceId, name) {
519
+ const action = "ephemeral export";
520
+ const url = new URL(`/api:meta/workspace/${parentWorkspaceId}/tenant/${encodeURIComponent(name)}/multidoc`, auth.instance);
521
+ try {
522
+ const res = await fetchReadOrExplain(
523
+ url.href,
524
+ {
525
+ headers: { accept: "text/x-xanoscript", Authorization: `Bearer ${auth.access_token}` },
526
+ signal: AbortSignal.timeout(TIMEOUT_MS)
527
+ },
528
+ action,
529
+ TIMEOUT_MS
530
+ );
531
+ const text = await res.text();
532
+ if (!res.ok) throw Object.assign(httpFailureError(action, res, text), { status: res.status });
533
+ return multidocAnswer(text, action, url.href);
534
+ } catch (err) {
535
+ if (!(err instanceof TransportError) && !isServerError(err)) throw err;
536
+ throw unansweredExport(err);
537
+ }
538
+ }
539
+ async function fetchEphemeralBundle(auth, summary, name) {
540
+ if (summary.url === void 0) throw goneError(name, false);
541
+ try {
542
+ return await exportWorkspaceBundle(auth, {
543
+ base: summary.url,
544
+ workspaceId: 1,
545
+ label: "ephemeral export"
546
+ });
547
+ } catch (err) {
548
+ if (!(err instanceof TransportError) && !isServerError(err)) throw err;
549
+ const again = await getEphemeral(auth, { parentWorkspaceId: auth.workspaceId, name }).then(
550
+ (s) => s === null || isExpired(s.expiresAt) ? "gone" : "live",
551
+ () => "unknown"
552
+ );
553
+ if (again === "gone") throw goneError(name, false);
554
+ throw unansweredExport(err, again === "live" ? namedEphemeral(summary) : void 0);
555
+ }
556
+ }
557
+ function unansweredExport(err, stillThere) {
558
+ const head = ((err instanceof Error ? err.message : String(err)).split("\n")[0] ?? "").trim().replace(/[.:]$/, "");
559
+ const what = err instanceof TransportError ? err.timeout ? "The export timed out" : "The connection dropped during the export" : `${unansweredCause(err)}, not a missing ephemeral`;
560
+ return new LookupFailedError(
561
+ `${head}.
562
+ ${what}${stillThere === void 0 ? "" : ` \u2014 ${stillThere} is still there`}; nothing was written`,
563
+ "unreachable",
564
+ "ephemeral"
565
+ );
566
+ }
567
+ function requireName(args, verb) {
568
+ const name = args.positionals[0]?.trim();
569
+ if (name === void 0 || name === "") {
570
+ throw new UsageError(
571
+ `\`xanosdk ephemeral ${verb}\` needs an ephemeral name. \`xanosdk ephemeral list${contextFlags(args)}\` shows the ones that exist.`,
572
+ { hintFor: { command: "ephemeral", subcommand: verb } }
573
+ );
574
+ }
575
+ assertOneName(args.positionals[0], "the ephemeral name", { args, helpFor: { command: "ephemeral", subcommand: verb } });
576
+ return verbBackendName(name, "ephemeral", { command: "ephemeral", subcommand: verb }, contextFlags(args));
577
+ }
578
+ function deleteFix(args, jsonFlag) {
579
+ return (n) => `\`xanosdk ephemeral delete ${shellQuote(n)}${jsonFlag}${contextFlags(args)}\` deletes it, after asking to confirm.`;
580
+ }
581
+ export {
582
+ asDeleteLookupFailure,
583
+ confirmMissEverywhere,
584
+ defaultExportDir,
585
+ deleteLookupFailed,
586
+ fetchEphemeralBundle,
587
+ nearForDelete,
588
+ resolveLive,
589
+ runEphemeralCommand,
590
+ unknownDeleteOutcome
591
+ };
592
+ //# sourceMappingURL=ephemeral-command-CLJJKOFT.js.map
@@ -0,0 +1,61 @@
1
+ import {
2
+ allLandings,
3
+ clearEnvironment,
4
+ clearEnvironmentsNamed,
5
+ clearEphemeralLanding,
6
+ environmentKey,
7
+ ephemeralLandedOn,
8
+ ephemeralLandingKey,
9
+ ephemeralStatePath,
10
+ getEnvironment,
11
+ markEnvironmentFilled,
12
+ readEphemeralState,
13
+ recordEphemeralLanding,
14
+ recordStaticUrl,
15
+ setEnvironment,
16
+ unreadableEphemeralState
17
+ } from "./chunk-5QU2P5CA.js";
18
+ import "./chunk-ZYJP6BOO.js";
19
+ import "./chunk-QO6BVGS5.js";
20
+ import "./chunk-JZGVVJSI.js";
21
+ import "./chunk-FWD7AL6N.js";
22
+ import "./chunk-TLQE7ZN3.js";
23
+ import "./chunk-XW6KISBB.js";
24
+ import "./chunk-AWQ7BQTQ.js";
25
+ import "./chunk-EUUUMY7J.js";
26
+ import "./chunk-YLDALTWZ.js";
27
+ import "./chunk-5FBYXK5P.js";
28
+ import "./chunk-LLNZGEFK.js";
29
+ import "./chunk-QXTKSOFI.js";
30
+ import "./chunk-X2NL4KUO.js";
31
+ import "./chunk-PTHVMXZI.js";
32
+ import "./chunk-UTI5G6OJ.js";
33
+ import "./chunk-2EZ3ZJZZ.js";
34
+ import "./chunk-6MR5TI5V.js";
35
+ import "./chunk-5ZSO4T2G.js";
36
+ import "./chunk-XNCP4KYO.js";
37
+ import "./chunk-TFFGOFVZ.js";
38
+ import "./chunk-NZOWWHU5.js";
39
+ import "./chunk-4BW2SG2N.js";
40
+ import "./chunk-CIMQZRRE.js";
41
+ import "./chunk-OHX6MIUZ.js";
42
+ import "./chunk-36JUQZVQ.js";
43
+ import "./chunk-PZ5AY32C.js";
44
+ export {
45
+ allLandings,
46
+ clearEnvironment,
47
+ clearEnvironmentsNamed,
48
+ clearEphemeralLanding,
49
+ environmentKey,
50
+ ephemeralLandedOn,
51
+ ephemeralLandingKey,
52
+ ephemeralStatePath,
53
+ getEnvironment,
54
+ markEnvironmentFilled,
55
+ readEphemeralState,
56
+ recordEphemeralLanding,
57
+ recordStaticUrl,
58
+ setEnvironment,
59
+ unreadableEphemeralState
60
+ };
61
+ //# sourceMappingURL=ephemeral-state-PYCBSOGX.js.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ tryLock,
3
+ withFileLockSync
4
+ } from "./chunk-QO6BVGS5.js";
5
+ import "./chunk-PZ5AY32C.js";
6
+ export {
7
+ tryLock,
8
+ withFileLockSync
9
+ };
10
+ //# sourceMappingURL=file-lock-PT74GWYW.js.map