@tigrisdata/cli 3.10.0 → 3.12.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 +35 -3
- package/dist/auth/client.js +1 -1
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/browser/index.d.ts +307 -0
- package/dist/browser/index.js +2843 -0
- package/dist/{chunk-TFXO4OXM.js → chunk-DBDETUU5.js} +1 -1
- package/dist/{chunk-CEEDWOY2.js → chunk-DM3Z47H2.js} +1 -1
- package/dist/chunk-HBEO4D3T.js +1 -0
- package/dist/chunk-IUIKP2LU.js +1 -0
- package/dist/{chunk-RDJQLQQY.js → chunk-JSAFHUUW.js} +1 -1
- package/dist/{chunk-HAYPV4J6.js → chunk-M7RSEBSZ.js} +1 -1
- package/dist/{chunk-PNRZDYCK.js → chunk-NPKVQONE.js} +1 -1
- package/dist/{chunk-MQEI5KKF.js → chunk-P2VGCQRK.js} +1 -1
- package/dist/chunk-QPUL2AAI.js +1 -0
- package/dist/{chunk-IIF5VLQ7.js → chunk-RGFXGPV7.js} +1 -1
- package/dist/chunk-T7LA7K35.js +1 -0
- package/dist/chunk-UR3ROJIV.js +8 -0
- package/dist/{chunk-ZTZF3OHU.js → chunk-WLOUPDQT.js} +1 -1
- package/dist/{chunk-JUOJKZRI.js → chunk-XCTJOMF2.js} +1 -1
- package/dist/{chunk-4FAKNMI5.js → chunk-YL7RFWZJ.js} +1 -1
- package/dist/{chunk-UZIIZW33.js → chunk-YR7ZJNOL.js} +1 -1
- package/dist/chunk-Z6R2SWNJ.js +5 -0
- 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/buckets/share.js +1 -0
- 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/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/purge.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/restore-deleted.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 +2 -2
- 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 +57 -2
- package/dist/utils/analytics.js +1 -1
- package/dist/utils/bucket-info.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 +22 -6
- package/dist/chunk-76VFN2EJ.js +0 -8
- package/dist/chunk-J3MAV7JB.js +0 -1
- package/dist/chunk-JNSFDQGG.js +0 -1
- package/dist/chunk-R3KHIAWP.js +0 -5
- package/dist/chunk-RH6Z22EN.js +0 -1
- package/dist/chunk-V6JZFDRE.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
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{
|
|
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{f as C}from"../../chunk-Z6R2SWNJ.js";import{a as t,b,c as V}from"../../chunk-S6KFKBMY.js";import{b as a}from"../../chunk-RGFXGPV7.js";import{b as u,c as x,e as v,j as I}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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
4
|
`))}else{if(o.length===0&&n.length===0){v(i);return}if(o.length>0&&(console.log(`
|
package/dist/lib/objects/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w,g as O}from"../../chunk-AFM3TY2D.js";import{e as T}from"../../chunk-KIT6R3V2.js";import{
|
|
1
|
+
import{a as w,g as O}from"../../chunk-AFM3TY2D.js";import{e as T}from"../../chunk-KIT6R3V2.js";import{f as S}from"../../chunk-Z6R2SWNJ.js";import{a as e,b as z,c as P}from"../../chunk-S6KFKBMY.js";import{b as s}from"../../chunk-RGFXGPV7.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-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,b as d}from"../../chunk-S77OAN6Y.js";import{h as y}from"../../chunk-KIT6R3V2.js";import{
|
|
1
|
+
import{a as u,b as d}from"../../chunk-S77OAN6Y.js";import{h as y}from"../../chunk-KIT6R3V2.js";import{f as l}from"../../chunk-Z6R2SWNJ.js";import{a as n,b as p}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-RGFXGPV7.js";import{b as g,c as m,j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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
|
|
1
|
+
import{a as A}from"../../chunk-EKW6XTGL.js";import{a as v}from"../../chunk-HPICBIXL.js";import{a,f as j}from"../../chunk-AFM3TY2D.js";import{h as w}from"../../chunk-KIT6R3V2.js";import{f as z}from"../../chunk-Z6R2SWNJ.js";import{a as r,b as T}from"../../chunk-S6KFKBMY.js";import{b as n,d as C}from"../../chunk-RGFXGPV7.js";import{b,c as k,j as S}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.js";import"../../chunk-F4AGJWCK.js";import{createReadStream as M,statSync as N}from"fs";import{Readable as R}from"stream";import{put as Y}from"@tigrisdata/storage";var t=S("objects","put");async function D(o){b(t);let l=r(o,["bucket"]),u=r(o,["key"]),y=r(o,["file"]),$=r(o,["access","a","A"],"private"),O=r(o,["content-type","contentType","t","T"]),P=r(o,["cache-control","cacheControl"]),q=T(o);l||n(t,"Bucket name or path is required");let d=w(l),m=d.bucket,s=d.key||u,e=d.key&&u||y;s||n(t,"Object key is required");let U=!process.stdin.isTTY;!e&&!U&&n(t,"File path is required (or pipe data via stdin)");let f,i;if(e){try{i=N(e).size}catch{n(t,`File not found: ${e}`)}let p=M(e);f=R.toWeb(p)}else f=R.toWeb(process.stdin);let x=await z({withCredentialProvider:!0}),F=e?A(i):{multipart:!0,partSize:5*1024*1024,queueSize:8},W=O??(e?v(e):void 0),{data:c,error:g}=await Y(s,f,{access:$==="public"?"public":"private",contentType:W,cacheControl:P,...F,onUploadProgress:({loaded:p,percentage:h})=>{i!==void 0&&i>0?process.stdout.write(`\rUploading: ${a(p)} / ${a(i)} (${h}%)`):process.stdout.write(`\rUploading: ${a(p)}`)},config:{...x,bucket:m}});process.stdout.write(`\r${" ".repeat(60)}\r`),g&&n(t,g);let B=[{path:c.path,size:a(c.size??i??0),contentType:c.contentType||"-",cacheControl:c.cacheControl||"-",modified:c.modified}],E=j(B,q,"objects","object",[{key:"path",header:"Path"},{key:"size",header:"Size"},{key:"contentType",header:"Content-Type"},{key:"cacheControl",header:"Cache-Control"},{key:"modified",header:"Modified"}]);console.log(E),k(t,{key:s,bucket:m}),C(t,{key:s,bucket:m})}export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as p}from"../../chunk-KIT6R3V2.js";import{
|
|
1
|
+
import{h as p}from"../../chunk-KIT6R3V2.js";import{f as k}from"../../chunk-Z6R2SWNJ.js";import{a as n,b as u}from"../../chunk-S6KFKBMY.js";import{b as t,d}from"../../chunk-RGFXGPV7.js";import{b as g,c as m,j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{f as y}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-KIT6R3V2.js";import{f as h}from"../../chunk-Z6R2SWNJ.js";import{a as e,b as d}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-RGFXGPV7.js";import{b as g,c as p,e as l,j as k}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{h as k}from"../../chunk-KIT6R3V2.js";import{f as y}from"../../chunk-Z6R2SWNJ.js";import{a as t,b as p}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-RGFXGPV7.js";import{b as d,c as u,j as b}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{h as l}from"../../chunk-KIT6R3V2.js";import{f as k}from"../../chunk-Z6R2SWNJ.js";import{a as o,b}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-RGFXGPV7.js";import{b as m,c as u,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{h as d}from"../../chunk-KIT6R3V2.js";import{f as b}from"../../chunk-Z6R2SWNJ.js";import{a as i,b as y}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-RGFXGPV7.js";import{b as p,c as k,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{f as O,h as d}from"../../chunk-Z6R2SWNJ.js";import{a as p,b as u}from"../../chunk-S6KFKBMY.js";import{b as i,d as m}from"../../chunk-RGFXGPV7.js";import{b as e,c,g as f,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{f as q}from"../../chunk-AFM3TY2D.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{f as k,h as I}from"../../chunk-Z6R2SWNJ.js";import{b as S}from"../../chunk-S6KFKBMY.js";import{b as O}from"../../chunk-RGFXGPV7.js";import{b as u,c as r,e as h,j as z}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import{d as w}from"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{f as S,h as $}from"../../chunk-Z6R2SWNJ.js";import{a as z,b as O}from"../../chunk-S6KFKBMY.js";import{a as p,b as r,d as u}from"../../chunk-RGFXGPV7.js";import{b as c,c as f,d as l,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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,
|
|
1
|
+
import{b as A}from"../chunk-AFM3TY2D.js";import{e as v}from"../chunk-KIT6R3V2.js";import{a as K,f as w}from"../chunk-Z6R2SWNJ.js";import{a,b as k}from"../chunk-S6KFKBMY.js";import{a as r}from"../chunk-RGFXGPV7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";import{d as h}from"../chunk-HBEO4D3T.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 n=a(s,["path"]);n||r("path argument is required");let{bucket:o,path:e}=v(n);o||r("Invalid path"),e||r("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"&&r("Snapshot version is only supported for GET requests");let d=await w(),g;c?g=c:d.accessKeyId?g=d.accessKeyId:(p()!=="oauth"&&r("Presigning requires an access key. Pass --access-key or configure credentials."),C?g=await R(o,t):g=await E(o,t)),g||r("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&&r(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 n=await h().getAccessToken(),o=m(),e=K(),{data:t,error:i}=await P({config:{sessionToken:n,organizationId:o??void 0,iamEndpoint:e.iamEndpoint}});return i&&r(i),(!t.accessKeys||t.accessKeys.length===0)&&r('No access keys found. Create one with "tigris access-keys create <name>"'),t.accessKeys}function x(s,n,o){return s.roles?s.roles.some(e=>e.role==="NamespaceAdmin"?!0:e.bucket!==n&&e.bucket!=="*"?!1:o==="put"?e.role==="Editor"||e.role==="ReadWrite":e.role==="Editor"||e.role==="ReadWrite"||e.role==="ReadOnly"):!1}async function E(s,n){let e=(await I()).filter(i=>i.status==="active");e.length===0&&r('No active access keys found. Create one with "tigris access-keys create <name>"');let t=e.find(i=>x(i,s,n));return t||r(`No access key with ${n==="put"?"Editor or ReadWrite":"Editor, ReadWrite, or ReadOnly"} access to bucket "${s}" found.
|
|
2
2
|
Create one: tigris access-keys create <name>
|
|
3
|
-
Then assign: tigris access-keys assign <id> --bucket ${s} --role Editor`),console.error(`Using access key: ${t.name} (${t.id})`),t.id}async function
|
|
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 R(s,n){process.stdin.isTTY||r("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&&r('No active access keys found. Create one with "tigris access-keys create <name>"');let t=e.filter(c=>x(c,s,n)),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{
|
|
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{f as W}from"../chunk-Z6R2SWNJ.js";import{a as h,b as P}from"../chunk-S6KFKBMY.js";import{a as s}from"../chunk-RGFXGPV7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";import"../chunk-HBEO4D3T.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{
|
|
1
|
+
import{a as S,b as x}from"../../chunk-S77OAN6Y.js";import{f as A}from"../../chunk-Z6R2SWNJ.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-RGFXGPV7.js";import{b as m,c as l,d as u,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{g as S}from"../../chunk-AFM3TY2D.js";import{f as x}from"../../chunk-Z6R2SWNJ.js";import{a as k,b as y,c as T}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-RGFXGPV7.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-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{f as g}from"../../chunk-Z6R2SWNJ.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-RGFXGPV7.js";import{b as m,c,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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
|
|
1
|
+
import{c as I}from"../chunk-IUIKP2LU.js";import{a as d,f as m}from"../chunk-AFM3TY2D.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as C}from"../chunk-KIT6R3V2.js";import{f as j}from"../chunk-Z6R2SWNJ.js";import{a as u,b as O}from"../chunk-S6KFKBMY.js";import{b as i}from"../chunk-RGFXGPV7.js";import{b as y,c,j as b}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";import"../chunk-HBEO4D3T.js";import"../chunk-F4AGJWCK.js";import{getBucketInfo as T,getStats as V,head as M}from"@tigrisdata/storage";var t=b("stat");async function z(n){y(t);let h=u(n,["path"]),f=O(n),v=u(n,["snapshot-version","snapshotVersion","snapshot"]),S=u(n,["version-id","versionId"]),l=await j();if(!h){let{data:o,error:a}=await V({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:s}=C(h);if(r||i(t,"Invalid path"),!s||s==="/"){let{data:o,error:a}=await T(r,{config:l});a&&i(t,a);let p=I(o).map(({label:A,value:B})=>({metric:A,value:B})),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 M(s,{...v?{snapshotVersion:v}:{},...S?{versionId:S}:{},config:{...l,bucket:r}});k&&i(t,k),e||i(t,"Object not found");let w=[{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:"Cache-Control",value:e.cacheControl||"N/A"},{metric:"Modified",value:e.modified.toISOString()}],x=m(w,f,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(x),c(t,{bucket:r,path:s}),process.exit(0)}export{z 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-RGFXGPV7.js";import{c as i,j as s}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import{a as o,g as n}from"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.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-RGFXGPV7.js";import{c as l,j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import{a as r,d as i,g as s}from"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.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-RGFXGPV7.js";import{j as a}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-JSAFHUUW.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-T7LA7K35.js";import"../../chunk-BMWWPXMU.js";import{a as r,d as i}from"../../chunk-APJUJ6TW.js";import"../../chunk-QPUL2AAI.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{
|
|
1
|
+
import{e as f}from"../chunk-KIT6R3V2.js";import{f as s}from"../chunk-Z6R2SWNJ.js";import{a,b as c}from"../chunk-S6KFKBMY.js";import{a as t}from"../chunk-RGFXGPV7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";import"../chunk-HBEO4D3T.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 u}from"../chunk-S6KFKBMY.js";import{b as l,c as f,d}from"../chunk-
|
|
1
|
+
import{b as u}from"../chunk-S6KFKBMY.js";import{b as l,c as f,d}from"../chunk-UR3ROJIV.js";import"../chunk-G4OJTPSI.js";import{b as p}from"../chunk-RGFXGPV7.js";import{b as i,c as a,f as c,j as m}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import{a as r}from"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import{h as s}from"../chunk-QPUL2AAI.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 $,
|
|
1
|
+
import{a as $,e as b}from"../chunk-Z6R2SWNJ.js";import{b as w}from"../chunk-S6KFKBMY.js";import{b as y}from"../chunk-RGFXGPV7.js";import{f as g,j as A}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";import{d as z}from"../chunk-HBEO4D3T.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};
|
package/dist/specs.yaml
CHANGED
|
@@ -516,6 +516,7 @@ commands:
|
|
|
516
516
|
examples:
|
|
517
517
|
- "tigris cp ./file.txt t3://my-bucket/file.txt"
|
|
518
518
|
- "tigris cp ./logo.png t3://my-bucket/logo.png --access public"
|
|
519
|
+
- "tigris cp ./dist/ t3://my-bucket/assets/ -r --cache-control 'public, max-age=31536000, immutable'"
|
|
519
520
|
- "tigris cp t3://my-bucket/file.txt ./local-copy.txt"
|
|
520
521
|
- "tigris cp t3://my-bucket/src/ t3://my-bucket/dest/ -r"
|
|
521
522
|
- "tigris cp ./images/ t3://my-bucket/images/ -r"
|
|
@@ -549,6 +550,8 @@ commands:
|
|
|
549
550
|
description: Access level for uploaded objects (only applies to local-to-remote uploads)
|
|
550
551
|
alias: a
|
|
551
552
|
options: *access_options
|
|
553
|
+
- name: cache-control
|
|
554
|
+
description: Cache-Control header stored with uploaded objects (only applies to local-to-remote uploads)
|
|
552
555
|
|
|
553
556
|
# mv
|
|
554
557
|
- name: mv
|
|
@@ -1330,6 +1333,54 @@ commands:
|
|
|
1330
1333
|
description: Clear all CORS rules on the bucket
|
|
1331
1334
|
type: flag
|
|
1332
1335
|
|
|
1336
|
+
# share
|
|
1337
|
+
- name: share
|
|
1338
|
+
description: Share a bucket with your whole organization, specific teams, or specific users. Existing shares are kept unless --override or --reset is used
|
|
1339
|
+
examples:
|
|
1340
|
+
- "tigris buckets share my-bucket --organization --role ReadOnly"
|
|
1341
|
+
- "tigris buckets share my-bucket --team tmid_MQQUhV --role Editor"
|
|
1342
|
+
- "tigris buckets share my-bucket --user uid_MQQUhV --role ReadOnly"
|
|
1343
|
+
- "tigris buckets share my-bucket --team tmid_A,tmid_B --role Editor,ReadOnly"
|
|
1344
|
+
- "tigris buckets share my-bucket --team tmid_MQQUhV --role Editor --override"
|
|
1345
|
+
- "tigris buckets share my-bucket --reset"
|
|
1346
|
+
messages:
|
|
1347
|
+
onStart: 'Updating bucket shares...'
|
|
1348
|
+
onSuccess: 'Shares updated for bucket {{name}}'
|
|
1349
|
+
onFailure: 'Failed to update bucket shares'
|
|
1350
|
+
arguments:
|
|
1351
|
+
- name: name
|
|
1352
|
+
description: Name of the bucket
|
|
1353
|
+
type: positional
|
|
1354
|
+
required: true
|
|
1355
|
+
examples:
|
|
1356
|
+
- my-bucket
|
|
1357
|
+
- name: organization
|
|
1358
|
+
alias: org
|
|
1359
|
+
description: Give access to everyone in your organization. Takes exactly one --role and cannot be combined with --team or --user
|
|
1360
|
+
type: flag
|
|
1361
|
+
- name: team
|
|
1362
|
+
alias: t
|
|
1363
|
+
description: Team ID to share with (can specify multiple, comma-separated). Each team is paired positionally with a --role value
|
|
1364
|
+
multiple: true
|
|
1365
|
+
- name: user
|
|
1366
|
+
alias: u
|
|
1367
|
+
description: User ID to share with (can specify multiple, comma-separated). Each user is paired positionally with a --role value
|
|
1368
|
+
multiple: true
|
|
1369
|
+
- name: role
|
|
1370
|
+
alias: r
|
|
1371
|
+
description: Role to grant (can specify multiple, comma-separated). A single role applies to every target; otherwise each role pairs with the corresponding --team or --user value
|
|
1372
|
+
multiple: true
|
|
1373
|
+
options:
|
|
1374
|
+
- ReadOnly
|
|
1375
|
+
- ReadWrite
|
|
1376
|
+
- Editor
|
|
1377
|
+
- name: override
|
|
1378
|
+
description: Replace all existing shares instead of merging with them
|
|
1379
|
+
type: flag
|
|
1380
|
+
- name: reset
|
|
1381
|
+
description: Remove all shares from the bucket
|
|
1382
|
+
type: flag
|
|
1383
|
+
|
|
1333
1384
|
#########################
|
|
1334
1385
|
# Manage forks (removed)
|
|
1335
1386
|
#########################
|
|
@@ -1492,7 +1543,7 @@ commands:
|
|
|
1492
1543
|
description: List objects from a specific storage source on buckets with shadow migration enabled
|
|
1493
1544
|
options: [tigris, shadow]
|
|
1494
1545
|
- name: deleted
|
|
1495
|
-
description: List soft-deleted objects instead of live ones. Requires soft delete on the bucket.
|
|
1546
|
+
description: List soft-deleted objects instead of live ones. Requires soft delete on the bucket. On a snapshot bucket a plain delete records a delete marker instead, so use "tigris objects list-versions" for those
|
|
1496
1547
|
type: flag
|
|
1497
1548
|
# list-versions
|
|
1498
1549
|
- name: list-versions
|
|
@@ -1581,6 +1632,7 @@ commands:
|
|
|
1581
1632
|
- "tigris objects put my-bucket report.pdf ./report.pdf"
|
|
1582
1633
|
- "tigris objects put t3://my-bucket/report.pdf ./report.pdf"
|
|
1583
1634
|
- "tigris objects put my-bucket logo.png ./logo.png --access public --content-type image/png"
|
|
1635
|
+
- "tigris objects put my-bucket app.js ./app.js --cache-control 'public, max-age=31536000, immutable'"
|
|
1584
1636
|
- "echo 'hello' | tigris objects put t3://my-bucket/hello.txt"
|
|
1585
1637
|
- "cat report.pdf | tigris objects put my-bucket report.pdf --content-type application/pdf"
|
|
1586
1638
|
messages:
|
|
@@ -1616,6 +1668,8 @@ commands:
|
|
|
1616
1668
|
- name: content-type
|
|
1617
1669
|
description: Content type (auto-detected from extension if omitted)
|
|
1618
1670
|
alias: t
|
|
1671
|
+
- name: cache-control
|
|
1672
|
+
description: Cache-Control header stored with the object and returned on every read (e.g. "public, max-age=31536000, immutable")
|
|
1619
1673
|
- name: format
|
|
1620
1674
|
description: Output format
|
|
1621
1675
|
options: [json, table, xml]
|
|
@@ -1965,7 +2019,7 @@ commands:
|
|
|
1965
2019
|
examples:
|
|
1966
2020
|
- tid_AaBbCcDdEeFf
|
|
1967
2021
|
- name: assign
|
|
1968
|
-
description: Assign per-bucket roles to an access key. Pair each --bucket with a --role (Editor or ReadOnly), or use --admin for org-wide access
|
|
2022
|
+
description: Assign per-bucket roles to an access key. Pair each --bucket with a --role (Editor, ReadWrite, or ReadOnly), or use --admin for org-wide access
|
|
1969
2023
|
alias: a
|
|
1970
2024
|
examples:
|
|
1971
2025
|
- "tigris access-keys assign tid_AaBb --bucket my-bucket --role Editor"
|
|
@@ -1996,6 +2050,7 @@ commands:
|
|
|
1996
2050
|
multiple: true
|
|
1997
2051
|
options:
|
|
1998
2052
|
- Editor
|
|
2053
|
+
- ReadWrite
|
|
1999
2054
|
- ReadOnly
|
|
2000
2055
|
- name: admin
|
|
2001
2056
|
description: Grant admin access to all buckets in the organization
|
package/dist/utils/analytics.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-WLOUPDQT.js";import"../chunk-G4OJTPSI.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";export{d as captureCommand,c as decodeTokenEmail,f as identifyOnLogin,a as isCI,e as trackCommand,b as usedFlags};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-IUIKP2LU.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-RGFXGPV7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-JSAFHUUW.js";import"../chunk-DV3LCXRH.js";import"../chunk-T7LA7K35.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";export{a as exitWithError,b as failWithError,c as getSuccessNextActions,d as printNextActions};
|
package/dist/utils/telemetry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as d,c as e,d as f,e as g}from"../chunk-
|
|
1
|
+
import{a as c,b as d,c as e,d as f,e as g}from"../chunk-JSAFHUUW.js";import"../chunk-T7LA7K35.js";import{a,b}from"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-QPUL2AAI.js";export{d as beforeSend,f as captureError,g as flushTelemetry,e as initTelemetry,c as invocationCommand,a as redactSecrets,b as scrubArgv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-UR3ROJIV.js";import"../chunk-G4OJTPSI.js";import"../chunk-T7LA7K35.js";import"../chunk-QPUL2AAI.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"import": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"./browser": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/browser/index.d.ts",
|
|
13
|
+
"default": "./dist/browser/index.js"
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
16
|
},
|
|
11
17
|
"bin": {
|
|
@@ -14,6 +20,7 @@
|
|
|
14
20
|
},
|
|
15
21
|
"files": [
|
|
16
22
|
"dist",
|
|
23
|
+
"!dist/**/*.map",
|
|
17
24
|
"postinstall.cjs",
|
|
18
25
|
"README.md",
|
|
19
26
|
"SKILL.md"
|
|
@@ -46,14 +53,21 @@
|
|
|
46
53
|
"jsonc-parser": "^3.3.1",
|
|
47
54
|
"open": "^11.0.0",
|
|
48
55
|
"yaml": "^2.8.3",
|
|
49
|
-
"@tigrisdata/iam": "^2.
|
|
50
|
-
"@tigrisdata/storage": "^3.
|
|
56
|
+
"@tigrisdata/iam": "^2.5.1",
|
|
57
|
+
"@tigrisdata/storage": "^3.21.0"
|
|
51
58
|
},
|
|
52
59
|
"devDependencies": {
|
|
53
|
-
"
|
|
60
|
+
"buffer": "^6.0.3",
|
|
61
|
+
"esbuild": "^0.27.7",
|
|
62
|
+
"events": "^3.3.0",
|
|
63
|
+
"memfs": "^4.68.1",
|
|
64
|
+
"path-browserify": "^1.0.1",
|
|
65
|
+
"stream-browserify": "^3.0.0",
|
|
66
|
+
"tsx": "^4.21.0",
|
|
67
|
+
"util": "^0.12.5"
|
|
54
68
|
},
|
|
55
69
|
"scripts": {
|
|
56
|
-
"build": "tsc --noEmit && tsup",
|
|
70
|
+
"build": "tsc --noEmit && tsup && npm run build:browser",
|
|
57
71
|
"dev": "export $(grep -v '^#' .env.test | xargs) && (tsc --noEmit --watch --preserveWatchOutput & tsup --watch)",
|
|
58
72
|
"cli": "export $(grep -v '^#' .env.test | xargs) && node dist/cli.js",
|
|
59
73
|
"lint": "biome lint",
|
|
@@ -72,6 +86,8 @@
|
|
|
72
86
|
"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",
|
|
73
87
|
"clean": "rm -rf dist",
|
|
74
88
|
"check": "biome check",
|
|
75
|
-
"check:fix": "biome check --write"
|
|
89
|
+
"check:fix": "biome check --write",
|
|
90
|
+
"generate:registry:browser": "tsx scripts/generate-registry.ts --target=browser",
|
|
91
|
+
"build:browser": "npm run generate:registry:browser && tsc --noEmit -p tsconfig.browser.json && tsx scripts/build-browser.ts && tsup --config tsup.browser.config.ts"
|
|
76
92
|
}
|
|
77
93
|
}
|
package/dist/chunk-76VFN2EJ.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as h}from"./chunk-G4OJTPSI.js";import{a as p}from"./chunk-RH6Z22EN.js";import{d as f,e as m,f as d}from"./chunk-V6JZFDRE.js";import{mkdirSync as w,readFileSync as E,writeFileSync as T}from"fs";import I from"https";import{homedir as g}from"os";import{join as C}from"path";var N=C(g(),".tigris","update-check.json");function _(){try{let r=E(N,"utf-8"),i=JSON.parse(r);return typeof i.latestVersion=="string"&&typeof i.lastChecked=="number"?i:null}catch{return null}}function b(r){try{w(C(g(),".tigris"),{recursive:!0}),T(N,JSON.stringify(r),"utf-8")}catch{}}function U(r,i){let o=s=>{let n=s.startsWith("v")?s.slice(1):s,c=null,a=n.indexOf("-");a!==-1&&(c=n.slice(a+1),n=n.slice(0,a));let l=n.split(".");if(l.length!==3)return null;let u=l.map(Number);return u.some(Number.isNaN)?null:{major:u[0],minor:u[1],patch:u[2],prerelease:c}},t=o(r),e=o(i);return!t||!e?!1:e.major>t.major?!0:e.major<t.major?!1:e.minor>t.minor?!0:e.minor<t.minor?!1:e.patch>t.patch?!0:e.patch<t.patch?!1:t.prerelease&&!e.prerelease?!0:(!t.prerelease&&e.prerelease,!1)}function D(){switch(h()){case"npm":return"npm install -g @tigrisdata/cli";case"homebrew":return"brew upgrade tigris";default:return process.platform==="win32"?"irm https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.ps1 | iex":"curl -fsSL https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.sh | sh"}}function k(r={}){return new Promise((i,o)=>{let t=I.get(f,{timeout:1e4},e=>{let s="";e.on("data",n=>{s+=n}),e.on("end",()=>{try{let n=JSON.parse(s);typeof n.version=="string"?(b({..._(),latestVersion:n.version,lastChecked:Date.now()}),i(n.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});t.on("error",e=>{o(e)}),t.on("timeout",()=>{t.destroy(),o(new Error("Request timed out"))}),r.unref&&t.on("socket",e=>{e.unref()}),t.end()})}function S(){k({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let r=_(),i=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(r&&U(p,r.latestVersion)&&(!r.lastNotified||Date.now()-r.lastNotified>i)){let t=`Update available: ${p} \u2192 ${r.latestVersion}`,e='Run "tigris update" to upgrade.',s=Math.max(t.length,e.length)+4,n=`\u250C${"\u2500".repeat(s-2)}\u2510`,c=`\u2514${"\u2500".repeat(s-2)}\u2518`,a=l=>`\u2502 ${l.padEnd(s-4)} \u2502`;console.log(`
|
|
2
|
-
${n}
|
|
3
|
-
${a("")}
|
|
4
|
-
${a(t)}
|
|
5
|
-
${a(e)}
|
|
6
|
-
${a("")}
|
|
7
|
-
${c}
|
|
8
|
-
`),b({...r,lastNotified:Date.now()})}let o=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!r||Date.now()-r.lastChecked>o)&&S()}export{_ as a,U as b,D as c,k as d,M as e};
|
package/dist/chunk-J3MAV7JB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,d as s,e as g,f,g as p,o as k}from"./chunk-F4AGJWCK.js";import{createRemoteJWKSet as w,jwtVerify as T}from"jose";import _ from"open";function y(){let a=process.env.TIGRIS_ENV==="development",e=a?process.env.TIGRIS_AUTH0_DOMAIN??"auth-storage.tigris.dev":process.env.TIGRIS_AUTH0_DOMAIN??"auth.storage.tigrisdata.io",t=a?process.env.TIGRIS_AUTH0_CLIENT_ID??"JdJVYIyw0O1uHi5L5OJH903qaWBgd3gF":process.env.TIGRIS_AUTH0_CLIENT_ID??"DMejqeM3CQ4IqTjEcd3oA9eEiT40hn8D",n=a?process.env.TIGRIS_AUTH0_AUDIENCE??"https://tigris-api-dev":process.env.TIGRIS_AUTH0_AUDIENCE??"https://tigris-os-api",i=process.env.TIGRIS_CLAIMS_NAMESPACE??"https://tigris";return{domain:e,clientId:t,audience:n,claimsNamespace:i}}var u=class{config;baseUrl;jwks=null;constructor(){this.config=y(),this.baseUrl=`https://${this.config.domain}`}getJWKS(){return this.jwks||(this.jwks=w(new URL(`${this.baseUrl}/.well-known/jwks.json`))),this.jwks}async verifyIdToken(e){let{payload:t}=await T(e,this.getJWKS(),{issuer:`${this.baseUrl}/`,audience:this.config.clientId});return t}async login(e){let t=await fetch(`${this.baseUrl}/oauth/device/code`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:this.config.clientId,audience:this.config.audience,scope:"openid profile email offline_access"})});if(!t.ok)throw new Error(`Device authorization failed: ${t.statusText}`);let n=JSON.parse(await t.text());e?.onDeviceCode?.(n.user_code,n.verification_uri),await this.sleep(2e3);try{await _(n.verification_uri_complete)}catch{}e?.onWaiting?.();let i=await this.pollForToken(n.device_code,n.interval||5);await d(i),k("oauth"),await this.extractAndStoreOrganizations()}async pollForToken(e,t){let i=0;for(;i<60;){i++;let r=await fetch(`${this.baseUrl}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:this.config.clientId,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});if(!r.ok){let l=await r.text().then(JSON.parse).catch(()=>({}));if(l.error==="authorization_pending"){await this.sleep(t*1e3);continue}if(l.error==="slow_down"){t+=5,await this.sleep(t*1e3);continue}throw new Error(l.error_description||"Authentication failed")}let o=JSON.parse(await r.text());if(!o.id_token)throw new Error("No ID token found. Please try again.");if((await this.verifyIdToken(o.id_token)).email_verified===!1)throw console.log("Email not verified. Please verify your email and try again."),new Error("Email not verified. Please verify your email and try again.");let m=Date.now()+(o.expires_in||3600)*1e3;return{accessToken:o.access_token,refreshToken:o.refresh_token,idToken:o.id_token,expiresAt:m}}throw new Error("Authentication timed out. Please try again.")}async getAccessToken(){let e=await s();if(!e)throw new Error('Not authenticated. Please run "tigris login" to authenticate.');let t=300*1e3;return Date.now()+t>=e.expiresAt&&(e=await this.refreshAccessToken(e)),e.accessToken}async refreshAccessToken(e){let t;if(e?.refreshToken?t=e:t=await s(),!t?.refreshToken)throw new Error('No refresh token available. Please run "tigris login" to re-authenticate.');try{let n=await fetch(`${this.baseUrl}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:this.config.clientId,grant_type:"refresh_token",refresh_token:t.refreshToken,scope:"openid profile email offline_access"})});if(!n.ok)throw new Error("Token refresh failed");let i=JSON.parse(await n.text()),r={accessToken:i.access_token,refreshToken:i.refresh_token||t.refreshToken,idToken:i.id_token||t.idToken,expiresAt:Date.now()+(i.expires_in||3600)*1e3};return await d(r),r}catch{throw await g(),new Error('Token refresh failed. Please run "tigris login" to re-authenticate.')}}async getIdTokenClaims(){let e=await s();if(!e?.idToken)throw new Error('Not authenticated. Please run "tigris login" to authenticate.');try{return await this.verifyIdToken(e.idToken)}catch{throw new Error('ID token verification failed. Please run "tigris login" to re-authenticate.')}}async extractAndStoreOrganizations(){try{let e=await this.fetchOrganizationsFromUserInfo();e&&f(e)}catch{}}async fetchOrganizationsFromUserInfo(){try{let{domain:e,claimsNamespace:t}=this.config,n=await this.getAccessToken(),i=await fetch(`https://${e}/userinfo`,{headers:{Authorization:`Bearer ${n}`}});if(!i.ok)return null;let o=JSON.parse(await i.text())[t]?.ns;return Array.isArray(o)?o.map(c=>({id:c.id,name:c.name,slug:c.name})):null}catch{return null}}async getOrganizations(){return await this.getAccessToken(),p()}async isFlyUser(){return(await this.getIdTokenClaims()).sub.includes("fly-sso")}async logout(){await g()}async isAuthenticated(){return await s()!==null}sleep(e){return new Promise(t=>setTimeout(t,e))}},h=null;function S(){return h||(h=new u),h}export{y as a,u as b,S as c};
|
package/dist/chunk-JNSFDQGG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-AFM3TY2D.js";import{b as r}from"./chunk-N3Y6RFSK.js";function a(e){if(e.storageClass)return e.days!==void 0?`${e.storageClass} after ${e.days}d`:e.date!==void 0?`${e.storageClass} on ${e.date}`:e.storageClass}function f(e){if(e.expiration){if(e.expiration.days!==void 0)return`${e.expiration.days}d`;if(e.expiration.date!==void 0)return e.expiration.date}}function u(e){let n=[],i=a(e);i&&n.push(i);let t=f(e);t&&n.push(e.expiration?.days!==void 0?`expire after ${t}`:`expire on ${t}`);let s=[];e.filter?.prefix&&s.push(`prefix=${e.filter.prefix}`),e.enabled===!1&&s.push("disabled");let o=n.join(", ");return s.length>0?`${o} (${s.join(", ")})`:o}function p(e){let n=[{label:"Number of Objects",value:e.sizeInfo.numberOfObjects?.toString()??"N/A"},{label:"Total Size",value:e.sizeInfo.size!==void 0?l(e.sizeInfo.size):"N/A"},{label:"All Versions Count",value:e.sizeInfo.numberOfObjectsAllVersions?.toString()??"N/A"},{label:"Default Tier",value:e.settings.defaultTier},{label:"Locations",value:r(e.locations)},{label:"Snapshots Enabled",value:e.isSnapshotEnabled?"Yes":"No"},{label:"Delete Protection",value:e.settings.deleteProtection?"Yes":"No"},{label:"Soft Delete",value:e.settings.softDelete.enabled?`Enabled (${e.settings.softDelete.retentionDays} day retention)`:"Disabled"},{label:"Allow Object ACL",value:e.settings.allowObjectAcl?"Yes":"No"},{label:"Custom Domain",value:e.settings.customDomain??"None"},{label:"Has Forks",value:e.forkInfo?.hasChildren?"Yes":"No"}];return e.forkInfo?.parents?.length&&(n.push({label:"Forked From",value:e.forkInfo.parents[0].bucketName}),n.push({label:"Fork Snapshot",value:e.forkInfo.parents[0].snapshot})),e.settings.lifecycleRules?.length&&n.push({label:"Lifecycle Rules",value:e.settings.lifecycleRules.map(i=>u(i)).join(", ")}),e.settings.additionalHeaders&&n.push({label:"Additional Headers",value:Object.entries(e.settings.additionalHeaders).map(([i,t])=>`${i}: ${t}`).join(", ")}),e.settings.corsRules.length&&n.push({label:"CORS Rules",value:`${e.settings.corsRules.length} rule(s)`}),e.settings.notifications&&n.push({label:"Notifications",value:e.settings.notifications.enabled!==!1?"Enabled":"Disabled"}),e.settings.dataMigration&&n.push({label:"Data Migration",value:e.settings.dataMigration.endpoint?`${e.settings.dataMigration.name??"N/A"} (${e.settings.dataMigration.endpoint})`:e.settings.dataMigration.name??"Configured"}),n}export{a,f as b,p as c};
|