Socket
Socket
Sign inDemoInstall

kourou

Package Overview
Dependencies
215
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.26.2 to 0.27.0

1

lib/commands/sdk/execute.d.ts

@@ -28,2 +28,3 @@ import { flags } from "@oclif/command";

beforeConnect(): Promise<void>;
getVariables(): any;
runSafe(): Promise<void>;

@@ -30,0 +31,0 @@ get haveSubscription(): boolean;

28

lib/commands/sdk/execute.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const command_1 = require("@oclif/command");

@@ -8,2 +9,4 @@ const lodash_1 = require("lodash");

const kuzzle_1 = require("../../support/kuzzle");
const typescript_1 = (0, tslib_1.__importDefault)(require("typescript"));
const node_vm_1 = (0, tslib_1.__importDefault)(require("node:vm"));
class SdkExecute extends common_1.Kommand {

@@ -16,2 +19,11 @@ constructor() {

this.code = this.stdin || this.args.code || "// paste your code here";
try {
node_vm_1.default.runInContext(this.code, node_vm_1.default.createContext({}));
}
catch (e) {
if (e.name === "SyntaxError") {
const result = typescript_1.default.transpileModule(this.code, { compilerOptions: { module: typescript_1.default.ModuleKind.CommonJS } });
this.code = result.outputText;
}
}
if (this.haveSubscription) {

@@ -21,2 +33,10 @@ this.sdkOptions.protocol = "ws";

}
getVariables() {
return (this.flags.var || [])
.map((nameValue) => {
const [name, value] = nameValue.split("=");
return ` let ${name} = ${value};`;
})
.join("\n");
}
async runSafe() {

@@ -27,12 +47,6 @@ if ((0, lodash_1.isEmpty)(this.code)) {

let userError = null;
const variables = (this.flags.var || [])
.map((nameValue) => {
const [name, value] = nameValue.split("=");
return ` let ${name} = ${value};`;
})
.join("\n");
this.code = `
(async () => {
try {
${variables}
${this.getVariables()}
${this.code}

@@ -39,0 +53,0 @@ }

{
"name": "kourou",
"description": "The CLI that helps you manage your Kuzzle instances",
"version": "0.26.2",
"version": "0.27.0",
"author": "The Kuzzle Team <support@kuzzle.io>",

@@ -6,0 +6,0 @@ "bin": {

@@ -30,3 +30,3 @@ # kourou

$ kourou (-v|--version|version)
kourou/0.26.2 darwin-arm64 node-v18.17.1
kourou/0.27.0 darwin-arm64 node-v18.17.1
$ kourou --help [COMMAND]

@@ -33,0 +33,0 @@ USAGE

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc