Giter Club home page Giter Club logo

aws-event-generator's Introduction

AWS Event Generator

Note: Currently only for AppSync Events with custom arguments.

your-first-event.js

const CreateEvent = require('./')

const params = {
    templateName: 'aws:appsync',
    cognitoIdentity: true, // OR false if you want switch if off 
    customInput: {
        contactName: 'Dimitri Tarasowski',
        contactEmail: '[email protected]',
        entity: 'contact'
    }
}

const event = CreateEvent(params)

console.log(event)

console.log()

{ args: 
   { input: 
      { contactName: 'Dimitri Tarasowski',
        contactEmail: '[email protected]',
        entity: 'contact' } },
  identity: 
   { sub: '18b560d3-b524-4e11-a5cc-9aa46dc31350',
     issuer: 'https://cognito-idp.eu-west-1.amazonaws.com/XX',
     username: '18b560d3-b524-4e11-a5cc-9aa46dc31350',
     claims: 
      { sub: '18b560d3-b524-4e11-a5cc-9aa46dc31350',
        'cognito:groups': [Array],
        iss: 'https://cognito-idp.eu-west-1.amazonaws.com/XX',
        'cognito:username': '18b560d3-b524-4e11-a5cc-9aa46dc31350',
        preferred_username: 'testcompany',
        aud: '4ovlg9o3ahg7703d2aadgfojlg',
        event_id: '338bbb06-8f49-11e8-a316-5d4eb5239c30',
        token_use: 'id',
        auth_time: 1532440519,
        name: 'Dimitri',
        exp: 1532444119,
        iat: 1532440519,
        family_name: 'Tarasowski',
        email: '[email protected]' },
     sourceIp: [ '37.221.176.67' ],
     defaultAuthStrategy: 'DENY',
     groups: [ 'canInvite', 'hasFullAccess' ] } }

Todo:

  • Add unit tests
  • Add other event sources (see full list here)
  • Create documentation
  • Creat an npm module

aws-event-generator's People

Contributors

tarasowski avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.