squidcloudctl 1.1.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/dist/auth-revoke-OC67YCEQ.js +2 -0
- package/dist/auth-revoke-OC67YCEQ.js.map +1 -0
- package/dist/auth-sessions-XIBWY6BL.js +2 -0
- package/dist/auth-sessions-XIBWY6BL.js.map +1 -0
- package/dist/auth-status-B5VLDH27.js +2 -0
- package/dist/auth-status-B5VLDH27.js.map +1 -0
- package/dist/bin/squidcloud.js +4 -0
- package/dist/bin/squidcloud.js.map +1 -0
- package/dist/chunk-6TS5Y27A.js +6 -0
- package/dist/chunk-6TS5Y27A.js.map +1 -0
- package/dist/chunk-C5KZCYJ4.js +2 -0
- package/dist/chunk-C5KZCYJ4.js.map +1 -0
- package/dist/chunk-G4JU7IUC.js +2 -0
- package/dist/chunk-G4JU7IUC.js.map +1 -0
- package/dist/chunk-LWB2J3KU.js +2 -0
- package/dist/chunk-LWB2J3KU.js.map +1 -0
- package/dist/chunk-MKRWNV2T.js +2 -0
- package/dist/chunk-MKRWNV2T.js.map +1 -0
- package/dist/chunk-NDB6KXYI.js +3 -0
- package/dist/chunk-NDB6KXYI.js.map +1 -0
- package/dist/chunk-ON3YIMVG.js +2 -0
- package/dist/chunk-ON3YIMVG.js.map +1 -0
- package/dist/chunk-QT7R3AXE.js +3 -0
- package/dist/chunk-QT7R3AXE.js.map +1 -0
- package/dist/chunk-RWWBBPEJ.js +2 -0
- package/dist/chunk-RWWBBPEJ.js.map +1 -0
- package/dist/chunk-THMWE2I6.js +2 -0
- package/dist/chunk-THMWE2I6.js.map +1 -0
- package/dist/client-FRNT7PEB.js +2 -0
- package/dist/client-FRNT7PEB.js.map +1 -0
- package/dist/collab-activity-GQOGCECR.js +2 -0
- package/dist/collab-activity-GQOGCECR.js.map +1 -0
- package/dist/collab-invite-HUSQYV23.js +2 -0
- package/dist/collab-invite-HUSQYV23.js.map +1 -0
- package/dist/collab-leave-W2ESTT5L.js +2 -0
- package/dist/collab-leave-W2ESTT5L.js.map +1 -0
- package/dist/collab-list-722OEBJQ.js +2 -0
- package/dist/collab-list-722OEBJQ.js.map +1 -0
- package/dist/collab-remove-ZMB22U2T.js +2 -0
- package/dist/collab-remove-ZMB22U2T.js.map +1 -0
- package/dist/collab-transfer-56MH4IT6.js +2 -0
- package/dist/collab-transfer-56MH4IT6.js.map +1 -0
- package/dist/completion-IF3NB7PB.js +44 -0
- package/dist/completion-IF3NB7PB.js.map +1 -0
- package/dist/config-7G24FXQJ.js +2 -0
- package/dist/config-7G24FXQJ.js.map +1 -0
- package/dist/config-delete-VSIFFODZ.js +2 -0
- package/dist/config-delete-VSIFFODZ.js.map +1 -0
- package/dist/config-get-DDNSM5EH.js +2 -0
- package/dist/config-get-DDNSM5EH.js.map +1 -0
- package/dist/config-reset-ZFMP4J5H.js +2 -0
- package/dist/config-reset-ZFMP4J5H.js.map +1 -0
- package/dist/config-set-O6JKOGGN.js +2 -0
- package/dist/config-set-O6JKOGGN.js.map +1 -0
- package/dist/deploy-WK3VAA7D.js +3 -0
- package/dist/deploy-WK3VAA7D.js.map +1 -0
- package/dist/doctor-C7TZGTCO.js +2 -0
- package/dist/doctor-C7TZGTCO.js.map +1 -0
- package/dist/feedback-QUGQAWZB.js +3 -0
- package/dist/feedback-QUGQAWZB.js.map +1 -0
- package/dist/forms-clear-2ERBEAEY.js +2 -0
- package/dist/forms-clear-2ERBEAEY.js.map +1 -0
- package/dist/forms-create-3ONGTRQZ.js +2 -0
- package/dist/forms-create-3ONGTRQZ.js.map +1 -0
- package/dist/forms-delete-CKLGD52U.js +2 -0
- package/dist/forms-delete-CKLGD52U.js.map +1 -0
- package/dist/forms-embed-4S46VDP4.js +3 -0
- package/dist/forms-embed-4S46VDP4.js.map +1 -0
- package/dist/forms-export-WGHH5TBF.js +2 -0
- package/dist/forms-export-WGHH5TBF.js.map +1 -0
- package/dist/forms-info-OMXUOOBT.js +2 -0
- package/dist/forms-info-OMXUOOBT.js.map +1 -0
- package/dist/forms-list-ZRKQXGLM.js +2 -0
- package/dist/forms-list-ZRKQXGLM.js.map +1 -0
- package/dist/forms-submissions-K7W7XYPR.js +2 -0
- package/dist/forms-submissions-K7W7XYPR.js.map +1 -0
- package/dist/login-JJ7YHQB5.js +2 -0
- package/dist/login-JJ7YHQB5.js.map +1 -0
- package/dist/logout-PS2XK3GB.js +2 -0
- package/dist/logout-PS2XK3GB.js.map +1 -0
- package/dist/logs-export-55G3COYK.js +2 -0
- package/dist/logs-export-55G3COYK.js.map +1 -0
- package/dist/logs-search-5QCEBZ6W.js +2 -0
- package/dist/logs-search-5QCEBZ6W.js.map +1 -0
- package/dist/logs-tail-OYLJ5EOM.js +3 -0
- package/dist/logs-tail-OYLJ5EOM.js.map +1 -0
- package/dist/monitor-XUW4BMBQ.js +2 -0
- package/dist/monitor-XUW4BMBQ.js.map +1 -0
- package/dist/monitor-automations-TSO65I6U.js +2 -0
- package/dist/monitor-automations-TSO65I6U.js.map +1 -0
- package/dist/monitor-pipelines-OPCTGGRR.js +2 -0
- package/dist/monitor-pipelines-OPCTGGRR.js.map +1 -0
- package/dist/monitor-sites-OLSGE4V2.js +2 -0
- package/dist/monitor-sites-OLSGE4V2.js.map +1 -0
- package/dist/monitor-storage-CVFXC3ZS.js +2 -0
- package/dist/monitor-storage-CVFXC3ZS.js.map +1 -0
- package/dist/scripts-cancel-OR2UFFC3.js +2 -0
- package/dist/scripts-cancel-OR2UFFC3.js.map +1 -0
- package/dist/scripts-delete-HMHBIL4G.js +2 -0
- package/dist/scripts-delete-HMHBIL4G.js.map +1 -0
- package/dist/scripts-disable-ABFUD34Y.js +2 -0
- package/dist/scripts-disable-ABFUD34Y.js.map +1 -0
- package/dist/scripts-enable-VMRAPULS.js +2 -0
- package/dist/scripts-enable-VMRAPULS.js.map +1 -0
- package/dist/scripts-init-AU6WNMKB.js +14 -0
- package/dist/scripts-init-AU6WNMKB.js.map +1 -0
- package/dist/scripts-list-DV2QVLPX.js +2 -0
- package/dist/scripts-list-DV2QVLPX.js.map +1 -0
- package/dist/scripts-logs-AHTMTQ6G.js +2 -0
- package/dist/scripts-logs-AHTMTQ6G.js.map +1 -0
- package/dist/scripts-run-K2LFPFTH.js +2 -0
- package/dist/scripts-run-K2LFPFTH.js.map +1 -0
- package/dist/scripts-status-XGI5SMWL.js +2 -0
- package/dist/scripts-status-XGI5SMWL.js.map +1 -0
- package/dist/scripts-validate-7EZXPO3Q.js +2 -0
- package/dist/scripts-validate-7EZXPO3Q.js.map +1 -0
- package/dist/scripts-watch-HN23AZLJ.js +2 -0
- package/dist/scripts-watch-HN23AZLJ.js.map +1 -0
- package/dist/session-T3DZUXHP.js +2 -0
- package/dist/session-T3DZUXHP.js.map +1 -0
- package/dist/sign-cancel-R7KQFEM3.js +2 -0
- package/dist/sign-cancel-R7KQFEM3.js.map +1 -0
- package/dist/sign-download-EHPZ5FMF.js +2 -0
- package/dist/sign-download-EHPZ5FMF.js.map +1 -0
- package/dist/sign-list-6N7G36EO.js +2 -0
- package/dist/sign-list-6N7G36EO.js.map +1 -0
- package/dist/sign-request-DW6BS67P.js +2 -0
- package/dist/sign-request-DW6BS67P.js.map +1 -0
- package/dist/sign-status-L4PNMSBI.js +2 -0
- package/dist/sign-status-L4PNMSBI.js.map +1 -0
- package/dist/sign-verify-I6YPHFUW.js +2 -0
- package/dist/sign-verify-I6YPHFUW.js.map +1 -0
- package/dist/sites-analytics-JMW6DAC3.js +2 -0
- package/dist/sites-analytics-JMW6DAC3.js.map +1 -0
- package/dist/sites-delete-M4DJ3GXV.js +2 -0
- package/dist/sites-delete-M4DJ3GXV.js.map +1 -0
- package/dist/sites-deploys-2HBSXQA4.js +2 -0
- package/dist/sites-deploys-2HBSXQA4.js.map +1 -0
- package/dist/sites-info-CIDGRZRJ.js +2 -0
- package/dist/sites-info-CIDGRZRJ.js.map +1 -0
- package/dist/sites-list-L56B32PU.js +2 -0
- package/dist/sites-list-L56B32PU.js.map +1 -0
- package/dist/sites-logs-NMNQXOKI.js +3 -0
- package/dist/sites-logs-NMNQXOKI.js.map +1 -0
- package/dist/sites-open-JOJQ5PW2.js +3 -0
- package/dist/sites-open-JOJQ5PW2.js.map +1 -0
- package/dist/sites-purge-IA2673H4.js +2 -0
- package/dist/sites-purge-IA2673H4.js.map +1 -0
- package/dist/sites-rename-WFSBG4ME.js +2 -0
- package/dist/sites-rename-WFSBG4ME.js.map +1 -0
- package/dist/sites-rollback-REUDH4TZ.js +2 -0
- package/dist/sites-rollback-REUDH4TZ.js.map +1 -0
- package/dist/sites-unpublish-AS4D6N3M.js +2 -0
- package/dist/sites-unpublish-AS4D6N3M.js.map +1 -0
- package/dist/sites-visibility-S3TKH6XD.js +2 -0
- package/dist/sites-visibility-S3TKH6XD.js.map +1 -0
- package/dist/storage-cat-LZ7LYZAY.js +2 -0
- package/dist/storage-cat-LZ7LYZAY.js.map +1 -0
- package/dist/storage-clean-S57ZHSGL.js +2 -0
- package/dist/storage-clean-S57ZHSGL.js.map +1 -0
- package/dist/storage-cp-M2BVRCIL.js +2 -0
- package/dist/storage-cp-M2BVRCIL.js.map +1 -0
- package/dist/storage-diff-ZATBMPAM.js +2 -0
- package/dist/storage-diff-ZATBMPAM.js.map +1 -0
- package/dist/storage-download-PZEEX2Z3.js +3 -0
- package/dist/storage-download-PZEEX2Z3.js.map +1 -0
- package/dist/storage-info-T62YZOPK.js +2 -0
- package/dist/storage-info-T62YZOPK.js.map +1 -0
- package/dist/storage-ls-DGOI7ZXX.js +2 -0
- package/dist/storage-ls-DGOI7ZXX.js.map +1 -0
- package/dist/storage-mkdir-J4BYV3QL.js +2 -0
- package/dist/storage-mkdir-J4BYV3QL.js.map +1 -0
- package/dist/storage-mv-R73IGYOM.js +2 -0
- package/dist/storage-mv-R73IGYOM.js.map +1 -0
- package/dist/storage-rm-M3UODY5G.js +2 -0
- package/dist/storage-rm-M3UODY5G.js.map +1 -0
- package/dist/storage-search-H44Y6OKS.js +2 -0
- package/dist/storage-search-H44Y6OKS.js.map +1 -0
- package/dist/storage-share-VIJJIHBX.js +2 -0
- package/dist/storage-share-VIJJIHBX.js.map +1 -0
- package/dist/storage-tag-PAVT6GBZ.js +2 -0
- package/dist/storage-tag-PAVT6GBZ.js.map +1 -0
- package/dist/storage-unshare-O3AAJZMT.js +2 -0
- package/dist/storage-unshare-O3AAJZMT.js.map +1 -0
- package/dist/storage-upload-DRYGLH2O.js +2 -0
- package/dist/storage-upload-DRYGLH2O.js.map +1 -0
- package/dist/time-list-CW2OOCPT.js +2 -0
- package/dist/time-list-CW2OOCPT.js.map +1 -0
- package/dist/time-lock-A2MZ3MP2.js +2 -0
- package/dist/time-lock-A2MZ3MP2.js.map +1 -0
- package/dist/time-proof-ZLRY6ZVZ.js +2 -0
- package/dist/time-proof-ZLRY6ZVZ.js.map +1 -0
- package/dist/time-status-XQLRCYF6.js +2 -0
- package/dist/time-status-XQLRCYF6.js.map +1 -0
- package/dist/time-unlock-KNMGQ3TK.js +2 -0
- package/dist/time-unlock-KNMGQ3TK.js.map +1 -0
- package/dist/update-IYMIV34T.js +2 -0
- package/dist/update-IYMIV34T.js.map +1 -0
- package/dist/version-7IHVNLWY.js +2 -0
- package/dist/version-7IHVNLWY.js.map +1 -0
- package/dist/whoami-WIHSRTUN.js +2 -0
- package/dist/whoami-WIHSRTUN.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-ON3YIMVG.js';import'./chunk-6TS5Y27A.js';import {e}from'./chunk-RWWBBPEJ.js';import'./chunk-NDB6KXYI.js';import'./chunk-THMWE2I6.js';import {g}from'./chunk-QT7R3AXE.js';import {o}from'./chunk-C5KZCYJ4.js';import a from'inquirer';async function c(e$1){if(e$1.all){let{confirm:s}=await a.prompt([{type:"confirm",name:"confirm",message:"Revoke ALL active sessions? This will log out every device.",default:false}]);if(!s)return;let t=a$1("Revoking all sessions...");t.start(),await e("/api/auth/ssp/revoke-all",{},{authenticated:true}),await o(),t.succeed(),g("All sessions revoked");return}if(e$1.session){let s=a$1(`Revoking session ${e$1.session}...`);s.start(),await e("/api/auth/ssp/revoke",{session_id:e$1.session},{authenticated:true}),s.succeed(),g(`Session ${e$1.session} revoked`);return}console.error("Specify --session <id> or --all"),process.exit(1);}export{c as default};//# sourceMappingURL=auth-revoke-OC67YCEQ.js.map
|
|
2
|
+
//# sourceMappingURL=auth-revoke-OC67YCEQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/auth/auth-revoke.ts"],"names":["authRevoke","options","confirm","inquirer","spinner","createSpinner","apiPost","clearSession","logSuccess"],"mappings":"mQAOA,eAAOA,CAAAA,CAAkCC,GAAAA,CAA6D,CACpG,GAAIA,GAAAA,CAAQ,GAAA,CAAK,CACf,GAAM,CAAE,QAAAC,CAAQ,CAAA,CAAI,MAAMC,CAAAA,CAAS,MAAA,CAAO,CAAC,CACzC,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,6DAAA,CACT,QAAS,KACX,CAAC,CAAC,CAAA,CACF,GAAI,CAACD,EAAS,OACd,IAAME,CAAAA,CAAUC,GAAAA,CAAc,0BAA0B,CAAA,CACxDD,EAAQ,KAAA,EAAM,CACd,MAAME,CAAAA,CAAQ,0BAAA,CAA4B,EAAC,CAAG,CAAE,aAAA,CAAe,IAAK,CAAC,CAAA,CACrE,MAAMC,CAAAA,GACNH,CAAAA,CAAQ,OAAA,EAAQ,CAChBI,CAAAA,CAAW,sBAAsB,CAAA,CACjC,MACF,CAEA,GAAIP,GAAAA,CAAQ,OAAA,CAAS,CACnB,IAAMG,EAAUC,GAAAA,CAAc,CAAA,iBAAA,EAAoBJ,GAAAA,CAAQ,OAAO,CAAA,GAAA,CAAK,CAAA,CACtEG,EAAQ,KAAA,EAAM,CACd,MAAME,CAAAA,CAAQ,sBAAA,CAAwB,CAAE,WAAYL,GAAAA,CAAQ,OAAQ,CAAA,CAAG,CAAE,aAAA,CAAe,IAAK,CAAC,CAAA,CAC9FG,CAAAA,CAAQ,OAAA,EAAQ,CAChBI,CAAAA,CAAW,CAAA,QAAA,EAAWP,IAAQ,OAAO,CAAA,QAAA,CAAU,CAAA,CAC/C,MACF,CAEA,OAAA,CAAQ,KAAA,CAAM,iCAAiC,CAAA,CAC/C,OAAA,CAAQ,IAAA,CAAK,CAAC,EAChB","file":"auth-revoke-OC67YCEQ.js","sourcesContent":["import { Command } from 'commander'\nimport { apiPost } from '../../lib/api/client.js'\nimport { clearSession } from '../../lib/auth/session.js'\nimport { createSpinner } from '../../lib/output/spinner.js'\nimport { logSuccess } from '../../lib/output/logger.js'\nimport inquirer from 'inquirer'\n\nexport default async function authRevoke(options: { session?: string; all?: boolean }): Promise<void> {\n if (options.all) {\n const { confirm } = await inquirer.prompt([{\n type: 'confirm',\n name: 'confirm',\n message: 'Revoke ALL active sessions? This will log out every device.',\n default: false,\n }])\n if (!confirm) return\n const spinner = createSpinner('Revoking all sessions...')\n spinner.start()\n await apiPost('/api/auth/ssp/revoke-all', {}, { authenticated: true })\n await clearSession()\n spinner.succeed()\n logSuccess('All sessions revoked')\n return\n }\n\n if (options.session) {\n const spinner = createSpinner(`Revoking session ${options.session}...`)\n spinner.start()\n await apiPost('/api/auth/ssp/revoke', { session_id: options.session }, { authenticated: true })\n spinner.succeed()\n logSuccess(`Session ${options.session} revoked`)\n return\n }\n\n console.error('Specify --session <id> or --all')\n process.exit(1)\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d}from'./chunk-RWWBBPEJ.js';import'./chunk-NDB6KXYI.js';import {a}from'./chunk-THMWE2I6.js';import {b,c}from'./chunk-G4JU7IUC.js';import'./chunk-QT7R3AXE.js';import'./chunk-C5KZCYJ4.js';async function s(){let i=((await d("/api/auth/ssp/sessions",{authenticated:true})).sessions||[]).map(e=>({id:e.id.slice(0,8)+"...",device:e.device_fingerprint.slice(0,12),platform:e.platform||"unknown",last_seen:c(e.last_seen),created:b(e.created_at),current:e.current?"\u25CF":""}));console.log(a(i,[{key:"id",label:"Session ID"},{key:"device",label:"Fingerprint"},{key:"platform",label:"Platform"},{key:"last_seen",label:"Last Seen"},{key:"created",label:"Created"},{key:"current",label:""}]));}export{s as default};//# sourceMappingURL=auth-sessions-XIBWY6BL.js.map
|
|
2
|
+
//# sourceMappingURL=auth-sessions-XIBWY6BL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/auth/auth-sessions.ts"],"names":["authSessions","rows","apiGet","s","formatRelative","formatDate","renderTable"],"mappings":"kMAaA,eAAOA,CAAAA,EAAqD,CAE1D,IAAMC,CAAAA,CAAAA,CAAAA,CADO,MAAMC,CAAAA,CAAoC,wBAAA,CAA0B,CAAE,aAAA,CAAe,IAAK,CAAC,CAAA,EACrF,QAAA,EAAY,EAAC,EAAG,GAAA,CAAIC,IAAM,CAC3C,EAAA,CAAIA,CAAAA,CAAE,EAAA,CAAG,KAAA,CAAM,CAAA,CAAG,CAAC,CAAA,CAAI,KAAA,CACvB,OAAQA,CAAAA,CAAE,kBAAA,CAAmB,MAAM,CAAA,CAAG,EAAE,EACxC,QAAA,CAAUA,CAAAA,CAAE,UAAY,SAAA,CACxB,SAAA,CAAWC,EAAeD,CAAAA,CAAE,SAAS,EACrC,OAAA,CAASE,CAAAA,CAAWF,CAAAA,CAAE,UAAU,CAAA,CAChC,OAAA,CAASA,EAAE,OAAA,CAAU,QAAA,CAAM,EAC7B,CAAA,CAAE,CAAA,CACF,QAAQ,GAAA,CAAIG,CAAAA,CAAYL,EAAM,CAC5B,CAAE,IAAK,IAAA,CAAM,KAAA,CAAO,YAAa,CAAA,CACjC,CAAE,IAAK,QAAA,CAAU,KAAA,CAAO,aAAc,CAAA,CACtC,CAAE,GAAA,CAAK,WAAY,KAAA,CAAO,UAAW,EACrC,CAAE,GAAA,CAAK,YAAa,KAAA,CAAO,WAAY,CAAA,CACvC,CAAE,GAAA,CAAK,SAAA,CAAW,MAAO,SAAU,CAAA,CACnC,CAAE,GAAA,CAAK,SAAA,CAAW,MAAO,EAAG,CAC9B,CAAC,CAAC,EACJ","file":"auth-sessions-XIBWY6BL.js","sourcesContent":["import { apiGet } from '../../lib/api/client.js'\nimport { renderTable } from '../../lib/output/table.js'\nimport { formatDate, formatRelative } from '../../lib/utils/format.js'\n\ninterface SessionInfo {\n id: string\n device_fingerprint: string\n platform: string\n last_seen: string\n created_at: string\n current: boolean\n}\n\nexport default async function authSessions(): Promise<void> {\n const data = await apiGet<{ sessions: SessionInfo[] }>('/api/auth/ssp/sessions', { authenticated: true })\n const rows = (data.sessions || []).map(s => ({\n id: s.id.slice(0, 8) + '...',\n device: s.device_fingerprint.slice(0, 12),\n platform: s.platform || 'unknown',\n last_seen: formatRelative(s.last_seen),\n created: formatDate(s.created_at),\n current: s.current ? '●' : '',\n }))\n console.log(renderTable(rows, [\n { key: 'id', label: 'Session ID' },\n { key: 'device', label: 'Fingerprint' },\n { key: 'platform', label: 'Platform' },\n { key: 'last_seen', label: 'Last Seen' },\n { key: 'created', label: 'Created' },\n { key: 'current', label: '' },\n ]))\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d}from'./chunk-G4JU7IUC.js';import {h,f,m as m$1,l as l$1}from'./chunk-QT7R3AXE.js';import {m,l,r}from'./chunk-C5KZCYJ4.js';import e from'chalk';async function u(){let i=await m();i||(h("Not authenticated"),process.exit(1));let f$1=l(),t=i.device_fingerprint===f$1,o=r(i),s=o<=120*1e3;if(f()){m$1({authenticated:true,session_id:i.session_id,expires_in_ms:o,fingerprint_match:t,needs_refresh:s,user:i.user});return}l$1(""),l$1(`${e.bold("Session Health")}`),l$1(`${e.dim("\u2500\u2500\u2500".repeat(15))}`),l$1(` ${e.bold("Session ID:")} ${e.dim(i.session_id)}`),l$1(` ${e.bold("User:")} ${i.user.email} (${i.user.username})`),l$1(` ${e.bold("Plan:")} ${e.hex("#7C4DFF")(i.user.plan)}`),l$1(` ${e.bold("Expires:")} ${o>0?d(o):e.red("expired")}`),l$1(` ${e.bold("Fingerprint:")} ${t?e.green("\u2713 match"):e.red("\u2717 mismatch")}`),l$1(` ${e.bold("Refresh:")} ${s?e.yellow("needed soon"):e.green("ok")}`),l$1("");}export{u as default};//# sourceMappingURL=auth-status-B5VLDH27.js.map
|
|
2
|
+
//# sourceMappingURL=auth-status-B5VLDH27.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/auth/auth-status.ts"],"names":["authStatus","session","loadSession","logError","currentFingerprint","computeDeviceFingerprint","fingerprintMatch","timeLeft","getTimeUntilExpiry","needsRefresh","isJsonMode","logJSON","logRaw","chalk","formatCountdown"],"mappings":"yJAOA,eAAOA,GAAmD,CACxD,IAAMC,EAAU,MAAMC,CAAAA,GACjBD,CAAAA,GACHE,CAAAA,CAAS,mBAAmB,CAAA,CAC5B,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA,CAGhB,IAAMC,GAAAA,CAAqBC,CAAAA,EAAyB,CAC9CC,CAAAA,CAAmBL,EAAQ,kBAAA,GAAuBG,GAAAA,CAClDG,EAAWC,CAAAA,CAAmBP,CAAO,EACrCQ,CAAAA,CAAeF,CAAAA,EAAY,IAAS,GAAA,CAE1C,GAAIG,GAAW,CAAG,CAChBC,IAAQ,CACN,aAAA,CAAe,KACf,UAAA,CAAYV,CAAAA,CAAQ,UAAA,CACpB,aAAA,CAAeM,EACf,iBAAA,CAAmBD,CAAAA,CACnB,cAAeG,CAAAA,CACf,IAAA,CAAMR,EAAQ,IAChB,CAAC,EACD,MACF,CAEAW,IAAO,EAAE,CAAA,CACTA,IAAO,CAAA,EAAGC,CAAAA,CAAM,KAAK,gBAAgB,CAAC,EAAE,CAAA,CACxCD,GAAAA,CAAO,GAAGC,CAAAA,CAAM,GAAA,CAAI,qBAAM,MAAA,CAAO,EAAE,CAAC,CAAC,CAAA,CAAE,EACvCD,GAAAA,CAAO,CAAA,EAAA,EAAKC,EAAM,IAAA,CAAK,aAAa,CAAC,CAAA,IAAA,EAAOA,CAAAA,CAAM,IAAIZ,CAAAA,CAAQ,UAAU,CAAC,CAAA,CAAE,EAC3EW,GAAAA,CAAO,CAAA,EAAA,EAAKC,EAAM,IAAA,CAAK,OAAO,CAAC,CAAA,UAAA,EAAaZ,CAAAA,CAAQ,KAAK,KAAK,CAAA,EAAA,EAAKA,EAAQ,IAAA,CAAK,QAAQ,GAAG,CAAA,CAC3FW,GAAAA,CAAO,KAAKC,CAAAA,CAAM,IAAA,CAAK,OAAO,CAAC,CAAA,UAAA,EAAaA,EAAM,GAAA,CAAI,SAAS,EAAEZ,CAAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA,CAAE,EACrFW,GAAAA,CAAO,CAAA,EAAA,EAAKC,EAAM,IAAA,CAAK,UAAU,CAAC,CAAA,OAAA,EAAUN,CAAAA,CAAW,EAAIO,CAAAA,CAAgBP,CAAQ,CAAA,CAAIM,CAAAA,CAAM,IAAI,SAAS,CAAC,EAAE,CAAA,CAC7GD,GAAAA,CAAO,KAAKC,CAAAA,CAAM,IAAA,CAAK,cAAc,CAAC,CAAA,GAAA,EAAMP,EAAmBO,CAAAA,CAAM,KAAA,CAAM,cAAS,CAAA,CAAIA,CAAAA,CAAM,IAAI,iBAAY,CAAC,EAAE,CAAA,CACjHD,GAAAA,CAAO,KAAKC,CAAAA,CAAM,IAAA,CAAK,UAAU,CAAC,CAAA,OAAA,EAAUJ,EAAeI,CAAAA,CAAM,MAAA,CAAO,aAAa,CAAA,CAAIA,CAAAA,CAAM,MAAM,IAAI,CAAC,EAAE,CAAA,CAC5GD,GAAAA,CAAO,EAAE,EACX","file":"auth-status-B5VLDH27.js","sourcesContent":["import { loadSession, getTimeUntilExpiry } from '../../lib/auth/session.js'\nimport { computeDeviceFingerprint } from '../../lib/auth/fingerprint.js'\nimport { logError, logJSON, logRaw } from '../../lib/output/logger.js'\nimport { isJsonMode } from '../../lib/output/logger.js'\nimport chalk from 'chalk'\nimport { formatCountdown } from '../../lib/utils/format.js'\n\nexport default async function authStatus(): Promise<void> {\n const session = await loadSession()\n if (!session) {\n logError('Not authenticated')\n process.exit(1)\n }\n\n const currentFingerprint = computeDeviceFingerprint()\n const fingerprintMatch = session.device_fingerprint === currentFingerprint\n const timeLeft = getTimeUntilExpiry(session)\n const needsRefresh = timeLeft <= 2 * 60 * 1000\n\n if (isJsonMode()) {\n logJSON({\n authenticated: true,\n session_id: session.session_id,\n expires_in_ms: timeLeft,\n fingerprint_match: fingerprintMatch,\n needs_refresh: needsRefresh,\n user: session.user,\n })\n return\n }\n\n logRaw('')\n logRaw(`${chalk.bold('Session Health')}`)\n logRaw(`${chalk.dim('───'.repeat(15))}`)\n logRaw(` ${chalk.bold('Session ID:')} ${chalk.dim(session.session_id)}`)\n logRaw(` ${chalk.bold('User:')} ${session.user.email} (${session.user.username})`)\n logRaw(` ${chalk.bold('Plan:')} ${chalk.hex('#7C4DFF')(session.user.plan)}`)\n logRaw(` ${chalk.bold('Expires:')} ${timeLeft > 0 ? formatCountdown(timeLeft) : chalk.red('expired')}`)\n logRaw(` ${chalk.bold('Fingerprint:')} ${fingerprintMatch ? chalk.green('✓ match') : chalk.red('✗ mismatch')}`)\n logRaw(` ${chalk.bold('Refresh:')} ${needsRefresh ? chalk.yellow('needed soon') : chalk.green('ok')}`)\n logRaw('')\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import'../chunk-ON3YIMVG.js';import {b as b$1}from'../chunk-6TS5Y27A.js';import {a}from'../chunk-RWWBBPEJ.js';import'../chunk-NDB6KXYI.js';import'../chunk-THMWE2I6.js';import {e,d,h,n}from'../chunk-QT7R3AXE.js';import {m,q}from'../chunk-C5KZCYJ4.js';import {Command}from'commander';var P=[{name:"login",aliases:[],description:"Authenticate with SquidCloud",requiresAuth:false,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"auth",handler:()=>import('../login-JJ7YHQB5.js')},{name:"logout",aliases:[],description:"End current CLI session and clear credentials",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"safe",category:"auth",handler:()=>import('../logout-PS2XK3GB.js')},{name:"whoami",aliases:["auth whoami"],description:"Show current authenticated account info",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"auth",handler:()=>import('../whoami-WIHSRTUN.js')},{name:"auth status",aliases:[],description:"Detailed session health check",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"auth",handler:()=>import('../auth-status-B5VLDH27.js')},{name:"auth sessions",aliases:[],description:"List all active CLI sessions",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"auth",handler:()=>import('../auth-sessions-XIBWY6BL.js')},{name:"auth revoke",aliases:[],description:"Revoke a session or all sessions",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"destructive",category:"auth",handler:()=>import('../auth-revoke-OC67YCEQ.js')},{name:"storage ls",aliases:["storage list"],description:"List files and folders in storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-ls-DGOI7ZXX.js')},{name:"storage upload",aliases:["storage up"],description:"Upload files or folders to storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-upload-DRYGLH2O.js')},{name:"storage download",aliases:["storage dl"],description:"Download files or folders from storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-download-PZEEX2Z3.js')},{name:"storage cp",aliases:[],description:"Copy files within storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-cp-M2BVRCIL.js')},{name:"storage mv",aliases:[],description:"Move/rename files within storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"storage",handler:()=>import('../storage-mv-R73IGYOM.js')},{name:"storage rm",aliases:[],description:"Delete files from storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"storage",handler:()=>import('../storage-rm-M3UODY5G.js')},{name:"storage mkdir",aliases:[],description:"Create a folder in storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-mkdir-J4BYV3QL.js')},{name:"storage cat",aliases:[],description:"Print file contents to terminal",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-cat-LZ7LYZAY.js')},{name:"storage info",aliases:[],description:"Show file metadata",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-info-T62YZOPK.js')},{name:"storage share",aliases:[],description:"Generate a share link for a file",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-share-VIJJIHBX.js')},{name:"storage unshare",aliases:[],description:"Revoke all share links for a file",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"storage",handler:()=>import('../storage-unshare-O3AAJZMT.js')},{name:"storage tag",aliases:[],description:"Add or remove file tags",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-tag-PAVT6GBZ.js')},{name:"storage search",aliases:[],description:"Search storage by filename",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-search-H44Y6OKS.js')},{name:"storage diff",aliases:[],description:"Compare local and remote storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"storage",handler:()=>import('../storage-diff-ZATBMPAM.js')},{name:"storage clean",aliases:[],description:"Clean orphaned files from storage",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"storage",handler:()=>import('../storage-clean-S57ZHSGL.js')},{name:"deploy",aliases:["squidsite deploy"],description:"Deploy a static website to SquidCloud Sites",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"deploy",handler:()=>import('../deploy-WK3VAA7D.js')},{name:"sites list",aliases:["sites ls"],description:"List all published sites",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sites",handler:()=>import('../sites-list-L56B32PU.js')},{name:"sites info",aliases:[],description:"Show site details",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sites",handler:()=>import('../sites-info-CIDGRZRJ.js')},{name:"sites open",aliases:[],description:"Open site in browser",requiresAuth:true,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"sites",handler:()=>import('../sites-open-JOJQ5PW2.js')},{name:"sites unpublish",aliases:[],description:"Take a site offline",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"sites",handler:()=>import('../sites-unpublish-AS4D6N3M.js')},{name:"sites delete",aliases:[],description:"Permanently delete a site",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"sites",handler:()=>import('../sites-delete-M4DJ3GXV.js')},{name:"sites visibility",aliases:[],description:"Change site visibility (public/private)",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"sites",handler:()=>import('../sites-visibility-S3TKH6XD.js')},{name:"sites rename",aliases:[],description:"Rename a site slug",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"sites",handler:()=>import('../sites-rename-WFSBG4ME.js')},{name:"sites rollback",aliases:[],description:"Rollback to a previous deployment",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"sites",handler:()=>import('../sites-rollback-REUDH4TZ.js')},{name:"sites deploys",aliases:[],description:"Show deployment history",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sites",handler:()=>import('../sites-deploys-2HBSXQA4.js')},{name:"sites logs",aliases:[],description:"Stream live site access logs",requiresAuth:true,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"sites",handler:()=>import('../sites-logs-NMNQXOKI.js')},{name:"sites analytics",aliases:[],description:"Show site traffic analytics",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sites",handler:()=>import('../sites-analytics-JMW6DAC3.js')},{name:"sites purge",aliases:[],description:"Purge CDN cache for a site",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"sites",handler:()=>import('../sites-purge-IA2673H4.js')},{name:"scripts list",aliases:[],description:"List registered SquidScripts",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-list-DV2QVLPX.js')},{name:"scripts run",aliases:[],description:"Run a SquidScript pipeline",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-run-K2LFPFTH.js')},{name:"scripts logs",aliases:[],description:"View pipeline run logs",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-logs-AHTMTQ6G.js')},{name:"scripts validate",aliases:[],description:"Validate a .squid.yml file",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-validate-7EZXPO3Q.js')},{name:"scripts init",aliases:[],description:"Create a new pipeline interactively",requiresAuth:true,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-init-AU6WNMKB.js')},{name:"scripts enable",aliases:[],description:"Enable a disabled pipeline",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-enable-VMRAPULS.js')},{name:"scripts disable",aliases:[],description:"Disable a pipeline",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"scripts",handler:()=>import('../scripts-disable-ABFUD34Y.js')},{name:"scripts delete",aliases:[],description:"Delete a pipeline",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"scripts",handler:()=>import('../scripts-delete-HMHBIL4G.js')},{name:"scripts status",aliases:[],description:"Show pipeline status",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-status-XGI5SMWL.js')},{name:"scripts cancel",aliases:[],description:"Cancel a running pipeline",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"scripts",handler:()=>import('../scripts-cancel-OR2UFFC3.js')},{name:"scripts watch",aliases:[],description:"Watch .squid.yml for changes",requiresAuth:false,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"scripts",handler:()=>import('../scripts-watch-HN23AZLJ.js')},{name:"filereq list",aliases:["forms list","filereq ls"],description:"List file requests",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"forms",handler:()=>import('../forms-list-ZRKQXGLM.js')},{name:"filereq create",aliases:["forms create"],description:"Create a file request",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"forms",handler:()=>import('../forms-create-3ONGTRQZ.js')},{name:"filereq info",aliases:["forms info"],description:"View file request details",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"forms",handler:()=>import('../forms-info-OMXUOOBT.js')},{name:"filereq submissions",aliases:["forms submissions"],description:"View file request submissions",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"forms",handler:()=>import('../forms-submissions-K7W7XYPR.js')},{name:"filereq export",aliases:["forms export"],description:"Export submissions as CSV",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"safe",category:"forms",handler:()=>import('../forms-export-WGHH5TBF.js')},{name:"filereq clear",aliases:["forms clear"],description:"Clear all submissions",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"forms",handler:()=>import('../forms-clear-2ERBEAEY.js')},{name:"filereq delete",aliases:["forms delete"],description:"Delete a file request",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"forms",handler:()=>import('../forms-delete-CKLGD52U.js')},{name:"filereq embed",aliases:["forms embed"],description:"Get HTML embed snippet",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"safe",category:"forms",handler:()=>import('../forms-embed-4S46VDP4.js')},{name:"time lock",aliases:[],description:"Time-lock a file or folder",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"time",handler:()=>import('../time-lock-A2MZ3MP2.js')},{name:"time unlock",aliases:[],description:"Unlock a time-locked file",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"time",handler:()=>import('../time-unlock-KNMGQ3TK.js')},{name:"time status",aliases:[],description:"Check time-lock status",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"time",handler:()=>import('../time-status-XQLRCYF6.js')},{name:"time list",aliases:[],description:"List all time-locked files",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"time",handler:()=>import('../time-list-CW2OOCPT.js')},{name:"time proof",aliases:[],description:"Export cryptographic existence proof",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"time",handler:()=>import('../time-proof-ZLRY6ZVZ.js')},{name:"collab invite",aliases:[],description:"Invite a collaborator to a folder",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"collab",handler:()=>import('../collab-invite-HUSQYV23.js')},{name:"collab list",aliases:[],description:"List folder collaborators",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"collab",handler:()=>import('../collab-list-722OEBJQ.js')},{name:"collab remove",aliases:[],description:"Remove a collaborator",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"collab",handler:()=>import('../collab-remove-ZMB22U2T.js')},{name:"collab activity",aliases:[],description:"View collaborator activity feed",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"collab",handler:()=>import('../collab-activity-GQOGCECR.js')},{name:"collab leave",aliases:[],description:"Leave a shared folder",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"collab",handler:()=>import('../collab-leave-W2ESTT5L.js')},{name:"collab transfer",aliases:[],description:"Transfer folder ownership",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"collab",handler:()=>import('../collab-transfer-56MH4IT6.js')},{name:"sign request",aliases:[],description:"Request a digital signature",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sign",handler:()=>import('../sign-request-DW6BS67P.js')},{name:"sign status",aliases:[],description:"Check signing request status",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sign",handler:()=>import('../sign-status-L4PNMSBI.js')},{name:"sign list",aliases:[],description:"List signing requests",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sign",handler:()=>import('../sign-list-6N7G36EO.js')},{name:"sign cancel",aliases:[],description:"Cancel a signing request",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"caution",category:"sign",handler:()=>import('../sign-cancel-R7KQFEM3.js')},{name:"sign verify",aliases:[],description:"Verify a signed document",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sign",handler:()=>import('../sign-verify-I6YPHFUW.js')},{name:"sign download",aliases:[],description:"Download signed document",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"sign",handler:()=>import('../sign-download-EHPZ5FMF.js')},{name:"monitor",aliases:[],description:"At-a-glance SquidCloud health dashboard",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"monitor",handler:()=>import('../monitor-XUW4BMBQ.js')},{name:"monitor sites",aliases:[],description:"Site health overview",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"monitor",handler:()=>import('../monitor-sites-OLSGE4V2.js')},{name:"monitor pipelines",aliases:[],description:"Pipeline health overview",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"monitor",handler:()=>import('../monitor-pipelines-OPCTGGRR.js')},{name:"monitor storage",aliases:[],description:"Storage health report",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"monitor",handler:()=>import('../monitor-storage-CVFXC3ZS.js')},{name:"monitor automations",aliases:[],description:"Automation health overview",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"monitor",handler:()=>import('../monitor-automations-TSO65I6U.js')},{name:"logs tail",aliases:[],description:"Stream live logs",requiresAuth:true,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"logs",handler:()=>import('../logs-tail-OYLJ5EOM.js')},{name:"logs search",aliases:[],description:"Search historical logs",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"logs",handler:()=>import('../logs-search-5QCEBZ6W.js')},{name:"logs export",aliases:[],description:"Export logs as JSONL or CSV",requiresAuth:true,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"safe",category:"logs",handler:()=>import('../logs-export-55G3COYK.js')},{name:"doctor",aliases:[],description:"Run system diagnostics",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../doctor-C7TZGTCO.js')},{name:"version",aliases:["--version","-v"],description:"Show CLI version",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../version-7IHVNLWY.js')},{name:"config list",aliases:["config ls"],description:"List CLI configuration",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../config-7G24FXQJ.js')},{name:"config set",aliases:[],description:"Set a config value",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../config-set-O6JKOGGN.js')},{name:"config get",aliases:[],description:"Get a config value",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../config-get-DDNSM5EH.js')},{name:"config delete",aliases:[],description:"Delete a config value",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../config-delete-VSIFFODZ.js')},{name:"config reset",aliases:[],description:"Reset all configuration",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"destructive",category:"utility",handler:()=>import('../config-reset-ZFMP4J5H.js')},{name:"completion",aliases:[],description:"Generate shell completion scripts",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:false,dangerLevel:"safe",category:"utility",handler:()=>import('../completion-IF3NB7PB.js')},{name:"feedback",aliases:[],description:"Submit feedback or report a bug",requiresAuth:false,requiresProject:false,ciSafe:false,jsonSupport:false,dangerLevel:"safe",category:"utility",handler:()=>import('../feedback-QUGQAWZB.js')},{name:"update",aliases:[],description:"Update the CLI to latest version",requiresAuth:false,requiresProject:false,ciSafe:true,jsonSupport:true,dangerLevel:"safe",category:"utility",handler:()=>import('../update-IYMIV34T.js')}];function y(){return [...P]}var p=new Command,L={version:"1.0.0",description:"SquidCloud CLI \u2014 static sites, storage, pipelines, and more."};p.name("squidcloud").description(L.description).version(L.version,"-v, --version","Display CLI version").option("--output <format>","Output format (json)","text").hook("preAction",async e$1=>{e$1.optsWithGlobals().output==="json"&&e(true),d()&&e(false);});async function A(e){if(!e.requiresAuth)return;let s=await m();s||(h("Not authenticated. Run `squidcloud login` first."),process.exit(1)),q(s)&&(await a()||(h("Session expired. Please run `squidcloud login` again."),process.exit(1)));}function b(e){let s=new Map;for(let t of e){let u=t.name.split(" ");if(u.length===1)s.set(t.name,new Map);else if(u.length===2){let[r,o]=u;s.has(r)||s.set(r,new Map),s.get(r).set(o,t);}}for(let[t,u]of s)if(u.size===0){let r=e.find(a=>a.name===t),o=p.command(t);o.description(r.description),r.aliases.length>0&&o.aliases(r.aliases),o.action(async(...a)=>{try{await A(r);let i=await r.handler();if(typeof i.default=="function"){let n=a.slice(0,-2);await i.default(...n);}n(r.name,process.argv.slice(2).join(" "),0);}catch(i){let n$1=i instanceof Error?i.message:String(i);h(n$1),n(r.name,process.argv.slice(2).join(" "),1),process.exit(1);}});}else {let r=p.command(t);r.description(`SquidCloud ${t} commands`);for(let[o,a]of u){let i=`${t} ${o}`,n$1=r.command(o);n$1.description(a.description),a.aliases.length>0&&n$1.aliases(a.aliases.map(f=>f.replace(`${t} `,""))),n$1.action(async(...f)=>{try{await A(a);let l=await a.handler();if(typeof l.default=="function"){let m=f.slice(0,-2);await l.default(...m);}n(i,process.argv.slice(2).join(" "),0);}catch(l){let m=l instanceof Error?l.message:String(l);h(m),n(i,process.argv.slice(2).join(" "),1),process.exit(1);}});}}}async function w(){let e=process.argv.slice(2);if(e.length===0&&!e.includes("--help")&&!e.includes("-h")){console.log(b$1()),p.outputHelp();return}if(e.includes("--version")||e.includes("-v")){let{showVersion:t}=await import('../version-7IHVNLWY.js');await t();return}let s=y();b(s),p.addHelpText("beforeAll",`
|
|
3
|
+
`),await p.parseAsync(process.argv);}w().catch(e=>{h(e instanceof Error?e.message:String(e)),process.exit(1);});//# sourceMappingURL=squidcloud.js.map
|
|
4
|
+
//# sourceMappingURL=squidcloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/registry/index.ts","../../src/bin/squidcloud.ts"],"names":["REGISTRY","getAllCommands","program","Command","pkg","thisCommand","setJsonMode","isCI","ensureAuth","descriptor","session","loadSession","logError","shouldRefreshToken","refreshAccessToken","buildCommandTree","commands","tree","cmd","parts","parent","child","name","children","c","args","mod","actionArgs","writeAudit","err","message","parentCmd","childName","childCmd","fullName","a","main","renderBrandedMascot","showVersion"],"mappings":";0RA+BA,IAAMA,CAAAA,CAAgC,CAEpC,CAAE,IAAA,CAAM,OAAA,CAAS,OAAA,CAAS,EAAC,CAAG,WAAA,CAAa,+BAAgC,YAAA,CAAc,KAAA,CAAO,gBAAiB,KAAA,CAAO,MAAA,CAAQ,KAAA,CAAO,WAAA,CAAa,MAAO,WAAA,CAAa,MAAA,CAAQ,SAAU,MAAA,CAAQ,OAAA,CAAS,IAAM,OAAO,sBAA2B,CAAE,CAAA,CACrP,CAAE,IAAA,CAAM,QAAA,CAAU,QAAS,EAAC,CAAG,YAAa,+CAAA,CAAiD,YAAA,CAAc,IAAA,CAAM,eAAA,CAAiB,MAAO,MAAA,CAAQ,IAAA,CAAM,YAAa,KAAA,CAAO,WAAA,CAAa,OAAQ,QAAA,CAAU,MAAA,CAAQ,OAAA,CAAS,IAAM,OAAO,uBAA4B,CAAE,EACtQ,CAAE,IAAA,CAAM,SAAU,OAAA,CAAS,CAAC,aAAa,CAAA,CAAG,YAAa,yCAAA,CAA2C,YAAA,CAAc,KAAM,eAAA,CAAiB,KAAA,CAAO,OAAQ,IAAA,CAAM,WAAA,CAAa,IAAA,CAAM,WAAA,CAAa,OAAQ,QAAA,CAAU,MAAA,CAAQ,QAAS,IAAM,OAAO,uBAA4B,CAAE,CAAA,CA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AA,CAAI,MAAM,OAAO,wBAA6B,EAClE,MAAMA,CAAAA,GACN,MACF,CAEA,IAAMtB,CAAAA,CAAWf,GAAe,CAChCc,CAAAA,CAAiBC,CAAQ,CAAA,CAEzBd,CAAAA,CAAQ,YAAY,WAAA,CAAa;AAAA,CAAI,CAAA,CAErC,MAAMA,CAAAA,CAAQ,UAAA,CAAW,OAAA,CAAQ,IAAI,EACvC,CAEAkC,CAAAA,EAAK,CAAE,KAAA,CAAOP,CAAAA,EAAQ,CACpBjB,EAASiB,CAAAA,YAAe,KAAA,CAAQA,CAAAA,CAAI,OAAA,CAAU,MAAA,CAAOA,CAAG,CAAC,CAAA,CACzD,OAAA,CAAQ,IAAA,CAAK,CAAC,EAChB,CAAC,CAAA","file":"squidcloud.js","sourcesContent":["export type CommandCategory =\n | 'auth'\n | 'storage'\n | 'deploy'\n | 'sites'\n | 'scripts'\n | 'automations'\n | 'forms'\n | 'sign'\n | 'time'\n | 'monitor'\n | 'logs'\n | 'collab'\n | 'tunnel'\n | 'id'\n | 'project'\n | 'utility'\n\nexport interface CommandDescriptor {\n name: string\n aliases: string[]\n description: string\n requiresAuth: boolean\n requiresProject: boolean\n ciSafe: boolean\n jsonSupport: boolean\n dangerLevel: 'safe' | 'caution' | 'destructive'\n category: CommandCategory\n handler: () => Promise<{ default: (...args: unknown[]) => void | Promise<void> }>\n}\n\nconst REGISTRY: CommandDescriptor[] = [\n // AUTH\n { name: 'login', aliases: [], description: 'Authenticate with SquidCloud', requiresAuth: false, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'auth', handler: () => import('../commands/auth/login.js') },\n { name: 'logout', aliases: [], description: 'End current CLI session and clear credentials', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'safe', category: 'auth', handler: () => import('../commands/auth/logout.js') },\n { name: 'whoami', aliases: ['auth whoami'], description: 'Show current authenticated account info', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'auth', handler: () => import('../commands/auth/whoami.js') },\n { name: 'auth status', aliases: [], description: 'Detailed session health check', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'auth', handler: () => import('../commands/auth/auth-status.js') },\n { name: 'auth sessions', aliases: [], description: 'List all active CLI sessions', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'auth', handler: () => import('../commands/auth/auth-sessions.js') },\n { name: 'auth revoke', aliases: [], description: 'Revoke a session or all sessions', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'destructive', category: 'auth', handler: () => import('../commands/auth/auth-revoke.js') },\n\n // STORAGE\n { name: 'storage ls', aliases: ['storage list'], description: 'List files and folders in storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-ls.js') },\n { name: 'storage upload', aliases: ['storage up'], description: 'Upload files or folders to storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-upload.js') },\n { name: 'storage download', aliases: ['storage dl'], description: 'Download files or folders from storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-download.js') },\n { name: 'storage cp', aliases: [], description: 'Copy files within storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-cp.js') },\n { name: 'storage mv', aliases: [], description: 'Move/rename files within storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'storage', handler: () => import('../commands/storage/storage-mv.js') },\n { name: 'storage rm', aliases: [], description: 'Delete files from storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'storage', handler: () => import('../commands/storage/storage-rm.js') },\n { name: 'storage mkdir', aliases: [], description: 'Create a folder in storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-mkdir.js') },\n { name: 'storage cat', aliases: [], description: 'Print file contents to terminal', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-cat.js') },\n { name: 'storage info', aliases: [], description: 'Show file metadata', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-info.js') },\n { name: 'storage share', aliases: [], description: 'Generate a share link for a file', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-share.js') },\n { name: 'storage unshare', aliases: [], description: 'Revoke all share links for a file', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'storage', handler: () => import('../commands/storage/storage-unshare.js') },\n { name: 'storage tag', aliases: [], description: 'Add or remove file tags', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-tag.js') },\n { name: 'storage search', aliases: [], description: 'Search storage by filename', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-search.js') },\n { name: 'storage diff', aliases: [], description: 'Compare local and remote storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'storage', handler: () => import('../commands/storage/storage-diff.js') },\n { name: 'storage clean', aliases: [], description: 'Clean orphaned files from storage', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'storage', handler: () => import('../commands/storage/storage-clean.js') },\n\n // DEPLOY\n { name: 'deploy', aliases: ['squidsite deploy'], description: 'Deploy a static website to SquidCloud Sites', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'deploy', handler: () => import('../commands/deploy/index.js') },\n\n // SITES\n { name: 'sites list', aliases: ['sites ls'], description: 'List all published sites', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sites', handler: () => import('../commands/sites/sites-list.js') },\n { name: 'sites info', aliases: [], description: 'Show site details', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sites', handler: () => import('../commands/sites/sites-info.js') },\n { name: 'sites open', aliases: [], description: 'Open site in browser', requiresAuth: true, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'sites', handler: () => import('../commands/sites/sites-open.js') },\n { name: 'sites unpublish', aliases: [], description: 'Take a site offline', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'sites', handler: () => import('../commands/sites/sites-unpublish.js') },\n { name: 'sites delete', aliases: [], description: 'Permanently delete a site', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'sites', handler: () => import('../commands/sites/sites-delete.js') },\n { name: 'sites visibility', aliases: [], description: 'Change site visibility (public/private)', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'sites', handler: () => import('../commands/sites/sites-visibility.js') },\n { name: 'sites rename', aliases: [], description: 'Rename a site slug', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'sites', handler: () => import('../commands/sites/sites-rename.js') },\n { name: 'sites rollback', aliases: [], description: 'Rollback to a previous deployment', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'sites', handler: () => import('../commands/sites/sites-rollback.js') },\n { name: 'sites deploys', aliases: [], description: 'Show deployment history', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sites', handler: () => import('../commands/sites/sites-deploys.js') },\n { name: 'sites logs', aliases: [], description: 'Stream live site access logs', requiresAuth: true, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'sites', handler: () => import('../commands/sites/sites-logs.js') },\n { name: 'sites analytics', aliases: [], description: 'Show site traffic analytics', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sites', handler: () => import('../commands/sites/sites-analytics.js') },\n { name: 'sites purge', aliases: [], description: 'Purge CDN cache for a site', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'sites', handler: () => import('../commands/sites/sites-purge.js') },\n\n // SCRIPTS (Pipelines)\n { name: 'scripts list', aliases: [], description: 'List registered SquidScripts', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-list.js') },\n { name: 'scripts run', aliases: [], description: 'Run a SquidScript pipeline', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-run.js') },\n { name: 'scripts logs', aliases: [], description: 'View pipeline run logs', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-logs.js') },\n { name: 'scripts validate', aliases: [], description: 'Validate a .squid.yml file', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-validate.js') },\n { name: 'scripts init', aliases: [], description: 'Create a new pipeline interactively', requiresAuth: true, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-init.js') },\n { name: 'scripts enable', aliases: [], description: 'Enable a disabled pipeline', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-enable.js') },\n { name: 'scripts disable', aliases: [], description: 'Disable a pipeline', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'scripts', handler: () => import('../commands/scripts/scripts-disable.js') },\n { name: 'scripts delete', aliases: [], description: 'Delete a pipeline', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'scripts', handler: () => import('../commands/scripts/scripts-delete.js') },\n { name: 'scripts status', aliases: [], description: 'Show pipeline status', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-status.js') },\n { name: 'scripts cancel', aliases: [], description: 'Cancel a running pipeline', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'scripts', handler: () => import('../commands/scripts/scripts-cancel.js') },\n { name: 'scripts watch', aliases: [], description: 'Watch .squid.yml for changes', requiresAuth: false, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'scripts', handler: () => import('../commands/scripts/scripts-watch.js') },\n\n // FORMS (File Requests)\n { name: 'filereq list', aliases: ['forms list', 'filereq ls'], description: 'List file requests', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'forms', handler: () => import('../commands/forms/forms-list.js') },\n { name: 'filereq create', aliases: ['forms create'], description: 'Create a file request', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'forms', handler: () => import('../commands/forms/forms-create.js') },\n { name: 'filereq info', aliases: ['forms info'], description: 'View file request details', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'forms', handler: () => import('../commands/forms/forms-info.js') },\n { name: 'filereq submissions', aliases: ['forms submissions'], description: 'View file request submissions', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'forms', handler: () => import('../commands/forms/forms-submissions.js') },\n { name: 'filereq export', aliases: ['forms export'], description: 'Export submissions as CSV', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'safe', category: 'forms', handler: () => import('../commands/forms/forms-export.js') },\n { name: 'filereq clear', aliases: ['forms clear'], description: 'Clear all submissions', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'forms', handler: () => import('../commands/forms/forms-clear.js') },\n { name: 'filereq delete', aliases: ['forms delete'], description: 'Delete a file request', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'forms', handler: () => import('../commands/forms/forms-delete.js') },\n { name: 'filereq embed', aliases: ['forms embed'], description: 'Get HTML embed snippet', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'safe', category: 'forms', handler: () => import('../commands/forms/forms-embed.js') },\n\n // SQUIDTIME\n { name: 'time lock', aliases: [], description: 'Time-lock a file or folder', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'time', handler: () => import('../commands/time/time-lock.js') },\n { name: 'time unlock', aliases: [], description: 'Unlock a time-locked file', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'time', handler: () => import('../commands/time/time-unlock.js') },\n { name: 'time status', aliases: [], description: 'Check time-lock status', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'time', handler: () => import('../commands/time/time-status.js') },\n { name: 'time list', aliases: [], description: 'List all time-locked files', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'time', handler: () => import('../commands/time/time-list.js') },\n { name: 'time proof', aliases: [], description: 'Export cryptographic existence proof', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'time', handler: () => import('../commands/time/time-proof.js') },\n\n // COLLAB\n { name: 'collab invite', aliases: [], description: 'Invite a collaborator to a folder', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'collab', handler: () => import('../commands/collab/collab-invite.js') },\n { name: 'collab list', aliases: [], description: 'List folder collaborators', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'collab', handler: () => import('../commands/collab/collab-list.js') },\n { name: 'collab remove', aliases: [], description: 'Remove a collaborator', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'collab', handler: () => import('../commands/collab/collab-remove.js') },\n { name: 'collab activity', aliases: [], description: 'View collaborator activity feed', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'collab', handler: () => import('../commands/collab/collab-activity.js') },\n { name: 'collab leave', aliases: [], description: 'Leave a shared folder', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'collab', handler: () => import('../commands/collab/collab-leave.js') },\n { name: 'collab transfer', aliases: [], description: 'Transfer folder ownership', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'collab', handler: () => import('../commands/collab/collab-transfer.js') },\n\n // SQUIDSIGN\n { name: 'sign request', aliases: [], description: 'Request a digital signature', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sign', handler: () => import('../commands/sign/sign-request.js') },\n { name: 'sign status', aliases: [], description: 'Check signing request status', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sign', handler: () => import('../commands/sign/sign-status.js') },\n { name: 'sign list', aliases: [], description: 'List signing requests', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sign', handler: () => import('../commands/sign/sign-list.js') },\n { name: 'sign cancel', aliases: [], description: 'Cancel a signing request', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'caution', category: 'sign', handler: () => import('../commands/sign/sign-cancel.js') },\n { name: 'sign verify', aliases: [], description: 'Verify a signed document', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sign', handler: () => import('../commands/sign/sign-verify.js') },\n { name: 'sign download', aliases: [], description: 'Download signed document', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'sign', handler: () => import('../commands/sign/sign-download.js') },\n\n // MONITOR\n { name: 'monitor', aliases: [], description: 'At-a-glance SquidCloud health dashboard', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'monitor', handler: () => import('../commands/monitor/monitor.js') },\n { name: 'monitor sites', aliases: [], description: 'Site health overview', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'monitor', handler: () => import('../commands/monitor/monitor-sites.js') },\n { name: 'monitor pipelines', aliases: [], description: 'Pipeline health overview', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'monitor', handler: () => import('../commands/monitor/monitor-pipelines.js') },\n { name: 'monitor storage', aliases: [], description: 'Storage health report', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'monitor', handler: () => import('../commands/monitor/monitor-storage.js') },\n { name: 'monitor automations', aliases: [], description: 'Automation health overview', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'monitor', handler: () => import('../commands/monitor/monitor-automations.js') },\n\n // LOGS\n { name: 'logs tail', aliases: [], description: 'Stream live logs', requiresAuth: true, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'logs', handler: () => import('../commands/logs/logs-tail.js') },\n { name: 'logs search', aliases: [], description: 'Search historical logs', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'logs', handler: () => import('../commands/logs/logs-search.js') },\n { name: 'logs export', aliases: [], description: 'Export logs as JSONL or CSV', requiresAuth: true, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'safe', category: 'logs', handler: () => import('../commands/logs/logs-export.js') },\n\n // UTILITY\n { name: 'doctor', aliases: [], description: 'Run system diagnostics', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/doctor.js') },\n { name: 'version', aliases: ['--version', '-v'], description: 'Show CLI version', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/version.js') },\n { name: 'config list', aliases: ['config ls'], description: 'List CLI configuration', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/config.js') },\n { name: 'config set', aliases: [], description: 'Set a config value', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/config-set.js') },\n { name: 'config get', aliases: [], description: 'Get a config value', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/config-get.js') },\n { name: 'config delete', aliases: [], description: 'Delete a config value', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/config-delete.js') },\n { name: 'config reset', aliases: [], description: 'Reset all configuration', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'destructive', category: 'utility', handler: () => import('../commands/util/config-reset.js') },\n { name: 'completion', aliases: [], description: 'Generate shell completion scripts', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: false, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/completion.js') },\n { name: 'feedback', aliases: [], description: 'Submit feedback or report a bug', requiresAuth: false, requiresProject: false, ciSafe: false, jsonSupport: false, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/feedback.js') },\n { name: 'update', aliases: [], description: 'Update the CLI to latest version', requiresAuth: false, requiresProject: false, ciSafe: true, jsonSupport: true, dangerLevel: 'safe', category: 'utility', handler: () => import('../commands/util/update.js') },\n]\n\nexport function getCommand(name: string): CommandDescriptor | undefined {\n const parts = name.trim().toLowerCase().split(/\\s+/)\n return REGISTRY.find(cmd => {\n const cmdParts = cmd.name.split(/\\s+/)\n if (parts.join(' ') === cmd.name) return true\n for (const alias of cmd.aliases) {\n const aliasParts = alias.split(/\\s+/)\n const expandedAlias = (aliasParts[0] === cmdParts[0] && aliasParts.length > 1) ? alias : null\n if (parts.join(' ') === alias) return true\n }\n return false\n })\n}\n\nexport function getCategory(cat: CommandCategory): CommandDescriptor[] {\n return REGISTRY.filter(cmd => cmd.category === cat)\n}\n\nexport function getAllCommands(): CommandDescriptor[] {\n return [...REGISTRY]\n}\n\nexport function getCISafeCommands(): CommandDescriptor[] {\n return REGISTRY.filter(cmd => cmd.ciSafe)\n}\n","#!/usr/bin/env node\nimport { Command } from 'commander'\nimport { setJsonMode, logError, writeAudit, renderBrandedMascot } from '../lib/output/index.js'\nimport { isCI } from '../lib/utils/ci-detect.js'\nimport { getAllCommands, CommandDescriptor } from '../registry/index.js'\nimport { loadSession, shouldRefreshToken } from '../lib/auth/session.js'\nimport { refreshAccessToken } from '../lib/auth/refresh.js'\n\nconst program = new Command()\nconst pkg = { version: '1.0.0', name: '@squidcloud/cli', description: 'SquidCloud CLI — static sites, storage, pipelines, and more.' }\n\nprogram\n .name('squidcloud')\n .description(pkg.description)\n .version(pkg.version, '-v, --version', 'Display CLI version')\n .option('--output <format>', 'Output format (json)', 'text')\n .hook('preAction', async (thisCommand) => {\n const opts = thisCommand.optsWithGlobals()\n if (opts.output === 'json') {\n setJsonMode(true)\n }\n if (isCI()) {\n setJsonMode(false)\n }\n })\n\nasync function ensureAuth(descriptor: CommandDescriptor): Promise<void> {\n if (!descriptor.requiresAuth) return\n const session = await loadSession()\n if (!session) {\n logError('Not authenticated. Run `squidcloud login` first.')\n process.exit(1)\n }\n if (shouldRefreshToken(session)) {\n const refreshed = await refreshAccessToken()\n if (!refreshed) {\n logError('Session expired. Please run `squidcloud login` again.')\n process.exit(1)\n }\n }\n}\n\nfunction buildCommandTree(commands: CommandDescriptor[]): void {\n const tree = new Map<string, Map<string, CommandDescriptor>>()\n\n for (const cmd of commands) {\n const parts = cmd.name.split(' ')\n if (parts.length === 1) {\n tree.set(cmd.name, new Map())\n } else if (parts.length === 2) {\n const [parent, child] = parts\n if (!tree.has(parent!)) {\n tree.set(parent!, new Map())\n }\n tree.get(parent!)!.set(child!, cmd)\n }\n }\n\n for (const [name, children] of tree) {\n if (children.size === 0) {\n const cmd = commands.find(c => c.name === name)!\n const c = program.command(name)\n c.description(cmd.description)\n if (cmd.aliases.length > 0) {\n c.aliases(cmd.aliases)\n }\n c.action(async (...args: unknown[]) => {\n try {\n await ensureAuth(cmd)\n const mod = await cmd.handler()\n if (typeof mod.default === 'function') {\n const actionArgs = args.slice(0, -2)\n await mod.default(...actionArgs)\n }\n writeAudit(cmd.name, process.argv.slice(2).join(' '), 0)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n logError(message)\n writeAudit(cmd.name, process.argv.slice(2).join(' '), 1)\n process.exit(1)\n }\n })\n } else {\n const parentCmd = program.command(name)\n parentCmd.description(`SquidCloud ${name} commands`)\n for (const [childName, childCmd] of children) {\n const fullName = `${name} ${childName}`\n const c = parentCmd.command(childName)\n c.description(childCmd.description)\n if (childCmd.aliases.length > 0) {\n c.aliases(childCmd.aliases.map(a => a.replace(`${name} `, '')))\n }\n c.action(async (...args: unknown[]) => {\n try {\n await ensureAuth(childCmd)\n const mod = await childCmd.handler()\n if (typeof mod.default === 'function') {\n const actionArgs = args.slice(0, -2)\n await mod.default(...actionArgs)\n }\n writeAudit(fullName, process.argv.slice(2).join(' '), 0)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n logError(message)\n writeAudit(fullName, process.argv.slice(2).join(' '), 1)\n process.exit(1)\n }\n })\n }\n }\n }\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2)\n\n if (args.length === 0 && !args.includes('--help') && !args.includes('-h')) {\n console.log(renderBrandedMascot())\n program.outputHelp()\n return\n }\n\n if (args.includes('--version') || args.includes('-v')) {\n const { showVersion } = await import('../commands/util/version.js')\n await showVersion()\n return\n }\n\n const commands = getAllCommands()\n buildCommandTree(commands)\n\n program.addHelpText('beforeAll', '\\n')\n\n await program.parseAsync(process.argv)\n}\n\nmain().catch((err) => {\n logError(err instanceof Error ? err.message : String(err))\n process.exit(1)\n})\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import n from'chalk';var F="#0A0E1A",r="#4FC3F7",s="#7C4DFF",c="#FFFFFF",l=[" \u2554\u2550\u2550\u2550\u2557 "," \u2554\u255D\u2588 \u2588\u255A\u2557 "," \u2551 \u25C9 \u2551 "," \u255A\u2557 \u2554\u255D "," \u2551 \u2566 \u2551 "," \u2554\u255D \u2551 \u255A\u2557 "," \u2551 \u2551 \u2551 "," \u255A\u2557 \u2551 \u2554\u255D "," \u255A\u2550\u2550\u2550\u255D "];function p(){return l.map((e,o)=>{let i=e.replace(/█/g,n.hex(s)("\u2588")).replace(/◉/g,n.hex(r)("\u25C9")).replace(/[╔╗╚╝═║╦]/g,a=>n.hex(c)(a));return n.bgHex(F)(i)}).join(`
|
|
2
|
+
`)}function g(){let t=p(),e=n.hex(r)("SQUID")+n.hex(s)("CLOUD"),o=n.hex(c).dim("static sites \xB7 storage \xB7 pipelines");return `${t}
|
|
3
|
+
|
|
4
|
+
${e} ${o}
|
|
5
|
+
`}export{p as a,g as b};//# sourceMappingURL=chunk-6TS5Y27A.js.map
|
|
6
|
+
//# sourceMappingURL=chunk-6TS5Y27A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/output/mascot.ts"],"names":["NAVY","BLUE","VIOLET","WHITE","SQUID_ART","renderMascot","line","i","colored","chalk","m","renderBrandedMascot","mascot","brand","tagline"],"mappings":"qBAEA,IAAMA,CAAAA,CAAO,UACPC,CAAAA,CAAO,SAAA,CACPC,CAAAA,CAAS,SAAA,CACTC,EAAQ,SAAA,CAERC,CAAAA,CAAY,CAChB,oCAAA,CACA,0CACA,0BAAA,CACA,+BAAA,CACA,0BAAA,CACA,oCAAA,CACA,0BAAA,CACA,oCAAA,CACA,oCACF,CAAA,CAEO,SAASC,CAAAA,EAAuB,CAOrC,OANcD,CAAAA,CAAU,IAAI,CAACE,CAAAA,CAAMC,CAAAA,GAAM,CACvC,IAAMC,CAAAA,CAAUF,CAAAA,CAAK,OAAA,CAAQ,IAAA,CAAMG,CAAAA,CAAM,GAAA,CAAIP,CAAM,CAAA,CAAE,QAAG,CAAC,CAAA,CACtD,OAAA,CAAQ,IAAA,CAAMO,EAAM,GAAA,CAAIR,CAAI,CAAA,CAAE,QAAG,CAAC,CAAA,CAClC,OAAA,CAAQ,YAAA,CAAeS,CAAAA,EAAMD,EAAM,GAAA,CAAIN,CAAK,CAAA,CAAEO,CAAC,CAAC,CAAA,CACnD,OAAOD,CAAAA,CAAM,KAAA,CAAMT,CAAI,CAAA,CAAEQ,CAAO,CAClC,CAAC,EACY,IAAA,CAAK;AAAA,CAAI,CACxB,CAEO,SAASG,CAAAA,EAA8B,CAC5C,IAAMC,CAAAA,CAASP,CAAAA,EAAa,CACtBQ,CAAAA,CAAQJ,CAAAA,CAAM,GAAA,CAAIR,CAAI,EAAE,OAAO,CAAA,CAAIQ,CAAAA,CAAM,GAAA,CAAIP,CAAM,CAAA,CAAE,OAAO,CAAA,CAC5DY,EAAUL,CAAAA,CAAM,GAAA,CAAIN,CAAK,CAAA,CAAE,GAAA,CAAI,0CAAoC,CAAA,CACzE,OAAO,GAAGS,CAAM;;AAAA,EAAA,EAASC,CAAK,KAAKC,CAAO;AAAA,CAC5C","file":"chunk-6TS5Y27A.js","sourcesContent":["import chalk from 'chalk'\n\nconst NAVY = '#0A0E1A'\nconst BLUE = '#4FC3F7'\nconst VIOLET = '#7C4DFF'\nconst WHITE = '#FFFFFF'\n\nconst SQUID_ART = [\n ' ╔═══╗ ',\n ' ╔╝█ █╚╗ ',\n ' ║ ◉ ║ ',\n ' ╚╗ ╔╝ ',\n ' ║ ╦ ║ ',\n ' ╔╝ ║ ╚╗ ',\n ' ║ ║ ║ ',\n ' ╚╗ ║ ╔╝ ',\n ' ╚═══╝ ',\n]\n\nexport function renderMascot(): string {\n const lines = SQUID_ART.map((line, i) => {\n const colored = line.replace(/█/g, chalk.hex(VIOLET)('█'))\n .replace(/◉/g, chalk.hex(BLUE)('◉'))\n .replace(/[╔╗╚╝═║╦]/g, (m) => chalk.hex(WHITE)(m))\n return chalk.bgHex(NAVY)(colored)\n })\n return lines.join('\\n')\n}\n\nexport function renderBrandedMascot(): string {\n const mascot = renderMascot()\n const brand = chalk.hex(BLUE)('SQUID') + chalk.hex(VIOLET)('CLOUD')\n const tagline = chalk.hex(WHITE).dim('static sites · storage · pipelines')\n return `${mascot}\\n\\n ${brand} ${tagline}\\n`\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import s from'os';import l from'path';import a,{existsSync,readFileSync}from'fs';import {randomBytes}from'@noble/hashes/utils';import {sha256}from'@noble/hashes/sha256';import {hkdf}from'@noble/hashes/hkdf';import {gcm}from'@noble/ciphers/aes';import {utils,getPublicKey,verify}from'@noble/ed25519';import {x25519}from'@noble/curves/ed25519.js';import {hmac}from'@noble/hashes/hmac';import {blake3}from'@noble/hashes/blake3';import {pbkdf2Sync,createHash}from'crypto';var T="squidcloud-session-v1";function et(){let t=utils.randomPrivateKey();return {pub:getPublicKey(t),priv:t}}function nt(){return randomBytes(32)}function it(t,r){let e=Buffer.from(r.slice(0,32).padEnd(32,"\0"));return pbkdf2Sync(t,e,1e5,32,"sha512")}function ot(t,r,e,n){let i=new Uint8Array(t.length+r.length+e.length+8);i.set(t,0),i.set(r,t.length),i.set(e,t.length+r.length);let o=new Uint8Array(8);return new DataView(o.buffer).setBigUint64(0,BigInt(n),false),i.set(o,t.length+r.length+e.length),blake3(i)}function st(t,r){return x25519.getSharedSecret(r,t)}function at(t,r,e){let n=new Uint8Array(r.length+e.length);return n.set(r,0),n.set(e,r.length),hkdf(sha256,t,n,T,32)}function ct(t,r,e,n){let i=new Uint8Array(t.length+e.length);i.set(t,0),i.set(e,t.length);let m=gcm(n,r).decrypt(i);return JSON.parse(new TextDecoder().decode(m))}function ut(t,r,e){return verify(t,r,e)}function pt(t,r){return Buffer.from(hmac(sha256,t,r)).toString("hex")}function c(t){return Buffer.from(t).toString("hex")}function f(t){return new Uint8Array(Buffer.from(t,"hex"))}var K=["/etc/machine-id","/var/lib/dbus/machine-id","/etc/hostid"];function O(){for(let r of K)try{if(existsSync(r))return readFileSync(r,"utf-8").trim()}catch{continue}return createHash("sha256").update(s.hostname()+s.arch()+s.platform()).digest("hex")}function g(){let e=[O(),s.hostname(),s.platform(),s.arch(),s.release()].join(":");return c(blake3(e))}var d=l.join(s.homedir(),".squidcloud"),u=l.join(d,".session");function h(){let t=g(),r=new TextEncoder().encode(t);return hkdf(sha256,r,new Uint8Array(32),"squidcloud-fallback-v1",32)}async function x(t){let r=h(),e=randomBytes(12),n=new TextEncoder().encode(t),o=gcm(r,e).encrypt(n);a.existsSync(d)||a.mkdirSync(d,{recursive:true,mode:448});let m={iv:c(e),data:c(o)};a.writeFileSync(u,JSON.stringify(m),{mode:384,encoding:"utf-8"});}async function A(){try{if(!a.existsSync(u))return null;let t=a.readFileSync(u,"utf-8"),{iv:r,data:e}=JSON.parse(t),n=h(),o=gcm(n,f(r)).decrypt(f(e));return new TextDecoder().decode(o)}catch{return null}}async function p(){try{a.existsSync(u)&&a.unlinkSync(u);}catch{}}async function Dt(){try{let t=await A();if(!t)return null;let r=JSON.parse(t);return !r.session_id||!r.access_token?(await p(),null):r}catch{return await p(),null}}async function Tt(t){await x(JSON.stringify(t));}async function Ft(){await p();}function It(t){return Date.now()>=t.expires_at}function Et(t){return t.expires_at-Date.now()<=12e4}function Ht(t){return t.expires_at-Date.now()}export{et as a,nt as b,it as c,ot as d,st as e,at as f,ct as g,ut as h,pt as i,c as j,f as k,g as l,Dt as m,Tt as n,Ft as o,It as p,Et as q,Ht as r};//# sourceMappingURL=chunk-C5KZCYJ4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-C5KZCYJ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/crypto/ssp.ts","../src/lib/auth/fingerprint.ts","../src/lib/auth/keychain.ts","../src/lib/auth/session.ts"],"names":["HKDF_INFO","generateKeypair","priv","edUtils","getPublicKey","generateNonce","randomBytes","hashPassword","password","email","salt","pbkdf2Sync","computeSignPayload","clientNonce","serverNonce","clientPub","timestamp","payload","tsBuf","blake3","deriveSharedSecret","pub","x25519","deriveEncryptionKey","ecdhSecret","hkdf","sha256","decryptSession","encrypted","iv","tag","key","combined","plaintext","gcm","verifyServerSignature","signature","serverPub","verify","computeHMAC","data","hmac","bytesToHex","buf","hexToBytes","hex","MACHINE_ID_PATHS","getMachineId","p","existsSync","readFileSync","createHash","os","computeDeviceFingerprint","FALLBACK_DIR","path","FALLBACK_FILE","getFallbackKey","fingerprint","ikm","storeSession","sessionJson","fs","getSession","raw","decrypted","deleteSession","loadSession","session","saveSession","clearSession","isSessionExpired","shouldRefreshToken","getTimeUntilExpiry"],"mappings":"odAWA,IAAMA,CAAAA,CAAY,uBAAA,CAoCX,SAASC,EAAAA,EAAyD,CACvE,IAAMC,CAAAA,CAAOC,KAAAA,CAAQ,kBAAiB,CAEtC,OAAO,CAAE,GAAA,CADGC,YAAAA,CAAaF,CAAI,CAAA,CACf,KAAAA,CAAK,CACrB,CAEO,SAASG,EAAAA,EAA4B,CAC1C,OAAOC,WAAAA,CAAY,EAAE,CACvB,CAEO,SAASC,EAAAA,CAAaC,CAAAA,CAAkB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AG,CAAA,CAC9B,OAAI,CAACI,CAAAA,CAAQ,UAAA,EAAc,CAACA,CAAAA,CAAQ,cAClC,MAAMF,CAAAA,GACC,IAAA,EAEFE,CACT,MAAQ,CACN,OAAA,MAAMF,GAAc,CACb,IACT,CACF,CAEA,eAAsBG,GAAYD,CAAAA,CAAsC,CACtE,MAAMR,CAAAA,CAAa,IAAA,CAAK,SAAA,CAAUQ,CAAO,CAAC,EAC5C,CAEA,eAAsBE,EAAAA,EAA8B,CAClD,MAAMJ,CAAAA,GACR,CAEO,SAASK,EAAAA,CAAiBH,EAAgC,CAC/D,OAAO,KAAK,GAAA,EAAI,EAAKA,EAAQ,UAC/B,CAEO,SAASI,EAAAA,CAAmBJ,EAAgC,CAEjE,OAAQA,EAAQ,UAAA,CAAa,IAAA,CAAK,KAAI,EAAM,IAC9C,CAEO,SAASK,EAAAA,CAAmBL,EAA+B,CAChE,OAAOA,EAAQ,UAAA,CAAa,IAAA,CAAK,KACnC","file":"chunk-C5KZCYJ4.js","sourcesContent":["import { getPublicKey, sign, verify, utils as edUtils } from '@noble/ed25519'\nimport { x25519 } from '@noble/curves/ed25519.js'\nimport { sha256 } from '@noble/hashes/sha256'\nimport { hmac } from '@noble/hashes/hmac'\nimport { hkdf } from '@noble/hashes/hkdf'\nimport { blake3 } from '@noble/hashes/blake3'\nimport { randomBytes } from '@noble/hashes/utils'\nimport { gcm } from '@noble/ciphers/aes'\nimport { pbkdf2Sync } from 'node:crypto'\nimport { hostname, platform, arch } from 'node:os'\n\nconst HKDF_INFO = 'squidcloud-session-v1'\n\nexport interface SSPHello {\n email: string\n password_proof: string\n client_ephemeral_pub: string\n client_nonce: string\n device_fingerprint: string\n timestamp: number\n}\n\nexport interface SSPResponse {\n server_nonce: string\n server_ephemeral_pub: string\n server_signature: string\n encrypted_session: string\n session_iv: string\n session_tag: string\n}\n\nexport interface SquidSession {\n session_id: string\n access_token: string\n refresh_token: string\n refresh_token_id: string\n device_fingerprint: string\n issued_at: number\n expires_at: number\n user: {\n id: string\n email: string\n username: string\n plan: 'free' | 'pro' | 'team'\n }\n}\n\nexport function generateKeypair(): { pub: Uint8Array; priv: Uint8Array } {\n const priv = edUtils.randomPrivateKey()\n const pub = getPublicKey(priv)\n return { pub, priv }\n}\n\nexport function generateNonce(): Uint8Array {\n return randomBytes(32)\n}\n\nexport function hashPassword(password: string, email: string): Buffer {\n const salt = Buffer.from(email.slice(0, 32).padEnd(32, '\\x00'))\n return pbkdf2Sync(password, salt, 100000, 32, 'sha512')\n}\n\nexport function computeDeviceFingerprint(machineId: string): string {\n const data = `${machineId}:${hostname()}:${platform()}:${arch()}`\n return Buffer.from(blake3(data)).toString('hex')\n}\n\nexport function computeSignPayload(clientNonce: Uint8Array, serverNonce: Uint8Array, clientPub: Uint8Array, timestamp: number): Uint8Array {\n const payload = new Uint8Array(clientNonce.length + serverNonce.length + clientPub.length + 8)\n payload.set(clientNonce, 0)\n payload.set(serverNonce, clientNonce.length)\n payload.set(clientPub, clientNonce.length + serverNonce.length)\n const tsBuf = new Uint8Array(8)\n new DataView(tsBuf.buffer).setBigUint64(0, BigInt(timestamp), false)\n payload.set(tsBuf, clientNonce.length + serverNonce.length + clientPub.length)\n return blake3(payload)\n}\n\nexport function deriveSharedSecret(pub: Uint8Array, priv: Uint8Array): Uint8Array {\n return x25519.getSharedSecret(priv, pub)\n}\n\nexport function deriveEncryptionKey(ecdhSecret: Uint8Array, clientNonce: Uint8Array, serverNonce: Uint8Array): Uint8Array {\n const salt = new Uint8Array(clientNonce.length + serverNonce.length)\n salt.set(clientNonce, 0)\n salt.set(serverNonce, clientNonce.length)\n return hkdf(sha256, ecdhSecret, salt, HKDF_INFO, 32)\n}\n\nexport function encryptSession(session: SquidSession, key: Uint8Array): { ciphertext: Uint8Array; iv: Uint8Array; tag: Uint8Array } {\n const iv = randomBytes(12)\n const plaintext = new TextEncoder().encode(JSON.stringify(session))\n const aes = gcm(key, iv)\n const encrypted = aes.encrypt(plaintext)\n const ciphertext = encrypted.slice(0, -16)\n const tag = encrypted.slice(-16)\n return { ciphertext, iv, tag }\n}\n\nexport function decryptSession(encrypted: Uint8Array, iv: Uint8Array, tag: Uint8Array, key: Uint8Array): SquidSession {\n const combined = new Uint8Array(encrypted.length + tag.length)\n combined.set(encrypted, 0)\n combined.set(tag, encrypted.length)\n const aes = gcm(key, iv)\n const plaintext = aes.decrypt(combined)\n return JSON.parse(new TextDecoder().decode(plaintext)) as SquidSession\n}\n\nexport function verifyServerSignature(signature: Uint8Array, payload: Uint8Array, serverPub: Uint8Array): Promise<boolean> {\n return verify(signature, payload, serverPub)\n}\n\nexport function signPayload(priv: Uint8Array, payload: Uint8Array): Promise<Uint8Array> {\n return sign(payload, priv)\n}\n\nexport function computeHMAC(key: Uint8Array, data: string): string {\n return Buffer.from(hmac(sha256, key, data)).toString('hex')\n}\n\nexport function bytesToHex(buf: Uint8Array): string {\n return Buffer.from(buf).toString('hex')\n}\n\nexport function hexToBytes(hex: string): Uint8Array {\n return new Uint8Array(Buffer.from(hex, 'hex'))\n}\n","import { createHash, randomBytes } from 'node:crypto'\nimport os from 'node:os'\nimport { readFileSync, existsSync } from 'node:fs'\nimport { blake3 } from '@noble/hashes/blake3'\nimport { bytesToHex } from '../crypto/ssp.js'\n\nconst MACHINE_ID_PATHS = [\n '/etc/machine-id',\n '/var/lib/dbus/machine-id',\n '/etc/hostid',\n]\n\nfunction getMachineId(): string {\n for (const p of MACHINE_ID_PATHS) {\n try {\n if (existsSync(p)) {\n return readFileSync(p, 'utf-8').trim()\n }\n } catch {\n continue\n }\n }\n const h = createHash('sha256').update(os.hostname() + os.arch() + os.platform()).digest('hex')\n return h\n}\n\nexport function computeDeviceFingerprint(): string {\n const machineId = getMachineId()\n const components = [\n machineId,\n os.hostname(),\n os.platform(),\n os.arch(),\n os.release(),\n ]\n const data = components.join(':')\n return bytesToHex(blake3(data))\n}\n\nexport function generateDeviceId(): string {\n return randomBytes(32).toString('hex')\n}\n","import os from 'node:os'\nimport path from 'node:path'\nimport fs from 'node:fs'\nimport { randomBytes } from '@noble/hashes/utils'\nimport { sha256 } from '@noble/hashes/sha256'\nimport { hkdf } from '@noble/hashes/hkdf'\nimport { blake3 } from '@noble/hashes/blake3'\nimport { gcm } from '@noble/ciphers/aes'\nimport { bytesToHex, hexToBytes } from '../crypto/ssp.js'\nimport { computeDeviceFingerprint } from './fingerprint.js'\n\nconst FALLBACK_DIR = path.join(os.homedir(), '.squidcloud')\nconst FALLBACK_FILE = path.join(FALLBACK_DIR, '.session')\n\nfunction getFallbackKey(): Uint8Array {\n const fingerprint = computeDeviceFingerprint()\n const ikm = new TextEncoder().encode(fingerprint)\n return hkdf(sha256, ikm, new Uint8Array(32), 'squidcloud-fallback-v1', 32)\n}\n\nexport async function storeSession(sessionJson: string): Promise<void> {\n const key = getFallbackKey()\n const iv = randomBytes(12)\n const plaintext = new TextEncoder().encode(sessionJson)\n const aes = gcm(key, iv)\n const encrypted = aes.encrypt(plaintext)\n if (!fs.existsSync(FALLBACK_DIR)) {\n fs.mkdirSync(FALLBACK_DIR, { recursive: true, mode: 0o700 })\n }\n const payload = {\n iv: bytesToHex(iv),\n data: bytesToHex(encrypted),\n }\n fs.writeFileSync(FALLBACK_FILE, JSON.stringify(payload), { mode: 0o600, encoding: 'utf-8' })\n}\n\nexport async function getSession(): Promise<string | null> {\n try {\n if (!fs.existsSync(FALLBACK_FILE)) return null\n const raw = fs.readFileSync(FALLBACK_FILE, 'utf-8')\n const { iv, data } = JSON.parse(raw) as { iv: string; data: string }\n const key = getFallbackKey()\n const aes = gcm(key, hexToBytes(iv))\n const decrypted = aes.decrypt(hexToBytes(data))\n return new TextDecoder().decode(decrypted)\n } catch {\n return null\n }\n}\n\nexport async function deleteSession(): Promise<void> {\n try {\n if (fs.existsSync(FALLBACK_FILE)) {\n fs.unlinkSync(FALLBACK_FILE)\n }\n } catch {\n // ignore\n }\n}\n","import { SquidSession } from '../crypto/ssp.js'\nimport { storeSession, getSession, deleteSession } from './keychain.js'\n\nexport async function loadSession(): Promise<SquidSession | null> {\n try {\n const raw = await getSession()\n if (!raw) return null\n const session = JSON.parse(raw) as SquidSession\n if (!session.session_id || !session.access_token) {\n await deleteSession()\n return null\n }\n return session\n } catch {\n await deleteSession()\n return null\n }\n}\n\nexport async function saveSession(session: SquidSession): Promise<void> {\n await storeSession(JSON.stringify(session))\n}\n\nexport async function clearSession(): Promise<void> {\n await deleteSession()\n}\n\nexport function isSessionExpired(session: SquidSession): boolean {\n return Date.now() >= session.expires_at\n}\n\nexport function shouldRefreshToken(session: SquidSession): boolean {\n const twoMinutes = 2 * 60 * 1000\n return (session.expires_at - Date.now()) <= twoMinutes\n}\n\nexport function getTimeUntilExpiry(session: SquidSession): number {\n return session.expires_at - Date.now()\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from'chalk';import {format,formatDistanceToNow}from'date-fns';function c(t){if(t===0)return "0 B";let r=["B","KB","MB","GB","TB"],o=1024,n=Math.floor(Math.log(t)/Math.log(o));return `${(t/Math.pow(o,n)).toFixed(n>0?1:0)} ${r[n]}`}function m(t){let r=typeof t=="string"?new Date(t):t;return format(r,"MMM d, yyyy HH:mm")}function g(t){let r=typeof t=="string"?new Date(t):t;return formatDistanceToNow(r,{addSuffix:true})}function $(t){if(t<=0)return e.red("expired");let r=Math.floor(t/36e5),o=Math.floor(t%36e5/6e4),n=Math.floor(t%6e4/1e3);return r>0?`${r}h ${o}m ${n}s`:o>0?`${o}m ${n}s`:`${n}s`}export{c as a,m as b,g as c,$ as d};//# sourceMappingURL=chunk-G4JU7IUC.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-G4JU7IUC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils/format.ts"],"names":["formatBytes","bytes","units","k","i","formatDate","date","d","dateFnsFormat","formatRelative","formatDistanceToNow","formatCountdown","ms","chalk","hours","minutes","seconds"],"mappings":"uEAGO,SAASA,EAAYC,CAAAA,CAAu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AAA,CAC9C,OAAIE,CAAAA,CAAQ,CAAA,CAAU,GAAGA,CAAK,CAAA,EAAA,EAAKC,CAAO,CAAA,EAAA,EAAKC,CAAO,CAAA,CAAA,CAAA,CAClDD,CAAAA,CAAU,CAAA,CAAU,CAAA,EAAGA,CAAO,CAAA,EAAA,EAAKC,CAAO,CAAA,CAAA,CAAA,CACvC,CAAA,EAAGA,CAAO,CAAA,CAAA,CACnB","file":"chunk-G4JU7IUC.js","sourcesContent":["import chalk from 'chalk'\nimport { formatDistanceToNow, format as dateFnsFormat } from 'date-fns'\n\nexport function formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B'\n const units = ['B', 'KB', 'MB', 'GB', 'TB']\n const k = 1024\n const i = Math.floor(Math.log(bytes) / Math.log(k))\n const value = bytes / Math.pow(k, i)\n return `${value.toFixed(i > 0 ? 1 : 0)} ${units[i]}`\n}\n\nexport function formatDuration(ms: number): string {\n if (ms < 1000) return `${ms}ms`\n if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`\n const minutes = Math.floor(ms / 60000)\n const seconds = Math.round((ms % 60000) / 1000)\n return `${minutes}m ${seconds}s`\n}\n\nexport function formatDate(date: string | Date): string {\n const d = typeof date === 'string' ? new Date(date) : date\n return dateFnsFormat(d, 'MMM d, yyyy HH:mm')\n}\n\nexport function formatRelative(date: string | Date): string {\n const d = typeof date === 'string' ? new Date(date) : date\n return formatDistanceToNow(d, { addSuffix: true })\n}\n\nexport function formatCountdown(ms: number): string {\n if (ms <= 0) return chalk.red('expired')\n const hours = Math.floor(ms / 3600000)\n const minutes = Math.floor((ms % 3600000) / 60000)\n const seconds = Math.floor((ms % 60000) / 1000)\n if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`\n if (minutes > 0) return `${minutes}m ${seconds}s`\n return `${seconds}s`\n}\n\nexport function truncate(str: string, max: number): string {\n if (str.length <= max) return str\n return str.slice(0, max - 3) + '...'\n}\n\nexport function pluralize(n: number, singular: string, plural?: string): string {\n return n === 1 ? `${n} ${singular}` : `${n} ${plural ?? singular + 's'}`\n}\n\nexport function maskEmail(email: string): string {\n const [name, domain] = email.split('@')\n if (!name || !domain) return email\n const masked = name[0] + '***' + name[name.length - 1]\n return `${masked}@${domain}`\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-THMWE2I6.js';import {f,m}from'./chunk-QT7R3AXE.js';import a from'conf';var n=new a({projectName:"squidcloud",defaults:{defaultEnvironment:"production",autoCopyUrl:true,outputFormat:"text",checkUpdates:true}});function d(){return n}async function c(){let o=Object.entries(n.store);if(f()){m(Object.fromEntries(o));return}let i=o.map(([s,u])=>({key:s,value:String(u)}));console.log(a$1(i,[{key:"key",label:"Key"},{key:"value",label:"Value"}]));}export{n as a,d as b,c};//# sourceMappingURL=chunk-LWB2J3KU.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-LWB2J3KU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/util/config.ts"],"names":["config","Conf","getConfig","configList","entries","isJsonMode","logJSON","rows","key","value","renderTable"],"mappings":"qGAKA,IAAMA,EAAS,IAAIC,CAAAA,CAAK,CACtB,WAAA,CAAa,YAAA,CACb,QAAA,CAAU,CACR,mBAAoB,YAAA,CACpB,WAAA,CAAa,KACb,YAAA,CAAc,MAAA,CACd,aAAc,IAChB,CACF,CAAC,EAEM,SAASC,CAAAA,EAAkB,CAChC,OAAOF,CACT,CAEA,eAAOG,CAAAA,EAAmD,CACxD,IAAMC,CAAAA,CAAU,MAAA,CAAO,QAAQJ,CAAAA,CAAO,KAAK,EAC3C,GAAIK,CAAAA,GAAc,CAChBC,CAAAA,CAAQ,MAAA,CAAO,WAAA,CAAYF,CAAO,CAAC,CAAA,CACnC,MACF,CACA,IAAMG,EAAOH,CAAAA,CAAQ,GAAA,CAAI,CAAC,CAACI,CAAAA,CAAKC,CAAK,CAAA,IAAO,CAC1C,IAAAD,CAAAA,CACA,KAAA,CAAO,OAAOC,CAAK,CACrB,CAAA,CAAE,CAAA,CACF,QAAQ,GAAA,CAAIC,GAAAA,CAAYH,EAAM,CAC5B,CAAE,IAAK,KAAA,CAAO,KAAA,CAAO,KAAM,CAAA,CAC3B,CAAE,IAAK,OAAA,CAAS,KAAA,CAAO,OAAQ,CACjC,CAAC,CAAC,EACJ","file":"chunk-LWB2J3KU.js","sourcesContent":["import Conf from 'conf'\nimport { renderTable } from '../../lib/output/table.js'\nimport { logJSON } from '../../lib/output/logger.js'\nimport { isJsonMode } from '../../lib/output/logger.js'\n\nconst config = new Conf({\n projectName: 'squidcloud',\n defaults: {\n defaultEnvironment: 'production',\n autoCopyUrl: true,\n outputFormat: 'text',\n checkUpdates: true,\n },\n})\n\nexport function getConfig(): Conf {\n return config\n}\n\nexport default async function configList(): Promise<void> {\n const entries = Object.entries(config.store) as [string, unknown][]\n if (isJsonMode()) {\n logJSON(Object.fromEntries(entries))\n return\n }\n const rows = entries.map(([key, value]) => ({\n key,\n value: String(value),\n }))\n console.log(renderTable(rows, [\n { key: 'key', label: 'Key' },\n { key: 'value', label: 'Value' },\n ]))\n}\n\nexport { config }\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var o=new Set([".html",".css",".js",".mjs",".json",".svg",".png",".jpg",".jpeg",".gif",".webp",".avif",".ico",".woff",".woff2",".ttf",".otf",".eot",".mp4",".webm",".ogg",".mp3",".wav",".pdf",".txt",".xml",".map"]);function n(t){let e=t.toLowerCase().slice(t.lastIndexOf("."));return e?o.has(e):false}export{n as a};//# sourceMappingURL=chunk-MKRWNV2T.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-MKRWNV2T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/deploy/allowlist.ts"],"names":["ALLOWED_EXTENSIONS","isAllowedFile","filePath","ext"],"mappings":"AAAA,IAAMA,CAAAA,CAAqB,IAAI,GAAA,CAAI,CACjC,OAAA,CAAS,OAAQ,KAAA,CAAO,MAAA,CAAQ,OAAA,CAAS,MAAA,CACzC,MAAA,CAAQ,MAAA,CAAQ,QAAS,MAAA,CAAQ,OAAA,CAAS,OAAA,CAAS,MAAA,CACnD,OAAA,CAAS,QAAA,CAAU,MAAA,CAAQ,MAAA,CAAQ,MAAA,CACnC,MAAA,CAAQ,OAAA,CAAS,MAAA,CAAQ,MAAA,CAAQ,MAAA,CACjC,OAAQ,MAAA,CAAQ,MAAA,CAAQ,MAC1B,CAAC,CAAA,CAEM,SAASC,EAAcC,CAAAA,CAA2B,CACvD,IAAMC,CAAAA,CAAMD,CAAAA,CAAS,WAAA,GAAc,KAAA,CAAMA,CAAAA,CAAS,WAAA,CAAY,GAAG,CAAC,CAAA,CAClE,OAAKC,CAAAA,CACEH,CAAAA,CAAmB,GAAA,CAAIG,CAAG,CAAA,CADhB,KAEnB","file":"chunk-MKRWNV2T.js","sourcesContent":["const ALLOWED_EXTENSIONS = new Set([\n '.html', '.css', '.js', '.mjs', '.json', '.svg',\n '.png', '.jpg', '.jpeg', '.gif', '.webp', '.avif', '.ico',\n '.woff', '.woff2', '.ttf', '.otf', '.eot',\n '.mp4', '.webm', '.ogg', '.mp3', '.wav',\n '.pdf', '.txt', '.xml', '.map',\n])\n\nexport function isAllowedFile(filePath: string): boolean {\n const ext = filePath.toLowerCase().slice(filePath.lastIndexOf('.'))\n if (!ext) return false\n return ALLOWED_EXTENSIONS.has(ext)\n}\n\nexport function getAllowedExtensions(): string[] {\n return [...ALLOWED_EXTENSIONS]\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/api/cert-pin.ts"],"names":["API_BASE","getApiBase"],"mappings":"eAOA,IAAMA,CAAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,mBAAA,EAAuB,+BAAA,CAoB7C,SAASC,CAAAA,EAAqB,CACnC,OAAOD,CACT","file":"chunk-NDB6KXYI.js","sourcesContent":["import { createHash } from 'node:crypto'\n\nconst PINNED_PUB_KEY_HASHES: string[] = [\n // SquidCloud Vercel deployment — update as needed\n // SHA-256 hash of the expected server public key\n]\n\nconst API_BASE = process.env.SQUIDCLOUD_API_BASE || 'https://squidcloud.vercel.app'\n\nexport function addPinnedKeyHash(hash: string): void {\n PINNED_PUB_KEY_HASHES.push(hash.toLowerCase())\n}\n\nfunction getExpectedSPKI(): string | null {\n return process.env.SQUIDCLOUD_CERT_PIN || null\n}\n\nexport function validateCertPin(peerCertificate: { raw: Buffer }): boolean {\n if (PINNED_PUB_KEY_HASHES.length === 0 && !getExpectedSPKI()) return true\n const der = peerCertificate.raw\n const sha256 = createHash('sha256').update(der).digest('base64')\n const expectedPin = getExpectedSPKI()\n if (expectedPin && sha256 === expectedPin) return true\n if (PINNED_PUB_KEY_HASHES.includes(sha256)) return true\n return false\n}\n\nexport function getApiBase(): string {\n return API_BASE\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {f}from'./chunk-QT7R3AXE.js';import i from'ora';import n from'chalk';function e(){return !!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI)}var c={dots:{spinner:"dots"},moon:{spinner:"moon"},arc:{spinner:"arc"},bounce:{spinner:"bounce"},shark:{spinner:{interval:120,frames:["\u25B8 ","\u25B8\u25B8 ","\u25B8\u25B8\u25B8 ","\u25B8\u25B8\u25B8\u25B8"," \u25B8\u25B8\u25B8\u25B8"," \u25B8\u25B8\u25B8"," \u25B8\u25B8"," \u25B8"]}}};function t(o,a="shark"){if(e()||f()){let r={...i({text:o,spinner:"dots"}),start:()=>(e()||console.log(o),r),stop:()=>(e()||console.log(),r),succeed:()=>(e()||console.log(`${n.green("\u2713")} ${o}`),r),fail:()=>(e()||console.log(`${n.red("\u2717")} ${o}`),r),warn:()=>(e()||console.log(`${n.hex("#FF9800")("\u26A0")} ${o}`),r),info:()=>(e()||console.log(`${n.hex("#4FC3F7")("\u2139")} ${o}`),r),stopAndPersist:()=>(e()||console.log(`${o}`),r),clear:()=>r,render:()=>r,frame:()=>" ",text:o,isSpinning:false,indent:0,color:"cyan",prefixText:"",spinner:{interval:100,frames:[""]}};return r}return i({text:o,...c[a]}).start()}export{t as a};//# sourceMappingURL=chunk-ON3YIMVG.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ON3YIMVG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/output/index.ts","../src/lib/output/spinner.ts"],"names":["isCI","SPINNER_FRAMES","createSpinner","text","style","isJsonMode","silent","ora","chalk"],"mappings":"4EAMO,SAASA,CAAAA,EAAgB,CAC9B,OAAO,CAAC,EACN,OAAA,CAAQ,IAAI,EAAA,EACZ,OAAA,CAAQ,GAAA,CAAI,cAAA,EACZ,OAAA,CAAQ,GAAA,CAAI,SAAA,EACZ,OAAA,CAAQ,GAAA,CAAI,QAAA,CAEhB,CCTA,IAAMC,CAAAA,CAA8C,CAClD,KAAM,CAAE,OAAA,CAAS,MAAO,CAAA,CACxB,IAAA,CAAM,CAAE,QAAS,MAAO,CAAA,CACxB,GAAA,CAAK,CAAE,OAAA,CAAS,KAAM,EACtB,MAAA,CAAQ,CAAE,OAAA,CAAS,QAAS,CAAA,CAC5B,KAAA,CAAO,CAAE,OAAA,CAAS,CAAE,QAAA,CAAU,GAAA,CAAK,MAAA,CAAQ,CAAC,WAAA,CAAQ,iBAAQ,qBAAA,CAAQ,0BAAA,CAAQ,2BAAA,CAAS,sBAAA,CAAS,iBAAA,CAAS,YAAO,CAAE,CAAE,CACpH,CAAA,CAEO,SAASC,CAAAA,CAAcC,CAAAA,CAAcC,EAAqC,OAAA,CAAc,CAC7F,GAAIJ,CAAAA,EAAK,EAAKK,CAAAA,EAAW,CAAG,CAC1B,IAAMC,CAAAA,CAAc,CAClB,GAAGC,CAAAA,CAAI,CAAE,KAAAJ,CAAAA,CAAM,OAAA,CAAS,MAAO,CAAC,CAAA,CAChC,KAAA,CAAO,KAAaH,CAAAA,EAAK,EAAG,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ACZ,OAAA,CAAS,CAAE,QAAA,CAAU,GAAA,CAAK,MAAA,CAAQ,CAAC,EAAE,CAAE,CACzC,CAAA,CACA,OAAOG,CACT,CACA,OAAOC,CAAAA,CAAI,CAAE,IAAA,CAAAJ,CAAAA,CAAM,GAAGF,CAAAA,CAAeG,CAAK,CAAE,CAAC,CAAA,CAAE,KAAA,EACjD","file":"chunk-ON3YIMVG.js","sourcesContent":["export { renderMascot, renderBrandedMascot } from './mascot.js'\nexport { brand, brandDim, brandLine, success, error, warn, info, muted, copied, BRAND_MARKER, SUCCESS_MARK, ERROR_MARK, WARN_MARK, INFO_MARK, PROGRESS_MARK } from './brand.js'\nexport { setJsonMode, isJsonMode, log, logSuccess, logError, logWarn, logInfo, logBrand, logRaw, logJSON, logErrorJSON, writeAudit } from './logger.js'\nexport { createSpinner } from './spinner.js'\nexport { createTable, renderTable, renderCompactTable } from './table.js'\n\nexport function isCI(): boolean {\n return !!(\n process.env.CI ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.CIRCLECI\n )\n}\n","import ora, { Ora } from 'ora'\nimport chalk from 'chalk'\nimport { isCI, isJsonMode } from './index.js'\n\nconst SPINNER_FRAMES: Record<string, ora.Options> = {\n dots: { spinner: 'dots' },\n moon: { spinner: 'moon' },\n arc: { spinner: 'arc' },\n bounce: { spinner: 'bounce' },\n shark: { spinner: { interval: 120, frames: ['▸ ', '▸▸ ', '▸▸▸ ', '▸▸▸▸', ' ▸▸▸▸', ' ▸▸▸', ' ▸▸', ' ▸'] } },\n}\n\nexport function createSpinner(text: string, style: keyof typeof SPINNER_FRAMES = 'shark'): Ora {\n if (isCI() || isJsonMode()) {\n const silent: Ora = {\n ...ora({ text, spinner: 'dots' }),\n start: () => { if (!isCI()) console.log(text); return silent },\n stop: () => { if (!isCI()) console.log(); return silent },\n succeed: () => { if (!isCI()) console.log(`${chalk.green('✓')} ${text}`); return silent },\n fail: () => { if (!isCI()) console.log(`${chalk.red('✗')} ${text}`); return silent },\n warn: () => { if (!isCI()) console.log(`${chalk.hex('#FF9800')('⚠')} ${text}`); return silent },\n info: () => { if (!isCI()) console.log(`${chalk.hex('#4FC3F7')('ℹ')} ${text}`); return silent },\n stopAndPersist: () => { if (!isCI()) console.log(`${text}`); return silent },\n clear: () => { return silent },\n render: () => { return silent },\n frame: () => ' ',\n text,\n isSpinning: false,\n indent: 0,\n color: 'cyan',\n prefixText: '',\n spinner: { interval: 100, frames: [''] },\n } as unknown as Ora\n return silent\n }\n return ora({ text, ...SPINNER_FRAMES[style] }).start()\n}\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import o from'chalk';import l from'gradient-string';import C from'os';import g from'fs';import $ from'path';var d=l(["#4FC3F7","#7C4DFF"]);l(["#1a5276","#4a148c"]);var x=d("\u25C6"),c=o.hex("#4CAF50")("\u2713"),u=o.hex("#F44336")("\u2717"),f=o.hex("#FF9800")("\u26A0"),p=o.hex("#4FC3F7")("\u2139");o.hex("#7C4DFF")("\u25B8");function N(r){return d(r)}function F(r){return o.dim(r)}function h(r){return F("(copied to clipboard)")}function t(){return !!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.TRAVIS||process.env.JENKINS_HOME)}var n=false;function D(r){n=r;}function B(){return n}function i(){return o.dim(`[${new Date().toISOString()}]`)}function G(r){if(n){console.log(JSON.stringify({level:"success",message:r}));return}t()?console.log(`${i()} ${c} ${r}`):console.log(`${c} ${o.green(r)}`);}function L(r){if(n){console.error(JSON.stringify({error:{message:r}}));return}t()?console.error(`${i()} ${u} ${o.red(r)}`):console.error(`${u} ${o.red(r)}`);}function k(r){n||(t()?console.warn(`${i()} ${f} ${o.hex("#FF9800")(r)}`):console.warn(`${f} ${o.hex("#FF9800")(r)}`));}function j(r){n||(t()?console.log(`${i()} ${p} ${o.hex("#4FC3F7")(r)}`):console.log(`${p} ${o.hex("#4FC3F7")(r)}`));}function H(r){n||console.log(`${x} ${r}`);}function U(r){n||console.log(r);}function W(r){n&&console.log(JSON.stringify(r));}function q(r,a,R){let s=$.join(C.homedir(),".squidcloud"),S=$.join(s,"audit.log"),v=JSON.stringify({timestamp:new Date().toISOString(),command:r,args:a,exitCode:R,pid:process.pid})+`
|
|
2
|
+
`;try{g.existsSync(s)||g.mkdirSync(s,{recursive:!0,mode:448}),g.appendFileSync(S,v,{encoding:"utf-8"});}catch{}}export{N as a,F as b,h as c,t as d,D as e,B as f,G as g,L as h,k as i,j,H as k,U as l,W as m,q as n};//# sourceMappingURL=chunk-QT7R3AXE.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-QT7R3AXE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/output/brand.ts","../src/lib/utils/ci-detect.ts","../src/lib/output/logger.ts"],"names":["squidGradient","gradient","BRAND_MARKER","SUCCESS_MARK","chalk","ERROR_MARK","WARN_MARK","INFO_MARK","brand","text","muted","copied","isCI","jsonMode","setJsonMode","mode","isJsonMode","timestamp","logSuccess","message","logError","logWarn","logInfo","logBrand","logRaw","logJSON","data","writeAudit","command","args","exitCode","auditDir","path","os","auditFile","entry","fs"],"mappings":"4GAGA,IAAMA,CAAAA,CAAgBC,EAAS,CAAC,SAAA,CAAW,SAAS,CAAC,CAAA,CACjCA,CAAAA,CAAS,CAAC,UAAW,SAAS,CAAC,CAAA,KAEtCC,CAAAA,CAAeF,CAAAA,CAAc,QAAG,EAChCG,CAAAA,CAAeC,CAAAA,CAAM,IAAI,SAAS,CAAA,CAAE,QAAG,CAAA,CACvCC,CAAAA,CAAaD,EAAM,GAAA,CAAI,SAAS,EAAE,QAAG,CAAA,CACrCE,EAAYF,CAAAA,CAAM,GAAA,CAAI,SAAS,CAAA,CAAE,QAAG,CAAA,CACpCG,CAAAA,CAAYH,CAAAA,CAAM,GAAA,CAAI,SAAS,CAAA,CAAE,QAAG,EACpBA,CAAAA,CAAM,IAAI,SAAS,CAAA,CAAE,QAAG,EAE9C,S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IiB,CAAO,CAAA,CAAE,EAC1C,CAEO,SAASK,CAAAA,CAAOL,EAAuB,CACxCN,CAAAA,EACJ,QAAQ,GAAA,CAAIM,CAAO,EACrB,CAEO,SAASM,CAAAA,CAAQC,CAAAA,CAAqB,CACtCb,CAAAA,EACL,QAAQ,GAAA,CAAI,IAAA,CAAK,UAAUa,CAAI,CAAC,EAClC,CAUO,SAASC,EAAWC,CAAAA,CAAiBC,CAAAA,CAAcC,EAAwB,CAChF,IAAMC,EAAWC,CAAAA,CAAK,IAAA,CAAKC,EAAG,OAAA,EAAQ,CAAG,aAAa,CAAA,CAChDC,CAAAA,CAAYF,CAAAA,CAAK,KAAKD,CAAAA,CAAU,WAAW,EAC3CI,CAAAA,CAAQ,IAAA,CAAK,UAAU,CAC3B,SAAA,CAAW,IAAI,IAAA,EAAK,CAAE,WAAA,GACtB,OAAA,CAAAP,CAAAA,CACA,KAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,GAAA,CAAK,OAAA,CAAQ,GACf,CAAC,CAAA,CAAI;AAAA,CAAA,CACL,GAAI,CACGM,CAAAA,CAAG,UAAA,CAAWL,CAAQ,CAAA,EACzBK,CAAAA,CAAG,SAAA,CAAUL,CAAAA,CAAU,CAAE,SAAA,CAAW,CAAA,CAAA,CAAM,IAAA,CAAM,GAAM,CAAC,CAAA,CAEzDK,CAAAA,CAAG,cAAA,CAAeF,CAAAA,CAAWC,CAAAA,CAAO,CAAE,QAAA,CAAU,OAAQ,CAAC,EAC3D,CAAA,KAAQ,CAER,CACF","file":"chunk-QT7R3AXE.js","sourcesContent":["import chalk from 'chalk'\nimport gradient from 'gradient-string'\n\nconst squidGradient = gradient(['#4FC3F7', '#7C4DFF'])\nconst dimGradient = gradient(['#1a5276', '#4a148c'])\n\nexport const BRAND_MARKER = squidGradient('◆')\nexport const SUCCESS_MARK = chalk.hex('#4CAF50')('✓')\nexport const ERROR_MARK = chalk.hex('#F44336')('✗')\nexport const WARN_MARK = chalk.hex('#FF9800')('⚠')\nexport const INFO_MARK = chalk.hex('#4FC3F7')('ℹ')\nexport const PROGRESS_MARK = chalk.hex('#7C4DFF')('▸')\n\nexport function brand(text: string): string {\n return squidGradient(text)\n}\n\nexport function brandDim(text: string): string {\n return dimGradient(text)\n}\n\nexport function brandLine(text: string): string {\n return `${BRAND_MARKER} ${brand(text)}`\n}\n\nexport function success(text: string): string {\n return `${SUCCESS_MARK} ${chalk.green(text)}`\n}\n\nexport function error(text: string): string {\n return `${ERROR_MARK} ${chalk.red(text)}`\n}\n\nexport function warn(text: string): string {\n return `${WARN_MARK} ${chalk.hex('#FF9800')(text)}`\n}\n\nexport function info(text: string): string {\n return `${INFO_MARK} ${chalk.hex('#4FC3F7')(text)}`\n}\n\nexport function muted(text: string): string {\n return chalk.dim(text)\n}\n\nexport function copied(text: string): string {\n return muted(`(copied to clipboard)`)\n}\n","export function isCI(): boolean {\n return !!(\n process.env.CI ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.JENKINS_HOME\n )\n}\n\nexport function isInteractive(): boolean {\n if (isCI()) return false\n return process.stdout.isTTY && process.stdin.isTTY\n}\n\nexport function getCIProvider(): string | null {\n if (process.env.GITHUB_ACTIONS) return 'github-actions'\n if (process.env.GITLAB_CI) return 'gitlab-ci'\n if (process.env.CIRCLECI) return 'circleci'\n if (process.env.TRAVIS) return 'travis'\n if (process.env.JENKINS_HOME) return 'jenkins'\n if (process.env.CI) return 'unknown-ci'\n return null\n}\n","import chalk from 'chalk'\nimport os from 'node:os'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { isCI } from '../utils/ci-detect.js'\nimport { BRAND_MARKER, SUCCESS_MARK, ERROR_MARK, WARN_MARK, INFO_MARK, muted } from './brand.js'\n\nlet jsonMode = false\n\nexport function setJsonMode(mode: boolean): void {\n jsonMode = mode\n}\n\nexport function isJsonMode(): boolean {\n return jsonMode\n}\n\ninterface LogOptions {\n prefix?: string\n}\n\nfunction timestamp(): string {\n return chalk.dim(`[${new Date().toISOString()}]`)\n}\n\nexport function log(message: string, options?: LogOptions): void {\n if (jsonMode) return\n const prefix = options?.prefix ? `${options.prefix} ` : ''\n if (isCI()) {\n console.log(`${timestamp()} ${prefix}${message}`)\n } else {\n console.log(`${prefix}${message}`)\n }\n}\n\nexport function logSuccess(message: string): void {\n if (jsonMode) {\n console.log(JSON.stringify({ level: 'success', message }))\n return\n }\n if (isCI()) {\n console.log(`${timestamp()} ${SUCCESS_MARK} ${message}`)\n } else {\n console.log(`${SUCCESS_MARK} ${chalk.green(message)}`)\n }\n}\n\nexport function logError(message: string): void {\n if (jsonMode) {\n console.error(JSON.stringify({ error: { message } }))\n return\n }\n if (isCI()) {\n console.error(`${timestamp()} ${ERROR_MARK} ${chalk.red(message)}`)\n } else {\n console.error(`${ERROR_MARK} ${chalk.red(message)}`)\n }\n}\n\nexport function logWarn(message: string): void {\n if (jsonMode) return\n if (isCI()) {\n console.warn(`${timestamp()} ${WARN_MARK} ${chalk.hex('#FF9800')(message)}`)\n } else {\n console.warn(`${WARN_MARK} ${chalk.hex('#FF9800')(message)}`)\n }\n}\n\nexport function logInfo(message: string): void {\n if (jsonMode) return\n if (isCI()) {\n console.log(`${timestamp()} ${INFO_MARK} ${chalk.hex('#4FC3F7')(message)}`)\n } else {\n console.log(`${INFO_MARK} ${chalk.hex('#4FC3F7')(message)}`)\n }\n}\n\nexport function logBrand(message: string): void {\n if (jsonMode) return\n console.log(`${BRAND_MARKER} ${message}`)\n}\n\nexport function logRaw(message: string): void {\n if (jsonMode) return\n console.log(message)\n}\n\nexport function logJSON(data: unknown): void {\n if (!jsonMode) return\n console.log(JSON.stringify(data))\n}\n\nexport function logErrorJSON(data: { message: string; code?: string }): void {\n if (!jsonMode) {\n logError(data.message)\n return\n }\n console.error(JSON.stringify({ error: data }))\n}\n\nexport function writeAudit(command: string, args: string, exitCode: number): void {\n const auditDir = path.join(os.homedir(), '.squidcloud')\n const auditFile = path.join(auditDir, 'audit.log')\n const entry = JSON.stringify({\n timestamp: new Date().toISOString(),\n command,\n args,\n exitCode,\n pid: process.pid,\n }) + '\\n'\n try {\n if (!fs.existsSync(auditDir)) {\n fs.mkdirSync(auditDir, { recursive: true, mode: 0o700 })\n }\n fs.appendFileSync(auditFile, entry, { encoding: 'utf-8' })\n } catch {\n // Silently fail — audit should never crash the CLI\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-NDB6KXYI.js';import {m,l,o,n,i}from'./chunk-C5KZCYJ4.js';import {nanoid}from'nanoid';import u from'fs';import D from'path';import X from'os';var T=D.join(X.homedir(),".squidcloud",".refresh.lock");function L(){let t=D.dirname(T);u.existsSync(t)||u.mkdirSync(t,{recursive:true,mode:448});}async function Q(){L();let t=false,e=0;for(;!t&&e<50;)try{let n=u.openSync(T,"wx");u.writeSync(n,String(process.pid)),u.closeSync(n),t=!0;}catch{let n=u.statSync(T);if(Date.now()-n.mtimeMs>1e4)try{u.unlinkSync(T);}catch{}await new Promise(r=>setTimeout(r,100)),e++;}return ()=>{try{u.unlinkSync(T);}catch{}}}async function $(){let t=await Q();try{let e=await m();if(!e)return null;let n$1=l();if(e.device_fingerprint!==n$1)return await o(),null;let s=await A("/api/auth/ssp/refresh",{refresh_token:e.refresh_token,refresh_token_id:e.refresh_token_id,device_fingerprint:n$1});if(!s||!s.session)return await o(),null;let r={...s.session,device_fingerprint:n$1};return await n(r),r}catch{return await o(),null}finally{t();}}var F=3,M=1e3,O=1e3,C=a(),I=0;async function H(){let e=Date.now()-I;e<O&&await new Promise(n=>setTimeout(n,O-e)),I=Date.now();}function v(){return nanoid(21)}async function b(t,e,n,s,r){let f=`${t}:${e}:${n}:${s}`;return i(new TextEncoder().encode(r),f)}async function k(t,e={}){let{method:n="GET",headers:s={},body:r,authenticated:f=false,retries:h=F}=e;await H();let d=v(),m$1=Date.now(),i={"Content-Type":"application/json","X-SQC-Request-ID":d,"X-SQC-Timestamp":String(m$1),...s};if(f){let o=await m();if(o){let c=l();i["X-SQC-Fingerprint"]=c,o.access_token&&(i.Authorization=`Bearer ${o.access_token}`,i["X-SQC-Signature"]=await b(d,m$1,n,t,o.access_token));}}let g=`${C}${t}`,a={method:n,headers:i};r&&n!=="GET"&&(a.body=JSON.stringify(r));let P=null;for(let o=0;o<=h;o++)try{let c=await fetch(g,a);if(c.status===401&&f){let p=await $();if(p){i.Authorization=`Bearer ${p.access_token}`,i["X-SQC-Signature"]=await b(d,m$1,n,t,p.access_token),a.headers=i;let q=await fetch(g,a);return R(q)}}return R(c)}catch(c){if(P=c instanceof Error?c:new Error(String(c)),o<h){let p=M*Math.pow(2,o)*(.5+Math.random()*.5);await new Promise(q=>setTimeout(q,p));}}throw P||new Error(`Request failed: ${t}`)}async function R(t){if(t.status===204)return;if((t.headers.get("content-type")||"").includes("application/json")){let s=await t.json();if(!t.ok){let r=s?.error?.message||s?.message||`HTTP ${t.status}`;throw new y(r,t.status,s?.error)}return s}if(!t.ok){let s=await t.text();throw new y(s||`HTTP ${t.status}`,t.status)}return await t.text()}var y=class extends Error{constructor(n,s,r){super(n);this.status=s;this.details=r;this.name="ApiError";}status;details};async function nt(t,e){return k(t,{...e,method:"GET"})}async function A(t,e,n){return k(t,{...n,method:"POST",body:e})}async function st(t,e,n){return k(t,{...n,method:"PUT",body:e})}async function rt(t,e){return k(t,{...e,method:"DELETE"})}async function it(t,e,n){let{method:s="POST",headers:r={},authenticated:f=false}=n||{},h=v(),d=Date.now(),m$1={...r,"X-SQC-Request-ID":h,"X-SQC-Timestamp":String(d)};if(f){let a=await m();a&&(m$1["X-SQC-Fingerprint"]=l(),a.access_token&&(m$1.Authorization=`Bearer ${a.access_token}`));}let i=`${C}${t}`,g=await fetch(i,{method:s,headers:m$1,body:e});return R(g)}export{$ as a,k as b,y as c,nt as d,A as e,st as f,rt as g,it as h};//# sourceMappingURL=chunk-RWWBBPEJ.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-RWWBBPEJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/auth/refresh.ts","../src/lib/api/client.ts"],"names":["LOCK_FILE","path","os","ensureLockDir","dir","fs","acquireLock","acquired","attempts","fd","stat","refreshAccessToken","release","session","loadSession","fingerprint","computeDeviceFingerprint","clearSession","response","apiPost","newSession","saveSession","MAX_RETRIES","BASE_DELAY","RATE_LIMIT_WINDOW","API_BASE","getApiBase","lastRequestTime","rateLimit","elapsed","r","buildRequestId","nanoid","signRequest","requestId","timestamp","method","accessToken","data","computeHMAC","apiRequest","options","headers","body","authenticated","retries","reqHeaders","url","fetchOptions","lastError","attempt","retryResponse","handleResponse","err","delay","message","ApiError","text","status","details","apiGet","apiPut","apiDelete","apiUpload","formData"],"mappings":"oKAQA,IAAMA,EAAYC,CAAAA,CAAK,IAAA,CAAKC,EAAG,OAAA,EAAQ,CAAG,cAAe,eAAe,CAAA,CAExE,SAASC,CAAAA,EAAsB,CAC7B,IAAMC,CAAAA,CAAMH,CAAAA,CAAK,QAAQD,CAAS,CAAA,CAC7BK,EAAG,UAAA,CAAWD,CAAG,GACpBC,CAAAA,CAAG,SAAA,CAAUD,EAAK,CAAE,SAAA,CAAW,KAAM,IAAA,CAAM,GAAM,CAAC,EAEtD,CAEA,eAAeE,GAAmC,CAChDH,CAAAA,GACA,IAAII,CAAAA,CAAW,MACXC,CAAAA,CAAW,CAAA,CACf,KAAO,CAACD,CAAAA,EAAYC,EAAW,EAAA,EAC7B,GAAI,CACF,IAAMC,CAAAA,CAAKJ,EAAG,QAAA,CAASL,CAAAA,CAAW,IAAI,CAAA,CACtCK,CAAAA,CAAG,SAAA,CAAUI,EAAI,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAC,CAAA,CACpCJ,EAAG,SAAA,CAAUI,CAAE,EACfF,CAAAA,CAAW,CAAA,EACb,MAAQ,CACN,IAAMG,EAAOL,CAAAA,CAAG,QAAA,CAASL,CAAS,CAAA,CAElC,GADY,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Ae,CACjB,IAAM/B,EAAU,MAAMC,CAAAA,GAClBD,CAAAA,GACFiC,GAAAA,CAAW,mBAAmB,CAAA,CAAI9B,CAAAA,GAC9BH,CAAAA,CAAQ,YAAA,GACViC,IAAW,aAAA,CAAmB,CAAA,OAAA,EAAUjC,CAAAA,CAAQ,YAAY,CAAA,CAAA,CAAA,EAGlE,CAEA,IAAMkC,CAAAA,CAAM,CAAA,EAAGtB,CAAQ,CAAA,EAAGxB,CAAI,GACxBiB,CAAAA,CAAW,MAAM,MAAM6B,CAAAA,CAAK,CAChC,OAAAX,CAAAA,CACA,OAAA,CAASU,IACT,IAAA,CAAMkB,CACR,CAAC,CAAA,CAED,OAAOZ,CAAAA,CAAkBlC,CAAQ,CACnC","file":"chunk-RWWBBPEJ.js","sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport os from 'node:os'\nimport { SquidSession } from '../crypto/ssp.js'\nimport { apiPost } from '../api/client.js'\nimport { computeDeviceFingerprint } from './fingerprint.js'\nimport { loadSession, saveSession, clearSession } from './session.js'\n\nconst LOCK_FILE = path.join(os.homedir(), '.squidcloud', '.refresh.lock')\n\nfunction ensureLockDir(): void {\n const dir = path.dirname(LOCK_FILE)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true, mode: 0o700 })\n }\n}\n\nasync function acquireLock(): Promise<() => void> {\n ensureLockDir()\n let acquired = false\n let attempts = 0\n while (!acquired && attempts < 50) {\n try {\n const fd = fs.openSync(LOCK_FILE, 'wx')\n fs.writeSync(fd, String(process.pid))\n fs.closeSync(fd)\n acquired = true\n } catch {\n const stat = fs.statSync(LOCK_FILE)\n const age = Date.now() - stat.mtimeMs\n if (age > 10000) {\n try { fs.unlinkSync(LOCK_FILE) } catch {}\n }\n await new Promise(r => setTimeout(r, 100))\n attempts++\n }\n }\n return () => {\n try { fs.unlinkSync(LOCK_FILE) } catch {}\n }\n}\n\nexport async function refreshAccessToken(): Promise<SquidSession | null> {\n const release = await acquireLock()\n try {\n const session = await loadSession()\n if (!session) return null\n\n const fingerprint = computeDeviceFingerprint()\n if (session.device_fingerprint !== fingerprint) {\n await clearSession()\n return null\n }\n\n const response = await apiPost<{ session: SquidSession }>('/api/auth/ssp/refresh', {\n refresh_token: session.refresh_token,\n refresh_token_id: session.refresh_token_id,\n device_fingerprint: fingerprint,\n })\n\n if (!response || !response.session) {\n await clearSession()\n return null\n }\n\n const newSession: SquidSession = {\n ...response.session,\n device_fingerprint: fingerprint,\n }\n await saveSession(newSession)\n return newSession\n } catch {\n await clearSession()\n return null\n } finally {\n release()\n }\n}\n","import { nanoid } from 'nanoid'\nimport { computeHMAC } from '../crypto/ssp.js'\nimport { loadSession } from '../auth/session.js'\nimport { refreshAccessToken } from '../auth/refresh.js'\nimport { computeDeviceFingerprint } from '../auth/fingerprint.js'\nimport { getApiBase } from './cert-pin.js'\n\nconst MAX_RETRIES = 3\nconst BASE_DELAY = 1000\nconst RATE_LIMIT_WINDOW = 1000\nconst API_BASE = getApiBase()\n\ninterface RequestOptions {\n method?: string\n headers?: Record<string, string>\n body?: unknown\n authenticated?: boolean\n retries?: number\n}\n\nlet lastRequestTime = 0\n\nasync function rateLimit(): Promise<void> {\n const now = Date.now()\n const elapsed = now - lastRequestTime\n if (elapsed < RATE_LIMIT_WINDOW) {\n await new Promise(r => setTimeout(r, RATE_LIMIT_WINDOW - elapsed))\n }\n lastRequestTime = Date.now()\n}\n\nfunction buildRequestId(): string {\n return nanoid(21)\n}\n\nasync function signRequest(requestId: string, timestamp: number, method: string, path: string, accessToken: string): Promise<string> {\n const data = `${requestId}:${timestamp}:${method}:${path}`\n return computeHMAC(new TextEncoder().encode(accessToken), data)\n}\n\nexport async function apiRequest<T>(path: string, options: RequestOptions = {}): Promise<T> {\n const { method = 'GET', headers = {}, body, authenticated = false, retries = MAX_RETRIES } = options\n\n await rateLimit()\n\n const requestId = buildRequestId()\n const timestamp = Date.now()\n\n const reqHeaders: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-SQC-Request-ID': requestId,\n 'X-SQC-Timestamp': String(timestamp),\n ...headers,\n }\n\n if (authenticated) {\n let session = await loadSession()\n if (session) {\n const fingerprint = computeDeviceFingerprint()\n reqHeaders['X-SQC-Fingerprint'] = fingerprint\n\n if (session.access_token) {\n reqHeaders['Authorization'] = `Bearer ${session.access_token}`\n reqHeaders['X-SQC-Signature'] = await signRequest(requestId, timestamp, method, path, session.access_token)\n }\n }\n }\n\n const url = `${API_BASE}${path}`\n const fetchOptions: RequestInit = {\n method,\n headers: reqHeaders,\n }\n\n if (body && method !== 'GET') {\n fetchOptions.body = JSON.stringify(body)\n }\n\n let lastError: Error | null = null\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n const response = await fetch(url, fetchOptions)\n\n if (response.status === 401 && authenticated) {\n const newSession = await refreshAccessToken()\n if (newSession) {\n reqHeaders['Authorization'] = `Bearer ${newSession.access_token}`\n reqHeaders['X-SQC-Signature'] = await signRequest(requestId, timestamp, method, path, newSession.access_token)\n fetchOptions.headers = reqHeaders\n const retryResponse = await fetch(url, fetchOptions)\n return handleResponse<T>(retryResponse)\n }\n }\n\n return handleResponse<T>(response)\n } catch (err) {\n lastError = err instanceof Error ? err : new Error(String(err))\n if (attempt < retries) {\n const delay = BASE_DELAY * Math.pow(2, attempt) * (0.5 + Math.random() * 0.5)\n await new Promise(r => setTimeout(r, delay))\n }\n }\n }\n\n throw lastError || new Error(`Request failed: ${path}`)\n}\n\nasync function handleResponse<T>(response: Response): Promise<T> {\n if (response.status === 204) {\n return undefined as T\n }\n const contentType = response.headers.get('content-type') || ''\n if (contentType.includes('application/json')) {\n const data = await response.json()\n if (!response.ok) {\n const message = data?.error?.message || data?.message || `HTTP ${response.status}`\n throw new ApiError(message, response.status, data?.error)\n }\n return data as T\n }\n if (!response.ok) {\n const text = await response.text()\n throw new ApiError(text || `HTTP ${response.status}`, response.status)\n }\n const text = await response.text()\n return text as unknown as T\n}\n\nexport class ApiError extends Error {\n constructor(\n message: string,\n public status: number,\n public details?: unknown,\n ) {\n super(message)\n this.name = 'ApiError'\n }\n}\n\nexport async function apiGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return apiRequest<T>(path, { ...options, method: 'GET' })\n}\n\nexport async function apiPost<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return apiRequest<T>(path, { ...options, method: 'POST', body })\n}\n\nexport async function apiPut<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return apiRequest<T>(path, { ...options, method: 'PUT', body })\n}\n\nexport async function apiDelete<T>(path: string, options?: RequestOptions): Promise<T> {\n return apiRequest<T>(path, { ...options, method: 'DELETE' })\n}\n\nexport async function apiUpload<T>(path: string, formData: FormData, options?: RequestOptions): Promise<T> {\n const { method = 'POST', headers = {}, authenticated = false } = options || {}\n const requestId = buildRequestId()\n const timestamp = Date.now()\n\n const reqHeaders: Record<string, string> = {\n ...headers,\n 'X-SQC-Request-ID': requestId,\n 'X-SQC-Timestamp': String(timestamp),\n }\n\n if (authenticated) {\n const session = await loadSession()\n if (session) {\n reqHeaders['X-SQC-Fingerprint'] = computeDeviceFingerprint()\n if (session.access_token) {\n reqHeaders['Authorization'] = `Bearer ${session.access_token}`\n }\n }\n }\n\n const url = `${API_BASE}${path}`\n const response = await fetch(url, {\n method,\n headers: reqHeaders,\n body: formData,\n })\n\n return handleResponse<T>(response)\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {f,m}from'./chunk-QT7R3AXE.js';import g from'cli-table3';import f$1 from'chalk';function a(r,t={}){return new g({head:r.map(e=>f$1.bold(e)),colAligns:t.colAligns,style:{head:[],border:[],"padding-left":1,"padding-right":1,...t.style},chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},...t.compact?{chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:""},style:{"padding-left":0,"padding-right":2}}:{}})}function b(r,t){if(f())return m(r),"";let e=a(t.map(o=>o.label),{colAligns:t.map(o=>o.align??"left")});for(let o of r)e.push(t.map(i=>{let n=o[i.key];return i.format?i.format(n):String(n??"")}));return e.toString()}function c(r,t){if(f())return m(r),"";let e=a(t.map(o=>o.label),{colAligns:t.map(o=>o.align??"left"),compact:true});for(let o of r)e.push(t.map(i=>{let n=o[i.key];return i.format?i.format(n):String(n??"")}));return e.toString()}export{b as a,c as b};//# sourceMappingURL=chunk-THMWE2I6.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-THMWE2I6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/output/table.ts"],"names":["createTable","headers","options","Table","h","chalk","renderTable","data","columns","isJsonMode","logJSON","table","c","row","val","renderCompactTable"],"mappings":"uFAmBO,SAASA,CAAAA,CAAYC,CAAAA,CAAmBC,CAAAA,CAAwB,EAAC,CAAgB,CACtF,OAAO,IAAIC,CAAAA,CAAM,CACf,IAAA,CAAMF,CAAAA,CAAQ,GAAA,CAAIG,CAAAA,EAAKC,GAAAA,CAAM,IAAA,CAAKD,CAAC,CAAC,CAAA,CACpC,SAAA,CAAWF,CAAAA,CAAQ,SAAA,CACnB,MAAO,CACL,IAAA,CAAM,EAAC,CACP,MAAA,CAAQ,EAAC,CACT,cAAA,CAAgB,CAAA,CAChB,eAAA,CAAiB,CAAA,CACjB,GAAGA,CAAAA,CAAQ,KACb,CAAA,CACA,KAAA,CAAO,CACL,GAAA,CAAK,QAAA,CACL,SAAA,CAAW,QAAA,CACX,UAAA,CAAY,QAAA,CACZ,WAAA,CAAa,QAAA,CACb,MAAA,CAAQ,QAAA,CACR,YAAA,CAAc,QAAA,CACd,aAAA,CAAe,QAAA,CACf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A,CAAE,MAAA,CAASA,CAAAA,CAAE,MAAA,CAAOE,CAAG,CAAA,CAAI,MAAA,CAAOA,CAAAA,EAAO,EAAE,CACpD,CAAC,CACH,CAAA,CAEF,OAAOH,CAAAA,CAAM,QAAA,EACf,CAEO,SAASI,CAAAA,CAAmBR,CAAAA,CAAiCC,CAAAA,CAA8B,CAChG,GAAIC,CAAAA,EAAW,CACb,OAAAC,CAAAA,CAAQH,CAAI,CAAA,CACL,EAAA,CAET,IAAMI,CAAAA,CAAQX,CAAAA,CACZQ,CAAAA,CAAQ,GAAA,CAAII,CAAAA,EAAKA,CAAAA,CAAE,KAAK,CAAA,CACxB,CAAE,SAAA,CAAWJ,CAAAA,CAAQ,GAAA,CAAII,CAAAA,EAAKA,CAAAA,CAAE,KAAA,EAAS,MAAM,CAAA,CAAG,OAAA,CAAS,IAAK,CAClE,CAAA,CACA,IAAA,IAAWC,CAAAA,IAAON,CAAAA,CAChBI,CAAAA,CAAM,IAAA,CACJH,CAAAA,CAAQ,GAAA,CAAII,CAAAA,EAAK,CACf,IAAME,CAAAA,CAAMD,CAAAA,CAAID,CAAAA,CAAE,GAAG,EACrB,OAAOA,CAAAA,CAAE,MAAA,CAASA,CAAAA,CAAE,MAAA,CAAOE,CAAG,CAAA,CAAI,MAAA,CAAOA,CAAAA,EAAO,EAAE,CACpD,CAAC,CACH,CAAA,CAEF,OAAOH,CAAAA,CAAM,UACf","file":"chunk-THMWE2I6.js","sourcesContent":["import Table from 'cli-table3'\nimport chalk from 'chalk'\nimport { isCI } from '../utils/ci-detect.js'\nimport { isJsonMode, logJSON } from './logger.js'\n\ninterface ColumnDef {\n key: string\n label: string\n align?: 'left' | 'center' | 'right'\n format?: (value: unknown) => string\n}\n\ninterface TableOptions {\n head?: string[]\n colAligns?: ('left' | 'center' | 'right')[]\n style?: Record<string, unknown>\n compact?: boolean\n}\n\nexport function createTable(headers: string[], options: TableOptions = {}): Table.Table {\n return new Table({\n head: headers.map(h => chalk.bold(h)),\n colAligns: options.colAligns,\n style: {\n head: [],\n border: [],\n 'padding-left': 1,\n 'padding-right': 1,\n ...options.style,\n },\n chars: {\n top: '─',\n 'top-mid': '┬',\n 'top-left': '┌',\n 'top-right': '┐',\n bottom: '─',\n 'bottom-mid': '┴',\n 'bottom-left': '└',\n 'bottom-right': '┘',\n left: '│',\n 'left-mid': '├',\n mid: '─',\n 'mid-mid': '┼',\n right: '│',\n 'right-mid': '┤',\n middle: '│',\n },\n ...options.compact ? {\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: '',\n },\n style: { 'padding-left': 0, 'padding-right': 2 },\n } : {},\n })\n}\n\nexport function renderTable(data: Record<string, unknown>[], columns: ColumnDef[]): string {\n if (isJsonMode()) {\n logJSON(data)\n return ''\n }\n const table = createTable(\n columns.map(c => c.label),\n { colAligns: columns.map(c => c.align ?? 'left') }\n )\n for (const row of data) {\n table.push(\n columns.map(c => {\n const val = row[c.key]\n return c.format ? c.format(val) : String(val ?? '')\n })\n )\n }\n return table.toString()\n}\n\nexport function renderCompactTable(data: Record<string, unknown>[], columns: ColumnDef[]): string {\n if (isJsonMode()) {\n logJSON(data)\n return ''\n }\n const table = createTable(\n columns.map(c => c.label),\n { colAligns: columns.map(c => c.align ?? 'left'), compact: true }\n )\n for (const row of data) {\n table.push(\n columns.map(c => {\n const val = row[c.key]\n return c.format ? c.format(val) : String(val ?? '')\n })\n )\n }\n return table.toString()\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"client-FRNT7PEB.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-NDB6KXYI.js';import {m}from'./chunk-C5KZCYJ4.js';import {WebSocket}from'ws';import e from'chalk';async function f(r){let i=await m();i||(console.error("Not authenticated"),process.exit(1));let a$1=a().replace(/^http/,"ws"),s=new WebSocket(`${a$1}/api/v1/collab/${encodeURIComponent(r)}/activity`,{headers:{Authorization:`Bearer ${i.access_token}`}});console.log(e.dim(`Streaming activity for "${r}"... (Ctrl+C to stop)`)),s.on("message",t=>{try{let o=JSON.parse(t.toString()),l=e.dim(new Date(o.timestamp).toLocaleTimeString()),p=e.hex("#4FC3F7")(o.user||"unknown"),m=o.action==="upload"?e.green("uploaded"):o.action==="delete"?e.red("deleted"):o.action==="edit"?e.yellow("edited"):o.action,d=o.file||o.path||"";console.log(`${l} ${p} ${m} ${d}`);}catch{console.log(t.toString());}}),s.on("error",t=>{console.error(e.red(`Error: ${t.message}`)),process.exit(1);}),process.on("SIGINT",()=>{s.close(),process.exit(0);});}export{f as default};//# sourceMappingURL=collab-activity-GQOGCECR.js.map
|
|
2
|
+
//# sourceMappingURL=collab-activity-GQOGCECR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/collab/collab-activity.ts"],"names":["collabActivity","folder","session","loadSession","apiBase","getApiBase","ws","WebSocket","chalk","data","e","ts","user","action","file","err"],"mappings":"wHAKA,eAAOA,CAAAA,CAAsCC,CAAAA,CAA+B,CAC1E,IAAMC,CAAAA,CAAU,MAAMC,CAAAA,EAAY,CAC7BD,IAAW,OAAA,CAAQ,KAAA,CAAM,mBAAmB,CAAA,CAAG,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA,CAElE,IAAME,GAAAA,CAAUC,CAAAA,GAAa,OAAA,CAAQ,OAAA,CAAS,IAAI,CAAA,CAC5CC,CAAAA,CAAK,IAAIC,SAAAA,CAAU,CAAA,EAAGH,GAAO,CAAA,eAAA,EAAkB,kBAAA,CAAmBH,CAAM,CAAC,CAAA,SAAA,CAAA,CAAa,CAC1F,OAAA,CAAS,CAAE,aAAA,CAAe,CAAA,OAAA,EAAUC,EAAQ,YAAY,CAAA,CAAG,CAC7D,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A,CAAQ,KAAK,CAAC,EAAE,CAAC,EAC5D","file":"collab-activity-GQOGCECR.js","sourcesContent":["import { WebSocket } from 'ws'\nimport chalk from 'chalk'\nimport { loadSession } from '../../lib/auth/session.js'\nimport { getApiBase } from '../../lib/api/cert-pin.js'\n\nexport default async function collabActivity(folder: string): Promise<void> {\n const session = await loadSession()\n if (!session) { console.error('Not authenticated'); process.exit(1) }\n\n const apiBase = getApiBase().replace(/^http/, 'ws')\n const ws = new WebSocket(`${apiBase}/api/v1/collab/${encodeURIComponent(folder)}/activity`, {\n headers: { Authorization: `Bearer ${session.access_token}` },\n })\n\n console.log(chalk.dim(`Streaming activity for \"${folder}\"... (Ctrl+C to stop)`))\n ws.on('message', (data: Buffer) => {\n try {\n const e = JSON.parse(data.toString())\n const ts = chalk.dim(new Date(e.timestamp).toLocaleTimeString())\n const user = chalk.hex('#4FC3F7')(e.user || 'unknown')\n const action = e.action === 'upload' ? chalk.green('uploaded') :\n e.action === 'delete' ? chalk.red('deleted') :\n e.action === 'edit' ? chalk.yellow('edited') : e.action\n const file = e.file || e.path || ''\n console.log(`${ts} ${user} ${action} ${file}`)\n } catch {\n console.log(data.toString())\n }\n })\n ws.on('error', (err) => { console.error(chalk.red(`Error: ${err.message}`)); process.exit(1) })\n process.on('SIGINT', () => { ws.close(); process.exit(0) })\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-ON3YIMVG.js';import'./chunk-6TS5Y27A.js';import {e}from'./chunk-RWWBBPEJ.js';import'./chunk-NDB6KXYI.js';import'./chunk-THMWE2I6.js';import {g}from'./chunk-QT7R3AXE.js';import'./chunk-C5KZCYJ4.js';async function m(i,e$1){let t=a(`Inviting ${e$1.email} to "${i}" as ${e$1.role}...`);t.start(),await e("/api/v1/collab/invite",{folder:i,email:e$1.email,role:e$1.role},{authenticated:true}),t.succeed(),g(`Invited ${e$1.email} to "${i}" as ${e$1.role}`);}export{m as default};//# sourceMappingURL=collab-invite-HUSQYV23.js.map
|
|
2
|
+
//# sourceMappingURL=collab-invite-HUSQYV23.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/collab/collab-invite.ts"],"names":["collabInvite","folder","options","spinner","createSpinner","apiPost","logSuccess"],"mappings":"4NAIA,eAAOA,CAAAA,CAAoCC,EAAgBC,GAAAA,CAAyD,CAClH,IAAMC,CAAAA,CAAUC,CAAAA,CAAc,CAAA,SAAA,EAAYF,GAAAA,CAAQ,KAAK,CAAA,KAAA,EAAQD,CAAM,CAAA,KAAA,EAAQC,GAAAA,CAAQ,IAAI,CAAA,GAAA,CAAK,CAAA,CAC9FC,CAAAA,CAAQ,OAAM,CACd,MAAME,CAAAA,CAAQ,uBAAA,CAAyB,CACrC,MAAA,CAAAJ,EACA,KAAA,CAAOC,GAAAA,CAAQ,KAAA,CACf,IAAA,CAAMA,GAAAA,CAAQ,IAChB,EAAG,CAAE,aAAA,CAAe,IAAK,CAAC,CAAA,CAC1BC,CAAAA,CAAQ,SAAQ,CAChBG,CAAAA,CAAW,CAAA,QAAA,EAAWJ,GAAAA,CAAQ,KAAK,CAAA,KAAA,EAAQD,CAAM,CAAA,KAAA,EAAQC,GAAAA,CAAQ,IAAI,CAAA,CAAE,EACzE","file":"collab-invite-HUSQYV23.js","sourcesContent":["import { apiPost } from '../../lib/api/client.js'\nimport { createSpinner } from '../../lib/output/spinner.js'\nimport { logSuccess } from '../../lib/output/logger.js'\n\nexport default async function collabInvite(folder: string, options: { email: string; role: string }): Promise<void> {\n const spinner = createSpinner(`Inviting ${options.email} to \"${folder}\" as ${options.role}...`)\n spinner.start()\n await apiPost('/api/v1/collab/invite', {\n folder,\n email: options.email,\n role: options.role,\n }, { authenticated: true })\n spinner.succeed()\n logSuccess(`Invited ${options.email} to \"${folder}\" as ${options.role}`)\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-ON3YIMVG.js';import'./chunk-6TS5Y27A.js';import {e}from'./chunk-RWWBBPEJ.js';import'./chunk-NDB6KXYI.js';import'./chunk-THMWE2I6.js';import {g}from'./chunk-QT7R3AXE.js';import'./chunk-C5KZCYJ4.js';import n from'inquirer';async function m(e$1){let{confirm:a$1}=await n.prompt([{type:"confirm",name:"confirm",message:`Remove yourself from "${e$1}"?`,default:false}]);if(!a$1)return;let t=a(`Leaving "${e$1}"...`);t.start(),await e("/api/v1/collab/leave",{folder:e$1},{authenticated:true}),t.succeed(),g(`You left "${e$1}"`);}export{m as default};//# sourceMappingURL=collab-leave-W2ESTT5L.js.map
|
|
2
|
+
//# sourceMappingURL=collab-leave-W2ESTT5L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/collab/collab-leave.ts"],"names":["collabLeave","folder","confirm","inquirer","spinner","createSpinner","apiPost","logSuccess"],"mappings":"oPAKA,eAAOA,CAAAA,CAAmCC,GAAAA,CAA+B,CACvE,GAAM,CAAE,OAAA,CAAAC,GAAQ,CAAA,CAAI,MAAMC,CAAAA,CAAS,MAAA,CAAO,CAAC,CACzC,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,CAAA,sBAAA,EAAyBF,GAAM,CAAA,EAAA,CAAA,CACxC,OAAA,CAAS,KACX,CAAC,CAAC,EACF,GAAI,CAACC,GAAAA,CAAS,OACd,IAAME,CAAAA,CAAUC,CAAAA,CAAc,CAAA,SAAA,EAAYJ,GAAM,CAAA,IAAA,CAAM,CAAA,CACtDG,CAAAA,CAAQ,KAAA,EAAM,CACd,MAAME,CAAAA,CAAQ,sBAAA,CAAwB,CAAE,MAAA,CAAAL,GAAO,CAAA,CAAG,CAAE,aAAA,CAAe,IAAK,CAAC,CAAA,CACzEG,CAAAA,CAAQ,OAAA,EAAQ,CAChBG,CAAAA,CAAW,CAAA,UAAA,EAAaN,GAAM,GAAG,EACnC","file":"collab-leave-W2ESTT5L.js","sourcesContent":["import inquirer from 'inquirer'\nimport { apiPost } from '../../lib/api/client.js'\nimport { createSpinner } from '../../lib/output/spinner.js'\nimport { logSuccess } from '../../lib/output/logger.js'\n\nexport default async function collabLeave(folder: string): Promise<void> {\n const { confirm } = await inquirer.prompt([{\n type: 'confirm',\n name: 'confirm',\n message: `Remove yourself from \"${folder}\"?`,\n default: false,\n }])\n if (!confirm) return\n const spinner = createSpinner(`Leaving \"${folder}\"...`)\n spinner.start()\n await apiPost('/api/v1/collab/leave', { folder }, { authenticated: true })\n spinner.succeed()\n logSuccess(`You left \"${folder}\"`)\n}\n"]}
|