
Security News
Socket Integrates With Bun 1.3’s Security Scanner API
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
@educational-technology-collective/etc_http_aws_api_gateway_wrapper
Advanced tools
## Description This package offers a Wrapper that can be used to log messages to specially configured AWS Gateway APIs. Instantiation of a Wrapper involves providing 3 required arguments: the URL for the AWS API Gateway, the name of the S3 Bucket, and th
This package offers a Wrapper that can be used to log messages to specially configured AWS Gateway APIs. Instantiation of a Wrapper involves providing 3 required arguments: the URL for the AWS API Gateway, the name of the S3 Bucket, and the path that messages should be saved to in the S3 bucket.
The Wrapper logs errors to console.error
by default.
The Wrapper has two methods: AWSAPIGatewayWrapper#request
and AWSAPIGatewayWrapper#requestAsync
.
AWSAPIGatewayWrapper#request
will handle errors by logging the error to the errorHandler
specified in the constructor. In the event of an error, it will then continue to retry the request after the number of seconds specified by the constructor's retry
argument. This method wraps the requestAsync
method so that the user doesn't need to handle asynchronous errors.
AWSAPIGatewayWrapper#requestAsync
will return a Promise that will resolve with a Response
object or reject with an error. It will log errors to the errorHandler
specified in the constructor. This method does not automatically retry the request if an error happens. It gives you more control over error handling.
Each logged S3 object is named by the AWS Gateway server using a combination of timestamp and UUID. E.g., 1625155259384-9a47660f-3ffe-469d-b1d5-2de875a6a022
. In that example, 1625155259384
is the timestamp and 9a47660f-3ffe-469d-b1d5-2de875a6a022
is the UUID.
First change directory into the base directory of your repository.
Install the dependency and add it to your package.json file.
npm add @educational-technology-collective/etc_http_aws_api_gateway_wrapper
Import the Wrapper.
import { AWSAPIGatewayWrapper } from "@educational-technology-collective/etc_http_aws_api_gateway_wrapper"
constructor
null
for no retry. Default: 1000null
in order to disable it. Default: console.error.AWSAPIGatewayWrapper#requestAsync(data)
AWSAPIGatewayWrapper#request(data)
Example:
let awsAPIGatewayWrapper: AWSAPIGatewayWrapper = new AWSAPIGatewayWrapper(
{
url: "https://example.com",
bucket: "the-name-of-the-bucket",
path: "the-path", // e.g., path/to/resource
retry: 1000, // optional
errorHandler: console.error // optional
});
This is an example of using the request
method in order to send data to an S3 bucket.
import { AWSAPIGatewayWrapper } from "@educational-technology-collective/etc_http_aws_api_gateway_wrapper";
let timestamp: number = Date.now();
let awsAPIGatewayWrapper: AWSAPIGatewayWrapper = new AWSAPIGatewayWrapper(
{
url: "https://example.com",
bucket: "the-name-of-the-bucket",
path: "the-path", // e.g., path/to/resource
retry: 1000, // optional
errorHandler: console.error // optional
});
awsAPIGatewayWrapper.request(["This request was made by AWSAPIGatewayWrapper#request.", timestamp]);
This is an example of making an asynchronous
HTTP request to an S3 bucket.
import { AWSAPIGatewayWrapper } from "@educational-technology-collective/etc_http_aws_api_gateway_wrapper";
let awsAPIGatewayWrapper: AWSAPIGatewayWrapper = new AWSAPIGatewayWrapper(
{
url: "https://example.com",
bucket: "the-name-of-the-bucket",
path: "the-path", // e.g., path/to/resource
errorHandler: console.error // optional
});
(async function () {
try {
let timestamp: number = Date.now();
let response: Response = await awsAPIGatewayWrapper.requestAsync(["This request was made by AWSAPIGatewayWrapper#requestAsync.", timestamp]);
}
catch (e) {
console.error(e);
}
})();
FAQs
## Description This package offers a Wrapper that can be used to log messages to specially configured AWS Gateway APIs. Instantiation of a Wrapper involves providing 3 required arguments: the URL for the AWS API Gateway, the name of the S3 Bucket, and th
The npm package @educational-technology-collective/etc_http_aws_api_gateway_wrapper receives a total of 2 weekly downloads. As such, @educational-technology-collective/etc_http_aws_api_gateway_wrapper popularity was classified as not popular.
We found that @educational-technology-collective/etc_http_aws_api_gateway_wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.