@tigrisdata/cli 2.15.0 → 2.16.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/client.js +1 -1
- package/dist/auth/fly.js +1 -1
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/{chunk-WIOXQDND.js → chunk-4ZHCF5D6.js} +1 -1
- package/dist/chunk-7TRUGAFK.js +4 -0
- package/dist/chunk-ALJKYIQL.js +5 -0
- package/dist/{chunk-CMGXGXVC.js → chunk-AU3RCZHB.js} +1 -1
- package/dist/{chunk-4RNEQIK4.js → chunk-EYGRHNNY.js} +1 -1
- package/dist/chunk-GAWFFIPC.js +4 -0
- package/dist/chunk-IRDNZN7R.js +7 -0
- package/dist/chunk-KK7FZ7QM.js +1 -0
- package/dist/{chunk-ZHAJEGAB.js → chunk-LVAJB4FR.js} +1 -1
- package/dist/chunk-OHGCOC5Q.js +1 -0
- package/dist/chunk-PG746YF3.js +3 -0
- package/dist/{chunk-S33FT7Z7.js → chunk-TRRXHLUE.js} +1 -1
- package/dist/{chunk-3FMWZQ3C.js → chunk-VAVMX5DC.js} +1 -1
- package/dist/chunk-YFMOI263.js +1 -0
- package/dist/chunk-YYVLDLPP.js +8 -0
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -1
- package/dist/lib/access-keys/create.js +1 -1
- package/dist/lib/access-keys/delete.js +1 -1
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list.js +1 -1
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/list.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-transition.js +1 -1
- package/dist/lib/buckets/set-ttl.js +1 -1
- package/dist/lib/buckets/set.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/forks/create.js +1 -1
- package/dist/lib/forks/list.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/list.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/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.js +1 -1
- package/dist/lib/objects/put.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 +2 -2
- package/dist/lib/rm.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/touch.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/whoami.js +2 -2
- package/dist/specs.yaml +20 -0
- package/dist/utils/bucket-info.js +1 -1
- package/dist/utils/exit.js +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/messages.js +1 -1
- package/dist/utils/options.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +6 -9
- package/dist/chunk-552FMFE5.js +0 -5
- package/dist/chunk-5VDFQRGP.js +0 -2
- package/dist/chunk-7RGWTDUP.js +0 -1
- package/dist/chunk-AEADROU6.js +0 -4
- package/dist/chunk-AHGPPFCQ.js +0 -1
- package/dist/chunk-BC2HK4K6.js +0 -1
- package/dist/chunk-CQCBYE3X.js +0 -6
- package/dist/chunk-JVQ7GLJH.js +0 -4
- package/dist/chunk-KCWQ4II7.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"../../../chunk-
|
|
1
|
+
import{a as h}from"../../../chunk-LVAJB4FR.js";import{f as v}from"../../../chunk-IRDNZN7R.js";import"../../../chunk-ALJKYIQL.js";import{a as p,b as y}from"../../../chunk-YFMOI263.js";import{b as n}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as m,c as s,e as g,j as d}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import $ from"enquirer";import{getPolicy as w,listPolicies as I}from"@tigrisdata/iam";var{prompt:D}=$,t=d("iam policies","get");async function C(c){m(t);let r=p(c,["resource"]),l=y(c),a=await h(t);if(!r){let{data:o,error:u}=await I({config:a});if(u&&n(t,u),!o.policies||o.policies.length===0){g(t);return}let{selected:O}=await D({type:"select",name:"selected",message:"Select a policy:",choices:o.policies.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});r=O}let{data:e,error:f}=await w(r,{config:a});if(f&&n(t,f),l==="json"){console.log(JSON.stringify(e,null,2)),s(t);return}let S=[{field:"Name",value:e.name},{field:"ID",value:e.id},{field:"Resource",value:e.resource},{field:"Description",value:e.description||"-"},{field:"Path",value:e.path},{field:"Version",value:e.defaultVersionId},{field:"Attachments",value:String(e.attachmentCount)},{field:"Created",value:e.createDate.toISOString()},{field:"Updated",value:e.updateDate.toISOString()}],A=v(S,l,"policy","field",[{key:"field",header:"Field"},{key:"value",header:"Value"}]);if(console.log(A),e.users&&e.users.length>0){console.log("Attached Users:");for(let o of e.users)console.log(` - ${o}`);console.log()}console.log("Policy Document:"),console.log(` Version: ${e.document.version}`),console.log(" Statements:");for(let o of e.document.statements)console.log(` - Effect: ${o.effect}`),console.log(` Action: ${Array.isArray(o.action)?o.action.join(", "):o.action}`),console.log(` Resource: ${Array.isArray(o.resource)?o.resource.join(", "):o.resource}`);s(t)}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as x}from"../../../chunk-LVAJB4FR.js";import{f as C,g as D}from"../../../chunk-IRDNZN7R.js";import"../../../chunk-ALJKYIQL.js";import{b as y,c as P}from"../../../chunk-YFMOI263.js";import{b as T}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as g,c as f,e as l,i as h,j as k}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import{listPolicies as I}from"@tigrisdata/iam";var e=k("iam policies","list");async function O(r){g(e);let i=y(r),{limit:s,pageToken:c,isPaginated:d}=P(r),o=await x(e),{data:n,error:m}=await I({...s!==void 0?{limit:s}:{},...c?{paginationToken:c}:{},config:{sessionToken:o.sessionToken,organizationId:o.organizationId,iamEndpoint:o.iamEndpoint}});if(m&&T(e,m),!n.policies||n.policies.length===0){l(e);return}let a=n.policies.map(t=>({name:t.name,id:t.id,resource:t.resource,description:t.description||"-",attachments:t.attachmentCount,created:t.createDate,updated:t.updateDate})),p=[{key:"id",header:"ID"},{key:"resource",header:"Resource"},{key:"name",header:"Name"},{key:"description",header:"Description"},{key:"attachments",header:"Attachments"},{key:"created",header:"Created"},{key:"updated",header:"Updated"}],u=n.paginationToken||void 0,E=d?D(a,i,"policies","policy",p,{paginationToken:u}):C(a,i,"policies","policy",p);console.log(E),d&&i!=="json"&&i!=="xml"&&h(u),f(e,{count:a.length})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"../../../chunk-
|
|
1
|
+
import{a as u}from"../../../chunk-LVAJB4FR.js";import"../../../chunk-ALJKYIQL.js";import{a as s,b as p}from"../../../chunk-YFMOI263.js";import{b as n}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as l,c,j as f}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import{a as g}from"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import{inviteUser as b}from"@tigrisdata/iam";var i=f("iam users","invite");async function j(e){l(i);let d=p(e);if(g("User management"))return;let o=s(e,["email"]),r=s(e,["role","r"])??"member",t=Array.isArray(o)?o:o?[o]:[];t.length===0&&n(i,"Email address is required");let a=["admin","member"];a.includes(r)||n(i,`Invalid role "${r}". Must be one of: ${a.join(", ")}`);let v=r,y=await u(i),R=t.map(O=>({email:O,role:v})),{error:m}=await b(R,{config:y});m&&n(i,m),d==="json"&&console.log(JSON.stringify({action:"invited",email:t.join(", ")})),c(i,{email:t.join(", ")})}export{j as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p}from"../../../chunk-
|
|
1
|
+
import{a as p}from"../../../chunk-LVAJB4FR.js";import{b as y,d as i,e as a}from"../../../chunk-IRDNZN7R.js";import"../../../chunk-ALJKYIQL.js";import{b as h}from"../../../chunk-YFMOI263.js";import{b as d}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as m,c as g,e as c,j as u}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import{a as f}from"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import{listUsers as v}from"@tigrisdata/iam";var n=u("iam users","list");async function w(k){m(n);let r=h(k);if(f("User management"))return;let C=await p(n),{data:l,error:s}=await v({config:C});s&&d(n,s);let o=l.users.map(e=>({email:e.email,name:e.userName||"-",role:e.isOrgOwner?"owner":e.role,userId:e.userId})),t=l.invitations.map(e=>({id:e.id,email:e.email,role:e.role,status:e.status,validUntil:e.validUntil.toLocaleDateString()}));if(o.length===0&&t.length===0){c(n);return}let I=[{key:"email",header:"Email"},{key:"name",header:"Name"},{key:"role",header:"Role"},{key:"userId",header:"User ID"}],U=[{key:"id",header:"ID"},{key:"email",header:"Email"},{key:"role",header:"Role"},{key:"status",header:"Status"},{key:"validUntil",header:"Valid Until"}];if(r==="json")console.log(y({users:o,invitations:t}));else if(r==="xml"){let e=["<organization>"];e.push(" "+i(o,"users","user").replace(/\n/g,`
|
|
2
2
|
`)),e.push(" "+i(t,"invitations","invitation").replace(/\n/g,`
|
|
3
3
|
`)),e.push("</organization>"),console.log(e.join(`
|
|
4
4
|
`))}else o.length>0&&(console.log(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"../../../chunk-
|
|
1
|
+
import{a as O}from"../../../chunk-LVAJB4FR.js";import{a,b as v}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-ALJKYIQL.js";import{a as m,b as w}from"../../../chunk-YFMOI263.js";import{b as n}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as l,c as u,e as p,j as d}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import{a as y}from"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import I from"enquirer";import{listUsers as E,removeUser as F}from"@tigrisdata/iam";var{prompt:S}=I,e=d("iam users","remove");async function $(s){l(e);let h=w(s),t=m(s,["resource"]),U=m(s,["yes","y","force"]);if(y("User management"))return;let c=await O(e),r=Array.isArray(t)?t:t?[t]:[];if(r.length===0){let{data:i,error:g}=await E({config:c});if(g&&n(e,g),i.users.length===0){p(e);return}a("Provide user ID(s) as a positional argument");let{selected:A}=await S({type:"multiselect",name:"selected",message:"Select user(s) to remove (space to select, enter to confirm):",choices:i.users.map(o=>({name:o.userId,message:`${o.email} (${o.isOrgOwner?"owner":o.role})`}))});r=A}if(!U&&(a("Use --yes to skip confirmation"),!await v(`Remove ${r.length} user(s)?`))){console.log("Aborted");return}let{error:f}=await F(r,{config:c});f&&n(e,f),h==="json"&&console.log(JSON.stringify({action:"removed",users:r})),u(e)}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"../../../chunk-
|
|
1
|
+
import{a as h}from"../../../chunk-LVAJB4FR.js";import{a,b as y}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-ALJKYIQL.js";import{a as c,b as k}from"../../../chunk-YFMOI263.js";import{b as s}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as g,c as p,e as u,j as v}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import{a as d}from"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import O from"enquirer";import{listUsers as $,revokeInvitation as E}from"@tigrisdata/iam";var{prompt:S}=O,t=v("iam users","revoke-invitation");async function U(r){g(t);let w=k(r),o=c(r,["resource"]),I=c(r,["yes","y","force"]);if(d("User management"))return;let m=await h(t),e=Array.isArray(o)?o:o?[o]:[];if(e.length===0){let{data:n,error:l}=await $({config:m});if(l&&s(t,l),n.invitations.length===0){u(t);return}a("Provide invitation ID(s) as a positional argument");let{selected:A}=await S({type:"multiselect",name:"selected",message:"Select invitation(s) to revoke (space to select, enter to confirm):",choices:n.invitations.map(i=>({name:i.id,message:`${i.email} (${i.role} - ${i.status})`}))});e=A}if(!I&&(a("Use --yes to skip confirmation"),!await y(`Revoke ${e.length} invitation(s)?`))){console.log("Aborted");return}let{error:f}=await E(e,{config:m});f&&s(t,f),w==="json"&&console.log(JSON.stringify({action:"revoked",invitations:e})),p(t)}export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"../../../chunk-
|
|
1
|
+
import{a as v}from"../../../chunk-LVAJB4FR.js";import{a as w}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-ALJKYIQL.js";import{a as c,b}from"../../../chunk-YFMOI263.js";import{b as o}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as d,c as h,e as y,j as R}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import{a as O}from"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import I from"enquirer";import{listUsers as S,updateUserRole as q}from"@tigrisdata/iam";var{prompt:U}=I,e=R("iam users","update-role");async function E(m){d(e);let A=b(m);if(O("User management"))return;let f=["admin","member"],i=c(m,["role","r"]);i||o(e,"Role is required. Use --role admin or --role member");let r=Array.isArray(i)?i:[i];for(let t of r)f.includes(t)||o(e,`Invalid role "${t}". Must be one of: ${f.join(", ")}`);let n=c(m,["resource"]),s=Array.isArray(n)?n:n?[n]:[],u=await v(e);if(s.length===0){let{data:t,error:a}=await S({config:u});if(a&&o(e,a),t.users.length===0){y(e);return}w("Provide user ID(s) as a positional argument");let{selected:$}=await U({type:"multiselect",name:"selected",message:"Select user(s) to update (space to select, enter to confirm):",choices:t.users.map(l=>({name:l.userId,message:`${l.email} (${l.isOrgOwner?"owner":l.role})`}))});s=$}r.length>1&&r.length!==s.length&&o(e,`Number of roles (${r.length}) must match number of users (${s.length}), or provide a single role for all users`);let g=s.map((t,a)=>({userId:t,role:r.length===1?r[0]:r[a]})),{error:p}=await q(g,{config:u});p&&o(e,p),A==="json"&&console.log(JSON.stringify({action:"updated",users:g})),h(e)}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-EYGRHNNY.js";import"../../chunk-S77OAN6Y.js";import"../../chunk-ALJKYIQL.js";import"../../chunk-YFMOI263.js";import"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";export{a as default};
|
package/dist/lib/login/oauth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-7TRUGAFK.js";import"../../chunk-YFMOI263.js";import"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";export{b as default,a as oauth};
|
package/dist/lib/login/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"../../chunk-
|
|
1
|
+
import{a as r}from"../../chunk-7TRUGAFK.js";import{a as c}from"../../chunk-EYGRHNNY.js";import{a as s}from"../../chunk-S77OAN6Y.js";import"../../chunk-ALJKYIQL.js";import"../../chunk-YFMOI263.js";import"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import i from"enquirer";var{prompt:n}=i;async function u(e){let a=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,t=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(a||t){await c(e);return}s('Use "tigris login oauth" or "tigris login credentials --access-key ... --access-secret ..."');let{method:m}=await n({type:"select",name:"method",message:"Choose login method:",choices:[{name:"user",message:"As a user (OAuth2 flow)"},{name:"machine",message:"As a machine (Access Key & Secret)"}]});m==="user"?await r():await c(e)}export{u as default};
|
package/dist/lib/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"../chunk-
|
|
1
|
+
import{b as c}from"../chunk-YFMOI263.js";import{b as n}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{b as t,c as r,j as i}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import{t as a}from"../chunk-OHGCOC5Q.js";var o=i("logout");async function f(m={}){t(o);let e=c(m);try{await a(),e==="json"&&console.log(JSON.stringify({action:"logged_out"})),r(o)}catch(s){n(o,s)}}export{f as default};
|
package/dist/lib/ls.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,f as m}from"../chunk-
|
|
1
|
+
import{a as b,f as m}from"../chunk-IRDNZN7R.js";import{f as w}from"../chunk-JQUG732D.js";import{d as f}from"../chunk-ALJKYIQL.js";import{a as d,b as y}from"../chunk-YFMOI263.js";import{a}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{list as O,listBuckets as W}from"@tigrisdata/storage";async function v(i){let p=d(i,["path"]),h=d(i,["snapshot-version","snapshotVersion","snapshot"]),l=y(i);if(!p){let e=await f(),{data:t,error:o}=await W({config:e});o&&a(o);let n=(t.buckets||[]).map(g=>({name:g.name,created:g.creationDate})),c=m(n,l,"buckets","bucket",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(c);return}let{bucket:u,path:s}=w(p);u||a("Invalid path");let x=await f(),r=s?s.endsWith("/")?s:`${s}/`:void 0,{data:z,error:k}=await O({prefix:r,...h?{snapshotVersion:h}:{},config:{...x,bucket:u}});k&&a(k);let S=(z.items||[]).map(e=>{let t=r?e.name.slice(r.length):e.name,o=t.indexOf("/"),n=o===-1?t:t.slice(0,o+1),c=n.endsWith("/");return{key:n,size:c?"-":b(e.size),modified:e.lastModified}}).filter((e,t,o)=>e.key!==""&&o.findIndex(n=>n.key===e.key)===t),j=m(S,l,"objects","object",[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}]);console.log(j)}export{v as default};
|
package/dist/lib/mk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as S}from"../chunk-TD2HGNDY.js";import"../chunk-S77OAN6Y.js";import{f as b}from"../chunk-JQUG732D.js";import{
|
|
1
|
+
import{b as S}from"../chunk-TD2HGNDY.js";import"../chunk-S77OAN6Y.js";import{f as b}from"../chunk-JQUG732D.js";import{d as m}from"../chunk-ALJKYIQL.js";import{a as t,b as h}from"../chunk-YFMOI263.js";import{a as o}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{createBucket as C,put as O}from"@tigrisdata/storage";async function T(e){let f=t(e,["path"]);f||o("path argument is required");let{bucket:s,path:n}=b(f);s||o("Invalid path");let u=await m(),d=h(e);if(n){let r=n.endsWith("/")?n:`${n}/`,{error:a}=await O(r,"",{config:{...u,bucket:s}});a&&o(a),console.log(d==="json"?JSON.stringify({action:"created",type:"folder",bucket:s,path:r}):`Folder '${s}/${r}' created`),process.exit(0)}else{let a=t(e,["public"])?"public":t(e,["access","a","A"]),k=t(e,["enableSnapshots","enable-snapshots","s","S"]),w=t(e,["defaultTier","default-tier","t","T"]),c=t(e,["locations","l","L"]),i=t(e,["fork-of","forkOf","fork"]),l=t(e,["source-snapshot","sourceSnapshot","source-snap"]),g=t(e,["region","r","R"]),y=t(e,["consistency","c","C"]);g!==void 0&&(console.warn("Warning: --region is deprecated, use --locations instead. See https://www.tigrisdata.com/docs/buckets/locations/"),c===void 0&&(c=g)),y!==void 0&&console.warn("Warning: --consistency is deprecated, use --locations instead. See https://www.tigrisdata.com/docs/buckets/locations/"),l&&!i&&o("--source-snapshot requires --fork-of");let{error:p}=await C(s,{defaultTier:w??"STANDARD",enableSnapshot:k===!0,access:a??"private",locations:S(c??"global"),...i?{sourceBucketName:i}:{},...l?{sourceBucketSnapshot:l}:{},config:u});p&&o(p),console.log(d==="json"?JSON.stringify({action:"created",type:"bucket",name:s}):`Bucket '${s}' created`),process.exit(0)}}export{T as default};
|
package/dist/lib/mv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J}from"../chunk-EKW6XTGL.js";import{a as y}from"../chunk-
|
|
1
|
+
import{a as J}from"../chunk-EKW6XTGL.js";import{a as y}from"../chunk-IRDNZN7R.js";import{a as x,b as E}from"../chunk-S77OAN6Y.js";import{a as j,b as R,d as A,g as U,h as D,j as z}from"../chunk-JQUG732D.js";import{d as T}from"../chunk-ALJKYIQL.js";import{a as w,b as O}from"../chunk-YFMOI263.js";import{a as n}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{get as L,head as Q,list as V,put as q,remove as I}from"@tigrisdata/storage";var d=!1;async function X(s){let c=w(s,["src"]),l=w(s,["dest"]),h=w(s,["yes","y","force","f"]),g=!!w(s,["recursive","r"]);d=O(s)==="json",(!c||!l)&&n("both src and dest arguments are required"),(!j(c)||!j(l))&&n("Both src and dest must be remote Tigris paths (t3:// or tigris://)");let e=R(c),t=R(l);e.bucket||n("Invalid source path"),t.bucket||n("Invalid destination path");let P=c.endsWith("/");!e.path&&!P&&n("Cannot move a bucket. Provide a path within the bucket.");let a=await T({withCredentialProvider:!0}),f=e.path.includes("*"),m=e.path.endsWith("/")||!e.path&&P;if(!f&&!m&&e.path&&(m=await A(e.bucket,e.path,a)),m&&!f&&!g&&n("Source is a remote folder (not moved). Use -r to move recursively."),f||m){let r=f?D(e.path):e.path?e.path.endsWith("/")?e.path:`${e.path}/`:"",i=!f&&e.path&&!e.path.endsWith("/")?e.path.split("/").filter(Boolean).pop()??"":"",u=[t.path?.replace(/\/$/,"")||"",i].filter(Boolean).join("/"),B=u?`${u}/`:"";e.bucket===t.bucket&&r===B&&n("Source and destination are the same");let{items:_,error:N}=await z(e.bucket,r||void 0,a);N&&n(N);let b=_.filter(o=>o.name!==r);if(f){let o=e.path.split("/").pop(),p=U(o);b=b.filter(v=>{let $=r?v.name.slice(r.length):v.name;return!g&&$.includes("/")?!1:p.test($.split("/").pop())})}let{data:G}=await V({prefix:r,limit:1,config:{...a,bucket:e.bucket}}),F=r?G?.items?.some(o=>o.name===r):!1;if(b.length===0&&!F){console.log(d?JSON.stringify({action:"moved",count:0}):"No objects to move");return}let H=b.length+(F?1:0);if(!h&&(x("Use --yes to skip confirmation"),!await E(`Are you sure you want to move ${H} object(s)?`))){d||console.log("Aborted");return}let k=0;for(let o of b){let p=r?o.name.slice(r.length):o.name,v=u?`${u}/${p}`:p,$=await C(a,e.bucket,o.name,t.bucket,v);$.error?console.error(`Failed to move ${o.name}: ${$.error}`):(d||console.log(`Moved t3://${e.bucket}/${o.name} -> t3://${t.bucket}/${v}`),k++)}let W=!1;if(F)if(u){let o=`${u}/`,p=await C(a,e.bucket,r,t.bucket,o);p.error?console.error(`Failed to move folder marker: ${p.error}`):W=!0}else{let{error:o}=await I(r,{config:{...a,bucket:e.bucket}});o?console.error(`Failed to remove source folder marker: ${o.message}`):W=!0}k===0&&W&&(k=1),console.log(d?JSON.stringify({action:"moved",count:k}):`Moved ${k} object(s)`)}else{let r=e.path.split("/").pop(),i;if(t.path?t.path.endsWith("/")?i=`${t.path}${r}`:await A(t.bucket,t.path,a)?i=`${t.path}/${r}`:i=t.path:i=r,e.bucket===t.bucket&&e.path===i&&n("Source and destination are the same"),!h&&(x("Use --yes to skip confirmation"),!await E(`Are you sure you want to move 't3://${e.bucket}/${e.path}'?`))){d||console.log("Aborted");return}let S=await C(a,e.bucket,e.path,t.bucket,i,!d);S.error&&n(S.error),console.log(d?JSON.stringify({action:"moved",count:1,src:`t3://${e.bucket}/${e.path}`,dest:`t3://${t.bucket}/${i}`}):`Moved t3://${e.bucket}/${e.path} -> t3://${t.bucket}/${i}`)}process.exit(0)}async function C(s,c,l,h,g,M=!1){if(l.endsWith("/")){let{error:r}=await q(g,"",{config:{...s,bucket:h}});if(r)return{error:r.message};let{error:i}=await I(l,{config:{...s,bucket:c}});return i?{error:`Copied but failed to delete source: ${i.message}`}:{}}let{data:e}=await Q(l,{config:{...s,bucket:c}}),t=e?.size,{data:P,error:a}=await L(l,"stream",{config:{...s,bucket:c}});if(a)return{error:a.message};let{error:f}=await q(g,P,{...J(t),onUploadProgress:M?({loaded:r})=>{if(t!==void 0&&t>0){let i=Math.round(r/t*100);process.stdout.write(`\rMoving: ${y(r)} / ${y(t)} (${i}%)`)}else process.stdout.write(`\rMoving: ${y(r)}`)}:void 0,config:{...s,bucket:h}});if(M&&process.stdout.write("\r"+" ".repeat(60)+"\r"),f)return{error:f.message};let{error:m}=await I(l,{config:{...s,bucket:c}});return m?{error:`Copied but failed to delete source: ${m.message}`}:{}}export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as j}from"../../chunk-S77OAN6Y.js";import{i as w}from"../../chunk-JQUG732D.js";import{
|
|
1
|
+
import{a as h,b as j}from"../../chunk-S77OAN6Y.js";import{i as w}from"../../chunk-JQUG732D.js";import{d as O}from"../../chunk-ALJKYIQL.js";import{a as c,b as x}from"../../chunk-YFMOI263.js";import{a as p,b as f,c as b,d as A}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as l,c as d,d as k,j as y}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{remove as E}from"@tigrisdata/storage";var t=y("objects","delete");async function F(n){l(t);let S=x(n),g=c(n,["bucket"]),v=c(n,["key"]),q=c(n,["yes","y","force"]);g||f(t,"Bucket name or path is required");let m=w(g),o=m.bucket,s=v||m.key||void 0;s||f(t,"Object key is required");let N=await O(),a=Array.isArray(s)?s:[s];if(!q&&(h("Use --yes to skip confirmation"),!await j(`Delete ${a.length} object(s) from '${o}'?`))){console.log("Aborted");return}let u=[],i=[];for(let e of a){let{error:r}=await E(e,{config:{...N,bucket:o}});r?(k(t,r.message,{key:e}),i.push({key:e,error:r.message})):(u.push(e),d(t,{key:e}))}if(S==="json"){let e=b(t,{bucket:o}),r={action:"deleted",bucket:o,keys:u,errors:i};e.length>0&&(r.nextActions=e),console.log(JSON.stringify(r))}i.length>0&&p(i[0].error,t),A(t,{bucket:o})}export{F as default};
|
package/dist/lib/objects/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as k}from"../../chunk-JQUG732D.js";import{
|
|
1
|
+
import{i as k}from"../../chunk-JQUG732D.js";import{d as j}from"../../chunk-ALJKYIQL.js";import{a as r,b}from"../../chunk-YFMOI263.js";import{b as c}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as h,c as a,j as u}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{get as w}from"@tigrisdata/storage";import{createWriteStream as v,writeFileSync as q}from"fs";import{extname as T}from"path";import{Readable as S}from"stream";import{pipeline as x}from"stream/promises";var e=u("objects","get"),C=new Set([".js",".ts",".jsx",".tsx",".mjs",".cjs",".py",".rb",".php",".java",".go",".rs",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".scala",".clj",".ex",".exs",".erl",".sh",".bash",".zsh",".fish",".ps1",".bat",".cmd",".sql",".graphql",".gql",".json",".yaml",".yml",".toml",".ini",".cfg",".conf",".xml",".plist",".env",".properties",".html",".htm",".css",".scss",".sass",".less",".styl",".md",".markdown",".mdx",".rst",".txt",".text",".csv",".tsv",".log",".ejs",".hbs",".pug",".jade",".njk",".twig",".liquid",".svg",".gitignore",".dockerignore",".editorconfig"]);function E(s,m){let l=T(m||s).toLowerCase();return C.has(l)?"string":"stream"}async function F(s){h(e);let m=b(s),p=r(s,["bucket"]),l=r(s,["key"]),t=r(s,["output","o","O"]),y=r(s,["mode","m","M"]),g=r(s,["snapshot-version","snapshotVersion","snapshot"]);p||c(e,"Bucket name or path is required");let{bucket:f,key:o}=k(p,l);o||c(e,"Object key is required");let d=await j();if((y||E(o,t))==="stream"){let{data:i,error:n}=await w(o,"stream",{...g?{snapshotVersion:g}:{},config:{...d,bucket:f}});if(n&&c(e,n),t){let O=v(t);await x(S.fromWeb(i),O),a(e,{key:o,output:t}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:f,key:o,output:t}))}else await x(S.fromWeb(i),process.stdout),a(e)}else{let{data:i,error:n}=await w(o,"string",{...g?{snapshotVersion:g}:{},config:{...d,bucket:f}});n&&c(e,n),t?(q(t,i),a(e,{key:o,output:t}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:f,key:o,output:t}))):(console.log(i),a(e))}}export{F as default};
|
package/dist/lib/objects/info.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,f as h}from"../../chunk-
|
|
1
|
+
import{a as d,f as h}from"../../chunk-IRDNZN7R.js";import{i as k}from"../../chunk-JQUG732D.js";import{d as l}from"../../chunk-ALJKYIQL.js";import{a as i,b as g}from"../../chunk-YFMOI263.js";import{b as o}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as u,j as p}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{head as O}from"@tigrisdata/storage";var e=p("objects","info");async function A(r){m(e);let b=g(r),c=i(r,["bucket"]),v=i(r,["key"]),s=i(r,["snapshot-version","snapshotVersion","snapshot"]);c||o(e,"Bucket name or path is required");let{bucket:a,key:n}=k(c,v);n||o(e,"Object key is required");let y=await l(),{data:t,error:f}=await O(n,{...s?{snapshotVersion:s}:{},config:{...y,bucket:a}});f&&o(e,f),t||o(e,"Object not found");let S=[{metric:"Path",value:t.path},{metric:"Size",value:d(t.size)},{metric:"Content-Type",value:t.contentType||"N/A"},{metric:"Content-Disposition",value:t.contentDisposition||"N/A"},{metric:"Modified",value:t.modified.toISOString()},{metric:"URL",value:t.url}],j=h(S,b,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(j),u(e,{bucket:a,key:n})}export{A as default};
|
package/dist/lib/objects/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as S,f as T,g as w}from"../../chunk-IRDNZN7R.js";import{f as A}from"../../chunk-JQUG732D.js";import{d as O}from"../../chunk-ALJKYIQL.js";import{a as i,b as P,c as z}from"../../chunk-YFMOI263.js";import{b as a}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as h,c as b,e as y,i as j,j as x}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{list as v}from"@tigrisdata/storage";var e=x("objects","list");async function B(t){h(e);let c=i(t,["bucket"]),E=i(t,["prefix","p","P"]),n=P(t),f=i(t,["snapshot-version","snapshotVersion","snapshot"]),{limit:m,pageToken:p,isPaginated:g}=z(t);c||a(e,"Bucket name is required");let d=A(c),F=d.bucket,M=E||d.path||void 0,V=await O(),{data:o,error:u}=await v({prefix:M,...f?{snapshotVersion:f}:{},...m!==void 0?{limit:m}:{},...p?{paginationToken:p}:{},config:{...V,bucket:F}});if(u&&a(e,u),!o.items||o.items.length===0){y(e);return}let r=o.items.map(s=>({key:s.name,size:S(s.size),modified:s.lastModified})),k=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],l=o.paginationToken||void 0,q=g?w(r,n,"objects","object",k,{paginationToken:l}):T(r,n,"objects","object",k);console.log(q),g&&n!=="json"&&n!=="xml"&&j(l),b(e,{count:r.length})}export{B as default};
|
package/dist/lib/objects/put.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R}from"../../chunk-EKW6XTGL.js";import{a,f as j}from"../../chunk-
|
|
1
|
+
import{a as R}from"../../chunk-EKW6XTGL.js";import{a,f as j}from"../../chunk-IRDNZN7R.js";import{i as A}from"../../chunk-JQUG732D.js";import{d as w}from"../../chunk-ALJKYIQL.js";import{a as s,b as T}from"../../chunk-YFMOI263.js";import{b as i,d as z}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as S,j as h}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{put as W}from"@tigrisdata/storage";import{createReadStream as B,statSync as E}from"fs";import{Readable as v}from"stream";var t=h("objects","put");async function M(e){k(t);let u=s(e,["bucket"]),l=s(e,["key"]),g=s(e,["file"]),O=s(e,["access","a","A"],"private"),P=s(e,["content-type","contentType","t","T"]),$=T(e);u||i(t,"Bucket name or path is required");let d=A(u),m=d.bucket,n=d.key||l,r=d.key&&l||g;n||i(t,"Object key is required");let q=!process.stdin.isTTY;!r&&!q&&i(t,"File path is required (or pipe data via stdin)");let f,o;if(r){try{o=E(r).size}catch{i(t,`File not found: ${r}`)}let p=B(r);f=v.toWeb(p)}else f=v.toWeb(process.stdin);let U=await w({withCredentialProvider:!0}),x=r?R(o):{multipart:!0,partSize:5*1024*1024,queueSize:8},{data:c,error:b}=await W(n,f,{access:O==="public"?"public":"private",contentType:P,...x,onUploadProgress:({loaded:p,percentage:y})=>{o!==void 0&&o>0?process.stdout.write(`\rUploading: ${a(p)} / ${a(o)} (${y}%)`):process.stdout.write(`\rUploading: ${a(p)}`)},config:{...U,bucket:m}});process.stdout.write("\r"+" ".repeat(60)+"\r"),b&&i(t,b);let C=[{path:c.path,size:a(c.size??o??0),contentType:c.contentType||"-",modified:c.modified}],F=j(C,$,"objects","object",[{key:"path",header:"Path"},{key:"size",header:"Size"},{key:"contentType",header:"Content-Type"},{key:"modified",header:"Modified"}]);console.log(F),S(t,{key:n,bucket:m}),z(t,{key:n,bucket:m})}export{M as default};
|
package/dist/lib/objects/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as k}from"../../chunk-JQUG732D.js";import{
|
|
1
|
+
import{i as k}from"../../chunk-JQUG732D.js";import{d as b}from"../../chunk-ALJKYIQL.js";import{a as c,b as p}from"../../chunk-YFMOI263.js";import{b as r}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as g,c as m,j as u}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{updateObject as j}from"@tigrisdata/storage";var e=u("objects","set");async function w(t){g(e);let l=p(t),a=c(t,["bucket"]),y=c(t,["key"]),s=c(t,["access","a","A"]),i=c(t,["new-key","n","newKey"]);a||r(e,"Bucket name or path is required");let{bucket:n,key:o}=k(a,y);o||r(e,"Object key is required"),s||r(e,"Access level is required (--access public|private)");let d=await b(),{error:f}=await j(o,{access:s==="public"?"public":"private",...i&&{key:i},config:{...d,bucket:n}});f&&r(e,f),l==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,key:o,access:s,...i?{newKey:i}:{}})),m(e,{key:o,bucket:n})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as O,f as d}from"../../chunk-ALJKYIQL.js";import{a as p,b as u}from"../../chunk-YFMOI263.js";import{b as i,d as m}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as e,c,g as f,j as g}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import{a as s}from"../../chunk-GAWFFIPC.js";import"../../chunk-OHGCOC5Q.js";import{createOrganization as w}from"@tigrisdata/iam";var r=g("organizations","create");async function x(n){if(e(r),d("Organization creation")||s("Organization creation"))return;let t=p(n,["name","N"]);t||i(r,"Organization name is required");let z=await O(),l=u(n),{data:S,error:o}=await w(t,{config:z});o&&i(r,o);let a=S.id;l==="json"&&console.log(JSON.stringify({action:"created",name:t,id:a})),c(r,{name:t,id:a}),f(r,{name:t}),m(r,{name:t})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as q}from"../../chunk-
|
|
1
|
+
import{f as q}from"../../chunk-IRDNZN7R.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{d as k,f as I}from"../../chunk-ALJKYIQL.js";import{b as S}from"../../chunk-YFMOI263.js";import{b as h}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as r,e as p,j as u}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import{c as w}from"../../chunk-KK7FZ7QM.js";import{h as z,i as O}from"../../chunk-OHGCOC5Q.js";import{listOrganizations as F}from"@tigrisdata/iam";import U from"enquirer";var i=u("organizations","list");async function $(x){if(f(i),I("Organization listing and selection"))return;let s=S(x,"select"),c=w(),e;if(await c.isFlyUser())e=await c.fetchOrganizationsFromUserInfo()??[];else{let n=await k(),{data:g,error:a}=await F({config:n});a&&h(i,a),e=g?.organizations??[]}if(e.length===0){p(i);return}let o=O();if(s==="select"){let n=e.map(t=>({name:t.id,message:`${t.name} (${t.id})`,hint:t.id===o?"currently selected":void 0}));y("Use --format table or --format json");let l=(await U.prompt({type:"select",name:"organization",message:"Select an organization:",choices:n.map(t=>t.message),initial:o?e.findIndex(t=>t.id===o):0})).organization.match(/\(([^)]+)\)$/),d=l?l[1]:e[0].id;await z(d);let E=e.find(t=>t.id===d);r(i,{name:E?.name});return}let m=e.map(n=>({id:n.id,name:n.name,slug:n.slug,selected:n.id===o?"*":""})),C=q(m,s,"organizations","organization",[{key:"selected",header:" ",width:1},{key:"id",header:"ID"},{key:"name",header:"Name"},{key:"slug",header:"Slug"}]);console.log(C),r(i,{count:m.length})}export{$ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as S,f as $}from"../../chunk-ALJKYIQL.js";import{a as z,b as O}from"../../chunk-YFMOI263.js";import{a as d,b as r,d as p}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as g,c,d as f,j as l}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import{h as u}from"../../chunk-OHGCOC5Q.js";import{listOrganizations as A}from"@tigrisdata/iam";var n=l("organizations","select");async function N(a){if(g(n),$("Organization selection"))return;let w=O(a),i=z(a,["name","N"]);i||r(n,"Organization name or ID is required");let x=await S(),{data:h,error:e}=await A({config:x});e&&r(n,e);let s=h?.organizations??[],t=s.find(o=>o.id===i||o.name===i);if(!t){let o=s.map(m=>` - ${m.name} (${m.id})`).join(`
|
|
2
2
|
`);f(n,`Organization "${i}" not found
|
|
3
3
|
|
|
4
4
|
Available organizations:
|
package/dist/lib/presign.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as w}from"../chunk-
|
|
1
|
+
import{b as w}from"../chunk-IRDNZN7R.js";import{f as A}from"../chunk-JQUG732D.js";import{a as k,d as K}from"../chunk-ALJKYIQL.js";import{a as g,b as h}from"../chunk-YFMOI263.js";import{a as n}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{c as p}from"../chunk-KK7FZ7QM.js";import{i as y,p as u}from"../chunk-OHGCOC5Q.js";import{listAccessKeys as C}from"@tigrisdata/iam";import{getPresignedUrl as P}from"@tigrisdata/storage";import $ from"enquirer";var{prompt:b}=$;async function T(s){let r=g(s,["path"]);r||n("path argument is required");let{bucket:c,path:e}=A(r);c||n("Invalid path"),e||n("Object key is required");let i=g(s,["method","m"])??"get",t=parseInt(g(s,["expires-in","expiresIn","e"])??"3600",10),l=h(s,"url"),o=g(s,["access-key","accessKey"]),x=g(s,["select"]),f=await K(),a;o?a=o:f.accessKeyId?a=f.accessKeyId:(u()!=="oauth"&&n("Presigning requires an access key. Pass --access-key or configure credentials."),x?a=await E(c,i):a=await q(c,i)),a||n("Presigning requires an access key. Pass --access-key or configure credentials.");let{data:d,error:m}=await P(e,{method:i,expiresIn:t,accessKeyId:a,config:{...f,bucket:c}});m&&n(m),console.log(l==="json"?w({url:d.url,expiresIn:d.expiresIn,method:i,bucket:c,key:e}):d.url),process.exit(0)}async function v(){let r=await p().getAccessToken(),c=y(),e=k(),{data:i,error:t}=await C({config:{sessionToken:r,organizationId:c??void 0,iamEndpoint:e.iamEndpoint}});return t&&n(t),(!i.accessKeys||i.accessKeys.length===0)&&n('No access keys found. Create one with "tigris access-keys create <name>"'),i.accessKeys}function I(s,r,c){return s.roles?s.roles.some(e=>e.role==="NamespaceAdmin"?!0:e.bucket!==r&&e.bucket!=="*"?!1:c==="put"?e.role==="Editor":e.role==="Editor"||e.role==="ReadOnly"):!1}async function q(s,r){let e=(await v()).filter(t=>t.status==="active");e.length===0&&n('No active access keys found. Create one with "tigris access-keys create <name>"');let i=e.find(t=>I(t,s,r));return i||n(`No access key with ${r==="put"?"Editor":"Editor or ReadOnly"} access to bucket "${s}" found.
|
|
2
2
|
Create one: tigris access-keys create <name>
|
|
3
|
-
Then assign: tigris access-keys assign <id> --bucket ${s} --role Editor`),console.error(`Using access key: ${i.name} (${i.id})`),i.id}async function E(s,
|
|
3
|
+
Then assign: tigris access-keys assign <id> --bucket ${s} --role Editor`),console.error(`Using access key: ${i.name} (${i.id})`),i.id}async function E(s,r){process.stdin.isTTY||n("Interactive selection requires a TTY. Omit --select to auto-resolve, or pass --access-key tid_...");let e=(await v()).filter(o=>o.status==="active");e.length===0&&n('No active access keys found. Create one with "tigris access-keys create <name>"');let i=e.filter(o=>I(o,s,r)),t;if(i.length>0?t=i:(console.error(`No access keys with explicit access to bucket "${s}" found. Showing all active keys.`),t=e),t.length===1)return console.error(`Using access key: ${t[0].name} (${t[0].id})`),t[0].id;let{selectedKey:l}=await b({type:"select",name:"selectedKey",message:"Select an access key for presigning:",choices:t.map(o=>({name:o.id,message:`${o.name} (${o.id})`}))});return l}export{T as default,I as keyMatchesOperation};
|
package/dist/lib/rm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as h}from"../chunk-S77OAN6Y.js";import{a as j,b as I,d as N,g as O,h as E,j as J}from"../chunk-JQUG732D.js";import{
|
|
1
|
+
import{a as v,b as h}from"../chunk-S77OAN6Y.js";import{a as j,b as I,d as N,g as O,h as E,j as J}from"../chunk-JQUG732D.js";import{d as W}from"../chunk-ALJKYIQL.js";import{a as $,b as P}from"../chunk-YFMOI263.js";import{a as s}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{list as U,remove as b,removeBucket as T}from"@tigrisdata/storage";var i=!1;async function q(m){let d=$(m,["path"]),g=$(m,["yes","y","force","f"]),k=!!$(m,["recursive","r"]);i=P(m)==="json",d||s("path argument is required"),j(d)||s("Path must be a remote Tigris path (t3:// or tigris://)");let{bucket:e,path:o}=I(d);e||s("Invalid path");let n=await W(),R=d.endsWith("/");if(!o&&!R){if(!g&&(v("Use --yes to skip confirmation"),!await h(`Are you sure you want to delete bucket '${e}'?`))){i||console.log("Aborted");return}let{error:r}=await T(e,{config:n,force:g});r&&s(r),console.log(i?JSON.stringify({action:"removed",bucket:e}):`Removed bucket '${e}'`);return}let a=o.includes("*"),u=o.endsWith("/")||!o&&R;if(!a&&!u&&(u=await N(e,o,n)),u&&!a&&!k&&s("Source is a remote folder (not removed). Use -r to remove recursively."),a||u){let r=a?E(o):o?o.endsWith("/")?o:`${o}/`:"",{items:w,error:S}=await J(e,r||void 0,n);S&&s(S);let f=w;if(a){let t=o.split("/").pop(),l=O(t);f=f.filter(A=>{let F=r?A.name.slice(r.length):A.name;return!k&&F.includes("/")?!1:l.test(F.split("/").pop())})}let c=r,M=f.some(t=>t.name===c),y=!1;if(!M&&!a){let{data:t}=await U({prefix:c,limit:1,config:{...n,bucket:e}});y=t?.items?.some(l=>l.name===c)||!1}let x=f.length+(y?1:0);if(x===0){console.log(i?JSON.stringify({action:"removed",count:0}):"No objects to remove");return}if(!g&&(v("Use --yes to skip confirmation"),!await h(`Are you sure you want to delete ${x} object(s)?`))){i||console.log("Aborted");return}let p=0;for(let t of f){let{error:l}=await b(t.name,{config:{...n,bucket:e}});l?console.error(`Failed to remove ${t.name}: ${l.message}`):(i||console.log(`Removed t3://${e}/${t.name}`),p++)}if(y){let{error:t}=await b(c,{config:{...n,bucket:e}});t?console.error(`Failed to remove ${c}: ${t.message}`):(i||console.log(`Removed t3://${e}/${c}`),p++)}console.log(i?JSON.stringify({action:"removed",count:p}):`Removed ${p} object(s)`)}else{if(!g&&(v("Use --yes to skip confirmation"),!await h(`Are you sure you want to delete 't3://${e}/${o}'?`))){i||console.log("Aborted");return}let{error:r}=await b(o,{config:{...n,bucket:e}});r&&s(r),console.log(i?JSON.stringify({action:"removed",count:1,path:`t3://${e}/${o}`}):`Removed t3://${e}/${o}`)}process.exit(0)}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as h}from"../../chunk-
|
|
1
|
+
import{f as h}from"../../chunk-IRDNZN7R.js";import{d}from"../../chunk-ALJKYIQL.js";import{a as u,b as g}from"../../chunk-YFMOI263.js";import{b as o}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,e as p,j as f}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{listBucketSnapshots as S}from"@tigrisdata/storage";var t=f("snapshots","list");async function v(n){m(t);let a=u(n,["name"]),l=g(n);a||o(t,"Bucket name is required");let k=await d(),{data:e,error:i}=await S(a,{config:k});if(i&&o(t,i),!e||e.length===0){p(t);return}let s=e.map(r=>({name:r.name||"",version:r.version||"",created:r.creationDate})),y=h(s,l,"snapshots","snapshot",[{key:"name",header:"Name"},{key:"version",header:"Version"},{key:"created",header:"Created"}]);console.log(y),c(t,{count:s.length})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as g}from"../../chunk-ALJKYIQL.js";import{a,b as f}from"../../chunk-YFMOI263.js";import{b as r}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,j as p}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{createBucketSnapshot as k}from"@tigrisdata/storage";var o=p("snapshots","take");async function S(n){m(o);let h=f(n),t=a(n,["name"]),e=a(n,["snapshot-name","snapshotName"]);t||r(o,"Bucket name is required");let u=await g(),{data:s,error:i}=await k(t,{name:e,config:u});i&&r(o,i),h==="json"&&console.log(JSON.stringify({action:"taken",bucket:t,version:s?.snapshotVersion})),c(o,{name:t,snapshotName:e||s?.snapshotVersion,version:s?.snapshotVersion})}export{S as default};
|
package/dist/lib/stat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"../chunk-
|
|
1
|
+
import{a as w}from"../chunk-4ZHCF5D6.js";import{a as d,f as c}from"../chunk-IRDNZN7R.js";import{f as j}from"../chunk-JQUG732D.js";import{d as O}from"../chunk-ALJKYIQL.js";import{a as g,b}from"../chunk-YFMOI263.js";import{b as i}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{b as k,c as n,j as y}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{getBucketInfo as A,getStats as I,head as M}from"@tigrisdata/storage";var t=y("stat");async function z(u){k(t);let h=g(u,["path"]),m=b(u),v=g(u,["snapshot-version","snapshotVersion","snapshot"]),f=await O();if(!h){let{data:o,error:r}=await I({config:f});r&&i(t,r);let p=[{metric:"Active Buckets",value:String(o.stats.activeBuckets)},{metric:"Total Objects",value:String(o.stats.totalObjects)},{metric:"Total Unique Objects",value:String(o.stats.totalUniqueObjects)},{metric:"Total Storage",value:d(o.stats.totalStorageBytes)}],l=c(p,m,"stats","stat",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(l),n(t),process.exit(0)}let{bucket:a,path:s}=j(h);if(a||i(t,"Invalid path"),!s||s==="/"){let{data:o,error:r}=await A(a,{config:f});r&&i(t,r);let p=w(o).map(({label:T,value:V})=>({metric:T,value:V})),l=c(p,m,"bucket-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(l),n(t,{bucket:a}),process.exit(0)}let{data:e,error:S}=await M(s,{...v?{snapshotVersion:v}:{},config:{...f,bucket:a}});S&&i(t,S),e||i(t,"Object not found");let x=[{metric:"Path",value:e.path},{metric:"Size",value:d(e.size)},{metric:"Content-Type",value:e.contentType||"N/A"},{metric:"Content-Disposition",value:e.contentDisposition||"N/A"},{metric:"Modified",value:e.modified.toISOString()}],B=c(x,m,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(B),n(t,{bucket:a,path:s}),process.exit(0)}export{z as default};
|
package/dist/lib/touch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f}from"../chunk-JQUG732D.js";import{
|
|
1
|
+
import{f}from"../chunk-JQUG732D.js";import{d as s}from"../chunk-ALJKYIQL.js";import{a,b as c}from"../chunk-YFMOI263.js";import{a as t}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{put as p}from"@tigrisdata/storage";async function u(e){let i=a(e,["path"]);i||t("path argument is required");let{bucket:o,path:r}=f(i);o||t("Invalid path"),r||t("Object key is required (use mk to create buckets)");let g=c(e),m=await s(),{error:n}=await p(r,"",{config:{...m,bucket:o}});n&&t(n),console.log(g==="json"?JSON.stringify({action:"created",bucket:o,path:r}):`Created '${o}/${r}'`),process.exit(0)}export{u as default};
|
package/dist/lib/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d}from"../chunk-
|
|
1
|
+
import{b as d}from"../chunk-YFMOI263.js";import{a as t,c as l,d as p,e as f}from"../chunk-YYVLDLPP.js";import{b as m}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{execSync as h}from"child_process";var r=c("update");async function v(u={}){let g=d(u);s(r);try{let o=await f(),e=l(t,o),n=p();if(g==="json"){console.log(JSON.stringify({currentVersion:t,latestVersion:o,updateAvailable:e,updateCommand:n}));return}console.log(`Current version: ${t}`),e?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",...process.platform==="win32"?{shell:"powershell.exe"}:{}}),i(r,{latestVersion:o})):a(r,{currentVersion:t})}catch(o){m(r,o)}}export{v as default};
|
package/dist/lib/whoami.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`))}catch(u){A(
|
|
1
|
+
import{a as $,c as b}from"../chunk-ALJKYIQL.js";import{b as w}from"../chunk-YFMOI263.js";import{b as A}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{f as g,j as I}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{c as z}from"../chunk-KK7FZ7QM.js";import{i as y}from"../chunk-OHGCOC5Q.js";import{whoami as k}from"@tigrisdata/iam";var f=I("whoami"),v={"aws-profile":"AWS Profile",oauth:"OAuth",credentials:"Access Key Credentials",environment:"Environment Variables",configured:"Configured Credentials"};async function l(h,u){try{let t=$(),{data:c}=await k({config:{accessKeyId:h,secretAccessKey:u,iamEndpoint:t.iamEndpoint}});return{userId:c?.userId,organizationId:c?.organizationId}}catch{return{userId:void 0,organizationId:void 0}}}async function K(h={}){try{let u=w(h),t=await b();if(t.type==="none"){g(f);return}let c,r,o,n,d,e=[""],m=v[t.type]??t.type;switch(t.type){case"aws-profile":{e.push(`Auth method: ${m} (${t.profile})`);let i=await l(t.accessKeyId,t.secretAccessKey);r=i.userId,o=i.organizationId;break}case"oauth":{e.push(`Auth method: ${m}`);let i=z();if(!await i.isAuthenticated()){g(f);return}let a=await i.getIdTokenClaims();c=a.email,r=a.sub,d=y(),n=await i.getOrganizations();break}case"credentials":{e.push(`Auth method: ${m}`);let i=await l(t.accessKeyId,t.secretAccessKey);r=i.userId,o=i.organizationId;break}case"environment":{let i=t.source==="tigris"?"TIGRIS_STORAGE_*":"AWS_*";e.push(`Auth method: ${m} (${i})`);let s=await l(t.accessKeyId,t.secretAccessKey);r=s.userId,o=s.organizationId;break}case"configured":{e.push(`Auth method: ${m}`);let i=await l(t.accessKeyId,t.secretAccessKey);r=i.userId,o=i.organizationId;break}}if(e.push(""),e.push("User Information:"),e.push(` Email: ${c||"N/A"}`),e.push(` User ID: ${r||"N/A"}`),n)if(n.length>0){let s=n.slice(0,5);if(e.push(""),e.push(`Organizations (${n.length}):`),s.forEach(a=>{let O=a.id===d?">":" ";e.push(` ${O} ${a.name} (${a.id})`)}),n.length>5&&e.push(` ... and ${n.length-5} more. Run "tigris organizations list" to see all.`),d){let a=n.find(p=>p.id===d);a&&(e.push(""),e.push(`Active: ${a.name}`))}}else e.push(""),e.push("Organizations: None");else o&&e.push(` Organization: ${o}`);if(u==="json"){let i={authMethod:t.type,email:c,userId:r};if(n&&(i.organizations=n.map(s=>({id:s.id,name:s.name})),d)){let s=n.find(a=>a.id===d);s&&(i.activeOrganization=s.name)}o&&(i.organizationId=o),console.log(JSON.stringify(i));return}e.push(""),console.log(e.join(`
|
|
2
|
+
`))}catch(u){A(f,u)}}export{K as default};
|
package/dist/specs.yaml
CHANGED
|
@@ -647,6 +647,11 @@ commands:
|
|
|
647
647
|
default: table
|
|
648
648
|
- name: forks-of
|
|
649
649
|
description: Only list buckets that are forks of the named source bucket
|
|
650
|
+
- name: limit
|
|
651
|
+
description: Maximum number of items to return per page
|
|
652
|
+
- name: page-token
|
|
653
|
+
description: Pagination token from a previous request to fetch the next page
|
|
654
|
+
alias: pt
|
|
650
655
|
# create
|
|
651
656
|
- name: create
|
|
652
657
|
description: Create a new bucket with optional access, tier, and location settings
|
|
@@ -1182,6 +1187,11 @@ commands:
|
|
|
1182
1187
|
- name: snapshot-version
|
|
1183
1188
|
description: Read from a specific bucket snapshot. Accepts a snapshot version string or any UNIX nanosecond-precision timestamp (e.g. 1765889000501544464)
|
|
1184
1189
|
alias: snapshot
|
|
1190
|
+
- name: limit
|
|
1191
|
+
description: Maximum number of items to return per page
|
|
1192
|
+
- name: page-token
|
|
1193
|
+
description: Pagination token from a previous request to fetch the next page
|
|
1194
|
+
alias: pt
|
|
1185
1195
|
# get
|
|
1186
1196
|
- name: get
|
|
1187
1197
|
description: Download an object by key. Prints to stdout by default, or saves to a file with --output
|
|
@@ -1376,6 +1386,11 @@ commands:
|
|
|
1376
1386
|
description: Output format
|
|
1377
1387
|
options: [json, table, xml]
|
|
1378
1388
|
default: table
|
|
1389
|
+
- name: limit
|
|
1390
|
+
description: Maximum number of items to return per page
|
|
1391
|
+
- name: page-token
|
|
1392
|
+
description: Pagination token from a previous request to fetch the next page
|
|
1393
|
+
alias: pt
|
|
1379
1394
|
- name: create
|
|
1380
1395
|
description: Create a new access key with the given name. Returns the key ID and secret (shown only once)
|
|
1381
1396
|
alias: c
|
|
@@ -1503,6 +1518,11 @@ commands:
|
|
|
1503
1518
|
description: Output format
|
|
1504
1519
|
options: [json, table, xml]
|
|
1505
1520
|
default: table
|
|
1521
|
+
- name: limit
|
|
1522
|
+
description: Maximum number of items to return per page
|
|
1523
|
+
- name: page-token
|
|
1524
|
+
description: Pagination token from a previous request to fetch the next page
|
|
1525
|
+
alias: pt
|
|
1506
1526
|
- name: get
|
|
1507
1527
|
description: Show details for a policy including its document and attached users. If no ARN provided, shows interactive selection
|
|
1508
1528
|
alias: g
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-4ZHCF5D6.js";import"../chunk-IRDNZN7R.js";export{a as buildBucketInfo};
|
package/dist/utils/exit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";export{a as exitWithError,b as failWithError,c as getSuccessNextActions,d as printNextActions};
|
package/dist/utils/format.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../chunk-IRDNZN7R.js";export{b as formatJson,f as formatOutput,g as formatPaginatedOutput,a as formatSize,e as formatTable,d as formatXml,c as formatXmlObject};
|
package/dist/utils/messages.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";export{a as interpolate,j as msg,f as printAlreadyDone,h as printDeprecated,e as printEmpty,d as printFailure,g as printHint,i as printPaginationHint,b as printStart,c as printSuccess};
|
package/dist/utils/options.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-YFMOI263.js";export{b as getFormat,a as getOption,c as getPaginationOptions,d as parseBoolean};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-YYVLDLPP.js";import"../chunk-ATBINUDP.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": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -90,11 +90,10 @@
|
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@aws-sdk/credential-providers": "^3.
|
|
93
|
+
"@aws-sdk/credential-providers": "^3.1024.0",
|
|
94
94
|
"@smithy/shared-ini-file-loader": "^4.4.7",
|
|
95
95
|
"@tigrisdata/iam": "^1.4.1",
|
|
96
|
-
"@tigrisdata/storage": "^2.
|
|
97
|
-
"axios": "^1.13.6",
|
|
96
|
+
"@tigrisdata/storage": "^2.16.2",
|
|
98
97
|
"commander": "^14.0.3",
|
|
99
98
|
"enquirer": "^2.4.1",
|
|
100
99
|
"jose": "^6.2.2",
|
|
@@ -105,11 +104,9 @@
|
|
|
105
104
|
"@commitlint/cli": "^20.5.0",
|
|
106
105
|
"@commitlint/config-conventional": "^20.5.0",
|
|
107
106
|
"@eslint/js": "^10.0.1",
|
|
108
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
109
|
-
"@semantic-release/git": "^10.0.1",
|
|
110
107
|
"@types/node": "^22.19.11",
|
|
111
|
-
"dotenv": "^17.
|
|
112
|
-
"eslint": "^10.
|
|
108
|
+
"dotenv": "^17.4.1",
|
|
109
|
+
"eslint": "^10.2.0",
|
|
113
110
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
114
111
|
"husky": "^9.1.7",
|
|
115
112
|
"prettier": "^3.8.1",
|
|
@@ -118,7 +115,7 @@
|
|
|
118
115
|
"tsup": "^8.5.1",
|
|
119
116
|
"tsx": "^4.21.0",
|
|
120
117
|
"typescript": "^5.9.3",
|
|
121
|
-
"typescript-eslint": "^8.
|
|
118
|
+
"typescript-eslint": "^8.58.0",
|
|
122
119
|
"vitest": "^4.1.2"
|
|
123
120
|
}
|
|
124
121
|
}
|
package/dist/chunk-552FMFE5.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as i,b as g,c as d}from"./chunk-ATBINUDP.js";import{a as A,d as I}from"./chunk-BC2HK4K6.js";import{i as c,j as l,k as y,l as o,p as a}from"./chunk-7RGWTDUP.js";import{fromIni as _}from"@aws-sdk/credential-providers";function K(){return process.env.AWS_ENDPOINT_URL_S3||process.env.AWS_ENDPOINT_URL_IAM?{endpoint:process.env.AWS_ENDPOINT_URL_S3||i,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||g,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||d}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||i,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||g,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||d}}var r=K(),S=A();function p(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY){let e=process.env.AWS_ENDPOINT_URL_S3||i;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||i;return{accessKeyId:process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,secretAccessKey:process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY,endpoint:e,source:"tigris"}}return null}function T(){return p()||o()||null}var f=!1;async function C(){if(f||!process.stdin.isTTY)return!1;f=!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 O(){return a()}async function h(){if(l()){let n=process.env.AWS_PROFILE||"default",u=await _({profile:n})();return{type:"aws-profile",profile:n,accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey}}let e=p();if(e)return{type:"environment",accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,source:e.source};let s=a();if(s==="oauth")return{type:"oauth"};if(s==="credentials"){let n=o();if(n)return{type:"credentials",accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey}}let t=o();return t?{type:"configured",accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey}:{type:"none"}}async function E(e){let s=await h();switch(s.type){case"aws-profile":{let t=await y(s.profile);return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:t.endpoint||r.endpoint||i,iamEndpoint:t.iamEndpoint||r.iamEndpoint}}case"oauth":{let t=I(),n=c();if(!n)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await t.getAccessToken(),accessKeyId:"",secretAccessKey:"",...e?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await t.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:r.endpoint,organizationId:n,iamEndpoint:r.iamEndpoint,authDomain:S.domain}}case"credentials":{let t=c();return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:o()?.endpoint||i,organizationId:t??void 0,iamEndpoint:r.iamEndpoint}}case"environment":return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:p()?.endpoint||i};case"configured":return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:o()?.endpoint||i};case"none":{if(await C())return E(e);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}}}async function P(){let e=await E(),s=c();return{...e,...s&&!e.organizationId?{organizationId:s}:{}}}function R(e){return a()==="oauth"?!1:(T()?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{K as a,p as b,T as c,O as d,h as e,E as f,P as g,R as h};
|
package/dist/chunk-5VDFQRGP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-PPNBQWSR.js";var c={success:"\u2714",failure:"\u2716",hint:"\u2192"};function t(){return process.stdout.isTTY===!0}function i(){return globalThis.__TIGRIS_JSON_MODE===!0}function o(n){let s=p(n.command,n.operation);if(s)return s.messages}function r(n,s){let e=n;return e=e.replace(/\\n/g,`
|
|
2
|
-
`),s&&(e=e.replace(/\{\{(\w+)\}\}/g,(a,g)=>{let u=s[g];return u!==void 0?String(u):`{{${g}}}`})),e}function f(n,s){if(!t()||i())return;let e=o(n);e?.onStart&&console.log(r(e.onStart,s))}function d(n,s){if(!t()||i())return;let e=o(n);e?.onSuccess&&console.log(`${c.success} ${r(e.onSuccess,s)}`)}function m(n,s,e){if(globalThis.__TIGRIS_JSON_MODE===!0)return;let a=o(n);a?.onFailure&&console.error(`${c.failure} ${r(a.onFailure,e)}`),s&&console.error(` ${s}`)}function M(n,s){if(!t()||i())return;let e=o(n);e?.onEmpty&&console.log(r(e.onEmpty,s))}function x(n,s){if(!t()||i())return;let e=o(n);e?.onAlreadyDone&&console.log(r(e.onAlreadyDone,s))}function S(n,s){if(!t()||i())return;let e=o(n);e?.hint&&console.log(`${c.hint} ${r(e.hint,s)}`)}function b(n){t()&&console.warn(`\u26A0 Deprecated: ${n}`)}function C(n,s){return{command:n,operation:s}}export{r as a,f as b,d as c,m as d,M as e,x as f,S as g,b as h,C as i};
|