@sap-devx/app-studio-toolkit-types
Advanced tools
Comparing version 0.0.1 to 0.0.2
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -8,12 +17,20 @@ exports.startBasctlServer = exports.closeBasctlServer = void 0; | ||
const _ = require("lodash"); | ||
const performer_1 = require("./performer"); | ||
const actionsFactory_1 = require("./actionsFactory"); | ||
const SOCKETFILE = '/extbin/basctlSocket'; | ||
let basctlServer; | ||
function handleRequest(socket) { | ||
socket.on('data', dataBuffer => { | ||
socket.on('data', (dataBuffer) => __awaiter(this, void 0, void 0, function* () { | ||
const data = getRequestData(dataBuffer); | ||
if (data.command === 'openExternal') { | ||
const uri = vscode.Uri.parse(data.url, true); | ||
vscode.env.openExternal(uri); | ||
let result; | ||
try { | ||
const action = actionsFactory_1.ActionsFactory.createAction(data); | ||
result = yield performer_1._performAction(action); | ||
} | ||
}); | ||
catch (error) { | ||
showErrorMessage(error, 'failed to perform action'); | ||
result = false; | ||
} | ||
socket.write(JSON.stringify({ result })); | ||
})); | ||
} | ||
@@ -20,0 +37,0 @@ function getRequestData(dataBuffer) { |
@@ -9,2 +9,8 @@ import * as vscode from "vscode"; | ||
} | ||
export declare enum ActionJsonKey { | ||
ActionType = "actionType", | ||
CommandName = "commandName", | ||
CommandParams = "commandParams", | ||
Uri = "uri" | ||
} | ||
export declare type CommandActionParams = any[]; | ||
@@ -11,0 +17,0 @@ export declare type ExecuteActionParams = any[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ActionType = void 0; | ||
exports.ActionJsonKey = exports.ActionType = void 0; | ||
var ActionType; | ||
@@ -12,2 +12,9 @@ (function (ActionType) { | ||
})(ActionType = exports.ActionType || (exports.ActionType = {})); | ||
var ActionJsonKey; | ||
(function (ActionJsonKey) { | ||
ActionJsonKey["ActionType"] = "actionType"; | ||
ActionJsonKey["CommandName"] = "commandName"; | ||
ActionJsonKey["CommandParams"] = "commandParams"; | ||
ActionJsonKey["Uri"] = "uri"; | ||
})(ActionJsonKey = exports.ActionJsonKey || (exports.ActionJsonKey = {})); | ||
//# sourceMappingURL=interfaces.js.map |
{ | ||
"name": "@sap-devx/app-studio-toolkit-types", | ||
"publisher": "SAPOSS", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20972
20
339