@tigrisdata/cli 3.9.0 → 3.10.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.
Files changed (122) hide show
  1. package/README.md +50 -5
  2. package/dist/auth/iam.js +1 -1
  3. package/dist/auth/provider.js +1 -1
  4. package/dist/{chunk-ZBRCGJ6R.js → chunk-4FAKNMI5.js} +1 -1
  5. package/dist/{chunk-54KNZAI5.js → chunk-76VFN2EJ.js} +1 -1
  6. package/dist/chunk-7UKHARLH.js +10 -0
  7. package/dist/{chunk-LKNUDKJD.js → chunk-CEEDWOY2.js} +2 -2
  8. package/dist/{chunk-XHR75GDI.js → chunk-HAYPV4J6.js} +1 -1
  9. package/dist/{chunk-FKHFOOA3.js → chunk-IIF5VLQ7.js} +1 -1
  10. package/dist/{chunk-QUCEBYIQ.js → chunk-JUOJKZRI.js} +1 -1
  11. package/dist/{chunk-XUHRL6QY.js → chunk-MQEI5KKF.js} +1 -1
  12. package/dist/{chunk-WIJB3E2C.js → chunk-PNRZDYCK.js} +1 -1
  13. package/dist/{chunk-2TPTTPAT.js → chunk-R3KHIAWP.js} +1 -1
  14. package/dist/{chunk-AFES4NT6.js → chunk-RDJQLQQY.js} +1 -1
  15. package/dist/chunk-RH6Z22EN.js +1 -0
  16. package/dist/chunk-RQGIXHG5.js +5 -0
  17. package/dist/{chunk-E5CPKJ4N.js → chunk-TFXO4OXM.js} +1 -1
  18. package/dist/{chunk-N76NIM6R.js → chunk-UZIIZW33.js} +1 -1
  19. package/dist/chunk-V6JZFDRE.js +1 -0
  20. package/dist/{chunk-UUPTUOXD.js → chunk-ZTZF3OHU.js} +1 -1
  21. package/dist/cli-core.js +1 -1
  22. package/dist/cli.js +1 -1
  23. package/dist/constants.js +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/lib/access-keys/assign.js +1 -1
  26. package/dist/lib/access-keys/attach-policy.js +1 -1
  27. package/dist/lib/access-keys/create.js +1 -1
  28. package/dist/lib/access-keys/delete.js +1 -1
  29. package/dist/lib/access-keys/detach-policy.js +1 -1
  30. package/dist/lib/access-keys/get.js +1 -1
  31. package/dist/lib/access-keys/list-policies.js +1 -1
  32. package/dist/lib/access-keys/list.js +1 -1
  33. package/dist/lib/access-keys/rotate.js +1 -1
  34. package/dist/lib/buckets/create.js +1 -1
  35. package/dist/lib/buckets/delete.js +1 -1
  36. package/dist/lib/buckets/disable-snapshots.js +1 -1
  37. package/dist/lib/buckets/enable-snapshots.js +1 -1
  38. package/dist/lib/buckets/get.js +1 -1
  39. package/dist/lib/buckets/lifecycle/create.js +1 -1
  40. package/dist/lib/buckets/lifecycle/edit.js +1 -1
  41. package/dist/lib/buckets/lifecycle/list.js +1 -1
  42. package/dist/lib/buckets/lifecycle/shared.js +1 -1
  43. package/dist/lib/buckets/list.js +1 -1
  44. package/dist/lib/buckets/merge.js +1 -1
  45. package/dist/lib/buckets/migrate.js +1 -1
  46. package/dist/lib/buckets/rebase.js +1 -1
  47. package/dist/lib/buckets/restore.js +1 -1
  48. package/dist/lib/buckets/set-cors.js +1 -1
  49. package/dist/lib/buckets/set-locations.js +1 -1
  50. package/dist/lib/buckets/set-migration.js +1 -1
  51. package/dist/lib/buckets/set-notifications.js +1 -1
  52. package/dist/lib/buckets/set.js +1 -1
  53. package/dist/lib/bundle.js +1 -1
  54. package/dist/lib/configure/index.js +1 -1
  55. package/dist/lib/cp.js +1 -1
  56. package/dist/lib/credentials/test.js +1 -1
  57. package/dist/lib/iam/policies/create.js +1 -1
  58. package/dist/lib/iam/policies/delete.js +1 -1
  59. package/dist/lib/iam/policies/edit.js +1 -1
  60. package/dist/lib/iam/policies/get.js +1 -1
  61. package/dist/lib/iam/policies/link-key.js +1 -1
  62. package/dist/lib/iam/policies/list-keys.js +1 -1
  63. package/dist/lib/iam/policies/list.js +1 -1
  64. package/dist/lib/iam/policies/select-policy.js +1 -1
  65. package/dist/lib/iam/policies/unlink-key.js +1 -1
  66. package/dist/lib/iam/teams/create.js +1 -1
  67. package/dist/lib/iam/teams/edit.js +1 -1
  68. package/dist/lib/iam/teams/list.js +1 -1
  69. package/dist/lib/iam/teams/shared.js +1 -1
  70. package/dist/lib/iam/users/invite.js +1 -1
  71. package/dist/lib/iam/users/list.js +1 -1
  72. package/dist/lib/iam/users/remove.js +1 -1
  73. package/dist/lib/iam/users/revoke-invitation.js +1 -1
  74. package/dist/lib/iam/users/update-role.js +1 -1
  75. package/dist/lib/init/index.js +1 -1
  76. package/dist/lib/init/interactive.js +1 -1
  77. package/dist/lib/init/shared.js +1 -1
  78. package/dist/lib/login/credentials.js +1 -1
  79. package/dist/lib/login/oauth.js +1 -1
  80. package/dist/lib/login/select.js +1 -1
  81. package/dist/lib/logout.js +1 -1
  82. package/dist/lib/ls.js +1 -1
  83. package/dist/lib/mk.js +1 -1
  84. package/dist/lib/mv.js +1 -1
  85. package/dist/lib/objects/delete.js +1 -1
  86. package/dist/lib/objects/get.js +1 -1
  87. package/dist/lib/objects/info.js +1 -1
  88. package/dist/lib/objects/list-versions.js +4 -4
  89. package/dist/lib/objects/list.js +1 -1
  90. package/dist/lib/objects/purge.js +1 -0
  91. package/dist/lib/objects/put.js +1 -1
  92. package/dist/lib/objects/restore-deleted.js +1 -0
  93. package/dist/lib/objects/restore-info.js +1 -1
  94. package/dist/lib/objects/restore.js +1 -1
  95. package/dist/lib/objects/set-access.js +1 -1
  96. package/dist/lib/objects/set.js +1 -1
  97. package/dist/lib/organizations/create.js +1 -1
  98. package/dist/lib/organizations/list.js +1 -1
  99. package/dist/lib/organizations/select.js +1 -1
  100. package/dist/lib/presign.js +1 -1
  101. package/dist/lib/rm.js +1 -1
  102. package/dist/lib/snapshots/delete.js +1 -1
  103. package/dist/lib/snapshots/list.js +1 -1
  104. package/dist/lib/snapshots/take.js +1 -1
  105. package/dist/lib/stat.js +1 -1
  106. package/dist/lib/telemetry/disable.js +1 -1
  107. package/dist/lib/telemetry/enable.js +1 -1
  108. package/dist/lib/telemetry/status.js +1 -1
  109. package/dist/lib/touch.js +1 -1
  110. package/dist/lib/update.js +1 -1
  111. package/dist/lib/whoami.js +1 -1
  112. package/dist/specs.yaml +78 -2
  113. package/dist/utils/analytics.js +1 -1
  114. package/dist/utils/exit.js +1 -1
  115. package/dist/utils/telemetry.js +1 -1
  116. package/dist/utils/update-check.js +1 -1
  117. package/package.json +3 -3
  118. package/postinstall.cjs +6 -0
  119. package/dist/chunk-64FBY7Z6.js +0 -1
  120. package/dist/chunk-672QCRVD.js +0 -1
  121. package/dist/chunk-HCZGZVF3.js +0 -9
  122. package/dist/chunk-L6I5MSYU.js +0 -5
package/README.md CHANGED
@@ -1007,7 +1007,7 @@ Low-level object operations for listing, downloading, uploading, and deleting in
1007
1007
  | Command | Description |
1008
1008
  |---------|-------------|
1009
1009
  | `tigris objects list` (l) | List objects in a bucket, optionally filtered by a key prefix |
1010
- | `tigris objects list-versions` (lv) | List object versions and delete markers in a bucket (requires bucket versioning). Returns both arrays separately to match the S3 ListObjectVersions response |
1010
+ | `tigris objects list-versions` (lv) | List object versions and delete markers in a bucket (requires bucket versioning), or with --deleted the recoverable versions of soft-deleted objects. Returns both arrays separately to match the S3 ListObjectVersions response |
1011
1011
  | `tigris objects get` (g) | Download an object by key. Prints to stdout by default, or saves to a file with --output |
1012
1012
  | `tigris objects put` (p) | Upload a local file — or data piped via stdin — as an object. Content-type is auto-detected from the file extension unless overridden |
1013
1013
  | `tigris objects delete` (d) | Delete one or more objects by key from the given bucket. On a versioned bucket, the default creates a delete marker; use --version-id or --all-versions to hard-delete versions |
@@ -1016,6 +1016,8 @@ Low-level object operations for listing, downloading, uploading, and deleting in
1016
1016
  | `tigris objects info` (i) | Show metadata for an object (content type, size, modified date) |
1017
1017
  | `tigris objects restore` (rs) | Restore an archived object (e.g. one in the GLACIER tier) into an actively-readable copy for a number of days |
1018
1018
  | `tigris objects restore-info` (ri) | Show the restore state of an archived object (archived, in-progress, or restored) |
1019
+ | `tigris objects restore-deleted` (rd) | Restore a soft-deleted object within its retention window. List recoverable objects with "tigris objects list --deleted", then pick a version with "tigris objects list-versions --deleted" |
1020
+ | `tigris objects purge` (pg) | Permanently destroy a soft-deleted object version before its retention period expires. This cannot be undone — the version can no longer be restored with "tigris objects restore-deleted" |
1019
1021
 
1020
1022
  #### `tigris objects list` (l)
1021
1023
 
@@ -1033,6 +1035,7 @@ tigris objects list <bucket> [flags]
1033
1035
  | `--limit` | Maximum number of items to return per page |
1034
1036
  | `-pt, --page-token` | Pagination token from a previous request to fetch the next page |
1035
1037
  | `--source` | List objects from a specific storage source on buckets with shadow migration enabled |
1038
+ | `--deleted` | List soft-deleted objects instead of live ones. Requires soft delete on the bucket. Not the recovery path for snapshot buckets — use "tigris objects list-versions" for those |
1036
1039
 
1037
1040
  **Examples:**
1038
1041
  ```bash
@@ -1041,11 +1044,12 @@ tigris objects list t3://my-bucket
1041
1044
  tigris objects list t3://my-bucket/images/
1042
1045
  tigris objects list my-bucket --prefix images/
1043
1046
  tigris objects list my-bucket --format json
1047
+ tigris objects list my-bucket --deleted
1044
1048
  ```
1045
1049
 
1046
1050
  #### `tigris objects list-versions` (lv)
1047
1051
 
1048
- List object versions and delete markers in a bucket (requires bucket versioning). Returns both arrays separately to match the S3 ListObjectVersions response
1052
+ List object versions and delete markers in a bucket (requires bucket versioning), or with --deleted the recoverable versions of soft-deleted objects. Returns both arrays separately to match the S3 ListObjectVersions response
1049
1053
 
1050
1054
  ```
1051
1055
  tigris objects list-versions <bucket> [flags]
@@ -1059,6 +1063,7 @@ tigris objects list-versions <bucket> [flags]
1059
1063
  | `--limit` | Maximum number of items to return per page |
1060
1064
  | `--key-marker` | Pagination marker — the key to start listing from (from a prior nextKeyMarker) |
1061
1065
  | `--version-id-marker` | Pagination marker — the version id to start listing from (from a prior nextVersionIdMarker) |
1066
+ | `--deleted` | List the recoverable versions of soft-deleted objects. Use the version id with "tigris objects restore-deleted" or "tigris objects purge" |
1062
1067
 
1063
1068
  **Examples:**
1064
1069
  ```bash
@@ -1066,6 +1071,7 @@ tigris objects list-versions my-bucket
1066
1071
  tigris objects list-versions t3://my-bucket/logs/
1067
1072
  tigris objects list-versions my-bucket --prefix images/
1068
1073
  tigris objects list-versions my-bucket --format json
1074
+ tigris objects list-versions my-bucket --prefix report.pdf --deleted
1069
1075
  ```
1070
1076
 
1071
1077
  #### `tigris objects get` (g)
@@ -1123,7 +1129,7 @@ tigris objects delete <bucket> [key] [flags]
1123
1129
 
1124
1130
  | Flag | Description |
1125
1131
  |------|-------------|
1126
- | `--version-id` | Hard-delete a specific object version (requires bucket versioning). Targets a single key |
1132
+ | `--version-id` | Hard-delete a specific object version (requires bucket versioning). Targets a single key. To destroy a soft-deleted version, use "tigris objects purge" |
1127
1133
  | `--all-versions` | Hard-delete every version and delete marker for the given key(s). Mutually exclusive with --version-id |
1128
1134
  | `--force` | Skip confirmation prompts (alias for --yes) |
1129
1135
 
@@ -1146,7 +1152,7 @@ tigris objects set <bucket> [key] [flags]
1146
1152
 
1147
1153
  | Flag | Description |
1148
1154
  |------|-------------|
1149
- | `-a, --access` | Access level |
1155
+ | `-a, --access` | Access level **(required)** |
1150
1156
  | `-n, --new-key` | Rename the object to a new key |
1151
1157
 
1152
1158
  **Examples:**
@@ -1240,6 +1246,45 @@ tigris objects restore-info t3://my-bucket/archived.bin --format json
1240
1246
  tigris objects restore-info my-bucket archived.bin --snapshot-version 1765889000501544464
1241
1247
  ```
1242
1248
 
1249
+ #### `tigris objects restore-deleted` (rd)
1250
+
1251
+ Restore a soft-deleted object within its retention window. List recoverable objects with "tigris objects list --deleted", then pick a version with "tigris objects list-versions --deleted"
1252
+
1253
+ ```
1254
+ tigris objects restore-deleted <bucket> [key] [flags]
1255
+ ```
1256
+
1257
+ | Flag | Description |
1258
+ |------|-------------|
1259
+ | `--version-id` | The soft-deleted version to bring back, from "tigris objects list-versions --deleted" **(required)** |
1260
+ | `--format` | Output format (default: table) |
1261
+
1262
+ **Examples:**
1263
+ ```bash
1264
+ tigris objects restore-deleted my-bucket report.pdf --version-id 1787749774802410496
1265
+ tigris objects restore-deleted t3://my-bucket/report.pdf --version-id 1787749774802410496
1266
+ ```
1267
+
1268
+ #### `tigris objects purge` (pg)
1269
+
1270
+ Permanently destroy a soft-deleted object version before its retention period expires. This cannot be undone — the version can no longer be restored with "tigris objects restore-deleted"
1271
+
1272
+ ```
1273
+ tigris objects purge <bucket> [key] [flags]
1274
+ ```
1275
+
1276
+ | Flag | Description |
1277
+ |------|-------------|
1278
+ | `--version-id` | The soft-deleted version to destroy, from "tigris objects list-versions --deleted" **(required)** |
1279
+ | `--force` | Skip confirmation prompts (alias for --yes) |
1280
+ | `--format` | Output format (default: table) |
1281
+
1282
+ **Examples:**
1283
+ ```bash
1284
+ tigris objects purge my-bucket report.pdf --version-id 1787749774802410496 --yes
1285
+ tigris objects purge t3://my-bucket/report.pdf --version-id 1787749774802410496 --yes
1286
+ ```
1287
+
1243
1288
  ### `tigris access-keys` (keys)
1244
1289
 
1245
1290
  Create, list, inspect, delete, and assign roles to access keys. Access keys are credentials used for programmatic API access
@@ -1667,7 +1712,7 @@ tigris iam users update-role [resource] [flags]
1667
1712
 
1668
1713
  | Flag | Description |
1669
1714
  |------|-------------|
1670
- | `-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 |
1715
+ | `-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 **(required)** |
1671
1716
 
1672
1717
  **Examples:**
1673
1718
  ```bash
package/dist/auth/iam.js CHANGED
@@ -1 +1 @@
1
- import{a as b,b as c}from"../chunk-N76NIM6R.js";import"../chunk-2TPTTPAT.js";import"../chunk-FKHFOOA3.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-AFES4NT6.js";import"../chunk-DV3LCXRH.js";import"../chunk-64FBY7Z6.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-672QCRVD.js";import"../chunk-J3MAV7JB.js";import{a}from"../chunk-KJBSIIND.js";import"../chunk-F4AGJWCK.js";export{c as getIAMConfig,b as getOAuthIAMConfig,a as isFlyOrganization};
1
+ import{a as b,b as c}from"../chunk-UZIIZW33.js";import"../chunk-R3KHIAWP.js";import"../chunk-IIF5VLQ7.js";import"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-RDJQLQQY.js";import"../chunk-DV3LCXRH.js";import"../chunk-RH6Z22EN.js";import"../chunk-BMWWPXMU.js";import"../chunk-APJUJ6TW.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import{a}from"../chunk-KJBSIIND.js";import"../chunk-F4AGJWCK.js";export{c as getIAMConfig,b as getOAuthIAMConfig,a as isFlyOrganization};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g}from"../chunk-2TPTTPAT.js";import"../chunk-672QCRVD.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";export{c as getEnvCredentials,b as getEnvForcePathStyle,e as getStorageConfig,f as getStorageConfigWithOrg,a as getTigrisConfig,g as requireOAuthLogin,d as resolveAuthMethod};
1
+ import{a,b,c,d,e,f,g}from"../chunk-R3KHIAWP.js";import"../chunk-V6JZFDRE.js";import"../chunk-J3MAV7JB.js";import"../chunk-F4AGJWCK.js";export{c as getEnvCredentials,b as getEnvForcePathStyle,e as getStorageConfig,f as getStorageConfigWithOrg,a as getTigrisConfig,g as requireOAuthLogin,d as resolveAuthMethod};
@@ -1,4 +1,4 @@
1
- import{b as h}from"./chunk-S6KFKBMY.js";import{f as c}from"./chunk-UUPTUOXD.js";import{a as d,d as e}from"./chunk-FKHFOOA3.js";import{b as l,c as r,d as f,g as m,j as p}from"./chunk-D7WXNA2O.js";import{c as u}from"./chunk-J3MAV7JB.js";import{h as g,r as s}from"./chunk-F4AGJWCK.js";var o=p("login","oauth");async function O(w={}){l(o);let a=h(w);try{let t=u();await t.login({onDeviceCode:(i,y)=>{console.log(`
1
+ import{b as h}from"./chunk-S6KFKBMY.js";import{f as c}from"./chunk-ZTZF3OHU.js";import{a as d,d as e}from"./chunk-IIF5VLQ7.js";import{b as l,c as r,d as f,g as m,j as p}from"./chunk-D7WXNA2O.js";import{c as u}from"./chunk-J3MAV7JB.js";import{h as g,r as s}from"./chunk-F4AGJWCK.js";var o=p("login","oauth");async function O(w={}){l(o);let a=h(w);try{let t=u();await t.login({onDeviceCode:(i,y)=>{console.log(`
2
2
  Your confirmation code: ${i}
3
3
  `),console.log(`If browser doesn't open, visit: ${y}`)},onWaiting:()=>console.log(`
4
4
  Waiting for authentication...`)}),await s();let n=await t.getOrganizations();if(n.length>0){let i=n[0];await g(i.id),a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:i.name}),e(o),n.length>1&&m(o,{count:n.length})}else a==="json"&&console.log(JSON.stringify({action:"logged_in"})),r(o,{org:"none"}),e(o);c()}catch(t){f(o),d(t,o)}}var j=O;export{O as a,j as b};
@@ -1,4 +1,4 @@
1
- import{b as h}from"./chunk-G4OJTPSI.js";import{a as p}from"./chunk-64FBY7Z6.js";import{d as f,e as m,f as d}from"./chunk-672QCRVD.js";import{mkdirSync as w,readFileSync as E,writeFileSync as T}from"fs";import I from"https";import{homedir as g}from"os";import{join as C}from"path";var N=C(g(),".tigris","update-check.json");function _(){try{let r=E(N,"utf-8"),i=JSON.parse(r);return typeof i.latestVersion=="string"&&typeof i.lastChecked=="number"?i:null}catch{return null}}function b(r){try{w(C(g(),".tigris"),{recursive:!0}),T(N,JSON.stringify(r),"utf-8")}catch{}}function U(r,i){let o=s=>{let n=s.startsWith("v")?s.slice(1):s,c=null,a=n.indexOf("-");a!==-1&&(c=n.slice(a+1),n=n.slice(0,a));let l=n.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}},t=o(r),e=o(i);return!t||!e?!1:e.major>t.major?!0:e.major<t.major?!1:e.minor>t.minor?!0:e.minor<t.minor?!1:e.patch>t.patch?!0:e.patch<t.patch?!1:t.prerelease&&!e.prerelease?!0:(!t.prerelease&&e.prerelease,!1)}function D(){switch(h()){case"npm":return"npm install -g @tigrisdata/cli";case"homebrew":return"brew upgrade tigris";default:return 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"}}function k(r={}){return new Promise((i,o)=>{let t=I.get(f,{timeout:1e4},e=>{let s="";e.on("data",n=>{s+=n}),e.on("end",()=>{try{let n=JSON.parse(s);typeof n.version=="string"?(b({..._(),latestVersion:n.version,lastChecked:Date.now()}),i(n.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});t.on("error",e=>{o(e)}),t.on("timeout",()=>{t.destroy(),o(new Error("Request timed out"))}),r.unref&&t.on("socket",e=>{e.unref()}),t.end()})}function S(){k({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let r=_(),i=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(r&&U(p,r.latestVersion)&&(!r.lastNotified||Date.now()-r.lastNotified>i)){let t=`Update available: ${p} \u2192 ${r.latestVersion}`,e='Run "tigris update" to upgrade.',s=Math.max(t.length,e.length)+4,n=`\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{b as h}from"./chunk-G4OJTPSI.js";import{a as p}from"./chunk-RH6Z22EN.js";import{d as f,e as m,f as d}from"./chunk-V6JZFDRE.js";import{mkdirSync as w,readFileSync as E,writeFileSync as T}from"fs";import I from"https";import{homedir as g}from"os";import{join as C}from"path";var N=C(g(),".tigris","update-check.json");function _(){try{let r=E(N,"utf-8"),i=JSON.parse(r);return typeof i.latestVersion=="string"&&typeof i.lastChecked=="number"?i:null}catch{return null}}function b(r){try{w(C(g(),".tigris"),{recursive:!0}),T(N,JSON.stringify(r),"utf-8")}catch{}}function U(r,i){let o=s=>{let n=s.startsWith("v")?s.slice(1):s,c=null,a=n.indexOf("-");a!==-1&&(c=n.slice(a+1),n=n.slice(0,a));let l=n.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}},t=o(r),e=o(i);return!t||!e?!1:e.major>t.major?!0:e.major<t.major?!1:e.minor>t.minor?!0:e.minor<t.minor?!1:e.patch>t.patch?!0:e.patch<t.patch?!1:t.prerelease&&!e.prerelease?!0:(!t.prerelease&&e.prerelease,!1)}function D(){switch(h()){case"npm":return"npm install -g @tigrisdata/cli";case"homebrew":return"brew upgrade tigris";default:return 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"}}function k(r={}){return new Promise((i,o)=>{let t=I.get(f,{timeout:1e4},e=>{let s="";e.on("data",n=>{s+=n}),e.on("end",()=>{try{let n=JSON.parse(s);typeof n.version=="string"?(b({..._(),latestVersion:n.version,lastChecked:Date.now()}),i(n.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});t.on("error",e=>{o(e)}),t.on("timeout",()=>{t.destroy(),o(new Error("Request timed out"))}),r.unref&&t.on("socket",e=>{e.unref()}),t.end()})}function S(){k({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let r=_(),i=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(r&&U(p,r.latestVersion)&&(!r.lastNotified||Date.now()-r.lastNotified>i)){let t=`Update available: ${p} \u2192 ${r.latestVersion}`,e='Run "tigris update" to upgrade.',s=Math.max(t.length,e.length)+4,n=`\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
  ${n}
3
3
  ${a("")}
4
4
  ${a(t)}
@@ -0,0 +1,10 @@
1
+ import{spawnSync as w}from"child_process";import{homedir as A}from"os";import{delimiter as j,join as e,normalize as O,sep as E}from"path";import{fileURLToPath as _}from"url";import{applyEdits as C,modify as I,parse as R}from"jsonc-parser";function G(){return{encoding:"utf8",...process.platform==="win32"?{shell:!0}:{}}}function M(){let t;try{t=_(import.meta.url)}catch{return null}let r=t.indexOf(`${E}node_modules${E}`);return r===-1?null:e(t.slice(0,r),"node_modules",".bin")}var $=/[\\/](?:_npx|dlx(?:-[^\\/]*)?)(?:[\\/]|$)/;function q(t,r=M()){let o=r===null?null:P(r);return(t??"").split(j).filter(s=>s!==""&&!$.test(s)&&(o===null||P(s)!==o)).join(j)}function P(t){let r=O(t),o=r.length>1?r.replace(/[\\/]+$/,""):r;return process.platform==="win32"?o.toLowerCase():o}function Q(){let t=w("tigris",["--version"],G());if(t.error||t.status!==0||!t.stdout)return null;let r=t.stdout.trim().split(`
2
+ `)[0].trim();return/^\d+\.\d+\.\d+/.test(r)?r:null}function Y(t){return[...t?[]:["CLI - Global"],"MCP - Global","Skills - Project"].join(", ")}var c=A(),m=process.env.XDG_CONFIG_HOME?.trim()||e(c,".config"),y=process.env.CODEX_HOME?.trim()||e(c,".codex");function S(t,r){return process.platform==="darwin"?e(t,"Library","Application Support","Code","User"):process.platform==="win32"?e(r.APPDATA?.trim()||e(t,"AppData","Roaming"),"Code","User"):e(r.XDG_CONFIG_HOME?.trim()||e(t,".config"),"Code","User")}var T=S(c,process.env),v="saoudrizwan.claude-dev";function L(t,r){return e(T,"globalStorage",t,"settings",r)}var ee="tigris",p="https://mcp.storage.dev/mcp";function te(t,r,o,s){let n=t?.trim()?t:"{}",l=[],i=R(n,l,{allowTrailingComma:!0});if(l.length>0)throw new Error("config is not valid JSON/JSONC");if(!b(i))throw new Error("config root is not an object");let d=i[r];if(d!==void 0&&!b(d))throw new Error(`"${r}" is not an object`);let a=b(d)&&Object.hasOwn(d,o),u=I(n,[r,o],s,{formattingOptions:{insertSpaces:!0,tabSize:2}});return{content:f(C(n,u)),replaced:a}}function b(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function re(t,r,o,s){let l=[`[${r}.${o}]`,...Object.entries(s).map(([g,D])=>`${g} = ${JSON.stringify(D)}`)],i=t??"";if(N(i,r,o))throw new Error(`existing TOML defines ${r}.${o} inline`);let d=`${r}.${o}`,a=i.length?i.split(`
3
+ `):[],u=a.findIndex(g=>k(g)===d);if(u!==-1){let g=u+1;for(;g<a.length&&k(a[g])===null;)g++;return a.splice(u,g-u,...l),{content:f(a.join(`
4
+ `)),replaced:!0}}let h=i.length===0?"":f(i),x=h.length===0?"":`
5
+ `;return{content:f(h+x+l.join(`
6
+ `)),replaced:!1}}function f(t){return t.endsWith(`
7
+ `)?t:`${t}
8
+ `}function k(t){let r=t.trim().match(/^\[([^[\]]*)\]/);return r?r[1].split(".").map(o=>o.trim()).join("."):null}function N(t,r,o){let s="";for(let n of t.split(`
9
+ `)){let l=n.trim();if(l===""||l.startsWith("#"))continue;let i=k(l);if(i!==null){s=i;continue}let d=l.indexOf("=");if(d===-1)continue;let a=l.slice(0,d).trim().replace(/^['"]|['"]$/g,"");if(s===r&&(a===o||a.startsWith(`${o}.`))||s===""&&(a===`${r}.${o}`||a.startsWith(`${r}.${o}.`)))return!0}return!1}var z={source:"custom",command:"npx",args:["-y","mcp-remote",p]},ne=[{id:"claude-code",label:"Claude Code",mcp:{format:"json",key:"mcpServers",entry:{type:"http",url:p},projectPath:".mcp.json",globalPath:e(c,".claude.json")},skillsAgent:"claude-code",skillsProjectDir:e(".claude","skills"),skillsGlobalDir:e(c,".claude","skills")},{id:"cursor",label:"Cursor",mcp:{format:"json",key:"mcpServers",entry:{url:p},projectPath:e(".cursor","mcp.json"),globalPath:e(c,".cursor","mcp.json")},skillsAgent:"cursor",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".cursor","skills")},{id:"vscode",label:"VS Code",mcp:{format:"json",key:"servers",entry:{type:"http",url:p},projectPath:e(".vscode","mcp.json")},skillsAgent:"github-copilot",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".copilot","skills")},{id:"windsurf",label:"Windsurf",mcp:{format:"json",key:"mcpServers",entry:{serverUrl:p},globalPath:e(c,".codeium","windsurf","mcp_config.json")},skillsAgent:"windsurf",skillsProjectDir:e(".windsurf","skills"),skillsGlobalDir:e(c,".codeium","windsurf","skills")},{id:"codex",label:"Codex",mcp:{format:"toml",key:"mcp_servers",entry:{url:p},projectPath:e(".codex","config.toml"),globalPath:e(y,"config.toml")},skillsAgent:"codex",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(y,"skills")},{id:"antigravity-cli",label:"Antigravity CLI",mcp:{format:"json",key:"mcpServers",entry:{serverUrl:p},globalPath:e(c,".gemini","config","mcp_config.json")},skillsAgent:"antigravity-cli",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".gemini","antigravity-cli","skills")},{id:"cline",label:"Cline",mcp:{format:"json",key:"mcpServers",entry:{type:"streamableHttp",url:p,disabled:!1,autoApprove:[]},globalPath:L(v,"cline_mcp_settings.json"),createDirs:!1},skillsAgent:"cline",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".agents","skills")},{id:"zed",label:"Zed",mcp:{format:"json",key:"context_servers",entry:z,projectPath:e(".zed","settings.json"),globalPath:e(m,"zed","settings.json")},skillsAgent:"zed",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(c,".agents","skills")},{id:"roo",label:"Roo Code",mcp:{format:"json",key:"mcpServers",entry:{type:"streamable-http",url:p},projectPath:e(".roo","mcp.json")},skillsAgent:"roo",skillsProjectDir:e(".roo","skills"),skillsGlobalDir:e(c,".roo","skills")},{id:"opencode",label:"opencode",mcp:{format:"json",key:"mcp",entry:{type:"remote",url:p,enabled:!0},projectPath:"opencode.json",globalPath:e(m,"opencode","opencode.json")},skillsAgent:"opencode",skillsProjectDir:e(".agents","skills"),skillsGlobalDir:e(m,"opencode","skills")}];function se(t,r,o){let s=t.map(n=>r==="global"?n.skillsGlobalDir:e(o,n.skillsProjectDir));return[...new Set(s)]}function oe(t,r,o){let s=t.mcp;if(!s)return null;let n=s.globalPath!==void 0,l=s.projectPath!==void 0,i=r==="global"?n?"global":l?"project":null:l?"project":n?"global":null;return i==="global"?{path:s.globalPath,scope:i}:i==="project"?{path:e(o,s.projectPath),scope:i}:null}function ie(t){let{env:r,cwd:o,home:s,fileExists:n}=t,l=r.XDG_CONFIG_HOME?.trim()||e(s,".config"),i=[];return(r.CLAUDECODE==="1"||n(e(o,".claude"))||n(e(s,".claude.json")))&&i.push("claude-code"),(r.TERM_PROGRAM==="cursor"||n(e(o,".cursor"))||n(e(s,".cursor")))&&i.push("cursor"),(r.TERM_PROGRAM==="vscode"||n(e(o,".vscode")))&&i.push("vscode"),n(e(s,".codeium","windsurf"))&&i.push("windsurf"),(r.CODEX_HOME?.trim()||n(e(s,".codex")))&&i.push("codex"),(n(e(s,".gemini","antigravity-cli"))||n(e(s,".gemini","antigravity"))||n(e(s,".gemini","config")))&&i.push("antigravity-cli"),(n(e(s,".cline"))||n(e(S(s,r),"globalStorage",v)))&&i.push("cline"),(n(e(l,"zed"))||n("/Applications/Zed.app"))&&i.push("zed"),n(e(o,".roo"))&&i.push("roo"),(n(e(l,"opencode"))||n(e(o,"opencode.json"))||n(e(o,"opencode.jsonc")))&&i.push("opencode"),i}var H="github.com/tigrisdata/skills",le=[{id:"tigris-agent-kit",label:"Agent kit",recommended:!0},{id:"tigris-object-operations",label:"Object operations",recommended:!0},{id:"tigris-bucket-management",label:"Bucket management",recommended:!0},{id:"tigris-sdk-guide",label:"SDK guide",recommended:!0},{id:"tigris-snapshots-forking",label:"Snapshots & forking",recommended:!1},{id:"tigris-snapshots-recovery",label:"Snapshots recovery",recommended:!1},{id:"tigris-lifecycle-management",label:"Lifecycle management",recommended:!1},{id:"tigris-security-access-control",label:"Security & access control",recommended:!1},{id:"tigris-s3-migration",label:"S3 migration",recommended:!1},{id:"tigris-static-assets",label:"Static assets",recommended:!1},{id:"tigris-image-optimization",label:"Image optimization",recommended:!1},{id:"tigris-egress-optimizer",label:"Egress optimizer",recommended:!1},{id:"tigris-backup-export",label:"Backup & export",recommended:!1},{id:"tigris-python-sdk",label:"Python SDK",recommended:!1}],U="skills@latest";function ce(t,r,o){let s=["-y",U,"add",H];for(let n of t)s.push("--skill",n);o&&s.push("-g");for(let n of r)s.push("-a",n);return s.push("--yes"),s}function K(t,r){let o=t.replace(J,""),s=o.search(/Invalid agents?:/i);if(s===-1)return[];let n=o.indexOf(`
10
+ `,s),l=o.slice(s,n===-1?void 0:n),i=l.search(/\bvalid agents?:/i);return i!==-1&&(l=l.slice(0,i)),r.filter(d=>new RegExp(`(?<![\\w-])${X(d)}(?![\\w-])`).test(l))}function ae(t,r){let o=K(r,t.map(n=>n.skillsAgent)),s=n=>o.includes(n.skillsAgent);return{kept:t.filter(n=>!s(n)),dropped:t.filter(s)}}function X(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var J=new RegExp("\x1B\\[[0-9;]*m","g");export{G as a,q as b,Q as c,Y as d,ee as e,p as f,te as g,re as h,ne as i,se as j,oe as k,ie as l,H as m,le as n,ce as o,K as p,ae as q};
@@ -1,8 +1,8 @@
1
- import{e as x}from"./chunk-UUPTUOXD.js";import{a as S}from"./chunk-FKHFOOA3.js";import{h as C}from"./chunk-D7WXNA2O.js";import{c as b,d as k,e as E}from"./chunk-AFES4NT6.js";import{b as v}from"./chunk-DV3LCXRH.js";import{Command as V,Option as H}from"commander";function y(n,o,e,a,t){let r=n[n.length-1],i=typeof r=="object"&&r!==null&&"args"in r?r.args:n.filter(m=>typeof m=="string");if(i.length===0)return i;let l=i[0],d=(o.commands??[]).filter(m=>g(m,[...e,m.name],t));if(!new Set(d.flatMap(m=>[m.name,...Array.isArray(m.alias)?m.alias:m.alias?[m.alias]:[]])).has(l)){let m=d.map(u=>u.name),p=e.length>0?`'${l}' for '${e.join(" ")}'`:`'${l}'`;console.error(`Unknown command ${p}.`),m.length>0&&console.error(`Available commands: ${m.join(", ")}`);let f=e.length>0?`${a.name} ${e.join(" ")} help`:`${a.name} help`;console.error(`
1
+ import{e as x}from"./chunk-ZTZF3OHU.js";import{a as S}from"./chunk-IIF5VLQ7.js";import{h as C}from"./chunk-D7WXNA2O.js";import{c as b,d as k,e as E}from"./chunk-RDJQLQQY.js";import{b as v}from"./chunk-DV3LCXRH.js";import{Command as V,Option as H}from"commander";function y(n,o,e,a,t){let r=n[n.length-1],i=typeof r=="object"&&r!==null&&"args"in r?r.args:n.filter(m=>typeof m=="string");if(i.length===0)return i;let l=i[0],d=(o.commands??[]).filter(m=>g(m,[...e,m.name],t));if(!new Set(d.flatMap(m=>[m.name,...Array.isArray(m.alias)?m.alias:m.alias?[m.alias]:[]])).has(l)){let m=d.map(u=>u.name),p=e.length>0?`'${l}' for '${e.join(" ")}'`:`'${l}'`;console.error(`Unknown command ${p}.`),m.length>0&&console.error(`Available commands: ${m.join(", ")}`);let f=e.length>0?`${a.name} ${e.join(" ")} help`:`${a.name} help`;console.error(`
2
2
  Run "${f}" for usage.`),process.exit(1)}return i}function Z(){b();let n=!1,o=async e=>{n&&process.exit(1),n=!0,k(e,{crash:!0,exitCode:v(e).exitCode}),await E(),S(e,void 0,{skipCapture:!0})};process.on("unhandledRejection",e=>{(e===""||e===void 0)&&(console.error(`
3
3
  Operation cancelled`),process.exit(1)),o(e)}),process.on("uncaughtException",e=>{o(e)})}function T(n){return/^[a-zA-Z0-9_-]+$/.test(n)}function W(n){let o;n.type==="positional"?o=` ${n.name}`:(o=` --${n.name}`,n.alias&&typeof n.alias=="string"&&(o+=n.alias.length===1?`, -${n.alias}`:`, --${n.alias}`));let e=26,a=o.length>=e?`${o} `:o.padEnd(e),t=n.description;return n.options&&(Array.isArray(n.options)&&typeof n.options[0]=="string"?t+=` (options: ${n.options.join(", ")})`:t+=` (options: ${n.options.map(r=>r.value).join(", ")})`),n.default&&(t+=` [default: ${n.default}]`),n.required&&(t+=" [required]"),n.deprecated&&(t+=n.replaced_by?` [deprecated: use ${n.replaced_by}]`:" [deprecated]"),n["required-when"]&&(t+=` [required when: ${n["required-when"]}]`),n.multiple&&(t+=" [multiple values: comma-separated]"),n.type==="positional"&&(t+=" [positional argument]"),n.examples&&n.examples.length>0&&(t+=` (examples: ${n.examples.join(", ")})`),`${a}${t}`}function g(n,o,e){return n.removed||e(o)?!0:n.commands?n.commands.some(a=>g(a,[...o,a.name],e)):!1}function D(n,o){let e=o?` Use ${o} instead.`:" See the changelog for migration guidance.";console.error(`${n} was removed in this version.${e}`),process.exit(1)}function j(n,o){if(n)for(let e of n){if(!e.removed)continue;h(o,e.name,n)!==void 0&&D(`--${e.name}`,e.replaced_by)}}function I(n,o,e,a){let t=e.join(" ");if(console.log(`
4
4
  ${n.name} ${t} - ${o.description??""}
5
5
  `),o.commands&&o.commands.length>0){let l=o.commands.filter(s=>!s.removed&&g(s,[...e,s.name],a));l.length>0&&(console.log("Commands:"),l.forEach(s=>{let d=` ${s.name}`;if(s.alias){let m=Array.isArray(s.alias)?s.alias:[s.alias];d+=` (${m.join(", ")})`}let c=d.padEnd(24);console.log(`${c}${s.description??""}`)}),console.log())}let r=n.definitions?.global_arguments??[],i=w(r,o.arguments).filter(l=>!l.removed);i.length>0&&(console.log("Arguments:"),i.forEach(l=>{console.log(W(l))}),console.log()),o.examples&&o.examples.length>0&&(console.log("Examples:"),o.examples.forEach(l=>{console.log(` ${l}`)}),console.log()),o.commands&&o.commands.length>0&&console.log(`Use "${n.name} ${t} <command> help" for more information about a command.`)}function R(n,o,e){console.log(`Tigris CLI Version: ${o}
6
6
  `),console.log(`Usage: tigris [command] [options]
7
7
  `),console.log("Commands:"),n.commands.filter(t=>!t.removed&&g(t,[t.name],e)).forEach(t=>{let r=` ${t.name}`;if(t.alias){let l=Array.isArray(t.alias)?t.alias:[t.alias];r+=` (${l.join(", ")})`}let i=r.padEnd(24);console.log(`${i}${t.description??""}`)}),console.log(`
8
- Use "${n.name} <command> help" for more information about a command.`)}function w(n,o){let e=o??[],a=new Set(e.map(i=>i.name)),t=new Set(e.filter(i=>i.alias).map(i=>i.alias)),r=n.filter(i=>!a.has(i.name)&&!(i.alias&&t.has(i.alias)));return[...e,...r]}function _(n,o=[]){o.forEach(e=>{if(e.type==="positional"){let a=e.required?`<${e.name}>`:`[${e.name}]`;n.argument(a,e.description)}else{let a=e.alias&&typeof e.alias=="string"&&e.alias.length===1,t=e.alias&&typeof e.alias=="string"&&e.alias.length>1,r=a?`-${e.alias}, --${e.name}`:t?`--${e.alias}, --${e.name}`:`--${e.name}`;if(e.type==="flag"||(e.type==="boolean"?r+=" [value]":e.options?r+=" <value>":r+=e.required||e["required-when"]?" <value>":" [value]"),e.removed)n.addOption(new H(r,e.description??"").hideHelp());else{let i=e.description??"";if(e.deprecated){let l=e.replaced_by?` Use ${e.replaced_by} instead.`:"";i=`(deprecated) ${i}${l}`}n.option(r,i,e.default)}}})}function G(n){return n.replace(/-([a-z])/g,(o,e)=>e.toUpperCase())}function h(n,o,e){if(e){let t=e.find(r=>r.name===o);if(t?.alias&&typeof t.alias=="string"){let r=t.alias.charAt(0).toUpperCase()+t.alias.slice(1);if(n[r]!==void 0)return n[r]}}let a=[o,o.replace(/-/g,""),o.replace(/-/g,"").toLowerCase(),o.charAt(0).toUpperCase(),G(o)];for(let t of a)if(n[t]!==void 0)return n[t]}function q(n,o){for(let e of n){if(e["required-when"]){let[a,t]=e["required-when"].split("="),r=h(o,a,n),i=h(o,e.name,n);if(r===t&&!i)return console.error(`--${e.name} is required when --${a} is ${t}`),!1}if(e.required&&!h(o,e.name,n))return console.error(`--${e.name} is required`),!1}return!0}function L(n,o,e){let a;"optsWithGlobals"in e&&typeof e.optsWithGlobals=="function"?a=e.optsWithGlobals():"opts"in e&&typeof e.opts=="function"?a=e.opts():a=e;let t={...a};return n.filter(i=>i.type==="positional").forEach((i,l)=>{o[l]!==void 0&&(i.multiple?t[i.name]=o[l].split(",").map(s=>s.trim()):t[i.name]=o[l])}),n.forEach(i=>{i.multiple&&i.type!=="positional"&&t[i.name]&&typeof t[i.name]=="string"&&(t[i.name]=t[i.name].split(",").map(l=>l.trim()))}),t}async function U(n,o,e=[],a={}){(a.json||a.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:t,error:r}=await n(o);(r||!t)&&(console.error(r),process.exit(1));let i=o[o.length-1],l=t.default||t[i];typeof l!="function"&&(console.error(`Command not implemented: ${o.join(" ")}`),process.exit(1)),x(o),await l({...a,_positional:e})}function M(n,o,e,a=[]){let{specs:t,loadModule:r,hasImplementation:i}=n,l=t.definitions?.global_arguments??[];for(let s of e){T(s.name)||(console.error(`Invalid command name "${s.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let d=[...a,s.name];if(!g(s,d,i))continue;let c=o.command(s.name,s.removed?{hidden:!0}:void 0).description(s.description??"");if(s.alias&&(Array.isArray(s.alias)?s.alias:[s.alias]).forEach(p=>{c.alias(p)}),s.removed){c.allowUnknownOption(!0),c.allowExcessArguments(!0),c.action(()=>{D(`${t.name} ${d.join(" ")}`,s.replaced_by)});continue}if(s.commands&&s.commands.length>0)if(M(n,c,s.commands,d),s.default){let m=s.commands.find(p=>p.name===s.default);if(m){let p=w(l,[...s.arguments||[],...m.arguments||[]]);_(c,p),c.allowExcessArguments(!0),c.action(async(...f)=>{let u=f.pop(),A=y([u],s,d,t,i),$=L(p,A,u);p.length>0&&!q(p,$)||(j(p,$),m.deprecated&&m.messages?.onDeprecated&&C(m.messages.onDeprecated),await U(r,[...d,m.name],A,$))})}}else c.allowExcessArguments(!0),c.action((...m)=>{y(m,s,d,t,i),I(t,s,d,i)});else _(c,w(l,s.arguments)),c.action(async(...m)=>{let p=m.pop(),f=m,u=L(s.arguments||[],f,p);s.arguments&&!q(s.arguments,u)||(j(s.arguments,u),s.deprecated&&s.messages?.onDeprecated&&C(s.messages.onDeprecated),await U(r,d,f,u))});c.command("help").description("Show help for this command").action(()=>{I(t,s,d,i)})}}function Q(n){let{specs:o,version:e,hasImplementation:a}=n,t=new V;return t.name(o.name).description(o.description).version(e),M(n,t,o.commands),t.command("help").description("Show general help").action(()=>{R(o,e,a)}),t.command("version").description("Show the CLI version").action(()=>{console.log(e)}),t.allowExcessArguments(!0),t.action((...r)=>{y(r,{commands:o.commands},[],o,a),R(o,e,a)}),t}export{Z as a,T as b,W as c,g as d,I as e,R as f,_ as g,q as h,L as i,M as j,Q as k};
8
+ Use "${n.name} <command> help" for more information about a command.`)}function w(n,o){let e=o??[],a=new Set(e.map(i=>i.name)),t=new Set(e.filter(i=>i.alias).map(i=>i.alias)),r=n.filter(i=>!a.has(i.name)&&!(i.alias&&t.has(i.alias)));return[...e,...r]}function _(n,o=[]){o.forEach(e=>{if(e.type==="positional"){let a=e.required?`<${e.name}>`:`[${e.name}]`;n.argument(a,e.description)}else{let a=e.alias&&typeof e.alias=="string"&&e.alias.length===1,t=e.alias&&typeof e.alias=="string"&&e.alias.length>1,r=a?`-${e.alias}, --${e.name}`:t?`--${e.alias}, --${e.name}`:`--${e.name}`;if(e.type==="flag"||(e.type==="boolean"?r+=" [value]":e.options?r+=" <value>":r+=e.required||e["required-when"]?" <value>":" [value]"),e.removed)n.addOption(new H(r,e.description??"").hideHelp());else{let i=e.description??"";if(e.deprecated){let l=e.replaced_by?` Use ${e.replaced_by} instead.`:"";i=`(deprecated) ${i}${l}`}n.option(r,i,e.default)}}})}function G(n){return n.replace(/-([a-z])/g,(o,e)=>e.toUpperCase())}function h(n,o,e){if(e){let t=e.find(r=>r.name===o);if(t?.alias&&typeof t.alias=="string"){let r=t.alias.charAt(0).toUpperCase()+t.alias.slice(1);if(n[r]!==void 0)return n[r]}}let a=[o,o.replace(/-/g,""),o.replace(/-/g,"").toLowerCase(),o.charAt(0).toUpperCase(),G(o)];for(let t of a)if(n[t]!==void 0)return n[t]}function q(n,o){for(let e of n){if(e["required-when"]){let[a,t]=e["required-when"].split("="),r=h(o,a,n),i=h(o,e.name,n);if(r===t&&!i)return console.error(`--${e.name} is required when --${a} is ${t}`),!1}if(e.required&&!h(o,e.name,n))return console.error(`--${e.name} is required`),e.description&&console.error(` ${e.description}`),!1}return!0}function L(n,o,e){let a;"optsWithGlobals"in e&&typeof e.optsWithGlobals=="function"?a=e.optsWithGlobals():"opts"in e&&typeof e.opts=="function"?a=e.opts():a=e;let t={...a};return n.filter(i=>i.type==="positional").forEach((i,l)=>{o[l]!==void 0&&(i.multiple?t[i.name]=o[l].split(",").map(s=>s.trim()):t[i.name]=o[l])}),n.forEach(i=>{i.multiple&&i.type!=="positional"&&t[i.name]&&typeof t[i.name]=="string"&&(t[i.name]=t[i.name].split(",").map(l=>l.trim()))}),t}async function U(n,o,e=[],a={}){(a.json||a.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:t,error:r}=await n(o);(r||!t)&&(console.error(r),process.exit(1));let i=o[o.length-1],l=t.default||t[i];typeof l!="function"&&(console.error(`Command not implemented: ${o.join(" ")}`),process.exit(1)),x(o),await l({...a,_positional:e})}function M(n,o,e,a=[]){let{specs:t,loadModule:r,hasImplementation:i}=n,l=t.definitions?.global_arguments??[];for(let s of e){T(s.name)||(console.error(`Invalid command name "${s.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let d=[...a,s.name];if(!g(s,d,i))continue;let c=o.command(s.name,s.removed?{hidden:!0}:void 0).description(s.description??"");if(s.alias&&(Array.isArray(s.alias)?s.alias:[s.alias]).forEach(p=>{c.alias(p)}),s.removed){c.allowUnknownOption(!0),c.allowExcessArguments(!0),c.action(()=>{D(`${t.name} ${d.join(" ")}`,s.replaced_by)});continue}if(s.commands&&s.commands.length>0)if(M(n,c,s.commands,d),s.default){let m=s.commands.find(p=>p.name===s.default);if(m){let p=w(l,[...s.arguments||[],...m.arguments||[]]);_(c,p),c.allowExcessArguments(!0),c.action(async(...f)=>{let u=f.pop(),A=y([u],s,d,t,i),$=L(p,A,u);p.length>0&&!q(p,$)&&process.exit(1),j(p,$),m.deprecated&&m.messages?.onDeprecated&&C(m.messages.onDeprecated),await U(r,[...d,m.name],A,$)})}}else c.allowExcessArguments(!0),c.action((...m)=>{y(m,s,d,t,i),I(t,s,d,i)});else _(c,w(l,s.arguments)),c.action(async(...m)=>{let p=m.pop(),f=m,u=L(s.arguments||[],f,p);s.arguments&&!q(s.arguments,u)&&process.exit(1),j(s.arguments,u),s.deprecated&&s.messages?.onDeprecated&&C(s.messages.onDeprecated),await U(r,d,f,u)});c.command("help").description("Show help for this command").action(()=>{I(t,s,d,i)})}}function Q(n){let{specs:o,version:e,hasImplementation:a}=n,t=new V;return t.name(o.name).description(o.description).version(e),M(n,t,o.commands),t.command("help").description("Show general help").action(()=>{R(o,e,a)}),t.command("version").description("Show the CLI version").action(()=>{console.log(e)}),t.allowExcessArguments(!0),t.action((...r)=>{y(r,{commands:o.commands},[],o,a),R(o,e,a)}),t}export{Z as a,T as b,W as c,g as d,I as e,R as f,_ as g,q as h,L as i,M as j,Q as k};
@@ -1 +1 @@
1
- import{a as d,b as o}from"./chunk-JNSFDQGG.js";import{a}from"./chunk-S6KFKBMY.js";import{b as i}from"./chunk-FKHFOOA3.js";import{getBucketInfo as l,setBucketLifecycle as g}from"@tigrisdata/storage";var f=["STANDARD_IA","GLACIER","GLACIER_IR"];function c(e){return f.includes(e)}function u(e){return/^\d{4}-\d{2}-\d{2}/.test(e)&&!Number.isNaN(new Date(e).getTime())}function C(e){return{prefix:a(e,["prefix"]),storageClass:a(e,["storage-class","storageClass"]),days:a(e,["days"]),date:a(e,["date"]),expireDays:a(e,["expire-days","expireDays"]),expireDate:a(e,["expire-date","expireDate"]),enable:a(e,["enable"]),disable:a(e,["disable"])}}function p(e,{requireStorageClassForTiming:r=!0}={}){if(e.enable&&e.disable)return"Cannot use both --enable and --disable";if(r&&(e.days!==void 0||e.date!==void 0)&&!e.storageClass)return"--storage-class is required when setting --days or --date";if(e.storageClass&&!c(e.storageClass))return`--storage-class must be one of: ${f.join(", ")} (STANDARD is not a valid transition target)`;if(e.days!==void 0&&e.date!==void 0)return"Cannot specify both --days and --date";if(e.days!==void 0&&(Number.isNaN(Number(e.days))||Number(e.days)<=0))return"--days must be a positive number";if(e.date!==void 0&&!u(e.date))return"--date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.expireDays!==void 0&&e.expireDate!==void 0)return"Cannot specify both --expire-days and --expire-date";if(e.expireDays!==void 0&&(Number.isNaN(Number(e.expireDays))||Number(e.expireDays)<=0))return"--expire-days must be a positive number";if(e.expireDate!==void 0&&!u(e.expireDate))return"--expire-date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.prefix!==void 0&&e.prefix==="")return"--prefix cannot be empty"}function D(e){let r={};return e.storageClass&&(r.storageClass=e.storageClass),e.days!==void 0?(r.days=Number(e.days),r.date=void 0):e.date!==void 0&&(r.date=e.date,r.days=void 0),r}function R(e){if(e.expireDays!==void 0)return{days:Number(e.expireDays),date:void 0};if(e.expireDate!==void 0)return{date:e.expireDate,days:void 0}}function I(e){if(e.enable)return!0;if(e.disable)return!1}async function N(e,r,n){let{data:t,error:s}=await l(r,{config:n});return s&&i(e,s),t?.settings.lifecycleRules??[]}async function T(e,r,n,t){let{error:s}=await g(r,{lifecycleRules:n,config:t});s&&i(e,s)}function S(e){return d(e)??"-"}function A(e){return o(e)??"-"}export{C as a,p as b,D as c,R as d,I as e,N as f,T as g,S as h,A as i};
1
+ import{a as d,b as o}from"./chunk-JNSFDQGG.js";import{a}from"./chunk-S6KFKBMY.js";import{b as i}from"./chunk-IIF5VLQ7.js";import{getBucketInfo as l,setBucketLifecycle as g}from"@tigrisdata/storage";var f=["STANDARD_IA","GLACIER","GLACIER_IR"];function c(e){return f.includes(e)}function u(e){return/^\d{4}-\d{2}-\d{2}/.test(e)&&!Number.isNaN(new Date(e).getTime())}function C(e){return{prefix:a(e,["prefix"]),storageClass:a(e,["storage-class","storageClass"]),days:a(e,["days"]),date:a(e,["date"]),expireDays:a(e,["expire-days","expireDays"]),expireDate:a(e,["expire-date","expireDate"]),enable:a(e,["enable"]),disable:a(e,["disable"])}}function p(e,{requireStorageClassForTiming:r=!0}={}){if(e.enable&&e.disable)return"Cannot use both --enable and --disable";if(r&&(e.days!==void 0||e.date!==void 0)&&!e.storageClass)return"--storage-class is required when setting --days or --date";if(e.storageClass&&!c(e.storageClass))return`--storage-class must be one of: ${f.join(", ")} (STANDARD is not a valid transition target)`;if(e.days!==void 0&&e.date!==void 0)return"Cannot specify both --days and --date";if(e.days!==void 0&&(Number.isNaN(Number(e.days))||Number(e.days)<=0))return"--days must be a positive number";if(e.date!==void 0&&!u(e.date))return"--date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.expireDays!==void 0&&e.expireDate!==void 0)return"Cannot specify both --expire-days and --expire-date";if(e.expireDays!==void 0&&(Number.isNaN(Number(e.expireDays))||Number(e.expireDays)<=0))return"--expire-days must be a positive number";if(e.expireDate!==void 0&&!u(e.expireDate))return"--expire-date must be a valid ISO-8601 date (e.g. 2026-06-01)";if(e.prefix!==void 0&&e.prefix==="")return"--prefix cannot be empty"}function D(e){let r={};return e.storageClass&&(r.storageClass=e.storageClass),e.days!==void 0?(r.days=Number(e.days),r.date=void 0):e.date!==void 0&&(r.date=e.date,r.days=void 0),r}function R(e){if(e.expireDays!==void 0)return{days:Number(e.expireDays),date:void 0};if(e.expireDate!==void 0)return{date:e.expireDate,days:void 0}}function I(e){if(e.enable)return!0;if(e.disable)return!1}async function N(e,r,n){let{data:t,error:s}=await l(r,{config:n});return s&&i(e,s),t?.settings.lifecycleRules??[]}async function T(e,r,n,t){let{error:s}=await g(r,{lifecycleRules:n,config:t});s&&i(e,s)}function S(e){return d(e)??"-"}function A(e){return o(e)??"-"}export{C as a,p as b,D as c,R as d,I as e,N as f,T as g,S as h,A as i};
@@ -1,4 +1,4 @@
1
- import{a as r,d as a}from"./chunk-D7WXNA2O.js";import{c}from"./chunk-NI4EYBQH.js";import{d as m}from"./chunk-AFES4NT6.js";import{b as i}from"./chunk-DV3LCXRH.js";function p(){return globalThis.__TIGRIS_JSON_MODE===!0}function g(){return process.stderr.isTTY===!0}function f(){return process.stdout.isTTY===!0}function u(t,o,n){let e=i(t);if(p()){let s={error:{message:e.message,code:e.exitCode,category:e.category}};e.nextActions.length>0&&(s.nextActions=e.nextActions),console.error(JSON.stringify(s))}else if(o||console.error(`
1
+ import{a as r,d as a}from"./chunk-D7WXNA2O.js";import{c}from"./chunk-NI4EYBQH.js";import{d as m}from"./chunk-RDJQLQQY.js";import{b as i}from"./chunk-DV3LCXRH.js";function p(){return globalThis.__TIGRIS_JSON_MODE===!0}function g(){return process.stderr.isTTY===!0}function f(){return process.stdout.isTTY===!0}function u(t,o,n){let e=i(t);if(p()){let s={error:{message:e.message,code:e.exitCode,category:e.category}};e.nextActions.length>0&&(s.nextActions=e.nextActions),console.error(JSON.stringify(s))}else if(o||console.error(`
2
2
  Error: ${e.message}`),g()&&e.nextActions.length>0){console.error(`
3
3
  Next steps:`);for(let s of e.nextActions)console.error(` \u2192 ${s.command} ${s.description}`)}n?.skipCapture||m(t,{category:e.category,command:o?.command,exitCode:e.exitCode}),process.exit(e.exitCode)}function M(t,o){let n=o instanceof Error?o.message:String(o);a(t,n),u(o,t)}function x(t,o){let n=c(t.command,t.operation);return n?.messages?.nextActions?n.messages.nextActions.map(e=>({command:r(e.command,o),description:r(e.description,o)})):[]}function T(t,o){if(!f()||p())return;let n=x(t,o);if(n.length!==0){console.log(`
4
4
  Next steps:`);for(let e of n)console.log(` \u2192 ${e.command} ${e.description}`)}}export{u as a,M as b,x as c,T as d};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-S77OAN6Y.js";import{b as s}from"./chunk-FKHFOOA3.js";import{e as o}from"./chunk-D7WXNA2O.js";import m from"enquirer";import{listPolicies as f}from"@tigrisdata/iam";var{prompt:p}=m;async function h(a,t,c="Select a policy:"){let{data:e,error:r}=await f({config:a});if(r&&s(t,r),!e.policies||e.policies.length===0){o(t);return}n("Provide the policy ARN as a positional argument");let{selected:l}=await p({type:"select",name:"selected",message:c,choices:e.policies.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});return l}export{h as a};
1
+ import{a as n}from"./chunk-S77OAN6Y.js";import{b as s}from"./chunk-IIF5VLQ7.js";import{e as o}from"./chunk-D7WXNA2O.js";import m from"enquirer";import{listPolicies as f}from"@tigrisdata/iam";var{prompt:p}=m;async function h(a,t,c="Select a policy:"){let{data:e,error:r}=await f({config:a});if(r&&s(t,r),!e.policies||e.policies.length===0){o(t);return}n("Provide the policy ARN as a positional argument");let{selected:l}=await p({type:"select",name:"selected",message:c,choices:e.policies.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});return l}export{h as a};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-S77OAN6Y.js";import{a as w}from"./chunk-2TPTTPAT.js";import{b as S}from"./chunk-S6KFKBMY.js";import{b as u,d as l}from"./chunk-FKHFOOA3.js";import{b as f,c as y,j as p}from"./chunk-D7WXNA2O.js";import{a as i}from"./chunk-672QCRVD.js";import{l as n,n as o,o as d,q as m,s as g}from"./chunk-F4AGJWCK.js";import C from"enquirer";import{whoami as k}from"@tigrisdata/iam";var{prompt:I}=C,a=p("login","credentials");async function q(e){f(a);let A=S(e),s=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,r=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(!s||!r){let t=[];s||t.push({type:"input",name:"accessKey",message:"Access Key ID:",required:!0}),r||t.push({type:"password",name:"accessSecret",message:"Secret Access Key:",required:!0}),K("Provide --access-key and --access-secret");let c=await I(t);s=s||c.accessKey,r=r||c.accessSecret}(!s||!r)&&u(a,"Access key and secret are required");let h=n()?.endpoint||i;await o({accessKeyId:s,secretAccessKey:r,endpoint:h}),await d("credentials"),await g();try{let t=w(),{data:c}=await k({config:{accessKeyId:s,secretAccessKey:r,iamEndpoint:t.iamEndpoint}});c?.organizationId&&await m(c.organizationId,"temporary")}catch{}A==="json"&&console.log(JSON.stringify({action:"logged_in"})),y(a),l(a)}export{q as a};
1
+ import{a as K}from"./chunk-S77OAN6Y.js";import{a as w}from"./chunk-R3KHIAWP.js";import{b as S}from"./chunk-S6KFKBMY.js";import{b as u,d as l}from"./chunk-IIF5VLQ7.js";import{b as f,c as y,j as p}from"./chunk-D7WXNA2O.js";import{a as i}from"./chunk-V6JZFDRE.js";import{l as n,n as o,o as d,q as m,s as g}from"./chunk-F4AGJWCK.js";import C from"enquirer";import{whoami as k}from"@tigrisdata/iam";var{prompt:I}=C,a=p("login","credentials");async function q(e){f(a);let A=S(e),s=e["access-key"]||e.accessKey||e.key||e.Key||e.accesskey,r=e["access-secret"]||e.accessSecret||e.secret||e.Secret||e.accesssecret;if(!s||!r){let t=[];s||t.push({type:"input",name:"accessKey",message:"Access Key ID:",required:!0}),r||t.push({type:"password",name:"accessSecret",message:"Secret Access Key:",required:!0}),K("Provide --access-key and --access-secret");let c=await I(t);s=s||c.accessKey,r=r||c.accessSecret}(!s||!r)&&u(a,"Access key and secret are required");let h=n()?.endpoint||i;await o({accessKeyId:s,secretAccessKey:r,endpoint:h}),await d("credentials"),await g();try{let t=w(),{data:c}=await k({config:{accessKeyId:s,secretAccessKey:r,iamEndpoint:t.iamEndpoint}});c?.organizationId&&await m(c.organizationId,"temporary")}catch{}A==="json"&&console.log(JSON.stringify({action:"logged_in"})),y(a),l(a)}export{q as a};
@@ -1 +1 @@
1
- import{e as l}from"./chunk-54KNZAI5.js";import{a as m,k as s}from"./chunk-LKNUDKJD.js";import{b as i}from"./chunk-NI4EYBQH.js";import{a as t}from"./chunk-64FBY7Z6.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";m();var j=f(import.meta.url),d=u(j),h=i(),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=s({specs:h,version:t,loadModule:b,hasImplementation:y});x.parse();l();
1
+ import{e as l}from"./chunk-76VFN2EJ.js";import{a as m,k as s}from"./chunk-CEEDWOY2.js";import{b as i}from"./chunk-NI4EYBQH.js";import{a as t}from"./chunk-RH6Z22EN.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";m();var j=f(import.meta.url),d=u(j),h=i(),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=s({specs:h,version:t,loadModule:b,hasImplementation:y});x.parse();l();
@@ -1,4 +1,4 @@
1
- import{a as o,b as a,c as g}from"./chunk-672QCRVD.js";import{a as A,c as I}from"./chunk-J3MAV7JB.js";import{i as c,j as l,k as y,l as i,p as d}from"./chunk-F4AGJWCK.js";import{fromIni as S}from"@aws-sdk/credential-providers";function _(){return process.env.AWS_ENDPOINT_URL_S3||process.env.AWS_ENDPOINT_URL_IAM?{endpoint:process.env.AWS_ENDPOINT_URL_S3||o,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||a,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||g}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||o,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||a,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||g}}function K(){let e=process.env.TIGRIS_FORCE_PATH_STYLE?.trim().toLowerCase();return e==="1"||e==="true"||e==="yes"||e==="on"}var r=_(),T=A();function p(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY){let e=process.env.AWS_ENDPOINT_URL_S3||o;return{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,endpoint:e,source:"aws"}}if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID&&process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let e=process.env.TIGRIS_STORAGE_ENDPOINT||o;return{accessKeyId:process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,secretAccessKey:process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY,endpoint:e,source:"tigris"}}return null}var f=!1;async function C(){if(f||!process.stdin.isTTY)return!1;f=!0,console.log(`Not authenticated. Starting login...
1
+ import{a as o,b as a,c as g}from"./chunk-V6JZFDRE.js";import{a as A,c as I}from"./chunk-J3MAV7JB.js";import{i as c,j as l,k as y,l as i,p as d}from"./chunk-F4AGJWCK.js";import{fromIni as S}from"@aws-sdk/credential-providers";function _(){return process.env.AWS_ENDPOINT_URL_S3||process.env.AWS_ENDPOINT_URL_IAM?{endpoint:process.env.AWS_ENDPOINT_URL_S3||o,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||a,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||g}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||o,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||a,mgmtEndpoint:process.env.TIGRIS_MGMT_ENDPOINT||g}}function K(){let e=process.env.TIGRIS_FORCE_PATH_STYLE?.trim().toLowerCase();return e==="1"||e==="true"||e==="yes"||e==="on"}var r=_(),T=A();function p(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY){let e=process.env.AWS_ENDPOINT_URL_S3||o;return{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,endpoint:e,source:"aws"}}if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID&&process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let e=process.env.TIGRIS_STORAGE_ENDPOINT||o;return{accessKeyId:process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,secretAccessKey:process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY,endpoint:e,source:"tigris"}}return null}var f=!1;async function C(){if(f||!process.stdin.isTTY)return!1;f=!0,console.log(`Not authenticated. Starting login...
2
2
  `);let{default:e}=await import("./lib/login/select.js");return await e({}),console.log(),!0}async function h(){if(l()){let s=process.env.AWS_PROFILE||"default",u=await S({profile:s})();return{type:"aws-profile",profile:s,accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey}}let e=p();if(e)return{type:"environment",accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,source:e.source};let t=d();if(t==="oauth")return{type:"oauth"};if(t==="credentials"){let s=i();if(s)return{type:"credentials",accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey}}let n=i();return n?{type:"configured",accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey}:{type:"none"}}async function m(e){let t=await E(e);return K()?{...t,forcePathStyle:!0}:t}async function E(e){let t=await h();switch(t.type){case"aws-profile":{let n=await y(t.profile);return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:n.endpoint||r.endpoint||o,iamEndpoint:n.iamEndpoint||r.iamEndpoint}}case"oauth":{let n=I(),s=c();if(!s)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await n.getAccessToken(),accessKeyId:"",secretAccessKey:"",...e?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await n.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:r.endpoint,organizationId:s,iamEndpoint:r.iamEndpoint,authDomain:T.domain}}case"credentials":{let n=c();return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:i()?.endpoint||o,organizationId:n??void 0,iamEndpoint:r.iamEndpoint}}case"environment":return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:p()?.endpoint||o};case"configured":{let n=c();return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:i()?.endpoint||o,organizationId:n??void 0,iamEndpoint:r.iamEndpoint}}case"none":{if(await C())return E(e);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}}}async function O(){let e=await m(),t=c();return{...e,...t&&!e.organizationId?{organizationId:t}:{}}}function R(e){return d()==="oauth"?!1:(p()||i()?console.log(`You are using access key credentials, which belong to a single organization.
3
3
  ${e} is only available with OAuth login.
4
4
 
@@ -1 +1 @@
1
- import{a as c}from"./chunk-64FBY7Z6.js";import{a as u,b as y}from"./chunk-BMWWPXMU.js";import{e as l}from"./chunk-APJUJ6TW.js";import{g as m}from"./chunk-672QCRVD.js";import*as t from"@sentry/node";var g=new Set(["general","network"]),p=!1,a=!1;function S(){return process.env.TIGRIS_SENTRY_DSN?.trim()||m}var E=process.env.TIGRIS_ENV==="development"?"development":"production";function h(r){let e=r[0];return e&&!e.startsWith("-")?e:void 0}var T=new Set(["OnUncaughtException","OnUnhandledRejection","LocalVariables","LocalVariablesAsync","Console","ChildProcess"]);function f(r){if(typeof r=="string")return u(r);if(Array.isArray(r))return r.map(f);if(r!==null&&typeof r=="object"){let e=r;for(let n of Object.keys(e))e[n]=f(e[n]);return e}return r}function R(r){return r.server_name=void 0,f(r)}function w(){if(p)return;p=!0;let r=S();if(!(!r||l()))try{t.init({dsn:r,release:`@tigrisdata/cli@${c}`,environment:E,tracesSampleRate:0,sendDefaultPii:!1,integrations:i=>i.filter(s=>!T.has(s.name)),beforeSend:R}),t.setContext("cli",{version:c,node:process.version,platform:process.platform,arch:process.arch});let e=process.argv.slice(2);t.setContext("invocation",{command:y(e).join(" ")});let n=h(e);n&&t.setTag("command",n),a=!0}catch{a=!1}}function A(r,e={}){if(!a)return;let{category:n,command:i,crash:s,exitCode:d}=e;if(!(!s&&n&&!g.has(n)))try{t.captureException(r,o=>(o.setTag("crash",s===!0),n&&o.setTag("error.category",n),i&&o.setTag("command",i),d!==void 0&&o.setTag("exit_code",d),o))}catch{}}async function I(r=2e3){if(a)try{await t.flush(r)}catch{}}export{h as a,R as b,w as c,A as d,I as e};
1
+ import{a as c}from"./chunk-RH6Z22EN.js";import{a as u,b as y}from"./chunk-BMWWPXMU.js";import{e as l}from"./chunk-APJUJ6TW.js";import{h as m}from"./chunk-V6JZFDRE.js";import*as t from"@sentry/node";var g=new Set(["general","network"]),p=!1,a=!1;function S(){return process.env.TIGRIS_SENTRY_DSN?.trim()||m}var E=process.env.TIGRIS_ENV==="development"?"development":"production";function h(r){let e=r[0];return e&&!e.startsWith("-")?e:void 0}var T=new Set(["OnUncaughtException","OnUnhandledRejection","LocalVariables","LocalVariablesAsync","Console","ChildProcess"]);function f(r){if(typeof r=="string")return u(r);if(Array.isArray(r))return r.map(f);if(r!==null&&typeof r=="object"){let e=r;for(let n of Object.keys(e))e[n]=f(e[n]);return e}return r}function R(r){return r.server_name=void 0,f(r)}function w(){if(p)return;p=!0;let r=S();if(!(!r||l()))try{t.init({dsn:r,release:`@tigrisdata/cli@${c}`,environment:E,tracesSampleRate:0,sendDefaultPii:!1,integrations:i=>i.filter(s=>!T.has(s.name)),beforeSend:R}),t.setContext("cli",{version:c,node:process.version,platform:process.platform,arch:process.arch});let e=process.argv.slice(2);t.setContext("invocation",{command:y(e).join(" ")});let n=h(e);n&&t.setTag("command",n),a=!0}catch{a=!1}}function A(r,e={}){if(!a)return;let{category:n,command:i,crash:s,exitCode:d}=e;if(!(!s&&n&&!g.has(n)))try{t.captureException(r,o=>(o.setTag("crash",s===!0),n&&o.setTag("error.category",n),i&&o.setTag("command",i),d!==void 0&&o.setTag("exit_code",d),o))}catch{}}async function I(r=2e3){if(a)try{await t.flush(r)}catch{}}export{h as a,R as b,w as c,A as d,I as e};
@@ -0,0 +1 @@
1
+ var e="3.10.0";export{e as a};
@@ -0,0 +1,5 @@
1
+ import{a as h,c as m,d as $,e as w,g as S,h as T,i as I,j,k as L,l as E,n as k,o as P,q as x}from"./chunk-7UKHARLH.js";import{spawnSync as D}from"child_process";import{existsSync as d,mkdirSync as O,readFileSync as V,writeFileSync as W}from"fs";import{homedir as _}from"os";import{dirname as R}from"path";import*as e from"@clack/prompts";async function X(){process.stdin.isTTY||(console.error("Run `tigris init` in an interactive terminal."),process.exit(1));let t=process.cwd(),i=_();e.intro("Connect Tigris to your AI coding agent");let n=E({env:process.env,cwd:t,home:i,fileExists:d}),l=await e.multiselect({message:"Which editor(s) should use Tigris?",options:I.map(u=>({value:u.id,label:u.label})),initialValues:n,required:!0});if(e.isCancel(l))return b();let s=I.filter(u=>l.includes(u.id)),p=m(),o=await e.select({message:"What would you like to install?",options:[{value:"defaults",label:"Defaults",hint:$(p!==null)},{value:"custom",label:"Customize installation"}],initialValue:"defaults"});if(e.isCancel(o))return b();let a="global",r="project";o==="custom"&&(a=await A("MCP server:","global"),r=await A("Agent skills:","project"));let c=k.map(u=>u.id);if(o==="custom"&&r!=="skip"){let u=await e.multiselect({message:"Which skills should your agent get? (space to toggle)",options:k.map(f=>({value:f.id,label:f.label})),initialValues:k.filter(f=>f.recommended).map(f=>f.id),required:!1});if(e.isCancel(u))return b();c=u}let g;if(p?g=q(p)||z(p):g=Y(),a==="skip")e.log.info("MCP server: skipped");else for(let u of s)H(u,a,t,i);r==="skip"||c.length===0?e.log.info("Agent skills: skipped"):G(s,c,r,t,i),e.note(g?"tigris init --agent":"npx tigris init --agent","Paste this to your AI coding agent to finish setup"),e.outro("Your agent will authenticate with Tigris in-browser on first use.")}async function A(t,i){let n=await e.select({message:t,options:[{value:"global",label:"Global (available in all projects)"},{value:"project",label:"Project-level (this project only)"},{value:"skip",label:"Skip"}],initialValue:i});return e.isCancel(n)&&b(),n}function b(){e.cancel("Setup cancelled."),process.exit(1)}function C(t,i){return t.startsWith(i)?`~${t.slice(i.length)}`:t}function H(t,i,n,l){let s=t.mcp,p=L(t,i,n);if(!s||!p){e.log.warn(`${t.label}: no writable MCP config \u2014 skipped.`);return}let o=p.path;!d(o)&&o.endsWith(".json")&&d(`${o}c`)&&(o=`${o}c`);let a=R(o);if(s.createDirs===!1&&!d(R(a))){e.log.warn(`${t.label}: not installed \u2014 skipped.`);return}try{let r=d(o)?V(o,"utf8"):null,c=s.format==="toml"?T(r,s.key,w,N(s.entry)):S(r,s.key,w,s.entry);O(a,{recursive:!0}),W(o,c.content);let g=p.scope===i?"":` (${p.scope}-only)`;e.log.success(`${t.label}: MCP \u2192 ${C(o,l)}${g}`)}catch{e.log.error(`${t.label}: could not update ${C(o,l)} (incompatible or unwritable) \u2014 skipped.`)}}function G(t,i,n,l,s,p=v){let o=(c,g)=>p("npx",P(i,[...new Set(c.map(y=>y.skillsAgent))],n==="global"),g),a=t,r=o(a,`Installing ${i.length} Tigris skill(s) (${n})`);if(!r.ok){let{kept:c,dropped:g}=x(a,r.output??"");if(g.length>0){if(e.log.warn(`Skills: installer has no support for ${M(g)} \u2014 skipped.`),c.length===0){e.log.info("Agent skills: skipped (no supported editor selected)");return}a=c,r=o(a,`Installing ${i.length} Tigris skill(s) for ${M(a)}`)}}if(r.ok)for(let c of j(a,n,l))e.log.success(`Skills \u2192 ${C(c,s)}`);else r.output&&e.log.error(r.output.split(`
2
+ `).slice(-6).join(`
3
+ `))}function M(t){return t.map(i=>i.label).join(", ")}function N(t){let i={};for(let[n,l]of Object.entries(t))typeof l=="string"&&(i[n]=l);return i}function Y(){let t=v("npm",["install","-g","@tigrisdata/cli","--ignore-scripts"],"Installing Tigris CLI (global)");return F(t)?m()===null?(e.log.warn("Tigris CLI installed but not on PATH \u2014 the agent handoff will use npx."),!1):!0:!1}function q(t){if(!F(v("tigris",["update"],`Checking for Tigris CLI updates (${t})`)))return!1;let n=m();return n&&n!==t&&e.log.success(`Tigris CLI ${t} \u2192 ${n}`),!0}function z(t){let i=D("tigris",["init","--agent"],h());return i.error||i.status!==0?(e.log.warn(`Tigris CLI ${t} predates \`init --agent\` \u2014 the agent handoff will use npx.`),!1):!0}function v(t,i,n){let l=e.spinner();l.start(n);let s=D(t,i,h());return s.status===0?(l.stop(`${n} \u2014 done`),{ok:!0}):(l.stop(`${n} \u2014 failed`),{ok:!1,output:(s.stderr||s.stdout||s.error?.message||"").trim()})}function F(t){return!t.ok&&t.output&&e.log.error(t.output.split(`
4
+ `).slice(-6).join(`
5
+ `)),t.ok}export{X as a,G as b};
@@ -1 +1 @@
1
- import{b as n}from"./chunk-FKHFOOA3.js";function o(s,e){if(e===void 0)return;let t=(Array.isArray(e)?e:[e]).map(r=>typeof r=="string"?r.trim():"").filter(r=>r.length>0);return t.length===0&&n(s,"--members requires at least one email address"),t}export{o as a};
1
+ import{b as n}from"./chunk-IIF5VLQ7.js";function o(s,e){if(e===void 0)return;let t=(Array.isArray(e)?e:[e]).map(r=>typeof r=="string"?r.trim():"").filter(r=>r.length>0);return t.length===0&&n(s,"--members requires at least one email address"),t}export{o as a};
@@ -1,2 +1,2 @@
1
- import{a as o,d as a}from"./chunk-2TPTTPAT.js";import{b as i}from"./chunk-FKHFOOA3.js";import{c as r}from"./chunk-J3MAV7JB.js";import{i as n,p as s}from"./chunk-F4AGJWCK.js";async function d(e){s()!=="oauth"&&i(e,`This operation requires OAuth login.
1
+ import{a as o,d as a}from"./chunk-R3KHIAWP.js";import{b as i}from"./chunk-IIF5VLQ7.js";import{c as r}from"./chunk-J3MAV7JB.js";import{i as n,p as s}from"./chunk-F4AGJWCK.js";async function d(e){s()!=="oauth"&&i(e,`This operation requires OAuth login.
2
2
  Run "tigris login oauth" first.`);let t=r();await t.isAuthenticated()||i(e,'Not authenticated. Run "tigris login oauth" first.');let c=n(),{iamEndpoint:g,mgmtEndpoint:u}=o();return{sessionToken:await t.getAccessToken(),organizationId:c??void 0,iamEndpoint:g,mgmtEndpoint:u}}async function A(e){let t=await a();switch(t.type){case"oauth":return d(e);case"aws-profile":case"credentials":case"environment":case"configured":return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,organizationId:n()??void 0,iamEndpoint:o().iamEndpoint};case"none":i(e,'Not authenticated. Run "tigris login" or "tigris configure" first.')}}export{d as a,A as b};
@@ -0,0 +1 @@
1
+ var t="https://t3.storage.dev",o="https://iam.storageapi.dev",s="https://mgmt.storageapi.dev",p="https://registry.npmjs.org/@tigrisdata/cli/latest",_=216e5,e=36e5,T="TIGRIS_NO_BANNER",r="https://c3a84c6a2811c557d70e42412cda4ffa@o4507410155896832.ingest.us.sentry.io/4511767771545600",E="phc_6a2zd9w9hGzIqYl527bL4dXk3Wz8J9pEHyXTwP1hHq4",N="https://ph.tigrisdata.com";export{t as a,o as b,s as c,p as d,_ as e,e as f,T as g,r as h,E as i,N as j};
@@ -1,4 +1,4 @@
1
- import{a as p,b as a}from"./chunk-G4OJTPSI.js";import{a as r}from"./chunk-64FBY7Z6.js";import{b as f}from"./chunk-BMWWPXMU.js";import{e as c,f as I,h as _,i as g}from"./chunk-APJUJ6TW.js";import{h as l,i as m}from"./chunk-672QCRVD.js";import{request as O}from"http";import{request as v}from"https";var E="/i/v0/e/",N=1e3;function y(){return process.env.TIGRIS_POSTHOG_KEY?.trim()||l}function R(){return process.env.TIGRIS_POSTHOG_HOST?.trim()||m}var C=["CI","CONTINUOUS_INTEGRATION","BUILD_NUMBER","GITHUB_ACTIONS","GITLAB_CI","CIRCLECI","TRAVIS","JENKINS_URL","BUILDKITE","TEAMCITY_VERSION","TF_BUILD"];function w(){return C.some(e=>{let t=process.env[e];return t!==void 0&&t!==""&&t!=="0"&&t.toLowerCase()!=="false"})}var k=/^[a-z0-9][a-z0-9-]*$/i;function M(e){let t=new Set;for(let o of e){if(o==="--")break;if(!o.startsWith("-")||o==="-")continue;let n=o.split("=")[0].replace(/^--?/,"");k.test(n)&&t.add(n)}return[...t].sort()}function b(e){try{let t=e.split(".")[1];if(!t)return;let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))?.email;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}async function h(){let e=I(),t={distinctId:e,anonymousId:e,isIdentified:!1,authMethod:"none"};try{let o=await import("./auth/storage.js"),n=await o.getTokens(),i=n?.idToken?b(n.idToken):void 0;return{distinctId:i??e,anonymousId:e,isIdentified:i!==void 0,authMethod:o.getLoginMethod()??"none",organizationId:o.getSelectedOrganization()??void 0}}catch{return t}}function T(){return{$lib:"tigris-cli",$lib_version:r,interface:"cli",cli_version:r,runtime:p()?"binary":"node",install_method:a(),node_version:process.version,os:process.platform,arch:process.arch,is_ci:w(),is_tty:process.stdout.isTTY===!0}}function S(e){return new Promise(t=>{let o=!1,n=()=>{o||(o=!0,t())};try{let i=new URL(E,R()),u=JSON.stringify(e),s=(i.protocol==="http:"?O:v)({protocol:i.protocol,hostname:i.hostname,port:i.port||void 0,path:i.pathname,method:"POST",timeout:N,headers:{"content-type":"application/json","content-length":Buffer.byteLength(u),"user-agent":`tigris-cli/${r}`}},d=>{d.resume(),d.on("end",n),d.on("error",n)});s.on("error",n),s.on("timeout",()=>{s.destroy(),n()}),s.end(u)}catch{n()}})}var L=`
1
+ import{a as p,b as a}from"./chunk-G4OJTPSI.js";import{a as r}from"./chunk-RH6Z22EN.js";import{b as f}from"./chunk-BMWWPXMU.js";import{e as c,f as I,h as _,i as g}from"./chunk-APJUJ6TW.js";import{i as l,j as m}from"./chunk-V6JZFDRE.js";import{request as O}from"http";import{request as v}from"https";var E="/i/v0/e/",N=1e3;function y(){return process.env.TIGRIS_POSTHOG_KEY?.trim()||l}function R(){return process.env.TIGRIS_POSTHOG_HOST?.trim()||m}var C=["CI","CONTINUOUS_INTEGRATION","BUILD_NUMBER","GITHUB_ACTIONS","GITLAB_CI","CIRCLECI","TRAVIS","JENKINS_URL","BUILDKITE","TEAMCITY_VERSION","TF_BUILD"];function w(){return C.some(e=>{let t=process.env[e];return t!==void 0&&t!==""&&t!=="0"&&t.toLowerCase()!=="false"})}var k=/^[a-z0-9][a-z0-9-]*$/i;function M(e){let t=new Set;for(let o of e){if(o==="--")break;if(!o.startsWith("-")||o==="-")continue;let n=o.split("=")[0].replace(/^--?/,"");k.test(n)&&t.add(n)}return[...t].sort()}function b(e){try{let t=e.split(".")[1];if(!t)return;let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))?.email;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}async function h(){let e=I(),t={distinctId:e,anonymousId:e,isIdentified:!1,authMethod:"none"};try{let o=await import("./auth/storage.js"),n=await o.getTokens(),i=n?.idToken?b(n.idToken):void 0;return{distinctId:i??e,anonymousId:e,isIdentified:i!==void 0,authMethod:o.getLoginMethod()??"none",organizationId:o.getSelectedOrganization()??void 0}}catch{return t}}function T(){return{$lib:"tigris-cli",$lib_version:r,interface:"cli",cli_version:r,runtime:p()?"binary":"node",install_method:a(),node_version:process.version,os:process.platform,arch:process.arch,is_ci:w(),is_tty:process.stdout.isTTY===!0}}function S(e){return new Promise(t=>{let o=!1,n=()=>{o||(o=!0,t())};try{let i=new URL(E,R()),u=JSON.stringify(e),s=(i.protocol==="http:"?O:v)({protocol:i.protocol,hostname:i.hostname,port:i.port||void 0,path:i.pathname,method:"POST",timeout:N,headers:{"content-type":"application/json","content-length":Buffer.byteLength(u),"user-agent":`tigris-cli/${r}`}},d=>{d.resume(),d.on("end",n),d.on("error",n)});s.on("error",n),s.on("timeout",()=>{s.destroy(),n()}),s.end(u)}catch{n()}})}var L=`
2
2
  Tigris CLI collects usage analytics (which commands you run and their
3
3
  arguments, CLI version, OS) and error reports, to help us decide what to
4
4
  improve. Credentials \u2014 access keys, secrets, tokens \u2014 are never collected.
package/dist/cli-core.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-LKNUDKJD.js";import"./chunk-UUPTUOXD.js";import"./chunk-G4OJTPSI.js";import"./chunk-FKHFOOA3.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-AFES4NT6.js";import"./chunk-DV3LCXRH.js";import"./chunk-64FBY7Z6.js";import"./chunk-BMWWPXMU.js";import"./chunk-APJUJ6TW.js";import"./chunk-672QCRVD.js";export{g as addArgumentsToCommand,d as commandHasAnyImplementation,k as createProgram,i as extractArgumentValues,c as formatArgumentHelp,b as isValidCommandName,j as registerCommands,a as setupErrorHandlers,e as showCommandHelp,f as showMainHelp,h as validateRequiredWhen};
1
+ import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-CEEDWOY2.js";import"./chunk-ZTZF3OHU.js";import"./chunk-G4OJTPSI.js";import"./chunk-IIF5VLQ7.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-RDJQLQQY.js";import"./chunk-DV3LCXRH.js";import"./chunk-RH6Z22EN.js";import"./chunk-BMWWPXMU.js";import"./chunk-APJUJ6TW.js";import"./chunk-V6JZFDRE.js";export{g as addArgumentsToCommand,d as commandHasAnyImplementation,k as createProgram,i as extractArgumentValues,c as formatArgumentHelp,b as isValidCommandName,j as registerCommands,a as setupErrorHandlers,e as showCommandHelp,f as showMainHelp,h as validateRequiredWhen};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./chunk-WIJB3E2C.js";import"./chunk-54KNZAI5.js";import"./chunk-LKNUDKJD.js";import"./chunk-UUPTUOXD.js";import"./chunk-G4OJTPSI.js";import"./chunk-FKHFOOA3.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-AFES4NT6.js";import"./chunk-DV3LCXRH.js";import"./chunk-64FBY7Z6.js";import"./chunk-BMWWPXMU.js";import"./chunk-APJUJ6TW.js";import"./chunk-672QCRVD.js";
2
+ import"./chunk-PNRZDYCK.js";import"./chunk-76VFN2EJ.js";import"./chunk-CEEDWOY2.js";import"./chunk-ZTZF3OHU.js";import"./chunk-G4OJTPSI.js";import"./chunk-IIF5VLQ7.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-RDJQLQQY.js";import"./chunk-DV3LCXRH.js";import"./chunk-RH6Z22EN.js";import"./chunk-BMWWPXMU.js";import"./chunk-APJUJ6TW.js";import"./chunk-V6JZFDRE.js";
package/dist/constants.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-672QCRVD.js";export{b as DEFAULT_IAM_ENDPOINT,c as DEFAULT_MGMT_ENDPOINT,a as DEFAULT_STORAGE_ENDPOINT,d as NPM_REGISTRY_URL,i as POSTHOG_HOST,h as POSTHOG_KEY,g as SENTRY_DSN,e as UPDATE_CHECK_INTERVAL_MS,f as UPDATE_NOTIFY_INTERVAL_MS};
1
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-V6JZFDRE.js";export{b as DEFAULT_IAM_ENDPOINT,c as DEFAULT_MGMT_ENDPOINT,a as DEFAULT_STORAGE_ENDPOINT,g as NO_BANNER_ENV,d as NPM_REGISTRY_URL,j as POSTHOG_HOST,i as POSTHOG_KEY,h as SENTRY_DSN,e as UPDATE_CHECK_INTERVAL_MS,f as UPDATE_NOTIFY_INTERVAL_MS};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-WIJB3E2C.js";import"./chunk-54KNZAI5.js";import"./chunk-LKNUDKJD.js";import"./chunk-UUPTUOXD.js";import"./chunk-G4OJTPSI.js";import"./chunk-FKHFOOA3.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-AFES4NT6.js";import"./chunk-DV3LCXRH.js";import"./chunk-64FBY7Z6.js";import"./chunk-BMWWPXMU.js";import"./chunk-APJUJ6TW.js";import"./chunk-672QCRVD.js";
1
+ import"./chunk-PNRZDYCK.js";import"./chunk-76VFN2EJ.js";import"./chunk-CEEDWOY2.js";import"./chunk-ZTZF3OHU.js";import"./chunk-G4OJTPSI.js";import"./chunk-IIF5VLQ7.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-RDJQLQQY.js";import"./chunk-DV3LCXRH.js";import"./chunk-RH6Z22EN.js";import"./chunk-BMWWPXMU.js";import"./chunk-APJUJ6TW.js";import"./chunk-V6JZFDRE.js";
@@ -1 +1 @@
1
- import{b as y}from"../../chunk-N76NIM6R.js";import"../../chunk-2TPTTPAT.js";import{a as s,b as h}from"../../chunk-S6KFKBMY.js";import{b as n,c as b,d as p}from"../../chunk-FKHFOOA3.js";import{b as A,c as f,j as R}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{assignBucketRoles as x,revokeAllBucketRoles as w}from"@tigrisdata/iam";var e=R("access-keys","assign"),N=["Editor","ReadOnly","NamespaceAdmin"];function v(r){return r?Array.isArray(r)?r:[r]:[]}async function O(r){A(e);let g=h(r),i=s(r,["id"]),m=s(r,["admin"]),d=s(r,["revokeRoles","revoke-roles"]),l=v(s(r,["bucket","b"])),t=v(s(r,["role","r"]));i||n(e,"Access key ID is required"),m&&d&&n(e,"Cannot use --admin and --revoke-roles together");let u=await y(e);if(d){let{error:o}=await w(i,{config:u});o&&n(e,o),g==="json"&&console.log(JSON.stringify({action:"revoked",id:i})),f(e);return}let a;if(m)a=[{bucket:"*",role:"NamespaceAdmin"}];else{l.length===0&&n(e,"At least one bucket name is required (or use --admin or --revoke-roles)"),t.length===0&&n(e,"At least one role is required (or use --admin or --revoke-roles)");for(let o of t)N.includes(o)||n(e,`Invalid role "${o}". Valid roles are: ${N.join(", ")}`);t.length===1?a=l.map(o=>({bucket:o,role:t[0]})):t.length===l.length?a=l.map((o,c)=>({bucket:o,role:t[c]})):n(e,`Number of roles (${t.length}) must be 1 or match number of buckets (${l.length})`)}let{error:k}=await x(i,a,{config:u});if(k&&n(e,k),g==="json"){let o=b(e),c={action:"assigned",id:i,assignments:a};o.length>0&&(c.nextActions=o),console.log(JSON.stringify(c))}f(e),p(e)}export{O as default};
1
+ import{b as y}from"../../chunk-UZIIZW33.js";import"../../chunk-R3KHIAWP.js";import{a as s,b as h}from"../../chunk-S6KFKBMY.js";import{b as n,c as b,d as p}from"../../chunk-IIF5VLQ7.js";import{b as A,c as f,j as R}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{assignBucketRoles as x,revokeAllBucketRoles as w}from"@tigrisdata/iam";var e=R("access-keys","assign"),N=["Editor","ReadOnly","NamespaceAdmin"];function v(r){return r?Array.isArray(r)?r:[r]:[]}async function O(r){A(e);let g=h(r),i=s(r,["id"]),m=s(r,["admin"]),d=s(r,["revokeRoles","revoke-roles"]),l=v(s(r,["bucket","b"])),t=v(s(r,["role","r"]));i||n(e,"Access key ID is required"),m&&d&&n(e,"Cannot use --admin and --revoke-roles together");let u=await y(e);if(d){let{error:o}=await w(i,{config:u});o&&n(e,o),g==="json"&&console.log(JSON.stringify({action:"revoked",id:i})),f(e);return}let a;if(m)a=[{bucket:"*",role:"NamespaceAdmin"}];else{l.length===0&&n(e,"At least one bucket name is required (or use --admin or --revoke-roles)"),t.length===0&&n(e,"At least one role is required (or use --admin or --revoke-roles)");for(let o of t)N.includes(o)||n(e,`Invalid role "${o}". Valid roles are: ${N.join(", ")}`);t.length===1?a=l.map(o=>({bucket:o,role:t[0]})):t.length===l.length?a=l.map((o,c)=>({bucket:o,role:t[c]})):n(e,`Number of roles (${t.length}) must be 1 or match number of buckets (${l.length})`)}let{error:k}=await x(i,a,{config:u});if(k&&n(e,k),g==="json"){let o=b(e),c={action:"assigned",id:i,assignments:a};o.length>0&&(c.nextActions=o),console.log(JSON.stringify(c))}f(e),p(e)}export{O as default};
@@ -1 +1 @@
1
- import{b as u}from"../../chunk-N76NIM6R.js";import{a as d}from"../../chunk-S77OAN6Y.js";import"../../chunk-2TPTTPAT.js";import{a as l,b as h}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-FKHFOOA3.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import S from"enquirer";import{attachPolicyToAccessKey as N,listPolicies as R,listPoliciesForAccessKey as q}from"@tigrisdata/iam";var{prompt:k}=S,e=g("access-keys","attach-policy");async function v(s){p(e);let A=h(s),o=l(s,["id"]),r=l(s,["policyArn","policy-arn"]);o||t(e,"Access key ID is required");let c=await u(e);if(!r){d("Use --policy-arn to specify the policy ARN");let[a,n]=await Promise.all([R({config:c}),q(o,{config:c})]);a.error&&t(e,a.error),n.error&&t(e,n.error);let w=new Set(n.data.policies),f=a.data.policies.filter(i=>!w.has(i.name));f.length===0&&t(e,"No unassigned policies available. All policies are already attached to this access key.");let{selected:P}=await k({type:"select",name:"selected",message:"Select a policy to attach:",choices:f.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});r=P}let{error:m}=await N(o,r,{config:c});m&&t(e,m),A==="json"&&console.log(JSON.stringify({action:"attached",id:o,policyArn:r})),y(e)}export{v as default};
1
+ import{b as u}from"../../chunk-UZIIZW33.js";import{a as d}from"../../chunk-S77OAN6Y.js";import"../../chunk-R3KHIAWP.js";import{a as l,b as h}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-IIF5VLQ7.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import S from"enquirer";import{attachPolicyToAccessKey as N,listPolicies as R,listPoliciesForAccessKey as q}from"@tigrisdata/iam";var{prompt:k}=S,e=g("access-keys","attach-policy");async function v(s){p(e);let A=h(s),o=l(s,["id"]),r=l(s,["policyArn","policy-arn"]);o||t(e,"Access key ID is required");let c=await u(e);if(!r){d("Use --policy-arn to specify the policy ARN");let[a,n]=await Promise.all([R({config:c}),q(o,{config:c})]);a.error&&t(e,a.error),n.error&&t(e,n.error);let w=new Set(n.data.policies),f=a.data.policies.filter(i=>!w.has(i.name));f.length===0&&t(e,"No unassigned policies available. All policies are already attached to this access key.");let{selected:P}=await k({type:"select",name:"selected",message:"Select a policy to attach:",choices:f.map(i=>({name:i.resource,message:`${i.name} (${i.resource})`}))});r=P}let{error:m}=await N(o,r,{config:c});m&&t(e,m),A==="json"&&console.log(JSON.stringify({action:"attached",id:o,policyArn:r})),y(e)}export{v as default};
@@ -1 +1 @@
1
- import{b as u}from"../../chunk-N76NIM6R.js";import"../../chunk-2TPTTPAT.js";import{a as d,b as p}from"../../chunk-S6KFKBMY.js";import{b as o,c as g,d as f}from"../../chunk-FKHFOOA3.js";import{b as a,c as m,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{createAccessKey as w}from"@tigrisdata/iam";var t=l("access-keys","create");async function x(n){a(t);let A=p(n),c=d(n,["name"]);c||o(t,"Access key name is required");let y=await u(t),{data:e,error:s}=await w(c,{config:y});if(s&&o(t,s),A==="json"){let r=g(t,{name:e.name,id:e.id}),i={action:"created",name:e.name,id:e.id,secret:e.secret};r.length>0&&(i.nextActions=r),console.log(JSON.stringify(i))}else console.log(` Name: ${e.name}`),console.log(` Access Key ID: ${e.id}`),console.log(` Secret Access Key: ${e.secret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");m(t),f(t,{name:e.name,id:e.id})}export{x as default};
1
+ import{b as u}from"../../chunk-UZIIZW33.js";import"../../chunk-R3KHIAWP.js";import{a as d,b as p}from"../../chunk-S6KFKBMY.js";import{b as o,c as g,d as f}from"../../chunk-IIF5VLQ7.js";import{b as a,c as m,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{createAccessKey as w}from"@tigrisdata/iam";var t=l("access-keys","create");async function x(n){a(t);let A=p(n),c=d(n,["name"]);c||o(t,"Access key name is required");let y=await u(t),{data:e,error:s}=await w(c,{config:y});if(s&&o(t,s),A==="json"){let r=g(t,{name:e.name,id:e.id}),i={action:"created",name:e.name,id:e.id,secret:e.secret};r.length>0&&(i.nextActions=r),console.log(JSON.stringify(i))}else console.log(` Name: ${e.name}`),console.log(` Access Key ID: ${e.id}`),console.log(` Secret Access Key: ${e.secret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");m(t),f(t,{name:e.name,id:e.id})}export{x as default};
@@ -1 +1 @@
1
- import{b as g}from"../../chunk-N76NIM6R.js";import{a as m,b as a}from"../../chunk-S77OAN6Y.js";import"../../chunk-2TPTTPAT.js";import{a as i,b as d}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-FKHFOOA3.js";import{b as n,c as s,j as f}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{removeAccessKey as u}from"@tigrisdata/iam";var e=f("access-keys","delete");async function k(r){n(e);let l=d(r),o=i(r,["id"]),p=i(r,["yes","y","force"]);if(o||t(e,"Access key ID is required"),!p&&(m("Use --yes to skip confirmation"),!await a(`Delete access key '${o}'?`))){console.log("Aborted");return}let y=await g(e),{error:c}=await u(o,{config:y});c&&t(e,c),l==="json"&&console.log(JSON.stringify({action:"deleted",id:o})),s(e)}export{k as default};
1
+ import{b as g}from"../../chunk-UZIIZW33.js";import{a as m,b as a}from"../../chunk-S77OAN6Y.js";import"../../chunk-R3KHIAWP.js";import{a as i,b as d}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-IIF5VLQ7.js";import{b as n,c as s,j as f}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{removeAccessKey as u}from"@tigrisdata/iam";var e=f("access-keys","delete");async function k(r){n(e);let l=d(r),o=i(r,["id"]),p=i(r,["yes","y","force"]);if(o||t(e,"Access key ID is required"),!p&&(m("Use --yes to skip confirmation"),!await a(`Delete access key '${o}'?`))){console.log("Aborted");return}let y=await g(e),{error:c}=await u(o,{config:y});c&&t(e,c),l==="json"&&console.log(JSON.stringify({action:"deleted",id:o})),s(e)}export{k as default};
@@ -1 +1 @@
1
- import{b as A}from"../../chunk-N76NIM6R.js";import{a as m,b as h}from"../../chunk-S77OAN6Y.js";import"../../chunk-2TPTTPAT.js";import{a,b as u}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-FKHFOOA3.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import N from"enquirer";import{detachPolicyFromAccessKey as $,listPolicies as q,listPoliciesForAccessKey as F}from"@tigrisdata/iam";var{prompt:R}=N,e=g("access-keys","detach-policy");async function I(c){p(e);let w=u(c),t=a(c,["id"]),i=a(c,["policyArn","policy-arn"]),k=a(c,["yes","y","force"]);t||o(e,"Access key ID is required");let n=await A(e);if(!i){m("Use --policy-arn to specify the policy ARN");let[s,l]=await Promise.all([F(t,{config:n}),q({config:n})]);s.error&&o(e,s.error),l.error&&o(e,l.error);let P=new Set(s.data.policies),d=l.data.policies.filter(r=>P.has(r.name));d.length===0&&o(e,"No policies are attached to this access key.");let{selected:S}=await R({type:"select",name:"selected",message:"Select a policy to detach:",choices:d.map(r=>({name:r.resource,message:`${r.name} (${r.resource})`}))});i=S}if(!k&&(m("Use --yes to skip confirmation"),!await h(`Detach policy '${i}' from access key '${t}'?`))){console.log("Aborted");return}let{error:f}=await $(t,i,{config:n});f&&o(e,f),w==="json"&&console.log(JSON.stringify({action:"detached",id:t,policyArn:i})),y(e)}export{I as default};
1
+ import{b as A}from"../../chunk-UZIIZW33.js";import{a as m,b as h}from"../../chunk-S77OAN6Y.js";import"../../chunk-R3KHIAWP.js";import{a,b as u}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-IIF5VLQ7.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import N from"enquirer";import{detachPolicyFromAccessKey as $,listPolicies as q,listPoliciesForAccessKey as F}from"@tigrisdata/iam";var{prompt:R}=N,e=g("access-keys","detach-policy");async function I(c){p(e);let w=u(c),t=a(c,["id"]),i=a(c,["policyArn","policy-arn"]),k=a(c,["yes","y","force"]);t||o(e,"Access key ID is required");let n=await A(e);if(!i){m("Use --policy-arn to specify the policy ARN");let[s,l]=await Promise.all([F(t,{config:n}),q({config:n})]);s.error&&o(e,s.error),l.error&&o(e,l.error);let P=new Set(s.data.policies),d=l.data.policies.filter(r=>P.has(r.name));d.length===0&&o(e,"No policies are attached to this access key.");let{selected:S}=await R({type:"select",name:"selected",message:"Select a policy to detach:",choices:d.map(r=>({name:r.resource,message:`${r.name} (${r.resource})`}))});i=S}if(!k&&(m("Use --yes to skip confirmation"),!await h(`Detach policy '${i}' from access key '${t}'?`))){console.log("Aborted");return}let{error:f}=await $(t,i,{config:n});f&&o(e,f),w==="json"&&console.log(JSON.stringify({action:"detached",id:t,policyArn:i})),y(e)}export{I as default};
@@ -1 +1 @@
1
- import{b as m}from"../../chunk-N76NIM6R.js";import"../../chunk-2TPTTPAT.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-FKHFOOA3.js";import{b as c,c as l,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{getAccessKey as u}from"@tigrisdata/iam";var e=g("access-keys","get");async function $(s){c(e);let d=f(s),r=a(s,["id"]);r||t(e,"Access key ID is required");let p=await m(e),{data:o,error:n}=await u(r,{config:p});if(n&&t(e,n),d==="json")console.log(JSON.stringify(o));else if(console.log(` Name: ${o.name}`),console.log(` ID: ${o.id}`),console.log(` Status: ${o.status}`),console.log(` Created: ${o.createdAt}`),console.log(` Organization: ${o.organizationId}`),o.roles&&o.roles.length>0){console.log(" Roles:");for(let i of o.roles)console.log(` - ${i.bucket}: ${i.role}`)}else console.log(" Roles: None");l(e)}export{$ as default};
1
+ import{b as m}from"../../chunk-UZIIZW33.js";import"../../chunk-R3KHIAWP.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-IIF5VLQ7.js";import{b as c,c as l,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{getAccessKey as u}from"@tigrisdata/iam";var e=g("access-keys","get");async function $(s){c(e);let d=f(s),r=a(s,["id"]);r||t(e,"Access key ID is required");let p=await m(e),{data:o,error:n}=await u(r,{config:p});if(n&&t(e,n),d==="json")console.log(JSON.stringify(o));else if(console.log(` Name: ${o.name}`),console.log(` ID: ${o.id}`),console.log(` Status: ${o.status}`),console.log(` Created: ${o.createdAt}`),console.log(` Organization: ${o.organizationId}`),o.roles&&o.roles.length>0){console.log(" Roles:");for(let i of o.roles)console.log(` - ${i.bucket}: ${i.role}`)}else console.log(" Roles: None");l(e)}export{$ as default};
@@ -1 +1 @@
1
- import{b as P}from"../../chunk-N76NIM6R.js";import{g as A}from"../../chunk-AFM3TY2D.js";import"../../chunk-2TPTTPAT.js";import{a as y,b as k,c as h}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-FKHFOOA3.js";import{b as m,c as g,e as f,i as d,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{listPoliciesForAccessKey as E}from"@tigrisdata/iam";var i=u("access-keys","list-policies");async function F(o){m(i);let n=k(o),{limit:s,pageToken:r}=h(o),a=y(o,["id"]);a||c(i,"Access key ID is required");let T=await P(i),{data:t,error:p}=await E(a,{...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:T});if(p&&c(i,p),!t.policies||t.policies.length===0){f(i);return}let e=t.policies.map(O=>({policy:O})),x=[{key:"policy",header:e.length>1?"Attached Policies":"Attached Policy"}],l=t.paginationToken||void 0,w=A(e,n,"policies","policy",x,{paginationToken:l});console.log(w),n!=="json"&&n!=="xml"&&d(l),g(i,{count:e.length})}export{F as default};
1
+ import{b as P}from"../../chunk-UZIIZW33.js";import{g as A}from"../../chunk-AFM3TY2D.js";import"../../chunk-R3KHIAWP.js";import{a as y,b as k,c as h}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-IIF5VLQ7.js";import{b as m,c as g,e as f,i as d,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{listPoliciesForAccessKey as E}from"@tigrisdata/iam";var i=u("access-keys","list-policies");async function F(o){m(i);let n=k(o),{limit:s,pageToken:r}=h(o),a=y(o,["id"]);a||c(i,"Access key ID is required");let T=await P(i),{data:t,error:p}=await E(a,{...s!==void 0?{limit:s}:{},...r?{paginationToken:r}:{},config:T});if(p&&c(i,p),!t.policies||t.policies.length===0){f(i);return}let e=t.policies.map(O=>({policy:O})),x=[{key:"policy",header:e.length>1?"Attached Policies":"Attached Policy"}],l=t.paginationToken||void 0,w=A(e,n,"policies","policy",x,{paginationToken:l});console.log(w),n!=="json"&&n!=="xml"&&d(l),g(i,{count:e.length})}export{F as default};
@@ -1 +1 @@
1
- import{b as h}from"../../chunk-N76NIM6R.js";import{g as T}from"../../chunk-AFM3TY2D.js";import"../../chunk-2TPTTPAT.js";import{b as k,c as y}from"../../chunk-S6KFKBMY.js";import{b as l}from"../../chunk-FKHFOOA3.js";import{b as d,c as p,e as f,i as g,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.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
+ import{b as h}from"../../chunk-UZIIZW33.js";import{g as T}from"../../chunk-AFM3TY2D.js";import"../../chunk-R3KHIAWP.js";import{b as k,c as y}from"../../chunk-S6KFKBMY.js";import{b as l}from"../../chunk-IIF5VLQ7.js";import{b as d,c as p,e as f,i as g,j as u}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.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{b as w}from"../../chunk-N76NIM6R.js";import{a as u,b as y}from"../../chunk-S77OAN6Y.js";import"../../chunk-2TPTTPAT.js";import{a as i,b as p}from"../../chunk-S6KFKBMY.js";import{b as n,c as g,d as m}from"../../chunk-FKHFOOA3.js";import{b as f,c as l,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{rotateAccessKey as k}from"@tigrisdata/iam";var e=d("access-keys","rotate");async function x(o){f(e);let A=p(o),r=i(o,["id"]),S=i(o,["yes","y","force"]);if(r||n(e,"Access key ID is required"),!S&&(u("Use --yes to skip confirmation"),!await y(`Rotate access key '${r}'? The current secret will be invalidated.`))){console.log("Aborted");return}let h=await w(e),{data:t,error:s}=await k(r,{config:h});if(s&&n(e,s),A==="json"){let c=g(e,{id:t.id}),a={action:"rotated",id:t.id,secret:t.newSecret};c.length>0&&(a.nextActions=c),console.log(JSON.stringify(a))}else console.log(` Access Key ID: ${t.id}`),console.log(` New Secret Access Key: ${t.newSecret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");l(e),m(e,{id:t.id})}export{x as default};
1
+ import{b as w}from"../../chunk-UZIIZW33.js";import{a as u,b as y}from"../../chunk-S77OAN6Y.js";import"../../chunk-R3KHIAWP.js";import{a as i,b as p}from"../../chunk-S6KFKBMY.js";import{b as n,c as g,d as m}from"../../chunk-IIF5VLQ7.js";import{b as f,c as l,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-KJBSIIND.js";import"../../chunk-F4AGJWCK.js";import{rotateAccessKey as k}from"@tigrisdata/iam";var e=d("access-keys","rotate");async function x(o){f(e);let A=p(o),r=i(o,["id"]),S=i(o,["yes","y","force"]);if(r||n(e,"Access key ID is required"),!S&&(u("Use --yes to skip confirmation"),!await y(`Rotate access key '${r}'? The current secret will be invalidated.`))){console.log("Aborted");return}let h=await w(e),{data:t,error:s}=await k(r,{config:h});if(s&&n(e,s),A==="json"){let c=g(e,{id:t.id}),a={action:"rotated",id:t.id,secret:t.newSecret};c.length>0&&(a.nextActions=c),console.log(JSON.stringify(a))}else console.log(` Access Key ID: ${t.id}`),console.log(` New Secret Access Key: ${t.newSecret}`),console.log(""),console.log(" Save these credentials securely. The secret will not be shown again.");l(e),m(e,{id:t.id})}export{x as default};
@@ -1 +1 @@
1
- import{a as C,c as j}from"../../chunk-N3Y6RFSK.js";import{a as B}from"../../chunk-S77OAN6Y.js";import{e as T}from"../../chunk-2TPTTPAT.js";import{a as t,b as O}from"../../chunk-S6KFKBMY.js";import{b as i,c as x,d as D}from"../../chunk-FKHFOOA3.js";import{b as w,c as v,j as L}from"../../chunk-D7WXNA2O.js";import{d as p,e as g}from"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createBucket as E}from"@tigrisdata/storage";import F from"enquirer";var{prompt:J}=F,a=L("buckets","create");async function W(e){w(a);let q=O(e),s=t(e,["name"]),b=t(e,["public"])?"public":t(e,["access","a","A"]),d=t(e,["enable-snapshots","enableSnapshots","s","S"]),N=t(e,["allow-object-acl","allowObjectAcl"]),P=t(e,["enable-directory-listing","enableDirectoryListing"]),h=t(e,["default-tier","t","T"]),I=t(e,["locations","l","L"]),o=t(e,["fork-of","forkOf","fork"]),u=t(e,["source-snapshot","sourceSnapshot","source-snap"]),R=!s,S;if(R){B("Provide --name to skip interactive mode");let c=p("buckets","access","create"),n=g(c),f=n?.findIndex(r=>r.value===c?.default),y=p("buckets","default-tier","create"),A=g(y),m=A?.findIndex(r=>r.value===y?.default),l=await J([{type:"input",name:"name",message:"Bucket name:",required:!0},{type:"select",name:"access",message:"Access level:",choices:n||[],initial:f!==void 0&&f>=0?f:0},{type:"select",name:"defaultTier",message:"Default storage tier:",choices:A||[],initial:m!==void 0&&m>=0?m:0},{type:"confirm",name:"enableSnapshots",message:"Enable snapshots?",initial:!0}]);s=l.name,b=l.access,h=l.defaultTier,d=l.enableSnapshots;try{S=await C()}catch(r){i(a,r)}}s||i(a,"Bucket name is required"),u&&!o&&i(a,"--source-snapshot requires --fork-of");let{error:k}=await E(s,{defaultTier:h??"STANDARD",enableSnapshot:d===!0,allowObjectAcl:N===!0,enableDirectoryListing:P===!0,access:b??"private",locations:S??j(I??"global"),...o?{sourceBucketName:o}:{},...u?{sourceBucketSnapshot:u}:{},config:await T()});if(k&&i(a,k),q==="json"){let c=x(a,{name:s}),n={action:"created",name:s,...o?{forkOf:o}:{}};c.length>0&&(n.nextActions=c),console.log(JSON.stringify(n))}v(a,{name:s}),D(a,{name:s})}export{W as default};
1
+ import{a as C,c as j}from"../../chunk-N3Y6RFSK.js";import{a as B}from"../../chunk-S77OAN6Y.js";import{e as T}from"../../chunk-R3KHIAWP.js";import{a as t,b as O}from"../../chunk-S6KFKBMY.js";import{b as i,c as x,d as D}from"../../chunk-IIF5VLQ7.js";import{b as w,c as v,j as L}from"../../chunk-D7WXNA2O.js";import{d as p,e as g}from"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{createBucket as E}from"@tigrisdata/storage";import F from"enquirer";var{prompt:J}=F,a=L("buckets","create");async function W(e){w(a);let q=O(e),s=t(e,["name"]),b=t(e,["public"])?"public":t(e,["access","a","A"]),d=t(e,["enable-snapshots","enableSnapshots","s","S"]),N=t(e,["allow-object-acl","allowObjectAcl"]),P=t(e,["enable-directory-listing","enableDirectoryListing"]),h=t(e,["default-tier","t","T"]),I=t(e,["locations","l","L"]),o=t(e,["fork-of","forkOf","fork"]),u=t(e,["source-snapshot","sourceSnapshot","source-snap"]),R=!s,S;if(R){B("Provide --name to skip interactive mode");let c=p("buckets","access","create"),n=g(c),f=n?.findIndex(r=>r.value===c?.default),y=p("buckets","default-tier","create"),A=g(y),m=A?.findIndex(r=>r.value===y?.default),l=await J([{type:"input",name:"name",message:"Bucket name:",required:!0},{type:"select",name:"access",message:"Access level:",choices:n||[],initial:f!==void 0&&f>=0?f:0},{type:"select",name:"defaultTier",message:"Default storage tier:",choices:A||[],initial:m!==void 0&&m>=0?m:0},{type:"confirm",name:"enableSnapshots",message:"Enable snapshots?",initial:!0}]);s=l.name,b=l.access,h=l.defaultTier,d=l.enableSnapshots;try{S=await C()}catch(r){i(a,r)}}s||i(a,"Bucket name is required"),u&&!o&&i(a,"--source-snapshot requires --fork-of");let{error:k}=await E(s,{defaultTier:h??"STANDARD",enableSnapshot:d===!0,allowObjectAcl:N===!0,enableDirectoryListing:P===!0,access:b??"private",locations:S??j(I??"global"),...o?{sourceBucketName:o}:{},...u?{sourceBucketSnapshot:u}:{},config:await T()});if(k&&i(a,k),q==="json"){let c=x(a,{name:s}),n={action:"created",name:s,...o?{forkOf:o}:{}};c.length>0&&(n.nextActions=c),console.log(JSON.stringify(n))}v(a,{name:s}),D(a,{name:s})}export{W as default};
@@ -1 +1 @@
1
- import{a as x,b as y}from"../../chunk-S77OAN6Y.js";import{e as b}from"../../chunk-2TPTTPAT.js";import{a as s,b as A}from"../../chunk-S6KFKBMY.js";import{a as p,b as d,c as k,d as h}from"../../chunk-FKHFOOA3.js";import{b as f,c as g,d as u,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{removeBucket as N}from"@tigrisdata/storage";var e=l("buckets","delete");async function B(i){f(e);let w=A(i),o=s(i,["name"]),c=s(i,["yes","y","force"]);o||d(e,"Bucket name is required");let a=Array.isArray(o)?o:[o],S=await b();if(!c&&(x("Use --yes to skip confirmation"),!await y(`Delete ${a.length} bucket(s)?`))){console.log("Aborted");return}let m=[],n=[];for(let t of a){let{error:r}=await N(t,{config:S,force:c});r?(u(e,r.message,{name:t}),n.push({name:t,error:r.message})):(m.push(t),g(e,{name:t}))}if(w==="json"){let t=k(e),r={action:"deleted",names:m,errors:n};t.length>0&&(r.nextActions=t),console.log(JSON.stringify(r))}n.length>0&&p(n[0].error,e),h(e)}export{B as default};
1
+ import{a as x,b as y}from"../../chunk-S77OAN6Y.js";import{e as b}from"../../chunk-R3KHIAWP.js";import{a as s,b as A}from"../../chunk-S6KFKBMY.js";import{a as p,b as d,c as k,d as h}from"../../chunk-IIF5VLQ7.js";import{b as f,c as g,d as u,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{removeBucket as N}from"@tigrisdata/storage";var e=l("buckets","delete");async function B(i){f(e);let w=A(i),o=s(i,["name"]),c=s(i,["yes","y","force"]);o||d(e,"Bucket name is required");let a=Array.isArray(o)?o:[o],S=await b();if(!c&&(x("Use --yes to skip confirmation"),!await y(`Delete ${a.length} bucket(s)?`))){console.log("Aborted");return}let m=[],n=[];for(let t of a){let{error:r}=await N(t,{config:S,force:c});r?(u(e,r.message,{name:t}),n.push({name:t,error:r.message})):(m.push(t),g(e,{name:t}))}if(w==="json"){let t=k(e),r={action:"deleted",names:m,errors:n};t.length>0&&(r.nextActions=t),console.log(JSON.stringify(r))}n.length>0&&p(n[0].error,e),h(e)}export{B as default};
@@ -1 +1 @@
1
- import{f as m}from"../../chunk-2TPTTPAT.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-FKHFOOA3.js";import{b as s,c as a,j as e}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{disableSnapshot as l}from"@tigrisdata/storage";var o=e("buckets","disable-snapshots");async function d(n){s(o);let g=c(n),t=f(n,["name"]);t||i(o,"Bucket name is required");let p=await m(),{error:r}=await l(t,{config:p});r&&i(o,r),g==="json"&&console.log(JSON.stringify({action:"snapshots-disabled",name:t})),a(o,{name:t})}export{d as default};
1
+ import{f as m}from"../../chunk-R3KHIAWP.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-IIF5VLQ7.js";import{b as s,c as a,j as e}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{disableSnapshot as l}from"@tigrisdata/storage";var o=e("buckets","disable-snapshots");async function d(n){s(o);let g=c(n),t=f(n,["name"]);t||i(o,"Bucket name is required");let p=await m(),{error:r}=await l(t,{config:p});r&&i(o,r),g==="json"&&console.log(JSON.stringify({action:"snapshots-disabled",name:t})),a(o,{name:t})}export{d as default};
@@ -1 +1 @@
1
- import{f as m}from"../../chunk-2TPTTPAT.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-FKHFOOA3.js";import{b as e,c as a,j as s}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-AFES4NT6.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-64FBY7Z6.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-672QCRVD.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{enableSnapshot as l}from"@tigrisdata/storage";var o=s("buckets","enable-snapshots");async function u(r){e(o);let g=c(r),t=f(r,["name"]);t||n(o,"Bucket name is required");let p=await m(),{error:i}=await l(t,{config:p});i&&n(o,i),g==="json"&&console.log(JSON.stringify({action:"snapshots-enabled",name:t})),a(o,{name:t})}export{u as default};
1
+ import{f as m}from"../../chunk-R3KHIAWP.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-IIF5VLQ7.js";import{b as e,c as a,j as s}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-RDJQLQQY.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-RH6Z22EN.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-V6JZFDRE.js";import"../../chunk-J3MAV7JB.js";import"../../chunk-F4AGJWCK.js";import{enableSnapshot as l}from"@tigrisdata/storage";var o=s("buckets","enable-snapshots");async function u(r){e(o);let g=c(r),t=f(r,["name"]);t||n(o,"Bucket name is required");let p=await m(),{error:i}=await l(t,{config:p});i&&n(o,i),g==="json"&&console.log(JSON.stringify({action:"snapshots-enabled",name:t})),a(o,{name:t})}export{u as default};