@tigrisdata/cli 2.15.0 → 2.16.1

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 (95) hide show
  1. package/dist/auth/client.js +1 -1
  2. package/dist/auth/fly.js +1 -1
  3. package/dist/auth/iam.js +1 -1
  4. package/dist/auth/provider.js +1 -1
  5. package/dist/auth/storage.js +1 -1
  6. package/dist/{chunk-WIOXQDND.js → chunk-4ZHCF5D6.js} +1 -1
  7. package/dist/chunk-7TRUGAFK.js +4 -0
  8. package/dist/chunk-ALJKYIQL.js +5 -0
  9. package/dist/{chunk-4RNEQIK4.js → chunk-EYGRHNNY.js} +1 -1
  10. package/dist/chunk-GAWFFIPC.js +4 -0
  11. package/dist/chunk-IRDNZN7R.js +7 -0
  12. package/dist/chunk-KK7FZ7QM.js +1 -0
  13. package/dist/{chunk-ZHAJEGAB.js → chunk-LVAJB4FR.js} +1 -1
  14. package/dist/chunk-OHGCOC5Q.js +1 -0
  15. package/dist/chunk-PG746YF3.js +3 -0
  16. package/dist/{chunk-S33FT7Z7.js → chunk-TRRXHLUE.js} +1 -1
  17. package/dist/{chunk-3FMWZQ3C.js → chunk-VAVMX5DC.js} +1 -1
  18. package/dist/{chunk-CMGXGXVC.js → chunk-VYYV76WE.js} +1 -1
  19. package/dist/chunk-XAZRKVEQ.js +8 -0
  20. package/dist/chunk-YFMOI263.js +1 -0
  21. package/dist/cli-core.js +1 -1
  22. package/dist/cli.js +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/lib/access-keys/assign.js +1 -1
  25. package/dist/lib/access-keys/create.js +1 -1
  26. package/dist/lib/access-keys/delete.js +1 -1
  27. package/dist/lib/access-keys/get.js +1 -1
  28. package/dist/lib/access-keys/list.js +1 -1
  29. package/dist/lib/buckets/create.js +1 -1
  30. package/dist/lib/buckets/delete.js +1 -1
  31. package/dist/lib/buckets/get.js +1 -1
  32. package/dist/lib/buckets/list.js +1 -1
  33. package/dist/lib/buckets/set-cors.js +1 -1
  34. package/dist/lib/buckets/set-locations.js +1 -1
  35. package/dist/lib/buckets/set-migration.js +1 -1
  36. package/dist/lib/buckets/set-notifications.js +1 -1
  37. package/dist/lib/buckets/set-transition.js +1 -1
  38. package/dist/lib/buckets/set-ttl.js +1 -1
  39. package/dist/lib/buckets/set.js +1 -1
  40. package/dist/lib/configure/index.js +1 -1
  41. package/dist/lib/cp.js +1 -1
  42. package/dist/lib/credentials/test.js +1 -1
  43. package/dist/lib/forks/create.js +1 -1
  44. package/dist/lib/forks/list.js +1 -1
  45. package/dist/lib/iam/policies/create.js +1 -1
  46. package/dist/lib/iam/policies/delete.js +1 -1
  47. package/dist/lib/iam/policies/edit.js +1 -1
  48. package/dist/lib/iam/policies/get.js +1 -1
  49. package/dist/lib/iam/policies/list.js +1 -1
  50. package/dist/lib/iam/users/invite.js +1 -1
  51. package/dist/lib/iam/users/list.js +1 -1
  52. package/dist/lib/iam/users/remove.js +1 -1
  53. package/dist/lib/iam/users/revoke-invitation.js +1 -1
  54. package/dist/lib/iam/users/update-role.js +1 -1
  55. package/dist/lib/login/credentials.js +1 -1
  56. package/dist/lib/login/oauth.js +1 -1
  57. package/dist/lib/login/select.js +1 -1
  58. package/dist/lib/logout.js +1 -1
  59. package/dist/lib/ls.js +1 -1
  60. package/dist/lib/mk.js +1 -1
  61. package/dist/lib/mv.js +1 -1
  62. package/dist/lib/objects/delete.js +1 -1
  63. package/dist/lib/objects/get.js +1 -1
  64. package/dist/lib/objects/info.js +1 -1
  65. package/dist/lib/objects/list.js +1 -1
  66. package/dist/lib/objects/put.js +1 -1
  67. package/dist/lib/objects/set.js +1 -1
  68. package/dist/lib/organizations/create.js +1 -1
  69. package/dist/lib/organizations/list.js +1 -1
  70. package/dist/lib/organizations/select.js +1 -1
  71. package/dist/lib/presign.js +2 -2
  72. package/dist/lib/rm.js +1 -1
  73. package/dist/lib/snapshots/list.js +1 -1
  74. package/dist/lib/snapshots/take.js +1 -1
  75. package/dist/lib/stat.js +1 -1
  76. package/dist/lib/touch.js +1 -1
  77. package/dist/lib/update.js +1 -1
  78. package/dist/lib/whoami.js +2 -2
  79. package/dist/specs.yaml +30 -0
  80. package/dist/utils/bucket-info.js +1 -1
  81. package/dist/utils/exit.js +1 -1
  82. package/dist/utils/format.js +1 -1
  83. package/dist/utils/messages.js +1 -1
  84. package/dist/utils/options.js +1 -1
  85. package/dist/utils/update-check.js +1 -1
  86. package/package.json +6 -9
  87. package/dist/chunk-552FMFE5.js +0 -5
  88. package/dist/chunk-5VDFQRGP.js +0 -2
  89. package/dist/chunk-7RGWTDUP.js +0 -1
  90. package/dist/chunk-AEADROU6.js +0 -4
  91. package/dist/chunk-AHGPPFCQ.js +0 -1
  92. package/dist/chunk-BC2HK4K6.js +0 -1
  93. package/dist/chunk-CQCBYE3X.js +0 -6
  94. package/dist/chunk-JVQ7GLJH.js +0 -4
  95. package/dist/chunk-KCWQ4II7.js +0 -8
@@ -1 +1 @@
1
- import{a as h}from"../../../chunk-ZHAJEGAB.js";import{f as v}from"../../../chunk-CQCBYE3X.js";import"../../../chunk-552FMFE5.js";import{a as p,b as y}from"../../../chunk-AHGPPFCQ.js";import{b as n}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as m,c as s,e as g,i as d}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.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
+ 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 u}from"../../../chunk-ZHAJEGAB.js";import{f}from"../../../chunk-CQCBYE3X.js";import"../../../chunk-552FMFE5.js";import{b as p}from"../../../chunk-AHGPPFCQ.js";import{b as m}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as n,c as s,e as c,i as d}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.js";import{listPolicies as k}from"@tigrisdata/iam";var t=d("iam policies","list");async function y(h){n(t);let g=p(h),o=await u(t),{data:i,error:r}=await k({config:{sessionToken:o.sessionToken,organizationId:o.organizationId,iamEndpoint:o.iamEndpoint}});if(r&&m(t,r),!i.policies||i.policies.length===0){c(t);return}let a=i.policies.map(e=>({name:e.name,id:e.id,resource:e.resource,description:e.description||"-",attachments:e.attachmentCount,created:e.createDate,updated:e.updateDate})),l=f(a,g,"policies","policy",[{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"}]);console.log(l),s(t,{count:a.length})}export{y as default};
1
+ import{a as x}from"../../../chunk-LVAJB4FR.js";import{g as y}from"../../../chunk-IRDNZN7R.js";import"../../../chunk-ALJKYIQL.js";import{b as l,c as T}from"../../../chunk-YFMOI263.js";import{b as k}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as p,c as u,e as g,i as f,j as h}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 E}from"@tigrisdata/iam";var t=h("iam policies","list");async function I(a){p(t);let i=l(a),{limit:r,pageToken:s}=T(a),o=await x(t),{data:n,error:c}=await E({...r!==void 0?{limit:r}:{},...s?{paginationToken:s}:{},config:{sessionToken:o.sessionToken,organizationId:o.organizationId,iamEndpoint:o.iamEndpoint}});if(c&&k(t,c),!n.policies||n.policies.length===0){g(t);return}let d=n.policies.map(e=>({name:e.name,id:e.id,resource:e.resource,description:e.description||"-",attachments:e.attachmentCount,created:e.createDate,updated:e.updateDate})),C=[{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"}],m=n.paginationToken||void 0,D=y(d,i,"policies","policy",C,{paginationToken:m});console.log(D),i!=="json"&&i!=="xml"&&f(m),u(t,{count:d.length})}export{I as default};
@@ -1 +1 @@
1
- import{a as u}from"../../../chunk-ZHAJEGAB.js";import"../../../chunk-552FMFE5.js";import{a as s,b as p}from"../../../chunk-AHGPPFCQ.js";import{b as n}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as l,c,i as f}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import{b as g}from"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.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
+ 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-ZHAJEGAB.js";import{b as y,d as i,e as a}from"../../../chunk-CQCBYE3X.js";import"../../../chunk-552FMFE5.js";import{b as h}from"../../../chunk-AHGPPFCQ.js";import{b as d}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as m,c as g,e as c,i as u}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import{b as f}from"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.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,`
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-ZHAJEGAB.js";import{a,b as v}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-552FMFE5.js";import{a as m,b as w}from"../../../chunk-AHGPPFCQ.js";import{b as n}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as l,c as u,e as p,i as d}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import{b as y}from"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.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
+ 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-ZHAJEGAB.js";import{a,b as y}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-552FMFE5.js";import{a as c,b as k}from"../../../chunk-AHGPPFCQ.js";import{b as s}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as g,c as p,e as u,i as v}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import{b as d}from"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.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
+ 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-ZHAJEGAB.js";import{a as w}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-552FMFE5.js";import{a as c,b}from"../../../chunk-AHGPPFCQ.js";import{b as o}from"../../../chunk-3FMWZQ3C.js";import"../../../chunk-DV3LCXRH.js";import{b as d,c as h,e as y,i as R}from"../../../chunk-5VDFQRGP.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import{b as O}from"../../../chunk-AEADROU6.js";import"../../../chunk-BC2HK4K6.js";import"../../../chunk-7RGWTDUP.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
+ 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-4RNEQIK4.js";import"../../chunk-S77OAN6Y.js";import"../../chunk-552FMFE5.js";import"../../chunk-AHGPPFCQ.js";import"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.js";export{a as default};
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};
@@ -1 +1 @@
1
- import{a,b}from"../../chunk-JVQ7GLJH.js";import"../../chunk-AHGPPFCQ.js";import"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.js";export{b as default,a as oauth};
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};
@@ -1 +1 @@
1
- import{a as r}from"../../chunk-JVQ7GLJH.js";import{a as c}from"../../chunk-4RNEQIK4.js";import{a as s}from"../../chunk-S77OAN6Y.js";import"../../chunk-552FMFE5.js";import"../../chunk-AHGPPFCQ.js";import"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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};
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};
@@ -1 +1 @@
1
- import{b as c}from"../chunk-AHGPPFCQ.js";import{b as n}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import{b as t,c as r,i}from"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import{t as a}from"../chunk-7RGWTDUP.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};
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-CQCBYE3X.js";import{f as w}from"../chunk-JQUG732D.js";import{f}from"../chunk-552FMFE5.js";import{a as d,b as y}from"../chunk-AHGPPFCQ.js";import{a}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-BC2HK4K6.js";import"../chunk-7RGWTDUP.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};
1
+ import{a as O,g as u}from"../chunk-IRDNZN7R.js";import{f as P}from"../chunk-JQUG732D.js";import{d as k}from"../chunk-ALJKYIQL.js";import{a as g,b as z,c as S}from"../chunk-YFMOI263.js";import{a as d}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{i as p}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{list as M,listBuckets as N}from"@tigrisdata/storage";async function V(a){let l=g(a,["path"]),h=g(a,["snapshot-version","snapshotVersion","snapshot"]),o=z(a),{limit:s,pageToken:r}=S(a);if(!l){let n=await k(),{data:e,error:t}=await N({...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:n});t&&d(t);let i=(e.buckets||[]).map(w=>({name:w.name,created:w.creationDate})),m=[{key:"name",header:"Name"},{key:"created",header:"Created"}],j=e.paginationToken||void 0,I=u(i,o,"buckets","bucket",m,{paginationToken:j});console.log(I),o!=="json"&&o!=="xml"&&p(j);return}let{bucket:y,path:c}=P(l);y||d("Invalid path");let W=await k(),f=c?c.endsWith("/")?c:`${c}/`:void 0,{data:x,error:T}=await M({prefix:f,...h?{snapshotVersion:h}:{},...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:{...W,bucket:y}});T&&d(T);let v=(x.items||[]).map(n=>{let e=f?n.name.slice(f.length):n.name,t=e.indexOf("/"),i=t===-1?e:e.slice(0,t+1),m=i.endsWith("/");return{key:i,size:m?"-":O(n.size),modified:n.lastModified}}).filter((n,e,t)=>n.key!==""&&t.findIndex(i=>i.key===n.key)===e),C=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],b=x.paginationToken||void 0,F=u(v,o,"objects","object",C,{paginationToken:b});console.log(F),o!=="json"&&o!=="xml"&&p(b)}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{f as m}from"../chunk-552FMFE5.js";import{a as t,b as h}from"../chunk-AHGPPFCQ.js";import{a as o}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-BC2HK4K6.js";import"../chunk-7RGWTDUP.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};
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-CQCBYE3X.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{f as T}from"../chunk-552FMFE5.js";import{a as w,b as O}from"../chunk-AHGPPFCQ.js";import{a as n}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-BC2HK4K6.js";import"../chunk-7RGWTDUP.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
+ 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{f as O}from"../../chunk-552FMFE5.js";import{a as c,b as x}from"../../chunk-AHGPPFCQ.js";import{a as p,b as f,c as b,d as A}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as l,c as d,d as k,i as y}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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};
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};
@@ -1 +1 @@
1
- import{i as k}from"../../chunk-JQUG732D.js";import{f as j}from"../../chunk-552FMFE5.js";import{a as r,b}from"../../chunk-AHGPPFCQ.js";import{b as c}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as h,c as a,i as u}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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};
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};
@@ -1 +1 @@
1
- import{a as d,f as h}from"../../chunk-CQCBYE3X.js";import{i as k}from"../../chunk-JQUG732D.js";import{f as l}from"../../chunk-552FMFE5.js";import{a as i,b as g}from"../../chunk-AHGPPFCQ.js";import{b as o}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as u,i as p}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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};
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};
@@ -1 +1 @@
1
- import{a as l,f as b}from"../../chunk-CQCBYE3X.js";import{f as y}from"../../chunk-JQUG732D.js";import{f as k}from"../../chunk-552FMFE5.js";import{a as o,b as h}from"../../chunk-AHGPPFCQ.js";import{b as s}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as p,c as d,e as g,i as u}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.js";import{list as A}from"@tigrisdata/storage";var t=u("objects","list");async function E(e){p(t);let n=o(e,["bucket"]),j=o(e,["prefix","p","P"]),x=h(e),c=o(e,["snapshot-version","snapshotVersion","snapshot"]);n||s(t,"Bucket name is required");let a=y(n),z=a.bucket,S=j||a.path||void 0,w=await k(),{data:r,error:f}=await A({prefix:S,...c?{snapshotVersion:c}:{},config:{...w,bucket:z}});if(f&&s(t,f),!r.items||r.items.length===0){g(t);return}let m=r.items.map(i=>({key:i.name,size:l(i.size),modified:i.lastModified})),O=b(m,x,"objects","object",[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}]);console.log(O),d(t,{count:m.length})}export{E as default};
1
+ import{a as P,g as S}from"../../chunk-IRDNZN7R.js";import{f as T}from"../../chunk-JQUG732D.js";import{d as z}from"../../chunk-ALJKYIQL.js";import{a as o,b as x,c as j}from"../../chunk-YFMOI263.js";import{b as s}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as l,e as h,i as b,j as y}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=y("objects","list");async function q(t){k(e);let a=o(t,["bucket"]),O=o(t,["prefix","p","P"]),i=x(t),c=o(t,["snapshot-version","snapshotVersion","snapshot"]),{limit:f,pageToken:m}=j(t);a||s(e,"Bucket name is required");let p=T(a),w=p.bucket,A=O||p.path||void 0,E=await z(),{data:n,error:g}=await V({prefix:A,...c?{snapshotVersion:c}:{},...f!==void 0?{limit:f}:{},...m?{paginationToken:m}:{},config:{...E,bucket:w}});if(g&&s(e,g),!n.items||n.items.length===0){h(e);return}let d=n.items.map(r=>({key:r.name,size:P(r.size),modified:r.lastModified})),F=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],u=n.paginationToken||void 0,M=S(d,i,"objects","object",F,{paginationToken:u});console.log(M),i!=="json"&&i!=="xml"&&b(u),l(e,{count:d.length})}export{q as default};
@@ -1 +1 @@
1
- import{a as R}from"../../chunk-EKW6XTGL.js";import{a,f as j}from"../../chunk-CQCBYE3X.js";import{i as A}from"../../chunk-JQUG732D.js";import{f as w}from"../../chunk-552FMFE5.js";import{a as s,b as T}from"../../chunk-AHGPPFCQ.js";import{b as i,d as z}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as S,i as h}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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};
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};
@@ -1 +1 @@
1
- import{i as k}from"../../chunk-JQUG732D.js";import{f as b}from"../../chunk-552FMFE5.js";import{a as c,b as p}from"../../chunk-AHGPPFCQ.js";import{b as r}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as g,c as m,i as u}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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
+ 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{f as O,h as d}from"../../chunk-552FMFE5.js";import{a as p,b as u}from"../../chunk-AHGPPFCQ.js";import{b as i,d as m}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as e,c,g as f,i as g}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import{b as s}from"../../chunk-AEADROU6.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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
+ 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-CQCBYE3X.js";import{a as S}from"../../chunk-S77OAN6Y.js";import{f as C,h as U}from"../../chunk-552FMFE5.js";import{b as I}from"../../chunk-AHGPPFCQ.js";import{b as h}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as s,e as u,i as p}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import{a as O,c as k}from"../../chunk-AEADROU6.js";import{d as y}from"../../chunk-BC2HK4K6.js";import{h as z,i as w}from"../../chunk-7RGWTDUP.js";import{listOrganizations as T}from"@tigrisdata/iam";import b from"enquirer";var i=p("organizations","list");async function j(x){if(f(i),U("Organization listing and selection"))return;let m=I(x,"select"),A=await y().getAccessToken(),a=await k(A),E=a?.some(t=>O(t.id))??!1,n;if(E&&a)n=a.map(t=>({id:t.id,name:t.name,slug:t.name}));else{let t=await C(),{data:l,error:r}=await T({config:t});r&&h(i,r),n=l?.organizations??[]}if(n.length===0){u(i);return}let o=w();if(m==="select"){let t=n.map(e=>({name:e.id,message:`${e.name} (${e.id})`,hint:e.id===o?"currently selected":void 0}));S("Use --format table or --format json");let g=(await b.prompt({type:"select",name:"organization",message:"Select an organization:",choices:t.map(e=>e.message),initial:o?n.findIndex(e=>e.id===o):0})).organization.match(/\(([^)]+)\)$/),d=g?g[1]:n[0].id;await z(d);let $=n.find(e=>e.id===d);s(i,{name:$?.name});return}let c=n.map(t=>({id:t.id,name:t.name,slug:t.slug,selected:t.id===o?"*":""})),F=q(c,m,"organizations","organization",[{key:"selected",header:" ",width:1},{key:"id",header:"ID"},{key:"name",header:"Name"},{key:"slug",header:"Slug"}]);console.log(F),s(i,{count:c.length})}export{j as default};
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{f as S,h as $}from"../../chunk-552FMFE5.js";import{a as z,b as O}from"../../chunk-AHGPPFCQ.js";import{a as d,b as r,d as p}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as g,c,d as f,i as l}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import{h as u}from"../../chunk-7RGWTDUP.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(`
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:
@@ -1,3 +1,3 @@
1
- import{b as w}from"../chunk-CQCBYE3X.js";import{f as A}from"../chunk-JQUG732D.js";import{a as h,d as k,f as K}from"../chunk-552FMFE5.js";import{a as g,b as p}from"../chunk-AHGPPFCQ.js";import{a as r}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{d as u}from"../chunk-BC2HK4K6.js";import{i as y}from"../chunk-7RGWTDUP.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 n=g(s,["path"]);n||r("path argument is required");let{bucket:c,path:e}=A(n);c||r("Invalid path"),e||r("Object key is required");let i=g(s,["method","m"])??"get",t=parseInt(g(s,["expires-in","expiresIn","e"])??"3600",10),l=p(s,"url"),o=g(s,["access-key","accessKey"]),x=g(s,["select"]),f=await K(),a;o?a=o:f.accessKeyId?a=f.accessKeyId:(await k()!=="oauth"&&r("Presigning requires an access key. Pass --access-key or configure credentials."),x?a=await E(c,i):a=await q(c,i)),a||r("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&&r(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 n=await u().getAccessToken(),c=y(),e=h(),{data:i,error:t}=await C({config:{sessionToken:n,organizationId:c??void 0,iamEndpoint:e.iamEndpoint}});return t&&r(t),(!i.accessKeys||i.accessKeys.length===0)&&r('No access keys found. Create one with "tigris access-keys create <name>"'),i.accessKeys}function I(s,n,c){return s.roles?s.roles.some(e=>e.role==="NamespaceAdmin"?!0:e.bucket!==n&&e.bucket!=="*"?!1:c==="put"?e.role==="Editor":e.role==="Editor"||e.role==="ReadOnly"):!1}async function q(s,n){let e=(await v()).filter(t=>t.status==="active");e.length===0&&r('No active access keys found. Create one with "tigris access-keys create <name>"');let i=e.find(t=>I(t,s,n));return i||r(`No access key with ${n==="put"?"Editor":"Editor or ReadOnly"} access to bucket "${s}" found.
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,n){process.stdin.isTTY||r("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&&r('No active access keys found. Create one with "tigris access-keys create <name>"');let i=e.filter(o=>I(o,s,n)),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};
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{f as W}from"../chunk-552FMFE5.js";import{a as $,b as P}from"../chunk-AHGPPFCQ.js";import{a as s}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-BC2HK4K6.js";import"../chunk-7RGWTDUP.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
+ 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-CQCBYE3X.js";import{f as d}from"../../chunk-552FMFE5.js";import{a as u,b as g}from"../../chunk-AHGPPFCQ.js";import{b as o}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,e as p,i as f}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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
+ import{g as S}from"../../chunk-IRDNZN7R.js";import{d as x}from"../../chunk-ALJKYIQL.js";import{a as k,b as y,c as T}from"../../chunk-YFMOI263.js";import{b as i}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as u,e as d,i as h,j as l}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{listBucketSnapshots as P}from"@tigrisdata/storage";var t=l("snapshots","list");async function B(o){f(t);let r=k(o,["name"]),e=y(o),{limit:s,pageToken:m}=T(o);r||i(t,"Bucket name is required");let v=await x(),{data:n,error:c}=await P(r,{...s!==void 0?{limit:s}:{},...m?{paginationToken:m}:{},config:v});if(c&&i(t,c),!n.snapshots||n.snapshots.length===0){d(t);return}let p=n.snapshots.map(a=>({name:a.name||"",version:a.version||"",created:a.creationDate})),w=[{key:"name",header:"Name"},{key:"version",header:"Version"},{key:"created",header:"Created"}],g=n.paginationToken||void 0,O=S(p,e,"snapshots","snapshot",w,{paginationToken:g});console.log(O),e!=="json"&&e!=="xml"&&h(g),u(t,{count:p.length})}export{B as default};
@@ -1 +1 @@
1
- import{f as g}from"../../chunk-552FMFE5.js";import{a,b as f}from"../../chunk-AHGPPFCQ.js";import{b as r}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,i as p}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-BC2HK4K6.js";import"../../chunk-7RGWTDUP.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};
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-WIOXQDND.js";import{a as d,f as c}from"../chunk-CQCBYE3X.js";import{f as j}from"../chunk-JQUG732D.js";import{f as O}from"../chunk-552FMFE5.js";import{a as g,b}from"../chunk-AHGPPFCQ.js";import{b as i}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import{b as k,c as n,i as y}from"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-BC2HK4K6.js";import"../chunk-7RGWTDUP.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};
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{f as s}from"../chunk-552FMFE5.js";import{a,b as c}from"../chunk-AHGPPFCQ.js";import{a as t}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-BC2HK4K6.js";import"../chunk-7RGWTDUP.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};
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};
@@ -1 +1 @@
1
- import{b as d}from"../chunk-AHGPPFCQ.js";import{a as t,c as l,d as p,e as f}from"../chunk-KCWQ4II7.js";import{b as m}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,i as c}from"../chunk-5VDFQRGP.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};
1
+ import{b as d}from"../chunk-YFMOI263.js";import{a as t,c as l,d as p,e as f}from"../chunk-XAZRKVEQ.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};
@@ -1,2 +1,2 @@
1
- import{a as O,e as S,f as k}from"../chunk-552FMFE5.js";import{b}from"../chunk-AHGPPFCQ.js";import{b as A}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import{f as I,i as z}from"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{d as $}from"../chunk-BC2HK4K6.js";import{i as w}from"../chunk-7RGWTDUP.js";import{listOrganizations as v,whoami as C}from"@tigrisdata/iam";var g=z("whoami"),K={"aws-profile":"AWS Profile",oauth:"OAuth",credentials:"Access Key Credentials",environment:"Environment Variables",configured:"Configured Credentials"};async function h(f,u){try{let t=O(),{data:c}=await C({config:{accessKeyId:f,secretAccessKey:u,iamEndpoint:t.iamEndpoint}});return{userId:c?.userId,organizationId:c?.organizationId}}catch{return{userId:void 0,organizationId:void 0}}}async function E(f={}){try{let u=b(f),t=await S();if(t.type==="none"){I(g);return}let c,r,o,n,d,e=[""],l=K[t.type]??t.type;switch(t.type){case"aws-profile":{e.push(`Auth method: ${l} (${t.profile})`);let i=await h(t.accessKeyId,t.secretAccessKey);r=i.userId,o=i.organizationId;break}case"oauth":{e.push(`Auth method: ${l}`);let i=$();if(!await i.isAuthenticated()){I(g);return}let a=await i.getIdTokenClaims();c=a.email,r=a.sub;let m=await k();d=w();let{data:p,error:y}=await v({config:m});y&&A(g,y),n=p?.organizations??[];break}case"credentials":{e.push(`Auth method: ${l}`);let i=await h(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: ${l} (${i})`);let s=await h(t.accessKeyId,t.secretAccessKey);r=s.userId,o=s.organizationId;break}case"configured":{e.push(`Auth method: ${l}`);let i=await h(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 p=a.id===d?">":" ";e.push(` ${p} ${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(m=>m.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(g,u)}}export{E as default};
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
@@ -292,6 +292,11 @@ commands:
292
292
  description: Output format
293
293
  options: [json, table, xml]
294
294
  default: table
295
+ - name: limit
296
+ description: Maximum number of items to return per page
297
+ - name: page-token
298
+ description: Pagination token from a previous request to fetch the next page
299
+ alias: pt
295
300
 
296
301
  # mk
297
302
  - name: mk
@@ -647,6 +652,11 @@ commands:
647
652
  default: table
648
653
  - name: forks-of
649
654
  description: Only list buckets that are forks of the named source bucket
655
+ - name: limit
656
+ description: Maximum number of items to return per page
657
+ - name: page-token
658
+ description: Pagination token from a previous request to fetch the next page
659
+ alias: pt
650
660
  # create
651
661
  - name: create
652
662
  description: Create a new bucket with optional access, tier, and location settings
@@ -1110,6 +1120,11 @@ commands:
1110
1120
  description: Output format
1111
1121
  options: [json, table, xml]
1112
1122
  default: table
1123
+ - name: limit
1124
+ description: Maximum number of items to return per page
1125
+ - name: page-token
1126
+ description: Pagination token from a previous request to fetch the next page
1127
+ alias: pt
1113
1128
  # take
1114
1129
  - name: take
1115
1130
  description: Take a new snapshot of the bucket's current state. Optionally provide a name for the snapshot
@@ -1182,6 +1197,11 @@ commands:
1182
1197
  - name: snapshot-version
1183
1198
  description: Read from a specific bucket snapshot. Accepts a snapshot version string or any UNIX nanosecond-precision timestamp (e.g. 1765889000501544464)
1184
1199
  alias: snapshot
1200
+ - name: limit
1201
+ description: Maximum number of items to return per page
1202
+ - name: page-token
1203
+ description: Pagination token from a previous request to fetch the next page
1204
+ alias: pt
1185
1205
  # get
1186
1206
  - name: get
1187
1207
  description: Download an object by key. Prints to stdout by default, or saves to a file with --output
@@ -1376,6 +1396,11 @@ commands:
1376
1396
  description: Output format
1377
1397
  options: [json, table, xml]
1378
1398
  default: table
1399
+ - name: limit
1400
+ description: Maximum number of items to return per page
1401
+ - name: page-token
1402
+ description: Pagination token from a previous request to fetch the next page
1403
+ alias: pt
1379
1404
  - name: create
1380
1405
  description: Create a new access key with the given name. Returns the key ID and secret (shown only once)
1381
1406
  alias: c
@@ -1503,6 +1528,11 @@ commands:
1503
1528
  description: Output format
1504
1529
  options: [json, table, xml]
1505
1530
  default: table
1531
+ - name: limit
1532
+ description: Maximum number of items to return per page
1533
+ - name: page-token
1534
+ description: Pagination token from a previous request to fetch the next page
1535
+ alias: pt
1506
1536
  - name: get
1507
1537
  description: Show details for a policy including its document and attached users. If no ARN provided, shows interactive selection
1508
1538
  alias: g
@@ -1 +1 @@
1
- import{a}from"../chunk-WIOXQDND.js";import"../chunk-CQCBYE3X.js";export{a as buildBucketInfo};
1
+ import{a}from"../chunk-4ZHCF5D6.js";import"../chunk-IRDNZN7R.js";export{a as buildBucketInfo};
@@ -1 +1 @@
1
- import{a,b,c,d}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";export{a as exitWithError,b as failWithError,c as getSuccessNextActions,d as printNextActions};
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};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"../chunk-CQCBYE3X.js";export{b as formatJson,f as formatOutput,a as formatSize,e as formatTable,d as formatXml,c as formatXmlObject};
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};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i}from"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";export{a as interpolate,i as msg,f as printAlreadyDone,h as printDeprecated,e as printEmpty,d as printFailure,g as printHint,b as printStart,c as printSuccess};
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};
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-AHGPPFCQ.js";export{b as getFormat,a as getOption,c as parseBoolean};
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-KCWQ4II7.js";import"../chunk-ATBINUDP.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
1
+ import{b as a,c as b,d as c,e as d,f as e}from"../chunk-XAZRKVEQ.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.15.0",
3
+ "version": "2.16.1",
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.1018.0",
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.15.6",
97
- "axios": "^1.13.6",
96
+ "@tigrisdata/storage": "^3.0.0",
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.3.1",
112
- "eslint": "^10.1.0",
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.57.2",
118
+ "typescript-eslint": "^8.58.0",
122
119
  "vitest": "^4.1.2"
123
120
  }
124
121
  }