@tigrisdata/cli 2.6.0 → 2.6.2

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.
Files changed (65) hide show
  1. package/README.md +22 -13
  2. package/dist/auth/client.js +1 -1
  3. package/dist/auth/config.js +1 -1
  4. package/dist/auth/s3-client.js +1 -1
  5. package/dist/auth/storage.js +1 -1
  6. package/dist/chunk-4LGKN5DA.js +1 -0
  7. package/dist/chunk-6U4U4JM6.js +1 -0
  8. package/dist/chunk-A3TXP5Y2.js +2 -0
  9. package/dist/chunk-D63SZLT5.js +1 -0
  10. package/dist/chunk-DJIPPZGR.js +4 -0
  11. package/dist/chunk-ESJWTUFN.js +1 -0
  12. package/dist/chunk-HE7E7ZMA.js +1 -0
  13. package/dist/chunk-HGIJOGCZ.js +6 -0
  14. package/dist/chunk-JRALYIRA.js +1 -0
  15. package/dist/chunk-JVB3Y42V.js +1 -0
  16. package/dist/chunk-LCWHZUZZ.js +1 -0
  17. package/dist/chunk-QZXBLNMQ.js +1 -0
  18. package/dist/chunk-TPUZYSCZ.js +12 -0
  19. package/dist/chunk-TUJTXB5G.js +8 -0
  20. package/dist/cli.js +1 -12
  21. package/dist/constants.js +1 -1
  22. package/dist/index.js +1 -12
  23. package/dist/lib/_stat.js +1 -1
  24. package/dist/lib/access-keys/assign.js +2 -3
  25. package/dist/lib/access-keys/create.js +2 -3
  26. package/dist/lib/access-keys/delete.js +2 -3
  27. package/dist/lib/access-keys/get.js +2 -3
  28. package/dist/lib/access-keys/list.js +2 -8
  29. package/dist/lib/buckets/create.js +1 -2
  30. package/dist/lib/buckets/delete.js +1 -2
  31. package/dist/lib/buckets/get.js +1 -7
  32. package/dist/lib/buckets/list.js +1 -7
  33. package/dist/lib/buckets/set.js +1 -2
  34. package/dist/lib/configure/index.js +1 -2
  35. package/dist/lib/cp.js +1 -1
  36. package/dist/lib/credentials/test.js +1 -2
  37. package/dist/lib/forks/create.js +1 -2
  38. package/dist/lib/forks/list.js +1 -7
  39. package/dist/lib/login/credentials.js +1 -2
  40. package/dist/lib/login/oauth.js +1 -5
  41. package/dist/lib/login/select.js +1 -5
  42. package/dist/lib/logout.js +1 -2
  43. package/dist/lib/ls.js +1 -6
  44. package/dist/lib/mk.js +1 -1
  45. package/dist/lib/mv.js +1 -1
  46. package/dist/lib/objects/delete.js +1 -2
  47. package/dist/lib/objects/get.js +1 -2
  48. package/dist/lib/objects/list.js +1 -7
  49. package/dist/lib/objects/put.js +1 -7
  50. package/dist/lib/organizations/create.js +2 -3
  51. package/dist/lib/organizations/list.js +2 -8
  52. package/dist/lib/organizations/select.js +4 -5
  53. package/dist/lib/rm.js +1 -1
  54. package/dist/lib/snapshots/list.js +1 -7
  55. package/dist/lib/snapshots/take.js +1 -2
  56. package/dist/lib/touch.js +1 -1
  57. package/dist/lib/whoami.js +2 -3
  58. package/dist/specs.yaml +49 -28
  59. package/dist/utils/format.js +1 -6
  60. package/dist/utils/messages.js +1 -2
  61. package/dist/utils/options.js +1 -1
  62. package/dist/utils/path.js +1 -1
  63. package/dist/utils/specs.js +1 -1
  64. package/dist/utils/update-check.js +1 -0
  65. package/package.json +3 -2
package/dist/specs.yaml CHANGED
@@ -200,10 +200,12 @@ commands:
200
200
  arguments:
201
201
  - name: path
202
202
  type: positional
203
- description: a bucket or path in a bucket (if not provided, lists all buckets)
203
+ description: a bucket or path in a bucket (if not provided, lists all buckets). Supports t3:// and tigris:// prefixes.
204
204
  examples:
205
205
  - my-bucket
206
206
  - my-bucket/my-path
207
+ - t3://my-bucket
208
+ - t3://my-bucket/my-path
207
209
 
208
210
  # mk
209
211
  - name: mk
@@ -213,10 +215,12 @@ commands:
213
215
  - name: path
214
216
  required: true
215
217
  type: positional
216
- description: a bucket or a folder in a bucket
218
+ description: a bucket or a folder in a bucket. Supports t3:// and tigris:// prefixes.
217
219
  examples:
218
220
  - my-bucket
219
221
  - my-bucket/my-path
222
+ - t3://my-bucket
223
+ - t3://my-bucket/my-path
220
224
 
221
225
  # touch
222
226
  - name: touch
@@ -225,9 +229,10 @@ commands:
225
229
  - name: path
226
230
  required: true
227
231
  type: positional
228
- description: path to the object (bucket/key)
232
+ description: path to the object (bucket/key). Supports t3:// and tigris:// prefixes.
229
233
  examples:
230
234
  - my-bucket/my-file.txt
235
+ - t3://my-bucket/my-file.txt
231
236
 
232
237
  # stat
233
238
  - name: stat
@@ -236,55 +241,67 @@ commands:
236
241
  - name: path
237
242
  required: true
238
243
  type: positional
239
- description: a bucket or a folder in a bucket or an object in a bucket or path
244
+ description: a bucket, folder, or object path. Supports t3:// and tigris:// prefixes.
240
245
  examples:
241
246
  - my-bucket
242
247
  - my-bucket/my-path
248
+ - t3://my-bucket
249
+ - t3://my-bucket/my-path
243
250
  - my-bucket/my-path/my-object.json
244
251
 
245
252
  # cp
246
253
  - name: cp
247
- description: Copy a folder or an object
254
+ description: Copy files between local filesystem and Tigris, or within Tigris
248
255
  alias: copy
249
256
  arguments:
250
257
  - name: src
251
258
  required: true
252
259
  type: positional
253
- description: a bucket, a folder in a bucket, an object in a bucket / path. Wildcard is supported.
260
+ description: source path. Use t3:// (or tigris://) prefix for remote Tigris paths, bare paths for local files. At least one side must be remote. Quote wildcard patterns to prevent shell expansion.
254
261
  examples:
255
- - my-bucket
256
- - my-bucket/my-path
257
- - my-bucket/my-path/my-object.json
262
+ - ./file.txt
263
+ - ./dir/
264
+ - '"./dir/*.jpg"'
265
+ - t3://my-bucket/my-path/my-object.json
266
+ - t3://my-bucket/my-path/*
258
267
  - name: dest
259
268
  required: true
260
269
  type: positional
261
- description: path to copy to
270
+ description: destination path. Use t3:// (or tigris://) prefix for remote Tigris paths, bare paths for local files.
262
271
  examples:
263
- - my-bucket
264
- - my-bucket/my-path
265
- - my-bucket/my-path/*
266
- - my-bucket/my-path/my-object.json
272
+ - .
273
+ - ./local-dir/
274
+ - t3://my-bucket
275
+ - t3://my-bucket/my-path/
276
+ - name: recursive
277
+ type: flag
278
+ alias: r
279
+ description: copy directories recursively
267
280
 
268
281
  # mv
269
282
  - name: mv
270
- description: Move a folder or an object
283
+ description: Move objects within Tigris
271
284
  alias: move
272
285
  arguments:
273
286
  - name: src
274
287
  type: positional
275
288
  required: true
276
- description: path to move from
289
+ description: remote source path. Use t3:// (or tigris://) prefix. Quote wildcard patterns to prevent shell expansion.
277
290
  examples:
278
- - my-bucket/my-path
279
- - my-bucket/my-path/*
280
- - my-bucket/my-path/my-object.json
291
+ - t3://my-bucket/my-path/my-object.json
292
+ - t3://my-bucket/my-path/
293
+ - '"t3://my-bucket/my-path/*.jpg"'
281
294
  - name: dest
282
295
  type: positional
283
296
  required: true
284
- description: path to move to
297
+ description: remote destination path. Use t3:// (or tigris://) prefix.
285
298
  examples:
286
- - my-bucket
287
- - my-bucket/new-path
299
+ - t3://my-bucket
300
+ - t3://my-bucket/new-path/
301
+ - name: recursive
302
+ type: flag
303
+ alias: r
304
+ description: move directories recursively
288
305
  - name: force
289
306
  type: flag
290
307
  alias: f
@@ -292,18 +309,22 @@ commands:
292
309
 
293
310
  # rm
294
311
  - name: rm
295
- description: Remove a bucket or a folder in a bucket or an object in a bucket or path
312
+ description: Remove a bucket, folder, or object from Tigris
296
313
  alias: remove
297
314
  arguments:
298
315
  - name: path
299
316
  type: positional
300
317
  required: true
301
- description: a bucket, a folder in a bucket, an object in a bucket / path. Wildcard is supported.
318
+ description: remote path. Use t3:// (or tigris://) prefix. Bucket-only path removes the bucket. Quote wildcard patterns to prevent shell expansion.
302
319
  examples:
303
- - my-bucket
304
- - my-bucket/my-path
305
- - my-bucket/my-path/*
306
- - my-bucket/my-path/my-object.json
320
+ - t3://my-bucket
321
+ - t3://my-bucket/my-path/my-object.json
322
+ - t3://my-bucket/my-path/
323
+ - '"t3://my-bucket/my-path/*.jpg"'
324
+ - name: recursive
325
+ type: flag
326
+ alias: r
327
+ description: remove directories recursively
307
328
  - name: force
308
329
  type: flag
309
330
  alias: f
@@ -1,6 +1 @@
1
- function m(n){return JSON.stringify(n,null,2)}function l(n,e=" "){return Object.entries(n).map(([t,r])=>`${e}<${t}>${r}</${t}>`).join(`
2
- `)}function T(n,e,t){let r=[`<${e}>`];return n.forEach(o=>{r.push(` <${t}>`),r.push(l(o," ")),r.push(` </${t}>`)}),r.push(`</${e}>`),r.join(`
3
- `)}function p(n){if(n==null)return"";if(n instanceof Date)return f(n);if(typeof n=="string"){let e=new Date(n);if(!isNaN(e.getTime())&&n.includes("T"))return f(e)}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 w(n,e){return e.map(t=>{if(t.width)return t.width;let r=t.header.length,o=n.reduce((s,u)=>{let a=p(u[t.key]);return Math.max(s,a.length)},0);return Math.max(r,o)})}function x(n,e){let t=[],r=w(n,e),o="\u250C"+r.map(i=>"\u2500".repeat(i+2)).join("\u252C")+"\u2510",s="\u251C"+r.map(i=>"\u2500".repeat(i+2)).join("\u253C")+"\u2524",u="\u2514"+r.map(i=>"\u2500".repeat(i+2)).join("\u2534")+"\u2518";t.push(`
4
- `+o);let a="\u2502 "+e.map((i,d)=>i.header.padEnd(r[d])).join(" \u2502 ")+" \u2502";return t.push(a),t.push(s),n.forEach(i=>{let d=e.map((c,g)=>{let h=p(i[c.key]);return c.align==="right"?h.padStart(r[g]):h.padEnd(r[g])});t.push("\u2502 "+d.join(" \u2502 ")+" \u2502")}),t.push(u+`
5
- `),t.join(`
6
- `)}function j(n,e,t,r,o){switch(e){case"json":return m(n);case"xml":return T(n,t,r);default:return x(n,o)}}export{m as formatJson,j as formatOutput,x as formatTable,T as formatXml,l as formatXmlObject};
1
+ import{a,b,c,d,e,f}from"../chunk-HGIJOGCZ.js";export{b as formatJson,f as formatOutput,a as formatSize,e as formatTable,d as formatXml,c as formatXmlObject};
@@ -1,2 +1 @@
1
- import{readFileSync as f,existsSync as d}from"fs";import{join as m,dirname as S}from"path";import{fileURLToPath as C}from"url";import*as l from"yaml";var M=C(import.meta.url),x=S(M),c=null;function y(){let n=x;for(let e=0;e<5;e++){let s=m(n,"specs.yaml");if(d(s))return s;n=m(n,"..")}throw new Error("Could not find specs.yaml")}function A(){if(!c){let n=y(),e=f(n,"utf8");c=l.parse(e)}return c}function g(n,e){let t=A().commands.find(r=>r.name===n);return t?e&&t.operations?t.operations.find(r=>r.name===e)||null:t:null}var p={success:"\u2714",failure:"\u2716",hint:"\u2192"};function a(){return process.stdout.isTTY===!0}function o(n){let e=g(n.command,n.operation);if(e)return e.messages}function i(n,e){let s=n;return s=s.replace(/\\n/g,`
2
- `),e&&(s=s.replace(/\{\{(\w+)\}\}/g,(t,r)=>{let u=e[r];return u!==void 0?String(u):`{{${r}}}`})),s}function O(n,e){if(!a())return;let s=o(n);s?.onStart&&console.log(i(s.onStart,e))}function P(n,e){if(!a())return;let s=o(n);s?.onSuccess&&console.log(`${p.success} ${i(s.onSuccess,e)}`)}function T(n,e,s){let t=o(n);t?.onFailure&&console.error(`${p.failure} ${i(t.onFailure,s)}`),e&&console.error(` ${e}`)}function _(n,e){if(!a())return;let s=o(n);s?.onEmpty&&console.log(i(s.onEmpty,e))}function j(n,e){if(!a())return;let s=o(n);s?.onAlreadyDone&&console.log(i(s.onAlreadyDone,e))}function D(n,e){if(!a())return;let s=o(n);s?.hint&&console.log(`${p.hint} ${i(s.hint,e)}`)}function E(n,e){return{command:n,operation:e}}export{E as msg,j as printAlreadyDone,_ as printEmpty,T as printFailure,D as printHint,O as printStart,P as printSuccess};
1
+ import{a,b,c,d,e,f,g}from"../chunk-A3TXP5Y2.js";import"../chunk-4LGKN5DA.js";export{g as msg,e as printAlreadyDone,d as printEmpty,c as printFailure,f as printHint,a as printStart,b as printSuccess};
@@ -1 +1 @@
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 getOption,f as parseBoolean};
1
+ import{a,b}from"../chunk-JRALYIRA.js";export{a as getOption,b as parseBoolean};
@@ -1 +1 @@
1
- import{list as g}from"@tigrisdata/storage";function a(i){let t=i.split("/");return{bucket:t[0],path:t.slice(1).join("/")}}async function p(i,t,s){let{data:e}=await g({prefix:`${t}/`,limit:1,config:{...s,bucket:i}});return!!(e?.items&&e.items.length>0)}function f(i,t){return{source:a(i),destination:a(t)}}async function d(i,t,s){let e=[],n;do{let{data:r,error:o}=await g({prefix:t,paginationToken:n,config:{...s,bucket:i}});if(o)return{items:e,error:o};r?.items&&e.push(...r.items),n=r?.hasMore?r.paginationToken:void 0}while(n);return{items:e}}export{p as isPathFolder,d as listAllItems,a as parsePath,f as parsePaths};
1
+ import{a,b,c,d,e,f,g,h,i}from"../chunk-LCWHZUZZ.js";export{g as globToRegex,d as isPathFolder,a as isRemotePath,i as listAllItems,f as parseAnyPath,c as parsePath,e as parsePaths,b as parseRemotePath,h as wildcardPrefix};
@@ -1 +1 @@
1
- import{readFileSync as c,existsSync as m}from"fs";import{join as o,dirname as p}from"path";import{fileURLToPath as l}from"url";import*as a from"yaml";var u=l(import.meta.url),f=p(u),i=null;function d(){let e=f;for(let n=0;n<5;n++){let t=o(e,"specs.yaml");if(m(t))return t;e=o(e,"..")}throw new Error("Could not find specs.yaml")}function g(){if(!i){let e=d(),n=c(e,"utf8");i=a.parse(n)}return i}function S(e,n){let r=g().commands.find(s=>s.name===e);return r?n&&r.operations?r.operations.find(s=>s.name===n)||null:r:null}function h(e,n,t){let r=S(e,t);return!r||!r.arguments?null:r.arguments.find(s=>s.name===n)||null}function v(e){return e.options?Array.isArray(e.options)&&typeof e.options[0]=="string"?e.options.map(n=>({name:n,message:n.charAt(0).toUpperCase()+n.slice(1),value:n})):Array.isArray(e.options)&&typeof e.options[0]=="object"?e.options.map(n=>({name:n.value,message:n.description?`${n.name} - ${n.description}`:n.name,value:n.value})):null:null}export{v as buildPromptChoices,h as getArgumentSpec,S as getCommandSpec};
1
+ import{a,b,c,d}from"../chunk-4LGKN5DA.js";export{d as buildPromptChoices,c as getArgumentSpec,b as getCommandSpec,a as loadSpecs};
@@ -0,0 +1 @@
1
+ import{b as a,c as b}from"../chunk-TUJTXB5G.js";import"../chunk-D63SZLT5.js";export{b as checkForUpdates,a as isNewerVersion};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tigrisdata/cli",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "Command line interface for Tigris object storage",
5
5
  "type": "module",
6
6
  "exports": {
@@ -85,6 +85,7 @@
85
85
  "axios": "^1.12.2",
86
86
  "commander": "^11.0.0",
87
87
  "enquirer": "^2.4.1",
88
+ "jose": "^6.1.3",
88
89
  "open": "^10.2.0",
89
90
  "yaml": "^2.3.4"
90
91
  },
@@ -101,7 +102,7 @@
101
102
  "husky": "^8.0.0",
102
103
  "prettier": "^3.0.0",
103
104
  "publint": "^0.2.0",
104
- "semantic-release": "^25.0.2",
105
+ "semantic-release": "^25.0.3",
105
106
  "tsup": "^8.0.0",
106
107
  "tsx": "^4.21.0",
107
108
  "typescript": "^5.0.0",