Socket
Socket
Sign inDemoInstall

api-gateway-mapping-template

Package Overview
Dependencies
3
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    api-gateway-mapping-template

Make AWS API Gateway's Mapping Template testable.


Version published
Weekly downloads
196
decreased by-13.27%
Maintainers
1
Install size
464 kB
Created
Weekly downloads
 

Changelog

Source

0.0.8 (2020-04-29)

Bug Fixes

  • print null objects as empty string #4

<a name="0.0.7"></a>

Readme

Source

api-gateway-mapping-template

make AWS API Gateway's Mapping Template testable

Image

Installation

npm install api-gateway-mapping-template

Usage

simple.js:

var mappingTemplate = require('api-gateway-mapping-template')

var vtl = '$input.json(\'$.data\')';
var payload = '{"data": {"url": "https://github.com/ToQoz/api-gateway-mapping-template"}}';

var result = mappingTemplate({template: vtl, payload: payload})
console.dir(result);

$ node ./simple.js
'{"url":"https://github.com/ToQoz/api-gateway-mapping-template"}'

Examples

API

var mappingTemplate = require('api-gateway-mapping-template')

mappingTemplate(parameters)

This function renders AWS API Gateway's Mapping Template by using given payload, params and context.

  • Arguments
    • parameters - required - map
      • template - required - String|Buffer
      • payload - required - String|Buffer
      • params - map
        • path - map<String, String|Number|Boolean|null>
        • querystring - map<String, String|Number|Boolean|null>
        • header - map<String, String|Number|Boolean|null>
      • context - map
        • indentity - map<String, String>
          • cognitoAuthenticationType - String
          • cognitoIdentityId - String
          • cognitoIdentityPoolId - String
          • sourceIp - String
          • user - String
          • userAgent - String
          • userArn - String
        • requestId - String
        • resourceId - String
        • resourcePath - String
        • stage - String
  • Return value
    • rendered template - String

FAQs

Last updated on 29 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc