@tigrisdata/cli 3.3.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/client.js +1 -1
- package/dist/auth/fly.js +1 -1
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/{chunk-YN2TKPPT.js → chunk-3QCSRNXC.js} +1 -1
- package/dist/{chunk-KQTMMFPE.js → chunk-76L56E5U.js} +1 -1
- package/dist/chunk-7ZCVOA6A.js +1 -0
- package/dist/chunk-AFM3TY2D.js +7 -0
- package/dist/chunk-BN6MNZDO.js +1 -0
- package/dist/{chunk-EFPPY2JQ.js → chunk-CL4GEWT2.js} +1 -1
- package/dist/{chunk-7ZUCJBD5.js → chunk-D7WXNA2O.js} +1 -1
- package/dist/{chunk-OHGCOC5Q.js → chunk-F4AGJWCK.js} +1 -1
- package/dist/{chunk-S7EO4QWK.js → chunk-JLNCN27M.js} +1 -1
- package/dist/{chunk-LAB2KJTN.js → chunk-JNSFDQGG.js} +1 -1
- package/dist/{chunk-2ITYREA5.js → chunk-KJA757WE.js} +1 -1
- package/dist/{chunk-GAWFFIPC.js → chunk-KJBSIIND.js} +1 -1
- package/dist/{chunk-PPNBQWSR.js → chunk-NI4EYBQH.js} +1 -1
- package/dist/chunk-Q6UVMHAZ.js +1 -0
- package/dist/{chunk-UBANDLB4.js → chunk-SE5TRZWU.js} +1 -1
- package/dist/{chunk-3EAZ2L6H.js → chunk-VNUR4TRP.js} +1 -1
- package/dist/{chunk-D3UQD6W2.js → chunk-W52B2I2N.js} +1 -1
- package/dist/chunk-X3H2PJ6S.js +8 -0
- package/dist/{chunk-G4DHMSCQ.js → chunk-Z2LVZ3ZF.js} +4 -4
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -1
- package/dist/lib/access-keys/attach-policy.js +1 -1
- package/dist/lib/access-keys/create.js +1 -1
- package/dist/lib/access-keys/delete.js +1 -1
- package/dist/lib/access-keys/detach-policy.js +1 -1
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list-policies.js +1 -1
- package/dist/lib/access-keys/list.js +1 -1
- package/dist/lib/access-keys/rotate.js +1 -1
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/disable-snapshots.js +1 -1
- package/dist/lib/buckets/enable-snapshots.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/lifecycle/create.js +1 -1
- package/dist/lib/buckets/lifecycle/edit.js +1 -1
- package/dist/lib/buckets/lifecycle/list.js +1 -1
- package/dist/lib/buckets/lifecycle/shared.js +1 -1
- package/dist/lib/buckets/list.js +1 -1
- package/dist/lib/buckets/merge.js +1 -0
- package/dist/lib/buckets/migrate.js +1 -1
- package/dist/lib/buckets/rebase.js +1 -0
- package/dist/lib/buckets/restore.js +1 -1
- package/dist/lib/buckets/set-cors.js +1 -1
- package/dist/lib/buckets/set-locations.js +1 -1
- package/dist/lib/buckets/set-migration.js +1 -1
- package/dist/lib/buckets/set-notifications.js +1 -1
- package/dist/lib/buckets/set.js +1 -1
- package/dist/lib/bundle.js +3 -3
- package/dist/lib/configure/index.js +1 -1
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -1
- package/dist/lib/iam/policies/delete.js +1 -1
- package/dist/lib/iam/policies/edit.js +1 -1
- package/dist/lib/iam/policies/get.js +1 -1
- package/dist/lib/iam/policies/link-key.js +1 -1
- package/dist/lib/iam/policies/list-keys.js +1 -1
- package/dist/lib/iam/policies/list.js +1 -1
- package/dist/lib/iam/policies/select-policy.js +1 -1
- package/dist/lib/iam/policies/unlink-key.js +1 -1
- package/dist/lib/iam/teams/create.js +1 -1
- package/dist/lib/iam/teams/edit.js +1 -1
- package/dist/lib/iam/teams/list.js +1 -1
- package/dist/lib/iam/teams/shared.js +1 -1
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +2 -2
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/oauth.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/logout.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list-versions.js +1 -1
- package/dist/lib/objects/list.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/restore-info.js +1 -1
- package/dist/lib/objects/restore.js +1 -1
- package/dist/lib/objects/set-access.js +1 -1
- package/dist/lib/objects/set.js +1 -1
- package/dist/lib/organizations/create.js +1 -1
- package/dist/lib/organizations/list.js +1 -1
- package/dist/lib/organizations/select.js +1 -1
- package/dist/lib/presign.js +1 -1
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/list.js +1 -1
- package/dist/lib/snapshots/take.js +1 -1
- package/dist/lib/stat.js +1 -1
- package/dist/lib/touch.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/whoami.js +1 -1
- package/dist/specs.yaml +52 -2
- package/dist/utils/bucket-info.js +1 -1
- package/dist/utils/exit.js +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/messages.js +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/specs.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +15 -58
- package/dist/chunk-BVSVEXGE.js +0 -8
- package/dist/chunk-IRDNZN7R.js +0 -7
- package/dist/chunk-JW6HI5E4.js +0 -1
- package/dist/chunk-RXNG56FL.js +0 -1
- package/dist/chunk-RZPBM4CD.js +0 -1
package/dist/auth/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-VNUR4TRP.js";import"../chunk-F4AGJWCK.js";export{b as TigrisAuthClient,a as getAuth0Config,c as getAuthClient};
|
package/dist/auth/fly.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-KJBSIIND.js";import"../chunk-F4AGJWCK.js";export{a as isFlyOrganization};
|
package/dist/auth/iam.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as c}from"../chunk-
|
|
1
|
+
import{a as b,b as c}from"../chunk-CL4GEWT2.js";import"../chunk-3QCSRNXC.js";import"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import"../chunk-VNUR4TRP.js";import{a}from"../chunk-KJBSIIND.js";import"../chunk-F4AGJWCK.js";export{c as getIAMConfig,b as getOAuthIAMConfig,a as isFlyOrganization};
|
package/dist/auth/provider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-3QCSRNXC.js";import"../chunk-ATBINUDP.js";import"../chunk-VNUR4TRP.js";import"../chunk-F4AGJWCK.js";export{b as getEnvCredentials,d as getStorageConfig,e as getStorageConfigWithOrg,a as getTigrisConfig,f as requireOAuthLogin,c as resolveAuthMethod};
|
package/dist/auth/storage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"../chunk-F4AGJWCK.js";export{a as CONFIG_DIR,b as CONFIG_FILE,t as clearAllData,s as clearOAuthData,r as clearTemporaryCredentials,e as clearTokens,k as getAwsProfileConfig,p as getLoginMethod,g as getOrganizations,i as getSelectedOrganization,l as getStoredCredentials,d as getTokens,j as hasAwsProfile,q as storeCredentialOrganization,m as storeCredentials,o as storeLoginMethod,f as storeOrganizations,h as storeSelectedOrganization,n as storeTemporaryCredentials,c as storeTokens};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as i,b as a,c as g}from"./chunk-ATBINUDP.js";import{a as A,c as I}from"./chunk-
|
|
1
|
+
import{a as i,b as a,c as g}from"./chunk-ATBINUDP.js";import{a as A,c as I}from"./chunk-VNUR4TRP.js";import{i as c,j as y,k as l,l as o,p as d}from"./chunk-F4AGJWCK.js";import{fromIni as _}from"@aws-sdk/credential-providers";function K(){return process.env.AWS_ENDPOINT_URL_S3||process.env.AWS_ENDPOINT_URL_IAM?{endpoint:process.env.AWS_ENDPOINT_URL_S3||i,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||a,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||g}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||i,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||a,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||g}}var r=K(),S=A();function p(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY){let e=process.env.AWS_ENDPOINT_URL_S3||i;return{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,endpoint:e,source:"aws"}}if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID&&process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let e=process.env.TIGRIS_STORAGE_ENDPOINT||i;return{accessKeyId:process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,secretAccessKey:process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY,endpoint:e,source:"tigris"}}return null}var E=!1;async function T(){if(E||!process.stdin.isTTY)return!1;E=!0,console.log(`Not authenticated. Starting login...
|
|
2
2
|
`);let{default:e}=await import("./lib/login/select.js");return await e({}),console.log(),!0}async function C(){if(y()){let n=process.env.AWS_PROFILE||"default",u=await _({profile:n})();return{type:"aws-profile",profile:n,accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey}}let e=p();if(e)return{type:"environment",accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,source:e.source};let s=d();if(s==="oauth")return{type:"oauth"};if(s==="credentials"){let n=o();if(n)return{type:"credentials",accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey}}let t=o();return t?{type:"configured",accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey}:{type:"none"}}async function f(e){let s=await C();switch(s.type){case"aws-profile":{let t=await l(s.profile);return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:t.endpoint||r.endpoint||i,iamEndpoint:t.iamEndpoint||r.iamEndpoint}}case"oauth":{let t=I(),n=c();if(!n)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await t.getAccessToken(),accessKeyId:"",secretAccessKey:"",...e?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await t.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:r.endpoint,organizationId:n,iamEndpoint:r.iamEndpoint,authDomain:S.domain}}case"credentials":{let t=c();return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:o()?.endpoint||i,organizationId:t??void 0,iamEndpoint:r.iamEndpoint}}case"environment":return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:p()?.endpoint||i};case"configured":{let t=c();return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:o()?.endpoint||i,organizationId:t??void 0,iamEndpoint:r.iamEndpoint}}case"none":{if(await T())return f(e);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}}}async function N(){let e=await f(),s=c();return{...e,...s&&!e.organizationId?{organizationId:s}:{}}}function O(e){return d()==="oauth"?!1:(p()||o()?console.log(`You are using access key credentials, which belong to a single organization.
|
|
3
3
|
${e} is only available with OAuth login.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as d}from"./chunk-S6KFKBMY.js";import{a as f,d as e}from"./chunk-
|
|
1
|
+
import{b as d}from"./chunk-S6KFKBMY.js";import{a as f,d as e}from"./chunk-SE5TRZWU.js";import{b as s,c as r,d as g,g as c,j as l}from"./chunk-D7WXNA2O.js";import{c as u}from"./chunk-VNUR4TRP.js";import{h as m,r as p}from"./chunk-F4AGJWCK.js";var o=l("login","oauth");async function x(h={}){s(o);let a=d(h);try{let t=u();await t.login({onDeviceCode:(i,w)=>{console.log(`
|
|
2
2
|
Your confirmation code: ${i}
|
|
3
3
|
`),console.log(`If browser doesn't open, visit: ${w}`)},onWaiting:()=>console.log(`
|
|
4
4
|
Waiting for authentication...`)}),await p();let n=await t.getOrganizations();if(n.length>0){let i=n[0];await m(i.id),a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:i.name}),e(o),n.length>1&&c(o,{count:n.length})}else a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:"none"}),e(o)}catch(t){g(o),f(t,o)}}var N=x;export{x as a,N as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{list as a}from"@tigrisdata/storage";var g=["t3://","tigris://"];function p(t){return g.some(e=>t.startsWith(e))}function u(t){let e=g.find(r=>t.startsWith(r));return c(t.slice(e.length))}function c(t){let e=t.split("/");return{bucket:e[0],path:e.slice(1).join("/")}}async function l(t,e,r){let{data:i}=await a({prefix:`${e}/`,limit:1,config:{...r,bucket:t}});return!!(i?.items&&i.items.length>0)}function f(t){return p(t)?u(t):c(t)}function d(t){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*");return new RegExp(`^${e}$`)}function x(t){let e=t.indexOf("*"),r=t.lastIndexOf("/",e);return r>=0?t.slice(0,r+1):""}function h(t,e){let r=f(t);return e?{bucket:r.bucket,key:e}:{bucket:r.bucket,key:r.path}}async function P(t,e,r){let i=[],s;do{let{data:n,error:o}=await a({prefix:e,paginationToken:s,config:{...r,bucket:t}});if(o)return{items:i,error:o};n?.items&&i.push(...n.items),s=n?.hasMore?n.paginationToken:void 0}while(s);return{items:i}}export{p as a,u as b,c,l as d,f as e,d as f,x as g,h,P as i};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function B(n){if(n===0)return"0 B";let t=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(n)/Math.log(1024));return`${(n/1024**r).toFixed(r>0?1:0)} ${t[r]}`}function l(n){return JSON.stringify(n,null,2)}function m(n){return String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function T(n,t=" "){return Object.entries(n).map(([r,e])=>`${t}<${r}>${m(e)}</${r}>`).join(`
|
|
2
|
+
`)}function W(n,t,r){let e=[`<${t}>`];return n.forEach(o=>{e.push(` <${r}>`),e.push(T(o," ")),e.push(` </${r}>`)}),e.push(`</${t}>`),e.join(`
|
|
3
|
+
`)}function p(n,t){return n.length<=t?n:`${n.slice(0,t-1)}\u2026`}function x(n){if(n==null)return"";if(n instanceof Date)return f(n);if(typeof n=="string"){let t=new Date(n);if(!Number.isNaN(t.getTime())&&n.includes("T"))return f(t)}return String(n)}function f(n){return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function j(n,t){let r=process.stdout.columns||120,e=t.length*3+1,o=r-e,s=t.map(i=>{if(i.width)return i.width;let g=i.header.length,a=n.reduce((k,$)=>{let b=x($[i.key]);return Math.max(k,b.length)},0),h=Math.max(g,a);return i.maxWidth&&h>i.maxWidth&&(h=i.maxWidth),h}),d=s.reduce((i,g)=>i+g,0);if(d<=o)return s;let c=[...s],u=t.map(i=>Math.max(i.header.length,8));for(;d>o;){let i=-1,g=0;for(let a=0;a<c.length;a++)c[a]>u[a]&&c[a]>g&&(g=c[a],i=a);if(i===-1)break;c[i]--,d--}return c}function w(n,t){let r=[],e=j(n,t),o=`\u250C${e.map(u=>"\u2500".repeat(u+2)).join("\u252C")}\u2510`,s=`\u251C${e.map(u=>"\u2500".repeat(u+2)).join("\u253C")}\u2524`,d=`\u2514${e.map(u=>"\u2500".repeat(u+2)).join("\u2534")}\u2518`;r.push(`
|
|
4
|
+
${o}`);let c="\u2502 "+t.map((u,i)=>p(u.header,e[i]).padEnd(e[i])).join(" \u2502 ")+" \u2502";return r.push(c),r.push(s),n.forEach(u=>{let i=t.map((g,a)=>{let h=p(x(u[g.key]),e[a]);return g.align==="right"?h.padStart(e[a]):h.padEnd(e[a])});r.push(`\u2502 ${i.join(" \u2502 ")} \u2502`)}),r.push(`${d}
|
|
5
|
+
`),r.join(`
|
|
6
|
+
`)}function R(n,t,r,e,o){switch(t){case"json":return l(n);case"xml":return W(n,r,e);default:return w(n,o)}}function C(n,t,r,e,o,s){switch(t){case"json":{let d={items:n};return s.paginationToken&&(d.paginationToken=s.paginationToken),l(d)}case"xml":return M(n,r,e,s);default:return w(n,o)}}function M(n,t,r,e){let o=[`<${t}>`];return n.forEach(s=>{o.push(` <${r}>`),o.push(T(s," ")),o.push(` </${r}>`)}),e.paginationToken&&o.push(` <paginationToken>${m(e.paginationToken)}</paginationToken>`),o.push(`</${t}>`),o.join(`
|
|
7
|
+
`)}export{B as a,l as b,T as c,W as d,w as e,R as f,C as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,f as l}from"./chunk-X3H2PJ6S.js";import{a as i,k as m}from"./chunk-Z2LVZ3ZF.js";import{b as t}from"./chunk-NI4EYBQH.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=`${a(d,"lib",...o)}.js`;if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,c as a}from"./chunk-
|
|
1
|
+
import{a as o,c as a}from"./chunk-3QCSRNXC.js";import{b as i}from"./chunk-SE5TRZWU.js";import{c as r}from"./chunk-VNUR4TRP.js";import{i as n,p as s}from"./chunk-F4AGJWCK.js";async function d(e){s()!=="oauth"&&i(e,`This operation requires OAuth login.
|
|
2
2
|
Run "tigris login oauth" first.`);let t=r();await t.isAuthenticated()||i(e,'Not authenticated. Run "tigris login oauth" first.');let c=n(),{iamEndpoint:g,mgmtEndpoint:u}=o();return{sessionToken:await t.getAccessToken(),organizationId:c??void 0,iamEndpoint:g,mgmtEndpoint:u}}async function A(e){let t=await a();switch(t.type){case"oauth":return d(e);case"aws-profile":case"credentials":case"environment":case"configured":return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,organizationId:n()??void 0,iamEndpoint:o().iamEndpoint};case"none":i(e,'Not authenticated. Run "tigris login" or "tigris configure" first.')}}export{d as a,A as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as l}from"./chunk-
|
|
1
|
+
import{c as l}from"./chunk-NI4EYBQH.js";var c={success:"\u2714",failure:"\u2716",hint:"\u2192"};function t(){return process.stdout.isTTY===!0}function i(){return globalThis.__TIGRIS_JSON_MODE===!0}function o(e){let s=l(e.command,e.operation);if(s)return s.messages}function r(e,s){let n=e;return n=n.replace(/\\n/g,`
|
|
2
2
|
`),s&&(n=n.replace(/\{\{(\w+)\}\}/g,(a,g)=>{let u=s[g];return u!==void 0?String(u):`{{${g}}}`})),n}function f(e,s){if(!t()||i())return;let n=o(e);n?.onStart&&console.log(r(n.onStart,s))}function d(e,s){if(!t()||i())return;let n=o(e);n?.onSuccess&&console.log(`${c.success} ${r(n.onSuccess,s)}`)}function m(e,s,n){if(globalThis.__TIGRIS_JSON_MODE===!0)return;let a=o(e);a?.onFailure&&console.error(`${c.failure} ${r(a.onFailure,n)}`),s&&console.error(` ${s}`)}function M(e,s){if(!t()||i())return;let n=o(e);n?.onEmpty&&console.log(r(n.onEmpty,s))}function x(e,s){if(!t()||i())return;let n=o(e);n?.onAlreadyDone&&console.log(r(n.onAlreadyDone,s))}function S(e,s){if(!t()||i())return;let n=o(e);n?.hint&&console.log(`${c.hint} ${r(n.hint,s)}`)}function b(e){t()&&console.warn(`\u26A0 Deprecated: ${e}`)}function C(e){e&&console.error(`
|
|
3
3
|
Next page: --page-token "${e}"`)}function $(e,s){return{command:e,operation:s}}export{r as a,f as b,d as c,m as d,M as e,x as f,S as g,b as h,C as i,$ as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{execFileSync as y}from"child_process";import{chmodSync as m,existsSync as c,mkdirSync as v,readFileSync as C,writeFileSync as h}from"fs";import{homedir as g,platform as w}from"os";import{join as r}from"path";import{loadSharedConfigFiles as x}from"@smithy/shared-ini-file-loader";var s=r(g(),".tigris"),a=r(s,"config.json");function l(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function u(e,n){if(w()==="win32")try{let i=process.env.USERNAME;i&&y("icacls",[e,"/inheritance:r","/grant:r",`${i}:F`],{stdio:"ignore"})}catch{console.warn(`Warning: Could not set restrictive permissions on ${e}. It may be accessible to other users.`)}else try{m(e,n)}catch{console.warn(`Warning: Could not set restrictive permissions on ${e}. It may be accessible to other users.`)}}function S(){c(s)||(v(s,{recursive:!0,mode:448}),u(s,448))}function A(e){let n={version:2},i=e.credentials;return l(i)&&typeof i.accessKeyId=="string"&&typeof i.secretAccessKey=="string"&&typeof i.endpoint=="string"&&(n.credentials={saved:{accessKeyId:i.accessKeyId,secretAccessKey:i.secretAccessKey,endpoint:i.endpoint}}),n}function t(){if(!c(a))return{version:2};try{let e=C(a,"utf8"),n=JSON.parse(e);if(!l(n))return{version:2};if(n.version===2)return n;let i=A(n);return p(i),i}catch{return{version:2}}}function p(e){S(),h(a,JSON.stringify(e,null,2),{mode:384}),u(a,384)}async function o(e){p(e)}async function O(e){let n=t();n.oauth?n.oauth.tokens=e:n.oauth={tokens:e,organizations:[]},await o(n)}async function P(){return t().oauth?.tokens??null}async function F(){let e=t();e.oauth&&delete e.oauth.tokens,await o(e)}async function M(e){let n=t();n.oauth?n.oauth.organizations=e:n.oauth={organizations:e},await o(n)}function b(){return t().oauth?.organizations??[]}async function V(e){let n=t();if(n.activeMethod==="credentials"){let i=n.credentials?.temporary??n.credentials?.saved;i&&(i.organizationId=e)}else n.oauth||(n.oauth={organizations:[]}),n.oauth.selectedOrganization=e;await o(n)}function _(){let e=t();return e.activeMethod==="credentials"?(e.credentials?.temporary??e.credentials?.saved)?.organizationId??null:e.oauth?.selectedOrganization??null}function E(){if(!process.env.AWS_PROFILE)return!1;let e=r(g(),".aws");return c(r(e,"credentials"))||c(r(e,"config"))}async function R(e){try{let{configFile:n}=await x(),i=n[e];return i?{endpoint:i.endpoint_url_s3||i.endpoint_url,iamEndpoint:i.endpoint_url_iam,region:i.region}:{}}catch{return{}}}function D(){let e=t();return f(e.credentials?.temporary)||f(e.credentials?.saved)||null}async function N(e){let n=t();n.credentials||(n.credentials={}),n.credentials.saved={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint},await o(n)}async function L(e){let n=t();n.credentials||(n.credentials={}),n.credentials.temporary={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint},await o(n)}async function j(e){let n=t();n.activeMethod=e,await o(n)}function W(){return t().activeMethod??null}async function $(e,n){let i=t(),d=i.credentials?.[n];d&&(d.organizationId=e,await o(i))}async function G(){let e=t();e.credentials&&delete e.credentials.temporary,await o(e)}async function J(){let e=t();delete e.oauth,e.activeMethod==="oauth"&&delete e.activeMethod,await o(e)}async function U(){let n=t().credentials?.saved;await o({version:2,credentials:n?{saved:n}:void 0})}function f(e){return e?{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint}:null}export{s as a,a as b,O as c,P as d,F as e,M as f,b as g,V as h,_ as i,E as j,R as k,D as l,N as m,L as n,j as o,W as p,$ as q,G as r,J as s,U as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-S77OAN6Y.js";import{b as s}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-S77OAN6Y.js";import{b as s}from"./chunk-SE5TRZWU.js";import{e as o}from"./chunk-D7WXNA2O.js";import m from"enquirer";import{listPolicies as f}from"@tigrisdata/iam";var{prompt:p}=m;async function h(a,t,c="Select a policy:"){let{data:e,error:r}=await f({config:a});if(r&&s(t,r),!e.policies||e.policies.length===0){o(t);return}n("Provide the policy ARN as a positional argument");let{selected:l}=await p({type:"select",name:"selected",message:c,choices:e.policies.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});return l}export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-SE5TRZWU.js";function o(s,e){if(e===void 0)return;let t=(Array.isArray(e)?e:[e]).map(r=>typeof r=="string"?r.trim():"").filter(r=>r.length>0);return t.length===0&&n(s,"--members requires at least one email address"),t}export{o as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as o}from"./chunk-
|
|
1
|
+
import{i as o}from"./chunk-F4AGJWCK.js";function i(t){return o()?.startsWith("flyio_")?(console.log(`${t} is not available for Fly.io organizations.
|
|
2
2
|
Your resources are managed through Fly.io.
|
|
3
3
|
|
|
4
4
|
Visit https://fly.io to manage your organization.`),!0):!1}export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as p}from"fs";import{dirname as l,join as u}from"path";import{fileURLToPath as f}from"url";import*as i from"yaml";var d=f(import.meta.url),S=l(d),s=null,g=u(S,"specs.yaml");function x(n){s=n}function A(){if(!s){let n=p(g,"utf8");s=i.parse(n,{schema:"core"})}return s}function y(n,e){let o=A(),t=n.split(" ").filter(Boolean),r,c=o.commands;for(let m of t){if(r=c.find(a=>a.name===m),!r)return null;c=r.commands||[]}return r?e&&r.commands?r.commands.find(m=>m.name===e)||null:r:null}function P(n,e,o){let t=y(n,o);return
|
|
1
|
+
import{readFileSync as p}from"fs";import{dirname as l,join as u}from"path";import{fileURLToPath as f}from"url";import*as i from"yaml";var d=f(import.meta.url),S=l(d),s=null,g=u(S,"specs.yaml");function x(n){s=n}function A(){if(!s){let n=p(g,"utf8");s=i.parse(n,{schema:"core"})}return s}function y(n,e){let o=A(),t=n.split(" ").filter(Boolean),r,c=o.commands;for(let m of t){if(r=c.find(a=>a.name===m),!r)return null;c=r.commands||[]}return r?e&&r.commands?r.commands.find(m=>m.name===e)||null:r:null}function P(n,e,o){let t=y(n,o);return t?.arguments&&t.arguments.find(r=>r.name===e)||null}function _(n){return n.options?Array.isArray(n.options)&&typeof n.options[0]=="string"?n.options.map(e=>({name:e,message:e.charAt(0).toUpperCase()+e.slice(1),value:e})):Array.isArray(n.options)&&typeof n.options[0]=="object"?n.options.map(e=>({name:e.value,message:e.description?`${e.name} - ${e.description}`:e.name,value:e.value})):null:null}export{x as a,A as b,y as c,P as d,_ as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,b as o}from"./chunk-JNSFDQGG.js";import{a}from"./chunk-S6KFKBMY.js";import{b as i}from"./chunk-SE5TRZWU.js";import{getBucketInfo as l,setBucketLifecycle as g}from"@tigrisdata/storage";var f=["STANDARD_IA","GLACIER","GLACIER_IR"];function c(e){return f.includes(e)}function u(e){return/^\d{4}-\d{2}-\d{2}/.test(e)&&!Number.isNaN(new Date(e).getTime())}function C(e){return{prefix:a(e,["prefix"]),storageClass:a(e,["storage-class","storageClass"]),days:a(e,["days"]),date:a(e,["date"]),expireDays:a(e,["expire-days","expireDays"]),expireDate:a(e,["expire-date","expireDate"]),enable:a(e,["enable"]),disable:a(e,["disable"])}}function p(e,{requireStorageClassForTiming:r=!0}={}){if(e.enable&&e.disable)return"Cannot use both --enable and --disable";if(r&&(e.days!==void 0||e.date!==void 0)&&!e.storageClass)return"--storage-class is required when setting --days or --date";if(e.storageClass&&!c(e.storageClass))return`--storage-class must be one of: ${f.join(", ")} (STANDARD is not a valid transition target)`;if(e.days!==void 0&&e.date!==void 0)return"Cannot specify both --days and --date";if(e.days!==void 0&&(Number.isNaN(Number(e.days))||Number(e.days)<=0))return"--days must be a positive number";if(e.date!==void 0&&!u(e.date))return"--date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.expireDays!==void 0&&e.expireDate!==void 0)return"Cannot specify both --expire-days and --expire-date";if(e.expireDays!==void 0&&(Number.isNaN(Number(e.expireDays))||Number(e.expireDays)<=0))return"--expire-days must be a positive number";if(e.expireDate!==void 0&&!u(e.expireDate))return"--expire-date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.prefix!==void 0&&e.prefix==="")return"--prefix cannot be empty"}function D(e){let r={};return e.storageClass&&(r.storageClass=e.storageClass),e.days!==void 0?(r.days=Number(e.days),r.date=void 0):e.date!==void 0&&(r.date=e.date,r.days=void 0),r}function R(e){if(e.expireDays!==void 0)return{days:Number(e.expireDays),date:void 0};if(e.expireDate!==void 0)return{date:e.expireDate,days:void 0}}function I(e){if(e.enable)return!0;if(e.disable)return!1}async function N(e,r,n){let{data:t,error:s}=await l(r,{config:n});return s&&i(e,s),t?.settings.lifecycleRules??[]}async function T(e,r,n,t){let{error:s}=await g(r,{lifecycleRules:n,config:t});s&&i(e,s)}function S(e){return d(e)??"-"}function A(e){return o(e)??"-"}export{C as a,p as b,D as c,R as d,I as e,N as f,T as g,S as h,A as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as r}from"./chunk-DV3LCXRH.js";import{a as s,d as c}from"./chunk-
|
|
1
|
+
import{b as r}from"./chunk-DV3LCXRH.js";import{a as s,d as c}from"./chunk-D7WXNA2O.js";import{c as i}from"./chunk-NI4EYBQH.js";function a(){return globalThis.__TIGRIS_JSON_MODE===!0}function m(){return process.stderr.isTTY===!0}function g(){return process.stdout.isTTY===!0}function p(n,o){let e=r(n);if(a()){let t={error:{message:e.message,code:e.exitCode,category:e.category}};e.nextActions.length>0&&(t.nextActions=e.nextActions),console.error(JSON.stringify(t))}else if(o||console.error(`
|
|
2
2
|
Error: ${e.message}`),m()&&e.nextActions.length>0){console.error(`
|
|
3
3
|
Next steps:`);for(let t of e.nextActions)console.error(` \u2192 ${t.command} ${t.description}`)}process.exit(e.exitCode)}function d(n,o){let e=o instanceof Error?o.message:String(o);c(n,e),p(o,n)}function f(n,o){let e=i(n.command,n.operation);return e?.messages?.nextActions?e.messages.nextActions.map(t=>({command:s(t.command,o),description:s(t.description,o)})):[]}function A(n,o){if(!g()||a())return;let e=f(n,o);if(e.length!==0){console.log(`
|
|
4
4
|
Next steps:`);for(let t of e)console.log(` \u2192 ${t.command} ${t.description}`)}}export{p as a,d as b,f as c,A as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,d as s,e as g,f,g as p,o as k}from"./chunk-
|
|
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.AUTH0_DOMAIN??"auth-storage.tigris.dev":process.env.AUTH0_DOMAIN??"auth.storage.tigrisdata.io",t=a?process.env.AUTH0_CLIENT_ID??"JdJVYIyw0O1uHi5L5OJH903qaWBgd3gF":process.env.AUTH0_CLIENT_ID??"DMejqeM3CQ4IqTjEcd3oA9eEiT40hn8D",n=a?process.env.AUTH0_AUDIENCE??"https://tigris-api-dev":process.env.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 C(){return h||(h=new u),h}export{y as a,u as b,C as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-S77OAN6Y.js";import{a as w}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-S77OAN6Y.js";import{a as w}from"./chunk-3QCSRNXC.js";import{b as S}from"./chunk-S6KFKBMY.js";import{b as d,d as m}from"./chunk-SE5TRZWU.js";import{b as i,c as n,j as o}from"./chunk-D7WXNA2O.js";import{a as g}from"./chunk-ATBINUDP.js";import{l as f,n as y,o as p,q as u,s as l}from"./chunk-F4AGJWCK.js";import C from"enquirer";import{whoami as k}from"@tigrisdata/iam";var{prompt:I}=C,a=o("login","credentials");async function q(e){i(a);let A=S(e),s=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,r=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(!s||!r){let t=[];s||t.push({type:"input",name:"accessKey",message:"Access Key ID:",required:!0}),r||t.push({type:"password",name:"accessSecret",message:"Secret Access Key:",required:!0}),K("Provide --access-key and --access-secret");let c=await I(t);s=s||c.accessKey,r=r||c.accessSecret}(!s||!r)&&d(a,"Access key and secret are required");let h=f()?.endpoint||g;await y({accessKeyId:s,secretAccessKey:r,endpoint:h}),await p("credentials"),await l();try{let t=w(),{data:c}=await k({config:{accessKeyId:s,secretAccessKey:r,iamEndpoint:t.iamEndpoint}});c?.organizationId&&await u(c.organizationId,"temporary")}catch{}A==="json"&&console.log(JSON.stringify({action:"logged_in"})),n(a),m(a)}export{q as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as C,readFileSync as _,realpathSync as E,writeFileSync as I}from"fs";import k from"https";import{homedir as g}from"os";import{join as h}from"path";var p="3.4.1";var b=h(g(),".tigris","update-check.json");function y(){try{let e=_(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function v(e){try{C(h(g(),".tigris"),{recursive:!0}),I(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let o=i=>{let s=i.startsWith("v")?i.slice(1):i,c=null,a=s.indexOf("-");a!==-1&&(c=s.slice(a+1),s=s.slice(0,a));let l=s.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}},r=o(e),t=o(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function T(){if(process.platform==="win32")return!1;try{let e=E(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function L(){return globalThis.__TIGRIS_BINARY===!0?T()?"brew upgrade tigris":process.platform==="win32"?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function x(e={}){return new Promise((n,o)=>{let r=k.get(d,{timeout:1e4},t=>{let i="";t.on("data",s=>{i+=s}),t.on("end",()=>{try{let s=JSON.parse(i);typeof s.version=="string"?(v({...y(),latestVersion:s.version,lastChecked:Date.now()}),n(s.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});r.on("error",t=>{o(t)}),r.on("timeout",()=>{r.destroy(),o(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function j(){x({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(p,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${p} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',i=Math.max(r.length,t.length)+4,s=`\u250C${"\u2500".repeat(i-2)}\u2510`,c=`\u2514${"\u2500".repeat(i-2)}\u2518`,a=l=>`\u2502 ${l.padEnd(i-4)} \u2502`;console.log(`
|
|
2
|
+
${s}
|
|
3
|
+
${a("")}
|
|
4
|
+
${a(r)}
|
|
5
|
+
${a(t)}
|
|
6
|
+
${a("")}
|
|
7
|
+
${c}
|
|
8
|
+
`),v({...e,lastNotified:Date.now()})}let o=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!e||Date.now()-e.lastChecked>o)&&j()}export{p as a,y as b,N as c,L as d,x as e,M as f};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as y}from"./chunk-SE5TRZWU.js";import{h as C}from"./chunk-D7WXNA2O.js";import{Command as q,Option as L}from"commander";function w(n,t,e,a,o){let r=n[n.length-1],s=typeof r=="object"&&r!==null&&"args"in r?r.args:n.filter(m=>typeof m=="string");if(s.length===0)return s;let l=s[0],d=(t.commands??[]).filter(m=>g(m,[...e,m.name],o));if(!new Set(d.flatMap(m=>[m.name,...Array.isArray(m.alias)?m.alias:m.alias?[m.alias]:[]])).has(l)){let m=d.map(u=>u.name),p=e.length>0?`'${l}' for '${e.join(" ")}'`:`'${l}'`;console.error(`Unknown command ${p}.`),m.length>0&&console.error(`Available commands: ${m.join(", ")}`);let f=e.length>0?`${a.name} ${e.join(" ")} help`:`${a.name} help`;console.error(`
|
|
2
2
|
Run "${f}" for usage.`),process.exit(1)}return s}function G(){process.on("unhandledRejection",n=>{(n===""||n===void 0)&&(console.error(`
|
|
3
|
-
Operation cancelled`),process.exit(1)),
|
|
3
|
+
Operation cancelled`),process.exit(1)),y(n)}),process.on("uncaughtException",n=>{y(n)})}function U(n){return/^[a-zA-Z0-9_-]+$/.test(n)}function D(n){let t;n.type==="positional"?t=` ${n.name}`:(t=` --${n.name}`,n.alias&&typeof n.alias=="string"&&(t+=n.alias.length===1?`, -${n.alias}`:`, --${n.alias}`));let e=26,a=t.length>=e?`${t} `:t.padEnd(e),o=n.description;return n.options&&(Array.isArray(n.options)&&typeof n.options[0]=="string"?o+=` (options: ${n.options.join(", ")})`:o+=` (options: ${n.options.map(r=>r.value).join(", ")})`),n.default&&(o+=` [default: ${n.default}]`),n.required&&(o+=" [required]"),n.deprecated&&(o+=n.replaced_by?` [deprecated: use ${n.replaced_by}]`:" [deprecated]"),n["required-when"]&&(o+=` [required when: ${n["required-when"]}]`),n.multiple&&(o+=" [multiple values: comma-separated]"),n.type==="positional"&&(o+=" [positional argument]"),n.examples&&n.examples.length>0&&(o+=` (examples: ${n.examples.join(", ")})`),`${a}${o}`}function g(n,t,e){return n.removed||e(t)?!0:n.commands?n.commands.some(a=>g(a,[...t,a.name],e)):!1}function R(n,t){let e=t?` Use ${t} instead.`:" See the changelog for migration guidance.";console.error(`${n} was removed in this version.${e}`),process.exit(1)}function v(n,t){if(n)for(let e of n){if(!e.removed)continue;h(t,e.name,n)!==void 0&&R(`--${e.name}`,e.replaced_by)}}function b(n,t,e,a){let o=e.join(" ");if(console.log(`
|
|
4
4
|
${n.name} ${o} - ${t.description??""}
|
|
5
|
-
`),t.commands&&t.commands.length>0){let l=t.commands.filter(i=>!i.removed&&g(i,[...e,i.name],a));l.length>0&&(console.log("Commands:"),l.forEach(i=>{let d=` ${i.name}`;if(i.alias){let m=Array.isArray(i.alias)?i.alias:[i.alias];d+=` (${m.join(", ")})`}let c=d.padEnd(24);console.log(`${c}${i.description??""}`)}),console.log())}let r=n.definitions?.global_arguments??[],s=
|
|
5
|
+
`),t.commands&&t.commands.length>0){let l=t.commands.filter(i=>!i.removed&&g(i,[...e,i.name],a));l.length>0&&(console.log("Commands:"),l.forEach(i=>{let d=` ${i.name}`;if(i.alias){let m=Array.isArray(i.alias)?i.alias:[i.alias];d+=` (${m.join(", ")})`}let c=d.padEnd(24);console.log(`${c}${i.description??""}`)}),console.log())}let r=n.definitions?.global_arguments??[],s=A(r,t.arguments).filter(l=>!l.removed);s.length>0&&(console.log("Arguments:"),s.forEach(l=>{console.log(D(l))}),console.log()),t.examples&&t.examples.length>0&&(console.log("Examples:"),t.examples.forEach(l=>{console.log(` ${l}`)}),console.log()),t.commands&&t.commands.length>0&&console.log(`Use "${n.name} ${o} <command> help" for more information about a command.`)}function k(n,t,e){console.log(`Tigris CLI Version: ${t}
|
|
6
6
|
`),console.log(`Usage: tigris [command] [options]
|
|
7
7
|
`),console.log("Commands:"),n.commands.filter(o=>!o.removed&&g(o,[o.name],e)).forEach(o=>{let r=` ${o.name}`;if(o.alias){let l=Array.isArray(o.alias)?o.alias:[o.alias];r+=` (${l.join(", ")})`}let s=r.padEnd(24);console.log(`${s}${o.description??""}`)}),console.log(`
|
|
8
|
-
Use "${n.name} <command> help" for more information about a command.`)}function
|
|
8
|
+
Use "${n.name} <command> help" for more information about a command.`)}function A(n,t){let e=t??[],a=new Set(e.map(s=>s.name)),o=new Set(e.filter(s=>s.alias).map(s=>s.alias)),r=n.filter(s=>!a.has(s.name)&&!(s.alias&&o.has(s.alias)));return[...e,...r]}function E(n,t=[]){t.forEach(e=>{if(e.type==="positional"){let a=e.required?`<${e.name}>`:`[${e.name}]`;n.argument(a,e.description)}else{let a=e.alias&&typeof e.alias=="string"&&e.alias.length===1,o=e.alias&&typeof e.alias=="string"&&e.alias.length>1,r=a?`-${e.alias}, --${e.name}`:o?`--${e.alias}, --${e.name}`:`--${e.name}`;if(e.type==="flag"||(e.type==="boolean"?r+=" [value]":e.options?r+=" <value>":r+=e.required||e["required-when"]?" <value>":" [value]"),e.removed)n.addOption(new L(r,e.description??"").hideHelp());else{let s=e.description??"";if(e.deprecated){let l=e.replaced_by?` Use ${e.replaced_by} instead.`:"";s=`(deprecated) ${s}${l}`}n.option(r,s,e.default)}}})}function M(n){return n.replace(/-([a-z])/g,(t,e)=>e.toUpperCase())}function h(n,t,e){if(e){let o=e.find(r=>r.name===t);if(o?.alias&&typeof o.alias=="string"){let r=o.alias.charAt(0).toUpperCase()+o.alias.slice(1);if(n[r]!==void 0)return n[r]}}let a=[t,t.replace(/-/g,""),t.replace(/-/g,"").toLowerCase(),t.charAt(0).toUpperCase(),M(t)];for(let o of a)if(n[o]!==void 0)return n[o]}function S(n,t){for(let e of n){if(e["required-when"]){let[a,o]=e["required-when"].split("="),r=h(t,a,n),s=h(t,e.name,n);if(r===o&&!s)return console.error(`--${e.name} is required when --${a} is ${o}`),!1}if(e.required&&!h(t,e.name,n))return console.error(`--${e.name} is required`),!1}return!0}function j(n,t,e){let a;"optsWithGlobals"in e&&typeof e.optsWithGlobals=="function"?a=e.optsWithGlobals():"opts"in e&&typeof e.opts=="function"?a=e.opts():a=e;let o={...a};return n.filter(s=>s.type==="positional").forEach((s,l)=>{t[l]!==void 0&&(s.multiple?o[s.name]=t[l].split(",").map(i=>i.trim()):o[s.name]=t[l])}),n.forEach(s=>{s.multiple&&s.type!=="positional"&&o[s.name]&&typeof o[s.name]=="string"&&(o[s.name]=o[s.name].split(",").map(l=>l.trim()))}),o}async function I(n,t,e=[],a={}){(a.json||a.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:o,error:r}=await n(t);(r||!o)&&(console.error(r),process.exit(1));let s=t[t.length-1],l=o.default||o[s];typeof l!="function"&&(console.error(`Command not implemented: ${t.join(" ")}`),process.exit(1)),await l({...a,_positional:e})}function _(n,t,e,a=[]){let{specs:o,loadModule:r,hasImplementation:s}=n,l=o.definitions?.global_arguments??[];for(let i of e){U(i.name)||(console.error(`Invalid command name "${i.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let d=[...a,i.name];if(!g(i,d,s))continue;let c=t.command(i.name,i.removed?{hidden:!0}:void 0).description(i.description??"");if(i.alias&&(Array.isArray(i.alias)?i.alias:[i.alias]).forEach(p=>{c.alias(p)}),i.removed){c.allowUnknownOption(!0),c.allowExcessArguments(!0),c.action(()=>{R(`${o.name} ${d.join(" ")}`,i.replaced_by)});continue}if(i.commands&&i.commands.length>0)if(_(n,c,i.commands,d),i.default){let m=i.commands.find(p=>p.name===i.default);if(m){let p=A(l,[...i.arguments||[],...m.arguments||[]]);E(c,p),c.allowExcessArguments(!0),c.action(async(...f)=>{let u=f.pop(),x=w([u],i,d,o,s),$=j(p,x,u);p.length>0&&!S(p,$)||(v(p,$),m.deprecated&&m.messages?.onDeprecated&&C(m.messages.onDeprecated),await I(r,[...d,m.name],x,$))})}}else c.allowExcessArguments(!0),c.action((...m)=>{w(m,i,d,o,s),b(o,i,d,s)});else E(c,A(l,i.arguments)),c.action(async(...m)=>{let p=m.pop(),f=m,u=j(i.arguments||[],f,p);i.arguments&&!S(i.arguments,u)||(v(i.arguments,u),i.deprecated&&i.messages?.onDeprecated&&C(i.messages.onDeprecated),await I(r,d,f,u))});c.command("help").description("Show help for this command").action(()=>{b(o,i,d,s)})}}function P(n){let{specs:t,version:e,hasImplementation:a}=n,o=new q;return o.name(t.name).description(t.description).version(e),_(n,o,t.commands),o.command("help").description("Show general help").action(()=>{k(t,e,a)}),o.command("version").description("Show the CLI version").action(()=>{console.log(e)}),o.allowExcessArguments(!0),o.action((...r)=>{w(r,{commands:t.commands},[],t,a),k(t,e,a)}),o}export{G as a,U as b,D as c,g as d,b as e,k as f,E as g,S as h,j as i,_ as j,P as k};
|
package/dist/cli-core.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}from"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";export{g as addArgumentsToCommand,d as commandHasAnyImplementation,k as createProgram,i as extractArgumentValues,c as formatArgumentHelp,b as isValidCommandName,j as registerCommands,a as setupErrorHandlers,e as showCommandHelp,f as showMainHelp,h as validateRequiredWhen};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-BN6MNZDO.js";import"./chunk-X3H2PJ6S.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-BN6MNZDO.js";import"./chunk-X3H2PJ6S.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y}from"../../chunk-
|
|
1
|
+
import{b as y}from"../../chunk-CL4GEWT2.js";import"../../chunk-3QCSRNXC.js";import{a as s,b as h}from"../../chunk-S6KFKBMY.js";import{b as n,c as b,d as p}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as A,c as f,j as R}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{assignBucketRoles as x,revokeAllBucketRoles as w}from"@tigrisdata/iam";var e=R("access-keys","assign"),N=["Editor","ReadOnly","NamespaceAdmin"];function v(r){return r?Array.isArray(r)?r:[r]:[]}async function O(r){A(e);let g=h(r),i=s(r,["id"]),m=s(r,["admin"]),d=s(r,["revokeRoles","revoke-roles"]),l=v(s(r,["bucket","b"])),t=v(s(r,["role","r"]));i||n(e,"Access key ID is required"),m&&d&&n(e,"Cannot use --admin and --revoke-roles together");let u=await y(e);if(d){let{error:o}=await w(i,{config:u});o&&n(e,o),g==="json"&&console.log(JSON.stringify({action:"revoked",id:i})),f(e);return}let a;if(m)a=[{bucket:"*",role:"NamespaceAdmin"}];else{l.length===0&&n(e,"At least one bucket name is required (or use --admin or --revoke-roles)"),t.length===0&&n(e,"At least one role is required (or use --admin or --revoke-roles)");for(let o of t)N.includes(o)||n(e,`Invalid role "${o}". Valid roles are: ${N.join(", ")}`);t.length===1?a=l.map(o=>({bucket:o,role:t[0]})):t.length===l.length?a=l.map((o,c)=>({bucket:o,role:t[c]})):n(e,`Number of roles (${t.length}) must be 1 or match number of buckets (${l.length})`)}let{error:k}=await x(i,a,{config:u});if(k&&n(e,k),g==="json"){let o=b(e),c={action:"assigned",id:i,assignments:a};o.length>0&&(c.nextActions=o),console.log(JSON.stringify(c))}f(e),p(e)}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"../../chunk-
|
|
1
|
+
import{b as u}from"../../chunk-CL4GEWT2.js";import{a as d}from"../../chunk-S77OAN6Y.js";import"../../chunk-3QCSRNXC.js";import{a as l,b as h}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import S from"enquirer";import{attachPolicyToAccessKey as N,listPolicies as R,listPoliciesForAccessKey as q}from"@tigrisdata/iam";var{prompt:k}=S,e=g("access-keys","attach-policy");async function v(s){p(e);let A=h(s),o=l(s,["id"]),r=l(s,["policyArn","policy-arn"]);o||t(e,"Access key ID is required");let c=await u(e);if(!r){d("Use --policy-arn to specify the policy ARN");let[a,n]=await Promise.all([R({config:c}),q(o,{config:c})]);a.error&&t(e,a.error),n.error&&t(e,n.error);let w=new Set(n.data.policies),f=a.data.policies.filter(i=>!w.has(i.name));f.length===0&&t(e,"No unassigned policies available. All policies are already attached to this access key.");let{selected:P}=await k({type:"select",name:"selected",message:"Select a policy to attach:",choices:f.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});r=P}let{error:m}=await N(o,r,{config:c});m&&t(e,m),A==="json"&&console.log(JSON.stringify({action:"attached",id:o,policyArn:r})),y(e)}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"../../chunk-
|
|
1
|
+
import{b as u}from"../../chunk-CL4GEWT2.js";import"../../chunk-3QCSRNXC.js";import{a as d,b as p}from"../../chunk-S6KFKBMY.js";import{b as o,c as g,d as f}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as a,c as m,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{createAccessKey as w}from"@tigrisdata/iam";var t=l("access-keys","create");async function x(n){a(t);let A=p(n),c=d(n,["name"]);c||o(t,"Access key name is required");let y=await u(t),{data:e,error:s}=await w(c,{config:y});if(s&&o(t,s),A==="json"){let r=g(t,{name:e.name,id:e.id}),i={action:"created",name:e.name,id:e.id,secret:e.secret};r.length>0&&(i.nextActions=r),console.log(JSON.stringify(i))}else console.log(` Name: ${e.name}`),console.log(` Access Key ID: ${e.id}`),console.log(` Secret Access Key: ${e.secret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");m(t),f(t,{name:e.name,id:e.id})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as g}from"../../chunk-
|
|
1
|
+
import{b as g}from"../../chunk-CL4GEWT2.js";import{a as m,b as a}from"../../chunk-S77OAN6Y.js";import"../../chunk-3QCSRNXC.js";import{a as i,b as d}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as n,c as s,j as f}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{removeAccessKey as u}from"@tigrisdata/iam";var e=f("access-keys","delete");async function k(r){n(e);let l=d(r),o=i(r,["id"]),p=i(r,["yes","y","force"]);if(o||t(e,"Access key ID is required"),!p&&(m("Use --yes to skip confirmation"),!await a(`Delete access key '${o}'?`))){console.log("Aborted");return}let y=await g(e),{error:c}=await u(o,{config:y});c&&t(e,c),l==="json"&&console.log(JSON.stringify({action:"deleted",id:o})),s(e)}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A}from"../../chunk-
|
|
1
|
+
import{b as A}from"../../chunk-CL4GEWT2.js";import{a as m,b as h}from"../../chunk-S77OAN6Y.js";import"../../chunk-3QCSRNXC.js";import{a,b as u}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import N from"enquirer";import{detachPolicyFromAccessKey as $,listPolicies as q,listPoliciesForAccessKey as F}from"@tigrisdata/iam";var{prompt:R}=N,e=g("access-keys","detach-policy");async function I(c){p(e);let w=u(c),t=a(c,["id"]),i=a(c,["policyArn","policy-arn"]),k=a(c,["yes","y","force"]);t||o(e,"Access key ID is required");let n=await A(e);if(!i){m("Use --policy-arn to specify the policy ARN");let[s,l]=await Promise.all([F(t,{config:n}),q({config:n})]);s.error&&o(e,s.error),l.error&&o(e,l.error);let P=new Set(s.data.policies),d=l.data.policies.filter(r=>P.has(r.name));d.length===0&&o(e,"No policies are attached to this access key.");let{selected:S}=await R({type:"select",name:"selected",message:"Select a policy to detach:",choices:d.map(r=>({name:r.resource,message:`${r.name} (${r.resource})`}))});i=S}if(!k&&(m("Use --yes to skip confirmation"),!await h(`Detach policy '${i}' from access key '${t}'?`))){console.log("Aborted");return}let{error:f}=await $(t,i,{config:n});f&&o(e,f),w==="json"&&console.log(JSON.stringify({action:"detached",id:t,policyArn:i})),y(e)}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m}from"../../chunk-
|
|
1
|
+
import{b as m}from"../../chunk-CL4GEWT2.js";import"../../chunk-3QCSRNXC.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as c,c as l,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{getAccessKey as u}from"@tigrisdata/iam";var e=g("access-keys","get");async function $(s){c(e);let d=f(s),r=a(s,["id"]);r||t(e,"Access key ID is required");let p=await m(e),{data:o,error:n}=await u(r,{config:p});if(n&&t(e,n),d==="json")console.log(JSON.stringify(o));else if(console.log(` Name: ${o.name}`),console.log(` ID: ${o.id}`),console.log(` Status: ${o.status}`),console.log(` Created: ${o.createdAt}`),console.log(` Organization: ${o.organizationId}`),o.roles&&o.roles.length>0){console.log(" Roles:");for(let i of o.roles)console.log(` - ${i.bucket}: ${i.role}`)}else console.log(" Roles: None");l(e)}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as P}from"../../chunk-
|
|
1
|
+
import{b as P}from"../../chunk-CL4GEWT2.js";import{g as A}from"../../chunk-AFM3TY2D.js";import"../../chunk-3QCSRNXC.js";import{a as y,b as k,c as h}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as g,e as f,i as d,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{listPoliciesForAccessKey as E}from"@tigrisdata/iam";var i=u("access-keys","list-policies");async function F(o){m(i);let n=k(o),{limit:s,pageToken:r}=h(o),a=y(o,["id"]);a||c(i,"Access key ID is required");let T=await P(i),{data:t,error:p}=await E(a,{...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:T});if(p&&c(i,p),!t.policies||t.policies.length===0){f(i);return}let e=t.policies.map(O=>({policy:O})),x=[{key:"policy",header:e.length>1?"Attached Policies":"Attached Policy"}],l=t.paginationToken||void 0,w=A(e,n,"policies","policy",x,{paginationToken:l});console.log(w),n!=="json"&&n!=="xml"&&d(l),g(i,{count:e.length})}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as h}from"../../chunk-
|
|
1
|
+
import{b as h}from"../../chunk-CL4GEWT2.js";import{g as T}from"../../chunk-AFM3TY2D.js";import"../../chunk-3QCSRNXC.js";import{b as k,c as y}from"../../chunk-S6KFKBMY.js";import{b as l}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as d,c as p,e as f,i as g,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{listAccessKeys as A}from"@tigrisdata/iam";var t=u("access-keys","list");async function P(a){d(t);let o=k(a),{limit:s,pageToken:i}=y(a),x=await h(t),{data:e,error:r}=await A({...s!==void 0?{limit:s}:{},...i?{paginationToken:i}:{},config:x});if(r&&l(t,r),!e.accessKeys||e.accessKeys.length===0){f(t);return}let c=e.accessKeys.map(n=>({name:n.name,id:n.id,status:n.status,created:n.createdAt})),K=[{key:"name",header:"Name"},{key:"id",header:"ID"},{key:"status",header:"Status"},{key:"created",header:"Created"}],m=e.paginationToken||void 0,w=T(c,o,"keys","key",K,{paginationToken:m});console.log(w),o!=="json"&&o!=="xml"&&g(m),p(t,{count:c.length})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w}from"../../chunk-
|
|
1
|
+
import{b as w}from"../../chunk-CL4GEWT2.js";import{a as u,b as y}from"../../chunk-S77OAN6Y.js";import"../../chunk-3QCSRNXC.js";import{a as i,b as p}from"../../chunk-S6KFKBMY.js";import{b as n,c as g,d as m}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as l,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{rotateAccessKey as k}from"@tigrisdata/iam";var e=d("access-keys","rotate");async function x(o){f(e);let A=p(o),r=i(o,["id"]),S=i(o,["yes","y","force"]);if(r||n(e,"Access key ID is required"),!S&&(u("Use --yes to skip confirmation"),!await y(`Rotate access key '${r}'? The current secret will be invalidated.`))){console.log("Aborted");return}let h=await w(e),{data:t,error:s}=await k(r,{config:h});if(s&&n(e,s),A==="json"){let c=g(e,{id:t.id}),a={action:"rotated",id:t.id,secret:t.newSecret};c.length>0&&(a.nextActions=c),console.log(JSON.stringify(a))}else console.log(` Access Key ID: ${t.id}`),console.log(` New Secret Access Key: ${t.newSecret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");l(e),m(e,{id:t.id})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,c as j}from"../../chunk-N3Y6RFSK.js";import{a as B}from"../../chunk-S77OAN6Y.js";import{d as T}from"../../chunk-
|
|
1
|
+
import{a as C,c as j}from"../../chunk-N3Y6RFSK.js";import{a as B}from"../../chunk-S77OAN6Y.js";import{d as T}from"../../chunk-3QCSRNXC.js";import{a as t,b as O}from"../../chunk-S6KFKBMY.js";import{b as i,c as x,d as D}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as w,c as v,j as L}from"../../chunk-D7WXNA2O.js";import{d as p,e as g}from"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{createBucket as E}from"@tigrisdata/storage";import F from"enquirer";var{prompt:J}=F,a=L("buckets","create");async function W(e){w(a);let q=O(e),s=t(e,["name"]),b=t(e,["public"])?"public":t(e,["access","a","A"]),d=t(e,["enable-snapshots","enableSnapshots","s","S"]),N=t(e,["allow-object-acl","allowObjectAcl"]),P=t(e,["enable-directory-listing","enableDirectoryListing"]),h=t(e,["default-tier","t","T"]),I=t(e,["locations","l","L"]),o=t(e,["fork-of","forkOf","fork"]),u=t(e,["source-snapshot","sourceSnapshot","source-snap"]),R=!s,S;if(R){B("Provide --name to skip interactive mode");let c=p("buckets","access","create"),n=g(c),f=n?.findIndex(r=>r.value===c?.default),y=p("buckets","default-tier","create"),A=g(y),m=A?.findIndex(r=>r.value===y?.default),l=await J([{type:"input",name:"name",message:"Bucket name:",required:!0},{type:"select",name:"access",message:"Access level:",choices:n||[],initial:f!==void 0&&f>=0?f:0},{type:"select",name:"defaultTier",message:"Default storage tier:",choices:A||[],initial:m!==void 0&&m>=0?m:0},{type:"confirm",name:"enableSnapshots",message:"Enable snapshots?",initial:!0}]);s=l.name,b=l.access,h=l.defaultTier,d=l.enableSnapshots;try{S=await C()}catch(r){i(a,r)}}s||i(a,"Bucket name is required"),u&&!o&&i(a,"--source-snapshot requires --fork-of");let{error:k}=await E(s,{defaultTier:h??"STANDARD",enableSnapshot:d===!0,allowObjectAcl:N===!0,enableDirectoryListing:P===!0,access:b??"private",locations:S??j(I??"global"),...o?{sourceBucketName:o}:{},...u?{sourceBucketSnapshot:u}:{},config:await T()});if(k&&i(a,k),q==="json"){let c=x(a,{name:s}),n={action:"created",name:s,...o?{forkOf:o}:{}};c.length>0&&(n.nextActions=c),console.log(JSON.stringify(n))}v(a,{name:s}),D(a,{name:s})}export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,b as y}from"../../chunk-S77OAN6Y.js";import{d as b}from"../../chunk-
|
|
1
|
+
import{a as x,b as y}from"../../chunk-S77OAN6Y.js";import{d as b}from"../../chunk-3QCSRNXC.js";import{a as s,b as A}from"../../chunk-S6KFKBMY.js";import{a as p,b as d,c as k,d as h}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as g,d as u,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{removeBucket as N}from"@tigrisdata/storage";var e=l("buckets","delete");async function B(i){f(e);let w=A(i),o=s(i,["name"]),c=s(i,["yes","y","force"]);o||d(e,"Bucket name is required");let a=Array.isArray(o)?o:[o],S=await b();if(!c&&(x("Use --yes to skip confirmation"),!await y(`Delete ${a.length} bucket(s)?`))){console.log("Aborted");return}let m=[],n=[];for(let t of a){let{error:r}=await N(t,{config:S,force:c});r?(u(e,r.message,{name:t}),n.push({name:t,error:r.message})):(m.push(t),g(e,{name:t}))}if(w==="json"){let t=k(e),r={action:"deleted",names:m,errors:n};t.length>0&&(r.nextActions=t),console.log(JSON.stringify(r))}n.length>0&&p(n[0].error,e),h(e)}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as m}from"../../chunk-
|
|
1
|
+
import{e as m}from"../../chunk-3QCSRNXC.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as s,c as a,j as e}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{disableSnapshot as l}from"@tigrisdata/storage";var o=e("buckets","disable-snapshots");async function d(n){s(o);let g=c(n),t=f(n,["name"]);t||i(o,"Bucket name is required");let p=await m(),{error:r}=await l(t,{config:p});r&&i(o,r),g==="json"&&console.log(JSON.stringify({action:"snapshots-disabled",name:t})),a(o,{name:t})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as m}from"../../chunk-
|
|
1
|
+
import{e as m}from"../../chunk-3QCSRNXC.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as e,c as a,j as s}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{enableSnapshot as l}from"@tigrisdata/storage";var o=s("buckets","enable-snapshots");async function u(r){e(o);let g=c(r),t=f(r,["name"]);t||n(o,"Bucket name is required");let p=await m(),{error:i}=await l(t,{config:p});i&&n(o,i),g==="json"&&console.log(JSON.stringify({action:"snapshots-enabled",name:t})),a(o,{name:t})}export{u as default};
|
package/dist/lib/buckets/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s}from"../../chunk-
|
|
1
|
+
import{c as s}from"../../chunk-JNSFDQGG.js";import{f as u}from"../../chunk-AFM3TY2D.js";import"../../chunk-N3Y6RFSK.js";import"../../chunk-S77OAN6Y.js";import{d as f}from"../../chunk-3QCSRNXC.js";import{a as p,b as c}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as a,c as i,j as m}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{getBucketInfo as h}from"@tigrisdata/storage";var t=m("buckets","get");async function w(e){a(t);let r=p(e,["name"]),g=c(e);r||o(t,"Bucket name is required");let{data:k,error:n}=await h(r,{config:await f()});n&&o(t,n);let l=[{property:"Name",value:r},...s(k).map(({label:d,value:b})=>({property:d,value:b}))],y=u(l,g,"bucket","property",[{key:"property",header:"Property"},{key:"value",header:"Value"}]);console.log(y),i(t)}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,b as k,c as b,d as F,e as I,f as c,g as h}from"../../../chunk-
|
|
1
|
+
import{a as R,b as k,c as b,d as F,e as I,f as c,g as h}from"../../../chunk-Q6UVMHAZ.js";import"../../../chunk-JNSFDQGG.js";import"../../../chunk-AFM3TY2D.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import{e as y}from"../../../chunk-3QCSRNXC.js";import{a as x,b as w}from"../../../chunk-S6KFKBMY.js";import{b as n}from"../../../chunk-SE5TRZWU.js";import"../../../chunk-DV3LCXRH.js";import{b as m,c as p,j as g}from"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-VNUR4TRP.js";import"../../../chunk-F4AGJWCK.js";var t=g("buckets lifecycle","create");async function O(r){m(t);let C=w(r),i=x(r,["name"]);i||n(t,"Bucket name is required");let e=R(r),d=k(e);d&&n(t,d);let a=b(e),o=F(e);!a.storageClass&&!o&&n(t,"A new rule must include a transition (--storage-class with --days or --date) and/or an expiration (--expire-days or --expire-date)"),a.storageClass&&e.days===void 0&&e.date===void 0&&n(t,"--storage-class requires --days or --date for a new transition rule");let f=I(e),s=await y(),u=await c(t,i,s),S={...a,...o?{expiration:o}:{},...e.prefix!==void 0?{filter:{prefix:e.prefix}}:{},...f!==void 0?{enabled:f}:{}};await h(t,i,[...u,S],s);let l=(await c(t,i,s)).find(B=>!u.some(E=>E.id===B.id))?.id??"(unknown)";C==="json"&&console.log(JSON.stringify({action:"created",bucket:i,id:l})),p(t,{name:i,id:l})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,b as R,c as k,d as F,e as S,f as q,g as w}from"../../../chunk-
|
|
1
|
+
import{a as C,b as R,c as k,d as F,e as S,f as q,g as w}from"../../../chunk-Q6UVMHAZ.js";import"../../../chunk-JNSFDQGG.js";import"../../../chunk-AFM3TY2D.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import{e as b}from"../../../chunk-3QCSRNXC.js";import{a as c,b as x}from"../../../chunk-S6KFKBMY.js";import{b as t}from"../../../chunk-SE5TRZWU.js";import"../../../chunk-DV3LCXRH.js";import{b as p,c as y,j as h}from"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-VNUR4TRP.js";import"../../../chunk-F4AGJWCK.js";var i=h("buckets lifecycle","edit");async function E(o){p(i);let T=x(o),n=c(o,["name"]),s=c(o,["id"]);n||t(i,"Bucket name is required"),s||t(i,"Rule id is required");let e=C(o),l=R(e,{requireStorageClassForTiming:!1});l&&t(i,l);let d=k(e),f=F(e),u=S(e);d.storageClass!==void 0||d.days!==void 0||d.date!==void 0||f!==void 0||u!==void 0||e.prefix!==void 0||t(i,"Provide at least one field to change (--storage-class, --days, --date, --expire-days, --expire-date, --prefix, --enable, --disable)");let g=await b(),m=await q(i,n,g),r=m.find(a=>a.id===s);if(r||t(i,`No lifecycle rule with id "${s}" found. Run \`tigris buckets lifecycle list ${n}\` to see ids.`),e.storageClass!==void 0||e.days!==void 0||e.date!==void 0){let a=d.storageClass??r.storageClass,B=e.days!==void 0?Number(e.days):e.date!==void 0?void 0:r.days,D=e.date!==void 0?e.date:e.days!==void 0?void 0:r.date;a||t(i,"--storage-class is required (this rule has no existing transition target)"),B===void 0&&D===void 0&&t(i,"--days or --date is required (this rule has no existing transition timing)")}let I={...r,...d,...f?{expiration:f}:{},...e.prefix!==void 0?{filter:{prefix:e.prefix}}:{},...u!==void 0?{enabled:u}:{}},v=m.map(a=>a.id===s?I:a);await w(i,n,v,g),T==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,id:s})),y(i,{name:n,id:s})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,i as b}from"../../../chunk-
|
|
1
|
+
import{h,i as b}from"../../../chunk-Q6UVMHAZ.js";import"../../../chunk-JNSFDQGG.js";import{b as x,d as y,e as k}from"../../../chunk-AFM3TY2D.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import{d as g}from"../../../chunk-3QCSRNXC.js";import{a as u,b as d}from"../../../chunk-S6KFKBMY.js";import{b as r}from"../../../chunk-SE5TRZWU.js";import"../../../chunk-DV3LCXRH.js";import{b as f,c as m,e as c,j as p}from"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-VNUR4TRP.js";import"../../../chunk-F4AGJWCK.js";import{getBucketInfo as T}from"@tigrisdata/storage";var e=p("buckets lifecycle","list");async function w(n){f(e);let a=u(n,["name"]),s=d(n);a||r(e,"Bucket name is required");let{data:C,error:l}=await T(a,{config:await g()});l&&r(e,l);let o=C?.settings.lifecycleRules??[];if(o.length===0){c(e);return}let i=o.map(t=>({id:t.id??"-",prefix:t.filter?.prefix??"-",transition:h(t),expiration:b(t),status:t.enabled===!1?"disabled":"enabled"}));console.log(s==="json"?x(i):s==="xml"?y(i,"lifecycleRules","rule"):k(i,[{key:"id",header:"ID"},{key:"prefix",header:"Prefix"},{key:"transition",header:"Transition"},{key:"expiration",header:"Expiration"},{key:"status",header:"Status"}])),m(e,{count:o.length})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"../../../chunk-Q6UVMHAZ.js";import"../../../chunk-JNSFDQGG.js";import"../../../chunk-AFM3TY2D.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import"../../../chunk-S6KFKBMY.js";import"../../../chunk-SE5TRZWU.js";import"../../../chunk-DV3LCXRH.js";import"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";export{e as enabledFromInput,d as expirationFromInput,f as fetchExistingRules,i as formatExpirationCell,h as formatTransitionCell,a as readRuleInput,g as submitRules,c as transitionDeltaFromInput,b as validateRuleFieldCombinations};
|
package/dist/lib/buckets/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l}from"../../chunk-
|
|
1
|
+
import{g as l}from"../../chunk-AFM3TY2D.js";import{d as j}from"../../chunk-3QCSRNXC.js";import{a as g,b as P,c as S}from"../../chunk-S6KFKBMY.js";import{b as m}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as D,c as d,e as k,i as u,j as E}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{listBuckets as A,listForks as B}from"@tigrisdata/storage";var e=E("buckets","list");async function H(o){D(e);let n=P(o),s=g(o,["forks-of","forksOf"]),c=g(o,["deleted"]),{limit:r,pageToken:i}=S(o),p=await j();s&&c&&console.warn("\u26A0 --deleted is ignored when --forks-of is used; use --deleted on its own to list soft-deleted buckets");let b=[{key:"name",header:"Name"},{key:"created",header:"Created"}];if(s){let{data:t,error:x}=await B(s,{...r!==void 0?{limit:r}:{},...i?{paginationToken:i}:{},config:p});if(x&&m(e,x),!t.forks||t.forks.length===0){k(e);return}let f=[];for(let O of t.forks)f.push({name:O.name,created:O.creationDate});let y=t.paginationToken||void 0,F=l(f,n,"forks","fork",b,{paginationToken:y});console.log(F),n!=="json"&&n!=="xml"&&u(y),d(e,{count:f.length});return}let{data:a,error:h}=await A({...r!==void 0?{limit:r}:{},...i?{paginationToken:i}:{},...c?{deleted:c}:{},config:p});if(h&&m(e,h),!a.buckets||a.buckets.length===0){k(e);return}let T=a.buckets.map(t=>({name:t.name,created:t.creationDate})),w=a.paginationToken||void 0,C=l(T,n,"buckets","bucket",b,{paginationToken:w});console.log(C),n!=="json"&&n!=="xml"&&u(w),d(e,{count:T.length})}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,b as S}from"../../chunk-S77OAN6Y.js";import{d as x}from"../../chunk-3QCSRNXC.js";import{a as c,b as w}from"../../chunk-S6KFKBMY.js";import{b as s,c as h,d as l}from"../../chunk-SE5TRZWU.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as p,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-ATBINUDP.js";import"../../chunk-VNUR4TRP.js";import"../../chunk-F4AGJWCK.js";import{getBucketInfo as $,mergeFork as F}from"@tigrisdata/storage";var r=d("buckets","merge");async function I(n){k(r);let y=w(n),o=c(n,["fork"]),t=c(n,["into","source"]),f=c(n,["from-snapshot","fromSnapshot","from-snap"]),A=c(n,["yes","y"]);o||s(r,"Fork bucket name is required");let a=await x();if(!t){let{data:e,error:i}=await $(o,{config:a});i&&s(r,i);let u=e?.forkInfo?.parents?.[0]?.bucketName;u||s(r,`'${o}' is not a fork or its source bucket could not be determined. Pass --into <source-bucket>.`),t=u}if(!A&&(b("Use --yes to skip confirmation"),!await S(`Merge fork '${o}' into source '${t}'? This writes the fork's changes into '${t}'.`))){console.log("Aborted");return}let{data:N,error:m}=await F(o,t,{...f?{forkSnapshot:f}:{},config:a});m&&s(r,m);let g=N?.snapshotVersion??"";if(y==="json"){let e=h(r,{fork:o,into:t}),i={action:"merged",fork:o,into:t,snapshotVersion:g};e.length>0&&(i.nextActions=e),console.log(JSON.stringify(i))}p(r,{fork:o,into:t,snapshotVersion:g}),l(r,{fork:o,into:t})}export{I as default};
|