@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
46 lines • 4.04 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.analysisResponseMessage = exports.requestAnalysisMessage = void 0;
const joi_1 = __importDefault(require("joi"));
exports.requestAnalysisMessage = {
type: 'request-file-analysis',
schema: joi_1.default.object({
type: joi_1.default.string().valid('request-file-analysis').required().description('The type of the message.'),
id: joi_1.default.string().optional().description('You may pass an id to link requests with responses (they get the same id).'),
filetoken: joi_1.default.string().optional().description('A unique token to identify the file for subsequent requests. Only use this if you plan to send more queries!'),
filename: joi_1.default.string().optional().description('A human-readable name of the file, only for debugging purposes.'),
content: joi_1.default.string().optional().description('The content of the file or an R expression (either give this or the filepath).'),
filepath: joi_1.default.alternatives(joi_1.default.string(), joi_1.default.array().items(joi_1.default.string())).optional().description('The path to the file(s) on the local machine (either give this or the content).'),
cfg: joi_1.default.boolean().optional().description('If you want to extract the control flow information of the file.'),
format: joi_1.default.string().valid('json', 'n-quads', 'compact').optional().description('The format of the results, if missing we assume json.')
}).xor('content', 'filepath')
};
const jsonSchema = joi_1.default.object({
type: joi_1.default.string().valid('response-file-analysis').required().description('The type of the message.'),
id: joi_1.default.string().optional().description('The id of the message, if you passed one in the request.'),
format: joi_1.default.string().valid('json').required().description('The format of the results in json format.'),
results: joi_1.default.object().required().description('The results of the analysis (one field per step).'),
cfg: joi_1.default.object().optional().description('The control flow information of the file, only present if requested.')
}).description('The response in JSON format.');
const compactSchema = joi_1.default.object({
type: joi_1.default.string().valid('response-file-analysis').required().description('The type of the message.'),
id: joi_1.default.string().optional().description('The id of the message, if you passed one in the request.'),
format: joi_1.default.string().valid('bson').required().description('The format of the results in bson format.'),
results: joi_1.default.string().required().description('The results of the analysis (one field per step).'),
cfg: joi_1.default.string().optional().description('The control flow information of the file, only present if requested.')
});
const nquadsSchema = joi_1.default.object({
type: joi_1.default.string().valid('response-file-analysis').required().description('The type of the message.'),
id: joi_1.default.string().optional().description('The id of the message, if you passed one in the request.'),
format: joi_1.default.string().valid('n-quads').required().description('The format of the results in n-quads format.'),
results: joi_1.default.object().required().description('The results of the analysis (one field per step). Quads are presented as string.'),
cfg: joi_1.default.string().optional().description('The control flow information of the file, only present if requested.')
}).description('The response as n-quads.');
exports.analysisResponseMessage = {
type: 'response-file-analysis',
schema: joi_1.default.alternatives(jsonSchema, nquadsSchema, compactSchema).required().description('The response to a file analysis request (based on the `format` field).')
};
//# sourceMappingURL=message-analysis.js.map