@based/cli
Advanced tools
Comparing version 7.3.0 to 7.3.1
@@ -1,2 +0,3 @@ | ||
export declare const backupsDownloadCmd: ({ org, project, env, cluster, apiKey, }: { | ||
export declare const backupsDownloadCmd: ({ host, org, project, env, cluster, apiKey, }: { | ||
host: any; | ||
org: any; | ||
@@ -3,0 +4,0 @@ project: any; |
@@ -12,4 +12,5 @@ import pc from 'picocolors'; | ||
const replaceTilde = (path) => path.replace(/^~(?=$|\/|\\)/, homedir()); | ||
export const backupsDownloadCmd = async ({ org, project, env, cluster, apiKey, }) => { | ||
export const backupsDownloadCmd = async ({ host, org, project, env, cluster, apiKey, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -59,2 +60,3 @@ project, | ||
const response = await backupsDownload({ | ||
host, | ||
org, | ||
@@ -61,0 +63,0 @@ project, |
export * from './cmd.js'; | ||
export declare const backupsDownload: ({ org, project, env, cluster, instanceName, key, }: { | ||
export declare const backupsDownload: ({ host, org, project, env, cluster, instanceName, key, }: { | ||
host: any; | ||
org: any; | ||
@@ -4,0 +5,0 @@ project: any; |
import { isCurrentDumpKey } from '../../../utils/index.js'; | ||
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const backupsDownload = async ({ org, project, env, cluster, instanceName, key, | ||
export const backupsDownload = async ({ host, org, project, env, cluster, instanceName, key, | ||
// path, | ||
@@ -9,2 +9,3 @@ }) => { | ||
const adminClient = await getClient({ | ||
host, | ||
adminHub: true, | ||
@@ -22,2 +23,3 @@ cluster, | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -24,0 +26,0 @@ project, |
@@ -1,2 +0,2 @@ | ||
export declare const backupsFlushCmd: ({ org, project, env, cluster, name, apiKey, }: { | ||
export declare const backupsFlushCmd: ({ org, project, env, cluster, name, apiKey, host, }: { | ||
org: any; | ||
@@ -8,2 +8,3 @@ project: any; | ||
apiKey: any; | ||
host: any; | ||
}) => Promise<any>; |
@@ -8,4 +8,5 @@ import pc from 'picocolors'; | ||
// file, | ||
apiKey, }) => { | ||
apiKey, host, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -54,4 +55,4 @@ project, | ||
} | ||
return backupsFlush({ org, project, env, cluster, db }); | ||
return backupsFlush({ org, project, env, cluster, db, host }); | ||
}; | ||
//# sourceMappingURL=cmd.js.map |
export * from './cmd.js'; | ||
export declare const backupsFlush: ({ org, project, env, cluster, db }: { | ||
export declare const backupsFlush: ({ host, org, project, env, cluster, db, }: { | ||
host: any; | ||
org: any; | ||
@@ -4,0 +5,0 @@ project: any; |
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const backupsFlush = async ({ org, project, env, cluster, db }) => { | ||
export const backupsFlush = async ({ host, org, project, env, cluster, db, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -6,0 +7,0 @@ project, |
export * from './cmd.js'; | ||
export declare const backupsList: ({ org, project, env, cluster, apiKey }: { | ||
export declare const backupsList: ({ org, project, env, cluster, apiKey, host, }: { | ||
org: any; | ||
@@ -8,2 +8,3 @@ project: any; | ||
apiKey: any; | ||
host: any; | ||
}) => Promise<any>; |
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const backupsList = async ({ org, project, env, cluster, apiKey }) => { | ||
export const backupsList = async ({ org, project, env, cluster, apiKey, host, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -6,0 +7,0 @@ project, |
@@ -1,2 +0,3 @@ | ||
export declare const backupsMakeCmd: ({ org, project, env, cluster }: { | ||
export declare const backupsMakeCmd: ({ host, org, project, env, cluster }: { | ||
host: any; | ||
org: any; | ||
@@ -3,0 +4,0 @@ project: any; |
// import ora from 'ora' | ||
import confirm from '@inquirer/confirm'; | ||
import { backupsMake } from './index.js'; | ||
export const backupsMakeCmd = async ({ org, project, env, cluster }) => { | ||
export const backupsMakeCmd = async ({ host, org, project, env, cluster }) => { | ||
const yes = await confirm({ | ||
@@ -13,2 +13,3 @@ message: `Would you like to execute a backup for env ${org}/${project}/${env} ?`, | ||
await backupsMake({ | ||
host, | ||
org, | ||
@@ -15,0 +16,0 @@ project, |
export * from './cmd.js'; | ||
export declare const backupsMake: ({ org, project, env, cluster }: { | ||
export declare const backupsMake: ({ org, project, env, cluster, host }: { | ||
org: any; | ||
@@ -7,2 +7,3 @@ project: any; | ||
cluster: any; | ||
host: any; | ||
}) => Promise<any>; |
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const backupsMake = async ({ org, project, env, cluster }) => { | ||
export const backupsMake = async ({ org, project, env, cluster, host }) => { | ||
const adminHub = await getClient({ | ||
host, | ||
adminHub: true, | ||
@@ -6,0 +7,0 @@ cluster, |
@@ -1,2 +0,3 @@ | ||
export declare const backupsSelectCmd: ({ org, project, env, cluster, apiKey, }: { | ||
export declare const backupsSelectCmd: ({ host, org, project, env, cluster, apiKey, }: { | ||
host: any; | ||
org: any; | ||
@@ -3,0 +4,0 @@ project: any; |
import { getClient } from '../../../utils/getClient.js'; | ||
import select, { Separator } from '@inquirer/select'; | ||
import { backupsSelect } from './index.js'; | ||
export const backupsSelectCmd = async ({ org, project, env, cluster, apiKey, }) => { | ||
export const backupsSelectCmd = async ({ host, org, project, env, cluster, apiKey, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -59,5 +60,13 @@ project, | ||
envAdminClient.destroy(); | ||
const result = await backupsSelect({ cluster, org, project, env, db, key }); | ||
const result = await backupsSelect({ | ||
cluster, | ||
org, | ||
project, | ||
env, | ||
db, | ||
key, | ||
host, | ||
}); | ||
console.info({ result }); | ||
}; | ||
//# sourceMappingURL=cmd.js.map |
import { DB } from '../types.js'; | ||
export * from './cmd.js'; | ||
export declare const backupsSelect: ({ org, project, env, cluster, db, key, apiKey, }: { | ||
export declare const backupsSelect: ({ host, org, project, env, cluster, db, key, apiKey, }: { | ||
org: string; | ||
@@ -8,2 +8,3 @@ project: string; | ||
cluster: string; | ||
host: string; | ||
db: DB; | ||
@@ -10,0 +11,0 @@ key: string; |
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const backupsSelect = async ({ org, project, env, cluster, db, key, apiKey, }) => { | ||
export const backupsSelect = async ({ host, org, project, env, cluster, db, key, apiKey, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -6,0 +7,0 @@ project, |
@@ -1,2 +0,2 @@ | ||
export declare const backupsUploadCmd: ({ org, project, env, cluster, name, file, apiKey, }: { | ||
export declare const backupsUploadCmd: ({ org, project, env, cluster, host, name, file, apiKey, }: { | ||
org: any; | ||
@@ -6,2 +6,3 @@ project: any; | ||
cluster: any; | ||
host: any; | ||
name: any; | ||
@@ -8,0 +9,0 @@ file: any; |
@@ -8,4 +8,5 @@ import pc from 'picocolors'; | ||
import { pathExists } from 'fs-extra/esm'; | ||
export const backupsUploadCmd = async ({ org, project, env, cluster, name, file, apiKey, }) => { | ||
export const backupsUploadCmd = async ({ org, project, env, cluster, host, name, file, apiKey, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -61,2 +62,3 @@ project, | ||
return backupsUpload({ | ||
host, | ||
org, | ||
@@ -63,0 +65,0 @@ project, |
import { BasedClient } from '@based/client'; | ||
export * from './cmd.js'; | ||
export declare const backupsUpload: ({ org, project, env, cluster, db, file, apiKey, envAdminClient, }: { | ||
export declare const backupsUpload: ({ host, org, project, env, cluster, db, file, apiKey, envAdminClient, }: { | ||
org: string; | ||
@@ -8,2 +8,3 @@ project: string; | ||
cluster: string; | ||
host?: string; | ||
db: { | ||
@@ -10,0 +11,0 @@ name?: string; |
@@ -5,4 +5,5 @@ import { pathExists } from 'fs-extra/esm'; | ||
export * from './cmd.js'; | ||
export const backupsUpload = async ({ org, project, env, cluster, db, file, apiKey, envAdminClient = undefined, }) => { | ||
export const backupsUpload = async ({ host, org, project, env, cluster, db, file, apiKey, envAdminClient = undefined, }) => { | ||
envAdminClient ??= await getClient({ | ||
host, | ||
org, | ||
@@ -9,0 +10,0 @@ project, |
@@ -1,2 +0,3 @@ | ||
export declare const cloneEnvCmd: ({ cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }: { | ||
export declare const cloneEnvCmd: ({ host, cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }: { | ||
host: any; | ||
cluster: any; | ||
@@ -3,0 +4,0 @@ org: any; |
@@ -6,4 +6,4 @@ import input from '@inquirer/input'; | ||
import { cloneEnv } from './index.js'; | ||
export const cloneEnvCmd = async ({ cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }) => { | ||
const adminClient = await getClient({ cluster, adminHub: true }); | ||
export const cloneEnvCmd = async ({ host, cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }) => { | ||
const adminClient = await getClient({ cluster, adminHub: true, host }); | ||
const userEnvsResult = await adminClient | ||
@@ -88,2 +88,3 @@ .query('user-envs', { userId: adminClient.authState?.userId }) | ||
await cloneEnv({ | ||
host, | ||
cluster, | ||
@@ -90,0 +91,0 @@ org, |
export * from './cmd.js'; | ||
export declare const cloneEnv: ({ cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }: { | ||
export declare const cloneEnv: ({ host, cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }: { | ||
host: any; | ||
cluster: any; | ||
@@ -4,0 +5,0 @@ org: any; |
import { getSharedClient } from '../../getSharedClient.js'; | ||
export * from './cmd.js'; | ||
export const cloneEnv = async ({ cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }) => { | ||
export const cloneEnv = async ({ host, cluster, org, project, env, destOrg, destProject, destEnv, keepConfig, }) => { | ||
const adminClient = getSharedClient({ | ||
@@ -10,2 +10,3 @@ org: 'saulx', | ||
cluster, | ||
host, | ||
}); | ||
@@ -12,0 +13,0 @@ await adminClient.call('clone-env', { |
@@ -6,3 +6,3 @@ import { deploy } from './index.js'; | ||
export const deployCmd = async (data) => { | ||
const { cluster, org, project, env, watch, force, apiKey, schema: deploySchema, function: fnNames, forceReload, dev, } = data; | ||
const { cluster, host, org, project, env, watch, force, apiKey, schema: deploySchema, function: fnNames, forceReload, dev, } = data; | ||
const functions = []; | ||
@@ -52,3 +52,4 @@ let schema; | ||
update, | ||
forceReload | ||
forceReload, | ||
host, | ||
}); | ||
@@ -55,0 +56,0 @@ } |
@@ -12,2 +12,3 @@ import { BasedClient } from '@based/client'; | ||
cluster?: string; | ||
host?: string; | ||
deploySchema?: boolean; | ||
@@ -22,2 +23,2 @@ force?: boolean; | ||
}; | ||
export declare const deploy: ({ org, project, env, cluster, watch, functions, fnNames, schema, deploySchema, force, envAdminClient, apiKey, update, envHubUrl, forceReload, dev, }: DeployOpts) => Promise<void>; | ||
export declare const deploy: ({ org, project, env, cluster, watch, functions, fnNames, schema, deploySchema, force, envAdminClient, apiKey, update, envHubUrl, forceReload, dev, host, }: DeployOpts) => Promise<void>; |
@@ -23,3 +23,3 @@ import { readdir } from 'fs/promises'; | ||
}; | ||
export const deploy = async ({ org, project, env, cluster, watch, functions, fnNames, schema, deploySchema, force = false, envAdminClient, apiKey, update = () => { }, envHubUrl, forceReload, dev, }) => { | ||
export const deploy = async ({ org, project, env, cluster, watch, functions, fnNames, schema, deploySchema, force = false, envAdminClient, apiKey, update = () => { }, envHubUrl, forceReload, dev, host, }) => { | ||
const execDir = process.cwd() + '/'; | ||
@@ -33,2 +33,3 @@ const envAdmin = envAdminClient || | ||
apiKey, | ||
host, | ||
})); | ||
@@ -40,2 +41,3 @@ envHubUrl ??= await discover({ | ||
cluster, | ||
host, | ||
}, true); | ||
@@ -203,3 +205,5 @@ const { publicPath } = await envAdmin.call('based:env-info').catch((err) => { | ||
}); | ||
const checksum = forceReload ? hash([fn.text, appParams, Date.now()]) : hash([fn.text, appParams]); | ||
const checksum = forceReload | ||
? hash([fn.text, appParams, Date.now()]) | ||
: hash([fn.text, appParams]); | ||
configObj.appParams = appParams; | ||
@@ -241,3 +245,6 @@ const existing = existingFunctions.find((existingFunction) => existingFunction.current?.checksum === checksum); | ||
} | ||
update(timeLabel + ': ' + ((performance.now() - timeStart) / 1000).toFixed(2) + 's'); | ||
update(timeLabel + | ||
': ' + | ||
((performance.now() - timeStart) / 1000).toFixed(2) + | ||
's'); | ||
if (watch) { | ||
@@ -244,0 +251,0 @@ update('🔎 watching for file changes..'); |
@@ -1,3 +0,4 @@ | ||
export declare const devCmd: ({ cluster, org, project, env, skipAuth, production, include: includeArr, }: { | ||
export declare const devCmd: ({ cluster, host, org, project, env, skipAuth, production, include: includeArr, }: { | ||
cluster: any; | ||
host: any; | ||
org: any; | ||
@@ -4,0 +5,0 @@ project: any; |
@@ -5,3 +5,3 @@ import { dev } from './index.js'; | ||
import { isConfigFile, isSchemaFile } from '../deploy/utils.js'; | ||
export const devCmd = async ({ cluster, org, project, env, skipAuth, production, include: includeArr, }) => { | ||
export const devCmd = async ({ cluster, host, org, project, env, skipAuth, production, include: includeArr, }) => { | ||
const include = includeArr && new Set(includeArr); | ||
@@ -75,2 +75,3 @@ let functions = []; | ||
production, | ||
host, | ||
}); | ||
@@ -77,0 +78,0 @@ } |
import type { BasedServer } from '@based/server'; | ||
declare const _default: (port: number, { org, project, env, cluster }: { | ||
declare const _default: (port: number, { org, project, env, cluster, host }: { | ||
org: any; | ||
@@ -7,3 +7,4 @@ project: any; | ||
cluster: any; | ||
host: any; | ||
}) => Promise<BasedServer>; | ||
export default _default; |
import { BasedClient } from '@based/client'; | ||
import { getClient } from '../../utils/getClient.js'; | ||
export default async (port, { org, project, env, cluster }) => { | ||
export default async (port, { org, project, env, cluster, host }) => { | ||
// only load uws when calling this cmd | ||
@@ -11,2 +11,3 @@ const { BasedServer } = await import('@based/server'); | ||
cluster, | ||
host, | ||
}); | ||
@@ -18,2 +19,3 @@ const envClient = new BasedClient({ | ||
cluster, | ||
host, | ||
}); | ||
@@ -20,0 +22,0 @@ envClient.setAuthState({ ...envAdminClient.authState, type: 'based' }); |
@@ -10,4 +10,5 @@ export * from './cmd.js'; | ||
cluster?: string; | ||
host?: string; | ||
production?: boolean; | ||
}; | ||
export declare const dev: ({ org, project, env, cluster, functions, schema, production, }: DevOpts) => Promise<void>; | ||
export declare const dev: ({ org, project, env, cluster, functions, schema, production, host, }: DevOpts) => Promise<void>; |
@@ -113,3 +113,3 @@ import devServer from './devServer.js'; | ||
const cwd = process.cwd(); | ||
return /* HTML */ `<!DOCTYPE html> | ||
return /* HTML */ `<!doctype html> | ||
<html lang="en"> | ||
@@ -157,3 +157,3 @@ <head> | ||
}; | ||
export const dev = async ({ org, project, env, cluster, functions, schema, production, }) => { | ||
export const dev = async ({ org, project, env, cluster, functions, schema, production, host, }) => { | ||
const [devPort, filePort, lrPort] = await Promise.all([ | ||
@@ -174,2 +174,3 @@ getPort({ port: 1234 }), | ||
cluster, | ||
host, | ||
}); | ||
@@ -291,7 +292,3 @@ if (schema) { | ||
: ''}`; | ||
console.info(`\n${fnDir} (js ${toKb(metafile.outputs[jsKey]?.bytes)} css ${toKb(metafile.outputs[cssKey]?.bytes)}):\n${info(files | ||
// files.filter(([file]: [string]) => | ||
// file.startsWith('node_modules') | ||
// ) | ||
)}`); | ||
console.info(`\n${fnDir} (js ${toKb(metafile.outputs[jsKey]?.bytes)} css ${toKb(metafile.outputs[cssKey]?.bytes)}):\n${info(files)}`); | ||
} | ||
@@ -298,0 +295,0 @@ if (errors.length) { |
@@ -10,3 +10,3 @@ import { ensureDir, writeJSON, readJSON, remove } from 'fs-extra/esm'; | ||
export const edit = async (opts) => { | ||
const { org, project, env, cluster, id, language, db, editor, apiKey } = opts; | ||
const { org, project, env, cluster, host, id, language, db, editor, apiKey } = opts; | ||
const envAdminClient = await getClient({ | ||
@@ -18,2 +18,3 @@ org, | ||
apiKey, | ||
host, | ||
}); | ||
@@ -20,0 +21,0 @@ const q = { $id: id, $all: true }; |
@@ -1,2 +0,3 @@ | ||
export declare const initCmd: ({ path, debug, cluster, org, project, env, region, size, }: { | ||
export declare const initCmd: ({ host, path, debug, cluster, org, project, env, region, size, }: { | ||
host: any; | ||
path: any; | ||
@@ -3,0 +4,0 @@ debug: any; |
@@ -9,6 +9,6 @@ import input from '@inquirer/input'; | ||
const replaceTilde = (path) => path.replace(/^~(?=$|\/|\\)/, homedir()); | ||
export const initCmd = async ({ path, | ||
export const initCmd = async ({ host, path, | ||
// lib, | ||
debug, cluster, org, project, env, region, size, }) => { | ||
const adminClient = await getClient({ cluster, adminHub: true }); | ||
const adminClient = await getClient({ cluster, adminHub: true, host }); | ||
const userEnvsResult = await adminClient | ||
@@ -141,2 +141,3 @@ .query('user-envs', { userId: adminClient.authState?.userId }) | ||
// lib, | ||
host, | ||
cluster, | ||
@@ -143,0 +144,0 @@ org, |
export * from './cmd.js'; | ||
export declare const init: ({ path, cluster, org, project, env }: { | ||
export declare const init: ({ path, cluster, org, project, env, host }: { | ||
path: any; | ||
@@ -8,2 +8,3 @@ cluster: any; | ||
env: any; | ||
host: any; | ||
}) => Promise<void>; |
@@ -9,3 +9,3 @@ import { tmpdir } from 'node:os'; | ||
export * from './cmd.js'; | ||
export const init = async ({ path, cluster, org, project, env }) => { | ||
export const init = async ({ path, cluster, org, project, env, host }) => { | ||
const tempPath = join(tmpdir(), 'based_boilerplate.zip'); | ||
@@ -56,2 +56,3 @@ const response = await fetch('https://boilerplate.based.dev/latest.zip'); | ||
env, | ||
host, | ||
...(cluster !== 'production' ? { cluster } : null), | ||
@@ -58,0 +59,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
export declare const logsDeleteCmd: ({ org, project, env, cluster, debug }: { | ||
export declare const logsDeleteCmd: ({ org, project, env, cluster, host, debug, }: { | ||
org: any; | ||
@@ -6,3 +6,4 @@ project: any; | ||
cluster: any; | ||
host: any; | ||
debug: any; | ||
}) => Promise<never>; |
import * as readline from 'node:readline/promises'; | ||
import { logsDelete } from './index.js'; | ||
export const logsDeleteCmd = async ({ org, project, env, cluster, debug }) => { | ||
export const logsDeleteCmd = async ({ org, project, env, cluster, host, debug, }) => { | ||
const rl = readline.createInterface({ | ||
@@ -18,2 +18,3 @@ input: process.stdin, | ||
await logsDelete({ | ||
host, | ||
cluster, | ||
@@ -20,0 +21,0 @@ org, |
@@ -7,3 +7,4 @@ export * from '../logs-delete/cmd.js'; | ||
cluster?: string; | ||
host?: string; | ||
}; | ||
export declare const logsDelete: ({ org, project, env, cluster, }: LogsDeleteOpts) => Promise<any>; | ||
export declare const logsDelete: ({ org, project, env, cluster, host, }: LogsDeleteOpts) => Promise<any>; |
import { getClient } from '../../utils/getClient.js'; | ||
export * from '../logs-delete/cmd.js'; | ||
export const logsDelete = async ({ org, project, env, cluster, }) => { | ||
export const logsDelete = async ({ org, project, env, cluster, host, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -6,0 +7,0 @@ project, |
@@ -18,3 +18,4 @@ export type FunctionLog = { | ||
}; | ||
export declare const logsCmd: ({ org, project, env, before, after, fn, service, cs, level, cluster, }: { | ||
export declare const logsCmd: ({ host, org, project, env, before, after, fn, service, cs, level, cluster, }: { | ||
host: any; | ||
org: any; | ||
@@ -21,0 +22,0 @@ project: any; |
@@ -17,3 +17,3 @@ import pc from 'picocolors'; | ||
}; | ||
export const logsCmd = async ({ org, project, env, before, after, fn, service, cs, level, cluster, }) => { | ||
export const logsCmd = async ({ host, org, project, env, before, after, fn, service, cs, level, cluster, }) => { | ||
if (before) { | ||
@@ -95,4 +95,5 @@ before = dayjs(before); | ||
cluster, | ||
host, | ||
}); | ||
}; | ||
//# sourceMappingURL=cmd.js.map |
@@ -7,2 +7,3 @@ import { FunctionLog } from './cmd.js'; | ||
env: string; | ||
host?: string; | ||
cluster?: string; | ||
@@ -18,2 +19,2 @@ update: (data: FunctionLog[]) => void; | ||
}; | ||
export declare const logs: ({ org, project, env, update, before, cluster, after, fn, cs, lvl, }: LogsOpts) => Promise<void>; | ||
export declare const logs: ({ org, project, env, update, before, cluster, after, fn, cs, lvl, host, }: LogsOpts) => Promise<void>; |
@@ -91,3 +91,3 @@ import { parseStack } from './stackParser.js'; | ||
}; | ||
export const logs = async ({ org, project, env, update, before, cluster, after, fn, cs, lvl, }) => { | ||
export const logs = async ({ org, project, env, update, before, cluster, after, fn, cs, lvl, host, }) => { | ||
const envAdminClient = await getClient({ | ||
@@ -98,2 +98,3 @@ org, | ||
cluster, | ||
host, | ||
}); | ||
@@ -100,0 +101,0 @@ process.on('SIGINT', function () { |
export * from './cmd.js'; | ||
export declare const query: ({ org, project, env, cluster, watch, id, type, language, fields, limit, name, db, apiKey, }: { | ||
export declare const query: ({ org, project, env, cluster, watch, id, type, language, fields, limit, name, db, apiKey, host, }: { | ||
org: any; | ||
@@ -16,2 +16,3 @@ project: any; | ||
apiKey: any; | ||
host: any; | ||
}) => Promise<void>; |
@@ -25,3 +25,3 @@ import { inspect } from 'util'; | ||
}; | ||
export const query = async ({ org, project, env, cluster, watch, id, type, language, fields, limit, name, db, apiKey, }) => { | ||
export const query = async ({ org, project, env, cluster, watch, id, type, language, fields, limit, name, db, apiKey, host, }) => { | ||
let q; | ||
@@ -72,2 +72,3 @@ let handler = (res) => { | ||
apiKey, | ||
host, | ||
}); | ||
@@ -89,2 +90,3 @@ if (language) { | ||
cluster, | ||
host, | ||
}); | ||
@@ -91,0 +93,0 @@ query = client.query(name); |
@@ -1,2 +0,3 @@ | ||
export declare const getSecretCmd: ({ cluster, org, project, env, apiKey, key, file, overwrite, }: { | ||
export declare const getSecretCmd: ({ host, cluster, org, project, env, apiKey, key, file, overwrite, }: { | ||
host: any; | ||
cluster: any; | ||
@@ -3,0 +4,0 @@ org: any; |
@@ -6,5 +6,6 @@ import input from '@inquirer/input'; | ||
import { getClient } from '../../../utils/getClient.js'; | ||
export const getSecretCmd = async ({ cluster, org, project, env, apiKey, key, file, overwrite, }) => { | ||
export const getSecretCmd = async ({ host, cluster, org, project, env, apiKey, key, file, overwrite, }) => { | ||
// only for pre signin | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -25,3 +26,11 @@ project, | ||
} | ||
const result = await getSecret({ cluster, org, project, env, apiKey, key }); | ||
const result = await getSecret({ | ||
cluster, | ||
org, | ||
project, | ||
env, | ||
apiKey, | ||
key, | ||
host, | ||
}); | ||
if (!result) { | ||
@@ -28,0 +37,0 @@ console.error(pc.red(`! Secret ${pc.blue(key)} not found or empty value.`)); |
export * from './cmd.js'; | ||
export declare const getSecret: ({ org, project, env, cluster, key, apiKey, }: { | ||
export declare const getSecret: ({ org, project, env, cluster, key, apiKey, host, }: { | ||
org: any; | ||
@@ -9,2 +9,3 @@ project: any; | ||
apiKey: any; | ||
host: any; | ||
}) => Promise<any>; |
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const getSecret = async ({ org, project, env, cluster, key, apiKey, }) => { | ||
export const getSecret = async ({ org, project, env, cluster, key, apiKey, host, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -6,0 +7,0 @@ project, |
@@ -1,2 +0,3 @@ | ||
export declare const setSecretCmd: ({ cluster, org, project, env, apiKey, key, value, file, }: { | ||
export declare const setSecretCmd: ({ host, cluster, org, project, env, apiKey, key, value, file, }: { | ||
host: any; | ||
cluster: any; | ||
@@ -3,0 +4,0 @@ org: any; |
@@ -6,3 +6,3 @@ import input from '@inquirer/input'; | ||
import { readFileSync } from 'node:fs'; | ||
export const setSecretCmd = async ({ cluster, org, project, env, apiKey, key, value, file, }) => { | ||
export const setSecretCmd = async ({ host, cluster, org, project, env, apiKey, key, value, file, }) => { | ||
if (value && file) { | ||
@@ -14,2 +14,3 @@ console.error(pc.red('! Cannot use --value and --file at the same time')); | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -43,2 +44,3 @@ project, | ||
const result = await setSecret({ | ||
host, | ||
cluster, | ||
@@ -45,0 +47,0 @@ org, |
export * from './cmd.js'; | ||
export declare const setSecret: ({ org, project, env, cluster, apiKey, key, value, }: { | ||
export declare const setSecret: ({ host, org, project, env, cluster, apiKey, key, value, }: { | ||
host: any; | ||
org: any; | ||
@@ -4,0 +5,0 @@ project: any; |
import { getClient } from '../../../utils/getClient.js'; | ||
export * from './cmd.js'; | ||
export const setSecret = async ({ org, project, env, cluster, apiKey, key, value, }) => { | ||
export const setSecret = async ({ host, org, project, env, cluster, apiKey, key, value, }) => { | ||
const envAdminClient = await getClient({ | ||
host, | ||
org, | ||
@@ -6,0 +7,0 @@ project, |
@@ -156,3 +156,4 @@ import * as cmds from './commands/index.js'; | ||
.requiredOption('-e, --env <env>', 'env', basedJson?.env) | ||
.option('--api-key <api-key>', 'API key for service account'); | ||
.option('--api-key <api-key>', 'API key for service account') | ||
.option('--host <host>', 'Optional custom host'); | ||
} | ||
@@ -159,0 +160,0 @@ }); |
import { BasedClient } from '@based/client'; | ||
export declare const getClient: ({ cluster, org, project, env, adminHub, apiKey, silent, }: { | ||
export declare const getClient: ({ cluster, org, project, env, adminHub, apiKey, silent, host, }: { | ||
cluster: string; | ||
@@ -7,2 +7,3 @@ org?: string; | ||
env?: string; | ||
host?: string; | ||
adminHub?: boolean; | ||
@@ -9,0 +10,0 @@ apiKey?: string; |
@@ -13,3 +13,3 @@ import { outputFile } from 'fs-extra/esm'; | ||
// const discover = require('@based/opts') | ||
export const getClient = async ({ cluster, org, project, env, adminHub = false, apiKey, silent = false, }) => { | ||
export const getClient = async ({ cluster, org, project, env, adminHub = false, apiKey, silent = false, host, }) => { | ||
const adminHubConfig = { | ||
@@ -20,2 +20,3 @@ org: 'saulx', | ||
name: '@based/admin-hub', | ||
host, | ||
cluster, | ||
@@ -27,2 +28,3 @@ }; | ||
env, | ||
host, | ||
cluster, | ||
@@ -29,0 +31,0 @@ key: 'cms', |
{ | ||
"name": "@based/cli", | ||
"version": "7.3.0", | ||
"version": "7.3.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "bin": "bin/cmd.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
249898
3892
7