Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global __dirname */
'use strict'
var path = require('path')
var edge = require('edge-js')
var application = edge.func({
assemblyFile: path.join(__dirname, '../../../dist/OfficeScript.dll'),
typeName: 'OfficeScript.Startup',
methodName: 'PowerPointApplication'
})
module.exports = application
module.exports = function (homeDir, context, logger) {
var module = {};
var path = require('path');
var ctx = context;
var DotNetError = require('../errors/DotNetError');
const STATUS = require('../model/status.js');
// edge-js - edge fork that adds support for Mono v4.8 needed by XSLTransform
// TODO: revert to upstream edge once the support is added there
var edge = require('edge-js');
var multiplexer = null;
try {
multiplexer = edge.func({
assemblyFile: path.resolve(homeDir, 'lib/native/Oxygen.dll'),
typeName: 'CloudBeat.Oxygen.Dispatcher',
methodName: 'Invoke'
});
}
catch (e) {
logger.error('Error initializing DotNet Dispatcher', e);
throw e;
}
module.execute = function (module, cmd, args) {
try {
return multiplexer({ module: module, method: cmd, args: args, ctx: ctx }, true);
} catch (exc) {
throw new DotNetError(exc.Source + ': ' + exc.message, exc.StackTrace);
}
.then(() => new Promise((resolve, reject) => {
const wbPath = path.resolve(`${testCase}out.xlsx`);
const parseSource = fs.readFileSync(`${testCase}parse.cs`);
const parseTemplate = fs.readFileSync("./template.cs");
const source = parseTemplate + parseSource;
const parse = edge.func({
source,
references: ["System.Drawing.dll", interopPath]
});
parse({ path: wbPath, password }, (err, results) => {
if (err) return reject(err);
resolve(results);
});
}))
.then(results => {
import edge from 'edge-js';
import path from 'path';
export const reflect = edge.func(path.join(__dirname, '../Scan.cs'));
export function scan(assembly,) {
return new Promise((resolve, reject) => {
reflect(assembly, (error, result) => {
if(error) {
return reject(error);
}
resolve(result);
});
});
}
const edge = require('edge-js');
const data = edge.func(__dirname + '/Data.cs');
const COMMAND_TYPES = {
QUERY: 'query',
SCALAR: 'scalar',
COMMAND: 'command',
PROCEDURE: 'procedure',
PROCEDURE_SCALAR: 'procedure_scalar'
};
const PARAMETER_DIRECTIONS = {
INPUT: 1,
OUTPUT: 2,
INPUT_OUTPUT: 3,
RETURN_VALUE: 6
};