@tigrisdata/cli 2.15.0 → 2.16.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-WIOXQDND.js → chunk-4ZHCF5D6.js} +1 -1
- package/dist/chunk-7TRUGAFK.js +4 -0
- package/dist/chunk-ALJKYIQL.js +5 -0
- package/dist/{chunk-4RNEQIK4.js → chunk-EYGRHNNY.js} +1 -1
- package/dist/chunk-GAWFFIPC.js +4 -0
- package/dist/chunk-IRDNZN7R.js +7 -0
- package/dist/chunk-KK7FZ7QM.js +1 -0
- package/dist/{chunk-ZHAJEGAB.js → chunk-LVAJB4FR.js} +1 -1
- package/dist/chunk-OHGCOC5Q.js +1 -0
- package/dist/chunk-PG746YF3.js +3 -0
- package/dist/{chunk-S33FT7Z7.js → chunk-TRRXHLUE.js} +1 -1
- package/dist/{chunk-3FMWZQ3C.js → chunk-VAVMX5DC.js} +1 -1
- package/dist/{chunk-CMGXGXVC.js → chunk-VYYV76WE.js} +1 -1
- package/dist/chunk-XAZRKVEQ.js +8 -0
- package/dist/chunk-YFMOI263.js +1 -0
- 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/create.js +1 -1
- package/dist/lib/access-keys/delete.js +1 -1
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list.js +1 -1
- 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 -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/list.js +1 -1
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +1 -1
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/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.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 +1 -1
- package/dist/lib/organizations/list.js +1 -1
- package/dist/lib/organizations/select.js +1 -1
- package/dist/lib/presign.js +2 -2
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/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 +2 -2
- package/dist/specs.yaml +30 -0
- 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/options.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +6 -9
- package/dist/chunk-552FMFE5.js +0 -5
- package/dist/chunk-5VDFQRGP.js +0 -2
- package/dist/chunk-7RGWTDUP.js +0 -1
- package/dist/chunk-AEADROU6.js +0 -4
- package/dist/chunk-AHGPPFCQ.js +0 -1
- package/dist/chunk-BC2HK4K6.js +0 -1
- package/dist/chunk-CQCBYE3X.js +0 -6
- package/dist/chunk-JVQ7GLJH.js +0 -4
- package/dist/chunk-KCWQ4II7.js +0 -8
package/dist/chunk-552FMFE5.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as i,b as g,c as d}from"./chunk-ATBINUDP.js";import{a as A,d as I}from"./chunk-BC2HK4K6.js";import{i as c,j as l,k as y,l as o,p as a}from"./chunk-7RGWTDUP.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||g,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||d}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||i,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||g,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||d}}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}function T(){return p()||o()||null}var f=!1;async function C(){if(f||!process.stdin.isTTY)return!1;f=!0,console.log(`Not authenticated. Starting login...
|
|
2
|
-
`);let{default:e}=await import("./lib/login/select.js");return await e({}),console.log(),!0}async function O(){return a()}async function h(){if(l()){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=a();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 E(e){let s=await h();switch(s.type){case"aws-profile":{let t=await y(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":return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:o()?.endpoint||i};case"none":{if(await C())return E(e);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}}}async function P(){let e=await E(),s=c();return{...e,...s&&!e.organizationId?{organizationId:s}:{}}}function R(e){return a()==="oauth"?!1:(T()?console.log(`You are using access key credentials, which belong to a single organization.
|
|
3
|
-
${e} 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{K as a,p as b,T as c,O as d,h as e,E as f,P as g,R as h};
|
package/dist/chunk-5VDFQRGP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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};
|
package/dist/chunk-7RGWTDUP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{loadSharedConfigFiles as p}from"@smithy/shared-ini-file-loader";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 f,platform as w}from"os";import{join as r}from"path";var s=r(f(),".tigris"),a=r(s,"config.json");function g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function l(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 x(){c(s)||(v(s,{recursive:!0,mode:448}),l(s,448))}function I(e){let n={version:2},i=e.credentials;return g(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(!g(n))return{version:2};if(n.version===2)return n;let i=I(n);return u(i),i}catch{return{version:2}}}function u(e){x(),h(a,JSON.stringify(e,null,2),{mode:384}),l(a,384)}async function o(e){u(e)}async function T(e){let n=t();n.oauth?n.oauth.tokens=e:n.oauth={tokens:e,organizations:[]},await o(n)}async function O(){return t().oauth?.tokens??null}async function P(){let e=t();e.oauth&&delete e.oauth.tokens,await o(e)}async function F(e){let n=t();n.oauth?n.oauth.organizations=e:n.oauth={organizations:e},await o(n)}function M(){return t().oauth?.organizations??[]}async function b(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 V(){let e=t();return e.activeMethod==="credentials"?(e.credentials?.temporary??e.credentials?.saved)?.organizationId??null:e.oauth?.selectedOrganization??null}function _(){if(!process.env.AWS_PROFILE)return!1;let e=r(f(),".aws");return c(r(e,"credentials"))||c(r(e,"config"))}async function E(e){try{let{configFile:n}=await p(),i=n[e];return i?{endpoint:i.endpoint_url_s3||i.endpoint_url,iamEndpoint:i.endpoint_url_iam,region:i.region}:{}}catch{return{}}}function N(){let e=t();return d(e.credentials?.temporary)||d(e.credentials?.saved)||null}async function R(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 D(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 L(e){let n=t();n.activeMethod=e,await o(n)}function j(){return t().activeMethod??null}async function W(e){let n=t(),i=n.credentials?.temporary??n.credentials?.saved;i&&(i.organizationId=e,await o(n))}async function $(){let e=t();e.credentials&&delete e.credentials.temporary,await o(e)}async function G(){let e=t();delete e.oauth,e.activeMethod==="oauth"&&delete e.activeMethod,await o(e)}async function J(){let n=t().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,T as c,O as d,P as e,F as f,M as g,b as h,V as i,_ as j,E as k,N as l,R as m,D as n,L as o,j as p,W as q,$ as r,G as s,J as t};
|
package/dist/chunk-AEADROU6.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as i,b as a}from"./chunk-BC2HK4K6.js";import{i as e}from"./chunk-7RGWTDUP.js";import s from"axios";function l(n){return!!n?.startsWith("flyio_")}function c(n){let o=e();return l(o??void 0)?(console.log(`${n} is not available for Fly.io organizations.
|
|
2
|
-
Your resources are managed through Fly.io.
|
|
3
|
-
|
|
4
|
-
Visit https://fly.io to manage your organization.`),!0):!1}async function p(n){try{let{domain:o}=i(),t=(await s.get(`https://${o}/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{l as a,c as b,p as c};
|
package/dist/chunk-AHGPPFCQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-BC2HK4K6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,d as s,e as l,f as u,g as f,o as h}from"./chunk-7RGWTDUP.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};
|
package/dist/chunk-CQCBYE3X.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
function B(n){if(n===0)return"0 B";let t=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(n)/Math.log(1024));return`${(n/Math.pow(1024,r)).toFixed(r>0?1:0)} ${t[r]}`}function T(n){return JSON.stringify(n,null,2)}function b(n){return String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function W(n,t=" "){return Object.entries(n).map(([r,e])=>`${t}<${r}>${b(e)}</${r}>`).join(`
|
|
2
|
-
`)}function j(n,t,r){let e=[`<${t}>`];return n.forEach(u=>{e.push(` <${r}>`),e.push(W(u," ")),e.push(` </${r}>`)}),e.push(`</${t}>`),e.join(`
|
|
3
|
-
`)}function l(n,t){return n.length<=t?n:n.slice(0,t-1)+"\u2026"}function m(n){if(n==null)return"";if(n instanceof Date)return f(n);if(typeof n=="string"){let t=new Date(n);if(!isNaN(t.getTime())&&n.includes("T"))return f(t)}return String(n)}function f(n){return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function k(n,t){let r=process.stdout.columns||120,e=t.length*3+1,u=r-e,c=t.map(i=>{if(i.width)return i.width;let s=i.header.length,o=n.reduce((p,x)=>{let w=m(x[i.key]);return Math.max(p,w.length)},0),h=Math.max(s,o);return i.maxWidth&&h>i.maxWidth&&(h=i.maxWidth),h}),g=c.reduce((i,s)=>i+s,0);if(g<=u)return c;let d=[...c],a=t.map(i=>Math.max(i.header.length,8));for(;g>u;){let i=-1,s=0;for(let o=0;o<d.length;o++)d[o]>a[o]&&d[o]>s&&(s=d[o],i=o);if(i===-1)break;d[i]--,g--}return d}function $(n,t){let r=[],e=k(n,t),u="\u250C"+e.map(a=>"\u2500".repeat(a+2)).join("\u252C")+"\u2510",c="\u251C"+e.map(a=>"\u2500".repeat(a+2)).join("\u253C")+"\u2524",g="\u2514"+e.map(a=>"\u2500".repeat(a+2)).join("\u2534")+"\u2518";r.push(`
|
|
4
|
-
`+u);let d="\u2502 "+t.map((a,i)=>l(a.header,e[i]).padEnd(e[i])).join(" \u2502 ")+" \u2502";return r.push(d),r.push(c),n.forEach(a=>{let i=t.map((s,o)=>{let h=l(m(a[s.key]),e[o]);return s.align==="right"?h.padStart(e[o]):h.padEnd(e[o])});r.push("\u2502 "+i.join(" \u2502 ")+" \u2502")}),r.push(g+`
|
|
5
|
-
`),r.join(`
|
|
6
|
-
`)}function M(n,t,r,e,u){switch(t){case"json":return T(n);case"xml":return j(n,r,e);default:return $(n,u)}}export{B as a,T as b,W as c,j as d,$ as e,M as f};
|
package/dist/chunk-JVQ7GLJH.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as u}from"./chunk-AHGPPFCQ.js";import{a as f,d as e}from"./chunk-3FMWZQ3C.js";import{b as s,c as r,d as g,g as c,i as l}from"./chunk-5VDFQRGP.js";import{d}from"./chunk-BC2HK4K6.js";import{h as m,r as p}from"./chunk-7RGWTDUP.js";var o=l("login","oauth");async function y(h={}){s(o);let a=u(h);try{let n=d();await n.login({onDeviceCode:(t,w)=>{console.log(`
|
|
2
|
-
Your confirmation code: ${t}
|
|
3
|
-
`),console.log(`If browser doesn't open, visit: ${w}`)},onWaiting:()=>console.log(`
|
|
4
|
-
Waiting for authentication...`)}),await p();let i=await n.getOrganizations();if(i.length>0){let t=i[0];await m(t.id),a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:t.displayName||t.name}),e(o),i.length>1&&c(o,{count:i.length})}else a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:"none"}),e(o)}catch(n){g(o),f(n,o)}}var v=y;export{y as a,v as b};
|
package/dist/chunk-KCWQ4II7.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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.15.0";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};
|