@tigrisdata/cli 3.9.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -5
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/{chunk-ZBRCGJ6R.js → chunk-4FAKNMI5.js} +1 -1
- package/dist/{chunk-54KNZAI5.js → chunk-76VFN2EJ.js} +1 -1
- package/dist/chunk-7UKHARLH.js +10 -0
- package/dist/{chunk-LKNUDKJD.js → chunk-CEEDWOY2.js} +2 -2
- package/dist/{chunk-XHR75GDI.js → chunk-HAYPV4J6.js} +1 -1
- package/dist/{chunk-FKHFOOA3.js → chunk-IIF5VLQ7.js} +1 -1
- package/dist/{chunk-QUCEBYIQ.js → chunk-JUOJKZRI.js} +1 -1
- package/dist/{chunk-XUHRL6QY.js → chunk-MQEI5KKF.js} +1 -1
- package/dist/{chunk-WIJB3E2C.js → chunk-PNRZDYCK.js} +1 -1
- package/dist/{chunk-2TPTTPAT.js → chunk-R3KHIAWP.js} +1 -1
- package/dist/{chunk-AFES4NT6.js → chunk-RDJQLQQY.js} +1 -1
- package/dist/chunk-RH6Z22EN.js +1 -0
- package/dist/chunk-RQGIXHG5.js +5 -0
- package/dist/{chunk-E5CPKJ4N.js → chunk-TFXO4OXM.js} +1 -1
- package/dist/{chunk-N76NIM6R.js → chunk-UZIIZW33.js} +1 -1
- package/dist/chunk-V6JZFDRE.js +1 -0
- package/dist/{chunk-UUPTUOXD.js → chunk-ZTZF3OHU.js} +1 -1
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/constants.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 -1
- 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 -1
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list-policies.js +1 -1
- package/dist/lib/access-keys/list.js +1 -1
- package/dist/lib/access-keys/rotate.js +1 -1
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/disable-snapshots.js +1 -1
- package/dist/lib/buckets/enable-snapshots.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/lifecycle/create.js +1 -1
- package/dist/lib/buckets/lifecycle/edit.js +1 -1
- package/dist/lib/buckets/lifecycle/list.js +1 -1
- package/dist/lib/buckets/lifecycle/shared.js +1 -1
- package/dist/lib/buckets/list.js +1 -1
- package/dist/lib/buckets/merge.js +1 -1
- package/dist/lib/buckets/migrate.js +1 -1
- package/dist/lib/buckets/rebase.js +1 -1
- package/dist/lib/buckets/restore.js +1 -1
- package/dist/lib/buckets/set-cors.js +1 -1
- package/dist/lib/buckets/set-locations.js +1 -1
- package/dist/lib/buckets/set-migration.js +1 -1
- package/dist/lib/buckets/set-notifications.js +1 -1
- package/dist/lib/buckets/set.js +1 -1
- package/dist/lib/bundle.js +1 -1
- package/dist/lib/configure/index.js +1 -1
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -1
- package/dist/lib/iam/policies/delete.js +1 -1
- package/dist/lib/iam/policies/edit.js +1 -1
- package/dist/lib/iam/policies/get.js +1 -1
- package/dist/lib/iam/policies/link-key.js +1 -1
- package/dist/lib/iam/policies/list-keys.js +1 -1
- package/dist/lib/iam/policies/list.js +1 -1
- package/dist/lib/iam/policies/select-policy.js +1 -1
- package/dist/lib/iam/policies/unlink-key.js +1 -1
- package/dist/lib/iam/teams/create.js +1 -1
- package/dist/lib/iam/teams/edit.js +1 -1
- package/dist/lib/iam/teams/list.js +1 -1
- package/dist/lib/iam/teams/shared.js +1 -1
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +1 -1
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/init/index.js +1 -1
- package/dist/lib/init/interactive.js +1 -1
- package/dist/lib/init/shared.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/oauth.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/logout.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list-versions.js +4 -4
- package/dist/lib/objects/list.js +1 -1
- package/dist/lib/objects/purge.js +1 -0
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/restore-deleted.js +1 -0
- package/dist/lib/objects/restore-info.js +1 -1
- package/dist/lib/objects/restore.js +1 -1
- package/dist/lib/objects/set-access.js +1 -1
- package/dist/lib/objects/set.js +1 -1
- package/dist/lib/organizations/create.js +1 -1
- package/dist/lib/organizations/list.js +1 -1
- package/dist/lib/organizations/select.js +1 -1
- package/dist/lib/presign.js +1 -1
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/delete.js +1 -1
- package/dist/lib/snapshots/list.js +1 -1
- package/dist/lib/snapshots/take.js +1 -1
- package/dist/lib/stat.js +1 -1
- package/dist/lib/telemetry/disable.js +1 -1
- package/dist/lib/telemetry/enable.js +1 -1
- package/dist/lib/telemetry/status.js +1 -1
- package/dist/lib/touch.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/whoami.js +1 -1
- package/dist/specs.yaml +78 -2
- package/dist/utils/analytics.js +1 -1
- package/dist/utils/exit.js +1 -1
- package/dist/utils/telemetry.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +3 -3
- package/postinstall.cjs +6 -0
- package/dist/chunk-64FBY7Z6.js +0 -1
- package/dist/chunk-672QCRVD.js +0 -1
- package/dist/chunk-HCZGZVF3.js +0 -9
- package/dist/chunk-L6I5MSYU.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-MQEI5KKF.js";import"../../chunk-S77OAN6Y.js";import"../../chunk-R3KHIAWP.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-IIF5VLQ7.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";export{a as default};
|
package/dist/lib/login/oauth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-4FAKNMI5.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-ZTZF3OHU.js";import"../../chunk-G4OJTPSI.js";import"../../chunk-IIF5VLQ7.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";export{b as default,a as oauth};
|
package/dist/lib/login/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"../../chunk-
|
|
1
|
+
import{a as c}from"../../chunk-MQEI5KKF.js";import{a as r}from"../../chunk-4FAKNMI5.js";import{a as s}from"../../chunk-S77OAN6Y.js";import"../../chunk-R3KHIAWP.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-ZTZF3OHU.js";import"../../chunk-G4OJTPSI.js";import"../../chunk-IIF5VLQ7.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import i from"enquirer";var{prompt:n}=i;async function u(e){let a=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,t=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(a||t){await c(e);return}s('Use "tigris login oauth" or "tigris login credentials --access-key ... --access-secret ..."');let{method:m}=await n({type:"select",name:"method",message:"Choose login method:",choices:[{name:"user",message:"As a user (OAuth2 flow)"},{name:"machine",message:"As a machine (Access Key & Secret)"}]});m==="user"?await r():await c(e)}export{u as default};
|
package/dist/lib/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"../chunk-S6KFKBMY.js";import{b as a}from"../chunk-
|
|
1
|
+
import{b as c}from"../chunk-S6KFKBMY.js";import{b as a}from"../chunk-IIF5VLQ7.js";import{b as r,c as i,j as n}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import{t}from"../chunk-F4AGJWCK.js";var o=n("logout");async function f(m={}){r(o);let e=c(m);try{await t(),e==="json"&&console.log(JSON.stringify({action:"logged_out"})),i(o)}catch(s){a(o,s)}}export{f as default};
|
package/dist/lib/ls.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P,g}from"../chunk-AFM3TY2D.js";import{e as N}from"../chunk-KIT6R3V2.js";import{e as p}from"../chunk-
|
|
1
|
+
import{a as P,g}from"../chunk-AFM3TY2D.js";import{e as N}from"../chunk-KIT6R3V2.js";import{e as p}from"../chunk-R3KHIAWP.js";import{a as d,b as z,c as j}from"../chunk-S6KFKBMY.js";import{a as c}from"../chunk-IIF5VLQ7.js";import{i as f}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{list as D,listBuckets as E}from"@tigrisdata/storage";async function F(n){let l=d(n,["path"]),u=d(n,["snapshot-version","snapshotVersion","snapshot"]),t=z(n),k=d(n,["source"]),{limit:i,pageToken:a}=j(n);if(!l){let e=await p(),{data:r,error:x}=await E({...i!==void 0?{limit:i}:{},...a?{paginationToken:a}:{},config:e});x&&c(x);let W=(r.buckets||[]).map(w=>({name:w.name,created:w.creationDate})),A=[{key:"name",header:"Name"},{key:"created",header:"Created"}],b=r.paginationToken||void 0,B=g(W,t,"buckets","bucket",A,{paginationToken:b});console.log(B),t!=="json"&&t!=="xml"&&f(b);return}let{bucket:h,path:s}=N(l);h||c("Invalid path");let S=await p(),o=s?s.endsWith("/")?s:`${s}/`:void 0,{data:m,error:y}=await D({prefix:o,delimiter:"/",...u?{snapshotVersion:u}:{},...k?{source:k}:{},...i!==void 0?{limit:i}:{},...a?{paginationToken:a}:{},config:{...S,bucket:h}});y&&c(y);let O=(m.commonPrefixes||[]).map(e=>({key:o?e.slice(o.length):e,size:"-",modified:""})),v=(m.items||[]).map(e=>({key:o?e.name.slice(o.length):e.name,size:P(e.size),modified:e.lastModified})).filter(e=>e.key!==""),C=[...O,...v],M=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],T=m.paginationToken||void 0,V=g(C,t,"objects","object",M,{paginationToken:T});console.log(V),t!=="json"&&t!=="xml"&&f(T)}export{F as default};
|
package/dist/lib/mk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as h}from"../chunk-KIT6R3V2.js";import{e as b}from"../chunk-
|
|
1
|
+
import{c as m}from"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as h}from"../chunk-KIT6R3V2.js";import{e as b}from"../chunk-R3KHIAWP.js";import{a as t,b as p}from"../chunk-S6KFKBMY.js";import{a as r}from"../chunk-IIF5VLQ7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{createBucket as O,put as A}from"@tigrisdata/storage";async function j(e){let l=t(e,["path"]);l||r("path argument is required");let{bucket:o,path:a}=h(l);o||r("Invalid path");let f=await b(),u=p(e);if(a){let s=a.endsWith("/")?a:`${a}/`,{error:c}=await A(s,"",{config:{...f,bucket:o}});c&&r(c),console.log(u==="json"?JSON.stringify({action:"created",type:"folder",bucket:o,path:s}):`Folder '${o}/${s}' created`),process.exit(0)}else{let c=t(e,["public"])?"public":t(e,["access","a","A"]),d=t(e,["enableSnapshots","enable-snapshots","s","S"]),S=t(e,["allow-object-acl","allowObjectAcl"]),k=t(e,["enable-directory-listing","enableDirectoryListing"]),y=t(e,["defaultTier","default-tier","t","T"]),w=t(e,["locations","l","L"]),n=t(e,["fork-of","forkOf","fork"]),i=t(e,["source-snapshot","sourceSnapshot","source-snap"]);i&&!n&&r("--source-snapshot requires --fork-of");let{error:g}=await O(o,{defaultTier:y??"STANDARD",enableSnapshot:d===!0,allowObjectAcl:S===!0,enableDirectoryListing:k===!0,access:c??"private",locations:m(w??"global"),...n?{sourceBucketName:n}:{},...i?{sourceBucketSnapshot:i}:{},config:f});g&&r(g),console.log(u==="json"?JSON.stringify({action:"created",type:"bucket",name:o}):`Bucket '${o}' created`),process.exit(0)}}export{j as default};
|
package/dist/lib/mv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S,b as W}from"../chunk-S77OAN6Y.js";import{a as x,b as j,d as E,f as J,g as U,i as q,j as R,k as _}from"../chunk-KIT6R3V2.js";import{e as D}from"../chunk-
|
|
1
|
+
import{a as S,b as W}from"../chunk-S77OAN6Y.js";import{a as x,b as j,d as E,f as J,g as U,i as q,j as R,k as _}from"../chunk-KIT6R3V2.js";import{e as D}from"../chunk-R3KHIAWP.js";import{a as $,b as T}from"../chunk-S6KFKBMY.js";import{a as s}from"../chunk-IIF5VLQ7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{copy as L,list as Q,move as V,put as X,remove as C}from"@tigrisdata/storage";var p=!1;async function Y(i){let a=$(i,["src"]),c=$(i,["dest"]),u=$(i,["yes","y","force","f"]),h=!!$(i,["recursive","r"]);p=T(i)==="json",(!a||!c)&&s("both src and dest arguments are required"),(!x(a)||!x(c))&&s("Both src and dest must be remote Tigris paths (t3:// or tigris://)");let e=j(a),t=j(c);e.bucket||s("Invalid source path"),t.bucket||s("Invalid destination path");let g=a.endsWith("/");!e.path&&!g&&s("Cannot move a bucket. Provide a path within the bucket.");let f=await D({withCredentialProvider:!0}),d=e.path.includes("*"),w=e.path.endsWith("/")||!e.path&&g;if(!d&&!w&&e.path&&(w=await E(e.bucket,e.path,f)),w&&!d&&!h&&s("Source is a remote folder (not moved). Use -r to move recursively."),d||w){let r=d?U(e.path):e.path?e.path.endsWith("/")?e.path:`${e.path}/`:"",n=!d&&e.path&&!e.path.endsWith("/")?e.path.split("/").filter(Boolean).pop()??"":"",m=[t.path?.replace(/\/$/,"")||"",n].filter(Boolean).join("/"),z=m?`${m}/`:"";e.bucket===t.bucket&&r===z&&s("Source and destination are the same");let{items:G,error:I}=await _(e.bucket,r||void 0,f);I&&s(I);let b=G.filter(o=>o.name!==r);if(d){let o=e.path.split("/").pop(),l=J(o);b=b.filter(v=>{let k=r?v.name.slice(r.length):v.name;return!h&&k.includes("/")?!1:l.test(k.split("/").pop())})}let y=!1;if(r&&!d){let{data:o}=await Q({prefix:r,limit:1,config:{...f,bucket:e.bucket}});y=!!o?.items?.some(l=>l.name===r)}if(b.length===0&&!y){console.log(p?JSON.stringify({action:"moved",count:0}):"No objects to move");return}let N=[...b.map(o=>o.name),...y?[r]:[]],H=R(N);if(!u&&(S("Use --yes to skip confirmation"),!await W(`Are you sure you want to move ${H} object(s)?`))){p||console.log("Aborted");return}let P=[];for(let o of b){let l=r?o.name.slice(r.length):o.name,v=m?`${m}/${l}`:l,k=await A(f,e.bucket,o.name,t.bucket,v);k.error?console.error(`Failed to move ${o.name}: ${k.error}`):(!p&&!q(o.name)&&console.log(`Moved t3://${e.bucket}/${o.name} -> t3://${t.bucket}/${v}`),P.push(o.name))}if(y)if(m){let o=`${m}/`,l=await A(f,e.bucket,r,t.bucket,o);l.error?console.error(`Failed to move folder marker: ${l.error}`):P.push(r)}else{let{error:o}=await C(r,{config:{...f,bucket:e.bucket}});o?console.error(`Failed to remove source folder marker: ${o.message}`):P.push(r)}let O=R(N,P);console.log(p?JSON.stringify({action:"moved",count:O}):`Moved ${O} object(s)`)}else{let r=e.path.split("/").pop(),n;if(t.path?t.path.endsWith("/")?n=`${t.path}${r}`:await E(t.bucket,t.path,f)?n=`${t.path}/${r}`:n=t.path:n=r,e.bucket===t.bucket&&e.path===n&&s("Source and destination are the same"),!u&&(S("Use --yes to skip confirmation"),!await W(`Are you sure you want to move 't3://${e.bucket}/${e.path}'?`))){p||console.log("Aborted");return}let M=await A(f,e.bucket,e.path,t.bucket,n);M.error&&s(M.error),console.log(p?JSON.stringify({action:"moved",count:1,src:`t3://${e.bucket}/${e.path}`,dest:`t3://${t.bucket}/${n}`}):`Moved t3://${e.bucket}/${e.path} -> t3://${t.bucket}/${n}`)}process.exit(0)}async function A(i,a,c,u,h){if(c.endsWith("/")){let{error:t}=await X(h,"",{config:{...i,bucket:u}});if(t)return{error:t.message};let{error:g}=await C(c,{config:{...i,bucket:a}});return g?{error:`Copied but failed to delete source: ${g.message}`}:{}}if(a===u){let{error:t}=await V(c,h,{config:{...i,bucket:a}});return t?{error:t.message}:{}}let{error:F}=await L(c,h,{srcBucket:a,destBucket:u,config:{...i,bucket:u}});if(F)return{error:F.message};let{error:e}=await C(c,{config:{...i,bucket:a}});return e?{error:`Copied but failed to delete source: ${e.message}`}:{}}export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,b as N}from"../../chunk-S77OAN6Y.js";import{h as C}from"../../chunk-KIT6R3V2.js";import{e as q}from"../../chunk-
|
|
1
|
+
import{a as V,b as N}from"../../chunk-S77OAN6Y.js";import{h as C}from"../../chunk-KIT6R3V2.js";import{e as q}from"../../chunk-R3KHIAWP.js";import{a as d,b as T}from"../../chunk-S6KFKBMY.js";import{a as w,b as o,c as O,d as S}from"../../chunk-IIF5VLQ7.js";import{b as A,c as $,d as j,j as M}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{listVersions as H,remove as R}from"@tigrisdata/storage";var r=M("objects","delete");async function W(c){A(r);let K=T(c),b=d(c,["bucket"]),E=d(c,["key"]),F=d(c,["yes","y","force"]),a=d(c,["version-id","versionId"]),u=!!d(c,["all-versions","allVersions"]);b||o(r,"Bucket name or path is required"),a&&u&&o(r,"Cannot use --version-id with --all-versions");let h=C(b),s=h.bucket,m=E||h.key||void 0;m||o(r,"Object key is required");let I={...await q(),bucket:s},n=Array.isArray(m)?m:[m];a&&n.length>1&&o(r,"--version-id targets a single object; pass exactly one key");let f=[];if(u)for(let e of n){let t=0,g,v,p=!1;for(;;){let{data:l,error:x}=await H({prefix:e,...g?{keyMarker:g}:{},...v?{versionIdMarker:v}:{},config:I});x&&o(r,x);for(let i of l.versions)i.name===e?(f.push({key:e,versionId:i.versionId}),t++):i.name>e&&(p=!0);for(let i of l.deleteMarkers)i.name===e?(f.push({key:e,versionId:i.versionId}),t++):i.name>e&&(p=!0);if(p||!l.hasMore)break;l.nextKeyMarker||o(r,`listVersions reported more pages but no nextKeyMarker for key '${e}'`),g=l.nextKeyMarker,v=l.nextVersionIdMarker}t===0&&o(r,`No versions or delete markers found for key '${e}'`)}else if(a)f.push({key:n[0],versionId:a});else for(let e of n)f.push({key:e});if(!F){V("Use --yes to skip confirmation");let e=u?`Hard-delete ${f.length} version(s) and delete marker(s) for ${n.length} object(s) from '${s}'?`:a?`Hard-delete version '${a}' of '${n[0]}' from '${s}'?`:`Delete ${n.length} object(s) from '${s}'?`;if(!await N(e)){console.log("Aborted");return}}let y=[],k=[];for(let e of f){let{error:t}=await R(e.key,{...e.versionId?{versionId:e.versionId}:{},config:I});t?(j(r,t.message,e),k.push({...e,error:t.message})):(y.push(e),$(r,e))}if(K==="json"){let e=O(r,{bucket:s}),t={action:"deleted",bucket:s,keys:y.map(g=>g.key),deleted:y,errors:k};e.length>0&&(t.nextActions=e),console.log(JSON.stringify(t))}k.length>0&&w(k[0].error,r),S(r,{bucket:s})}export{W as default};
|
package/dist/lib/objects/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as w}from"../../chunk-KIT6R3V2.js";import{e as k}from"../../chunk-
|
|
1
|
+
import{h as w}from"../../chunk-KIT6R3V2.js";import{e as k}from"../../chunk-R3KHIAWP.js";import{a as r,b as j}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-IIF5VLQ7.js";import{b as u,c as a,j as b}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createWriteStream as q,writeFileSync as T}from"fs";import{extname as C}from"path";import{Readable as S}from"stream";import{pipeline as x}from"stream/promises";import{get as y}from"@tigrisdata/storage";var e=b("objects","get"),E=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 F(t,m){let d=C(m||t).toLowerCase();return E.has(d)?"string":"stream"}async function N(t){u(e);let m=j(t),p=r(t,["bucket"]),d=r(t,["key"]),s=r(t,["output","o","O"]),v=r(t,["mode","m","M"]),g=r(t,["snapshot-version","snapshotVersion","snapshot"]),f=r(t,["version-id","versionId"]);p||c(e,"Bucket name or path is required");let{bucket:l,key:o}=w(p,d);o||c(e,"Object key is required");let h=await k();if((v||F(o,s))==="stream"){let{data:i,error:n}=await y(o,"stream",{...g?{snapshotVersion:g}:{},...f?{versionId:f}:{},config:{...h,bucket:l}});if(n&&c(e,n),s){let O=q(s);await x(S.fromWeb(i),O),a(e,{key:o,output:s}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:l,key:o,output:s}))}else await x(S.fromWeb(i),process.stdout),a(e)}else{let{data:i,error:n}=await y(o,"string",{...g?{snapshotVersion:g}:{},...f?{versionId:f}:{},config:{...h,bucket:l}});n&&c(e,n),s?(T(s,i),a(e,{key:o,output:s}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:l,key:o,output:s}))):(console.log(i),a(e))}}export{N as default};
|
package/dist/lib/objects/info.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,f as k}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-KIT6R3V2.js";import{e as l}from"../../chunk-
|
|
1
|
+
import{a as h,f as k}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-KIT6R3V2.js";import{e as l}from"../../chunk-R3KHIAWP.js";import{a as i,b as d}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-IIF5VLQ7.js";import{b as u,c as p,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{head as A}from"@tigrisdata/storage";var e=g("objects","info");async function I(o){u(e);let b=d(o),s=i(o,["bucket"]),y=i(o,["key"]),c=i(o,["snapshot-version","snapshotVersion","snapshot"]),a=i(o,["version-id","versionId"]);s||r(e,"Bucket name or path is required");let{bucket:f,key:n}=v(s,y);n||r(e,"Object key is required");let S=await l(),{data:t,error:m}=await A(n,{...c?{snapshotVersion:c}:{},...a?{versionId:a}:{},config:{...S,bucket:f}});m&&r(e,m),t||r(e,"Object not found");let j=[{metric:"Path",value:t.path},{metric:"Size",value:h(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}],O=k(j,b,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(O),p(e,{bucket:f,key:n})}export{I as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as w,b as z,d as l,e as d}from"../../chunk-AFM3TY2D.js";import{e as K}from"../../chunk-KIT6R3V2.js";import{e as C}from"../../chunk-R3KHIAWP.js";import{a as t,b,c as V}from"../../chunk-S6KFKBMY.js";import{b as a}from"../../chunk-IIF5VLQ7.js";import{b as u,c as x,e as v,j as I}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{listVersions as O}from"@tigrisdata/storage";var i=I("objects","list-versions");async function R(s){u(i);let k=t(s,["bucket"]),P=t(s,["prefix","p","P"]),m=t(s,["delimiter","d"]),c=t(s,["key-marker","keyMarker"]),f=t(s,["version-id-marker","versionIdMarker"]),g=b(s),y=!!t(s,["deleted"]),{limit:M}=V(s);k||a(i,"Bucket name is required");let h=K(k),S=h.bucket,j=P||h.path||void 0,L=await C(),{data:r,error:p}=await O({prefix:j,...m?{delimiter:m}:{},...y?{deleted:y}:{},...M!==void 0?{limit:M}:{},...c?{keyMarker:c}:{},...f?{versionIdMarker:f}:{},config:{...L,bucket:S}});p&&a(i,p);let o=r.versions.map(e=>({key:e.name,versionId:e.versionId,latest:e.isLatest?"yes":"",size:w(e.size),modified:e.lastModified})),n=r.deleteMarkers.map(e=>({key:e.name,versionId:e.versionId,latest:e.isLatest?"yes":"",modified:e.lastModified})),T=[{key:"key",header:"Key"},{key:"versionId",header:"Version ID"},{key:"latest",header:"Latest"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],D=[{key:"key",header:"Key"},{key:"versionId",header:"Version ID"},{key:"latest",header:"Latest"},{key:"modified",header:"Modified"}];if(g==="json")console.log(z({versions:r.versions,deleteMarkers:r.deleteMarkers,commonPrefixes:r.commonPrefixes,nextKeyMarker:r.nextKeyMarker,nextVersionIdMarker:r.nextVersionIdMarker,hasMore:r.hasMore}));else if(g==="xml"){let e=["<listVersions>"];e.push(" "+l(o,"versions","version").replace(/\n/g,`
|
|
2
2
|
`)),e.push(" "+l(n,"deleteMarkers","deleteMarker").replace(/\n/g,`
|
|
3
3
|
`)),e.push("</listVersions>"),console.log(e.join(`
|
|
4
|
-
`))}else{if(
|
|
5
|
-
Versions`),console.log(d(
|
|
6
|
-
Next page: --key-marker "${r.nextKeyMarker}"`;r.nextVersionIdMarker&&(e+=` --version-id-marker "${r.nextVersionIdMarker}"`),console.error(e)}}
|
|
4
|
+
`))}else{if(o.length===0&&n.length===0){v(i);return}if(o.length>0&&(console.log(`
|
|
5
|
+
Versions`),console.log(d(o,T))),n.length>0&&(console.log("Delete Markers"),console.log(d(n,D))),r.hasMore&&r.nextKeyMarker){let e=`
|
|
6
|
+
Next page: --key-marker "${r.nextKeyMarker}"`;r.nextVersionIdMarker&&(e+=` --version-id-marker "${r.nextVersionIdMarker}"`),console.error(e)}}x(i,{versions:o.length,deleteMarkers:n.length})}export{R as default};
|
package/dist/lib/objects/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as w,g as O}from"../../chunk-AFM3TY2D.js";import{e as T}from"../../chunk-KIT6R3V2.js";import{e as S}from"../../chunk-R3KHIAWP.js";import{a as e,b as z,c as P}from"../../chunk-S6KFKBMY.js";import{b as s}from"../../chunk-IIF5VLQ7.js";import{b as h,c as b,e as y,i as x,j}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{list as v}from"@tigrisdata/storage";var n=j("objects","list");async function B(t){h(n);let a=e(t,["bucket"]),A=e(t,["prefix","p","P"]),i=z(t),c=e(t,["snapshot-version","snapshotVersion","snapshot"]),f=e(t,["source"]),m=!!e(t,["deleted"]),{limit:d,pageToken:p}=P(t);a||s(n,"Bucket name is required");let g=T(a),E=g.bucket,F=A||g.path||void 0,M=await S(),{data:o,error:u}=await v({prefix:F,...c?{snapshotVersion:c}:{},...f?{source:f}:{},...m?{deleted:m}:{},...d!==void 0?{limit:d}:{},...p?{paginationToken:p}:{},config:{...M,bucket:E}});if(u&&s(n,u),!o.items||o.items.length===0){y(n);return}let l=o.items.map(r=>({key:r.name,size:w(r.size),modified:r.lastModified})),V=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],k=o.paginationToken||void 0,q=O(l,i,"objects","object",V,{paginationToken:k});console.log(q),i!=="json"&&i!=="xml"&&x(k),b(n,{count:l.length})}export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,b as d}from"../../chunk-S77OAN6Y.js";import{h as y}from"../../chunk-KIT6R3V2.js";import{e as l}from"../../chunk-R3KHIAWP.js";import{a as n,b as p}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-IIF5VLQ7.js";import{b as g,c as m,j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{purgeDeletedObject as O}from"@tigrisdata/storage";var r=a("objects","purge");async function q(e){g(r);let b=p(e),s=n(e,["bucket"]),k=n(e,["key"]),o=n(e,["version-id","versionId"]),v=n(e,["yes","y","force"]);s||i(r,"Bucket name or path is required");let{bucket:c,key:t}=y(s,k);if(t||i(r,"Object key is required"),o||i(r,"--version-id is required"),!v&&(u("Use --yes to skip confirmation"),!await d(`Permanently destroy version '${o}' of '${t}' in '${c}'? It can no longer be restored.`))){console.log("Aborted");return}let j=await l(),{error:f}=await O(t,o,{config:{...j,bucket:c}});f&&i(r,f),b==="json"&&console.log(JSON.stringify({action:"purged",bucket:c,key:t,versionId:o})),m(r,{key:t,bucket:c,versionId:o})}export{q as default};
|
package/dist/lib/objects/put.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R}from"../../chunk-EKW6XTGL.js";import{a as A}from"../../chunk-HPICBIXL.js";import{a as s,f as v}from"../../chunk-AFM3TY2D.js";import{h as j}from"../../chunk-KIT6R3V2.js";import{e as w}from"../../chunk-
|
|
1
|
+
import{a as R}from"../../chunk-EKW6XTGL.js";import{a as A}from"../../chunk-HPICBIXL.js";import{a as s,f as v}from"../../chunk-AFM3TY2D.js";import{h as j}from"../../chunk-KIT6R3V2.js";import{e as w}from"../../chunk-R3KHIAWP.js";import{a as n,b as z}from"../../chunk-S6KFKBMY.js";import{b as i,d as T}from"../../chunk-IIF5VLQ7.js";import{b as k,c as S,j as h}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createReadStream as E,statSync as M}from"fs";import{Readable as $}from"stream";import{put as N}from"@tigrisdata/storage";var t=h("objects","put");async function Y(r){k(t);let u=n(r,["bucket"]),l=n(r,["key"]),y=n(r,["file"]),C=n(r,["access","a","A"],"private"),O=n(r,["content-type","contentType","t","T"]),P=z(r);u||i(t,"Bucket name or path is required");let d=j(u),m=d.bucket,a=d.key||l,e=d.key&&l||y;a||i(t,"Object key is required");let q=!process.stdin.isTTY;!e&&!q&&i(t,"File path is required (or pipe data via stdin)");let f,o;if(e){try{o=M(e).size}catch{i(t,`File not found: ${e}`)}let p=E(e);f=$.toWeb(p)}else f=$.toWeb(process.stdin);let U=await w({withCredentialProvider:!0}),x=e?R(o):{multipart:!0,partSize:5*1024*1024,queueSize:8},F=O??(e?A(e):void 0),{data:c,error:g}=await N(a,f,{access:C==="public"?"public":"private",contentType:F,...x,onUploadProgress:({loaded:p,percentage:b})=>{o!==void 0&&o>0?process.stdout.write(`\rUploading: ${s(p)} / ${s(o)} (${b}%)`):process.stdout.write(`\rUploading: ${s(p)}`)},config:{...U,bucket:m}});process.stdout.write(`\r${" ".repeat(60)}\r`),g&&i(t,g);let W=[{path:c.path,size:s(c.size??o??0),contentType:c.contentType||"-",modified:c.modified}],B=v(W,P,"objects","object",[{key:"path",header:"Path"},{key:"size",header:"Size"},{key:"contentType",header:"Content-Type"},{key:"modified",header:"Modified"}]);console.log(B),S(t,{key:a,bucket:m}),T(t,{key:a,bucket:m})}export{Y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as p}from"../../chunk-KIT6R3V2.js";import{e as k}from"../../chunk-R3KHIAWP.js";import{a as n,b as u}from"../../chunk-S6KFKBMY.js";import{b as t,d}from"../../chunk-IIF5VLQ7.js";import{b as g,c as m,j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{restoreDeletedObject as j}from"@tigrisdata/storage";var r=a("objects","restore-deleted");async function v(e){g(r);let l=u(e),c=n(e,["bucket"]),b=n(e,["key"]),s=n(e,["version-id","versionId"]);c||t(r,"Bucket name or path is required");let{bucket:o,key:i}=p(c,b);i||t(r,"Object key is required"),s||t(r,"--version-id is required");let y=await k(),{error:f}=await j(i,s,{config:{...y,bucket:o}});f&&t(r,f),l==="json"&&console.log(JSON.stringify({action:"restored",bucket:o,key:i,versionId:s})),m(r,{key:i,bucket:o}),d(r,{bucket:o})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as y}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-KIT6R3V2.js";import{e as h}from"../../chunk-
|
|
1
|
+
import{f as y}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-KIT6R3V2.js";import{e as h}from"../../chunk-R3KHIAWP.js";import{a as e,b as d}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-IIF5VLQ7.js";import{b as g,c as p,e as l,j as k}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{getRestoreInfo as A}from"@tigrisdata/storage";var t=k("objects","restore-info");async function I(r){g(t);let n=d(r),c=e(r,["bucket"]),S=e(r,["key"]),a=e(r,["version-id","versionId"]),f=e(r,["snapshot-version","snapshotVersion","snapshot"]);c||i(t,"Bucket name or path is required");let{bucket:m,key:o}=v(c,S);o||i(t,"Object key is required");let b=await h(),{data:s,error:u}=await A(o,{...a?{versionId:a}:{},...f?{snapshotVersion:f}:{},config:{...b,bucket:m}});if(u&&i(t,u),!s){n==="json"?console.log(JSON.stringify({status:null})):l(t);return}let O=[{metric:"Path",value:o},{metric:"Status",value:s.status},...s.expiresAt?[{metric:"Expires",value:s.expiresAt.toISOString()}]:[]],x=y(O,n,"restore-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(x),p(t,{bucket:m,key:o})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as k}from"../../chunk-KIT6R3V2.js";import{e as y}from"../../chunk-
|
|
1
|
+
import{h as k}from"../../chunk-KIT6R3V2.js";import{e as y}from"../../chunk-R3KHIAWP.js";import{a as t,b as p}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-IIF5VLQ7.js";import{b as d,c as u,j as b}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{restoreObject as j}from"@tigrisdata/storage";var s=b("objects","restore");async function O(e){d(s);let h=p(e),c=t(e,["bucket"]),l=t(e,["key"]),a=t(e,["version-id","versionId"]),f=t(e,["snapshot-version","snapshotVersion","snapshot"]),g=t(e,["days","d"]);c||n(s,"Bucket name or path is required");let{bucket:i,key:o}=k(c,l);o||n(s,"Object key is required");let r;g!==void 0&&(r=Number(g),(!Number.isInteger(r)||r<1)&&n(s,"--days must be a positive integer"));let v=await y(),{error:m}=await j(o,{...r!==void 0?{days:r}:{},...a?{versionId:a}:{},...f?{snapshotVersion:f}:{},config:{...v,bucket:i}});m&&n(s,m),h==="json"&&console.log(JSON.stringify({action:"restore-requested",bucket:i,key:o,days:r??1})),u(s,{key:o,bucket:i})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as l}from"../../chunk-KIT6R3V2.js";import{e as k}from"../../chunk-
|
|
1
|
+
import{h as l}from"../../chunk-KIT6R3V2.js";import{e as k}from"../../chunk-R3KHIAWP.js";import{a as o,b}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-IIF5VLQ7.js";import{b as m,c as u,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{setObjectAccess as v}from"@tigrisdata/storage";var e=p("objects","set-access");async function j(r){m(e);let d=b(r),a=o(r,["bucket"]),f=o(r,["key"]),y=o(r,["access"]);a||c(e,"Bucket name or path is required");let i=l(a),n=i.bucket,s=i.key||f,t=i.key?f:y;s||c(e,"Object key is required"),t||c(e,"Access level is required (public or private)"),t!=="public"&&t!=="private"&&c(e,'Access level must be either "public" or "private"');let A=await k(),{error:g}=await v(s,{access:t,config:{...A,bucket:n}});g&&c(e,g),d==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,key:s,access:t})),u(e,{key:s,bucket:n,access:t})}export{j as default};
|
package/dist/lib/objects/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d}from"../../chunk-KIT6R3V2.js";import{e as b}from"../../chunk-
|
|
1
|
+
import{h as d}from"../../chunk-KIT6R3V2.js";import{e as b}from"../../chunk-R3KHIAWP.js";import{a as i,b as y}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-IIF5VLQ7.js";import{b as p,c as k,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{move as v,setObjectAccess as A}from"@tigrisdata/storage";var e=l("objects","set");async function O(r){p(e);let w=y(r),f=i(r,["bucket"]),j=i(r,["key"]),s=i(r,["access","a","A"]),c=i(r,["new-key","n","newKey"]);f||t(e,"Bucket name or path is required");let{bucket:n,key:a}=d(f,j);a||t(e,"Object key is required"),s||t(e,"Access level is required (--access public|private)");let g={...await b(),bucket:n},o=a;if(c){let{error:u}=await v(a,c,{config:g});u&&t(e,u),o=c}let{error:m}=await A(o,{access:s==="public"?"public":"private",config:g});m&&t(e,m),w==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,key:o,access:s,...c?{newKey:c}:{}})),k(e,{key:o,bucket:n})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as O,g as d}from"../../chunk-
|
|
1
|
+
import{e as O,g as d}from"../../chunk-R3KHIAWP.js";import{a as p,b as u}from"../../chunk-S6KFKBMY.js";import{b as i,d as m}from"../../chunk-IIF5VLQ7.js";import{b as e,c,g as f,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import{a as s}from"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.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-AFM3TY2D.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{e as k,g as I}from"../../chunk-
|
|
1
|
+
import{f as q}from"../../chunk-AFM3TY2D.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{e as k,g as I}from"../../chunk-R3KHIAWP.js";import{b as S}from"../../chunk-S6KFKBMY.js";import{b as O}from"../../chunk-IIF5VLQ7.js";import{b as u,c as r,e as h,j as z}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import{c as w}from"../../chunk-J3MAV7JB.js";import{h as f,i as p}from"../../chunk-F4AGJWCK.js";import{listOrganizations as F}from"@tigrisdata/iam";import U from"enquirer";var i=z("organizations","list");async function $(x){if(u(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&&O(i,a),e=g?.organizations??[]}if(e.length===0){h(i);return}let o=p();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 f(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{e as S,g as $}from"../../chunk-
|
|
1
|
+
import{e as S,g as $}from"../../chunk-R3KHIAWP.js";import{a as z,b as O}from"../../chunk-S6KFKBMY.js";import{a as p,b as r,d as u}from"../../chunk-IIF5VLQ7.js";import{b as c,c as f,d as l,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import{h as g}from"../../chunk-F4AGJWCK.js";import{listOrganizations as A}from"@tigrisdata/iam";var n=d("organizations","select");async function N(a){if(c(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
|
`);l(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 A}from"../chunk-AFM3TY2D.js";import{e as v}from"../chunk-KIT6R3V2.js";import{a as K,e as w}from"../chunk-
|
|
1
|
+
import{b as A}from"../chunk-AFM3TY2D.js";import{e as v}from"../chunk-KIT6R3V2.js";import{a as K,e as w}from"../chunk-R3KHIAWP.js";import{a,b as k}from"../chunk-S6KFKBMY.js";import{a as n}from"../chunk-IIF5VLQ7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import{c as h}from"../chunk-J3MAV7JB.js";import{i as m,p}from"../chunk-F4AGJWCK.js";import{listAccessKeys as P}from"@tigrisdata/iam";import{getPresignedUrl as T}from"@tigrisdata/storage";import $ from"enquirer";var{prompt:b}=$;async function q(s){let r=a(s,["path"]);r||n("path argument is required");let{bucket:o,path:e}=v(r);o||n("Invalid path"),e||n("Object key is required");let t=a(s,["method","m"])??"get",i=parseInt(a(s,["expires-in","expiresIn","e"])??"3600",10),l=k(s,"url"),c=a(s,["access-key","accessKey"]),C=a(s,["select"]),f=a(s,["snapshot-version","snapshotVersion","snapshot"]);f&&t!=="get"&&n("Snapshot version is only supported for GET requests");let d=await w(),g;c?g=c:d.accessKeyId?g=d.accessKeyId:(p()!=="oauth"&&n("Presigning requires an access key. Pass --access-key or configure credentials."),C?g=await O(o,t):g=await E(o,t)),g||n("Presigning requires an access key. Pass --access-key or configure credentials.");let{data:u,error:y}=await T(e,{method:t,expiresIn:i,accessKeyId:g,...f?{snapshotVersion:f}:{},config:{...d,bucket:o}});y&&n(y),console.log(l==="json"?A({url:u.url,expiresIn:u.expiresIn,method:t,bucket:o,key:e}):u.url),process.exit(0)}async function I(){let r=await h().getAccessToken(),o=m(),e=K(),{data:t,error:i}=await P({config:{sessionToken:r,organizationId:o??void 0,iamEndpoint:e.iamEndpoint}});return i&&n(i),(!t.accessKeys||t.accessKeys.length===0)&&n('No access keys found. Create one with "tigris access-keys create <name>"'),t.accessKeys}function x(s,r,o){return s.roles?s.roles.some(e=>e.role==="NamespaceAdmin"?!0:e.bucket!==r&&e.bucket!=="*"?!1:o==="put"?e.role==="Editor":e.role==="Editor"||e.role==="ReadOnly"):!1}async function E(s,r){let e=(await I()).filter(i=>i.status==="active");e.length===0&&n('No active access keys found. Create one with "tigris access-keys create <name>"');let t=e.find(i=>x(i,s,r));return t||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: ${t.name} (${t.id})`),t.id}async function O(s,r){process.stdin.isTTY||n("Interactive selection requires a TTY. Omit --select to auto-resolve, or pass --access-key tid_...");let e=(await I()).filter(c=>c.status==="active");e.length===0&&n('No active access keys found. Create one with "tigris access-keys create <name>"');let t=e.filter(c=>x(c,s,r)),i;if(t.length>0?i=t:(console.error(`No access keys with explicit access to bucket "${s}" found. Showing all active keys.`),i=e),i.length===1)return console.error(`Using access key: ${i[0].name} (${i[0].id})`),i[0].id;let{selectedKey:l}=await b({type:"select",name:"selectedKey",message:"Select an access key for presigning:",choices:i.map(c=>({name:c.id,message:`${c.name} (${c.id})`}))});return l}export{q as default,x as keyMatchesOperation};
|
package/dist/lib/rm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,b as v}from"../chunk-S77OAN6Y.js";import{a as I,b as M,d as N,f as E,g as J,i as T,j as R,k as U}from"../chunk-KIT6R3V2.js";import{e as W}from"../chunk-
|
|
1
|
+
import{a as p,b as v}from"../chunk-S77OAN6Y.js";import{a as I,b as M,d as N,f as E,g as J,i as T,j as R,k as U}from"../chunk-KIT6R3V2.js";import{e as W}from"../chunk-R3KHIAWP.js";import{a as h,b as P}from"../chunk-S6KFKBMY.js";import{a as s}from"../chunk-IIF5VLQ7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{list as C,remove as S,removeBucket as D}from"@tigrisdata/storage";var i=!1;async function K(m){let d=h(m,["path"]),u=h(m,["yes","y","force","f"]),x=!!h(m,["recursive","r"]);i=P(m)==="json",d||s("path argument is required"),I(d)||s("Path must be a remote Tigris path (t3:// or tigris://)");let{bucket:o,path:t}=M(d);o||s("Invalid path");let n=await W(),F=d.endsWith("/");if(!t&&!F){if(!u&&(p("Use --yes to skip confirmation"),!await v(`Are you sure you want to delete bucket '${o}'?`))){i||console.log("Aborted");return}let{error:r}=await D(o,{config:n,force:u});r&&s(r),console.log(i?JSON.stringify({action:"removed",bucket:o}):`Removed bucket '${o}'`);return}let c=t.includes("*"),g=t.endsWith("/")||!t&&F;if(!c&&!g&&(g=await N(o,t,n)),g&&!c&&!x&&s("Source is a remote folder (not removed). Use -r to remove recursively."),c||g){let r=c?J(t):t?t.endsWith("/")?t:`${t}/`:"",{items:y,error:A}=await U(o,r||void 0,n);A&&s(A);let l=y;if(c){let e=t.split("/").pop(),f=E(e);l=l.filter(k=>{if(k.name===r)return!1;let O=r?k.name.slice(r.length):k.name;return!x&&O.includes("/")?!1:f.test(O.split("/").pop())})}let a=r,q=l.some(e=>e.name===a),w=!1;if(!q&&!c){let{data:e}=await C({prefix:a,limit:1,config:{...n,bucket:o}});w=e?.items?.some(f=>f.name===a)||!1}let $=[...l.map(e=>e.name),...w?[a]:[]];if($.length===0){console.log(i?JSON.stringify({action:"removed",count:0}):"No objects to remove");return}let B=R($);if(!u&&(p("Use --yes to skip confirmation"),!await v(`Are you sure you want to delete ${B} object(s)?`))){i||console.log("Aborted");return}let b=[];for(let e of l){let{error:f}=await S(e.name,{config:{...n,bucket:o}});f?console.error(`Failed to remove ${e.name}: ${f.message}`):(!i&&!T(e.name)&&console.log(`Removed t3://${o}/${e.name}`),b.push(e.name))}if(w){let{error:e}=await S(a,{config:{...n,bucket:o}});e?console.error(`Failed to remove ${a}: ${e.message}`):b.push(a)}let j=R($,b);console.log(i?JSON.stringify({action:"removed",count:j}):`Removed ${j} object(s)`)}else{if(!u&&(p("Use --yes to skip confirmation"),!await v(`Are you sure you want to delete 't3://${o}/${t}'?`))){i||console.log("Aborted");return}let{error:r}=await S(t,{config:{...n,bucket:o}});r&&s(r),console.log(i?JSON.stringify({action:"removed",count:1,path:`t3://${o}/${t}`}):`Removed t3://${o}/${t}`)}process.exit(0)}export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S,b as x}from"../../chunk-S77OAN6Y.js";import{e as A}from"../../chunk-
|
|
1
|
+
import{a as S,b as x}from"../../chunk-S77OAN6Y.js";import{e as A}from"../../chunk-R3KHIAWP.js";import{a,b as y}from"../../chunk-S6KFKBMY.js";import{a as d,b as c,c as h,d as v}from"../../chunk-IIF5VLQ7.js";import{b as m,c as l,d as u,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{deleteBucketSnapshot as q}from"@tigrisdata/storage";var t=p("snapshots","delete");async function N(n){m(t);let k=y(n),r=a(n,["name"]),s=a(n,["version"]),w=a(n,["yes","y","force"]);r||c(t,"Bucket name is required"),s||c(t,"Snapshot version is required");let f=(Array.isArray(s)?s:[s]).filter(e=>e.length>0);f.length===0&&c(t,"Snapshot version is required");let b=await A();if(!w&&(S("Use --yes to skip confirmation"),!await x(`Delete ${f.length} snapshot(s) from '${r}'? This cannot be undone.`))){console.log("Aborted");return}let g=[],i=[];for(let e of f){let{error:o}=await q(r,e,{config:b});o?(u(t,o.message,{name:r,version:e}),i.push({version:e,error:o.message})):(g.push(e),l(t,{name:r,version:e}))}if(k==="json"){let e=h(t,{name:r}),o={action:"deleted",bucket:r,versions:g,errors:i};e.length>0&&(o.nextActions=e),console.log(JSON.stringify(o))}i.length>0&&d(i[0].error,t),v(t,{name:r})}export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as S}from"../../chunk-AFM3TY2D.js";import{e as x}from"../../chunk-
|
|
1
|
+
import{g as S}from"../../chunk-AFM3TY2D.js";import{e as x}from"../../chunk-R3KHIAWP.js";import{a as k,b as y,c as T}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-IIF5VLQ7.js";import{b as f,c as u,e as d,i as h,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.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{e as g}from"../../chunk-
|
|
1
|
+
import{e as g}from"../../chunk-R3KHIAWP.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-IIF5VLQ7.js";import{b as m,c,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.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{c as w}from"../chunk-JNSFDQGG.js";import{a as d,f as m}from"../chunk-AFM3TY2D.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as I}from"../chunk-KIT6R3V2.js";import{e as j}from"../chunk-
|
|
1
|
+
import{c as w}from"../chunk-JNSFDQGG.js";import{a as d,f as m}from"../chunk-AFM3TY2D.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as I}from"../chunk-KIT6R3V2.js";import{e as j}from"../chunk-R3KHIAWP.js";import{a as u,b as O}from"../chunk-S6KFKBMY.js";import{b as i}from"../chunk-IIF5VLQ7.js";import{b as y,c,j as b}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{getBucketInfo as A,getStats as M,head as z}from"@tigrisdata/storage";var t=b("stat");async function C(s){y(t);let h=u(s,["path"]),f=O(s),v=u(s,["snapshot-version","snapshotVersion","snapshot"]),S=u(s,["version-id","versionId"]),l=await j();if(!h){let{data:o,error:a}=await M({config:l});a&&i(t,a);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)}],g=m(p,f,"stats","stat",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(g),c(t),process.exit(0)}let{bucket:r,path:n}=I(h);if(r||i(t,"Invalid path"),!n||n==="/"){let{data:o,error:a}=await A(r,{config:l});a&&i(t,a);let p=w(o).map(({label:T,value:V})=>({metric:T,value:V})),g=m(p,f,"bucket-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(g),c(t,{bucket:r}),process.exit(0)}let{data:e,error:k}=await z(n,{...v?{snapshotVersion:v}:{},...S?{versionId:S}:{},config:{...l,bucket:r}});k&&i(t,k),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=m(x,f,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(B),c(t,{bucket:r,path:n}),process.exit(0)}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-
|
|
1
|
+
import{b as m}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-IIF5VLQ7.js";import{c as i,j as s}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import{a as o,g as n}from"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";var t=s("telemetry","disable");async function l(a={}){try{let e=m(a);if(n(!0)||r(t,new Error(`Could not save your preference to ${o}. Set TIGRIS_NO_TELEMETRY=1 in your environment to disable telemetry instead.`)),e==="json"){console.log(JSON.stringify({enabled:!1,action:"disabled"}));return}i(t)}catch(e){r(t,e)}}export{l as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as c}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-
|
|
1
|
+
import{b as c}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-IIF5VLQ7.js";import{c as l,j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import{a as r,d as i,g as s}from"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";var n=a("telemetry","enable");async function m(f={}){try{let t=c(f);s(!1)||o(n,new Error(`Could not save your preference to ${r}. Check the permissions on that file and its directory.`));let e=i();if(t==="json"){console.log(JSON.stringify({enabled:e===null,action:"enabled",...e?{stillDisabledBy:e}:{}}));return}l(n),(e==="TIGRIS_NO_TELEMETRY"||e==="DO_NOT_TRACK")&&console.log(`
|
|
2
2
|
Note: ${e} is set in this environment, which still turns telemetry off.
|
|
3
3
|
Unset it to let this setting take effect.`)}catch(t){o(n,t)}}export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as m}from"../../chunk-S6KFKBMY.js";import{b as l}from"../../chunk-
|
|
1
|
+
import{b as m}from"../../chunk-S6KFKBMY.js";import{b as l}from"../../chunk-IIF5VLQ7.js";import{j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import{a as r,d as i}from"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import{homedir as d}from"os";var c=a("telemetry","status"),h={TIGRIS_NO_TELEMETRY:"the TIGRIS_NO_TELEMETRY environment variable is set",DO_NOT_TRACK:"the DO_NOT_TRACK environment variable is set","opt-out":"you disabled it on this machine",development:"this is a development build",test:"this is a test environment"};function u(n){let t=d();return n.startsWith(t)?`~${n.slice(t.length)}`:n}async function T(n={}){try{let t=m(n),e=i(),o=e===null;if(t==="json"){console.log(JSON.stringify({enabled:o,disabledReason:e,settingsFile:r}));return}let s=["",`Telemetry: ${o?"enabled":"disabled"}`];o||s.push(` Reason: ${h[e]}`),s.push("","What is collected:"," Usage analytics which commands you run and their arguments, CLI"," version, OS, install method, and whether you are in CI"," Error reports crashes and unexpected failures","","Never collected:"," credentials of any kind \u2014 access keys, secrets, tokens, passwords \u2014"," or your hostname. Both are stripped before anything is sent.","",`Settings file: ${u(r)}`,""),e==="TIGRIS_NO_TELEMETRY"||e==="DO_NOT_TRACK"?s.push(`Unset ${e} to re-enable, then run "tigris telemetry enable".`,""):o?s.push("To disable: tigris telemetry disable",""):e==="opt-out"&&s.push("To re-enable: tigris telemetry enable",""),console.log(s.join(`
|
|
2
2
|
`))}catch(t){l(c,t)}}export{T as default};
|
package/dist/lib/touch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f}from"../chunk-KIT6R3V2.js";import{e as s}from"../chunk-
|
|
1
|
+
import{e as f}from"../chunk-KIT6R3V2.js";import{e as s}from"../chunk-R3KHIAWP.js";import{a,b as c}from"../chunk-S6KFKBMY.js";import{a as t}from"../chunk-IIF5VLQ7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.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
|
|
1
|
+
import{b as u}from"../chunk-S6KFKBMY.js";import{b as l,c as f,d}from"../chunk-76VFN2EJ.js";import"../chunk-G4OJTPSI.js";import{b as p}from"../chunk-IIF5VLQ7.js";import{b as i,c as a,f as c,j as m}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import{a as r}from"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import{g as s}from"../chunk-V6JZFDRE.js";import{execSync as h}from"child_process";var e=m("update");async function N(g={}){let v=u(g);i(e);try{let o=await d(),t=l(r,o),n=f();if(v==="json"){console.log(JSON.stringify({currentVersion:r,latestVersion:o,updateAvailable:t,updateCommand:n}));return}console.log(`Current version: ${r}`),t?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",env:{...process.env,[s]:"1"},...process.platform==="win32"?{shell:"powershell.exe"}:{}}),a(e,{latestVersion:o})):c(e,{currentVersion:r})}catch(o){p(e,o)}}export{N as default};
|
package/dist/lib/whoami.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as $,d as b}from"../chunk-
|
|
1
|
+
import{a as $,d as b}from"../chunk-R3KHIAWP.js";import{b as w}from"../chunk-S6KFKBMY.js";import{b as y}from"../chunk-IIF5VLQ7.js";import{f as g,j as A}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import{c as z}from"../chunk-J3MAV7JB.js";import{i as I}from"../chunk-F4AGJWCK.js";import{whoami as k}from"@tigrisdata/iam";var f=A("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=I(),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){y(f,u)}}export{K as default};
|