How to use datafire - 10 common examples

To help you get started, we’ve selected a few datafire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DataFire / Integrations / test / http.js View on Github external
"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: {
github DataFire / Integrations / integrations / generated / amazonaws_streams_dynamodb / index.js View on Github external
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));
          })
      }
    }));
  }
}
github DataFire / Integrations / integrations / generated / amazonaws_gamelift / index.js View on Github external
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));
          })
      }
    }));
  }
}
github DataFire / Integrations / integrations / generated / amazonaws_marketplacecommerceanalytics / index.js View on Github external
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));
          })
      }
    }));
  }
}
github DataFire / Integrations / integrations / generated / amazonaws_cloudfront / index.js View on Github external
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));
          })
      }
    }));
  }
}
github DataFire / Integrations / integrations / generated / amazonaws_elasticmapreduce / index.js View on Github external
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));
          })
      }
    }));
  }
}
github DataFire / Integrations / integrations / generated / amazonaws_streams_dynamodb / index.js View on Github external
'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())
github DataFire / Integrations / integrations / generated / amazonaws_gamelift / index.js View on Github external
'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())
github DataFire / Integrations / integrations / generated / amazonaws_marketplacecommerceanalytics / index.js View on Github external
'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())
github DataFire / Integrations / integrations / generated / amazonaws_cloudfront / index.js View on Github external
'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())

datafire

[![Travis][travis-image]][travis-link] [![Downloads][downloads-image]][npm-link] [![NPM version][npm-image]][npm-link] [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://www.npmjs.com/package/datafire) <!--[![Dependency status][deps-i

MIT
Latest version published 4 years ago

Package Health Score

40 / 100
Full package analysis

Popular datafire functions

Similar packages