@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,432 @@
|
|
|
1
|
+
import {
|
|
2
|
+
confirm
|
|
3
|
+
} from "./chunk-65HWOMGV.js";
|
|
4
|
+
import {
|
|
5
|
+
ProfileNotFoundError,
|
|
6
|
+
describeRefreshAnswer,
|
|
7
|
+
environmentCredentialVars
|
|
8
|
+
} from "./chunk-ET4Y4XCB.js";
|
|
9
|
+
import {
|
|
10
|
+
yesRerun
|
|
11
|
+
} from "./chunk-T5KELPAR.js";
|
|
12
|
+
import {
|
|
13
|
+
OpenIdProvider,
|
|
14
|
+
assertCredentialFileRemovable,
|
|
15
|
+
assertHttpsOrigin,
|
|
16
|
+
clearCredential,
|
|
17
|
+
clearCredentialUnderLock,
|
|
18
|
+
credentialFileFlag,
|
|
19
|
+
describeProfile,
|
|
20
|
+
dropProfile,
|
|
21
|
+
emptyCredentialFile,
|
|
22
|
+
globalAuthFilePath,
|
|
23
|
+
localAuthFilePath,
|
|
24
|
+
loginCommand,
|
|
25
|
+
profileNames,
|
|
26
|
+
projectAuthFilePath,
|
|
27
|
+
readCredentialFile,
|
|
28
|
+
readProfile,
|
|
29
|
+
removeEmptyProjectCacheDir,
|
|
30
|
+
resolveAuthFilePath,
|
|
31
|
+
resolveScope,
|
|
32
|
+
withCredentialLock,
|
|
33
|
+
writeOrRemoveCredentialFile
|
|
34
|
+
} from "./chunk-XW6KISBB.js";
|
|
35
|
+
import {
|
|
36
|
+
findProjectPointer,
|
|
37
|
+
resolveProjectProfile
|
|
38
|
+
} from "./chunk-5FBYXK5P.js";
|
|
39
|
+
import {
|
|
40
|
+
resolveActiveProfile
|
|
41
|
+
} from "./chunk-QXTKSOFI.js";
|
|
42
|
+
import {
|
|
43
|
+
UsageError,
|
|
44
|
+
detail,
|
|
45
|
+
hostLabel,
|
|
46
|
+
info,
|
|
47
|
+
isMachineOutput,
|
|
48
|
+
quotedNames,
|
|
49
|
+
safeText,
|
|
50
|
+
success,
|
|
51
|
+
warn,
|
|
52
|
+
writeJson
|
|
53
|
+
} from "./chunk-PTHVMXZI.js";
|
|
54
|
+
import {
|
|
55
|
+
suggestAll
|
|
56
|
+
} from "./chunk-UTI5G6OJ.js";
|
|
57
|
+
import {
|
|
58
|
+
shellQuote
|
|
59
|
+
} from "./chunk-5ZSO4T2G.js";
|
|
60
|
+
|
|
61
|
+
// src/emit/logout-command.ts
|
|
62
|
+
import { existsSync } from "fs";
|
|
63
|
+
import { resolve } from "path";
|
|
64
|
+
async function runLogoutCommand(args) {
|
|
65
|
+
if (args.all && args.profile !== void 0) {
|
|
66
|
+
throw new UsageError(
|
|
67
|
+
`\`--all\` clears every stored profile, so it cannot be scoped to \`--profile ${args.profile}\`. Drop \`--all\` to sign out of that one profile, or drop \`--profile\` to sign out of all of them.`,
|
|
68
|
+
{ hintFor: { command: "logout" } }
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
const authFilePath = resolveAuthFilePath(args, "write");
|
|
72
|
+
const targetsGlobal = authFilePath === globalAuthFilePath();
|
|
73
|
+
let file;
|
|
74
|
+
try {
|
|
75
|
+
file = readCredentialFile(authFilePath);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
warn(`Could not read ${authFilePath} (${err instanceof Error ? err.message : String(err)}).`, "logout.unreadable");
|
|
78
|
+
const removedFile2 = clearCredential(authFilePath);
|
|
79
|
+
if (removedFile2) removeEmptyProjectCacheDir(authFilePath);
|
|
80
|
+
if (removedFile2) {
|
|
81
|
+
success("Removed the unreadable credential file.");
|
|
82
|
+
detail(`Removed ${authFilePath}`);
|
|
83
|
+
}
|
|
84
|
+
if (isMachineOutput(args)) {
|
|
85
|
+
writeJson({
|
|
86
|
+
verb: "logout",
|
|
87
|
+
path: authFilePath,
|
|
88
|
+
removed: [],
|
|
89
|
+
remaining: [],
|
|
90
|
+
alreadyGone: false,
|
|
91
|
+
removedUnreadableFile: removedFile2,
|
|
92
|
+
removedFile: removedFile2,
|
|
93
|
+
// An unreadable file names no session to revoke.
|
|
94
|
+
...revokeFields({ revoked: null })
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const names = file === null ? [] : profileNames(file);
|
|
100
|
+
if (file === null || names.length === 0) {
|
|
101
|
+
if (!args.all) refuseIfOnlyInProjectFile(args, authFilePath, activeProfile(args, file ?? emptyCredentialFile()), names);
|
|
102
|
+
info(`Not signed in (no credential at ${authFilePath}). Nothing to do.`);
|
|
103
|
+
noteEnvCredential();
|
|
104
|
+
if (isMachineOutput(args)) writeLogoutDocument(authFilePath, [], [], { alreadyGone: true });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const warnShared = (what) => {
|
|
108
|
+
if (targetsGlobal) {
|
|
109
|
+
warn(`Clearing ${what} in the shared credential file ${authFilePath} \u2014 this affects every project that reuses it.`, "logout.shared-file");
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
if (args.all) {
|
|
113
|
+
const pin2 = pinnedBy(authFilePath, names);
|
|
114
|
+
if (!await confirmRemoveAll(args, authFilePath, names, pin2)) {
|
|
115
|
+
return declined(args, authFilePath, names, pin2);
|
|
116
|
+
}
|
|
117
|
+
warnShared("every credential");
|
|
118
|
+
let revokes = [];
|
|
119
|
+
const removedFile2 = await clearCredentialUnderLock(authFilePath, async (current) => {
|
|
120
|
+
revokes = await Promise.all(
|
|
121
|
+
profileNames(current).flatMap((name) => {
|
|
122
|
+
const record = revocableRecord(current, name, authFilePath);
|
|
123
|
+
return record === void 0 ? [] : [revokeProfileSession(args, record, name).then((outcome) => ({ profile: name, outcome }))];
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
});
|
|
127
|
+
if (removedFile2) removeEmptyProjectCacheDir(authFilePath);
|
|
128
|
+
success(`Signed out of ${names.length} ${names.length === 1 ? "profile" : "profiles"}.`);
|
|
129
|
+
detail(`Removed ${authFilePath}`);
|
|
130
|
+
const tokens = names.filter((name) => file.profiles[name]?.type === "token");
|
|
131
|
+
if (tokens.length > 0) {
|
|
132
|
+
detail(
|
|
133
|
+
`${tokens.length === 1 ? `The meta API token behind "${safeText(tokens[0])}" is` : `The meta API tokens behind ${quotedNames(tokens)} are`} still valid \u2014 revoke ${tokens.length === 1 ? "it" : "them"} at the source if you need ${tokens.length === 1 ? "it" : "them"} dead.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
if (envCredentialVars().length === 0) {
|
|
137
|
+
const again = names.length === 1 ? names[0] : file.default ?? names[0];
|
|
138
|
+
detail(`No profiles are left \u2014 run \`${signInAgain(authFilePath, again, file.profiles[again])}\` to sign in again.`);
|
|
139
|
+
}
|
|
140
|
+
notePinLeft(pin2, authFilePath, file.profiles[pin2?.profile ?? ""]);
|
|
141
|
+
noteEnvCredential();
|
|
142
|
+
if (isMachineOutput(args)) {
|
|
143
|
+
writeLogoutDocument(authFilePath, names, [], {
|
|
144
|
+
clearedDefault: file.default !== void 0,
|
|
145
|
+
removedFile: removedFile2,
|
|
146
|
+
revoke: combineRevokes(revokes),
|
|
147
|
+
pin: pin2
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const selection = activeProfile(args, file);
|
|
153
|
+
let saved;
|
|
154
|
+
try {
|
|
155
|
+
saved = readProfile(file, selection.name, authFilePath);
|
|
156
|
+
} catch {
|
|
157
|
+
saved = null;
|
|
158
|
+
}
|
|
159
|
+
if (saved === null && !Object.prototype.hasOwnProperty.call(file.profiles, selection.name)) {
|
|
160
|
+
refuseIfOnlyInProjectFile(args, authFilePath, selection, names);
|
|
161
|
+
refuseNearMiss(args, authFilePath, file, selection, names);
|
|
162
|
+
info(
|
|
163
|
+
`Profile "${selection.name}" is not signed in at ${authFilePath}. Nothing to do. Signed in as: ${quotedNames(names)}.`
|
|
164
|
+
);
|
|
165
|
+
noteEnvCredential();
|
|
166
|
+
if (isMachineOutput(args)) writeLogoutDocument(authFilePath, [], names, { alreadyGone: true });
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const pin = pinnedBy(authFilePath, [selection.name]);
|
|
170
|
+
const orphansDefault = file.default === selection.name && names.length > 1 ? authFilePath : void 0;
|
|
171
|
+
if (!await confirmDanglingRemoval(args, "logout", selection.name, pin, orphansDefault)) {
|
|
172
|
+
return declined(args, authFilePath, names, pin);
|
|
173
|
+
}
|
|
174
|
+
warnShared(`profile "${selection.name}"`);
|
|
175
|
+
let wasDefault = false;
|
|
176
|
+
let removedFile = false;
|
|
177
|
+
let revoke = { revoked: null };
|
|
178
|
+
const left = await withCredentialLock(authFilePath, async (current) => {
|
|
179
|
+
wasDefault = current.default === selection.name;
|
|
180
|
+
const revocable = revocableRecord(current, selection.name, authFilePath);
|
|
181
|
+
if (revocable !== void 0) revoke = await revokeProfileSession(args, revocable, selection.name);
|
|
182
|
+
removedFile = writeOrRemoveCredentialFile(authFilePath, dropProfile(current, selection.name));
|
|
183
|
+
return profileNames(current);
|
|
184
|
+
});
|
|
185
|
+
if (removedFile) removeEmptyProjectCacheDir(authFilePath);
|
|
186
|
+
if (saved?.type === "token") {
|
|
187
|
+
success(`Removed the meta API token credential "${selection.name}" (${hostLabel(saved.instance_base_url)})`);
|
|
188
|
+
detail("The token itself is still valid \u2014 revoke it at its source if you need it dead.");
|
|
189
|
+
} else if (saved === null) {
|
|
190
|
+
success(`Removed the unreadable profile "${selection.name}".`);
|
|
191
|
+
} else {
|
|
192
|
+
success(`Signed out of profile "${selection.name}" (${hostLabel(saved.instance)})`);
|
|
193
|
+
}
|
|
194
|
+
reportWhatIsLeft(authFilePath, selection.name, left, wasDefault, file.profiles[selection.name]);
|
|
195
|
+
notePinLeft(pin, authFilePath, file.profiles[selection.name]);
|
|
196
|
+
if (isMachineOutput(args)) {
|
|
197
|
+
writeLogoutDocument(authFilePath, [selection.name], left, { clearedDefault: wasDefault, removedFile, revoke, pin });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function pinnedBy(authFilePath, removing) {
|
|
201
|
+
if (authFilePath !== resolve(projectAuthFilePath())) return void 0;
|
|
202
|
+
const pin = findProjectPointer(process.cwd());
|
|
203
|
+
return pin !== void 0 && removing.includes(pin.profile) ? pin : void 0;
|
|
204
|
+
}
|
|
205
|
+
async function confirmDanglingRemoval(args, verb, name, pin, orphansDefaultIn) {
|
|
206
|
+
if (args.yes || pin === void 0 && orphansDefaultIn === void 0) return true;
|
|
207
|
+
const where = orphansDefaultIn === void 0 ? "" : orphansDefaultIn === globalAuthFilePath() ? "this machine" : orphansDefaultIn;
|
|
208
|
+
const is = [
|
|
209
|
+
orphansDefaultIn === void 0 ? void 0 : where === "this machine" ? "this machine's default" : `the default in ${where}`,
|
|
210
|
+
pin === void 0 ? void 0 : `the one ${pin.path} pins this project to`
|
|
211
|
+
].filter(Boolean).join(" and ");
|
|
212
|
+
const costs = [
|
|
213
|
+
orphansDefaultIn === void 0 ? void 0 : `leaves ${where} with no default`,
|
|
214
|
+
pin === void 0 ? void 0 : `keeps ${pin.path} naming it, so every command here fails until ${verb === "logout" ? "it is signed in again" : "it is stored again or another profile is pinned"}`
|
|
215
|
+
].filter(Boolean).join(" and ");
|
|
216
|
+
const doing = verb === "logout" ? "Signing out of it" : "Deleting it";
|
|
217
|
+
const { rerun, note } = yesRerun(args, verb === "logout" ? "logout" : "profile delete");
|
|
218
|
+
return confirm(
|
|
219
|
+
`Profile "${pin?.profile ?? name}" is ${is}. ${doing} ${costs}. ${verb === "logout" ? "Sign out" : "Delete it"} anyway?`,
|
|
220
|
+
{ flag: "--yes", refusal: { details: { removed: false, profile: pin?.profile ?? name }, rerun, note } }
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
async function confirmRemoveAll(args, path, names, pin) {
|
|
224
|
+
assertCredentialFileRemovable(path);
|
|
225
|
+
if (args.yes) return true;
|
|
226
|
+
const which = names.length === 1 ? `the one profile ("${safeText(names[0])}")` : `all ${names.length} profiles (${quotedNames(names)})`;
|
|
227
|
+
const pinCost = pin === void 0 ? "" : ` ${pin.path} keeps pinning this project to "${pin.profile}", so every command here fails until it is signed in again.`;
|
|
228
|
+
const { rerun, note } = yesRerun(args, "logout");
|
|
229
|
+
return confirm(`Signing out of ${which} removes ${path}.${pinCost} Sign out of every profile?`, {
|
|
230
|
+
flag: "--yes",
|
|
231
|
+
refusal: { details: { removed: false, profiles: [...names] }, rerun, note }
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function declined(args, authFilePath, names, pin) {
|
|
235
|
+
info("Nothing was removed.");
|
|
236
|
+
if (isMachineOutput(args)) writeLogoutDocument(authFilePath, [], names, { declined: true, ...pin === void 0 ? {} : { pin } });
|
|
237
|
+
}
|
|
238
|
+
function notePinLeft(pin, path, record) {
|
|
239
|
+
if (pin === void 0) return;
|
|
240
|
+
warn(
|
|
241
|
+
`${pin.path} still pins this project to "${pin.profile}", which is signed out now. Sign in again with \`${signInAgain(path, pin.profile, record)}\`, or pin another profile with \`xanosdk profile use <name>\`.`,
|
|
242
|
+
"logout.pin-signed-out"
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function writeLogoutDocument(path, removed, remaining, outcome = {}) {
|
|
246
|
+
writeJson({
|
|
247
|
+
verb: "logout",
|
|
248
|
+
path,
|
|
249
|
+
removed,
|
|
250
|
+
remaining,
|
|
251
|
+
clearedDefault: outcome.clearedDefault ?? false,
|
|
252
|
+
alreadyGone: outcome.alreadyGone ?? false,
|
|
253
|
+
removedFile: outcome.removedFile ?? false,
|
|
254
|
+
// A confirmation of a pinned profile's sign-out answered no.
|
|
255
|
+
declined: outcome.declined ?? false,
|
|
256
|
+
// The `xano.profile.json` still pinning a profile this run signed out of —
|
|
257
|
+
// kept, since it is committed; null when none does.
|
|
258
|
+
pinnedBy: outcome.pin?.path ?? null,
|
|
259
|
+
environmentCredential: envCredentialVars(),
|
|
260
|
+
// `revoked`: whether the removed session was ended on the server — null when
|
|
261
|
+
// there was none to end (a meta API token, nothing removed). `false` means it
|
|
262
|
+
// may still be live, with the reason in `revokeError`.
|
|
263
|
+
...revokeFields(outcome.revoke ?? { revoked: null })
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
function envCredentialVars() {
|
|
267
|
+
return environmentCredentialVars().vars;
|
|
268
|
+
}
|
|
269
|
+
function noteEnvCredential() {
|
|
270
|
+
const { vars, complete } = environmentCredentialVars();
|
|
271
|
+
if (vars.length === 0) return;
|
|
272
|
+
const them = vars.length === 1 ? "it" : "them";
|
|
273
|
+
const set = `${vars.join(", ")} ${vars.length === 1 ? "is" : "are"} still set in this environment`;
|
|
274
|
+
warn(
|
|
275
|
+
complete ? `${set} \u2014 commands keep authenticating with ${them}. Unset ${them} to sign out fully.` : `${set} \u2014 it is an incomplete credential, so commands fail on it rather than using a stored profile. Unset ${them}.`,
|
|
276
|
+
"logout.env-still-set"
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
function refuseIfOnlyInProjectFile(args, authFilePath, selection, names) {
|
|
280
|
+
if (args.local || authFilePath !== globalAuthFilePath()) return;
|
|
281
|
+
const local = localAuthFilePath();
|
|
282
|
+
if (local === authFilePath || !existsSync(local)) return;
|
|
283
|
+
let held;
|
|
284
|
+
try {
|
|
285
|
+
held = readCredentialFile(local);
|
|
286
|
+
} catch {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (held === null || !Object.prototype.hasOwnProperty.call(held.profiles, selection.name)) return;
|
|
290
|
+
throw new ProfileNotFoundError(
|
|
291
|
+
`Profile "${selection.name}" is not in ${authFilePath}, the file \`logout\` clears by default \u2014 it is stored in this project's ${local}. Run \`xanosdk logout --local -p ${selection.name}\` to sign out of it there.`,
|
|
292
|
+
selection,
|
|
293
|
+
names
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
function refuseNearMiss(args, authFilePath, file, selection, names) {
|
|
297
|
+
const nearAll = suggestAll(selection.name, names);
|
|
298
|
+
if (nearAll.length === 0) return;
|
|
299
|
+
const again = `${args.json === true ? " --json" : ""}${authFilePath === resolve(projectAuthFilePath()) ? "" : credentialFileFlag(authFilePath)}`;
|
|
300
|
+
const confirms = (n) => pinnedBy(authFilePath, [n]) !== void 0 || file.default === n && names.length > 1;
|
|
301
|
+
const err = new ProfileNotFoundError(
|
|
302
|
+
[
|
|
303
|
+
`Profile "${selection.name}" is not signed in at ${authFilePath} \u2014 nothing was signed out. Signed in as: ${quotedNames(names)}.`,
|
|
304
|
+
...nearAll.map(
|
|
305
|
+
(n) => `Did you mean "${safeText(n)}"? \`xanosdk logout --profile ${shellQuote(n)}${again}\` signs it out${confirms(n) ? ", after asking to confirm" : ""}.`
|
|
306
|
+
)
|
|
307
|
+
].join("\n"),
|
|
308
|
+
selection,
|
|
309
|
+
names
|
|
310
|
+
);
|
|
311
|
+
Object.defineProperty(err, "suggestion", { value: nearAll[0], enumerable: true });
|
|
312
|
+
if (nearAll.length > 1) Object.defineProperty(err, "suggestions", { value: nearAll, enumerable: true });
|
|
313
|
+
throw err;
|
|
314
|
+
}
|
|
315
|
+
function activeProfile(args, file) {
|
|
316
|
+
return resolveActiveProfile({
|
|
317
|
+
flag: args.profile,
|
|
318
|
+
fileDefault: file.default,
|
|
319
|
+
readPointer: () => resolveProjectProfile(process.cwd())
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function afterFailedRevoke(context) {
|
|
323
|
+
switch (context) {
|
|
324
|
+
case "logout":
|
|
325
|
+
return "Removing the local copy anyway.";
|
|
326
|
+
case "replace":
|
|
327
|
+
return "It was replaced here anyway \u2014 the replaced session stays valid on the server until it expires.";
|
|
328
|
+
case "minted":
|
|
329
|
+
return "It was never stored, so nothing here holds it \u2014 the unused session stays valid on the server until it expires.";
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
async function revokeProfileSession(args, saved, profile, context = "logout") {
|
|
333
|
+
if (!saved.refresh_token) return { revoked: null };
|
|
334
|
+
const whose = context === "logout" ? `profile "${profile}"'s refresh token` : context === "replace" ? `the session profile "${profile}" held before` : `the session this sign-in minted for profile "${profile}"`;
|
|
335
|
+
try {
|
|
336
|
+
assertHttpsOrigin(saved.auth_host, "The stored sign-in server (`auth_host`)");
|
|
337
|
+
} catch (err) {
|
|
338
|
+
const why = err instanceof Error ? err.message : String(err);
|
|
339
|
+
warn(`Did not revoke ${whose}: ${why} The token was not sent. ${afterFailedRevoke(context)}`, "logout.revoke-failed");
|
|
340
|
+
return { revoked: false, error: oneLine(`The token was not sent: ${why}`) };
|
|
341
|
+
}
|
|
342
|
+
const provider = new OpenIdProvider({
|
|
343
|
+
authHost: saved.auth_host,
|
|
344
|
+
scope: saved.scope ?? resolveScope(args),
|
|
345
|
+
clientId: saved.client_id
|
|
346
|
+
});
|
|
347
|
+
try {
|
|
348
|
+
await provider.revoke(saved.refresh_token);
|
|
349
|
+
return { revoked: true };
|
|
350
|
+
} catch (err) {
|
|
351
|
+
return { revoked: false, error: await warnRevokeFailed(whose, saved.auth_host, err, context) };
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function revokeFields(outcome) {
|
|
355
|
+
return { revoked: outcome.revoked, revokeError: outcome.revoked === false ? outcome.error : null };
|
|
356
|
+
}
|
|
357
|
+
function combineRevokes(outcomes) {
|
|
358
|
+
const tried = outcomes.filter((o) => o.outcome.revoked !== null);
|
|
359
|
+
if (tried.length === 0) return { revoked: null };
|
|
360
|
+
const failed = tried.flatMap((o) => o.outcome.revoked === false ? [`"${o.profile}": ${o.outcome.error}`] : []);
|
|
361
|
+
return failed.length === 0 ? { revoked: true } : { revoked: false, error: failed.join("; ") };
|
|
362
|
+
}
|
|
363
|
+
function oneLine(text) {
|
|
364
|
+
return text.replace(/\s*\n\s*/g, " ").trim();
|
|
365
|
+
}
|
|
366
|
+
async function warnRevokeFailed(whose, authHost, err, context) {
|
|
367
|
+
const answer = await describeRefreshAnswer(err);
|
|
368
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
369
|
+
warn(
|
|
370
|
+
`Could not revoke ${whose} at ${hostLabel(authHost)} ` + (answer === void 0 ? `(${message})` : `(the server answered ${answer})`) + `. ${afterFailedRevoke(context)}`,
|
|
371
|
+
"logout.revoke-failed"
|
|
372
|
+
);
|
|
373
|
+
return oneLine(
|
|
374
|
+
answer === void 0 ? `${hostLabel(authHost)}: ${message}` : `${hostLabel(authHost)} answered ${answer}`
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
function revocableRecord(file, name, path) {
|
|
378
|
+
if (!Object.prototype.hasOwnProperty.call(file.profiles, name)) return void 0;
|
|
379
|
+
const described = describeProfile(file, name, path);
|
|
380
|
+
if ("record" in described) return described.record.type === "oauth" ? described.record : void 0;
|
|
381
|
+
return salvageRevocable(file.profiles[name]);
|
|
382
|
+
}
|
|
383
|
+
function salvageRevocable(raw) {
|
|
384
|
+
if (typeof raw !== "object" || raw === null) return void 0;
|
|
385
|
+
const r = raw;
|
|
386
|
+
const has = (k) => typeof r[k] === "string" && r[k] !== "";
|
|
387
|
+
if (!has("refresh_token") || !has("client_id") || !has("auth_host")) return void 0;
|
|
388
|
+
return {
|
|
389
|
+
type: "oauth",
|
|
390
|
+
refresh_token: r.refresh_token,
|
|
391
|
+
client_id: r.client_id,
|
|
392
|
+
auth_host: r.auth_host,
|
|
393
|
+
scope: typeof r.scope === "string" ? r.scope : void 0
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function signInAgain(path, name, record) {
|
|
397
|
+
const r = typeof record === "object" && record !== null ? record : {};
|
|
398
|
+
if (r.type === "token" && typeof r.instance_base_url === "string" && typeof r.workspace_id === "number") {
|
|
399
|
+
return `xanosdk profile add ${shellQuote(name)}${credentialFileFlag(path)} --instance ${shellQuote(r.instance_base_url)} --workspace-id ${r.workspace_id}`;
|
|
400
|
+
}
|
|
401
|
+
return loginCommand(name, { path, origin: typeof r.auth_host === "string" ? r.auth_host : void 0 });
|
|
402
|
+
}
|
|
403
|
+
function reportWhatIsLeft(path, removed, left, wasDefault, record) {
|
|
404
|
+
detail(`Removed profile "${removed}" from ${path}`);
|
|
405
|
+
const fileFlag = credentialFileFlag(path);
|
|
406
|
+
if (left.length === 0) {
|
|
407
|
+
detail(`It was the last profile, so ${path} was removed.`);
|
|
408
|
+
if (envCredentialVars().length === 0) {
|
|
409
|
+
detail(`No profiles are left \u2014 run \`${signInAgain(path, removed, record)}\` to sign in again.`);
|
|
410
|
+
}
|
|
411
|
+
} else if (wasDefault) {
|
|
412
|
+
detail(
|
|
413
|
+
`${path === globalAuthFilePath() ? "This machine has" : `${path} has`} no default now. Signed in as: ${quotedNames(left)} \u2014 set one with \`xanosdk profile set-default ${left.length === 1 ? left[0] : "<name>"}${fileFlag}\`.`
|
|
414
|
+
);
|
|
415
|
+
} else {
|
|
416
|
+
detail(`Still signed in as: ${quotedNames(left)}.`);
|
|
417
|
+
}
|
|
418
|
+
noteEnvCredential();
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export {
|
|
422
|
+
runLogoutCommand,
|
|
423
|
+
confirmDanglingRemoval,
|
|
424
|
+
revokeProfileSession,
|
|
425
|
+
revokeFields,
|
|
426
|
+
combineRevokes,
|
|
427
|
+
warnRevokeFailed,
|
|
428
|
+
revocableRecord,
|
|
429
|
+
salvageRevocable,
|
|
430
|
+
signInAgain
|
|
431
|
+
};
|
|
432
|
+
//# sourceMappingURL=chunk-ELP2HMXC.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/kinds/def-brand.ts
|
|
2
|
+
var DEF_KIND = /* @__PURE__ */ Symbol.for("xanosdk.def.kind");
|
|
3
|
+
function brandDef(def, kind) {
|
|
4
|
+
if (typeof def !== "object" || def === null) return def;
|
|
5
|
+
try {
|
|
6
|
+
Object.defineProperty(def, DEF_KIND, { value: kind, enumerable: false, configurable: true });
|
|
7
|
+
} catch {
|
|
8
|
+
}
|
|
9
|
+
return def;
|
|
10
|
+
}
|
|
11
|
+
function defKindOf(def) {
|
|
12
|
+
if (typeof def !== "object" || def === null) return void 0;
|
|
13
|
+
const kind = def[DEF_KIND];
|
|
14
|
+
return typeof kind === "string" ? kind : void 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
brandDef,
|
|
19
|
+
defKindOf
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-ERVIASGL.js.map
|