Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@based/cli

Package Overview
Dependencies
Maintainers
7
Versions
189
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@based/cli - npm Package Compare versions

Comparing version 5.12.2 to 5.13.0

11

dist/commands/secrets_/get/cmd.d.ts

@@ -1,2 +0,11 @@

export declare const getSecretCmd: (props: any) => Promise<void>;
export declare const getSecretCmd: ({ cluster, org, project, env, apiKey, key, file, overwrite, }: {
cluster: any;
org: any;
project: any;
env: any;
apiKey: any;
key: any;
file: any;
overwrite: any;
}) => Promise<void>;
//# sourceMappingURL=cmd.d.ts.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSecretCmd = void 0;
const input_1 = __importDefault(require("@inquirer/input"));
const node_fs_1 = require("node:fs");
const picocolors_1 = __importDefault(require("picocolors"));
const _1 = require(".");
const getSecretCmd = async (props) => {
return (0, _1.getSecret)(props);
const getClient_1 = require("../../../utils/getClient");
const getSecretCmd = async ({ cluster, org, project, env, apiKey, key, file, overwrite, }) => {
// only for pre signin
const envAdminClient = await (0, getClient_1.getClient)({
org,
project,
env,
cluster,
apiKey,
});
envAdminClient.destroy();
if (!key) {
key = await (0, input_1.default)({
message: 'Whats the secrets key/name?',
});
}
else {
console.info(picocolors_1.default.dim(`Geting secret ${picocolors_1.default.blue(key)}`));
}
const result = await (0, _1.getSecret)({ cluster, org, project, env, apiKey, key });
if (!result) {
console.error(picocolors_1.default.red(`! Secret ${picocolors_1.default.blue(key)} not found or empty value.`));
}
else {
if (file) {
try {
(0, node_fs_1.writeFileSync)(file, result, {
encoding: 'utf8',
flag: overwrite ? 'w' : 'wx',
});
console.info(picocolors_1.default.dim(`Saved the value of secret ${picocolors_1.default.blue(key)} to file ${picocolors_1.default.blue(file)}`));
}
catch (_error) {
console.error(picocolors_1.default.red(`! Error writing to file ${file}`));
}
}
else {
console.info();
console.info(result);
}
}
};
exports.getSecretCmd = getSecretCmd;
//# sourceMappingURL=cmd.js.map

5

dist/commands/secrets_/get/index.d.ts
export * from './cmd';
export declare const getSecret: ({ org, project, env, cluster, key }: {
export declare const getSecret: ({ org, project, env, cluster, key, apiKey, }: {
org: any;

@@ -8,3 +8,4 @@ project: any;

key: any;
}) => Promise<void>;
apiKey: any;
}) => Promise<any>;
//# sourceMappingURL=index.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

__exportStar(require("./cmd"), exports);
const getSecret = async ({ org, project, env, cluster, key }) => {
const getSecret = async ({ org, project, env, cluster, key, apiKey, }) => {
const envAdminClient = await (0, getClient_1.getClient)({

@@ -27,8 +27,10 @@ org,

cluster,
apiKey,
silent: true,
});
console.info(`🔏 Get secret '${key}'`);
console.info(await envAdminClient.call('based:get-secret', { key }));
const result = await envAdminClient.call('based:get-secret', { key });
envAdminClient.destroy();
return result;
};
exports.getSecret = getSecret;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,11 @@

export declare const setSecretCmd: (props: any) => Promise<void>;
export declare const setSecretCmd: ({ cluster, org, project, env, apiKey, key, value, file, }: {
cluster: any;
org: any;
project: any;
env: any;
apiKey: any;
key: any;
value: any;
file: any;
}) => Promise<void>;
//# sourceMappingURL=cmd.d.ts.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.setSecretCmd = void 0;
const input_1 = __importDefault(require("@inquirer/input"));
const picocolors_1 = __importDefault(require("picocolors"));
const getClient_1 = require("../../../utils/getClient");
const _1 = require(".");
const setSecretCmd = async (props) => {
return (0, _1.setSecret)(props);
const node_fs_1 = require("node:fs");
const setSecretCmd = async ({ cluster, org, project, env, apiKey, key, value, file, }) => {
if (value && file) {
console.error(picocolors_1.default.red('! Cannot use --value and --file at the same time'));
process.exit(1);
}
// only for pre signin
const envAdminClient = await (0, getClient_1.getClient)({
org,
project,
env,
cluster,
apiKey,
});
envAdminClient.destroy();
if (!key) {
key = await (0, input_1.default)({
message: "What's the secrets key/name?",
});
}
if (!value && !file) {
value = await (0, input_1.default)({
message: 'Enter value:',
});
}
else if (file) {
try {
value = (0, node_fs_1.readFileSync)(file, 'utf8');
}
catch (error) {
console.error(picocolors_1.default.red(`\n! Cannot read from file ${picocolors_1.default.blue(file)}`));
process.exit(1);
}
}
console.info(picocolors_1.default.dim(`Setting secret ${picocolors_1.default.blue(key)}`));
const result = await (0, _1.setSecret)({
cluster,
org,
project,
env,
apiKey,
key,
value,
});
if (result !== 'OK') {
console.error(`! Error setting secret ${picocolors_1.default.blue(key)}`);
}
else {
console.info(`✓ Secret ${picocolors_1.default.blue(key)} set`);
}
};
exports.setSecretCmd = setSecretCmd;
//# sourceMappingURL=cmd.js.map
export * from './cmd';
export declare const setSecret: ({ org, project, env, cluster, key, value }: {
export declare const setSecret: ({ org, project, env, cluster, apiKey, key, value, }: {
org: any;

@@ -7,5 +7,6 @@ project: any;

cluster: any;
apiKey: any;
key: any;
value: any;
}) => Promise<void>;
}) => Promise<any>;
//# sourceMappingURL=index.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

__exportStar(require("./cmd"), exports);
const setSecret = async ({ org, project, env, cluster, key, value }) => {
const setSecret = async ({ org, project, env, cluster, apiKey, key, value, }) => {
const envAdminClient = await (0, getClient_1.getClient)({

@@ -27,9 +27,10 @@ org,

cluster,
apiKey,
silent: true,
});
console.info(`🔏 Setting secret '${key}'`);
await envAdminClient.call('based:set-secret', { key, value });
console.info(`✔️ Secret '${key}' set`);
const result = await envAdminClient.call('based:set-secret', { key, value });
envAdminClient.destroy();
return result;
};
exports.setSecret = setSecret;
//# sourceMappingURL=index.js.map

@@ -65,8 +65,12 @@ "use strict";

.command('set')
.requiredOption('-k, --key <key>', 'key')
.requiredOption('-v, --value <value>', 'value')
.option('-k, --key <key>', 'secret key')
.option('-v, --value <value>', 'secret value')
.option('-f, --file <file>', 'file path to read value')
.action(cmds.setSecretCmd);
// Should there be a get command for secrets?
secrets
.command('get')
.requiredOption('-k, --key <key>', 'key')
.option('-k, --key <key>', 'secret key')
.option('-f, --file <file>', 'file path to save value')
.option('--overwrite', 'overwrite file if exists')
.action(cmds.getSecretCmd);

@@ -73,0 +77,0 @@ const query = commander_1.program.command('query');

{
"name": "@based/cli",
"version": "5.12.2",
"version": "5.13.0",
"description": "",

@@ -28,3 +28,3 @@ "bin": "bin/cmd.js",

"@based/type-gen": "0.0.4",
"@based/client": "4.8.9",
"@based/client": "4.8.10",
"@based/server": "6.9.0",

@@ -48,3 +48,3 @@ "@esbuild-plugins/node-globals-polyfill": "^0.2.3",

"mime-types": "^2.1.31",
"node-fetch": "^2.6.9",
"node-fetch": "2",
"ora": "5",

@@ -57,3 +57,3 @@ "picocolors": "1",

"@based/opts": "0.6.0",
"@saulx/utils": "^3.4.2",
"@saulx/utils": "3.5.3",
"escape-html": "1.0.3"

@@ -66,5 +66,5 @@ },

"@types/inquirer": "^9.0.3",
"@types/node-fetch": "^2.6.2",
"@types/node-fetch": "2",
"ava": "3"
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc