aws-api-gateway-client
Advanced tools
Comparing version 0.2.15 to 0.2.16
@@ -23,5 +23,2 @@ 'use strict'; | ||
// import 'babel-polyfill'; | ||
var _urlTemplate = require('url-template'); | ||
@@ -55,3 +52,3 @@ | ||
sessionToken: '', | ||
region: 'us-east-1', | ||
region: '', | ||
apiKey: '', | ||
@@ -58,0 +55,0 @@ invokeUrl: '', |
{ | ||
"name": "aws-api-gateway-client", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"description": "A moduel for AWS API Gateway client", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -36,4 +36,4 @@ [![dependencies Status](https://david-dm.org/kndt84/aws-api-gateway-client/status.svg)](https://david-dm.org/kndt84/aws-api-gateway-client) | ||
``` | ||
var params = { | ||
//This is where any header, path, or querystring request params go. The key is the parameter named as defined in the API | ||
var pathParams = { | ||
//This is where path request params go. | ||
userId: '1234', | ||
@@ -45,3 +45,3 @@ }; | ||
var additionalParams = { | ||
//If there are any unmodeled query parameters or headers that need to be sent with the request you can add them here | ||
//If there are query parameters or headers that need to be sent with the request you can add them here | ||
headers: { | ||
@@ -60,3 +60,3 @@ param0: '', | ||
apigClient.invokeApi(params, pathTemplate, method, additionalParams, body) | ||
apigClient.invokeApi(pathParams, pathTemplate, method, additionalParams, body) | ||
.then(function(result){ | ||
@@ -74,7 +74,7 @@ //This is where you would put a success callback | ||
var apigClient = apigClientFactory.newClient({ | ||
invokeUrl:'https://xxxxx.execute-api.us-east-1.amazonaws.com', | ||
accessKey: 'ACCESS_KEY', | ||
secretKey: 'SECRET_KEY', | ||
invokeUrl:'https://xxxxx.execute-api.us-east-1.amazonaws.com', // REQUIRED | ||
accessKey: 'ACCESS_KEY', // REQUIRED | ||
secretKey: 'SECRET_KEY', // REQUIRED | ||
sessionToken: 'SESSION_TOKEN', //OPTIONAL: If you are using temporary credentials you must include the session token | ||
region: 'eu-west-1', // OPTIONAL: The region where the API is deployed, by default this parameter is set to us-east-1 | ||
region: 'eu-west-1', // REQUIRED: The region where the API is deployed. | ||
systemClockOffset: 0, // OPTIONAL: An offset value in milliseconds to apply to signing time | ||
@@ -93,17 +93,6 @@ retries: 4, // OPTIONAL: Number of times to retry before failing. Uses axon-retry plugin. | ||
var apigClient = apigClientFactory.newClient({ | ||
apiKey: 'API_KEY' | ||
invokeUrl:'https://xxxxx.execute-api.us-east-1.amazonaws.com', // REQUIRED | ||
apiKey: 'API_KEY', // REQUIRED | ||
region: 'eu-west-1' // REQUIRED | ||
}); | ||
``` | ||
# Troubleshooting | ||
The standard Javascript SDK as generated by AWS API Gateway hard codes assertions for your query parameters and headers, which is not possible in this module. Therefore, the params object passed to your `apigClient.invokeApi()` must contain keys that conform exactly to your API definitions. | ||
``` | ||
http://example.com/prod?userId=123&info=hello&state=NY | ||
var params = { | ||
userId: '123', | ||
info: 'hello', | ||
state: 'NY' | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37368
520
94