@tigrisdata/cli 3.12.1 → 3.13.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.
- package/README.md +33 -4
- package/dist/auth/iam.js +1 -1
- package/dist/auth/provider.js +1 -1
- package/dist/browser/index.d.ts +18 -0
- package/dist/browser/index.js +456 -193
- package/dist/{chunk-X2SUXPXB.js → chunk-453SVRXR.js} +1 -1
- package/dist/chunk-CIRQB45N.js +7 -0
- package/dist/{chunk-6RSONDY2.js → chunk-DBLI36XY.js} +1 -1
- package/dist/{chunk-IUIKP2LU.js → chunk-EOCLTUJ4.js} +1 -1
- package/dist/chunk-FVHGLZAE.js +1 -0
- package/dist/chunk-IA7SF576.js +2 -0
- package/dist/{chunk-C4WTV2YM.js → chunk-IOTP5CCJ.js} +1 -1
- package/dist/chunk-JF2D6OZD.js +4 -0
- package/dist/{chunk-XBMAJWHH.js → chunk-KKSYGHZK.js} +1 -1
- package/dist/{chunk-NOYGN74P.js → chunk-P2MUSPB4.js} +1 -1
- package/dist/{chunk-JKIAWSHG.js → chunk-PHN3GNLG.js} +1 -1
- package/dist/chunk-QCASVW5M.js +3 -0
- package/dist/chunk-RZMWZYTK.js +1 -0
- package/dist/chunk-S447CUNB.js +1 -0
- package/dist/{chunk-OIOEFM6D.js → chunk-TZ7BKFW5.js} +1 -1
- package/dist/{chunk-4GODDZ6W.js → chunk-VFRTC4TW.js} +1 -1
- package/dist/{chunk-ARZLX6CN.js → chunk-VSUYES3O.js} +1 -1
- package/dist/chunk-Y36SHW6I.js +14 -0
- package/dist/{chunk-YXNJDI2L.js → chunk-Y4FIJDZ4.js} +1 -1
- package/dist/chunk-ZC272QWP.js +5 -0
- package/dist/cli-core.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/help.js +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/access-keys/assign.js +1 -1
- package/dist/lib/access-keys/attach-policy.js +1 -1
- package/dist/lib/access-keys/create.js +2 -1
- package/dist/lib/access-keys/delete.js +1 -1
- package/dist/lib/access-keys/detach-policy.js +1 -1
- package/dist/lib/access-keys/get.js +1 -1
- package/dist/lib/access-keys/list-policies.js +1 -1
- package/dist/lib/access-keys/list.js +1 -1
- package/dist/lib/access-keys/roles.js +1 -0
- package/dist/lib/access-keys/rotate.js +1 -1
- package/dist/lib/buckets/create.js +1 -1
- package/dist/lib/buckets/delete.js +1 -1
- package/dist/lib/buckets/disable-snapshots.js +1 -1
- package/dist/lib/buckets/enable-snapshots.js +1 -1
- package/dist/lib/buckets/get.js +1 -1
- package/dist/lib/buckets/lifecycle/create.js +1 -1
- package/dist/lib/buckets/lifecycle/edit.js +1 -1
- package/dist/lib/buckets/lifecycle/list.js +1 -1
- package/dist/lib/buckets/lifecycle/shared.js +1 -1
- package/dist/lib/buckets/list.js +1 -1
- package/dist/lib/buckets/merge.js +1 -1
- package/dist/lib/buckets/migrate.js +1 -1
- package/dist/lib/buckets/rebase.js +1 -1
- package/dist/lib/buckets/restore.js +1 -1
- package/dist/lib/buckets/set-cors.js +1 -1
- package/dist/lib/buckets/set-locations.js +1 -1
- package/dist/lib/buckets/set-migration.js +1 -1
- package/dist/lib/buckets/set-notifications.js +1 -1
- package/dist/lib/buckets/set.js +1 -1
- package/dist/lib/buckets/share.js +1 -1
- package/dist/lib/bundle.js +1 -1
- package/dist/lib/configure/index.js +1 -1
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +1 -1
- package/dist/lib/iam/policies/create.js +1 -1
- package/dist/lib/iam/policies/delete.js +1 -1
- package/dist/lib/iam/policies/edit.js +1 -1
- package/dist/lib/iam/policies/get.js +1 -1
- package/dist/lib/iam/policies/link-key.js +1 -1
- package/dist/lib/iam/policies/list-keys.js +1 -1
- package/dist/lib/iam/policies/list.js +1 -1
- package/dist/lib/iam/policies/select-policy.js +1 -1
- package/dist/lib/iam/policies/unlink-key.js +1 -1
- package/dist/lib/iam/policies/utils.js +1 -1
- package/dist/lib/iam/teams/create.js +1 -1
- package/dist/lib/iam/teams/edit.js +1 -1
- package/dist/lib/iam/teams/list.js +1 -1
- package/dist/lib/iam/teams/shared.js +1 -1
- package/dist/lib/iam/users/invite.js +1 -1
- package/dist/lib/iam/users/list.js +1 -1
- package/dist/lib/iam/users/remove.js +1 -1
- package/dist/lib/iam/users/revoke-invitation.js +1 -1
- package/dist/lib/iam/users/update-role.js +1 -1
- package/dist/lib/init/index.js +1 -1
- package/dist/lib/init/plan.js +1 -1
- package/dist/lib/login/credentials.js +1 -1
- package/dist/lib/login/oauth.js +1 -1
- package/dist/lib/login/select.js +1 -1
- package/dist/lib/logout.js +1 -1
- package/dist/lib/ls.js +1 -1
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +1 -1
- package/dist/lib/objects/get.js +1 -1
- package/dist/lib/objects/info.js +1 -1
- package/dist/lib/objects/list-versions.js +1 -1
- package/dist/lib/objects/list.js +1 -1
- package/dist/lib/objects/purge.js +1 -1
- package/dist/lib/objects/put.js +1 -1
- package/dist/lib/objects/restore-deleted.js +1 -1
- package/dist/lib/objects/restore-info.js +1 -1
- package/dist/lib/objects/restore.js +1 -1
- package/dist/lib/objects/set-access.js +1 -1
- package/dist/lib/objects/set.js +1 -1
- package/dist/lib/organizations/create.js +1 -1
- package/dist/lib/organizations/list.js +1 -1
- package/dist/lib/organizations/select.js +1 -1
- package/dist/lib/presign.js +1 -1
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/delete.js +1 -1
- package/dist/lib/snapshots/list.js +1 -1
- package/dist/lib/snapshots/take.js +1 -1
- package/dist/lib/stat.js +1 -1
- package/dist/lib/telemetry/disable.js +1 -1
- package/dist/lib/telemetry/enable.js +1 -1
- package/dist/lib/telemetry/status.js +1 -1
- package/dist/lib/touch.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/whoami.js +1 -1
- package/dist/specs.yaml +272 -19
- package/dist/utils/analytics.js +1 -1
- package/dist/utils/bucket-info.js +1 -1
- package/dist/utils/credentials-export.js +1 -0
- package/dist/utils/exit.js +1 -1
- package/dist/utils/telemetry.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-E6COPYXK.js +0 -28
- package/dist/chunk-HEQX2NUJ.js +0 -2
- package/dist/chunk-KWYDYEDO.js +0 -5
- package/dist/chunk-TUDALPGD.js +0 -1
- package/dist/chunk-VXGFGLXP.js +0 -10
- package/dist/chunk-ZJWJRAFY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as l}from"./chunk-APJUJ6TW.js";import{a as c}from"./chunk-RZMWZYTK.js";import{a as u,b as y}from"./chunk-BMWWPXMU.js";import{i as m}from"./chunk-QPUL2AAI.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,7 @@
|
|
|
1
|
+
import{a as h}from"./chunk-QPUL2AAI.js";import{chmodSync as v,existsSync as u,readFileSync as y,realpathSync as x,renameSync as A,statSync as R,unlinkSync as T,writeFileSync as b}from"fs";import{basename as $,dirname as f,join as S,relative as C,sep as I}from"path";var K=["tigris","aws"];function k(t){let{id:e,secret:n,bucket:o,sdk:a,endpoints:c}=t;if(a==="aws")return[["AWS_ACCESS_KEY_ID",e],["AWS_SECRET_ACCESS_KEY",n],["AWS_ENDPOINT_URL_S3",c.storage],["AWS_ENDPOINT_URL_IAM",c.iam],["AWS_REGION","auto"]];let s=[["TIGRIS_STORAGE_ACCESS_KEY_ID",e],["TIGRIS_STORAGE_SECRET_ACCESS_KEY",n]];return c.storage!==h&&s.push(["TIGRIS_STORAGE_ENDPOINT",c.storage]),o&&s.push(["TIGRIS_STORAGE_BUCKET",o]),s}function _(t){return/^[A-Za-z0-9_./:@+=-]*$/.test(t)?t:`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`}function D(t,e){let n=t===""?[]:t.split(`
|
|
2
|
+
`),o=t.endsWith(`
|
|
3
|
+
`);o&&n.pop();let a=t.includes(`\r
|
|
4
|
+
`)?"\r":"",c=new Map(e),s=new Set,i=n.map(r=>{let l=r.endsWith("\r")?"\r":"",p=l?r.slice(0,-1):r,d=/^(\s*(?:export\s+)?)([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(p),g=d?.[2];return!d||g===void 0||!c.has(g)?r:(s.add(g),`${d[1]}${g}=${_(c.get(g)??"")}${l}`)});if(!o&&i.length>0&&a){let r=i.length-1;i[r].endsWith("\r")||(i[r]+="\r")}for(let[r,l]of e)s.has(r)||i.push(`${r}=${_(l)}${a}`);return`${i.join(`
|
|
5
|
+
`)}
|
|
6
|
+
`}function V(t,e){let n=u(t)?x(t):t,o=u(n),a=o?y(n,"utf8"):"",c=o?R(n).mode&511:384,s=S(f(n),`.${$(n)}.${Math.random().toString(36).slice(2)}.tmp`);try{b(s,D(a,e),{mode:c,flag:"wx"}),v(s,c),A(s,n)}catch(i){try{T(s)}catch{}throw i}return{created:!o}}function M(t){return t.map(([e,n])=>`export ${e}='${n.replace(/'/g,"'\\''")}'`)}function G(t){let e=t.split("/"),n=e.map((o,a)=>{let c=a===e.length-1;if(o==="**")return c?".*":"(?:.*/)?";let s=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");return c?s:`${s}/`}).join("");return new RegExp(`^${n}$`)}function W(t){let e=t.trim();if(e===""||e.startsWith("#"))return null;let n=e.endsWith("/");n&&(e=e.slice(0,-1));let o=e.startsWith("**/");o&&(e=e.slice(3));let a=!o&&e.includes("/");if(e.startsWith("/")&&(e=e.slice(1)),e==="")return null;let c=G(e),s=i=>{if(a)return c.test(i);let r=i.split("/");return r.some((l,p)=>c.test(r.slice(p).join("/")))};return i=>{let r=i.split("/"),l=r.slice(0,-1).map((p,d)=>r.slice(0,d+1).join("/"));return!n&&s(i)?"file":l.some(s)?"parent":null}}function j(t){let e=f(t),n="no-gitignore",o=[];for(let i=0;;i++){let r=S(e,".gitignore");if(u(r)){n==="no-gitignore"&&(n="not-covered");let d=C(e,t).split(I).join("/");for(let g of y(r,"utf8").split(`
|
|
7
|
+
`)){let E=g.startsWith("!"),m=W(E?g.slice(1):g)?.(d);m&&o.push({depth:i,ignored:!E,via:m})}}let l=u(S(e,".git")),p=f(e);if(l||p===e)break;e=p}let a=i=>i.reduce((r,l)=>r===void 0||l.depth<=r.depth?l:r,void 0);if(a(o.filter(i=>i.via==="parent"))?.ignored)return"covered";let s=a(o);return s===void 0?n:s.ignored?"covered":"not-covered"}export{K as a,k as b,_ as c,D as d,V as e,M as f,j as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as m}from"./chunk-453SVRXR.js";import{a as r,d as a}from"./chunk-D7WXNA2O.js";import{c}from"./chunk-NI4EYBQH.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{
|
|
1
|
+
import{b as r}from"./chunk-N3Y6RFSK.js";import{a as l}from"./chunk-AFM3TY2D.js";function a(e){if(e.storageClass)return e.days!==void 0?`${e.storageClass} after ${e.days}d`:e.date!==void 0?`${e.storageClass} on ${e.date}`:e.storageClass}function f(e){if(e.expiration){if(e.expiration.days!==void 0)return`${e.expiration.days}d`;if(e.expiration.date!==void 0)return e.expiration.date}}function u(e){let i=[],t=a(e);t&&i.push(t);let s=f(e);s&&i.push(e.expiration?.days!==void 0?`expire after ${s}`:`expire on ${s}`);let n=[];e.filter?.prefix&&n.push(`prefix=${e.filter.prefix}`),e.enabled===!1&&n.push("disabled");let o=i.join(", ");return n.length>0?`${o} (${n.join(", ")})`:o}function p(e){let i=[{label:"Number of Objects",value:e.sizeInfo.numberOfObjects?.toString()??"N/A"},{label:"Total Size",value:e.sizeInfo.size!==void 0?l(e.sizeInfo.size):"N/A"},{label:"All Versions Count",value:e.sizeInfo.numberOfObjectsAllVersions?.toString()??"N/A"},{label:"Default Tier",value:e.settings.defaultTier},{label:"Locations",value:r(e.locations)},{label:"Snapshots Enabled",value:e.isSnapshotEnabled?"Yes":"No"},{label:"Delete Protection",value:e.settings.deleteProtection?"Yes":"No"},{label:"Soft Delete",value:e.settings.softDelete.enabled?`Enabled (${e.settings.softDelete.retentionDays} day retention)`:"Disabled"},{label:"Allow Object ACL",value:e.settings.allowObjectAcl?"Yes":"No"},{label:"Custom Domain",value:e.settings.customDomain??"None"},{label:"Has Forks",value:e.forkInfo?.hasChildren?"Yes":"No"}];e.forkInfo?.parents?.length&&(i.push({label:"Forked From",value:e.forkInfo.parents[0].bucketName}),i.push({label:"Fork Snapshot",value:e.forkInfo.parents[0].snapshot})),e.settings.lifecycleRules?.length&&i.push({label:"Lifecycle Rules",value:e.settings.lifecycleRules.map(n=>u(n)).join(", ")}),e.settings.additionalHeaders&&i.push({label:"Additional Headers",value:Object.entries(e.settings.additionalHeaders).map(([n,o])=>`${n}: ${o}`).join(", ")}),e.settings.corsRules.length&&i.push({label:"CORS Rules",value:`${e.settings.corsRules.length} rule(s)`});let t=e.settings.shares,s=[...t.organization?[`Everyone in organization (${t.organization.role})`]:[],...t.team.map(n=>`${n.teamId} (${n.role})`),...t.user.map(n=>`${n.userId} (${n.role})`)];return s.length&&i.push({label:"Shared With",value:s.join(", ")}),e.settings.notifications&&i.push({label:"Notifications",value:e.settings.notifications.enabled!==!1?"Enabled":"Disabled"}),e.settings.dataMigration&&i.push({label:"Data Migration",value:e.settings.dataMigration.endpoint?`${e.settings.dataMigration.name??"N/A"} (${e.settings.dataMigration.endpoint})`:e.settings.dataMigration.name??"Configured"}),i}export{a,f as b,p as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-S6KFKBMY.js";import{b as o}from"./chunk-DBLI36XY.js";import{ACCESS_KEY_ROLES as u}from"@tigrisdata/iam";function a(e){return e?Array.isArray(e)?e:[e]:[]}function R(e){return{admin:i(e,["admin"])===!0,buckets:a(i(e,["bucket","b"])),roles:a(i(e,["role","r"]))}}function d({admin:e,buckets:s,roles:r}){return e||s.length>0||r.length>0}function h(e,{admin:s,buckets:r,roles:t},l=""){if(s)return(r.length>0||t.length>0)&&o(e,"--admin grants every bucket; it cannot be combined with --bucket or --role"),[{bucket:"*",role:"NamespaceAdmin"}];r.length===0&&o(e,`At least one bucket name is required${l}`),t.length===0&&o(e,`At least one role is required${l}`);for(let n of t)u.includes(n)||o(e,`Invalid role "${n}". Valid roles are: ${u.join(", ")}`);if(t.length===1)return r.map(n=>({bucket:n,role:t[0]}));if(t.length===r.length)return r.map((n,g)=>({bucket:n,role:t[g]}));o(e,`Number of roles (${t.length}) must be 1 or match number of buckets (${r.length})`)}export{R as a,d as b,h as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o,e as g}from"./chunk-ZC272QWP.js";import{b as n}from"./chunk-DBLI36XY.js";import{d as c}from"./chunk-HBEO4D3T.js";import{i,k as r,p as a}from"./chunk-F4AGJWCK.js";async function u(t){a()!=="oauth"&&n(t,`This operation requires OAuth login.
|
|
2
|
+
Run "tigris login oauth" first.`);let e=c();await e.isAuthenticated()||n(t,'Not authenticated. Run "tigris login oauth" first.');let s=i(),{iamEndpoint:d,mgmtEndpoint:f}=o();return{sessionToken:await e.getAccessToken(),organizationId:s??void 0,iamEndpoint:d,mgmtEndpoint:f}}async function A(t){let e=await g();switch(e.type){case"oauth":return u(t);case"aws-profile":{let s=await r(e.profile);return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,organizationId:i()??void 0,iamEndpoint:s.iamEndpoint||o().iamEndpoint}}case"credentials":case"environment":case"configured":return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,organizationId:i()??void 0,iamEndpoint:o().iamEndpoint};case"none":n(t,'Not authenticated. Run "tigris login" or "tigris configure" first.')}}export{u as a,A as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,b as o}from"./chunk-
|
|
1
|
+
import{a as d,b as o}from"./chunk-EOCLTUJ4.js";import{a}from"./chunk-S6KFKBMY.js";import{b as i}from"./chunk-DBLI36XY.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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var T="Usage: ",I="Options:",C="Global Options:",h="Commands:",d=t=>`\x1B[1m${t}\x1B[22m`,W=t=>`\x1B[2m${t}\x1B[22m`,A=new WeakMap;function H(t,n){A.set(t,n)}function x(t){return`${t}:`}function D(t,n){let s=i=>{let e=n.indexOf(i);return e===-1?n.length:e};return[...t].sort(([i],[e])=>s(i)-s(e))}function M(t){let n=t.helpText??t.description??"";if(t.deprecated){let i=t.replaced_by?` Use ${t.replaced_by} instead.`:"";n=`(deprecated) ${n}${i}`}let s=[];if(t.required&&t.type!=="positional"&&s.push("required"),t.options&&t.options.length>0){let i=t.options.map(e=>typeof e=="string"?e:e.value);s.push(`options: ${i.join(", ")}`)}return t.default!==void 0&&t.type!=="flag"&&s.push(`default: ${t.default}`),s.length===0?n:n?`${n} [${s.join("; ")}]`:`[${s.join("; ")}]`}function _(t){let n=[];for(let s=t;s;s=s.parent)n.unshift(s.name());return n.join(" ")}function $(t,n){return t.replace(/\n/g,`
|
|
2
|
+
${" ".repeat(n)}`)}var S={minWidthToWrap:20,subcommandTerm(t){return t.name()},optionTerm(t){return t.flags.startsWith("--")?` ${t.flags}`:t.flags},styleTitle:d,styleSubcommandTerm:d,styleOptionTerm:d,styleArgumentTerm:d,styleDescriptionText(t){return t.replace(/ \[(?:required|options: |default: )[^\]]*\]$/,n=>W(n))},optionDescription(t){return t.description},argumentDescription(t){return t.description},commandUsage(t){let n=[_(t)];this.visibleOptions(t).length>0&&n.push("[options]"),this.visibleCommands(t).length>0&&n.push("[command]");for(let s of t.registeredArguments){let i=`${s.name()}${s.variadic?"...":""}`;n.push(s.required?`<${i}>`:`[${i}]`)}return n.join(" ")},formatItem(t,n,s,i){let e=" ".repeat(2);if(!s)return`${e}${t}`;let m=i.helpWidth??80,a=2+n+2,p=m-a<28,c=p?10:a,u=$(i.boxWrap(s,Math.max(m-c,20)),c);if(p||i.displayWidth(t)>n)return`${e}${t}
|
|
3
|
+
${" ".repeat(c)}${u}`;let g=" ".repeat(n-i.displayWidth(t)+2);return`${e}${t}${g}${u}`},formatHelp(t,n){let s=n.helpWidth??80,i=A.get(t)??{},e=[],m=o=>Math.min(Math.max(0,...o.map(([r])=>n.displayWidth(r))),30),a=(o,r,O=m(r))=>{r.length!==0&&e.push(n.styleTitle(o),...r.map(([b,y])=>n.formatItem(b,O,y,n)),"")},p=o=>[n.styleSubcommandTerm(n.subcommandTerm(o)),n.styleSubcommandDescription(n.subcommandDescription(o))],c=o=>[n.styleOptionTerm(n.optionTerm(o)),n.styleOptionDescription(n.optionDescription(o))];e.push(`${n.styleTitle(T.trimEnd())} ${$(n.boxWrap(n.commandUsage(t),s-T.length),T.length)}`,"");let u=n.commandDescription(t);u&&e.push(n.boxWrap(u,s),"");let g=t.aliases();g.length>0&&e.push(n.styleTitle("Aliases:"),`${" ".repeat(2)}${[t.name(),...g].join(", ")}`,"");let l=n.visibleCommands(t),N=m(l.map(p)),E=this.groupItems(t.commands,l,o=>o.helpGroup()||h);for(let[o,r]of D(E,(i.groups??[]).map(x)))a(o,r.map(p),N);a("Arguments:",n.visibleArguments(t).map(o=>[n.styleArgumentTerm(n.argumentTerm(o)),n.styleArgumentDescription(n.argumentDescription(o))]));let f=this.groupItems(t.options,n.visibleOptions(t),o=>o.helpGroupHeading??I);i.globalOptions&&f.set(C,i.globalOptions);for(let[o,r]of D(f,[I]))a(o,r.map(c));return i.examples&&i.examples.length>0&&e.push(n.styleTitle("Examples:"),...i.examples.map(o=>`${" ".repeat(2)}${o}`),""),l.length>0&&e.push(n.boxWrap(`Use "${_(t)} [command] --help" for more information about a command.`,s),""),e.join(`
|
|
4
|
+
`)}};export{I as a,C as b,H as c,x as d,M as e,S as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-DBLI36XY.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 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-S77OAN6Y.js";import{b as s}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-S77OAN6Y.js";import{b as s}from"./chunk-DBLI36XY.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-
|
|
1
|
+
import{a as K}from"./chunk-S77OAN6Y.js";import{a as w}from"./chunk-ZC272QWP.js";import{b as S}from"./chunk-S6KFKBMY.js";import{b as u,d as l}from"./chunk-DBLI36XY.js";import{b as f,c as y,j as p}from"./chunk-D7WXNA2O.js";import{a as i}from"./chunk-QPUL2AAI.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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{e as b}from"./chunk-VFRTC4TW.js";import{a as _}from"./chunk-DBLI36XY.js";import{c as S,d as I,e as R}from"./chunk-453SVRXR.js";import{h as A}from"./chunk-D7WXNA2O.js";import{b as E}from"./chunk-DV3LCXRH.js";import{a as H,b as L,c as x,d as g,e as h,f as D}from"./chunk-JF2D6OZD.js";import{Command as z,Option as V}from"commander";function y(e,o,n,a,i){let s=e[e.length-1],t=typeof s=="object"&&s!==null&&"args"in s?s.args:e.filter(l=>typeof l=="string");if(t.length===0)return t;let m=t[0],u=(o.commands??[]).filter(l=>v(l,[...n,l.name],i));if(!new Set(u.flatMap(l=>[l.name,...Array.isArray(l.alias)?l.alias:l.alias?[l.alias]:[]])).has(m)){let l=u.map(p=>p.name),d=n.length>0?`'${m}' for '${n.join(" ")}'`:`'${m}'`;console.error(`Unknown command ${d}.`),l.length>0&&console.error(`Available commands: ${l.join(", ")}`);let f=n.length>0?`${a.name} ${n.join(" ")} help`:`${a.name} help`;console.error(`
|
|
2
|
+
Run "${f}" for usage.`),process.exit(1)}return t}function P(){S();let e=!1,o=async n=>{e&&process.exit(1),e=!0,I(n,{crash:!0,exitCode:E(n).exitCode}),await R(),_(n,void 0,{skipCapture:!0})};process.on("unhandledRejection",n=>{(n===""||n===void 0)&&(console.error(`
|
|
3
|
+
Operation cancelled`),process.exit(1)),o(n)}),process.on("uncaughtException",n=>{o(n)})}function F(e){return/^[a-zA-Z0-9_-]+$/.test(e)}function v(e,o,n){return e.removed||n(o)?!0:e.commands?e.commands.some(a=>v(a,[...o,a.name],n)):!1}function N(e,o){let n=o?` Use ${o} instead.`:" See the changelog for migration guidance.";console.error(`${e} was removed in this version.${n}`),process.exit(1)}function G(e,o){if(e)for(let n of e){if(!n.removed)continue;C(o,n.name,e)!==void 0&&N(`--${n.name}`,n.replaced_by)}}function j(e,o){let n=o??[],a=new Set(n.map(t=>t.name)),i=new Set(n.filter(t=>t.alias).map(t=>t.alias)),s=e.filter(t=>!a.has(t.name)&&!(t.alias&&i.has(t.alias)));return[...n,...s]}function $(e){let o=e.alias&&typeof e.alias=="string"&&e.alias.length===1,n=e.alias&&typeof e.alias=="string"&&e.alias.length>1,a=o?`-${e.alias}, --${e.name}`:n?`--${e.alias}, --${e.name}`:`--${e.name}`;return e.type==="flag"?a:e.type==="boolean"?`${a} [value]`:e.options?`${a} <value>`:e.required||e["required-when"]?`${a} <value>`:`${a} [value]`}function q(e,o=[],n=[]){let a=s=>n.findIndex(t=>t.name===s.name);[...o.filter(s=>a(s)===-1),...o.filter(s=>a(s)!==-1).sort((s,t)=>a(s)-a(t))].forEach(s=>{if(s.type==="positional"){let t=s.required?`<${s.name}>`:`[${s.name}]`;e.argument(t,h(s))}else s.removed||s.hidden?e.addOption(new V($(s),s.description??"").hideHelp()):(n.length>0&&e.optionsGroup(a(s)===-1?H:L),e.option($(s),h(s),s.default))})}function K(e){return e.replace(/-([a-z])/g,(o,n)=>n.toUpperCase())}function C(e,o,n){if(n){let i=n.find(s=>s.name===o);if(i?.alias&&typeof i.alias=="string"){let s=i.alias.charAt(0).toUpperCase()+i.alias.slice(1);if(e[s]!==void 0)return e[s]}}let a=[o,o.replace(/-/g,""),o.replace(/-/g,"").toLowerCase(),o.charAt(0).toUpperCase(),K(o)];for(let i of a)if(e[i]!==void 0)return e[i]}function T(e,o){for(let n of e){if(n["required-when"]){let[a,i]=n["required-when"].split("="),s=C(o,a,e),t=C(o,n.name,e);if(s===i&&!t)return console.error(`--${n.name} is required when --${a} is ${i}`),!1}if(n.required&&!C(o,n.name,e))return console.error(`--${n.name} is required`),n.description&&console.error(` ${n.description}`),!1}return!0}function M(e,o,n){let a;"optsWithGlobals"in n&&typeof n.optsWithGlobals=="function"?a=n.optsWithGlobals():"opts"in n&&typeof n.opts=="function"?a=n.opts():a=n;let i={...a};return e.filter(t=>t.type==="positional").forEach((t,m)=>{o[m]!==void 0&&(t.multiple?i[t.name]=o[m].split(",").map(r=>r.trim()):i[t.name]=o[m])}),e.forEach(t=>{t.multiple&&t.type!=="positional"&&i[t.name]&&typeof i[t.name]=="string"&&(i[t.name]=i[t.name].split(",").map(m=>m.trim()))}),i}async function U(e,o,n=[],a={}){(a.json||a.format==="json")&&(globalThis.__TIGRIS_JSON_MODE=!0);let{module:i,error:s}=await e(o);(s||!i)&&(console.error(s),process.exit(1));let t=o[o.length-1],m=i.default||i[t];typeof m!="function"&&(console.error(`Command not implemented: ${o.join(" ")}`),process.exit(1)),b(o),await m({...a,_positional:n})}function W(e,o,n,a=[]){let{specs:i,loadModule:s,hasImplementation:t}=e,m=i.definitions?.global_arguments??[];for(let r of n){F(r.name)||(console.error(`Invalid command name "${r.name}": only alphanumeric, hyphens, and underscores allowed`),process.exit(1));let u=[...a,r.name];if(!v(r,u,t))continue;let c=o.command(r.name,r.removed?{hidden:!0}:void 0).description(r.description??"").summary(r.helpText??"");if(r.group&&c.helpGroup(g(r.group)),x(c,{examples:r.examples,groups:r.groups}),r.alias&&(Array.isArray(r.alias)?r.alias:[r.alias]).forEach(d=>{c.alias(d)}),r.removed){c.allowUnknownOption(!0),c.allowExcessArguments(!0),c.action(()=>{N(`${i.name} ${u.join(" ")}`,r.replaced_by)});continue}if(r.commands&&r.commands.length>0)if(W(e,c,r.commands,u),r.default){let l=r.commands.find(d=>d.name===r.default);if(l){let d=j(m,[...r.arguments||[],...l.arguments||[]]);q(c,d,m),c.allowExcessArguments(!0),c.action(async(...f)=>{let p=f.pop(),k=y([p],r,u,i,t),w=M(d,k,p);d.length>0&&!T(d,w)&&process.exit(1),G(d,w),l.deprecated&&l.messages?.onDeprecated&&A(l.messages.onDeprecated),await U(s,[...u,l.name],k,w)})}}else c.allowExcessArguments(!0),c.action((...l)=>{y(l,r,u,i,t),c.outputHelp()});else q(c,j(m,r.arguments),m),c.action(async(...l)=>{let d=l.pop(),f=l,p=M(r.arguments||[],f,d);r.arguments&&!T(r.arguments,p)&&process.exit(1),G(r.arguments,p),r.deprecated&&r.messages?.onDeprecated&&A(r.messages.onDeprecated),await U(s,u,f,p)});c.command("help",{hidden:!0}).action(()=>{c.outputHelp()})}}function ee(e){let{specs:o,version:n,hasImplementation:a}=e,i=new z;i.name(o.name).description(o.description).version(n,"-V, --version","Show the CLI version").helpOption("-h, --help","Show help").configureHelp(D),W(e,i,o.commands);let s=(o.definitions?.global_arguments??[]).filter(u=>!u.removed).map(u=>new V($(u),h(u)));x(i,{groups:o.groups,globalOptions:s});let t=o.groups?.[o.groups.length-1],m=i.command("help").description("Show general help").action(()=>{i.outputHelp()}),r=i.command("version").description("Show the CLI version").action(()=>{console.log(n)});return t&&(m.helpGroup(g(t)),r.helpGroup(g(t))),i.allowExcessArguments(!0),i.action((...u)=>{y(u,{commands:o.commands},[],o,a),i.outputHelp()}),i}export{P as a,F as b,v as c,q as d,T as e,M as f,W as g,ee as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="3.13.0";export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fromApiDocument as m}from"@tigrisdata/iam";export{m as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as h}from"./chunk-S6KFKBMY.js";import{f as c}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-S6KFKBMY.js";import{f as c}from"./chunk-VFRTC4TW.js";import{a as d,d as e}from"./chunk-DBLI36XY.js";import{b as l,c as r,d as f,g as m,j as p}from"./chunk-D7WXNA2O.js";import{d as u}from"./chunk-HBEO4D3T.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{a as p,b as a}from"./chunk-G4OJTPSI.js";import{
|
|
1
|
+
import{a as p,b as a}from"./chunk-G4OJTPSI.js";import{e as c,f as I,h as _,i as g}from"./chunk-APJUJ6TW.js";import{a as r}from"./chunk-RZMWZYTK.js";import{b as f}from"./chunk-BMWWPXMU.js";import{j as l,k as m}from"./chunk-QPUL2AAI.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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as g}from"./chunk-G4OJTPSI.js";import{a as p}from"./chunk-
|
|
1
|
+
import{b as g}from"./chunk-G4OJTPSI.js";import{a as p}from"./chunk-RZMWZYTK.js";import{d as m,e as f,f as d,g as h}from"./chunk-QPUL2AAI.js";import{mkdirSync as I,readFileSync as S,writeFileSync as U}from"fs";import b from"https";import{homedir as C}from"os";import{join as N}from"path";var _=N(C(),".tigris","update-check.json");function E(){try{let r=S(_,"utf-8"),o=JSON.parse(r);return typeof o.latestVersion=="string"&&typeof o.lastChecked=="number"?o:null}catch{return null}}function T(r){try{I(N(C(),".tigris"),{recursive:!0}),U(_,JSON.stringify(r),"utf-8")}catch{}}function w(r,o){let i=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=i(r),e=i(o);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(g()){case"npm":return"npm install -g @tigrisdata/cli";case"homebrew":return"brew upgrade tigris";default:return process.platform==="win32"?`irm ${f}/install.ps1 | iex`:`curl -fsSL ${f}/install.sh | sh`}}function y(r={}){return new Promise((o,i)=>{let t=b.get(m,{timeout:1e4},e=>{let s="";e.on("data",n=>{s+=n}),e.on("end",()=>{try{let n=JSON.parse(s);typeof n.version=="string"?(T({...E(),latestVersion:n.version,lastChecked:Date.now()}),o(n.version)):i(new Error("Unexpected registry response"))}catch{i(new Error("Failed to parse registry response"))}})});t.on("error",e=>{i(e)}),t.on("timeout",()=>{t.destroy(),i(new Error("Request timed out"))}),r.unref&&t.on("socket",e=>{e.unref()}),t.end()})}function k(){y({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let r=E(),o=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(r&&w(p,r.latestVersion)&&(!r.lastNotified||Date.now()-r.lastNotified>o)){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,14 @@
|
|
|
1
|
+
var i="Ask the user for permission. Then install the CLI: `npm install -g @tigrisdata/cli --ignore-scripts`.",o="Update the CLI to the latest version: `tigris update`.",r=["Run `tigris whoami` to get the authentication state. If the user is not authenticated, run `tigris login oauth`.","Run `tigris orgs list --format json`. If there is more than one org, ask the user which org to use. If there is more than one org, run `tigris orgs select <org>` to make that org active. The commands that come after target the active org.","Read the project name from a metadata file, for example package.json, go.mod, or pyproject.toml. Run `tigris buckets list --format json` first. If the bucket is absent, run `tigris buckets create <name> --format json`. If anything is ambiguous, ask the user.","Identify the SDK that the code uses: Tigris SDK (@tigrisdata/storage, storage-go) or the AWS SDK. Check that `.env` can be written: `test -w . && { test ! -e .env || test -w .env; }`. If that fails, fix the permissions before you continue. Then create an access key with the Editor role on the bucket and write its credentials to `.env` in one step:\n `tigris access-keys create <username>-<project>-devel --bucket <bucket> --role Editor --env --for tigris`\n Pass `--for aws` instead for the AWS SDK. While the write succeeds, the secret goes to `.env` only and is not printed. Do not read `.env` into your context. If `tigris access-keys create` exits non-zero, it printed the credentials instead: delete that key with `tigris access-keys delete <id> --yes`, fix the cause, and run it again. If the command warns that `.env` is not ignored by `.gitignore`, add it.\n\n Variables written for Tigris SDK:\n TIGRIS_STORAGE_ACCESS_KEY_ID, TIGRIS_STORAGE_SECRET_ACCESS_KEY, TIGRIS_STORAGE_BUCKET\n Variables written for the AWS SDK:\n AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL_S3, AWS_ENDPOINT_URL_IAM, AWS_REGION",`Congratulate the user. Then give these links:
|
|
2
|
+
- JS: https://www.tigrisdata.com/docs/sdks/tigris/
|
|
3
|
+
- Go: https://pkg.go.dev/github.com/tigrisdata/storage-go
|
|
4
|
+
- Docs: https://www.tigrisdata.com/docs/
|
|
5
|
+
- Discord: https://community.tigrisdata.com/
|
|
6
|
+
- Skills: https://www.tigrisdata.com/docs/skills/
|
|
7
|
+
|
|
8
|
+
Suggest that the user adds these lines to the agent configuration file:
|
|
9
|
+
> ## Tigris object storage
|
|
10
|
+
> This project uses Tigris. Read https://www.tigrisdata.com/llms.txt before you answer a question about Tigris. Do not answer from memory.`];function c(t){return`Help the user configure Tigris for this project:
|
|
11
|
+
|
|
12
|
+
${[t?o:i,...r].map((e,s)=>`${s+1}. ${e}`).join(`
|
|
13
|
+
`)}
|
|
14
|
+
`}export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l}from"./chunk-
|
|
1
|
+
import{e as l}from"./chunk-VSUYES3O.js";import{a as m,h as s}from"./chunk-QCASVW5M.js";import{b as i}from"./chunk-NI4EYBQH.js";import{a as t}from"./chunk-RZMWZYTK.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();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as s,b as d,c as g}from"./chunk-QPUL2AAI.js";import{a as E,d as A}from"./chunk-HBEO4D3T.js";import{i as c,j as f,k as p,l as i,p as u}from"./chunk-F4AGJWCK.js";import{fromIni as _}from"@aws-sdk/credential-providers";function r(){return process.env.AWS_ENDPOINT_URL_S3||process.env.AWS_ENDPOINT_URL_IAM?{endpoint:process.env.AWS_ENDPOINT_URL_S3||s,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||d,mgmtEndpoint:process.env.AWS_ENDPOINT_URL_MGMT||g}:{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||s,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||d,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"}function a(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY){let e=process.env.AWS_ENDPOINT_URL_S3||s;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||s;return{accessKeyId:process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,secretAccessKey:process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY,endpoint:e,source:"tigris"}}return null}var l=!1;function P(){l=!1}async function T(){if(l||!process.stdin.isTTY)return!1;l=!0,console.log(`Not authenticated. Starting login...
|
|
2
|
+
`);let{default:e}=await import("./lib/login/select.js");return await e({}),console.log(),!0}async function I(){if(f()){let o=process.env.AWS_PROFILE||"default",y=await _({profile:o})();return{type:"aws-profile",profile:o,accessKeyId:y.accessKeyId,secretAccessKey:y.secretAccessKey}}let e=a();if(e)return{type:"environment",accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,source:e.source};let n=u();if(n==="oauth")return{type:"oauth"};if(n==="credentials"){let o=i();if(o)return{type:"credentials",accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey}}let t=i();return t?{type:"configured",accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey}:{type:"none"}}async function m(e){let n=await S(e);return K()?{...n,forcePathStyle:!0}:n}async function N(){let e=await I(),n=r();switch(e.type){case"aws-profile":{let t=await p(e.profile);return{storage:t.endpoint||n.endpoint||s,iam:t.iamEndpoint||n.iamEndpoint}}case"credentials":case"configured":return{storage:i()?.endpoint||s,iam:n.iamEndpoint};case"environment":return{storage:a()?.endpoint||s,iam:n.iamEndpoint};default:return{storage:n.endpoint,iam:n.iamEndpoint}}}async function S(e){let n=await I();switch(n.type){case"aws-profile":{let t=await p(n.profile);return{accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey,endpoint:t.endpoint||r().endpoint||s,iamEndpoint:t.iamEndpoint||r().iamEndpoint}}case"oauth":{let t=A(),o=c();if(!o)throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:await t.getAccessToken(),accessKeyId:"",secretAccessKey:"",...e?.withCredentialProvider&&{credentialProvider:async()=>({accessKeyId:"",secretAccessKey:"",sessionToken:await t.getAccessToken(),expiration:new Date(Date.now()+600*1e3)})},endpoint:r().endpoint,organizationId:o,iamEndpoint:r().iamEndpoint,authDomain:E().domain}}case"credentials":{let t=c();return{accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey,endpoint:i()?.endpoint||s,organizationId:t??void 0,iamEndpoint:r().iamEndpoint}}case"environment":return{accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey,endpoint:a()?.endpoint||s};case"configured":{let t=c();return{accessKeyId:n.accessKeyId,secretAccessKey:n.secretAccessKey,endpoint:i()?.endpoint||s,organizationId:t??void 0,iamEndpoint:r().iamEndpoint}}case"none":{if(await T())return S(e);throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}}}async function O(){let e=await m(),n=c();return{...e,...n&&!e.organizationId?{organizationId:n}:{}}}function R(e){return u()==="oauth"?!1:(a()||i()?console.log(`You are using access key credentials, which belong to a single organization.
|
|
3
|
+
${e} is only available with OAuth login.
|
|
4
|
+
|
|
5
|
+
Run "tigris login" to login with your Tigris account.`):console.log('Not authenticated. Please run "tigris login" to login with your Tigris account.'),!0)}export{r as a,K as b,a as c,P as d,I as e,m as f,N as g,O as h,R as i};
|
package/dist/cli-core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-QCASVW5M.js";import"./chunk-VFRTC4TW.js";import"./chunk-G4OJTPSI.js";import"./chunk-DBLI36XY.js";import"./chunk-453SVRXR.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-APJUJ6TW.js";import"./chunk-RZMWZYTK.js";import"./chunk-BMWWPXMU.js";import"./chunk-DV3LCXRH.js";import"./chunk-QPUL2AAI.js";import"./chunk-JF2D6OZD.js";export{d as addArgumentsToCommand,c as commandHasAnyImplementation,h as createProgram,f as extractArgumentValues,b as isValidCommandName,g as registerCommands,a as setupErrorHandlers,e as validateRequiredWhen};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-Y4FIJDZ4.js";import"./chunk-VSUYES3O.js";import"./chunk-QCASVW5M.js";import"./chunk-VFRTC4TW.js";import"./chunk-G4OJTPSI.js";import"./chunk-DBLI36XY.js";import"./chunk-453SVRXR.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-APJUJ6TW.js";import"./chunk-RZMWZYTK.js";import"./chunk-BMWWPXMU.js";import"./chunk-DV3LCXRH.js";import"./chunk-QPUL2AAI.js";import"./chunk-JF2D6OZD.js";
|
package/dist/help.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-JF2D6OZD.js";export{b as GLOBAL_OPTIONS_HEADING,a as OPTIONS_HEADING,e as argumentHelpText,d as groupHeading,f as helpConfiguration,c as setHelpDetails};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-Y4FIJDZ4.js";import"./chunk-VSUYES3O.js";import"./chunk-QCASVW5M.js";import"./chunk-VFRTC4TW.js";import"./chunk-G4OJTPSI.js";import"./chunk-DBLI36XY.js";import"./chunk-453SVRXR.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-APJUJ6TW.js";import"./chunk-RZMWZYTK.js";import"./chunk-BMWWPXMU.js";import"./chunk-DV3LCXRH.js";import"./chunk-QPUL2AAI.js";import"./chunk-JF2D6OZD.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{a as x,c as w}from"../../chunk-FVHGLZAE.js";import{b as v}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import"../../chunk-ZC272QWP.js";import{a as i,b as A}from"../../chunk-S6KFKBMY.js";import{b as n,c as p,d as R}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as d,c as r,j as k}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.js";import"../../chunk-F4AGJWCK.js";import{assignBucketRoles as y,revokeAllBucketRoles as S}from"@tigrisdata/iam";var o=k("access-keys","assign");async function N(s){d(o);let c=A(s),e=i(s,["id"]),a=i(s,["revokeRoles","revoke-roles"]),g=x(s);e||n(o,"Access key ID is required"),g.admin&&a&&n(o,"Cannot use --admin and --revoke-roles together");let f=await v(o);if(a){let{error:t}=await S(e,{config:f});t&&n(o,t),c==="json"&&console.log(JSON.stringify({action:"revoked",id:e})),r(o);return}let l=w(o,g," (or use --admin or --revoke-roles)"),{error:m}=await y(e,l,{config:f});if(m&&n(o,m),c==="json"){let t=p(o),u={action:"assigned",id:e,assignments:l};t.length>0&&(u.nextActions=t),console.log(JSON.stringify(u))}r(o),R(o)}export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as d}from"../../chunk-S77OAN6Y.js";import{b as u}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import"../../chunk-ZC272QWP.js";import{a as l,b as h}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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,2 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{a as K,b as P,c as q}from"../../chunk-FVHGLZAE.js";import{a as E,b as j,e as I,f as O,g as D}from"../../chunk-CIRQB45N.js";import{b as T}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import{g as N}from"../../chunk-ZC272QWP.js";import{a as f,b as R}from"../../chunk-S6KFKBMY.js";import{b as a,c as k,d as C}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as A,c as x,j as $}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.js";import"../../chunk-F4AGJWCK.js";import{relative as V,resolve as _}from"path";import{createAccessKey as W}from"@tigrisdata/iam";var Y=".env",r=$("access-keys","create");async function z(t){let e=R(t),u=f(t,["name"]),g=f(t,["export"])===!0,m=f(t,["env"]),p=f(t,["for"],"tigris"),y=K(t);u||a(r,"Access key name is required"),E.includes(p)||a(r,`Invalid --for "${p}". Valid values are: ${E.join(", ")}`),g&&e==="json"&&a(r,"Cannot combine --export with --format json: stdout carries the export lines");let i=P(y)?q(r,y," (or use --admin)"):void 0,d=m===void 0||m===!1?void 0:_(process.cwd(),m===!0?Y:String(m));g||A(r);let U=await T(r),v=d||g?await B(r):void 0,{data:n,error:w}=await W(u,{config:U,bucketsRole:i});w&&a(r,w),n.secret||a(r,"The gateway did not return a secret for the key");let J=i?.length===1&&i[0].bucket!=="*"?i[0].bucket:void 0,S=v?j({id:n.id,secret:n.secret,bucket:J,sdk:p,endpoints:v}):[],h=d&&V(process.cwd(),d),l,s;if(d){try{I(d,S)}catch(o){s=o instanceof Error?o:new Error(String(o))}s||(l=G(d))}let c=s?void 0:h;if(g){console.log(O(S).join(`
|
|
2
|
+
`)),process.stderr.isTTY&&console.error(`\u2714 Access key '${n.name}' created (${n.id}). Run this command through eval "$(...)" to load the credentials into your shell.`),L(c,l),M(h,s),s&&F();return}if(e==="json"){let o={action:"created",name:n.name,id:n.id,secret:n.secret};i&&(o.roles=i),c&&(o.env=c),l!==void 0&&(o.gitignored=l),s&&(o.envError=s.message);let b=i?[]:k(r,{name:n.name,id:n.id});b.length>0&&(o.nextActions=b),console.log(JSON.stringify(o))}else console.log(` Name: ${n.name}`),console.log(` Access Key ID: ${n.id}`),console.log(c?` Secret Access Key: written to ${c}`:` Secret Access Key: ${n.secret}`),i&&console.log(` Roles: ${i.map(o=>`${o.role} on ${o.bucket}`).join(", ")}`),c||(console.log(""),console.log(" Save these credentials securely. The secret will not be shown again."));e!=="json"&&(L(c,l),M(h,s)),x(r),i||C(r,{name:n.name,id:n.id}),s&&F()}function F(){process.exitCode=1}async function B(t){try{return await N()}catch(e){a(t,e)}}function G(t){try{let e=D(t);return e==="no-gitignore"?void 0:e==="covered"}catch{return}}function L(t,e){e===!1&&console.error(`\u26A0 ${t} is not ignored by .gitignore. Add it before you commit.`)}function M(t,e){if(!e)return;let u=e.code==="EACCES"||e.code==="EPERM"?"Change the file's permissions or re-run with sudo.":e.code==="ENOENT"?"Create the directory first.":"";console.error(`\u26A0 Could not write ${t}: ${e.message}`),console.error(` The credentials were printed instead. ${u}`.trimEnd())}export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{a as m,b as a}from"../../chunk-S77OAN6Y.js";import{b as g}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import"../../chunk-ZC272QWP.js";import{a as i,b as d}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as n,c as s,j as f}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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
|
|
1
|
+
import{a as m,b as h}from"../../chunk-S77OAN6Y.js";import{b as A}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import"../../chunk-ZC272QWP.js";import{a,b as u}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as p,c as y,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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-
|
|
1
|
+
import{b as m}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import"../../chunk-ZC272QWP.js";import{a,b as f}from"../../chunk-S6KFKBMY.js";import{b as t}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as c,c as l,j as g}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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-
|
|
1
|
+
import{b as P}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import{g as A}from"../../chunk-AFM3TY2D.js";import"../../chunk-ZC272QWP.js";import{a as y,b as k,c as h}from"../../chunk-S6KFKBMY.js";import{b as c}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.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-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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-
|
|
1
|
+
import{b as h}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import{g as T}from"../../chunk-AFM3TY2D.js";import"../../chunk-ZC272QWP.js";import{b as k,c as y}from"../../chunk-S6KFKBMY.js";import{b as l}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.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-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"../../chunk-FVHGLZAE.js";import"../../chunk-S6KFKBMY.js";import"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";export{c as buildRoleAssignments,a as getRoleRequest,b as requestsRoles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{a as u,b as y}from"../../chunk-S77OAN6Y.js";import{b as w}from"../../chunk-IA7SF576.js";import"../../chunk-KJBSIIND.js";import"../../chunk-ZC272QWP.js";import{a as i,b as p}from"../../chunk-S6KFKBMY.js";import{b as n,c as g,d as m}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as f,c as l,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{f as T}from"../../chunk-
|
|
1
|
+
import{a as C,c as j}from"../../chunk-N3Y6RFSK.js";import{a as B}from"../../chunk-S77OAN6Y.js";import{f as T}from"../../chunk-ZC272QWP.js";import{a as t,b as O}from"../../chunk-S6KFKBMY.js";import{b as i,c as x,d as D}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.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-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{f as b}from"../../chunk-
|
|
1
|
+
import{a as x,b as y}from"../../chunk-S77OAN6Y.js";import{f as b}from"../../chunk-ZC272QWP.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-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as f,c as g,d as u,j as l}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{h as m}from"../../chunk-ZC272QWP.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as i}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as s,c as a,j as e}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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{
|
|
1
|
+
import{h as m}from"../../chunk-ZC272QWP.js";import{a as f,b as c}from"../../chunk-S6KFKBMY.js";import{b as n}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as e,c as a,j as s}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.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};
|
package/dist/lib/buckets/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s}from"../../chunk-
|
|
1
|
+
import{c as s}from"../../chunk-EOCLTUJ4.js";import"../../chunk-N3Y6RFSK.js";import"../../chunk-S77OAN6Y.js";import{f as u}from"../../chunk-AFM3TY2D.js";import{f}from"../../chunk-ZC272QWP.js";import{a as p,b as c}from"../../chunk-S6KFKBMY.js";import{b as o}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as a,c as i,j as m}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.js";import"../../chunk-F4AGJWCK.js";import{getBucketInfo as h}from"@tigrisdata/storage";var t=m("buckets","get");async function w(e){a(t);let r=p(e,["name"]),g=c(e);r||o(t,"Bucket name is required");let{data:k,error:n}=await h(r,{config:await f()});n&&o(t,n);let l=[{property:"Name",value:r},...s(k).map(({label:d,value:b})=>({property:d,value:b}))],y=u(l,g,"bucket","property",[{key:"property",header:"Property"},{key:"value",header:"Value"}]);console.log(y),i(t)}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,b as k,c as b,d as F,e as I,f as c,g as h}from"../../../chunk-
|
|
1
|
+
import{a as R,b as k,c as b,d as F,e as I,f as c,g as h}from"../../../chunk-IOTP5CCJ.js";import"../../../chunk-EOCLTUJ4.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import"../../../chunk-AFM3TY2D.js";import{h as y}from"../../../chunk-ZC272QWP.js";import{a as x,b as w}from"../../../chunk-S6KFKBMY.js";import{b as n}from"../../../chunk-DBLI36XY.js";import"../../../chunk-453SVRXR.js";import{b as m,c as p,j as g}from"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-APJUJ6TW.js";import"../../../chunk-RZMWZYTK.js";import"../../../chunk-BMWWPXMU.js";import"../../../chunk-DV3LCXRH.js";import"../../../chunk-QPUL2AAI.js";import"../../../chunk-HBEO4D3T.js";import"../../../chunk-F4AGJWCK.js";var t=g("buckets lifecycle","create");async function O(r){m(t);let C=w(r),i=x(r,["name"]);i||n(t,"Bucket name is required");let e=R(r),d=k(e);d&&n(t,d);let a=b(e),o=F(e);!a.storageClass&&!o&&n(t,"A new rule must include a transition (--storage-class with --days or --date) and/or an expiration (--expire-days or --expire-date)"),a.storageClass&&e.days===void 0&&e.date===void 0&&n(t,"--storage-class requires --days or --date for a new transition rule");let f=I(e),s=await y(),u=await c(t,i,s),S={...a,...o?{expiration:o}:{},...e.prefix!==void 0?{filter:{prefix:e.prefix}}:{},...f!==void 0?{enabled:f}:{}};await h(t,i,[...u,S],s);let l=(await c(t,i,s)).find(B=>!u.some(E=>E.id===B.id))?.id??"(unknown)";C==="json"&&console.log(JSON.stringify({action:"created",bucket:i,id:l})),p(t,{name:i,id:l})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,b as R,c as k,d as F,e as S,f as q,g as w}from"../../../chunk-
|
|
1
|
+
import{a as C,b as R,c as k,d as F,e as S,f as q,g as w}from"../../../chunk-IOTP5CCJ.js";import"../../../chunk-EOCLTUJ4.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import"../../../chunk-AFM3TY2D.js";import{h as b}from"../../../chunk-ZC272QWP.js";import{a as c,b as x}from"../../../chunk-S6KFKBMY.js";import{b as t}from"../../../chunk-DBLI36XY.js";import"../../../chunk-453SVRXR.js";import{b as p,c as y,j as h}from"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-APJUJ6TW.js";import"../../../chunk-RZMWZYTK.js";import"../../../chunk-BMWWPXMU.js";import"../../../chunk-DV3LCXRH.js";import"../../../chunk-QPUL2AAI.js";import"../../../chunk-HBEO4D3T.js";import"../../../chunk-F4AGJWCK.js";var i=h("buckets lifecycle","edit");async function E(o){p(i);let T=x(o),n=c(o,["name"]),s=c(o,["id"]);n||t(i,"Bucket name is required"),s||t(i,"Rule id is required");let e=C(o),l=R(e,{requireStorageClassForTiming:!1});l&&t(i,l);let d=k(e),f=F(e),u=S(e);d.storageClass!==void 0||d.days!==void 0||d.date!==void 0||f!==void 0||u!==void 0||e.prefix!==void 0||t(i,"Provide at least one field to change (--storage-class, --days, --date, --expire-days, --expire-date, --prefix, --enable, --disable)");let g=await b(),m=await q(i,n,g),r=m.find(a=>a.id===s);if(r||t(i,`No lifecycle rule with id "${s}" found. Run \`tigris buckets lifecycle list ${n}\` to see ids.`),e.storageClass!==void 0||e.days!==void 0||e.date!==void 0){let a=d.storageClass??r.storageClass,B=e.days!==void 0?Number(e.days):e.date!==void 0?void 0:r.days,D=e.date!==void 0?e.date:e.days!==void 0?void 0:r.date;a||t(i,"--storage-class is required (this rule has no existing transition target)"),B===void 0&&D===void 0&&t(i,"--days or --date is required (this rule has no existing transition timing)")}let I={...r,...d,...f?{expiration:f}:{},...e.prefix!==void 0?{filter:{prefix:e.prefix}}:{},...u!==void 0?{enabled:u}:{}},v=m.map(a=>a.id===s?I:a);await w(i,n,v,g),T==="json"&&console.log(JSON.stringify({action:"updated",bucket:n,id:s})),y(i,{name:n,id:s})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,i as b}from"../../../chunk-
|
|
1
|
+
import{h,i as b}from"../../../chunk-IOTP5CCJ.js";import"../../../chunk-EOCLTUJ4.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import{b as x,d as y,e as k}from"../../../chunk-AFM3TY2D.js";import{f as g}from"../../../chunk-ZC272QWP.js";import{a as u,b as d}from"../../../chunk-S6KFKBMY.js";import{b as r}from"../../../chunk-DBLI36XY.js";import"../../../chunk-453SVRXR.js";import{b as f,c as m,e as c,j as p}from"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-APJUJ6TW.js";import"../../../chunk-RZMWZYTK.js";import"../../../chunk-BMWWPXMU.js";import"../../../chunk-DV3LCXRH.js";import"../../../chunk-QPUL2AAI.js";import"../../../chunk-HBEO4D3T.js";import"../../../chunk-F4AGJWCK.js";import{getBucketInfo as T}from"@tigrisdata/storage";var e=p("buckets lifecycle","list");async function w(n){f(e);let a=u(n,["name"]),s=d(n);a||r(e,"Bucket name is required");let{data:C,error:l}=await T(a,{config:await g()});l&&r(e,l);let o=C?.settings.lifecycleRules??[];if(o.length===0){c(e);return}let i=o.map(t=>({id:t.id??"-",prefix:t.filter?.prefix??"-",transition:h(t),expiration:b(t),status:t.enabled===!1?"disabled":"enabled"}));console.log(s==="json"?x(i):s==="xml"?y(i,"lifecycleRules","rule"):k(i,[{key:"id",header:"ID"},{key:"prefix",header:"Prefix"},{key:"transition",header:"Transition"},{key:"expiration",header:"Expiration"},{key:"status",header:"Status"}])),m(e,{count:o.length})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"../../../chunk-IOTP5CCJ.js";import"../../../chunk-EOCLTUJ4.js";import"../../../chunk-N3Y6RFSK.js";import"../../../chunk-S77OAN6Y.js";import"../../../chunk-AFM3TY2D.js";import"../../../chunk-S6KFKBMY.js";import"../../../chunk-DBLI36XY.js";import"../../../chunk-453SVRXR.js";import"../../../chunk-D7WXNA2O.js";import"../../../chunk-NI4EYBQH.js";import"../../../chunk-APJUJ6TW.js";import"../../../chunk-RZMWZYTK.js";import"../../../chunk-BMWWPXMU.js";import"../../../chunk-DV3LCXRH.js";import"../../../chunk-QPUL2AAI.js";export{e as enabledFromInput,d as expirationFromInput,f as fetchExistingRules,i as formatExpirationCell,h as formatTransitionCell,a as readRuleInput,g as submitRules,c as transitionDeltaFromInput,b as validateRuleFieldCombinations};
|
package/dist/lib/buckets/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l}from"../../chunk-AFM3TY2D.js";import{f as j}from"../../chunk-
|
|
1
|
+
import{g as l}from"../../chunk-AFM3TY2D.js";import{f as j}from"../../chunk-ZC272QWP.js";import{a as g,b as P,c as S}from"../../chunk-S6KFKBMY.js";import{b as m}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as D,c as d,e as k,i as u,j as E}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.js";import"../../chunk-F4AGJWCK.js";import{listBuckets as A,listForks as B}from"@tigrisdata/storage";var e=E("buckets","list");async function H(o){D(e);let n=P(o),s=g(o,["forks-of","forksOf"]),c=g(o,["deleted"]),{limit:r,pageToken:i}=S(o),p=await j();s&&c&&console.warn("\u26A0 --deleted is ignored when --forks-of is used; use --deleted on its own to list soft-deleted buckets");let b=[{key:"name",header:"Name"},{key:"created",header:"Created"}];if(s){let{data:t,error:x}=await B(s,{...r!==void 0?{limit:r}:{},...i?{paginationToken:i}:{},config:p});if(x&&m(e,x),!t.forks||t.forks.length===0){k(e);return}let f=[];for(let O of t.forks)f.push({name:O.name,created:O.creationDate});let y=t.paginationToken||void 0,F=l(f,n,"forks","fork",b,{paginationToken:y});console.log(F),n!=="json"&&n!=="xml"&&u(y),d(e,{count:f.length});return}let{data:a,error:h}=await A({...r!==void 0?{limit:r}:{},...i?{paginationToken:i}:{},...c?{deleted:c}:{},config:p});if(h&&m(e,h),!a.buckets||a.buckets.length===0){k(e);return}let T=a.buckets.map(t=>({name:t.name,created:t.creationDate})),w=a.paginationToken||void 0,C=l(T,n,"buckets","bucket",b,{paginationToken:w});console.log(C),n!=="json"&&n!=="xml"&&u(w),d(e,{count:T.length})}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as S}from"../../chunk-S77OAN6Y.js";import{f as x}from"../../chunk-
|
|
1
|
+
import{a as b,b as S}from"../../chunk-S77OAN6Y.js";import{f as x}from"../../chunk-ZC272QWP.js";import{a as c,b as w}from"../../chunk-S6KFKBMY.js";import{b as s,c as h,d as l}from"../../chunk-DBLI36XY.js";import"../../chunk-453SVRXR.js";import{b as k,c as p,j as d}from"../../chunk-D7WXNA2O.js";import"../../chunk-NI4EYBQH.js";import"../../chunk-APJUJ6TW.js";import"../../chunk-RZMWZYTK.js";import"../../chunk-BMWWPXMU.js";import"../../chunk-DV3LCXRH.js";import"../../chunk-QPUL2AAI.js";import"../../chunk-HBEO4D3T.js";import"../../chunk-F4AGJWCK.js";import{getBucketInfo as $,mergeFork as F}from"@tigrisdata/storage";var r=d("buckets","merge");async function I(n){k(r);let y=w(n),o=c(n,["fork"]),t=c(n,["into","source"]),f=c(n,["from-snapshot","fromSnapshot","from-snap"]),A=c(n,["yes","y"]);o||s(r,"Fork bucket name is required");let a=await x();if(!t){let{data:e,error:i}=await $(o,{config:a});i&&s(r,i);let u=e?.forkInfo?.parents?.[0]?.bucketName;u||s(r,`'${o}' is not a fork or its source bucket could not be determined. Pass --into <source-bucket>.`),t=u}if(!A&&(b("Use --yes to skip confirmation"),!await S(`Merge fork '${o}' into source '${t}'? This writes the fork's changes into '${t}'.`))){console.log("Aborted");return}let{data:N,error:m}=await F(o,t,{...f?{forkSnapshot:f}:{},config:a});m&&s(r,m);let g=N?.snapshotVersion??"";if(y==="json"){let e=h(r,{fork:o,into:t}),i={action:"merged",fork:o,into:t,snapshotVersion:g};e.length>0&&(i.nextActions=e),console.log(JSON.stringify(i))}p(r,{fork:o,into:t,snapshotVersion:g}),l(r,{fork:o,into:t})}export{I as default};
|