@tigrisdata/cli 2.16.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.
@@ -1 +1 @@
1
- import{a as s,f as l}from"./chunk-YYVLDLPP.js";import{a as i,k as m}from"./chunk-TRRXHLUE.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();
1
+ import{a as s,f as l}from"./chunk-XAZRKVEQ.js";import{a as i,k as m}from"./chunk-TRRXHLUE.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();
@@ -1,4 +1,4 @@
1
- import{d as m,e as d,f}from"./chunk-ATBINUDP.js";import{execSync as _}from"child_process";import{mkdirSync as C,readFileSync as E,writeFileSync as I}from"fs";import T from"https";import{homedir as g}from"os";import{join as h}from"path";var u="2.16.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}),I(b,JSON.stringify(t),"utf-8")}catch{}}function N(t,i){let a=n=>{let s=n.startsWith("v")?n.slice(1):n,l=null,o=s.indexOf("-");o!==-1&&(l=s.slice(o+1),s=s.slice(0,o));let c=s.split(".");if(c.length!==3)return null;let p=c.map(Number);return p.some(isNaN)?null:{major:p[0],minor:p[1],patch:p[2],prerelease:l}},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 x(){if(process.platform==="win32")return!1;try{return _("brew list tigris",{stdio:"ignore"}),!0}catch{return!1}}function O(){let t=globalThis.__TIGRIS_BINARY===!0,i=process.platform==="win32";return t?x()?"brew upgrade tigris":i?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function j(t={}){return new Promise((i,a)=>{let r=T.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 k(){j({unref:!0}).catch(()=>{})}function P(){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&&N(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",l="\u2514"+"\u2500".repeat(n-2)+"\u2518",o=c=>"\u2502 "+c.padEnd(n-4)+" \u2502";console.log(`
1
+ import{d as m,e as d,f}from"./chunk-ATBINUDP.js";import{execSync as _}from"child_process";import{mkdirSync as C,readFileSync as E,writeFileSync as I}from"fs";import T from"https";import{homedir as g}from"os";import{join as h}from"path";var u="2.16.1";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}),I(b,JSON.stringify(t),"utf-8")}catch{}}function N(t,i){let a=n=>{let s=n.startsWith("v")?n.slice(1):n,l=null,o=s.indexOf("-");o!==-1&&(l=s.slice(o+1),s=s.slice(0,o));let c=s.split(".");if(c.length!==3)return null;let p=c.map(Number);return p.some(isNaN)?null:{major:p[0],minor:p[1],patch:p[2],prerelease:l}},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 x(){if(process.platform==="win32")return!1;try{return _("brew list tigris",{stdio:"ignore"}),!0}catch{return!1}}function O(){let t=globalThis.__TIGRIS_BINARY===!0,i=process.platform==="win32";return t?x()?"brew upgrade tigris":i?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function j(t={}){return new Promise((i,a)=>{let r=T.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 k(){j({unref:!0}).catch(()=>{})}function P(){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&&N(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",l="\u2514"+"\u2500".repeat(n-2)+"\u2518",o=c=>"\u2502 "+c.padEnd(n-4)+" \u2502";console.log(`
2
2
  ${s}
3
3
  ${o("")}
4
4
  ${o(r)}
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./chunk-AU3RCZHB.js";import"./chunk-YYVLDLPP.js";import"./chunk-TRRXHLUE.js";import"./chunk-VAVMX5DC.js";import"./chunk-DV3LCXRH.js";import"./chunk-PG746YF3.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
2
+ import"./chunk-VYYV76WE.js";import"./chunk-XAZRKVEQ.js";import"./chunk-TRRXHLUE.js";import"./chunk-VAVMX5DC.js";import"./chunk-DV3LCXRH.js";import"./chunk-PG746YF3.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-AU3RCZHB.js";import"./chunk-YYVLDLPP.js";import"./chunk-TRRXHLUE.js";import"./chunk-VAVMX5DC.js";import"./chunk-DV3LCXRH.js";import"./chunk-PG746YF3.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
1
+ import"./chunk-VYYV76WE.js";import"./chunk-XAZRKVEQ.js";import"./chunk-TRRXHLUE.js";import"./chunk-VAVMX5DC.js";import"./chunk-DV3LCXRH.js";import"./chunk-PG746YF3.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
@@ -1 +1 @@
1
- import{b as x}from"../../chunk-LVAJB4FR.js";import{f as K,g as P}from"../../chunk-IRDNZN7R.js";import"../../chunk-ALJKYIQL.js";import{b as h,c as T}from"../../chunk-YFMOI263.js";import{b as l}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as u,e as g,i as k,j as y}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-GAWFFIPC.js";import"../../chunk-OHGCOC5Q.js";import{listAccessKeys as O}from"@tigrisdata/iam";var t=y("access-keys","list");async function S(s){f(t);let e=h(s),{limit:i,pageToken:r,isPaginated:c}=T(s),w=await x(t),{data:n,error:m}=await O({...i!==void 0?{limit:i}:{},...r?{paginationToken:r}:{},config:w});if(m&&l(t,m),!n.accessKeys||n.accessKeys.length===0){g(t);return}let o=n.accessKeys.map(a=>({name:a.name,id:a.id,status:a.status,created:a.createdAt})),d=[{key:"name",header:"Name"},{key:"id",header:"ID"},{key:"status",header:"Status"},{key:"created",header:"Created"}],p=n.paginationToken||void 0,A=c?P(o,e,"keys","key",d,{paginationToken:p}):K(o,e,"keys","key",d);console.log(A),c&&e!=="json"&&e!=="xml"&&k(p),u(t,{count:o.length})}export{S as default};
1
+ import{b as h}from"../../chunk-LVAJB4FR.js";import{g as T}from"../../chunk-IRDNZN7R.js";import"../../chunk-ALJKYIQL.js";import{b as k,c as y}from"../../chunk-YFMOI263.js";import{b as l}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as d,c as p,e as f,i as g,j as u}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-GAWFFIPC.js";import"../../chunk-OHGCOC5Q.js";import{listAccessKeys as A}from"@tigrisdata/iam";var t=u("access-keys","list");async function P(a){d(t);let o=k(a),{limit:s,pageToken:i}=y(a),x=await h(t),{data:e,error:r}=await A({...s!==void 0?{limit:s}:{},...i?{paginationToken:i}:{},config:x});if(r&&l(t,r),!e.accessKeys||e.accessKeys.length===0){f(t);return}let c=e.accessKeys.map(n=>({name:n.name,id:n.id,status:n.status,created:n.createdAt})),K=[{key:"name",header:"Name"},{key:"id",header:"ID"},{key:"status",header:"Status"},{key:"created",header:"Created"}],m=e.paginationToken||void 0,w=T(c,o,"keys","key",K,{paginationToken:m});console.log(w),o!=="json"&&o!=="xml"&&g(m),p(t,{count:c.length})}export{P as default};
@@ -1 +1 @@
1
- import{f as d,g as E}from"../../chunk-IRDNZN7R.js";import{d as D}from"../../chunk-ALJKYIQL.js";import{a as x,b as B,c as C}from"../../chunk-YFMOI263.js";import{b as g}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as O,c as k,e as s,i as P,j as T}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{getBucketInfo as N,listBuckets as j}from"@tigrisdata/storage";var t=T("buckets","list");async function A(f){O(t);let n=B(f),e=x(f,["forks-of","forksOf"]),{limit:p,pageToken:l,isPaginated:r}=C(f),u=await D();e&&r&&console.warn("\u26A0 Pagination flags are ignored when --forks-of is used (all buckets are fetched for filtering)");let{data:o,error:h}=await j({...e||!r?{}:{...p!==void 0?{limit:p}:{},...l?{paginationToken:l}:{}},config:u});if(h&&g(t,h),!o.buckets||o.buckets.length===0){s(t);return}if(e){let{data:a,error:y}=await N(e,{config:u});if(y&&g(t,y),!a.hasForks){s(t);return}let i=[];for(let c of o.buckets){if(c.name===e)continue;let{data:I}=await N(c.name,{config:u});I?.sourceBucketName===e&&i.push({name:c.name,created:c.creationDate})}if(i.length===0){s(t);return}let F=d(i,n,"forks","fork",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(F),k(t,{count:i.length});return}let m=o.buckets.map(a=>({name:a.name,created:a.creationDate})),b=[{key:"name",header:"Name"},{key:"created",header:"Created"}],w=o.paginationToken||void 0,S=r?E(m,n,"buckets","bucket",b,{paginationToken:w}):d(m,n,"buckets","bucket",b);console.log(S),r&&n!=="json"&&n!=="xml"&&P(w),k(t,{count:m.length})}export{A as default};
1
+ import{f as x,g as I}from"../../chunk-IRDNZN7R.js";import{d as T}from"../../chunk-ALJKYIQL.js";import{a as y,b as C,c as P}from"../../chunk-YFMOI263.js";import{b as m}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b,c as u,e as s,i as O,j as w}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{getBucketInfo as D,listBuckets as F}from"@tigrisdata/storage";var t=w("buckets","list");async function H(f){b(t);let o=C(f),e=y(f,["forks-of","forksOf"]),{limit:k,pageToken:g,isPaginated:E}=P(f),c=await T();e&&E&&console.warn("\u26A0 Pagination flags are ignored when --forks-of is used (all buckets are fetched for filtering)");let{data:n,error:d}=await F({...e?{}:{...k!==void 0?{limit:k}:{},...g?{paginationToken:g}:{}},config:c});if(d&&m(t,d),!n.buckets||n.buckets.length===0){s(t);return}if(e){let{data:r,error:h}=await D(e,{config:c});if(h&&m(t,h),!r.forkInfo?.hasChildren){s(t);return}let a=[];for(let i of n.buckets){if(i.name===e)continue;let{data:j}=await D(i.name,{config:c});j?.forkInfo?.parents?.some(A=>A.bucketName===e)&&a.push({name:i.name,created:i.creationDate})}if(a.length===0){s(t);return}let B=x(a,o,"forks","fork",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(B),u(t,{count:a.length});return}let l=n.buckets.map(r=>({name:r.name,created:r.creationDate})),N=[{key:"name",header:"Name"},{key:"created",header:"Created"}],p=n.paginationToken||void 0,S=I(l,o,"buckets","bucket",N,{paginationToken:p});console.log(S),o!=="json"&&o!=="xml"&&O(p),u(t,{count:l.length})}export{H as default};
@@ -1 +1 @@
1
- import{f as l}from"../../chunk-IRDNZN7R.js";import{d}from"../../chunk-ALJKYIQL.js";import{a as g,b as p}from"../../chunk-YFMOI263.js";import{b as n}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as u,e as i,j as k}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{getBucketInfo as h,listBuckets as E}from"@tigrisdata/storage";var t=k("forks","list");async function x(c){m(t);let r=g(c,["name"]),w=p(c);r||n(t,"Source bucket name is required");let a=await d(),{data:y,error:f}=await h(r,{config:a});if(f&&n(t,f),!y.hasForks){i(t);return}let{data:b,error:s}=await E({config:a});s&&n(t,s);let e=[];for(let o of b.buckets){if(o.name===r)continue;let{data:B}=await h(o.name,{config:a});B?.sourceBucketName===r&&e.push({name:o.name,created:o.creationDate})}if(e.length===0){i(t);return}let S=l(e,w,"forks","fork",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(S),u(t,{count:e.length})}export{x as default};
1
+ import{f as l}from"../../chunk-IRDNZN7R.js";import{d as g}from"../../chunk-ALJKYIQL.js";import{a as d,b as p}from"../../chunk-YFMOI263.js";import{b as n}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c as u,e as i,j as k}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{getBucketInfo as h,listBuckets as S}from"@tigrisdata/storage";var t=k("forks","list");async function E(f){m(t);let r=d(f,["name"]),b=p(f);r||n(t,"Source bucket name is required");let a=await g(),{data:w,error:c}=await h(r,{config:a});if(c&&n(t,c),!w.forkInfo?.hasChildren){i(t);return}let{data:y,error:s}=await S({config:a});s&&n(t,s);let o=[];for(let e of y.buckets){if(e.name===r)continue;let{data:I}=await h(e.name,{config:a});I?.forkInfo?.parents?.some(O=>O.bucketName===r)&&o.push({name:e.name,created:e.creationDate})}if(o.length===0){i(t);return}let C=l(o,b,"forks","fork",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(C),u(t,{count:o.length})}export{E as default};
@@ -1 +1 @@
1
- import{a as x}from"../../../chunk-LVAJB4FR.js";import{f as C,g as D}from"../../../chunk-IRDNZN7R.js";import"../../../chunk-ALJKYIQL.js";import{b as y,c as P}from"../../../chunk-YFMOI263.js";import{b as T}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as g,c as f,e as l,i as h,j as k}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import{listPolicies as I}from"@tigrisdata/iam";var e=k("iam policies","list");async function O(r){g(e);let i=y(r),{limit:s,pageToken:c,isPaginated:d}=P(r),o=await x(e),{data:n,error:m}=await I({...s!==void 0?{limit:s}:{},...c?{paginationToken:c}:{},config:{sessionToken:o.sessionToken,organizationId:o.organizationId,iamEndpoint:o.iamEndpoint}});if(m&&T(e,m),!n.policies||n.policies.length===0){l(e);return}let a=n.policies.map(t=>({name:t.name,id:t.id,resource:t.resource,description:t.description||"-",attachments:t.attachmentCount,created:t.createDate,updated:t.updateDate})),p=[{key:"id",header:"ID"},{key:"resource",header:"Resource"},{key:"name",header:"Name"},{key:"description",header:"Description"},{key:"attachments",header:"Attachments"},{key:"created",header:"Created"},{key:"updated",header:"Updated"}],u=n.paginationToken||void 0,E=d?D(a,i,"policies","policy",p,{paginationToken:u}):C(a,i,"policies","policy",p);console.log(E),d&&i!=="json"&&i!=="xml"&&h(u),f(e,{count:a.length})}export{O as default};
1
+ import{a as x}from"../../../chunk-LVAJB4FR.js";import{g as y}from"../../../chunk-IRDNZN7R.js";import"../../../chunk-ALJKYIQL.js";import{b as l,c as T}from"../../../chunk-YFMOI263.js";import{b as k}from"../../../chunk-VAVMX5DC.js";import"../../../chunk-DV3LCXRH.js";import{b as p,c as u,e as g,i as f,j as h}from"../../../chunk-PG746YF3.js";import"../../../chunk-PPNBQWSR.js";import"../../../chunk-ATBINUDP.js";import"../../../chunk-KK7FZ7QM.js";import"../../../chunk-GAWFFIPC.js";import"../../../chunk-OHGCOC5Q.js";import{listPolicies as E}from"@tigrisdata/iam";var t=h("iam policies","list");async function I(a){p(t);let i=l(a),{limit:r,pageToken:s}=T(a),o=await x(t),{data:n,error:c}=await E({...r!==void 0?{limit:r}:{},...s?{paginationToken:s}:{},config:{sessionToken:o.sessionToken,organizationId:o.organizationId,iamEndpoint:o.iamEndpoint}});if(c&&k(t,c),!n.policies||n.policies.length===0){g(t);return}let d=n.policies.map(e=>({name:e.name,id:e.id,resource:e.resource,description:e.description||"-",attachments:e.attachmentCount,created:e.createDate,updated:e.updateDate})),C=[{key:"id",header:"ID"},{key:"resource",header:"Resource"},{key:"name",header:"Name"},{key:"description",header:"Description"},{key:"attachments",header:"Attachments"},{key:"created",header:"Created"},{key:"updated",header:"Updated"}],m=n.paginationToken||void 0,D=y(d,i,"policies","policy",C,{paginationToken:m});console.log(D),i!=="json"&&i!=="xml"&&f(m),u(t,{count:d.length})}export{I as default};
package/dist/lib/ls.js CHANGED
@@ -1 +1 @@
1
- import{a as b,f as m}from"../chunk-IRDNZN7R.js";import{f as w}from"../chunk-JQUG732D.js";import{d as f}from"../chunk-ALJKYIQL.js";import{a as d,b as y}from"../chunk-YFMOI263.js";import{a}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{list as O,listBuckets as W}from"@tigrisdata/storage";async function v(i){let p=d(i,["path"]),h=d(i,["snapshot-version","snapshotVersion","snapshot"]),l=y(i);if(!p){let e=await f(),{data:t,error:o}=await W({config:e});o&&a(o);let n=(t.buckets||[]).map(g=>({name:g.name,created:g.creationDate})),c=m(n,l,"buckets","bucket",[{key:"name",header:"Name"},{key:"created",header:"Created"}]);console.log(c);return}let{bucket:u,path:s}=w(p);u||a("Invalid path");let x=await f(),r=s?s.endsWith("/")?s:`${s}/`:void 0,{data:z,error:k}=await O({prefix:r,...h?{snapshotVersion:h}:{},config:{...x,bucket:u}});k&&a(k);let S=(z.items||[]).map(e=>{let t=r?e.name.slice(r.length):e.name,o=t.indexOf("/"),n=o===-1?t:t.slice(0,o+1),c=n.endsWith("/");return{key:n,size:c?"-":b(e.size),modified:e.lastModified}}).filter((e,t,o)=>e.key!==""&&o.findIndex(n=>n.key===e.key)===t),j=m(S,l,"objects","object",[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}]);console.log(j)}export{v as default};
1
+ import{a as O,g as u}from"../chunk-IRDNZN7R.js";import{f as P}from"../chunk-JQUG732D.js";import{d as k}from"../chunk-ALJKYIQL.js";import{a as g,b as z,c as S}from"../chunk-YFMOI263.js";import{a as d}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{i as p}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import"../chunk-KK7FZ7QM.js";import"../chunk-OHGCOC5Q.js";import{list as M,listBuckets as N}from"@tigrisdata/storage";async function V(a){let l=g(a,["path"]),h=g(a,["snapshot-version","snapshotVersion","snapshot"]),o=z(a),{limit:s,pageToken:r}=S(a);if(!l){let n=await k(),{data:e,error:t}=await N({...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:n});t&&d(t);let i=(e.buckets||[]).map(w=>({name:w.name,created:w.creationDate})),m=[{key:"name",header:"Name"},{key:"created",header:"Created"}],j=e.paginationToken||void 0,I=u(i,o,"buckets","bucket",m,{paginationToken:j});console.log(I),o!=="json"&&o!=="xml"&&p(j);return}let{bucket:y,path:c}=P(l);y||d("Invalid path");let W=await k(),f=c?c.endsWith("/")?c:`${c}/`:void 0,{data:x,error:T}=await M({prefix:f,...h?{snapshotVersion:h}:{},...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:{...W,bucket:y}});T&&d(T);let v=(x.items||[]).map(n=>{let e=f?n.name.slice(f.length):n.name,t=e.indexOf("/"),i=t===-1?e:e.slice(0,t+1),m=i.endsWith("/");return{key:i,size:m?"-":O(n.size),modified:n.lastModified}}).filter((n,e,t)=>n.key!==""&&t.findIndex(i=>i.key===n.key)===e),C=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],b=x.paginationToken||void 0,F=u(v,o,"objects","object",C,{paginationToken:b});console.log(F),o!=="json"&&o!=="xml"&&p(b)}export{V as default};
@@ -1 +1 @@
1
- import{a as S,f as T,g as w}from"../../chunk-IRDNZN7R.js";import{f as A}from"../../chunk-JQUG732D.js";import{d as O}from"../../chunk-ALJKYIQL.js";import{a as i,b as P,c as z}from"../../chunk-YFMOI263.js";import{b as a}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as h,c as b,e as y,i as j,j as x}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{list as v}from"@tigrisdata/storage";var e=x("objects","list");async function B(t){h(e);let c=i(t,["bucket"]),E=i(t,["prefix","p","P"]),n=P(t),f=i(t,["snapshot-version","snapshotVersion","snapshot"]),{limit:m,pageToken:p,isPaginated:g}=z(t);c||a(e,"Bucket name is required");let d=A(c),F=d.bucket,M=E||d.path||void 0,V=await O(),{data:o,error:u}=await v({prefix:M,...f?{snapshotVersion:f}:{},...m!==void 0?{limit:m}:{},...p?{paginationToken:p}:{},config:{...V,bucket:F}});if(u&&a(e,u),!o.items||o.items.length===0){y(e);return}let r=o.items.map(s=>({key:s.name,size:S(s.size),modified:s.lastModified})),k=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],l=o.paginationToken||void 0,q=g?w(r,n,"objects","object",k,{paginationToken:l}):T(r,n,"objects","object",k);console.log(q),g&&n!=="json"&&n!=="xml"&&j(l),b(e,{count:r.length})}export{B as default};
1
+ import{a as P,g as S}from"../../chunk-IRDNZN7R.js";import{f as T}from"../../chunk-JQUG732D.js";import{d as z}from"../../chunk-ALJKYIQL.js";import{a as o,b as x,c as j}from"../../chunk-YFMOI263.js";import{b as s}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as k,c as l,e as h,i as b,j as y}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{list as V}from"@tigrisdata/storage";var e=y("objects","list");async function q(t){k(e);let a=o(t,["bucket"]),O=o(t,["prefix","p","P"]),i=x(t),c=o(t,["snapshot-version","snapshotVersion","snapshot"]),{limit:f,pageToken:m}=j(t);a||s(e,"Bucket name is required");let p=T(a),w=p.bucket,A=O||p.path||void 0,E=await z(),{data:n,error:g}=await V({prefix:A,...c?{snapshotVersion:c}:{},...f!==void 0?{limit:f}:{},...m?{paginationToken:m}:{},config:{...E,bucket:w}});if(g&&s(e,g),!n.items||n.items.length===0){h(e);return}let d=n.items.map(r=>({key:r.name,size:P(r.size),modified:r.lastModified})),F=[{key:"key",header:"Key"},{key:"size",header:"Size"},{key:"modified",header:"Modified"}],u=n.paginationToken||void 0,M=S(d,i,"objects","object",F,{paginationToken:u});console.log(M),i!=="json"&&i!=="xml"&&b(u),l(e,{count:d.length})}export{q as default};
@@ -1 +1 @@
1
- import{f as h}from"../../chunk-IRDNZN7R.js";import{d}from"../../chunk-ALJKYIQL.js";import{a as u,b as g}from"../../chunk-YFMOI263.js";import{b as o}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as m,c,e as p,j as f}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{listBucketSnapshots as S}from"@tigrisdata/storage";var t=f("snapshots","list");async function v(n){m(t);let a=u(n,["name"]),l=g(n);a||o(t,"Bucket name is required");let k=await d(),{data:e,error:i}=await S(a,{config:k});if(i&&o(t,i),!e||e.length===0){p(t);return}let s=e.map(r=>({name:r.name||"",version:r.version||"",created:r.creationDate})),y=h(s,l,"snapshots","snapshot",[{key:"name",header:"Name"},{key:"version",header:"Version"},{key:"created",header:"Created"}]);console.log(y),c(t,{count:s.length})}export{v as default};
1
+ import{g as S}from"../../chunk-IRDNZN7R.js";import{d as x}from"../../chunk-ALJKYIQL.js";import{a as k,b as y,c as T}from"../../chunk-YFMOI263.js";import{b as i}from"../../chunk-VAVMX5DC.js";import"../../chunk-DV3LCXRH.js";import{b as f,c as u,e as d,i as h,j as l}from"../../chunk-PG746YF3.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{listBucketSnapshots as P}from"@tigrisdata/storage";var t=l("snapshots","list");async function B(o){f(t);let r=k(o,["name"]),e=y(o),{limit:s,pageToken:m}=T(o);r||i(t,"Bucket name is required");let v=await x(),{data:n,error:c}=await P(r,{...s!==void 0?{limit:s}:{},...m?{paginationToken:m}:{},config:v});if(c&&i(t,c),!n.snapshots||n.snapshots.length===0){d(t);return}let p=n.snapshots.map(a=>({name:a.name||"",version:a.version||"",created:a.creationDate})),w=[{key:"name",header:"Name"},{key:"version",header:"Version"},{key:"created",header:"Created"}],g=n.paginationToken||void 0,O=S(p,e,"snapshots","snapshot",w,{paginationToken:g});console.log(O),e!=="json"&&e!=="xml"&&h(g),u(t,{count:p.length})}export{B as default};
@@ -1 +1 @@
1
- import{b as d}from"../chunk-YFMOI263.js";import{a as t,c as l,d as p,e as f}from"../chunk-YYVLDLPP.js";import{b as m}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.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-YFMOI263.js";import{a as t,c as l,d as p,e as f}from"../chunk-XAZRKVEQ.js";import{b as m}from"../chunk-VAVMX5DC.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-PG746YF3.js";import"../chunk-PPNBQWSR.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};
package/dist/specs.yaml CHANGED
@@ -292,6 +292,11 @@ commands:
292
292
  description: Output format
293
293
  options: [json, table, xml]
294
294
  default: table
295
+ - name: limit
296
+ description: Maximum number of items to return per page
297
+ - name: page-token
298
+ description: Pagination token from a previous request to fetch the next page
299
+ alias: pt
295
300
 
296
301
  # mk
297
302
  - name: mk
@@ -1115,6 +1120,11 @@ commands:
1115
1120
  description: Output format
1116
1121
  options: [json, table, xml]
1117
1122
  default: table
1123
+ - name: limit
1124
+ description: Maximum number of items to return per page
1125
+ - name: page-token
1126
+ description: Pagination token from a previous request to fetch the next page
1127
+ alias: pt
1118
1128
  # take
1119
1129
  - name: take
1120
1130
  description: Take a new snapshot of the bucket's current state. Optionally provide a name for the snapshot
@@ -1 +1 @@
1
- import{b as a,c as b,d as c,e as d,f as e}from"../chunk-YYVLDLPP.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-XAZRKVEQ.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.16.0",
3
+ "version": "2.16.1",
4
4
  "description": "Command line interface for Tigris object storage",
5
5
  "type": "module",
6
6
  "exports": {
@@ -93,7 +93,7 @@
93
93
  "@aws-sdk/credential-providers": "^3.1024.0",
94
94
  "@smithy/shared-ini-file-loader": "^4.4.7",
95
95
  "@tigrisdata/iam": "^1.4.1",
96
- "@tigrisdata/storage": "^2.16.2",
96
+ "@tigrisdata/storage": "^3.0.0",
97
97
  "commander": "^14.0.3",
98
98
  "enquirer": "^2.4.1",
99
99
  "jose": "^6.2.2",