@burdenoff/cli-sdk 2026.526.2 → 2026.529.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-KTKHJORN.js → chunk-LZQBJDKZ.js} +1 -1
- package/dist/chunk-TCBALVP4.js +32 -0
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-Bv5zhYt2.d.cts → module-DxCuik6L.d.cts} +1 -0
- package/dist/{module-Bv5zhYt2.d.ts → module-DxCuik6L.d.ts} +1 -0
- package/dist/modules/auth/index.cjs +4 -4
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +1 -1
- package/dist/modules/billing/index.cjs +2 -2
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/channels/index.cjs +4 -4
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +1 -1
- package/dist/modules/conversations/index.cjs +2 -2
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +1 -1
- package/dist/modules/devportal/index.cjs +4 -4
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs +5 -5
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/groups/index.cjs +4 -4
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/integrations/index.cjs +4 -4
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +4 -4
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/products/index.cjs +8 -8
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +1 -1
- package/dist/modules/rbac/index.cjs +3 -3
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +1 -1
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +10 -10
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/security/index.cjs +7 -7
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/store/index.cjs +2 -2
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs +2 -2
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +1 -1
- package/dist/modules/tours/index.cjs +2 -2
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs +51 -51
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +1 -1
- package/dist/modules/workspaces/index.cjs +10 -10
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-RNWXATAC.js +0 -32
package/dist/chunk-RNWXATAC.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {existsSync,readFileSync,writeFileSync,chmodSync,unlinkSync,mkdirSync}from'fs';import {join}from'path';import {homedir}from'os';import {GraphQLClient}from'graphql-request';import C from'cross-fetch';import {Command}from'commander';var W=300*1e3;function S(e){let n=join(e,"auth.json");function r(){existsSync(e)||mkdirSync(e,{recursive:true,mode:448});}function t(){try{if(!existsSync(n))return null;let a=readFileSync(n,"utf8");return JSON.parse(a)}catch{return null}}function i(a){r(),writeFileSync(n,JSON.stringify(a,null,2),{encoding:"utf8",mode:384});try{chmodSync(n,384);}catch{}}function s(){try{existsSync(n)&&unlinkSync(n);}catch{}}function o(){let a=t();return a?.expiresAt?Date.now()>=a.expiresAt:false}function c(){let a=t();return a?.expiresAt?Date.now()+W>=a.expiresAt:false}function p(){let a=t();return a?.workspaceTokenExpiresAt?Date.now()>=a.workspaceTokenExpiresAt:false}function g(){let a=t();return a?.workspaceTokenExpiresAt?Date.now()+W>=a.workspaceTokenExpiresAt:false}function d(){return t()?.accessToken?!o():false}return {read:t,write:i,clear:s,isTokenExpired:o,isTokenExpiringSoon:c,isWorkspaceTokenExpired:p,isWorkspaceTokenExpiringSoon:g,isAuthenticated:d}}var ae=["workspaceEndpoint","globalEndpoint","oidcIssuer","clientId","defaultFormat","verbose","authServiceEndpoint"];function $(e){let n=join(homedir(),".config",e.configDirName),r=join(n,"config.json"),t={workspaceEndpoint:e.workspaceEndpointDefault,globalEndpoint:e.globalEndpointDefault};function i(){existsSync(n)||mkdirSync(n,{recursive:true,mode:448});}function s(){try{if(!existsSync(r))return {...t};let d=readFileSync(r,"utf8"),a=JSON.parse(d);return {...t,...a}}catch{return {...t}}}function o(d){i(),writeFileSync(r,JSON.stringify(d,null,2),{encoding:"utf8"});try{chmodSync(r,384);}catch{}}function c(d){return s()[d]}function p(d,a){let u=s();u[d]=a,o(u);}function g(){let d=s(),a=d.clientId||e.oidcClientId,u=d.oidcIssuer;if(!u){let l=d.globalEndpoint;l.includes("localhost")||l.includes("127.0.0.1")?u=l.replace(/\/graphql$/,"").replace(/\/global\/graphql$/,"/global"):u=e.oidcIssuerProd??"https://graphql.burdenoff.com/global";}return {oidcIssuer:u,clientId:a}}return {read:s,write:o,get:c,set:p,path:()=>r,dir:()=>n,resolveOIDC:g}}async function ce(e){let n=`${e.oidcIssuer}/oidc/device/code`,r=new URLSearchParams({client_id:e.clientId,scope:"openid profile email offline_access"}),t=await C(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()});if(!t.ok){let s=await t.text().catch(()=>"Unknown error");throw new Error(`Device code request failed (${t.status}): ${s}`)}let i=await t.json();return {deviceCode:i.device_code,userCode:i.user_code,verificationUri:i.verification_uri,verificationUriComplete:i.verification_uri_complete??null,expiresIn:i.expires_in,interval:i.interval??5}}async function ue(e,n,r){let t=`${r.oidcIssuer}/oauth/device/token`,i=n;for(;;){await new Promise(p=>setTimeout(p,i*1e3));let s=await C(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e,client_id:r.clientId}).toString()}),o=await s.json();if(s.ok&&o.access_token)return {accessToken:o.access_token,refreshToken:o.refresh_token??"",expiresIn:o.expires_in??3600};let c=o.error;switch(c){case "authorization_pending":continue;case "slow_down":i+=5;continue;case "expired_token":throw new Error("Device code has expired. Please try again.");case "access_denied":throw new Error("Authorization was denied by the user.");default:throw new Error(`Device code polling failed: ${o.error_description??c??"Unknown error"}`)}}}async function O(e,n,r,t){let s=await C(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:`
|
|
2
|
-
mutation AuthenticateApp($input: AuthenticateAppInput!) {
|
|
3
|
-
authenticateApp(input: $input) {
|
|
4
|
-
accessToken tokenType expiresIn scopes
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`,variables:{input:{clientId:n,clientSecret:r,scopes:t}}})});if(!s.ok){let c=await s.text().catch(()=>"Unknown error");throw new Error(`App authentication failed (${s.status}): ${c}`)}let o=await s.json();if(o.errors?.length)throw new Error(`App authentication failed: ${o.errors[0]?.message??"unknown error"}`);if(!o.data?.authenticateApp?.accessToken)throw new Error("App authentication failed: no access token returned");return o.data.authenticateApp}async function D(e,n,r,t){let s=await C(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({query:`
|
|
8
|
-
mutation IssueWorkspaceToken($input: IssueWorkspaceTokenInput!) {
|
|
9
|
-
issueWorkspaceToken(input: $input) {
|
|
10
|
-
success token expiresAt scopes
|
|
11
|
-
error { code message }
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`,variables:{input:{workspaceId:r,organizationId:t}}})});if(!s.ok){let p=await s.text().catch(()=>"Unknown error");throw new Error(`Workspace token request failed (${s.status}): ${p}`)}let o=await s.json();if(o.errors?.length)throw new Error(`Workspace token failed: ${o.errors[0]?.message??"unknown error"}`);let c=o.data?.issueWorkspaceToken;if(!c?.success||!c.token){let p=c?.error?.message??"Unknown error";throw new Error(`Workspace token failed: ${p}`)}return {token:c.token,expiresAt:c.expiresAt??"",scopes:c.scopes??[]}}async function le(e,n){let t=await C(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({query:`
|
|
15
|
-
query MyWorkspaces($limit: Int) {
|
|
16
|
-
myWorkspaces(limit: $limit) {
|
|
17
|
-
items { id name slug tenantId organizationId }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`,variables:{limit:50}})});if(!t.ok){let s=await t.text().catch(()=>"Unknown error");throw new Error(`Failed to fetch workspaces (${t.status}): ${s}`)}let i=await t.json();if(i.errors?.length)throw new Error(`Failed to fetch workspaces: ${i.errors[0]?.message??"unknown error"}`);return i.data?.myWorkspaces?.items??[]}function pe(e){try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return false}}async function de(e){try{if(!pe(e))return !1;let{execFile:n}=await import('child_process'),r=process.platform,t,i;return r==="darwin"?(t="open",i=[e]):r==="win32"?(t="cmd",i=["/c","start","",e]):(t="xdg-open",i=[e]),new Promise(s=>{n(t,i,o=>{s(!o);});})}catch{return false}}var ge=3e4,U=3,fe=1e3;function me(e){return new Promise(n=>setTimeout(n,e))}function ke(e){if(e instanceof TypeError)return true;if(e&&typeof e=="object"&&"response"in e){let n=e.response;if(n&&typeof n.status=="number"&&n.status>=500)return true}return false}function H(e){if(e&&typeof e=="object"&&"response"in e){let n=e,r=n.response?.errors?.[0],t=r?.extensions?.originalError?.message;if(t)return t;if(r?.message)return r.message;if(n.message)return n.message}return e instanceof Error?e.message:String(e)}function T(e){let n={};return e?.accessToken&&(n.Authorization=`Bearer ${e.accessToken}`),e?.organizationId&&(n["x-org-id"]=e.organizationId),n}function z(e){let n=T(e);return e?.workspaceToken&&(n["X-Workspace-Authorization"]=`Bearer ${e.workspaceToken}`),e?.organizationId&&(n["x-org-id"]=e.organizationId),n}async function R(e,n,r){let t;for(let i=0;i<U;i++)try{let s=new AbortController,o=setTimeout(()=>s.abort(),ge);try{return await e.request({document:n,variables:r,signal:s.signal})}finally{clearTimeout(o);}}catch(s){if(t=s,s&&typeof s=="object"&&"response"in s){let o=s.response;if(o&&typeof o.status=="number"&&o.status>=400&&o.status<500)break}if(ke(s)&&i<U-1){let o=fe*Math.pow(2,i);await me(o);continue}break}throw new Error(H(t))}function L(e,n){let r=null,t=null;function i(){let a=e.read(),u=n.read();return r=new GraphQLClient(a.workspaceEndpoint),r.setHeaders(z(u)),t=new GraphQLClient(a.globalEndpoint),t.setHeaders(T(u)),{workspace:r,global:t}}async function s(){let a=n.read();if(!a)return;if(a.authMethod==="client_credentials"&&a.clientId&&a.clientSecret){let y=e.read();try{let w=await O(y.globalEndpoint,a.clientId,a.clientSecret);n.write({...a,accessToken:w.accessToken,expiresAt:Date.now()+w.expiresIn*1e3}),r=null,t=null;}catch{}return}if(!a.refreshToken)return;let u=e.read(),l=new GraphQLClient(u.globalEndpoint);l.setHeaders({Authorization:`Bearer ${a.accessToken}`});let I=`
|
|
21
|
-
mutation RefreshToken($token: String!) {
|
|
22
|
-
refreshToken(token: $token) {
|
|
23
|
-
accessToken
|
|
24
|
-
refreshToken
|
|
25
|
-
expiresIn
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;try{let w=(await l.request(I,{token:a.refreshToken})).refreshToken;n.write({...a,accessToken:w.accessToken,refreshToken:w.refreshToken,expiresAt:Date.now()+w.expiresIn*1e3}),r=null,t=null;}catch{}}async function o(){let a=n.read();if(!a?.accessToken||!a.workspaceId||!a.organizationId)return;let u=e.read();try{let l=await D(u.workspaceEndpoint,a.accessToken,a.workspaceId,a.organizationId);n.write({...a,workspaceToken:l.token,workspaceTokenExpiresAt:new Date(l.expiresAt).getTime()}),r=null;}catch{}}async function c(){n.isTokenExpiringSoon()&&await s(),n.read()?.workspaceToken&&n.isWorkspaceTokenExpiringSoon()&&await o();}return {workspace:{async request(a,u){await c();let{workspace:l}=r?{workspace:r}:i();return l.setHeaders(z(n.read())),R(l,a,u)}},global:{async request(a,u){let{global:l}=t?{global:t}:i();return l.setHeaders(T(n.read())),R(l,a,u)}},workspaceAuthOnly:{async request(a,u){let l=e.read(),I=n.read(),y=new GraphQLClient(l.workspaceEndpoint);return y.setHeaders(T(I)),R(y,a,u)}},reset(){r=null,t=null;}}}function _(){return !!(process.stdout.isTTY&&process.stdin.isTTY)}function B(e){if(e.format){let n=e.format.toLowerCase();if(n==="json"||n==="table"||n==="yaml")return n}return _()?"table":"json"}function P(e){console.log(JSON.stringify(e,null,2));}function V(e,n){if(e.length===0)return;let r=e.map((s,o)=>{let c=s.length;for(let p of n){let g=p[o]??"";g.length>c&&(c=g.length);}return Math.min(c,50)}),t=r.map(s=>"-".repeat(s+2)).join("+"),i=s=>s.map((o,c)=>` ${(o??"").padEnd(r[c]??0)} `).join("|");console.log(i(e)),console.log(t);for(let s of n)console.log(i(s));}function q(e,n){let r=" ".repeat(n),t=[];for(let[i,s]of Object.entries(e))if(s==null)t.push(`${r}${i}: null`);else if(Array.isArray(s)){t.push(`${r}${i}:`);for(let o of s)typeof o=="object"&&o!==null?(t.push(`${r} -`),t.push(q(o,n+2))):t.push(`${r} - ${String(o)}`);}else typeof s=="object"?(t.push(`${r}${i}:`),t.push(q(s,n+1))):t.push(`${r}${i}: ${String(s)}`);return t.join(`
|
|
29
|
-
`)}function J(e){if(typeof e!="object"||e===null){console.log(String(e));return}console.log(q(e,0));}function we(e){console.log(`\u2713 ${e}`);}function Y(e){console.error(`\u2717 ${e}`);}function he(e){console.warn(`! ${e}`);}function ye(e){console.log(`\u2139 ${e}`);}function Ce(e){if(!e)return "-";try{return new Date(e).toLocaleString()}catch{return e}}function xe(e){if(!e)return "-";switch(e.toUpperCase()){case "ACTIVE":case "RUNNING":case "HEALTHY":return `\u2713 ${e}`;case "INACTIVE":case "STOPPED":case "PENDING":return `\u25CB ${e}`;case "ERROR":return `\u2717 ${e}`;case "ARCHIVED":return `\u2192 ${e}`;case "STARTING":return `\u25B6 ${e}`;case "TERMINATED":return `\u25A0 ${e}`;default:return e}}function be(e,n){return e?e.length<=n?e:e.substring(0,n-3)+"...":"-"}function Te(e,n,r){switch(B(e)){case "json":P(n);break;case "yaml":J(n);break;case "table":r?V(r.headers,r.rows):P(n);break}}async function ve(e,n){return n?true:_()?new Promise(r=>{process.stdout.write(`${e} [y/N] `),process.stdin.setEncoding("utf8"),process.stdin.once("data",t=>{let i=t.trim().toLowerCase();r(i==="y"||i==="yes");}),process.stdin.resume();}):(Y(`${e} Use --force to skip confirmation.`),false)}var j={isInteractive:_,getFormat:B,formatAndOutput:Te,printJson:P,printTable:V,printYaml:J,printSuccess:we,printError:Y,printWarning:he,printInfo:ye,formatDate:Ce,formatStatus:xe,truncate:be,confirm:ve};function F(e={}){let{verbose:n=false,quiet:r=false}=e;return {debug(t,...i){n&&console.error(`[debug] ${t}`,...i);},info(t,...i){r||console.error(`[info] ${t}`,...i);},warn(t,...i){console.error(`[warn] ${t}`,...i);},error(t,...i){console.error(`[error] ${t}`,...i);}}}function Ee(e){return e.includes("localhost")||e.includes("127.0.0.1")?"local":e.includes("alpha")||e.includes("staging")?"staging":"prod"}function Ie(e){return !!e&&typeof e.debug=="function"&&typeof e.info=="function"}function Ae(e){let n=$(e.defaults),r=S(n.dir()),t=L(n,r),i=e.output??j,s=Ie(e.logger)?e.logger:F(e.logger),o=e.env??Ee(n.read().workspaceEndpoint);return {productName:e.productName,productVersion:e.productVersion,defaults:e.defaults,config:n,auth:r,gql:t,output:i,logger:s,env:o}}var h=class extends Error{exitCode;hint;constructor(n,r){super(n),this.name="CliUserError",this.exitCode=r?.exitCode??1,this.hint=r?.hint;}},x=class extends h{constructor(n,r){super(n,{exitCode:2,hint:r?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},k=class extends Error{cause;constructor(n,r){super(n),this.name="CliInternalError",this.cause=r;}};var v=class extends k{constructor(n,r){super(`Module '${n}' declares dependency on '${r}', but '${r}' is not in the module list.`),this.name="MissingDependencyError";}},E=class extends k{constructor(n){super(`Circular dependency detected among modules: ${n.join(" -> ")}`),this.name="CircularDependencyError";}};function N(e){let n=new Map;for(let o of e){if(n.has(o.id))throw new k(`Duplicate module id: '${o.id}'`);n.set(o.id,o);}for(let o of e)for(let c of o.dependsOn??[])if(!n.has(c))throw new v(o.id,c);let r=[],t=new Set,i=new Set;function s(o,c){if(!i.has(o.id)){if(t.has(o.id))throw new E([...c,o.id]);t.add(o.id);for(let p of o.dependsOn??[]){let g=n.get(p);g&&s(g,[...c,o.id]);}t.delete(o.id),i.add(o.id),r.push(o);}}for(let o of e)s(o,[]);return r}function $e(e,n,r){let t=new Command;t.name(r.name).description(r.description??"").version(r.version,"-v, --version").option("-f, --format <format>","Output format (json, table, yaml)").option("--verbose","Enable verbose logging").option("--no-color","Disable colored output");let i=N(n);for(let o of i)o.register(t,e);r.helpExamples?.length&&t.addHelpText("after",`
|
|
30
|
-
Examples:
|
|
31
|
-
`+r.helpExamples.map(o=>" "+o).join(`
|
|
32
|
-
`)),t.on("command:*",()=>{e.output.printError(`Invalid command: ${t.args.join(" ")}`),e.output.printInfo(`Run \`${r.name} --help\` for available commands.`),process.exit(1);});async function s(o=process.argv){try{await t.parseAsync(o),o.length<=2&&t.outputHelp();}catch(c){Oe(e,c);}}return {program:t,run:s}}function Oe(e,n){if(n instanceof x&&(e.output.printError(n.message),n.hint&&e.output.printInfo(n.hint),process.exit(n.exitCode)),n instanceof h&&(e.output.printError(n.message),n.hint&&e.output.printInfo(n.hint),process.exit(n.exitCode)),n instanceof k&&(e.output.printError(`Internal error: ${n.message}`),n.cause&&e.logger.debug("caused by:",n.cause),process.exit(70)),n&&typeof n=="object"&&"code"in n&&"exitCode"in n){let t=n.exitCode;process.exit(typeof t=="number"?t:0);}let r=n instanceof Error?n.message:String(n);e.output.printError(r),process.exit(1);}export{S as a,ae as b,$ as c,ce as d,ue as e,O as f,D as g,le as h,de as i,H as j,L as k,j as l,F as m,Ae as n,h as o,x as p,k as q,v as r,E as s,N as t,$e as u};
|