@tigrisdata/cli 2.14.0-beta.2 → 2.14.0-beta.3
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 -0
- package/dist/auth/provider.js +1 -0
- package/dist/auth/storage.js +1 -1
- package/dist/chunk-3FMWZQ3C.js +4 -0
- package/dist/chunk-3LHPCSFG.js +4 -0
- package/dist/chunk-4R4YLHT7.js +7 -0
- package/dist/chunk-52HSMT5H.js +1 -0
- package/dist/chunk-5VDFQRGP.js +2 -0
- package/dist/chunk-7J6WK54T.js +1 -0
- package/dist/chunk-AHGPPFCQ.js +1 -0
- package/dist/{chunk-2XAO2OYD.js → chunk-ATBINUDP.js} +1 -1
- package/dist/chunk-CLO5HM7B.js +1 -0
- package/dist/chunk-DZUJWPQ3.js +8 -0
- package/dist/chunk-EULV7RV7.js +5 -0
- package/dist/{chunk-LCWHZUZZ.js → chunk-NDNMIXDC.js} +1 -1
- package/dist/{chunk-BETAO4PB.js → chunk-PPNBQWSR.js} +1 -1
- package/dist/{chunk-ZK3HJDIZ.js → chunk-RG5EZWTN.js} +1 -1
- package/dist/chunk-RTJM32XN.js +5 -0
- package/dist/chunk-X3GRUJWS.js +1 -0
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -3
- package/dist/lib/access-keys/create.js +1 -3
- package/dist/lib/access-keys/delete.js +1 -3
- package/dist/lib/access-keys/get.js +1 -3
- package/dist/lib/access-keys/list.js +1 -3
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/list.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-transition.js +1 -1
- package/dist/lib/buckets/set-ttl.js +1 -1
- package/dist/lib/buckets/set.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/forks/create.js +1 -1
- package/dist/lib/forks/list.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -3
- package/dist/lib/iam/policies/delete.js +1 -3
- package/dist/lib/iam/policies/edit.js +1 -3
- package/dist/lib/iam/policies/get.js +1 -3
- package/dist/lib/iam/policies/list.js +1 -3
- package/dist/lib/iam/users/invite.js +1 -6
- package/dist/lib/iam/users/list.js +4 -9
- package/dist/lib/iam/users/remove.js +1 -6
- package/dist/lib/iam/users/revoke-invitation.js +1 -6
- package/dist/lib/iam/users/update-role.js +1 -6
- 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/list.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/set.js +1 -1
- package/dist/lib/organizations/create.js +2 -5
- package/dist/lib/organizations/list.js +1 -4
- package/dist/lib/organizations/select.js +3 -6
- 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 -0
- package/dist/lib/whoami.js +2 -2
- package/dist/specs.yaml +41 -208
- package/dist/utils/exit.js +1 -1
- package/dist/utils/messages.js +1 -1
- package/dist/utils/options.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 +25 -15
- package/dist/auth/config.js +0 -1
- package/dist/auth/s3-client.js +0 -1
- package/dist/auth/types.js +0 -0
- package/dist/chunk-5LRGY6RN.js +0 -2
- package/dist/chunk-DHUR7FTP.js +0 -4
- package/dist/chunk-DOUR5YEY.js +0 -1
- package/dist/chunk-E4MLGABW.js +0 -1
- package/dist/chunk-FP2FMNEE.js +0 -8
- package/dist/chunk-GHTFMDGV.js +0 -4
- package/dist/chunk-GZ7JBHFT.js +0 -1
- package/dist/chunk-IJYKPR4W.js +0 -2
- package/dist/chunk-JRALYIRA.js +0 -1
- package/dist/chunk-KH63ANUX.js +0 -1
- package/dist/chunk-S5P27E6L.js +0 -7
- package/dist/chunk-XLRVNE6T.js +0 -1
package/dist/auth/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-7J6WK54T.js";import"../chunk-CLO5HM7B.js";import"../chunk-ATBINUDP.js";export{b as TIGRIS_CLAIMS_NAMESPACE,c as TigrisAuthClient,a as getAuth0Config,d as getAuthClient};
|
package/dist/auth/fly.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-52HSMT5H.js";import"../chunk-7J6WK54T.js";import"../chunk-CLO5HM7B.js";import"../chunk-ATBINUDP.js";export{b as fetchOrganizationsFromUserInfo,a as isFlyUser};
|
package/dist/auth/iam.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"../chunk-RTJM32XN.js";import"../chunk-EULV7RV7.js";import"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-52HSMT5H.js";import"../chunk-7J6WK54T.js";import"../chunk-CLO5HM7B.js";import"../chunk-ATBINUDP.js";export{c as getIAMConfig,b as getOAuthIAMConfig,a as isFlyOrganization};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-EULV7RV7.js";import"../chunk-7J6WK54T.js";import"../chunk-CLO5HM7B.js";import"../chunk-ATBINUDP.js";export{b as getLoginMethod,c as getStorageConfig,e as getStorageConfigWithOrg,a as getTigrisConfig,d as isAuthenticated,f as requireOAuthLogin};
|
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,u}from"../chunk-CLO5HM7B.js";import"../chunk-ATBINUDP.js";export{a as CONFIG_DIR,b as CONFIG_FILE,u as clearAllData,q as clearCredentials,e as clearTokens,l as getAwsProfileConfig,m as getCredentials,j as getEnvCredentials,s as getLoginMethod,g as getOrganizations,i as getSelectedOrganization,n as getStoredCredentials,d as getTokens,k as hasAwsProfile,t as storeCredentialOrganization,o as storeCredentials,r as storeLoginMethod,f as storeOrganizations,h as storeSelectedOrganization,p as storeTemporaryCredentials,c as storeTokens};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as r}from"./chunk-DV3LCXRH.js";import{a as s,d as c}from"./chunk-5VDFQRGP.js";import{c as i}from"./chunk-PPNBQWSR.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
|
+
Error: ${e.message}`),m()&&e.nextActions.length>0){console.error(`
|
|
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
|
+
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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as d}from"./chunk-AHGPPFCQ.js";import{a as m,d as e}from"./chunk-3FMWZQ3C.js";import{b as s,c as r,d as c,f as g,g as l,i as f}from"./chunk-5VDFQRGP.js";import{d as p}from"./chunk-7J6WK54T.js";import{h as u}from"./chunk-CLO5HM7B.js";var o=f("login","oauth");async function y(h={}){s(o);let a=d(h);try{let t=p();if(await t.isAuthenticated()){g(o);return}await t.login({onDeviceCode:(n,w)=>{console.log(`
|
|
2
|
+
Your confirmation code: ${n}
|
|
3
|
+
`),console.log(`If browser doesn't open, visit: ${w}`)},onWaiting:()=>console.log(`
|
|
4
|
+
Waiting for authentication...`)});let i=await t.getOrganizations();if(i.length>0){let n=i[0];await u(n.id),a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:n.displayName||n.name}),e(o),i.length>1&&l(o,{count:i.length})}else a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:"none"}),e(o)}catch(t){c(o),m(t,o)}}var C=y;export{y as a,C as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as $}from"./chunk-3FMWZQ3C.js";import{h as C}from"./chunk-5VDFQRGP.js";import{Command as I}from"commander";function P(){process.on("unhandledRejection",e=>{(e===""||e===void 0)&&(console.error(`
|
|
2
|
+
Operation cancelled`),process.exit(1)),$(e)}),process.on("uncaughtException",e=>{$(e)})}function q(e){return/^[a-zA-Z0-9_-]+$/.test(e)}function j(e){let t;e.type==="positional"?t=` ${e.name}`:(t=` --${e.name}`,e.alias&&typeof e.alias=="string"&&(t+=e.alias.length===1?`, -${e.alias}`:`, --${e.alias}`));let n=26,a=t.length>=n?t+" ":t.padEnd(n),o=e.description;return e.options&&(Array.isArray(e.options)&&typeof e.options[0]=="string"?o+=` (options: ${e.options.join(", ")})`:o+=` (options: ${e.options.map(r=>r.value).join(", ")})`),e.default&&(o+=` [default: ${e.default}]`),e.required&&(o+=" [required]"),e["required-when"]&&(o+=` [required when: ${e["required-when"]}]`),e.multiple&&(o+=" [multiple values: comma-separated]"),e.type==="positional"&&(o+=" [positional argument]"),e.examples&&e.examples.length>0&&(o+=` (examples: ${e.examples.join(", ")})`),`${a}${o}`}function g(e,t,n){return n(t)?!0:e.commands?e.commands.some(a=>g(a,[...t,a.name],n)):!1}function x(e,t,n,a){let o=n.join(" ");if(console.log(`
|
|
3
|
+
${e.name} ${o} - ${t.description}
|
|
4
|
+
`),t.commands&&t.commands.length>0){let l=t.commands.filter(i=>g(i,[...n,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 p=d.padEnd(24);console.log(`${p}${i.description}`)}),console.log())}let r=e.definitions?.global_arguments??[],s=y(r,t.arguments);s.length>0&&(console.log("Arguments:"),s.forEach(l=>{console.log(j(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 "${e.name} ${o} <command> help" for more information about a command.`)}function b(e,t,n){console.log(`Tigris CLI Version: ${t}
|
|
5
|
+
`),console.log(`Usage: tigris [command] [options]
|
|
6
|
+
`),console.log("Commands:"),e.commands.filter(o=>g(o,[o.name],n)).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(`
|
|
7
|
+
Use "${e.name} <command> help" for more information about a command.`)}function y(e,t){let n=t??[],a=new Set(n.map(s=>s.name)),o=new Set(n.filter(s=>s.alias).map(s=>s.alias)),r=e.filter(s=>!a.has(s.name)&&!(s.alias&&o.has(s.alias)));return[...n,...r]}function v(e,t=[]){t.forEach(n=>{if(n.type==="positional"){let a=n.required?`<${n.name}>`:`[${n.name}]`;e.argument(a,n.description)}else{let a=n.alias&&typeof n.alias=="string"&&n.alias.length===1,o=n.alias&&typeof n.alias=="string"&&n.alias.length>1,r=a?`-${n.alias}, --${n.name}`:o?`--${n.alias}, --${n.name}`:`--${n.name}`;n.type==="flag"||(n.type==="boolean"?r+=" [value]":n.options?r+=" <value>":r+=n.required||n["required-when"]?" <value>":" [value]"),e.option(r,n.description,n.default)}})}function R(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function A(e,t,n){if(n){let o=n.find(r=>r.name===t);if(o&&o.alias&&typeof o.alias=="string"){let r=o.alias.charAt(0).toUpperCase()+o.alias.slice(1);if(e[r]!==void 0)return e[r]}}let a=[t,t.replace(/-/g,""),t.replace(/-/g,"").toLowerCase(),t.charAt(0).toUpperCase(),R(t)];for(let o of a)if(e[o]!==void 0)return e[o]}function E(e,t){for(let n of e){if(n["required-when"]){let[a,o]=n["required-when"].split("="),r=A(t,a,e),s=A(t,n.name,e);if(r===o&&!s)return console.error(`--${n.name} is required when --${a} is ${o}`),!1}if(n.required&&!A(t,n.name,e))return console.error(`--${n.name} is required`),!1}return!0}function f(e,t,n){let a;"optsWithGlobals"in n&&typeof n.optsWithGlobals=="function"?a=n.optsWithGlobals():"opts"in n&&typeof n.opts=="function"?a=n.opts():a=n;let o={...a};return e.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])}),e.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 S(e,t,n=[],a={}){(a.json||a.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:o,error:r}=await e(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:n})}function k(e,t,n,a=[]){let{specs:o,loadModule:r,hasImplementation:s}=e,l=o.definitions?.global_arguments??[];for(let i of n){q(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 p=t.command(i.name).description(i.description);if(i.alias&&(Array.isArray(i.alias)?i.alias:[i.alias]).forEach(c=>p.alias(c)),i.commands&&i.commands.length>0)if(k(e,p,i.commands,d),i.default){let m=i.commands.find(c=>c.name===i.default);if(m){let c=y(l,[...i.arguments||[],...m.arguments||[]]);v(p,c),p.action(async(...u)=>{let w=u.pop(),h=u;c.length>0&&!E(c,f(c,h,w))||(m.deprecated&&m.messages?.onDeprecated&&C(m.messages.onDeprecated),await S(r,[...d,m.name],h,f(c,h,w)))})}}else p.action(()=>{x(o,i,d,s)});else v(p,y(l,i.arguments)),p.action(async(...m)=>{let c=m.pop(),u=m;i.arguments&&!E(i.arguments,f(i.arguments,u,c))||(i.deprecated&&i.messages?.onDeprecated&&C(i.messages.onDeprecated),await S(r,d,u,f(i.arguments||[],u,c)))});p.command("help").description("Show help for this command").action(()=>{x(o,i,d,s)})}}function M(e){let{specs:t,version:n,hasImplementation:a}=e,o=new I;return o.name(t.name).description(t.description).version(n),k(e,o,t.commands),o.command("help").description("Show general help").action(()=>{b(t,n,a)}),o.command("version").description("Show the CLI version").action(()=>{console.log(n)}),o.action(()=>{b(t,n,a)}),o}export{P as a,q as b,j as c,g as d,x as e,b as f,v as g,E as h,f as i,k as j,M as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as a}from"./chunk-7J6WK54T.js";import i from"axios";function u(n){return!!n?.startsWith("flyio_")}async function p(n){try{let{domain:e}=o(),t=(await i.get(`https://${e}/userinfo`,{headers:{Authorization:`Bearer ${n}`}})).data[a]?.ns;return Array.isArray(t)?t.map(r=>({id:r.id,name:r.name,displayName:r.name})):null}catch{return null}}export{u as a,p as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as p}from"./chunk-PPNBQWSR.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(n){let s=p(n.command,n.operation);if(s)return s.messages}function r(n,s){let e=n;return e=e.replace(/\\n/g,`
|
|
2
|
+
`),s&&(e=e.replace(/\{\{(\w+)\}\}/g,(a,g)=>{let u=s[g];return u!==void 0?String(u):`{{${g}}}`})),e}function f(n,s){if(!t()||i())return;let e=o(n);e?.onStart&&console.log(r(e.onStart,s))}function d(n,s){if(!t()||i())return;let e=o(n);e?.onSuccess&&console.log(`${c.success} ${r(e.onSuccess,s)}`)}function m(n,s,e){if(globalThis.__TIGRIS_JSON_MODE===!0)return;let a=o(n);a?.onFailure&&console.error(`${c.failure} ${r(a.onFailure,e)}`),s&&console.error(` ${s}`)}function M(n,s){if(!t()||i())return;let e=o(n);e?.onEmpty&&console.log(r(e.onEmpty,s))}function x(n,s){if(!t()||i())return;let e=o(n);e?.onAlreadyDone&&console.log(r(e.onAlreadyDone,s))}function S(n,s){if(!t()||i())return;let e=o(n);e?.hint&&console.log(`${c.hint} ${r(e.hint,s)}`)}function b(n){t()&&console.warn(`\u26A0 Deprecated: ${n}`)}function C(n,s){return{command:n,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as d,d as s,e as l,f as u,g as f,r as h}from"./chunk-CLO5HM7B.js";import c from"axios";import{createRemoteJWKSet as m,jwtVerify as w}from"jose";import T from"open";function _(){let a=process.env.TIGRIS_ENV==="development",e=a?"auth-dev.tigris.dev":process.env.AUTH0_DOMAIN??"auth.storage.tigrisdata.io",t=a?"JdJVYIyw0O1uHi5L5OJH903qaWBgd3gF":process.env.AUTH0_CLIENT_ID??"DMejqeM3CQ4IqTjEcd3oA9eEiT40hn8D",o=a?"https://tigris-api-dev":process.env.AUTH0_AUDIENCE??"https://tigris-os-api";return{domain:e,clientId:t,audience:o}}var v=process.env.TIGRIS_CLAIMS_NAMESPACE||"https://tigris",p=class{config;baseUrl;jwks=null;constructor(){this.config=_(),this.baseUrl=`https://${this.config.domain}`}getJWKS(){return this.jwks||(this.jwks=m(new URL(`${this.baseUrl}/.well-known/jwks.json`))),this.jwks}async verifyIdToken(e){let{payload:t}=await w(e,this.getJWKS(),{issuer:`${this.baseUrl}/`,audience:this.config.clientId});return t}async login(e){let o=(await c.post(`${this.baseUrl}/oauth/device/code`,{client_id:this.config.clientId,audience:this.config.audience,scope:"openid profile email offline_access"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;e?.onDeviceCode?.(o.user_code,o.verification_uri),await this.sleep(2e3);try{await T(o.verification_uri_complete)}catch{}e?.onWaiting?.();let n=await this.pollForToken(o.device_code,o.interval||5);await d(n),h("oauth"),await this.extractAndStoreOrganizations(n.idToken)}async pollForToken(e,t){let n=0;for(;n<60;){n++;try{let r=(await c.post(`${this.baseUrl}/oauth/token`,{client_id:this.config.clientId,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;if(!r.id_token)throw new Error("No ID token found. Please try again.");if((await this.verifyIdToken(r.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 k=Date.now()+(r.expires_in||3600)*1e3;return{accessToken:r.access_token,refreshToken:r.refresh_token,idToken:r.id_token,expiresAt:k}}catch(i){if(c.isAxiosError(i)&&i.response){let r=i.response.data?.error;if(r==="authorization_pending"){await this.sleep(t*1e3);continue}if(r==="slow_down"){t+=5,await this.sleep(t*1e3);continue}throw new Error(i.response.data?.error_description||"Authentication failed",{cause:i})}throw i}}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)throw new Error('No refresh token available. Please run "tigris login" to re-authenticate.');try{let n=(await c.post(`${this.baseUrl}/oauth/token`,{client_id:this.config.clientId,grant_type:"refresh_token",refresh_token:t.refreshToken,scope:"openid profile email offline_access"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data,i={accessToken:n.access_token,refreshToken:n.refresh_token||t.refreshToken,idToken:n.id_token||t.idToken,expiresAt:Date.now()+(n.expires_in||3600)*1e3};return await d(i),i}catch{throw await l(),new Error('Token refresh failed. Please run "tigris login" to re-authenticate.')}}async getIdTokenClaims(){let e=await s();if(!e||!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(e){if(e)try{let o=(await this.verifyIdToken(e))[v];if(!o)return;let n=o?.ns?.map(i=>typeof i=="object"&&i!==null?{id:i.id,name:i.name,displayName:i.name}:{id:i,name:i,displayName:i})||[];if(n.length===0)return;u(n)}catch{}}async getOrganizations(){return await this.getAccessToken(),f()}async logout(){await l()}async isAuthenticated(){return await s()!==null}sleep(e){return new Promise(t=>setTimeout(t,e))}},g=null;function P(){return g||(g=new p),g}export{_ as a,v as b,p as c,P as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(n,e,r){for(let o of e)if(n[o]!==void 0)return n[o];return r}function i(n,e="table"){return t(n,["json"])?"json":t(n,["format"],e)??e}function f(n){if(n!==void 0)return typeof n=="boolean"?n:n==="true"}export{t as a,i as b,f as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t="https://t3.storage.dev",s="https://iam.storageapi.dev",o="https://mgmt.storageapi.dev",e="https://registry.npmjs.org/@tigrisdata/cli/latest",T=
|
|
1
|
+
var t="https://t3.storage.dev",s="https://iam.storageapi.dev",o="https://mgmt.storageapi.dev",e="https://registry.npmjs.org/@tigrisdata/cli/latest",T=216e5,_=36e5;export{t as a,s as b,o as c,e as d,T as e,_ as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-ATBINUDP.js";import{loadSharedConfigFiles as S}from"@smithy/shared-ini-file-loader";import{execFileSync as v}from"child_process";import{chmodSync as I,existsSync as c,mkdirSync as A,readFileSync as _,writeFileSync as T}from"fs";import{homedir as u,platform as E}from"os";import{join as r}from"path";var s=r(u(),".tigris"),a=r(s,"config.json");function p(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e,n){if(E()==="win32")try{let t=process.env.USERNAME;t&&v("icacls",[e,"/inheritance:r","/grant:r",`${t}:F`],{stdio:"ignore"})}catch{console.warn(`Warning: Could not set restrictive permissions on ${e}. It may be accessible to other users.`)}else try{I(e,n)}catch{console.warn(`Warning: Could not set restrictive permissions on ${e}. It may be accessible to other users.`)}}function h(){c(s)||(A(s,{recursive:!0,mode:448}),y(s,448))}function K(e){let n={version:2},t=e.credentials;return p(t)&&typeof t.accessKeyId=="string"&&typeof t.secretAccessKey=="string"&&typeof t.endpoint=="string"&&(n.credentials={saved:{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:t.endpoint}}),n}function i(){if(!c(a))return{version:2};try{let e=_(a,"utf8"),n=JSON.parse(e);if(!p(n))return{version:2};if(n.version===2)return n;let t=K(n);return C(t),t}catch{return{version:2}}}function C(e){h(),T(a,JSON.stringify(e,null,2),{mode:384}),y(a,384)}async function o(e){C(e)}async function G(e){let n=i();n.oauth?n.oauth.tokens=e:n.oauth={tokens:e,organizations:[]},await o(n)}async function N(){return i().oauth?.tokens??null}async function D(){let e=i();e.oauth&&delete e.oauth.tokens,await o(e)}async function F(e){let n=i();n.oauth?n.oauth.organizations=e:n.oauth={organizations:e},await o(n)}function b(){return i().oauth?.organizations??[]}async function M(e){let n=i();if(n.activeMethod==="credentials"){let t=n.credentials?.temporary??n.credentials?.saved;t&&(t.organizationId=e)}else n.oauth||(n.oauth={organizations:[]}),n.oauth.selectedOrganization=e;await o(n)}function V(){let e=i();return e.activeMethod==="credentials"?(e.credentials?.temporary??e.credentials?.saved)?.organizationId??null:e.oauth?.selectedOrganization??null}function w(){if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID||process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let l=process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,g=process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY;if(!l||!g)return null;let m=process.env.TIGRIS_STORAGE_ENDPOINT||f;return{accessKeyId:l,secretAccessKey:g,endpoint:m}}let e=process.env.AWS_ACCESS_KEY_ID,n=process.env.AWS_SECRET_ACCESS_KEY;if(!e||!n)return null;let t=process.env.AWS_ENDPOINT_URL_S3||f;return{accessKeyId:e,secretAccessKey:n,endpoint:t}}function L(){if(!process.env.AWS_PROFILE)return!1;let e=r(u(),".aws");return c(r(e,"credentials"))||c(r(e,"config"))}async function W(e){try{let{configFile:n}=await S(),t=n[e];return t?{endpoint:t.endpoint_url_s3||t.endpoint_url,iamEndpoint:t.endpoint_url_iam,region:t.region}:{}}catch{return{}}}function Y(){let e=i();return w()||d(e.credentials?.temporary)||d(e.credentials?.saved)||null}function j(){let e=i();return d(e.credentials?.temporary)||d(e.credentials?.saved)||null}async function U(e){let n=i();n.credentials||(n.credentials={}),n.credentials.saved={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint},await o(n)}async function $(e){let n=i();n.credentials||(n.credentials={}),n.credentials.temporary={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint},await o(n)}async function J(){let e=i();e.credentials&&delete e.credentials.saved,await o(e)}async function q(e){let n=i();n.activeMethod=e,await o(n)}function B(){return i().activeMethod??null}async function H(e){let n=i(),t=n.credentials?.temporary??n.credentials?.saved;t&&(t.organizationId=e,await o(n))}async function Q(){let n=i().credentials?.saved;await o({version:2,credentials:n?{saved:n}:void 0})}function d(e){return e?{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint}:null}export{s as a,a as b,G as c,N as d,D as e,F as f,b as g,M as h,V as i,w as j,L as k,W as l,Y as m,j as n,U as o,$ as p,J as q,q as r,B as s,H as t,Q as u};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{d as m,e as d,f}from"./chunk-ATBINUDP.js";import{mkdirSync as C,readFileSync as E,writeFileSync as w}from"fs";import I from"https";import{homedir as g}from"os";import{join as h}from"path";var u="2.14.0-beta.3";var b=h(g(),".tigris","update-check.json");function y(){try{let t=E(b,"utf-8"),i=JSON.parse(t);return typeof i.latestVersion=="string"&&typeof i.lastChecked=="number"?i:null}catch{return null}}function v(t){try{C(h(g(),".tigris"),{recursive:!0}),w(b,JSON.stringify(t),"utf-8")}catch{}}function T(t,i){let a=n=>{let s=n.startsWith("v")?n.slice(1):n,c=null,o=s.indexOf("-");o!==-1&&(c=s.slice(o+1),s=s.slice(0,o));let l=s.split(".");if(l.length!==3)return null;let p=l.map(Number);return p.some(isNaN)?null:{major:p[0],minor:p[1],patch:p[2],prerelease:c}},r=a(t),e=a(i);return!r||!e?!1:e.major>r.major?!0:e.major<r.major?!1:e.minor>r.minor?!0:e.minor<r.minor?!1:e.patch>r.patch?!0:e.patch<r.patch?!1:r.prerelease&&!e.prerelease?!0:(!r.prerelease&&e.prerelease,!1)}function D(){let t=globalThis.__TIGRIS_BINARY===!0,i=process.platform==="win32";return t?i?"irm https://raw.githubusercontent.com/tigrisdata/cli/main/scripts/install.ps1 | iex":"curl -fsSL https://raw.githubusercontent.com/tigrisdata/cli/main/scripts/install.sh | sh":"npm install -g @tigrisdata/cli"}function N(t={}){return new Promise((i,a)=>{let r=I.get(m,{timeout:1e4},e=>{let n="";e.on("data",s=>{n+=s}),e.on("end",()=>{try{let s=JSON.parse(n);typeof s.version=="string"?(v({...y(),latestVersion:s.version,lastChecked:Date.now()}),i(s.version)):a(new Error("Unexpected registry response"))}catch{a(new Error("Failed to parse registry response"))}})});r.on("error",e=>{a(e)}),r.on("timeout",()=>{r.destroy(),a(new Error("Request timed out"))}),t.unref&&r.on("socket",e=>{e.unref()}),r.end()})}function x(){N({unref:!0}).catch(()=>{})}function L(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let t=y(),i=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(t&&T(u,t.latestVersion)&&(!t.lastNotified||Date.now()-t.lastNotified>i)){let r=`Update available: ${u} \u2192 ${t.latestVersion}`,e='Run "tigris update" to upgrade.',n=Math.max(r.length,e.length)+4,s="\u250C"+"\u2500".repeat(n-2)+"\u2510",c="\u2514"+"\u2500".repeat(n-2)+"\u2518",o=l=>"\u2502 "+l.padEnd(n-4)+" \u2502";console.log(`
|
|
2
|
+
${s}
|
|
3
|
+
${o("")}
|
|
4
|
+
${o(r)}
|
|
5
|
+
${o(e)}
|
|
6
|
+
${o("")}
|
|
7
|
+
${c}
|
|
8
|
+
`),v({...t,lastNotified:Date.now()})}let a=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!t||Date.now()-t.lastChecked>a)&&x()}export{u as a,y as b,T as c,D as d,N as e,L as f};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as m,d as y}from"./chunk-7J6WK54T.js";import{i as a,j as u,k as p,l as T,m as A,n as g,s as f}from"./chunk-CLO5HM7B.js";import{a as c,b as d,c as l}from"./chunk-ATBINUDP.js";import{fromIni as P}from"@aws-sdk/credential-providers";function _(){return process.env.TIGRIS_STORAGE_ENDPOINT||process.env.TIGRIS_IAM_ENDPOINT?{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||c,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||d,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||l}:{endpoint:process.env.AWS_ENDPOINT_URL_S3||c,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||d,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||l}}var o=_(),w=m(),E=!1;async function K(){if(E||!process.stdin.isTTY)return!1;E=!0,console.log(`Not authenticated. Starting login...
|
|
2
|
+
`);let{default:n}=await import("./lib/login/select.js");return await n({}),console.log(),!0}async function h(){return f()}async function N(n){if(p()){let e=process.env.AWS_PROFILE||"default",t=await T(e),I=await P({profile:e})();return{accessKeyId:I.accessKeyId,secretAccessKey:I.secretAccessKey,endpoint:t.endpoint||o.endpoint||c,iamEndpoint:t.iamEndpoint||o.iamEndpoint}}let i=await h();if(i==="oauth"){let e=y(),t=a();if(!t)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await e.getAccessToken(),accessKeyId:"",secretAccessKey:"",...n?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await e.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:o.endpoint,organizationId:t,iamEndpoint:o.iamEndpoint,authDomain:w.domain}}if(i==="credentials"){let e=g();if(e){let t=a();return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint,organizationId:t??void 0,iamEndpoint:o.iamEndpoint}}}let s=u();if(s)return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:s.endpoint};let r=g();if(r)return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,endpoint:r.endpoint};if(await K())return N(n);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}async function v(){return p()||await h()!==null||u()!==null||g()!==null}async function M(){let n=await N(),i=a();return{...n,...i&&!n.organizationId?{organizationId:i}:{}}}function L(n){return f()==="oauth"?!1:(A()?console.log(`You are using access key credentials, which belong to a single organization.
|
|
3
|
+
${n} is only available with OAuth login.
|
|
4
|
+
|
|
5
|
+
Run "tigris login" to login with your Tigris account.`):console.log('Not authenticated. Please run "tigris login" to login with your Tigris account.'),!0)}export{_ as a,h as b,N as c,v as d,M as e,L as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{list as g}from"@tigrisdata/storage";var
|
|
1
|
+
import{list as g}from"@tigrisdata/storage";var p=["t3://","tigris://"];function f(t){return p.some(e=>t.startsWith(e))}function c(t){let e=p.find(r=>t.startsWith(r));return s(t.slice(e.length))}function s(t){let e=t.split("/");return{bucket:e[0],path:e.slice(1).join("/")}}async function m(t,e,r){let{data:i}=await g({prefix:`${e}/`,limit:1,config:{...r,bucket:t}});return!!(i?.items&&i.items.length>0)}function d(t,e){return{source:s(t),destination:s(e)}}function l(t){return f(t)?c(t):s(t)}function P(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):""}async function h(t,e,r){let i=[],o;do{let{data:n,error:a}=await g({prefix:e,paginationToken:o,config:{...r,bucket:t}});if(a)return{items:i,error:a};n?.items&&i.push(...n.items),o=n?.hasMore?n.paginationToken:void 0}while(o);return{items:i}}export{f as a,c as b,s as c,m as d,d as e,l as f,P as g,x as h,h as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as p}from"fs";import{
|
|
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||!t.arguments?null: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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,
|
|
1
|
+
import{a as s,f as l}from"./chunk-DZUJWPQ3.js";import{a as i,k as m}from"./chunk-4R4YLHT7.js";import{b as t}from"./chunk-PPNBQWSR.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=a(d,"lib",...o)+".js";if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as g,b as c}from"./chunk-EULV7RV7.js";import{b as n}from"./chunk-3FMWZQ3C.js";import{a as f}from"./chunk-52HSMT5H.js";import{d as r}from"./chunk-7J6WK54T.js";import{i as a,m as d}from"./chunk-CLO5HM7B.js";function C(){let t=a();return f(t??void 0)?(console.log(`User management is not available for Fly.io organizations.
|
|
2
|
+
Your users are managed through Fly.io.
|
|
3
|
+
|
|
4
|
+
Visit https://fly.io to manage your organization members.`),!0):!1}async function M(t){await c()!=="oauth"&&n(t,`This operation requires OAuth login.
|
|
5
|
+
Run "tigris login oauth" first.`);let i=r();await i.isAuthenticated()||n(t,'Not authenticated. Run "tigris login oauth" first.');let o=await i.getAccessToken(),e=a(),{iamEndpoint:s,mgmtEndpoint:l}=g();return{sessionToken:o,organizationId:e??void 0,iamEndpoint:s,mgmtEndpoint:l}}async function z(t){let u=await c(),i=g(),o=a();if(u==="oauth"){let s=r();return await s.isAuthenticated()||n(t,'Not authenticated. Run "tigris login oauth" first.'),{sessionToken:await s.getAccessToken(),organizationId:o??void 0,iamEndpoint:i.iamEndpoint}}let e=d();return e||n(t,'Not authenticated. Run "tigris login" or "tigris configure" first.'),{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,organizationId:o??void 0,iamEndpoint:i.iamEndpoint}}export{C as a,M as b,z as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-S77OAN6Y.js";import{a as S}from"./chunk-EULV7RV7.js";import{b as K}from"./chunk-AHGPPFCQ.js";import{b as d,d as m}from"./chunk-3FMWZQ3C.js";import{b as i,c as n,i as o}from"./chunk-5VDFQRGP.js";import{n as f,p as y,r as p,t as u}from"./chunk-CLO5HM7B.js";import{a as g}from"./chunk-ATBINUDP.js";import C from"enquirer";import{whoami as h}from"@tigrisdata/iam";var{prompt:I}=C,a=o("login","credentials");async function k(e){i(a);let w=K(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 c=[];s||c.push({type:"input",name:"accessKey",message:"Access Key ID:",required:!0}),r||c.push({type:"password",name:"accessSecret",message:"Secret Access Key:",required:!0}),l("Provide --access-key and --access-secret");let t=await I(c);s=s||t.accessKey,r=r||t.accessSecret}(!s||!r)&&d(a,"Access key and secret are required");let A=f()?.endpoint||g;await y({accessKeyId:s,secretAccessKey:r,endpoint:A}),await p("credentials");try{let c=S(),{data:t}=await h({config:{accessKeyId:s,secretAccessKey:r,iamEndpoint:c.iamEndpoint}});t?.organizationId&&await u(t.organizationId)}catch{}w==="json"&&console.log(JSON.stringify({action:"logged_in"})),n(a),m(a)}export{k as a};
|
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-4R4YLHT7.js";import"./chunk-3FMWZQ3C.js";import"./chunk-DV3LCXRH.js";import"./chunk-5VDFQRGP.js";import"./chunk-PPNBQWSR.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-RG5EZWTN.js";import"./chunk-DZUJWPQ3.js";import"./chunk-4R4YLHT7.js";import"./chunk-3FMWZQ3C.js";import"./chunk-DV3LCXRH.js";import"./chunk-5VDFQRGP.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-ATBINUDP.js";export{b as DEFAULT_IAM_ENDPOINT,c as DEFAULT_MGMT_ENDPOINT,a as DEFAULT_STORAGE_ENDPOINT,d as NPM_REGISTRY_URL,e as UPDATE_CHECK_INTERVAL_MS,f as UPDATE_NOTIFY_INTERVAL_MS};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-RG5EZWTN.js";import"./chunk-DZUJWPQ3.js";import"./chunk-4R4YLHT7.js";import"./chunk-3FMWZQ3C.js";import"./chunk-DV3LCXRH.js";import"./chunk-5VDFQRGP.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Run "tigris login oauth" first.`),i(`Bucket roles can only be managed when logged in via OAuth.
|
|
3
|
-
Run "tigris login oauth" first.`,e));let A=O();await A.isAuthenticated()||(n(e,'Not authenticated. Run "tigris login oauth" first.'),i('Not authenticated. Run "tigris login oauth" first.',e));let $=await A.getAccessToken(),x=w(),q=N(),b={sessionToken:$,organizationId:x??void 0,iamEndpoint:q.iamEndpoint};if(k){let{error:o}=await S(l,{config:b});o&&(n(e,o.message),i(o,e)),f==="json"&&console.log(JSON.stringify({action:"revoked",id:l})),d(e);return}let c;if(h)c=[{bucket:"*",role:"NamespaceAdmin"}];else{a.length===0&&(n(e,"At least one bucket name is required (or use --admin or --revoke-roles)"),i("At least one bucket name is required (or use --admin or --revoke-roles)",e)),r.length===0&&(n(e,"At least one role is required (or use --admin or --revoke-roles)"),i("At least one role is required (or use --admin or --revoke-roles)",e));for(let o of r)m.includes(o)||(n(e,`Invalid role "${o}". Valid roles are: ${m.join(", ")}`),i(`Invalid role "${o}". Valid roles are: ${m.join(", ")}`,e));r.length===1?c=a.map(o=>({bucket:o,role:r[0]})):r.length===a.length?c=a.map((o,g)=>({bucket:o,role:r[g]})):(n(e,`Number of roles (${r.length}) must be 1 or match number of buckets (${a.length})`),i(`Number of roles (${r.length}) must be 1 or match number of buckets (${a.length})`,e))}let{error:u}=await C(l,c,{config:b});if(u&&(n(e,u.message),i(u,e)),f==="json"){let o=y(e),g={action:"assigned",id:l,assignments:c};o.length>0&&(g.nextActions=o),console.log(JSON.stringify(g))}d(e),v(e)}export{E as default};
|
|
1
|
+
import{c as y}from"../../chunk-RTJM32XN.js";import"../../chunk-EULV7RV7.js";import{a as s,b as h}from"../../chunk-AHGPPFCQ.js";import{b as n,c as b,d as p}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as A,c as f,i as R}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-52HSMT5H.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.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,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Run "tigris login oauth" first.`),o(`Access keys can only be created when logged in via OAuth.
|
|
3
|
-
Run "tigris login oauth" first.`,e));let a=y();await a.isAuthenticated()||(n(e,'Not authenticated. Run "tigris login oauth" first.'),o('Not authenticated. Run "tigris login oauth" first.',e));let x=await a.getAccessToken(),S=p(),N=A(),{data:t,error:c}=await O(r,{config:{sessionToken:x,organizationId:S??void 0,iamEndpoint:N.iamEndpoint}});if(c&&(n(e,c.message),o(c,e)),w==="json"){let g=f(e,{name:t.name,id:t.id}),l={action:"created",name:t.name,id:t.id,secret:t.secret};g.length>0&&(l.nextActions=g),console.log(JSON.stringify(l))}else console.log(` Name: ${t.name}`),console.log(` Access Key ID: ${t.id}`),console.log(` Secret Access Key: ${t.secret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");m(e),h(e,{name:t.name,id:t.id})}export{R as default};
|
|
1
|
+
import{c as u}from"../../chunk-RTJM32XN.js";import"../../chunk-EULV7RV7.js";import{a as d,b as p}from"../../chunk-AHGPPFCQ.js";import{b as o,c as g,d as f}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as a,c as m,i as l}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-52HSMT5H.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.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,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Run "tigris login oauth" first.`),i(`Access keys can only be deleted when logged in via OAuth.
|
|
3
|
-
Run "tigris login oauth" first.`,t));let c=l();if(await c.isAuthenticated()||(e(t,'Not authenticated. Run "tigris login oauth" first.'),i('Not authenticated. Run "tigris login oauth" first.',t)),!A&&(u("Use --yes to skip confirmation"),!await h(`Delete access key '${s}'?`))){console.log("Aborted");return}let k=await c.getAccessToken(),w=m(),b=d(),{error:r}=await O(s,{config:{sessionToken:k,organizationId:w??void 0,iamEndpoint:b.iamEndpoint}});r&&(e(t,r.message),i(r,t)),y==="json"&&console.log(JSON.stringify({action:"deleted",id:s})),g(t)}export{j as default};
|
|
1
|
+
import{c as g}from"../../chunk-RTJM32XN.js";import{a as m,b as a}from"../../chunk-S77OAN6Y.js";import"../../chunk-EULV7RV7.js";import{a as i,b as d}from"../../chunk-AHGPPFCQ.js";import{b as t}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as n,c as s,i as f}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-52HSMT5H.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.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,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Run "tigris login oauth" first.`),i(`Access keys can only be retrieved when logged in via OAuth.
|
|
3
|
-
Run "tigris login oauth" first.`,o));let a=h();await a.isAuthenticated()||(e(o,'Not authenticated. Run "tigris login oauth" first.'),i('Not authenticated. Run "tigris login oauth" first.',o));let k=await a.getAccessToken(),y=m(),w=u(),{data:t,error:r}=await O(c,{config:{sessionToken:k,organizationId:y??void 0,iamEndpoint:w.iamEndpoint}});if(r&&(e(o,r.message),i(r,o)),A==="json")console.log(JSON.stringify(t));else if(console.log(` Name: ${t.name}`),console.log(` ID: ${t.id}`),console.log(` Status: ${t.status}`),console.log(` Created: ${t.createdAt}`),console.log(` Organization: ${t.organizationId}`),t.roles&&t.roles.length>0){console.log(" Roles:");for(let g of t.roles)console.log(` - ${g.bucket}: ${g.role}`)}else console.log(" Roles: None");d(o)}export{R as default};
|
|
1
|
+
import{c as m}from"../../chunk-RTJM32XN.js";import"../../chunk-EULV7RV7.js";import{a,b as f}from"../../chunk-AHGPPFCQ.js";import{b as t}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as c,c as l,i as g}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-52HSMT5H.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.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,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Run "tigris login oauth" first.`),n(`Access keys can only be listed when logged in via OAuth.
|
|
3
|
-
Run "tigris login oauth" first.`,t));let c=p();await c.isAuthenticated()||(i(t,'Not authenticated. Run "tigris login oauth" first.'),n('Not authenticated. Run "tigris login oauth" first.',t));let w=await c.getAccessToken(),O=h(),C=l(),{data:o,error:s}=await b({config:{sessionToken:w,organizationId:O??void 0,iamEndpoint:C.iamEndpoint}});if(s&&(i(t,s.message),n(s,t)),!o.accessKeys||o.accessKeys.length===0){m(t);return}let g=o.accessKeys.map(e=>({name:e.name,id:e.id,status:e.status,created:e.createdAt})),R=k(g,A,"keys","key",[{key:"name",header:"Name"},{key:"id",header:"ID"},{key:"status",header:"Status"},{key:"created",header:"Created"}]);console.log(R),d(t,{count:g.length})}export{j as default};
|
|
1
|
+
import{c as d}from"../../chunk-RTJM32XN.js";import{f as p}from"../../chunk-CQCBYE3X.js";import"../../chunk-EULV7RV7.js";import{b as f}from"../../chunk-AHGPPFCQ.js";import{b as m}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as a,c,e as n,i}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-52HSMT5H.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{listAccessKeys as h}from"@tigrisdata/iam";var t=i("access-keys","list");async function k(u){a(t);let y=f(u),g=await d(t),{data:s,error:r}=await h({config:g});if(r&&m(t,r),!s.accessKeys||s.accessKeys.length===0){n(t);return}let o=s.accessKeys.map(e=>({name:e.name,id:e.id,status:e.status,created:e.createdAt})),l=p(o,y,"keys","key",[{key:"name",header:"Name"},{key:"id",header:"ID"},{key:"status",header:"Status"},{key:"created",header:"Created"}]);console.log(l),c(t,{count:o.length})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as R,b as O}from"../../chunk-TD2HGNDY.js";import{a as q}from"../../chunk-S77OAN6Y.js";import{c as N}from"../../chunk-EULV7RV7.js";import{a as t,b as D}from"../../chunk-AHGPPFCQ.js";import{b as r,c as T,d as L}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as x,c as C,i as B}from"../../chunk-5VDFQRGP.js";import{d as p,e as g}from"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{createBucket as E}from"@tigrisdata/storage";import j from"enquirer";var{prompt:F}=j,n=B("buckets","create");async function J(e){x(n);let P=D(e),s=t(e,["name"]),b=t(e,["public"])?"public":t(e,["access","a","A"]),h=t(e,["enable-snapshots","s","S"]),S=t(e,["default-tier","t","T"]),l=t(e,["locations","l","L"]),a=t(e,["fork-of","forkOf","fork"]),f=t(e,["source-snapshot","sourceSnapshot","source-snap"]),k=t(e,["region","r","R"]),I=t(e,["consistency","c","C"]);k!==void 0&&(console.warn("Warning: --region is deprecated, use --locations instead. See https://www.tigrisdata.com/docs/buckets/locations/"),l===void 0&&(l=k)),I!==void 0&&console.warn("Warning: --consistency is deprecated, use --locations instead. See https://www.tigrisdata.com/docs/buckets/locations/");let W=!s,w;if(W){q("Provide --name to skip interactive mode");let c=p("buckets","access","create"),o=g(c),d=o?.findIndex(i=>i.value===c?.default),v=p("buckets","default-tier","create"),A=g(v),m=A?.findIndex(i=>i.value===v?.default),u=await F([{type:"input",name:"name",message:"Bucket name:",required:!0},{type:"select",name:"access",message:"Access level:",choices:o||[],initial:d!==void 0&&d>=0?d: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=u.name,b=u.access,S=u.defaultTier,h=u.enableSnapshots;try{w=await R()}catch(i){r(n,i)}}s||r(n,"Bucket name is required"),f&&!a&&r(n,"--source-snapshot requires --fork-of");let{error:y}=await E(s,{defaultTier:S??"STANDARD",enableSnapshot:h===!0,access:b??"private",locations:w??O(l??"global"),...a?{sourceBucketName:a}:{},...f?{sourceBucketSnapshot:f}:{},config:await N()});if(y&&r(n,y),P==="json"){let c=T(n,{name:s}),o={action:"created",name:s,...a?{forkOf:a}:{}};c.length>0&&(o.nextActions=c),console.log(JSON.stringify(o))}C(n,{name:s}),L(n,{name:s})}export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h,b as x}from"../../chunk-S77OAN6Y.js";import{c as A}from"../../chunk-EULV7RV7.js";import{a as s,b as y}from"../../chunk-AHGPPFCQ.js";import{a as l,b as p,c as d,d as k}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as f,d as g,i as u}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{removeBucket as N}from"@tigrisdata/storage";var e=u("buckets","delete");async function B(i){m(e);let b=y(i),o=s(i,["name"]),w=s(i,["yes","y","force"]);o||p(e,"Bucket name is required");let c=Array.isArray(o)?o:[o],S=await A();if(!w&&(h("Use --yes to skip confirmation"),!await x(`Delete ${c.length} bucket(s)?`))){console.log("Aborted");return}let a=[],n=[];for(let t of c){let{error:r}=await N(t,{config:S});r?(g(e,r.message,{name:t}),n.push({name:t,error:r.message})):(a.push(t),f(e,{name:t}))}if(b==="json"){let t=d(e),r={action:"deleted",names:a,errors:n};t.length>0&&(r.nextActions=t),console.log(JSON.stringify(r))}n.length>0&&l(n[0].error,e),k(e)}export{B as default};
|
package/dist/lib/buckets/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as s}from"../../chunk-WIOXQDND.js";import{f as u}from"../../chunk-CQCBYE3X.js";import{c as f}from"../../chunk-EULV7RV7.js";import{a as p,b as c}from"../../chunk-AHGPPFCQ.js";import{b as o}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as a,c as i,i as m}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.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};
|
package/dist/lib/buckets/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as
|
|
1
|
+
import{f as u}from"../../chunk-CQCBYE3X.js";import{c as w}from"../../chunk-EULV7RV7.js";import{a as b,b as y}from"../../chunk-AHGPPFCQ.js";import{b as f}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as l,c as i,e as c,i as h}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{getBucketInfo as O,listBuckets as E}from"@tigrisdata/storage";var t=h("buckets","list");async function N(m){l(t);let k=y(m),e=b(m,["forks-of","forksOf"]),s=await w(),{data:r,error:g}=await E({config:s});if(g&&f(t,g),!r.buckets||r.buckets.length===0){c(t);return}if(e){let{data:o,error:p}=await O(e,{config:s});if(p&&f(t,p),!o.hasForks){c(t);return}let n=[];for(let a of r.buckets){if(a.name===e)continue;let{data:D}=await O(a.name,{config:s});D?.sourceBucketName===e&&n.push({name:a.name,created:a.creationDate})}if(n.length===0){c(t);return}let C=u(n,k,"forks","fork",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(C),i(t,{count:n.length});return}let d=r.buckets.map(o=>({name:o.name,created:o.creationDate})),B=u(d,k,"buckets","bucket",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(B),i(t,{count:d.length})}export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as b}from"../../chunk-EULV7RV7.js";import{a as r,b as x}from"../../chunk-AHGPPFCQ.js";import{b as i}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as c,c as l,i as h}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{setBucketCors as N}from"@tigrisdata/storage";var n=h("buckets","set-cors");async function k(e){c(n);let p=x(e),o=r(e,["name"]),s=r(e,["origins"]),d=r(e,["methods"]),a=r(e,["headers"]),f=r(e,["expose-headers","exposeHeaders"]),t=r(e,["max-age","maxAge"]),g=r(e,["override"]),m=r(e,["reset"]);o||i(n,"Bucket name is required"),m&&(s!==void 0||d!==void 0||a!==void 0||f!==void 0||t!==void 0||g)&&i(n,"Cannot use --reset with other options"),!m&&!s&&i(n,"Provide --origins or --reset"),t!==void 0&&(isNaN(Number(t))||Number(t)<=0)&&i(n,"--max-age must be a positive number");let w=await b(),{error:u}=await N(o,{rules:m?[]:[{allowedOrigins:s,...d!==void 0?{allowedMethods:d}:{},...a!==void 0?{allowedHeaders:a}:{},...f!==void 0?{exposeHeaders:f}:{},maxAge:t!==void 0?Number(t):3600}],override:g??!1,config:w});u&&i(n,u),p==="json"&&console.log(JSON.stringify({action:"updated",bucket:o})),l(n,{name:o})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as l,b as d}from"../../chunk-TD2HGNDY.js";import{a as g}from"../../chunk-S77OAN6Y.js";import{e as u}from"../../chunk-EULV7RV7.js";import{a as e,b as p}from"../../chunk-AHGPPFCQ.js";import{b as i}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as s,c as f,i as m}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{updateBucket as y}from"@tigrisdata/storage";var t=m("buckets","set-locations");async function B(r){s(t);let k=p(r),o=e(r,["name"]),a=e(r,["locations"]);o||i(t,"Bucket name is required");let n;if(a!==void 0)n=d(a);else{g("Provide --locations flag");try{n=await l()}catch(w){i(t,w)}}let L=await u(),{error:c}=await y(o,{locations:n,config:L});c&&i(t,c),k==="json"&&console.log(JSON.stringify({action:"updated",bucket:o})),f(t,{name:o})}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as p}from"../../chunk-EULV7RV7.js";import{a as t,b as w}from"../../chunk-AHGPPFCQ.js";import{b as r}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as h,c as f,i as y}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{setBucketMigration as S}from"@tigrisdata/storage";var n=y("buckets","set-migration");async function K(e){h(n);let d=w(e),i=t(e,["name"]),o=t(e,["bucket"]),a=t(e,["endpoint"]),s=t(e,["region"]),c=t(e,["access-key","accessKey"]),g=t(e,["secret-key","secretKey"]),u=t(e,["write-through","writeThrough"]),m=t(e,["disable"]);i||r(n,"Bucket name is required"),m&&(o!==void 0||a!==void 0||s!==void 0||c!==void 0||g!==void 0||u!==void 0)&&r(n,"Cannot use --disable with other migration options");let l=await p();if(m){let{error:k}=await S(i,{dataMigration:{enabled:!1},config:l});k&&r(n,k),d==="json"&&console.log(JSON.stringify({action:"updated",bucket:i})),f(n,{name:i});return}(!o||!a||!s||!c||!g)&&r(n,"Required: --bucket, --endpoint, --region, --access-key, --secret-key");let{error:b}=await S(i,{dataMigration:{enabled:!0,accessKey:c,secretKey:g,region:s,name:o,endpoint:a,writeThrough:u??!1},config:l});b&&r(n,b),d==="json"&&console.log(JSON.stringify({action:"updated",bucket:i})),f(n,{name:i})}export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as p}from"../../chunk-EULV7RV7.js";import{a as n,b as w}from"../../chunk-AHGPPFCQ.js";import{b as i}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b,c as h,i as k}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{setBucketNotifications as N}from"@tigrisdata/storage";var t=k("buckets","set-notifications");async function y(e){b(t);let C=w(e),d=n(e,["name"]),s=n(e,["url"]),u=n(e,["filter"]),a=n(e,["token"]),o=n(e,["username"]),r=n(e,["password"]),l=n(e,["enable"]),g=n(e,["disable"]),c=n(e,["reset"]);d||i(t,"Bucket name is required"),[l,g,c].filter(Boolean).length>1&&i(t,"Only one of --enable, --disable, or --reset can be used"),c&&(s!==void 0||u!==void 0||a!==void 0||o!==void 0||r!==void 0)&&i(t,"Cannot use --reset with other options"),!l&&!g&&!c&&s===void 0&&u===void 0&&a===void 0&&o===void 0&&r===void 0&&i(t,"Provide at least one option"),a&&(o!==void 0||r!==void 0)&&i(t,"Cannot use --token with --username/--password. Choose one auth method"),(o!==void 0&&r===void 0||o===void 0&&r!==void 0)&&i(t,"Both --username and --password are required");let B=await p(),f;c?f={}:(f={...l?{enabled:!0}:{},...g?{enabled:!1}:{},...s!==void 0?{url:s}:{},...u!==void 0?{filter:u}:{}},a?f={...f,auth:{token:a}}:o&&r&&(f={...f,auth:{username:o,password:r}}));let{error:m}=await N(d,{notificationConfig:f,config:B});m&&i(t,m),C==="json"&&console.log(JSON.stringify({action:"updated",bucket:d})),h(t,{name:d})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as b}from"../../chunk-EULV7RV7.js";import{a as i,b as m}from"../../chunk-AHGPPFCQ.js";import{b as t}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as l,c as u,i as g}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{setBucketLifecycle as S}from"@tigrisdata/storage";var e=g("buckets","set-transition"),y=["STANDARD_IA","GLACIER","GLACIER_IR"];async function A(a){l(e);let N=m(a),d=i(a,["name"]),r=i(a,["storage-class","storageClass"]),s=i(a,["days"]),n=i(a,["date"]),f=i(a,["enable"]),o=i(a,["disable"]);d||t(e,"Bucket name is required"),f&&o&&t(e,"Cannot use both --enable and --disable"),o&&(s!==void 0||n!==void 0||r!==void 0)&&t(e,"Cannot use --disable with --days, --date, or --storage-class"),!f&&!o&&s===void 0&&n===void 0&&t(e,"Provide --days, --date, --enable, or --disable"),(s!==void 0||n!==void 0)&&!r&&t(e,"--storage-class is required when setting --days or --date"),r&&!y.includes(r)&&t(e,`--storage-class must be one of: ${y.join(", ")} (STANDARD is not a valid transition target)`),s!==void 0&&(isNaN(Number(s))||Number(s)<=0)&&t(e,"--days must be a positive number"),n!==void 0&&(typeof n!="string"||!/^\d{4}-\d{2}-\d{2}/.test(n)||isNaN(new Date(n).getTime()))&&t(e,"--date must be a valid ISO-8601 date (e.g. 2026-06-01)");let C=await b(),R={...f?{enabled:!0}:{},...o?{enabled:!1}:{},...r?{storageClass:r}:{},...s!==void 0?{days:Number(s)}:{},...n!==void 0?{date:n}:{}},{error:c}=await S(d,{lifecycleRules:[R],config:C});c&&t(e,c),N==="json"&&console.log(JSON.stringify({action:"updated",bucket:d})),u(e,{name:d})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as b}from"../../chunk-EULV7RV7.js";import{a as d,b as m}from"../../chunk-AHGPPFCQ.js";import{b as n}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as u,c as l,i as c}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{setBucketTtl as p}from"@tigrisdata/storage";var e=c("buckets","set-ttl");async function k(a){u(e);let g=m(a),o=d(a,["name"]),i=d(a,["days"]),t=d(a,["date"]),r=d(a,["enable"]),s=d(a,["disable"]);o||n(e,"Bucket name is required"),r&&s&&n(e,"Cannot use both --enable and --disable"),s&&(i!==void 0||t!==void 0)&&n(e,"Cannot use --disable with --days or --date"),!r&&!s&&i===void 0&&t===void 0&&n(e,"Provide --days, --date, --enable, or --disable"),i!==void 0&&(isNaN(Number(i))||Number(i)<=0)&&n(e,"--days must be a positive number"),t!==void 0&&(typeof t!="string"||!/^\d{4}-\d{2}-\d{2}/.test(t)||isNaN(new Date(t).getTime()))&&n(e,"--date must be a valid ISO-8601 date (e.g. 2026-06-01)");let y=await b(),N={...r?{enabled:!0}:{},...s?{enabled:!1}:{},...i!==void 0?{days:Number(i)}:{},...t!==void 0?{date:t}:{}},{error:f}=await p(o,{ttlConfig:N,config:y});f&&n(e,f),g==="json"&&console.log(JSON.stringify({action:"updated",bucket:o})),l(e,{name:o})}export{k as default};
|
package/dist/lib/buckets/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as y}from"../../chunk-TD2HGNDY.js";import"../../chunk-S77OAN6Y.js";import{e as k}from"../../chunk-EULV7RV7.js";import{a as n,b as h,c as o}from"../../chunk-AHGPPFCQ.js";import{b as r}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as w,c as D,i as O}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import"../../chunk-CLO5HM7B.js";import"../../chunk-ATBINUDP.js";import{updateBucket as B}from"@tigrisdata/storage";var a=O("buckets","set");async function C(e){w(a);let A=h(e),c=n(e,["name"]),s=n(e,["access"]),i=n(e,["locations"]),b=n(e,["region"]);b!==void 0&&(console.warn("Warning: --region is deprecated, use --locations instead. See https://www.tigrisdata.com/docs/buckets/locations/"),i===void 0&&(i=b));let d=n(e,["allow-object-acl","allowObjectAcl"]),l=n(e,["disable-directory-listing","disableDirectoryListing"]),f=n(e,["cache-control","cacheControl"]),u=n(e,["custom-domain","customDomain"]),g=n(e,["enable-delete-protection","enableDeleteProtection"]),m=n(e,["enable-additional-headers","enableAdditionalHeaders"]);c||r(a,"Bucket name is required"),s===void 0&&i===void 0&&d===void 0&&l===void 0&&f===void 0&&u===void 0&&g===void 0&&m===void 0&&r(a,"At least one setting is required");let t={};s!==void 0&&(t.access=s),i!==void 0&&(t.locations=y(i)),d!==void 0&&(t.allowObjectAcl=o(d)),l!==void 0&&(t.disableDirectoryListing=o(l)),f!==void 0&&(t.cacheControl=f),u!==void 0&&(t.customDomain=u),g!==void 0&&(t.enableDeleteProtection=o(g)),m!==void 0&&(t.enableAdditionalHeaders=o(m));let j=await k(),{error:p}=await B(c,{...t,config:j});p&&r(a,p),A==="json"&&console.log(JSON.stringify({action:"updated",name:c})),D(a,{name:c})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as S}from"../../chunk-S77OAN6Y.js";import{a as h}from"../../chunk-EULV7RV7.js";import{b as E}from"../../chunk-AHGPPFCQ.js";import{a as m,b as f,d as p}from"../../chunk-3FMWZQ3C.js";import"../../chunk-DV3LCXRH.js";import{b as n,c as o,d,i as g}from"../../chunk-5VDFQRGP.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-7J6WK54T.js";import{o as y,r as l,t as K}from"../../chunk-CLO5HM7B.js";import{a as u}from"../../chunk-ATBINUDP.js";import A from"enquirer";import{whoami as I}from"@tigrisdata/iam";var{prompt:q}=A,a=g("configure");async function T(e){n(a);let w=E(e),t=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,s=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret,i=e.endpoint||e.e||e.E||e.Endpoint;if(!t||!s||!i){let r=[];t||r.push({type:"input",name:"accessKey",message:"Tigris Access Key ID:",required:!0}),s||r.push({type:"password",name:"accessSecret",message:"Tigris Secret Access Key:",required:!0}),i||r.push({type:"input",name:"endpoint",message:"Tigris Endpoint:",required:!0,initial:u}),S("Provide --access-key, --access-secret, and --endpoint");let c=await q(r);t=t||c.accessKey,s=s||c.accessSecret,i=i||c.endpoint}(!t||!s||!i)&&f(a,"All credentials are required");try{await y({accessKeyId:t,secretAccessKey:s,endpoint:i}),await l("credentials");try{let r=h(),{data:c}=await I({config:{accessKeyId:t,secretAccessKey:s,iamEndpoint:r.iamEndpoint}});c?.organizationId&&await K(c.organizationId)}catch{}w==="json"&&console.log(JSON.stringify({action:"configured"})),o(a),p(a)}catch(r){d(a,"Failed to save credentials"),m(r,a)}}export{T as default};
|
package/dist/lib/cp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as C}from"../chunk-SAAGVLRE.js";import{a as B}from"../chunk-EKW6XTGL.js";import{a as w}from"../chunk-CQCBYE3X.js";import{a as U,b as T,d as D,g as O,h as J,i as j}from"../chunk-NDNMIXDC.js";import{c as G}from"../chunk-EULV7RV7.js";import{a as x,b as q}from"../chunk-AHGPPFCQ.js";import{a as f}from"../chunk-3FMWZQ3C.js";import"../chunk-DV3LCXRH.js";import"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";import"../chunk-7J6WK54T.js";import"../chunk-CLO5HM7B.js";import"../chunk-ATBINUDP.js";import{get as V,head as X,list as tt,put as E}from"@tigrisdata/storage";import{createReadStream as et,createWriteStream as ot,existsSync as Y,mkdirSync as it,readdirSync as z,statSync as L}from"fs";import{homedir as nt}from"os";import{basename as M,dirname as K,join as N,relative as _,resolve as H}from"path";import{Readable as Z}from"stream";import{pipeline as rt}from"stream/promises";var h=!1;function at(n,t){let e=U(n),l=U(t);return!e&&!l&&f("At least one path must be a remote Tigris path (t3:// or tigris://)"),e&&l?"remote-to-remote":e?"remote-to-local":"local-to-remote"}function P(n){return n==="~"||n.startsWith("~/")?H(nt(),n.slice(2)):H(n)}function lt(n){return z(n,{recursive:!0,withFileTypes:!0}).filter(e=>e.isFile()).map(e=>{let l=e.parentPath??e.path;return N(l,e.name)})}function ct(n,t){let e=K(n),l=M(n),s=O(l);return Y(e)?t?z(e,{recursive:!0,withFileTypes:!0}).filter(r=>r.isFile()&&s.test(r.name)).map(r=>{let o=r.parentPath??r.path;return N(o,r.name)}):z(e,{withFileTypes:!0}).filter(o=>o.isFile()&&s.test(o.name)).map(o=>N(e,o.name)):[]}async function I(n,t,e,l,s=!1){let p;try{p=L(n).size}catch{return{error:`File not found: ${n}`}}let r=et(n),o=Z.toWeb(r),{error:i}=await E(e,o,{...B(p),onUploadProgress:s?({loaded:a})=>{if(p!==void 0&&p>0){let c=Math.round(a/p*100);process.stdout.write(`\rUploading: ${w(a)} / ${w(p)} (${c}%)`)}else process.stdout.write(`\rUploading: ${w(a)}`)}:void 0,config:{...l,bucket:t}});return s&&process.stdout.write("\r"+" ".repeat(60)+"\r"),i?{error:i.message}:{}}async function Q(n,t,e,l,s=!1){let p;if(s){let{data:u}=await X(t,{config:{...l,bucket:n}});p=u?.size}let{data:r,error:o}=await V(t,"stream",{config:{...l,bucket:n}});if(o)return{error:o.message};let i=K(e);Y(i)||it(i,{recursive:!0});let a=ot(e),c=Z.fromWeb(r);if(s&&p!==void 0&&p>0){let u=0;c.on("data",m=>{u+=m.length;let g=Math.round(u/p*100);process.stdout.write(`\rDownloading: ${w(u)} / ${w(p)} (${g}%)`)})}return await rt(c,a),s&&process.stdout.write("\r"+" ".repeat(60)+"\r"),{}}async function A(n,t,e,l,s,p=!1){if(e.endsWith("/")){let{error:c}=await E(s,"",{config:{...n,bucket:l}});return c?{error:c.message}:{}}let r;if(p){let{data:c}=await X(e,{config:{...n,bucket:t}});r=c?.size}let{data:o,error:i}=await V(e,"stream",{config:{...n,bucket:t}});if(i)return{error:i.message};let{error:a}=await E(s,o,{...B(r),onUploadProgress:p?({loaded:c})=>{if(r!==void 0&&r>0){let u=Math.round(c/r*100);process.stdout.write(`\rCopying: ${w(c)} / ${w(r)} (${u}%)`)}else process.stdout.write(`\rCopying: ${w(c)}`)}:void 0,config:{...n,bucket:l}});return p&&process.stdout.write("\r"+" ".repeat(60)+"\r"),a?{error:a.message}:{}}async function st(n,t,e,l){let s=P(n);if(n.includes("*")){let o=ct(s,l);if(o.length===0){console.log(h?JSON.stringify({action:"copied",direction:"local-to-remote",count:0}):"No files matching pattern");return}let i=K(s),a=o.map(m=>async()=>{let g=_(i,m),k=t.path?`${t.path.replace(/\/$/,"")}/${g}`:g,$=await I(m,t.bucket,k,e);return $.error?(console.error(`Failed to upload ${m}: ${$.error}`),!1):(h||console.log(`Uploaded ${m} -> t3://${t.bucket}/${k}`),!0)}),u=(await C(a,8)).filter(Boolean).length;console.log(h?JSON.stringify({action:"copied",direction:"local-to-remote",count:u}):`Uploaded ${u} file(s)`);return}let r;try{r=L(s)}catch{f(`Source not found: ${n}`)}if(r.isDirectory()){l||f(`${n} is a directory (not copied). Use -r to copy recursively.`);let o=lt(s);if(o.length===0){console.log(h?JSON.stringify({action:"copied",direction:"local-to-remote",count:0}):"No files to upload");return}let i=n.endsWith("/")?"":M(s),a=o.map(m=>async()=>{let g=_(s,m),$=[t.path?.replace(/\/$/,""),i,g].filter(Boolean).join("/"),R=await I(m,t.bucket,$,e);return R.error?(console.error(`Failed to upload ${m}: ${R.error}`),!1):(h||console.log(`Uploaded ${m} -> t3://${t.bucket}/${$}`),!0)}),u=(await C(a,8)).filter(Boolean).length;console.log(h?JSON.stringify({action:"copied",direction:"local-to-remote",count:u}):`Uploaded ${u} file(s)`)}else{let o=M(s),i;t.path?n.endsWith("/")||t.path.endsWith("/")?i=`${t.path.replace(/\/$/,"")}/${o}`:await D(t.bucket,t.path,e)?i=`${t.path}/${o}`:i=t.path:i=o;let a=await I(s,t.bucket,i,e,!h);a.error&&f(a.error),console.log(h?JSON.stringify({action:"copied",direction:"local-to-remote",count:1,src:n,dest:`t3://${t.bucket}/${i}`}):`Uploaded ${n} -> t3://${t.bucket}/${i}`)}}async function pt(n,t,e,l,s){let p=n.endsWith("/");!t.path&&!p&&f("Cannot copy a bucket. Provide a path within the bucket.");let r=P(e),o=t.path.includes("*"),i=t.path.endsWith("/")||!t.path&&p;if(!o&&!i&&(i=await D(t.bucket,t.path,l)),i&&!o&&!s&&f("Source is a remote folder (not copied). Use -r to copy recursively."),o||i){let a=o?J(t.path):t.path?t.path.endsWith("/")?t.path:`${t.path}/`:"",c=!o&&t.path&&!t.path.endsWith("/")?t.path.split("/").filter(Boolean).pop()??"":"",{items:u,error:m}=await j(t.bucket,a||void 0,l);m&&f(m);let g=u.filter(y=>!y.name.endsWith("/"));if(o){let y=t.path.split("/").pop(),b=O(y);g=g.filter(S=>{let d=a?S.name.slice(a.length):S.name;return!s&&d.includes("/")?!1:b.test(d.split("/").pop())})}if(g.length===0){console.log(h?JSON.stringify({action:"copied",direction:"remote-to-local",count:0}):"No objects to download");return}let k=g.map(y=>async()=>{let b=a?y.name.slice(a.length):y.name,S=c?N(r,c,b):N(r,b),d=await Q(t.bucket,y.name,S,l);return d.error?(console.error(`Failed to download ${y.name}: ${d.error}`),!1):(h||console.log(`Downloaded t3://${t.bucket}/${y.name} -> ${S}`),!0)}),R=(await C(k,8)).filter(Boolean).length;console.log(h?JSON.stringify({action:"copied",direction:"remote-to-local",count:R}):`Downloaded ${R} file(s)`)}else{let a=t.path.split("/").pop(),c,u=!1;try{u=L(r).isDirectory()}catch{}u||e.endsWith("/")?c=N(r,a):c=r;let m=await Q(t.bucket,t.path,c,l,!h);m.error&&f(m.error),console.log(h?JSON.stringify({action:"copied",direction:"remote-to-local",count:1,src:`t3://${t.bucket}/${t.path}`,dest:c}):`Downloaded t3://${t.bucket}/${t.path} -> ${c}`)}}async function ut(n,t,e,l,s){let p=n.endsWith("/");!t.path&&!p&&f("Cannot copy a bucket. Provide a path within the bucket.");let r=n.includes("*"),o=t.path.endsWith("/")||!t.path&&p;if(!r&&!o&&t.path&&(o=await D(t.bucket,t.path,l)),o&&!r&&!s&&f("Source is a remote folder (not copied). Use -r to copy recursively."),r||o){let i=r?J(t.path):t.path?t.path.endsWith("/")?t.path:`${t.path}/`:"",a=!r&&t.path&&!t.path.endsWith("/")?t.path.split("/").filter(Boolean).pop()??"":"",u=[e.path?.replace(/\/$/,"")||"",a].filter(Boolean).join("/"),m=u?`${u}/`:"";t.bucket===e.bucket&&i===m&&f("Source and destination are the same");let{items:g,error:k}=await j(t.bucket,i||void 0,l);k&&f(k);let $=g.filter(d=>d.name!==i);if(r){let d=t.path.split("/").pop(),W=O(d);$=$.filter(F=>{let v=i?F.name.slice(i.length):F.name;return!s&&v.includes("/")?!1:W.test(v.split("/").pop())})}let R=$.map(d=>async()=>{let W=i?d.name.slice(i.length):d.name,F=u?`${u}/${W}`:W,v=await A(l,t.bucket,d.name,e.bucket,F);return v.error?(console.error(`Failed to copy ${d.name}: ${v.error}`),!1):(h||console.log(`Copied t3://${t.bucket}/${d.name} -> t3://${e.bucket}/${F}`),!0)}),b=(await C(R,8)).filter(Boolean).length,S=!1;if(u&&i){let{data:d}=await tt({prefix:i,limit:1,config:{...l,bucket:t.bucket}});if(d?.items?.some(W=>W.name===i)){let W=`${u}/`,F=await A(l,t.bucket,i,e.bucket,W);F.error?console.error(`Failed to copy folder marker: ${F.error}`):S=!0}}if(b===0&&S&&(b=1),b===0){console.log(h?JSON.stringify({action:"copied",direction:"remote-to-remote",count:0}):"No objects to copy");return}console.log(h?JSON.stringify({action:"copied",direction:"remote-to-remote",count:b}):`Copied ${b} object(s)`)}else{let i=t.path.split("/").pop(),a;e.path?e.path.endsWith("/")?a=`${e.path}${i}`:await D(e.bucket,e.path,l)?a=`${e.path}/${i}`:a=e.path:a=i,t.bucket===e.bucket&&t.path===a&&f("Source and destination are the same");let c=await A(l,t.bucket,t.path,e.bucket,a,!h);c.error&&f(c.error),console.log(h?JSON.stringify({action:"copied",direction:"remote-to-remote",count:1,src:`t3://${t.bucket}/${t.path}`,dest:`t3://${e.bucket}/${a}`}):`Copied t3://${t.bucket}/${t.path} -> t3://${e.bucket}/${a}`)}}async function ft(n){let t=x(n,["src"]),e=x(n,["dest"]);(!t||!e)&&f("Both src and dest arguments are required");let l=!!x(n,["recursive","r"]);h=q(n)==="json";let p=at(t,e),r=await G({withCredentialProvider:!0});switch(p){case"local-to-remote":{let o=T(e);o.bucket||f("Invalid destination path"),await st(t,o,r,l);break}case"remote-to-local":{let o=T(t);o.bucket||f("Invalid source path"),await pt(t,o,e,r,l);break}case"remote-to-remote":{let o=T(t),i=T(e);o.bucket||f("Invalid source path"),i.bucket||f("Invalid destination path"),await ut(t,o,i,r,l);break}}process.exit(0)}export{ft as default};
|