How to use the aws-api-gateway-client.default.newClient function in aws-api-gateway-client

To help you get started, we’ve selected a few aws-api-gateway-client 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 AnomalyInnovations / aws-api-gateway-cli-test / index.js View on Github external
function makeRequest(userTokens) {
  console.log("Making API request");

  var apigClient = apigClientFactory.newClient({
    apiKey: argv.apiKey,
    accessKey: AWS.config.credentials.accessKeyId,
    secretKey: AWS.config.credentials.secretAccessKey,
    sessionToken: AWS.config.credentials.sessionToken,
    region: argv.apiGatewayRegion,
    invokeUrl: argv.invokeUrl
  });

  var params = JSON.parse(argv.params);
  var additionalParams = JSON.parse(argv.additionalParams);
  var body = JSON.parse(argv.body);

  if (argv.accessTokenHeader) {
    const tokenHeader = {};
    tokenHeader[argv.accessTokenHeader] = userTokens.accessToken;
    additionalParams.headers = Object.assign({}, additionalParams.headers, tokenHeader);
github Coalfire-Research / npk / terraform-selfhost / compute-node / hashcat_wrapper.js View on Github external
aws.config.getCredentials(function(err) {
			if (err) {
				credFailureCount++;
				console.log("Error retrieving credentials:" + err);

				if (credFailureCount < 5) {
					console.log("Retrying");
					return getCredentials();
				} else {
					return Project.reject('Failure retrieving credentials.')
				}
			}

			credentialsReady = 1;

			apiClient = apiClientFactory.newClient({
				invokeUrl: "https://" + apigateway + "/v1/statusreport/",
				accessKey: aws.config.credentials.accessKeyId,
				secretKey: aws.config.credentials.secretAccessKey,
				sessionToken: aws.config.credentials.sessionToken,
				region: "us-west-2"
			});

			setTimeout(getCredentials, 600);

			return success(true);
		});
	});

aws-api-gateway-client

A module for AWS API Gateway client

MIT
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis