Upgrade octokit to v4.1.2

This commit is contained in:
Angela P Wen 2025-02-19 11:13:12 -08:00
parent dbbcbe019d
commit c1745a9831
1214 changed files with 160765 additions and 0 deletions

21
node_modules/@types/aws-lambda/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

15
node_modules/@types/aws-lambda/README.md generated vendored Normal file
View file

@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/aws-lambda`
# Summary
This package contains type definitions for aws-lambda (http://docs.aws.amazon.com/lambda).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda.
### Additional Details
* Last updated: Fri, 03 Jan 2025 00:04:09 GMT
* Dependencies: none
# Credits
These definitions were written by [James Darbyshire](https://github.com/darbio), [Michael Skarum](https://github.com/skarum), [Stef Heyenrath](https://github.com/StefH), [Rich Buggy](https://github.com/buggy), [wwwy3y3](https://github.com/wwwy3y3), [Ishaan Malhi](https://github.com/OrthoDex), [Michael Marner](https://github.com/MichaelMarner), [Daniel Cottone](https://github.com/daniel-cottone), [Kostya Misura](https://github.com/kostya-misura), [Markus Tacker](https://github.com/coderbyheart), [Palmi Valgeirsson](https://github.com/palmithor), [Danilo Raisi](https://github.com/daniloraisi), [Simon Buchan](https://github.com/simonbuchan), [David Hayden](https://github.com/Haydabase), [Chris Redekop](https://github.com/repl-chris), [Aneil Mallavarapu](https://github.com/aneilbaboo), [Jeremy Nagel](https://github.com/jeznag), [Louis Larry](https://github.com/louislarry), [Daniel Papukchiev](https://github.com/dpapukchiev), [Oliver Hookins](https://github.com/ohookins), [Trevor Leach](https://github.com/trevor-leach), [James Gregory](https://github.com/jagregory), [Erik Dalén](https://github.com/dalen), [Loïk Gaonac'h](https://github.com/loikg), [Roberto Zen](https://github.com/skyzenr), [Grzegorz Redlicki](https://github.com/redlickigrzegorz), [Juan Carbonel](https://github.com/juancarbonel), [Peter McIntyre](https://github.com/pwmcintyre), [Alex Bolenok](https://github.com/alex-bolenok-centralreach), [Marian Zange](https://github.com/marianzange), [Alessandro Palumbo](https://github.com/apalumbo), [Sachin Shekhar](https://github.com/SachinShekhar), [Ivan Martos](https://github.com/ivanmartos), [Zach Anthony](https://github.com/zach-anthony), [Peter Savnik](https://github.com/savnik), [Benoit Boure](https://github.com/bboure), [James Lakin](https://github.com/jamesorlakin), [Ross Gerbasi](https://github.com/aphex), [Joey Kilpatrick](https://github.com/joeykilpatrick), [Luciano Manerich Junior](https://github.com/lmanerich), and [Luciano M. Taranto](https://github.com/LucianoTaranto).

83
node_modules/@types/aws-lambda/common/api-gateway.d.ts generated vendored Normal file
View file

@ -0,0 +1,83 @@
// Types shared between trigger/api-gateway-authorizer.d.ts and api-gateway-proxy.d.ts
// Poorly documented, but API Gateway will just fail internally if
// the context type does not match this.
// Note that although non-string types will be accepted, they will be
// coerced to strings on the other side.
export interface APIGatewayAuthorizerResultContext {
[name: string]: string | number | boolean | null | undefined;
}
// Default authorizer type, prefer using a specific type with the "...WithAuthorizer..." variant types.
// Note that this doesn't have to be a context from a custom lambda outhorizer, AWS also has a cognito
// authorizer type and could add more, so the property won't always be a string.
export type APIGatewayEventDefaultAuthorizerContext =
| undefined
| null
| {
[name: string]: any;
};
export type APIGatewayEventRequestContext = APIGatewayEventRequestContextWithAuthorizer<
APIGatewayEventDefaultAuthorizerContext
>;
// The requestContext property of both request authorizer and proxy integration events.
export interface APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext> {
accountId: string;
apiId: string;
// This one is a bit confusing: it is not actually present in authorizer calls
// and proxy calls without an authorizer. We model this by allowing undefined in the type,
// since it ends up the same and avoids breaking users that are testing the property.
// This lets us allow parameterizing the authorizer for proxy events that know what authorizer
// context values they have.
authorizer: TAuthorizerContext;
connectedAt?: number | undefined;
connectionId?: string | undefined;
domainName?: string | undefined;
domainPrefix?: string | undefined;
eventType?: string | undefined;
extendedRequestId?: string | undefined;
protocol: string;
httpMethod: string;
identity: APIGatewayEventIdentity;
messageDirection?: string | undefined;
messageId?: string | null | undefined;
path: string;
stage: string;
requestId: string;
requestTime?: string | undefined;
requestTimeEpoch: number;
resourceId: string;
resourcePath: string;
routeKey?: string | undefined;
}
export interface APIGatewayEventClientCertificate {
clientCertPem: string;
serialNumber: string;
subjectDN: string;
issuerDN: string;
validity: {
notAfter: string;
notBefore: string;
};
}
export interface APIGatewayEventIdentity {
accessKey: string | null;
accountId: string | null;
apiKey: string | null;
apiKeyId: string | null;
caller: string | null;
clientCert: APIGatewayEventClientCertificate | null;
cognitoAuthenticationProvider: string | null;
cognitoAuthenticationType: string | null;
cognitoIdentityId: string | null;
cognitoIdentityPoolId: string | null;
principalOrgId: string | null;
sourceIp: string;
user: string | null;
userAgent: string | null;
userArn: string | null;
}

245
node_modules/@types/aws-lambda/common/cloudfront.d.ts generated vendored Normal file
View file

@ -0,0 +1,245 @@
/**
* CloudFront events
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
* Bear in mind that the "example" event structure in the page above includes
* both an S3 and a Custom origin, which is not strictly allowed. Only one
* of these per event may be present.
*/
export interface CloudFrontHeaders {
[name: string]: Array<{
key?: string | undefined;
value: string;
}>;
}
export type CloudFrontOrigin =
| { s3: CloudFrontS3Origin; custom?: never | undefined }
| { custom: CloudFrontCustomOrigin; s3?: never | undefined };
export interface CloudFrontCustomOrigin {
customHeaders: CloudFrontHeaders;
domainName: string;
keepaliveTimeout: number;
path: string;
port: number;
protocol: "http" | "https";
readTimeout: number;
sslProtocols: string[];
}
export type CloudFrontS3Origin =
| CloudFrontS3OriginAuthMethodNone
| CloudFrontS3OriginAuthMethodOriginAccessIdentity;
export interface CloudFrontS3OriginBase {
authMethod: "origin-access-identity" | "none";
customHeaders: CloudFrontHeaders;
domainName: string;
path: string;
}
export interface CloudFrontS3OriginAuthMethodNone extends CloudFrontS3OriginBase {
authMethod: "none";
region?: never;
}
export interface CloudFrontS3OriginAuthMethodOriginAccessIdentity extends CloudFrontS3OriginBase {
authMethod: "origin-access-identity";
region: string;
}
export interface CloudFrontResponse {
status: string;
statusDescription: string;
headers: CloudFrontHeaders;
}
export interface CloudFrontRequest {
body?:
| {
action: "read-only" | "replace";
data: string;
encoding: "base64" | "text";
readonly inputTruncated: boolean;
}
| undefined;
readonly clientIp: string;
readonly method: string;
uri: string;
querystring: string;
headers: CloudFrontHeaders;
origin?: CloudFrontOrigin | undefined;
}
export interface CloudFrontEvent {
config: {
readonly distributionDomainName: string;
readonly distributionId: string;
readonly eventType: "origin-request" | "origin-response" | "viewer-request" | "viewer-response";
readonly requestId: string;
};
}
/**
* Generated HTTP response in viewer request event or origin request event
*
* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-generating-http-responses-in-requests.html#lambda-generating-http-responses-object
*/
export interface CloudFrontResultResponse {
status: string;
statusDescription?: string | undefined;
headers?: CloudFrontHeaders | undefined;
bodyEncoding?: "text" | "base64" | undefined;
body?: string | undefined;
}
/** @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html#functions-event-structure-query-header-cookie */
export interface CloudFrontFunctionsCookies {
[key: string]: {
value: string;
attributes?: string;
multiValue?: Array<{ value: string; attributes?: string }>;
};
}
/** @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html#functions-event-structure-query-header-cookie */
export interface CloudFrontFunctionsQuerystring {
[key: string]: { value: string; multiValue?: Array<{ value: string }> };
}
/** @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html#functions-event-structure-query-header-cookie */
export interface CloudFrontFunctionsHeaders {
[key: string]: { value: string; multiValue?: Array<{ value: string }> };
}
/**
* @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html
*
* @usage
* ```ts
* export const handler = async (event: CloudFrontFunctionsEvent) => {
* var response = event.response;
* var headers = response.headers;
* // Set the cache-control header
* headers["cache-control"] = { value: "public,max-age=31536000,immutable" };
* // Return response to viewers
* return response
* };
* ```
*/
export interface CloudFrontFunctionsEvent {
/**
* ## Version field
* The version field contains a string that specifies the version of the
* CloudFront Functions event object. The current version is 1.0.
*/
version: string;
/**
* ## Context object
* The `context` object contains contextual information about the event. It includes the following fields:
* - `distributionDomainName`
* - `distributionId`
* - `eventType`
* - `requestId`
*/
context: {
/** The CloudFront domain name (for example, d111111abcdef8.cloudfront.net) of the distribution thats associated with the event. */
distributionDomainName: string;
/** The ID of the distribution (for example, EDFDVBD6EXAMPLE) thats associated with the event. */
distributionId: string;
/** The event type, either `viewer-request` or `viewer-response`. */
eventType: "viewer-request" | "viewer-response";
/** A string that uniquely identifies a CloudFront request (and its associated response). */
requestId: string;
};
/**
* ## Viewer object
* The `viewer` object contains an `ip` field whose value is the IP address of the viewer (client) that sent the request.
* If the viewer request came through an HTTP proxy or a load balancer, the value is the IP address of the proxy or load balancer.
*/
viewer: {
ip: string;
};
/**
* ## Request object
* The `request` object contains a representation of a viewer-to-CloudFront HTTP request.
* In the `event` object thats passed to your function, the `request` object represents the
* actual request that CloudFront received from the viewer.
*
* If your function code returns a `request` object to CloudFront, it must use this same structure.
*
* The `request` object contains the following fields:
* - `method`
* - `uri`
* - `querystring`
* - `headers`
* - `cookies`
*/
request: {
/** The HTTP method of the request. If your function code returns a `request`, it cannot modify this field. This is the only read-only field in the `request` object. */
method: string;
/**
* The relative path of the requested object. If your function modifies the `uri value, note the following:
* - The new `uri` value must begin with a forward slash (`/`)`.
* - When a function changes the `uri` value, it changes the object that the viewer is requesting.
* - When a function changes the `uri` value, it doesnt change the cache behavior for the request or the origin that an origin request is sent to.
*/
uri: string;
/**
* An object that represents the query string in the request. If the request doesnt include a query string,
* the `request` object still includes an empty `querystring` object.
*
* The `querystring` object contains one field for each query string parameter in the request.
* Query string parameter names are converted to lowercase.
*/
querystring: CloudFrontFunctionsQuerystring;
/**
* An object that represents the HTTP headers in the request. If the request contains any `Cookie` headers,
* those headers are not part of the `headers` object. Cookies are represented separately in the `cookies` object.
*
* The `headers` object contains one field for each header in the request. Header names are converted to lowercase.
*/
headers: CloudFrontFunctionsHeaders;
/**
* An object that represents the cookies in the request (`Cookie` headers).
*
* The `cookies` object contains one field for each cookie in the request. Cookie names are converted to lowercase.
*/
cookies: CloudFrontFunctionsCookies;
};
/**
* ## Response object
*
* The `response` object contains a representation of a CloudFront-to-viewer HTTP response.
* In the `event` object thats passed to your function, the `response` object represents CloudFronts actual response to a viewer request.
*
* If your function code returns a `response` object, it must use this same structure.
*
* The `response` object contains the following fields:
*/
response: {
/**
* The HTTP status code of the response. This value is an integer, not a string.
*
* If the function is associated with a _viewer response_ event type, your function code cannot change
* the `statusCode` that it received. If the function is associated with a _viewer request_ event type
* and [generates an HTTP response](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html#function-code-generate-response),
* your function code can set the `statusCode`.
*/
statusCode: number;
/** The HTTP status description of the response. If your function code generates a response, this field is optional. */
statusDescription?: string;
/**
* An object that represents the HTTP headers in the response. If the response contains any `Set-Cookie` headers,
* those `headers` are not part of the headers object. Cookies are represented separately in the `cookies` object.
*
* The `headers` object contains one field for each header in the response. Header names are converted to lowercase.
*/
headers: CloudFrontFunctionsHeaders;
/**
* An object that represents the cookies in the response (`Set-Cookie` headers).
* The `cookies` object contains one field for each cookie in the response. Cookie names are converted to lowercase.
*/
cookies: CloudFrontFunctionsCookies;
};
}

172
node_modules/@types/aws-lambda/handler.d.ts generated vendored Normal file
View file

@ -0,0 +1,172 @@
/**
* The interface that AWS Lambda will invoke your handler with.
* There are more specialized types for many cases where AWS services
* invoke your lambda, but you can directly use this type for when you are invoking
* your lambda directly.
*
* See the {@link http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html AWS documentation}
* for more information about the runtime behavior, and the
* {@link https://aws.amazon.com/blogs/compute/node-js-8-10-runtime-now-available-in-aws-lambda/ AWS Blog post}
* introducing the async handler behavior in the 8.10 runtime.
*
* @example <caption>Defining a custom handler type</caption>
* import { Handler } from 'aws-lambda'
*
* interface NameEvent {
* fullName: string
* }
* interface NameResult {
* firstName: string
* middleNames: string
* lastName: string
* }
* type PersonHandler = Handler<NameEvent, NameResult>
*
* export const handler: PersonHandler = async (event) => {
* const names = event.fullName.split(' ')
* const firstName = names.shift()
* const lastName = names.pop()
* return { firstName, middleNames: names, lastName }
* }
*
* @example <caption>Logs the contents of the event object and returns the location of the logs</caption>
* import { Handler } from 'aws-lambda'
*
* export const handler: Handler = async (event, context) => {
* console.log("EVENT: \n" + JSON.stringify(event, null, 2))
* return context.logStreamName
* }
*
* @example <caption>AWS SDK with Async Function and Promises</caption>
* import { Handler } from 'aws-lambda'
* import AWS from 'aws-sdk'
*
* const s3 = new AWS.S3()
*
* export const handler: Handler = async (event) => {
* const response = await s3.listBuckets().promise()
* return response?.Buckets.map((bucket) => bucket.Name)
* }
*
* @example <caption>HTTP Request with Callback</caption>
* import { Handler } from 'aws-lambda'
* import https from 'https'
*
* let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html"
*
* export const handler: Handler<void, number> = (event, context, callback) => {
* https.get(url, (res) => {
* callback(null, res.statusCode)
* }).on('error', (e) => {
* callback(Error(e))
* })
* }
*
* @param event
* Parsed JSON data in the lambda request payload. For an AWS service triggered
* lambda this should be in the format of a type ending in Event, for example the
* S3Handler receives an event of type S3Event.
* @param context
* Runtime contextual information of the current invocation, for example the caller
* identity, available memory and time remaining, legacy completion callbacks, and
* a mutable property controlling when the lambda execution completes.
* @param callback
* NodeJS-style completion callback that the AWS Lambda runtime will provide that can
* be used to provide the lambda result payload value, or any execution error. Can
* instead return a promise that resolves with the result payload value or rejects
* with the execution error.
* @return
* A promise that resolves with the lambda result payload value, or rejects with the
* execution error. Note that if you implement your handler as an async function,
* you will automatically return a promise that will resolve with a returned value,
* or reject with a thrown value.
*/
export type Handler<TEvent = any, TResult = any> = (
event: TEvent,
context: Context,
callback: Callback<TResult>,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) => void | Promise<TResult>;
/**
* {@link Handler} context parameter.
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
*/
export interface Context {
callbackWaitsForEmptyEventLoop: boolean;
functionName: string;
functionVersion: string;
invokedFunctionArn: string;
memoryLimitInMB: string;
awsRequestId: string;
logGroupName: string;
logStreamName: string;
identity?: CognitoIdentity | undefined;
clientContext?: ClientContext | undefined;
getRemainingTimeInMillis(): number;
// Functions for compatibility with earlier Node.js Runtime v0.10.42
// No longer documented, so they are deprecated, but they still work
// as of the 12.x runtime, so they are not removed from the types.
/** @deprecated Use handler callback or promise result */
done(error?: Error, result?: any): void;
/** @deprecated Use handler callback with first argument or reject a promise result */
fail(error: Error | string): void;
/** @deprecated Use handler callback with second argument or resolve a promise result */
succeed(messageOrObject: any): void;
// Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
// and it behaves like the above, ignoring the object parameter.
/** @deprecated Use handler callback or promise result */
succeed(message: string, object: any): void;
}
export interface CognitoIdentity {
cognitoIdentityId: string;
cognitoIdentityPoolId: string;
}
export interface ClientContext {
client: ClientContextClient;
Custom?: any;
env: ClientContextEnv;
}
export interface ClientContextClient {
installationId: string;
appTitle: string;
appVersionName: string;
appVersionCode: string;
appPackageName: string;
}
export interface ClientContextEnv {
platformVersion: string;
platform: string;
make: string;
model: string;
locale: string;
}
/**
* NodeJS-style callback parameter for the {@link Handler} type.
* Can be used instead of returning a promise, see the
* {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html AWS documentation}
* for the handler programming model.
*
* @param error
* Parameter to use to provide the error payload for a failed lambda execution.
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-mode-exceptions.html AWS documentation}
* for error handling.
* If an Error instance is passed, the error payload uses the `name` property as the `errorType`,
* the `message` property as the `errorMessage`, and parses the `stack` property string into
* the `trace` array.
* For other values, the `errorType` is `typeof value`, the `errorMessage` is `String(value)`, and
* `trace` is an empty array.
*
* @param result
* Parameter to use to provide the result payload for a successful lambda execution.
* Pass `null` or `undefined` for the `error` parameter to use this parameter.
*/
export type Callback<TResult = any> = (error?: Error | string | null, result?: TResult) => void;

54
node_modules/@types/aws-lambda/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,54 @@
export * from "./common/api-gateway";
export * from "./common/cloudfront";
export * from "./handler";
export * from "./trigger/alb";
// TODO: export * from "./trigger/alexa";
export * from "./trigger/api-gateway-authorizer";
export * from "./trigger/api-gateway-proxy";
export * from "./trigger/appsync-resolver";
export * from "./trigger/autoscaling";
// CloudTrail section just describes using S3 to trigger on cloudtrail changes.
export * from "./trigger/cdk-custom-resource";
export * from "./trigger/cloudformation-custom-resource";
export * from "./trigger/cloudfront-request";
export * from "./trigger/cloudfront-response";
export * from "./trigger/cloudwatch-alarm";
export * from "./trigger/cloudwatch-events";
export * from "./trigger/cloudwatch-logs";
export * from "./trigger/codebuild-cloudwatch-state";
export * from "./trigger/codecommit";
export * from "./trigger/codepipeline";
export * from "./trigger/codepipeline-cloudwatch";
export * from "./trigger/codepipeline-cloudwatch-action";
export * from "./trigger/codepipeline-cloudwatch-pipeline";
export * from "./trigger/codepipeline-cloudwatch-stage";
// TODO: export * from "./trigger/cognito-sync";
export * from "./trigger/cognito-user-pool-trigger/";
export * from "./trigger/connect-contact-flow";
// TODO: export * from "./trigger/config";
export * from "./trigger/dynamodb-stream";
export * from "./trigger/eventbridge";
// ElastiCache section just describes using lambdas in an ElastiCache context (VPC issues, etc.)
// EC2 events are delivered using cloudwatch events...
export * from "./trigger/guard-duty-event-notification";
export * from "./trigger/iot";
export * from "./trigger/iot-authorizer";
export * from "./trigger/kinesis-firehose-transformation";
export * from "./trigger/kinesis-stream";
export * from "./trigger/lambda-function-url";
export * from "./trigger/lex";
export * from "./trigger/lex-v2";
// RDS events are delivered using SNS events...
export * from "./trigger/amplify-resolver";
export * from "./trigger/msk";
export * from "./trigger/s3";
export * from "./trigger/s3-batch";
export * from "./trigger/s3-event-notification";
export * from "./trigger/secretsmanager";
export * from "./trigger/self-managed-kafka";
export * from "./trigger/ses";
export * from "./trigger/sns";
export * from "./trigger/sqs";
export * from "./trigger/transfer-family-authorizer";
export as namespace AWSLambda;

226
node_modules/@types/aws-lambda/package.json generated vendored Normal file
View file

@ -0,0 +1,226 @@
{
"name": "@types/aws-lambda",
"version": "8.10.147",
"description": "TypeScript definitions for aws-lambda",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda",
"license": "MIT",
"contributors": [
{
"name": "James Darbyshire",
"githubUsername": "darbio",
"url": "https://github.com/darbio"
},
{
"name": "Michael Skarum",
"githubUsername": "skarum",
"url": "https://github.com/skarum"
},
{
"name": "Stef Heyenrath",
"githubUsername": "StefH",
"url": "https://github.com/StefH"
},
{
"name": "Rich Buggy",
"githubUsername": "buggy",
"url": "https://github.com/buggy"
},
{
"name": "wwwy3y3",
"githubUsername": "wwwy3y3",
"url": "https://github.com/wwwy3y3"
},
{
"name": "Ishaan Malhi",
"githubUsername": "OrthoDex",
"url": "https://github.com/OrthoDex"
},
{
"name": "Michael Marner",
"githubUsername": "MichaelMarner",
"url": "https://github.com/MichaelMarner"
},
{
"name": "Daniel Cottone",
"githubUsername": "daniel-cottone",
"url": "https://github.com/daniel-cottone"
},
{
"name": "Kostya Misura",
"githubUsername": "kostya-misura",
"url": "https://github.com/kostya-misura"
},
{
"name": "Markus Tacker",
"githubUsername": "coderbyheart",
"url": "https://github.com/coderbyheart"
},
{
"name": "Palmi Valgeirsson",
"githubUsername": "palmithor",
"url": "https://github.com/palmithor"
},
{
"name": "Danilo Raisi",
"githubUsername": "daniloraisi",
"url": "https://github.com/daniloraisi"
},
{
"name": "Simon Buchan",
"githubUsername": "simonbuchan",
"url": "https://github.com/simonbuchan"
},
{
"name": "David Hayden",
"githubUsername": "Haydabase",
"url": "https://github.com/Haydabase"
},
{
"name": "Chris Redekop",
"githubUsername": "repl-chris",
"url": "https://github.com/repl-chris"
},
{
"name": "Aneil Mallavarapu",
"githubUsername": "aneilbaboo",
"url": "https://github.com/aneilbaboo"
},
{
"name": "Jeremy Nagel",
"githubUsername": "jeznag",
"url": "https://github.com/jeznag"
},
{
"name": "Louis Larry",
"githubUsername": "louislarry",
"url": "https://github.com/louislarry"
},
{
"name": "Daniel Papukchiev",
"githubUsername": "dpapukchiev",
"url": "https://github.com/dpapukchiev"
},
{
"name": "Oliver Hookins",
"githubUsername": "ohookins",
"url": "https://github.com/ohookins"
},
{
"name": "Trevor Leach",
"githubUsername": "trevor-leach",
"url": "https://github.com/trevor-leach"
},
{
"name": "James Gregory",
"githubUsername": "jagregory",
"url": "https://github.com/jagregory"
},
{
"name": "Erik Dalén",
"githubUsername": "dalen",
"url": "https://github.com/dalen"
},
{
"name": "Loïk Gaonac'h",
"githubUsername": "loikg",
"url": "https://github.com/loikg"
},
{
"name": "Roberto Zen",
"githubUsername": "skyzenr",
"url": "https://github.com/skyzenr"
},
{
"name": "Grzegorz Redlicki",
"githubUsername": "redlickigrzegorz",
"url": "https://github.com/redlickigrzegorz"
},
{
"name": "Juan Carbonel",
"githubUsername": "juancarbonel",
"url": "https://github.com/juancarbonel"
},
{
"name": "Peter McIntyre",
"githubUsername": "pwmcintyre",
"url": "https://github.com/pwmcintyre"
},
{
"name": "Alex Bolenok",
"githubUsername": "alex-bolenok-centralreach",
"url": "https://github.com/alex-bolenok-centralreach"
},
{
"name": "Marian Zange",
"githubUsername": "marianzange",
"url": "https://github.com/marianzange"
},
{
"name": "Alessandro Palumbo",
"githubUsername": "apalumbo",
"url": "https://github.com/apalumbo"
},
{
"name": "Sachin Shekhar",
"githubUsername": "SachinShekhar",
"url": "https://github.com/SachinShekhar"
},
{
"name": "Ivan Martos",
"githubUsername": "ivanmartos",
"url": "https://github.com/ivanmartos"
},
{
"name": "Zach Anthony",
"githubUsername": "zach-anthony",
"url": "https://github.com/zach-anthony"
},
{
"name": "Peter Savnik",
"githubUsername": "savnik",
"url": "https://github.com/savnik"
},
{
"name": "Benoit Boure",
"githubUsername": "bboure",
"url": "https://github.com/bboure"
},
{
"name": "James Lakin",
"githubUsername": "jamesorlakin",
"url": "https://github.com/jamesorlakin"
},
{
"name": "Ross Gerbasi",
"githubUsername": "aphex",
"url": "https://github.com/aphex"
},
{
"name": "Joey Kilpatrick",
"githubUsername": "joeykilpatrick",
"url": "https://github.com/joeykilpatrick"
},
{
"name": "Luciano Manerich Junior",
"githubUsername": "lmanerich",
"url": "https://github.com/lmanerich"
},
{
"name": "Luciano M. Taranto",
"githubUsername": "LucianoTaranto",
"url": "https://github.com/LucianoTaranto"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/aws-lambda"
},
"scripts": {},
"dependencies": {},
"peerDependencies": {},
"typesPublisherContentHash": "c61fda39cd2f8e15ec3e08c58f4bbff834919ab754ed2653832203474b96c3b9",
"typeScriptVersion": "5.0"
}

48
node_modules/@types/aws-lambda/trigger/alb.d.ts generated vendored Normal file
View file

@ -0,0 +1,48 @@
import { Callback, Handler } from "../handler";
export type ALBHandler = Handler<ALBEvent, ALBResult>;
export type ALBCallback = Callback<ALBResult>;
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html
export interface ALBEventRequestContext {
elb: {
targetGroupArn: string;
};
}
export interface ALBEventQueryStringParameters {
[name: string]: string | undefined;
}
export interface ALBEventHeaders {
[name: string]: string | undefined;
}
export interface ALBEventMultiValueHeaders {
[name: string]: string[] | undefined;
}
export interface ALBEventMultiValueQueryStringParameters {
[name: string]: string[] | undefined;
}
export interface ALBEvent {
requestContext: ALBEventRequestContext;
httpMethod: string;
path: string;
queryStringParameters?: ALBEventQueryStringParameters | undefined; // URL encoded
headers?: ALBEventHeaders | undefined;
multiValueQueryStringParameters?: ALBEventMultiValueQueryStringParameters | undefined; // URL encoded
multiValueHeaders?: ALBEventMultiValueHeaders | undefined;
body: string | null;
isBase64Encoded: boolean;
}
export interface ALBResult {
statusCode: number;
statusDescription?: string | undefined;
headers?: { [header: string]: boolean | number | string } | undefined;
multiValueHeaders?: { [header: string]: Array<boolean | number | string> } | undefined;
body?: string | undefined;
isBase64Encoded?: boolean | undefined;
}

View file

@ -0,0 +1,38 @@
import { Handler } from "../handler";
import { AppSyncIdentity, AppSyncResolverEventHeaders } from "./appsync-resolver";
/**
* An AWS Amplify GraphQL resolver event. It differs slightly from a native ('direct') AppSync resolver event.
*
* @see https://docs.amplify.aws/cli/graphql/custom-business-logic/#structure-of-the-function-event
*/
export interface AmplifyGraphQlResolverEvent<TArguments = Record<string, any>, TSource = Record<string, any>> {
/** The name of the parent object type (data model) of the field being resolved. */
typeName: string;
/** The field within the given type to resolve. */
fieldName: string;
/** A map of GraphQL arguments passed to the field being resolved. */
arguments: TArguments;
/** The identity used to authenticate the request to AppSync. */
identity?: AppSyncIdentity;
/** The parent object's value if resolving a nested field. */
source: TSource;
/** The request headers */
request: {
headers: AppSyncResolverEventHeaders;
domainName: string | null;
};
/** The object returned by a possible previous pipeline resolver function. */
prev: { result: { [key: string]: any } } | null;
}
/**
* A handler for Amplify GraphQL Lambda resolvers. The returned result will be resolved as the value (no need to convert to a JSON string).
*
* @see https://docs.amplify.aws/cli/graphql/custom-business-logic/#structure-of-the-function-event
*/
export type AmplifyGraphQlResolverHandler<
TArguments = Record<string, any>,
TSource = Record<string, any>,
TResult = any,
> = Handler<AmplifyGraphQlResolverEvent<TArguments, TSource>, TResult>;

View file

@ -0,0 +1,246 @@
import {
APIGatewayAuthorizerResultContext,
APIGatewayEventDefaultAuthorizerContext,
APIGatewayEventRequestContextWithAuthorizer,
} from "../common/api-gateway";
import { Callback, Handler } from "../handler";
import { APIGatewayEventRequestContextV2 } from "./api-gateway-proxy";
export type APIGatewayAuthorizerHandler = Handler<APIGatewayAuthorizerEvent, APIGatewayAuthorizerResult>;
export type APIGatewayAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
Handler<APIGatewayAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
export type APIGatewayAuthorizerCallback = Callback<APIGatewayAuthorizerResult>;
export type APIGatewayAuthorizerWithContextCallback<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
Callback<APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
export type APIGatewayTokenAuthorizerHandler = Handler<APIGatewayTokenAuthorizerEvent, APIGatewayAuthorizerResult>;
export type APIGatewayTokenAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
Handler<APIGatewayTokenAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
export type APIGatewayRequestAuthorizerHandler = Handler<APIGatewayRequestAuthorizerEvent, APIGatewayAuthorizerResult>;
export type APIGatewayRequestAuthorizerWithContextHandler<
TAuthorizerContext extends APIGatewayAuthorizerResultContext,
> = Handler<APIGatewayRequestAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
export type APIGatewayAuthorizerEvent = APIGatewayTokenAuthorizerEvent | APIGatewayRequestAuthorizerEvent;
export interface APIGatewayTokenAuthorizerEvent {
type: "TOKEN";
methodArn: string;
authorizationToken: string;
}
export interface APIGatewayRequestAuthorizerEventV2 {
version: string;
type: "REQUEST";
routeArn: string;
identitySource: string[];
routeKey: string;
rawPath: string;
rawQueryString: string;
cookies: string[];
headers?: APIGatewayRequestAuthorizerEventHeaders;
queryStringParameters?: APIGatewayRequestAuthorizerEventQueryStringParameters;
requestContext: APIGatewayEventRequestContextV2;
pathParameters?: APIGatewayRequestAuthorizerEventPathParameters;
stageVariables?: APIGatewayRequestAuthorizerEventStageVariables;
}
export interface APIGatewayRequestAuthorizerEventHeaders {
[name: string]: string | undefined;
}
export interface APIGatewayRequestAuthorizerEventMultiValueHeaders {
[name: string]: string[] | undefined;
}
export interface APIGatewayRequestAuthorizerEventPathParameters {
[name: string]: string | undefined;
}
export interface APIGatewayRequestAuthorizerEventQueryStringParameters {
[name: string]: string | undefined;
}
export interface APIGatewayRequestAuthorizerEventMultiValueQueryStringParameters {
[name: string]: string[] | undefined;
}
export interface APIGatewayRequestAuthorizerEventStageVariables {
[name: string]: string | undefined;
}
// Note, when invoked by the tester in the AWS web console, the map values can be null,
// but they will be empty objects in the real object.
// Worse, it will include "body" and "isBase64Encoded" properties, unlike the real call!
// See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html for the
// formal definition.
export interface APIGatewayRequestAuthorizerEvent {
type: "REQUEST";
methodArn: string;
resource: string;
path: string;
httpMethod: string;
headers: APIGatewayRequestAuthorizerEventHeaders | null;
multiValueHeaders: APIGatewayRequestAuthorizerEventMultiValueHeaders | null;
pathParameters: APIGatewayRequestAuthorizerEventPathParameters | null;
queryStringParameters: APIGatewayRequestAuthorizerEventQueryStringParameters | null;
multiValueQueryStringParameters: APIGatewayRequestAuthorizerEventMultiValueQueryStringParameters | null;
stageVariables: APIGatewayRequestAuthorizerEventStageVariables | null;
requestContext: APIGatewayEventRequestContextWithAuthorizer<undefined>;
}
export interface APIGatewayAuthorizerResult {
principalId: string;
policyDocument: PolicyDocument;
context?: APIGatewayAuthorizerResultContext | null | undefined;
usageIdentifierKey?: string | null | undefined;
}
// Separate type so the context property is required, without pulling complex type magic.
export interface APIGatewayAuthorizerWithContextResult<TAuthorizerContext extends APIGatewayAuthorizerResultContext> {
principalId: string;
policyDocument: PolicyDocument;
context: TAuthorizerContext;
usageIdentifierKey?: string | null | undefined;
}
/**
* IAM Authorizer Types
*/
export interface APIGatewayIAMAuthorizerResult {
principalId: string;
policyDocument: PolicyDocument;
context?: APIGatewayAuthorizerResultContext | null | undefined;
usageIdentifierKey?: string | null | undefined;
}
export interface APIGatewayIAMAuthorizerWithContextResult<
TAuthorizerContext extends APIGatewayAuthorizerResultContext,
> {
principalId: string;
policyDocument: PolicyDocument;
context: TAuthorizerContext;
usageIdentifierKey?: string | null | undefined;
}
export type APIGatewayRequestIAMAuthorizerHandlerV2 = Handler<
APIGatewayRequestAuthorizerEventV2,
APIGatewayIAMAuthorizerResult
>;
export type APIGatewayRequestIAMAuthorizerV2WithContextHandler<
TAuthorizerContext extends APIGatewayAuthorizerResultContext,
> = Handler<APIGatewayRequestAuthorizerEventV2, APIGatewayIAMAuthorizerWithContextResult<TAuthorizerContext>>;
/**
* Simple Lambda Authorizer Types V2 spec with simple response
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
*/
export interface APIGatewaySimpleAuthorizerResult {
isAuthorized: boolean;
}
export interface APIGatewaySimpleAuthorizerWithContextResult<TAuthorizerContext>
extends APIGatewaySimpleAuthorizerResult
{
context: TAuthorizerContext;
}
export type APIGatewayRequestSimpleAuthorizerHandlerV2 = Handler<
APIGatewayRequestAuthorizerEventV2,
APIGatewaySimpleAuthorizerResult
>;
export type APIGatewayRequestSimpleAuthorizerHandlerV2WithContext<TAuthorizerContext> = Handler<
APIGatewayRequestAuthorizerEventV2,
APIGatewaySimpleAuthorizerWithContextResult<TAuthorizerContext>
>;
// Legacy event / names
/** @deprecated Use APIGatewayAuthorizerHandler or a subtype */
export type CustomAuthorizerHandler = Handler<CustomAuthorizerEvent, APIGatewayAuthorizerResult>;
// This one is actually fine.
export type CustomAuthorizerCallback = APIGatewayAuthorizerCallback;
/** @deprecated Use APIGatewayAuthorizerEvent or a subtype */
export interface CustomAuthorizerEvent {
type: string;
methodArn: string;
authorizationToken?: string | undefined;
resource?: string | undefined;
path?: string | undefined;
httpMethod?: string | undefined;
headers?: { [name: string]: string } | undefined;
multiValueHeaders?: { [name: string]: string[] } | undefined;
pathParameters?: { [name: string]: string } | null | undefined;
queryStringParameters?: { [name: string]: string } | null | undefined;
multiValueQueryStringParameters?: { [name: string]: string[] } | null | undefined;
stageVariables?: { [name: string]: string } | undefined;
requestContext?: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext> | undefined;
domainName?: string | undefined;
apiId?: string | undefined;
}
export type CustomAuthorizerResult = APIGatewayAuthorizerResult;
export type AuthResponse = APIGatewayAuthorizerResult;
export type AuthResponseContext = APIGatewayAuthorizerResultContext;
/**
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.
* https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition
*/
export interface PolicyDocument {
Version: string;
Id?: string | undefined;
Statement: Statement[];
}
/**
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Condition.
* https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html
*/
export interface ConditionBlock {
[condition: string]: Condition | Condition[];
}
export interface Condition {
[key: string]: string | string[];
}
/**
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
* https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html
*/
export type Statement = BaseStatement & StatementAction & (StatementResource | StatementPrincipal);
export type StatementEffect = "Allow" | "Deny";
export interface BaseStatement {
Effect: StatementEffect;
Sid?: string | undefined;
Condition?: ConditionBlock | undefined;
}
export type PrincipalValue = { [key: string]: string | string[] } | string | string[];
export interface MaybeStatementPrincipal {
Principal?: PrincipalValue | undefined;
NotPrincipal?: PrincipalValue | undefined;
}
export interface MaybeStatementResource {
Resource?: string | string[] | undefined;
NotResource?: string | string[] | undefined;
}
export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] };
export type StatementResource =
& MaybeStatementPrincipal
& ({ Resource: string | string[] } | { NotResource: string | string[] });
export type StatementPrincipal =
& MaybeStatementResource
& ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue });

View file

@ -0,0 +1,336 @@
import {
APIGatewayEventClientCertificate,
APIGatewayEventDefaultAuthorizerContext,
APIGatewayEventRequestContextWithAuthorizer,
} from "../common/api-gateway";
import { Callback, CognitoIdentity, Handler } from "../handler";
/**
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyHandler = Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
/**
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyCallback = Callback<APIGatewayProxyResult>;
/**
* Works with HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyHandlerV2<T = never> = Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2<T>>;
/**
* Works with HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-requests.html
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-mapping-template-reference.html
*/
export type APIGatewayProxyWebsocketHandlerV2<T = never> = Handler<
APIGatewayProxyWebsocketEventV2,
APIGatewayProxyResultV2<T>
>;
/**
* Works with HTTP API integration Payload Format version 2.0 adds JWT Authroizer to RequestContext
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyHandlerV2WithJWTAuthorizer<T = never> = Handler<
APIGatewayProxyEventV2WithJWTAuthorizer,
APIGatewayProxyResultV2<T>
>;
/**
* Works with HTTP API integration Payload Format version 2.0 adds Lambda Authroizer to RequestContext
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyHandlerV2WithLambdaAuthorizer<TAuthorizerContext, T = never> = Handler<
APIGatewayProxyEventV2WithLambdaAuthorizer<TAuthorizerContext>,
APIGatewayProxyResultV2<T>
>;
/**
* Works with HTTP API integration Payload Format version 2.0 adds IAM Authroizer to RequestContext
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyHandlerV2WithIAMAuthorizer<T = never> = Handler<
APIGatewayProxyEventV2WithIAMAuthorizer,
APIGatewayProxyResultV2<T>
>;
/**
* Works with HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyCallbackV2 = Callback<APIGatewayProxyResultV2>;
/**
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyEvent = APIGatewayProxyEventBase<APIGatewayEventDefaultAuthorizerContext>;
export type APIGatewayProxyWithLambdaAuthorizerHandler<TAuthorizerContext> = Handler<
APIGatewayProxyWithLambdaAuthorizerEvent<TAuthorizerContext>,
APIGatewayProxyResult
>;
export type APIGatewayProxyWithCognitoAuthorizerHandler = Handler<
APIGatewayProxyWithCognitoAuthorizerEvent,
APIGatewayProxyResult
>;
export type APIGatewayProxyWithLambdaAuthorizerEvent<TAuthorizerContext> = APIGatewayProxyEventBase<
APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext>
>;
export type APIGatewayProxyWithLambdaAuthorizerEventRequestContext<TAuthorizerContext> =
APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext>>;
// API Gateway proxy integration mangles the context from a custom authorizer,
// converting all number or boolean properties to string, and adding some extra properties.
export type APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext> =
& {
[P in keyof TAuthorizerContext]: TAuthorizerContext[P] extends null ? null : string;
}
& {
principalId: string;
integrationLatency: number;
};
export type APIGatewayProxyWithCognitoAuthorizerEvent = APIGatewayProxyEventBase<APIGatewayProxyCognitoAuthorizer>;
// All claims are coerced into strings.
export interface APIGatewayProxyCognitoAuthorizer {
claims: {
[name: string]: string;
};
}
export interface APIGatewayProxyEventHeaders {
[name: string]: string | undefined;
}
export interface APIGatewayProxyEventMultiValueHeaders {
[name: string]: string[] | undefined;
}
export interface APIGatewayProxyEventPathParameters {
[name: string]: string | undefined;
}
export interface APIGatewayProxyEventQueryStringParameters {
[name: string]: string | undefined;
}
export interface APIGatewayProxyEventMultiValueQueryStringParameters {
[name: string]: string[] | undefined;
}
export interface APIGatewayProxyEventStageVariables {
[name: string]: string | undefined;
}
export interface APIGatewayProxyEventBase<TAuthorizerContext> {
body: string | null;
headers: APIGatewayProxyEventHeaders;
multiValueHeaders: APIGatewayProxyEventMultiValueHeaders;
httpMethod: string;
isBase64Encoded: boolean;
path: string;
pathParameters: APIGatewayProxyEventPathParameters | null;
queryStringParameters: APIGatewayProxyEventQueryStringParameters | null;
multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters | null;
stageVariables: APIGatewayProxyEventStageVariables | null;
requestContext: APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext>;
resource: string;
}
/**
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export interface APIGatewayProxyResult {
statusCode: number;
headers?:
| {
[header: string]: boolean | number | string;
}
| undefined;
multiValueHeaders?:
| {
[header: string]: Array<boolean | number | string>;
}
| undefined;
body: string;
isBase64Encoded?: boolean | undefined;
}
/**
* Works with HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export interface APIGatewayEventRequestContextV2 {
accountId: string;
apiId: string;
authentication?: {
clientCert: APIGatewayEventClientCertificate;
};
domainName: string;
domainPrefix: string;
http: {
method: string;
path: string;
protocol: string;
sourceIp: string;
userAgent: string;
};
requestId: string;
routeKey: string;
stage: string;
time: string;
timeEpoch: number;
}
/**
* Works with Websocket API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-requests.html
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-mapping-template-reference.html
*/
export interface APIGatewayEventWebsocketRequestContextV2 {
routeKey: string;
messageId: string;
eventType: "CONNECT" | "MESSAGE" | "DISCONNECT";
extendedRequestId: string;
requestTime: string;
messageDirection: "IN";
stage: string;
connectedAt: number;
requestTimeEpoch: number;
requestId: string;
domainName: string;
connectionId: string;
apiId: string;
}
/**
* Proxy Event with adaptable requestContext for different authorizer scenarios
*/
export interface APIGatewayProxyEventV2WithRequestContext<TRequestContext> {
version: string;
routeKey: string;
rawPath: string;
rawQueryString: string;
cookies?: string[];
headers: APIGatewayProxyEventHeaders;
queryStringParameters?: APIGatewayProxyEventQueryStringParameters;
requestContext: TRequestContext;
body?: string;
pathParameters?: APIGatewayProxyEventPathParameters;
isBase64Encoded: boolean;
stageVariables?: APIGatewayProxyEventStageVariables;
}
/**
* Proxy Websocket Event with adaptable requestContext for different authorizer scenarios
*/
export interface APIGatewayProxyWebsocketEventV2WithRequestContext<TRequestContext> {
requestContext: TRequestContext;
body?: string;
isBase64Encoded: boolean;
stageVariables?: APIGatewayProxyEventStageVariables;
}
/**
* Lambda Authorizer Payload
*/
export interface APIGatewayEventRequestContextLambdaAuthorizer<TAuthorizerContext> {
lambda: TAuthorizerContext;
}
/**
* JWT Authorizer Payload
*/
export interface APIGatewayEventRequestContextJWTAuthorizer {
principalId: string;
integrationLatency: number;
jwt: {
claims: { [name: string]: string | number | boolean | string[] };
scopes: string[];
};
}
/**
* IAM Authorizer Payload
*/
export interface APIGatewayEventRequestContextIAMAuthorizer {
iam: {
accessKey: string;
accountId: string;
callerId: string;
cognitoIdentity: null;
principalOrgId: string;
userArn: string;
userId: string;
};
}
export type APIGatewayProxyEventV2WithJWTAuthorizer = APIGatewayProxyEventV2WithRequestContext<
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextJWTAuthorizer>
>;
export type APIGatewayProxyEventV2WithLambdaAuthorizer<TAuthorizerContext> = APIGatewayProxyEventV2WithRequestContext<
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextLambdaAuthorizer<TAuthorizerContext>>
>;
/**
* Event type when invoking Lambda function URLs with IAM authorizer
*/
export type APIGatewayProxyEventV2WithIAMAuthorizer = APIGatewayProxyEventV2WithRequestContext<
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextIAMAuthorizer>
>;
export interface APIGatewayEventRequestContextV2WithAuthorizer<TAuthorizer> extends APIGatewayEventRequestContextV2 {
authorizer: TAuthorizer;
}
/**
* Default Proxy event with no Authorizer
*/
export type APIGatewayProxyEventV2 = APIGatewayProxyEventV2WithRequestContext<APIGatewayEventRequestContextV2>;
/**
* Default Websocket Proxy event with no Authorizer
*/
export type APIGatewayProxyWebsocketEventV2 = APIGatewayProxyWebsocketEventV2WithRequestContext<
APIGatewayEventWebsocketRequestContextV2
>;
/**
* Works with HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type APIGatewayProxyResultV2<T = never> = APIGatewayProxyStructuredResultV2 | string | T;
/**
* Interface for structured response with `statusCode` and`headers`
* Works with HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export interface APIGatewayProxyStructuredResultV2 {
statusCode?: number | undefined;
headers?:
| {
[header: string]: boolean | number | string;
}
| undefined;
body?: string | undefined;
isBase64Encoded?: boolean | undefined;
cookies?: string[] | undefined;
}
// Legacy names
export type ProxyHandler = APIGatewayProxyHandler;
export type ProxyCallback = APIGatewayProxyCallback;
export type APIGatewayEvent = APIGatewayProxyEvent;
export type ProxyResult = APIGatewayProxyResult;

View file

@ -0,0 +1,121 @@
import { Handler } from "../handler";
export type AppSyncResolverHandler<TArguments, TResult, TSource = Record<string, any> | null> = Handler<
AppSyncResolverEvent<TArguments, TSource>,
TResult
>;
// https:docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html#advanced-use-case-batching
export type AppSyncBatchResolverHandler<TArguments, TResult, TSource = Record<string, any> | null> = Handler<
Array<AppSyncResolverEvent<TArguments, TSource>>,
TResult[]
>;
/**
* @deprecated Use {@link AppSyncAuthorizerHandler}
*/
export type AppSyncAuthorizerHander<TResolverContext = undefined> = AppSyncAuthorizerHandler<TResolverContext>;
/**
* See https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html#aws-lambda-authorization
*
* @param TResolverContext type of the resolverContext object that you can return from the handler
*/
export type AppSyncAuthorizerHandler<TResolverContext = undefined> = Handler<
AppSyncAuthorizerEvent,
AppSyncAuthorizerResult<TResolverContext>
>;
export interface AppSyncResolverEventHeaders {
[name: string]: string | undefined;
}
export interface AppSyncAuthorizerEventHeaders {
[name: string]: string | undefined;
}
export type AppSyncIdentity =
| AppSyncIdentityIAM
| AppSyncIdentityCognito
| AppSyncIdentityOIDC
| AppSyncIdentityLambda
| undefined
| null;
/**
* See https://docs.aws.amazon.com/appsync/latest/devguide/resolver-context-reference.html
*
* @param TArguments type of the arguments
* @param TSource type of the source
*/
// Maintainer's note: Some of these properties are shared with the Amplify resolver.
// It may be worth checking if changes here may be applicable there too.
export interface AppSyncResolverEvent<TArguments, TSource = Record<string, any> | null> {
arguments: TArguments;
identity?: AppSyncIdentity;
source: TSource;
request: {
headers: AppSyncResolverEventHeaders;
/** The API's custom domain if used for the request. */
domainName: string | null;
};
info: {
selectionSetList: string[];
selectionSetGraphQL: string;
parentTypeName: string;
fieldName: string;
variables: { [key: string]: any };
};
prev: { result: { [key: string]: any } } | null;
stash: { [key: string]: any };
}
export interface AppSyncAuthorizerEvent {
authorizationToken: string;
requestContext: {
apiId: string;
accountId: string;
requestId: string;
queryString: string;
operationName?: string;
variables: { [key: string]: any };
};
requestHeaders: AppSyncAuthorizerEventHeaders;
}
export interface AppSyncAuthorizerResult<TResolverContext = undefined> {
isAuthorized: boolean;
resolverContext?: TResolverContext;
deniedFields?: string[];
ttlOverride?: number;
}
export interface AppSyncIdentityIAM {
accountId: string;
cognitoIdentityPoolId: string;
cognitoIdentityId: string;
sourceIp: string[];
username: string;
userArn: string;
cognitoIdentityAuthType: string;
cognitoIdentityAuthProvider: string;
}
export interface AppSyncIdentityCognito {
sub: string;
issuer: string;
username: string;
claims: any;
sourceIp: string[];
defaultAuthStrategy: string;
groups: string[] | null;
}
export interface AppSyncIdentityOIDC {
claims: any;
issuer: string;
sub: string;
}
export interface AppSyncIdentityLambda {
resolverContext: any;
}

View file

@ -0,0 +1,41 @@
import { Callback, Handler } from "../handler";
export type AutoScalingScaleInHandler = Handler<AutoScalingScaleInEvent, AutoScalingScaleInResult>;
export type AutoScalingScaleInCallback = Callback<AutoScalingScaleInResult>;
export type AutoScalingInstanceMarketOption = "spot" | "on-demand";
export type AutoScalingScaleInCause = "SCALE_IN" | "INSTANCE_REFRESH" | "MAX_INSTANCE_LIFETIME" | "REBALANCE";
export interface AutoScalingTerminationRequest {
AvailabilityZone: string;
Capacity: number;
InstanceMarketOption: AutoScalingInstanceMarketOption;
}
export interface AutoScalingInstanceRecord {
AvailabilityZone: string;
InstanceId: string;
InstanceType: string;
InstanceMarketOption: AutoScalingInstanceMarketOption;
}
/**
* An Auto Scaling Group may trigger a Scale In Event when you have attached
* a custom termination policy function. This event and the expected response are
* described in the Auto Scaling docs at:
*
* https://docs.aws.amazon.com/autoscaling/ec2/userguide/lambda-custom-termination-policy.html
*/
export interface AutoScalingScaleInEvent {
AutoScalingGroupARN: string;
AutoScalingGroupName: string;
CapacityToTerminate: AutoScalingTerminationRequest[];
Instances: AutoScalingInstanceRecord[];
Cause: AutoScalingScaleInCause;
HasMoreInstances?: boolean;
}
export interface AutoScalingScaleInResult {
InstanceIDs: string[];
}

View file

@ -0,0 +1,158 @@
import { Callback, Handler } from "../handler";
import {
CloudFormationCustomResourceEvent,
CloudFormationCustomResourceResourcePropertiesCommon,
} from "./cloudformation-custom-resource";
/**
* Request event sent to the Lambda `OnEvent` handler for a CDK Custom Resource
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
*/
export type CdkCustomResourceEvent<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TOldResourceProperties = TResourceProperties,
> =
& CloudFormationCustomResourceEvent<TResourceProperties, TOldResourceProperties>
& {
/**
* The response URL identifies a presigned S3 bucket that receives responses from the custom resource provider to AWS CloudFormation.
*
* **This URL should not be used.**
* The CDK Provider Framework will call this URL automatically based on the response produced by the Lambda handler.
*/
ResponseURL: string;
};
/**
* Lambda handler function for the `OnEvent` CDK Custom Resource
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
*
* NOTE: this is not to be confused with traditional CloudFormation custom resources.
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TData User-defined output properties that are retuned from any invocation
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
*/
export type CdkCustomResourceHandler<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TData extends Record<string, any> = Record<string, any>,
TOldResourceProperties = TResourceProperties,
> = Handler<CdkCustomResourceEvent<TResourceProperties, TOldResourceProperties>, CdkCustomResourceResponse<TData>>;
/**
* Lambda `OnEvent` callback function for a CDK Custom Resource
* @template TData User-defined output properties that are retuned from any invocation
*/
export type CdkCustomResourceCallback<TData extends Record<string, any>> = Callback<CdkCustomResourceResponse<TData>>;
/**
* Response from the `OnEvent` Lambda handler for a CDK Custom Resource
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
* @template TData User-defined output properties that are retuned from any invocation
*/
export interface CdkCustomResourceResponse<TData extends Record<string, any> = Record<string, any>> {
/**
* This value should be an identifier unique to the custom resource vendor, and can be up to 1 KB in size. The value must be a non-empty string and must be identical for all responses for the same resource.
* The value returned for a `PhysicalResourceId` can change custom resource update operations. If the value returned is the same, it is considered a normal update. If the value returned is different, AWS CloudFormation recognizes the update as a replacement and sends a delete request to the old resource.
*
* If omitted for `Create` events, the event's `RequestId` will be used.
* For `Update`, the current physical ID will be used. If a different value is returned, CloudFormation will follow with a subsequent `Delete` for the previous ID (resource replacement).
* For `Delete`, it will always return the current physical resource ID, and if the user returns a different one, an error will occur.
*/
PhysicalResourceId?: string;
/**
* The custom resource provider-defined name-value pairs to send with the response. You can access the values provided here by name in the template with `Fn::GetAtt`.
* NOTE: If the name-value pairs contain sensitive information, you should use the `NoEcho` field to mask the output of the custom resource. Otherwise, the values are visible through APIs that surface property values (such as `DescribeStackEvents`).
*/
Data?: TData;
/**
* Indicates whether to mask the output of the custom resource when retrieved by using the `Fn::GetAtt` function. If set to `true`, all returned values are masked with asterisks (*****), __except for those stored in the `Metadata` section of the template__. AWS CloudFormation does not transform, modify, or redact any information you include in the `Metadata` section. The default value is `false`.
*/
NoEcho?: boolean;
/**
* Any other field included in the response will be passed through to `isComplete`. This can sometimes be useful to pass state between the handlers.
*/
[Key: string]: any;
}
/**
* Request event sent to the Lambda `IsComplete` handler for an asynchronous CDK Custom Resource
* The input event to isComplete includes all request fields, combined with all fields returned from onEvent. If PhysicalResourceId has not been explicitly returned from onEvent, it's value will be calculated based on heuristics.
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TData User-defined output properties that are retuned from any invocation
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
*/
export type CdkCustomResourceIsCompleteEvent<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TData extends Record<string, any> = Record<string, any>,
TOldResourceProperties = TResourceProperties,
> = CdkCustomResourceEvent<TResourceProperties, TOldResourceProperties> & CdkCustomResourceResponse<TData>;
/**
* Common response properties from the `IsComplete` Lambda handler for a CDK Custom Resource
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
* @template TData User-defined output properties that are retuned from any invocation
*/
export type CdkCustomResourceIsCompleteResponse<TData extends Record<string, any> = Record<string, any>> =
| CdkCustomResourceIsCompleteResponseSuccess<TData>
| CdkCustomResourceIsCompleteResponseWaiting;
/**
* Response properties that are specifically for a successful `IsComplete` response for a CDK Custom Resource
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
* @template TData User-defined output properties that are retuned from any invocation
*/
export interface CdkCustomResourceIsCompleteResponseSuccess<TData extends Record<string, any> = Record<string, any>> {
/**
* Indicates the operation has finished.
*/
IsComplete: true;
/**
* The custom resource provider-defined name-value pairs to send with the response. You can access the values provided here by name in the template with `Fn::GetAtt`.
* These attributes will be **merged** with the ones returned from `onEvent`.
*/
Data?: TData;
}
/**
* Response properties that are specifically for a still waiting `IsComplete` response for a CDK Custom Resource
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
*/
export interface CdkCustomResourceIsCompleteResponseWaiting {
/**
* Indicates the operation has not finished.
*/
IsComplete: false;
}
/**
* Lambda `IsComplete` handler function for asynchronous CDK Custom Resources
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TOnEventData User-defined output properties that are retuned from any invocation of the `OnEvent` function
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
* @template TIsCompleteData User-defined output properties that are retuned from any invocation of the `IsComplete` function
*/
export type CdkCustomResourceIsCompleteHandler<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TOnEventData extends Record<string, any> = Record<string, any>,
TOldResourceProperties = TResourceProperties,
TIsCompleteData extends Record<string, any> = TOnEventData,
> = Handler<
CdkCustomResourceIsCompleteEvent<TResourceProperties, TOnEventData, TOldResourceProperties>,
CdkCustomResourceIsCompleteResponse<TIsCompleteData>
>;
/**
* Lambda `IsComplete` callback function for a CDK Custom Resource
* @template TData User-defined output properties that are retuned from any invocation
*/
export type CdkCustomResourceIsCompleteCallback<TData extends Record<string, any> = Record<string, any>> = Callback<
CdkCustomResourceIsCompleteResponse<TData>
>;

View file

@ -0,0 +1,236 @@
import { Handler } from "../handler";
/**
* Named service-defined resource properties
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html#crpg-ref-request-properties
*/
export interface CloudFormationCustomResourceResourcePropertiesCommon extends Record<string, any> {
/**
* The service token, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region as the stack.
*/
ServiceToken: string;
/**
* The maximum time, in seconds, that can elapse before a custom resource operation times out.
* The value must be an integer from 1 to 3600. The default value is 3600 seconds (1 hour).
*/
ServiceTimeout?: string;
}
/**
* Lambda handler function for a Lambda-backed CloudFormation Custom Resource
*
* NOTE: responses are *not* returned from the Lambda handler but rather they are sent to the event ResponseURL.
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
*/
export type CloudFormationCustomResourceHandler<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TOldResourceProperties = TResourceProperties,
> = Handler<CloudFormationCustomResourceEvent<TResourceProperties, TOldResourceProperties>, void>;
/**
* Request event sent to the Lambda handler for a Lambda-backed CloudFormation Custom Resource
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html#crpg-ref-request-fields
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
*/
export type CloudFormationCustomResourceEvent<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TOldResourceProperties = TResourceProperties,
> =
| CloudFormationCustomResourceCreateEvent<TResourceProperties>
| CloudFormationCustomResourceUpdateEvent<TResourceProperties, TOldResourceProperties>
| CloudFormationCustomResourceDeleteEvent<TResourceProperties>;
/**
* Response from a Lambda handler for a Lambda-backed CloudFormation Custom Resource
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
*
* NOTE: responses are *not* returned from the Lambda handler but rather they are sent to the event ResponseURL.
* @template TData User-defined output properties that are retuned from any invocation
*/
export type CloudFormationCustomResourceResponse<TData extends Record<string, any> = Record<string, any>> =
| CloudFormationCustomResourceSuccessResponse<TData>
| CloudFormationCustomResourceFailedResponse<TData>;
/**
* Request properties that are common to all invocations of a Lambda-backed CloudFormation Custom Resource
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html#crpg-ref-request-fields
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
*/
export interface CloudFormationCustomResourceEventCommon<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
> {
/**
* The service token, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region as the stack.
*/
ServiceToken: string;
/**
* The response URL identifies a presigned S3 bucket that receives responses from the custom resource provider to AWS CloudFormation.
*/
ResponseURL: string;
/**
* The Amazon Resource Name (ARN) that identifies the stack that contains the custom resource.
* Combining the `StackId` with the `RequestId` forms a value that you can use to uniquely identify a request on a particular custom resource.
*/
StackId: string;
/**
* A unique ID for the request.
* Combining the `StackId` with the `RequestId` forms a value that you can use to uniquely identify a request on a particular custom resource.
*/
RequestId: string;
/**
* The template developer-chosen name (logical ID) of the custom resource in the AWS CloudFormation template. This is provided to facilitate communication between the custom resource provider and the template developer.
*/
LogicalResourceId: string;
/**
* The template developer-chosen resource type of the custom resource in the CloudFormation template. Custom resource type names can be up to 60 characters long and can include alphanumeric and the following characters: `_@-`.
*/
ResourceType: string;
/**
* This field contains the contents of the `Properties` object sent by the template developer. Its contents are defined by the custom resource provider.
*/
ResourceProperties: TResourceProperties & CloudFormationCustomResourceResourcePropertiesCommon;
}
/**
* Request properties specifically for the `Create` invocation of a Lambda-backed CloudFormation Custom Resource
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
*/
export interface CloudFormationCustomResourceCreateEvent<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
> extends CloudFormationCustomResourceEventCommon<TResourceProperties> {
/**
* The request type is set by the CloudFormation stack operation (create-stack, update-stack, or delete-stack) that was initiated by the template developer for the stack that contains the custom resource.
*/
RequestType: "Create";
}
/**
* Request properties specifically for the `Update` invocation of a Lambda-backed CloudFormation Custom Resource
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
*/
export interface CloudFormationCustomResourceUpdateEvent<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
TOldResourceProperties = TResourceProperties,
> extends CloudFormationCustomResourceEventCommon<TResourceProperties> {
/**
* The request type is set by the CloudFormation stack operation (create-stack, update-stack, or delete-stack) that was initiated by the template developer for the stack that contains the custom resource.
*/
RequestType: "Update";
/**
* A required custom resource provider-defined physical ID that is unique for that provider.
* The value returned for a `PhysicalResourceId` can change custom resource update operations. If the value returned is the same, it is considered a normal update. If the value returned is different, AWS CloudFormation recognizes the update as a replacement and sends a delete request to the old resource.
*/
PhysicalResourceId: string;
/**
* Used only for `Update` requests. Contains the resource properties that were declared previous to the update request.
*/
OldResourceProperties: TOldResourceProperties;
}
/**
* Request properties specifically for the `Delete` invocation of a Lambda-backed CloudFormation Custom Resource
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
*/
export interface CloudFormationCustomResourceDeleteEvent<
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
> extends CloudFormationCustomResourceEventCommon<TResourceProperties> {
/**
* The request type is set by the CloudFormation stack operation (create-stack, update-stack, or delete-stack) that was initiated by the template developer for the stack that contains the custom resource.
*/
RequestType: "Delete";
/**
* A required custom resource provider-defined physical ID that is unique for that provider.
* The value returned for a `PhysicalResourceId` can change custom resource update operations. If the value returned is the same, it is considered a normal update. If the value returned is different, AWS CloudFormation recognizes the update as a replacement and sends a delete request to the old resource.
*/
PhysicalResourceId: string;
}
/**
* Response properties that are common to all invocations of a Lambda-backed CloudFormation Custom Resource
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
* @template TData User-defined output properties that are retuned from any invocation
*/
export interface CloudFormationCustomResourceResponseCommon<TData extends Record<string, any> = Record<string, any>> {
/**
* This value should be an identifier unique to the custom resource vendor, and can be up to 1 KB in size. The value must be a non-empty string and must be identical for all responses for the same resource.
* The value returned for a `PhysicalResourceId` can change custom resource update operations. If the value returned is the same, it is considered a normal update. If the value returned is different, AWS CloudFormation recognizes the update as a replacement and sends a delete request to the old resource.
*/
PhysicalResourceId: string;
/**
* The Amazon Resource Name (ARN) that identifies the stack that contains the custom resource. This response value should be copied verbatim from the request.
*/
StackId: string;
/**
* A unique ID for the request. This response value should be copied verbatim from the request.
*/
RequestId: string;
/**
* The template developer-chosen name (logical ID) of the custom resource in the AWS CloudFormation template. This response value should be copied verbatim from the request.
*/
LogicalResourceId: string;
/**
* The custom resource provider-defined name-value pairs to send with the response. You can access the values provided here by name in the template with `Fn::GetAtt`.
* NOTE: If the name-value pairs contain sensitive information, you should use the `NoEcho` field to mask the output of the custom resource. Otherwise, the values are visible through APIs that surface property values (such as `DescribeStackEvents`).
*/
Data?: TData | undefined;
/**
* Indicates whether to mask the output of the custom resource when retrieved by using the `Fn::GetAtt` function. If set to `true`, all returned values are masked with asterisks (*****), __except for those stored in the `Metadata` section of the template__. AWS CloudFormation does not transform, modify, or redact any information you include in the `Metadata` section. The default value is `false`.
*/
NoEcho?: boolean | undefined;
}
/**
* Response properties that are specifically for a response indicating succesful invocation of a Lambda-backed CloudFormation Custom Resource
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
* @template TData User-defined output properties that are retuned from any invocation
*/
export interface CloudFormationCustomResourceSuccessResponse<TData extends Record<string, any> = Record<string, any>>
extends CloudFormationCustomResourceResponseCommon<TData>
{
/**
* The status value sent by the custom resource provider in response to an AWS CloudFormation-generated request.
*/
Status: "SUCCESS";
/**
* Describes the reason for a failure response.
*/
Reason?: string | undefined;
}
/**
* Response properties that are specifically for a response indicating failed invocation of a Lambda-backed CloudFormation Custom Resource
* Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
* @template TData User-defined output properties that are retuned from any invocation
*/
export interface CloudFormationCustomResourceFailedResponse<TData extends Record<string, any> = Record<string, any>>
extends CloudFormationCustomResourceResponseCommon<TData>
{
/**
* The status value sent by the custom resource provider in response to an AWS CloudFormation-generated request.
*/
Status: "FAILED";
/**
* Describes the reason for a failure response.
*/
Reason: string;
}

View file

@ -0,0 +1,22 @@
import type { CloudFrontEvent, CloudFrontRequest, CloudFrontResultResponse } from "../common/cloudfront";
import type { Callback, Handler } from "../handler";
export type CloudFrontRequestHandler = Handler<CloudFrontRequestEvent, CloudFrontRequestResult>;
export type CloudFrontRequestCallback = Callback<CloudFrontRequestResult>;
export interface CloudFrontRequestEventRecord {
cf: CloudFrontEvent & {
request: CloudFrontRequest;
};
}
/**
* CloudFront viewer request or origin request event
*
* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-request
*/
export interface CloudFrontRequestEvent {
Records: CloudFrontRequestEventRecord[];
}
export type CloudFrontRequestResult = undefined | null | CloudFrontResultResponse | CloudFrontRequest;

View file

@ -0,0 +1,21 @@
import { CloudFrontEvent, CloudFrontRequest, CloudFrontResponse, CloudFrontResultResponse } from "../common/cloudfront";
import { Callback, Handler } from "../handler";
export type CloudFrontResponseHandler = Handler<CloudFrontResponseEvent, CloudFrontResponseResult>;
export type CloudFrontResponseCallback = Callback<CloudFrontResponseResult>;
/**
* CloudFront viewer response or origin response event
*
* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response
*/
export interface CloudFrontResponseEvent {
Records: Array<{
cf: CloudFrontEvent & {
readonly request: Pick<CloudFrontRequest, Exclude<keyof CloudFrontRequest, "body">>;
response: CloudFrontResponse;
};
}>;
}
export type CloudFrontResponseResult = undefined | null | CloudFrontResultResponse;

View file

@ -0,0 +1,69 @@
import { Handler } from "../handler";
export type CloudWatchAlarmHandler = Handler<CloudWatchAlarmEvent, void>;
export interface CloudWatchAlarmEvent {
source: string;
alarmArn: string;
accountId: string;
time: string;
region: string;
alarmData: CloudWatchAlarmData;
}
export interface CloudWatchAlarmState {
value: string;
reason: string;
timestamp: string;
reasonData?: string;
actionsSuppressedBy?: string;
actionsSuppressedReason?: string;
}
export interface CloudWatchMetric {
namespace: string;
name: string;
dimensions?: Record<string, string>;
}
export interface CloudWatchMetricStat {
metric: CloudWatchMetric;
period: number;
stat: string;
unit?: string;
}
export interface CloudWatchAlarmMetric {
id: string;
metricStat: CloudWatchMetricStat;
returnData: boolean;
}
export interface CloudWatchAlarmExpression {
id: string;
expression: string;
label: string;
returnData: boolean;
}
export type CloudWatchAlarmMetricDataQuery = CloudWatchAlarmMetric | CloudWatchAlarmExpression;
export interface CloudWatchAlarmConfiguration {
metrics: CloudWatchAlarmMetricDataQuery[];
description?: string;
}
export interface CloudWatchAlarmCompositeConfiguration {
alarmRule: string;
description?: string;
actionsSuppressor?: string;
actionsSuppressorWaitPeriod?: number;
actionsSuppressorExtensionPeriod?: number;
}
export interface CloudWatchAlarmData {
alarmName: string;
state: CloudWatchAlarmState;
previousState: CloudWatchAlarmState;
configuration: CloudWatchAlarmConfiguration | CloudWatchAlarmCompositeConfiguration;
}

View file

@ -0,0 +1,8 @@
import { EventBridgeEvent, EventBridgeHandler } from "../trigger/eventbridge";
export type ScheduledHandler<TDetail = any> = EventBridgeHandler<"Scheduled Event", TDetail, void>;
/**
* https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
*/
export interface ScheduledEvent<TDetail = any> extends EventBridgeEvent<"Scheduled Event", TDetail> {}

View file

@ -0,0 +1,37 @@
import { Handler } from "../handler";
export type CloudWatchLogsHandler = Handler<CloudWatchLogsEvent, void>;
/**
* See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs
*/
export interface CloudWatchLogsEvent {
awslogs: CloudWatchLogsEventData;
}
export interface CloudWatchLogsEventData {
data: string;
}
export interface CloudWatchLogsDecodedData {
owner: string;
logGroup: string;
logStream: string;
subscriptionFilters: string[];
messageType: string;
logEvents: CloudWatchLogsLogEvent[];
}
export interface CloudWatchLogsLogEventExtractedFields {
[name: string]: string | undefined;
}
/**
* See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample
*/
export interface CloudWatchLogsLogEvent {
id: string;
timestamp: number;
message: string;
extractedFields?: CloudWatchLogsLogEventExtractedFields | undefined;
}

View file

@ -0,0 +1,104 @@
import { EventBridgeEvent, EventBridgeHandler } from "./eventbridge";
export type CodeBuildCloudWatchStateHandler = EventBridgeHandler<
"CodeBuild Build State Change",
CodeBuildStateEventDetail,
void
>;
export type CodeBuildStateType = "IN_PROGRESS" | "SUCCEEDED" | "FAILED" | "STOPPED";
export type CodeBuildPhaseType =
| "COMPLETED"
| "FINALIZING"
| "UPLOAD_ARTIFACTS"
| "POST_BUILD"
| "BUILD"
| "PRE_BUILD"
| "INSTALL"
| "QUEUED"
| "DOWNLOAD_SOURCE"
| "PROVISIONING"
| "SUBMITTED";
export type CodeBuildPhaseStatusType = "TIMED_OUT" | "STOPPED" | "FAILED" | "SUCCEEDED" | "FAULT" | "CLIENT_ERROR";
export type CodeBuildCacheType = "NO_CACHE" | "LOCAL" | "S3";
export type CodeBuildSourceLocationType =
| "CODECOMMIT"
| "CODEPIPELINE"
| "GITHUB"
| "GITHUB_ENTERPRISE"
| "BITBUCKET"
| "S3"
| "NO_SOURCE";
export type CodeBuildEnvironmentType =
| "LINUX_CONTAINER"
| "LINUX_GPU_CONTAINER"
| "WINDOWS_CONTAINER"
| "ARM_CONTAINER";
export type CodeBuildEnvironmentPullCredentialsType = "CODEBUILD" | "SERVICE_ROLE";
export type CodeBuildEnvironmentComputeType =
| "BUILD_GENERAL1_SMALL"
| "BUILD_GENERAL1_MEDIUM"
| "BUILD_GENERAL1_LARGE"
| "BUILD_GENERAL1_2XLARGE";
export type CodeBuildEnvironmentVariableType = "PARAMETER_STORE" | "PLAINTEXT" | "SECRETS_MANAGER";
export interface CodeBuildStateEventDetail {
"build-status": CodeBuildStateType;
"project-name": string;
"build-id": string;
"current-phase": CodeBuildPhaseType;
"current-phase-context": string;
version: string;
"additional-information": {
cache: {
type: CodeBuildCacheType;
};
"build-number": number;
"timeout-in-minutes": number;
"build-complete": boolean;
initiator: string;
"build-start-time": string;
source: {
buildspec: string;
location: string;
type: CodeBuildSourceLocationType;
};
"source-version": string;
artifact: {
location: string;
};
environment: {
image: string;
"privileged-mode": boolean;
"image-pull-credentials-type"?: CodeBuildEnvironmentPullCredentialsType | undefined;
"compute-type": CodeBuildEnvironmentComputeType;
type: CodeBuildEnvironmentType;
"environment-variables": Array<{
name: string;
type?: CodeBuildEnvironmentVariableType | undefined;
value: string;
}>;
};
"project-file-system-locations": [];
logs: {
"group-name": string;
"stream-name": string;
"deep-link": string;
};
phases: Array<{
"phase-context"?: string[] | undefined; // Not available for COMPLETED phase-type
"start-time": string;
"end-time"?: string | undefined; // Not available for COMPLETED phase-type
"duration-in-seconds"?: number | undefined; // Not available for COMPLETED phase-type
"phase-type": CodeBuildPhaseType;
"phase-status"?: CodeBuildPhaseStatusType | undefined; // Not available for COMPLETED phase-type
}>;
"queued-timeout-in-minutes": number;
};
}
export interface CodeBuildCloudWatchStateEvent
extends EventBridgeEvent<"CodeBuild Build State Change", CodeBuildStateEventDetail>
{
source: "aws.codebuild";
}

35
node_modules/@types/aws-lambda/trigger/codecommit.d.ts generated vendored Normal file
View file

@ -0,0 +1,35 @@
import { Handler } from "../handler";
export type CodeCommitHandler = Handler<CodeCommitTrigger, void>;
/**
* CodeCommit events
* https://docs.aws.amazon.com/lambda/latest/dg/services-codecommit.html
*/
export interface CodeCommitTrigger {
awsRegion: string;
codecommit: {
references: Array<{
commit: string;
created?: boolean;
deleted?: boolean;
ref: string;
}>;
};
customData?: string;
eventId: string;
eventName: string;
eventPartNumber: number;
eventSource: string;
eventSourceARN: string;
eventTime: string;
eventTotalParts: number;
eventTriggerConfigId: string;
eventTriggerName: string;
eventVersion: string;
userIdentityARN: string;
}
export interface CodeCommitTriggerEvent {
Records: CodeCommitTrigger[];
}

View file

@ -0,0 +1,31 @@
import { Handler } from "../handler";
export type CodePipelineCloudWatchActionHandler = Handler<CodePipelineCloudWatchActionEvent, void>;
export type CodePipelineActionCategory = "Approval" | "Build" | "Deploy" | "Invoke" | "Source" | "Test";
export type CodePipelineActionState = "STARTED" | "SUCCEEDED" | "FAILED" | "CANCELED";
export interface CodePipelineCloudWatchActionEvent {
version: string;
id: string;
"detail-type": "CodePipeline Action Execution State Change";
source: "aws.codepipeline";
account: string;
time: string;
region: string;
resources: string[];
detail: {
pipeline: string;
version: number;
"execution-id": string;
stage: string;
action: string;
state: CodePipelineActionState;
type: {
owner: "AWS" | "Custom" | "ThirdParty";
category: CodePipelineActionCategory;
provider: string;
version: number;
};
};
}

View file

@ -0,0 +1,32 @@
import { Handler } from "../handler";
export type CodePipelineCloudWatchPipelineHandler = Handler<CodePipelineCloudWatchPipelineEvent, void>;
export type CodePipelineState = "STARTED" | "SUCCEEDED" | "RESUMED" | "FAILED" | "CANCELED" | "SUPERSEDED";
/**
* CodePipeline CloudWatch Events
* https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html
*
* The above CodePipelineEvent is when a lambda is invoked by a CodePipeline.
* These events are when you subscribe to CodePipeline events in CloudWatch.
*
* Their documentation says that detail.version is a string, but it is actually an integer
*/
export interface CodePipelineCloudWatchPipelineEvent {
version: string;
id: string;
"detail-type": "CodePipeline Pipeline Execution State Change";
source: "aws.codepipeline";
account: string;
time: string;
region: string;
resources: string[];
detail: {
pipeline: string;
version: number;
state: CodePipelineState;
"execution-id": string;
};
}

View file

@ -0,0 +1,23 @@
import { Handler } from "../handler";
export type CodePipelineCloudWatchStageHandler = Handler<CodePipelineCloudWatchStageEvent, void>;
export type CodePipelineStageState = "STARTED" | "SUCCEEDED" | "RESUMED" | "FAILED" | "CANCELED";
export interface CodePipelineCloudWatchStageEvent {
version: string;
id: string;
"detail-type": "CodePipeline Stage Execution State Change";
source: "aws.codepipeline";
account: string;
time: string;
region: string;
resources: string[];
detail: {
pipeline: string;
version: number;
"execution-id": string;
stage: string;
state: CodePipelineStageState;
};
}

View file

@ -0,0 +1,11 @@
import { Handler } from "../handler";
import { CodePipelineCloudWatchActionEvent } from "./codepipeline-cloudwatch-action";
import { CodePipelineCloudWatchPipelineEvent } from "./codepipeline-cloudwatch-pipeline";
import { CodePipelineCloudWatchStageEvent } from "./codepipeline-cloudwatch-stage";
export type CodePipelineCloudWatchHandler = Handler<CodePipelineCloudWatchEvent, void>;
export type CodePipelineCloudWatchEvent =
| CodePipelineCloudWatchPipelineEvent
| CodePipelineCloudWatchStageEvent
| CodePipelineCloudWatchActionEvent;

View file

@ -0,0 +1,55 @@
import { Handler } from "../handler";
export type CodePipelineHandler = Handler<CodePipelineEvent, void>;
/**
* CodePipeline events
* https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html
*/
export interface S3ArtifactLocation {
bucketName: string;
objectKey: string;
}
export interface S3ArtifactStore {
type: "S3";
s3Location: S3ArtifactLocation;
}
export type ArtifactLocation = S3ArtifactStore;
export interface Artifact {
name: string;
revision: string | null;
location: ArtifactLocation;
}
export interface Credentials {
accessKeyId: string;
secretAccessKey: string;
sessionToken?: string | undefined;
}
export interface EncryptionKey {
type: string;
id: string;
}
export interface CodePipelineEvent {
"CodePipeline.job": {
id: string;
accountId: string;
data: {
actionConfiguration: {
configuration: {
FunctionName: string;
UserParameters: string;
};
};
inputArtifacts: Artifact[];
outputArtifacts: Artifact[];
artifactCredentials: Credentials;
encryptionKey?: (EncryptionKey & { type: "KMS" }) | undefined;
continuationToken?: string | undefined;
};
};
}

View file

@ -0,0 +1,41 @@
export interface StringMap {
[name: string]: string;
}
export type ChallengeName =
| "PASSWORD_VERIFIER"
| "SMS_MFA"
| "DEVICE_SRP_AUTH"
| "DEVICE_PASSWORD_VERIFIER"
| "ADMIN_NO_SRP_AUTH"
| "SRP_A";
export interface ChallengeResult {
challengeName: ChallengeName;
challengeResult: boolean;
challengeMetadata?: undefined;
}
export interface CustomChallengeResult {
challengeName: "CUSTOM_CHALLENGE";
challengeResult: boolean;
challengeMetadata?: string | undefined;
}
/**
* Common attributes shared by all User Pool Lambda Trigger Events
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#cognito-user-pools-lambda-trigger-event-parameter-shared
*/
export interface BaseTriggerEvent<T extends string> {
version: string;
region: string;
userPoolId: string;
triggerSource: T;
userName: string;
callerContext: {
awsSdkVersion: string;
clientId: string;
};
request: {};
response: {};
}

View file

@ -0,0 +1,22 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, ChallengeResult, CustomChallengeResult, StringMap } from "./_common";
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-create-auth-challenge.html
*/
export interface CreateAuthChallengeTriggerEvent extends BaseTriggerEvent<"CreateAuthChallenge_Authentication"> {
request: {
userAttributes: StringMap;
challengeName: string;
session: Array<ChallengeResult | CustomChallengeResult>;
userNotFound?: boolean | undefined;
clientMetadata?: StringMap | undefined;
};
response: {
publicChallengeParameters: StringMap;
privateChallengeParameters: StringMap;
challengeMetadata: string;
};
}
export type CreateAuthChallengeTriggerHandler = Handler<CreateAuthChallengeTriggerEvent>;

View file

@ -0,0 +1,76 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface BaseCustomEmailSenderTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
type: string;
code: string | null;
userAttributes: StringMap;
clientMetadata?: StringMap | undefined;
};
}
export type AccountTakeOverActionType = "BLOCK" | "NO_ACTION" | "MFA" | "MFA_IF_CONFIGURED" | "MFA_REQUIRED";
export interface CustomEmailSender_AccountTakeOverNotification_UserAttributes {
EVENT_ID: string;
USER_NAME: string;
IP_ADDRESS: string;
ACCOUNT_TAKE_OVER_ACTION: AccountTakeOverActionType;
ONE_CLICK_LINK_VALID: string;
ONE_CLICK_LINK_INVALID: string;
LOGIN_TIME: string;
FEEDBACK_TOKEN: string;
CITY?: string | undefined;
COUNTRY?: string | undefined;
DEVICE_NAME?: string | undefined;
}
export interface CustomEmailSenderSignUpTriggerEvent
extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_SignUp">
{}
export interface CustomEmailSenderResendCodeTriggerEvent
extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_ResendCode">
{}
export interface CustomEmailSenderForgotPasswordTriggerEvent
extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_ForgotPassword">
{}
export interface CustomEmailSenderUpdateUserAttributeTriggerEvent
extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_UpdateUserAttribute">
{}
export interface CustomEmailSenderVerifyUserAttributeTriggerEvent
extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_VerifyUserAttribute">
{}
export interface CustomEmailSenderAdminCreateUserTriggerEvent
extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_AdminCreateUser">
{}
export interface CustomEmailSenderAccountTakeOverNotificationTriggerEvent
extends BaseTriggerEvent<"CustomEmailSender_AccountTakeOverNotification">
{
request: {
type: string;
code: string | null;
userAttributes: CustomEmailSender_AccountTakeOverNotification_UserAttributes;
clientMetadata?: StringMap | undefined;
};
}
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html
*/
export type CustomEmailSenderTriggerEvent =
| CustomEmailSenderSignUpTriggerEvent
| CustomEmailSenderResendCodeTriggerEvent
| CustomEmailSenderForgotPasswordTriggerEvent
| CustomEmailSenderUpdateUserAttributeTriggerEvent
| CustomEmailSenderVerifyUserAttributeTriggerEvent
| CustomEmailSenderAdminCreateUserTriggerEvent
| CustomEmailSenderAccountTakeOverNotificationTriggerEvent;
export type CustomEmailSenderTriggerHandler = Handler<CustomEmailSenderTriggerEvent>;

View file

@ -0,0 +1,52 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface BaseCustomMessageTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
userAttributes: StringMap;
codeParameter: string;
linkParameter: string;
/**
* This is null for all events other than the AdminCreateUser action.
*/
usernameParameter: string | null;
clientMetadata?: StringMap | undefined;
};
response: {
smsMessage: string | null;
emailMessage: string | null;
emailSubject: string | null;
};
}
export type CustomMessageAdminCreateUserTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_AdminCreateUser">;
export type CustomMessageAuthenticationTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_Authentication">;
export type CustomMessageForgotPasswordTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_ForgotPassword">;
export type CustomMessageResendCodeTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_ResendCode">;
export type CustomMessageSignUpTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_SignUp">;
export type CustomMessageUpdateUserAttributeTriggerEvent = BaseCustomMessageTriggerEvent<
"CustomMessage_UpdateUserAttribute"
>;
export type CustomMessageVerifyUserAttributeTriggerEvent = BaseCustomMessageTriggerEvent<
"CustomMessage_VerifyUserAttribute"
>;
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-message.html
*/
export type CustomMessageTriggerEvent =
| CustomMessageSignUpTriggerEvent
| CustomMessageAdminCreateUserTriggerEvent
| CustomMessageResendCodeTriggerEvent
| CustomMessageForgotPasswordTriggerEvent
| CustomMessageUpdateUserAttributeTriggerEvent
| CustomMessageVerifyUserAttributeTriggerEvent
| CustomMessageAuthenticationTriggerEvent;
export type CustomMessageTriggerHandler = Handler<CustomMessageTriggerEvent>;

View file

@ -0,0 +1,51 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface BaseCustomSMSSenderTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
type: string;
code: string | null;
userAttributes: StringMap;
clientMetadata?: StringMap | undefined;
};
}
export interface CustomSMSSenderSignUpTriggerEvent extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_SignUp"> {}
export interface CustomSMSSenderResendCodeTriggerEvent
extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_ResendCode">
{}
export interface CustomSMSSenderForgotPasswordTriggerEvent
extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_ForgotPassword">
{}
export interface CustomSMSSenderUpdateUserAttributeTriggerEvent
extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_UpdateUserAttribute">
{}
export interface CustomSMSSenderVerifyUserAttributeTriggerEvent
extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_VerifyUserAttribute">
{}
export interface CustomSMSSenderAdminCreateUserTriggerEvent
extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_AdminCreateUser">
{}
export interface CustomSMSSenderAuthenticationUserTriggerEvent
extends BaseCustomSMSSenderTriggerEvent<"CustomSMSSender_Authentication">
{}
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html
*/
export type CustomSMSSenderTriggerEvent =
| CustomSMSSenderSignUpTriggerEvent
| CustomSMSSenderResendCodeTriggerEvent
| CustomSMSSenderForgotPasswordTriggerEvent
| CustomSMSSenderUpdateUserAttributeTriggerEvent
| CustomSMSSenderVerifyUserAttributeTriggerEvent
| CustomSMSSenderAdminCreateUserTriggerEvent
| CustomSMSSenderAuthenticationUserTriggerEvent;
export type CustomSMSSenderTriggerHandler = Handler<CustomSMSSenderTriggerEvent>;

View file

@ -0,0 +1,21 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, ChallengeResult, CustomChallengeResult, StringMap } from "./_common";
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-define-auth-challenge.html
*/
export interface DefineAuthChallengeTriggerEvent extends BaseTriggerEvent<"DefineAuthChallenge_Authentication"> {
request: {
userAttributes: StringMap;
session: Array<ChallengeResult | CustomChallengeResult>;
userNotFound?: boolean | undefined;
clientMetadata?: StringMap | undefined;
};
response: {
challengeName?: string | undefined;
failAuthentication: boolean;
issueTokens: boolean;
};
}
export type DefineAuthChallengeTriggerHandler = Handler<DefineAuthChallengeTriggerEvent>;

View file

@ -0,0 +1,128 @@
import { Handler } from "../../handler";
/**
* Cognito User Pool event
* @deprecated Please use specific event types instead
* http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html
*/
export interface CognitoUserPoolTriggerEvent {
version: number;
triggerSource:
| "PreSignUp_SignUp"
| "PreSignUp_ExternalProvider"
| "PostConfirmation_ConfirmSignUp"
| "PreAuthentication_Authentication"
| "PostAuthentication_Authentication"
| "CustomMessage_SignUp"
| "CustomMessage_AdminCreateUser"
| "CustomMessage_ResendCode"
| "CustomMessage_ForgotPassword"
| "CustomMessage_UpdateUserAttribute"
| "CustomMessage_VerifyUserAttribute"
| "CustomMessage_Authentication"
| "DefineAuthChallenge_Authentication"
| "CreateAuthChallenge_Authentication"
| "VerifyAuthChallengeResponse_Authentication"
| "PreSignUp_AdminCreateUser"
| "PostConfirmation_ConfirmForgotPassword"
| "TokenGeneration_HostedAuth"
| "TokenGeneration_Authentication"
| "TokenGeneration_NewPasswordChallenge"
| "TokenGeneration_AuthenticateDevice"
| "TokenGeneration_RefreshTokens"
| "UserMigration_Authentication"
| "UserMigration_ForgotPassword";
region: string;
userPoolId: string;
userName?: string | undefined;
callerContext: {
awsSdkVersion: string;
clientId: string;
};
request: {
userAttributes: { [key: string]: string };
validationData?: { [key: string]: string } | undefined;
codeParameter?: string | undefined;
linkParameter?: string | undefined;
usernameParameter?: string | undefined;
newDeviceUsed?: boolean | undefined;
session?:
| Array<{
challengeName:
| "CUSTOM_CHALLENGE"
| "PASSWORD_VERIFIER"
| "SMS_MFA"
| "DEVICE_SRP_AUTH"
| "DEVICE_PASSWORD_VERIFIER"
| "ADMIN_NO_SRP_AUTH"
| "SRP_A";
challengeResult: boolean;
challengeMetadata?: string | undefined;
}>
| undefined;
challengeName?: string | undefined;
privateChallengeParameters?: { [key: string]: string } | undefined;
challengeAnswer?: string | undefined;
password?: string | undefined;
clientMetadata?: { [key: string]: string } | undefined;
userNotFound?: boolean | undefined;
};
response: {
autoConfirmUser?: boolean | undefined;
autoVerifyPhone?: boolean | undefined;
autoVerifyEmail?: boolean | undefined;
smsMessage?: string | undefined;
emailMessage?: string | undefined;
emailSubject?: string | undefined;
challengeName?: string | undefined;
issueTokens?: boolean | undefined;
failAuthentication?: boolean | undefined;
publicChallengeParameters?: { [key: string]: string } | undefined;
privateChallengeParameters?: { [key: string]: string } | undefined;
challengeMetadata?: string | undefined;
answerCorrect?: boolean | undefined;
userAttributes?: { [key: string]: string } | undefined;
finalUserStatus?: "CONFIRMED" | "RESET_REQUIRED" | undefined;
messageAction?: "SUPPRESS" | undefined;
desiredDeliveryMediums?: Array<"EMAIL" | "SMS"> | undefined;
forceAliasCreation?: boolean | undefined;
claimsOverrideDetails?:
| {
claimsToAddOrOverride?: { [key: string]: string } | undefined;
claimsToSuppress?: string[] | undefined;
groupOverrideDetails?:
| null
| {
groupsToOverride?: string[] | undefined;
iamRolesToOverride?: string[] | undefined;
preferredRole?: string | undefined;
}
| undefined;
}
| undefined;
};
}
/**
* @deprecated Please use specific event types instead
*/
export type CognitoUserPoolEvent = CognitoUserPoolTriggerEvent;
/**
* @deprecated Please use specific event handler types instead
*/
export type CognitoUserPoolTriggerHandler = Handler<CognitoUserPoolTriggerEvent>;
export * from "./create-auth-challenge";
export * from "./custom-email-sender";
export * from "./custom-message";
export * from "./custom-sms-sender";
export * from "./define-auth-challenge";
export * from "./post-authentication";
export * from "./post-confirmation";
export * from "./pre-authentication";
export * from "./pre-signup";
export * from "./pre-token-generation";
export * from "./pre-token-generation-v2";
export * from "./user-migration";
export * from "./verify-auth-challenge-response";

View file

@ -0,0 +1,15 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-authentication.html
*/
export interface PostAuthenticationTriggerEvent extends BaseTriggerEvent<"PostAuthentication_Authentication"> {
request: {
userAttributes: StringMap;
newDeviceUsed: boolean;
clientMetadata?: StringMap | undefined;
};
}
export type PostAuthenticationTriggerHandler = Handler<PostAuthenticationTriggerEvent>;

View file

@ -0,0 +1,26 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface BasePostConfirmationTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
userAttributes: StringMap;
clientMetadata?: StringMap | undefined;
};
}
export type PostConfirmationConfirmSignUpTriggerEvent = BasePostConfirmationTriggerEvent<
"PostConfirmation_ConfirmSignUp"
>;
export type PostConfirmationConfirmForgotPassword = BasePostConfirmationTriggerEvent<
"PostConfirmation_ConfirmForgotPassword"
>;
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html
*/
export type PostConfirmationTriggerEvent =
| PostConfirmationConfirmSignUpTriggerEvent
| PostConfirmationConfirmForgotPassword;
export type PostConfirmationTriggerHandler = Handler<PostConfirmationTriggerEvent>;

View file

@ -0,0 +1,16 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html
*/
export interface PreAuthenticationTriggerEvent extends BaseTriggerEvent<"PreAuthentication_Authentication"> {
request: {
userAttributes: StringMap;
userNotFound?: boolean | undefined;
validationData?: StringMap | undefined;
clientMetadata?: StringMap | undefined;
};
}
export type PreAuthenticationTriggerHandler = Handler<PreAuthenticationTriggerEvent>;

View file

@ -0,0 +1,31 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface BasePreSignUpTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
userAttributes: StringMap;
validationData?: StringMap | undefined;
clientMetadata?: StringMap | undefined;
};
response: {
autoConfirmUser: boolean;
autoVerifyEmail: boolean;
autoVerifyPhone: boolean;
};
}
export type PreSignUpEmailTriggerEvent = BasePreSignUpTriggerEvent<"PreSignUp_SignUp">;
export type PreSignUpExternalProviderTriggerEvent = BasePreSignUpTriggerEvent<"PreSignUp_ExternalProvider">;
export type PreSignUpAdminCreateUserTriggerEvent = BasePreSignUpTriggerEvent<"PreSignUp_AdminCreateUser">;
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
*/
export type PreSignUpTriggerEvent =
| PreSignUpEmailTriggerEvent
| PreSignUpExternalProviderTriggerEvent
| PreSignUpAdminCreateUserTriggerEvent;
export type PreSignUpTriggerHandler = Handler<PreSignUpTriggerEvent>;

View file

@ -0,0 +1,73 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface GroupOverrideDetailsV2 {
groupsToOverride?: string[] | undefined;
iamRolesToOverride?: string[] | undefined;
preferredRole?: string | undefined;
}
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html#cognito-user-pools-lambda-trigger-syntax-pre-token-generation
*/
export interface IdTokenGeneration {
claimsToAddOrOverride?: StringMap | undefined;
claimsToSuppress?: string[] | undefined;
}
export interface AccessTokenGeneration {
claimsToAddOrOverride?: StringMap | undefined;
claimsToSuppress?: string[] | undefined;
scopesToAdd?: string[] | undefined;
scopesToSuppress?: string[] | undefined;
}
export interface ClaimsAndScopeOverrideDetails {
idTokenGeneration?: IdTokenGeneration | undefined;
accessTokenGeneration?: AccessTokenGeneration | undefined;
groupOverrideDetails?: GroupOverrideDetailsV2 | undefined;
}
export interface BasePreTokenGenerationV2TriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
userAttributes: StringMap;
groupConfiguration: GroupOverrideDetailsV2;
scopes?: string[] | undefined;
clientMetadata?: StringMap | undefined;
};
response: {
claimsAndScopeOverrideDetails: ClaimsAndScopeOverrideDetails;
};
}
export type PreTokenGenerationHostedAuthV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
"TokenGeneration_HostedAuth"
>;
export type PreTokenGenerationAuthenticationV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
"TokenGeneration_Authentication"
>;
export type PreTokenGenerationNewPasswordChallengeV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
"TokenGeneration_NewPasswordChallenge"
>;
export type PreTokenGenerationAuthenticateDeviceV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
"TokenGeneration_AuthenticateDevice"
>;
export type PreTokenGenerationRefreshTokensV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
"TokenGeneration_RefreshTokens"
>;
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html
*/
export type PreTokenGenerationV2TriggerEvent =
| PreTokenGenerationHostedAuthV2TriggerEvent
| PreTokenGenerationAuthenticationV2TriggerEvent
| PreTokenGenerationNewPasswordChallengeV2TriggerEvent
| PreTokenGenerationAuthenticateDeviceV2TriggerEvent
| PreTokenGenerationRefreshTokensV2TriggerEvent;
export type PreTokenGenerationV2TriggerHandler = Handler<PreTokenGenerationV2TriggerEvent>;

View file

@ -0,0 +1,53 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export interface GroupOverrideDetails {
groupsToOverride?: string[] | undefined;
iamRolesToOverride?: string[] | undefined;
preferredRole?: string | undefined;
}
export interface BasePreTokenGenerationTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
userAttributes: StringMap;
groupConfiguration: GroupOverrideDetails;
clientMetadata?: StringMap | undefined;
};
response: {
claimsOverrideDetails: {
claimsToAddOrOverride?: StringMap | undefined;
claimsToSuppress?: string[] | undefined;
groupOverrideDetails?: GroupOverrideDetails | undefined;
};
};
}
export type PreTokenGenerationHostedAuthTriggerEvent = BasePreTokenGenerationTriggerEvent<"TokenGeneration_HostedAuth">;
export type PreTokenGenerationAuthenticationTriggerEvent = BasePreTokenGenerationTriggerEvent<
"TokenGeneration_Authentication"
>;
export type PreTokenGenerationNewPasswordChallengeTriggerEvent = BasePreTokenGenerationTriggerEvent<
"TokenGeneration_NewPasswordChallenge"
>;
export type PreTokenGenerationAuthenticateDeviceTriggerEvent = BasePreTokenGenerationTriggerEvent<
"TokenGeneration_AuthenticateDevice"
>;
export type PreTokenGenerationRefreshTokensTriggerEvent = BasePreTokenGenerationTriggerEvent<
"TokenGeneration_RefreshTokens"
>;
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html
*/
export type PreTokenGenerationTriggerEvent =
| PreTokenGenerationHostedAuthTriggerEvent
| PreTokenGenerationAuthenticationTriggerEvent
| PreTokenGenerationNewPasswordChallengeTriggerEvent
| PreTokenGenerationAuthenticateDeviceTriggerEvent
| PreTokenGenerationRefreshTokensTriggerEvent;
export type PreTokenGenerationTriggerHandler = Handler<PreTokenGenerationTriggerEvent>;

View file

@ -0,0 +1,40 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
export type UserStatus =
| "UNCONFIRMED"
| "CONFIRMED"
| "ARCHIVED"
| "COMPROMISED"
| "UNKNOWN"
| "RESET_REQUIRED"
| "FORCE_CHANGE_PASSWORD";
export interface BaseUserMigrationTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
request: {
password: string;
validationData?: StringMap | undefined;
clientMetadata?: StringMap | undefined;
};
response: {
userAttributes: StringMap;
finalUserStatus?: UserStatus | undefined;
messageAction?: "RESEND" | "SUPPRESS" | undefined;
desiredDeliveryMediums: Array<"SMS" | "EMAIL">;
forceAliasCreation?: boolean | undefined;
enableSMSMFA?: boolean | undefined;
};
}
export type UserMigrationAuthenticationTriggerEvent = BaseUserMigrationTriggerEvent<"UserMigration_Authentication">;
export type UserMigrationForgotPasswordTriggerEvent = BaseUserMigrationTriggerEvent<"UserMigration_ForgotPassword">;
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html
*/
export type UserMigrationTriggerEvent =
| UserMigrationAuthenticationTriggerEvent
| UserMigrationForgotPasswordTriggerEvent;
export type UserMigrationTriggerHandler = Handler<UserMigrationTriggerEvent>;

View file

@ -0,0 +1,22 @@
import { Handler } from "../../handler";
import { BaseTriggerEvent, StringMap } from "./_common";
/**
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-verify-auth-challenge-response.html
*/
export interface VerifyAuthChallengeResponseTriggerEvent
extends BaseTriggerEvent<"VerifyAuthChallengeResponse_Authentication">
{
request: {
userAttributes: StringMap;
privateChallengeParameters: StringMap;
challengeAnswer: string;
userNotFound?: boolean | undefined;
clientMetadata?: StringMap | undefined;
};
response: {
answerCorrect: boolean;
};
}
export type VerifyAuthChallengeResponseTriggerHandler = Handler<VerifyAuthChallengeResponseTriggerEvent>;

View file

@ -0,0 +1,64 @@
import { Callback, Handler } from "../handler";
export type ConnectContactFlowHandler = Handler<ConnectContactFlowEvent, ConnectContactFlowResult>;
export type ConnectContactFlowCallback = Callback<ConnectContactFlowResult>;
// Connect
// https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html
export interface ConnectContactFlowEvent {
Details: {
ContactData: {
Attributes: { [key: string]: string };
Channel: ConnectContactFlowChannel;
ContactId: string;
CustomerEndpoint: ConnectContactFlowEndpoint | null;
InitialContactId: string;
InitiationMethod: ConnectContactFlowInitiationMethod;
InstanceARN: string;
PreviousContactId: string;
Queue: ConnectContactFlowQueue | null;
SystemEndpoint: ConnectContactFlowEndpoint | null;
MediaStreams: {
Customer: {
Audio: CustomerAudio;
};
};
};
Parameters: { [key: string]: string };
};
Name: "ContactFlowEvent";
}
export type ConnectContactFlowChannel = "VOICE" | "CHAT";
export type ConnectContactFlowInitiationMethod = "INBOUND" | "OUTBOUND" | "TRANSFER" | "CALLBACK" | "API";
export interface ConnectContactFlowEndpoint {
Address: string;
Type: "TELEPHONE_NUMBER";
}
export interface ConnectContactFlowQueue {
ARN: string;
Name: string;
}
export interface ConnectContactFlowResult {
[key: string]: string | null;
}
export type CustomerAudio =
| null // If Media Streaming has never been started.
| StartedCustomerAudio // If Media Streaming has been started, but not stopped.
| (StartedCustomerAudio & StoppedCustomerAudio); // If Media Streaming has been started and stopped.
export interface StartedCustomerAudio {
StartFragmentNumber: string;
StartTimestamp: string;
StreamARN: string;
}
export interface StoppedCustomerAudio {
StopFragmentNumber: string;
StopTimestamp: string;
}

View file

@ -0,0 +1,55 @@
import { Handler } from "../handler";
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
export type DynamoDBStreamHandler = Handler<DynamoDBStreamEvent, DynamoDBBatchResponse | void>;
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html
export interface AttributeValue {
B?: string | undefined;
BS?: string[] | undefined;
BOOL?: boolean | undefined;
L?: AttributeValue[] | undefined;
M?: { [id: string]: AttributeValue } | undefined;
N?: string | undefined;
NS?: string[] | undefined;
NULL?: boolean | undefined;
S?: string | undefined;
SS?: string[] | undefined;
}
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html
export interface StreamRecord {
ApproximateCreationDateTime?: number | undefined;
Keys?: { [key: string]: AttributeValue } | undefined;
NewImage?: { [key: string]: AttributeValue } | undefined;
OldImage?: { [key: string]: AttributeValue } | undefined;
SequenceNumber?: string | undefined;
SizeBytes?: number | undefined;
StreamViewType?: "KEYS_ONLY" | "NEW_IMAGE" | "OLD_IMAGE" | "NEW_AND_OLD_IMAGES" | undefined;
}
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html
export interface DynamoDBRecord {
awsRegion?: string | undefined;
dynamodb?: StreamRecord | undefined;
eventID?: string | undefined;
eventName?: "INSERT" | "MODIFY" | "REMOVE" | undefined;
eventSource?: string | undefined;
eventSourceARN?: string | undefined;
eventVersion?: string | undefined;
userIdentity?: any;
}
// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ddb-update
export interface DynamoDBStreamEvent {
Records: DynamoDBRecord[];
}
// https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting
export interface DynamoDBBatchResponse {
batchItemFailures: DynamoDBBatchItemFailure[];
}
export interface DynamoDBBatchItemFailure {
itemIdentifier: string;
}

View file

@ -0,0 +1,19 @@
import { Handler } from "../handler";
export type EventBridgeHandler<TDetailType extends string, TDetail, TResult> = Handler<
EventBridgeEvent<TDetailType, TDetail>,
TResult
>;
export interface EventBridgeEvent<TDetailType extends string, TDetail> {
id: string;
version: string;
account: string;
time: string;
region: string;
resources: string[];
source: string;
"detail-type": TDetailType;
detail: TDetail;
"replay-name"?: string;
}

View file

@ -0,0 +1,36 @@
import { EventBridgeEvent } from "./eventbridge";
/**
* Guard Duty events
* https://docs.aws.amazon.com/guardduty/latest/ug/monitor-with-eventbridge-s3-malware-protection.html
*/
export interface GuardDutyScanResultNotificationEvent
extends
EventBridgeEvent<"GuardDuty Malware Protection Object Scan Result", GuardDutyScanResultNotificationEventDetail>
{
source: "aws.guardduty";
}
export interface GuardDutyScanResultNotificationEventDetail {
schemaVersion: "1.0";
scanStatus: "COMPLETED" | "SKIPPED" | "FAILED";
resourceType: "S3_OBJECT";
s3ObjectDetails: {
bucketName: string;
objectKey: string;
eTag: string;
versionId: string;
s3Throttled: boolean;
};
scanResultDetails: {
scanResultStatus: "NO_THREATS_FOUND" | "THREAT_FOUND" | "UNSUPPORTED" | "ACCESS_DENIED" | "FAILED";
threats: GuardDutyThreatDetail[] | null;
};
}
export interface GuardDutyThreatDetail {
name: string;
}
export type GuardDutyNotificationEvent = GuardDutyScanResultNotificationEvent;

View file

@ -0,0 +1,48 @@
import { Handler } from "../handler";
import { PolicyDocument } from "./api-gateway-authorizer";
export type IoTProtocolType = "http" | "mqtt" | "tls";
export type IoTCustomAuthorizerHandler = Handler<IoTCustomAuthorizerEvent, IoTCustomAuthorizerResult>;
export interface IoTProtocolDataTLS {
serverName: string; // The server name indication (SNI) host_name string.
}
export interface IoTProtocolDataHTTP {
headers: Record<string, string>;
queryString: string;
}
export interface IoTProtocolDataMQTT {
username?: string;
password?: string; // A base64-encoded string.
clientId: string; // Included in the event only when the device sends the value.
}
export interface IoTCustomAuthorizerEvent {
token?: string;
signatureVerified: boolean; // Indicates whether the device gateway has validated the signature.
protocols: IoTProtocolType[]; // Indicates which protocols to expect for the request.
protocolData: {
tls?: IoTProtocolDataTLS;
http?: IoTProtocolDataHTTP;
mqtt?: IoTProtocolDataMQTT;
};
connectionMetadata: {
id: string; // The connection ID. You can use this for logging.
};
}
/**
* IoT CustomAuthorizer AuthResponse.PolicyDocument.
* https://docs.aws.amazon.com/iot/latest/developerguide/config-custom-auth.html#custom-auth-lambda
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition
*/
export interface IoTCustomAuthorizerResult {
isAuthenticated: boolean; // A Boolean that determines whether client can connect.
principalId: string; // A string that identifies the connection in logs.
disconnectAfterInSeconds: number;
refreshAfterInSeconds: number;
policyDocuments: PolicyDocument[];
}

28
node_modules/@types/aws-lambda/trigger/iot.d.ts generated vendored Normal file
View file

@ -0,0 +1,28 @@
import { Handler } from "../handler";
export type IoTHandler = Handler<IoTEvent, void>;
// IoT
// https://docs.aws.amazon.com/lambda/latest/dg/services-iot.html
// IoT payload is not restriced to JSON, but JSON is highly recommended. Types as string, number or array are possible to use.
export type IoTEvent<T = never> = string | number | T;
// PreProvisioningHook
// https://docs.aws.amazon.com/iot/latest/developerguide/pre-provisioning-hook.html
// When using AWS IoT fleet provisioning, you can set up a Lambda function to validate parameters passed from the device before allowing the device to be provisioned.
export type IoTPreProvisioningHookHandler = Handler<IoTPreProvisioningHookEvent, IoTPreProvisioningHookResult>;
export interface IoTPreProvisioningHookEvent {
claimCertificateId: string;
certificateId: string;
certificatePem: string;
templateArn: string;
clientId: string;
parameters: Record<string, string>;
}
export interface IoTPreProvisioningHookResult {
allowProvisioning: boolean;
parameterOverrides: Record<string, string>;
}

View file

@ -0,0 +1,51 @@
import { Callback, Handler } from "../handler";
export type FirehoseTransformationHandler = Handler<FirehoseTransformationEvent, FirehoseTransformationResult>;
export type FirehoseTransformationCallback = Callback<FirehoseTransformationResult>;
// Kinesis Data Firehose Event
// https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-kinesis-firehose
// https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html
// https://aws.amazon.com/blogs/compute/amazon-kinesis-firehose-data-transformation-with-aws-lambda/
// Examples in the lambda blueprints
export interface FirehoseTransformationEvent {
invocationId: string;
deliveryStreamArn: string;
sourceKinesisStreamArn?: string | undefined;
region: string;
records: FirehoseTransformationEventRecord[];
}
export interface FirehoseTransformationEventRecord {
recordId: string;
approximateArrivalTimestamp: number;
/** Base64 encoded */
data: string;
kinesisRecordMetadata?: FirehoseRecordMetadata | undefined;
}
export interface FirehoseRecordMetadata {
shardId: string;
partitionKey: string;
approximateArrivalTimestamp: number;
sequenceNumber: string;
subsequenceNumber: string;
}
export type FirehoseRecordTransformationStatus = "Ok" | "Dropped" | "ProcessingFailed";
export interface FirehoseTransformationMetadata {
partitionKeys: { [name: string]: string };
}
export interface FirehoseTransformationResultRecord {
recordId: string;
result: FirehoseRecordTransformationStatus;
/** Encode in Base64 */
data?: string;
metadata?: FirehoseTransformationMetadata;
}
export interface FirehoseTransformationResult {
records: FirehoseTransformationResultRecord[];
}

View file

@ -0,0 +1,56 @@
import { Handler } from "../handler";
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
export type KinesisStreamHandler = Handler<KinesisStreamEvent, KinesisStreamBatchResponse | void>;
export type KinesisStreamTumblingWindowHandler = Handler<
KinesisStreamTumblingWindowEvent,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
KinesisStreamStateResponse | void
>;
// Kinesis Streams
// https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-kinesis-streams
export interface KinesisStreamRecordPayload {
approximateArrivalTimestamp: number;
data: string;
kinesisSchemaVersion: string;
partitionKey: string;
sequenceNumber: string;
}
export interface KinesisStreamRecord {
awsRegion: string;
eventID: string;
eventName: string;
eventSource: string;
eventSourceARN: string;
eventVersion: string;
invokeIdentityArn: string;
kinesis: KinesisStreamRecordPayload;
}
export interface KinesisStreamEvent {
Records: KinesisStreamRecord[];
}
// https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows
export interface KinesisStreamTumblingWindowEvent extends KinesisStreamEvent {
window: { start: string; end: string };
state?: { [key: string]: any };
isFinalInvokeForWindow: boolean;
isWindowTerminatedEarly: boolean;
}
export interface KinesisStreamStateResponse extends Partial<KinesisStreamBatchResponse> {
state: { [key: string]: any };
}
// https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-batchfailurereporting
export interface KinesisStreamBatchResponse {
batchItemFailures: KinesisStreamBatchItemFailure[];
}
export interface KinesisStreamBatchItemFailure {
itemIdentifier: string;
}

View file

@ -0,0 +1,45 @@
import { Handler } from "../handler";
import {
APIGatewayEventRequestContextIAMAuthorizer,
APIGatewayEventRequestContextV2WithAuthorizer,
APIGatewayProxyCallbackV2,
APIGatewayProxyEventV2,
APIGatewayProxyEventV2WithRequestContext,
APIGatewayProxyResultV2,
} from "./api-gateway-proxy";
/**
* Default Lambda Function URL event with no Authorizer
*/
export type LambdaFunctionURLEvent = APIGatewayProxyEventV2;
/**
* Works with Lambda Function URL format which is currently the same as HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
*/
export type LambdaFunctionURLResult<T = never> = APIGatewayProxyResultV2<T>;
/**
* Works with Lambda Function URL format which is currently the same as HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
*/
export type LambdaFunctionURLCallback = APIGatewayProxyCallbackV2;
/**
* Works with Lambda Function URL format which is currently the same as HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
*/
export type LambdaFunctionURLHandler<T = never> = Handler<LambdaFunctionURLEvent, LambdaFunctionURLResult<T>>;
export type LambdaFunctionURLEventWithIAMAuthorizer = APIGatewayProxyEventV2WithRequestContext<
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextIAMAuthorizer>
>;
/**
* Works with Lambda Function URL format which is currently the same as HTTP API integration Payload Format version 2.0
* @see - https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
*/
export type LambdaFunctionURLHandlerWithIAMAuthorizer<T = never> = Handler<
LambdaFunctionURLEventWithIAMAuthorizer,
LambdaFunctionURLResult<T>
>;

164
node_modules/@types/aws-lambda/trigger/lex-v2.d.ts generated vendored Normal file
View file

@ -0,0 +1,164 @@
import { Callback, Handler } from "../handler";
export type LexV2Handler = Handler<LexV2Event, LexV2Result>;
export type LexV2Callback = Callback<LexV2Result>;
// Lex V2
// https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html
export interface LexV2Event {
messageVersion: string;
invocationSource: "DialogCodeHook" | "FulfillmentCodeHook";
inputMode: "DTMF" | "Speech" | "Text";
responseContentType: string;
sessionId: string;
inputTranscript: string;
bot: LexV2Bot;
interpretations: LexV2Interpretation[];
proposedNextState: {
dialogAction: LexV2DialogAction;
intent: LexV2Intent;
};
requestAttributes?: Record<string, string>;
sessionState: LexV2SessionState;
transcriptions: LexV2Transcription[];
}
export interface LexV2Bot {
id: string;
name: string;
aliasId: string;
aliasName: string;
localeId: string;
version: string; // 'DRAFT' | `${number}`
}
export interface LexV2Interpretation {
intent: LexV2Intent;
nluConfidence?: number;
sentimentResponse?: LexV2SentimentResponse;
}
export interface LexV2Intent {
confirmationState: "Confirmed" | "Denied" | "None";
name: string;
slots: LexV2Slots;
state: LexV2IntentState;
kendraResponse?: any;
}
export type LexV2IntentState =
| "Failed"
| "Fulfilled"
| "FulfillmentInProgress"
| "InProgress"
| "ReadyForFulfillment"
| "Waiting";
export interface LexV2SentimentResponse {
sentiment: string;
sentimentScore: LexV2SentimentScore;
}
export interface LexV2SentimentScore {
mixed: number;
negative: number;
neutral: number;
positive: number;
}
export interface LexV2SessionState {
activeContexts?: LexV2ActiveContext[];
sessionAttributes?: Record<string, string>;
dialogAction?: LexV2DialogAction;
intent: LexV2Intent;
originatingRequestId: string;
}
export interface LexV2ActiveContext {
name: string;
contextAttributes: Record<string, string>;
timeToLive: {
timeToLiveInSeconds: number;
turnsToLive: number;
};
}
export type LevV2DialogActionWithoutSlot =
| { type: "Close" }
| { type: "ConfirmIntent" }
| { type: "Delegate" }
| { type: "ElicitIntent" };
export type LexV2DialogAction =
| (LevV2DialogActionWithoutSlot & { slotToElicit?: never })
| { type: "ElicitSlot"; slotToElicit: string };
export type LexV2ResultDialogAction =
| (LevV2DialogActionWithoutSlot & { slotToElicit?: never })
| { type: "ElicitSlot"; slotToElicit: string; slotElicitationStyle?: "Default" | "SpellByLetter" | "SpellByWord" };
export interface LexV2Result {
sessionState: {
sessionAttributes?: Record<string, string>;
dialogAction: LexV2ResultDialogAction;
intent?: {
name?: string;
state: LexV2IntentState;
slots?: LexV2Slots;
};
};
messages?: LexV2Message[];
}
export type LexV2Message = LexV2ContentMessage | LexV2ImageResponseCardMessage;
export interface LexV2ContentMessage {
contentType: "CustomPayload" | "PlainText" | "SSML";
content: string;
}
export interface LexV2ImageResponseCardMessage {
contentType: "ImageResponseCard";
imageResponseCard: LexV2ImageResponseCard;
}
export interface LexV2ImageResponseCard {
title: string;
subtitle?: string;
imageUrl?: string;
buttons?: LexV2ImageResponseCardButton[];
}
export interface LexV2ImageResponseCardButton {
text: string;
value: string;
}
export type LexV2Slot = LexV2ScalarSlotValue | LexV2ListSlotValue;
export type LexV2Slots = Record<string, LexV2Slot | null>;
export interface LexV2ScalarSlotValue {
shape: "Scalar";
value: LexV2SlotValue;
}
export interface LexV2ListSlotValue {
shape: "List";
value: LexV2SlotValue;
values: LexV2ScalarSlotValue[];
}
export interface LexV2SlotValue {
interpretedValue?: string;
originalValue: string;
resolvedValues: string[];
}
export interface LexV2Transcription {
transcription: string;
transcriptionConfidence: number;
resolvedContext: {
intent: string;
};
resolvedSlots: LexV2Slots;
}

120
node_modules/@types/aws-lambda/trigger/lex.d.ts generated vendored Normal file
View file

@ -0,0 +1,120 @@
import { Callback, Handler } from "../handler";
export type LexHandler = Handler<LexEvent, LexResult>;
export type LexCallback = Callback<LexResult>;
export interface LexEventSlots {
[name: string]: string | undefined | null;
}
export interface LexEventSessionAttributes {
[key: string]: string | undefined;
}
export interface LexEventRequestAttributes {
[key: string]: string | undefined;
}
// Lex
// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-lex
export interface LexEvent {
currentIntent: {
name: string;
slots: LexEventSlots;
slotDetails: LexSlotDetails;
confirmationStatus: "None" | "Confirmed" | "Denied";
};
bot: {
name: string;
alias: string;
version: string;
};
userId: string;
inputTranscript: string;
invocationSource: "DialogCodeHook" | "FulfillmentCodeHook";
outputDialogMode: "Text" | "Voice";
messageVersion: "1.0";
sessionAttributes: LexEventSessionAttributes;
requestAttributes: LexEventRequestAttributes | null;
}
export interface LexSlotResolution {
value: string;
}
export interface LexSlotDetail {
// "at least 1 but no more than 5 items"
resolutions: [LexSlotResolution, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?];
originalValue: string;
}
export interface LexSlotDetails {
[name: string]: LexSlotDetail;
}
export interface LexGenericAttachment {
title: string;
subTitle: string;
imageUrl: string;
attachmentLinkUrl: string;
buttons: Array<{
text: string;
value: string;
}>;
}
export interface LexDialogActionBase {
type: "Close" | "ElicitIntent" | "ElicitSlot" | "ConfirmIntent";
message?:
| {
contentType: "PlainText" | "SSML" | "CustomPayload";
content: string;
}
| undefined;
responseCard?:
| {
version: number;
contentType: "application/vnd.amazonaws.card.generic";
genericAttachments: LexGenericAttachment[];
}
| undefined;
}
export interface LexDialogActionClose extends LexDialogActionBase {
type: "Close";
fulfillmentState: "Fulfilled" | "Failed";
}
export interface LexDialogActionElicitIntent extends LexDialogActionBase {
type: "ElicitIntent";
}
export interface LexDialogActionElicitSlot extends LexDialogActionBase {
type: "ElicitSlot";
intentName: string;
slots: { [name: string]: string | null };
slotToElicit: string;
}
export interface LexDialogActionConfirmIntent extends LexDialogActionBase {
type: "ConfirmIntent";
intentName: string;
slots: { [name: string]: string | null };
}
export interface LexDialogActionDelegate {
type: "Delegate";
slots: { [name: string]: string | null };
}
export type LexDialogAction =
| LexDialogActionClose
| LexDialogActionElicitIntent
| LexDialogActionElicitSlot
| LexDialogActionConfirmIntent
| LexDialogActionDelegate;
export interface LexResult {
sessionAttributes?: { [key: string]: string } | undefined;
dialogAction: LexDialogAction;
}

28
node_modules/@types/aws-lambda/trigger/msk.d.ts generated vendored Normal file
View file

@ -0,0 +1,28 @@
import { Handler } from "../handler";
export type MSKHandler = Handler<MSKEvent, void>;
export interface MSKRecordHeader {
[headerKey: string]: number[];
}
export interface MSKRecord {
topic: string;
partition: number;
offset: number;
timestamp: number;
timestampType: "CREATE_TIME" | "LOG_APPEND_TIME";
key: string;
value: string;
headers: MSKRecordHeader[];
}
// https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html
export interface MSKEvent {
eventSource: "aws:kafka";
eventSourceArn: string;
bootstrapServers: string;
records: {
[topic: string]: MSKRecord[];
};
}

41
node_modules/@types/aws-lambda/trigger/s3-batch.d.ts generated vendored Normal file
View file

@ -0,0 +1,41 @@
import { Callback, Handler } from "../handler";
/**
* S3 Batch Operations event
* https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-invoke-lambda.html
*/
export type S3BatchHandler = Handler<S3BatchEvent, S3BatchResult>;
export type S3BatchCallback = Callback<S3BatchResult>;
export interface S3BatchEvent {
invocationSchemaVersion: string;
invocationId: string;
job: S3BatchEventJob;
tasks: S3BatchEventTask[];
}
export interface S3BatchEventJob {
id: string;
}
export interface S3BatchEventTask {
taskId: string;
s3Key: string;
s3VersionId: string | null;
s3BucketArn: string;
}
export interface S3BatchResult {
invocationSchemaVersion: string;
treatMissingKeysAs: S3BatchResultResultCode;
invocationId: string;
results: S3BatchResultResult[];
}
export type S3BatchResultResultCode = "Succeeded" | "TemporaryFailure" | "PermanentFailure";
export interface S3BatchResultResult {
taskId: string;
resultCode: S3BatchResultResultCode;
resultString: string;
}

View file

@ -0,0 +1,290 @@
import { Handler } from "../handler";
import { EventBridgeEvent } from "./eventbridge";
export interface S3ObjectAccessTierChangedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
size: number;
etag: string;
"version-id": string;
};
"request-id": string;
requester: string;
"destination-access-tier": "ARCHIVE_ACCESS" | "DEEP_ARCHIVE_ACCESS"; // https://docs.aws.amazon.com/AmazonS3/latest/API/API_Tiering.html
}
export interface S3ObjectACLUpdatedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
etag: string;
"version-id": string;
};
"request-id": string;
requester: string;
"source-ip-address": string;
}
export interface S3ObjectCreatedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
size: number;
etag: string;
"version-id": string;
sequencer: string;
};
"request-id": string;
requester: string;
"source-ip-address": string;
reason: "PutObject" | "POST Object" | "CopyObject" | "CompleteMultipartUpload";
}
export interface S3ObjectDeletedNotificationEventLifecycleExpirationDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
etag: string;
"version-id": string;
sequencer: string;
};
"request-id": string;
requester: string;
reason: "Lifecycle Expiration";
"deletion-type": "Permanently Deleted" | "Delete Marker Created";
}
export interface S3ObjectDeletedNotificationEventDeleteObjectDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
etag: string;
"version-id": string;
sequencer: string;
};
"request-id": string;
requester: string;
"source-ip-address": string;
reason: "DeleteObject";
"deletion-type": "Permanently Deleted" | "Delete Marker Created";
}
export type S3ObjectDeletedNotificationEventDetail =
| S3ObjectDeletedNotificationEventLifecycleExpirationDetail
| S3ObjectDeletedNotificationEventDeleteObjectDetail;
export interface S3ObjectRestoreCompletedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
size: number;
"version-id": string;
etag: string;
};
"request-id": string;
requester: "s3.amazonaws.com";
"restore-expiry-time": string;
"source-storage-class":
| "STANDARD"
| "REDUCED_REDUNDANCY"
| "STANDARD_IA"
| "ONEZONE_IA"
| "INTELLIGENT_TIERING"
| "GLACIER"
| "DEEP_ARCHIVE"
| "OUTPOSTS"
| "GLACIER_IR"; // https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax
}
export interface S3ObjectRestoreExpiredNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
"version-id": string;
etag: string;
};
"request-id": string;
requester: "s3.amazonaws.com";
}
export interface S3ObjectRestoreInitiatedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
size: number;
"version-id": string;
etag: string;
};
"request-id": string;
requester: string;
"source-ip-address": string;
"source-storage-class":
| "STANDARD"
| "REDUCED_REDUNDANCY"
| "STANDARD_IA"
| "ONEZONE_IA"
| "INTELLIGENT_TIERING"
| "GLACIER"
| "DEEP_ARCHIVE"
| "OUTPOSTS"
| "GLACIER_IR"; // https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax
}
export interface S3ObjectStorageClassChangedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
size: number;
"version-id": string;
etag: string;
};
"request-id": string;
requester: string;
"destination-storage-class":
| "STANDARD"
| "REDUCED_REDUNDANCY"
| "STANDARD_IA"
| "ONEZONE_IA"
| "INTELLIGENT_TIERING"
| "GLACIER"
| "DEEP_ARCHIVE"
| "OUTPOSTS"
| "GLACIER_IR"; // https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax
}
export interface S3ObjectTagsAddedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
"version-id": string;
etag: string;
};
"request-id": string;
requester: string;
"source-ip-address": string;
}
export interface S3ObjectTagsDeletedNotificationEventDetail {
version: "0";
bucket: {
name: string;
};
object: {
key: string;
"version-id": string;
etag: string;
};
"request-id": string;
requester: string;
"source-ip-address": string;
}
export interface S3ObjectAccessTierChangedNotificationEvent
extends EventBridgeEvent<"Object Access Tier Changed", S3ObjectAccessTierChangedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectACLUpdatedNotificationEvent
extends EventBridgeEvent<"Object ACL Updated", S3ObjectACLUpdatedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectCreatedNotificationEvent
extends EventBridgeEvent<"Object Created", S3ObjectCreatedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectDeletedNotificationEvent
extends EventBridgeEvent<"Object Deleted", S3ObjectDeletedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectRestoreCompletedNotificationEvent
extends EventBridgeEvent<"Object Restore Completed", S3ObjectRestoreCompletedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectRestoreExpiredNotificationEvent
extends EventBridgeEvent<"Object Restore Expired", S3ObjectRestoreExpiredNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectRestoreInitiatedNotificationEvent
extends EventBridgeEvent<"Object Restore Initiated", S3ObjectRestoreInitiatedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectStorageClassChangedNotificationEvent
extends EventBridgeEvent<"Object Storage Class Changed", S3ObjectStorageClassChangedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectTagsAddedNotificationEvent
extends EventBridgeEvent<"Object Tags Added", S3ObjectTagsAddedNotificationEventDetail>
{
source: "aws.s3";
}
export interface S3ObjectTagsDeletedNotificationEvent
extends EventBridgeEvent<"Object Tags Deleted", S3ObjectTagsDeletedNotificationEventDetail>
{
source: "aws.s3";
}
export type S3NotificationEvent =
| S3ObjectAccessTierChangedNotificationEvent
| S3ObjectACLUpdatedNotificationEvent
| S3ObjectCreatedNotificationEvent
| S3ObjectDeletedNotificationEvent
| S3ObjectRestoreCompletedNotificationEvent
| S3ObjectRestoreExpiredNotificationEvent
| S3ObjectRestoreInitiatedNotificationEvent
| S3ObjectStorageClassChangedNotificationEvent
| S3ObjectTagsAddedNotificationEvent
| S3ObjectTagsDeletedNotificationEvent;
export type S3NotificationEventBridgeHandler<EventType extends S3NotificationEvent = S3NotificationEvent> = Handler<
EventBridgeEvent<EventType["detail-type"], EventType["detail"]> & {
source: "aws.s3";
},
void
>;

60
node_modules/@types/aws-lambda/trigger/s3.d.ts generated vendored Normal file
View file

@ -0,0 +1,60 @@
import { Handler } from "../handler";
export type S3Handler = Handler<S3Event, void>;
/**
* S3Create event
* https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
*/
export interface S3EventRecordGlacierRestoreEventData {
lifecycleRestorationExpiryTime: string;
lifecycleRestoreStorageClass: string;
}
export interface S3EventRecordGlacierEventData {
restoreEventData: S3EventRecordGlacierRestoreEventData;
}
export interface S3EventRecord {
eventVersion: string;
eventSource: string;
awsRegion: string;
eventTime: string;
eventName: string;
userIdentity: {
principalId: string;
};
requestParameters: {
sourceIPAddress: string;
};
responseElements: {
"x-amz-request-id": string;
"x-amz-id-2": string;
};
s3: {
s3SchemaVersion: string;
configurationId: string;
bucket: {
name: string;
ownerIdentity: {
principalId: string;
};
arn: string;
};
object: {
key: string;
size: number;
eTag: string;
versionId?: string | undefined;
sequencer: string;
};
};
glacierEventData?: S3EventRecordGlacierEventData | undefined;
}
export interface S3Event {
Records: S3EventRecord[];
}
export type S3CreateEvent = S3Event; // old name

View file

@ -0,0 +1,15 @@
import { Handler } from "../handler";
export type SecretsManagerRotationHandler = Handler<SecretsManagerRotationEvent, void>;
export type SecretsManagerRotationEventStep = "createSecret" | "setSecret" | "testSecret" | "finishSecret";
/**
* Secrets Manager Rotation event
* https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-lambda-function-overview.html
*/
export interface SecretsManagerRotationEvent {
Step: SecretsManagerRotationEventStep;
SecretId: string;
ClientRequestToken: string;
}

View file

@ -0,0 +1,27 @@
import { Handler } from "../handler";
export type SelfManagedKafkaHandler = Handler<SelfManagedKafkaEvent, void>;
export interface SelfManagedKafkaRecordHeader {
[headerKey: string]: number[];
}
export interface SelfManagedKafkaRecord {
topic: string;
partition: number;
offset: number;
timestamp: number;
timestampType: "CREATE_TIME" | "LOG_APPEND_TIME";
key: string;
value: string;
headers: SelfManagedKafkaRecordHeader[];
}
// https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html
export interface SelfManagedKafkaEvent {
eventSource: "SelfManagedKafka";
bootstrapServers: string;
records: {
[topic: string]: SelfManagedKafkaRecord[];
};
}

109
node_modules/@types/aws-lambda/trigger/ses.d.ts generated vendored Normal file
View file

@ -0,0 +1,109 @@
import { Handler } from "../handler";
export type SESHandler = Handler<SESEvent, void>;
// SES event
export interface SESMailHeader {
name: string;
value: string;
}
export interface SESMailCommonHeaders {
returnPath: string;
from?: string[] | undefined;
date: string;
to?: string[] | undefined;
cc?: string[] | undefined;
bcc?: string[] | undefined;
sender?: string[] | undefined;
replyTo?: string[] | undefined;
messageId: string;
subject?: string | undefined;
}
export interface SESMail {
timestamp: string;
source: string;
messageId: string;
destination: string[];
headersTruncated: boolean;
headers: SESMailHeader[];
commonHeaders: SESMailCommonHeaders;
}
export interface SESReceiptStatus {
status: "PASS" | "FAIL" | "GRAY" | "PROCESSING_FAILED" | "DISABLED";
}
export interface SESReceiptS3Action {
type: "S3";
topicArn?: string | undefined;
bucketName: string;
objectKey: string;
}
export interface SESReceiptSnsAction {
type: "SNS";
topicArn: string;
}
export interface SESReceiptBounceAction {
type: "Bounce";
topicArn?: string | undefined;
smtpReplyCode: string;
statusCode: string;
message: string;
sender: string;
}
export interface SESReceiptLambdaAction {
type: "Lambda";
topicArn?: string | undefined;
functionArn: string;
invocationType: string;
}
export interface SESReceiptStopAction {
type: "Stop";
topicArn?: string | undefined;
}
export interface SESReceiptWorkMailAction {
type: "WorkMail";
topicArn?: string | undefined;
organizationArn: string;
}
export interface SESReceipt {
timestamp: string;
processingTimeMillis: number;
recipients: string[];
spamVerdict: SESReceiptStatus;
virusVerdict: SESReceiptStatus;
spfVerdict: SESReceiptStatus;
dkimVerdict: SESReceiptStatus;
dmarcVerdict: SESReceiptStatus;
dmarcPolicy?: "none" | "quarantine" | "reject" | undefined;
action:
| SESReceiptS3Action
| SESReceiptSnsAction
| SESReceiptBounceAction
| SESReceiptLambdaAction
| SESReceiptStopAction
| SESReceiptWorkMailAction;
}
export interface SESMessage {
mail: SESMail;
receipt: SESReceipt;
}
export interface SESEventRecord {
eventSource: string;
eventVersion: string;
ses: SESMessage;
}
export interface SESEvent {
Records: SESEventRecord[];
}

39
node_modules/@types/aws-lambda/trigger/sns.d.ts generated vendored Normal file
View file

@ -0,0 +1,39 @@
import { Handler } from "../handler";
export type SNSHandler = Handler<SNSEvent, void>;
// SNS "event"
export interface SNSMessageAttribute {
Type: string;
Value: string;
}
export interface SNSMessageAttributes {
[name: string]: SNSMessageAttribute;
}
export interface SNSMessage {
SignatureVersion: string;
Timestamp: string;
Signature: string;
SigningCertUrl: string;
MessageId: string;
Message: string;
MessageAttributes: SNSMessageAttributes;
Type: string;
UnsubscribeUrl: string;
TopicArn: string;
Subject?: string;
Token?: string;
}
export interface SNSEventRecord {
EventVersion: string;
EventSubscriptionArn: string;
EventSource: string;
Sns: SNSMessage;
}
export interface SNSEvent {
Records: SNSEventRecord[];
}

58
node_modules/@types/aws-lambda/trigger/sqs.d.ts generated vendored Normal file
View file

@ -0,0 +1,58 @@
import { Handler } from "../handler";
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
export type SQSHandler = Handler<SQSEvent, SQSBatchResponse | void>;
// SQS
// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-sqs
export interface SQSRecord {
messageId: string;
receiptHandle: string;
body: string;
attributes: SQSRecordAttributes;
messageAttributes: SQSMessageAttributes;
md5OfBody: string;
md5OfMessageAttributes?: string;
eventSource: string;
eventSourceARN: string;
awsRegion: string;
}
export interface SQSEvent {
Records: SQSRecord[];
}
export interface SQSRecordAttributes {
AWSTraceHeader?: string | undefined;
ApproximateReceiveCount: string;
SentTimestamp: string;
SenderId: string;
ApproximateFirstReceiveTimestamp: string;
SequenceNumber?: string | undefined;
MessageGroupId?: string | undefined;
MessageDeduplicationId?: string | undefined;
DeadLetterQueueSourceArn?: string | undefined; // Undocumented, but used by AWS to support their re-drive functionality in the console
}
export type SQSMessageAttributeDataType = "String" | "Number" | "Binary" | string;
export interface SQSMessageAttribute {
stringValue?: string | undefined;
binaryValue?: string | undefined;
stringListValues?: string[] | undefined; // Not implemented. Reserved for future use.
binaryListValues?: string[] | undefined; // Not implemented. Reserved for future use.
dataType: SQSMessageAttributeDataType;
}
export interface SQSMessageAttributes {
[name: string]: SQSMessageAttribute;
}
// https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting
export interface SQSBatchResponse {
batchItemFailures: SQSBatchItemFailure[];
}
export interface SQSBatchItemFailure {
itemIdentifier: string;
}

View file

@ -0,0 +1,110 @@
import { Handler } from "../handler";
/**
* Use this only if you want to use callbacks. AWS [recommends against](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html) using those,
* so you might want to use async/await instead, like this:
*
* ```typescript
* const handler = async (event: TransferFamilyAuthorizerEvent): Promise<TransferFamilyAuthorizerResult> => {
* ... add your logic here
* }
* ```
*/
export type TransferFamilyAuthorizerHandler = Handler<TransferFamilyAuthorizerEvent, TransferFamilyAuthorizerResult>;
/**
* Transfer Family Authorizer Event. This is the event that will be passed to the Lambda function.
* Event message structure can be found here: https://docs.aws.amazon.com/transfer/latest/userguide/custom-lambda-idp.html
* While the documentation is not explicit, for key based auth, password will be undefined
*/
export interface TransferFamilyAuthorizerEvent {
username: string;
password?: string;
protocol: "SFTP" | "FTP" | "FTPS";
serverId: string;
sourceIp: string;
}
/**
* The values that Transfer Family accepts for Lambda functions that are used for custom identity providers.
* For some examples, see https://docs.aws.amazon.com/transfer/latest/userguide/custom-lambda-idp.html#lambda-auth-examples
*/
export interface TransferFamilyAuthorizerResult {
/**
* [**Required if authentication was successful. The user is authenticated if and only if the Role field is not blank**]
*
* Specifies the Amazon Resource Name (ARN) of the IAM role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system.
* The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 or Amazon EFS file system.
* The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.
*
* For details on establishing a trust relationship, see [To establish a trust relationship](https://docs.aws.amazon.com/transfer/latest/userguide/requirements-roles.html#establish-trust-transfer).
*/
Role?: string;
/**
* [**Required for Amazon EFS backing storage**]
*
* The full POSIX identity, including user ID (`Uid`), group ID (`Gid`), and any secondary group IDs (`SecondaryGids`), that controls your users' access to your Amazon EFS file systems.
* The POSIX permissions that are set on files and directories in your file system determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.
*/
PosixProfile?: {
/**
* User ID (UID) for the POSIX profile.
*/
Uid: number;
/**
* Group ID (GID) for the POSIX profile.
*/
Gid: number;
/**
* Secondary group IDs for the POSIX profile, if any.
*/
SecondaryGids?: number[];
} | undefined;
/**
* [**Optional**]
*
* A list of SSH public key values that are valid for this user.
* An empty list implies that this is not a valid login.
* Must not be returned during password authentication.
*/
PublicKeys?: string[] | undefined;
/**
* [**Optional**]
*
* A session policy for your user so that you can use the same IAM role across multiple users.
* This policy scopes down user access to portions of their Amazon S3 bucket.
*/
Policy?: string | undefined;
/**
* [**Optional**]
*
* The type of landing directory (folder) that you want your users' home directory to be when they log in to the server.
*
* - If you set it to `PATH`, the user sees the absolute Amazon S3 bucket or Amazon EFS paths as is in their file transfer protocol clients.
* - If you set it to `LOGICAL`, you must provide mappings in the `HomeDirectoryDetails` parameter to make Amazon S3 or Amazon EFS paths visible to your users.
*/
HomeDirectoryType?: "PATH" | "LOGICAL" | undefined;
/**
* [**Required if `HomeDirectoryType` has a value of `LOGICAL`**]
*
* Logical directory mappings that specify which Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible.
* You must specify the Entry and Target pair, where Entry shows how the path is made visible and Target is the actual Amazon S3 or Amazon EFS path.
*
* **Note**: `HomeDirectoryDetails` is a string representation of a JSON map.
* This is in contrast to `PosixProfile`, which is an actual JSON map object, and `PublicKeys` which is a JSON array of strings.
* See the [code examples](https://docs.aws.amazon.com/transfer/latest/userguide/custom-lambda-idp.html#lambda-auth-examples).
*/
HomeDirectoryDetails?: string | undefined;
/**
* [**Optional**]
*
* The landing directory for a user when they log in to the server using the client.
*/
HomeDirectory?: string | undefined;
}