@xano/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +788 -0
- package/LICENSE +21 -0
- package/README.md +541 -0
- package/dist/.build-fingerprint +1 -0
- package/dist/agent-file-refresh-ZEMK33AX.js +38 -0
- package/dist/answer-shape-K67TAAPY.js +33 -0
- package/dist/backend-dir-2U53CIAL.js +39 -0
- package/dist/backend-slot-7QXW2QYC.js +28 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +255 -0
- package/dist/branch-NCRNWQBQ.js +61 -0
- package/dist/branch-commands-ACIRCEQJ.js +79 -0
- package/dist/bundle.d.ts +223 -0
- package/dist/bundle.js +153 -0
- package/dist/capture-WAXPD7DR.js +41 -0
- package/dist/chunk-27GWNP2I.js +23 -0
- package/dist/chunk-2CMJZDCL.js +177 -0
- package/dist/chunk-2EZ3ZJZZ.js +302 -0
- package/dist/chunk-2GNFDZA2.js +390 -0
- package/dist/chunk-2MNLRIOX.js +11 -0
- package/dist/chunk-2TFRR6JV.js +104 -0
- package/dist/chunk-2ZUEE4EK.js +408 -0
- package/dist/chunk-36JUQZVQ.js +22 -0
- package/dist/chunk-3DRXWLJ5.js +83 -0
- package/dist/chunk-3JDU4VRL.js +137 -0
- package/dist/chunk-3KZCLN4Z.js +241 -0
- package/dist/chunk-3LDULPRE.js +168 -0
- package/dist/chunk-3M4LFYNQ.js +111 -0
- package/dist/chunk-3XI5CTUE.js +22 -0
- package/dist/chunk-3YW23UFH.js +50 -0
- package/dist/chunk-45UIT5T2.js +862 -0
- package/dist/chunk-4BW2SG2N.js +46 -0
- package/dist/chunk-4KHEMC32.js +79 -0
- package/dist/chunk-4POWHT2K.js +321 -0
- package/dist/chunk-4Q2GN7NW.js +192 -0
- package/dist/chunk-5A2PLKZB.js +70 -0
- package/dist/chunk-5FBYXK5P.js +159 -0
- package/dist/chunk-5HVXPTU4.js +323 -0
- package/dist/chunk-5QU2P5CA.js +304 -0
- package/dist/chunk-5V5XU32D.js +191 -0
- package/dist/chunk-5ZSO4T2G.js +10 -0
- package/dist/chunk-622HUCZT.js +10 -0
- package/dist/chunk-65HWOMGV.js +177 -0
- package/dist/chunk-6ELFRN3P.js +365 -0
- package/dist/chunk-6HO3NCSJ.js +1055 -0
- package/dist/chunk-6IUMKYWI.js +457 -0
- package/dist/chunk-6KEB3C3U.js +65 -0
- package/dist/chunk-6MR5TI5V.js +987 -0
- package/dist/chunk-6NNTNXN7.js +157 -0
- package/dist/chunk-6PBR37LN.js +97 -0
- package/dist/chunk-6QXLMMT3.js +155 -0
- package/dist/chunk-6ZGJCBZS.js +224 -0
- package/dist/chunk-73IVBKMA.js +250 -0
- package/dist/chunk-7G3CTU7I.js +286 -0
- package/dist/chunk-A3UDOZB6.js +222 -0
- package/dist/chunk-A6E77GDW.js +85 -0
- package/dist/chunk-AHJWCYQO.js +660 -0
- package/dist/chunk-AKNCFVKZ.js +36 -0
- package/dist/chunk-AM4FKL4J.js +237 -0
- package/dist/chunk-AN6BL47T.js +26 -0
- package/dist/chunk-AOSYVMUS.js +147 -0
- package/dist/chunk-APWXY5SL.js +182 -0
- package/dist/chunk-AWEIIR2U.js +218 -0
- package/dist/chunk-AWQ7BQTQ.js +73 -0
- package/dist/chunk-BAUZOWGX.js +393 -0
- package/dist/chunk-BHACRS6R.js +940 -0
- package/dist/chunk-BWPNT55T.js +680 -0
- package/dist/chunk-C6RIMRU4.js +187 -0
- package/dist/chunk-CGVQZXYG.js +263 -0
- package/dist/chunk-CIMQZRRE.js +162 -0
- package/dist/chunk-CJHQKJU4.js +113 -0
- package/dist/chunk-CTMO46PK.js +1897 -0
- package/dist/chunk-D53J55C5.js +106 -0
- package/dist/chunk-D7VGG3WS.js +90 -0
- package/dist/chunk-DAD3ONIS.js +245 -0
- package/dist/chunk-DGWHAVRG.js +162 -0
- package/dist/chunk-DX4QR4B2.js +483 -0
- package/dist/chunk-EHP3WPEG.js +21 -0
- package/dist/chunk-ELP2HMXC.js +432 -0
- package/dist/chunk-ERVIASGL.js +21 -0
- package/dist/chunk-ET4Y4XCB.js +865 -0
- package/dist/chunk-ETO6LGLD.js +4750 -0
- package/dist/chunk-EUUUMY7J.js +24 -0
- package/dist/chunk-FQJ2TTHP.js +218 -0
- package/dist/chunk-FQOF7E2E.js +133 -0
- package/dist/chunk-FWD7AL6N.js +21 -0
- package/dist/chunk-FXFV3KU6.js +138 -0
- package/dist/chunk-FXRQOWTE.js +171 -0
- package/dist/chunk-G554NZNI.js +210 -0
- package/dist/chunk-GSGDWJB5.js +13 -0
- package/dist/chunk-H2V3N23D.js +66 -0
- package/dist/chunk-H5C7MBCR.js +159 -0
- package/dist/chunk-HHN734BU.js +371 -0
- package/dist/chunk-HRVBLCVJ.js +243 -0
- package/dist/chunk-HVRUQXGD.js +1264 -0
- package/dist/chunk-I4F5TCJH.js +130 -0
- package/dist/chunk-IDOTCMDV.js +57 -0
- package/dist/chunk-IGOLHKWF.js +427 -0
- package/dist/chunk-JGE7CAWB.js +148 -0
- package/dist/chunk-JTUKLCXS.js +92 -0
- package/dist/chunk-JZGVVJSI.js +66 -0
- package/dist/chunk-K4WX6UUU.js +923 -0
- package/dist/chunk-K5BBGTYZ.js +217 -0
- package/dist/chunk-K6RXBGUB.js +427 -0
- package/dist/chunk-KTSDSD36.js +165 -0
- package/dist/chunk-L5JYN3NM.js +1038 -0
- package/dist/chunk-LIEOKXKD.js +354 -0
- package/dist/chunk-LLNZGEFK.js +51 -0
- package/dist/chunk-LPECSJ2J.js +55 -0
- package/dist/chunk-LQCMKAJ7.js +413 -0
- package/dist/chunk-LRN4ZJCQ.js +1145 -0
- package/dist/chunk-MJ4ZVHKN.js +17 -0
- package/dist/chunk-MXHSQOC4.js +3061 -0
- package/dist/chunk-N5GKCWE5.js +367 -0
- package/dist/chunk-NA3PXMEF.js +10 -0
- package/dist/chunk-NAQDMEHV.js +76 -0
- package/dist/chunk-NWKXM5RD.js +109 -0
- package/dist/chunk-NZOWWHU5.js +196 -0
- package/dist/chunk-OHX6MIUZ.js +184 -0
- package/dist/chunk-OOXWYAA4.js +15 -0
- package/dist/chunk-OPHB5ORL.js +1990 -0
- package/dist/chunk-OXA6PSZT.js +1725 -0
- package/dist/chunk-P2HAGF6H.js +73 -0
- package/dist/chunk-PTHVMXZI.js +3036 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-Q325JKYB.js +189 -0
- package/dist/chunk-Q7DGTQ5G.js +255 -0
- package/dist/chunk-QCNYHBL7.js +601 -0
- package/dist/chunk-QO6BVGS5.js +145 -0
- package/dist/chunk-QXTKSOFI.js +76 -0
- package/dist/chunk-ROY4YAEQ.js +66 -0
- package/dist/chunk-RTJRZFFY.js +447 -0
- package/dist/chunk-SAVJUS2X.js +128 -0
- package/dist/chunk-SFLHVCKX.js +173 -0
- package/dist/chunk-STSFNCY4.js +127 -0
- package/dist/chunk-SWBF2LTK.js +170 -0
- package/dist/chunk-T5KELPAR.js +109 -0
- package/dist/chunk-TFFGOFVZ.js +1481 -0
- package/dist/chunk-TLHIFK4M.js +256 -0
- package/dist/chunk-TLQE7ZN3.js +156 -0
- package/dist/chunk-TPHWJ7UG.js +1981 -0
- package/dist/chunk-TRJCALW3.js +291 -0
- package/dist/chunk-TTEIYD5P.js +133 -0
- package/dist/chunk-U64O2MXY.js +407 -0
- package/dist/chunk-UCQ2VUTG.js +630 -0
- package/dist/chunk-UTI5G6OJ.js +44 -0
- package/dist/chunk-UVHDMMIP.js +188 -0
- package/dist/chunk-UZ6QQWJT.js +120 -0
- package/dist/chunk-VAX3UZOY.js +686 -0
- package/dist/chunk-W3HBUKFO.js +57 -0
- package/dist/chunk-WKQLGKCL.js +2823 -0
- package/dist/chunk-WQFNASK4.js +560 -0
- package/dist/chunk-WRBKLYSJ.js +224 -0
- package/dist/chunk-WTPZRR4I.js +17 -0
- package/dist/chunk-WZDJ2LLX.js +2385 -0
- package/dist/chunk-X2NL4KUO.js +14 -0
- package/dist/chunk-X4DVXBFY.js +38 -0
- package/dist/chunk-X677DMZM.js +7050 -0
- package/dist/chunk-XBKMWY7F.js +612 -0
- package/dist/chunk-XNCP4KYO.js +78 -0
- package/dist/chunk-XVBGLISP.js +35 -0
- package/dist/chunk-XW6KISBB.js +1192 -0
- package/dist/chunk-YGZHHAAB.js +8156 -0
- package/dist/chunk-YHEFQUQB.js +186 -0
- package/dist/chunk-YLDALTWZ.js +653 -0
- package/dist/chunk-YU4HSQW7.js +229 -0
- package/dist/chunk-ZDPP6RKB.js +27 -0
- package/dist/chunk-ZFDZKNGG.js +194 -0
- package/dist/chunk-ZIY7RNUT.js +49 -0
- package/dist/chunk-ZYJP6BOO.js +30 -0
- package/dist/cli.d.ts +1111 -0
- package/dist/cli.js +165 -0
- package/dist/codegen-command-VR2GWR6C.js +173 -0
- package/dist/codegen.d.ts +115 -0
- package/dist/codegen.js +19 -0
- package/dist/commands-GJMJ4XYZ.js +76 -0
- package/dist/completion-ZQLO6PB6.js +738 -0
- package/dist/config-MBYGCAFK.js +136 -0
- package/dist/deploy-command-JVZPWHMK.js +180 -0
- package/dist/deploy-source-3W45CXMP.js +81 -0
- package/dist/dev-env-sync-HN44K4D5.js +188 -0
- package/dist/diagnostics-UEAAHWVF.js +30 -0
- package/dist/display-name-hint-ABBPVQIR.js +46 -0
- package/dist/emit-CyhBDxli.d.ts +7007 -0
- package/dist/env-example-refresh-ET5HMMDW.js +126 -0
- package/dist/env-pull-command-TNMNB3CV.js +323 -0
- package/dist/env-target-O4HRKTGZ.js +40 -0
- package/dist/env-var-command-ZIRDCAZA.js +427 -0
- package/dist/ephemeral-P7F3PMAD.js +54 -0
- package/dist/ephemeral-command-CLJJKOFT.js +592 -0
- package/dist/ephemeral-state-PYCBSOGX.js +61 -0
- package/dist/file-lock-PT74GWYW.js +10 -0
- package/dist/generate-command-AYEOLA26.js +510 -0
- package/dist/gitignore-3SJ3WNRG.js +51 -0
- package/dist/guards-4EBNCZDC.js +162 -0
- package/dist/hosted-file-PSHJB3HX.js +28 -0
- package/dist/impersonate-command-5JAS3WSV.js +152 -0
- package/dist/import-EQSFU6JC.js +19 -0
- package/dist/index.d.ts +5470 -0
- package/dist/index.js +371 -0
- package/dist/init-command-X2FR4UAK.js +125 -0
- package/dist/init-modules-RY7UHAOL.js +50 -0
- package/dist/init-web-M4YZSZK6.js +42 -0
- package/dist/internal.d.ts +179 -0
- package/dist/internal.js +2634 -0
- package/dist/io-RC56QSN5.js +26 -0
- package/dist/keep-data-merge-7MPLVAVI.js +1119 -0
- package/dist/lambda-config-reconcile-OUZ4OYAB.js +116 -0
- package/dist/landed-753YLJ5H.js +40 -0
- package/dist/landing-record-SU52SKXU.js +61 -0
- package/dist/live-diff-YONW2VI3.js +65 -0
- package/dist/local-engine-choice-CH5X3W7E.js +79 -0
- package/dist/local-engine-command-Z3OL7VOD.js +766 -0
- package/dist/local-engine-config-5U3SC434.js +39 -0
- package/dist/local-engine-deploy-PCQ4SNPB.js +39 -0
- package/dist/local-engine-process-EHTE5LLU.js +63 -0
- package/dist/local-engine-state-A4FTRFAF.js +32 -0
- package/dist/local-engine-update-check-6L645VBL.js +162 -0
- package/dist/lock-MRRHW5GS.js +87 -0
- package/dist/lock-commands-2QG25HL7.js +963 -0
- package/dist/login-command-QPYRWOXZ.js +538 -0
- package/dist/logout-command-WOIQLDP6.js +56 -0
- package/dist/loop-ALIZLOSX.js +191 -0
- package/dist/marketplace-command-K5YL42NO.js +977 -0
- package/dist/marketplace-resolve-LY32JES5.js +40 -0
- package/dist/meta-client-YXGPW53C.js +244 -0
- package/dist/module-manifest-JFGHU2TC.js +38 -0
- package/dist/near-key.d.ts +13 -0
- package/dist/near-key.js +8 -0
- package/dist/node.d.ts +95 -0
- package/dist/node.js +969 -0
- package/dist/operation-outcome-TZSESNC7.js +51 -0
- package/dist/output-target-AL3I44GG.js +47 -0
- package/dist/package-manager-PRAHUSCN.js +34 -0
- package/dist/plan-disclosure-6G4MLZKD.js +114 -0
- package/dist/plugin-contributions-WRNY5ABG.js +28 -0
- package/dist/plugin-prompt-4VA3B4FF.js +20 -0
- package/dist/plugin-questions-JTSYA74Q.js +24 -0
- package/dist/plugin.d.ts +396 -0
- package/dist/plugin.js +1 -0
- package/dist/preflight-command-2T5Z36MI.js +321 -0
- package/dist/profile-command-AH3PIM4X.js +800 -0
- package/dist/profile-pointer-GRWJU3YD.js +31 -0
- package/dist/profile-select-74TRDEPD.js +23 -0
- package/dist/project-dependency-KSH63ODT.js +35 -0
- package/dist/project-sdk-REPPOIBD.js +24 -0
- package/dist/promote-command-PCWT5N6S.js +140 -0
- package/dist/prompt-II3F3LND.js +27 -0
- package/dist/publish-command-TTDUUJI5.js +414 -0
- package/dist/pull-command-VBO7C4S3.js +161 -0
- package/dist/pull-superseded-GJWLG7XO.js +20 -0
- package/dist/release-command-N4ZPKMHR.js +146 -0
- package/dist/release-ns-command-3KFDMZ6G.js +1745 -0
- package/dist/response-HlXahv4K.d.ts +925 -0
- package/dist/retry-command-AS5EVREX.js +34 -0
- package/dist/routes-manifest-SNWUVBT6.js +43 -0
- package/dist/runtime-XETHVF33.js +14 -0
- package/dist/scaffold.d.ts +1911 -0
- package/dist/scaffold.js +107 -0
- package/dist/secrets-file-LVZD6IIM.js +56 -0
- package/dist/secrets-fill-command-TTCPSVXN.js +218 -0
- package/dist/seed-VU7C3QYS.js +46 -0
- package/dist/sent-writes-N7X4OVXT.js +22 -0
- package/dist/source-resolve-S2XA3XZF.js +83 -0
- package/dist/static-host-B2Y6AG3W.js +352 -0
- package/dist/status-command-RUDXTF7I.js +554 -0
- package/dist/store-6VNCD4D7.js +20 -0
- package/dist/store-ARM6VMO5.js +98 -0
- package/dist/store-DuYfzKlW.d.ts +3144 -0
- package/dist/suggest-6FOOYKHG.js +12 -0
- package/dist/sveltekit.d.ts +154 -0
- package/dist/sveltekit.js +109 -0
- package/dist/sync-contributions-UCEROO26.js +415 -0
- package/dist/table-ENAVMITR.js +42 -0
- package/dist/tables-command-GUPXXSB5.js +156 -0
- package/dist/tenant-IIHPOHGP.js +42 -0
- package/dist/tenant-command-D5HGI2X4.js +965 -0
- package/dist/test-command-TIKZMDPZ.js +476 -0
- package/dist/tests-BGGIOK3L.js +26 -0
- package/dist/token-NICJUTMT.js +72 -0
- package/dist/toolchain-hooks-GHKLUJOH.js +96 -0
- package/dist/toolchain-modules-5EAZUONB.js +24 -0
- package/dist/tracked-backend-EIBUMDZA.js +80 -0
- package/dist/update-check-2W2NLDTC.js +136 -0
- package/dist/upgrade-command-QHNFWM7O.js +531 -0
- package/dist/verify-rollout-DRCK5TDD.js +61 -0
- package/dist/whoami-command-STGINTXH.js +51 -0
- package/dist/workspace-2CLHU2LK.js +93 -0
- package/dist/workspace-binding-56PIIPCP.js +54 -0
- package/dist/workspace-command-JEXQETJD.js +535 -0
- package/dist/workspace-env-F2RFMSC5.js +70 -0
- package/dist/workspace-export-OJSH2HIW.js +21 -0
- package/dist/writable-VA7OISSK.js +25 -0
- package/dist/xano-ICFUSPFR.js +42 -0
- package/dist/xanosdk-import-GN42TO2B.js +56 -0
- package/dist/xanosdk-project-S6DXJONQ.js +41 -0
- package/dist/xdo-CxDr2Q1C.d.ts +1371 -0
- package/guides/README.md +33 -0
- package/guides/authoring.md +921 -0
- package/guides/cli.md +401 -0
- package/guides/codegen.md +177 -0
- package/guides/codes.md +404 -0
- package/guides/coverage.md +74 -0
- package/guides/deploying.md +1525 -0
- package/guides/environment.md +400 -0
- package/guides/marketplace.md +415 -0
- package/guides/module-contract.md +558 -0
- package/guides/object-kinds.md +433 -0
- package/guides/project-structure.md +43 -0
- package/guides/scaffold.md +351 -0
- package/guides/typed-frontend.md +242 -0
- package/llms/client.md +63 -0
- package/llms/errors.md +56 -0
- package/llms/fields.md +176 -0
- package/llms/filters.md +183 -0
- package/llms/kinds-agent-mcp.md +30 -0
- package/llms/kinds-core.md +100 -0
- package/llms/kinds-knowledge.md +20 -0
- package/llms/kinds-realtime.md +76 -0
- package/llms/lambda.md +94 -0
- package/llms/legacy.md +44 -0
- package/llms/lock.md +40 -0
- package/llms/object-kinds.md +34 -0
- package/llms/statements-calls.md +62 -0
- package/llms/statements-catalog.md +320 -0
- package/llms/statements-data.md +66 -0
- package/llms/statements-runtime.md +68 -0
- package/llms/tests.md +59 -0
- package/llms/toolchain.md +16 -0
- package/llms/triggers.md +36 -0
- package/llms/values.md +29 -0
- package/llms-full.txt +2085 -0
- package/llms.txt +493 -0
- package/manifest.json +11224 -0
- package/package.json +162 -0
- package/types/lambda-globals.d.ts +129 -0
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
import {
|
|
2
|
+
profileValue,
|
|
3
|
+
rejectedFixCommand,
|
|
4
|
+
rejectedRemedy,
|
|
5
|
+
signedInValue,
|
|
6
|
+
workspaceValue
|
|
7
|
+
} from "./chunk-UVHDMMIP.js";
|
|
8
|
+
import {
|
|
9
|
+
reachableInline,
|
|
10
|
+
reachableWorkspaces
|
|
11
|
+
} from "./chunk-KTSDSD36.js";
|
|
12
|
+
import {
|
|
13
|
+
readTrackedBackend
|
|
14
|
+
} from "./chunk-HHN734BU.js";
|
|
15
|
+
import {
|
|
16
|
+
readDeployed
|
|
17
|
+
} from "./chunk-LPECSJ2J.js";
|
|
18
|
+
import {
|
|
19
|
+
isProjectDir,
|
|
20
|
+
projectDirFrom
|
|
21
|
+
} from "./chunk-6NNTNXN7.js";
|
|
22
|
+
import {
|
|
23
|
+
LookupFailedError,
|
|
24
|
+
lookupEphemeral
|
|
25
|
+
} from "./chunk-QCNYHBL7.js";
|
|
26
|
+
import "./chunk-2ZUEE4EK.js";
|
|
27
|
+
import "./chunk-AN6BL47T.js";
|
|
28
|
+
import {
|
|
29
|
+
NotSignedInError,
|
|
30
|
+
StoredCredentialError,
|
|
31
|
+
getAccessToken
|
|
32
|
+
} from "./chunk-ET4Y4XCB.js";
|
|
33
|
+
import "./chunk-SWBF2LTK.js";
|
|
34
|
+
import "./chunk-UZ6QQWJT.js";
|
|
35
|
+
import "./chunk-A3UDOZB6.js";
|
|
36
|
+
import "./chunk-2MNLRIOX.js";
|
|
37
|
+
import {
|
|
38
|
+
getEngineRecord
|
|
39
|
+
} from "./chunk-3M4LFYNQ.js";
|
|
40
|
+
import {
|
|
41
|
+
isLoopbackUrl
|
|
42
|
+
} from "./chunk-AM4FKL4J.js";
|
|
43
|
+
import "./chunk-STSFNCY4.js";
|
|
44
|
+
import {
|
|
45
|
+
environmentKey,
|
|
46
|
+
getEnvironment,
|
|
47
|
+
readEphemeralState,
|
|
48
|
+
unreadableEphemeralState
|
|
49
|
+
} from "./chunk-5QU2P5CA.js";
|
|
50
|
+
import "./chunk-ZYJP6BOO.js";
|
|
51
|
+
import "./chunk-QO6BVGS5.js";
|
|
52
|
+
import "./chunk-JZGVVJSI.js";
|
|
53
|
+
import {
|
|
54
|
+
isExpired
|
|
55
|
+
} from "./chunk-7G3CTU7I.js";
|
|
56
|
+
import "./chunk-6PBR37LN.js";
|
|
57
|
+
import {
|
|
58
|
+
retryCommand
|
|
59
|
+
} from "./chunk-T5KELPAR.js";
|
|
60
|
+
import "./chunk-622HUCZT.js";
|
|
61
|
+
import {
|
|
62
|
+
ENV_CREDENTIAL_VARS,
|
|
63
|
+
credentialFileFlagFor,
|
|
64
|
+
credentialFileOf,
|
|
65
|
+
recordedByEnvCredential
|
|
66
|
+
} from "./chunk-NAQDMEHV.js";
|
|
67
|
+
import "./chunk-5A2PLKZB.js";
|
|
68
|
+
import "./chunk-AHJWCYQO.js";
|
|
69
|
+
import "./chunk-DX4QR4B2.js";
|
|
70
|
+
import "./chunk-6QXLMMT3.js";
|
|
71
|
+
import "./chunk-ZFDZKNGG.js";
|
|
72
|
+
import "./chunk-FWD7AL6N.js";
|
|
73
|
+
import "./chunk-2GNFDZA2.js";
|
|
74
|
+
import "./chunk-JTUKLCXS.js";
|
|
75
|
+
import "./chunk-4KHEMC32.js";
|
|
76
|
+
import "./chunk-ROY4YAEQ.js";
|
|
77
|
+
import "./chunk-TLQE7ZN3.js";
|
|
78
|
+
import "./chunk-WRBKLYSJ.js";
|
|
79
|
+
import "./chunk-3LDULPRE.js";
|
|
80
|
+
import {
|
|
81
|
+
loginCommand,
|
|
82
|
+
profileAddCommand,
|
|
83
|
+
recordedCredentialPath,
|
|
84
|
+
recordedProfileStored
|
|
85
|
+
} from "./chunk-XW6KISBB.js";
|
|
86
|
+
import "./chunk-AWQ7BQTQ.js";
|
|
87
|
+
import "./chunk-EUUUMY7J.js";
|
|
88
|
+
import {
|
|
89
|
+
fetchOrExplain,
|
|
90
|
+
httpFailure,
|
|
91
|
+
parseJsonAnswer
|
|
92
|
+
} from "./chunk-YLDALTWZ.js";
|
|
93
|
+
import "./chunk-5FBYXK5P.js";
|
|
94
|
+
import "./chunk-LLNZGEFK.js";
|
|
95
|
+
import {
|
|
96
|
+
selectionDocument
|
|
97
|
+
} from "./chunk-QXTKSOFI.js";
|
|
98
|
+
import "./chunk-X2NL4KUO.js";
|
|
99
|
+
import "./chunk-UCQ2VUTG.js";
|
|
100
|
+
import "./chunk-DGWHAVRG.js";
|
|
101
|
+
import {
|
|
102
|
+
CliError,
|
|
103
|
+
EXIT_SOURCE_UNRESOLVABLE,
|
|
104
|
+
displayPath,
|
|
105
|
+
formatExpiration,
|
|
106
|
+
formatFields,
|
|
107
|
+
isMachineOutput,
|
|
108
|
+
isUsageError,
|
|
109
|
+
printHuman,
|
|
110
|
+
stdoutStyle,
|
|
111
|
+
writeJson
|
|
112
|
+
} from "./chunk-PTHVMXZI.js";
|
|
113
|
+
import "./chunk-UTI5G6OJ.js";
|
|
114
|
+
import "./chunk-2EZ3ZJZZ.js";
|
|
115
|
+
import "./chunk-6MR5TI5V.js";
|
|
116
|
+
import {
|
|
117
|
+
shellQuote
|
|
118
|
+
} from "./chunk-5ZSO4T2G.js";
|
|
119
|
+
import "./chunk-XNCP4KYO.js";
|
|
120
|
+
import "./chunk-TFFGOFVZ.js";
|
|
121
|
+
import "./chunk-NZOWWHU5.js";
|
|
122
|
+
import "./chunk-4BW2SG2N.js";
|
|
123
|
+
import "./chunk-CIMQZRRE.js";
|
|
124
|
+
import "./chunk-OHX6MIUZ.js";
|
|
125
|
+
import "./chunk-36JUQZVQ.js";
|
|
126
|
+
import "./chunk-PZ5AY32C.js";
|
|
127
|
+
|
|
128
|
+
// src/emit/status-command.ts
|
|
129
|
+
var TIMEOUT_MS = 3e4;
|
|
130
|
+
function asString(v) {
|
|
131
|
+
return typeof v === "string" && v !== "" ? v : void 0;
|
|
132
|
+
}
|
|
133
|
+
var NETWORK_HINT = "A connection failure here is usually blocked egress, not a bad credential \u2014 check network access to the instance before running `xanosdk login`, which rotates a single-use refresh token.";
|
|
134
|
+
var StatusReadError = class extends Error {
|
|
135
|
+
constructor(message, status) {
|
|
136
|
+
super(message);
|
|
137
|
+
this.status = status;
|
|
138
|
+
}
|
|
139
|
+
status;
|
|
140
|
+
};
|
|
141
|
+
async function getJson(url, auth, action) {
|
|
142
|
+
let res;
|
|
143
|
+
try {
|
|
144
|
+
res = await fetchOrExplain(
|
|
145
|
+
url,
|
|
146
|
+
{
|
|
147
|
+
headers: { accept: "application/json", Authorization: `Bearer ${auth.access_token}` },
|
|
148
|
+
signal: AbortSignal.timeout(TIMEOUT_MS)
|
|
149
|
+
},
|
|
150
|
+
action,
|
|
151
|
+
TIMEOUT_MS
|
|
152
|
+
);
|
|
153
|
+
} catch (err) {
|
|
154
|
+
throw new Error(`${err instanceof Error ? err.message : String(err)}
|
|
155
|
+
${NETWORK_HINT}`, { cause: err });
|
|
156
|
+
}
|
|
157
|
+
const text = await res.text();
|
|
158
|
+
if (!res.ok) throw new StatusReadError(httpFailure(action, res, text), res.status);
|
|
159
|
+
return parseJsonAnswer(text, action, url);
|
|
160
|
+
}
|
|
161
|
+
async function readWorkspace(auth) {
|
|
162
|
+
const list = await getJson(`${auth.instance}/api:meta/workspace`, auth, "status (workspace list)");
|
|
163
|
+
const all = Array.isArray(list) ? list : [];
|
|
164
|
+
const match = all.find((w) => w.id === auth.workspaceId);
|
|
165
|
+
if (match === void 0) {
|
|
166
|
+
return {
|
|
167
|
+
id: auth.workspaceId,
|
|
168
|
+
name: null,
|
|
169
|
+
credential: auth.credentialType,
|
|
170
|
+
note: `this credential cannot see workspace ${auth.workspaceId}` + (reachableWorkspaces(all).length > 0 ? ` \u2014 the ids it can: ${reachableInline(reachableWorkspaces(all))}` : "")
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
id: auth.workspaceId,
|
|
175
|
+
name: asString(match.name) ?? null,
|
|
176
|
+
credential: auth.credentialType
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
async function readEnvironment(auth, cwd) {
|
|
180
|
+
const tracked = getEnvironment(readEphemeralState(cwd), auth);
|
|
181
|
+
if (tracked === void 0) return null;
|
|
182
|
+
let summary;
|
|
183
|
+
try {
|
|
184
|
+
summary = await lookupEphemeral(auth, tracked.name);
|
|
185
|
+
} catch (err) {
|
|
186
|
+
if (!(err instanceof LookupFailedError)) throw err;
|
|
187
|
+
return {
|
|
188
|
+
name: tracked.name,
|
|
189
|
+
display: tracked.display,
|
|
190
|
+
url: tracked.url,
|
|
191
|
+
state: null,
|
|
192
|
+
expiresAt: tracked.expires_at,
|
|
193
|
+
alive: null,
|
|
194
|
+
note: err.head
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
if (summary === null) {
|
|
198
|
+
return {
|
|
199
|
+
name: tracked.name,
|
|
200
|
+
display: tracked.display,
|
|
201
|
+
url: tracked.url,
|
|
202
|
+
state: null,
|
|
203
|
+
expiresAt: tracked.expires_at,
|
|
204
|
+
alive: false
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
name: summary.name,
|
|
209
|
+
display: summary.display,
|
|
210
|
+
url: summary.url,
|
|
211
|
+
state: summary.state ?? null,
|
|
212
|
+
expiresAt: summary.expiresAt,
|
|
213
|
+
alive: !isExpired(summary.expiresAt)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
async function readLocalEngine(cwd, deps) {
|
|
217
|
+
const env = deps.env ?? process.env;
|
|
218
|
+
const record = getEngineRecord(cwd, env);
|
|
219
|
+
if (record === void 0) return null;
|
|
220
|
+
let running;
|
|
221
|
+
try {
|
|
222
|
+
running = await (deps.listEngines ?? defaultEnumeration(env, cwd))();
|
|
223
|
+
} catch {
|
|
224
|
+
running = void 0;
|
|
225
|
+
}
|
|
226
|
+
if (running === void 0) return { name: record.name, url: record.url, liveness: "unknown" };
|
|
227
|
+
const engine = running.find((e) => e.name === record.name);
|
|
228
|
+
if (engine === void 0) return { name: record.name, url: record.url, liveness: "not-running" };
|
|
229
|
+
if (!isLoopbackUrl(engine.url)) return { name: record.name, url: engine.url, liveness: "unreachable" };
|
|
230
|
+
return { name: record.name, url: engine.url, liveness: "live" };
|
|
231
|
+
}
|
|
232
|
+
function defaultEnumeration(env, cwd) {
|
|
233
|
+
return async () => {
|
|
234
|
+
const { cachedEngineEntry, listEngines } = await import("./local-engine-process-EHTE5LLU.js");
|
|
235
|
+
const entry = cachedEngineEntry(env, cwd);
|
|
236
|
+
return entry === void 0 ? void 0 : listEngines({ entry, env });
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function isNamed(args, err) {
|
|
240
|
+
if (args.profile !== void 0) return true;
|
|
241
|
+
const source = err.missingProfile?.source;
|
|
242
|
+
return source === "flag" || source === "pointer" || source === "env";
|
|
243
|
+
}
|
|
244
|
+
function signInCommand(err, args) {
|
|
245
|
+
const stored = err instanceof NotSignedInError ? err.storedProfiles : [];
|
|
246
|
+
const flag = readFileFlag(args);
|
|
247
|
+
if (stored.length === 0) return `xanosdk login${flag}`;
|
|
248
|
+
return `xanosdk profile set-default ${stored.length === 1 ? stored[0] : "<name>"}${flag}`;
|
|
249
|
+
}
|
|
250
|
+
function readFileFlag(args) {
|
|
251
|
+
const recorded = credentialFileOf(args);
|
|
252
|
+
return recorded === void 0 ? "" : credentialFileFlagFor(recorded);
|
|
253
|
+
}
|
|
254
|
+
async function readStatus(args, start = process.cwd(), deps = {}) {
|
|
255
|
+
const env = deps.env ?? process.env;
|
|
256
|
+
const project = projectDirFrom(start) ?? null;
|
|
257
|
+
const cwd = project ?? start;
|
|
258
|
+
const localEngine = await readLocalEngine(cwd, deps);
|
|
259
|
+
let auth;
|
|
260
|
+
try {
|
|
261
|
+
auth = await getAccessToken(args);
|
|
262
|
+
} catch (err) {
|
|
263
|
+
if (isUsageError(err)) throw err;
|
|
264
|
+
if (err instanceof NotSignedInError && args.profile !== void 0) throw err;
|
|
265
|
+
if (err instanceof NotSignedInError && isNamed(args, err)) {
|
|
266
|
+
const missing = err.missingProfile;
|
|
267
|
+
return {
|
|
268
|
+
signedIn: false,
|
|
269
|
+
project,
|
|
270
|
+
signIn: `xanosdk login --profile ${shellQuote(missing.name)}${readFileFlag(args)}`,
|
|
271
|
+
rejected: null,
|
|
272
|
+
credentialFailure: err.message,
|
|
273
|
+
instance: null,
|
|
274
|
+
profile: missing,
|
|
275
|
+
user: null,
|
|
276
|
+
workspace: null,
|
|
277
|
+
environment: null,
|
|
278
|
+
environmentTrackedUnder: null,
|
|
279
|
+
deployed: deployedHere(cwd, env, void 0),
|
|
280
|
+
localEngine
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (!(err instanceof NotSignedInError)) {
|
|
284
|
+
const stored = err instanceof StoredCredentialError ? err : void 0;
|
|
285
|
+
return {
|
|
286
|
+
signedIn: false,
|
|
287
|
+
project,
|
|
288
|
+
signIn: stored?.fix ?? null,
|
|
289
|
+
rejected: null,
|
|
290
|
+
credentialFailure: err instanceof Error ? err.message : String(err),
|
|
291
|
+
instance: stored?.instance ?? null,
|
|
292
|
+
profile: stored?.profile ?? null,
|
|
293
|
+
user: null,
|
|
294
|
+
workspace: null,
|
|
295
|
+
environment: null,
|
|
296
|
+
environmentTrackedUnder: null,
|
|
297
|
+
deployed: deployedHere(cwd, env, void 0),
|
|
298
|
+
localEngine
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const tracked = project === null ? [] : trackedUnderOthers(project, void 0);
|
|
302
|
+
return {
|
|
303
|
+
signedIn: false,
|
|
304
|
+
project,
|
|
305
|
+
signIn: trackedRemedy(tracked) ?? signInCommand(err, args),
|
|
306
|
+
rejected: null,
|
|
307
|
+
credentialFailure: null,
|
|
308
|
+
instance: null,
|
|
309
|
+
profile: null,
|
|
310
|
+
user: null,
|
|
311
|
+
workspace: null,
|
|
312
|
+
environment: null,
|
|
313
|
+
environmentTrackedUnder: tracked.length > 0 ? tracked : null,
|
|
314
|
+
// No credential: the fallback skips the ephemeral check, as a bare command's does.
|
|
315
|
+
deployed: deployedHere(cwd, env, void 0),
|
|
316
|
+
localEngine
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
let me;
|
|
320
|
+
try {
|
|
321
|
+
me = await getJson(`${auth.instance}/api:meta/auth/me`, auth, "status (signed-in user)");
|
|
322
|
+
} catch (err) {
|
|
323
|
+
if (err instanceof StatusReadError && (err.status === 401 || err.status === 403)) {
|
|
324
|
+
return {
|
|
325
|
+
signedIn: false,
|
|
326
|
+
project,
|
|
327
|
+
signIn: rejectedFixCommand(auth, args),
|
|
328
|
+
rejected: rejectedRemedy(auth, args),
|
|
329
|
+
credentialFailure: null,
|
|
330
|
+
instance: auth.instance,
|
|
331
|
+
profile: auth.profile ?? null,
|
|
332
|
+
user: null,
|
|
333
|
+
// The pin is known without the instance's help: which workspace the
|
|
334
|
+
// refused credential addresses is half of "which credential".
|
|
335
|
+
workspace: { id: auth.workspaceId, name: null, credential: auth.credentialType },
|
|
336
|
+
environment: null,
|
|
337
|
+
environmentTrackedUnder: null,
|
|
338
|
+
deployed: deployedHere(cwd, env, auth),
|
|
339
|
+
localEngine
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
throw err;
|
|
343
|
+
}
|
|
344
|
+
return {
|
|
345
|
+
signedIn: true,
|
|
346
|
+
project,
|
|
347
|
+
signIn: null,
|
|
348
|
+
rejected: null,
|
|
349
|
+
credentialFailure: null,
|
|
350
|
+
instance: auth.instance,
|
|
351
|
+
profile: auth.profile ?? null,
|
|
352
|
+
user: {
|
|
353
|
+
id: typeof me.id === "number" ? me.id : void 0,
|
|
354
|
+
name: asString(me.name),
|
|
355
|
+
email: asString(me.email)
|
|
356
|
+
},
|
|
357
|
+
workspace: await readWorkspace(auth),
|
|
358
|
+
...await environmentBlock(auth, cwd, project),
|
|
359
|
+
deployed: deployedHere(cwd, env, auth),
|
|
360
|
+
localEngine
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
function deployedHere(cwd, env, scope) {
|
|
364
|
+
const answer = readTrackedBackend({ cwd, env, scope });
|
|
365
|
+
if (answer.kind !== null || isProjectDir(cwd)) return answer;
|
|
366
|
+
return {
|
|
367
|
+
...answer,
|
|
368
|
+
// "Inside", not "from a project's root": any subdirectory of one finds it.
|
|
369
|
+
reason: `No Xano SDK project here (${cwd}) \u2014 run \`xanosdk status\` from inside a Xano SDK project, or \`xanosdk init\` to start one.`
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
async function environmentBlock(auth, cwd, project) {
|
|
373
|
+
const environment = await readEnvironment(auth, cwd);
|
|
374
|
+
if (environment !== null || project === null) return { environment, environmentTrackedUnder: null };
|
|
375
|
+
const unreadable = unreadableEphemeralState(cwd);
|
|
376
|
+
if (unreadable !== void 0) return { environment, environmentTrackedUnder: null, environmentUnreadable: unreadable };
|
|
377
|
+
const others = trackedUnderOthers(project, auth);
|
|
378
|
+
return { environment, environmentTrackedUnder: others.length > 0 ? others : null };
|
|
379
|
+
}
|
|
380
|
+
function trackedUnderOthers(project, auth) {
|
|
381
|
+
let state;
|
|
382
|
+
try {
|
|
383
|
+
state = readEphemeralState(project);
|
|
384
|
+
} catch {
|
|
385
|
+
return [];
|
|
386
|
+
}
|
|
387
|
+
const mine = auth === void 0 ? void 0 : environmentKey(auth);
|
|
388
|
+
return Object.entries(state.environments).filter(([key]) => auth === void 0 || key !== mine && key !== String(auth.workspaceId)).map(([key, record]) => {
|
|
389
|
+
const parts = key.split("/");
|
|
390
|
+
const profile = parts.length >= 3 ? parts[0] : null;
|
|
391
|
+
const host = parts.length >= 3 ? parts.slice(1, -1).join("/") : null;
|
|
392
|
+
const recorded = record.credential_file;
|
|
393
|
+
if (recordedByEnvCredential(record)) {
|
|
394
|
+
const workspaceId2 = Number(parts[parts.length - 1]);
|
|
395
|
+
return {
|
|
396
|
+
profile: null,
|
|
397
|
+
workspaceId: Number.isSafeInteger(workspaceId2) && workspaceId2 > 0 ? workspaceId2 : null,
|
|
398
|
+
host,
|
|
399
|
+
file: null,
|
|
400
|
+
command: null,
|
|
401
|
+
environmentCredential: true
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const file = recordedCredentialPath(recorded);
|
|
405
|
+
const rawWorkspace = Number(parts[parts.length - 1]);
|
|
406
|
+
const workspaceId = Number.isSafeInteger(rawWorkspace) && rawWorkspace > 0 ? rawWorkspace : null;
|
|
407
|
+
const gone = profile !== null && !recordedProfileStored(profile, recorded);
|
|
408
|
+
const command = profile === null ? null : !gone ? `xanosdk status --profile ${profile}${recorded !== void 0 ? credentialFileFlagFor(recorded) : ""}` : loginCommand(profile, { path: file ?? void 0 });
|
|
409
|
+
const tokenCommand = gone ? profileAddCommand(profile, {
|
|
410
|
+
path: file ?? void 0,
|
|
411
|
+
instance: record.instance ?? (host !== null ? `https://${host}` : void 0),
|
|
412
|
+
workspaceId: workspaceId ?? void 0
|
|
413
|
+
}) : void 0;
|
|
414
|
+
return { profile, workspaceId, host, file, command, ...tokenCommand !== void 0 ? { tokenCommand } : {} };
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
function trackedRemedy(entries) {
|
|
418
|
+
const status = entries.find((e) => e.file !== null && e.command?.startsWith("xanosdk status ") === true);
|
|
419
|
+
return status?.command ?? entries.find((e) => e.command?.startsWith("xanosdk login") === true)?.command ?? void 0;
|
|
420
|
+
}
|
|
421
|
+
function trackedUnderText(entries, fromEnv, signedOut = false) {
|
|
422
|
+
const one = (e) => {
|
|
423
|
+
const where = `workspace ${e.workspaceId ?? "unknown"}${e.host !== null ? ` on ${e.host}` : ""}`;
|
|
424
|
+
const who = e.environmentCredential === true ? `the environment credential (${where}` : e.profile !== null ? `profile "${e.profile}" (${where}` : `another credential (${where}`;
|
|
425
|
+
const file = e.file !== null ? `, credential file ${e.file}` : "";
|
|
426
|
+
const run = e.command !== null ? e.tokenCommand !== void 0 ? ` \xB7 \`${e.command}\` (OAuth), or \`${e.tokenCommand}\` (meta API token)` : ` \xB7 \`${e.command}\`` : e.environmentCredential === true ? ` \xB7 set ${ENV_CREDENTIAL_VARS} for it` : "";
|
|
427
|
+
return `${who}${file})${run}`;
|
|
428
|
+
};
|
|
429
|
+
const envNote = fromEnv && entries.some((e) => e.command !== null) ? " (run without the environment credential \u2014 it outranks every stored profile)" : "";
|
|
430
|
+
const lead = signedOut ? "not signed in" : "none under this credential";
|
|
431
|
+
return `${lead} \xB7 the project's ephemeral is recorded under ${entries.map(one).join("; ")}${envNote}`;
|
|
432
|
+
}
|
|
433
|
+
function trackedRows(status, s) {
|
|
434
|
+
const rows = [];
|
|
435
|
+
const d = status.deployed;
|
|
436
|
+
if (status.project === null && d.kind === null) {
|
|
437
|
+
rows.push(["Project", `none ${s.dim(`\xB7 ${d.reason}`)}`]);
|
|
438
|
+
} else {
|
|
439
|
+
rows.push([
|
|
440
|
+
"Deployed",
|
|
441
|
+
// `none` where a kind would be, then why: a bare command has no backend to
|
|
442
|
+
// go to and refuses with that sentence. Not a bold "refuse" standing in for
|
|
443
|
+
// a kind, which read as a backend by that name.
|
|
444
|
+
d.kind === null ? `none ${s.dim(`\xB7 ${d.reason}`)}` : `${d.kind} ${s.dim(`\xB7 ${d.via === "pointer" ? "last deployed" : "recorded"}`)}`
|
|
445
|
+
]);
|
|
446
|
+
}
|
|
447
|
+
const e = status.localEngine;
|
|
448
|
+
if (e !== null) {
|
|
449
|
+
const hint = e.liveness === "not-running" ? " \xB7 not running \xB7 `xanosdk deploy --local-engine` starts it" : e.liveness === "live" ? "" : ` \xB7 ${e.liveness}`;
|
|
450
|
+
rows.push(["Local engine", `${e.name} ${s.dim(`\xB7 ${e.url}${hint}`)}`]);
|
|
451
|
+
}
|
|
452
|
+
return rows;
|
|
453
|
+
}
|
|
454
|
+
function credentialRows(status, s) {
|
|
455
|
+
const rows = [];
|
|
456
|
+
if (status.instance !== null) rows.push(["Instance", s.bold(s.cyan(status.instance))]);
|
|
457
|
+
if (status.workspace !== null) rows.push(["Workspace", workspaceValue(status.workspace, s)]);
|
|
458
|
+
if (status.profile !== null) rows.push(["Profile", profileValue(status.profile, s)]);
|
|
459
|
+
return rows;
|
|
460
|
+
}
|
|
461
|
+
function displayLabel(env, s) {
|
|
462
|
+
return env.display !== void 0 && env.display !== "" && env.display !== env.name ? ` ${s.dim(env.display)}` : "";
|
|
463
|
+
}
|
|
464
|
+
function prettyStatus(status, fileFlag = "", rerun = `xanosdk status${fileFlag}`) {
|
|
465
|
+
const s = stdoutStyle();
|
|
466
|
+
if (!status.signedIn) {
|
|
467
|
+
const rows2 = status.rejected !== null ? [
|
|
468
|
+
["Signed in", `${s.bold("no")} ${s.dim("\xB7 the instance rejected the credential")}`],
|
|
469
|
+
// The same Instance/Profile rows a credential that failed locally
|
|
470
|
+
// shows: which credential was refused is half the answer.
|
|
471
|
+
...credentialRows(status, s),
|
|
472
|
+
["", s.dim(status.rejected)]
|
|
473
|
+
] : status.credentialFailure !== null ? [
|
|
474
|
+
["Signed in", `${s.bold("no")} ${s.dim("\xB7 the credential could not be used")}`],
|
|
475
|
+
...credentialRows(status, s),
|
|
476
|
+
...status.credentialFailure.split("\n").map((line) => ["", s.dim(line)])
|
|
477
|
+
] : [["Signed in", `${s.bold("no")} ${s.dim(`\xB7 run \`${status.signIn ?? "xanosdk login"}\``)}`]];
|
|
478
|
+
if (status.project !== null && status.environmentTrackedUnder !== null) {
|
|
479
|
+
rows2.push(["Environment", s.dim(trackedUnderText(status.environmentTrackedUnder, false, true))]);
|
|
480
|
+
}
|
|
481
|
+
return `
|
|
482
|
+
${formatFields([...rows2, ...trackedRows(status, s)])}`;
|
|
483
|
+
}
|
|
484
|
+
const rows = [
|
|
485
|
+
["Signed in", signedInValue(status.user, s)],
|
|
486
|
+
["Instance", s.bold(s.cyan(status.instance ?? ""))]
|
|
487
|
+
];
|
|
488
|
+
const ws = status.workspace;
|
|
489
|
+
if (ws !== null) {
|
|
490
|
+
rows.push(["Workspace", workspaceValue(ws, s)]);
|
|
491
|
+
if (ws.note !== void 0) rows.push(["", s.dim(ws.note)]);
|
|
492
|
+
}
|
|
493
|
+
rows.push(["Profile", profileValue(status.profile, s)]);
|
|
494
|
+
const env = status.environment;
|
|
495
|
+
if (status.project === null) {
|
|
496
|
+
} else if (env === null && status.environmentUnreadable !== void 0) {
|
|
497
|
+
rows.push([
|
|
498
|
+
"Environment",
|
|
499
|
+
s.dim(`unknown \xB7 ${displayPath(status.environmentUnreadable)} is unreadable \xB7 \`xanosdk ephemeral list${fileFlag}\` finds the ephemeral it recorded`)
|
|
500
|
+
]);
|
|
501
|
+
} else if (env === null && status.environmentTrackedUnder !== null) {
|
|
502
|
+
rows.push(["Environment", s.dim(trackedUnderText(status.environmentTrackedUnder, status.profile === null))]);
|
|
503
|
+
} else if (env === null && status.deployed.kind === "local-engine") {
|
|
504
|
+
rows.push(["Environment", s.dim(`no ephemeral \xB7 \`xanosdk deploy${fileFlag}\` without --local-engine makes one`)]);
|
|
505
|
+
} else if (env === null && readDeployed(status.project)?.kind === "ephemeral") {
|
|
506
|
+
rows.push(["Environment", s.dim(`none tracked \xB7 the last one is gone (deleted or expired) \xB7 run \`xanosdk deploy${fileFlag}\` for a fresh one`)]);
|
|
507
|
+
} else if (env === null) {
|
|
508
|
+
rows.push(["Environment", s.dim(`none yet \xB7 run \`xanosdk deploy${fileFlag}\``)]);
|
|
509
|
+
} else if (env.alive === null) {
|
|
510
|
+
rows.push(["Environment", `${env.name}${displayLabel(env, s)} ${s.dim("\xB7 unknown \u2014 the lookup got no answer")}`]);
|
|
511
|
+
if (env.note !== void 0) rows.push(["", s.dim(`${env.note}. Run \`${rerun}\` again once it answers.`)]);
|
|
512
|
+
} else if (!env.alive) {
|
|
513
|
+
rows.push([
|
|
514
|
+
"Environment",
|
|
515
|
+
`${env.name}${displayLabel(env, s)} ${s.dim(`\xB7 gone or expired \xB7 run \`xanosdk deploy${fileFlag}\` for a fresh one`)}`
|
|
516
|
+
]);
|
|
517
|
+
} else {
|
|
518
|
+
const state = env.state === null ? "" : ` ${s.dim(`\xB7 ${env.state}`)}`;
|
|
519
|
+
rows.push([
|
|
520
|
+
"Environment",
|
|
521
|
+
`${env.name}${displayLabel(env, s)}${state} ${s.dim(`\xB7 expires ${formatExpiration(env.expiresAt)}`)}`
|
|
522
|
+
]);
|
|
523
|
+
if (env.url !== void 0) rows.push(["URL", s.bold(s.cyan(env.url))]);
|
|
524
|
+
}
|
|
525
|
+
rows.push(...trackedRows(status, s));
|
|
526
|
+
return `
|
|
527
|
+
${formatFields(rows)}`;
|
|
528
|
+
}
|
|
529
|
+
async function runStatusCommand(args) {
|
|
530
|
+
const status = await readStatus(args).catch(async (err) => {
|
|
531
|
+
const { unansweredRead } = await import("./source-resolve-S2XA3XZF.js");
|
|
532
|
+
throw unansweredRead(err, "read the status", "workspace");
|
|
533
|
+
});
|
|
534
|
+
if (isMachineOutput(args)) {
|
|
535
|
+
const env = status.environment;
|
|
536
|
+
const doc = { ...status, profile: selectionDocument(status.profile) };
|
|
537
|
+
if (env?.alive === null) {
|
|
538
|
+
const again = `${env.note ?? "The ephemeral lookup got no answer"}. Run \`${retryCommand(args, { command: "status" }).command}\` again once it answers.`;
|
|
539
|
+
throw new CliError("SDK_ERROR", again, {
|
|
540
|
+
exitCode: EXIT_SOURCE_UNRESOLVABLE,
|
|
541
|
+
details: { status: { ...doc, environment: { ...env, note: again } } }
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
writeJson(doc);
|
|
545
|
+
} else {
|
|
546
|
+
printHuman(prettyStatus(status, readFileFlag(args), retryCommand(args, { command: "status" }).command));
|
|
547
|
+
}
|
|
548
|
+
if (status.environment?.alive === null) process.exitCode = EXIT_SOURCE_UNRESOLVABLE;
|
|
549
|
+
}
|
|
550
|
+
export {
|
|
551
|
+
readStatus,
|
|
552
|
+
runStatusCommand
|
|
553
|
+
};
|
|
554
|
+
//# sourceMappingURL=status-command-RUDXTF7I.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getLockedCanonical,
|
|
3
|
+
getLockedGuid,
|
|
4
|
+
isLockSeeded,
|
|
5
|
+
resetLockOverrides,
|
|
6
|
+
seedLockOverrides,
|
|
7
|
+
seededLockSource,
|
|
8
|
+
tagLockSource
|
|
9
|
+
} from "./chunk-4BW2SG2N.js";
|
|
10
|
+
import "./chunk-PZ5AY32C.js";
|
|
11
|
+
export {
|
|
12
|
+
getLockedCanonical,
|
|
13
|
+
getLockedGuid,
|
|
14
|
+
isLockSeeded,
|
|
15
|
+
resetLockOverrides,
|
|
16
|
+
seedLockOverrides,
|
|
17
|
+
seededLockSource,
|
|
18
|
+
tagLockSource
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=store-6VNCD4D7.js.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CREDENTIAL_FILE_VERSION,
|
|
3
|
+
UPGRADE_REMEDY,
|
|
4
|
+
addGitignoreRule,
|
|
5
|
+
addProfileHint,
|
|
6
|
+
assertCredentialFileRemovable,
|
|
7
|
+
assertCredentialFileWritable,
|
|
8
|
+
assertCredentialPathUsable,
|
|
9
|
+
buildTokenCredential,
|
|
10
|
+
clearCredential,
|
|
11
|
+
clearCredentialUnderLock,
|
|
12
|
+
credentialFileFlag,
|
|
13
|
+
describeProfile,
|
|
14
|
+
dropProfile,
|
|
15
|
+
emptyCredentialFile,
|
|
16
|
+
ensureGitignored,
|
|
17
|
+
gitSaysIgnored,
|
|
18
|
+
gitignoreRootFor,
|
|
19
|
+
globalAuthFilePath,
|
|
20
|
+
insideGitRepo,
|
|
21
|
+
isSafeIdText,
|
|
22
|
+
localAuthFilePath,
|
|
23
|
+
loginCommand,
|
|
24
|
+
loginHint,
|
|
25
|
+
profileAddCommand,
|
|
26
|
+
profileNames,
|
|
27
|
+
projectAuthFilePath,
|
|
28
|
+
readCredential,
|
|
29
|
+
readCredentialFile,
|
|
30
|
+
readProfile,
|
|
31
|
+
recordedCredentialFile,
|
|
32
|
+
recordedCredentialPath,
|
|
33
|
+
recordedProfileStored,
|
|
34
|
+
removeEmptyProjectCacheDir,
|
|
35
|
+
resolveAuthFilePath,
|
|
36
|
+
sameOriginAs,
|
|
37
|
+
withCredentialLock,
|
|
38
|
+
writeCredentialFile,
|
|
39
|
+
writeOrRemoveCredentialFile
|
|
40
|
+
} from "./chunk-XW6KISBB.js";
|
|
41
|
+
import "./chunk-AWQ7BQTQ.js";
|
|
42
|
+
import "./chunk-EUUUMY7J.js";
|
|
43
|
+
import "./chunk-YLDALTWZ.js";
|
|
44
|
+
import "./chunk-5FBYXK5P.js";
|
|
45
|
+
import "./chunk-LLNZGEFK.js";
|
|
46
|
+
import {
|
|
47
|
+
DEFAULT_PROFILE
|
|
48
|
+
} from "./chunk-QXTKSOFI.js";
|
|
49
|
+
import "./chunk-X2NL4KUO.js";
|
|
50
|
+
import "./chunk-PTHVMXZI.js";
|
|
51
|
+
import "./chunk-UTI5G6OJ.js";
|
|
52
|
+
import "./chunk-2EZ3ZJZZ.js";
|
|
53
|
+
import "./chunk-5ZSO4T2G.js";
|
|
54
|
+
import "./chunk-TFFGOFVZ.js";
|
|
55
|
+
import "./chunk-36JUQZVQ.js";
|
|
56
|
+
import "./chunk-PZ5AY32C.js";
|
|
57
|
+
export {
|
|
58
|
+
CREDENTIAL_FILE_VERSION,
|
|
59
|
+
DEFAULT_PROFILE,
|
|
60
|
+
UPGRADE_REMEDY,
|
|
61
|
+
addGitignoreRule,
|
|
62
|
+
addProfileHint,
|
|
63
|
+
assertCredentialFileRemovable,
|
|
64
|
+
assertCredentialFileWritable,
|
|
65
|
+
assertCredentialPathUsable,
|
|
66
|
+
buildTokenCredential,
|
|
67
|
+
clearCredential,
|
|
68
|
+
clearCredentialUnderLock,
|
|
69
|
+
credentialFileFlag,
|
|
70
|
+
describeProfile,
|
|
71
|
+
dropProfile,
|
|
72
|
+
emptyCredentialFile,
|
|
73
|
+
ensureGitignored,
|
|
74
|
+
gitSaysIgnored,
|
|
75
|
+
gitignoreRootFor,
|
|
76
|
+
globalAuthFilePath,
|
|
77
|
+
insideGitRepo,
|
|
78
|
+
isSafeIdText,
|
|
79
|
+
localAuthFilePath,
|
|
80
|
+
loginCommand,
|
|
81
|
+
loginHint,
|
|
82
|
+
profileAddCommand,
|
|
83
|
+
profileNames,
|
|
84
|
+
projectAuthFilePath,
|
|
85
|
+
readCredential,
|
|
86
|
+
readCredentialFile,
|
|
87
|
+
readProfile,
|
|
88
|
+
recordedCredentialFile,
|
|
89
|
+
recordedCredentialPath,
|
|
90
|
+
recordedProfileStored,
|
|
91
|
+
removeEmptyProjectCacheDir,
|
|
92
|
+
resolveAuthFilePath,
|
|
93
|
+
sameOriginAs,
|
|
94
|
+
withCredentialLock,
|
|
95
|
+
writeCredentialFile,
|
|
96
|
+
writeOrRemoveCredentialFile
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=store-ARM6VMO5.js.map
|