@tigrisdata/cli 3.12.1 → 3.13.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/README.md +33 -4
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/browser/index.d.ts +18 -0
- package/dist/browser/index.js +456 -193
- package/dist/{chunk-X2SUXPXB.js → chunk-453SVRXR.js} +1 -1
- package/dist/chunk-CIRQB45N.js +7 -0
- package/dist/{chunk-6RSONDY2.js → chunk-DBLI36XY.js} +1 -1
- package/dist/{chunk-IUIKP2LU.js → chunk-EOCLTUJ4.js} +1 -1
- package/dist/chunk-FVHGLZAE.js +1 -0
- package/dist/chunk-IA7SF576.js +2 -0
- package/dist/{chunk-C4WTV2YM.js → chunk-IOTP5CCJ.js} +1 -1
- package/dist/chunk-JF2D6OZD.js +4 -0
- package/dist/{chunk-XBMAJWHH.js → chunk-KKSYGHZK.js} +1 -1
- package/dist/{chunk-NOYGN74P.js → chunk-P2MUSPB4.js} +1 -1
- package/dist/{chunk-JKIAWSHG.js → chunk-PHN3GNLG.js} +1 -1
- package/dist/chunk-QCASVW5M.js +3 -0
- package/dist/chunk-RZMWZYTK.js +1 -0
- package/dist/chunk-S447CUNB.js +1 -0
- package/dist/{chunk-OIOEFM6D.js → chunk-TZ7BKFW5.js} +1 -1
- package/dist/{chunk-4GODDZ6W.js → chunk-VFRTC4TW.js} +1 -1
- package/dist/{chunk-ARZLX6CN.js → chunk-VSUYES3O.js} +1 -1
- package/dist/chunk-Y36SHW6I.js +14 -0
- package/dist/{chunk-YXNJDI2L.js → chunk-Y4FIJDZ4.js} +1 -1
- package/dist/chunk-ZC272QWP.js +5 -0
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/help.js +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -1
- package/dist/lib/access-keys/attach-policy.js +1 -1
- package/dist/lib/access-keys/create.js +2 -1
- package/dist/lib/access-keys/delete.js +1 -1
- package/dist/lib/access-keys/detach-policy.js +1 -1
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list-policies.js +1 -1
- package/dist/lib/access-keys/list.js +1 -1
- package/dist/lib/access-keys/roles.js +1 -0
- package/dist/lib/access-keys/rotate.js +1 -1
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/disable-snapshots.js +1 -1
- package/dist/lib/buckets/enable-snapshots.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/lifecycle/create.js +1 -1
- package/dist/lib/buckets/lifecycle/edit.js +1 -1
- package/dist/lib/buckets/lifecycle/list.js +1 -1
- package/dist/lib/buckets/lifecycle/shared.js +1 -1
- package/dist/lib/buckets/list.js +1 -1
- package/dist/lib/buckets/merge.js +1 -1
- package/dist/lib/buckets/migrate.js +1 -1
- package/dist/lib/buckets/rebase.js +1 -1
- package/dist/lib/buckets/restore.js +1 -1
- package/dist/lib/buckets/set-cors.js +1 -1
- package/dist/lib/buckets/set-locations.js +1 -1
- package/dist/lib/buckets/set-migration.js +1 -1
- package/dist/lib/buckets/set-notifications.js +1 -1
- package/dist/lib/buckets/set.js +1 -1
- package/dist/lib/buckets/share.js +1 -1
- package/dist/lib/bundle.js +1 -1
- package/dist/lib/configure/index.js +1 -1
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -1
- package/dist/lib/iam/policies/delete.js +1 -1
- package/dist/lib/iam/policies/edit.js +1 -1
- package/dist/lib/iam/policies/get.js +1 -1
- package/dist/lib/iam/policies/link-key.js +1 -1
- package/dist/lib/iam/policies/list-keys.js +1 -1
- package/dist/lib/iam/policies/list.js +1 -1
- package/dist/lib/iam/policies/select-policy.js +1 -1
- package/dist/lib/iam/policies/unlink-key.js +1 -1
- package/dist/lib/iam/policies/utils.js +1 -1
- package/dist/lib/iam/teams/create.js +1 -1
- package/dist/lib/iam/teams/edit.js +1 -1
- package/dist/lib/iam/teams/list.js +1 -1
- package/dist/lib/iam/teams/shared.js +1 -1
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +1 -1
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/init/index.js +1 -1
- package/dist/lib/init/plan.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/oauth.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/logout.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list-versions.js +1 -1
- package/dist/lib/objects/list.js +1 -1
- package/dist/lib/objects/purge.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/restore-deleted.js +1 -1
- package/dist/lib/objects/restore-info.js +1 -1
- package/dist/lib/objects/restore.js +1 -1
- package/dist/lib/objects/set-access.js +1 -1
- package/dist/lib/objects/set.js +1 -1
- package/dist/lib/organizations/create.js +1 -1
- package/dist/lib/organizations/list.js +1 -1
- package/dist/lib/organizations/select.js +1 -1
- package/dist/lib/presign.js +1 -1
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/delete.js +1 -1
- package/dist/lib/snapshots/list.js +1 -1
- package/dist/lib/snapshots/take.js +1 -1
- package/dist/lib/stat.js +1 -1
- package/dist/lib/telemetry/disable.js +1 -1
- package/dist/lib/telemetry/enable.js +1 -1
- package/dist/lib/telemetry/status.js +1 -1
- package/dist/lib/touch.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/whoami.js +1 -1
- package/dist/specs.yaml +272 -19
- package/dist/utils/analytics.js +1 -1
- package/dist/utils/bucket-info.js +1 -1
- package/dist/utils/credentials-export.js +1 -0
- package/dist/utils/exit.js +1 -1
- package/dist/utils/telemetry.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-E6COPYXK.js +0 -28
- package/dist/chunk-HEQX2NUJ.js +0 -2
- package/dist/chunk-KWYDYEDO.js +0 -5
- package/dist/chunk-TUDALPGD.js +0 -1
- package/dist/chunk-VXGFGLXP.js +0 -10
- package/dist/chunk-ZJWJRAFY.js +0 -1
package/dist/utils/analytics.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-VFRTC4TW.js";import"../chunk-G4OJTPSI.js";import"../chunk-APJUJ6TW.js";import"../chunk-RZMWZYTK.js";import"../chunk-BMWWPXMU.js";import"../chunk-QPUL2AAI.js";export{d as captureCommand,c as decodeTokenEmail,f as identifyOnLogin,a as isCI,e as trackCommand,b as usedFlags};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-EOCLTUJ4.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import"../chunk-AFM3TY2D.js";export{c as buildBucketInfo,b as describeExpiration,a as describeTransition};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../chunk-CIRQB45N.js";import"../chunk-QPUL2AAI.js";export{a as CREDENTIALS_SDKS,b as credentialVariables,c as formatDotenvValue,g as gitignoreStatus,d as mergeDotenv,f as shellExportLines,e as writeDotenv};
|
package/dist/utils/exit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-DBLI36XY.js";import"../chunk-453SVRXR.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-APJUJ6TW.js";import"../chunk-RZMWZYTK.js";import"../chunk-BMWWPXMU.js";import"../chunk-DV3LCXRH.js";import"../chunk-QPUL2AAI.js";export{a as exitWithError,b as failWithError,c as getSuccessNextActions,d as printNextActions};
|
package/dist/utils/telemetry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as d,c as e,d as f,e as g}from"../chunk-
|
|
1
|
+
import{a as c,b as d,c as e,d as f,e as g}from"../chunk-453SVRXR.js";import"../chunk-APJUJ6TW.js";import"../chunk-RZMWZYTK.js";import{a,b}from"../chunk-BMWWPXMU.js";import"../chunk-QPUL2AAI.js";export{d as beforeSend,f as captureError,g as flushTelemetry,e as initTelemetry,c as invocationCommand,a as redactSecrets,b as scrubArgv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-VSUYES3O.js";import"../chunk-G4OJTPSI.js";import"../chunk-RZMWZYTK.js";import"../chunk-QPUL2AAI.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"jsonc-parser": "^3.3.1",
|
|
54
54
|
"open": "^11.0.0",
|
|
55
55
|
"yaml": "^2.8.3",
|
|
56
|
-
"@tigrisdata/iam": "^2.
|
|
56
|
+
"@tigrisdata/iam": "^2.6.0",
|
|
57
57
|
"@tigrisdata/storage": "^3.21.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
package/dist/chunk-E6COPYXK.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var i="Ask permission, then install the CLI: `npm install -g @tigrisdata/cli --ignore-scripts`.",r="Ensure the CLI is on the latest version: `tigris update`.",o=["Check if the user is already authenticated using `tigris whoami`. If not, authenticate using `tigris login oauth`.","Run `tigris orgs list --format json`. If there's more than one org, ask which to use, then make it active with `tigris orgs select <org>` so the following commands target it.","Infer the project name from metadata (package.json, go.mod, pyproject.toml, ...). Check `tigris buckets list --format json` first; if the bucket is absent, `tigris buckets create <name> --format json`. Ask the user whenever anything is ambiguous.",`Create the access key into a private temp file (overwrite, never append), then print only the ID:
|
|
2
|
-
\`umask 077; tmpfile=$(mktemp); tigris access-keys create <username>-<project>-devel --format json > "$tmpfile" && jq -r '.id' < "$tmpfile"\``,"Grant bucket access: `tigris access-keys assign <id> --bucket <bucket> --role Editor --format json`.",`Detect whether the code uses the Tigris SDK or the AWS SDK, then have a small script append the right vars to .env, reading \`.id\`/\`.secret\` from the temp file. Do NOT read the secret into your context \u2014 append it via script. Delete the temp file when done: \`rm -f "$tmpfile"\`.
|
|
3
|
-
|
|
4
|
-
Tigris SDK (@tigrisdata/storage, storage-go):
|
|
5
|
-
TIGRIS_STORAGE_ACCESS_KEY_ID = .id
|
|
6
|
-
TIGRIS_STORAGE_SECRET_ACCESS_KEY = .secret (secret)
|
|
7
|
-
TIGRIS_STORAGE_BUCKET = <bucket>
|
|
8
|
-
|
|
9
|
-
AWS SDK:
|
|
10
|
-
AWS_ACCESS_KEY_ID = .id
|
|
11
|
-
AWS_SECRET_ACCESS_KEY = .secret (secret)
|
|
12
|
-
AWS_ENDPOINT_URL_S3 = https://t3.storage.dev (required)
|
|
13
|
-
AWS_ENDPOINT_URL_IAM = https://iam.storageapi.dev (required)
|
|
14
|
-
AWS_REGION = auto (required)
|
|
15
|
-
`,`Congratulate the user and point them to:
|
|
16
|
-
- JS: https://www.tigrisdata.com/docs/sdks/tigris/
|
|
17
|
-
- Go: https://pkg.go.dev/github.com/tigrisdata/storage-go
|
|
18
|
-
- Docs: https://www.tigrisdata.com/docs/
|
|
19
|
-
- Discord: https://community.tigrisdata.com/
|
|
20
|
-
- Skills: https://www.tigrisdata.com/docs/skills/
|
|
21
|
-
|
|
22
|
-
Suggest adding to their agent config:
|
|
23
|
-
> ## Tigris object storage
|
|
24
|
-
> This project uses Tigris. For any Tigris questions, consult https://www.tigrisdata.com/llms.txt before acting; look it up rather than relying on memory.`];function c(t){return`Help the user set up their project with Tigris:
|
|
25
|
-
|
|
26
|
-
${[t?r:i,...o].map((e,s)=>`${s+1}. ${e}`).join(`
|
|
27
|
-
`)}
|
|
28
|
-
`}export{c as a};
|
package/dist/chunk-HEQX2NUJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o,e as a}from"./chunk-KWYDYEDO.js";import{b as i}from"./chunk-6RSONDY2.js";import{d as r}from"./chunk-HBEO4D3T.js";import{i as n,p as s}from"./chunk-F4AGJWCK.js";async function d(e){s()!=="oauth"&&i(e,`This operation requires OAuth login.
|
|
2
|
-
Run "tigris login oauth" first.`);let t=r();await t.isAuthenticated()||i(e,'Not authenticated. Run "tigris login oauth" first.');let c=n(),{iamEndpoint:g,mgmtEndpoint:u}=o();return{sessionToken:await t.getAccessToken(),organizationId:c??void 0,iamEndpoint:g,mgmtEndpoint:u}}async function A(e){let t=await a();switch(t.type){case"oauth":return d(e);case"aws-profile":case"credentials":case"environment":case"configured":return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,organizationId:n()??void 0,iamEndpoint:o().iamEndpoint};case"none":i(e,'Not authenticated. Run "tigris login" or "tigris configure" first.')}}export{d as a,A as b};
|
package/dist/chunk-KWYDYEDO.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as o,b as a,c as g}from"./chunk-QPUL2AAI.js";import{a as I,d as f}from"./chunk-HBEO4D3T.js";import{i as c,j as y,k as A,l as i,p as d}from"./chunk-F4AGJWCK.js";import{fromIni as S}from"@aws-sdk/credential-providers";function r(){return process.env.AWS_ENDPOINT_URL_S3||process.env.AWS_ENDPOINT_URL_IAM?{endpoint:process.env.AWS_ENDPOINT_URL_S3||o,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||a,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||g}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||o,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||a,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||g}}function _(){let e=process.env.TIGRIS_FORCE_PATH_STYLE?.trim().toLowerCase();return e==="1"||e==="true"||e==="yes"||e==="on"}function u(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY){let e=process.env.AWS_ENDPOINT_URL_S3||o;return{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,endpoint:e,source:"aws"}}if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID&&process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let e=process.env.TIGRIS_STORAGE_ENDPOINT||o;return{accessKeyId:process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,secretAccessKey:process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY,endpoint:e,source:"tigris"}}return null}var p=!1;function P(){p=!1}async function K(){if(p||!process.stdin.isTTY)return!1;p=!0,console.log(`Not authenticated. Starting login...
|
|
2
|
-
`);let{default:e}=await import("./lib/login/select.js");return await e({}),console.log(),!0}async function T(){if(y()){let s=process.env.AWS_PROFILE||"default",l=await S({profile:s})();return{type:"aws-profile",profile:s,accessKeyId:l.accessKeyId,secretAccessKey:l.secretAccessKey}}let e=u();if(e)return{type:"environment",accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,source:e.source};let t=d();if(t==="oauth")return{type:"oauth"};if(t==="credentials"){let s=i();if(s)return{type:"credentials",accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey}}let n=i();return n?{type:"configured",accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey}:{type:"none"}}async function C(e){let t=await E(e);return _()?{...t,forcePathStyle:!0}:t}async function E(e){let t=await T();switch(t.type){case"aws-profile":{let n=await A(t.profile);return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:n.endpoint||r().endpoint||o,iamEndpoint:n.iamEndpoint||r().iamEndpoint}}case"oauth":{let n=f(),s=c();if(!s)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await n.getAccessToken(),accessKeyId:"",secretAccessKey:"",...e?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await n.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:r().endpoint,organizationId:s,iamEndpoint:r().iamEndpoint,authDomain:I().domain}}case"credentials":{let n=c();return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:i()?.endpoint||o,organizationId:n??void 0,iamEndpoint:r().iamEndpoint}}case"environment":return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:u()?.endpoint||o};case"configured":{let n=c();return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:i()?.endpoint||o,organizationId:n??void 0,iamEndpoint:r().iamEndpoint}}case"none":{if(await K())return E(e);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}}}async function N(){let e=await C(),t=c();return{...e,...t&&!e.organizationId?{organizationId:t}:{}}}function O(e){return d()==="oauth"?!1:(u()||i()?console.log(`You are using access key credentials, which belong to a single organization.
|
|
3
|
-
${e} is only available with OAuth login.
|
|
4
|
-
|
|
5
|
-
Run "tigris login" to login with your Tigris account.`):console.log('Not authenticated. Please run "tigris login" to login with your Tigris account.'),!0)}export{r as a,_ as b,u as c,P as d,T as e,C as f,N as g,O as h};
|
package/dist/chunk-TUDALPGD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function i(r){let t=JSON.parse(r);return{version:t.Version,statements:(Array.isArray(t.Statement)?t.Statement:[t.Statement]).map(e=>({effect:e.Effect,action:e.Action,resource:e.Resource}))}}export{i as a};
|
package/dist/chunk-VXGFGLXP.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{e as x}from"./chunk-4GODDZ6W.js";import{a as k}from"./chunk-6RSONDY2.js";import{h as C}from"./chunk-D7WXNA2O.js";import{c as I,d as b,e as E}from"./chunk-X2SUXPXB.js";import{b as v}from"./chunk-DV3LCXRH.js";import{Command as M,Help as U,Option as P}from"commander";function y(n,o,e,a,t){let r=n[n.length-1],i=typeof r=="object"&&r!==null&&"args"in r?r.args:n.filter(m=>typeof m=="string");if(i.length===0)return i;let l=i[0],c=(o.commands??[]).filter(m=>g(m,[...e,m.name],t));if(!new Set(c.flatMap(m=>[m.name,...Array.isArray(m.alias)?m.alias:m.alias?[m.alias]:[]])).has(l)){let m=c.map(u=>u.name),p=e.length>0?`'${l}' for '${e.join(" ")}'`:`'${l}'`;console.error(`Unknown command ${p}.`),m.length>0&&console.error(`Available commands: ${m.join(", ")}`);let f=e.length>0?`${a.name} ${e.join(" ")} help`:`${a.name} help`;console.error(`
|
|
2
|
-
Run "${f}" for usage.`),process.exit(1)}return i}function B(){I();let n=!1,o=async e=>{n&&process.exit(1),n=!0,b(e,{crash:!0,exitCode:v(e).exitCode}),await E(),k(e,void 0,{skipCapture:!0})};process.on("unhandledRejection",e=>{(e===""||e===void 0)&&(console.error(`
|
|
3
|
-
Operation cancelled`),process.exit(1)),o(e)}),process.on("uncaughtException",e=>{o(e)})}function V(n){return/^[a-zA-Z0-9_-]+$/.test(n)}function G(n){let o;n.type==="positional"?o=` ${n.name}`:(o=` --${n.name}`,n.alias&&typeof n.alias=="string"&&(o+=n.alias.length===1?`, -${n.alias}`:`, --${n.alias}`));let e=26,a=o.length>=e?`${o} `:o.padEnd(e),t=n.description;return n.options&&(Array.isArray(n.options)&&typeof n.options[0]=="string"?t+=` (options: ${n.options.join(", ")})`:t+=` (options: ${n.options.map(r=>r.value).join(", ")})`),n.default&&(t+=` [default: ${n.default}]`),n.required&&(t+=" [required]"),n.deprecated&&(t+=n.replaced_by?` [deprecated: use ${n.replaced_by}]`:" [deprecated]"),n["required-when"]&&(t+=` [required when: ${n["required-when"]}]`),n.multiple&&(t+=" [multiple values: comma-separated]"),n.type==="positional"&&(t+=" [positional argument]"),n.examples&&n.examples.length>0&&(t+=` (examples: ${n.examples.join(", ")})`),`${a}${t}`}function g(n,o,e){return n.removed||e(o)?!0:n.commands?n.commands.some(a=>g(a,[...o,a.name],e)):!1}function L(n,o){let e=o?` Use ${o} instead.`:" See the changelog for migration guidance.";console.error(`${n} was removed in this version.${e}`),process.exit(1)}function S(n,o){if(n)for(let e of n){if(!e.removed)continue;h(o,e.name,n)!==void 0&&L(`--${e.name}`,e.replaced_by)}}function _(n,o,e,a){let t=e.join(" ");if(console.log(`
|
|
4
|
-
${n.name} ${t} - ${o.description??""}
|
|
5
|
-
`),o.commands&&o.commands.length>0){let l=o.commands.filter(s=>!s.removed&&g(s,[...e,s.name],a));l.length>0&&(console.log("Commands:"),l.forEach(s=>{let c=` ${s.name}`;if(s.alias){let m=Array.isArray(s.alias)?s.alias:[s.alias];c+=` (${m.join(", ")})`}let d=c.padEnd(24);console.log(`${d}${s.description??""}`)}),console.log())}let r=n.definitions?.global_arguments??[],i=w(r,o.arguments).filter(l=>!l.removed);i.length>0&&(console.log("Arguments:"),i.forEach(l=>{console.log(G(l))}),console.log()),o.examples&&o.examples.length>0&&(console.log("Examples:"),o.examples.forEach(l=>{console.log(` ${l}`)}),console.log()),o.commands&&o.commands.length>0&&console.log(`Use "${n.name} ${t} <command> help" for more information about a command.`)}function R(n,o,e){console.log(`Tigris CLI Version: ${o}
|
|
6
|
-
`),console.log(`Usage: tigris [command] [options]
|
|
7
|
-
`),console.log("Commands:"),n.commands.filter(t=>!t.removed&&g(t,[t.name],e)).forEach(t=>{let r=` ${t.name}`;if(t.alias){let l=Array.isArray(t.alias)?t.alias:[t.alias];r+=` (${l.join(", ")})`}let i=r.padEnd(24);console.log(`${i}${t.description??""}`)}),console.log(`
|
|
8
|
-
Use "${n.name} <command> help" for more information about a command.`)}function w(n,o){let e=o??[],a=new Set(e.map(i=>i.name)),t=new Set(e.filter(i=>i.alias).map(i=>i.alias)),r=n.filter(i=>!a.has(i.name)&&!(i.alias&&t.has(i.alias)));return[...e,...r]}function j(n,o=[]){o.forEach(e=>{if(e.type==="positional"){let a=e.required?`<${e.name}>`:`[${e.name}]`;n.argument(a,e.description)}else{let a=e.alias&&typeof e.alias=="string"&&e.alias.length===1,t=e.alias&&typeof e.alias=="string"&&e.alias.length>1,r=a?`-${e.alias}, --${e.name}`:t?`--${e.alias}, --${e.name}`:`--${e.name}`;if(e.type==="flag"||(e.type==="boolean"?r+=" [value]":e.options?r+=" <value>":r+=e.required||e["required-when"]?" <value>":" [value]"),e.removed)n.addOption(new P(r,e.description??"").hideHelp());else{let i=e.description??"";if(e.deprecated){let l=e.replaced_by?` Use ${e.replaced_by} instead.`:"";i=`(deprecated) ${i}${l}`}n.option(r,i,e.default)}}})}function K(n){return n.replace(/-([a-z])/g,(o,e)=>e.toUpperCase())}function h(n,o,e){if(e){let t=e.find(r=>r.name===o);if(t?.alias&&typeof t.alias=="string"){let r=t.alias.charAt(0).toUpperCase()+t.alias.slice(1);if(n[r]!==void 0)return n[r]}}let a=[o,o.replace(/-/g,""),o.replace(/-/g,"").toLowerCase(),o.charAt(0).toUpperCase(),K(o)];for(let t of a)if(n[t]!==void 0)return n[t]}function D(n,o){for(let e of n){if(e["required-when"]){let[a,t]=e["required-when"].split("="),r=h(o,a,n),i=h(o,e.name,n);if(r===t&&!i)return console.error(`--${e.name} is required when --${a} is ${t}`),!1}if(e.required&&!h(o,e.name,n))return console.error(`--${e.name} is required`),e.description&&console.error(` ${e.description}`),!1}return!0}function W(n,o,e){let a;"optsWithGlobals"in e&&typeof e.optsWithGlobals=="function"?a=e.optsWithGlobals():"opts"in e&&typeof e.opts=="function"?a=e.opts():a=e;let t={...a};return n.filter(i=>i.type==="positional").forEach((i,l)=>{o[l]!==void 0&&(i.multiple?t[i.name]=o[l].split(",").map(s=>s.trim()):t[i.name]=o[l])}),n.forEach(i=>{i.multiple&&i.type!=="positional"&&t[i.name]&&typeof t[i.name]=="string"&&(t[i.name]=t[i.name].split(",").map(l=>l.trim()))}),t}async function q(n,o,e=[],a={}){(a.json||a.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:t,error:r}=await n(o);(r||!t)&&(console.error(r),process.exit(1));let i=o[o.length-1],l=t.default||t[i];typeof l!="function"&&(console.error(`Command not implemented: ${o.join(" ")}`),process.exit(1)),x(o),await l({...a,_positional:e})}function N(n,o,e,a=[]){let{specs:t,loadModule:r,hasImplementation:i}=n,l=t.definitions?.global_arguments??[];for(let s of e){V(s.name)||(console.error(`Invalid command name "${s.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let c=[...a,s.name];if(!g(s,c,i))continue;let d=o.command(s.name,s.removed?{hidden:!0}:void 0).description(s.description??"");if(s.alias&&(Array.isArray(s.alias)?s.alias:[s.alias]).forEach(p=>{d.alias(p)}),s.removed){d.allowUnknownOption(!0),d.allowExcessArguments(!0),d.action(()=>{L(`${t.name} ${c.join(" ")}`,s.replaced_by)});continue}if(s.commands&&s.commands.length>0)if(N(n,d,s.commands,c),s.default){let m=s.commands.find(p=>p.name===s.default);if(m){let p=w(l,[...s.arguments||[],...m.arguments||[]]);j(d,p),d.allowExcessArguments(!0),d.action(async(...f)=>{let u=f.pop(),A=y([u],s,c,t,i),$=W(p,A,u);p.length>0&&!D(p,$)&&process.exit(1),S(p,$),m.deprecated&&m.messages?.onDeprecated&&C(m.messages.onDeprecated),await q(r,[...c,m.name],A,$)})}}else d.allowExcessArguments(!0),d.action((...m)=>{y(m,s,c,t,i),_(t,s,c,i)});else j(d,w(l,s.arguments)),d.action(async(...m)=>{let p=m.pop(),f=m,u=W(s.arguments||[],f,p);s.arguments&&!D(s.arguments,u)&&process.exit(1),S(s.arguments,u),s.deprecated&&s.messages?.onDeprecated&&C(s.messages.onDeprecated),await q(r,c,f,u)});d.command("help").description("Show help for this command").action(()=>{_(t,s,c,i)})}}var H=6,z=34,T=20,F={minWidthToWrap:T,formatItem(n,o,e,a){let i=a.helpWidth??80,l=i-o-2-2;if(!e||l>=z)return U.prototype.formatItem.call(this,n,o,e,a);let s=" ".repeat(H),c=a.boxWrap(e,Math.max(i-H,T));return`${" ".repeat(2)}${n}
|
|
9
|
-
${s}${c.replace(/\n/g,`
|
|
10
|
-
${s}`)}`}};function ee(n){let{specs:o,version:e,hasImplementation:a}=n,t=new M;return t.name(o.name).description(o.description).version(e),t.configureHelp(F),N(n,t,o.commands),t.command("help").description("Show general help").action(()=>{R(o,e,a)}),t.command("version").description("Show the CLI version").action(()=>{console.log(e)}),t.allowExcessArguments(!0),t.action((...r)=>{y(r,{commands:o.commands},[],o,a),R(o,e,a)}),t}export{B as a,V as b,G as c,g as d,_ as e,R as f,j as g,D as h,W as i,N as j,F as k,ee as l};
|
package/dist/chunk-ZJWJRAFY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s="3.12.1";export{s as a};
|