@tigrisdata/cli 3.3.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/client.js +1 -1
- package/dist/auth/fly.js +1 -1
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/{chunk-YN2TKPPT.js → chunk-3QCSRNXC.js} +1 -1
- package/dist/{chunk-KQTMMFPE.js → chunk-76L56E5U.js} +1 -1
- package/dist/chunk-7ZCVOA6A.js +1 -0
- package/dist/chunk-AFM3TY2D.js +7 -0
- package/dist/chunk-BN6MNZDO.js +1 -0
- package/dist/{chunk-EFPPY2JQ.js → chunk-CL4GEWT2.js} +1 -1
- package/dist/{chunk-7ZUCJBD5.js → chunk-D7WXNA2O.js} +1 -1
- package/dist/{chunk-OHGCOC5Q.js → chunk-F4AGJWCK.js} +1 -1
- package/dist/{chunk-S7EO4QWK.js → chunk-JLNCN27M.js} +1 -1
- package/dist/{chunk-LAB2KJTN.js → chunk-JNSFDQGG.js} +1 -1
- package/dist/{chunk-2ITYREA5.js → chunk-KJA757WE.js} +1 -1
- package/dist/{chunk-GAWFFIPC.js → chunk-KJBSIIND.js} +1 -1
- package/dist/{chunk-PPNBQWSR.js → chunk-NI4EYBQH.js} +1 -1
- package/dist/chunk-Q6UVMHAZ.js +1 -0
- package/dist/{chunk-UBANDLB4.js → chunk-SE5TRZWU.js} +1 -1
- package/dist/{chunk-3EAZ2L6H.js → chunk-VNUR4TRP.js} +1 -1
- package/dist/{chunk-D3UQD6W2.js → chunk-W52B2I2N.js} +1 -1
- package/dist/chunk-X3H2PJ6S.js +8 -0
- package/dist/{chunk-G4DHMSCQ.js → chunk-Z2LVZ3ZF.js} +4 -4
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -1
- package/dist/lib/access-keys/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 -0
- package/dist/lib/buckets/migrate.js +1 -1
- package/dist/lib/buckets/rebase.js +1 -0
- 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 +3 -3
- 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 +2 -2
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/oauth.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/logout.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list-versions.js +1 -1
- package/dist/lib/objects/list.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- 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/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 +52 -2
- package/dist/utils/bucket-info.js +1 -1
- package/dist/utils/exit.js +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/messages.js +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/specs.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +15 -58
- package/dist/chunk-BVSVEXGE.js +0 -8
- package/dist/chunk-IRDNZN7R.js +0 -7
- package/dist/chunk-JW6HI5E4.js +0 -1
- package/dist/chunk-RXNG56FL.js +0 -1
- package/dist/chunk-RZPBM4CD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as K,b as w,d as l,e as d}from"../../chunk-
|
|
1
|
+
import{a as K,b as w,d as l,e as d}from"../../chunk-AFM3TY2D.js";import{e as C}from"../../chunk-7ZCVOA6A.js";import{d as b}from"../../chunk-3QCSRNXC.js";import{a as o,b as I,c as V}from"../../chunk-S6KFKBMY.js";import{b as a}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as p,c as u,e as x,j as v}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{listVersions as D}from"@tigrisdata/storage";var i=v("objects","list-versions");async function O(s){p(i);let k=o(s,["bucket"]),z=o(s,["prefix","p","P"]),m=o(s,["delimiter","d"]),c=o(s,["key-marker","keyMarker"]),f=o(s,["version-id-marker","versionIdMarker"]),g=I(s),{limit:y}=V(s);k||a(i,"Bucket name is required");let M=C(k),P=M.bucket,S=z||M.path||void 0,j=await b(),{data:r,error:h}=await D({prefix:S,...m?{delimiter:m}:{},...y!==void 0?{limit:y}:{},...c?{keyMarker:c}:{},...f?{versionIdMarker:f}:{},config:{...j,bucket:P}});h&&a(i,h);let t=r.versions.map(e=>({key:e.name,versionId:e.versionId,latest:e.isLatest?"yes":"",size:K(e.size),modified:e.lastModified})),n=r.deleteMarkers.map(e=>({key:e.name,versionId:e.versionId,latest:e.isLatest?"yes":"",modified:e.lastModified})),L=[{key:"key",header:"Key"},{key:"versionId",header:"Version ID"},{key:"latest",header:"Latest"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],T=[{key:"key",header:"Key"},{key:"versionId",header:"Version ID"},{key:"latest",header:"Latest"},{key:"modified",header:"Modified"}];if(g==="json")console.log(w({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(t,"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
4
|
`))}else{if(t.length===0&&n.length===0){x(i);return}if(t.length>0&&(console.log(`
|
package/dist/lib/objects/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T,g as w}from"../../chunk-
|
|
1
|
+
import{a as T,g as w}from"../../chunk-AFM3TY2D.js";import{e as S}from"../../chunk-7ZCVOA6A.js";import{d as P}from"../../chunk-3QCSRNXC.js";import{a as e,b as j,c as z}from"../../chunk-S6KFKBMY.js";import{b as s}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as l,c as h,e as b,i as y,j as x}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{list as q}from"@tigrisdata/storage";var n=x("objects","list");async function v(t){l(n);let a=e(t,["bucket"]),O=e(t,["prefix","p","P"]),i=j(t),c=e(t,["snapshot-version","snapshotVersion","snapshot"]),f=e(t,["source"]),{limit:m,pageToken:p}=z(t);a||s(n,"Bucket name is required");let g=S(a),A=g.bucket,E=O||g.path||void 0,F=await P(),{data:o,error:d}=await q({prefix:E,...c?{snapshotVersion:c}:{},...f?{source:f}:{},...m!==void 0?{limit:m}:{},...p?{paginationToken:p}:{},config:{...F,bucket:A}});if(d&&s(n,d),!o.items||o.items.length===0){b(n);return}let u=o.items.map(r=>({key:r.name,size:T(r.size),modified:r.lastModified})),M=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],k=o.paginationToken||void 0,V=w(u,i,"objects","object",M,{paginationToken:k});console.log(V),i!=="json"&&i!=="xml"&&y(k),h(n,{count:u.length})}export{v 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-
|
|
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-7ZCVOA6A.js";import{d as w}from"../../chunk-3QCSRNXC.js";import{a as n,b as z}from"../../chunk-S6KFKBMY.js";import{b as i,d as T}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as S,j as h}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as v}from"../../chunk-
|
|
1
|
+
import{f as v}from"../../chunk-AFM3TY2D.js";import{h as y}from"../../chunk-7ZCVOA6A.js";import{d}from"../../chunk-3QCSRNXC.js";import{a as n,b as k}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as u,c as g,e as p,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{getRestoreInfo as x}from"@tigrisdata/storage";var t=l("objects","restore-info");async function A(r){u(t);let s=k(r),c=n(r,["bucket"]),S=n(r,["key"]),a=n(r,["version-id","versionId"]);c||i(t,"Bucket name or path is required");let{bucket:f,key:e}=y(c,S);e||i(t,"Object key is required");let b=await d(),{data:o,error:m}=await x(e,{...a?{versionId:a}:{},config:{...b,bucket:f}});if(m&&i(t,m),!o){s==="json"?console.log(JSON.stringify({status:null})):p(t);return}let O=[{metric:"Path",value:e},{metric:"Status",value:o.status},...o.expiresAt?[{metric:"Expires",value:o.expiresAt.toISOString()}]:[]],h=v(O,s,"restore-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(h),g(t,{bucket:f,key:e})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as k}from"../../chunk-
|
|
1
|
+
import{h as k}from"../../chunk-7ZCVOA6A.js";import{d as y}from"../../chunk-3QCSRNXC.js";import{a as i,b}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as a,c as d,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{restoreObject as v}from"@tigrisdata/storage";var r=u("objects","restore");async function O(t){a(r);let p=b(t),c=i(t,["bucket"]),l=i(t,["key"]),f=i(t,["version-id","versionId"]),g=i(t,["days","d"]);c||o(r,"Bucket name or path is required");let{bucket:s,key:n}=k(c,l);n||o(r,"Object key is required");let e;g!==void 0&&(e=Number(g),(!Number.isInteger(e)||e<1)&&o(r,"--days must be a positive integer"));let j=await y(),{error:m}=await v(n,{...e!==void 0?{days:e}:{},...f?{versionId:f}:{},config:{...j,bucket:s}});m&&o(r,m),p==="json"&&console.log(JSON.stringify({action:"restore-requested",bucket:s,key:n,days:e??1})),d(r,{key:n,bucket:s})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as l}from"../../chunk-
|
|
1
|
+
import{h as l}from"../../chunk-7ZCVOA6A.js";import{d as k}from"../../chunk-3QCSRNXC.js";import{a as o,b}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as u,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.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-
|
|
1
|
+
import{h as d}from"../../chunk-7ZCVOA6A.js";import{d as b}from"../../chunk-3QCSRNXC.js";import{a as i,b as y}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as p,c as k,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.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{d as O,f as d}from"../../chunk-
|
|
1
|
+
import{d as O,f as d}from"../../chunk-3QCSRNXC.js";import{a as p,b as u}from"../../chunk-S6KFKBMY.js";import{b as i,d as m}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as e,c,g as f,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.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-
|
|
1
|
+
import{f as q}from"../../chunk-AFM3TY2D.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{d as k,f as I}from"../../chunk-3QCSRNXC.js";import{b as S}from"../../chunk-S6KFKBMY.js";import{b as h}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as r,e as p,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import{c as w}from"../../chunk-VNUR4TRP.js";import{h as z,i as O}from"../../chunk-F4AGJWCK.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-3QCSRNXC.js";import{a as z,b as O}from"../../chunk-S6KFKBMY.js";import{a as d,b as r,d as p}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as g,c,d as f,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import{h as u}from"../../chunk-F4AGJWCK.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 A}from"../chunk-
|
|
1
|
+
import{b as A}from"../chunk-AFM3TY2D.js";import{e as v}from"../chunk-7ZCVOA6A.js";import{a as K,d as w}from"../chunk-3QCSRNXC.js";import{a,b as k}from"../chunk-S6KFKBMY.js";import{a as n}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import{c as h}from"../chunk-VNUR4TRP.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 v,b as h}from"../chunk-S77OAN6Y.js";import{a as j,b as I,d as N,f as O,g as E,i as J}from"../chunk-
|
|
1
|
+
import{a as v,b as h}from"../chunk-S77OAN6Y.js";import{a as j,b as I,d as N,f as O,g as E,i as J}from"../chunk-7ZCVOA6A.js";import{d as W}from"../chunk-3QCSRNXC.js";import{a as $,b as P}from"../chunk-S6KFKBMY.js";import{a as s}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import"../chunk-VNUR4TRP.js";import"../chunk-F4AGJWCK.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{g as S}from"../../chunk-
|
|
1
|
+
import{g as S}from"../../chunk-AFM3TY2D.js";import{d as x}from"../../chunk-3QCSRNXC.js";import{a as k,b as y,c as T}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.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-ATBINUDP.js";import"../../chunk-VNUR4TRP.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{d as g}from"../../chunk-
|
|
1
|
+
import{d as g}from"../../chunk-3QCSRNXC.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.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-
|
|
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-7ZCVOA6A.js";import{d as j}from"../chunk-3QCSRNXC.js";import{a as u,b as O}from"../chunk-S6KFKBMY.js";import{b as i}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import{b as y,c,j as b}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import"../chunk-VNUR4TRP.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};
|
package/dist/lib/touch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f}from"../chunk-
|
|
1
|
+
import{e as f}from"../chunk-7ZCVOA6A.js";import{d as s}from"../chunk-3QCSRNXC.js";import{a,b as c}from"../chunk-S6KFKBMY.js";import{a as t}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import"../chunk-VNUR4TRP.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 d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-
|
|
1
|
+
import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-X3H2PJ6S.js";import{b as m}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.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-3QCSRNXC.js";import{b as w}from"../chunk-S6KFKBMY.js";import{b as A}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import{f as g,j as I}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import{c as z}from"../chunk-VNUR4TRP.js";import{i as y}from"../chunk-F4AGJWCK.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
|
@@ -779,6 +779,54 @@ commands:
|
|
|
779
779
|
- name: source-snapshot
|
|
780
780
|
description: Fork from a specific snapshot of the source bucket. Accepts a snapshot version string or any UNIX nanosecond-precision timestamp (e.g. 1765889000501544464). Requires --fork-of
|
|
781
781
|
alias: source-snap
|
|
782
|
+
# rebase
|
|
783
|
+
- name: rebase
|
|
784
|
+
description: Update a fork with the latest changes from its source bucket
|
|
785
|
+
examples:
|
|
786
|
+
- "tigris buckets rebase my-fork"
|
|
787
|
+
- "tigris buckets rebase my-fork --yes"
|
|
788
|
+
messages:
|
|
789
|
+
onStart: 'Rebasing fork...'
|
|
790
|
+
onSuccess: "Fork '{{fork}}' rebased onto its source (snapshot {{snapshotVersion}})"
|
|
791
|
+
onFailure: "Failed to rebase fork '{{fork}}'"
|
|
792
|
+
nextActions:
|
|
793
|
+
- command: 'tigris buckets merge {{fork}}'
|
|
794
|
+
description: "Merge the fork's changes back into its source bucket"
|
|
795
|
+
arguments:
|
|
796
|
+
- name: fork
|
|
797
|
+
description: Name of the fork bucket to rebase onto its source
|
|
798
|
+
type: positional
|
|
799
|
+
required: true
|
|
800
|
+
examples:
|
|
801
|
+
- my-fork
|
|
802
|
+
# merge
|
|
803
|
+
- name: merge
|
|
804
|
+
description: Merge a fork's changes back into its source bucket
|
|
805
|
+
examples:
|
|
806
|
+
- "tigris buckets merge my-fork"
|
|
807
|
+
- "tigris buckets merge my-fork --into my-bucket"
|
|
808
|
+
- "tigris buckets merge my-fork --from-snapshot 1765889000501544464"
|
|
809
|
+
- "tigris buckets merge my-fork --yes"
|
|
810
|
+
messages:
|
|
811
|
+
onStart: 'Merging fork...'
|
|
812
|
+
onSuccess: "Fork '{{fork}}' merged into '{{into}}' (snapshot {{snapshotVersion}})"
|
|
813
|
+
onFailure: "Failed to merge fork '{{fork}}'"
|
|
814
|
+
nextActions:
|
|
815
|
+
- command: 'tigris buckets get {{into}}'
|
|
816
|
+
description: 'Inspect the updated source bucket'
|
|
817
|
+
arguments:
|
|
818
|
+
- name: fork
|
|
819
|
+
description: Name of the fork bucket whose changes will be merged
|
|
820
|
+
type: positional
|
|
821
|
+
required: true
|
|
822
|
+
examples:
|
|
823
|
+
- my-fork
|
|
824
|
+
- name: into
|
|
825
|
+
description: Source bucket to merge into. Defaults to the fork's parent source bucket
|
|
826
|
+
alias: source
|
|
827
|
+
- name: from-snapshot
|
|
828
|
+
description: Merge from a specific snapshot of the fork rather than its current state. Accepts a snapshot version string or any UNIX nanosecond-precision timestamp (e.g. 1765889000501544464)
|
|
829
|
+
alias: from-snap
|
|
782
830
|
# get
|
|
783
831
|
- name: get
|
|
784
832
|
description: Show details for a bucket including access level, region, tier, and custom domain
|
|
@@ -1419,12 +1467,14 @@ commands:
|
|
|
1419
1467
|
description: Object version id to download (requires bucket versioning). Omit to download the latest version
|
|
1420
1468
|
# put
|
|
1421
1469
|
- name: put
|
|
1422
|
-
description: Upload a local file as an object. Content-type is auto-detected from extension unless overridden
|
|
1470
|
+
description: Upload a local file — or data piped via stdin — as an object. Content-type is auto-detected from the file extension unless overridden
|
|
1423
1471
|
alias: p
|
|
1424
1472
|
examples:
|
|
1425
1473
|
- "tigris objects put my-bucket report.pdf ./report.pdf"
|
|
1426
1474
|
- "tigris objects put t3://my-bucket/report.pdf ./report.pdf"
|
|
1427
1475
|
- "tigris objects put my-bucket logo.png ./logo.png --access public --content-type image/png"
|
|
1476
|
+
- "echo 'hello' | tigris objects put t3://my-bucket/hello.txt"
|
|
1477
|
+
- "cat report.pdf | tigris objects put my-bucket report.pdf --content-type application/pdf"
|
|
1428
1478
|
messages:
|
|
1429
1479
|
onStart: 'Uploading object...'
|
|
1430
1480
|
onSuccess: "Object '{{key}}' uploaded successfully"
|
|
@@ -1446,7 +1496,7 @@ commands:
|
|
|
1446
1496
|
examples:
|
|
1447
1497
|
- my-file.txt
|
|
1448
1498
|
- name: file
|
|
1449
|
-
description: Path to the local file to upload
|
|
1499
|
+
description: Path to the local file to upload. Omit to read the object data from stdin (piped input)
|
|
1450
1500
|
type: positional
|
|
1451
1501
|
examples:
|
|
1452
1502
|
- ./my-file.txt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-JNSFDQGG.js";import"../chunk-AFM3TY2D.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";export{c as buildBucketInfo,b as describeExpiration,a as describeTransition};
|
package/dist/utils/exit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";export{a as exitWithError,b as failWithError,c as getSuccessNextActions,d as printNextActions};
|
package/dist/utils/format.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../chunk-AFM3TY2D.js";export{b as formatJson,f as formatOutput,g as formatPaginatedOutput,a as formatSize,e as formatTable,d as formatXml,c as formatXmlObject};
|
package/dist/utils/messages.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";export{a as interpolate,j as msg,f as printAlreadyDone,h as printDeprecated,e as printEmpty,d as printFailure,g as printHint,i as printPaginationHint,b as printStart,c as printSuccess};
|
package/dist/utils/path.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"../chunk-7ZCVOA6A.js";export{f as globToRegex,d as isPathFolder,a as isRemotePath,i as listAllItems,e as parseAnyPath,c as parsePath,b as parseRemotePath,h as resolveObjectArgs,g as wildcardPrefix};
|
package/dist/utils/specs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-NI4EYBQH.js";export{e as buildPromptChoices,d as getArgumentSpec,c as getCommandSpec,b as loadSpecs,a as setSpecs};
|
|
@@ -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-X3H2PJ6S.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": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"build": "tsc --noEmit && tsup",
|
|
26
26
|
"dev": "export $(grep -v '^#' .env.test | xargs) && (tsc --noEmit --watch --preserveWatchOutput & tsup --watch)",
|
|
27
27
|
"cli": "export $(grep -v '^#' .env.test | xargs) && node dist/cli.js",
|
|
28
|
-
"lint": "
|
|
29
|
-
"lint:fix": "
|
|
30
|
-
"format": "
|
|
31
|
-
"format:check": "
|
|
28
|
+
"lint": "biome lint",
|
|
29
|
+
"lint:fix": "biome lint --write",
|
|
30
|
+
"format": "biome format --write",
|
|
31
|
+
"format:check": "biome format",
|
|
32
32
|
"test": "vitest run --exclude test/cli.test.ts",
|
|
33
33
|
"test:watch": "vitest",
|
|
34
34
|
"test:all": "vitest run",
|
|
@@ -42,8 +42,12 @@
|
|
|
42
42
|
"dev:binary": "npm run generate:registry && tsc --noEmit --watch --preserveWatchOutput -p tsconfig.binary.json & bun build src/cli-binary.ts --compile --watch --outfile=bin/tigris",
|
|
43
43
|
"prepublishOnly": "npm run build",
|
|
44
44
|
"clean": "rm -rf dist",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
45
|
+
"prepare": "husky install",
|
|
46
|
+
"changeset": "changeset",
|
|
47
|
+
"version-packages": "changeset version",
|
|
48
|
+
"release": "changeset publish",
|
|
49
|
+
"check": "biome check",
|
|
50
|
+
"check:fix": "biome check --write"
|
|
47
51
|
},
|
|
48
52
|
"keywords": [
|
|
49
53
|
"cli",
|
|
@@ -58,52 +62,11 @@
|
|
|
58
62
|
"url": "git+https://github.com/tigrisdata/cli.git"
|
|
59
63
|
},
|
|
60
64
|
"license": "MIT",
|
|
61
|
-
"commitlint": {
|
|
62
|
-
"extends": [
|
|
63
|
-
"@commitlint/config-conventional"
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
"release": {
|
|
67
|
-
"branches": [
|
|
68
|
-
"release",
|
|
69
|
-
{
|
|
70
|
-
"name": "main",
|
|
71
|
-
"prerelease": "beta",
|
|
72
|
-
"channel": "beta"
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
"plugins": [
|
|
76
|
-
[
|
|
77
|
-
"@semantic-release/commit-analyzer",
|
|
78
|
-
{
|
|
79
|
-
"preset": "conventionalcommits",
|
|
80
|
-
"releaseRules": [
|
|
81
|
-
{
|
|
82
|
-
"breaking": true,
|
|
83
|
-
"release": "major"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"type": "refactor",
|
|
87
|
-
"release": "patch"
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
[
|
|
93
|
-
"@semantic-release/release-notes-generator",
|
|
94
|
-
{
|
|
95
|
-
"preset": "conventionalcommits"
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
"@semantic-release/github",
|
|
99
|
-
"@semantic-release/npm"
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
65
|
"dependencies": {
|
|
103
66
|
"@aws-sdk/credential-providers": "^3.1038.0",
|
|
104
67
|
"@smithy/shared-ini-file-loader": "^4.4.9",
|
|
105
68
|
"@tigrisdata/iam": "^2.2.0",
|
|
106
|
-
"@tigrisdata/storage": "^3.
|
|
69
|
+
"@tigrisdata/storage": "^3.17.0",
|
|
107
70
|
"commander": "^14.0.3",
|
|
108
71
|
"enquirer": "^2.4.1",
|
|
109
72
|
"jose": "^6.2.3",
|
|
@@ -111,22 +74,16 @@
|
|
|
111
74
|
"yaml": "^2.8.3"
|
|
112
75
|
},
|
|
113
76
|
"devDependencies": {
|
|
114
|
-
"@
|
|
115
|
-
"@
|
|
116
|
-
"@
|
|
77
|
+
"@biomejs/biome": "^2.5.2",
|
|
78
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
79
|
+
"@changesets/cli": "^2.31.0",
|
|
117
80
|
"@types/node": "^22.19.11",
|
|
118
|
-
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
119
81
|
"dotenv": "^17.4.2",
|
|
120
|
-
"eslint": "^10.2.1",
|
|
121
|
-
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
122
82
|
"husky": "^9.1.7",
|
|
123
|
-
"prettier": "^3.8.3",
|
|
124
83
|
"publint": "^0.3.18",
|
|
125
|
-
"semantic-release": "^25.0.3",
|
|
126
84
|
"tsup": "^8.5.1",
|
|
127
85
|
"tsx": "^4.21.0",
|
|
128
86
|
"typescript": "^5.9.3",
|
|
129
|
-
"typescript-eslint": "^8.59.1",
|
|
130
87
|
"vitest": "^4.1.5"
|
|
131
88
|
}
|
|
132
89
|
}
|
package/dist/chunk-BVSVEXGE.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d as m,e as d,f}from"./chunk-ATBINUDP.js";import{mkdirSync as w,readFileSync as _,realpathSync as E,writeFileSync as I}from"fs";import x from"https";import{homedir as g}from"os";import{join as h}from"path";var u="3.3.0";var b=h(g(),".tigris","update-check.json");function y(){try{let e=_(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function v(e){try{w(h(g(),".tigris"),{recursive:!0}),I(b,JSON.stringify(e),"utf-8")}catch{}}function T(e,n){let a=i=>{let s=i.startsWith("v")?i.slice(1):i,l=null,o=s.indexOf("-");o!==-1&&(l=s.slice(o+1),s=s.slice(0,o));let c=s.split(".");if(c.length!==3)return null;let p=c.map(Number);return p.some(isNaN)?null:{major:p[0],minor:p[1],patch:p[2],prerelease:l}},r=a(e),t=a(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function N(){if(process.platform==="win32")return!1;try{let e=E(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function M(){return globalThis.__TIGRIS_BINARY===!0?N()?"brew upgrade tigris":process.platform==="win32"?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function k(e={}){return new Promise((n,a)=>{let r=x.get(m,{timeout:1e4},t=>{let i="";t.on("data",s=>{i+=s}),t.on("end",()=>{try{let s=JSON.parse(i);typeof s.version=="string"?(v({...y(),latestVersion:s.version,lastChecked:Date.now()}),n(s.version)):a(new Error("Unexpected registry response"))}catch{a(new Error("Failed to parse registry response"))}})});r.on("error",t=>{a(t)}),r.on("timeout",()=>{r.destroy(),a(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function j(){k({unref:!0}).catch(()=>{})}function O(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&T(u,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${u} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',i=Math.max(r.length,t.length)+4,s="\u250C"+"\u2500".repeat(i-2)+"\u2510",l="\u2514"+"\u2500".repeat(i-2)+"\u2518",o=c=>"\u2502 "+c.padEnd(i-4)+" \u2502";console.log(`
|
|
2
|
-
${s}
|
|
3
|
-
${o("")}
|
|
4
|
-
${o(r)}
|
|
5
|
-
${o(t)}
|
|
6
|
-
${o("")}
|
|
7
|
-
${l}
|
|
8
|
-
`),v({...e,lastNotified:Date.now()})}let a=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!e||Date.now()-e.lastChecked>a)&&j()}export{u as a,y as b,T as c,M as d,k as e,O as f};
|
package/dist/chunk-IRDNZN7R.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
function B(n){if(n===0)return"0 B";let t=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(n)/Math.log(1024));return`${(n/Math.pow(1024,r)).toFixed(r>0?1:0)} ${t[r]}`}function l(n){return JSON.stringify(n,null,2)}function m(n){return String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function T(n,t=" "){return Object.entries(n).map(([r,e])=>`${t}<${r}>${m(e)}</${r}>`).join(`
|
|
2
|
-
`)}function W(n,t,r){let e=[`<${t}>`];return n.forEach(o=>{e.push(` <${r}>`),e.push(T(o," ")),e.push(` </${r}>`)}),e.push(`</${t}>`),e.join(`
|
|
3
|
-
`)}function p(n,t){return n.length<=t?n:n.slice(0,t-1)+"\u2026"}function x(n){if(n==null)return"";if(n instanceof Date)return f(n);if(typeof n=="string"){let t=new Date(n);if(!isNaN(t.getTime())&&n.includes("T"))return f(t)}return String(n)}function f(n){return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function j(n,t){let r=process.stdout.columns||120,e=t.length*3+1,o=r-e,s=t.map(i=>{if(i.width)return i.width;let g=i.header.length,a=n.reduce((k,b)=>{let $=x(b[i.key]);return Math.max(k,$.length)},0),h=Math.max(g,a);return i.maxWidth&&h>i.maxWidth&&(h=i.maxWidth),h}),d=s.reduce((i,g)=>i+g,0);if(d<=o)return s;let c=[...s],u=t.map(i=>Math.max(i.header.length,8));for(;d>o;){let i=-1,g=0;for(let a=0;a<c.length;a++)c[a]>u[a]&&c[a]>g&&(g=c[a],i=a);if(i===-1)break;c[i]--,d--}return c}function w(n,t){let r=[],e=j(n,t),o="\u250C"+e.map(u=>"\u2500".repeat(u+2)).join("\u252C")+"\u2510",s="\u251C"+e.map(u=>"\u2500".repeat(u+2)).join("\u253C")+"\u2524",d="\u2514"+e.map(u=>"\u2500".repeat(u+2)).join("\u2534")+"\u2518";r.push(`
|
|
4
|
-
`+o);let c="\u2502 "+t.map((u,i)=>p(u.header,e[i]).padEnd(e[i])).join(" \u2502 ")+" \u2502";return r.push(c),r.push(s),n.forEach(u=>{let i=t.map((g,a)=>{let h=p(x(u[g.key]),e[a]);return g.align==="right"?h.padStart(e[a]):h.padEnd(e[a])});r.push("\u2502 "+i.join(" \u2502 ")+" \u2502")}),r.push(d+`
|
|
5
|
-
`),r.join(`
|
|
6
|
-
`)}function R(n,t,r,e,o){switch(t){case"json":return l(n);case"xml":return W(n,r,e);default:return w(n,o)}}function C(n,t,r,e,o,s){switch(t){case"json":{let d={items:n};return s.paginationToken&&(d.paginationToken=s.paginationToken),l(d)}case"xml":return M(n,r,e,s);default:return w(n,o)}}function M(n,t,r,e){let o=[`<${t}>`];return n.forEach(s=>{o.push(` <${r}>`),o.push(T(s," ")),o.push(` </${r}>`)}),e.paginationToken&&o.push(` <paginationToken>${m(e.paginationToken)}</paginationToken>`),o.push(`</${t}>`),o.join(`
|
|
7
|
-
`)}export{B as a,l as b,T as c,W as d,w as e,R as f,C as g};
|
package/dist/chunk-JW6HI5E4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s,f as l}from"./chunk-BVSVEXGE.js";import{a as i,k as m}from"./chunk-G4DHMSCQ.js";import{b as t}from"./chunk-PPNBQWSR.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=a(d,"lib",...o)+".js";if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
|
package/dist/chunk-RXNG56FL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{list as a}from"@tigrisdata/storage";var g=["t3://","tigris://"];function p(t){return g.some(e=>t.startsWith(e))}function u(t){let e=g.find(r=>t.startsWith(r));return c(t.slice(e.length))}function c(t){let e=t.split("/");return{bucket:e[0],path:e.slice(1).join("/")}}async function l(t,e,r){let{data:i}=await a({prefix:`${e}/`,limit:1,config:{...r,bucket:t}});return!!(i?.items&&i.items.length>0)}function f(t){return p(t)?u(t):c(t)}function d(t){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*");return new RegExp("^"+e+"$")}function x(t){let e=t.indexOf("*"),r=t.lastIndexOf("/",e);return r>=0?t.slice(0,r+1):""}function h(t,e){let r=f(t);return e?{bucket:r.bucket,key:e}:{bucket:r.bucket,key:r.path}}async function P(t,e,r){let i=[],s;do{let{data:n,error:o}=await a({prefix:e,paginationToken:s,config:{...r,bucket:t}});if(o)return{items:i,error:o};n?.items&&i.push(...n.items),s=n?.hasMore?n.paginationToken:void 0}while(s);return{items:i}}export{p as a,u as b,c,l as d,f as e,d as f,x as g,h,P as i};
|
package/dist/chunk-RZPBM4CD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d,b as o}from"./chunk-LAB2KJTN.js";import{a}from"./chunk-S6KFKBMY.js";import{b as i}from"./chunk-UBANDLB4.js";import{getBucketInfo as l,setBucketLifecycle as g}from"@tigrisdata/storage";var f=["STANDARD_IA","GLACIER","GLACIER_IR"];function c(e){return f.includes(e)}function u(e){return/^\d{4}-\d{2}-\d{2}/.test(e)&&!isNaN(new Date(e).getTime())}function C(e){return{prefix:a(e,["prefix"]),storageClass:a(e,["storage-class","storageClass"]),days:a(e,["days"]),date:a(e,["date"]),expireDays:a(e,["expire-days","expireDays"]),expireDate:a(e,["expire-date","expireDate"]),enable:a(e,["enable"]),disable:a(e,["disable"])}}function p(e,{requireStorageClassForTiming:r=!0}={}){if(e.enable&&e.disable)return"Cannot use both --enable and --disable";if(r&&(e.days!==void 0||e.date!==void 0)&&!e.storageClass)return"--storage-class is required when setting --days or --date";if(e.storageClass&&!c(e.storageClass))return`--storage-class must be one of: ${f.join(", ")} (STANDARD is not a valid transition target)`;if(e.days!==void 0&&e.date!==void 0)return"Cannot specify both --days and --date";if(e.days!==void 0&&(isNaN(Number(e.days))||Number(e.days)<=0))return"--days must be a positive number";if(e.date!==void 0&&!u(e.date))return"--date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.expireDays!==void 0&&e.expireDate!==void 0)return"Cannot specify both --expire-days and --expire-date";if(e.expireDays!==void 0&&(isNaN(Number(e.expireDays))||Number(e.expireDays)<=0))return"--expire-days must be a positive number";if(e.expireDate!==void 0&&!u(e.expireDate))return"--expire-date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.prefix!==void 0&&e.prefix==="")return"--prefix cannot be empty"}function D(e){let r={};return e.storageClass&&(r.storageClass=e.storageClass),e.days!==void 0?(r.days=Number(e.days),r.date=void 0):e.date!==void 0&&(r.date=e.date,r.days=void 0),r}function R(e){if(e.expireDays!==void 0)return{days:Number(e.expireDays),date:void 0};if(e.expireDate!==void 0)return{date:e.expireDate,days:void 0}}function I(e){if(e.enable)return!0;if(e.disable)return!1}async function T(e,r,t){let{data:s,error:n}=await l(r,{config:t});return n&&i(e,n),s?.settings.lifecycleRules??[]}async function N(e,r,t,s){let{error:n}=await g(r,{lifecycleRules:t,config:s});n&&i(e,n)}function S(e){return d(e)??"-"}function A(e){return o(e)??"-"}export{C as a,p as b,D as c,R as d,I as e,T as f,N as g,S as h,A as i};
|