@tigrisdata/cli 2.14.3 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-4RNEQIK4.js +1 -0
- package/dist/chunk-552FMFE5.js +5 -0
- package/dist/{chunk-2JHVFROL.js → chunk-5VDFQRGP.js} +1 -1
- package/dist/chunk-7RGWTDUP.js +1 -0
- package/dist/chunk-AEADROU6.js +4 -0
- package/dist/chunk-AHGPPFCQ.js +1 -0
- package/dist/{chunk-2XAO2OYD.js → chunk-ATBINUDP.js} +1 -1
- package/dist/chunk-BC2HK4K6.js +1 -0
- package/dist/{chunk-5J2RG53O.js → chunk-CMGXGXVC.js} +1 -1
- package/dist/chunk-JQUG732D.js +1 -0
- package/dist/chunk-JVQ7GLJH.js +4 -0
- package/dist/chunk-KCWQ4II7.js +8 -0
- package/dist/{chunk-BETAO4PB.js → chunk-PPNBQWSR.js} +1 -1
- package/dist/chunk-S33FT7Z7.js +8 -0
- package/dist/chunk-ZHAJEGAB.js +2 -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/info.js +1 -0
- 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 -7
- package/dist/lib/organizations/list.js +1 -4
- package/dist/lib/organizations/select.js +3 -6
- package/dist/lib/presign.js +3 -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 +90 -219
- 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 +29 -19
- 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-2ALXOKBR.js +0 -1
- package/dist/chunk-6JFWKF3Y.js +0 -8
- package/dist/chunk-CFMM35UQ.js +0 -2
- package/dist/chunk-CLT45ZCW.js +0 -1
- package/dist/chunk-DOUR5YEY.js +0 -1
- package/dist/chunk-IFEXFA2T.js +0 -1
- package/dist/chunk-JRALYIRA.js +0 -1
- package/dist/chunk-LCWHZUZZ.js +0 -1
- package/dist/chunk-LQ4BU234.js +0 -4
- package/dist/chunk-RJGUZ3B2.js +0 -7
- package/dist/chunk-XBGYA42R.js +0 -4
- package/dist/chunk-Y3JRLJCC.js +0 -1
package/dist/utils/messages.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"../chunk-5VDFQRGP.js";import"../chunk-PPNBQWSR.js";export{a as interpolate,i as msg,f as printAlreadyDone,h as printDeprecated,e as printEmpty,d as printFailure,g as printHint,b as printStart,c as printSuccess};
|
package/dist/utils/options.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-AHGPPFCQ.js";export{b as getFormat,a as getOption,c as parseBoolean};
|
package/dist/utils/path.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-JQUG732D.js";export{g as globToRegex,d as isPathFolder,a as isRemotePath,j as listAllItems,f as parseAnyPath,c as parsePath,e as parsePaths,b as parseRemotePath,i as resolveObjectArgs,h as wildcardPrefix};
|
package/dist/utils/specs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-PPNBQWSR.js";export{e as buildPromptChoices,d as getArgumentSpec,c as getCommandSpec,b as loadSpecs,a as setSpecs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b}from"../chunk-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-KCWQ4II7.js";import"../chunk-ATBINUDP.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"build": "tsc --noEmit && tsup",
|
|
26
26
|
"dev": "export $(grep -v '^#' .env | xargs) && (tsc --noEmit --watch --preserveWatchOutput & tsup --watch)",
|
|
27
27
|
"cli": "node dist/cli.js",
|
|
28
|
-
"lint": "eslint src",
|
|
29
|
-
"lint:fix": "eslint src --fix",
|
|
30
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
31
|
-
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
32
|
-
"test": "vitest run
|
|
28
|
+
"lint": "eslint src test",
|
|
29
|
+
"lint:fix": "eslint src test --fix",
|
|
30
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
31
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
32
|
+
"test": "vitest run --exclude test/cli.test.ts",
|
|
33
33
|
"test:watch": "vitest",
|
|
34
34
|
"test:all": "vitest run",
|
|
35
35
|
"test:integration": "vitest run test/cli.test.ts",
|
|
@@ -73,34 +73,44 @@
|
|
|
73
73
|
}
|
|
74
74
|
],
|
|
75
75
|
"plugins": [
|
|
76
|
-
|
|
76
|
+
[
|
|
77
|
+
"@semantic-release/commit-analyzer",
|
|
78
|
+
{
|
|
79
|
+
"releaseRules": [
|
|
80
|
+
{
|
|
81
|
+
"type": "refactor",
|
|
82
|
+
"release": "patch"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
],
|
|
77
87
|
"@semantic-release/release-notes-generator",
|
|
78
88
|
"@semantic-release/github",
|
|
79
89
|
"@semantic-release/npm"
|
|
80
90
|
]
|
|
81
91
|
},
|
|
82
92
|
"dependencies": {
|
|
83
|
-
"@aws-sdk/
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"@tigrisdata/
|
|
87
|
-
"@tigrisdata/storage": "^2.15.5",
|
|
93
|
+
"@aws-sdk/credential-providers": "^3.1018.0",
|
|
94
|
+
"@smithy/shared-ini-file-loader": "^4.4.7",
|
|
95
|
+
"@tigrisdata/iam": "^1.4.1",
|
|
96
|
+
"@tigrisdata/storage": "^2.15.6",
|
|
88
97
|
"axios": "^1.13.6",
|
|
89
98
|
"commander": "^14.0.3",
|
|
90
99
|
"enquirer": "^2.4.1",
|
|
91
|
-
"jose": "^6.
|
|
100
|
+
"jose": "^6.2.2",
|
|
92
101
|
"open": "^11.0.0",
|
|
93
|
-
"yaml": "^2.8.
|
|
102
|
+
"yaml": "^2.8.3"
|
|
94
103
|
},
|
|
95
104
|
"devDependencies": {
|
|
96
|
-
"@commitlint/cli": "^20.
|
|
97
|
-
"@commitlint/config-conventional": "^20.
|
|
105
|
+
"@commitlint/cli": "^20.5.0",
|
|
106
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
98
107
|
"@eslint/js": "^10.0.1",
|
|
99
108
|
"@semantic-release/changelog": "^6.0.3",
|
|
100
109
|
"@semantic-release/git": "^10.0.1",
|
|
101
110
|
"@types/node": "^22.19.11",
|
|
102
111
|
"dotenv": "^17.3.1",
|
|
103
|
-
"eslint": "^10.0
|
|
112
|
+
"eslint": "^10.1.0",
|
|
113
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
104
114
|
"husky": "^9.1.7",
|
|
105
115
|
"prettier": "^3.8.1",
|
|
106
116
|
"publint": "^0.3.18",
|
|
@@ -108,7 +118,7 @@
|
|
|
108
118
|
"tsup": "^8.5.1",
|
|
109
119
|
"tsx": "^4.21.0",
|
|
110
120
|
"typescript": "^5.9.3",
|
|
111
|
-
"typescript-eslint": "^8.
|
|
112
|
-
"vitest": "^4.
|
|
121
|
+
"typescript-eslint": "^8.57.2",
|
|
122
|
+
"vitest": "^4.1.2"
|
|
113
123
|
}
|
|
114
124
|
}
|
package/dist/auth/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-CLT45ZCW.js";import"../chunk-2XAO2OYD.js";export{b as TIGRIS_CLAIMS_NAMESPACE,a as getAuth0Config,c as getTigrisConfig};
|
package/dist/auth/s3-client.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-CFMM35UQ.js";import"../chunk-2ALXOKBR.js";import"../chunk-DOUR5YEY.js";import"../chunk-CLT45ZCW.js";import"../chunk-2XAO2OYD.js";export{a as getLoginMethod,c as getS3Client,b as getStorageConfig,d as isAuthenticated};
|
package/dist/auth/types.js
DELETED
|
File without changes
|
package/dist/chunk-2ALXOKBR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c,b as s,c as l,d as h,e as g,r as k}from"./chunk-DOUR5YEY.js";import{a as p,b as u}from"./chunk-CLT45ZCW.js";import a from"axios";import w from"open";import{createRemoteJWKSet as T,jwtVerify as y}from"jose";var f=class{config;baseUrl;jwks=null;constructor(){this.config=p(),this.baseUrl=`https://${this.config.domain}`}getJWKS(){return this.jwks||(this.jwks=T(new URL(`${this.baseUrl}/.well-known/jwks.json`))),this.jwks}async verifyIdToken(e){let{payload:i}=await y(e,this.getJWKS(),{issuer:`${this.baseUrl}/`,audience:this.config.clientId});return i}async login(e){let o=(await a.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 w(o.verification_uri_complete)}catch{}e?.onWaiting?.();let n=await this.pollForToken(o.device_code,o.interval||5);await c(n),k("oauth"),await this.extractAndStoreOrganizations(n.idToken)}async pollForToken(e,i){let n=0;for(;n<60;){n++;try{let r=(await a.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 m=Date.now()+(r.expires_in||3600)*1e3;return{accessToken:r.access_token,refreshToken:r.refresh_token,idToken:r.id_token,expiresAt:m}}catch(t){if(a.isAxiosError(t)&&t.response){let r=t.response.data?.error;if(r==="authorization_pending"){await this.sleep(i*1e3);continue}if(r==="slow_down"){i+=5,await this.sleep(i*1e3);continue}throw new Error(t.response.data?.error_description||"Authentication failed",{cause:t})}throw t}}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 i=300*1e3;return Date.now()+i>=e.expiresAt&&(e=await this.refreshAccessToken(e)),e.accessToken}async refreshAccessToken(e){let i;if(e?.refreshToken?i=e:i=await s(),!i)throw new Error('No refresh token available. Please run "tigris login" to re-authenticate.');try{let n=(await a.post(`${this.baseUrl}/oauth/token`,{client_id:this.config.clientId,grant_type:"refresh_token",refresh_token:i.refreshToken,scope:"openid profile email offline_access"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data,t={accessToken:n.access_token,refreshToken:n.refresh_token||i.refreshToken,idToken:n.id_token||i.idToken,expiresAt:Date.now()+(n.expires_in||3600)*1e3};return await c(t),t}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))[u];if(!o)return;let n=o?.ns?.map(t=>typeof t=="object"&&t!==null?{id:t.id,name:t.name,displayName:t.name}:{id:t,name:t,displayName:t})||[];if(n.length===0)return;h(n)}catch{}}async getOrganizations(){return await this.getAccessToken(),g()}async logout(){await l()}async isAuthenticated(){return await s()!==null}sleep(e){return new Promise(i=>setTimeout(i,e))}},d=null;function S(){return d||(d=new f),d}export{f as a,S as b};
|
package/dist/chunk-6JFWKF3Y.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d as m,e as d,f}from"./chunk-2XAO2OYD.js";import{readFileSync as I,writeFileSync as T,mkdirSync as N}from"fs";import{join as g}from"path";import{homedir as h}from"os";import j from"https";var u="2.14.3";var b=g(h(),".tigris","update-check.json");function y(){try{let t=I(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{N(g(h(),".tigris"),{recursive:!0}),T(b,JSON.stringify(t),"utf-8")}catch{}}function E(t,i){let a=o=>{let r=o.startsWith("v")?o.slice(1):o,c=null,l=r.indexOf("-");l!==-1&&(c=r.slice(l+1),r=r.slice(0,l));let p=r.split(".");if(p.length!==3)return null;let n=p.map(Number);return n.some(isNaN)?null:{major:n[0],minor:n[1],patch:n[2],prerelease:c}},e=a(t),s=a(i);return!e||!s?!1:s.major>e.major?!0:s.major<e.major?!1:s.minor>e.minor?!0:s.minor<e.minor?!1:s.patch>e.patch?!0:s.patch<e.patch?!1:e.prerelease&&!s.prerelease?!0:(!e.prerelease&&s.prerelease,!1)}function w(){try{let t=j.get(m,{timeout:5e3},i=>{let a="";i.on("data",e=>{a+=e}),i.on("end",()=>{try{let e=JSON.parse(a);if(typeof e.version=="string"){let s=y();v({...s,latestVersion:e.version,lastChecked:Date.now()})}}catch{}})});t.on("error",()=>{}),t.on("timeout",()=>{t.destroy()}),t.end(),t.on("socket",i=>{i.unref()})}catch{}}function V(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let t=y(),i=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||216e5;if(t&&E(u,t.latestVersion)&&(!t.lastNotified||Date.now()-t.lastNotified>i)){let e=globalThis.__TIGRIS_BINARY===!0,s=process.platform==="win32",o=`Update available: ${u} \u2192 ${t.latestVersion}`,r;e?s?r="Run `irm https://raw.githubusercontent.com/tigrisdata/cli/main/scripts/install.ps1 | iex`":r="Run `curl -fsSL https://raw.githubusercontent.com/tigrisdata/cli/main/scripts/install.sh | sh`":r="Run `npm install -g @tigrisdata/cli` to upgrade.";let c=Math.max(o.length,r.length)+4,l="\u250C"+"\u2500".repeat(c-2)+"\u2510",p="\u2514"+"\u2500".repeat(c-2)+"\u2518",n=_=>"\u2502 "+_.padEnd(c-4)+" \u2502";console.log(`
|
|
2
|
-
${l}
|
|
3
|
-
${n("")}
|
|
4
|
-
${n(o)}
|
|
5
|
-
${n(r)}
|
|
6
|
-
${n("")}
|
|
7
|
-
${p}
|
|
8
|
-
`),v({...t,lastNotified:Date.now()})}let a=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||864e5;(!t||Date.now()-t.lastChecked>a)&&w()}export{u as a,E as b,V as c};
|
package/dist/chunk-CFMM35UQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./chunk-2ALXOKBR.js";import{g as p,h as l,i as g,j as f,l as r,s as h}from"./chunk-DOUR5YEY.js";import{a as m,c as A}from"./chunk-CLT45ZCW.js";import{a as u}from"./chunk-2XAO2OYD.js";import{S3Client as d}from"@aws-sdk/client-s3";import{fromIni as C}from"@aws-sdk/credential-providers";var c=A(),S=m(),I=!1;async function P(){if(I||!process.stdin.isTTY)return!1;I=!0,console.log(`Not authenticated. Starting login...
|
|
2
|
-
`);let{default:s}=await import("./lib/login/select.js");return await s({}),console.log(),!0}async function w(){return h()}async function v(s){if(g()){let t=process.env.AWS_PROFILE||"default",i=await f(t),a=await C({profile:t})();return{accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,endpoint:i.endpoint||c.endpoint||u,iamEndpoint:i.iamEndpoint||c.iamEndpoint}}let o=await w();if(o==="oauth"){let t=y(),i=p();if(!i)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await t.getAccessToken(),accessKeyId:"",secretAccessKey:"",...s?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await t.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:c.endpoint,organizationId:i,iamEndpoint:c.iamEndpoint,authDomain:S.domain}}if(o==="credentials"){let t=r();if(t)return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:t.endpoint}}let n=l();if(n)return{accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey,endpoint:n.endpoint};let e=r();if(e)return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint};if(await P())return v(s);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}async function k(){if(g()){let e=process.env.AWS_PROFILE||"default",t=await f(e);return new d({region:"auto",endpoint:t.endpoint||c.endpoint||u,credentials:C({profile:e})})}let s=await w();if(s==="oauth"){let e=y(),t=p();if(!t)throw new Error('No organization selected. Please run "tigris orgs select" first.');let i=async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await e.getAccessToken(),expiration:new Date(Date.now()+600*1e3)}),a=new d({region:"auto",endpoint:c.endpoint,credentials:i});return a.middlewareStack.add(T=>async K=>{let E=K.request;return E.headers["x-Tigris-Namespace"]=t,await T(K)},{name:"x-Tigris-Namespace-Middleware",step:"build",override:!0}),a}if(s==="credentials"){let e=r();if(e)return new d({region:"auto",endpoint:e.endpoint,credentials:{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey}})}let o=l();if(o)return new d({region:"auto",endpoint:o.endpoint,credentials:{accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey}});let n=r();if(n)return new d({region:"auto",endpoint:n.endpoint,credentials:{accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey}});if(await P())return k();throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}async function z(){return g()||await w()!==null||l()!==null||r()!==null}export{w as a,v as b,k as c,z as d};
|
package/dist/chunk-CLT45ZCW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,b as t,c as i}from"./chunk-2XAO2OYD.js";function T(){let n=process.env.TIGRIS_ENV==="development",s=n?"auth-dev.tigris.dev":process.env.AUTH0_DOMAIN??"auth.storage.tigrisdata.io",o=n?"JdJVYIyw0O1uHi5L5OJH903qaWBgd3gF":process.env.AUTH0_CLIENT_ID??"DMejqeM3CQ4IqTjEcd3oA9eEiT40hn8D",r=n?"https://tigris-api-dev":process.env.AUTH0_AUDIENCE??"https://tigris-os-api";return{domain:s,clientId:o,audience:r}}var p=process.env.TIGRIS_CLAIMS_NAMESPACE||"https://tigris";function _(){return process.env.TIGRIS_STORAGE_ENDPOINT||process.env.TIGRIS_IAM_ENDPOINT?{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||e,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||t,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||i}:{endpoint:process.env.AWS_ENDPOINT_URL_S3||e,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||t,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||i}}export{T as a,p as b,_ as c};
|
package/dist/chunk-DOUR5YEY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-2XAO2OYD.js";import{homedir as d,platform as C}from"os";import{join as r}from"path";import{readFileSync as m,writeFileSync as S,existsSync as c,mkdirSync as y,chmodSync as _}from"fs";import{execFileSync as E}from"child_process";import{loadSharedConfigFiles as I}from"@smithy/shared-ini-file-loader";var s=r(d(),".tigris"),a=r(s,"config.json");function u(n,e){if(C()==="win32")try{let i=process.env.USERNAME;i&&E("icacls",[n,"/inheritance:r","/grant:r",`${i}:F`],{stdio:"ignore"})}catch{console.warn(`Warning: Could not set restrictive permissions on ${n}. It may be accessible to other users.`)}else try{_(n,e)}catch{console.warn(`Warning: Could not set restrictive permissions on ${n}. It may be accessible to other users.`)}}function T(){c(s)||(y(s,{recursive:!0,mode:448}),u(s,448))}function o(){if(c(a))try{let n=m(a,"utf8");return JSON.parse(n)}catch{return{}}return{}}async function t(n){T(),S(a,JSON.stringify(n,null,2),{mode:384}),u(a,384)}async function h(n){let e=o();e.tokens=n,await t(e)}async function z(){return o().tokens||null}async function G(){let n=o();delete n.tokens,await t(n)}async function k(n){let e=o();e.organizations=n,await t(e)}function K(){return o().organizations||[]}async function D(n){let e=o();e.selectedOrganization=n,await t(e)}function F(){return o().selectedOrganization||null}function v(){if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID||process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let f=process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,g=process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY;if(!f||!g)return null;let p=process.env.TIGRIS_STORAGE_ENDPOINT||l;return{accessKeyId:f,secretAccessKey:g,endpoint:p}}let n=process.env.AWS_ACCESS_KEY_ID,e=process.env.AWS_SECRET_ACCESS_KEY;if(!n||!e)return null;let i=process.env.AWS_ENDPOINT_URL_S3||l;return{accessKeyId:n,secretAccessKey:e,endpoint:i}}function N(){if(!process.env.AWS_PROFILE)return!1;let n=r(d(),".aws");return c(r(n,"credentials"))||c(r(n,"config"))}async function b(n){try{let{configFile:e}=await I(),i=e[n];return i?{endpoint:i.endpoint_url_s3||i.endpoint_url,iamEndpoint:i.endpoint_url_iam,region:i.region}:{}}catch{return{}}}function L(){let n=o();return v()||n.temporaryCredentials||n.credentials||null}function M(){let n=o();return n.temporaryCredentials||n.credentials||null}function W(){return o().credentials||null}async function Y(n){let e=o();e.credentials=n,await t(e)}async function j(n){let e=o();e.temporaryCredentials=n,await t(e)}async function U(){let n=o();delete n.temporaryCredentials,await t(n)}async function $(){let n=o();delete n.credentials,await t(n)}async function J(n){let e=o();e.loginMethod=n,await t(e)}function q(){return o().loginMethod||null}async function B(){let e=o().credentials;await t({credentials:e})}export{h as a,z as b,G as c,k as d,K as e,D as f,F as g,v as h,N as i,b as j,L as k,M as l,W as m,Y as n,j as o,U as p,$ as q,J as r,q as s,B as t};
|
package/dist/chunk-IFEXFA2T.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-S77OAN6Y.js";import{a as y,c as m}from"./chunk-LQ4BU234.js";import{b as i,c as n,d,i as o}from"./chunk-2JHVFROL.js";import{m as f,o as p,r as g}from"./chunk-DOUR5YEY.js";import{a as u}from"./chunk-2XAO2OYD.js";import K from"enquirer";var{prompt:A}=K,r=o("login","credentials");async function k(e){i(r);let s=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,c=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(!s||!c){let t=[];s||t.push({type:"input",name:"accessKey",message:"Access Key ID:",required:!0}),c||t.push({type:"password",name:"accessSecret",message:"Secret Access Key:",required:!0}),S("Provide --access-key and --access-secret");let a=await A(t);s=s||a.accessKey,c=c||a.accessSecret}(!s||!c)&&(d(r,"Access key and secret are required"),y("Access key and secret are required",r));let l=f()?.endpoint||u;await p({accessKeyId:s,secretAccessKey:c,endpoint:l}),await g("credentials"),n(r),m(r)}export{k as a};
|
package/dist/chunk-JRALYIRA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(n,r,o){for(let e of r)if(n[e]!==void 0)return n[e];return o}function f(n){if(n!==void 0)return typeof n=="boolean"?n:n==="true"}export{t as a,f as b};
|
package/dist/chunk-LCWHZUZZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{list as g}from"@tigrisdata/storage";var f=["t3://","tigris://"];function p(t){return f.some(e=>t.startsWith(e))}function c(t){let e=f.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 l(t,e){return{source:s(t),destination:s(e)}}function d(t){return p(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{p as a,c as b,s as c,m as d,l as e,d as f,P as g,x as h,h as i};
|
package/dist/chunk-LQ4BU234.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as i}from"./chunk-DV3LCXRH.js";import{a as n}from"./chunk-2JHVFROL.js";import{c as r}from"./chunk-BETAO4PB.js";function c(){return globalThis.__TIGRIS_JSON_MODE===!0}function a(){return process.stderr.isTTY===!0}function m(){return process.stdout.isTTY===!0}function u(t,s){let e=i(t);if(c()){let o={error:{message:e.message,code:e.exitCode,category:e.category}};e.nextActions.length>0&&(o.nextActions=e.nextActions),console.error(JSON.stringify(o))}else if(s||console.error(`
|
|
2
|
-
Error: ${e.message}`),a()&&e.nextActions.length>0){console.error(`
|
|
3
|
-
Next steps:`);for(let o of e.nextActions)console.error(` \u2192 ${o.command} ${o.description}`)}process.exit(e.exitCode)}function p(t,s){let e=r(t.command,t.operation);return e?.messages?.nextActions?e.messages.nextActions.map(o=>({command:n(o.command,s),description:n(o.description,s)})):[]}function l(t,s){if(!m()||c())return;let e=p(t,s);if(e.length!==0){console.log(`
|
|
4
|
-
Next steps:`);for(let o of e)console.log(` \u2192 ${o.command} ${o.description}`)}}export{u as a,p as b,l as c};
|
package/dist/chunk-RJGUZ3B2.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./chunk-LQ4BU234.js";import{h as g}from"./chunk-2JHVFROL.js";import{Command as S}from"commander";function D(){process.on("unhandledRejection",e=>{(e===""||e===void 0)&&(console.error(`
|
|
2
|
-
Operation cancelled`),process.exit(1)),C(e)}),process.on("uncaughtException",e=>{C(e)})}function I(e){return/^[a-zA-Z0-9_-]+$/.test(e)}function b(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 f(e,t,n){return n(t)?!0:e.commands?e.commands.some(a=>f(a,[...t,a.name],n)):!1}function w(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 r=t.commands.filter(s=>f(s,[...n,s.name],a));r.length>0&&(console.log("Commands:"),r.forEach(s=>{let i=` ${s.name}`;if(s.alias){let l=Array.isArray(s.alias)?s.alias:[s.alias];i+=` (${l.join(", ")})`}let p=i.padEnd(24);console.log(`${p}${s.description}`)}),console.log())}t.arguments&&t.arguments.length>0&&(console.log("Arguments:"),t.arguments.forEach(r=>{console.log(b(r))}),console.log()),t.examples&&t.examples.length>0&&(console.log("Examples:"),t.examples.forEach(r=>{console.log(` ${r}`)}),console.log()),t.commands&&t.commands.length>0&&console.log(`Use "${e.name} ${o} <command> help" for more information about a command.`)}function x(e,t,n){console.log(`Tigris CLI Version: ${t}
|
|
5
|
-
`),console.log(`Usage: tigris [command] [options]
|
|
6
|
-
`),console.log("Commands:"),e.commands.filter(o=>f(o,[o.name],n)).forEach(o=>{let r=` ${o.name}`;if(o.alias){let i=Array.isArray(o.alias)?o.alias:[o.alias];r+=` (${i.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 $(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 q(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function y(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(),q(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=y(t,a,e),s=y(t,n.name,e);if(r===o&&!s)return console.error(`--${n.name} is required when --${a} is ${o}`),!1}if(n.required&&!y(t,n.name,e))return console.error(`--${n.name} is required`),!1}return!0}function u(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,i)=>{t[i]!==void 0&&(s.multiple?o[s.name]=t[i].split(",").map(p=>p.trim()):o[s.name]=t[i])}),e.forEach(s=>{s.multiple&&s.type!=="positional"&&o[s.name]&&typeof o[s.name]=="string"&&(o[s.name]=o[s.name].split(",").map(i=>i.trim()))}),o}async function k(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],i=o.default||o[s];typeof i!="function"&&(console.error(`Command not implemented: ${t.join(" ")}`),process.exit(1)),await i({...a,_positional:n})}function v(e,t,n,a=[]){let{specs:o,loadModule:r,hasImplementation:s}=e;for(let i of n){I(i.name)||(console.error(`Invalid command name "${i.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let p=[...a,i.name];if(!f(i,p,s))continue;let l=t.command(i.name).description(i.description);if(i.alias&&(Array.isArray(i.alias)?i.alias:[i.alias]).forEach(c=>l.alias(c)),i.commands&&i.commands.length>0)if(v(e,l,i.commands,p),i.default){let m=i.commands.find(c=>c.name===i.default);if(m){$(l,i.arguments),$(l,m.arguments);let c=[...i.arguments||[],...m.arguments||[]];l.action(async(...d)=>{let A=d.pop(),h=d;c.length>0&&!E(c,u(c,h,A))||(m.deprecated&&m.messages?.onDeprecated&&g(m.messages.onDeprecated),await k(r,[...p,m.name],h,u(c,h,A)))})}}else l.action(()=>{w(o,i,p,s)});else $(l,i.arguments),l.action(async(...m)=>{let c=m.pop(),d=m;i.arguments&&!E(i.arguments,u(i.arguments,d,c))||(i.deprecated&&i.messages?.onDeprecated&&g(i.messages.onDeprecated),await k(r,p,d,u(i.arguments||[],d,c)))});l.command("help").description("Show help for this command").action(()=>{w(o,i,p,s)})}}function P(e){let{specs:t,version:n,hasImplementation:a}=e,o=new S;return o.name(t.name).description(t.description).version(n),o.option("-y, --yes","Skip all confirmation prompts"),v(e,o,t.commands),o.command("help").description("Show general help").action(()=>{x(t,n,a)}),o.command("version").description("Show the CLI version").action(()=>{console.log(n)}),o.action(()=>{x(t,n,a)}),o}export{D as a,I as b,b as c,f as d,w as e,x as f,$ as g,E as h,u as i,v as j,P as k};
|
package/dist/chunk-XBGYA42R.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as u,c as r}from"./chunk-LQ4BU234.js";import{b as a,c as e,d as s,f as c,g,i as l}from"./chunk-2JHVFROL.js";import{b as f}from"./chunk-2ALXOKBR.js";import{f as p}from"./chunk-DOUR5YEY.js";var t=l("login","oauth");async function m(){a(t);try{let o=f();if(await o.isAuthenticated()){c(t);return}await o.login({onDeviceCode:(i,h)=>{console.log(`
|
|
2
|
-
Your confirmation code: ${i}
|
|
3
|
-
`),console.log(`If browser doesn't open, visit: ${h}`)},onWaiting:()=>console.log(`
|
|
4
|
-
Waiting for authentication...`)});let n=await o.getOrganizations();if(n.length>0){let i=n[0];await p(i.id),e(t,{org:i.displayName||i.name}),r(t),n.length>1&&g(t,{count:n.length})}else e(t,{org:"none"}),r(t)}catch(o){s(t),u(o,t)}}var v=m;export{m as a,v as b};
|
package/dist/chunk-Y3JRLJCC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o,b as e}from"./chunk-CLT45ZCW.js";import a from"axios";function p(n){return!!n?.startsWith("flyio_")}async function u(n){try{let{domain:i}=o(),t=(await a.get(`https://${i}/userinfo`,{headers:{Authorization:`Bearer ${n}`}})).data[e]?.ns;return Array.isArray(t)?t.map(r=>({id:r.id,name:r.name,displayName:r.name})):null}catch{return null}}export{p as a,u as b};
|