@tigrisdata/cli 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/{chunk-YYVLDLPP.js → chunk-4D33BI67.js} +1 -1
- package/dist/{chunk-LVAJB4FR.js → chunk-7ERBLTNY.js} +1 -1
- package/dist/{chunk-EYGRHNNY.js → chunk-P4RBPX26.js} +1 -1
- package/dist/{chunk-AU3RCZHB.js → chunk-PNSKHQX4.js} +1 -1
- package/dist/chunk-ZADGAARW.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -1
- package/dist/lib/access-keys/attach-policy.js +1 -0
- package/dist/lib/access-keys/create.js +1 -1
- package/dist/lib/access-keys/delete.js +1 -1
- package/dist/lib/access-keys/detach-policy.js +1 -0
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list-policies.js +1 -0
- package/dist/lib/access-keys/list.js +1 -1
- package/dist/lib/access-keys/rotate.js +1 -0
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/list.js +1 -1
- package/dist/lib/buckets/set-cors.js +1 -1
- package/dist/lib/buckets/set-locations.js +1 -1
- package/dist/lib/buckets/set-migration.js +1 -1
- package/dist/lib/buckets/set-notifications.js +1 -1
- package/dist/lib/buckets/set-transition.js +1 -1
- package/dist/lib/buckets/set-ttl.js +1 -1
- package/dist/lib/buckets/set.js +1 -1
- package/dist/lib/configure/index.js +1 -1
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +1 -1
- package/dist/lib/forks/create.js +1 -1
- package/dist/lib/forks/list.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -1
- package/dist/lib/iam/policies/delete.js +1 -1
- package/dist/lib/iam/policies/edit.js +1 -1
- package/dist/lib/iam/policies/get.js +1 -1
- package/dist/lib/iam/policies/link-key.js +1 -0
- package/dist/lib/iam/policies/list-keys.js +1 -0
- package/dist/lib/iam/policies/list.js +1 -1
- package/dist/lib/iam/policies/select-policy.js +1 -0
- package/dist/lib/iam/policies/unlink-key.js +1 -0
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +1 -1
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/set.js +1 -1
- package/dist/lib/organizations/create.js +1 -1
- package/dist/lib/organizations/list.js +1 -1
- package/dist/lib/organizations/select.js +1 -1
- package/dist/lib/presign.js +1 -1
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/list.js +1 -1
- package/dist/lib/snapshots/take.js +1 -1
- package/dist/lib/stat.js +1 -1
- package/dist/lib/touch.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/whoami.js +1 -1
- package/dist/specs.yaml +172 -0
- package/dist/utils/update-check.js +1 -1
- package/package.json +3 -3
- /package/dist/{chunk-ALJKYIQL.js → chunk-YOKGP6YU.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"../../../chunk-
|
|
1
|
+
import{a as v}from"../../../chunk-7ERBLTNY.js";import{a as w}from"../../../chunk-S77OAN6Y.js";import"../../../chunk-YOKGP6YU.js";import{a as c,b}from"../../../chunk-YFMOI263.js";import{b as o}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as d,c as h,e as y,j as R}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import{a as O}from"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import I from"enquirer";import{listUsers as S,updateUserRole as q}from"@tigrisdata/iam";var{prompt:U}=I,e=R("iam users","update-role");async function E(m){d(e);let A=b(m);if(O("User management"))return;let f=["admin","member"],i=c(m,["role","r"]);i||o(e,"Role is required. Use --role admin or --role member");let r=Array.isArray(i)?i:[i];for(let t of r)f.includes(t)||o(e,`Invalid role "${t}". Must be one of: ${f.join(", ")}`);let n=c(m,["resource"]),s=Array.isArray(n)?n:n?[n]:[],u=await v(e);if(s.length===0){let{data:t,error:a}=await S({config:u});if(a&&o(e,a),t.users.length===0){y(e);return}w("Provide user ID(s) as a positional argument");let{selected:$}=await U({type:"multiselect",name:"selected",message:"Select user(s) to update (space to select, enter to confirm):",choices:t.users.map(l=>({name:l.userId,message:`${l.email} (${l.isOrgOwner?"owner":l.role})`}))});s=$}r.length>1&&r.length!==s.length&&o(e,`Number of roles (${r.length}) must match number of users (${s.length}), or provide a single role for all users`);let g=s.map((t,a)=>({userId:t,role:r.length===1?r[0]:r[a]})),{error:p}=await q(g,{config:u});p&&o(e,p),A==="json"&&console.log(JSON.stringify({action:"updated",users:g})),h(e)}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-P4RBPX26.js";import"../../chunk-S77OAN6Y.js";import"../../chunk-YOKGP6YU.js";import"../../chunk-YFMOI263.js";import"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";export{a as default};
|
package/dist/lib/login/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as c}from"../../chunk-P4RBPX26.js";import{a as r}from"../../chunk-7TRUGAFK.js";import{a as s}from"../../chunk-S77OAN6Y.js";import"../../chunk-YOKGP6YU.js";import"../../chunk-YFMOI263.js";import"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import i from"enquirer";var{prompt:n}=i;async function u(e){let a=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,t=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(a||t){await c(e);return}s('Use "tigris login oauth" or "tigris login credentials --access-key ... --access-secret ..."');let{method:m}=await n({type:"select",name:"method",message:"Choose login method:",choices:[{name:"user",message:"As a user (OAuth2 flow)"},{name:"machine",message:"As a machine (Access Key & Secret)"}]});m==="user"?await r():await c(e)}export{u as default};
|
package/dist/lib/ls.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
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-YOKGP6YU.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{d as m}from"../chunk-
|
|
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-YOKGP6YU.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-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-
|
|
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-YOKGP6YU.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{d as O}from"../../chunk-
|
|
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-YOKGP6YU.js";import{a as c,b as x}from"../../chunk-YFMOI263.js";import{a as p,b as f,c as b,d as A}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as l,c as d,d as k,j as y}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{remove as E}from"@tigrisdata/storage";var t=y("objects","delete");async function F(n){l(t);let S=x(n),g=c(n,["bucket"]),v=c(n,["key"]),q=c(n,["yes","y","force"]);g||f(t,"Bucket name or path is required");let m=w(g),o=m.bucket,s=v||m.key||void 0;s||f(t,"Object key is required");let N=await O(),a=Array.isArray(s)?s:[s];if(!q&&(h("Use --yes to skip confirmation"),!await j(`Delete ${a.length} object(s) from '${o}'?`))){console.log("Aborted");return}let u=[],i=[];for(let e of a){let{error:r}=await E(e,{config:{...N,bucket:o}});r?(k(t,r.message,{key:e}),i.push({key:e,error:r.message})):(u.push(e),d(t,{key:e}))}if(S==="json"){let e=b(t,{bucket:o}),r={action:"deleted",bucket:o,keys:u,errors:i};e.length>0&&(r.nextActions=e),console.log(JSON.stringify(r))}i.length>0&&p(i[0].error,t),A(t,{bucket:o})}export{F as default};
|
package/dist/lib/objects/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as k}from"../../chunk-JQUG732D.js";import{d as j}from"../../chunk-
|
|
1
|
+
import{i as k}from"../../chunk-JQUG732D.js";import{d as j}from"../../chunk-YOKGP6YU.js";import{a as r,b}from"../../chunk-YFMOI263.js";import{b as c}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as h,c as a,j as u}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{get as w}from"@tigrisdata/storage";import{createWriteStream as v,writeFileSync as q}from"fs";import{extname as T}from"path";import{Readable as S}from"stream";import{pipeline as x}from"stream/promises";var e=u("objects","get"),C=new Set([".js",".ts",".jsx",".tsx",".mjs",".cjs",".py",".rb",".php",".java",".go",".rs",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".scala",".clj",".ex",".exs",".erl",".sh",".bash",".zsh",".fish",".ps1",".bat",".cmd",".sql",".graphql",".gql",".json",".yaml",".yml",".toml",".ini",".cfg",".conf",".xml",".plist",".env",".properties",".html",".htm",".css",".scss",".sass",".less",".styl",".md",".markdown",".mdx",".rst",".txt",".text",".csv",".tsv",".log",".ejs",".hbs",".pug",".jade",".njk",".twig",".liquid",".svg",".gitignore",".dockerignore",".editorconfig"]);function E(s,m){let l=T(m||s).toLowerCase();return C.has(l)?"string":"stream"}async function F(s){h(e);let m=b(s),p=r(s,["bucket"]),l=r(s,["key"]),t=r(s,["output","o","O"]),y=r(s,["mode","m","M"]),g=r(s,["snapshot-version","snapshotVersion","snapshot"]);p||c(e,"Bucket name or path is required");let{bucket:f,key:o}=k(p,l);o||c(e,"Object key is required");let d=await j();if((y||E(o,t))==="stream"){let{data:i,error:n}=await w(o,"stream",{...g?{snapshotVersion:g}:{},config:{...d,bucket:f}});if(n&&c(e,n),t){let O=v(t);await x(S.fromWeb(i),O),a(e,{key:o,output:t}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:f,key:o,output:t}))}else await x(S.fromWeb(i),process.stdout),a(e)}else{let{data:i,error:n}=await w(o,"string",{...g?{snapshotVersion:g}:{},config:{...d,bucket:f}});n&&c(e,n),t?(q(t,i),a(e,{key:o,output:t}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:f,key:o,output:t}))):(console.log(i),a(e))}}export{F as default};
|
package/dist/lib/objects/info.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,f as h}from"../../chunk-IRDNZN7R.js";import{i as k}from"../../chunk-JQUG732D.js";import{d as l}from"../../chunk-
|
|
1
|
+
import{a as d,f as h}from"../../chunk-IRDNZN7R.js";import{i as k}from"../../chunk-JQUG732D.js";import{d as l}from"../../chunk-YOKGP6YU.js";import{a as i,b as g}from"../../chunk-YFMOI263.js";import{b as o}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as u,j as p}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{head as O}from"@tigrisdata/storage";var e=p("objects","info");async function A(r){m(e);let b=g(r),c=i(r,["bucket"]),v=i(r,["key"]),s=i(r,["snapshot-version","snapshotVersion","snapshot"]);c||o(e,"Bucket name or path is required");let{bucket:a,key:n}=k(c,v);n||o(e,"Object key is required");let y=await l(),{data:t,error:f}=await O(n,{...s?{snapshotVersion:s}:{},config:{...y,bucket:a}});f&&o(e,f),t||o(e,"Object not found");let S=[{metric:"Path",value:t.path},{metric:"Size",value:d(t.size)},{metric:"Content-Type",value:t.contentType||"N/A"},{metric:"Content-Disposition",value:t.contentDisposition||"N/A"},{metric:"Modified",value:t.modified.toISOString()},{metric:"URL",value:t.url}],j=h(S,b,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(j),u(e,{bucket:a,key:n})}export{A as default};
|
package/dist/lib/objects/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as P,g as S}from"../../chunk-IRDNZN7R.js";import{f as T}from"../../chunk-JQUG732D.js";import{d as z}from"../../chunk-YOKGP6YU.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};
|
package/dist/lib/objects/put.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R}from"../../chunk-EKW6XTGL.js";import{a,f as j}from"../../chunk-IRDNZN7R.js";import{i as A}from"../../chunk-JQUG732D.js";import{d as w}from"../../chunk-
|
|
1
|
+
import{a as R}from"../../chunk-EKW6XTGL.js";import{a,f as j}from"../../chunk-IRDNZN7R.js";import{i as A}from"../../chunk-JQUG732D.js";import{d as w}from"../../chunk-YOKGP6YU.js";import{a as s,b as T}from"../../chunk-YFMOI263.js";import{b as i,d as z}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as S,j as h}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{put as W}from"@tigrisdata/storage";import{createReadStream as B,statSync as E}from"fs";import{Readable as v}from"stream";var t=h("objects","put");async function M(e){k(t);let u=s(e,["bucket"]),l=s(e,["key"]),g=s(e,["file"]),O=s(e,["access","a","A"],"private"),P=s(e,["content-type","contentType","t","T"]),$=T(e);u||i(t,"Bucket name or path is required");let d=A(u),m=d.bucket,n=d.key||l,r=d.key&&l||g;n||i(t,"Object key is required");let q=!process.stdin.isTTY;!r&&!q&&i(t,"File path is required (or pipe data via stdin)");let f,o;if(r){try{o=E(r).size}catch{i(t,`File not found: ${r}`)}let p=B(r);f=v.toWeb(p)}else f=v.toWeb(process.stdin);let U=await w({withCredentialProvider:!0}),x=r?R(o):{multipart:!0,partSize:5*1024*1024,queueSize:8},{data:c,error:b}=await W(n,f,{access:O==="public"?"public":"private",contentType:P,...x,onUploadProgress:({loaded:p,percentage:y})=>{o!==void 0&&o>0?process.stdout.write(`\rUploading: ${a(p)} / ${a(o)} (${y}%)`):process.stdout.write(`\rUploading: ${a(p)}`)},config:{...U,bucket:m}});process.stdout.write("\r"+" ".repeat(60)+"\r"),b&&i(t,b);let C=[{path:c.path,size:a(c.size??o??0),contentType:c.contentType||"-",modified:c.modified}],F=j(C,$,"objects","object",[{key:"path",header:"Path"},{key:"size",header:"Size"},{key:"contentType",header:"Content-Type"},{key:"modified",header:"Modified"}]);console.log(F),S(t,{key:n,bucket:m}),z(t,{key:n,bucket:m})}export{M as default};
|
package/dist/lib/objects/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as k}from"../../chunk-JQUG732D.js";import{d as b}from"../../chunk-
|
|
1
|
+
import{i as k}from"../../chunk-JQUG732D.js";import{d as b}from"../../chunk-YOKGP6YU.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{d as O,f as d}from"../../chunk-
|
|
1
|
+
import{d as O,f as d}from"../../chunk-YOKGP6YU.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-IRDNZN7R.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{d as k,f as I}from"../../chunk-
|
|
1
|
+
import{f as q}from"../../chunk-IRDNZN7R.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{d as k,f as I}from"../../chunk-YOKGP6YU.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{d as S,f as $}from"../../chunk-
|
|
1
|
+
import{d as S,f as $}from"../../chunk-YOKGP6YU.js";import{a as z,b as O}from"../../chunk-YFMOI263.js";import{a as d,b as r,d as p}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as g,c,d as f,j as l}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import{h as u}from"../../chunk-OHGCOC5Q.js";import{listOrganizations as A}from"@tigrisdata/iam";var n=l("organizations","select");async function N(a){if(g(n),$("Organization selection"))return;let w=O(a),i=z(a,["name","N"]);i||r(n,"Organization name or ID is required");let x=await S(),{data:h,error:e}=await A({config:x});e&&r(n,e);let s=h?.organizations??[],t=s.find(o=>o.id===i||o.name===i);if(!t){let o=s.map(m=>` - ${m.name} (${m.id})`).join(`
|
|
2
2
|
`);f(n,`Organization "${i}" not found
|
|
3
3
|
|
|
4
4
|
Available organizations:
|
package/dist/lib/presign.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as w}from"../chunk-IRDNZN7R.js";import{f as A}from"../chunk-JQUG732D.js";import{a as k,d as K}from"../chunk-
|
|
1
|
+
import{b as w}from"../chunk-IRDNZN7R.js";import{f as A}from"../chunk-JQUG732D.js";import{a as k,d as K}from"../chunk-YOKGP6YU.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
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{d as W}from"../chunk-
|
|
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-YOKGP6YU.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{
|
|
1
|
+
import{g as S}from"../../chunk-IRDNZN7R.js";import{d as x}from"../../chunk-YOKGP6YU.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{d as g}from"../../chunk-
|
|
1
|
+
import{d as g}from"../../chunk-YOKGP6YU.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-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-
|
|
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-YOKGP6YU.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{d as s}from"../chunk-
|
|
1
|
+
import{f}from"../chunk-JQUG732D.js";import{d as s}from"../chunk-YOKGP6YU.js";import{a,b as c}from"../chunk-YFMOI263.js";import{a as t}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{put as p}from"@tigrisdata/storage";async function u(e){let i=a(e,["path"]);i||t("path argument is required");let{bucket:o,path:r}=f(i);o||t("Invalid path"),r||t("Object key is required (use mk to create buckets)");let g=c(e),m=await s(),{error:n}=await p(r,"",{config:{...m,bucket:o}});n&&t(n),console.log(g==="json"?JSON.stringify({action:"created",bucket:o,path:r}):`Created '${o}/${r}'`),process.exit(0)}export{u as default};
|
package/dist/lib/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d}from"../chunk-YFMOI263.js";import{a as t,c as l,d as p,e as f}from"../chunk-
|
|
1
|
+
import{b as d}from"../chunk-YFMOI263.js";import{a as t,c as l,d as p,e as f}from"../chunk-4D33BI67.js";import{b as m}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{execSync as h}from"child_process";var r=c("update");async function v(u={}){let g=d(u);s(r);try{let o=await f(),e=l(t,o),n=p();if(g==="json"){console.log(JSON.stringify({currentVersion:t,latestVersion:o,updateAvailable:e,updateCommand:n}));return}console.log(`Current version: ${t}`),e?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",...process.platform==="win32"?{shell:"powershell.exe"}:{}}),i(r,{latestVersion:o})):a(r,{currentVersion:t})}catch(o){m(r,o)}}export{v as default};
|
package/dist/lib/whoami.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as $,c as b}from"../chunk-
|
|
1
|
+
import{a as $,c as b}from"../chunk-YOKGP6YU.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
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
|
|
@@ -1115,6 +1120,11 @@ commands:
|
|
|
1115
1120
|
description: Output format
|
|
1116
1121
|
options: [json, table, xml]
|
|
1117
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
|
|
1118
1128
|
# take
|
|
1119
1129
|
- name: take
|
|
1120
1130
|
description: Take a new snapshot of the bucket's current state. Optionally provide a name for the snapshot
|
|
@@ -1484,6 +1494,99 @@ commands:
|
|
|
1484
1494
|
- name: revoke-roles
|
|
1485
1495
|
description: Revoke all bucket roles from the access key
|
|
1486
1496
|
type: flag
|
|
1497
|
+
- name: rotate
|
|
1498
|
+
description: Rotate an access key's secret. The current secret is immediately invalidated and a new one is returned (shown only once)
|
|
1499
|
+
alias: r
|
|
1500
|
+
examples:
|
|
1501
|
+
- "tigris access-keys rotate tid_AaBbCcDdEeFf --yes"
|
|
1502
|
+
messages:
|
|
1503
|
+
onStart: 'Rotating access key...'
|
|
1504
|
+
onSuccess: 'Access key rotated'
|
|
1505
|
+
onFailure: 'Failed to rotate access key'
|
|
1506
|
+
nextActions:
|
|
1507
|
+
- command: 'tigris access-keys get {{id}}'
|
|
1508
|
+
description: 'Verify the rotated access key'
|
|
1509
|
+
arguments:
|
|
1510
|
+
- name: id
|
|
1511
|
+
description: Access key ID
|
|
1512
|
+
type: positional
|
|
1513
|
+
required: true
|
|
1514
|
+
examples:
|
|
1515
|
+
- tid_AaBbCcDdEeFf
|
|
1516
|
+
- name: force
|
|
1517
|
+
type: flag
|
|
1518
|
+
description: Skip confirmation prompts (alias for --yes)
|
|
1519
|
+
- name: attach-policy
|
|
1520
|
+
description: Attach an IAM policy to an access key. If no policy ARN is provided, shows interactive selection of available policies
|
|
1521
|
+
alias: ap
|
|
1522
|
+
examples:
|
|
1523
|
+
- "tigris access-keys attach-policy tid_AaBb --policy-arn arn:aws:iam::org_id:policy/my-policy"
|
|
1524
|
+
- "tigris access-keys attach-policy tid_AaBb"
|
|
1525
|
+
messages:
|
|
1526
|
+
onStart: 'Attaching policy...'
|
|
1527
|
+
onSuccess: 'Policy attached'
|
|
1528
|
+
onFailure: 'Failed to attach policy'
|
|
1529
|
+
arguments:
|
|
1530
|
+
- name: id
|
|
1531
|
+
description: Access key ID
|
|
1532
|
+
type: positional
|
|
1533
|
+
required: true
|
|
1534
|
+
examples:
|
|
1535
|
+
- tid_AaBbCcDdEeFf
|
|
1536
|
+
- name: policy-arn
|
|
1537
|
+
description: ARN of the policy to attach
|
|
1538
|
+
examples:
|
|
1539
|
+
- arn:aws:iam::org_id:policy/my-policy
|
|
1540
|
+
- name: detach-policy
|
|
1541
|
+
description: Detach an IAM policy from an access key. If no policy ARN is provided, shows interactive selection of attached policies
|
|
1542
|
+
alias: dp
|
|
1543
|
+
examples:
|
|
1544
|
+
- "tigris access-keys detach-policy tid_AaBb --policy-arn arn:aws:iam::org_id:policy/my-policy --yes"
|
|
1545
|
+
- "tigris access-keys detach-policy tid_AaBb"
|
|
1546
|
+
messages:
|
|
1547
|
+
onStart: 'Detaching policy...'
|
|
1548
|
+
onSuccess: 'Policy detached'
|
|
1549
|
+
onFailure: 'Failed to detach policy'
|
|
1550
|
+
arguments:
|
|
1551
|
+
- name: id
|
|
1552
|
+
description: Access key ID
|
|
1553
|
+
type: positional
|
|
1554
|
+
required: true
|
|
1555
|
+
examples:
|
|
1556
|
+
- tid_AaBbCcDdEeFf
|
|
1557
|
+
- name: policy-arn
|
|
1558
|
+
description: ARN of the policy to detach
|
|
1559
|
+
examples:
|
|
1560
|
+
- arn:aws:iam::org_id:policy/my-policy
|
|
1561
|
+
- name: force
|
|
1562
|
+
type: flag
|
|
1563
|
+
description: Skip confirmation prompts (alias for --yes)
|
|
1564
|
+
- name: list-policies
|
|
1565
|
+
description: List all IAM policies attached to an access key
|
|
1566
|
+
alias: lp
|
|
1567
|
+
examples:
|
|
1568
|
+
- "tigris access-keys list-policies tid_AaBbCcDdEeFf"
|
|
1569
|
+
messages:
|
|
1570
|
+
onStart: ''
|
|
1571
|
+
onSuccess: ''
|
|
1572
|
+
onFailure: 'Failed to list policies for access key'
|
|
1573
|
+
onEmpty: 'No policies attached to this access key'
|
|
1574
|
+
arguments:
|
|
1575
|
+
- name: id
|
|
1576
|
+
description: Access key ID
|
|
1577
|
+
type: positional
|
|
1578
|
+
required: true
|
|
1579
|
+
examples:
|
|
1580
|
+
- tid_AaBbCcDdEeFf
|
|
1581
|
+
- name: format
|
|
1582
|
+
description: Output format
|
|
1583
|
+
options: [json, table, xml]
|
|
1584
|
+
default: table
|
|
1585
|
+
- name: limit
|
|
1586
|
+
description: Maximum number of items to return per page
|
|
1587
|
+
- name: page-token
|
|
1588
|
+
description: Pagination token from a previous request to fetch the next page
|
|
1589
|
+
alias: pt
|
|
1487
1590
|
|
|
1488
1591
|
#########################
|
|
1489
1592
|
# IAM - Identity and Access Management
|
|
@@ -1616,6 +1719,75 @@ commands:
|
|
|
1616
1719
|
- name: force
|
|
1617
1720
|
type: flag
|
|
1618
1721
|
description: Skip confirmation prompts (alias for --yes)
|
|
1722
|
+
- name: link-key
|
|
1723
|
+
description: Link an access key to a policy. If no policy ARN is provided, shows interactive selection. If no access key ID is provided, shows interactive selection of unlinked keys
|
|
1724
|
+
alias: lnk
|
|
1725
|
+
examples:
|
|
1726
|
+
- "tigris iam policies link-key arn:aws:iam::org_id:policy/my-policy --id tid_AaBb"
|
|
1727
|
+
- "tigris iam policies link-key"
|
|
1728
|
+
messages:
|
|
1729
|
+
onStart: 'Linking access key...'
|
|
1730
|
+
onSuccess: 'Access key linked'
|
|
1731
|
+
onFailure: 'Failed to link access key'
|
|
1732
|
+
onEmpty: 'No policies found'
|
|
1733
|
+
arguments:
|
|
1734
|
+
- name: resource
|
|
1735
|
+
description: Policy ARN. If omitted, shows interactive selection
|
|
1736
|
+
type: positional
|
|
1737
|
+
required: false
|
|
1738
|
+
examples:
|
|
1739
|
+
- arn:aws:iam::org_id:policy/my-policy
|
|
1740
|
+
- name: id
|
|
1741
|
+
description: Access key ID to attach
|
|
1742
|
+
examples:
|
|
1743
|
+
- tid_AaBbCcDdEeFf
|
|
1744
|
+
- name: unlink-key
|
|
1745
|
+
description: Unlink an access key from a policy. If no policy ARN is provided, shows interactive selection. If no access key ID is provided, shows interactive selection of linked keys
|
|
1746
|
+
alias: ulnk
|
|
1747
|
+
examples:
|
|
1748
|
+
- "tigris iam policies unlink-key arn:aws:iam::org_id:policy/my-policy --id tid_AaBb --yes"
|
|
1749
|
+
- "tigris iam policies unlink-key"
|
|
1750
|
+
messages:
|
|
1751
|
+
onStart: 'Unlinking access key...'
|
|
1752
|
+
onSuccess: 'Access key unlinked'
|
|
1753
|
+
onFailure: 'Failed to unlink access key'
|
|
1754
|
+
onEmpty: 'No policies found'
|
|
1755
|
+
arguments:
|
|
1756
|
+
- name: resource
|
|
1757
|
+
description: Policy ARN. If omitted, shows interactive selection
|
|
1758
|
+
type: positional
|
|
1759
|
+
required: false
|
|
1760
|
+
examples:
|
|
1761
|
+
- arn:aws:iam::org_id:policy/my-policy
|
|
1762
|
+
- name: id
|
|
1763
|
+
description: Access key ID to detach
|
|
1764
|
+
examples:
|
|
1765
|
+
- tid_AaBbCcDdEeFf
|
|
1766
|
+
- name: force
|
|
1767
|
+
type: flag
|
|
1768
|
+
description: Skip confirmation prompts (alias for --yes)
|
|
1769
|
+
- name: list-keys
|
|
1770
|
+
description: List all access keys attached to a policy. If no policy ARN is provided, shows interactive selection
|
|
1771
|
+
alias: lk
|
|
1772
|
+
examples:
|
|
1773
|
+
- "tigris iam policies list-keys arn:aws:iam::org_id:policy/my-policy"
|
|
1774
|
+
- "tigris iam policies list-keys"
|
|
1775
|
+
messages:
|
|
1776
|
+
onStart: ''
|
|
1777
|
+
onSuccess: ''
|
|
1778
|
+
onFailure: 'Failed to list access keys for policy'
|
|
1779
|
+
onEmpty: 'No access keys attached to this policy'
|
|
1780
|
+
arguments:
|
|
1781
|
+
- name: resource
|
|
1782
|
+
description: Policy ARN. If omitted, shows interactive selection
|
|
1783
|
+
type: positional
|
|
1784
|
+
required: false
|
|
1785
|
+
examples:
|
|
1786
|
+
- arn:aws:iam::org_id:policy/my-policy
|
|
1787
|
+
- name: format
|
|
1788
|
+
description: Output format
|
|
1789
|
+
options: [json, table, xml]
|
|
1790
|
+
default: table
|
|
1619
1791
|
|
|
1620
1792
|
- name: users
|
|
1621
1793
|
description: Manage organization users and invitations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-4D33BI67.js";import"../chunk-ATBINUDP.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@aws-sdk/credential-providers": "^3.1024.0",
|
|
94
94
|
"@smithy/shared-ini-file-loader": "^4.4.7",
|
|
95
|
-
"@tigrisdata/iam": "^1.
|
|
96
|
-
"@tigrisdata/storage": "^
|
|
95
|
+
"@tigrisdata/iam": "^2.1.0",
|
|
96
|
+
"@tigrisdata/storage": "^3.0.0",
|
|
97
97
|
"commander": "^14.0.3",
|
|
98
98
|
"enquirer": "^2.4.1",
|
|
99
99
|
"jose": "^6.2.2",
|
|
File without changes
|