@tigrisdata/cli 3.4.2 → 3.4.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.
@@ -1,4 +1,4 @@
1
- import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as C,readFileSync as k,realpathSync as _,writeFileSync as E}from"fs";import I from"https";import{homedir as g}from"os";import{join as h}from"path";var p="3.4.2";var b=h(g(),".tigris","update-check.json");function y(){try{let e=k(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function w(e){try{C(h(g(),".tigris"),{recursive:!0}),E(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let o=s=>{let i=s.startsWith("v")?s.slice(1):s,c=null,a=i.indexOf("-");a!==-1&&(c=i.slice(a+1),i=i.slice(0,a));let l=i.split(".");if(l.length!==3)return null;let u=l.map(Number);return u.some(Number.isNaN)?null:{major:u[0],minor:u[1],patch:u[2],prerelease:c}},r=o(e),t=o(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function T(){if(process.platform==="win32")return!1;try{let e=_(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function L(){return globalThis.__TIGRIS_BINARY===!0?T()?"brew upgrade tigris":process.platform==="win32"?"irm https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.ps1 | iex":"curl -fsSL https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.sh | sh":"npm install -g @tigrisdata/cli"}function x(e={}){return new Promise((n,o)=>{let r=I.get(d,{timeout:1e4},t=>{let s="";t.on("data",i=>{s+=i}),t.on("end",()=>{try{let i=JSON.parse(s);typeof i.version=="string"?(w({...y(),latestVersion:i.version,lastChecked:Date.now()}),n(i.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});r.on("error",t=>{o(t)}),r.on("timeout",()=>{r.destroy(),o(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function S(){x({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(p,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${p} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',s=Math.max(r.length,t.length)+4,i=`\u250C${"\u2500".repeat(s-2)}\u2510`,c=`\u2514${"\u2500".repeat(s-2)}\u2518`,a=l=>`\u2502 ${l.padEnd(s-4)} \u2502`;console.log(`
1
+ import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as C,readFileSync as k,realpathSync as _,writeFileSync as E}from"fs";import I from"https";import{homedir as g}from"os";import{join as h}from"path";var p="3.4.3";var b=h(g(),".tigris","update-check.json");function y(){try{let e=k(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function w(e){try{C(h(g(),".tigris"),{recursive:!0}),E(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let o=s=>{let i=s.startsWith("v")?s.slice(1):s,c=null,a=i.indexOf("-");a!==-1&&(c=i.slice(a+1),i=i.slice(0,a));let l=i.split(".");if(l.length!==3)return null;let u=l.map(Number);return u.some(Number.isNaN)?null:{major:u[0],minor:u[1],patch:u[2],prerelease:c}},r=o(e),t=o(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function T(){if(process.platform==="win32")return!1;try{let e=_(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function L(){return globalThis.__TIGRIS_BINARY===!0?T()?"brew upgrade tigris":process.platform==="win32"?"irm https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.ps1 | iex":"curl -fsSL https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.sh | sh":"npm install -g @tigrisdata/cli"}function x(e={}){return new Promise((n,o)=>{let r=I.get(d,{timeout:1e4},t=>{let s="";t.on("data",i=>{s+=i}),t.on("end",()=>{try{let i=JSON.parse(s);typeof i.version=="string"?(w({...y(),latestVersion:i.version,lastChecked:Date.now()}),n(i.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});r.on("error",t=>{o(t)}),r.on("timeout",()=>{r.destroy(),o(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function S(){x({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(p,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${p} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',s=Math.max(r.length,t.length)+4,i=`\u250C${"\u2500".repeat(s-2)}\u2510`,c=`\u2514${"\u2500".repeat(s-2)}\u2518`,a=l=>`\u2502 ${l.padEnd(s-4)} \u2502`;console.log(`
2
2
  ${i}
3
3
  ${a("")}
4
4
  ${a(r)}
@@ -1 +1 @@
1
- import{a as s,f as l}from"./chunk-6JDBAIGA.js";import{a as i,k as m}from"./chunk-Z2LVZ3ZF.js";import{b as t}from"./chunk-NI4EYBQH.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=`${a(d,"lib",...o)}.js`;if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
1
+ import{a as s,f as l}from"./chunk-2Q2EKNAN.js";import{a as i,k as m}from"./chunk-Z2LVZ3ZF.js";import{b as t}from"./chunk-NI4EYBQH.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=`${a(d,"lib",...o)}.js`;if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./chunk-6FFMMSBH.js";import"./chunk-6JDBAIGA.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
2
+ import"./chunk-7O7LNYMA.js";import"./chunk-2Q2EKNAN.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-6FFMMSBH.js";import"./chunk-6JDBAIGA.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
1
+ import"./chunk-7O7LNYMA.js";import"./chunk-2Q2EKNAN.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
@@ -1 +1 @@
1
- import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-6JDBAIGA.js";import{b as m}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import{execSync as h}from"child_process";var r=c("update");async function v(u={}){let g=d(u);s(r);try{let o=await f(),e=l(t,o),n=p();if(g==="json"){console.log(JSON.stringify({currentVersion:t,latestVersion:o,updateAvailable:e,updateCommand:n}));return}console.log(`Current version: ${t}`),e?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",...process.platform==="win32"?{shell:"powershell.exe"}:{}}),i(r,{latestVersion:o})):a(r,{currentVersion:t})}catch(o){m(r,o)}}export{v as default};
1
+ import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-2Q2EKNAN.js";import{b as m}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import{execSync as h}from"child_process";var r=c("update");async function v(u={}){let g=d(u);s(r);try{let o=await f(),e=l(t,o),n=p();if(g==="json"){console.log(JSON.stringify({currentVersion:t,latestVersion:o,updateAvailable:e,updateCommand:n}));return}console.log(`Current version: ${t}`),e?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",...process.platform==="win32"?{shell:"powershell.exe"}:{}}),i(r,{latestVersion:o})):a(r,{currentVersion:t})}catch(o){m(r,o)}}export{v as default};
@@ -1 +1 @@
1
- import{b as a,c as b,d as c,e as d,f as e}from"../chunk-6JDBAIGA.js";import"../chunk-ATBINUDP.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
1
+ import{b as a,c as b,d as c,e as d,f as e}from"../chunk-2Q2EKNAN.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": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "description": "Command line interface for Tigris object storage",
5
5
  "type": "module",
6
6
  "exports": {