@axway-api-builder-ext/api-builder-plugin-fn-file
Version:
File Flow-Node to read/write files as part of an API-Builder flow.
17 lines (14 loc) • 526 B
JavaScript
const path = require('path');
const { SDK } = require('@axway/api-builder-sdk');
const { readFile, writeFile} = require('./standardFileActions');
const { readCVSFile } = require('./csvFileActions');
/**
* Resolves the API Builder plugin.
* @returns {object} An API Builder plugin.
*/
async function getPlugin(pluginConfig, options) {
const sdk = new SDK({ pluginConfig });
sdk.load(path.resolve(__dirname, 'flow-nodes.yml'), { readFile, writeFile, readCVSFile });
return sdk.getPlugin();
}
module.exports = getPlugin;