Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
let expect = require('chai').expect;
let datafire = require('datafire');
let http = require('../integrations/manual/http');
let echo = new datafire.Action({
handler: (input, context) => {
return context.request;
}
})
let target = new datafire.Project({
paths: {
'/foo': {
get: {
action: {
handler: i => 'foo',
}
}
},
'/body': {
patch: {
if (inputParam.schema) inputSchema.allOf = [inputParam.schema];
(op.parameters || []).forEach(p => {
if (p.name !== 'Action' && p.name !== 'Version' && p.name !== 'body' && !p.name.startsWith('X-')) {
inputSchema.properties[maybeCamelCase(p.name)] = {type: p.type};
if (p.required) {
inputSchema.required = inputSchema.required || [];
inputSchema.required.push(p.name);
}
}
})
function getSchema(schema) {
if (!schema) return;
return Object.assign({definitions: openapi.definitions}, schema);
}
integ.addAction(actionID, new datafire.Action({
inputSchema: getSchema(inputSchema),
outputSchema: getSchema(response.schema),
handler: (input, context) => {
let lib = new aws[SDK_ID](Object.assign({
version: openapi.info.version,
}, context.accounts[INTEGRATION_ID]));
return lib[functionID](input).promise()
.then(data => {
return JSON.parse(JSON.stringify(data));
})
}
}));
}
}
if (inputParam.schema) inputSchema.allOf = [inputParam.schema];
(op.parameters || []).forEach(p => {
if (p.name !== 'Action' && p.name !== 'Version' && p.name !== 'body' && !p.name.startsWith('X-')) {
inputSchema.properties[maybeCamelCase(p.name)] = {type: p.type};
if (p.required) {
inputSchema.required = inputSchema.required || [];
inputSchema.required.push(p.name);
}
}
})
function getSchema(schema) {
if (!schema) return;
return Object.assign({definitions: openapi.definitions}, schema);
}
integ.addAction(actionID, new datafire.Action({
inputSchema: getSchema(inputSchema),
outputSchema: getSchema(response.schema),
handler: (input, context) => {
let lib = new aws[SDK_ID](Object.assign({
version: openapi.info.version,
}, context.accounts[INTEGRATION_ID]));
return lib[functionID](input).promise()
.then(data => {
return JSON.parse(JSON.stringify(data));
})
}
}));
}
}
if (inputParam.schema) inputSchema.allOf = [inputParam.schema];
(op.parameters || []).forEach(p => {
if (p.name !== 'Action' && p.name !== 'Version' && p.name !== 'body' && !p.name.startsWith('X-')) {
inputSchema.properties[maybeCamelCase(p.name)] = {type: p.type};
if (p.required) {
inputSchema.required = inputSchema.required || [];
inputSchema.required.push(p.name);
}
}
})
function getSchema(schema) {
if (!schema) return;
return Object.assign({definitions: openapi.definitions}, schema);
}
integ.addAction(actionID, new datafire.Action({
inputSchema: getSchema(inputSchema),
outputSchema: getSchema(response.schema),
handler: (input, context) => {
let lib = new aws[SDK_ID](Object.assign({
version: openapi.info.version,
}, context.accounts[INTEGRATION_ID]));
return lib[functionID](input).promise()
.then(data => {
return JSON.parse(JSON.stringify(data));
})
}
}));
}
}
if (inputParam.schema) inputSchema.allOf = [inputParam.schema];
(op.parameters || []).forEach(p => {
if (p.name !== 'Action' && p.name !== 'Version' && p.name !== 'body' && !p.name.startsWith('X-')) {
inputSchema.properties[maybeCamelCase(p.name)] = {type: p.type};
if (p.required) {
inputSchema.required = inputSchema.required || [];
inputSchema.required.push(p.name);
}
}
})
function getSchema(schema) {
if (!schema) return;
return Object.assign({definitions: openapi.definitions}, schema);
}
integ.addAction(actionID, new datafire.Action({
inputSchema: getSchema(inputSchema),
outputSchema: getSchema(response.schema),
handler: (input, context) => {
let lib = new aws[SDK_ID](Object.assign({
version: openapi.info.version,
}, context.accounts[INTEGRATION_ID]));
return lib[functionID](input).promise()
.then(data => {
return JSON.parse(JSON.stringify(data));
})
}
}));
}
}
if (inputParam.schema) inputSchema.allOf = [inputParam.schema];
(op.parameters || []).forEach(p => {
if (p.name !== 'Action' && p.name !== 'Version' && p.name !== 'body' && !p.name.startsWith('X-')) {
inputSchema.properties[maybeCamelCase(p.name)] = {type: p.type};
if (p.required) {
inputSchema.required = inputSchema.required || [];
inputSchema.required.push(p.name);
}
}
})
function getSchema(schema) {
if (!schema) return;
return Object.assign({definitions: openapi.definitions}, schema);
}
integ.addAction(actionID, new datafire.Action({
inputSchema: getSchema(inputSchema),
outputSchema: getSchema(response.schema),
handler: (input, context) => {
let lib = new aws[SDK_ID](Object.assign({
version: openapi.info.version,
}, context.accounts[INTEGRATION_ID]));
return lib[functionID](input).promise()
.then(data => {
return JSON.parse(JSON.stringify(data));
})
}
}));
}
}
'use strict';
let datafire = require('datafire');
let openapi = require('./openapi.json');
let aws = require('aws-sdk');
const INTEGRATION_ID = 'amazonaws_streams_dynamodb';
const SDK_ID = 'DynamoDBStreams';
let integ = module.exports = new datafire.Integration({
id: INTEGRATION_ID,
title: openapi.info.title,
description: openapi.info.description,
logo: openapi.info['x-logo'],
});
integ.security[INTEGRATION_ID]= {
integration: INTEGRATION_ID,
fields: {
accessKeyId: "",
secretAccessKey: "",
region: "AWS region (if applicable)",
}
}
function maybeCamelCase(str) {
return str.replace(/_(\w)/g, (match, char) => char.toUpperCase())
'use strict';
let datafire = require('datafire');
let openapi = require('./openapi.json');
let aws = require('aws-sdk');
const INTEGRATION_ID = 'amazonaws_gamelift';
const SDK_ID = 'GameLift';
let integ = module.exports = new datafire.Integration({
id: INTEGRATION_ID,
title: openapi.info.title,
description: openapi.info.description,
logo: openapi.info['x-logo'],
});
integ.security[INTEGRATION_ID]= {
integration: INTEGRATION_ID,
fields: {
accessKeyId: "",
secretAccessKey: "",
region: "AWS region (if applicable)",
}
}
function maybeCamelCase(str) {
return str.replace(/_(\w)/g, (match, char) => char.toUpperCase())
'use strict';
let datafire = require('datafire');
let openapi = require('./openapi.json');
let aws = require('aws-sdk');
const INTEGRATION_ID = 'amazonaws_marketplacecommerceanalytics';
const SDK_ID = 'MarketplaceCommerceAnalytics';
let integ = module.exports = new datafire.Integration({
id: INTEGRATION_ID,
title: openapi.info.title,
description: openapi.info.description,
logo: openapi.info['x-logo'],
});
integ.security[INTEGRATION_ID]= {
integration: INTEGRATION_ID,
fields: {
accessKeyId: "",
secretAccessKey: "",
region: "AWS region (if applicable)",
}
}
function maybeCamelCase(str) {
return str.replace(/_(\w)/g, (match, char) => char.toUpperCase())
'use strict';
let datafire = require('datafire');
let openapi = require('./openapi.json');
let aws = require('aws-sdk');
const INTEGRATION_ID = 'amazonaws_cloudfront';
const SDK_ID = 'CloudFront';
let integ = module.exports = new datafire.Integration({
id: INTEGRATION_ID,
title: openapi.info.title,
description: openapi.info.description,
logo: openapi.info['x-logo'],
});
integ.security[INTEGRATION_ID]= {
integration: INTEGRATION_ID,
fields: {
accessKeyId: "",
secretAccessKey: "",
region: "AWS region (if applicable)",
}
}
function maybeCamelCase(str) {
return str.replace(/_(\w)/g, (match, char) => char.toUpperCase())