1.0.4 • Published 6 months ago

@types/aws-cloudfront-function v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/aws-cloudfront-function

Summary

This package contains type definitions for AWS CloudFront Functions (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-cloudfront-function.

index.d.ts

// Type definitions for non-npm package AWS CloudFront Functions 1.0
// Project: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html
// Definitions by: Jakub Zelenka <https://github.com/bukka>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace AWSCloudFrontFunction {
    interface Event {
        version: "1.0";
        context: Context;
        viewer: Viewer;
        request: Request;
        response: Response;
    }

    interface Context {
        distributionDomainName: string;
        distributionId: string;
        eventType: "viewer-request" | "viewer-response";
        requestId: string;
    }

    interface Viewer {
        ip: string;
    }

    interface Request {
        method: string;
        uri: string;
        querystring: ValueObject;
        headers: ValueObject;
        cookies: ValueObject;
    }

    interface Response {
        statusCode: number;
        statusDescription?: string;
        headers?: ValueObject;
        cookies?: ResponseCookie;
    }

    interface ValueObject {
        [name: string]: {
            value: string;
            multiValue?: Array<{
                value: string;
            }>;
        };
    }

    interface ResponseCookie {
        [name: string]: {
            value: string;
            attributes: string;
            multiValue?: Array<{
                value: string;
                attributes: string;
            }>;
        };
    }
}

Additional Details

  • Last updated: Tue, 24 May 2022 16:01:40 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Jakub Zelenka.

1.0.4

6 months ago

1.0.3

7 months ago

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago