@tigrisdata/cli 2.10.0 → 2.10.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/README.md +240 -1
- package/dist/{chunk-N7F2D3XT.js → chunk-3R67NH6M.js} +1 -1
- package/dist/{chunk-SJCYBKF2.js → chunk-RL37R6IA.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/specs.yaml +32 -0
- package/dist/utils/update-check.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ Run `tigris help` to see all available commands, or `tigris <command> help` for
|
|
|
24
24
|
- `tigris cp <src> <dest>` - Copy files between local filesystem and Tigris, or between paths within Tigris. At least one side must be a remote t3:// path
|
|
25
25
|
- `tigris mv <src> <dest>` - Move (rename) objects within Tigris. Both source and destination must be remote t3:// paths
|
|
26
26
|
- `tigris rm <path>` - Remove a bucket, folder, or object from Tigris. A bare bucket name deletes the bucket itself
|
|
27
|
+
- `tigris stat [path]` - Show storage stats (no args), bucket info, or object metadata
|
|
27
28
|
|
|
28
29
|
### Authentication
|
|
29
30
|
|
|
@@ -41,6 +42,7 @@ Run `tigris help` to see all available commands, or `tigris <command> help` for
|
|
|
41
42
|
- `tigris forks` - List and create forks. A fork is a writable copy-on-write clone of a bucket, useful for testing or branching data
|
|
42
43
|
- `tigris snapshots` - List and take snapshots. A snapshot is a point-in-time, read-only copy of a bucket's state
|
|
43
44
|
- `tigris objects` - Low-level object operations for listing, downloading, uploading, and deleting individual objects in a bucket
|
|
45
|
+
- `tigris iam` - Identity and Access Management - manage policies, users, and permissions
|
|
44
46
|
|
|
45
47
|
---
|
|
46
48
|
|
|
@@ -67,12 +69,22 @@ tigris ls t3://my-bucket/prefix/
|
|
|
67
69
|
Create a bucket (bare name) or a folder inside a bucket (bucket/folder/ with trailing slash)
|
|
68
70
|
|
|
69
71
|
```
|
|
70
|
-
tigris mk <path>
|
|
72
|
+
tigris mk <path> [flags]
|
|
71
73
|
```
|
|
72
74
|
|
|
75
|
+
| Flag | Description |
|
|
76
|
+
|------|-------------|
|
|
77
|
+
| `-a, --access` | Access level (only applies when creating a bucket) |
|
|
78
|
+
| `--public` | Shorthand for --access public (only applies when creating a bucket) |
|
|
79
|
+
| `-s, --enable-snapshots` | Enable snapshots for the bucket (only applies when creating a bucket) |
|
|
80
|
+
| `-t, --default-tier` | Default storage tier (only applies when creating a bucket) |
|
|
81
|
+
| `-c, --consistency` | Consistency level (only applies when creating a bucket) |
|
|
82
|
+
| `-r, --region` | Region (only applies when creating a bucket) |
|
|
83
|
+
|
|
73
84
|
**Examples:**
|
|
74
85
|
```bash
|
|
75
86
|
tigris mk my-bucket
|
|
87
|
+
tigris mk my-bucket --access public --region iad
|
|
76
88
|
tigris mk my-bucket/images/
|
|
77
89
|
tigris mk t3://my-bucket
|
|
78
90
|
```
|
|
@@ -152,6 +164,25 @@ tigris rm t3://my-bucket -f
|
|
|
152
164
|
tigris rm "t3://my-bucket/logs/*.tmp" -f
|
|
153
165
|
```
|
|
154
166
|
|
|
167
|
+
### `stat`
|
|
168
|
+
|
|
169
|
+
Show storage stats (no args), bucket info, or object metadata
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
tigris stat [path] [flags]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
| Flag | Description |
|
|
176
|
+
|------|-------------|
|
|
177
|
+
| `-f, --format` | Output format |
|
|
178
|
+
|
|
179
|
+
**Examples:**
|
|
180
|
+
```bash
|
|
181
|
+
tigris stat
|
|
182
|
+
tigris stat t3://my-bucket
|
|
183
|
+
tigris stat t3://my-bucket/my-object.json
|
|
184
|
+
```
|
|
185
|
+
|
|
155
186
|
## Authentication
|
|
156
187
|
|
|
157
188
|
### `login` | `l`
|
|
@@ -437,6 +468,7 @@ tigris buckets create [name] [flags]
|
|
|
437
468
|
| Flag | Description |
|
|
438
469
|
|------|-------------|
|
|
439
470
|
| `-a, --access` | Access level (default: private) |
|
|
471
|
+
| `--public` | Shorthand for --access public |
|
|
440
472
|
| `-s, --enable-snapshots` | Enable snapshots for the bucket (default: false) |
|
|
441
473
|
| `-t, --default-tier` | Choose the default tier for the bucket (default: STANDARD) |
|
|
442
474
|
| `-c, --consistency` | Choose the consistency level for the bucket (default: default) |
|
|
@@ -583,6 +615,7 @@ Low-level object operations for listing, downloading, uploading, and deleting in
|
|
|
583
615
|
| `objects get` (g) | Download an object by key. Prints to stdout by default, or saves to a file with --output |
|
|
584
616
|
| `objects put` (p) | Upload a local file as an object. Content-type is auto-detected from extension unless overridden |
|
|
585
617
|
| `objects delete` (d) | Delete one or more objects by key from the given bucket |
|
|
618
|
+
| `objects set` (s) | Update settings on an existing object such as access level |
|
|
586
619
|
|
|
587
620
|
#### `objects list`
|
|
588
621
|
|
|
@@ -649,6 +682,212 @@ tigris objects delete my-bucket old-file.txt
|
|
|
649
682
|
tigris objects delete my-bucket file-a.txt,file-b.txt
|
|
650
683
|
```
|
|
651
684
|
|
|
685
|
+
#### `objects set`
|
|
686
|
+
|
|
687
|
+
```
|
|
688
|
+
tigris objects set <bucket> <key> [flags]
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
| Flag | Description |
|
|
692
|
+
|------|-------------|
|
|
693
|
+
| `-a, --access` | Access level |
|
|
694
|
+
| `-n, --new-key` | Rename the object to a new key |
|
|
695
|
+
|
|
696
|
+
**Examples:**
|
|
697
|
+
```bash
|
|
698
|
+
tigris objects set my-bucket my-file.txt --access public
|
|
699
|
+
tigris objects set my-bucket my-file.txt --access private
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### `iam`
|
|
703
|
+
|
|
704
|
+
Identity and Access Management - manage policies, users, and permissions
|
|
705
|
+
|
|
706
|
+
| Command | Description |
|
|
707
|
+
|---------|-------------|
|
|
708
|
+
| `iam policies` (p) | Manage IAM policies. Policies define permissions for access keys |
|
|
709
|
+
| `iam users` (u) | Manage organization users and invitations |
|
|
710
|
+
|
|
711
|
+
#### `iam policies` | `p`
|
|
712
|
+
|
|
713
|
+
Manage IAM policies. Policies define permissions for access keys
|
|
714
|
+
|
|
715
|
+
| Command | Description |
|
|
716
|
+
|---------|-------------|
|
|
717
|
+
| `iam policies list` (l) | List all policies in the current organization |
|
|
718
|
+
| `iam policies get` (g) | Show details for a policy including its document and attached users. If no ARN provided, shows interactive selection |
|
|
719
|
+
| `iam policies create` (c) | Create a new policy with the given name and policy document. Document can be provided via file, inline JSON, or stdin |
|
|
720
|
+
| `iam policies edit` (e) | Update an existing policy's document. Document can be provided via file, inline JSON, or stdin. If no ARN provided, shows interactive selection |
|
|
721
|
+
| `iam policies delete` (d) | Delete a policy. If no ARN provided, shows interactive selection |
|
|
722
|
+
|
|
723
|
+
##### `iam policies list`
|
|
724
|
+
|
|
725
|
+
```
|
|
726
|
+
tigris iam policies list [flags]
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
| Flag | Description |
|
|
730
|
+
|------|-------------|
|
|
731
|
+
| `-f, --format` | Output format (default: table) |
|
|
732
|
+
|
|
733
|
+
**Examples:**
|
|
734
|
+
```bash
|
|
735
|
+
tigris iam policies list
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
##### `iam policies get`
|
|
739
|
+
|
|
740
|
+
```
|
|
741
|
+
tigris iam policies get [resource] [flags]
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
| Flag | Description |
|
|
745
|
+
|------|-------------|
|
|
746
|
+
| `-f, --format` | Output format (default: table) |
|
|
747
|
+
|
|
748
|
+
**Examples:**
|
|
749
|
+
```bash
|
|
750
|
+
tigris iam policies get
|
|
751
|
+
tigris iam policies get arn:aws:iam::org_id:policy/my-policy
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
##### `iam policies create`
|
|
755
|
+
|
|
756
|
+
```
|
|
757
|
+
tigris iam policies create <name> [flags]
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
| Flag | Description |
|
|
761
|
+
|------|-------------|
|
|
762
|
+
| `-d, --document` | Policy document (JSON file path or inline JSON). If omitted, reads from stdin |
|
|
763
|
+
| `--description` | Policy description |
|
|
764
|
+
|
|
765
|
+
**Examples:**
|
|
766
|
+
```bash
|
|
767
|
+
tigris iam policies create my-policy --document policy.json
|
|
768
|
+
tigris iam policies create my-policy --document '{"Version":"2012-10-17","Statement":[...]}'
|
|
769
|
+
cat policy.json | tigris iam policies create my-policy
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
##### `iam policies edit`
|
|
773
|
+
|
|
774
|
+
```
|
|
775
|
+
tigris iam policies edit [resource] [flags]
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
| Flag | Description |
|
|
779
|
+
|------|-------------|
|
|
780
|
+
| `-d, --document` | New policy document (JSON file path or inline JSON). If omitted, reads from stdin |
|
|
781
|
+
| `--description` | Update policy description |
|
|
782
|
+
|
|
783
|
+
**Examples:**
|
|
784
|
+
```bash
|
|
785
|
+
tigris iam policies edit --document policy.json
|
|
786
|
+
tigris iam policies edit arn:aws:iam::org_id:policy/my-policy --document policy.json
|
|
787
|
+
cat policy.json | tigris iam policies edit arn:aws:iam::org_id:policy/my-policy
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
##### `iam policies delete`
|
|
791
|
+
|
|
792
|
+
```
|
|
793
|
+
tigris iam policies delete [resource]
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
**Examples:**
|
|
797
|
+
```bash
|
|
798
|
+
tigris iam policies delete
|
|
799
|
+
tigris iam policies delete arn:aws:iam::org_id:policy/my-policy
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
#### `iam users` | `u`
|
|
803
|
+
|
|
804
|
+
Manage organization users and invitations
|
|
805
|
+
|
|
806
|
+
| Command | Description |
|
|
807
|
+
|---------|-------------|
|
|
808
|
+
| `iam users list` (l) | List all users and pending invitations in the organization |
|
|
809
|
+
| `iam users invite` (i) | Invite users to the organization by email |
|
|
810
|
+
| `iam users revoke-invitation` (ri) | Revoke pending invitations. If no invitation ID provided, shows interactive selection |
|
|
811
|
+
| `iam users update-role` (ur) | Update user roles in the organization. If no user ID provided, shows interactive selection |
|
|
812
|
+
| `iam users remove` (rm) | Remove users from the organization. If no user ID provided, shows interactive selection |
|
|
813
|
+
|
|
814
|
+
##### `iam users list`
|
|
815
|
+
|
|
816
|
+
```
|
|
817
|
+
tigris iam users list [flags]
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
| Flag | Description |
|
|
821
|
+
|------|-------------|
|
|
822
|
+
| `-f, --format` | Output format (default: table) |
|
|
823
|
+
|
|
824
|
+
**Examples:**
|
|
825
|
+
```bash
|
|
826
|
+
tigris iam users list
|
|
827
|
+
tigris iam users list --format json
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
##### `iam users invite`
|
|
831
|
+
|
|
832
|
+
```
|
|
833
|
+
tigris iam users invite <email> [flags]
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
| Flag | Description |
|
|
837
|
+
|------|-------------|
|
|
838
|
+
| `-r, --role` | Role to assign to the invited user(s) (default: member) |
|
|
839
|
+
|
|
840
|
+
**Examples:**
|
|
841
|
+
```bash
|
|
842
|
+
tigris iam users invite user@example.com
|
|
843
|
+
tigris iam users invite user@example.com --role admin
|
|
844
|
+
tigris iam users invite user1@example.com,user2@example.com
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
##### `iam users revoke-invitation`
|
|
848
|
+
|
|
849
|
+
```
|
|
850
|
+
tigris iam users revoke-invitation [resource]
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
**Examples:**
|
|
854
|
+
```bash
|
|
855
|
+
tigris iam users revoke-invitation
|
|
856
|
+
tigris iam users revoke-invitation invitation_id
|
|
857
|
+
tigris iam users revoke-invitation id1,id2,id3
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
##### `iam users update-role`
|
|
861
|
+
|
|
862
|
+
```
|
|
863
|
+
tigris iam users update-role [resource] [flags]
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
| Flag | Description |
|
|
867
|
+
|------|-------------|
|
|
868
|
+
| `-r, --role` | Role(s) to assign (comma-separated). Each role pairs with the corresponding user ID. If one role is given, it applies to all users |
|
|
869
|
+
|
|
870
|
+
**Examples:**
|
|
871
|
+
```bash
|
|
872
|
+
tigris iam users update-role --role admin
|
|
873
|
+
tigris iam users update-role user_id --role member
|
|
874
|
+
tigris iam users update-role id1,id2 --role admin
|
|
875
|
+
tigris iam users update-role id1,id2 --role admin,member
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
##### `iam users remove`
|
|
879
|
+
|
|
880
|
+
```
|
|
881
|
+
tigris iam users remove [resource]
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
**Examples:**
|
|
885
|
+
```bash
|
|
886
|
+
tigris iam users remove
|
|
887
|
+
tigris iam users remove user@example.com
|
|
888
|
+
tigris iam users remove user@example.com,user@example.net
|
|
889
|
+
```
|
|
890
|
+
|
|
652
891
|
## License
|
|
653
892
|
|
|
654
893
|
MIT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,c as l}from"./chunk-
|
|
1
|
+
import{a as s,c as l}from"./chunk-RL37R6IA.js";import{b as m}from"./chunk-BETAO4PB.js";import{a as t,k as i}from"./chunk-4V35SYMM.js";import{existsSync as c}from"fs";import{join as a,dirname as u}from"path";import{fileURLToPath as f}from"url";t();var j=f(import.meta.url),d=u(j),h=m(),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=i({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-2XAO2OYD.js";import{readFileSync as T,writeFileSync as I,mkdirSync as N}from"fs";import{join as g}from"path";import{homedir as h}from"os";import k from"https";var u="2.10.
|
|
1
|
+
import{d as m,e as d,f}from"./chunk-2XAO2OYD.js";import{readFileSync as T,writeFileSync as I,mkdirSync as N}from"fs";import{join as g}from"path";import{homedir as h}from"os";import k from"https";var u="2.10.1";var b=g(h(),".tigris","update-check.json");function y(){try{let e=T(b,"utf-8"),s=JSON.parse(e);return typeof s.latestVersion=="string"&&typeof s.lastChecked=="number"?s:null}catch{return null}}function v(e){try{N(g(h(),".tigris"),{recursive:!0}),I(b,JSON.stringify(e),"utf-8")}catch{}}function j(e,s){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}},t=a(e),i=a(s);return!t||!i?!1:i.major>t.major?!0:i.major<t.major?!1:i.minor>t.minor?!0:i.minor<t.minor?!1:i.patch>t.patch?!0:i.patch<t.patch?!1:t.prerelease&&!i.prerelease?!0:(!t.prerelease&&i.prerelease,!1)}function x(){try{let e=k.get(m,{timeout:5e3},s=>{let a="";s.on("data",t=>{a+=t}),s.on("end",()=>{try{let t=JSON.parse(a);if(typeof t.version=="string"){let i=y();v({...i,latestVersion:t.version,lastChecked:Date.now()})}}catch{}})});e.on("error",()=>{}),e.on("timeout",()=>{e.destroy()}),e.end(),e.on("socket",s=>{s.unref()})}catch{}}function V(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),s=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||216e5;if(e&&j(u,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>s)){let t=globalThis.__TIGRIS_BINARY===!0,i=process.platform==="win32",o=`Update available: ${u} \u2192 ${e.latestVersion}`,r;t?i?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
2
|
${l}
|
|
3
3
|
${n("")}
|
|
4
4
|
${n(o)}
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-3R67NH6M.js";import"./chunk-RL37R6IA.js";import"./chunk-BETAO4PB.js";import"./chunk-4V35SYMM.js";import"./chunk-2XAO2OYD.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-3R67NH6M.js";import"./chunk-RL37R6IA.js";import"./chunk-BETAO4PB.js";import"./chunk-4V35SYMM.js";import"./chunk-2XAO2OYD.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as x,b as k,c as h,g as v}from"../../chunk-SYGTCM6P.js";import{a as i}from"../../chunk-JRALYIRA.js";import{b as A}from"../../chunk-USCKVLDO.js";import{d,e as f}from"../../chunk-BETAO4PB.js";import"../../chunk-E4MLGABW.js";import"../../chunk-DOUR5YEY.js";import"../../chunk-KH63ANUX.js";import"../../chunk-2XAO2OYD.js";import I from"enquirer";import{createBucket as T}from"@tigrisdata/storage";var{prompt:C}=I,b=v("buckets","create");async function q(c){x(b);let t=!i(c,["name"]),u=i(c,["name"]),y=i(c,["public"]),g=y?"public":t?void 0:i(c,["access","a","A"]),l=t?void 0:i(c,["enable-snapshots","s","S"]),m=t?void 0:i(c,["default-tier","t","T"]),p=t?void 0:i(c,["consistency","c","C"]),r=t?void 0:i(c,["region","r","R"]),a=[];if((!u||t)&&a.push({type:"input",name:"name",message:"Bucket name:",required:!0}),(!g||t)&&!y){let e=d("buckets","access","create"),s=f(e),n=s?.findIndex(o=>o.value===e?.default);a.push({type:"select",name:"access",message:"Access level:",choices:s||[],initial:n!==void 0&&n>=0?n:0})}if(!m||t){let e=d("buckets","default-tier","create"),s=f(e),n=s?.findIndex(o=>o.value===e?.default);a.push({type:"select",name:"defaultTier",message:"Default storage tier:",choices:s||[],initial:n!==void 0&&n>=0?n:0})}if(!p||t){let e=d("buckets","consistency","create"),s=f(e),n=s?.findIndex(o=>o.value===e?.default);a.push({type:"select",name:"consistency",message:"Consistency level:",choices:s||[],initial:n!==void 0&&n>=0?n:0})}if(!r||t){let e=d("buckets","region","create"),s=f(e),n=s?.findIndex(o=>o.value===e?.default);a.push({type:"select",name:"region",message:"Region:",choices:s||[],initial:n!==void 0&&n>=0?n:0})}if((l===void 0||t)&&a.push({type:"confirm",name:"enableSnapshots",message:"Enable snapshots?",initial:!0}),a.length>0){let e=await C(a);u=u||e.name,g=g||e.access,l=l!==void 0?l:e.enableSnapshots,m=m||e.defaultTier,p=p||e.consistency,r=r!==void 0?r:e.region}u||(h(b,"Bucket name is required"),process.exit(1));let{error:S}=await T(u,{defaultTier:m??"STANDARD",consistency:p==="strict"?"strict":"default",enableSnapshot:l===!0,access:g??"private",region:r!=="global"&&r!==void 0?r.split(","):void 0,config:await A()});S&&(h(b,S.message),process.exit(1)),k(b,{name:u})}export{q as default};
|
package/dist/lib/mk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-JRALYIRA.js";import{f as
|
|
1
|
+
import{a as e}from"../chunk-JRALYIRA.js";import{f as p}from"../chunk-LCWHZUZZ.js";import{b as g}from"../chunk-USCKVLDO.js";import"../chunk-E4MLGABW.js";import"../chunk-DOUR5YEY.js";import"../chunk-KH63ANUX.js";import"../chunk-2XAO2OYD.js";import{createBucket as b,put as h}from"@tigrisdata/storage";async function m(t){let a=e(t,["path"]);a||(console.error("path argument is required"),process.exit(1));let{bucket:s,path:r}=p(a);s||(console.error("Invalid path"),process.exit(1));let i=await g();if(r){let n=r.endsWith("/")?r:`${r}/`,{error:o}=await h(n,"",{config:{...i,bucket:s}});o&&(console.error(o.message),process.exit(1)),console.log(`Folder '${s}/${n}' created`),process.exit(0)}else{let o=e(t,["public"])?"public":e(t,["access","a","A"]),f=e(t,["enableSnapshots","enable-snapshots","s","S"]),u=e(t,["defaultTier","default-tier","t","T"]),d=e(t,["consistency","c","C"]),c=e(t,["region","r","R"]),{error:l}=await b(s,{defaultTier:u??"STANDARD",consistency:d==="strict"?"strict":"default",enableSnapshot:f===!0,access:o??"private",region:c!=="global"&&c!==void 0?c.split(","):void 0,config:i});l&&(console.error(l.message),process.exit(1)),console.log(`Bucket '${s}' created`),process.exit(0)}}export{m as default};
|
package/dist/specs.yaml
CHANGED
|
@@ -243,6 +243,7 @@ commands:
|
|
|
243
243
|
alias: create
|
|
244
244
|
examples:
|
|
245
245
|
- "tigris mk my-bucket"
|
|
246
|
+
- "tigris mk my-bucket --access public --region iad"
|
|
246
247
|
- "tigris mk my-bucket/images/"
|
|
247
248
|
- "tigris mk t3://my-bucket"
|
|
248
249
|
messages:
|
|
@@ -257,6 +258,34 @@ commands:
|
|
|
257
258
|
- my-bucket/my-path
|
|
258
259
|
- t3://my-bucket
|
|
259
260
|
- t3://my-bucket/my-path
|
|
261
|
+
- name: access
|
|
262
|
+
description: Access level (only applies when creating a bucket)
|
|
263
|
+
alias: a
|
|
264
|
+
options: *access_options
|
|
265
|
+
default: private
|
|
266
|
+
- name: public
|
|
267
|
+
description: Shorthand for --access public (only applies when creating a bucket)
|
|
268
|
+
type: flag
|
|
269
|
+
- name: enable-snapshots
|
|
270
|
+
description: Enable snapshots for the bucket (only applies when creating a bucket)
|
|
271
|
+
alias: s
|
|
272
|
+
type: flag
|
|
273
|
+
default: false
|
|
274
|
+
- name: default-tier
|
|
275
|
+
description: Default storage tier (only applies when creating a bucket)
|
|
276
|
+
alias: t
|
|
277
|
+
options: *tier_options
|
|
278
|
+
default: STANDARD
|
|
279
|
+
- name: consistency
|
|
280
|
+
description: Consistency level (only applies when creating a bucket)
|
|
281
|
+
alias: c
|
|
282
|
+
options: *consistency_options
|
|
283
|
+
default: default
|
|
284
|
+
- name: region
|
|
285
|
+
description: Region (only applies when creating a bucket)
|
|
286
|
+
alias: r
|
|
287
|
+
options: *region_options
|
|
288
|
+
default: 'global'
|
|
260
289
|
|
|
261
290
|
# touch
|
|
262
291
|
- name: touch
|
|
@@ -523,6 +552,9 @@ commands:
|
|
|
523
552
|
alias: a
|
|
524
553
|
options: *access_options
|
|
525
554
|
default: private
|
|
555
|
+
- name: public
|
|
556
|
+
description: Shorthand for --access public
|
|
557
|
+
type: flag
|
|
526
558
|
- name: enable-snapshots
|
|
527
559
|
description: Enable snapshots for the bucket
|
|
528
560
|
alias: s
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b}from"../chunk-
|
|
1
|
+
import{b as a,c as b}from"../chunk-RL37R6IA.js";import"../chunk-2XAO2OYD.js";export{b as checkForUpdates,a as isNewerVersion};
|