@tigrisdata/cli 3.17.0 → 3.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +480 -458
  2. package/SKILL.md +1 -1
  3. package/dist/auth/iam.js +1 -1
  4. package/dist/auth/provider.js +1 -1
  5. package/dist/browser/index.d.ts +2 -1
  6. package/dist/browser/index.js +447 -448
  7. package/dist/chunk-36RAXRXY.js +1 -0
  8. package/dist/{chunk-RQYVMBA7.js → chunk-4BWK33XD.js} +1 -1
  9. package/dist/chunk-56W4QIZP.js +4 -0
  10. package/dist/{chunk-HK3DBOMB.js → chunk-5FFSAQBH.js} +1 -1
  11. package/dist/chunk-6R467XCM.js +1 -0
  12. package/dist/{chunk-I234FGXR.js → chunk-A6IZCL2R.js} +1 -1
  13. package/dist/{chunk-7PRSGIKV.js → chunk-H4VWRKBZ.js} +1 -1
  14. package/dist/{chunk-CBS7RVDP.js → chunk-JQRHEFN2.js} +1 -1
  15. package/dist/chunk-L5TE7GWK.js +1 -0
  16. package/dist/{chunk-4OC6VF2F.js → chunk-QJKKFI5K.js} +1 -1
  17. package/dist/chunk-QJMLIBCG.js +8 -0
  18. package/dist/{chunk-VQHXD36W.js → chunk-U63FQLE2.js} +1 -1
  19. package/dist/chunk-VI5JXLP7.js +1 -0
  20. package/dist/{chunk-W2SGDHBM.js → chunk-XCHHTO54.js} +1 -1
  21. package/dist/{chunk-7GBRSLA4.js → chunk-YRVVZ64M.js} +1 -1
  22. package/dist/cli-core.js +3 -1
  23. package/dist/cli.js +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/lib/access-keys/assign.js +1 -1
  26. package/dist/lib/access-keys/attach-policy.js +1 -1
  27. package/dist/lib/access-keys/create.js +1 -1
  28. package/dist/lib/access-keys/default-permissions.js +1 -1
  29. package/dist/lib/access-keys/delete.js +1 -1
  30. package/dist/lib/access-keys/detach-policy.js +1 -1
  31. package/dist/lib/access-keys/get.js +1 -1
  32. package/dist/lib/access-keys/list-policies.js +1 -1
  33. package/dist/lib/access-keys/list.js +1 -1
  34. package/dist/lib/access-keys/roles.js +1 -1
  35. package/dist/lib/access-keys/rotate.js +1 -1
  36. package/dist/lib/access-keys/set.js +1 -1
  37. package/dist/lib/buckets/create.js +1 -1
  38. package/dist/lib/buckets/delete.js +1 -1
  39. package/dist/lib/buckets/disable-snapshots.js +1 -1
  40. package/dist/lib/buckets/enable-snapshots.js +1 -1
  41. package/dist/lib/buckets/get.js +1 -1
  42. package/dist/lib/buckets/lifecycle/create.js +1 -1
  43. package/dist/lib/buckets/lifecycle/edit.js +1 -1
  44. package/dist/lib/buckets/lifecycle/list.js +1 -1
  45. package/dist/lib/buckets/lifecycle/shared.js +1 -1
  46. package/dist/lib/buckets/list.js +1 -1
  47. package/dist/lib/buckets/merge.js +1 -1
  48. package/dist/lib/buckets/migrate.js +5 -5
  49. package/dist/lib/buckets/purge.js +1 -1
  50. package/dist/lib/buckets/rebase.js +1 -1
  51. package/dist/lib/buckets/restore.js +1 -1
  52. package/dist/lib/buckets/set-cors.js +1 -1
  53. package/dist/lib/buckets/set-locations.js +1 -1
  54. package/dist/lib/buckets/set-migration.js +1 -1
  55. package/dist/lib/buckets/set-notifications.js +1 -1
  56. package/dist/lib/buckets/set.js +1 -1
  57. package/dist/lib/buckets/share.js +1 -1
  58. package/dist/lib/bundle.js +1 -1
  59. package/dist/lib/configure/index.js +1 -1
  60. package/dist/lib/cp.js +1 -1
  61. package/dist/lib/credentials/test.js +1 -1
  62. package/dist/lib/iam/policies/create.js +1 -1
  63. package/dist/lib/iam/policies/delete.js +1 -1
  64. package/dist/lib/iam/policies/edit.js +1 -1
  65. package/dist/lib/iam/policies/get.js +1 -1
  66. package/dist/lib/iam/policies/link-key.js +1 -1
  67. package/dist/lib/iam/policies/list-keys.js +1 -1
  68. package/dist/lib/iam/policies/list.js +1 -1
  69. package/dist/lib/iam/policies/select-policy.js +1 -1
  70. package/dist/lib/iam/policies/unlink-key.js +1 -1
  71. package/dist/lib/iam/teams/create.js +1 -1
  72. package/dist/lib/iam/teams/edit.js +1 -1
  73. package/dist/lib/iam/teams/list.js +1 -1
  74. package/dist/lib/iam/teams/shared.js +1 -1
  75. package/dist/lib/iam/users/invite.js +1 -1
  76. package/dist/lib/iam/users/list.js +1 -1
  77. package/dist/lib/iam/users/remove.js +1 -1
  78. package/dist/lib/iam/users/revoke-invitation.js +1 -1
  79. package/dist/lib/iam/users/update-role.js +1 -1
  80. package/dist/lib/init/index.js +1 -1
  81. package/dist/lib/login/credentials.js +1 -1
  82. package/dist/lib/login/oauth.js +1 -1
  83. package/dist/lib/login/select.js +1 -1
  84. package/dist/lib/logout.js +1 -1
  85. package/dist/lib/ls.js +1 -1
  86. package/dist/lib/mk.js +1 -1
  87. package/dist/lib/mv.js +1 -1
  88. package/dist/lib/objects/delete.js +1 -1
  89. package/dist/lib/objects/get.js +1 -1
  90. package/dist/lib/objects/info.js +1 -1
  91. package/dist/lib/objects/list-versions.js +1 -1
  92. package/dist/lib/objects/list.js +1 -1
  93. package/dist/lib/objects/purge.js +1 -1
  94. package/dist/lib/objects/put.js +1 -1
  95. package/dist/lib/objects/restore-deleted.js +1 -1
  96. package/dist/lib/objects/restore-info.js +1 -1
  97. package/dist/lib/objects/restore.js +1 -1
  98. package/dist/lib/objects/set-access.js +1 -1
  99. package/dist/lib/objects/set.js +1 -1
  100. package/dist/lib/organizations/create.js +1 -1
  101. package/dist/lib/organizations/delete.js +1 -1
  102. package/dist/lib/organizations/list.js +1 -1
  103. package/dist/lib/organizations/select.js +1 -1
  104. package/dist/lib/presign.js +1 -1
  105. package/dist/lib/rm.js +1 -1
  106. package/dist/lib/snapshots/delete.js +1 -1
  107. package/dist/lib/snapshots/list.js +1 -1
  108. package/dist/lib/snapshots/take.js +1 -1
  109. package/dist/lib/stat.js +1 -1
  110. package/dist/lib/telemetry/disable.js +1 -1
  111. package/dist/lib/telemetry/enable.js +1 -1
  112. package/dist/lib/telemetry/status.js +2 -2
  113. package/dist/lib/touch.js +1 -1
  114. package/dist/lib/update.js +1 -1
  115. package/dist/lib/usage.js +1 -1
  116. package/dist/lib/whoami.js +1 -1
  117. package/dist/specs.yaml +298 -299
  118. package/dist/utils/analytics.js +1 -1
  119. package/dist/utils/exit.js +1 -1
  120. package/dist/utils/telemetry-sender.js +1 -0
  121. package/dist/utils/telemetry.js +1 -1
  122. package/dist/utils/update-check.js +1 -1
  123. package/package.json +5 -2
  124. package/dist/chunk-AQZXG57U.js +0 -1
  125. package/dist/chunk-GE2NFNN4.js +0 -1
  126. package/dist/chunk-HCEAJ2BC.js +0 -4
  127. package/dist/chunk-K3ION5DP.js +0 -1
  128. package/dist/chunk-LBTT65MM.js +0 -3
  129. package/dist/chunk-UOX26MU3.js +0 -7
  130. /package/dist/{chunk-JCXPE6O6.js → chunk-2AC5S3JV.js} +0 -0
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"../chunk-UOX26MU3.js";import"../chunk-G4OJTPSI.js";import"../chunk-APJUJ6TW.js";import"../chunk-AQZXG57U.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
+ import{a,b,c,d,e,f,g,h,i,j}from"../chunk-QJMLIBCG.js";import"../chunk-APJUJ6TW.js";import"../chunk-BMWWPXMU.js";import"../chunk-DV3LCXRH.js";import"../chunk-QPUL2AAI.js";import"../chunk-36RAXRXY.js";import"../chunk-L5TE7GWK.js";import"../chunk-G4OJTPSI.js";export{g as commandHandlesSigint,c as decodeTokenEmail,d as errorCodeOf,h as finishCommand,j as identifyOnLogin,a as isCI,f as recordCommandError,i as resetCommandTrackingForTesting,e as trackCommand,b as usedFlags};
@@ -1 +1 @@
1
- import{a,b,c,d}from"../chunk-HCEAJ2BC.js";import"../chunk-K3ION5DP.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-APJUJ6TW.js";import"../chunk-AQZXG57U.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};
1
+ import{a,b,c,d}from"../chunk-56W4QIZP.js";import"../chunk-VI5JXLP7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-QJMLIBCG.js";import"../chunk-APJUJ6TW.js";import"../chunk-BMWWPXMU.js";import"../chunk-DV3LCXRH.js";import"../chunk-QPUL2AAI.js";import"../chunk-36RAXRXY.js";import"../chunk-L5TE7GWK.js";import"../chunk-G4OJTPSI.js";export{a as exitWithError,b as failWithError,c as getSuccessNextActions,d as printNextActions};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h}from"../chunk-36RAXRXY.js";import"../chunk-G4OJTPSI.js";export{b as PAYLOAD_FILE_PREFIX,a as TELEMETRY_SEND_COMMAND,f as post,c as queueTelemetry,h as resetTelemetryQueueForTesting,g as runTelemetrySender,d as sendQueuedTelemetry,e as senderCommand};
@@ -1 +1 @@
1
- import{a as c,b as d,c as e,d as f,e as g}from"../chunk-K3ION5DP.js";import"../chunk-APJUJ6TW.js";import"../chunk-AQZXG57U.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
+ import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k}from"../chunk-VI5JXLP7.js";import"../chunk-APJUJ6TW.js";import{a,b}from"../chunk-BMWWPXMU.js";import"../chunk-QPUL2AAI.js";import"../chunk-36RAXRXY.js";import"../chunk-L5TE7GWK.js";import"../chunk-G4OJTPSI.js";export{f as DATA_COLLECTION,d as DISABLED_INTEGRATIONS,h as beforeSend,j as captureError,k as flushTelemetry,i as initTelemetry,c as invocationCommand,g as makeQueuedTransport,a as redactSecrets,b as scrubArgv,e as selectIntegrations};
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"../chunk-CBS7RVDP.js";import"../chunk-G4OJTPSI.js";import"../chunk-AQZXG57U.js";import"../chunk-QPUL2AAI.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
1
+ import{a,b,c,d,e}from"../chunk-JQRHEFN2.js";import"../chunk-QPUL2AAI.js";import"../chunk-L5TE7GWK.js";import"../chunk-G4OJTPSI.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@tigrisdata/cli",
3
- "version": "3.17.0",
3
+ "version": "3.17.2",
4
4
  "description": "Command line interface for Tigris object storage",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": ">=20.19.0"
8
+ },
6
9
  "exports": {
7
10
  ".": {
8
11
  "import": "./dist/cli.js"
@@ -45,7 +48,7 @@
45
48
  "dependencies": {
46
49
  "@aws-sdk/credential-providers": "^3.1038.0",
47
50
  "@clack/prompts": "^1.7.0",
48
- "@sentry/node": "^10.66.0",
51
+ "@sentry/node": "^11.0.0",
49
52
  "@smithy/shared-ini-file-loader": "^4.4.9",
50
53
  "commander": "^15.0.0",
51
54
  "enquirer": "^2.4.1",
@@ -1 +0,0 @@
1
- var s="3.17.0";export{s as a};
@@ -1 +0,0 @@
1
- import{e as l}from"./chunk-CBS7RVDP.js";import{a as m,i as s}from"./chunk-LBTT65MM.js";import{b as i}from"./chunk-NI4EYBQH.js";import{a as t}from"./chunk-AQZXG57U.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";m();var j=f(import.meta.url),d=u(j),h=i(),y=o=>{if(o.length===0)return!1;let e=`${a(d,"lib",...o)}.js`;if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=s({specs:h,version:t,loadModule:b,hasImplementation:y});x.parse();l();
@@ -1,4 +0,0 @@
1
- import{d as m}from"./chunk-K3ION5DP.js";import{a as r,d as a}from"./chunk-D7WXNA2O.js";import{c}from"./chunk-NI4EYBQH.js";import{b as i}from"./chunk-DV3LCXRH.js";function p(){return globalThis.__TIGRIS_JSON_MODE===!0}function g(){return process.stderr.isTTY===!0}function f(){return process.stdout.isTTY===!0}function u(t,o,n){let e=i(t);if(p()){let s={error:{message:e.message,code:e.exitCode,category:e.category}};e.nextActions.length>0&&(s.nextActions=e.nextActions),console.error(JSON.stringify(s))}else if(o||console.error(`
2
- Error: ${e.message}`),g()&&e.nextActions.length>0){console.error(`
3
- Next steps:`);for(let s of e.nextActions)console.error(` \u2192 ${s.command} ${s.description}`)}n?.skipCapture||m(t,{category:e.category,command:o?.command,exitCode:e.exitCode}),process.exit(e.exitCode)}function M(t,o){let n=o instanceof Error?o.message:String(o);a(t,n),u(o,t)}function x(t,o){let n=c(t.command,t.operation);return n?.messages?.nextActions?n.messages.nextActions.map(e=>({command:r(e.command,o),description:r(e.description,o)})):[]}function T(t,o){if(!f()||p())return;let n=x(t,o);if(n.length!==0){console.log(`
4
- Next steps:`);for(let e of n)console.log(` \u2192 ${e.command} ${e.description}`)}}export{u as a,M as b,x as c,T as d};
@@ -1 +0,0 @@
1
- import{e as l}from"./chunk-APJUJ6TW.js";import{a as c}from"./chunk-AQZXG57U.js";import{a as u,b as y}from"./chunk-BMWWPXMU.js";import{i as m}from"./chunk-QPUL2AAI.js";import*as t from"@sentry/node";var g=new Set(["general","network"]),p=!1,a=!1;function S(){return process.env.TIGRIS_SENTRY_DSN?.trim()||m}var E=process.env.TIGRIS_ENV==="development"?"development":"production";function h(r){let e=r[0];return e&&!e.startsWith("-")?e:void 0}var T=new Set(["OnUncaughtException","OnUnhandledRejection","LocalVariables","LocalVariablesAsync","Console","ChildProcess"]);function f(r){if(typeof r=="string")return u(r);if(Array.isArray(r))return r.map(f);if(r!==null&&typeof r=="object"){let e=r;for(let n of Object.keys(e))e[n]=f(e[n]);return e}return r}function R(r){return r.server_name=void 0,f(r)}function w(){if(p)return;p=!0;let r=S();if(!(!r||l()))try{t.init({dsn:r,release:`@tigrisdata/cli@${c}`,environment:E,tracesSampleRate:0,sendDefaultPii:!1,integrations:i=>i.filter(s=>!T.has(s.name)),beforeSend:R}),t.setContext("cli",{version:c,node:process.version,platform:process.platform,arch:process.arch});let e=process.argv.slice(2);t.setContext("invocation",{command:y(e).join(" ")});let n=h(e);n&&t.setTag("command",n),a=!0}catch{a=!1}}function A(r,e={}){if(!a)return;let{category:n,command:i,crash:s,exitCode:d}=e;if(!(!s&&n&&!g.has(n)))try{t.captureException(r,o=>(o.setTag("crash",s===!0),n&&o.setTag("error.category",n),i&&o.setTag("command",i),d!==void 0&&o.setTag("exit_code",d),o))}catch{}}async function I(r=2e3){if(a)try{await t.flush(r)}catch{}}export{h as a,R as b,w as c,A as d,I as e};
@@ -1,3 +0,0 @@
1
- import{e as b}from"./chunk-UOX26MU3.js";import{a as _}from"./chunk-HCEAJ2BC.js";import{c as S,d as I,e as R}from"./chunk-K3ION5DP.js";import{h as A}from"./chunk-D7WXNA2O.js";import{b as E}from"./chunk-DV3LCXRH.js";import{a as L,b as H,c as x,d as g,e as h,f as j}from"./chunk-ABDWDZNK.js";import{Command as O,Option as N}from"commander";function y(e,o,n,t,r){let s=e[e.length-1],i=typeof s=="object"&&s!==null&&"args"in s?s.args:e.filter(l=>typeof l=="string");if(i.length===0)return i;let m=i[0],u=(o.commands??[]).filter(l=>v(l,[...n,l.name],r));if(!new Set(u.flatMap(l=>[l.name,...Array.isArray(l.alias)?l.alias:l.alias?[l.alias]:[]])).has(m)){let l=u.map(p=>p.name),d=n.length>0?`'${m}' for '${n.join(" ")}'`:`'${m}'`;console.error(`Unknown command ${d}.`),l.length>0&&console.error(`Available commands: ${l.join(", ")}`);let f=n.length>0?`${t.name} ${n.join(" ")} help`:`${t.name} help`;console.error(`
2
- Run "${f}" for usage.`),process.exit(1)}return i}function ee(){S();let e=!1,o=async t=>{e&&process.exit(1),e=!0,I(t,{crash:!0,exitCode:E(t).exitCode}),await R(),_(t,void 0,{skipCapture:!0})},n=()=>{console.error(`
3
- Operation cancelled`),process.exit(1)};process.on("unhandledRejection",t=>{D(t)&&n(),o(t)}),process.on("uncaughtException",t=>{D(t)&&n(),o(t)})}function D(e){return e===""||e===void 0?!0:typeof e=="object"&&e!==null&&e.code==="ERR_USE_AFTER_CLOSE"}function z(e){return/^[a-zA-Z0-9_-]+$/.test(e)}function v(e,o,n){return e.removed||n(o)?!0:e.commands?e.commands.some(t=>v(t,[...o,t.name],n)):!1}function W(e,o){let n=o?` Use ${o} instead.`:" See the changelog for migration guidance.";console.error(`${e} was removed in this version.${n}`),process.exit(1)}function G(e,o){if(e)for(let n of e){if(!n.removed)continue;C(o,n.name,e)!==void 0&&W(`--${n.name}`,n.replaced_by)}}function T(e,o){let n=o??[],t=new Set(n.map(i=>i.name)),r=new Set(n.filter(i=>i.alias).map(i=>i.alias)),s=e.filter(i=>!t.has(i.name)&&!(i.alias&&r.has(i.alias)));return[...n,...s]}function $(e){let o=e.alias&&typeof e.alias=="string"&&e.alias.length===1,n=e.alias&&typeof e.alias=="string"&&e.alias.length>1,t=o?`-${e.alias}, --${e.name}`:n?`--${e.alias}, --${e.name}`:`--${e.name}`;return e.type==="flag"?t:e.type==="boolean"?`${t} [value]`:e.options?`${t} <value>`:e.required||e["required-when"]?`${t} <value>`:`${t} [value]`}function q(e,o=[],n=[]){let t=s=>n.findIndex(i=>i.name===s.name);[...o.filter(s=>t(s)===-1),...o.filter(s=>t(s)!==-1).sort((s,i)=>t(s)-t(i))].forEach(s=>{if(s.type==="positional"){let i=s.required?`<${s.name}>`:`[${s.name}]`;e.argument(i,h(s))}else s.removed||s.hidden?e.addOption(new N($(s),s.description??"").hideHelp()):(n.length>0&&e.optionsGroup(t(s)===-1?L:H),e.option($(s),h(s),s.default))})}function K(e){return e.replace(/-([a-z])/g,(o,n)=>n.toUpperCase())}function C(e,o,n){if(n){let r=n.find(s=>s.name===o);if(r?.alias&&typeof r.alias=="string"){let s=r.alias.charAt(0).toUpperCase()+r.alias.slice(1);if(e[s]!==void 0)return e[s]}}let t=[o,o.replace(/-/g,""),o.replace(/-/g,"").toLowerCase(),o.charAt(0).toUpperCase(),K(o)];for(let r of t)if(e[r]!==void 0)return e[r]}function U(e,o){for(let n of e){if(n["required-when"]){let[t,r]=n["required-when"].split("="),s=C(o,t,e),i=C(o,n.name,e);if(s===r&&!i)return console.error(`--${n.name} is required when --${t} is ${r}`),!1}if(n.required&&!C(o,n.name,e))return console.error(`--${n.name} is required`),n.description&&console.error(` ${n.description}`),!1}return!0}function M(e,o,n){let t;"optsWithGlobals"in n&&typeof n.optsWithGlobals=="function"?t=n.optsWithGlobals():"opts"in n&&typeof n.opts=="function"?t=n.opts():t=n;let r={...t};return e.filter(i=>i.type==="positional").forEach((i,m)=>{o[m]!==void 0&&(i.multiple?r[i.name]=o[m].split(",").map(a=>a.trim()):r[i.name]=o[m])}),e.forEach(i=>{i.multiple&&i.type!=="positional"&&r[i.name]&&typeof r[i.name]=="string"&&(r[i.name]=r[i.name].split(",").map(m=>m.trim()))}),r}async function V(e,o,n=[],t={}){(t.json||t.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:r,error:s}=await e(o);(s||!r)&&(console.error(s),process.exit(1));let i=o[o.length-1],m=r.default||r[i];typeof m!="function"&&(console.error(`Command not implemented: ${o.join(" ")}`),process.exit(1)),b(o),await m({...t,_positional:n})}function F(e,o,n,t=[]){let{specs:r,loadModule:s,hasImplementation:i}=e,m=r.definitions?.global_arguments??[];for(let a of n){z(a.name)||(console.error(`Invalid command name "${a.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let u=[...t,a.name];if(!v(a,u,i))continue;let c=o.command(a.name,a.removed?{hidden:!0}:void 0).description(a.description??"").summary(a.helpText??"");if(a.group&&c.helpGroup(g(a.group)),x(c,{examples:a.examples,groups:a.groups,defaultCommand:a.default}),a.alias&&(Array.isArray(a.alias)?a.alias:[a.alias]).forEach(d=>{c.alias(d)}),a.removed){c.allowUnknownOption(!0),c.allowExcessArguments(!0),c.action(()=>{W(`${r.name} ${u.join(" ")}`,a.replaced_by)});continue}if(a.commands&&a.commands.length>0)if(F(e,c,a.commands,u),a.default){let l=a.commands.find(d=>d.name===a.default);if(l){let d=T(m,[...a.arguments||[],...l.arguments||[]]);q(c,d,m),c.allowExcessArguments(!0),c.action(async(...f)=>{let p=f.pop(),k=y([p],a,u,r,i),w=M(d,k,p);d.length>0&&!U(d,w)&&process.exit(1),G(d,w),l.deprecated&&l.messages?.onDeprecated&&A(l.messages.onDeprecated),await V(s,[...u,l.name],k,w)})}}else c.allowExcessArguments(!0),c.action((...l)=>{y(l,a,u,r,i),c.outputHelp()});else q(c,T(m,a.arguments),m),c.action(async(...l)=>{let d=l.pop(),f=l,p=M(a.arguments||[],f,d);a.arguments&&!U(a.arguments,p)&&process.exit(1),G(a.arguments,p),a.deprecated&&a.messages?.onDeprecated&&A(a.messages.onDeprecated),await V(s,u,f,p)});c.command("help",{hidden:!0}).action(()=>{c.outputHelp()})}}function ne(e){let{specs:o,version:n,hasImplementation:t}=e,r=new O;r.name(o.name).description(o.description).version(n,"-V, --version","Show the CLI version").helpOption("-h, --help","Show help").configureHelp(j),F(e,r,o.commands);let s=(o.definitions?.global_arguments??[]).filter(u=>!u.removed).map(u=>new N($(u),h(u)));x(r,{groups:o.groups,globalOptions:s});let i=o.groups?.[o.groups.length-1],m=r.command("help").description("Show general help").action(()=>{r.outputHelp()}),a=r.command("version").description("Show the CLI version").action(()=>{console.log(n)});return i&&(m.helpGroup(g(i)),a.helpGroup(g(i))),r.allowExcessArguments(!0),r.action((...u)=>{y(u,{commands:o.commands},[],o,t),r.outputHelp()}),r}export{ee as a,D as b,z as c,v as d,q as e,U as f,M as g,F as h,ne as i};
@@ -1,7 +0,0 @@
1
- import{a as p,b as a}from"./chunk-G4OJTPSI.js";import{e as c,f as I,h as _,i as g}from"./chunk-APJUJ6TW.js";import{a as r}from"./chunk-AQZXG57U.js";import{b as f}from"./chunk-BMWWPXMU.js";import{j as l,k as m}from"./chunk-QPUL2AAI.js";import{request as O}from"http";import{request as v}from"https";var E="/i/v0/e/",N=1e3;function y(){return process.env.TIGRIS_POSTHOG_KEY?.trim()||l}function R(){return process.env.TIGRIS_POSTHOG_HOST?.trim()||m}var C=["CI","CONTINUOUS_INTEGRATION","BUILD_NUMBER","GITHUB_ACTIONS","GITLAB_CI","CIRCLECI","TRAVIS","JENKINS_URL","BUILDKITE","TEAMCITY_VERSION","TF_BUILD"];function w(){return C.some(e=>{let t=process.env[e];return t!==void 0&&t!==""&&t!=="0"&&t.toLowerCase()!=="false"})}var k=/^[a-z0-9][a-z0-9-]*$/i;function M(e){let t=new Set;for(let o of e){if(o==="--")break;if(!o.startsWith("-")||o==="-")continue;let n=o.split("=")[0].replace(/^--?/,"");k.test(n)&&t.add(n)}return[...t].sort()}function b(e){try{let t=e.split(".")[1];if(!t)return;let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))?.email;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}async function h(){let e=I(),t={distinctId:e,anonymousId:e,isIdentified:!1,authMethod:"none"};try{let o=await import("./auth/storage.js"),n=await o.getTokens(),i=n?.idToken?b(n.idToken):void 0;return{distinctId:i??e,anonymousId:e,isIdentified:i!==void 0,authMethod:o.getLoginMethod()??"none",organizationId:o.getSelectedOrganization()??void 0}}catch{return t}}function T(){return{$lib:"tigris-cli",$lib_version:r,interface:"cli",cli_version:r,runtime:p()?"binary":"node",install_method:a(),node_version:process.version,os:process.platform,arch:process.arch,is_ci:w(),is_tty:process.stdout.isTTY===!0}}function S(e){return new Promise(t=>{let o=!1,n=()=>{o||(o=!0,t())};try{let i=new URL(E,R()),u=JSON.stringify(e),s=(i.protocol==="http:"?O:v)({protocol:i.protocol,hostname:i.hostname,port:i.port||void 0,path:i.pathname,method:"POST",timeout:N,headers:{"content-type":"application/json","content-length":Buffer.byteLength(u),"user-agent":`tigris-cli/${r}`}},d=>{d.resume(),d.on("end",n),d.on("error",n)});s.on("error",n),s.on("timeout",()=>{s.destroy(),n()}),s.end(u)}catch{n()}})}var L=`
2
- Tigris CLI collects usage analytics (which commands you run and their
3
- arguments, CLI version, OS) and error reports, to help us decide what to
4
- improve. Credentials \u2014 access keys, secrets, tokens \u2014 are never collected.
5
-
6
- Opt out any time: tigris telemetry disable (or set TIGRIS_NO_TELEMETRY=1)
7
- `,A=new Set(["telemetry"]);function G(){c()||process.stderr.isTTY!==!0||globalThis.__TIGRIS_JSON_MODE===!0||_()&&(console.error(L),g())}async function U(e){try{let t=y();if(!t||c())return;let o=await h(),n=process.argv.slice(2);await S({api_key:t,event:"cli_command",distinct_id:o.distinctId,properties:{...T(),command:e.join(" "),command_root:e[0],command_args:f(n).join(" "),flags:M(n),auth_method:o.authMethod,json_mode:globalThis.__TIGRIS_JSON_MODE===!0,$set:{cli_version:r,cli_install_method:a(),cli_last_os:process.platform},...o.organizationId?{$groups:{company:o.organizationId}}:{}}})}catch{}}function x(e){A.has(e[0])||(G(),U(e))}async function Y(){try{let e=y();if(!e||c())return;let t=await h();if(!t.isIdentified)return;await S({api_key:e,event:"$identify",distinct_id:t.distinctId,properties:{...T(),$anon_distinct_id:t.anonymousId,$set:{email:t.distinctId,cli_version:r,cli_install_method:a()},...t.organizationId?{$groups:{company:t.organizationId}}:{}}})}catch{}}export{w as a,M as b,b as c,U as d,x as e,Y as f};
File without changes