@tigrisdata/cli 3.6.1 → 3.7.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 +82 -5
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/{chunk-5OPGTV33.js → chunk-2CEUCG65.js} +1 -1
- package/dist/chunk-3ILNJZ6D.js +1 -0
- package/dist/{chunk-7Z6ZHS7Y.js → chunk-3RVILEB4.js} +1 -1
- package/dist/{chunk-4J4ZJAMQ.js → chunk-4HHJ6ZI7.js} +1 -1
- package/dist/{chunk-AWUW4BD3.js → chunk-5JBNZ4C6.js} +1 -1
- package/dist/{chunk-KPEAQ6DK.js → chunk-6QS6QJ65.js} +1 -1
- package/dist/{chunk-5YAC4LCL.js → chunk-DF3BGBKJ.js} +1 -1
- package/dist/chunk-E6COPYXK.js +28 -0
- package/dist/chunk-HCZGZVF3.js +9 -0
- package/dist/chunk-L6I5MSYU.js +5 -0
- package/dist/{chunk-4W44TSLI.js → chunk-U3422EZ6.js} +1 -1
- package/dist/{chunk-2FH2T67P.js → chunk-UIPN4DNR.js} +1 -1
- package/dist/{chunk-YGFC3GME.js → chunk-WXYJJPV2.js} +1 -1
- package/dist/{chunk-SDZJD5IE.js → chunk-Z265ZXTU.js} +1 -1
- package/dist/{chunk-MW4NG7JY.js → chunk-ZNUPMP3O.js} +1 -1
- 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 -1
- package/dist/lib/buckets/migrate.js +5 -5
- package/dist/lib/buckets/rebase.js +1 -1
- package/dist/lib/buckets/restore.js +1 -1
- package/dist/lib/buckets/set-cors.js +1 -1
- package/dist/lib/buckets/set-locations.js +1 -1
- package/dist/lib/buckets/set-migration.js +1 -1
- package/dist/lib/buckets/set-notifications.js +1 -1
- package/dist/lib/buckets/set.js +1 -1
- package/dist/lib/bundle.js +1 -1
- package/dist/lib/configure/index.js +1 -1
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -1
- package/dist/lib/iam/policies/delete.js +1 -1
- package/dist/lib/iam/policies/edit.js +1 -1
- package/dist/lib/iam/policies/get.js +1 -1
- package/dist/lib/iam/policies/link-key.js +1 -1
- package/dist/lib/iam/policies/list-keys.js +1 -1
- package/dist/lib/iam/policies/list.js +1 -1
- package/dist/lib/iam/policies/select-policy.js +1 -1
- package/dist/lib/iam/policies/unlink-key.js +1 -1
- package/dist/lib/iam/teams/create.js +1 -1
- package/dist/lib/iam/teams/edit.js +1 -1
- package/dist/lib/iam/teams/list.js +1 -1
- package/dist/lib/iam/teams/shared.js +1 -1
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +1 -1
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/init/index.js +1 -1
- package/dist/lib/init/interactive.js +1 -1
- package/dist/lib/init/plan.js +1 -1
- package/dist/lib/init/shared.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/oauth.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/logout.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list-versions.js +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 +5 -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 +1 -1
- package/dist/chunk-FB54QSI7.js +0 -35
- package/dist/chunk-IHMIXWMY.js +0 -1
- package/dist/chunk-OWYZCGWM.js +0 -8
- package/dist/chunk-TOKNV45Q.js +0 -6
- /package/dist/{chunk-AWTU3DRX.js → chunk-A3YRE353.js} +0 -0
package/dist/lib/init/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as t}from"../../chunk-L6I5MSYU.js";import{a as r}from"../../chunk-E6COPYXK.js";import{b as n,c as o}from"../../chunk-HCZGZVF3.js";import{a as e}from"../../chunk-S6KFKBMY.js";async function l(i){let s=e(i,["agent"]);if(process.env.TIGRIS_NO_UPDATE_CHECK="1",process.env.PATH=n(process.env.PATH),!s){await t();return}console.log(r(o()!==null))}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-L6I5MSYU.js";import"../../chunk-HCZGZVF3.js";export{a as runInteractive};
|
package/dist/lib/init/plan.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-E6COPYXK.js";export{a as buildAgentSetup};
|
package/dist/lib/init/shared.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"../../chunk-HCZGZVF3.js";export{e as MCP_SERVER_NAME,f as REMOTE_MCP_URL,i as SUPPORTED_EDITORS,n as TIGRIS_SKILLS,m as TIGRIS_SKILLS_REPO,o as buildSkillsArgs,d as defaultsHint,l as detectEditors,c as getInstalledCliVersion,g as mergeMcpServers,k as resolveMcpTarget,j as skillsDirsFor,a as spawnOpts,h as upsertTomlServer,b as withoutEphemeralBins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-WXYJJPV2.js";import"../../chunk-S77OAN6Y.js";import"../../chunk-A3YRE353.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";export{a as default};
|
package/dist/lib/login/oauth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-2CEUCG65.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";export{b as default,a as oauth};
|
package/dist/lib/login/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"../../chunk-
|
|
1
|
+
import{a as c}from"../../chunk-WXYJJPV2.js";import{a as r}from"../../chunk-2CEUCG65.js";import{a as s}from"../../chunk-S77OAN6Y.js";import"../../chunk-A3YRE353.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import i from"enquirer";var{prompt:n}=i;async function u(e){let a=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,t=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(a||t){await c(e);return}s('Use "tigris login oauth" or "tigris login credentials --access-key ... --access-secret ..."');let{method:m}=await n({type:"select",name:"method",message:"Choose login method:",choices:[{name:"user",message:"As a user (OAuth2 flow)"},{name:"machine",message:"As a machine (Access Key & Secret)"}]});m==="user"?await r():await c(e)}export{u as default};
|
package/dist/lib/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"../chunk-S6KFKBMY.js";import{b as n}from"../chunk-
|
|
1
|
+
import{b as c}from"../chunk-S6KFKBMY.js";import{b as n}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import{b as t,c as r,j as i}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import{t as a}from"../chunk-F4AGJWCK.js";var o=i("logout");async function f(m={}){t(o);let e=c(m);try{await a(),e==="json"&&console.log(JSON.stringify({action:"logged_out"})),r(o)}catch(s){n(o,s)}}export{f as default};
|
package/dist/lib/ls.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P,g}from"../chunk-AFM3TY2D.js";import{e as N}from"../chunk-7ZCVOA6A.js";import{e as p}from"../chunk-
|
|
1
|
+
import{a as P,g}from"../chunk-AFM3TY2D.js";import{e as N}from"../chunk-7ZCVOA6A.js";import{e as p}from"../chunk-A3YRE353.js";import{a as d,b as z,c as j}from"../chunk-S6KFKBMY.js";import{a as c}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import{i as f}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{list as D,listBuckets as E}from"@tigrisdata/storage";async function F(n){let l=d(n,["path"]),u=d(n,["snapshot-version","snapshotVersion","snapshot"]),t=z(n),k=d(n,["source"]),{limit:i,pageToken:a}=j(n);if(!l){let e=await p(),{data:r,error:x}=await E({...i!==void 0?{limit:i}:{},...a?{paginationToken:a}:{},config:e});x&&c(x);let W=(r.buckets||[]).map(w=>({name:w.name,created:w.creationDate})),A=[{key:"name",header:"Name"},{key:"created",header:"Created"}],b=r.paginationToken||void 0,B=g(W,t,"buckets","bucket",A,{paginationToken:b});console.log(B),t!=="json"&&t!=="xml"&&f(b);return}let{bucket:h,path:s}=N(l);h||c("Invalid path");let S=await p(),o=s?s.endsWith("/")?s:`${s}/`:void 0,{data:m,error:y}=await D({prefix:o,delimiter:"/",...u?{snapshotVersion:u}:{},...k?{source:k}:{},...i!==void 0?{limit:i}:{},...a?{paginationToken:a}:{},config:{...S,bucket:h}});y&&c(y);let O=(m.commonPrefixes||[]).map(e=>({key:o?e.slice(o.length):e,size:"-",modified:""})),v=(m.items||[]).map(e=>({key:o?e.name.slice(o.length):e.name,size:P(e.size),modified:e.lastModified})).filter(e=>e.key!==""),C=[...O,...v],M=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],T=m.paginationToken||void 0,V=g(C,t,"objects","object",M,{paginationToken:T});console.log(V),t!=="json"&&t!=="xml"&&f(T)}export{F as default};
|
package/dist/lib/mk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as h}from"../chunk-7ZCVOA6A.js";import{e as b}from"../chunk-
|
|
1
|
+
import{c as m}from"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as h}from"../chunk-7ZCVOA6A.js";import{e as b}from"../chunk-A3YRE353.js";import{a as t,b as p}from"../chunk-S6KFKBMY.js";import{a as r}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{createBucket as O,put as A}from"@tigrisdata/storage";async function j(e){let l=t(e,["path"]);l||r("path argument is required");let{bucket:o,path:a}=h(l);o||r("Invalid path");let f=await b(),u=p(e);if(a){let s=a.endsWith("/")?a:`${a}/`,{error:c}=await A(s,"",{config:{...f,bucket:o}});c&&r(c),console.log(u==="json"?JSON.stringify({action:"created",type:"folder",bucket:o,path:s}):`Folder '${o}/${s}' created`),process.exit(0)}else{let c=t(e,["public"])?"public":t(e,["access","a","A"]),d=t(e,["enableSnapshots","enable-snapshots","s","S"]),S=t(e,["allow-object-acl","allowObjectAcl"]),k=t(e,["enable-directory-listing","enableDirectoryListing"]),y=t(e,["defaultTier","default-tier","t","T"]),w=t(e,["locations","l","L"]),n=t(e,["fork-of","forkOf","fork"]),i=t(e,["source-snapshot","sourceSnapshot","source-snap"]);i&&!n&&r("--source-snapshot requires --fork-of");let{error:g}=await O(o,{defaultTier:y??"STANDARD",enableSnapshot:d===!0,allowObjectAcl:S===!0,enableDirectoryListing:k===!0,access:c??"private",locations:m(w??"global"),...n?{sourceBucketName:n}:{},...i?{sourceBucketSnapshot:i}:{},config:f});g&&r(g),console.log(u==="json"?JSON.stringify({action:"created",type:"bucket",name:o}):`Bucket '${o}' created`),process.exit(0)}}export{j as default};
|
package/dist/lib/mv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,b as M}from"../chunk-S77OAN6Y.js";import{a as E,b as j,d as R,f as T,g as D,i as J}from"../chunk-7ZCVOA6A.js";import{e as O}from"../chunk-
|
|
1
|
+
import{a as x,b as M}from"../chunk-S77OAN6Y.js";import{a as E,b as j,d as R,f as T,g as D,i as J}from"../chunk-7ZCVOA6A.js";import{e as O}from"../chunk-A3YRE353.js";import{a as w,b as N}from"../chunk-S6KFKBMY.js";import{a as s}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{copy as G,list as H,move as L,put as Q,remove as C}from"@tigrisdata/storage";var d=!1;async function V(i){let a=w(i,["src"]),c=w(i,["dest"]),m=w(i,["yes","y","force","f"]),p=!!w(i,["recursive","r"]);d=N(i)==="json",(!a||!c)&&s("both src and dest arguments are required"),(!E(a)||!E(c))&&s("Both src and dest must be remote Tigris paths (t3:// or tigris://)");let e=j(a),t=j(c);e.bucket||s("Invalid source path"),t.bucket||s("Invalid destination path");let g=a.endsWith("/");!e.path&&!g&&s("Cannot move a bucket. Provide a path within the bucket.");let l=await O({withCredentialProvider:!0}),h=e.path.includes("*"),y=e.path.endsWith("/")||!e.path&&g;if(!h&&!y&&e.path&&(y=await R(e.bucket,e.path,l)),y&&!h&&!p&&s("Source is a remote folder (not moved). Use -r to move recursively."),h||y){let r=h?D(e.path):e.path?e.path.endsWith("/")?e.path:`${e.path}/`:"",n=!h&&e.path&&!e.path.endsWith("/")?e.path.split("/").filter(Boolean).pop()??"":"",f=[t.path?.replace(/\/$/,"")||"",n].filter(Boolean).join("/"),U=f?`${f}/`:"";e.bucket===t.bucket&&r===U&&s("Source and destination are the same");let{items:q,error:I}=await J(e.bucket,r||void 0,l);I&&s(I);let b=q.filter(o=>o.name!==r);if(h){let o=e.path.split("/").pop(),u=T(o);b=b.filter(k=>{let $=r?k.name.slice(r.length):k.name;return!p&&$.includes("/")?!1:u.test($.split("/").pop())})}let{data:_}=await H({prefix:r,limit:1,config:{...l,bucket:e.bucket}}),S=r?_?.items?.some(o=>o.name===r):!1;if(b.length===0&&!S){console.log(d?JSON.stringify({action:"moved",count:0}):"No objects to move");return}let z=b.length+(S?1:0);if(!m&&(x("Use --yes to skip confirmation"),!await M(`Are you sure you want to move ${z} object(s)?`))){d||console.log("Aborted");return}let v=0;for(let o of b){let u=r?o.name.slice(r.length):o.name,k=f?`${f}/${u}`:u,$=await A(l,e.bucket,o.name,t.bucket,k);$.error?console.error(`Failed to move ${o.name}: ${$.error}`):(d||console.log(`Moved t3://${e.bucket}/${o.name} -> t3://${t.bucket}/${k}`),v++)}let W=!1;if(S)if(f){let o=`${f}/`,u=await A(l,e.bucket,r,t.bucket,o);u.error?console.error(`Failed to move folder marker: ${u.error}`):W=!0}else{let{error:o}=await C(r,{config:{...l,bucket:e.bucket}});o?console.error(`Failed to remove source folder marker: ${o.message}`):W=!0}v===0&&W&&(v=1),console.log(d?JSON.stringify({action:"moved",count:v}):`Moved ${v} object(s)`)}else{let r=e.path.split("/").pop(),n;if(t.path?t.path.endsWith("/")?n=`${t.path}${r}`:await R(t.bucket,t.path,l)?n=`${t.path}/${r}`:n=t.path:n=r,e.bucket===t.bucket&&e.path===n&&s("Source and destination are the same"),!m&&(x("Use --yes to skip confirmation"),!await M(`Are you sure you want to move 't3://${e.bucket}/${e.path}'?`))){d||console.log("Aborted");return}let F=await A(l,e.bucket,e.path,t.bucket,n);F.error&&s(F.error),console.log(d?JSON.stringify({action:"moved",count:1,src:`t3://${e.bucket}/${e.path}`,dest:`t3://${t.bucket}/${n}`}):`Moved t3://${e.bucket}/${e.path} -> t3://${t.bucket}/${n}`)}process.exit(0)}async function A(i,a,c,m,p){if(c.endsWith("/")){let{error:t}=await Q(p,"",{config:{...i,bucket:m}});if(t)return{error:t.message};let{error:g}=await C(c,{config:{...i,bucket:a}});return g?{error:`Copied but failed to delete source: ${g.message}`}:{}}if(a===m){let{error:t}=await L(c,p,{config:{...i,bucket:a}});return t?{error:t.message}:{}}let{error:P}=await G(c,p,{srcBucket:a,destBucket:m,config:{...i,bucket:m}});if(P)return{error:P.message};let{error:e}=await C(c,{config:{...i,bucket:a}});return e?{error:`Copied but failed to delete source: ${e.message}`}:{}}export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,b as N}from"../../chunk-S77OAN6Y.js";import{h as C}from"../../chunk-7ZCVOA6A.js";import{e as q}from"../../chunk-
|
|
1
|
+
import{a as V,b as N}from"../../chunk-S77OAN6Y.js";import{h as C}from"../../chunk-7ZCVOA6A.js";import{e as q}from"../../chunk-A3YRE353.js";import{a as d,b as T}from"../../chunk-S6KFKBMY.js";import{a as w,b as o,c as O,d as S}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import{b as A,c as $,d as j,j as M}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{listVersions as H,remove as R}from"@tigrisdata/storage";var r=M("objects","delete");async function W(c){A(r);let K=T(c),b=d(c,["bucket"]),E=d(c,["key"]),F=d(c,["yes","y","force"]),a=d(c,["version-id","versionId"]),u=!!d(c,["all-versions","allVersions"]);b||o(r,"Bucket name or path is required"),a&&u&&o(r,"Cannot use --version-id with --all-versions");let h=C(b),s=h.bucket,m=E||h.key||void 0;m||o(r,"Object key is required");let I={...await q(),bucket:s},n=Array.isArray(m)?m:[m];a&&n.length>1&&o(r,"--version-id targets a single object; pass exactly one key");let f=[];if(u)for(let e of n){let t=0,g,v,p=!1;for(;;){let{data:l,error:x}=await H({prefix:e,...g?{keyMarker:g}:{},...v?{versionIdMarker:v}:{},config:I});x&&o(r,x);for(let i of l.versions)i.name===e?(f.push({key:e,versionId:i.versionId}),t++):i.name>e&&(p=!0);for(let i of l.deleteMarkers)i.name===e?(f.push({key:e,versionId:i.versionId}),t++):i.name>e&&(p=!0);if(p||!l.hasMore)break;l.nextKeyMarker||o(r,`listVersions reported more pages but no nextKeyMarker for key '${e}'`),g=l.nextKeyMarker,v=l.nextVersionIdMarker}t===0&&o(r,`No versions or delete markers found for key '${e}'`)}else if(a)f.push({key:n[0],versionId:a});else for(let e of n)f.push({key:e});if(!F){V("Use --yes to skip confirmation");let e=u?`Hard-delete ${f.length} version(s) and delete marker(s) for ${n.length} object(s) from '${s}'?`:a?`Hard-delete version '${a}' of '${n[0]}' from '${s}'?`:`Delete ${n.length} object(s) from '${s}'?`;if(!await N(e)){console.log("Aborted");return}}let y=[],k=[];for(let e of f){let{error:t}=await R(e.key,{...e.versionId?{versionId:e.versionId}:{},config:I});t?(j(r,t.message,e),k.push({...e,error:t.message})):(y.push(e),$(r,e))}if(K==="json"){let e=O(r,{bucket:s}),t={action:"deleted",bucket:s,keys:y.map(g=>g.key),deleted:y,errors:k};e.length>0&&(t.nextActions=e),console.log(JSON.stringify(t))}k.length>0&&w(k[0].error,r),S(r,{bucket:s})}export{W as default};
|
package/dist/lib/objects/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as w}from"../../chunk-7ZCVOA6A.js";import{e as k}from"../../chunk-
|
|
1
|
+
import{h as w}from"../../chunk-7ZCVOA6A.js";import{e as k}from"../../chunk-A3YRE353.js";import{a as r,b as j}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import{b as u,c as a,j as b}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createWriteStream as q,writeFileSync as T}from"fs";import{extname as C}from"path";import{Readable as S}from"stream";import{pipeline as x}from"stream/promises";import{get as y}from"@tigrisdata/storage";var e=b("objects","get"),E=new Set([".js",".ts",".jsx",".tsx",".mjs",".cjs",".py",".rb",".php",".java",".go",".rs",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".scala",".clj",".ex",".exs",".erl",".sh",".bash",".zsh",".fish",".ps1",".bat",".cmd",".sql",".graphql",".gql",".json",".yaml",".yml",".toml",".ini",".cfg",".conf",".xml",".plist",".env",".properties",".html",".htm",".css",".scss",".sass",".less",".styl",".md",".markdown",".mdx",".rst",".txt",".text",".csv",".tsv",".log",".ejs",".hbs",".pug",".jade",".njk",".twig",".liquid",".svg",".gitignore",".dockerignore",".editorconfig"]);function F(t,m){let d=C(m||t).toLowerCase();return E.has(d)?"string":"stream"}async function N(t){u(e);let m=j(t),p=r(t,["bucket"]),d=r(t,["key"]),s=r(t,["output","o","O"]),v=r(t,["mode","m","M"]),g=r(t,["snapshot-version","snapshotVersion","snapshot"]),f=r(t,["version-id","versionId"]);p||c(e,"Bucket name or path is required");let{bucket:l,key:o}=w(p,d);o||c(e,"Object key is required");let h=await k();if((v||F(o,s))==="stream"){let{data:i,error:n}=await y(o,"stream",{...g?{snapshotVersion:g}:{},...f?{versionId:f}:{},config:{...h,bucket:l}});if(n&&c(e,n),s){let O=q(s);await x(S.fromWeb(i),O),a(e,{key:o,output:s}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:l,key:o,output:s}))}else await x(S.fromWeb(i),process.stdout),a(e)}else{let{data:i,error:n}=await y(o,"string",{...g?{snapshotVersion:g}:{},...f?{versionId:f}:{},config:{...h,bucket:l}});n&&c(e,n),s?(T(s,i),a(e,{key:o,output:s}),m==="json"&&console.log(JSON.stringify({action:"downloaded",bucket:l,key:o,output:s}))):(console.log(i),a(e))}}export{N as default};
|
package/dist/lib/objects/info.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,f as k}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-7ZCVOA6A.js";import{e as l}from"../../chunk-
|
|
1
|
+
import{a as h,f as k}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-7ZCVOA6A.js";import{e as l}from"../../chunk-A3YRE353.js";import{a as i,b as d}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import{b as u,c as p,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{head as A}from"@tigrisdata/storage";var e=g("objects","info");async function I(o){u(e);let b=d(o),s=i(o,["bucket"]),y=i(o,["key"]),c=i(o,["snapshot-version","snapshotVersion","snapshot"]),a=i(o,["version-id","versionId"]);s||r(e,"Bucket name or path is required");let{bucket:f,key:n}=v(s,y);n||r(e,"Object key is required");let S=await l(),{data:t,error:m}=await A(n,{...c?{snapshotVersion:c}:{},...a?{versionId:a}:{},config:{...S,bucket:f}});m&&r(e,m),t||r(e,"Object not found");let j=[{metric:"Path",value:t.path},{metric:"Size",value:h(t.size)},{metric:"Content-Type",value:t.contentType||"N/A"},{metric:"Content-Disposition",value:t.contentDisposition||"N/A"},{metric:"Modified",value:t.modified.toISOString()},{metric:"URL",value:t.url}],O=k(j,b,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(O),p(e,{bucket:f,key:n})}export{I as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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{e as b}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{e as b}from"../../chunk-A3YRE353.js";import{a as o,b as I,c as V}from"../../chunk-S6KFKBMY.js";import{b as a}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.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-AFM3TY2D.js";import{e as S}from"../../chunk-7ZCVOA6A.js";import{e as P}from"../../chunk-
|
|
1
|
+
import{a as T,g as w}from"../../chunk-AFM3TY2D.js";import{e as S}from"../../chunk-7ZCVOA6A.js";import{e as P}from"../../chunk-A3YRE353.js";import{a as e,b as j,c as z}from"../../chunk-S6KFKBMY.js";import{b as s}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.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-AFM3TY2D.js";import{h as j}from"../../chunk-7ZCVOA6A.js";import{e as w}from"../../chunk-
|
|
1
|
+
import{a as R}from"../../chunk-EKW6XTGL.js";import{a as A}from"../../chunk-HPICBIXL.js";import{a as s,f as v}from"../../chunk-AFM3TY2D.js";import{h as j}from"../../chunk-7ZCVOA6A.js";import{e as w}from"../../chunk-A3YRE353.js";import{a as n,b as z}from"../../chunk-S6KFKBMY.js";import{b as i,d as T}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createReadStream as E,statSync as M}from"fs";import{Readable as $}from"stream";import{put as N}from"@tigrisdata/storage";var t=h("objects","put");async function Y(r){k(t);let u=n(r,["bucket"]),l=n(r,["key"]),y=n(r,["file"]),C=n(r,["access","a","A"],"private"),O=n(r,["content-type","contentType","t","T"]),P=z(r);u||i(t,"Bucket name or path is required");let d=j(u),m=d.bucket,a=d.key||l,e=d.key&&l||y;a||i(t,"Object key is required");let q=!process.stdin.isTTY;!e&&!q&&i(t,"File path is required (or pipe data via stdin)");let f,o;if(e){try{o=M(e).size}catch{i(t,`File not found: ${e}`)}let p=E(e);f=$.toWeb(p)}else f=$.toWeb(process.stdin);let U=await w({withCredentialProvider:!0}),x=e?R(o):{multipart:!0,partSize:5*1024*1024,queueSize:8},F=O??(e?A(e):void 0),{data:c,error:g}=await N(a,f,{access:C==="public"?"public":"private",contentType:F,...x,onUploadProgress:({loaded:p,percentage:b})=>{o!==void 0&&o>0?process.stdout.write(`\rUploading: ${s(p)} / ${s(o)} (${b}%)`):process.stdout.write(`\rUploading: ${s(p)}`)},config:{...U,bucket:m}});process.stdout.write(`\r${" ".repeat(60)}\r`),g&&i(t,g);let W=[{path:c.path,size:s(c.size??o??0),contentType:c.contentType||"-",modified:c.modified}],B=v(W,P,"objects","object",[{key:"path",header:"Path"},{key:"size",header:"Size"},{key:"contentType",header:"Content-Type"},{key:"modified",header:"Modified"}]);console.log(B),S(t,{key:a,bucket:m}),T(t,{key:a,bucket:m})}export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as y}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-7ZCVOA6A.js";import{e as h}from"../../chunk-
|
|
1
|
+
import{f as y}from"../../chunk-AFM3TY2D.js";import{h as v}from"../../chunk-7ZCVOA6A.js";import{e as h}from"../../chunk-A3YRE353.js";import{a as e,b as d}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import{b as g,c as p,e as l,j as k}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{getRestoreInfo as A}from"@tigrisdata/storage";var t=k("objects","restore-info");async function I(r){g(t);let n=d(r),c=e(r,["bucket"]),S=e(r,["key"]),a=e(r,["version-id","versionId"]),f=e(r,["snapshot-version","snapshotVersion","snapshot"]);c||i(t,"Bucket name or path is required");let{bucket:m,key:o}=v(c,S);o||i(t,"Object key is required");let b=await h(),{data:s,error:u}=await A(o,{...a?{versionId:a}:{},...f?{snapshotVersion:f}:{},config:{...b,bucket:m}});if(u&&i(t,u),!s){n==="json"?console.log(JSON.stringify({status:null})):l(t);return}let O=[{metric:"Path",value:o},{metric:"Status",value:s.status},...s.expiresAt?[{metric:"Expires",value:s.expiresAt.toISOString()}]:[]],x=y(O,n,"restore-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(x),p(t,{bucket:m,key:o})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as k}from"../../chunk-7ZCVOA6A.js";import{e as y}from"../../chunk-
|
|
1
|
+
import{h as k}from"../../chunk-7ZCVOA6A.js";import{e as y}from"../../chunk-A3YRE353.js";import{a as t,b as p}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import{b as d,c as u,j as b}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{restoreObject as j}from"@tigrisdata/storage";var s=b("objects","restore");async function O(e){d(s);let h=p(e),c=t(e,["bucket"]),l=t(e,["key"]),a=t(e,["version-id","versionId"]),f=t(e,["snapshot-version","snapshotVersion","snapshot"]),g=t(e,["days","d"]);c||n(s,"Bucket name or path is required");let{bucket:i,key:o}=k(c,l);o||n(s,"Object key is required");let r;g!==void 0&&(r=Number(g),(!Number.isInteger(r)||r<1)&&n(s,"--days must be a positive integer"));let v=await y(),{error:m}=await j(o,{...r!==void 0?{days:r}:{},...a?{versionId:a}:{},...f?{snapshotVersion:f}:{},config:{...v,bucket:i}});m&&n(s,m),h==="json"&&console.log(JSON.stringify({action:"restore-requested",bucket:i,key:o,days:r??1})),u(s,{key:o,bucket:i})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as l}from"../../chunk-7ZCVOA6A.js";import{e as k}from"../../chunk-
|
|
1
|
+
import{h as l}from"../../chunk-7ZCVOA6A.js";import{e as k}from"../../chunk-A3YRE353.js";import{a as o,b}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{setObjectAccess as v}from"@tigrisdata/storage";var e=p("objects","set-access");async function j(r){m(e);let d=b(r),a=o(r,["bucket"]),f=o(r,["key"]),y=o(r,["access"]);a||c(e,"Bucket name or path is required");let i=l(a),n=i.bucket,s=i.key||f,t=i.key?f:y;s||c(e,"Object key is required"),t||c(e,"Access level is required (public or private)"),t!=="public"&&t!=="private"&&c(e,'Access level must be either "public" or "private"');let A=await k(),{error:g}=await v(s,{access:t,config:{...A,bucket:n}});g&&c(e,g),d==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,key:s,access:t})),u(e,{key:s,bucket:n,access:t})}export{j as default};
|
package/dist/lib/objects/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d}from"../../chunk-7ZCVOA6A.js";import{e as b}from"../../chunk-
|
|
1
|
+
import{h as d}from"../../chunk-7ZCVOA6A.js";import{e as b}from"../../chunk-A3YRE353.js";import{a as i,b as y}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{move as v,setObjectAccess as A}from"@tigrisdata/storage";var e=l("objects","set");async function O(r){p(e);let w=y(r),f=i(r,["bucket"]),j=i(r,["key"]),s=i(r,["access","a","A"]),c=i(r,["new-key","n","newKey"]);f||t(e,"Bucket name or path is required");let{bucket:n,key:a}=d(f,j);a||t(e,"Object key is required"),s||t(e,"Access level is required (--access public|private)");let g={...await b(),bucket:n},o=a;if(c){let{error:u}=await v(a,c,{config:g});u&&t(e,u),o=c}let{error:m}=await A(o,{access:s==="public"?"public":"private",config:g});m&&t(e,m),w==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,key:o,access:s,...c?{newKey:c}:{}})),k(e,{key:o,bucket:n})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as O,g as d}from"../../chunk-
|
|
1
|
+
import{e as O,g as d}from"../../chunk-A3YRE353.js";import{a as p,b as u}from"../../chunk-S6KFKBMY.js";import{b as i,d as m}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import{a as s}from"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{createOrganization as w}from"@tigrisdata/iam";var r=g("organizations","create");async function x(n){if(e(r),d("Organization creation")||s("Organization creation"))return;let t=p(n,["name","N"]);t||i(r,"Organization name is required");let z=await O(),l=u(n),{data:S,error:o}=await w(t,{config:z});o&&i(r,o);let a=S.id;l==="json"&&console.log(JSON.stringify({action:"created",name:t,id:a})),c(r,{name:t,id:a}),f(r,{name:t}),m(r,{name:t})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as q}from"../../chunk-AFM3TY2D.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{e as k,g as I}from"../../chunk-
|
|
1
|
+
import{f as q}from"../../chunk-AFM3TY2D.js";import{a as y}from"../../chunk-S77OAN6Y.js";import{e as k,g as I}from"../../chunk-A3YRE353.js";import{b as S}from"../../chunk-S6KFKBMY.js";import{b as h}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import{c as w}from"../../chunk-J3MAV7JB.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{e as S,g as $}from"../../chunk-
|
|
1
|
+
import{e as S,g as $}from"../../chunk-A3YRE353.js";import{a as z,b as O}from"../../chunk-S6KFKBMY.js";import{a as d,b as r,d as p}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.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-AFM3TY2D.js";import{e as v}from"../chunk-7ZCVOA6A.js";import{a as K,e as w}from"../chunk-
|
|
1
|
+
import{b as A}from"../chunk-AFM3TY2D.js";import{e as v}from"../chunk-7ZCVOA6A.js";import{a as K,e as w}from"../chunk-A3YRE353.js";import{a,b as k}from"../chunk-S6KFKBMY.js";import{a as n}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import{c as h}from"../chunk-J3MAV7JB.js";import{i as m,p}from"../chunk-F4AGJWCK.js";import{listAccessKeys as P}from"@tigrisdata/iam";import{getPresignedUrl as T}from"@tigrisdata/storage";import $ from"enquirer";var{prompt:b}=$;async function q(s){let r=a(s,["path"]);r||n("path argument is required");let{bucket:o,path:e}=v(r);o||n("Invalid path"),e||n("Object key is required");let t=a(s,["method","m"])??"get",i=parseInt(a(s,["expires-in","expiresIn","e"])??"3600",10),l=k(s,"url"),c=a(s,["access-key","accessKey"]),C=a(s,["select"]),f=a(s,["snapshot-version","snapshotVersion","snapshot"]);f&&t!=="get"&&n("Snapshot version is only supported for GET requests");let d=await w(),g;c?g=c:d.accessKeyId?g=d.accessKeyId:(p()!=="oauth"&&n("Presigning requires an access key. Pass --access-key or configure credentials."),C?g=await O(o,t):g=await E(o,t)),g||n("Presigning requires an access key. Pass --access-key or configure credentials.");let{data:u,error:y}=await T(e,{method:t,expiresIn:i,accessKeyId:g,...f?{snapshotVersion:f}:{},config:{...d,bucket:o}});y&&n(y),console.log(l==="json"?A({url:u.url,expiresIn:u.expiresIn,method:t,bucket:o,key:e}):u.url),process.exit(0)}async function I(){let r=await h().getAccessToken(),o=m(),e=K(),{data:t,error:i}=await P({config:{sessionToken:r,organizationId:o??void 0,iamEndpoint:e.iamEndpoint}});return i&&n(i),(!t.accessKeys||t.accessKeys.length===0)&&n('No access keys found. Create one with "tigris access-keys create <name>"'),t.accessKeys}function x(s,r,o){return s.roles?s.roles.some(e=>e.role==="NamespaceAdmin"?!0:e.bucket!==r&&e.bucket!=="*"?!1:o==="put"?e.role==="Editor":e.role==="Editor"||e.role==="ReadOnly"):!1}async function E(s,r){let e=(await I()).filter(i=>i.status==="active");e.length===0&&n('No active access keys found. Create one with "tigris access-keys create <name>"');let t=e.find(i=>x(i,s,r));return t||n(`No access key with ${r==="put"?"Editor":"Editor or ReadOnly"} access to bucket "${s}" found.
|
|
2
2
|
Create one: tigris access-keys create <name>
|
|
3
3
|
Then assign: tigris access-keys assign <id> --bucket ${s} --role Editor`),console.error(`Using access key: ${t.name} (${t.id})`),t.id}async function O(s,r){process.stdin.isTTY||n("Interactive selection requires a TTY. Omit --select to auto-resolve, or pass --access-key tid_...");let e=(await I()).filter(c=>c.status==="active");e.length===0&&n('No active access keys found. Create one with "tigris access-keys create <name>"');let t=e.filter(c=>x(c,s,r)),i;if(t.length>0?i=t:(console.error(`No access keys with explicit access to bucket "${s}" found. Showing all active keys.`),i=e),i.length===1)return console.error(`Using access key: ${i[0].name} (${i[0].id})`),i[0].id;let{selectedKey:l}=await b({type:"select",name:"selectedKey",message:"Select an access key for presigning:",choices:i.map(c=>({name:c.id,message:`${c.name} (${c.id})`}))});return l}export{q as default,x as keyMatchesOperation};
|
package/dist/lib/rm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as 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{e as W}from"../chunk-
|
|
1
|
+
import{a as v,b as h}from"../chunk-S77OAN6Y.js";import{a as j,b as I,d as N,f as O,g as E,i as J}from"../chunk-7ZCVOA6A.js";import{e as W}from"../chunk-A3YRE353.js";import{a as $,b as P}from"../chunk-S6KFKBMY.js";import{a as s}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import"../chunk-J3MAV7JB.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-AFM3TY2D.js";import{e as x}from"../../chunk-
|
|
1
|
+
import{g as S}from"../../chunk-AFM3TY2D.js";import{e as x}from"../../chunk-A3YRE353.js";import{a as k,b as y,c as T}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.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-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{listBucketSnapshots as P}from"@tigrisdata/storage";var t=l("snapshots","list");async function B(o){f(t);let r=k(o,["name"]),e=y(o),{limit:s,pageToken:m}=T(o);r||i(t,"Bucket name is required");let v=await x(),{data:n,error:c}=await P(r,{...s!==void 0?{limit:s}:{},...m?{paginationToken:m}:{},config:v});if(c&&i(t,c),!n.snapshots||n.snapshots.length===0){d(t);return}let p=n.snapshots.map(a=>({name:a.name||"",version:a.version||"",created:a.creationDate})),w=[{key:"name",header:"Name"},{key:"version",header:"Version"},{key:"created",header:"Created"}],g=n.paginationToken||void 0,O=S(p,e,"snapshots","snapshot",w,{paginationToken:g});console.log(O),e!=="json"&&e!=="xml"&&h(g),u(t,{count:p.length})}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as g}from"../../chunk-
|
|
1
|
+
import{e as g}from"../../chunk-A3YRE353.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as r}from"../../chunk-U3422EZ6.js";import"../../chunk-5JBNZ4C6.js";import"../../chunk-3ILNJZ6D.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,j as p}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-6ZZ54RU7.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createBucketSnapshot as k}from"@tigrisdata/storage";var o=p("snapshots","take");async function S(n){m(o);let h=f(n),t=a(n,["name"]),e=a(n,["snapshot-name","snapshotName"]);t||r(o,"Bucket name is required");let u=await g(),{data:s,error:i}=await k(t,{name:e,config:u});i&&r(o,i),h==="json"&&console.log(JSON.stringify({action:"taken",bucket:t,version:s?.snapshotVersion})),c(o,{name:t,snapshotName:e||s?.snapshotVersion,version:s?.snapshotVersion})}export{S as default};
|
package/dist/lib/stat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w}from"../chunk-JNSFDQGG.js";import{a as d,f as m}from"../chunk-AFM3TY2D.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as I}from"../chunk-7ZCVOA6A.js";import{e as j}from"../chunk-
|
|
1
|
+
import{c as w}from"../chunk-JNSFDQGG.js";import{a as d,f as m}from"../chunk-AFM3TY2D.js";import"../chunk-N3Y6RFSK.js";import"../chunk-S77OAN6Y.js";import{e as I}from"../chunk-7ZCVOA6A.js";import{e as j}from"../chunk-A3YRE353.js";import{a as u,b as O}from"../chunk-S6KFKBMY.js";import{b as i}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import{b as y,c,j as b}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{getBucketInfo as A,getStats as M,head as z}from"@tigrisdata/storage";var t=b("stat");async function C(s){y(t);let h=u(s,["path"]),f=O(s),v=u(s,["snapshot-version","snapshotVersion","snapshot"]),S=u(s,["version-id","versionId"]),l=await j();if(!h){let{data:o,error:a}=await M({config:l});a&&i(t,a);let p=[{metric:"Active Buckets",value:String(o.stats.activeBuckets)},{metric:"Total Objects",value:String(o.stats.totalObjects)},{metric:"Total Unique Objects",value:String(o.stats.totalUniqueObjects)},{metric:"Total Storage",value:d(o.stats.totalStorageBytes)}],g=m(p,f,"stats","stat",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(g),c(t),process.exit(0)}let{bucket:r,path:n}=I(h);if(r||i(t,"Invalid path"),!n||n==="/"){let{data:o,error:a}=await A(r,{config:l});a&&i(t,a);let p=w(o).map(({label:T,value:V})=>({metric:T,value:V})),g=m(p,f,"bucket-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(g),c(t,{bucket:r}),process.exit(0)}let{data:e,error:k}=await z(n,{...v?{snapshotVersion:v}:{},...S?{versionId:S}:{},config:{...l,bucket:r}});k&&i(t,k),e||i(t,"Object not found");let x=[{metric:"Path",value:e.path},{metric:"Size",value:d(e.size)},{metric:"Content-Type",value:e.contentType||"N/A"},{metric:"Content-Disposition",value:e.contentDisposition||"N/A"},{metric:"Modified",value:e.modified.toISOString()}],B=m(x,f,"object-info","info",[{key:"metric",header:"Metric"},{key:"value",header:"Value"}]);console.log(B),c(t,{bucket:r,path:n}),process.exit(0)}export{C as default};
|
package/dist/lib/touch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f}from"../chunk-7ZCVOA6A.js";import{e as s}from"../chunk-
|
|
1
|
+
import{e as f}from"../chunk-7ZCVOA6A.js";import{e as s}from"../chunk-A3YRE353.js";import{a,b as c}from"../chunk-S6KFKBMY.js";import{a as t}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";import{put as p}from"@tigrisdata/storage";async function u(e){let i=a(e,["path"]);i||t("path argument is required");let{bucket:o,path:r}=f(i);o||t("Invalid path"),r||t("Object key is required (use mk to create buckets)");let g=c(e),m=await s(),{error:n}=await p(r,"",{config:{...m,bucket:o}});n&&t(n),console.log(g==="json"?JSON.stringify({action:"created",bucket:o,path:r}):`Created '${o}/${r}'`),process.exit(0)}export{u as default};
|
package/dist/lib/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d}from"../chunk-S6KFKBMY.js";import{b as l,c as p,d as f}from"../chunk-
|
|
1
|
+
import{b as d}from"../chunk-S6KFKBMY.js";import{b as l,c as p,d as f}from"../chunk-ZNUPMP3O.js";import{b as m}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import{a as t}from"../chunk-3ILNJZ6D.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-6ZZ54RU7.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 $,d as b}from"../chunk-
|
|
1
|
+
import{a as $,d as b}from"../chunk-A3YRE353.js";import{b as w}from"../chunk-S6KFKBMY.js";import{b as A}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import{f as g,j as I}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.js";import{c as z}from"../chunk-J3MAV7JB.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
|
@@ -99,7 +99,7 @@ commands:
|
|
|
99
99
|
description: Connect Tigris to your AI coding agent — MCP server config and agent skills
|
|
100
100
|
examples:
|
|
101
101
|
- "tigris init"
|
|
102
|
-
- "npx
|
|
102
|
+
- "npx tigris init"
|
|
103
103
|
- "tigris init --agent"
|
|
104
104
|
messages:
|
|
105
105
|
onStart: ''
|
|
@@ -1075,6 +1075,7 @@ commands:
|
|
|
1075
1075
|
- "tigris buckets migrate my-bucket"
|
|
1076
1076
|
- "tigris buckets migrate my-bucket/images/"
|
|
1077
1077
|
- "tigris buckets migrate t3://my-bucket/prefix/"
|
|
1078
|
+
- "tigris buckets migrate my-bucket --max-in-flight-gb 100"
|
|
1078
1079
|
messages:
|
|
1079
1080
|
onStart: ''
|
|
1080
1081
|
onSuccess: ''
|
|
@@ -1088,6 +1089,9 @@ commands:
|
|
|
1088
1089
|
- my-bucket
|
|
1089
1090
|
- my-bucket/images/
|
|
1090
1091
|
- t3://my-bucket/prefix/
|
|
1092
|
+
- name: max-in-flight-gb
|
|
1093
|
+
description: Max total gigabytes of scheduled-but-unconfirmed migrations to keep in flight. Accepts 1-100
|
|
1094
|
+
default: '50'
|
|
1091
1095
|
# set-transition
|
|
1092
1096
|
- name: set-transition
|
|
1093
1097
|
removed: true
|
package/dist/utils/exit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-U3422EZ6.js";import"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-6ZZ54RU7.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,b,c,d,e,f,g}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../chunk-5JBNZ4C6.js";import"../chunk-3ILNJZ6D.js";import"../chunk-6ZZ54RU7.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-ZNUPMP3O.js";import"../chunk-3ILNJZ6D.js";import"../chunk-6ZZ54RU7.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
package/dist/chunk-FB54QSI7.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var t=`Help the user set up their project with Tigris:
|
|
2
|
-
|
|
3
|
-
1. If \`tigris\` isn't on $PATH (\`command -v tigris\`), ask permission, then \`npm install -g @tigrisdata/cli --ignore-scripts\`.
|
|
4
|
-
2. If \`tigris\` is on $PATH, ensure it's latest version using \`tigris update\`.
|
|
5
|
-
3. Check if the user is already authenticated using \`tigris whoami\`. If not, authenticate using \`tigris login oauth\`.
|
|
6
|
-
4. Run \`tigris orgs list --format json\`. If there's more than one org, ask which to use, then make it active with \`tigris orgs select <org>\` so the following commands target it.
|
|
7
|
-
5. Infer the project name from metadata (package.json, go.mod, pyproject.toml, ...). Check \`tigris buckets list --format json\` first; if the bucket is absent, \`tigris buckets create <name> --format json\`. Ask the user whenever anything is ambiguous.
|
|
8
|
-
6. Create the access key into a private temp file (overwrite, never append), then print only the ID:
|
|
9
|
-
\`umask 077; tmpfile=$(mktemp); tigris access-keys create <username>-<project>-devel --format json > "$tmpfile" && jq -r '.id' < "$tmpfile"\`
|
|
10
|
-
7. Grant bucket access: \`tigris access-keys assign <id> --bucket <bucket> --role Editor --format json\`.
|
|
11
|
-
8. Detect whether the code uses the Tigris SDK or the AWS SDK, then have a small script append the right vars to .env, reading \`.id\`/\`.secret\` from the temp file. Do NOT read the secret into your context \u2014 append it via script. Delete the temp file when done: \`rm -f "$tmpfile"\`.
|
|
12
|
-
|
|
13
|
-
Tigris SDK (@tigrisdata/storage, storage-go):
|
|
14
|
-
TIGRIS_STORAGE_ACCESS_KEY_ID = .id
|
|
15
|
-
TIGRIS_STORAGE_SECRET_ACCESS_KEY = .secret (secret)
|
|
16
|
-
TIGRIS_STORAGE_BUCKET = <bucket>
|
|
17
|
-
|
|
18
|
-
AWS SDK:
|
|
19
|
-
AWS_ACCESS_KEY_ID = .id
|
|
20
|
-
AWS_SECRET_ACCESS_KEY = .secret (secret)
|
|
21
|
-
AWS_ENDPOINT_URL_S3 = https://t3.storage.dev (required)
|
|
22
|
-
AWS_ENDPOINT_URL_IAM = https://iam.storageapi.dev (required)
|
|
23
|
-
AWS_REGION = auto (required)
|
|
24
|
-
|
|
25
|
-
9. Congratulate the user and point them to:
|
|
26
|
-
- JS: https://www.tigrisdata.com/docs/sdks/tigris/
|
|
27
|
-
- Go: https://pkg.go.dev/github.com/tigrisdata/storage-go
|
|
28
|
-
- Docs: https://www.tigrisdata.com/docs/
|
|
29
|
-
- Discord: https://community.tigrisdata.com/
|
|
30
|
-
- Skills: https://www.tigrisdata.com/docs/skills/
|
|
31
|
-
|
|
32
|
-
Suggest adding to their agent config:
|
|
33
|
-
> ## Tigris object storage
|
|
34
|
-
> This project uses Tigris. For any Tigris questions, consult https://www.tigrisdata.com/llms.txt before acting; look it up rather than relying on memory.
|
|
35
|
-
`;export{t as a};
|
package/dist/chunk-IHMIXWMY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="3.6.1";export{e as a};
|
package/dist/chunk-OWYZCGWM.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{homedir as S}from"os";import{join as e}from"path";import{applyEdits as v,modify as x,parse as O}from"jsonc-parser";var c=S(),f=process.env.XDG_CONFIG_HOME?.trim()||e(c,".config"),j=process.env.CODEX_HOME?.trim()||e(c,".codex");function y(o,r){return process.platform==="darwin"?e(o,"Library","Application Support","Code","User"):process.platform==="win32"?e(r.APPDATA?.trim()||e(o,"AppData","Roaming"),"Code","User"):e(r.XDG_CONFIG_HOME?.trim()||e(o,".config"),"Code","User")}var w=y(c,process.env),P="saoudrizwan.claude-dev";function _(o,r){return e(w,"globalStorage",o,"settings",r)}var T="tigris",d="https://mcp.storage.dev/mcp";function $(o,r,n,s){let t=o?.trim()?o:"{}",l=[],i=O(t,l,{allowTrailingComma:!0});if(l.length>0)throw new Error("config is not valid JSON/JSONC");if(!b(i))throw new Error("config root is not an object");let g=i[r];if(g!==void 0&&!b(g))throw new Error(`"${r}" is not an object`);let a=b(g)&&Object.hasOwn(g,n),u=x(t,[r,n],s,{formattingOptions:{insertSpaces:!0,tabSize:2}});return{content:m(v(t,u)),replaced:a}}function b(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function N(o,r,n,s){let l=[`[${r}.${n}]`,...Object.entries(s).map(([p,D])=>`${p} = ${JSON.stringify(D)}`)],i=o??"";if(A(i,r,n))throw new Error(`existing TOML defines ${r}.${n} inline`);let g=`${r}.${n}`,a=i.length?i.split(`
|
|
2
|
-
`):[],u=a.findIndex(p=>k(p)===g);if(u!==-1){let p=u+1;for(;p<a.length&&k(a[p])===null;)p++;return a.splice(u,p-u,...l),{content:m(a.join(`
|
|
3
|
-
`)),replaced:!0}}let h=i.length===0?"":m(i),E=h.length===0?"":`
|
|
4
|
-
`;return{content:m(h+E+l.join(`
|
|
5
|
-
`)),replaced:!1}}function m(o){return o.endsWith(`
|
|
6
|
-
`)?o:`${o}
|
|
7
|
-
`}function k(o){let r=o.trim().match(/^\[([^[\]]*)\]/);return r?r[1].split(".").map(n=>n.trim()).join("."):null}function A(o,r,n){let s="";for(let t of o.split(`
|
|
8
|
-
`)){let l=t.trim();if(l===""||l.startsWith("#"))continue;let i=k(l);if(i!==null){s=i;continue}let g=l.indexOf("=");if(g===-1)continue;let a=l.slice(0,g).trim().replace(/^['"]|['"]$/g,"");if(s===r&&(a===n||a.startsWith(`${n}.`))||s===""&&(a===`${r}.${n}`||a.startsWith(`${r}.${n}.`)))return!0}return!1}var C={source:"custom",command:"npx",args:["-y","mcp-remote",d]},z=[{id:"claude-code",label:"Claude Code",mcp:{format:"json",key:"mcpServers",entry:{type:"http",url:d},projectPath:".mcp.json",globalPath:e(c,".claude.json")},skillsAgent:"claude-code",skillsProjectDir:e(".claude","skills"),skillsGlobalDir:e(c,".claude","skills")},{id:"cursor",label:"Cursor",mcp:{format:"json",key:"mcpServers",entry:{url:d},projectPath:e(".cursor","mcp.json"),globalPath:e(c,".cursor","mcp.json")},skillsAgent:"cursor",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".cursor","skills")},{id:"vscode",label:"VS Code",mcp:{format:"json",key:"servers",entry:{type:"http",url:d},projectPath:e(".vscode","mcp.json")},skillsAgent:"github-copilot",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".copilot","skills")},{id:"windsurf",label:"Windsurf",mcp:{format:"json",key:"mcpServers",entry:{serverUrl:d},globalPath:e(c,".codeium","windsurf","mcp_config.json")},skillsAgent:"windsurf",skillsProjectDir:e(".windsurf","skills"),skillsGlobalDir:e(c,".codeium","windsurf","skills")},{id:"codex",label:"Codex",mcp:{format:"toml",key:"mcp_servers",entry:{url:d},projectPath:e(".codex","config.toml"),globalPath:e(j,"config.toml")},skillsAgent:"codex",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(j,"skills")},{id:"antigravity-cli",label:"Antigravity CLI",mcp:{format:"json",key:"mcpServers",entry:{serverUrl:d},globalPath:e(c,".gemini","config","mcp_config.json")},skillsAgent:"antigravity-cli",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".gemini","antigravity-cli","skills")},{id:"cline",label:"Cline",mcp:{format:"json",key:"mcpServers",entry:{type:"streamableHttp",url:d,disabled:!1,autoApprove:[]},globalPath:_(P,"cline_mcp_settings.json"),createDirs:!1},skillsAgent:"cline",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".agents","skills")},{id:"zed",label:"Zed",mcp:{format:"json",key:"context_servers",entry:C,projectPath:e(".zed","settings.json"),globalPath:e(f,"zed","settings.json")},skillsAgent:"zed",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".agents","skills")},{id:"roo",label:"Roo Code",mcp:{format:"json",key:"mcpServers",entry:{type:"streamable-http",url:d},projectPath:e(".roo","mcp.json")},skillsAgent:"roo",skillsProjectDir:e(".roo","skills"),skillsGlobalDir:e(c,".roo","skills")},{id:"opencode",label:"opencode",mcp:{format:"json",key:"mcp",entry:{type:"remote",url:d,enabled:!0},projectPath:"opencode.json",globalPath:e(f,"opencode","opencode.json")},skillsAgent:"opencode",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(f,"opencode","skills")}];function L(o,r,n){let s=o.map(t=>r==="global"?t.skillsGlobalDir:e(n,t.skillsProjectDir));return[...new Set(s)]}function H(o,r,n){let s=o.mcp;if(!s)return null;let t=s.globalPath!==void 0,l=s.projectPath!==void 0,i=r==="global"?t?"global":l?"project":null:l?"project":t?"global":null;return i==="global"?{path:s.globalPath,scope:i}:i==="project"?{path:e(n,s.projectPath),scope:i}:null}function U(o){let{env:r,cwd:n,home:s,fileExists:t}=o,l=r.XDG_CONFIG_HOME?.trim()||e(s,".config"),i=[];return(r.CLAUDECODE==="1"||t(e(n,".claude"))||t(e(s,".claude.json")))&&i.push("claude-code"),(r.TERM_PROGRAM==="cursor"||t(e(n,".cursor"))||t(e(s,".cursor")))&&i.push("cursor"),(r.TERM_PROGRAM==="vscode"||t(e(n,".vscode")))&&i.push("vscode"),t(e(s,".codeium","windsurf"))&&i.push("windsurf"),(r.CODEX_HOME?.trim()||t(e(s,".codex")))&&i.push("codex"),(t(e(s,".gemini","antigravity-cli"))||t(e(s,".gemini","antigravity"))||t(e(s,".gemini","config")))&&i.push("antigravity-cli"),(t(e(s,".cline"))||t(e(y(s,r),"globalStorage",P)))&&i.push("cline"),(t(e(l,"zed"))||t("/Applications/Zed.app"))&&i.push("zed"),t(e(n,".roo"))&&i.push("roo"),(t(e(l,"opencode"))||t(e(n,"opencode.json"))||t(e(n,"opencode.jsonc")))&&i.push("opencode"),i}var I="github.com/tigrisdata/skills",X=[{id:"tigris-agent-kit",label:"Agent kit",recommended:!0},{id:"tigris-object-operations",label:"Object operations",recommended:!0},{id:"tigris-bucket-management",label:"Bucket management",recommended:!0},{id:"tigris-sdk-guide",label:"SDK guide",recommended:!0},{id:"tigris-snapshots-forking",label:"Snapshots & forking",recommended:!1},{id:"tigris-snapshots-recovery",label:"Snapshots recovery",recommended:!1},{id:"tigris-lifecycle-management",label:"Lifecycle management",recommended:!1},{id:"tigris-security-access-control",label:"Security & access control",recommended:!1},{id:"tigris-s3-migration",label:"S3 migration",recommended:!1},{id:"tigris-static-assets",label:"Static assets",recommended:!1},{id:"tigris-image-optimization",label:"Image optimization",recommended:!1},{id:"tigris-egress-optimizer",label:"Egress optimizer",recommended:!1},{id:"tigris-backup-export",label:"Backup & export",recommended:!1},{id:"tigris-python-sdk",label:"Python SDK",recommended:!1}];function J(o,r,n){let s=["-y","skills","add",I];for(let t of o)s.push("--skill",t);n&&s.push("-g");for(let t of r)s.push("-a",t);return s.push("--yes"),s}export{T as a,d as b,$ as c,N as d,z as e,L as f,H as g,U as h,I as i,X as j,J as k};
|
package/dist/chunk-TOKNV45Q.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as w,c as T,d as S,e as y,f as $,g as L,h as j,j as f,k as R}from"./chunk-OWYZCGWM.js";import{b as C,d as P}from"./chunk-MW4NG7JY.js";import{spawnSync as V}from"child_process";import{existsSync as g,mkdirSync as F,readFileSync as W,writeFileSync as G}from"fs";import{homedir as O}from"os";import{dirname as x}from"path";import*as e from"@clack/prompts";async function Q(){process.stdin.isTTY||(console.error("Run `tigris init` in an interactive terminal."),process.exit(1));let t=process.cwd(),i=O();e.intro("Connect Tigris to your AI coding agent");let n=j({env:process.env,cwd:t,home:i,fileExists:g}),l=await e.multiselect({message:"Which editor(s) should use Tigris?",options:y.map(r=>({value:r.id,label:r.label})),initialValues:n,required:!0});if(e.isCancel(l))return d();let s=y.filter(r=>l.includes(r.id)),c=await e.select({message:"What would you like to install?",options:[{value:"defaults",label:"Defaults",hint:"CLI - Global, MCP - Global, Skills - Project"},{value:"custom",label:"Customize installation"}],initialValue:"defaults"});if(e.isCancel(c))return d();let o="global",a="project";c==="custom"&&(o=await A("MCP server:","global"),a=await A("Agent skills:","project"));let p=f.map(r=>r.id);if(c==="custom"&&a!=="skip"){let r=await e.multiselect({message:"Which skills should your agent get? (space to toggle)",options:f.map(u=>({value:u.id,label:u.label})),initialValues:f.filter(u=>u.recommended).map(u=>u.id),required:!1});if(e.isCancel(r))return d();p=r}let m=await U();if(o==="skip")e.log.info("MCP server: skipped");else for(let r of s)_(r,o,t,i);if(a==="skip"||p.length===0)e.log.info("Agent skills: skipped");else{let r=s.map(k=>k.skillsAgent),u=R(p,r,a==="global"),b=v("npx",u,`Installing ${p.length} Tigris skill(s) (${a})`);if(b.ok)for(let k of $(s,a,t))e.log.success(`Skills \u2192 ${h(k,i)}`);else b.output&&e.log.error(b.output.split(`
|
|
2
|
-
`).slice(-6).join(`
|
|
3
|
-
`))}e.note(m?"tigris init --agent":"npx @tigrisdata/cli init --agent","Paste this to your AI coding agent to finish setup"),e.outro("Your agent will authenticate with Tigris in-browser on first use.")}async function A(t,i){let n=await e.select({message:t,options:[{value:"global",label:"Global (available in all projects)"},{value:"project",label:"Project-level (this project only)"},{value:"skip",label:"Skip"}],initialValue:i});return e.isCancel(n)&&d(),n}function d(){e.cancel("Setup cancelled."),process.exit(1)}function h(t,i){return t.startsWith(i)?`~${t.slice(i.length)}`:t}function _(t,i,n,l){let s=t.mcp,c=L(t,i,n);if(!s||!c){e.log.warn(`${t.label}: no writable MCP config \u2014 skipped.`);return}let o=c.path;!g(o)&&o.endsWith(".json")&&g(`${o}c`)&&(o=`${o}c`);let a=x(o);if(s.createDirs===!1&&!g(x(a))){e.log.warn(`${t.label}: not installed \u2014 skipped.`);return}try{let p=g(o)?W(o,"utf8"):null,m=s.format==="toml"?S(p,s.key,w,N(s.entry)):T(p,s.key,w,s.entry);F(a,{recursive:!0}),G(o,m.content);let I=c.scope===i?"":` (${c.scope}-only)`;e.log.success(`${t.label}: MCP \u2192 ${h(o,l)}${I}`)}catch{e.log.error(`${t.label}: could not update ${h(o,l)} (incompatible or unwritable) \u2014 skipped.`)}}function N(t){let i={};for(let[n,l]of Object.entries(t))typeof l=="string"&&(i[n]=l);return i}function E(){let t=V("tigris",["--version"],D());if(t.error||t.status!==0||!t.stdout)return null;let i=t.stdout.trim().split(`
|
|
4
|
-
`)[0].trim();return/^\d+\.\d+\.\d+/.test(i)?i:null}async function U(){let t=E(),i=await Y(3e3);if(!t){let n=v("npm",["install","-g","@tigrisdata/cli","--ignore-scripts"],"Installing Tigris CLI (global)");return M(n)?E()===null?(e.log.warn("Tigris CLI installed but not on PATH \u2014 the agent handoff will use npx."),!1):!0:!1}return i&&C(t,i)?M(v("tigris",["update"],`Updating Tigris CLI ${t} \u2192 ${i}`)):!0}async function Y(t){let i;try{return await Promise.race([P({unref:!0}).catch(()=>null),new Promise(n=>{i=setTimeout(()=>n(null),t)})])}finally{i&&clearTimeout(i)}}function D(){return{encoding:"utf8",...process.platform==="win32"?{shell:!0}:{}}}function v(t,i,n){let l=e.spinner();l.start(n);let s=V(t,i,D());return s.status===0?(l.stop(`${n} \u2014 done`),{ok:!0}):(l.stop(`${n} \u2014 failed`),{ok:!1,output:(s.stderr||s.stdout||s.error?.message||"").trim()})}function M(t){return!t.ok&&t.output&&e.log.error(t.output.split(`
|
|
5
|
-
`).slice(-6).join(`
|
|
6
|
-
`)),t.ok}export{Q as a};
|
|
File without changes
|