Full Code of H4ad/serverless-adapter for AI

main 3abab65593ba cached
317 files
888.5 KB
227.5k tokens
493 symbols
1 requests
Download .txt
Showing preview only (971K chars total). Download the full file or copy to clipboard to get everything.
Repository: H4ad/serverless-adapter
Branch: main
Commit: 3abab65593ba
Files: 317
Total size: 888.5 KB

Directory structure:
gitextract_42shtyvg/

├── .eslintignore
├── .eslintrc
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── config.yml
│   │   └── feature_request.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── dependabot.yml
│   ├── settings.yml
│   └── workflows/
│       ├── codeql-analysis.yml
│       ├── docs.yml
│       ├── pr.yml
│       └── release.yml
├── .gitignore
├── .husky/
│   ├── .gitignore
│   ├── pre-commit
│   └── prepare-commit-msg
├── .npmrc
├── .prettierrc
├── .release-please-manifest.json
├── .tmuxinator.yml
├── .tool-versions
├── .vscode/
│   ├── launch.json
│   └── settings.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── api-extractor.json
├── benchmark/
│   ├── .gitignore
│   ├── .swcrc
│   ├── README.md
│   ├── package.json
│   ├── src/
│   │   ├── events.ts
│   │   ├── framework.mock.ts
│   │   └── samples/
│   │       ├── clone-headers.ts
│   │       ├── compare-libraries.ts
│   │       └── format-headers.ts
│   └── tsconfig.json
├── package.json
├── release-please-config.json
├── scripts/
│   ├── generate-api-pages.ts
│   ├── generate-markdown.ts
│   ├── libs/
│   │   ├── CustomMarkdownDocumenter.ts
│   │   ├── CustomUtilities.ts
│   │   └── MarkdownEmitter.ts
│   ├── models/
│   │   └── apidoc.types.ts
│   └── parse-docs.ts
├── src/
│   ├── @types/
│   │   ├── binary-settings.ts
│   │   ├── digital-ocean/
│   │   │   ├── digital-ocean-http-event.ts
│   │   │   ├── digital-ocean-http-response.ts
│   │   │   └── index.ts
│   │   ├── headers.ts
│   │   ├── helpers.ts
│   │   ├── huawei/
│   │   │   ├── huawei-api-gateway-event.ts
│   │   │   ├── huawei-api-gateway-response.ts
│   │   │   ├── huawei-context.ts
│   │   │   └── index.ts
│   │   └── index.ts
│   ├── adapters/
│   │   ├── apollo-server/
│   │   │   ├── apollo-server-mutation.adapter.ts
│   │   │   └── index.ts
│   │   ├── aws/
│   │   │   ├── alb.adapter.ts
│   │   │   ├── api-gateway-v1.adapter.ts
│   │   │   ├── api-gateway-v2.adapter.ts
│   │   │   ├── base/
│   │   │   │   ├── aws-simple-adapter.ts
│   │   │   │   └── index.ts
│   │   │   ├── dynamodb.adapter.ts
│   │   │   ├── event-bridge.adapter.ts
│   │   │   ├── index.ts
│   │   │   ├── lambda-edge.adapter.ts
│   │   │   ├── request-lambda-edge.adapter.ts
│   │   │   ├── s3.adapter.ts
│   │   │   ├── sns.adapter.ts
│   │   │   └── sqs.adapter.ts
│   │   ├── azure/
│   │   │   ├── http-trigger-v4.adapter.ts
│   │   │   └── index.ts
│   │   ├── digital-ocean/
│   │   │   ├── http-function.adapter.ts
│   │   │   └── index.ts
│   │   ├── dummy/
│   │   │   ├── dummy.adapter.ts
│   │   │   └── index.ts
│   │   └── huawei/
│   │       ├── huawei-api-gateway.adapter.ts
│   │       └── index.ts
│   ├── contracts/
│   │   ├── adapter.contract.ts
│   │   ├── framework.contract.ts
│   │   ├── handler.contract.ts
│   │   ├── index.ts
│   │   └── resolver.contract.ts
│   ├── core/
│   │   ├── base-handler.ts
│   │   ├── constants.ts
│   │   ├── current-invoke.ts
│   │   ├── event-body.ts
│   │   ├── headers.ts
│   │   ├── index.ts
│   │   ├── is-binary.ts
│   │   ├── logger.ts
│   │   ├── no-op.ts
│   │   ├── optional.ts
│   │   ├── path.ts
│   │   └── stream.ts
│   ├── frameworks/
│   │   ├── apollo-server/
│   │   │   ├── apollo-server.framework.ts
│   │   │   └── index.ts
│   │   ├── body-parser/
│   │   │   ├── base-body-parser.framework.ts
│   │   │   ├── index.ts
│   │   │   ├── json-body-parser.framework.ts
│   │   │   ├── raw-body-parser.framework.ts
│   │   │   ├── text-body-parser.framework.ts
│   │   │   └── urlencoded-body-parser.framework.ts
│   │   ├── cors/
│   │   │   ├── cors.framework.ts
│   │   │   └── index.ts
│   │   ├── deepkit/
│   │   │   ├── http-deepkit.framework.ts
│   │   │   └── index.ts
│   │   ├── express/
│   │   │   ├── express.framework.ts
│   │   │   └── index.ts
│   │   ├── fastify/
│   │   │   ├── fastify.framework.ts
│   │   │   ├── helpers/
│   │   │   │   └── no-op-content-parser.ts
│   │   │   └── index.ts
│   │   ├── hapi/
│   │   │   ├── hapi.framework.ts
│   │   │   └── index.ts
│   │   ├── koa/
│   │   │   ├── index.ts
│   │   │   └── koa.framework.ts
│   │   ├── lazy/
│   │   │   ├── index.ts
│   │   │   └── lazy.framework.ts
│   │   ├── polka/
│   │   │   ├── index.ts
│   │   │   └── polka.framework.ts
│   │   └── trpc/
│   │       ├── index.ts
│   │       └── trpc.framework.ts
│   ├── handlers/
│   │   ├── aws/
│   │   │   ├── aws-stream.handler.ts
│   │   │   └── index.ts
│   │   ├── azure/
│   │   │   ├── azure.handler.ts
│   │   │   └── index.ts
│   │   ├── base/
│   │   │   ├── index.ts
│   │   │   └── raw-request.ts
│   │   ├── default/
│   │   │   ├── default.handler.ts
│   │   │   └── index.ts
│   │   ├── digital-ocean/
│   │   │   ├── digital-ocean.handler.ts
│   │   │   └── index.ts
│   │   ├── firebase/
│   │   │   ├── http-firebase-v2.handler.ts
│   │   │   ├── http-firebase.handler.ts
│   │   │   └── index.ts
│   │   ├── gcp/
│   │   │   ├── gcp.handler.ts
│   │   │   └── index.ts
│   │   └── huawei/
│   │       ├── http-huawei.handler.ts
│   │       └── index.ts
│   ├── index.doc.ts
│   ├── index.ts
│   ├── network/
│   │   ├── index.ts
│   │   ├── request.ts
│   │   ├── response-stream.ts
│   │   ├── response.ts
│   │   └── utils.ts
│   ├── resolvers/
│   │   ├── aws-context/
│   │   │   ├── aws-context.resolver.ts
│   │   │   └── index.ts
│   │   ├── callback/
│   │   │   ├── callback.resolver.ts
│   │   │   └── index.ts
│   │   ├── dummy/
│   │   │   ├── dummy.resolver.ts
│   │   │   └── index.ts
│   │   └── promise/
│   │       ├── index.ts
│   │       └── promise.resolver.ts
│   └── serverless-adapter.ts
├── test/
│   ├── adapters/
│   │   ├── apollo-server/
│   │   │   └── apollo-mutation.adapter.spec.ts
│   │   ├── aws/
│   │   │   ├── alb.adapter.spec.ts
│   │   │   ├── api-gateway-v1.adapter.spec.ts
│   │   │   ├── api-gateway-v2.adapter.spec.ts
│   │   │   ├── aws-simple-adapter.spec.ts
│   │   │   ├── dynamodb.adapter.spec.ts
│   │   │   ├── event-bridge.adapter.spec.ts
│   │   │   ├── lambda-edge.adapter.spec.ts
│   │   │   ├── request-lambda-edge.adapter.spec.ts
│   │   │   ├── s3.adapter.spec.ts
│   │   │   ├── sns.adapter.spec.ts
│   │   │   ├── sqs.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── alb-event.ts
│   │   │       ├── api-gateway-v1.ts
│   │   │       ├── api-gateway-v2.ts
│   │   │       ├── dynamodb.ts
│   │   │       ├── event-bridge.ts
│   │   │       ├── events.ts
│   │   │       ├── lambda-edge.ts
│   │   │       ├── s3.ts
│   │   │       ├── sns.ts
│   │   │       └── sqs.ts
│   │   ├── azure/
│   │   │   ├── http-trigger.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── events.ts
│   │   │       └── http-trigger.ts
│   │   ├── digital-ocean/
│   │   │   ├── http-function.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── event.ts
│   │   │       └── http-function.ts
│   │   ├── dummy/
│   │   │   └── dummy.adapter.spec.ts
│   │   ├── huawei/
│   │   │   ├── huawei-api-gateway.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── events.ts
│   │   │       └── huawei-api-gateway.ts
│   │   ├── test.example
│   │   └── utils/
│   │       ├── can-handle.ts
│   │       └── events.ts
│   ├── core/
│   │   ├── base-handler.spec.ts
│   │   ├── current-invoke.spec.ts
│   │   ├── event-body.spec.ts
│   │   ├── headers.spec.ts
│   │   ├── is-binary.spec.ts
│   │   ├── logger.spec.ts
│   │   ├── no-op.spec.ts
│   │   ├── optional.spec.ts
│   │   ├── path.spec.ts
│   │   ├── stream.spec.ts
│   │   └── utils/
│   │       └── stream.ts
│   ├── frameworks/
│   │   ├── apollo-server.framework.spec.ts
│   │   ├── body-parser-v2.framework.spec.ts
│   │   ├── body-parser.framework.helper.ts
│   │   ├── body-parser.framework.spec.ts
│   │   ├── cors.framework.spec.ts
│   │   ├── express-v5.framework.spec.ts
│   │   ├── express.framework.spec.ts
│   │   ├── fastify-v5.framework.spec.ts
│   │   ├── fastify.framework.spec.ts
│   │   ├── hapi.framework.spec.ts
│   │   ├── http-deepkit.framework.spec.ts
│   │   ├── koa.framework.spec.ts
│   │   ├── lazy.framework.spec.ts
│   │   ├── polka.framework.spec.ts
│   │   ├── trpc.framework.spec.ts
│   │   └── utils.ts
│   ├── handlers/
│   │   ├── aws-stream.handler.spec.ts
│   │   ├── azure.handler.spec.ts
│   │   ├── default.handler.spec.ts
│   │   ├── digital-ocean.handler.spec.ts
│   │   ├── gcp.handler.spec.ts
│   │   ├── http-firebase-v2.handler.spec.ts
│   │   ├── http-firebase-v2.sdk-v5.handler.spec.ts
│   │   ├── http-firebase-v2.sdk-v6.handler.spec.ts
│   │   ├── http-firebase.handler.spec.ts
│   │   └── huawei.handler.spec.ts
│   ├── issues/
│   │   ├── alb-express-static/
│   │   │   ├── alb-express-static.spec.ts
│   │   │   └── robots.txt
│   │   └── issue-165/
│   │       └── transfer-encoding-chunked-support.spec.ts
│   ├── mocks/
│   │   └── framework.mock.ts
│   ├── network/
│   │   ├── request.spec.ts
│   │   └── response.spec.ts
│   ├── resolvers/
│   │   ├── aws-context.resolver.spec.ts
│   │   ├── callback.resolver.spec.ts
│   │   ├── dummy.resolver.spec.ts
│   │   └── promise.resolver.spec.ts
│   └── serverless-adapter.spec.ts
├── tsconfig.build.json
├── tsconfig.doc.json
├── tsconfig.eslint.json
├── tsconfig.json
├── tsdoc.json
├── tsup.config.ts
├── vite.config.ts
└── www/
    ├── .gitignore
    ├── .tool-versions
    ├── README.md
    ├── babel.config.js
    ├── blog/
    │   ├── 2022-06-17-the-beginning.mdx
    │   ├── 2022-07-17-updates-and-releases.mdx
    │   ├── 2023-04-28-aws-lambda-response-streaming.mdx
    │   ├── 2023-12-25-dual-package-publish.mdx
    │   └── authors.yml
    ├── docs/
    │   ├── .gitignore
    │   └── main/
    │       ├── adapters/
    │       │   ├── aws/
    │       │   │   ├── alb.mdx
    │       │   │   ├── api-gateway-v1.mdx
    │       │   │   ├── api-gateway-v2.mdx
    │       │   │   ├── dynamodb.mdx
    │       │   │   ├── event-bridge.mdx
    │       │   │   ├── function-url.mdx
    │       │   │   ├── lambda-edge.mdx
    │       │   │   ├── s3.mdx
    │       │   │   ├── sns.mdx
    │       │   │   └── sqs.mdx
    │       │   ├── azure/
    │       │   │   └── http-trigger-v4.mdx
    │       │   ├── digital-ocean/
    │       │   │   └── http-function.mdx
    │       │   ├── firebase.mdx
    │       │   └── huawei/
    │       │       └── huawei-api-gateway.mdx
    │       ├── advanced/
    │       │   └── adapters/
    │       │       ├── creating-an-adapter.mdx
    │       │       └── introduction.mdx
    │       ├── architecture.mdx
    │       ├── frameworks/
    │       │   ├── apollo-server.mdx
    │       │   ├── deepkit.mdx
    │       │   ├── express.mdx
    │       │   ├── fastify.mdx
    │       │   ├── hapi.mdx
    │       │   ├── helpers/
    │       │   │   ├── body-parser.mdx
    │       │   │   ├── cors.mdx
    │       │   │   └── lazy.mdx
    │       │   ├── koa.mdx
    │       │   ├── nestjs.mdx
    │       │   ├── polka.mdx
    │       │   └── trpc.mdx
    │       ├── getting-started/
    │       │   ├── customizing.mdx
    │       │   ├── examples.mdx
    │       │   ├── installation.mdx
    │       │   └── usage.mdx
    │       ├── handlers/
    │       │   ├── aws.mdx
    │       │   ├── azure.mdx
    │       │   ├── digital-ocean.mdx
    │       │   ├── firebase.mdx
    │       │   ├── gcp.mdx
    │       │   └── huawei.mdx
    │       ├── intro.mdx
    │       └── resolvers/
    │           ├── aws-context.mdx
    │           ├── callback.mdx
    │           └── promise.mdx
    ├── docusaurus.config.js
    ├── package.json
    ├── sidebars.js
    ├── src/
    │   ├── components/
    │   │   ├── BrowserWindow/
    │   │   │   ├── index.tsx
    │   │   │   └── styles.module.css
    │   │   ├── HomepageFeatures/
    │   │   │   ├── index.tsx
    │   │   │   └── styles.module.css
    │   │   └── HowToStart/
    │   │       ├── index.tsx
    │   │       └── styles.module.css
    │   ├── css/
    │   │   └── custom.css
    │   └── pages/
    │       ├── index.module.css
    │       └── index.tsx
    ├── static/
    │   ├── .nojekyll
    │   └── CNAME
    └── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .eslintignore
================================================
src/types/global.d.ts
benchmark/


================================================
FILE: .eslintrc
================================================
{
  "root": true,
  "parser": "@typescript-eslint/parser",
  "plugins": [
    "@typescript-eslint",
    "eslint-plugin-tsdoc"
  ],
  "parserOptions": {
    "project": [
      "./tsconfig.eslint.json"
    ]
  },
  "extends": [
    "eslint:recommended",
    "plugin:node/recommended",
    "plugin:import/recommended",
    "plugin:import/typescript",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:prettier/recommended"
  ],
  "rules": {
    "tsdoc/syntax": "error",
    "prettier/prettier": "warn",
    "comma-dangle": [
      "error",
      "always-multiline"
    ],
    "node/no-missing-import": "off",
    "node/no-empty-function": "off",
    "node/no-unsupported-features/es-syntax": "off",
    "node/no-missing-require": "off",
    "node/shebang": "off",
    "import/order": [
      "error",
      {
        "newlines-between": "never"
      }
    ],
    "sort-imports": [
      "error",
      {
        "ignoreDeclarationSort": true
      }
    ],
    "@typescript-eslint/no-use-before-define": "off",
    "quotes": [
      "warn",
      "single",
      {
        "avoidEscape": true
      }
    ],
    "curly": [
      "error",
      "multi-or-nest"
    ],
    "max-len": [
      "warn",
      {
        "code": 140,
        "tabWidth": 2,
        "ignoreStrings": true,
        "ignoreTemplateLiterals": true,
        "ignoreUrls": true,
        "ignoreComments": true,
        "ignorePattern": "^import\\s.+\\sfrom\\s.+;$"
      }
    ],
    "no-case-declarations": "warn",
    "no-control-regex": "off",
    "node/no-unpublished-import": "off",
    "@typescript-eslint/no-namespace": "off",
    "@typescript-eslint/no-unsafe-argument": "off",
    "@typescript-eslint/no-unsafe-assignment": "off",
    "@typescript-eslint/no-unsafe-member-access": "off",
    "@typescript-eslint/no-unsafe-call": "off",
    "@typescript-eslint/no-unsafe-return": "off",
    "@typescript-eslint/no-var-requires": "off",
    "@typescript-eslint/ban-ts-comment": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "@typescript-eslint/no-non-null-assertion": "off",
    "@typescript-eslint/restrict-template-expressions": "off",
    "@typescript-eslint/no-floating-promises": "off",
    "@typescript-eslint/explicit-module-boundary-types": "off",
    "@typescript-eslint/no-inferrable-types": "off",
    "@typescript-eslint/no-unnecessary-type-assertion": "off",
    "@typescript-eslint/no-redundant-type-constituents": "off",
    "@typescript-eslint/no-unused-vars": [
      "error",
      {
        "varsIgnorePattern": "^_",
        "argsIgnorePattern": "^_"
      }
    ],
    "@typescript-eslint/member-ordering": [
      "error",
      {
        "default": [
          // Constructors
          "public-constructor",
          "protected-constructor",
          "private-constructor",
          // Index signature
          "signature",
          // Fields
          "protected-abstract-field",
          "public-abstract-field",
          "protected-static-field",
          "public-static-field",
          "private-static-field",
          "protected-decorated-field",
          "public-decorated-field",
          "private-decorated-field",
          "protected-instance-field",
          "public-instance-field",
          "private-instance-field",
          // Getters
          "protected-decorated-get",
          "public-decorated-get",
          "private-decorated-get",
          "protected-static-get",
          "public-static-get",
          "private-static-get",
          "protected-instance-get",
          "public-instance-get",
          "private-instance-get",
          "protected-abstract-get",
          "public-abstract-get",
          "decorated-get",
          "abstract-get",
          "protected-get",
          "public-get",
          "private-get",
          "static-get",
          "instance-get",
          "get",
          // Setters
          "protected-abstract-set",
          "public-abstract-set",
          "abstract-set",
          "protected-decorated-set",
          "public-decorated-set",
          "private-decorated-set",
          "protected-static-set",
          "public-static-set",
          "private-static-set",
          "protected-instance-set",
          "public-instance-set",
          "private-instance-set",
          "protected-set",
          "public-set",
          "private-set",
          "decorated-set",
          "static-set",
          "instance-set",
          "set",
          // Methods
          "public-static-method",
          "protected-static-method",
          "private-static-method",
          "public-decorated-method",
          "protected-decorated-method",
          "private-decorated-method",
          "public-abstract-method",
          "protected-abstract-method",
          "public-instance-method",
          "protected-instance-method",
          "private-instance-method"
        ]
      }
    ]
  }
}


================================================
FILE: .gitattributes
================================================
# Set the repository to show as TypeScript rather than JS in GitHub
*.js linguist-detectable=false

================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: "🐛 Bug Report"
about: Report a reproducible bug or regression.
title: ''
labels: bug
assignees: ''

---

## Current Behavior

<!-- Describe how the issue manifests. -->

## Expected Behavior

<!-- Describe what the desired behavior would be. -->

## Steps to Reproduce the Problem

  1.
  1.
  1.

## Environment

- Version: <!-- Version set in package.json -->
- Platform: <!-- Win/Mac/Linux -->
- Node.js Version: <!-- Output of running `node -v` -->


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
# This file is automatically added by @npmcli/template-oss. Do not edit.

blank_issues_enabled: true


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: 🌈 Feature request
about: Suggest an amazing new idea for this project
title: ''
labels: enhancement
assignees: ''

---

## Feature Request

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I have an issue when [...] -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. Add any considered drawbacks. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

## Are you willing to resolve this issue by submitting a Pull Request?

<!--
  Remember that first-time contributors are welcome! 🙌
-->

- [ ] Yes, I have the time, and I know how to start.
- [ ] Yes, I have the time, but I don't know how to start. I would need guidance.
- [ ] No, I don't have the time, although I believe I could do it if I had the time...
- [ ] No, I don't have the time and I wouldn't even know how to start.

<!--
  👋 Have a great day and thank you for the feature request!
-->


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!--
  😀 Wonderful!  Thank you for opening a pull request.

  Please fill in the information below to expedite the review
  and (hopefully) merge of your change.
-->

### Description of change

<!--
  Please be clear and concise what the change is intended to do,
  why this change is needed, and how you've verified that it
  corrects what you intended.

  In some cases it may be helpful to include the current behavior
  and the new behavior.

  If the change is related to an open issue, you can link it here.
  If you include `Fixes #0000` (replacing `0000` with the issue number)
  when this is merged it will automatically mark the issue as fixed and
  close it.
-->

### Pull-Request Checklist

<!--
  Please make sure to review and check all of the following.

  If an item is not applicable, you can add "N/A" to the end.
-->

- [ ] Code is up-to-date with the `main` branch
- [ ] `npm run lint` passes with this change
- [ ] `npm run test` passes with this change
- [ ] This pull request links relevant issues as `Fixes #0000`
- [ ] There are new or updated unit tests validating the change
- [ ] Added documentation inside `www/docs/main` folder.
- [ ] Included new files inside `index.doc.ts`.
- [ ] The new commits follow conventions outlined in the [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0/)

<!--
  🎉 Thank you for contributing!
-->


================================================
FILE: .github/dependabot.yml
================================================
# This file is automatically added by @npmcli/template-oss. Do not edit.

version: 2

updates:
  - package-ecosystem: npm
    directory: /
    schedule:
      interval: daily
    allow:
      - dependency-type: direct
    versioning-strategy: increase-if-necessary
    commit-message:
      prefix: deps
      prefix-development: chore
    labels:
      - "Dependencies"


================================================
FILE: .github/settings.yml
================================================
# This file is automatically added by @npmcli/template-oss. Do not edit.

repository:
  allow_merge_commit: false
  allow_rebase_merge: true
  allow_squash_merge: true
  squash_merge_commit_title: PR_TITLE
  squash_merge_commit_message: PR_BODY
  delete_branch_on_merge: true
  enable_automated_security_fixes: true
  enable_vulnerability_alerts: true

branches:
  - name: main
    protection:
      required_status_checks: null
      enforce_admins: true
      required_pull_request_reviews:
        require_last_push_approval: true
        dismiss_stale_reviews: true


================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: CodeQL

on:
  push:
    paths:
      - 'src/**'
      - 'package-lock.json'
      - 'package.json'
      - 'tsconfig.json'
      - 'tsconfig.*.json'
      - 'vite.config.ts'
    branches:
      - main
  pull_request:
    paths:
      - 'src/**'
      - 'package-lock.json'
      - 'package.json'
      - 'tsconfig.json'
      - 'tsconfig.*.json'
      - 'vite.config.ts'
    branches:
      - main
  schedule:
    # "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
    - cron: "0 10 * * 1"

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    timeout-minutes: 120
    permissions:
      actions: read
      contents: read
      security-events: write
    strategy:
      fail-fast: false
      matrix:
        language: [ 'javascript-typescript' ]
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Git User
        run: |
          git config --global user.email "h4ad+bot@viniciusl.com.br"
          git config --global user.name "H4ad CLI robot"

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: ${{ matrix.language }}

      - name: Autobuild
        uses: github/codeql-action/autobuild@v3

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3
        with:
          category: "/language:${{matrix.language}}"


================================================
FILE: .github/workflows/docs.yml
================================================
name: Deploy to GitHub Pages

on:
  push:
    branches:
      - main
    paths:
      - '.github/workflows/docs.yml'
      - 'www/**'
      - 'src/**'
      - 'scripts/**'
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: '18.x'

      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-18-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-18-

      - name: Install Lib Dependencies
        run: npm ci

      - name: Install Docs Dependencies
        run: npm ci
        working-directory: www

      - name: Parse TSDoc Documentation
        run: npm run docs:generate

      - name: Build Docs
        run: npm run build
        working-directory: www

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        if: ${{ github.ref == 'refs/heads/main' }}
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./www/build



================================================
FILE: .github/workflows/pr.yml
================================================
name: Pull Request

on:
  workflow_dispatch:
  pull_request:
    paths:
      - 'src/**'
      - 'package-lock.json'
      - 'package.json'
      - 'tsconfig.json'
      - 'tsconfig.*.json'
      - 'vite.config.ts'

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [18.x, 20.x]

    steps:
      - uses: actions/checkout@v4

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}

      - name: Update NPM Version
        run: npm i -g npm

      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-${{ matrix.node-version }}-

      - name: Install Lib Dependencies
        run: npm ci

      - name: Build
        run: npm run build

      - name: Run tests
        run: npm test

      - name: Get Coverage Info
        uses: codecov/codecov-action@v4
        with:
          fail_ci_if_error: true
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

  docs:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Use Node.js 18
        uses: actions/setup-node@v4
        with:
          node-version: '18.x'

      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-18.x-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-18.x-

      - name: Install Lib Dependencies
        run: npm ci

      - name: Install Docs Dependencies
        run: npm ci
        working-directory: www

      - name: Parse TSDoc Documentation
        run: npm run docs:generate

      - name: Build Docs
        run: npm run build
        working-directory: www


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write
  id-token: write

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Release Please
        uses: google-github-actions/release-please-action@v4
        id: release

      - name: Use Node 20.x
        uses: actions/setup-node@v4
        if: ${{ steps.release.outputs.release_created }}
        with:
          node-version: 20
          registry-url: 'https://registry.npmjs.org'

      - name: Install Deps
        run: npm ci
        if: ${{ steps.release.outputs.release_created }}

      - name: Build
        run: npm run build
        if: ${{ steps.release.outputs.release_created }}

      - name: Test
        run: npm run test
        if: ${{ steps.release.outputs.release_created }}

      - name: Get Coverage Info
        if: ${{ steps.release.outputs.release_created }}
        uses: codecov/codecov-action@v4
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

      - name: NPM Publish
        run: npm publish --provenance --access public
        if: ${{ steps.release.outputs.release_created }}
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}


================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
var

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env.test
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Compiled code
lib/

# IDEs
.idea

# tsdoc
temp
/etc
!etc/.gitkeep

# docs
www/api/*
!www/api/.gitkeep

.env
perf/


================================================
FILE: .husky/.gitignore
================================================
_


================================================
FILE: .husky/pre-commit
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run build
npm run test
npm run lint


================================================
FILE: .husky/prepare-commit-msg
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec </dev/tty && node_modules/.bin/cz --hook || true


================================================
FILE: .npmrc
================================================
; This file is automatically added by @npmcli/template-oss. Do not edit.

ignore-scripts=true


================================================
FILE: .prettierrc
================================================
{
  "singleQuote": true,
  "trailingComma": "all",
  "arrowParens": "avoid",
  "printWidth": 80
}


================================================
FILE: .release-please-manifest.json
================================================
{
  ".": "4.4.0"
}


================================================
FILE: .tmuxinator.yml
================================================
# ./.tmuxinator.yml

name: serverless-adapter
root: ./

# Optional tmux socket
# socket_name: foo

# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.

# Project hooks

# Runs on project start, always
# on_project_start: command

# Run on project start, the first time
# on_project_first_start: command

# Run on project start, after the first time
# on_project_restart: command

# Run on project exit ( detaching from tmux session )
# on_project_exit: command

# Run on project stop
# on_project_stop: cd liga.api.nestjs.eng && docker-compose stop postgres

# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247

# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf

# Change the command to call tmux.  This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu

# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: editor

# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
# startup_pane: 1

# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false

windows:
  - lib:
      layout: tilled
      # Synchronize all panes of this window, can be enabled before or after the pane commands run.
      # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
      # synchronize: after
      panes:
        - npm run test:watch
        - clear
  - docs:
      layout: tilled
      # Synchronize all panes of this window, can be enabled before or after the pane commands run.
      # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
      # synchronize: after
      panes:
        - cd www && npm run start
        - cd www
#  - api: cd backend && npm run start:debug
#  - app: cd app && ng serve


================================================
FILE: .tool-versions
================================================
nodejs 18.18.1


================================================
FILE: .vscode/launch.json
================================================
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Current TS File",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "node",
      "args": ["${relativeFile}"],
      "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
      "envFile": "${workspaceFolder}/.env",
      "cwd": "${workspaceRoot}",
      "internalConsoleOptions": "openOnSessionStart",
      "skipFiles": ["<node_internals>/**", "node_modules/**"]
    },
    {
      "name": "Debug Jest Tests",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "--inspect-brk",
        "${workspaceRoot}/node_modules/.bin/jest",
        "--runInBand"
      ],
      "envFile": "${workspaceFolder}/.env",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "port": 9229,
      "disableOptimisticBPs": true,
      "windows": {
        "program": "${workspaceFolder}/node_modules/jest/bin/jest"
      }
    },
    {
      "name": "Debug Jest Current File",
      "type": "node",
      "request": "launch",
      "program": "${workspaceFolder}/node_modules/.bin/jest",
      "args": ["${relativeFile}", "--config", "jest.config.js"],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "port": 9229,
      "disableOptimisticBPs": true,
      "windows": {
        "program": "${workspaceFolder}/node_modules/jest/bin/jest"
      }
    }
  ]
}


================================================
FILE: .vscode/settings.json
================================================
{
  "editor.formatOnSave": true,
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}


================================================
FILE: CHANGELOG.md
================================================
# Changelog

## [4.4.0](https://github.com/H4ad/serverless-adapter/compare/v4.3.2...v4.4.0) (2024-12-01)


### Features

* **express-v5:** added support to express v5 and body-parser v2 ([e435b97](https://github.com/H4ad/serverless-adapter/commit/e435b97e09783de62801374a1fb365c553ed4833))
* **fastify-v5:** ensure support to fastify v5 ([bd09e46](https://github.com/H4ad/serverless-adapter/commit/bd09e4685a78f12851ab0f99fab19dae26c52d8d))
* **firebase:** ensure support to v5 and v6 sdk ([bc6886e](https://github.com/H4ad/serverless-adapter/commit/bc6886eadab75c7f18e3e9c2bcc886ec3b7f714c))


### Miscellaneous Chores

* bump cross-spawn and @swc/cli in /benchmark ([0e4db68](https://github.com/H4ad/serverless-adapter/commit/0e4db6820ab0836f1e2dfbe60dc692288f0c7157))
* bump cross-spawn from 7.0.3 to 7.0.6 in /www ([ce1d0cd](https://github.com/H4ad/serverless-adapter/commit/ce1d0cdb27133402ed624fb3fba96caed95fa905))
* bump micromatch from 4.0.5 to 4.0.8 in /benchmark ([1ddc2a9](https://github.com/H4ad/serverless-adapter/commit/1ddc2a990f868e63d6f8c29b65e4f7a0056736f4))
* bump webpack from 5.89.0 to 5.96.1 in /www ([47392b0](https://github.com/H4ad/serverless-adapter/commit/47392b0bbd973ad06a30e364e334444144559944))
* **http-deepkit:** ensure is working with version 1.0.1-alpha-155 ([b1ee6d4](https://github.com/H4ad/serverless-adapter/commit/b1ee6d4beb3219b7d63350502073530c637c826b))
* **packages:** bump lib package versions ([15bc6ad](https://github.com/H4ad/serverless-adapter/commit/15bc6ad7baae905971c04c88337c563fe65e913c))

## [4.3.2](https://github.com/H4ad/serverless-adapter/compare/v4.3.1...v4.3.2) (2024-11-09)


### Continuous Integration

* **coverage:** do not fail when fail coverage & fix issue with test ([ff9702b](https://github.com/H4ad/serverless-adapter/commit/ff9702b38da650b94935481be54618a0fd765e6b))

## [4.3.1](https://github.com/H4ad/serverless-adapter/compare/v4.3.0...v4.3.1) (2024-11-09)


### Miscellaneous Chores

* bump cookie and express in /www ([22d850f](https://github.com/H4ad/serverless-adapter/commit/22d850fab96240c110ee6fbc75473c8bbefd11c2))
* bump serve-static and express in /benchmark ([249af0c](https://github.com/H4ad/serverless-adapter/commit/249af0c9d3dfa1f5fda23f8a49f720f3c96c4f07))
* **codecov:** fix issues with upload coverage ([4b5b39e](https://github.com/H4ad/serverless-adapter/commit/4b5b39e7c54d5b37913a9d7866a626515b8c06b6))
* **reflect-metadata:** allow more general versions for reflect metadata ([816cc51](https://github.com/H4ad/serverless-adapter/commit/816cc51afee8024907eb399ed9fe625f828c98ad))

## [4.3.0](https://github.com/H4ad/serverless-adapter/compare/v4.2.3...v4.3.0) (2024-09-18)


### Features

* **aws-stream-handler:** add flag to customize callbackWaitsForEmptyEventLoop ([#264](https://github.com/H4ad/serverless-adapter/issues/264)) ([30a59f9](https://github.com/H4ad/serverless-adapter/commit/30a59f99e83cd16f5a7c37bc4296f7501f59fd36))

## [4.2.3](https://github.com/H4ad/serverless-adapter/compare/v4.2.2...v4.2.3) (2024-09-09)


### Bug Fixes

* **response-stream:** improve chunk identification (fixes [#260](https://github.com/H4ad/serverless-adapter/issues/260)) ([2aa474e](https://github.com/H4ad/serverless-adapter/commit/2aa474e02c533d31b5086866a78afdedd3058f04))


### Documentation

* **response-stream:** add comments and references explaining implementation ([d39db53](https://github.com/H4ad/serverless-adapter/commit/d39db532a2ca9ebd7754dd364f88cf8bf0ed0a18))


### Tests

* **response-stream:** test eagerly flushed headers ([0f33c29](https://github.com/H4ad/serverless-adapter/commit/0f33c29e2bfc99194c61887bb908763625e357b7))

## [4.2.2](https://github.com/H4ad/serverless-adapter/compare/v4.2.1...v4.2.2) (2024-09-06)


### Bug Fixes

* **apig-v1-adapter:** lowercase request headers ([4fbb588](https://github.com/H4ad/serverless-adapter/commit/4fbb5880283ba0fad54374baeb572ca706b804e6))


### Documentation

* fix Apollo Server package name in npm command ([4d4cece](https://github.com/H4ad/serverless-adapter/commit/4d4ceced9d2f882f7431830134d293c187aff4f3))
* **getting-started:** update npm install command ([ee4661f](https://github.com/H4ad/serverless-adapter/commit/ee4661fc3a7a3d518d4ff3f4ff033ce5a01066ba))


### Miscellaneous Chores

* bump express from 4.18.2 to 4.19.2 in /benchmark ([98e84d1](https://github.com/H4ad/serverless-adapter/commit/98e84d1a6cb7d05bab6506bf2225573c8bd6e50d))

## [4.2.1](https://github.com/H4ad/serverless-adapter/compare/v4.2.0...v4.2.1) (2024-02-29)


### Bug Fixes

* **response-stream:** fix response with no content doesn't correctly end the writable stream ([bded8cf](https://github.com/H4ad/serverless-adapter/commit/bded8cfe32a853529fea7334658709b12b2971e1))


### Code Refactoring

* **apollo-server-mutation:** better types for adapter ([79f3383](https://github.com/H4ad/serverless-adapter/commit/79f33833c4368282d421495b6f7a70a700bd06bb))
* **response-stream:** avoid creating object on log while parsing headers ([1effcae](https://github.com/H4ad/serverless-adapter/commit/1effcaebf23e83188d4836693428f1953d0403be))


### Tests

* **all:** cleaning tests and fixing ts issues ([c3dcfff](https://github.com/H4ad/serverless-adapter/commit/c3dcfff58ac3bc29294337abd074c567724a8198))
* **aws-stream:** add tests to cover [#206](https://github.com/H4ad/serverless-adapter/issues/206) ([c853149](https://github.com/H4ad/serverless-adapter/commit/c853149a6295f015b467825f20a60790cb346f65))

## [4.2.0](https://github.com/H4ad/serverless-adapter/compare/v4.1.0...v4.2.0) (2024-01-08)


### Features

* **frameworks:** added support for polka ([39377cb](https://github.com/H4ad/serverless-adapter/commit/39377cb16b20bdba7b724663b8076a6a394851a6))


### Miscellaneous Chores

* bump @apollo/server from 4.9.5 to 4.10.0 ([cf4e1d9](https://github.com/H4ad/serverless-adapter/commit/cf4e1d9485fe174c68ae1b70dc2c6d6e7a220c02))
* bump @rushstack/node-core-library from 3.62.0 to 3.63.0 ([19c88e0](https://github.com/H4ad/serverless-adapter/commit/19c88e01c74a8e4735ba66f6b5b77b2cbd579897))
* bump @vitest/coverage-v8 from 1.1.0 to 1.1.3 ([3e67b23](https://github.com/H4ad/serverless-adapter/commit/3e67b23dba80b00c65667c312578f07d39111919))
* bump eslint-plugin-prettier from 5.1.1 to 5.1.2 ([83fc5e5](https://github.com/H4ad/serverless-adapter/commit/83fc5e5cac5a08701815a6c73563a51866fdcbf9))
* bump fastify from 4.25.1 to 4.25.2 ([e048b11](https://github.com/H4ad/serverless-adapter/commit/e048b117034c2f4e7f3b25467dd24fa3b754e684))
* bump follow-redirects from 1.15.3 to 1.15.4 in /www ([af12bbd](https://github.com/H4ad/serverless-adapter/commit/af12bbd55d264dc2be668e24cb1f551e333f33ba))
* bump koa from 2.14.2 to 2.15.0 ([164c97b](https://github.com/H4ad/serverless-adapter/commit/164c97ba10e6d0ee4661bc980d279262f4a982c1))
* bump vite from 5.0.10 to 5.0.11 ([0478492](https://github.com/H4ad/serverless-adapter/commit/04784922a49429a57f9bbbd4773e42c069ce2cca))

## [4.1.0](https://github.com/H4ad/serverless-adapter/compare/v4.0.1...v4.1.0) (2024-01-03)


### Features

* **network:** support buffering transfer-encoding: chunked ([f19ffd1](https://github.com/H4ad/serverless-adapter/commit/f19ffd1f6b2da4cccbd2be6e48429c566719ade6))

## [4.0.1](https://github.com/H4ad/serverless-adapter/compare/v4.0.0...v4.0.1) (2023-12-26)


### Bug Fixes

* **ci:** missing build part while releasing new version ([5b7d184](https://github.com/H4ad/serverless-adapter/commit/5b7d18410acdc0aa547de2db63cf6347a5715b58))


### Documentation

* **blog:** added note about bug related to missing package files ([1d75d91](https://github.com/H4ad/serverless-adapter/commit/1d75d91fe8863c45ae2a7abe44aec6d51d96e44d))

## [4.0.0](https://github.com/H4ad/serverless-adapter/compare/v3.2.0...v4.0.0) (2023-12-26)


### ⚠ BREAKING CHANGES

* Now we support dual package publish, and the import can fail.

### Features

* added support for dual package publish ([dd0803f](https://github.com/H4ad/serverless-adapter/commit/dd0803ff5ebcabf22120da88b74a720c3661f846))


### Bug Fixes

* **dual-package-publish:** issue with imports lib when moduleResolution is node ([4dac8aa](https://github.com/H4ad/serverless-adapter/commit/4dac8aa07ef015f3b0fd8f8d766705271e93c111))


### Documentation

* **blog:** added blogpost about dual package publish ([006e8a9](https://github.com/H4ad/serverless-adapter/commit/006e8a94b02152e4857cda7951e285ff2b449430))
* updated documentation for dual package publish ([03ee217](https://github.com/H4ad/serverless-adapter/commit/03ee21746bee785d840ab26a1ec5ddf2bd6dea90))


### Continuous Integration

* **release:** fixed issue with release-please skipping release ([8dfb582](https://github.com/H4ad/serverless-adapter/commit/8dfb582742481f7e37e076f00c51d32907f401fd))

## [3.2.0](https://github.com/H4ad/serverless-adapter/compare/v3.1.0...v3.2.0) (2023-12-22)


### Features

* **firebase:** bump supported firebase functions to 4.x ([b717240](https://github.com/H4ad/serverless-adapter/commit/b717240a808d7d81905745347b17969e7caaf6f5))


### Documentation

* **readme:** removed semantic release badge ([fe85304](https://github.com/H4ad/serverless-adapter/commit/fe8530439df4ed48d3542127227ae98954fd84a5))


### Miscellaneous Chores

* **benchmark:** bump package versions ([b6aa539](https://github.com/H4ad/serverless-adapter/commit/b6aa539bb499fcadd2393c7bf010dfe6d726f2d5))
* bootstrap releases for path: . ([e68506e](https://github.com/H4ad/serverless-adapter/commit/e68506ea9c5a5fb8492b7cc7bb03400c95700668))
* bump @apollo/server from 4.7.4 to 4.9.3 ([52c8b83](https://github.com/H4ad/serverless-adapter/commit/52c8b83db4d8b80120aea6ccb32e8b4580466168))
* bump semver from 5.7.1 to 5.7.2 in /benchmark ([0a6a3e0](https://github.com/H4ad/serverless-adapter/commit/0a6a3e0a0e536f43e2c61f307f955b01a97e1169))
* bump semver from 5.7.1 to 5.7.2 in /www ([49c7baf](https://github.com/H4ad/serverless-adapter/commit/49c7baf364e251d78da4349ab35c6b69837a003d))
* bump vite from 4.3.5 to 4.4.9 ([ecd1252](https://github.com/H4ad/serverless-adapter/commit/ecd125253229ed032f21606238fbc27fc74d5e95))
* bump vite from 4.4.9 to 5.0.10 ([8eadf40](https://github.com/H4ad/serverless-adapter/commit/8eadf405eea86facff1268b9fb4d5d153a873fbb))
* bump word-wrap from 1.2.3 to 1.2.4 ([218d3a9](https://github.com/H4ad/serverless-adapter/commit/218d3a906c0b18156110c4c8fe155d0f183fca29))
* **docs:** update to docusaurus v3 ([51a104e](https://github.com/H4ad/serverless-adapter/commit/51a104e000e867ae3601a70408cec8d0ab2d8cc3))
* **package:** bump package versions ([fe0a0fc](https://github.com/H4ad/serverless-adapter/commit/fe0a0fc35c687037dfa172dbb667c4451d539ad8))
* **release-please:** set latest version ([69110ec](https://github.com/H4ad/serverless-adapter/commit/69110ec1f418831ac4a49545d1bf40c291212293))
* **semantic-release:** removed unused package ([2c60275](https://github.com/H4ad/serverless-adapter/commit/2c602753ecd3fcdff23567ec8a77e317ebd7f9fe))


### Continuous Integration

* **codeql:** run only when changing code files ([93d8f1c](https://github.com/H4ad/serverless-adapter/commit/93d8f1c029e2c84e5c4b1366ecddc9b1b11c6fa5))
* **codeql:** updated configuration ([9ffa3e8](https://github.com/H4ad/serverless-adapter/commit/9ffa3e8b5f4c7df8772cd64ef8640646879f713f))
* **docs:** only trigger when update workflows of docs ([c1e7f8a](https://github.com/H4ad/serverless-adapter/commit/c1e7f8aefdaf18a12f5a26c2b0cbc94f4c830322))
* **pr:** only run when update specific files ([0085520](https://github.com/H4ad/serverless-adapter/commit/0085520b20edb0a33111bdb7780195805d31b0af))
* **pr:** stop running the pr on main ([7c7a05a](https://github.com/H4ad/serverless-adapter/commit/7c7a05a78928a2ef96d67dae38f6f56b25361575))
* **release-please:** try fix issues with release please config ([46577f2](https://github.com/H4ad/serverless-adapter/commit/46577f2c79bcc9f20b9925f6fa629f534d63a4f9))
* **release:** added coverage ([57f1e09](https://github.com/H4ad/serverless-adapter/commit/57f1e09d63936546764708880e5dd5e799c332b6))
* **release:** added provenance during publish ([1161e42](https://github.com/H4ad/serverless-adapter/commit/1161e4227fb63ad272ba740ba186de63d40955c3))
* **release:** include all commits on release ([9185a0b](https://github.com/H4ad/serverless-adapter/commit/9185a0b6ab34174905669cfdd084b2cc9afe54bb))
* **release:** moved configuration to the correct place ([b8c6156](https://github.com/H4ad/serverless-adapter/commit/b8c6156eb3d7df06f1c370965e91abc850217adc))
* **release:** use release manager instead of merge-and-release ([ef278e6](https://github.com/H4ad/serverless-adapter/commit/ef278e6efc2732e5e21d2e3ae9d32fb96ac1edc2))
* **workflows:** bump action versions ([647e694](https://github.com/H4ad/serverless-adapter/commit/647e694ce6919925c5df4188450e49faa5ec3fc8))

CHANGES:

## [3.1.0](https://github.com/H4ad/serverless-adapter/compare/v3.0.0...v3.1.0) (2023-07-01)


### Bug Fixes

* **build:** disable minify identifiers ([0a285a6](https://github.com/H4ad/serverless-adapter/commit/0a285a6b2249d56ce39a762872bcc7cfb4515f8c))
* **package:** types not being emitted ([2bc1244](https://github.com/H4ad/serverless-adapter/commit/2bc124456f41855798ed7d5c4a132b2d83bf16fd))


### Features

* **aws:** added adapter for request lambda edge ([b8791da](https://github.com/H4ad/serverless-adapter/commit/b8791da9c4718a837d9ae01d89bba7b30067dc52))

## [3.0.0](https://github.com/H4ad/serverless-adapter/compare/v2.17.0...v3.0.0) (2023-06-09)


### Bug Fixes

* **api-gateway-v1:** probably missing query string value when multiple ([78b9f18](https://github.com/H4ad/serverless-adapter/commit/78b9f18dfb8a459f0c1557fdf702f68a078c098b))


* perf(api-gateway-v2)!: single pass when collecting headers and cookies on response ([3d65895](https://github.com/H4ad/serverless-adapter/commit/3d65895f174db00e2e45b3626223874a2d71f40a))
* refactor(core)!: removed support for regex on binary validation and case-sensitive headers ([4fb3a39](https://github.com/H4ad/serverless-adapter/commit/4fb3a39f0434d29d66b018f451698954ecbf3ed4))
* chore(nodejs)!: deprecate node 12.x, 14.x and 16.x ([4c734d4](https://github.com/H4ad/serverless-adapter/commit/4c734d4fed3bb9384b514ccf28d41f34c5360b76))


### Features

* **trpc:** bump support for 10.x ([5d3124a](https://github.com/H4ad/serverless-adapter/commit/5d3124a115dc44099fc681eec9592636374f85b8))


### Performance Improvements

* **api-gateway-v1:** faster getRequest ([70f7020](https://github.com/H4ad/serverless-adapter/commit/70f7020e347e57417920b32eb68d4456df7db246))
* **api-gateway-v2:** faster getRequest method ([3b08708](https://github.com/H4ad/serverless-adapter/commit/3b087087af1873414c85c8db09b5867c0752ab56))
* **aws:** optimized strip base path ([f72967a](https://github.com/H4ad/serverless-adapter/commit/f72967afaa1cdc4dbc95cc2298d560dc21b27884))
* **default-handler:** always log using fn ([36950b3](https://github.com/H4ad/serverless-adapter/commit/36950b36e246a43dc45d2d9ef2d989402eef916b))
* **headers:** use object.keys + reduce instead of entries ([41339c6](https://github.com/H4ad/serverless-adapter/commit/41339c681f52b05328097a8b4cbb9cf27e704a84))
* **logger:** faster logger ([103817c](https://github.com/H4ad/serverless-adapter/commit/103817c7a284dabedb78807d6db7fbf2ed42ed75))
* **optional:** use strict equal instead of typeof ([1fba12c](https://github.com/H4ad/serverless-adapter/commit/1fba12c6e22089376437a8976971ad30df1283e1))
* **tsconfig:** do not use define because is slower ([35ce7c7](https://github.com/H4ad/serverless-adapter/commit/35ce7c738b69a39b7179f1d8cae40924967ad0cd))


### Tests

* **vitest:** replaced jest for vitest ([7505fad](https://github.com/H4ad/serverless-adapter/commit/7505fad2b3078aabbc72c105033043c597842933))


### BREAKING CHANGES

* now we don't flatten the headers
* now regex is not support anymore due the slow performance and we don't lower case
all the headers, so the content-encoding and content-type must be lowercase
* **vitest:** removed support for fastify 3.0.0 & hapi 20.x & firebase-admin < 11
* Now we will no longer support old nodejs versions


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change. 

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Install the dependencies with `npm ci` and then go into the `www` folder and install the dependencies again.
2. After creating your resource or fixing a bug, verify that the tests are correct with `npm run test`.
3. Be sure to update the documentation if you add a new feature, the docs are inside `www/docs/main`, to see your changes, run `npm run start`.
4. Once we've reviewed and ensured that all of these things are correct, we'll merge your Pull-Request.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [@vinii_joga10](https://twitter.com/vinii_joga10). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2022 Vinícius Lourenço

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.


================================================
FILE: README.md
================================================
<h1 align="center">
  🚀 Serverless Adapter
</h1>

<p align="center">
  <a href="#install">Install</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  <a href="#usage">Usage</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  <a href="#support">Support</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  <a href="#examples">Examples</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  <a href="#benchmark">Benchmark</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  <a href="#architecture">Architecture</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  <a href="#credits">Credits</a>
</p>

[![npm package][npm-img]][npm-url]
[![Build Status][build-img]][build-url]
[![Downloads][downloads-img]][downloads-url]
[![Issues][issues-img]][issues-url]
[![Code Coverage][codecov-img]][codecov-url]
[![Commitizen Friendly][commitizen-img]][commitizen-url]

Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Deepkit, Express (v4 and v5), Koa, Hapi,
Fastify, tRPC and Apollo Server), on top of AWS Lambda, Azure, Digital Ocean and many other clouds.

This library was a refactored version of [@vendia/serverless-express](https://github.com/vendia/serverless-express), I
create a new way to interact and extend event sources by creating contracts to abstract the integrations between each
library layer.

Why you would use this libray instead of [@vendia/serverless-express](https://github.com/vendia/serverless-express)?

- Better APIs to extend library functionality.
  - You don't need me to release a new version to integrate with the new event source, you can create an adapter and
    just call the `addAdapter` method when building your handler.
- All code can be extended, if you want to modify the current behavior you can.
  - This is important because if you find a bug, you can quickly resolve it by extending the class, _and then you can
    submit a PR to fix the bug_.
- All code was written in Typescript.
- Well documented, any method, class, or interface has comments to explain the behavior.
- We have >99% coverage.

# Installing

To be able to use, first install the library:

```bash
npm i --save @h4ad/serverless-adapter
```

# Usage

To start to use, first you need to know what you need to import, let's start showing the [ServerlessAdapter](/docs/api/ServerlessAdapter).

```tsx
import { ServerlessAdapter } from '@h4ad/serverless-adapter';
```

We need to pass to [Serverless Adapter](/docs/api/ServerlessAdapter) the instance of your api, let's look an example with:

- Framework: [Express](../frameworks/express).
- Adapters: [AWS Api Gateway V2 Adapter](../adapters/aws/api-gateway-v2).
- Handler: [Default Handler](../handlers/default).
- Resolver: [Promise Resolver](../resolvers/promise).

```ts
import { ServerlessAdapter } from '@h4ad/serverless-adapter';
import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
import { DefaultHandler } from '@h4ad/serverless-adapter/lib/handlers/default';
import { PromiseResolver } from '@h4ad/serverless-adapter/lib/resolvers/promise';
import { ApiGatewayV2Adapter } from '@h4ad/serverless-adapter/lib/adapters/aws';

const express = require('express');

const app = express();
export const handler = ServerlessAdapter.new(app)
  .setFramework(new ExpressFramework())
  .setHandler(new DefaultHandler())
  .setResolver(new PromiseResolver())
  .addAdapter(new ApiGatewayV2Adapter())
  // if you need more adapters
  // just append more `addAdapter` calls
  .build();
```

# Documentation

See how to use this library [here](https://viniciusl.com.br/serverless-adapter/docs/category/getting-started).

# Breaking Changes

I will not consider updating/breaking compatibility of a NodeJS framework as a breaking change,
because I had a lot of supported frameworks and if I created a major version for each one it would be a mess.

So if you want predictability, pin the version with `~` instead of `^`.

# Examples

You can see some examples of how to use this library [here](https://github.com/H4ad/serverless-adapter-examples).

# Benchmark

See the speed comparison between other libraries that have the same purpose in the [Benchmark Section](./benchmark).

# Credits

Honestly, I just refactored all the code that the @vendia team and many other contributors wrote, thanks so much to them
for existing and giving us a brilliant library that is the core of my current company.

# Sponsors

| <a href="https://liga.facens.br/"><img height="50" src="https://mlogu6g7z5ex.i.optimole.com/yEwfkqo-4R0ttNtd/w:auto/h:auto/q:mauto/f:avif/http://liga.facens.br/wp-content/uploads/2020/03/logo-1.png" title="The LIGA logo" width="100"/></a> |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

[build-img]:https://github.com/H4ad/serverless-adapter/actions/workflows/release.yml/badge.svg

[build-url]:https://github.com/H4ad/serverless-adapter/actions/workflows/release.yml

[downloads-img]:https://img.shields.io/npm/dt/serverless-adapter

[downloads-url]:https://www.npmtrends.com/@h4ad/serverless-adapter

[npm-img]:https://img.shields.io/npm/v/@h4ad/serverless-adapter

[npm-url]:https://www.npmjs.com/package/@h4ad/serverless-adapter

[issues-img]:https://img.shields.io/github/issues/H4ad/serverless-adapter

[issues-url]:https://github.com/H4ad/serverless-adapter/issues

[codecov-img]:https://codecov.io/gh/H4ad/serverless-adapter/branch/main/graph/badge.svg

[codecov-url]:https://codecov.io/gh/H4ad/serverless-adapter

[commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg

[commitizen-url]:http://commitizen.github.io/cz-cli/


================================================
FILE: api-extractor.json
================================================
/**
 * Config file for API Extractor.  For more info, please visit: https://api-extractor.com
 */
{
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
  /**
   * Optionally specifies another JSON config file that this file extends from.  This provides a way for
   * standard settings to be shared across multiple projects.
   *
   * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
   * the "extends" field.  Otherwise, the first path segment is interpreted as an NPM package name, and will be
   * resolved using NodeJS require().
   *
   * SUPPORTED TOKENS: none
   * DEFAULT VALUE: ""
   */
  // "extends": "./shared/api-extractor-base.json"
  // "extends": "my-package/include/api-extractor-base.json"

  /**
   * Determines the "<projectFolder>" token that can be used with other config file settings.  The project folder
   * typically contains the tsconfig.json and package.json config files, but the path is user-defined.
   *
   * The path is resolved relative to the folder of the config file that contains the setting.
   *
   * The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
   * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
   * that contains a tsconfig.json file.  If a tsconfig.json file cannot be found in this way, then an error
   * will be reported.
   *
   * SUPPORTED TOKENS: <lookup>
   * DEFAULT VALUE: "<lookup>"
   */
  // "projectFolder": "..",

  /**
   * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis.  API Extractor
   * analyzes the symbols exported by this module.
   *
   * The file extension must be ".d.ts" and not ".ts".
   *
   * The path is resolved relative to the folder of the config file that contains the setting; to change this,
   * prepend a folder token such as "<projectFolder>".
   *
   * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
   */
  "mainEntryPointFilePath": "<projectFolder>/lib/index.doc.d.ts",
  /**
   * A list of NPM package names whose exports should be treated as part of this package.
   *
   * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1",
   * and another NPM package "library2" is embedded in this bundle.  Some types from library2 may become part
   * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly
   * imports library2.  To avoid this, we can specify:
   *
   *   "bundledPackages": [ "library2" ],
   *
   * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
   * local files for library1.
   */
  "bundledPackages": [],
  /**
   * Determines how the TypeScript compiler engine will be invoked by API Extractor.
   */
  "compiler": {
    /**
     * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * Note: This setting will be ignored if "overrideTsconfig" is used.
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<projectFolder>/tsconfig.json"
     */
    // "tsconfigFilePath": "<projectFolder>/tsconfig.json",
    /**
     * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
     * The object must conform to the TypeScript tsconfig schema:
     *
     * http://json.schemastore.org/tsconfig
     *
     * If omitted, then the tsconfig.json file will be read from the "projectFolder".
     *
     * DEFAULT VALUE: no overrideTsconfig section
     */
    // "overrideTsconfig": {
    //   . . .
    // }
    /**
     * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
     * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
     * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
     * for its analysis.  Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
     *
     * DEFAULT VALUE: false
     */
    // "skipLibCheck": true,
  },
  /**
   * Configures how the API report file (*.api.md) will be generated.
   */
  "apiReport": {
    /**
     * (REQUIRED) Whether to generate an API report.
     */
    "enabled": true

    /**
     * The filename for the API report files.  It will be combined with "reportFolder" or "reportTempFolder" to produce
     * a full file path.
     *
     * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
     *
     * SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<unscopedPackageName>.api.md"
     */
    // "reportFileName": "<unscopedPackageName>.api.md",

    /**
     * Specifies the folder where the API report file is written.  The file name portion is determined by
     * the "reportFileName" setting.
     *
     * The API report file is normally tracked by Git.  Changes to it can be used to trigger a branch policy,
     * e.g. for an API review.
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<projectFolder>/etc/"
     */
    // "reportFolder": "<projectFolder>/etc/",

    /**
     * Specifies the folder where the temporary report file is written.  The file name portion is determined by
     * the "reportFileName" setting.
     *
     * After the temporary file is written to disk, it is compared with the file in the "reportFolder".
     * If they are different, a production build will fail.
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<projectFolder>/temp/"
     */
    // "reportTempFolder": "<projectFolder>/temp/"
  },
  /**
   * Configures how the doc model file (*.api.json) will be generated.
   */
  "docModel": {
    /**
     * (REQUIRED) Whether to generate a doc model file.
     */
    "enabled": true

    /**
     * The output path for the doc model file.  The file extension should be ".api.json".
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
     */
    // "apiJsonFilePath": "<projectFolder>/temp/<unscopedPackageName>.api.json"
  },
  /**
   * Configures how the .d.ts rollup file will be generated.
   */
  "dtsRollup": {
    /**
     * (REQUIRED) Whether to generate the .d.ts rollup file.
     */
    "enabled": true

    /**
     * Specifies the output path for a .d.ts rollup file to be generated without any trimming.
     * This file will include all declarations that are exported by the main entry point.
     *
     * If the path is an empty string, then this file will not be written.
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
     */
    // "untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",

    /**
     * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
     * This file will include only declarations that are marked as "@public" or "@beta".
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: ""
     */
    // "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",

    /**
     * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
     * This file will include only declarations that are marked as "@public".
     *
     * If the path is an empty string, then this file will not be written.
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: ""
     */
    // "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",

    /**
     * When a declaration is trimmed, by default it will be replaced by a code comment such as
     * "Excluded from this release type: exampleMember".  Set "omitTrimmingComments" to true to remove the
     * declaration completely.
     *
     * DEFAULT VALUE: false
     */
    // "omitTrimmingComments": true
  },
  /**
   * Configures how the tsdoc-metadata.json file will be generated.
   */
  "tsdocMetadata": {
    /**
     * Whether to generate the tsdoc-metadata.json file.
     *
     * DEFAULT VALUE: true
     */
    // "enabled": true,
    /**
     * Specifies where the TSDoc metadata file should be written.
     *
     * The path is resolved relative to the folder of the config file that contains the setting; to change this,
     * prepend a folder token such as "<projectFolder>".
     *
     * The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
     * "typings" or "main" fields of the project's package.json.  If none of these fields are set, the lookup
     * falls back to "tsdoc-metadata.json" in the package folder.
     *
     * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
     * DEFAULT VALUE: "<lookup>"
     */
    // "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
  },
  /**
   * Specifies what type of newlines API Extractor should use when writing output files.  By default, the output files
   * will be written with Windows-style newlines.  To use POSIX-style newlines, specify "lf" instead.
   * To use the OS's default newline kind, specify "os".
   *
   * DEFAULT VALUE: "crlf"
   */
  // "newlineKind": "crlf",

  /**
   * Configures how API Extractor reports error and warning messages produced during analysis.
   *
   * There are three sources of messages:  compiler messages, API Extractor messages, and TSDoc messages.
   */
  "messages": {
    /**
     * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
     * the input .d.ts files.
     *
     * TypeScript message identifiers start with "TS" followed by an integer.  For example: "TS2551"
     *
     * DEFAULT VALUE:  A single "default" entry with logLevel=warning.
     */
    "compilerMessageReporting": {
      /**
       * Configures the default routing for messages that don't match an explicit rule in this table.
       */
      "default": {
        /**
         * Specifies whether the message should be written to the the tool's output log.  Note that
         * the "addToApiReportFile" property may supersede this option.
         *
         * Possible values: "error", "warning", "none"
         *
         * Errors cause the build to fail and return a nonzero exit code.  Warnings cause a production build fail
         * and return a nonzero exit code.  For a non-production build (e.g. when "api-extractor run" includes
         * the "--local" option), the warning is displayed but the build will not fail.
         *
         * DEFAULT VALUE: "warning"
         */
        "logLevel": "warning"

        /**
         * When addToApiReportFile is true:  If API Extractor is configured to write an API report file (.api.md),
         * then the message will be written inside that file; otherwise, the message is instead logged according to
         * the "logLevel" option.
         *
         * DEFAULT VALUE: false
         */
        // "addToApiReportFile": false
      }

      // "TS2551": {
      //   "logLevel": "warning",
      //   "addToApiReportFile": true
      // },
      //
      // . . .
    },
    /**
     * Configures handling of messages reported by API Extractor during its analysis.
     *
     * API Extractor message identifiers start with "ae-".  For example: "ae-extra-release-tag"
     *
     * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
     */
    "extractorMessageReporting": {
      "default": {
        "logLevel": "warning"
        // "addToApiReportFile": false
      }

      // "ae-extra-release-tag": {
      //   "logLevel": "warning",
      //   "addToApiReportFile": true
      // },
      //
      // . . .
    },
    /**
     * Configures handling of messages reported by the TSDoc parser when analyzing code comments.
     *
     * TSDoc message identifiers start with "tsdoc-".  For example: "tsdoc-link-tag-unescaped-text"
     *
     * DEFAULT VALUE:  A single "default" entry with logLevel=warning.
     */
    "tsdocMessageReporting": {
      "default": {
        "logLevel": "warning"
        // "addToApiReportFile": false
      }

      // "tsdoc-link-tag-unescaped-text": {
      //   "logLevel": "warning",
      //   "addToApiReportFile": true
      // },
      //
      // . . .
    }
  }
}


================================================
FILE: benchmark/.gitignore
================================================
node_modules
*.cpuprofile
.clinic


================================================
FILE: benchmark/.swcrc
================================================
{
  "env": {
    "targets": "node >= 18"
  },
  "module": {
    "type": "commonjs",
    "strict": true,
  },
  "jsc": {
    "target": "es2022",
    "parser": {
      "syntax": "typescript",
      "tsx": false,
      "dynamicImport": true
    }
  }
}


================================================
FILE: benchmark/README.md
================================================
# Benchmark

In this folder, we have benchmarks to compare the speed of this library with others.

## How to Run

```bash
git clone git@github.com:H4ad/serverless-adapter.git
cd serverless-adapter
npm ci
npm run build
npm pack
cd benchmark
npm ci
npm i ../h4ad-serverless-adapter-0.0.0-development.tgz
npm run bench
```

## Latest Run

- CPU: Ryzen 2200g
- Memory: 32GB 3200Hz

```md
@h4ad/serverless-adapter x 46,463 ops/sec ±10.75% (65 runs sampled)
@vendia/serverless-express x 8,726 ops/sec ±18.64% (82 runs sampled)
serverless-http x 48,246 ops/sec ±8.00% (70 runs sampled)
Fastest is serverless-http,@h4ad/serverless-adapter
```


================================================
FILE: benchmark/package.json
================================================
{
  "name": "benchmark",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "swc src --out-dir dist",
    "bench": "npm run build && node dist/samples/compare-libraries.js"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/H4ad/serverless-adapter.git"
  },
  "license": "MIT",
  "author": {
    "name": "Vinícius Lourenço",
    "email": "H4ad@users.noreply.github.com",
    "url": "https://github.com/H4ad"
  },
  "dependencies": {
    "@h4ad/serverless-adapter": "file:../h4ad-serverless-adapter-0.0.0-development.tgz",
    "@swc/cli": "0.5.1",
    "@swc/core": "1.3.101",
    "@vendia/serverless-express": "4.12.6",
    "benchmark": "2.1.4",
    "express": "4.21.1",
    "serverless-http": "3.2.0",
    "stream-mock": "2.0.5"
  },
  "devDependencies": {
    "@types/benchmark": "2.1.5",
    "aws-lambda": "1.0.7",
    "chokidar": "3.5.3",
    "ts-node": "10.9.2",
    "typescript": "5.3.3"
  }
}


================================================
FILE: benchmark/src/events.ts
================================================
import { getMultiValueHeadersMap } from '@h4ad/serverless-adapter';
import type {
  APIGatewayProxyEvent,
  APIGatewayProxyEventQueryStringParameters,
} from 'aws-lambda/trigger/api-gateway-proxy';

export function createApiGatewayV1(
  httpMethod: string,
  path: string,
  body?: Record<string, unknown>,
  headers?: Record<string, string>,
  queryParams?: APIGatewayProxyEventQueryStringParameters,
): APIGatewayProxyEvent {
  return {
    resource: '/{proxy+}',
    path,
    httpMethod,
    headers: {
      Accept: '*/*',
      'Accept-Encoding': 'gzip, deflate, br',
      'Accept-Language': 'en-US,en;q=0.9',
      'cache-control': 'no-cache',
      'CloudFront-Forwarded-Proto': 'https',
      'CloudFront-Is-Desktop-Viewer': 'true',
      'CloudFront-Is-Mobile-Viewer': 'false',
      'CloudFront-Is-SmartTV-Viewer': 'false',
      'CloudFront-Is-Tablet-Viewer': 'false',
      'CloudFront-Viewer-Country': 'US',
      'content-type': '',
      Host: 'xxxxxx.execute-api.us-east-1.amazonaws.com',
      origin: 'https://xxxxxx.execute-api.us-east-1.amazonaws.com',
      pragma: 'no-cache',
      Referer: 'https://xxxxxx.execute-api.us-east-1.amazonaws.com/prod/',
      'User-Agent':
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36',
      Via: '2.0 00f0a41f749793b9dd653153037c957e.cloudfront.net (CloudFront)',
      'X-Amz-Cf-Id': '2D5N65SYHJdnJfEmAV_hC0Mw3QvkbUXDumJKAL786IGHRdq_MggPtA==',
      'X-Amzn-Trace-Id': 'Root=1-5cdf30d0-31a428004abe13807f9445b0',
      'X-Forwarded-For': '11.111.111.111, 11.111.111.111',
      'X-Forwarded-Port': '443',
      'X-Forwarded-Proto': 'https',
      ...headers,
    },
    multiValueHeaders: {
      Accept: ['*/*'],
      'Accept-Encoding': ['gzip, deflate, br'],
      'Accept-Language': ['en-US,en;q=0.9'],
      'cache-control': ['no-cache'],
      'CloudFront-Forwarded-Proto': ['https'],
      'CloudFront-Is-Desktop-Viewer': ['true'],
      'CloudFront-Is-Mobile-Viewer': ['false'],
      'CloudFront-Is-SmartTV-Viewer': ['false'],
      'CloudFront-Is-Tablet-Viewer': ['false'],
      'CloudFront-Viewer-Country': ['US'],
      'content-type': [],
      Host: ['xxxxxx.execute-api.us-east-1.amazonaws.com'],
      origin: ['https://xxxxxx.execute-api.us-east-1.amazonaws.com'],
      pragma: ['no-cache'],
      Referer: ['https://xxxxxx.execute-api.us-east-1.amazonaws.com/prod/'],
      'User-Agent': [
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36',
      ],
      Via: ['2.0 00f0a41f749793b9dd653153037c957e.cloudfront.net (CloudFront)'],
      'X-Amz-Cf-Id': [
        '2D5N65SYHJdnJfEmAV_hC0Mw3QvkbUXDumJKAL786IGHRdq_MggPtA==',
      ],
      'X-Amzn-Trace-Id': ['Root=1-5cdf30d0-31a428004abe13807f9445b0'],
      'X-Forwarded-For': ['11.111.111.111, 11.111.111.111'],
      'X-Forwarded-Port': ['443'],
      'X-Forwarded-Proto': ['https'],
      ...(headers && getMultiValueHeadersMap(headers)),
    },
    queryStringParameters: queryParams || null,
    multiValueQueryStringParameters:
      (queryParams && getMultiValueHeadersMap(queryParams)) || null,
    pathParameters: {
      path: path.replace(/^\//, ''),
    },
    stageVariables: {},
    requestContext: {
      authorizer: {
        claims: null,
        scopes: null,
      },
      resourceId: 'xxxxx',
      resourcePath: '/{proxy+}',
      httpMethod: 'POST',
      extendedRequestId: 'Z2SQlEORIAMFjpA=',
      requestTime: '17/May/2019:22:08:16 +0000',
      path,
      accountId: 'xxxxxxxx',
      protocol: 'HTTP/1.1',
      stage: 'prod',
      domainPrefix: 'xxxxxx',
      requestTimeEpoch: 1558130896565,
      requestId: '4589cf16-78f0-11e9-9c65-816a9b037cec',
      identity: {
        apiKey: null,
        apiKeyId: null,
        clientCert: null,
        cognitoIdentityPoolId: null,
        accountId: null,
        cognitoIdentityId: null,
        caller: null,
        sourceIp: '11.111.111.111',
        principalOrgId: null,
        accessKey: null,
        cognitoAuthenticationType: null,
        cognitoAuthenticationProvider: null,
        userArn: null,
        userAgent:
          'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36',
        user: null,
      },
      domainName: 'xxxxxx.execute-api.us-east-1.amazonaws.com',
      apiId: 'xxxxxx',
    },
    body: (body && JSON.stringify(body)) || null,
    isBase64Encoded: false,
  };
}


================================================
FILE: benchmark/src/framework.mock.ts
================================================
import { FrameworkContract } from '@h4ad/serverless-adapter';
import type { IncomingMessage, ServerResponse } from 'http';
import { ObjectReadableMock } from 'stream-mock';

/**
 * The class that represents a mock for framework that forward the request body to the response.
 *
 * @internal
 */
export class FrameworkMock implements FrameworkContract<null> {
  //#region Constructor

  /**
   * Construtor padrão
   */
  constructor(
    protected readonly statusCode: number,
    protected readonly mockedResponseData: object,
  ) {}

  //#endregion

  /**
   * {@inheritDoc}
   */
  public sendRequest(
    _: null,
    __: IncomingMessage,
    response: ServerResponse,
  ): void {
    const writableOutput = new ObjectReadableMock(
      [Buffer.from(JSON.stringify(this.mockedResponseData))],
      {
        objectMode: true,
      },
    );

    response.statusCode = this.statusCode;
    response.setHeader('content-type', 'application/json');

    writableOutput.pipe(response);
  }
}


================================================
FILE: benchmark/src/samples/clone-headers.ts
================================================
import benchmark from 'benchmark';
import { createApiGatewayV1 } from '../events';

const eventV1ApiGateway = createApiGatewayV1('GET', '/test');

const randomTest = [
  createApiGatewayV1('GET', '/pat2'),
  createApiGatewayV1('GET', '/pat3'),
];
const headers = createApiGatewayV1('GET', '/pat2').headers;
const suite = new benchmark.Suite();

suite.add('{...}', () => {
  const result = { ...headers };
});
suite.add('structuredClone', () =>
  structuredClone(headers),
);
suite.add('JSON.parse + JSON.stringify', () =>
  JSON.parse(JSON.stringify(headers)),
);
suite.add('for loop + object.keys', () => {
  const headers = {};

  for (const key of Object.keys([Math.floor(Math.random() * 2)]))
    headers[key] = headers[key];
});

suite
  .on('cycle', function (event) {
    console.log(String(event.target));
  })
  .on('complete', function () {
    console.log('Fastest is ' + this.filter('fastest').map('name'));
  })
  .run({
    async: false,
  });


================================================
FILE: benchmark/src/samples/compare-libraries.ts
================================================
import { ServerlessAdapter } from '@h4ad/serverless-adapter/lib';
import { ApiGatewayV1Adapter } from '@h4ad/serverless-adapter/lib/adapters/aws';
import { DefaultHandler } from '@h4ad/serverless-adapter/lib/handlers/default';
import { PromiseResolver } from '@h4ad/serverless-adapter/lib/resolvers/promise';
import vendia from '@vendia/serverless-express';
import benchmark from 'benchmark';
import serverlessHttp from 'serverless-http';
import { createApiGatewayV1 } from '../events';
import { FrameworkMock } from '../framework.mock';

console.log('Running simply-forward.ts');

const framework = new FrameworkMock(200, { message: 'Hello world' });
const handler = ServerlessAdapter.new(null)
  .setHandler(new DefaultHandler())
  .setResolver(new PromiseResolver())
  .setFramework(framework)
  .addAdapter(new ApiGatewayV1Adapter())
  .build();

const falseApp = (req, res) => framework.sendRequest(null, req, res);
const vendiaHandler = vendia({
  app: falseApp,
});

const serverlessHttpHandler = serverlessHttp(falseApp);

const context = {} as any;
const callback = {} as any;

const eventV1ApiGateway = createApiGatewayV1('GET', '/test');

const suite = new benchmark.Suite();

suite.add(
  '@h4ad/serverless-adapter',
  async () => await handler(eventV1ApiGateway, context, callback),
);
suite.add(
  '@vendia/serverless-express',
  async () => await vendiaHandler(eventV1ApiGateway, context, callback),
);
suite.add(
  'serverless-http',
  async () => await serverlessHttpHandler(eventV1ApiGateway, context),
);

suite
  .on('cycle', function (event) {
    console.log(String(event.target));
  })
  .on('complete', function () {
    console.log('Fastest is ' + this.filter('fastest').map('name'));
  })
  .run({
    async: false,
  });


================================================
FILE: benchmark/src/samples/format-headers.ts
================================================
import benchmark from 'benchmark';
import { BothValueHeaders } from '../../../src';
import { createApiGatewayV1 } from '../events';

function getFlattenedHeadersMap(
  headersMap: BothValueHeaders,
  separator: string = ',',
  lowerCaseKey: boolean = false,
): Record<string, string> {
  const commaDelimitedHeaders: Record<string, string> = {};
  const headersMapEntries = Object.entries(headersMap);

  for (const [headerKey, headerValue] of headersMapEntries) {
    const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey;

    if (Array.isArray(headerValue))
      commaDelimitedHeaders[newKey] = headerValue.join(separator);
    else commaDelimitedHeaders[newKey] = String(headerValue ?? '');
  }

  return commaDelimitedHeaders;
}

function getFlattenedHeadersV2(
  headersMap: BothValueHeaders,
  separator: string = ',',
  lowerCaseKey: boolean = false,
): Record<string, string> {
  const commaDelimitedHeaders: Record<string, string> = {};

  for (const [headerKey, headerValue] of Object.entries(headersMap)) {
    const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey;

    if (Array.isArray(headerValue))
      commaDelimitedHeaders[newKey] = headerValue.join(separator);
    else commaDelimitedHeaders[newKey] = (headerValue ?? '') + '';
  }

  return commaDelimitedHeaders;
}

function getFlattenedHeadersV3(
  headersMap: BothValueHeaders,
  separator: string = ',',
  lowerCaseKey: boolean = false,
): Record<string, string> {
  return Object.keys(headersMap).reduce((acc, headerKey) => {
    const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey;
    const headerValue = headersMap[headerKey];

    if (Array.isArray(headerValue)) acc[newKey] = headerValue.join(separator);
    else acc[newKey] = (headerValue ?? '') + '';

    return acc;
  }, {});
}

const eventV1ApiGateway = createApiGatewayV1('GET', '/test');

const suite = new benchmark.Suite();

suite.add('getFlattenedHeadersMap', () =>
  getFlattenedHeadersMap(eventV1ApiGateway.headers),
);
suite.add('getFlattenedHeadersV2', () =>
  getFlattenedHeadersV2(eventV1ApiGateway.headers),
);
suite.add('getFlattenedHeadersV3', () =>
  getFlattenedHeadersV3(eventV1ApiGateway.headers),
);

suite
  .on('cycle', function (event) {
    console.log(String(event.target));
  })
  .on('complete', function () {
    console.log('Fastest is ' + this.filter('fastest').map('name'));
  })
  .run({
    async: false,
  });


================================================
FILE: benchmark/tsconfig.json
================================================
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "node",
    "jsx": "preserve",
    "declaration": true,
    "outDir": "dist",
    "allowJs": false,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "strict": true,
    "skipLibCheck": true,
    "noImplicitAny": false,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "strictNullChecks": true,
    "useUnknownInCatchVariables": false
  },
  "include": [
    "src/**/*.ts"
  ],
  "ts-node": {
    "esm": true
  }
}


================================================
FILE: package.json
================================================
{
  "name": "@h4ad/serverless-adapter",
  "version": "4.4.0",
  "description": "Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, Hapi, Fastify and many others), on top of AWS, Azure, Digital Ocean and many other clouds.",
  "type": "module",
  "main": "./lib/index.cjs",
  "module": "./lib/index.mjs",
  "types": "./lib/index.d.ts",
  "files": [
    "lib/**/*"
  ],
  "scripts": {
    "prepare": "husky install",
    "build": "tsup",
    "build:docs": "tsc -p tsconfig.doc.json",
    "clean": "rm -rf ./lib/",
    "cm": "cz",
    "lint": "eslint ./src/ ./test/  --fix",
    "docs:generate": "npm run docs:generate:parsing && npm run docs:generate:markdown && npm run docs:generate:api-pages",
    "docs:generate:parsing": "npm run build:docs && npx tsx scripts/parse-docs.ts",
    "docs:generate:markdown": "npx tsx ./scripts/generate-markdown.ts",
    "docs:generate:api-pages": "npx tsx ./scripts/generate-api-pages.ts",
    "test:watch": "vitest --watch",
    "test": "vitest --run --coverage",
    "typecheck": "tsc --noEmit"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/H4ad/serverless-adapter.git"
  },
  "license": "MIT",
  "author": {
    "name": "Vinícius Lourenço",
    "email": "H4ad@users.noreply.github.com",
    "url": "https://github.com/H4ad"
  },
  "engines": {
    "node": ">=18.0.0"
  },
  "keywords": [
    "aws",
    "serverless",
    "api gateway",
    "sqs",
    "sns",
    "lambda edge",
    "alb",
    "lambda",
    "lambda streaming",
    "response streaming",
    "apollo server",
    "express",
    "koa",
    "hapi",
    "fastify",
    "node.js",
    "http",
    "huawei",
    "functiongraph",
    "trpc",
    "azure",
    "azure functions",
    "http trigger v4",
    "firebase",
    "firebase functions",
    "firebase http events",
    "deepkit",
    "deepkit http",
    "digital ocean",
    "digital ocean functions",
    "digital ocean serverless",
    "gcp",
    "google cloud functions",
    "polka"
  ],
  "bugs": {
    "url": "https://github.com/H4ad/serverless-adapter/issues"
  },
  "homepage": "https://github.com/H4ad/serverless-adapter#readme",
  "devDependencies": {
    "@apollo/server": "4.10.0",
    "@azure/functions": "3.5.1",
    "@deepkit/app": "1.0.1-alpha.155",
    "@deepkit/core": "1.0.1-alpha.154",
    "@deepkit/framework": "1.0.1-alpha.155",
    "@deepkit/http": "1.0.1-alpha.155",
    "@deepkit/injector": "1.0.1-alpha.155",
    "@deepkit/logger": "1.0.1-alpha.155",
    "@deepkit/stopwatch": "1.0.1-alpha.155",
    "@deepkit/type": "1.0.1-alpha.155",
    "@deepkit/workflow": "1.0.1-alpha.155",
    "@google-cloud/functions-framework": "3.4.2",
    "@hapi/hapi": "21.3.2",
    "@microsoft/api-documenter": "7.26.0",
    "@microsoft/api-extractor": "7.48.0",
    "@microsoft/api-extractor-model": "7.30.0",
    "@microsoft/tsdoc": "0.15.1",
    "@rushstack/node-core-library": "5.10.0",
    "@trpc/server": "10.45.2",
    "@types/aws-lambda": "8.10.146",
    "@types/body-parser": "1.19.5",
    "@types/cors": "2.8.17",
    "@types/express": "4.17.21",
    "@types/koa": "2.15.0",
    "@types/node": "18.19.67",
    "@types/polka": "0.5.7",
    "@types/supertest": "6.0.2",
    "@typescript-eslint/eslint-plugin": "6.21.0",
    "@typescript-eslint/parser": "6.21.0",
    "@vitest/coverage-v8": "2.1.6",
    "body-parser": "1.20.3",
    "body-parser-v2": "npm:body-parser@2",
    "commitizen": "4.3.0",
    "cors": "2.8.5",
    "cz-conventional-changelog": "3.3.0",
    "esbuild": "0.24.0",
    "eslint": "8.57.1",
    "eslint-config-prettier": "9.1.0",
    "eslint-plugin-import": "2.31.0",
    "eslint-plugin-node": "11.1.0",
    "eslint-plugin-prettier": "5.2.1",
    "eslint-plugin-tsdoc": "0.4.0",
    "express": "4.21.1",
    "express-v5": "npm:express@5",
    "fastify": "4.28.1",
    "fastify-v5": "npm:fastify@5",
    "firebase-admin": "11.11.1",
    "firebase-functions": "4.5.0",
    "firebase-functions-v5": "npm:firebase-functions@5",
    "firebase-functions-v6": "npm:firebase-functions@6",
    "glob": "10.4.5",
    "husky": "8.0.3",
    "koa": "2.15.3",
    "polka": "0.5.2",
    "prettier": "3.4.1",
    "stream-mock": "2.0.5",
    "supertest": "6.3.4",
    "ts-node": "10.9.2",
    "tsup": "8.3.5",
    "typedoc": "0.27.2",
    "typescript": "~5.3.3",
    "vite": "6.0.1",
    "vitest": "2.1.6"
  },
  "peerDependencies": {
    "@apollo/server": ">= 4.0.0",
    "@azure/functions": ">= 2.0.0",
    "@deepkit/http": ">= 1.0.1-alpha.94",
    "@google-cloud/functions-framework": ">= 3.0.0",
    "@hapi/hapi": ">= 21.0.0",
    "@trpc/server": ">= 10.0.0",
    "@types/aws-lambda": ">= 8.10.92",
    "@types/body-parser": ">= 1.19.2",
    "@types/cors": ">= 2.8.12",
    "@types/express": ">= 4.15.4",
    "@types/koa": ">= 2.11.2",
    "body-parser": ">= 1.20.0",
    "cors": ">= 2.8.5",
    "express": ">= 4.15.4",
    "fastify": ">= 4.0.0",
    "firebase-admin": ">= 11.0.0",
    "firebase-functions": ">= 4.0.0",
    "http-errors": ">= 2.0.0",
    "koa": ">= 2.5.1",
    "reflect-metadata": ">= 0.1.13"
  },
  "peerDependenciesMeta": {
    "@apollo/server": {
      "optional": true
    },
    "@azure/functions": {
      "optional": true
    },
    "@deepkit/http": {
      "optional": true
    },
    "@google-cloud/functions-framework": {
      "optional": true
    },
    "@hapi/hapi": {
      "optional": true
    },
    "@trpc/server": {
      "optional": true
    },
    "@types/aws-lambda": {
      "optional": true
    },
    "@types/express": {
      "optional": true
    },
    "@types/hapi": {
      "optional": true
    },
    "@types/koa": {
      "optional": true
    },
    "body-parser": {
      "optional": true
    },
    "cors": {
      "optional": true
    },
    "express": {
      "optional": true
    },
    "fastify": {
      "optional": true
    },
    "firebase-admin": {
      "optional": true
    },
    "firebase-functions": {
      "optional": true
    },
    "http-errors": {
      "optional": true
    },
    "koa": {
      "optional": true
    },
    "reflect-metadata": {
      "optional": true
    }
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  },
  "publishConfig": {
    "access": "public"
  },
  "exports": {
    ".": {
      "import": {
        "types": "./lib/index.d.ts",
        "default": "./lib/index.mjs"
      },
      "require": {
        "types": "./lib/index.d.cts",
        "default": "./lib/index.cjs"
      }
    },
    "./adapters/apollo-server": {
      "import": {
        "types": "./lib/adapters/apollo-server/index.d.ts",
        "default": "./lib/adapters/apollo-server/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/apollo-server/index.d.cts",
        "default": "./lib/adapters/apollo-server/index.cjs"
      }
    },
    "./lib/adapters/apollo-server": {
      "import": {
        "types": "./lib/adapters/apollo-server/index.d.ts",
        "default": "./lib/adapters/apollo-server/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/apollo-server/index.d.cts",
        "default": "./lib/adapters/apollo-server/index.cjs"
      }
    },
    "./adapters/aws": {
      "import": {
        "types": "./lib/adapters/aws/index.d.ts",
        "default": "./lib/adapters/aws/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/aws/index.d.cts",
        "default": "./lib/adapters/aws/index.cjs"
      }
    },
    "./lib/adapters/aws": {
      "import": {
        "types": "./lib/adapters/aws/index.d.ts",
        "default": "./lib/adapters/aws/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/aws/index.d.cts",
        "default": "./lib/adapters/aws/index.cjs"
      }
    },
    "./adapters/azure": {
      "import": {
        "types": "./lib/adapters/azure/index.d.ts",
        "default": "./lib/adapters/azure/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/azure/index.d.cts",
        "default": "./lib/adapters/azure/index.cjs"
      }
    },
    "./lib/adapters/azure": {
      "import": {
        "types": "./lib/adapters/azure/index.d.ts",
        "default": "./lib/adapters/azure/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/azure/index.d.cts",
        "default": "./lib/adapters/azure/index.cjs"
      }
    },
    "./adapters/digital-ocean": {
      "import": {
        "types": "./lib/adapters/digital-ocean/index.d.ts",
        "default": "./lib/adapters/digital-ocean/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/digital-ocean/index.d.cts",
        "default": "./lib/adapters/digital-ocean/index.cjs"
      }
    },
    "./lib/adapters/digital-ocean": {
      "import": {
        "types": "./lib/adapters/digital-ocean/index.d.ts",
        "default": "./lib/adapters/digital-ocean/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/digital-ocean/index.d.cts",
        "default": "./lib/adapters/digital-ocean/index.cjs"
      }
    },
    "./adapters/dummy": {
      "import": {
        "types": "./lib/adapters/dummy/index.d.ts",
        "default": "./lib/adapters/dummy/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/dummy/index.d.cts",
        "default": "./lib/adapters/dummy/index.cjs"
      }
    },
    "./lib/adapters/dummy": {
      "import": {
        "types": "./lib/adapters/dummy/index.d.ts",
        "default": "./lib/adapters/dummy/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/dummy/index.d.cts",
        "default": "./lib/adapters/dummy/index.cjs"
      }
    },
    "./adapters/huawei": {
      "import": {
        "types": "./lib/adapters/huawei/index.d.ts",
        "default": "./lib/adapters/huawei/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/huawei/index.d.cts",
        "default": "./lib/adapters/huawei/index.cjs"
      }
    },
    "./lib/adapters/huawei": {
      "import": {
        "types": "./lib/adapters/huawei/index.d.ts",
        "default": "./lib/adapters/huawei/index.mjs"
      },
      "require": {
        "types": "./lib/adapters/huawei/index.d.cts",
        "default": "./lib/adapters/huawei/index.cjs"
      }
    },
    "./frameworks/apollo-server": {
      "import": {
        "types": "./lib/frameworks/apollo-server/index.d.ts",
        "default": "./lib/frameworks/apollo-server/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/apollo-server/index.d.cts",
        "default": "./lib/frameworks/apollo-server/index.cjs"
      }
    },
    "./lib/frameworks/apollo-server": {
      "import": {
        "types": "./lib/frameworks/apollo-server/index.d.ts",
        "default": "./lib/frameworks/apollo-server/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/apollo-server/index.d.cts",
        "default": "./lib/frameworks/apollo-server/index.cjs"
      }
    },
    "./frameworks/body-parser": {
      "import": {
        "types": "./lib/frameworks/body-parser/index.d.ts",
        "default": "./lib/frameworks/body-parser/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/body-parser/index.d.cts",
        "default": "./lib/frameworks/body-parser/index.cjs"
      }
    },
    "./lib/frameworks/body-parser": {
      "import": {
        "types": "./lib/frameworks/body-parser/index.d.ts",
        "default": "./lib/frameworks/body-parser/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/body-parser/index.d.cts",
        "default": "./lib/frameworks/body-parser/index.cjs"
      }
    },
    "./frameworks/cors": {
      "import": {
        "types": "./lib/frameworks/cors/index.d.ts",
        "default": "./lib/frameworks/cors/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/cors/index.d.cts",
        "default": "./lib/frameworks/cors/index.cjs"
      }
    },
    "./lib/frameworks/cors": {
      "import": {
        "types": "./lib/frameworks/cors/index.d.ts",
        "default": "./lib/frameworks/cors/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/cors/index.d.cts",
        "default": "./lib/frameworks/cors/index.cjs"
      }
    },
    "./frameworks/deepkit": {
      "import": {
        "types": "./lib/frameworks/deepkit/index.d.ts",
        "default": "./lib/frameworks/deepkit/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/deepkit/index.d.cts",
        "default": "./lib/frameworks/deepkit/index.cjs"
      }
    },
    "./lib/frameworks/deepkit": {
      "import": {
        "types": "./lib/frameworks/deepkit/index.d.ts",
        "default": "./lib/frameworks/deepkit/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/deepkit/index.d.cts",
        "default": "./lib/frameworks/deepkit/index.cjs"
      }
    },
    "./frameworks/express": {
      "import": {
        "types": "./lib/frameworks/express/index.d.ts",
        "default": "./lib/frameworks/express/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/express/index.d.cts",
        "default": "./lib/frameworks/express/index.cjs"
      }
    },
    "./lib/frameworks/express": {
      "import": {
        "types": "./lib/frameworks/express/index.d.ts",
        "default": "./lib/frameworks/express/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/express/index.d.cts",
        "default": "./lib/frameworks/express/index.cjs"
      }
    },
    "./frameworks/fastify": {
      "import": {
        "types": "./lib/frameworks/fastify/index.d.ts",
        "default": "./lib/frameworks/fastify/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/fastify/index.d.cts",
        "default": "./lib/frameworks/fastify/index.cjs"
      }
    },
    "./lib/frameworks/fastify": {
      "import": {
        "types": "./lib/frameworks/fastify/index.d.ts",
        "default": "./lib/frameworks/fastify/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/fastify/index.d.cts",
        "default": "./lib/frameworks/fastify/index.cjs"
      }
    },
    "./frameworks/hapi": {
      "import": {
        "types": "./lib/frameworks/hapi/index.d.ts",
        "default": "./lib/frameworks/hapi/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/hapi/index.d.cts",
        "default": "./lib/frameworks/hapi/index.cjs"
      }
    },
    "./lib/frameworks/hapi": {
      "import": {
        "types": "./lib/frameworks/hapi/index.d.ts",
        "default": "./lib/frameworks/hapi/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/hapi/index.d.cts",
        "default": "./lib/frameworks/hapi/index.cjs"
      }
    },
    "./frameworks/koa": {
      "import": {
        "types": "./lib/frameworks/koa/index.d.ts",
        "default": "./lib/frameworks/koa/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/koa/index.d.cts",
        "default": "./lib/frameworks/koa/index.cjs"
      }
    },
    "./lib/frameworks/koa": {
      "import": {
        "types": "./lib/frameworks/koa/index.d.ts",
        "default": "./lib/frameworks/koa/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/koa/index.d.cts",
        "default": "./lib/frameworks/koa/index.cjs"
      }
    },
    "./frameworks/lazy": {
      "import": {
        "types": "./lib/frameworks/lazy/index.d.ts",
        "default": "./lib/frameworks/lazy/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/lazy/index.d.cts",
        "default": "./lib/frameworks/lazy/index.cjs"
      }
    },
    "./lib/frameworks/lazy": {
      "import": {
        "types": "./lib/frameworks/lazy/index.d.ts",
        "default": "./lib/frameworks/lazy/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/lazy/index.d.cts",
        "default": "./lib/frameworks/lazy/index.cjs"
      }
    },
    "./frameworks/polka": {
      "import": {
        "types": "./lib/frameworks/polka/index.d.ts",
        "default": "./lib/frameworks/polka/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/polka/index.d.cts",
        "default": "./lib/frameworks/polka/index.cjs"
      }
    },
    "./lib/frameworks/polka": {
      "import": {
        "types": "./lib/frameworks/polka/index.d.ts",
        "default": "./lib/frameworks/polka/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/polka/index.d.cts",
        "default": "./lib/frameworks/polka/index.cjs"
      }
    },
    "./frameworks/trpc": {
      "import": {
        "types": "./lib/frameworks/trpc/index.d.ts",
        "default": "./lib/frameworks/trpc/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/trpc/index.d.cts",
        "default": "./lib/frameworks/trpc/index.cjs"
      }
    },
    "./lib/frameworks/trpc": {
      "import": {
        "types": "./lib/frameworks/trpc/index.d.ts",
        "default": "./lib/frameworks/trpc/index.mjs"
      },
      "require": {
        "types": "./lib/frameworks/trpc/index.d.cts",
        "default": "./lib/frameworks/trpc/index.cjs"
      }
    },
    "./handlers/aws": {
      "import": {
        "types": "./lib/handlers/aws/index.d.ts",
        "default": "./lib/handlers/aws/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/aws/index.d.cts",
        "default": "./lib/handlers/aws/index.cjs"
      }
    },
    "./lib/handlers/aws": {
      "import": {
        "types": "./lib/handlers/aws/index.d.ts",
        "default": "./lib/handlers/aws/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/aws/index.d.cts",
        "default": "./lib/handlers/aws/index.cjs"
      }
    },
    "./handlers/azure": {
      "import": {
        "types": "./lib/handlers/azure/index.d.ts",
        "default": "./lib/handlers/azure/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/azure/index.d.cts",
        "default": "./lib/handlers/azure/index.cjs"
      }
    },
    "./lib/handlers/azure": {
      "import": {
        "types": "./lib/handlers/azure/index.d.ts",
        "default": "./lib/handlers/azure/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/azure/index.d.cts",
        "default": "./lib/handlers/azure/index.cjs"
      }
    },
    "./handlers/default": {
      "import": {
        "types": "./lib/handlers/default/index.d.ts",
        "default": "./lib/handlers/default/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/default/index.d.cts",
        "default": "./lib/handlers/default/index.cjs"
      }
    },
    "./lib/handlers/default": {
      "import": {
        "types": "./lib/handlers/default/index.d.ts",
        "default": "./lib/handlers/default/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/default/index.d.cts",
        "default": "./lib/handlers/default/index.cjs"
      }
    },
    "./handlers/digital-ocean": {
      "import": {
        "types": "./lib/handlers/digital-ocean/index.d.ts",
        "default": "./lib/handlers/digital-ocean/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/digital-ocean/index.d.cts",
        "default": "./lib/handlers/digital-ocean/index.cjs"
      }
    },
    "./lib/handlers/digital-ocean": {
      "import": {
        "types": "./lib/handlers/digital-ocean/index.d.ts",
        "default": "./lib/handlers/digital-ocean/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/digital-ocean/index.d.cts",
        "default": "./lib/handlers/digital-ocean/index.cjs"
      }
    },
    "./handlers/firebase": {
      "import": {
        "types": "./lib/handlers/firebase/index.d.ts",
        "default": "./lib/handlers/firebase/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/firebase/index.d.cts",
        "default": "./lib/handlers/firebase/index.cjs"
      }
    },
    "./lib/handlers/firebase": {
      "import": {
        "types": "./lib/handlers/firebase/index.d.ts",
        "default": "./lib/handlers/firebase/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/firebase/index.d.cts",
        "default": "./lib/handlers/firebase/index.cjs"
      }
    },
    "./handlers/gcp": {
      "import": {
        "types": "./lib/handlers/gcp/index.d.ts",
        "default": "./lib/handlers/gcp/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/gcp/index.d.cts",
        "default": "./lib/handlers/gcp/index.cjs"
      }
    },
    "./lib/handlers/gcp": {
      "import": {
        "types": "./lib/handlers/gcp/index.d.ts",
        "default": "./lib/handlers/gcp/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/gcp/index.d.cts",
        "default": "./lib/handlers/gcp/index.cjs"
      }
    },
    "./handlers/huawei": {
      "import": {
        "types": "./lib/handlers/huawei/index.d.ts",
        "default": "./lib/handlers/huawei/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/huawei/index.d.cts",
        "default": "./lib/handlers/huawei/index.cjs"
      }
    },
    "./lib/handlers/huawei": {
      "import": {
        "types": "./lib/handlers/huawei/index.d.ts",
        "default": "./lib/handlers/huawei/index.mjs"
      },
      "require": {
        "types": "./lib/handlers/huawei/index.d.cts",
        "default": "./lib/handlers/huawei/index.cjs"
      }
    },
    "./resolvers/aws-context": {
      "import": {
        "types": "./lib/resolvers/aws-context/index.d.ts",
        "default": "./lib/resolvers/aws-context/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/aws-context/index.d.cts",
        "default": "./lib/resolvers/aws-context/index.cjs"
      }
    },
    "./lib/resolvers/aws-context": {
      "import": {
        "types": "./lib/resolvers/aws-context/index.d.ts",
        "default": "./lib/resolvers/aws-context/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/aws-context/index.d.cts",
        "default": "./lib/resolvers/aws-context/index.cjs"
      }
    },
    "./resolvers/callback": {
      "import": {
        "types": "./lib/resolvers/callback/index.d.ts",
        "default": "./lib/resolvers/callback/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/callback/index.d.cts",
        "default": "./lib/resolvers/callback/index.cjs"
      }
    },
    "./lib/resolvers/callback": {
      "import": {
        "types": "./lib/resolvers/callback/index.d.ts",
        "default": "./lib/resolvers/callback/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/callback/index.d.cts",
        "default": "./lib/resolvers/callback/index.cjs"
      }
    },
    "./resolvers/dummy": {
      "import": {
        "types": "./lib/resolvers/dummy/index.d.ts",
        "default": "./lib/resolvers/dummy/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/dummy/index.d.cts",
        "default": "./lib/resolvers/dummy/index.cjs"
      }
    },
    "./lib/resolvers/dummy": {
      "import": {
        "types": "./lib/resolvers/dummy/index.d.ts",
        "default": "./lib/resolvers/dummy/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/dummy/index.d.cts",
        "default": "./lib/resolvers/dummy/index.cjs"
      }
    },
    "./resolvers/promise": {
      "import": {
        "types": "./lib/resolvers/promise/index.d.ts",
        "default": "./lib/resolvers/promise/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/promise/index.d.cts",
        "default": "./lib/resolvers/promise/index.cjs"
      }
    },
    "./lib/resolvers/promise": {
      "import": {
        "types": "./lib/resolvers/promise/index.d.ts",
        "default": "./lib/resolvers/promise/index.mjs"
      },
      "require": {
        "types": "./lib/resolvers/promise/index.d.cts",
        "default": "./lib/resolvers/promise/index.cjs"
      }
    }
  }
}


================================================
FILE: release-please-config.json
================================================
{
  "packages": {
    ".": {
      "release-type": "node",
      "bump-minor-pre-major": false,
      "bump-patch-for-minor-pre-major": false,
      "draft": false,
      "prerelease": false,
      "draft-pull-request": true,
      "include-component-in-tag": false,
      "include-v-in-tag": true,
      "separate-pull-requests": false,
      "skip-github-release": false,
      "versioning": "default",
      "pull-request-header": ":robot: I have created a release *beep* *boop*",
      "pull-request-title-pattern": "chore${scope}: release${component} ${version}",
      "changelog-path": "CHANGELOG.md",
      "changelog-host": "https://github.com",
      "changelog-type": "default",
      "changelog-sections": [
        {
          "type": "feat",
          "section": "Features"
        },
        {
          "type": "feature",
          "section": "Features"
        },
        {
          "type": "fix",
          "section": "Bug Fixes"
        },
        {
          "type": "perf",
          "section": "Performance Improvements"
        },
        {
          "type": "revert",
          "section": "Reverts"
        },
        {
          "type": "docs",
          "section": "Documentation"
        },
        {
          "type": "style",
          "section": "Styles"
        },
        {
          "type": "chore",
          "section": "Miscellaneous Chores"
        },
        {
          "type": "refactor",
          "section": "Code Refactoring"
        },
        {
          "type": "test",
          "section": "Tests"
        },
        {
          "type": "build",
          "section": "Build System"
        },
        {
          "type": "ci",
          "section": "Continuous Integration"
        }
      ]
    }
  },
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}


================================================
FILE: scripts/generate-api-pages.ts
================================================
import { writeFileSync } from 'fs';
import { resolve } from 'path';
import {
  ApiDocumentedItem,
  ApiItem,
  ApiModel,
} from '@microsoft/api-extractor-model';
import { DocNode, DocNodeKind, DocPlainText } from '@microsoft/tsdoc';

const apiModelPath = resolve('.', 'temp', 'serverless-adapter.api.json');
const outputFile = resolve('.', 'www', 'sidebar-api-generated.js');

type BreadcrumbItem = {
  breadcrumbs: string[];
  apiMember: ApiItem;
};

function isPlainTextNode(block: DocNode): block is DocPlainText {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
  return block.kind === DocNodeKind.PlainText;
}

function getBreadcrumbsWithApiItem(apiModel: ApiModel): BreadcrumbItem[] {
  const breadcrumbs: BreadcrumbItem[] = [];

  for (const apiPackage of apiModel.members) {
    for (const apiEntrypoint of apiPackage.members) {
      for (const apiMember of apiEntrypoint.members) {
        const apiDocumentedItem = apiMember as ApiDocumentedItem;

        if (!apiDocumentedItem.tsdocComment) continue;

        const breadcrumb = apiDocumentedItem.tsdocComment.customBlocks.find(
          block => block.blockTag.tagName === '@breadcrumb',
        );

        if (!breadcrumb) continue;

        const breadcrumbContent = breadcrumb.content
          .getChildNodes()
          // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
          .filter(block => block.kind === DocNodeKind.Paragraph)
          // @ts-ignore
          .reduce((acc, block) => [...acc, ...block.getChildNodes()], [])
          // @ts-ignore
          .filter(isPlainTextNode)
          .map((plainText: DocPlainText) => plainText.text)
          .join('');

        breadcrumbs.push({
          breadcrumbs: breadcrumbContent
            .split('/')
            .map(section => section.trimLeft().trimRight()),
          apiMember,
        });
      }
    }
  }

  return breadcrumbs;
}

type SidebarItem = {
  type: string;
  label: string;
  link?: {
    type: string;
    id: string;
  };
  items: Sidebar[];
};

type Sidebar = SidebarItem;

function build(): void {
  const apiModel = new ApiModel();

  apiModel.loadPackage(apiModelPath);

  const breadcrumbsWithApiItems = getBreadcrumbsWithApiItem(apiModel);

  const pages: Sidebar[] = [];

  for (const breadcrumbWithApiItem of breadcrumbsWithApiItems) {
    let lastPage: SidebarItem | undefined;

    for (const breadcrumb of breadcrumbWithApiItem.breadcrumbs) {
      const newPage: SidebarItem = {
        type: 'category',
        label: breadcrumb,
        items: [],
        link: {
          id: `./api/${breadcrumb}`,
          type: 'doc',
        },
      };

      if (lastPage) {
        let subpage = lastPage.items.find(page => page.label === breadcrumb);

        if (!subpage) {
          subpage = newPage;

          lastPage.items.push(subpage);
        }

        lastPage = subpage;
      } else {
        const oldPage = pages.find(page => page.label === breadcrumb);

        if (oldPage) lastPage = oldPage;
        else {
          lastPage = newPage;

          pages.push(lastPage);
        }
      }
    }

    if (!lastPage) {
      throw new Error(
        `Breadcrumb was configured incorrectly. Error found in ${breadcrumbWithApiItem.apiMember.displayName}.`,
      );
    }

    lastPage.items.push({
      type: 'category',
      label: breadcrumbWithApiItem.apiMember.displayName,
      items: [],
    });
  }

  writeFileSync(outputFile, `export default ${JSON.stringify(pages)}`);
}

build();


================================================
FILE: scripts/generate-markdown.ts
================================================
import { readFileSync, writeFileSync } from 'fs';
import { join, resolve } from 'path';
import { ApiModel } from '@microsoft/api-extractor-model';
import { CustomMarkdownDocumenter } from './libs/CustomMarkdownDocumenter';

const apiModelPath = resolve('.', 'temp', 'serverless-adapter.api.json');
const outputFolder = resolve('.', 'www', 'docs', 'api');

function build(): void {
  const apiModel = new ApiModel();

  apiModel.loadPackage(apiModelPath);

  const markdown = new CustomMarkdownDocumenter({
    apiModel,
    outputFolder,
    documenterConfig: undefined,
  });

  markdown.generateFiles();

  const filename = join(outputFolder, 'Introduction.md');
  const introductionMarkdownContent = readFileSync(filename);

  const introductionContent = `---\ntitle: Introduction\nsidebar_position: -1\n---\n\n${introductionMarkdownContent}`;

  writeFileSync(filename, introductionContent);
}

build();


================================================
FILE: scripts/libs/CustomMarkdownDocumenter.ts
================================================
import * as path from 'path';
import {
  type IMarkdownDocumenterFeatureOnBeforeWritePageArgs,
  MarkdownDocumenterAccessor,
  MarkdownDocumenterFeatureContext,
} from '@microsoft/api-documenter/lib';
import { DocumenterConfig } from '@microsoft/api-documenter/lib/documenters/DocumenterConfig';
import { CustomDocNodes } from '@microsoft/api-documenter/lib/nodes/CustomDocNodeKind';
import { DocEmphasisSpan } from '@microsoft/api-documenter/lib/nodes/DocEmphasisSpan';
import { DocHeading } from '@microsoft/api-documenter/lib/nodes/DocHeading';
import { DocNoteBox } from '@microsoft/api-documenter/lib/nodes/DocNoteBox';
import { DocTable } from '@microsoft/api-documenter/lib/nodes/DocTable';
import { DocTableCell } from '@microsoft/api-documenter/lib/nodes/DocTableCell';
import { DocTableRow } from '@microsoft/api-documenter/lib/nodes/DocTableRow';
import { PluginLoader } from '@microsoft/api-documenter/lib/plugin/PluginLoader';
import { Utilities } from '@microsoft/api-documenter/lib/utils/Utilities';
import {
  ApiClass,
  ApiDeclaredItem,
  ApiDocumentedItem,
  ApiEnum,
  ApiInterface,
  ApiItem,
  ApiItemKind,
  ApiModel,
  ApiNamespace,
  ApiOptionalMixin,
  ApiPackage,
  ApiParameterListMixin,
  ApiReleaseTagMixin,
  ApiReturnTypeMixin,
  ApiTypeAlias,
  Excerpt,
  ExcerptToken,
  ExcerptTokenKind,
  type IResolveDeclarationReferenceResult,
  ReleaseTag,
} from '@microsoft/api-extractor-model';
import {
  DocBlock,
  DocCodeSpan,
  DocComment,
  DocFencedCode,
  DocLinkTag,
  DocNodeContainer,
  DocNodeKind,
  DocParagraph,
  DocPlainText,
  DocSection,
  StandardTags,
  StringBuilder,
  TSDocConfiguration,
} from '@microsoft/tsdoc';
import {
  FileSystem,
  NewlineKind,
  PackageName,
} from '@rushstack/node-core-library';
import { CustomUtilities } from './CustomUtilities';
import { MarkdownEmitter } from './MarkdownEmitter';

export interface IMarkdownDocumenterOptions {
  apiModel: ApiModel;
  documenterConfig: DocumenterConfig | undefined;
  outputFolder: string;
}

/**
 * Renders API documentation in the Markdown file format.
 * For more info:  https://en.wikipedia.org/wiki/Markdown
 */
export class CustomMarkdownDocumenter {
  public constructor(options: IMarkdownDocumenterOptions) {
    this._apiModel = options.apiModel;
    this._documenterConfig = options.documenterConfig;
    this._outputFolder = options.outputFolder;
    this._tsdocConfiguration = CustomDocNodes.configuration;
    this._markdownEmitter = new MarkdownEmitter(this._apiModel);

    this._pluginLoader = new PluginLoader();
  }

  private readonly _apiModel: ApiModel;
  private readonly _documenterConfig: DocumenterConfig | undefined;
  private readonly _tsdocConfiguration: TSDocConfiguration;
  private readonly _markdownEmitter: MarkdownEmitter;
  private readonly _outputFolder: string;
  private readonly _pluginLoader: PluginLoader;

  public generateFiles(): void {
    if (this._documenterConfig) {
      this._pluginLoader.load(this._documenterConfig, () => {
        return new MarkdownDocumenterFeatureContext({
          apiModel: this._apiModel,
          outputFolder: this._outputFolder,
          documenter: new MarkdownDocumenterAccessor({
            getLinkForApiItem: (apiItem: ApiItem) => {
              return this._getLinkFilenameForApiItem(apiItem);
            },
          }),
        });
      });
    }

    this._deleteOldOutputFiles();

    this._writeApiItemPage(this._apiModel);

    if (this._pluginLoader.markdownDocumenterFeature)
      this._pluginLoader.markdownDocumenterFeature.onFinished({});
  }

  private _writeApiItemPage(apiItem: ApiItem, parentOutput?: DocSection): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;
    const output: DocSection =
      parentOutput ||
      new DocSection({
        configuration: this._tsdocConfiguration,
      });

    if (!parentOutput) this._writeBreadcrumb(output, apiItem);

    const scopedName: string = apiItem.displayName;

    switch (apiItem.kind) {
      case ApiItemKind.Class:
        output.appendNode(
          new DocHeading({ configuration, title: `(class) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Enum:
        output.appendNode(
          new DocHeading({ configuration, title: `(enum) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Interface:
        output.appendNode(
          new DocHeading({ configuration, title: `(interface) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Constructor:
      case ApiItemKind.ConstructSignature:
        output.appendNode(new DocHeading({ configuration, title: scopedName }));
        break;
      case ApiItemKind.Method:
      case ApiItemKind.MethodSignature:
        output.appendNode(
          new DocHeading({ configuration, title: `(method) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Function:
        output.appendNode(
          new DocHeading({ configuration, title: `(function) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Model:
        output.appendNode(
          new DocHeading({ configuration, title: 'API Reference' }),
        );
        break;
      case ApiItemKind.Namespace:
        output.appendNode(
          new DocHeading({ configuration, title: `(namespace) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Package:
        console.log(`Writing ${apiItem.displayName} package`);
        const unscopedPackageName: string = PackageName.getUnscopedName(
          apiItem.displayName,
        );
        output.appendNode(
          new DocHeading({
            configuration,
            title: `(package) ${unscopedPackageName}`,
          }),
        );
        break;
      case ApiItemKind.Property:
      case ApiItemKind.PropertySignature:
        output.appendNode(
          new DocHeading({ configuration, title: `(property) ${scopedName}` }),
        );
        break;
      case ApiItemKind.TypeAlias:
        output.appendNode(
          new DocHeading({ configuration, title: `(type) ${scopedName}` }),
        );
        break;
      case ApiItemKind.Variable:
        output.appendNode(
          new DocHeading({ configuration, title: `(variable) ${scopedName}` }),
        );
        break;
      default:
        throw new Error('Unsupported API item kind: ' + apiItem.kind);
    }

    if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
      if (apiItem.releaseTag === ReleaseTag.Beta)
        this._writeBetaWarning(output);
    }

    const decoratorBlocks: DocBlock[] = [];

    if (apiItem instanceof ApiDocumentedItem) {
      const tsdocComment: DocComment | undefined = apiItem.tsdocComment;

      if (tsdocComment) {
        decoratorBlocks.push(
          ...tsdocComment.customBlocks.filter(
            block =>
              block.blockTag.tagNameWithUpperCase ===
              StandardTags.decorator.tagNameWithUpperCase,
          ),
        );

        if (tsdocComment.deprecatedBlock) {
          output.appendNode(
            new DocNoteBox({ configuration: this._tsdocConfiguration }, [
              new DocParagraph({ configuration: this._tsdocConfiguration }, [
                new DocPlainText({
                  configuration: this._tsdocConfiguration,
                  text: 'Warning: This API is now obsolete. ',
                }),
              ]),
              ...tsdocComment.deprecatedBlock.content.nodes,
            ]),
          );
        }

        this._appendSection(output, tsdocComment.summarySection);
      }
    }

    if (apiItem instanceof ApiDeclaredItem) {
      if (apiItem.excerpt.text.length > 0) {
        output.appendNode(
          new DocParagraph({ configuration }, [
            new DocEmphasisSpan({ configuration, bold: true }, [
              new DocPlainText({ configuration, text: 'Signature:' }),
            ]),
          ]),
        );
        output.appendNode(
          new DocFencedCode({
            configuration,
            code: apiItem.getExcerptWithModifiers(),
            language: 'typescript',
          }),
        );
      }

      this._writeHeritageTypes(output, apiItem);
    }

    if (decoratorBlocks.length > 0) {
      output.appendNode(
        new DocParagraph({ configuration }, [
          new DocEmphasisSpan({ configuration, bold: true }, [
            new DocPlainText({ configuration, text: 'Decorators:' }),
          ]),
        ]),
      );
      for (const decoratorBlock of decoratorBlocks)
        output.appendNodes(decoratorBlock.content.nodes);
    }

    let appendRemarks: boolean = true;
    switch (apiItem.kind) {
      case ApiItemKind.Class:
      case ApiItemKind.Interface:
      case ApiItemKind.Namespace:
      case ApiItemKind.Package:
        this._writeRemarksSection(output, apiItem);
        appendRemarks = false;
        break;
    }

    switch (apiItem.kind) {
      case ApiItemKind.Class:
        this._writeClassTables(output, apiItem as ApiClass);
        break;
      case ApiItemKind.Enum:
        this._writeEnumTables(output, apiItem as ApiEnum);
        break;
      case ApiItemKind.Interface:
        this._writeInterfaceTables(output, apiItem as ApiInterface);
        break;
      case ApiItemKind.Constructor:
      case ApiItemKind.ConstructSignature:
      case ApiItemKind.Method:
      case ApiItemKind.MethodSignature:
      case ApiItemKind.Function:
        this._writeParameterTables(output, apiItem as ApiParameterListMixin);
        this._writeThrowsSection(output, apiItem);
        break;
      case ApiItemKind.Namespace:
        this._writePackageOrNamespaceTables(output, apiItem as ApiNamespace);
        break;
      case ApiItemKind.Model:
        this._writeModelTable(output, apiItem as ApiModel);
        break;
      case ApiItemKind.Package:
        this._writePackageOrNamespaceTables(output, apiItem as ApiPackage);
        break;
      case ApiItemKind.Property:
      case ApiItemKind.PropertySignature:
        break;
      case ApiItemKind.TypeAlias:
        break;
      case ApiItemKind.Variable:
        break;
      default:
        throw new Error(`Unsupported API item kind: ${apiItem.kind}`);
    }

    if (appendRemarks) this._writeRemarksSection(output, apiItem);

    const filename: string = path.join(
      this._outputFolder,
      this._getFilenameForApiItem(apiItem, true),
    );
    const stringBuilder: StringBuilder = new StringBuilder();

    stringBuilder.append(
      '<!-- Do not edit this file. It is automatically generated by API Documenter. -->\n\n',
    );

    this._markdownEmitter.emit(stringBuilder, output, {
      contextApiItem: apiItem,
      onGetFilenameForApiItem: (apiItemForFilename: ApiItem) => {
        return this._getLinkFilenameForApiItem(apiItemForFilename);
      },
    });

    let pageContent: string = stringBuilder.toString();

    if (this._pluginLoader.markdownDocumenterFeature) {
      // Allow the plugin to customize the pageContent
      const eventArgs: IMarkdownDocumenterFeatureOnBeforeWritePageArgs = {
        apiItem: apiItem,
        outputFilename: filename,
        pageContent: pageContent,
      };
      this._pluginLoader.markdownDocumenterFeature.onBeforeWritePage(eventArgs);
      pageContent = eventArgs.pageContent;
    }

    if (apiItem.kind == ApiItemKind.Model) return;

    if (parentOutput) return;

    if (filename.includes('ignored.md')) return;

    FileSystem.writeFile(filename, pageContent.replaceAll('{', '\\{'), {
      ensureFolderExists: true,
      convertLineEndings: this._documenterConfig
        ? this._documenterConfig.newlineKind
        : NewlineKind.CrLf,
    });
  }

  private _writeHeritageTypes(
    output: DocSection,
    apiItem: ApiDeclaredItem,
  ): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    if (apiItem instanceof ApiClass) {
      if (apiItem.extendsType) {
        const extendsParagraph: DocParagraph = new DocParagraph(
          { configuration },
          [
            new DocEmphasisSpan({ configuration, bold: true }, [
              new DocPlainText({ configuration, text: 'Extends: ' }),
            ]),
          ],
        );
        this._appendExcerptWithHyperlinks(
          extendsParagraph,
          apiItem.extendsType.excerpt,
        );
        output.appendNode(extendsParagraph);
      }
      if (apiItem.implementsTypes.length > 0) {
        const extendsParagraph: DocParagraph = new DocParagraph(
          { configuration },
          [
            new DocEmphasisSpan({ configuration, bold: true }, [
              new DocPlainText({ configuration, text: 'Implements: ' }),
            ]),
          ],
        );
        let needsComma: boolean = false;
        for (const implementsType of apiItem.implementsTypes) {
          if (needsComma) {
            extendsParagraph.appendNode(
              new DocPlainText({ configuration, text: ', ' }),
            );
          }
          this._appendExcerptWithHyperlinks(
            extendsParagraph,
            implementsType.excerpt,
          );
          needsComma = true;
        }
        output.appendNode(extendsParagraph);
      }
    }

    if (apiItem instanceof ApiInterface) {
      if (apiItem.extendsTypes.length > 0) {
        const extendsParagraph: DocParagraph = new DocParagraph(
          { configuration },
          [
            new DocEmphasisSpan({ configuration, bold: true }, [
              new DocPlainText({ configuration, text: 'Extends: ' }),
            ]),
          ],
        );
        let needsComma: boolean = false;
        for (const extendsType of apiItem.extendsTypes) {
          if (needsComma) {
            extendsParagraph.appendNode(
              new DocPlainText({ configuration, text: ', ' }),
            );
          }
          this._appendExcerptWithHyperlinks(
            extendsParagraph,
            extendsType.excerpt,
          );
          needsComma = true;
        }
        output.appendNode(extendsParagraph);
      }
    }

    if (apiItem instanceof ApiTypeAlias) {
      const refs: ExcerptToken[] = apiItem.excerptTokens.filter(
        token =>
          token.kind === ExcerptTokenKind.Reference &&
          token.canonicalReference &&
          this._apiModel.resolveDeclarationReference(
            token.canonicalReference,
            undefined,
          ).resolvedApiItem,
      );
      if (refs.length > 0) {
        const referencesParagraph: DocParagraph = new DocParagraph(
          { configuration },
          [
            new DocEmphasisSpan({ configuration, bold: true }, [
              new DocPlainText({ configuration, text: 'References: ' }),
            ]),
          ],
        );
        let needsComma: boolean = false;
        const visited: Set<string> = new Set();
        for (const ref of refs) {
          if (visited.has(ref.text)) continue;

          visited.add(ref.text);

          if (needsComma) {
            referencesParagraph.appendNode(
              new DocPlainText({ configuration, text: ', ' }),
            );
          }

          this._appendExcerptTokenWithHyperlinks(referencesParagraph, ref);
          needsComma = true;
        }
        output.appendNode(referencesParagraph);
      }
    }
  }

  private _writeRemarksSection(output: DocSection, apiItem: ApiItem): void {
    if (apiItem instanceof ApiDocumentedItem) {
      const tsdocComment: DocComment | undefined = apiItem.tsdocComment;

      if (tsdocComment) {
        // Write the @remarks block
        if (tsdocComment.remarksBlock) {
          output.appendNode(
            new DocHeading({
              configuration: this._tsdocConfiguration,
              title: 'Remarks',
            }),
          );
          this._appendSection(output, tsdocComment.remarksBlock.content);
        }

        // Write the @example blocks
        const exampleBlocks: DocBlock[] = tsdocComment.customBlocks.filter(
          x =>
            x.blockTag.tagNameWithUpperCase ===
            StandardTags.example.tagNameWithUpperCase,
        );

        let exampleNumber: number = 1;
        for (const exampleBlock of exampleBlocks) {
          const heading: string =
            exampleBlocks.length > 1 ? `Example ${exampleNumber}` : 'Example';

          output.appendNode(
            new DocHeading({
              configuration: this._tsdocConfiguration,
              title: heading,
            }),
          );

          this._appendSection(output, exampleBlock.content);

          ++exampleNumber;
        }
      }
    }
  }

  private _writeThrowsSection(output: DocSection, apiItem: ApiItem): void {
    if (apiItem instanceof ApiDocumentedItem) {
      const tsdocComment: DocComment | undefined = apiItem.tsdocComment;

      if (tsdocComment) {
        // Write the @throws blocks
        const throwsBlocks: DocBlock[] = tsdocComment.customBlocks.filter(
          x =>
            x.blockTag.tagNameWithUpperCase ===
            StandardTags.throws.tagNameWithUpperCase,
        );

        if (throwsBlocks.length > 0) {
          const heading: string = 'Exceptions';
          output.appendNode(
            new DocHeading({
              configuration: this._tsdocConfiguration,
              title: heading,
            }),
          );

          for (const throwsBlock of throwsBlocks)
            this._appendSection(output, throwsBlock.content);
        }
      }
    }
  }

  /**
   * GENERATE PAGE: MODEL
   */
  private _writeModelTable(output: DocSection, apiModel: ApiModel): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    const packagesTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Package', 'Description'],
    });

    for (const apiMember of apiModel.members) {
      const row: DocTableRow = new DocTableRow({ configuration }, [
        this._createTitleCell(apiMember),
        this._createDescriptionCell(apiMember),
      ]);

      switch (apiMember.kind) {
        case ApiItemKind.Package:
          packagesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;
      }
    }

    if (packagesTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Packages',
        }),
      );
      output.appendNode(packagesTable);
    }
  }

  /**
   * GENERATE PAGE: PACKAGE or NAMESPACE
   */
  private _writePackageOrNamespaceTables(
    output: DocSection,
    apiContainer: ApiPackage | ApiNamespace,
  ): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    const classesTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Class', 'Description'],
    });

    const enumerationsTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Enumeration', 'Description'],
    });

    const functionsTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Function', 'Description'],
    });

    const interfacesTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Interface', 'Description'],
    });

    const namespacesTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Namespace', 'Description'],
    });

    const variablesTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Variable', 'Description'],
    });

    const typeAliasesTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Type Alias', 'Description'],
    });

    const apiMembers: ReadonlyArray<ApiItem> =
      apiContainer.kind === ApiItemKind.Package
        ? (apiContainer as ApiPackage).entryPoints[0].members
        : (apiContainer as ApiNamespace).members;

    for (const apiMember of apiMembers) {
      const name = Utilities.getConciseSignature(apiMember);

      // ignore types generated by deepkit
      if (name.startsWith('__')) continue;

      const row: DocTableRow = new DocTableRow({ configuration }, [
        this._createTitleCell(apiMember),
        this._createDescriptionCell(apiMember),
      ]);

      switch (apiMember.kind) {
        case ApiItemKind.Class:
          classesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Enum:
          enumerationsTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Interface:
          interfacesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Namespace:
          namespacesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Function:
          functionsTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.TypeAlias:
          typeAliasesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Variable:
          variablesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;
      }
    }

    if (classesTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Classes',
        }),
      );
      output.appendNode(classesTable);
    }

    if (enumerationsTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Enumerations',
        }),
      );
      output.appendNode(enumerationsTable);
    }
    if (functionsTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Functions',
        }),
      );
      output.appendNode(functionsTable);
    }

    if (interfacesTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Interfaces',
        }),
      );
      output.appendNode(interfacesTable);
    }

    if (namespacesTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Namespaces',
        }),
      );
      output.appendNode(namespacesTable);
    }

    if (variablesTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Variables',
        }),
      );
      output.appendNode(variablesTable);
    }

    if (typeAliasesTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Type Aliases',
        }),
      );
      output.appendNode(typeAliasesTable);
    }
  }

  /**
   * GENERATE PAGE: CLASS
   */
  private _writeClassTables(output: DocSection, apiClass: ApiClass): void {
    const postApiMembers: ApiItem[] = [];

    for (const apiMember of apiClass.members) {
      switch (apiMember.kind) {
        case ApiItemKind.Constructor:
        case ApiItemKind.Method:
        case ApiItemKind.Property:
          postApiMembers.push(apiMember);
          break;
      }
    }

    if (postApiMembers.length > 0) {
      postApiMembers.forEach(postApiMember =>
        this._writeApiItemPage(postApiMember, output),
      );
    }
  }

  /**
   * GENERATE PAGE: ENUM
   */
  private _writeEnumTables(output: DocSection, apiEnum: ApiEnum): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    const enumMembersTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Member', 'Value', 'Description'],
    });

    for (const apiEnumMember of apiEnum.members) {
      enumMembersTable.addRow(
        new DocTableRow({ configuration }, [
          new DocTableCell({ configuration }, [
            new DocParagraph({ configuration }, [
              new DocPlainText({
                configuration,
                text: Utilities.getConciseSignature(apiEnumMember),
              }),
            ]),
          ]),

          new DocTableCell({ configuration }, [
            new DocParagraph({ configuration }, [
              new DocCodeSpan({
                configuration,
                code: apiEnumMember.initializerExcerpt?.text || '',
              }),
            ]),
          ]),

          this._createDescriptionCell(apiEnumMember),
        ]),
      );
    }

    if (enumMembersTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Enumeration Members',
        }),
      );
      output.appendNode(enumMembersTable);
    }
  }

  /**
   * GENERATE PAGE: INTERFACE
   */
  private _writeInterfaceTables(
    output: DocSection,
    apiClass: ApiInterface,
  ): void {
    const postApiMembers: ApiItem[] = [];

    for (const apiMember of apiClass.members) {
      switch (apiMember.kind) {
        case ApiItemKind.ConstructSignature:
        case ApiItemKind.MethodSignature:
        case ApiItemKind.PropertySignature:
          postApiMembers.push(apiMember);
          break;
      }
    }

    if (postApiMembers.length > 0) {
      postApiMembers.forEach(postApiItem =>
        this._writeApiItemPage(postApiItem, output),
      );
    }
  }

  /**
   * GENERATE PAGE: FUNCTION-LIKE
   */
  private _writeParameterTables(
    output: DocSection,
    apiParameterListMixin: ApiParameterListMixin,
  ): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    const parametersTable: DocTable = new DocTable({
      configuration,
      headerTitles: ['Parameter', 'Type', 'Description'],
    });
    for (const apiParameter of apiParameterListMixin.parameters) {
      const parameterDescription: DocSection = new DocSection({
        configuration,
      });

      if (apiParameter.isOptional) {
        parameterDescription.appendNodesInParagraph([
          new DocEmphasisSpan({ configuration, italic: true }, [
            new DocPlainText({ configuration, text: '(Optional)' }),
          ]),
          new DocPlainText({ configuration, text: ' ' }),
        ]);
      }

      if (apiParameter.tsdocParamBlock) {
        this._appendAndMergeSection(
          parameterDescription,
          apiParameter.tsdocParamBlock.content,
        );
      }

      parametersTable.addRow(
        new DocTableRow({ configuration }, [
          new DocTableCell({ configuration }, [
            new DocParagraph({ configuration }, [
              new DocPlainText({ configuration, text: apiParameter.name }),
            ]),
          ]),
          new DocTableCell({ configuration }, [
            this._createParagraphForTypeExcerpt(
              apiParameter.parameterTypeExcerpt,
            ),
          ]),
          new DocTableCell({ configuration }, parameterDescription.nodes),
        ]),
      );
    }

    if (parametersTable.rows.length > 0) {
      output.appendNode(
        new DocHeading({
          configuration: this._tsdocConfiguration,
          title: 'Parameters',
          level: 3,
        }),
      );
      output.appendNode(parametersTable);
    }

    if (ApiReturnTypeMixin.isBaseClassOf(apiParameterListMixin)) {
      const returnTypeExcerpt: Excerpt =
        apiParameterListMixin.returnTypeExcerpt;
      output.appendNode(
        new DocParagraph({ configuration }, [
          new DocEmphasisSpan({ configuration, bold: true }, [
            new DocPlainText({ configuration, text: 'Returns:' }),
          ]),
        ]),
      );

      output.appendNode(this._createParagraphForTypeExcerpt(returnTypeExcerpt));

      if (apiParameterListMixin instanceof ApiDocumentedItem) {
        if (
          apiParameterListMixin.tsdocComment &&
          apiParameterListMixin.tsdocComment.returnsBlock
        ) {
          this._appendSection(
            output,
            apiParameterListMixin.tsdocComment.returnsBlock.content,
          );
        }
      }
    }
  }

  private _createParagraphForTypeExcerpt(excerpt: Excerpt): DocParagraph {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    const paragraph: DocParagraph = new DocParagraph({ configuration });

    if (!excerpt.text.trim()) {
      paragraph.appendNode(
        new DocPlainText({ configuration, text: '(not declared)' }),
      );
    } else this._appendExcerptWithHyperlinks(paragraph, excerpt);

    return paragraph;
  }

  private _appendExcerptWithHyperlinks(
    docNodeContainer: DocNodeContainer,
    excerpt: Excerpt,
  ): void {
    for (const token of excerpt.spannedTokens)
      this._appendExcerptTokenWithHyperlinks(docNodeContainer, token);
  }

  private _appendExcerptTokenWithHyperlinks(
    docNodeContainer: DocNodeContainer,
    token: ExcerptToken,
  ): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    // Markdown doesn't provide a standardized syntax for hyperlinks inside code spans, so we will render
    // the type expression as DocPlainText.  Instead of creating multiple DocParagraphs, we can simply
    // discard any newlines and let the renderer do normal word-wrapping.
    const unwrappedTokenText: string = token.text.replace(/[\r\n]+/g, ' ');

    // If it's hyperlinkable, then append a DocLinkTag
    if (token.kind === ExcerptTokenKind.Reference && token.canonicalReference) {
      const apiItemResult: IResolveDeclarationReferenceResult =
        this._apiModel.resolveDeclarationReference(
          token.canonicalReference,
          undefined,
        );

      if (apiItemResult.resolvedApiItem) {
        docNodeContainer.appendNode(
          new DocLinkTag({
            configuration,
            tagName: '@link',
            linkText: unwrappedTokenText,
            urlDestination: this._getLinkFilenameForApiItem(
              apiItemResult.resolvedApiItem,
            ),
          }),
        );
        return;
      }
    }

    // Otherwise append non-hyperlinked text
    docNodeContainer.appendNode(
      new DocPlainText({ configuration, text: unwrappedTokenText }),
    );
  }

  private _createTitleCell(apiItem: ApiItem): DocTableCell {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    let linkText: string = Utilities.getConciseSignature(apiItem);
    if (ApiOptionalMixin.isBaseClassOf(apiItem) && apiItem.isOptional)
      linkText += '?';

    return new DocTableCell({ configuration }, [
      new DocParagraph({ configuration }, [
        new DocLinkTag({
          configuration,
          tagName: '@link',
          linkText: linkText,
          urlDestination: this._getLinkFilenameForApiItem(apiItem),
        }),
      ]),
    ]);
  }

  /**
   * This generates a DocTableCell for an ApiItem including the summary section and "(BETA)" annotation.
   *
   * @remarks
   * We mostly assume that the input is an ApiDocumentedItem, but it's easier to perform this as a runtime
   * check than to have each caller perform a type cast.
   */
  private _createDescriptionCell(apiItem: ApiItem): DocTableCell {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;

    const section: DocSection = new DocSection({ configuration });

    if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
      if (apiItem.releaseTag === ReleaseTag.Beta) {
        section.appendNodesInParagraph([
          new DocEmphasisSpan({ configuration, bold: true, italic: true }, [
            new DocPlainText({ configuration, text: '(BETA)' }),
          ]),
          new DocPlainText({ configuration, text: ' ' }),
        ]);
      }
    }

    if (ApiOptionalMixin.isBaseClassOf(apiItem) && apiItem.isOptional) {
      section.appendNodesInParagraph([
        new DocEmphasisSpan({ configuration, italic: true }, [
          new DocPlainText({ configuration, text: '(Optional)' }),
        ]),
        new DocPlainText({ configuration, text: ' ' }),
      ]);
    }

    if (apiItem instanceof ApiDocumentedItem) {
      if (apiItem.tsdocComment !== undefined) {
        this._appendAndMergeSection(
          section,
          apiItem.tsdocComment.summarySection,
        );
      }
    }

    return new DocTableCell({ configuration }, section.nodes);
  }

  private _writeBreadcrumb(output: DocSection, apiItem: ApiItem): void {
    const breadcrumbDivider = [
      new DocPlainText({
        configuration: this._tsdocConfiguration,
        text: ' > ',
      }),
    ];

    for (const hierarchyItem of apiItem.getHierarchy()) {
      const isFirst = hierarchyItem.kind === ApiItemKind.Package;

      switch (hierarchyItem.kind) {
        case ApiItemKind.Model:
        case ApiItemKind.EntryPoint:
          // We don't show the model as part of the breadcrumb because it is the root-level container.
          // We don't show the entry point because today API Extractor doesn't support multiple entry points;
          // this may change in the future.
          break;
        default:
          output.appendNodesInParagraph([
            ...(isFirst ? [] : breadcrumbDivider),
            new DocLinkTag({
              configuration: this._tsdocConfiguration,
              tagName: '@link',
              linkText: hierarchyItem.displayName,
              urlDestination: this._getLinkFilenameForApiItem(hierarchyItem),
            }),
          ]);
      }
    }
  }

  private _writeBetaWarning(output: DocSection): void {
    const configuration: TSDocConfiguration = this._tsdocConfiguration;
    const betaWarning: string =
      'This API is provided as a preview for developers and may change' +
      ' based on feedback that we receive.  Do not use this API in a production environment.';
    output.appendNode(
      new DocNoteBox({ configuration }, [
        new DocParagraph({ configuration }, [
          new DocPlainText({ configuration, text: betaWarning }),
        ]),
      ]),
    );
  }

  private _appendSection(output: DocSection, docSection: DocSection): void {
    for (const node of docSection.nodes) output.appendNode(node);
  }

  private _appendAndMergeSection(
    output: DocSection,
    docSection: DocSection,
  ): void {
    let firstNode: boolean = true;
    for (const node of docSection.nodes) {
      if (firstNode) {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
        if (node.kind === DocNodeKind.Paragraph) {
          output.appendNodesInParagraph(node.getChildNodes());
          firstNode = false;
          continue;
        }
      }
      firstNode = false;

      output.appendNode(node);
    }
  }

  private _getFilenameForApiItem(
    apiItem: ApiItem,
    nestedWhenSameName: boolean = false,
  ): string {
    if (apiItem.kind === ApiItemKind.Model) {
      // this file will be ignored, we don't like the old index file.
      return 'ignored.md';
    }

    const apiDocumentedItem = apiItem as ApiDocumentedItem;

    if (apiDocumentedItem.tsdocComment) {
      const breadcrumb = apiDocumentedItem.tsdocComment.customBlocks.find(
        block => block.blockTag.tagName === '@breadcrumb',
      );

      if (breadcrumb) {
        const breadcrumbContent = breadcrumb.content
          .getChildNodes()
          // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
          .filter(block => block.kind === DocNodeKind.Paragraph)
          // @ts-ignore
          .reduce((acc, block) => [...acc, ...block.getChildNodes()], [])
          // @ts-ignore
          .filter(block => block.kind === DocNodeKind.PlainText)
          .map((plainText: DocPlainText) => plainText.text)
          .join('');

        const breadcrumbs = breadcrumbContent
          .split('/')
          .map(section => section.trimLeft().trimRight());

        const safeName = CustomUtilities.getSafeFilenameForNameWithCase(
          apiItem.displayName,
        );

        if (breadcrumbs.length === 0) return safeName + '.md';

        const filename =
          !nestedWhenSameName &&
          breadcrumbs[breadcrumbs.length - 1] === safeName
            ? ''
            : safeName + '.md';

        if (!filename) return breadcrumbs.join('/') + '.md';

        return [...breadcrumbs, filename].join('/');
      }
    }

    let baseName: string = '';

    for (const hierarchyItem of apiItem.getHierarchy()) {
      // For overloaded methods, add a suffix such as "MyClass.myMethod_2".
      let qualifiedName: string =
        CustomUtilities.getSafeFilenameForNameWithCase(
          hierarchyItem.displayName,
        );

      if (ApiParameterListMixin.isBaseClassOf(hierarchyItem)) {
        if (hierarchyItem.overloadIndex > 1) {
          // Subtract one for compatibility with earlier releases of API Documenter.
          // (This will get revamped when we fix GitHub issue #1308)
          qualifiedName += `_${hierarchyItem.overloadIndex - 1}`;
        }
      }

      switch (hierarchyItem.kind) {
        case ApiItemKind.Model:
        case ApiItemKind.EntryPoint:
        case ApiItemKind.EnumMember:
        case ApiItemKind.Package:
          break;
        default:
          baseName = baseName ? baseName + '.' + qualifiedName : qualifiedName;
      }
    }

    // when we don't have name, usually is the package documentation
    if (!baseName) return 'Introduction.md';

    if (baseName.startsWith('___')) {
      // ignore files from deepkit
      return 'ignored.md';
    }

    return baseName + '.md';
  }

  private _getLinkFilenameForApiItem(apiItem: ApiItem): string {
    return (
      '/docs/api/' +
      this._getFilenameForApiItem(apiItem)
        .replace(/\.md/g, '')
        .replace(/ /g, '%20')
    );
  }

  private _deleteOldOutputFiles(): void {
    console.log('Deleting old output from ' + this._outputFolder);
    FileSystem.ensureEmptyFolder(this._outputFolder);
  }
}


================================================
FILE: scripts/libs/CustomUtilities.ts
================================================
import { ApiItem, ApiParameterListMixin } from '@microsoft/api-extractor-model';

export class CustomUtilities {
  private static readonly _badFilenameCharsRegExp: RegExp = /[^a-z0-9_\-.]/gi;

  /**
   * Generates a concise signature for a function.  Example: "getArea(width, height)"
   */
  public static getConciseSignature(apiItem: ApiItem): string {
    if (ApiParameterListMixin.isBaseClassOf(apiItem)) {
      return (
        apiItem.displayName +
        '(' +
        apiItem.parameters.map(x => x.name).join(', ') +
        ')'
      );
    }
    return apiItem.displayName;
  }

  /**
   * Converts bad filename characters to underscores.
   */
  public static getSafeFilenameForName(name: string): string {
    // TODO: This can introduce naming collisions.
    // We will fix that as part of https://github.com/microsoft/rushstack/issues/1308
    return name
      .replace(CustomUtilities._badFilenameCharsRegExp, '_')
      .toLowerCase();
  }

  /**
   * Converts bad filename characters to underscores.
   */
  public static getSafeFilenameForNameWithCase(name: string): string {
    // TODO: This can introduce naming collisions.
    // We will fix that as part of https://github.com/microsoft/rushstack/issues/1308
    return name.replace(CustomUtilities._badFilenameCharsRegExp, '_');
  }
}


================================================
FILE: scripts/libs/MarkdownEmitter.ts
================================================
import { CustomMarkdownEmitter } from '@microsoft/api-documenter/lib/markdown/CustomMarkdownEmitter';
import type { IMarkdownEmitterContext } from '@microsoft/api-documenter/lib/markdown/MarkdownEmitter';
import { IndentedWriter } from '@microsoft/api-documenter/lib/utils/IndentedWriter';

export class MarkdownEmitter extends CustomMarkdownEmitter {
  protected override writePlainText(
    text: string,
    context: IMarkdownEmitterContext,
  ): void {
    const writer: IndentedWriter = context.writer;

    // split out the [ leading whitespace, content, trailing whitespace ]
    const parts: string[] = text.match(/^(\s*)(.*?)(\s*)$/) || [];

    writer.write(parts[1]); // write leading whitespace

    const middle: string = parts[2];

    if (middle !== '') {
      switch (writer.peekLastCharacter()) {
        case '':
        case '\n':
        case ' ':
        case '[':
        case '>':
          // okay to put a symbol
          break;
        default:
          // This is no problem:        "**one** *two* **three**"
          // But this is trouble:       "**one***two***three**"
          // The most general solution: "**one**<!-- -->*two*<!-- -->**three**"
          // but the solution above breaks docusaurus, so, I changed to space
          writer.write(' ');
          break;
      }

      writer.write(this.getEscapedText(middle));
    }

    writer.write(parts[3]); // write trailing whitespace
  }
}


================================================
FILE: scripts/models/apidoc.types.ts
================================================
export interface APIDoc {
  metadata: Metadata;
  kind: string;
  canonicalReference: string;
  docComment: string;
  name: string;
  members: APIDocMember[];
}

export interface APIDocMember {
  kind: string;
  canonicalReference: string;
  name: string;
  members: PurpleMember[];
}

export interface PurpleMember {
  kind: PurpleKind;
  canonicalReference: string;
  docComment: string;
  excerptTokens: ExcerptToken[];
  releaseTag: ReleaseTag;
  typeParameters?: TypeParameter[];
  name: string;
  members?: FluffyMember[];
  extendsTokenRanges?: any[];
  implementsTokenRanges?: TokenRange[];
  typeTokenRange?: TokenRange;
  returnTypeTokenRange?: TokenRange;
  overloadIndex?: number;
  parameters?: Parameter[];
  variableTypeTokenRange?: TokenRange;
  extendsTokenRange?: TokenRange;
}

export interface ExcerptToken {
  kind: ExcerptTokenKind;
  text: string;
  canonicalReference?: string;
}

export enum ExcerptTokenKind {
  Content = 'Content',
  Reference = 'Reference',
}

export interface TokenRange {
  startIndex: number;
  endIndex: number;
}

export enum PurpleKind {
  Class = 'Class',
  Function = 'Function',
  Interface = 'Interface',
  TypeAlias = 'TypeAlias',
  Variable = 'Variable',
}

export interface FluffyMember {
  kind: FluffyKind;
  canonicalReference: string;
  docComment: string;
  excerptTokens: ExcerptToken[];
  isOptional?: boolean;
  returnTypeTokenRange?: TokenRange;
  releaseTag: ReleaseTag;
  overloadIndex?: number;
  parameters?: Parameter[];
  name?: string;
  propertyTypeTokenRange?: TokenRange;
  isStatic?: boolean;
  typeParameters?: TypeParameter[];
}

export enum FluffyKind {
  Constructor = 'Constructor',
  Method = 'Method',
  MethodSignature = 'MethodSignature',
  Property = 'Property',
  PropertySignature = 'PropertySignature',
}

export interface Parameter {
  parameterName: string;
  parameterTypeTokenRange: TokenRange;
  isOptional: boolean;
}

export enum ReleaseTag {
  Public = 'Public',
}

export interface TypeParameter {
  typeParameterName: TypeParameterName;
  constraintTokenRange: TokenRange;
  defaultTypeTokenRange: TokenRange;
}

export enum TypeParameterName {
  T = 'T',
  TApp = 'TApp',
  TCallback = 'TCallback',
  TContext = 'TContext',
  TEvent = 'TEvent',
  TResponse = 'TResponse',
  TReturn = 'TReturn',
  TStream = 'TStream',
}

export interface Metadata {
  toolPackage: string;
  toolVersion: string;
  schemaVersion: number;
  oldestForwardsCompatibleVersion: number;
  tsdocConfig: TsdocConfig;
}

export interface TsdocConfig {
  $schema: string;
  noStandardTags: boolean;
  tagDefinitions: TagDefinition[];
  supportForTags: { [key: string]: boolean };
}

export interface TagDefinition {
  tagName: string;
  syntaxKind: SyntaxKind;
  allowMultiple?: boolean;
}

export enum SyntaxKind {
  Block = 'block',
  Inline = 'inline',
  Modifier = 'modifier',
}


================================================
FILE: scripts/parse-docs.ts
================================================
import { resolve } from 'path';
import { Extractor, ExtractorConfig } from '@microsoft/api-extractor';

const apiExtractConfig = resolve('./api-extractor.json');

function build(): void {
  const config = ExtractorConfig.loadFileAndPrepare(apiExtractConfig);

  const extractorResult = Extractor.invoke(config, {
    localBuild: true,
  });

  if (!extractorResult.succeeded) {
    console.error(
      `API Extractor completed with ${extractorResult.errorCount} errors` +
        ` and ${extractorResult.warningCount} warnings`,
    );
    process.exitCode = 1;
  }

  console.log('API Extractor completed successfully');
}

build();


================================================
FILE: src/@types/binary-settings.ts
================================================
/**
 * The interface representing the binary settings implementation by function
 *
 * @breadcrumb Types / BinarySettings
 * @public
 */
export interface BinarySettingsFunction {
  /**
   * This property can be a function that receives the response headers and returns whether that response should be encoded as binary.
   * Otherwise, you can specify not to treat any response as binary by putting `false` in this property.
   *
   * @remarks Setting this property prevents the `contentTypes` and `contentEncodings` properties from being used.
   */
  isBinary:
    | ((headers: Record<string, string | string[] | undefined>) => boolean)
    | false;
}

/**
 * The interface representing the binary settings implementation by looking inside the headers
 *
 * @breadcrumb Types / BinarySettings
 * @public
 */
export interface BinarySettingsContentHeaders {
  /**
   * The list of content types that will be treated as binary
   */
  contentTypes: string[];

  /**
   * The list of content encodings that will be treated as binary
   */
  contentEncodings: string[];
}

/**
 * The interface representing the settings for whether the response should be treated as binary or not
 *
 * @remarks Encoded as binary means the response body will be converted to base64
 *
 * @breadcrumb Types / BinarySettings
 * @public
 */
export type BinarySettings =
  | BinarySettingsFunction
  | BinarySettingsContentHeaders;


================================================
FILE: src/@types/digital-ocean/digital-ocean-http-event.ts
================================================
//#region Imports

import type { SingleValueHeaders } from '../headers';

//#endregion

/**
 * The interface to represents the values of args send when someone calls a function using HTTP Endpoint.
 * To be able to receive this event, inside your `project.yml`, instead of `web: true` change to `web: 'raw'`.
 *
 * {@link https://www.digitalocean.com/community/questions/digitalocean-functions-how-to-differentiate-query-params-from-body-params | Reference}
 *
 * @public
 * @breadcrumb Types / Digital Ocean / DigitalOceanHttpEvent
 */
export interface DigitalOceanHttpEvent {
  /**
   * The HTTP Method of the request
   */
  __ow_method: string;

  /**
   * The query porams of the request
   */
  __ow_query: string;

  /**
   * The body of the request.
   */
  __ow_body?: string;

  /**
   * Indicates if body is base64 string
   */
  __ow_isBase64Encoded?: boolean;

  /**
   * The HTTP Headers of the request
   */
  __ow_headers: SingleValueHeaders;

  /**
   * The path in the request
   */
  __ow_path: string;
}


================================================
FILE: src/@types/digital-ocean/digital-ocean-http-response.ts
================================================
//#region Imports

import type { SingleValueHeaders } from '../headers';

//#endregion

/**
 * The interface to represents the response of Digital Ocean Function.
 *
 * @public
 * @breadcrumb Types / Digital Ocean / DigitalOceanHttpResponse
 */
export interface DigitalOceanHttpResponse {
  /**
   * The HTTP Headers of the response
   */
  headers?: SingleValueHeaders;

  /**
   * The body of the response
   */
  body: unknown;

  /**
   * The HTTP Status code of the response
   */
  statusCode: number;
}


================================================
FILE: src/@types/digital-ocean/index.ts
================================================
export * from './digital-ocean-http-event';
export * from './digital-ocean-http-response';


================================================
FILE: src/@types/headers.ts
================================================
/**
 * The record that represents the headers that doesn't have multiple values in the value
 *
 * @example
 * ```typescript
 * { 'Accept-Encoding': 'gzip, deflate, br' }
 * ```
 *
 * @breadcrumb Types
 * @public
 */
export type SingleValueHeaders = Record<string, string | undefined>;

/**
 * The record that represents the headers that have multiple values in the value
 *
 * @example
 * ```typescript
 * { 'Accept-Encoding': ['gzip', 'deflate', 'br'] }
 * ```
 *
 * @breadcrumb Types
 * @public
 */
export type MultiValueHeaders = Record<string, string[] | undefined>;

/**
 * The record that represents the headers that can both single or multiple values in the value
 *
 * @example
 * ```typescript
 * { 'Accept-Encoding': ['gzip', 'deflate', 'br'], 'Host': 'xyz.execute-api.us-east-1.amazonaws.com' }
 * ```
 *
 * @breadcrumb Types
 * @public
 */
export type BothValueHeaders = Record<string, string | string[] | undefined>;


================================================
FILE: src/@types/helpers.ts
================================================
/**
 * Removes 'optional' attributes from a type's properties
 *
 * @breadcrumb Types
 * @public
 */
export type Concrete<Type> = {
  [Property in keyof Type]-?: Type[Property];
};


================================================
FILE: src/@types/huawei/huawei-api-gateway-event.ts
================================================
//#region Imports

import type { BothValueHeaders } from '../index';

//#endregion

/**
 * The interface that represents the Api Gateway Event of Huawei when integrate with Function Graph of Event Type.
 * See more in {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 | Reference}.
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
 */
export interface HuaweiApiGatewayEvent {
  /**
   * The body value with the content of this event serialized in JSON
   */
  body: string;

  /**
   * The headers of the request which this event represents
   */
  headers: BothValueHeaders;

  /**
   * The HTTP Method of the request which this event represents
   */
  httpMethod: string;

  /**
   * Tells if the body is base64 encoded
   */
  isBase64Encoded: boolean;

  /**
   * The path of the request which this event represents
   */
  path: string;

  /**
   * The path parameters of the request which this event represents
   */
  pathParameters: HuaweiRequestPathParameters;

  /**
   * The query strings of the request which this event represents
   */
  queryStringParameters: HuaweiRequestQueryStringParameters;

  /**
   * The request context with information about the stage, api and requestId
   */
  requestContext: HuaweiRequestContext;

  /**
   * It can have more properties that I could not discover yet
   */
  [key: string]: any;
}

/**
 * The path parameters of the request, usually is the name of the wildcard you create in FunctionGraph, such as /\{proxy\}.
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
 */
export type HuaweiRequestPathParameters = Record<string, string>;

/**
 * The query strings of the request
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
 */
export type HuaweiRequestQueryStringParameters = Record<
  string,
  string | string[]
>;

/**
 * The interface that represents the values you can get inside request context.
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
 */
export interface HuaweiRequestContext {
  /**
   * The ID of your API inside Api Gateway
   */
  apiId: string;

  /**
   * The ID of this request
   */
  requestId: string;

  /**
   * The name of the stage running this Function Graph
   */
  stage: string;
}


================================================
FILE: src/@types/huawei/huawei-api-gateway-response.ts
================================================
//#region Imports

import type { MultiValueHeaders } from '../headers';

//#endregion

/**
 * The interface that represents the Api Gateway Response of Huawei when integrate with Function Graph of Event Type.
 * See more in {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 | Reference}.
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiApiGatewayResponse
 */
export interface HuaweiApiGatewayResponse {
  /**
   * Tells if the body was encoded as base64
   */
  isBase64Encoded: boolean;

  /**
   * The HTTP Status code of this response
   */
  statusCode: number;

  /**
   * The headers sent with this response
   */
  headers: MultiValueHeaders;

  /**
   * The body value with the content of this response serialized in JSON
   */
  body: string;
}


================================================
FILE: src/@types/huawei/huawei-context.ts
================================================
/**
 * The return value of {@link HuaweiContext} getRequestID
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetRequestIDSecondsReturn = string;

/**
 * The return value of {@link HuaweiContext} getRemainingTimeInMilliSeconds
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetRemainingTimeInMilliSecondsReturn = number;

/**
 * The return value of {@link HuaweiContext} getAccessKey
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetAccessKeyReturn = string;

/**
 * The return value of {@link HuaweiContext} getSecretKey
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetSecretKeyReturn = string;

/**
 * The parameters of the method {@link HuaweiContext} getUserData
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetUserDataKeyParameter = string;

/**
 * The return value of {@link HuaweiContext} getUserData
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetUserDataReturn = any;

/**
 * The return value of {@link HuaweiContext} getFunctionName
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetFunctionNameReturn = string;

/**
 * The return value of {@link HuaweiContext} getRunningTimeInSeconds
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetRunningTimeInSecondsReturn = number;

/**
 * The return value of {@link HuaweiContext} getVersion
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetVersionReturn = string;

/**
 * The return value of {@link HuaweiContext} getMemorySize
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetMemorySizeReturn = number;

/**
 * The return value of {@link HuaweiContext} getCPUNumber
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetCPUNumberReturn = number;

/**
 * The return value of {@link HuaweiContext} getProjectID
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetProjectIdReturn = number;

/**
 * The return value of {@link HuaweiContext} getPackage
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetPackageReturn = string;

/**
 * The return value of {@link HuaweiContext} getToken
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetTokenReturn = string;

/**
 * The return value of {@link HuaweiContext} getLogger
 *
 * Is the instance of logger that can be used to send logs to
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export type GetLoggerReturn = {
  info(message: string): void;
};

/**
 * The interface that represents methods sent by huawei to get information about the function graph.
 * See more in {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0410.html#section1 | Context Methods}
 *
 * @public
 * @breadcrumb Types / Huawei / HuaweiContext
 */
export interface HuaweiContext {
  /**
   * Obtains a request ID.
   */
  getRequestID(): GetRequestIDSecondsReturn;

  /**
   * Obtains the remaining running time of a function.
   */
  getRemainingTimeInMilliSeconds(): GetRemainingTimeInMilliSecondsReturn;

  /**
   * Obtains the AK (valid for 24 hours) of an agency. If you use this method, you need to configure an agency for the function.
   */
  getAccessKey(): GetAccessKeyReturn;

  /**
   * Obtains the SK (valid for 24 hours) of an agency. If you use this method, you need to configure an agency for the function.
   */
  getSecretKey(): GetSecretKeyReturn;

  /**
   * Uses keys to obtain the values passed by environment variables.
   *
   * @param key - The key to get environment variables values
   */
  getUserData(key: GetUserDataKeyParameter): GetUserDataReturn;

  /**
   * Obtains the name of a function.
   */
  getFunctionName(): GetFunctionNameReturn;

  /**
   * Obtains the timeout of a function.
   */
  getRunningTimeInSeconds(): GetRunningTimeInSecondsReturn;

  /**
   * Obtains the version of a function.
   */
  getVersion(): GetVersionReturn;

  /**
   * Obtains the allocated memory.
   */
  getMemorySize(): GetMemorySizeReturn;

  /**
   * Number of CPU millicores used by the function (1 core = 1000 millicores).
   *
   * The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. The number of CPU millicores is calculated as follows: Memory/128 x 100 + 200 (basic CPU millicores).
   */
  getCPUNumber(): GetCPUNumberReturn;

  /**
   * Obtains a project ID.
   */
  getProjectID(): GetProjectIdReturn;

  /**
   * Obtains a function group, that is, an app.
   */
  getPackage(): GetPackageReturn;

  /**
   * Obtains the token (valid for 24 hours) of an agency. If you use this method, you need to configure an agency for the function.
   */
  getToken(): GetTokenReturn;

  /**
   * Obtains the logger method provided by the context and returns a log output class. Logs are output in the format of Time-Request ID-Content by using the info method.
   *
   * For example, use the info method to output logs:
   *
   * @example
   * ```typescript
   * logg = context.getLogger()
   *
   * logg.info("hello")
   * ```
   */
  getLogger(): GetLoggerReturn;
}


================================================
FILE: src/@types/huawei/index.ts
================================================
export * from './huawei-context';
export * from './huawei-api-gateway-event';
export * from './huawei-api-gateway-response';


================================================
FILE: src/@types/index.ts
================================================
export * from './binary-settings';
export * from './headers';
export * from './helpers';


================================================
FILE: src/adapters/apollo-server/apollo-server-mutation.adapter.ts
================================================
//#region Imports

import type {
  AdapterContract,
  AdapterRequest,
  GetResponseAdapterProps,
  OnErrorProps,
} from '../../contracts';
import {
  type ILogger,
  getDefaultIfUndefined,
  getEventBodyAsBuffer,
} from '../../core';

//#endregion

/**
 * The options for {@link ApolloServerMutationAdapter}
 *
 * @breadcrumb Adapters / Apollo Server / ApolloServerMutationAdapter
 * @public
 */
export type ApolloServerMutationAdapterOptions = {
  /**
   * Specify the name of mutation that will be called when an event was received
   */
  mutationName: string;

  /**
   * Specify the mutation result schema.
   * Use this to customize the behavior when you need to return a specific object to be handled by the Adapter, like SQS with Batch Mode.
   *
   * @defaultValue `{ __typename }`
   */
  mutationResultQuery?: string;
};

/**
 * The adapter that wraps another adapter to force a transformation of the event data as a mutation to Apollo Server be able to handle.
 *
 * @breadcrumb Adapters / Apollo Server / ApolloServerMutationAdapter
 * @public
 */
export class ApolloServerMutationAdapter<TEvent, TContext, TResponse>
  implements AdapterContract<TEvent, TContext, TResponse>
{
  //#region Constructor

  /**
   * The default constructor
   */
  constructor(
    protected readonly baseAdapter: AdapterContract<
      TEvent,
      TContext,
      TResponse
    >,
    protected readonly options: ApolloServerMutationAdapterOptions,
  ) {}

  //#endregion

  //#region Public Methods

  /**
   * {@inheritDoc}
   */
  public canHandle(event: unknown, context: TContext, log: ILogger): boolean {
    return this.baseAdapter.canHandle(event, context, log);
  }

  /**
   * {@inheritDoc}
   */
  public getAdapterName(): string {
    return this.baseAdapter.getAdapterName() + 'Mutation';
  }

  /**
   * {@inheritDoc}
   */
  public getRequest(
    event: TEvent,
    context: TContext,
    log: ILogger,
  ): AdapterRequest {
    const request = this.baseAdapter.getRequest(event, context, log);

    request.method = 'POST';

    const operationName = this.options.mutationName;
    const mutationResultQuery = getDefaultIfUndefined(
      this.options.mutationResultQuery,
      '{ __typename }',
    );

    const mutationBody = JSON.stringify({
      operationName,
      query: `mutation ${operationName} ($event: String) { ${operationName} (event: $event) ${mutationResultQuery} }`,
      variables: {
        event: request.body?.toString() || '',
      },
    });

    const [buffer, contentLength] = getEventBodyAsBuffer(mutationBody, false);

    request.body = buffer;
    request.headers['content-type'] = 'application/json';
    request.headers['content-length'] = String(contentLength);

    return request;
  }

  /**
   * {@inheritDoc}
   */
  public getResponse(props: GetResponseAdapterProps<TEvent>): TResponse {
    const { data, errors } = JSON.parse(props.body);

    if (!errors) {
      return this.baseAdapter.getResponse({
        ...props,
        body: JSON.stringify(data[this.options.mutationName]),
      });
    }

    // when error happens, is the responsability of base adapter
    // to deal with error status code.
    return this.baseAdapter.getResponse(props);
  }

  /**
   * {@inheritDoc}
   */
  public onErrorWhileForwarding(props: OnErrorProps<TEvent, TResponse>): void {
    return this.baseAdapter.onErrorWhileForwarding(props);
  }

  //#endregion
}


================================================
FILE: src/adapters/apollo-server/index.ts
================================================
export * from './apollo-server-mutation.adapter';


================================================
FILE: src/adapters/aws/alb.adapter.ts
================================================
//#region Imports

import type { ALBEvent, ALBResult, Context } from 'aws-lambda';
import type {
  AdapterContract,
  AdapterRequest,
  GetResponseAdapterProps,
  OnErrorProps,
} from '../../contracts';
import {
  type StripBasePathFn,
  buildStripBasePath,
  getEventBodyAsBuffer,
  getFlattenedHeadersMap,
  getMultiValueHeadersMap,
  getPathWithQueryStringParams,
} from '../../core';

//#endregion

/**
 * The options to customize the {@link AlbAdapter}
 *
 * @breadcrumb Adapters / AWS / AlbAdapter
 * @public
 */
export interface AlbAdapterOptions {
  /**
   * Strip base path for custom domains
   *
   * @defaultValue ''
   */
  stripBasePath?: string;
}

/**
 * The adapter to handle requests from AWS ALB
 *
 * @example
 * ```typescript
 * const stripBasePath = '/any/custom/base/path'; // default ''
 * const adapter = new AlbAdapter({ stripBasePath });
 * ```
 *
 * {@link https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html | Event Reference}
 *
 * @breadcrumb Adapters / AWS / AlbAdapter
 * @public
 */
export class AlbAdapter
  implements AdapterContract<ALBEvent, Context, ALBResult>
{
  //#region Constructor

  /**
   * Default constructor
   *
   * @param options - The options to customize the {@link AlbAdapter}
   */
  constructor(protected readonly options?: AlbAdapterOptions) {
    this.stripPathFn = buildStripBasePath(this.options?.stripBasePath);
  }

  //#endregion

  //#region Protected Properties

  /**
   * Strip base path function
   */
  protected stripPathFn: StripBasePathFn;

  //#endregion

  //#region Public Methods

  /**
   * {@inheritDoc}
   */
  public getAdapterName(): string {
    return AlbAdapter.name;
  }

  /**
   * {@inheritDoc}
   */
  public canHandle(event: unknown): event is ALBEvent {
    const albEvent = event as Partial<ALBEvent>;

    return !!(albEvent?.requestContext && albEvent.requestContext.elb);
  }

  /**
   * {@inheritDoc}
   */
  public getRequest(event: ALBEvent): AdapterRequest {
    const method = event.httpMethod;
    const path = this.getPathFromEvent(event);

    const headers = event.multiValueHeaders
      ? getFlattenedHeadersMap(event.multiValueHeaders, ',', true)
      : event.headers!;

    let body: Buffer | undefined;

    if (event.body) {
      const [bufferBody, contentLength] = getEventBodyAsBuffer(
        event.body,
        event.isBase64Encoded,
      );

      body = bufferBody;
      headers['content-length'] = String(contentLength);
    }

    let remoteAddress = '';

    // ref: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html#x-forwarded-for
    if (headers['x-forwarded-for']) remoteAddress = headers['x-forwarded-for'];

    return {
      method,
      headers,
      body,
      remoteAddress,
      path,
    };
  }

  /**
   * {@inheritDoc}
   */
  public getResponse({
    event,
    headers: responseHeaders,
    body,
    isBase64Encoded,
    statusCode,
  }: GetResponseAdapterProps<ALBEvent>): ALBResult {
    const multiValueHeaders = !event.headers
      ? getMultiValueHeadersMap(responseHeaders)
      : undefined;

    const headers = event.headers
      ? getFlattenedHeadersMap(responseHeaders)
      : undefined;

    if (headers && headers['transfer-encoding'] === 'chunked')
      delete headers['transfer-encoding'];

    if (
      multiValueHeaders &&
      multiValueHeaders['transfer-encoding']?.includes('chunked')
    )
      delete multiValueHeaders['transfer-encoding'];

    return {
      statusCode,
      body,
      headers,
      multiValueHeaders,
      isBase64Encoded,
    };
  }

  /**
   * {@inheritDoc}
   */
  public onErrorWhileForwarding({
    error,
    delegatedResolver,
    respondWithErrors,
    event,
    log,
  }: OnErrorProps<ALBEvent, ALBResult>): void {
    const body = respondWithErrors ? error.stack || '' : '';
    const errorResponse = this.getResponse({
      event,
      statusCode: 500,
      body,
      headers: {},
      isBase64Encoded: false,
      log,
    });

    delegatedResolver.succeed(errorResponse);
  }

  //#endregion

  //#region Protected Methods

  /**
   * Get path from event with query strings
   *
   * @param event - The event sent by serverless
   */
  protected getPathFromEvent(event: ALBEvent): string {
    const path = this.stripPathFn(event.path);

    const queryParams = event.headers
      ? event.queryStringParameters
      : event.multiValueQueryStringParameters;

    return getPathWithQueryStringParams(path, queryParams || {});
  }

  //#endregion
}


================================================
FILE: src/adapters/aws/api-gateway-v1.adapter.ts
================================================
//#region Imports

import type { APIGatewayProxyResult, Context } from 'aws-lambda';
import type { APIGatewayProxyEvent } from 'aws-lambda/trigger/api-gateway-proxy';
import type {
  AdapterContract,
  AdapterRequest,
  GetResponseAdapterProps,
  OnErrorProps,
} from '../../contracts';
import { keysToLowercase } from '../../core';
import {
  type StripBasePathFn,
  buildStripBasePath,
  getDefaultIfUndefined,
  getEventBodyAsBuffer,
  getMultiValueHeadersMap,
  getPathWithQueryStringParams,
} from '../../core';

//#endregion

/**
 * The options to customize the {@link ApiGatewayV1Adapter}
 *
 * @breadcrumb Adapters / AWS / ApiGatewayV1Adapter
 * @public
 */
export interface ApiGatewayV1Options {
  /**
   * Strip base path for custom domains
   *
   * @defaultValue ''
   */
  stripBasePath?: string;

  /**
   * Throw an exception when you send the `transfer-encoding=chunked`, currently, API Gateway doesn't support chunked transfer.
   * If this is set to `false`, we will remove the `transfer-encoding` header from the response and buffer the response body
   * while we remove the special characters inserted by the chunked encoding.
   *
   * @remarks To learn more https://github.com/H4ad/serverless-adapter/issues/165
   * @defaultValue true
   */
  throwOnChunkedTransferEncoding?: boolean;

  /**
   * Emulates the behavior of Node.js `http` module by ensuring all request headers are lowercase.
   *
   * @defaultValue false
   */
  lowercaseRequestHeaders?: boolean;
}

/**
 * The adapter to handle requests from AWS Api Gateway V1
 *
 * As per {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html | know issues}, we throw an exception when you send the `transfer-encoding=chunked`, currently, API Gateway doesn't support chunked transfer.
 *
 * @remarks This adapter is not fully compatible with \@vendia/serverless-express, on \@vendia they filter `transfer-encoding=chunked` but we throw an exception.
 *
 * @example
 * ```typescript
 * const stripBasePath = '/any/custom/base/path'; // default ''
 * const adapter = new ApiGatewayV1Adapter({ stripBasePath });
 * ```
 *
 * {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html | Event Reference}
 *
 * @breadcrumb Adapters / AWS / ApiGatewayV1Adapter
 * @public
 */
export class ApiGatewayV1Adapter
  implements
    AdapterContract<APIGatewayProxyEvent, Context, APIGatewayProxyResult>
{
  //#region Constructor

  /**
   * Default constructor
   *
   * @param options - The options to customize the {@link ApiGatewayV1Adapter}
   */
  constructor(protected readonly options?: ApiGatewayV1Options) {
    this.stripPathFn = buildStripBasePath(this.options?.stripBasePath);
  }

  //#endregion

  //#region Protected Properties

  /**
   * Strip base path function
   */
  protected stripPathFn: StripBasePathFn;

  //#endregion

  //#region Public Methods

  /**
   * {@inheritDoc}
   */
  public getAdapterName(): string {
    return ApiGatewayV1Adapter.name;
  }

  /**
   * {@inheritDoc}
   */
  public canHandle(event: unknown): event is APIGatewayProxyEvent {
    const partialEventV1 = event as Partial<APIGatewayProxyEvent> & {
      version?: '2.0';
    };

    return !!(
      partialEventV1?.requestContext &&
      partialEventV1.version !== '2.0' &&
      partialEventV1.headers &&
      partialEventV1.multiValueHeaders &&
      ((partialEventV1.queryStringParameters === null &&
        partialEventV1.multiValueQueryStringParameters === null) ||
        (partialEventV1.queryStringParameters &&
          partialEventV1.multiValueQueryStringParameters))
    );
  }

  /**
   * {@inheritDoc}
   */
  public getRequest(event: APIGatewayProxyEvent): AdapterRequest {
    const method = event.httpMethod;
    const headers = this.options?.lowercaseRequestHeaders
      ? keysToLowercase(event.headers)
      : { ...event.headers };

    for (const multiValueHeaderKey of Object.keys(
      event.multiValueHeaders || {},
    )) {
      const headerValue = event.multiValueHeaders[multiValueHeaderKey];

      // event.headers by default only stick with first value if they see multiple headers
      // the other values will only appear on multiValueHeaderKey, in this case
      // we look for headers with more than 1 length which is the wrong values on event.headers
      // https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
      if (!headerValue || headerValue?.length <= 1) continue;

      headers[multiValueHeaderKey] = headerValue.join(',');
    }

    const path = this.getPathFromEvent(event);

    let body: Buffer | undefined;

    if (event.body) {
      const [bufferBody, contentLength] = getEventBodyAsBuffer(
        event.body,
        event.isBase64Encoded,
      );

      body = bufferBody;
      // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
      headers['content-length'] = contentLength + '';
    }

    const remoteAddress = event.requestContext.identity.sourceIp;

    return {
      method,
      headers,
      body,
      remoteAddress,
      path,
    };
  }

  /**
   * {@inheritDoc}
   */
  public getResponse({
    headers: responseHeaders,
    body,
    isBase64Encoded,
    statusCode,
    response,
  }: GetResponseAdapterProps<APIGatewayProxyEvent>): APIGatewayProxyResult {
    const multiValueHeaders = getMultiValueHeadersMap(responseHeaders);

    const shouldThrowOnChunkedTransferEncoding = getDefaultIfUndefined(
      this.options?.throwOnChunkedTransferEncoding,
      true,
    );
    const transferEncodingHeader = multiValueHeaders['transfer-encoding'];
    const hasTransferEncodingChunked = transferEncodingHeader?.some(value =>
      value.includes('chunked'),
    );

    if (hasTransferEncodingChunked || response?.chunkedEncoding) {
      if (shouldThrowOnChunkedTransferEncoding) {
        throw new Error(
          'chunked encoding in headers is not supported by API Gateway V1',
        );
      } else delete multiValueHeaders['transfer-encoding'];
    }

    return {
      statusCode,
      body,
      multiValueHeaders,
      isBase64Encoded,
    };
  }

  /**
   * {@inheritDoc}
   */
  public onErrorWhileForwarding({
    error,
    delegatedResolver,
    respondWithErrors,
    event,
    log,
  }: OnErrorProps<APIGatewayProxyEvent, APIGatewayProxyResult>): void {
    const body = respondWithErrors ? error.stack : '';
    const errorResponse = this.getResponse({
      event,
      statusCode: 500,
      body: body || '',
      headers: {},
      isBase64Encoded: false,
      log,
    });

    delegatedResolver.succeed(errorResponse);
  }

  //#endregion

  //#region Protected Methods

  /**
   * Get path from event with query strings
   *
   * @param event - The event sent by serverless
   */
  protected getPathFromEvent(event: APIGatewayProxyEvent): string {
    const path = this.stripPathFn(event.path);
    const queryParams = event.multiValueQueryStringParameters || {};

    if (event.queryStringParameters) {
      for (const queryStringKey of Object.keys(event.queryStringParameters)) {
        const queryStringValue = event.queryStringParameters[queryStringKey];

        if (queryStringValue === undefined) continue;

        if (!Array.isArray(queryParams[queryStringKey]))
          queryParams[queryStringKey] = [];

        if (queryParams[queryStringKey]!.includes(queryStringValue)) continue;

        queryParams[queryStringKey]!.push(queryStringValue);
      }
    }

    return getPathWithQueryStringParams(path, queryParams);
  }

  //#endregion
}


================================================
FILE: src/adapters/aws/api-gateway-v2.adapter.ts
================================================
//#region Imports

import type { APIGatewayProxyEventV2, Context } from 'aws-lambda';
import type { APIGatewayProxyStructuredResultV2 } from 'aws-lambda/trigger/api-gateway-proxy';
import type {
  AdapterContract,
  AdapterRequest,
  GetResponseAdapterProps,
  OnErrorProps,
} from '../../contracts';
import {
  type StripBasePathFn,
  buildStripBasePath,
  getDefaultIfUndefined,
  getEventBodyAsBuffer,
  getFlattenedHeadersMapAndCookies,
  getPathWithQueryStringParams,
} from '../../core';

//#endregion

/**
 * The options to customize the {@link ApiGatewayV2Adapter}
 *
 * @breadcrumb Adapters / AWS / ApiGatewayV2Adapter
 * @public
 */
export interface ApiGatewayV2Options {
  /**
   * Strip base path for custom domains
   *
   * @defaultValue ''
   */
  stripBasePath?: string;

  /**
   * Throw an exception when you send the `transfer-encoding=chunked`, currently, API Gateway doesn't support chunked transfer.
   * If this is set to `false`, we will remove the `transfer-encoding` header from the response and buffer the response body
   * while we remove the special characters inserted by the chunked encoding.
   *
   * @remarks To learn more https://github.com/H4ad/serverless-adapter/issues/165
   * @defaultValue true
   */
  throwOnChunkedTransferEncoding?: boolean;
}

/**
 * The adapter to handle requests from AWS Api Gateway V2
 *
 * As per {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html | know issues}, we throw an exception when you send the `transfer-encoding=chunked`.
 * But, if you use this adapter to accept requests from Function URL, you can accept the `transfer-encoding=chunked` changing the method of invocation from `BUFFERED` to `RESPONSE_STREAM`.
 *
 * @example
 * ```typescript
 * const stripBasePath = '/any/custom/base/path'; // default ''
 * const adapter = new ApiGatewayV2Adapter({ stripBasePath });
 * ```
 *
 * {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html | Event Reference}
 *
 * @breadcrumb Adapters / AWS / ApiGatewayV2Adapter
 * @public
 */
export class ApiGatewayV2Adapter
  implements
    AdapterContract<
      APIGatewayProxyEventV2,
      Context,
      APIGatewayProxyStructuredResultV2
    >
{
  //#region Constructor

  /**
   * Default constructor
   *
   * @param options - The options to customize the {@link ApiGatewayV2Adapter}
   */
  constructor(protected readonly options?: ApiGatewayV2Options) {
    this.stripPathFn = buildStripBasePath(this.options?.stripBasePath);
  }

  //#endregion

  //#region Protected Properties

  /**
   * Strip base path function
   */
  protected stripPathFn: StripBasePathFn;

  //#endregion

  //#region Public Methods

  /**
   * {@inheritDoc}
   */
  public getAdapterName(): string {
    return ApiGatewayV2Adapter.name;
  }

  /**
   * {@inheritDoc}
   */
  public canHandle(event: unknown): event is APIGatewayProxyEventV2 {
    const apiGatewayEvent = event as Partial<APIGatewayProxyEventV2> & {
      version?: string;
    };

    return !!(
      apiGatewayEvent?.requestContext && apiGatewayEvent.version === '2.0'
    );
  }

  /**
   * {@inheritDoc}
   */
  public getRequest(event: APIGatewayProxyEventV2): AdapterRequest {
    const method = event.requestContext.http.method;
    const path = this.getPathFromEvent(event);
    // accords https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
    // all headers are lowercased and cannot be array
    // so no need to format, just a shallow copy will work here
    const headers = { ...event.headers };

    if (event.cookies) headers.cookie = event.cookies.join('; ');

    let body: Buffer | undefined;

    if (event.body) {
      const [bufferBody, contentLength] = getEventBodyAsBuffer(
        event.body,
        event.isBase64Encoded,
      );

      body = bufferBody;
      // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
      headers['content-length'] = contentLength + '';
    }

    const remoteAddress = event.requestContext.http.sourceIp;

    return {
      method,
      headers,
      body,
      remoteAddress,
      path,
    };
  }

  /**
   * {@inheritDoc}
   */
  public getResponse({
    headers: responseHeaders,
    body,
    isBase64Encoded,
    statusCode,
    response,
  }: GetResponseAdapterProps<APIGatewayProxyEventV2>): APIGatewayProxyStructuredResultV2 {
    const { cookies, headers } =
      getFlattenedHeadersMapAndCookies(responseHeaders);

    const shouldThrowOnChunkedTransferEncoding = getDefaultIfUndefined(
      this.options?.throwOnChunkedTransferEncoding,
      true,
    );

    const transferEncodingHeader: string | undefined =
      headers['transfer-encoding'];

    const hasTransferEncodingChunked =
      transferEncodingHeader && transferEncodingHeader.includes('chunked');

    if (hasTransferEncodingChunked || response?.chunkedEncoding) {
      if (shouldThrowOnChunkedTransferEncoding) {
        throw new Error(
          'chunked encoding in headers is not supported by API Gateway V2',
        );
      } else delete headers['transfer-encoding'];
    }

    return {
      statusCode,
      body,
      headers,
      isBase64Encoded,
      cookies,
    };
  }

  /**
   * {@inheritDoc}
   */
  public onErrorWhileForwarding({
    error,
    delegatedResolver,
    respondWithErrors,
    event,
    log,
  }: OnErrorProps<
    APIGatewayProxyEventV2,
    APIGatewayProxyStructuredResultV2
  >): void {
    const body = respondWithErrors ? error.stack : '';
    const errorResponse = this.getResponse({
      event,
      statusCode: 500,
      body: body || '',
      headers: {},
      isBase64Encoded: false,
      log,
    });

    delegatedResolver.succeed(errorResponse);
  }

  //#endregion

  //#region Protected Methods

  /**
   * Get path from event with query strings
   *
   * @param event - The event sent by serverless
   */
  protected getPathFromEvent(event: APIGatewayProxyEventV2): string {
    const path = this.stripPathFn(event.rawPath);
    const queryParams = event.rawQueryString;

    return getPathWithQueryStringParams(path, queryParams || {});
  }

  //#endregion
}


================================================
FILE: src/adapters/aws/base/aws-simple-adapter.ts
================================================
//#region Imports

import type { Context, SQSBatchItemFailure } from 'aws-lambda';
import type {
  AdapterContract,
  AdapterRequest,
  GetResponseAdapterProps,
  OnErrorProps,
} from '../../../contracts';
import {
  EmptyResponse,
  type IEmptyResponse,
  getEventBodyAsBuffer,
} from '../../../core';

//#endregion

/**
 * The options to customize the {@link AwsSimpleAdapter}
 *
 * @breadcrumb Adapters / AWS / AWS Simple Adapter
 * @public
 */
export interface AWSSimpleAdapterOptions {
  /**
   * The path that will be used to create a request to be forwarded to the framework.
   */
  forwardPath: string;

  /**
   * The http method that will be used to create a request to be forwarded to the framework.
   */
  forwardMethod: string;

  /**
   * The AWS Service host that will be injected inside headers to developer being able to validate if request originate from the library.
   */
  host: string;

  /**
   * Tells if this adapter should support batch item failures.
   */
  batch?: true | false;
}

/**
 * The batch item failure response expected from the API server
 *
 * @breadcrumb Adapters / AWS / AWS Simple Adapter
 * @public
 */
export type BatchItemFailureResponse = SQSBatchItemFailure;

/**
 * The possible options of response for {@link AwsSimpleAdapter}
 *
 * @breadcrumb Adapters / AWS / AWS Simple Adapter
 * @public
 */
export type AWSSimpleAdapterResponseType =
  | BatchItemFailureResponse
  | IEmptyResponse;

/**
 * The abstract adapter to use to implement other simple AWS adapters
 *
 * @breadcrumb Adapters / AWS / AWS Simple Adapter
 * @public
 */
export abstract class AwsSimpleAdapter<TEvent>
  implements AdapterContract<TEvent, Context, AWSSimpleAdapterResponseType>
{
  //#region Constructor

  /**
   * Default constructor
   *
   * @param options - The options to customize the {@link AwsSimpleAdapter}
   */
  constructor(protected readonly options: AWSSimpleAdapterOptions) {}

  //#endregion

  //#region Public Methods

  /**
   * {@inheritDoc}
   */
  public getAdapterName(): string {
    throw new Error('not implemented.');
  }

  /**
   * {@inheritDoc}
   */
  public canHandle(_: unknown): _ is TEvent {
    throw new Error('not implemented.');
  }

  /**
   * {@inheritDoc}
   */
  public getRequest(event: TEvent): AdapterRequest {
    const path = this.options.forwardPath;
    const method = this.options.forwardMethod;

    const [body, contentLength] = getEventBodyAsBuffer(
      JSON.stringify(event),
      false,
    );

    const headers = {
      host: this.options.host,
      'content-type': 'application/json',
      'content-length': String(contentLength),
    };

    return {
      method,
      headers,
      body,
      path,
    };
  }

  /**
   * {@inheritDoc}
   */
  public getResponse({
    body,
    headers,
    isBase64Encoded,
    event,
    statusCode,
  }: GetResponseAdapterProps<TEvent>): AWSSimpleAdapterResponseType {
    if (this.hasInvalidStatusCode(statusCode)) {
      throw new Error(
        JSON.stringify({ body, headers, isBase64Encoded, event, statusCode }),
      );
    }

    if (!this.options.batch) return EmptyResponse;

    if (isBase64Encoded) {
      throw new Error(
        'SERVERLESS_ADAPTER: The response could not be base64 encoded when you set batch: true, the response should be a JSON.',
      );
    }

    if (!body) return EmptyResponse;

    return JSON.parse(body);
  }

  /**
   * {@inheritDoc}
   */
  public onErrorWhileForwarding({
    error,
    delegatedResolver,
  }: OnErrorProps<TEvent, AWSSimpleAdapterResponseType>): void {
    delegatedResolver.fail(error);
  }

  //#endregion

  //#region Protected Methods

  /**
   * Check if the status code is invalid
   *
   * @param statusCode - The status code
   */
  protected hasInvalidStatusCode(statusCode: number): boolean {
    return statusCode < 200 || statusCode >= 400;
  }

  //#endregion
}


================================================
FILE: src/adapters/aws/base/index.ts
================================================
export * from './aws-simple-adapter';


================================================
FILE: src/adapters/aws/dynamodb.adapter.ts
================================================
//#region Imports

import type { DynamoDBStreamEvent } from 'aws-lambda';
import { getDefaultIfUndefined } from '../../core';
import { type AWSSimpleAdapterOptions, AwsSimpleAdapter } from './base/index';

//#endregion

/**
 * The options to customize the {@link DynamoDBAdapter}
 *
 * @breadcrumb Adapters / AWS / DynamoDBAdapter
 * @public
 */
export interface DynamoDBAdapterOptions
  extends Pick<AWSSimpleAdapterOptions, 'batch'> {
  /**
   * The path that will be used to create a request to be forwarded to the framework.
   *
   * @defaultValue /dynamo
   */
  dynamoDBForwardPath?: string;

  /**
   * The http method that will be used to create a request to be forwarded to the framework.
   *
   * @defaultValue POST
   */
  dynamoDBForwardMethod?: string;
}

/**
 * The adapter to handle requests from AWS DynamoDB.
 *
 * The option of `responseWithErrors` is ignored by this adapter and we always call `resolver.fail` with the error.
 *
 * {@link https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html | Event Reference}
 *
 * @example
 * ```typescript
 * const dynamoDBForwardPath = '/your/route/dynamo'; // default /dynamo
 * const dynamoDBForwardMethod = 'POST'; // default POST
 * const adapter = new DynamoDBAdapter({ dynamoDBForwardPath, dynamoDBForwardMethod });
 * ```
 *
 * @breadcrumb Adapters / AWS / DynamoDBAdapter
 * @public
 */
export class DynamoDBAdapter extends AwsSimpleAdapter<DynamoDBStreamEvent> {
  //#region Constructor

  /**
   * Default constructor
   *
   * @param options - The options to customize the {@link DynamoDBAdapter}
   */
  constructor(options?: DynamoDBAdapterOptions) {
    super({
      forwardPath: getDefaultIfUndefined(
        options?.dynamoDBForwardPath,
        '/dynamo',
      ),
      forwardMethod: getDefaultIfUndefined(
        options?.dynamoDBForwardMethod,
        'POST',
      ),
      batch: options?.batch,
      host: 'dynamodb.amazonaws.com',
    });
  }

  //#endregion

  //#region Public Methods

  /**
   * {@inheritDoc}
   */
  public override getAdapterName(): string {
    return DynamoDBAdapter.name;
  }

  /**
   * {@inheritDoc}
   */
  public override canHandle(event: unknown): event is DynamoDBStreamEvent {
    const dynamoDBevent = event as Partial<DynamoDBStreamEvent>;

    if (!Array.isArray(dynamoDBevent?.Records)) return false;

    const eventSource = dynamoDBevent.Records[0]?.eventSource;

    return eventSource === 'aws:dynamodb';
  }

  //#endregion
}


================================================
FILE: src/ad
Download .txt
gitextract_42shtyvg/

├── .eslintignore
├── .eslintrc
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── config.yml
│   │   └── feature_request.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── dependabot.yml
│   ├── settings.yml
│   └── workflows/
│       ├── codeql-analysis.yml
│       ├── docs.yml
│       ├── pr.yml
│       └── release.yml
├── .gitignore
├── .husky/
│   ├── .gitignore
│   ├── pre-commit
│   └── prepare-commit-msg
├── .npmrc
├── .prettierrc
├── .release-please-manifest.json
├── .tmuxinator.yml
├── .tool-versions
├── .vscode/
│   ├── launch.json
│   └── settings.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── api-extractor.json
├── benchmark/
│   ├── .gitignore
│   ├── .swcrc
│   ├── README.md
│   ├── package.json
│   ├── src/
│   │   ├── events.ts
│   │   ├── framework.mock.ts
│   │   └── samples/
│   │       ├── clone-headers.ts
│   │       ├── compare-libraries.ts
│   │       └── format-headers.ts
│   └── tsconfig.json
├── package.json
├── release-please-config.json
├── scripts/
│   ├── generate-api-pages.ts
│   ├── generate-markdown.ts
│   ├── libs/
│   │   ├── CustomMarkdownDocumenter.ts
│   │   ├── CustomUtilities.ts
│   │   └── MarkdownEmitter.ts
│   ├── models/
│   │   └── apidoc.types.ts
│   └── parse-docs.ts
├── src/
│   ├── @types/
│   │   ├── binary-settings.ts
│   │   ├── digital-ocean/
│   │   │   ├── digital-ocean-http-event.ts
│   │   │   ├── digital-ocean-http-response.ts
│   │   │   └── index.ts
│   │   ├── headers.ts
│   │   ├── helpers.ts
│   │   ├── huawei/
│   │   │   ├── huawei-api-gateway-event.ts
│   │   │   ├── huawei-api-gateway-response.ts
│   │   │   ├── huawei-context.ts
│   │   │   └── index.ts
│   │   └── index.ts
│   ├── adapters/
│   │   ├── apollo-server/
│   │   │   ├── apollo-server-mutation.adapter.ts
│   │   │   └── index.ts
│   │   ├── aws/
│   │   │   ├── alb.adapter.ts
│   │   │   ├── api-gateway-v1.adapter.ts
│   │   │   ├── api-gateway-v2.adapter.ts
│   │   │   ├── base/
│   │   │   │   ├── aws-simple-adapter.ts
│   │   │   │   └── index.ts
│   │   │   ├── dynamodb.adapter.ts
│   │   │   ├── event-bridge.adapter.ts
│   │   │   ├── index.ts
│   │   │   ├── lambda-edge.adapter.ts
│   │   │   ├── request-lambda-edge.adapter.ts
│   │   │   ├── s3.adapter.ts
│   │   │   ├── sns.adapter.ts
│   │   │   └── sqs.adapter.ts
│   │   ├── azure/
│   │   │   ├── http-trigger-v4.adapter.ts
│   │   │   └── index.ts
│   │   ├── digital-ocean/
│   │   │   ├── http-function.adapter.ts
│   │   │   └── index.ts
│   │   ├── dummy/
│   │   │   ├── dummy.adapter.ts
│   │   │   └── index.ts
│   │   └── huawei/
│   │       ├── huawei-api-gateway.adapter.ts
│   │       └── index.ts
│   ├── contracts/
│   │   ├── adapter.contract.ts
│   │   ├── framework.contract.ts
│   │   ├── handler.contract.ts
│   │   ├── index.ts
│   │   └── resolver.contract.ts
│   ├── core/
│   │   ├── base-handler.ts
│   │   ├── constants.ts
│   │   ├── current-invoke.ts
│   │   ├── event-body.ts
│   │   ├── headers.ts
│   │   ├── index.ts
│   │   ├── is-binary.ts
│   │   ├── logger.ts
│   │   ├── no-op.ts
│   │   ├── optional.ts
│   │   ├── path.ts
│   │   └── stream.ts
│   ├── frameworks/
│   │   ├── apollo-server/
│   │   │   ├── apollo-server.framework.ts
│   │   │   └── index.ts
│   │   ├── body-parser/
│   │   │   ├── base-body-parser.framework.ts
│   │   │   ├── index.ts
│   │   │   ├── json-body-parser.framework.ts
│   │   │   ├── raw-body-parser.framework.ts
│   │   │   ├── text-body-parser.framework.ts
│   │   │   └── urlencoded-body-parser.framework.ts
│   │   ├── cors/
│   │   │   ├── cors.framework.ts
│   │   │   └── index.ts
│   │   ├── deepkit/
│   │   │   ├── http-deepkit.framework.ts
│   │   │   └── index.ts
│   │   ├── express/
│   │   │   ├── express.framework.ts
│   │   │   └── index.ts
│   │   ├── fastify/
│   │   │   ├── fastify.framework.ts
│   │   │   ├── helpers/
│   │   │   │   └── no-op-content-parser.ts
│   │   │   └── index.ts
│   │   ├── hapi/
│   │   │   ├── hapi.framework.ts
│   │   │   └── index.ts
│   │   ├── koa/
│   │   │   ├── index.ts
│   │   │   └── koa.framework.ts
│   │   ├── lazy/
│   │   │   ├── index.ts
│   │   │   └── lazy.framework.ts
│   │   ├── polka/
│   │   │   ├── index.ts
│   │   │   └── polka.framework.ts
│   │   └── trpc/
│   │       ├── index.ts
│   │       └── trpc.framework.ts
│   ├── handlers/
│   │   ├── aws/
│   │   │   ├── aws-stream.handler.ts
│   │   │   └── index.ts
│   │   ├── azure/
│   │   │   ├── azure.handler.ts
│   │   │   └── index.ts
│   │   ├── base/
│   │   │   ├── index.ts
│   │   │   └── raw-request.ts
│   │   ├── default/
│   │   │   ├── default.handler.ts
│   │   │   └── index.ts
│   │   ├── digital-ocean/
│   │   │   ├── digital-ocean.handler.ts
│   │   │   └── index.ts
│   │   ├── firebase/
│   │   │   ├── http-firebase-v2.handler.ts
│   │   │   ├── http-firebase.handler.ts
│   │   │   └── index.ts
│   │   ├── gcp/
│   │   │   ├── gcp.handler.ts
│   │   │   └── index.ts
│   │   └── huawei/
│   │       ├── http-huawei.handler.ts
│   │       └── index.ts
│   ├── index.doc.ts
│   ├── index.ts
│   ├── network/
│   │   ├── index.ts
│   │   ├── request.ts
│   │   ├── response-stream.ts
│   │   ├── response.ts
│   │   └── utils.ts
│   ├── resolvers/
│   │   ├── aws-context/
│   │   │   ├── aws-context.resolver.ts
│   │   │   └── index.ts
│   │   ├── callback/
│   │   │   ├── callback.resolver.ts
│   │   │   └── index.ts
│   │   ├── dummy/
│   │   │   ├── dummy.resolver.ts
│   │   │   └── index.ts
│   │   └── promise/
│   │       ├── index.ts
│   │       └── promise.resolver.ts
│   └── serverless-adapter.ts
├── test/
│   ├── adapters/
│   │   ├── apollo-server/
│   │   │   └── apollo-mutation.adapter.spec.ts
│   │   ├── aws/
│   │   │   ├── alb.adapter.spec.ts
│   │   │   ├── api-gateway-v1.adapter.spec.ts
│   │   │   ├── api-gateway-v2.adapter.spec.ts
│   │   │   ├── aws-simple-adapter.spec.ts
│   │   │   ├── dynamodb.adapter.spec.ts
│   │   │   ├── event-bridge.adapter.spec.ts
│   │   │   ├── lambda-edge.adapter.spec.ts
│   │   │   ├── request-lambda-edge.adapter.spec.ts
│   │   │   ├── s3.adapter.spec.ts
│   │   │   ├── sns.adapter.spec.ts
│   │   │   ├── sqs.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── alb-event.ts
│   │   │       ├── api-gateway-v1.ts
│   │   │       ├── api-gateway-v2.ts
│   │   │       ├── dynamodb.ts
│   │   │       ├── event-bridge.ts
│   │   │       ├── events.ts
│   │   │       ├── lambda-edge.ts
│   │   │       ├── s3.ts
│   │   │       ├── sns.ts
│   │   │       └── sqs.ts
│   │   ├── azure/
│   │   │   ├── http-trigger.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── events.ts
│   │   │       └── http-trigger.ts
│   │   ├── digital-ocean/
│   │   │   ├── http-function.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── event.ts
│   │   │       └── http-function.ts
│   │   ├── dummy/
│   │   │   └── dummy.adapter.spec.ts
│   │   ├── huawei/
│   │   │   ├── huawei-api-gateway.adapter.spec.ts
│   │   │   └── utils/
│   │   │       ├── events.ts
│   │   │       └── huawei-api-gateway.ts
│   │   ├── test.example
│   │   └── utils/
│   │       ├── can-handle.ts
│   │       └── events.ts
│   ├── core/
│   │   ├── base-handler.spec.ts
│   │   ├── current-invoke.spec.ts
│   │   ├── event-body.spec.ts
│   │   ├── headers.spec.ts
│   │   ├── is-binary.spec.ts
│   │   ├── logger.spec.ts
│   │   ├── no-op.spec.ts
│   │   ├── optional.spec.ts
│   │   ├── path.spec.ts
│   │   ├── stream.spec.ts
│   │   └── utils/
│   │       └── stream.ts
│   ├── frameworks/
│   │   ├── apollo-server.framework.spec.ts
│   │   ├── body-parser-v2.framework.spec.ts
│   │   ├── body-parser.framework.helper.ts
│   │   ├── body-parser.framework.spec.ts
│   │   ├── cors.framework.spec.ts
│   │   ├── express-v5.framework.spec.ts
│   │   ├── express.framework.spec.ts
│   │   ├── fastify-v5.framework.spec.ts
│   │   ├── fastify.framework.spec.ts
│   │   ├── hapi.framework.spec.ts
│   │   ├── http-deepkit.framework.spec.ts
│   │   ├── koa.framework.spec.ts
│   │   ├── lazy.framework.spec.ts
│   │   ├── polka.framework.spec.ts
│   │   ├── trpc.framework.spec.ts
│   │   └── utils.ts
│   ├── handlers/
│   │   ├── aws-stream.handler.spec.ts
│   │   ├── azure.handler.spec.ts
│   │   ├── default.handler.spec.ts
│   │   ├── digital-ocean.handler.spec.ts
│   │   ├── gcp.handler.spec.ts
│   │   ├── http-firebase-v2.handler.spec.ts
│   │   ├── http-firebase-v2.sdk-v5.handler.spec.ts
│   │   ├── http-firebase-v2.sdk-v6.handler.spec.ts
│   │   ├── http-firebase.handler.spec.ts
│   │   └── huawei.handler.spec.ts
│   ├── issues/
│   │   ├── alb-express-static/
│   │   │   ├── alb-express-static.spec.ts
│   │   │   └── robots.txt
│   │   └── issue-165/
│   │       └── transfer-encoding-chunked-support.spec.ts
│   ├── mocks/
│   │   └── framework.mock.ts
│   ├── network/
│   │   ├── request.spec.ts
│   │   └── response.spec.ts
│   ├── resolvers/
│   │   ├── aws-context.resolver.spec.ts
│   │   ├── callback.resolver.spec.ts
│   │   ├── dummy.resolver.spec.ts
│   │   └── promise.resolver.spec.ts
│   └── serverless-adapter.spec.ts
├── tsconfig.build.json
├── tsconfig.doc.json
├── tsconfig.eslint.json
├── tsconfig.json
├── tsdoc.json
├── tsup.config.ts
├── vite.config.ts
└── www/
    ├── .gitignore
    ├── .tool-versions
    ├── README.md
    ├── babel.config.js
    ├── blog/
    │   ├── 2022-06-17-the-beginning.mdx
    │   ├── 2022-07-17-updates-and-releases.mdx
    │   ├── 2023-04-28-aws-lambda-response-streaming.mdx
    │   ├── 2023-12-25-dual-package-publish.mdx
    │   └── authors.yml
    ├── docs/
    │   ├── .gitignore
    │   └── main/
    │       ├── adapters/
    │       │   ├── aws/
    │       │   │   ├── alb.mdx
    │       │   │   ├── api-gateway-v1.mdx
    │       │   │   ├── api-gateway-v2.mdx
    │       │   │   ├── dynamodb.mdx
    │       │   │   ├── event-bridge.mdx
    │       │   │   ├── function-url.mdx
    │       │   │   ├── lambda-edge.mdx
    │       │   │   ├── s3.mdx
    │       │   │   ├── sns.mdx
    │       │   │   └── sqs.mdx
    │       │   ├── azure/
    │       │   │   └── http-trigger-v4.mdx
    │       │   ├── digital-ocean/
    │       │   │   └── http-function.mdx
    │       │   ├── firebase.mdx
    │       │   └── huawei/
    │       │       └── huawei-api-gateway.mdx
    │       ├── advanced/
    │       │   └── adapters/
    │       │       ├── creating-an-adapter.mdx
    │       │       └── introduction.mdx
    │       ├── architecture.mdx
    │       ├── frameworks/
    │       │   ├── apollo-server.mdx
    │       │   ├── deepkit.mdx
    │       │   ├── express.mdx
    │       │   ├── fastify.mdx
    │       │   ├── hapi.mdx
    │       │   ├── helpers/
    │       │   │   ├── body-parser.mdx
    │       │   │   ├── cors.mdx
    │       │   │   └── lazy.mdx
    │       │   ├── koa.mdx
    │       │   ├── nestjs.mdx
    │       │   ├── polka.mdx
    │       │   └── trpc.mdx
    │       ├── getting-started/
    │       │   ├── customizing.mdx
    │       │   ├── examples.mdx
    │       │   ├── installation.mdx
    │       │   └── usage.mdx
    │       ├── handlers/
    │       │   ├── aws.mdx
    │       │   ├── azure.mdx
    │       │   ├── digital-ocean.mdx
    │       │   ├── firebase.mdx
    │       │   ├── gcp.mdx
    │       │   └── huawei.mdx
    │       ├── intro.mdx
    │       └── resolvers/
    │           ├── aws-context.mdx
    │           ├── callback.mdx
    │           └── promise.mdx
    ├── docusaurus.config.js
    ├── package.json
    ├── sidebars.js
    ├── src/
    │   ├── components/
    │   │   ├── BrowserWindow/
    │   │   │   ├── index.tsx
    │   │   │   └── styles.module.css
    │   │   ├── HomepageFeatures/
    │   │   │   ├── index.tsx
    │   │   │   └── styles.module.css
    │   │   └── HowToStart/
    │   │       ├── index.tsx
    │   │       └── styles.module.css
    │   ├── css/
    │   │   └── custom.css
    │   └── pages/
    │       ├── index.module.css
    │       └── index.tsx
    ├── static/
    │   ├── .nojekyll
    │   └── CNAME
    └── tsconfig.json
Download .txt
SYMBOL INDEX (493 symbols across 121 files)

FILE: benchmark/src/events.ts
  function createApiGatewayV1 (line 7) | function createApiGatewayV1(

FILE: benchmark/src/framework.mock.ts
  class FrameworkMock (line 10) | class FrameworkMock implements FrameworkContract<null> {
    method constructor (line 16) | constructor(
    method sendRequest (line 26) | public sendRequest(

FILE: benchmark/src/samples/format-headers.ts
  function getFlattenedHeadersMap (line 5) | function getFlattenedHeadersMap(
  function getFlattenedHeadersV2 (line 24) | function getFlattenedHeadersV2(
  function getFlattenedHeadersV3 (line 42) | function getFlattenedHeadersV3(

FILE: scripts/generate-api-pages.ts
  type BreadcrumbItem (line 13) | type BreadcrumbItem = {
  function isPlainTextNode (line 18) | function isPlainTextNode(block: DocNode): block is DocPlainText {
  function getBreadcrumbsWithApiItem (line 23) | function getBreadcrumbsWithApiItem(apiModel: ApiModel): BreadcrumbItem[] {
  type SidebarItem (line 63) | type SidebarItem = {
  type Sidebar (line 73) | type Sidebar = SidebarItem;
  function build (line 75) | function build(): void {

FILE: scripts/generate-markdown.ts
  function build (line 9) | function build(): void {

FILE: scripts/libs/CustomMarkdownDocumenter.ts
  type IMarkdownDocumenterOptions (line 62) | interface IMarkdownDocumenterOptions {
  class CustomMarkdownDocumenter (line 72) | class CustomMarkdownDocumenter {
    method constructor (line 73) | public constructor(options: IMarkdownDocumenterOptions) {
    method generateFiles (line 90) | public generateFiles(): void {
    method _writeApiItemPage (line 113) | private _writeApiItemPage(apiItem: ApiItem, parentOutput?: DocSection)...
    method _writeHeritageTypes (line 363) | private _writeHeritageTypes(
    method _writeRemarksSection (line 478) | private _writeRemarksSection(output: DocSection, apiItem: ApiItem): vo...
    method _writeThrowsSection (line 521) | private _writeThrowsSection(output: DocSection, apiItem: ApiItem): void {
    method _writeModelTable (line 552) | private _writeModelTable(output: DocSection, apiModel: ApiModel): void {
    method _writePackageOrNamespaceTables (line 588) | private _writePackageOrNamespaceTables(
    method _writeClassTables (line 756) | private _writeClassTables(output: DocSection, apiClass: ApiClass): void {
    method _writeEnumTables (line 779) | private _writeEnumTables(output: DocSection, apiEnum: ApiEnum): void {
    method _writeInterfaceTables (line 827) | private _writeInterfaceTables(
    method _writeParameterTables (line 853) | private _writeParameterTables(
    method _createParagraphForTypeExcerpt (line 939) | private _createParagraphForTypeExcerpt(excerpt: Excerpt): DocParagraph {
    method _appendExcerptWithHyperlinks (line 953) | private _appendExcerptWithHyperlinks(
    method _appendExcerptTokenWithHyperlinks (line 961) | private _appendExcerptTokenWithHyperlinks(
    method _createTitleCell (line 1001) | private _createTitleCell(apiItem: ApiItem): DocTableCell {
    method _createDescriptionCell (line 1027) | private _createDescriptionCell(apiItem: ApiItem): DocTableCell {
    method _writeBreadcrumb (line 1064) | private _writeBreadcrumb(output: DocSection, apiItem: ApiItem): void {
    method _writeBetaWarning (line 1096) | private _writeBetaWarning(output: DocSection): void {
    method _appendSection (line 1110) | private _appendSection(output: DocSection, docSection: DocSection): vo...
    method _appendAndMergeSection (line 1114) | private _appendAndMergeSection(
    method _getFilenameForApiItem (line 1134) | private _getFilenameForApiItem(
    method _getLinkFilenameForApiItem (line 1223) | private _getLinkFilenameForApiItem(apiItem: ApiItem): string {
    method _deleteOldOutputFiles (line 1232) | private _deleteOldOutputFiles(): void {

FILE: scripts/libs/CustomUtilities.ts
  class CustomUtilities (line 3) | class CustomUtilities {
    method getConciseSignature (line 9) | public static getConciseSignature(apiItem: ApiItem): string {
    method getSafeFilenameForName (line 24) | public static getSafeFilenameForName(name: string): string {
    method getSafeFilenameForNameWithCase (line 35) | public static getSafeFilenameForNameWithCase(name: string): string {

FILE: scripts/libs/MarkdownEmitter.ts
  class MarkdownEmitter (line 5) | class MarkdownEmitter extends CustomMarkdownEmitter {
    method writePlainText (line 6) | protected override writePlainText(

FILE: scripts/models/apidoc.types.ts
  type APIDoc (line 1) | interface APIDoc {
  type APIDocMember (line 10) | interface APIDocMember {
  type PurpleMember (line 17) | interface PurpleMember {
  type ExcerptToken (line 36) | interface ExcerptToken {
  type ExcerptTokenKind (line 42) | enum ExcerptTokenKind {
  type TokenRange (line 47) | interface TokenRange {
  type PurpleKind (line 52) | enum PurpleKind {
  type FluffyMember (line 60) | interface FluffyMember {
  type FluffyKind (line 76) | enum FluffyKind {
  type Parameter (line 84) | interface Parameter {
  type ReleaseTag (line 90) | enum ReleaseTag {
  type TypeParameter (line 94) | interface TypeParameter {
  type TypeParameterName (line 100) | enum TypeParameterName {
  type Metadata (line 111) | interface Metadata {
  type TsdocConfig (line 119) | interface TsdocConfig {
  type TagDefinition (line 126) | interface TagDefinition {
  type SyntaxKind (line 132) | enum SyntaxKind {

FILE: scripts/parse-docs.ts
  function build (line 6) | function build(): void {

FILE: src/@types/binary-settings.ts
  type BinarySettingsFunction (line 7) | interface BinarySettingsFunction {
  type BinarySettingsContentHeaders (line 25) | interface BinarySettingsContentHeaders {
  type BinarySettings (line 45) | type BinarySettings =

FILE: src/@types/digital-ocean/digital-ocean-http-event.ts
  type DigitalOceanHttpEvent (line 16) | interface DigitalOceanHttpEvent {

FILE: src/@types/digital-ocean/digital-ocean-http-response.ts
  type DigitalOceanHttpResponse (line 13) | interface DigitalOceanHttpResponse {

FILE: src/@types/headers.ts
  type SingleValueHeaders (line 12) | type SingleValueHeaders = Record<string, string | undefined>;
  type MultiValueHeaders (line 25) | type MultiValueHeaders = Record<string, string[] | undefined>;
  type BothValueHeaders (line 38) | type BothValueHeaders = Record<string, string | string[] | undefined>;

FILE: src/@types/helpers.ts
  type Concrete (line 7) | type Concrete<Type> = {

FILE: src/@types/huawei/huawei-api-gateway-event.ts
  type HuaweiApiGatewayEvent (line 14) | interface HuaweiApiGatewayEvent {
  type HuaweiRequestPathParameters (line 67) | type HuaweiRequestPathParameters = Record<string, string>;
  type HuaweiRequestQueryStringParameters (line 75) | type HuaweiRequestQueryStringParameters = Record<
  type HuaweiRequestContext (line 86) | interface HuaweiRequestContext {

FILE: src/@types/huawei/huawei-api-gateway-response.ts
  type HuaweiApiGatewayResponse (line 14) | interface HuaweiApiGatewayResponse {

FILE: src/@types/huawei/huawei-context.ts
  type GetRequestIDSecondsReturn (line 7) | type GetRequestIDSecondsReturn = string;
  type GetRemainingTimeInMilliSecondsReturn (line 15) | type GetRemainingTimeInMilliSecondsReturn = number;
  type GetAccessKeyReturn (line 23) | type GetAccessKeyReturn = string;
  type GetSecretKeyReturn (line 31) | type GetSecretKeyReturn = string;
  type GetUserDataKeyParameter (line 39) | type GetUserDataKeyParameter = string;
  type GetUserDataReturn (line 47) | type GetUserDataReturn = any;
  type GetFunctionNameReturn (line 55) | type GetFunctionNameReturn = string;
  type GetRunningTimeInSecondsReturn (line 63) | type GetRunningTimeInSecondsReturn = number;
  type GetVersionReturn (line 71) | type GetVersionReturn = string;
  type GetMemorySizeReturn (line 79) | type GetMemorySizeReturn = number;
  type GetCPUNumberReturn (line 87) | type GetCPUNumberReturn = number;
  type GetProjectIdReturn (line 95) | type GetProjectIdReturn = number;
  type GetPackageReturn (line 103) | type GetPackageReturn = string;
  type GetTokenReturn (line 111) | type GetTokenReturn = string;
  type GetLoggerReturn (line 121) | type GetLoggerReturn = {
  type HuaweiContext (line 132) | interface HuaweiContext {

FILE: src/adapters/apollo-server/apollo-server-mutation.adapter.ts
  type ApolloServerMutationAdapterOptions (line 23) | type ApolloServerMutationAdapterOptions = {
  class ApolloServerMutationAdapter (line 44) | class ApolloServerMutationAdapter<TEvent, TContext, TResponse>
    method constructor (line 52) | constructor(
    method canHandle (line 68) | public canHandle(event: unknown, context: TContext, log: ILogger): boo...
    method getAdapterName (line 75) | public getAdapterName(): string {
    method getRequest (line 82) | public getRequest(
    method getResponse (line 117) | public getResponse(props: GetResponseAdapterProps<TEvent>): TResponse {
    method onErrorWhileForwarding (line 135) | public onErrorWhileForwarding(props: OnErrorProps<TEvent, TResponse>):...

FILE: src/adapters/aws/alb.adapter.ts
  type AlbAdapterOptions (line 27) | interface AlbAdapterOptions {
  class AlbAdapter (line 50) | class AlbAdapter
    method constructor (line 60) | constructor(protected readonly options?: AlbAdapterOptions) {
    method getAdapterName (line 80) | public getAdapterName(): string {
    method canHandle (line 87) | public canHandle(event: unknown): event is ALBEvent {
    method getRequest (line 96) | public getRequest(event: ALBEvent): AdapterRequest {
    method getResponse (line 133) | public getResponse({
    method onErrorWhileForwarding (line 169) | public onErrorWhileForwarding({
    method getPathFromEvent (line 198) | protected getPathFromEvent(event: ALBEvent): string {

FILE: src/adapters/aws/api-gateway-v1.adapter.ts
  type ApiGatewayV1Options (line 29) | interface ApiGatewayV1Options {
  class ApiGatewayV1Adapter (line 73) | class ApiGatewayV1Adapter
    method constructor (line 84) | constructor(protected readonly options?: ApiGatewayV1Options) {
    method getAdapterName (line 104) | public getAdapterName(): string {
    method canHandle (line 111) | public canHandle(event: unknown): event is APIGatewayProxyEvent {
    method getRequest (line 131) | public getRequest(event: APIGatewayProxyEvent): AdapterRequest {
    method getResponse (line 180) | public getResponse({
    method onErrorWhileForwarding (line 217) | public onErrorWhileForwarding({
    method getPathFromEvent (line 246) | protected getPathFromEvent(event: APIGatewayProxyEvent): string {

FILE: src/adapters/aws/api-gateway-v2.adapter.ts
  type ApiGatewayV2Options (line 28) | interface ApiGatewayV2Options {
  class ApiGatewayV2Adapter (line 64) | class ApiGatewayV2Adapter
    method constructor (line 79) | constructor(protected readonly options?: ApiGatewayV2Options) {
    method getAdapterName (line 99) | public getAdapterName(): string {
    method canHandle (line 106) | public canHandle(event: unknown): event is APIGatewayProxyEventV2 {
    method getRequest (line 119) | public getRequest(event: APIGatewayProxyEventV2): AdapterRequest {
    method getResponse (line 156) | public getResponse({
    method onErrorWhileForwarding (line 197) | public onErrorWhileForwarding({
    method getPathFromEvent (line 229) | protected getPathFromEvent(event: APIGatewayProxyEventV2): string {

FILE: src/adapters/aws/base/aws-simple-adapter.ts
  type AWSSimpleAdapterOptions (line 24) | interface AWSSimpleAdapterOptions {
  type BatchItemFailureResponse (line 52) | type BatchItemFailureResponse = SQSBatchItemFailure;
  type AWSSimpleAdapterResponseType (line 60) | type AWSSimpleAdapterResponseType =
  method constructor (line 80) | constructor(protected readonly options: AWSSimpleAdapterOptions) {}
  method getAdapterName (line 89) | public getAdapterName(): string {
  method canHandle (line 96) | public canHandle(_: unknown): _ is TEvent {
  method getRequest (line 103) | public getRequest(event: TEvent): AdapterRequest {
  method getResponse (line 129) | public getResponse({
  method onErrorWhileForwarding (line 158) | public onErrorWhileForwarding({
  method hasInvalidStatusCode (line 174) | protected hasInvalidStatusCode(statusCode: number): boolean {

FILE: src/adapters/aws/dynamodb.adapter.ts
  type DynamoDBAdapterOptions (line 15) | interface DynamoDBAdapterOptions
  class DynamoDBAdapter (line 49) | class DynamoDBAdapter extends AwsSimpleAdapter<DynamoDBStreamEvent> {
    method constructor (line 57) | constructor(options?: DynamoDBAdapterOptions) {
    method getAdapterName (line 79) | public override getAdapterName(): string {
    method canHandle (line 86) | public override canHandle(event: unknown): event is DynamoDBStreamEvent {

FILE: src/adapters/aws/event-bridge.adapter.ts
  type EventBridgeOptions (line 15) | interface EventBridgeOptions {
  type EventBridgeEventAll (line 37) | type EventBridgeEventAll = EventBridgeEvent<any, any>;
  class EventBridgeAdapter (line 56) | class EventBridgeAdapter extends AwsSimpleAdapter<EventBridgeEventAll> {
    method constructor (line 64) | constructor(options?: EventBridgeOptions) {
    method getAdapterName (line 86) | public override getAdapterName(): string {
    method canHandle (line 93) | public override canHandle(event: unknown): event is EventBridgeEventAll {

FILE: src/adapters/aws/lambda-edge.adapter.ts
  type DefaultQueryString (line 38) | type DefaultQueryString =
  type DefaultForwardPath (line 47) | type DefaultForwardPath =
  type NewLambdaEdgeBody (line 56) | type NewLambdaEdgeBody =
  type OldLambdaEdgeBody (line 65) | type OldLambdaEdgeBody = Concrete<
  constant DEFAULT_LAMBDA_EDGE_DISALLOWED_HEADERS (line 75) | const DEFAULT_LAMBDA_EDGE_DISALLOWED_HEADERS: (string | RegExp)[] = [
  constant DEFAULT_VIEWER_MAX_RESPONSE_SIZE_IN_BYTES (line 105) | const DEFAULT_VIEWER_MAX_RESPONSE_SIZE_IN_BYTES = 1024 * 40;
  constant DEFAULT_ORIGIN_MAX_RESPONSE_SIZE_IN_BYTES (line 117) | const DEFAULT_ORIGIN_MAX_RESPONSE_SIZE_IN_BYTES = 1024 * 1024;
  type LambdaEdgeAdapterOptions (line 125) | interface LambdaEdgeAdapterOptions {
  class LambdaEdgeAdapter (line 212) | class LambdaEdgeAdapter
    method constructor (line 223) | constructor(protected readonly options?: LambdaEdgeAdapterOptions) {
    method getAdapterName (line 252) | public getAdapterName(): string {
    method canHandle (line 259) | public canHandle(event: unknown): event is CloudFrontRequestEvent {
    method getRequest (line 278) | public getRequest(event: CloudFrontRequestEvent): AdapterRequest {
    method getResponse (line 326) | public getResponse(
    method onErrorWhileForwarding (line 363) | public onErrorWhileForwarding({
    method getFlattenedHeadersFromCloudfrontRequest (line 379) | protected getFlattenedHeadersFromCloudfrontRequest(
    method getResponseToLambdaEdge (line 397) | protected getResponseToLambdaEdge({
    method getHeadersForCloudfrontResponse (line 434) | protected getHeadersForCloudfrontResponse(
    method shouldStripHeader (line 469) | protected shouldStripHeader(headerKey: string): boolean {
    method isEventTypeOrigin (line 489) | protected isEventTypeOrigin(content: CloudFrontEvent['config']): boole...

FILE: src/adapters/aws/request-lambda-edge.adapter.ts
  type RequestLambdaEdgeAdapterOptions (line 42) | interface RequestLambdaEdgeAdapterOptions {
  class RequestLambdaEdgeAdapter (line 113) | class RequestLambdaEdgeAdapter
    method constructor (line 124) | constructor(protected readonly options?: RequestLambdaEdgeAdapterOptio...
    method getAdapterName (line 160) | public getAdapterName(): string {
    method canHandle (line 167) | public canHandle(event: unknown): event is CloudFrontRequestEvent {
    method getRequest (line 180) | public getRequest(event: CloudFrontRequestEvent): AdapterRequest {
    method getResponse (line 225) | public getResponse({
    method onErrorWhileForwarding (line 272) | public onErrorWhileForwarding({
    method getFlattenedHeadersFromCloudfrontRequest (line 301) | protected getFlattenedHeadersFromCloudfrontRequest(
    method getHeadersForCloudfrontResponse (line 319) | protected getHeadersForCloudfrontResponse(
    method shouldStripHeader (line 356) | protected shouldStripHeader(headerKey: string): boolean {

FILE: src/adapters/aws/s3.adapter.ts
  type S3AdapterOptions (line 15) | interface S3AdapterOptions {
  class S3Adapter (line 48) | class S3Adapter extends AwsSimpleAdapter<S3Event> {
    method constructor (line 56) | constructor(options?: S3AdapterOptions) {
    method getAdapterName (line 72) | public override getAdapterName(): string {
    method canHandle (line 79) | public override canHandle(event: unknown): event is S3Event {

FILE: src/adapters/aws/sns.adapter.ts
  type SNSAdapterOptions (line 15) | interface SNSAdapterOptions {
  class SNSAdapter (line 48) | class SNSAdapter extends AwsSimpleAdapter<SNSEvent> {
    method constructor (line 56) | constructor(options?: SNSAdapterOptions) {
    method getAdapterName (line 72) | public override getAdapterName(): string {
    method canHandle (line 79) | public override canHandle(event: unknown): event is SNSEvent {

FILE: src/adapters/aws/sqs.adapter.ts
  type SQSAdapterOptions (line 15) | interface SQSAdapterOptions
  class SQSAdapter (line 49) | class SQSAdapter extends AwsSimpleAdapter<SQSEvent> {
    method constructor (line 57) | constructor(options?: SQSAdapterOptions) {
    method getAdapterName (line 73) | public override getAdapterName(): string {
    method canHandle (line 80) | public override canHandle(event: unknown): event is SQSEvent {

FILE: src/adapters/azure/http-trigger-v4.adapter.ts
  type HttpTriggerV4AdapterOptions (line 32) | interface HttpTriggerV4AdapterOptions {
  class HttpTriggerV4Adapter (line 55) | class HttpTriggerV4Adapter
    method constructor (line 65) | constructor(protected readonly options?: HttpTriggerV4AdapterOptions) {}
    method getAdapterName (line 74) | public getAdapterName(): string {
    method canHandle (line 81) | public canHandle(event: unknown, context: unknown): boolean {
    method getRequest (line 103) | public getRequest(event: HttpRequest): AdapterRequest {
    method getResponse (line 135) | public getResponse({
    method onErrorWhileForwarding (line 162) | public onErrorWhileForwarding({
    method getPathFromEvent (line 191) | protected getPathFromEvent(event: HttpRequest): string {
    method getAzureCookiesFromHeaders (line 213) | protected getAzureCookiesFromHeaders(headers: BothValueHeaders): Cooki...
    method parseCookie (line 232) | protected parseCookie(cookie: string): Cookie {

FILE: src/adapters/digital-ocean/http-function.adapter.ts
  type HttpFunctionAdapterOptions (line 30) | interface HttpFunctionAdapterOptions {
  class HttpFunctionAdapter (line 51) | class HttpFunctionAdapter
    method constructor (line 62) | constructor(protected readonly options?: HttpFunctionAdapterOptions) {}
    method getAdapterName (line 71) | public getAdapterName(): string {
    method canHandle (line 78) | public canHandle(event: unknown): event is DigitalOceanHttpEvent {
    method getRequest (line 92) | public getRequest(event: DigitalOceanHttpEvent): AdapterRequest {
    method getResponse (line 123) | public getResponse({
    method onErrorWhileForwarding (line 140) | public onErrorWhileForwarding({
    method getPathFromEvent (line 169) | protected getPathFromEvent(event: DigitalOceanHttpEvent): string {

FILE: src/adapters/dummy/dummy.adapter.ts
  class DummyAdapter (line 18) | class DummyAdapter implements AdapterContract<any, any, void> {
    method canHandle (line 22) | public canHandle(): boolean {
    method getAdapterName (line 29) | public getAdapterName(): string {
    method getRequest (line 36) | public getRequest(): AdapterRequest {
    method getResponse (line 48) | public getResponse(): IEmptyResponse {
    method onErrorWhileForwarding (line 55) | public onErrorWhileForwarding(props: OnErrorProps<any, void>): void {

FILE: src/adapters/huawei/huawei-api-gateway.adapter.ts
  type HuaweiApiGatewayOptions (line 30) | interface HuaweiApiGatewayOptions {
  class HuaweiApiGatewayAdapter (line 53) | class HuaweiApiGatewayAdapter
    method constructor (line 68) | constructor(protected readonly options?: HuaweiApiGatewayOptions) {}
    method getAdapterName (line 77) | public getAdapterName(): string {
    method canHandle (line 84) | public canHandle(event: unknown): event is HuaweiApiGatewayEvent {
    method getRequest (line 102) | public getRequest(event: HuaweiApiGatewayEvent): AdapterRequest {
    method getResponse (line 134) | public getResponse({
    method onErrorWhileForwarding (line 153) | public onErrorWhileForwarding({
    method getPathFromEvent (line 182) | protected getPathFromEvent(event: HuaweiApiGatewayEvent): string {

FILE: src/contracts/adapter.contract.ts
  type AdapterRequest (line 16) | interface AdapterRequest {
  type GetResponseAdapterProps (line 63) | interface GetResponseAdapterProps<TEvent> {
  type OnErrorProps (line 108) | interface OnErrorProps<TEvent, TResponse> {
  type AdapterContract (line 141) | interface AdapterContract<TEvent, TContext, TResponse> {

FILE: src/contracts/framework.contract.ts
  type FrameworkContract (line 13) | interface FrameworkContract<TApp> {

FILE: src/contracts/handler.contract.ts
  type ServerlessHandler (line 17) | type ServerlessHandler<TReturn> = (...args: any[]) => TReturn;
  type HandlerContract (line 25) | interface HandlerContract<

FILE: src/contracts/resolver.contract.ts
  type Resolver (line 14) | type Resolver<TResponse, TReturn> = {
  type DelegatedResolver (line 29) | type DelegatedResolver<TResponse> = {
  type ResolverProps (line 51) | type ResolverProps<TEvent, TContext, TCallback, TResponse> = {
  type ResolverContract (line 89) | interface ResolverContract<

FILE: src/core/base-handler.ts
  method getAdapterByEventAndContext (line 66) | protected getAdapterByEventAndContext(
  method getServerlessRequestResponseFromAdapterRequest (line 98) | protected getServerlessRequestResponseFromAdapterRequest(

FILE: src/core/constants.ts
  constant DEFAULT_BINARY_ENCODINGS (line 8) | const DEFAULT_BINARY_ENCODINGS: string[] = ['gzip', 'deflate', 'br'];
  constant DEFAULT_BINARY_CONTENT_TYPES (line 17) | const DEFAULT_BINARY_CONTENT_TYPES: string[] = [
  type IEmptyResponse (line 37) | type IEmptyResponse = {};

FILE: src/core/current-invoke.ts
  type CurrentInvoke (line 7) | type CurrentInvoke<TEvent, TContext> = {
  function getCurrentInvoke (line 42) | function getCurrentInvoke<TEvent = any, TContext = any>(): CurrentInvoke<
  function setCurrentInvoke (line 60) | function setCurrentInvoke<TEvent = any, TContext = any>({

FILE: src/core/event-body.ts
  function getEventBodyAsBuffer (line 20) | function getEventBodyAsBuffer(

FILE: src/core/headers.ts
  function getFlattenedHeadersMap (line 25) | function getFlattenedHeadersMap(
  function getMultiValueHeadersMap (line 57) | function getMultiValueHeadersMap(
  type FlattenedHeadersAndCookies (line 77) | type FlattenedHeadersAndCookies = {
  function getFlattenedHeadersMapAndCookies (line 97) | function getFlattenedHeadersMapAndCookies(
  function parseHeaders (line 133) | function parseHeaders(
  function keysToLowercase (line 155) | function keysToLowercase<T extends Record<string, unknown>>(

FILE: src/core/is-binary.ts
  function isContentEncodingBinary (line 26) | function isContentEncodingBinary(
  function getContentType (line 58) | function getContentType(headers: BothValueHeaders): string {
  function isContentTypeBinary (line 91) | function isContentTypeBinary(
  function isBinary (line 119) | function isBinary(

FILE: src/core/logger.ts
  type LogLevels (line 9) | type LogLevels =
  type LoggerOptions (line 23) | type LoggerOptions = {
  type LoggerFN (line 38) | type LoggerFN = (message: any, ...additional: any[]) => void;
  type ILogger (line 46) | type ILogger = Record<Exclude<LogLevels, 'none'>, LoggerFN>;
  function createDefaultLogger (line 115) | function createDefaultLogger(
  function isInternalLogger (line 145) | function isInternalLogger(logger: ILogger): boolean {

FILE: src/core/optional.ts
  function getDefaultIfUndefined (line 21) | function getDefaultIfUndefined<T>(

FILE: src/core/path.ts
  function getPathWithQueryStringParams (line 19) | function getPathWithQueryStringParams(
  function getQueryParamsStringFromRecord (line 54) | function getQueryParamsStringFromRecord(
  type StripBasePathFn (line 85) | type StripBasePathFn = (path: string) => string;
  function buildStripBasePath (line 97) | function buildStripBasePath(

FILE: src/core/stream.ts
  function isStreamEnded (line 15) | function isStreamEnded(stream: Readable | Writable): boolean {
  function waitForStreamComplete (line 31) | function waitForStreamComplete<TStream extends Readable | Writable>(

FILE: src/frameworks/apollo-server/apollo-server.framework.ts
  type DefaultServerlessApolloServerContext (line 17) | interface DefaultServerlessApolloServerContext extends BaseContext {
  type ApolloServerContextArguments (line 34) | type ApolloServerContextArguments = {
  type ApolloServerOptions (line 51) | interface ApolloServerOptions<TContext extends BaseContext> {
  class ApolloServerFramework (line 66) | class ApolloServerFramework<TContext extends BaseContext>
    method constructor (line 74) | constructor(protected readonly options?: ApolloServerOptions<TContext>...
    method sendRequest (line 81) | public sendRequest(

FILE: src/frameworks/body-parser/base-body-parser.framework.ts
  type BodyParserOptions (line 17) | type BodyParserOptions = {
  class BaseBodyParserFramework (line 50) | class BaseBodyParserFramework<TApp> implements FrameworkContract<TApp> {
    method constructor (line 56) | protected constructor(
    method sendRequest (line 85) | public sendRequest(
    method onBodyParserFinished (line 104) | protected onBodyParserFinished(
    method defaultHandleOnError (line 123) | protected defaultHandleOnError(

FILE: src/frameworks/body-parser/json-body-parser.framework.ts
  type JsonBodyParserFrameworkOptions (line 20) | type JsonBodyParserFrameworkOptions = OptionsJson & BodyParserOptions;
  class JsonBodyParserFramework (line 28) | class JsonBodyParserFramework<TApp>
    method constructor (line 37) | constructor(

FILE: src/frameworks/body-parser/raw-body-parser.framework.ts
  type RawBodyParserFrameworkOptions (line 20) | type RawBodyParserFrameworkOptions = Options & BodyParserOptions;
  class RawBodyParserFramework (line 28) | class RawBodyParserFramework<TApp>
    method constructor (line 37) | constructor(

FILE: src/frameworks/body-parser/text-body-parser.framework.ts
  type TextBodyParserFrameworkOptions (line 20) | type TextBodyParserFrameworkOptions = OptionsText & BodyParserOptions;
  class TextBodyParserFramework (line 28) | class TextBodyParserFramework<TApp>
    method constructor (line 37) | constructor(

FILE: src/frameworks/body-parser/urlencoded-body-parser.framework.ts
  type UrlencodedBodyParserFrameworkOptions (line 20) | type UrlencodedBodyParserFrameworkOptions = OptionsUrlencoded &
  class UrlencodedBodyParserFramework (line 29) | class UrlencodedBodyParserFramework<TApp>
    method constructor (line 38) | constructor(

FILE: src/frameworks/cors/cors.framework.ts
  type CorsFrameworkOptions (line 16) | type CorsFrameworkOptions = CorsOptions & {
  class CorsFramework (line 50) | class CorsFramework<TApp> implements FrameworkContract<TApp> {
    method constructor (line 56) | constructor(
    method sendRequest (line 88) | public sendRequest(
    method onCorsNext (line 107) | protected onCorsNext(
    method formatHeaderValuesAddedByCorsPackage (line 150) | protected formatHeaderValuesAddedByCorsPackage(
    method isInvalidOriginOrMethodIsNotAllowed (line 170) | protected isInvalidOriginOrMethodIsNotAllowed(

FILE: src/frameworks/deepkit/http-deepkit.framework.ts
  class HttpDeepkitFramework (line 17) | class HttpDeepkitFramework implements FrameworkContract<HttpKernel> {
    method sendRequest (line 21) | public sendRequest(

FILE: src/frameworks/express/express.framework.ts
  class ExpressFramework (line 15) | class ExpressFramework implements FrameworkContract<Express> {
    method sendRequest (line 19) | public sendRequest(

FILE: src/frameworks/fastify/fastify.framework.ts
  class FastifyFramework (line 15) | class FastifyFramework implements FrameworkContract<FastifyInstance> {
    method sendRequest (line 19) | public sendRequest(

FILE: src/frameworks/fastify/helpers/no-op-content-parser.ts
  function setNoOpForContentType (line 18) | function setNoOpForContentType(

FILE: src/frameworks/hapi/hapi.framework.ts
  class HapiFramework (line 15) | class HapiFramework implements FrameworkContract<Server> {
    method sendRequest (line 19) | public sendRequest(

FILE: src/frameworks/koa/koa.framework.ts
  class KoaFramework (line 15) | class KoaFramework implements FrameworkContract<Application> {
    method sendRequest (line 19) | public sendRequest(

FILE: src/frameworks/lazy/lazy.framework.ts
  class LazyFramework (line 39) | class LazyFramework<TApp> implements FrameworkContract<null> {
    method constructor (line 45) | constructor(
    method sendRequest (line 86) | public sendRequest(

FILE: src/frameworks/polka/polka.framework.ts
  class PolkaFramework (line 15) | class PolkaFramework implements FrameworkContract<Polka> {
    method sendRequest (line 19) | sendRequest(

FILE: src/frameworks/trpc/trpc.framework.ts
  class BufferToJSObjectTransformer (line 24) | class BufferToJSObjectTransformer implements DataTransformer {
    method deserialize (line 30) | public deserialize(value?: unknown): any {
    method serialize (line 41) | public serialize(value: any): any {
  type TrpcAdapterBaseContext (line 52) | interface TrpcAdapterBaseContext {
  type TrpcAdapterContext (line 128) | type TrpcAdapterContext<TContext> = TContext & TrpcAdapterBaseContext;
  type TrpcFrameworkOptions (line 136) | type TrpcFrameworkOptions<TContext> = Omit<
  class TrpcFramework (line 153) | class TrpcFramework<
    method constructor (line 163) | constructor(protected readonly options?: TrpcFrameworkOptions<TContext...
    method sendRequest (line 172) | public sendRequest<TRouter extends AnyRouter>(
    method getSafeUrlForTrpc (line 205) | protected getSafeUrlForTrpc(request: IncomingMessage): string {
    method mergeDefaultContextWithOptionsContext (line 220) | protected mergeDefaultContextWithOptionsContext(
    method wrapResolvedContextWithDefaultContext (line 260) | protected wrapResolvedContextWithDefaultContext(

FILE: src/handlers/aws/aws-stream.handler.ts
  type AWSResponseStream (line 30) | type AWSResponseStream = Writable;
  type AWSStreamResponseMetadata (line 36) | type AWSStreamResponseMetadata = Pick<
  type AwsStreamHandlerOptions (line 67) | type AwsStreamHandlerOptions = {
  type AWSStreamContext (line 83) | type AWSStreamContext = {
  class AwsStreamHandler (line 100) | class AwsStreamHandler<TApp> extends BaseHandler<
    method constructor (line 113) | constructor(private readonly options?: AwsStreamHandlerOptions) {
    method getHandler (line 124) | public getHandler(
    method onReceiveRequest (line 196) | protected onReceiveRequest(
    method onResolveAdapter (line 217) | protected onResolveAdapter(
    method onResolveRequestValues (line 237) | protected onResolveRequestValues(
    method onForwardResponseAdapterResponse (line 258) | protected onForwardResponseAdapterResponse(
    method forwardRequestToFramework (line 282) | protected async forwardRequestToFramework(

FILE: src/handlers/azure/azure.handler.ts
  type AzureHandlerOptions (line 27) | interface AzureHandlerOptions {
  class AzureHandler (line 44) | class AzureHandler<
    method constructor (line 56) | constructor(protected readonly options?: AzureHandlerOptions) {
    method getHandler (line 67) | public override getHandler(
    method createLoggerFromContext (line 120) | protected createLoggerFromContext(context: Context): ILogger {

FILE: src/handlers/base/raw-request.ts
  method onRequestCallback (line 25) | protected onRequestCallback(
  method getRequestFromExpressRequest (line 46) | protected getRequestFromExpressRequest(

FILE: src/handlers/default/default.handler.ts
  class DefaultHandler (line 29) | class DefaultHandler<
    method getHandler (line 42) | public getHandler(
    method onReceiveRequest (line 113) | protected onReceiveRequest(
    method onResolveAdapter (line 134) | protected onResolveAdapter(
    method onResolveRequestValues (line 150) | protected onResolveRequestValues(
    method onResolveForwardedResponseToFramework (line 171) | protected onResolveForwardedResponseToFramework(
    method onForwardResponse (line 192) | protected onForwardResponse(
    method onForwardResponseAdapterResponse (line 217) | protected onForwardResponseAdapterResponse(
    method forwardRequestToFramework (line 246) | protected async forwardRequestToFramework(
    method forwardResponse (line 280) | protected forwardResponse(

FILE: src/handlers/digital-ocean/digital-ocean.handler.ts
  class DigitalOceanHandler (line 23) | class DigitalOceanHandler<
    method getHandler (line 32) | public override getHandler(

FILE: src/handlers/firebase/http-firebase-v2.handler.ts
  type FirebaseHttpHandler (line 17) | type FirebaseHttpHandler = (
  class HttpFirebaseV2Handler (line 30) | class HttpFirebaseV2Handler<TApp>
    method constructor (line 40) | constructor(protected readonly options?: https.HttpsOptions) {
    method getHandler (line 51) | public getHandler(
    method onRequestWithOptions (line 74) | protected onRequestWithOptions(

FILE: src/handlers/firebase/http-firebase.handler.ts
  class HttpFirebaseHandler (line 17) | class HttpFirebaseHandler<TApp>
    method getHandler (line 27) | public getHandler(

FILE: src/handlers/gcp/gcp.handler.ts
  class GCPHandler (line 18) | class GCPHandler<TApp>
    method constructor (line 30) | constructor(protected readonly name: string) {
    method getHandler (line 41) | public getHandler(

FILE: src/handlers/huawei/http-huawei.handler.ts
  constant DEFAULT_HUAWEI_LISTEN_PORT (line 25) | const DEFAULT_HUAWEI_LISTEN_PORT: number = 8000;
  type HttpHuaweiHandlerOptions (line 33) | type HttpHuaweiHandlerOptions = {
  class HttpHuaweiHandler (line 55) | class HttpHuaweiHandler<TApp>
    method constructor (line 63) | constructor(protected readonly options?: HttpHuaweiHandlerOptions) {}
    method getHandler (line 72) | public getHandler(
    method createHttpServer (line 120) | protected createHttpServer(requestListener: RequestListener): Server {

FILE: src/network/request.ts
  constant HTTPS_PORT (line 7) | const HTTPS_PORT = 443;
  type ServerlessRequestProps (line 15) | interface ServerlessRequestProps {
  class ServerlessRequest (line 48) | class ServerlessRequest extends IncomingMessage {
    method constructor (line 49) | constructor({

FILE: src/network/response-stream.ts
  type ServerlessStreamResponseProps (line 21) | interface ServerlessStreamResponseProps {
  class ServerlessStreamResponse (line 49) | class ServerlessStreamResponse extends ServerResponse {
    method constructor (line 50) | constructor({

FILE: src/network/response.ts
  constant BODY (line 10) | const BODY = Symbol('Response body');
  constant HEADERS (line 11) | const HEADERS = Symbol('Response headers');
  function addData (line 13) | function addData(stream: ServerlessResponse, data: Uint8Array | string) {
  type ServerlessResponseProps (line 29) | interface ServerlessResponseProps {
  class ServerlessResponse (line 43) | class ServerlessResponse extends ServerResponse {
    method constructor (line 44) | constructor({ method }: ServerlessResponseProps) {
    method headers (line 113) | get headers(): Record<any, any> {
    method from (line 117) | static from(res: IncomingMessage) {
    method body (line 128) | static body(res: ServerlessResponse): Buffer {
    method headers (line 132) | static headers(res: ServerlessResponse) {
    method setHeader (line 138) | override setHeader(
    method writeHead (line 146) | override writeHead(
    method callNativeWriteHead (line 180) | protected callNativeWriteHead(

FILE: src/network/utils.ts
  function getString (line 7) | function getString(data: Buffer | string | unknown) {

FILE: src/resolvers/aws-context/aws-context.resolver.ts
  class AwsContextResolver (line 23) | class AwsContextResolver<TEvent, TCallback, TResponse>
    method createResolver (line 29) | public createResolver({

FILE: src/resolvers/callback/callback.resolver.ts
  type ServerlessCallback (line 18) | type ServerlessCallback<TResponse> = (
  class CallbackResolver (line 31) | class CallbackResolver<TEvent, TContext, TResponse>
    method createResolver (line 38) | public createResolver({

FILE: src/resolvers/dummy/dummy.resolver.ts
  class DummyResolver (line 13) | class DummyResolver
    method createResolver (line 19) | public createResolver(): Resolver<any, void> {

FILE: src/resolvers/promise/promise.resolver.ts
  class PromiseResolver (line 18) | class PromiseResolver<TEvent, TContext, TCallback, TResponse, TReturn>
    method createResolver (line 25) | public createResolver({

FILE: src/serverless-adapter.ts
  class ServerlessAdapter (line 40) | class ServerlessAdapter<
    method constructor (line 53) | private constructor(app: TApp) {
    method new (line 135) | public static new<
    method setHandler (line 157) | public setHandler(
    method setResolver (line 180) | public setResolver(
    method setFramework (line 196) | public setFramework(
    method setLogger (line 215) | public setLogger(logger: ILogger): Omit<this, 'setLogger'> {
    method setBinarySettings (line 226) | public setBinarySettings(
    method setRespondWithErrors (line 242) | public setRespondWithErrors(
    method addAdapter (line 255) | public addAdapter(
    method build (line 266) | public build(): ServerlessHandler<TReturn> {

FILE: test/adapters/apollo-server/apollo-mutation.adapter.spec.ts
  function createApolloServer (line 28) | function createApolloServer({

FILE: test/adapters/aws/aws-simple-adapter.spec.ts
  class TestAdapter (line 20) | class TestAdapter extends AwsSimpleAdapter<any> {}

FILE: test/adapters/aws/utils/alb-event.ts
  function createAlbEvent (line 6) | function createAlbEvent(
  function createAlbEventWithMultiValueHeaders (line 51) | function createAlbEventWithMultiValueHeaders(

FILE: test/adapters/aws/utils/api-gateway-v1.ts
  function createApiGatewayV1 (line 7) | function createApiGatewayV1(

FILE: test/adapters/aws/utils/api-gateway-v2.ts
  function createApiGatewayV2 (line 5) | function createApiGatewayV2(

FILE: test/adapters/aws/utils/dynamodb.ts
  function createDynamoDBEvent (line 6) | function createDynamoDBEvent(): DynamoDBStreamEvent {

FILE: test/adapters/aws/utils/event-bridge.ts
  function createEventBridgeEvent (line 6) | function createEventBridgeEvent(): EventBridgeEvent<any, any> {
  function createEventBridgeEventSimple (line 30) | function createEventBridgeEventSimple(): EventBridgeEvent<any, any> {

FILE: test/adapters/aws/utils/lambda-edge.ts
  function createLambdaEdgeViewerEvent (line 4) | function createLambdaEdgeViewerEvent(
  function createLambdaEdgeOriginEvent (line 126) | function createLambdaEdgeOriginEvent(

FILE: test/adapters/aws/utils/s3.ts
  function createS3Event (line 6) | function createS3Event(): S3Event {

FILE: test/adapters/aws/utils/sns.ts
  function createSNSEvent (line 6) | function createSNSEvent(): SNSEvent {

FILE: test/adapters/aws/utils/sqs.ts
  function createSQSEvent (line 6) | function createSQSEvent(): SQSEvent {

FILE: test/adapters/azure/utils/http-trigger.ts
  function createHttpTriggerEvent (line 6) | function createHttpTriggerEvent(
  function createHttpTriggerContext (line 69) | function createHttpTriggerContext(

FILE: test/adapters/digital-ocean/utils/http-function.ts
  function createHttpFunctionEvent (line 3) | function createHttpFunctionEvent(

FILE: test/adapters/huawei/utils/huawei-api-gateway.ts
  function createHuaweiApiGateway (line 7) | function createHuaweiApiGateway(

FILE: test/adapters/utils/can-handle.ts
  function createCanHandleTestsForAdapter (line 5) | function createCanHandleTestsForAdapter<

FILE: test/core/base-handler.spec.ts
  class TestHandler (line 14) | class TestHandler<TApp, TContext, TCallback, TReturn> extends BaseHandler<
    method getAdapterByEventAndContext (line 27) | public override getAdapterByEventAndContext(
    method getServerlessRequestResponseFromAdapterRequest (line 39) | public override getServerlessRequestResponseFromAdapterRequest(

FILE: test/core/is-binary.spec.ts
  type HeaderListJest (line 12) | type HeaderListJest = [headers: BothValueHeaders, expectedValue: boolean...

FILE: test/core/utils/stream.ts
  class ErrorReadableMock (line 20) | class ErrorReadableMock
    method constructor (line 28) | constructor(expectedError: Error, options: ReadableOptions = {}) {
    method _read (line 37) | public override _read() {

FILE: test/frameworks/body-parser.framework.helper.ts
  type BodyParserTest (line 33) | type BodyParserTest = {
  function createFramework (line 199) | function createFramework<TApp>(
  function createRequest (line 211) | function createRequest(body: Buffer, contentType: string): ServerlessReq...
  function createResponse (line 224) | function createResponse(method: string): ServerlessResponse {
  function handleRestExpects (line 230) | async function handleRestExpects<TApp>(
  function createBodyParserTests (line 264) | function createBodyParserTests() {

FILE: test/frameworks/cors.framework.spec.ts
  type CorsTest (line 24) | type CorsTest = {
  function createFramework (line 164) | function createFramework<TApp>(
  function createRequest (line 176) | function createRequest(method: string, origin: string): ServerlessRequest {
  function createResponse (line 186) | function createResponse(method: string): ServerlessResponse {
  function handleRestExpects (line 192) | async function handleRestExpects<TApp>(

FILE: test/frameworks/express-v5.framework.spec.ts
  function createHandler (line 6) | function createHandler(

FILE: test/frameworks/express.framework.spec.ts
  function createHandler (line 6) | function createHandler(

FILE: test/frameworks/fastify-v5.framework.spec.ts
  function createHandler (line 6) | function createHandler(

FILE: test/frameworks/fastify.framework.spec.ts
  function createHandler (line 6) | function createHandler(

FILE: test/frameworks/hapi.framework.spec.ts
  function createHandler (line 6) | function createHandler(

FILE: test/frameworks/koa.framework.spec.ts
  function createHandler (line 7) | function createHandler(): TestRouteBuilderHandler<Application> {

FILE: test/frameworks/polka.framework.spec.ts
  function createHandler (line 6) | function createHandler(

FILE: test/frameworks/trpc.framework.spec.ts
  type TrpcContext (line 18) | type TrpcContext = TrpcAdapterContext<unknown>;
  function createHandler (line 20) | function createHandler(
  function createRouter (line 62) | function createRouter() {
  type Context (line 155) | type Context = { currentDate: Date };
  type CustomContext (line 156) | type CustomContext = TrpcAdapterContext<Context>;

FILE: test/frameworks/utils.ts
  type TestRouteBuilderHandler (line 11) | type TestRouteBuilderHandler<TApp, TOutput = void> = (
  type TestRouteBuilderMethods (line 20) | type TestRouteBuilderMethods = 'get' | 'post' | 'delete' | 'put';
  type TestRouteBuilder (line 22) | type TestRouteBuilder<TApp> = Record<
  type TestOptions (line 27) | type TestOptions = [
  function createTestSuiteFor (line 52) | function createTestSuiteFor<TApp, TFrameworkApp = TApp>(

FILE: test/handlers/gcp.handler.spec.ts
  class TestGCPHandler (line 7) | class TestGCPHandler<TApp> extends GCPHandler<TApp> {
    method onRequestCallback (line 8) | public override onRequestCallback(

FILE: test/handlers/huawei.handler.spec.ts
  function waitUntilServerStarted (line 70) | async function waitUntilServerStarted(): Promise<void> {

FILE: test/mocks/framework.mock.ts
  class FrameworkMock (line 14) | class FrameworkMock implements FrameworkContract<null> {
    method constructor (line 20) | constructor(
    method sendRequest (line 30) | public sendRequest(

FILE: test/network/response.spec.ts
  class MockServerlessResponse (line 206) | class MockServerlessResponse extends ServerlessResponse {
    method callNativeWriteHead (line 207) | public override callNativeWriteHead(

FILE: test/resolvers/aws-context.resolver.spec.ts
  function onContextResolve (line 17) | function onContextResolve(task: () => void): void {

FILE: test/resolvers/callback.resolver.spec.ts
  function onCallbackResolve (line 18) | function onCallbackResolve(task: () => void): void {

FILE: www/src/components/BrowserWindow/index.tsx
  type Props (line 13) | interface Props {
  function BrowserWindow (line 19) | function BrowserWindow({

FILE: www/src/components/HomepageFeatures/index.tsx
  type FeatureItem (line 5) | type FeatureItem = {
  function Feature (line 36) | function Feature({ title, description }: FeatureItem) {
  function HomepageFeatures (line 47) | function HomepageFeatures(): JSX.Element {

FILE: www/src/components/HowToStart/index.tsx
  function HowToStart (line 6) | function HowToStart(): JSX.Element {

FILE: www/src/pages/index.tsx
  function HomepageHeader (line 10) | function HomepageHeader() {
  function Home (line 30) | function Home(): JSX.Element {
Condensed preview — 317 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (969K chars).
[
  {
    "path": ".eslintignore",
    "chars": 35,
    "preview": "src/types/global.d.ts\r\nbenchmark/\r\n"
  },
  {
    "path": ".eslintrc",
    "chars": 5028,
    "preview": "{\n  \"root\": true,\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\n    \"@typescript-eslint\",\n    \"eslint-plugin-t"
  },
  {
    "path": ".gitattributes",
    "chars": 98,
    "preview": "# Set the repository to show as TypeScript rather than JS in GitHub\n*.js linguist-detectable=false"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 463,
    "preview": "---\nname: \"🐛 Bug Report\"\nabout: Report a reproducible bug or regression.\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n## Cu"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 101,
    "preview": "# This file is automatically added by @npmcli/template-oss. Do not edit.\n\nblank_issues_enabled: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 1097,
    "preview": "---\nname: 🌈 Feature request\nabout: Suggest an amazing new idea for this project\ntitle: ''\nlabels: enhancement\nassignees:"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 1381,
    "preview": "<!--\n  😀 Wonderful!  Thank you for opening a pull request.\n\n  Please fill in the information below to expedite the revie"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 371,
    "preview": "# This file is automatically added by @npmcli/template-oss. Do not edit.\n\nversion: 2\n\nupdates:\n  - package-ecosystem: np"
  },
  {
    "path": ".github/settings.yml",
    "chars": 570,
    "preview": "# This file is automatically added by @npmcli/template-oss. Do not edit.\n\nrepository:\n  allow_merge_commit: false\n  allo"
  },
  {
    "path": ".github/workflows/codeql-analysis.yml",
    "chars": 1386,
    "preview": "name: CodeQL\n\non:\n  push:\n    paths:\n      - 'src/**'\n      - 'package-lock.json'\n      - 'package.json'\n      - 'tsconf"
  },
  {
    "path": ".github/workflows/docs.yml",
    "chars": 1334,
    "preview": "name: Deploy to GitHub Pages\r\n\r\non:\r\n  push:\r\n    branches:\r\n      - main\r\n    paths:\r\n      - '.github/workflows/docs.y"
  },
  {
    "path": ".github/workflows/pr.yml",
    "chars": 1976,
    "preview": "name: Pull Request\n\non:\n  workflow_dispatch:\n  pull_request:\n    paths:\n      - 'src/**'\n      - 'package-lock.json'\n   "
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 1292,
    "preview": "name: Release\n\non:\n  push:\n    branches:\n      - main\n\npermissions:\n  contents: write\n  pull-requests: write\n  id-token:"
  },
  {
    "path": ".gitignore",
    "chars": 1944,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\nvar\n\n# Diagnostic reports (https://nod"
  },
  {
    "path": ".husky/.gitignore",
    "chars": 2,
    "preview": "_\n"
  },
  {
    "path": ".husky/pre-commit",
    "chars": 82,
    "preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpm run build\nnpm run test\nnpm run lint\n"
  },
  {
    "path": ".husky/prepare-commit-msg",
    "chars": 96,
    "preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nexec </dev/tty && node_modules/.bin/cz --hook || true\n"
  },
  {
    "path": ".npmrc",
    "chars": 94,
    "preview": "; This file is automatically added by @npmcli/template-oss. Do not edit.\n\nignore-scripts=true\n"
  },
  {
    "path": ".prettierrc",
    "chars": 98,
    "preview": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\",\n  \"arrowParens\": \"avoid\",\n  \"printWidth\": 80\n}\n"
  },
  {
    "path": ".release-please-manifest.json",
    "chars": 19,
    "preview": "{\n  \".\": \"4.4.0\"\n}\n"
  },
  {
    "path": ".tmuxinator.yml",
    "chars": 2138,
    "preview": "# ./.tmuxinator.yml\n\nname: serverless-adapter\nroot: ./\n\n# Optional tmux socket\n# socket_name: foo\n\n# Note that the pre a"
  },
  {
    "path": ".tool-versions",
    "chars": 15,
    "preview": "nodejs 18.18.1\n"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 1648,
    "preview": "{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  //"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 115,
    "preview": "{\n  \"editor.formatOnSave\": true,\n  \"[typescript]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  }\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 16051,
    "preview": "# Changelog\n\n## [4.4.0](https://github.com/H4ad/serverless-adapter/compare/v4.3.2...v4.4.0) (2024-12-01)\n\n\n### Features\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 4035,
    "preview": "# Contributing\n\nWhen contributing to this repository, please first discuss the change you wish to make via issue,\nemail,"
  },
  {
    "path": "LICENSE",
    "chars": 1074,
    "preview": "MIT License\n\nCopyright (c) 2022 Vinícius Lourenço\n\nPermission is hereby granted, free of charge, to any person obtaining"
  },
  {
    "path": "README.md",
    "chars": 5740,
    "preview": "<h1 align=\"center\">\n  🚀 Serverless Adapter\n</h1>\n\n<p align=\"center\">\n  <a href=\"#install\">Install</a>&nbsp;&nbsp;&nbsp;|"
  },
  {
    "path": "api-extractor.json",
    "chars": 14231,
    "preview": "/**\n * Config file for API Extractor.  For more info, please visit: https://api-extractor.com\n */\n{\n  \"$schema\": \"https:"
  },
  {
    "path": "benchmark/.gitignore",
    "chars": 34,
    "preview": "node_modules\n*.cpuprofile\n.clinic\n"
  },
  {
    "path": "benchmark/.swcrc",
    "chars": 250,
    "preview": "{\n  \"env\": {\n    \"targets\": \"node >= 18\"\n  },\n  \"module\": {\n    \"type\": \"commonjs\",\n    \"strict\": true,\n  },\n  \"jsc\": {\n"
  },
  {
    "path": "benchmark/README.md",
    "chars": 635,
    "preview": "# Benchmark\n\nIn this folder, we have benchmarks to compare the speed of this library with others.\n\n## How to Run\n\n```bas"
  },
  {
    "path": "benchmark/package.json",
    "chars": 967,
    "preview": "{\n  \"name\": \"benchmark\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"build\": \"s"
  },
  {
    "path": "benchmark/src/events.ts",
    "chars": 4550,
    "preview": "import { getMultiValueHeadersMap } from '@h4ad/serverless-adapter';\nimport type {\n  APIGatewayProxyEvent,\n  APIGatewayPr"
  },
  {
    "path": "benchmark/src/framework.mock.ts",
    "chars": 994,
    "preview": "import { FrameworkContract } from '@h4ad/serverless-adapter';\nimport type { IncomingMessage, ServerResponse } from 'http"
  },
  {
    "path": "benchmark/src/samples/clone-headers.ts",
    "chars": 958,
    "preview": "import benchmark from 'benchmark';\nimport { createApiGatewayV1 } from '../events';\n\nconst eventV1ApiGateway = createApiG"
  },
  {
    "path": "benchmark/src/samples/compare-libraries.ts",
    "chars": 1748,
    "preview": "import { ServerlessAdapter } from '@h4ad/serverless-adapter/lib';\nimport { ApiGatewayV1Adapter } from '@h4ad/serverless-"
  },
  {
    "path": "benchmark/src/samples/format-headers.ts",
    "chars": 2420,
    "preview": "import benchmark from 'benchmark';\nimport { BothValueHeaders } from '../../../src';\nimport { createApiGatewayV1 } from '"
  },
  {
    "path": "benchmark/tsconfig.json",
    "chars": 552,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"pre"
  },
  {
    "path": "package.json",
    "chars": 23954,
    "preview": "{\n  \"name\": \"@h4ad/serverless-adapter\",\n  \"version\": \"4.4.0\",\n  \"description\": \"Run REST APIs and other web applications"
  },
  {
    "path": "release-please-config.json",
    "chars": 1851,
    "preview": "{\n  \"packages\": {\n    \".\": {\n      \"release-type\": \"node\",\n      \"bump-minor-pre-major\": false,\n      \"bump-patch-for-mi"
  },
  {
    "path": "scripts/generate-api-pages.ts",
    "chars": 3527,
    "preview": "import { writeFileSync } from 'fs';\nimport { resolve } from 'path';\nimport {\n  ApiDocumentedItem,\n  ApiItem,\n  ApiModel,"
  },
  {
    "path": "scripts/generate-markdown.ts",
    "chars": 908,
    "preview": "import { readFileSync, writeFileSync } from 'fs';\nimport { join, resolve } from 'path';\nimport { ApiModel } from '@micro"
  },
  {
    "path": "scripts/libs/CustomMarkdownDocumenter.ts",
    "chars": 37849,
    "preview": "import * as path from 'path';\nimport {\n  type IMarkdownDocumenterFeatureOnBeforeWritePageArgs,\n  MarkdownDocumenterAcces"
  },
  {
    "path": "scripts/libs/CustomUtilities.ts",
    "chars": 1312,
    "preview": "import { ApiItem, ApiParameterListMixin } from '@microsoft/api-extractor-model';\n\nexport class CustomUtilities {\n  priva"
  },
  {
    "path": "scripts/libs/MarkdownEmitter.ts",
    "chars": 1435,
    "preview": "import { CustomMarkdownEmitter } from '@microsoft/api-documenter/lib/markdown/CustomMarkdownEmitter';\nimport type { IMar"
  },
  {
    "path": "scripts/models/apidoc.types.ts",
    "chars": 2857,
    "preview": "export interface APIDoc {\n  metadata: Metadata;\n  kind: string;\n  canonicalReference: string;\n  docComment: string;\n  na"
  },
  {
    "path": "scripts/parse-docs.ts",
    "chars": 635,
    "preview": "import { resolve } from 'path';\nimport { Extractor, ExtractorConfig } from '@microsoft/api-extractor';\n\nconst apiExtract"
  },
  {
    "path": "src/@types/binary-settings.ts",
    "chars": 1408,
    "preview": "/**\n * The interface representing the binary settings implementation by function\n *\n * @breadcrumb Types / BinarySetting"
  },
  {
    "path": "src/@types/digital-ocean/digital-ocean-http-event.ts",
    "chars": 1024,
    "preview": "//#region Imports\n\nimport type { SingleValueHeaders } from '../headers';\n\n//#endregion\n\n/**\n * The interface to represen"
  },
  {
    "path": "src/@types/digital-ocean/digital-ocean-http-response.ts",
    "chars": 510,
    "preview": "//#region Imports\n\nimport type { SingleValueHeaders } from '../headers';\n\n//#endregion\n\n/**\n * The interface to represen"
  },
  {
    "path": "src/@types/digital-ocean/index.ts",
    "chars": 91,
    "preview": "export * from './digital-ocean-http-event';\nexport * from './digital-ocean-http-response';\n"
  },
  {
    "path": "src/@types/headers.ts",
    "chars": 931,
    "preview": "/**\n * The record that represents the headers that doesn't have multiple values in the value\n *\n * @example\n * ```typesc"
  },
  {
    "path": "src/@types/helpers.ts",
    "chars": 181,
    "preview": "/**\n * Removes 'optional' attributes from a type's properties\n *\n * @breadcrumb Types\n * @public\n */\nexport type Concret"
  },
  {
    "path": "src/@types/huawei/huawei-api-gateway-event.ts",
    "chars": 2333,
    "preview": "//#region Imports\n\nimport type { BothValueHeaders } from '../index';\n\n//#endregion\n\n/**\n * The interface that represents"
  },
  {
    "path": "src/@types/huawei/huawei-api-gateway-response.ts",
    "chars": 843,
    "preview": "//#region Imports\n\nimport type { MultiValueHeaders } from '../headers';\n\n//#endregion\n\n/**\n * The interface that represe"
  },
  {
    "path": "src/@types/huawei/huawei-context.ts",
    "chars": 5294,
    "preview": "/**\n * The return value of {@link HuaweiContext} getRequestID\n *\n * @public\n * @breadcrumb Types / Huawei / HuaweiContex"
  },
  {
    "path": "src/@types/huawei/index.ts",
    "chars": 125,
    "preview": "export * from './huawei-context';\nexport * from './huawei-api-gateway-event';\nexport * from './huawei-api-gateway-respon"
  },
  {
    "path": "src/@types/index.ts",
    "chars": 89,
    "preview": "export * from './binary-settings';\nexport * from './headers';\nexport * from './helpers';\n"
  },
  {
    "path": "src/adapters/apollo-server/apollo-server-mutation.adapter.ts",
    "chars": 3408,
    "preview": "//#region Imports\n\nimport type {\n  AdapterContract,\n  AdapterRequest,\n  GetResponseAdapterProps,\n  OnErrorProps,\n} from "
  },
  {
    "path": "src/adapters/apollo-server/index.ts",
    "chars": 50,
    "preview": "export * from './apollo-server-mutation.adapter';\n"
  },
  {
    "path": "src/adapters/aws/alb.adapter.ts",
    "chars": 4525,
    "preview": "//#region Imports\n\nimport type { ALBEvent, ALBResult, Context } from 'aws-lambda';\nimport type {\n  AdapterContract,\n  Ad"
  },
  {
    "path": "src/adapters/aws/api-gateway-v1.adapter.ts",
    "chars": 7615,
    "preview": "//#region Imports\n\nimport type { APIGatewayProxyResult, Context } from 'aws-lambda';\nimport type { APIGatewayProxyEvent "
  },
  {
    "path": "src/adapters/aws/api-gateway-v2.adapter.ts",
    "chars": 6209,
    "preview": "//#region Imports\n\nimport type { APIGatewayProxyEventV2, Context } from 'aws-lambda';\nimport type { APIGatewayProxyStruc"
  },
  {
    "path": "src/adapters/aws/base/aws-simple-adapter.ts",
    "chars": 3880,
    "preview": "//#region Imports\n\nimport type { Context, SQSBatchItemFailure } from 'aws-lambda';\nimport type {\n  AdapterContract,\n  Ad"
  },
  {
    "path": "src/adapters/aws/base/index.ts",
    "chars": 38,
    "preview": "export * from './aws-simple-adapter';\n"
  },
  {
    "path": "src/adapters/aws/dynamodb.adapter.ts",
    "chars": 2461,
    "preview": "//#region Imports\n\nimport type { DynamoDBStreamEvent } from 'aws-lambda';\nimport { getDefaultIfUndefined } from '../../c"
  },
  {
    "path": "src/adapters/aws/event-bridge.adapter.ts",
    "chars": 3179,
    "preview": "//#region Imports\n\nimport type { EventBridgeEvent } from 'aws-lambda';\nimport { getDefaultIfUndefined } from '../../core"
  },
  {
    "path": "src/adapters/aws/index.ts",
    "chars": 393,
    "preview": "export * from './alb.adapter';\nexport * from './api-gateway-v1.adapter';\nexport * from './api-gateway-v2.adapter';\nexpor"
  },
  {
    "path": "src/adapters/aws/lambda-edge.adapter.ts",
    "chars": 15173,
    "preview": "//#region Imports\n\nimport type { CloudFrontRequest, Context } from 'aws-lambda';\nimport type {\n  CloudFrontEvent,\n  Clou"
  },
  {
    "path": "src/adapters/aws/request-lambda-edge.adapter.ts",
    "chars": 10616,
    "preview": "//#region Imports\n\nimport type { CloudFrontRequest, Context } from 'aws-lambda';\nimport type {\n  CloudFrontHeaders,\n  Cl"
  },
  {
    "path": "src/adapters/aws/s3.adapter.ts",
    "chars": 2121,
    "preview": "//#region Imports\n\nimport type { S3Event } from 'aws-lambda';\nimport { getDefaultIfUndefined } from '../../core';\nimport"
  },
  {
    "path": "src/adapters/aws/sns.adapter.ts",
    "chars": 2146,
    "preview": "//#region Imports\n\nimport type { SNSEvent } from 'aws-lambda';\nimport { getDefaultIfUndefined } from '../../core';\nimpor"
  },
  {
    "path": "src/adapters/aws/sqs.adapter.ts",
    "chars": 2240,
    "preview": "//#region Imports\n\nimport type { SQSEvent } from 'aws-lambda';\nimport { getDefaultIfUndefined } from '../../core';\nimpor"
  },
  {
    "path": "src/adapters/azure/http-trigger-v4.adapter.ts",
    "chars": 7043,
    "preview": "//#region Imports\n\nimport { URL } from 'node:url';\nimport type {\n  Context,\n  Cookie,\n  HttpRequest,\n  HttpResponseSimpl"
  },
  {
    "path": "src/adapters/azure/index.ts",
    "chars": 43,
    "preview": "export * from './http-trigger-v4.adapter';\n"
  },
  {
    "path": "src/adapters/digital-ocean/http-function.adapter.ts",
    "chars": 4028,
    "preview": "//#region Imports\n\n//#region Imports\n\nimport type {\n  DigitalOceanHttpEvent,\n  DigitalOceanHttpResponse,\n} from '../../@"
  },
  {
    "path": "src/adapters/digital-ocean/index.ts",
    "chars": 41,
    "preview": "export * from './http-function.adapter';\n"
  },
  {
    "path": "src/adapters/dummy/dummy.adapter.ts",
    "chars": 1060,
    "preview": "//#region Imports\n\nimport type {\n  AdapterContract,\n  AdapterRequest,\n  OnErrorProps,\n} from '../../contracts';\nimport {"
  },
  {
    "path": "src/adapters/dummy/index.ts",
    "chars": 33,
    "preview": "export * from './dummy.adapter';\n"
  },
  {
    "path": "src/adapters/huawei/huawei-api-gateway.adapter.ts",
    "chars": 4403,
    "preview": "//#region Imports\n\nimport type {\n  HuaweiApiGatewayEvent,\n  HuaweiApiGatewayResponse,\n  HuaweiContext,\n} from '../../@ty"
  },
  {
    "path": "src/adapters/huawei/index.ts",
    "chars": 46,
    "preview": "export * from './huawei-api-gateway.adapter';\n"
  },
  {
    "path": "src/contracts/adapter.contract.ts",
    "chars": 4343,
    "preview": "//#region Imports\n\nimport type { BothValueHeaders, SingleValueHeaders } from '../@types';\nimport type { ILogger } from '"
  },
  {
    "path": "src/contracts/framework.contract.ts",
    "chars": 712,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\n\n//#endregion\n\n/**\n * The interface that"
  },
  {
    "path": "src/contracts/handler.contract.ts",
    "chars": 1203,
    "preview": "//#region Imports\n\nimport type { BinarySettings } from '../@types';\nimport type { ILogger } from '../core';\nimport type "
  },
  {
    "path": "src/contracts/index.ts",
    "chars": 147,
    "preview": "export * from './adapter.contract';\nexport * from './framework.contract';\nexport * from './handler.contract';\nexport * f"
  },
  {
    "path": "src/contracts/resolver.contract.ts",
    "chars": 2329,
    "preview": "//#region Imports\n\nimport type { ILogger } from '../core';\nimport type { AdapterContract } from './adapter.contract';\n\n/"
  },
  {
    "path": "src/core/base-handler.ts",
    "chars": 2915,
    "preview": "//#region Imports\n\nimport type { BinarySettings } from '../@types';\nimport type {\n  AdapterContract,\n  AdapterRequest,\n "
  },
  {
    "path": "src/core/constants.ts",
    "chars": 1299,
    "preview": "/**\n * Default encodings that are treated as binary, they are compared with the `Content-Encoding` header.\n *\n * @breadc"
  },
  {
    "path": "src/core/current-invoke.ts",
    "chars": 1903,
    "preview": "/**\n * The type that represents the object that handles the references to the event created by the serverless trigger or"
  },
  {
    "path": "src/core/event-body.ts",
    "chars": 801,
    "preview": "/**\n * Get the event body as buffer from body string with content length\n *\n * @example\n * ```typescript\n * const body ="
  },
  {
    "path": "src/core/headers.ts",
    "chars": 4417,
    "preview": "//#region Imports\n\nimport type { BothValueHeaders } from '../@types';\n\n//#endregion\n\n/**\n * Transform a header map and m"
  },
  {
    "path": "src/core/index.ts",
    "chars": 310,
    "preview": "export * from './base-handler';\nexport * from './constants';\nexport * from './current-invoke';\nexport * from './event-bo"
  },
  {
    "path": "src/core/is-binary.ts",
    "chars": 3640,
    "preview": "// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\n\n//#region Imports\n\nimport type { BinarySettings, BothVal"
  },
  {
    "path": "src/core/logger.ts",
    "chars": 3083,
    "preview": "import { NO_OP } from './no-op';\n\n/**\n * The type representing the possible log levels to choose from.\n *\n * @breadcrumb"
  },
  {
    "path": "src/core/no-op.ts",
    "chars": 211,
    "preview": "/**\n * No operation function is used when we need to pass a function, but we don't want to specify any behavior.\n *\n * @"
  },
  {
    "path": "src/core/optional.ts",
    "chars": 626,
    "preview": "/**\n * Return the defaultValue whether the value is undefined, otherwise, return the value.\n *\n * @example\n * ```typescr"
  },
  {
    "path": "src/core/path.ts",
    "chars": 2701,
    "preview": "/**\n * Transform the path and a map of query params to a string with formatted query params\n *\n * @example\n * ```typescr"
  },
  {
    "path": "src/core/stream.ts",
    "chars": 1653,
    "preview": "//#region Imports\n\nimport { Readable, Writable } from 'node:stream';\n\n//#endregion\n\n/**\n * Check if stream already ended"
  },
  {
    "path": "src/frameworks/apollo-server/apollo-server.framework.ts",
    "chars": 4148,
    "preview": "//#region\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport { type ApolloServer, type BaseContext, He"
  },
  {
    "path": "src/frameworks/apollo-server/index.ts",
    "chars": 43,
    "preview": "export * from './apollo-server.framework';\n"
  },
  {
    "path": "src/frameworks/body-parser/base-body-parser.framework.ts",
    "chars": 3262,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { NextHandleFunction } from "
  },
  {
    "path": "src/frameworks/body-parser/index.ts",
    "chars": 235,
    "preview": "export * from './base-body-parser.framework';\nexport * from './json-body-parser.framework';\nexport * from './raw-body-pa"
  },
  {
    "path": "src/frameworks/body-parser/json-body-parser.framework.ts",
    "chars": 1068,
    "preview": "//#region Imports\n\nimport { type OptionsJson, json } from 'body-parser';\nimport { type FrameworkContract } from '../../c"
  },
  {
    "path": "src/frameworks/body-parser/raw-body-parser.framework.ts",
    "chars": 1068,
    "preview": "//#region Imports\n\nimport { type Options, raw } from 'body-parser';\nimport type { FrameworkContract } from '../../contra"
  },
  {
    "path": "src/frameworks/body-parser/text-body-parser.framework.ts",
    "chars": 1056,
    "preview": "//#region Imports\n\nimport { type OptionsText, text } from 'body-parser';\nimport type { FrameworkContract } from '../../c"
  },
  {
    "path": "src/frameworks/body-parser/urlencoded-body-parser.framework.ts",
    "chars": 1164,
    "preview": "//#region Imports\n\nimport { type OptionsUrlencoded, urlencoded } from 'body-parser';\nimport { type FrameworkContract } f"
  },
  {
    "path": "src/frameworks/cors/cors.framework.ts",
    "chars": 5810,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport cors, { type CorsOptions } from '"
  },
  {
    "path": "src/frameworks/cors/index.ts",
    "chars": 34,
    "preview": "export * from './cors.framework';\n"
  },
  {
    "path": "src/frameworks/deepkit/http-deepkit.framework.ts",
    "chars": 1156,
    "preview": "//#region\n\nimport type { ServerResponse } from 'http';\nimport { HttpKernel, HttpResponse, RequestBuilder } from '@deepki"
  },
  {
    "path": "src/frameworks/deepkit/index.ts",
    "chars": 42,
    "preview": "export * from './http-deepkit.framework';\n"
  },
  {
    "path": "src/frameworks/express/express.framework.ts",
    "chars": 558,
    "preview": "//#region\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { Express } from 'express';\nimport t"
  },
  {
    "path": "src/frameworks/express/index.ts",
    "chars": 37,
    "preview": "export * from './express.framework';\n"
  },
  {
    "path": "src/frameworks/fastify/fastify.framework.ts",
    "chars": 737,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { FastifyInstance } from 'fa"
  },
  {
    "path": "src/frameworks/fastify/helpers/no-op-content-parser.ts",
    "chars": 591,
    "preview": "//#region Imports\n\nimport type { FastifyInstance } from 'fastify';\n\n//#endregion\n\n/**\n * Just return the current body as"
  },
  {
    "path": "src/frameworks/fastify/index.ts",
    "chars": 37,
    "preview": "export * from './fastify.framework';\n"
  },
  {
    "path": "src/frameworks/hapi/hapi.framework.ts",
    "chars": 623,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { Server } from '@hapi/hapi'"
  },
  {
    "path": "src/frameworks/hapi/index.ts",
    "chars": 34,
    "preview": "export * from './hapi.framework';\n"
  },
  {
    "path": "src/frameworks/koa/index.ts",
    "chars": 33,
    "preview": "export * from './koa.framework';\n"
  },
  {
    "path": "src/frameworks/koa/koa.framework.ts",
    "chars": 569,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type Application from 'koa';\nimpo"
  },
  {
    "path": "src/frameworks/lazy/index.ts",
    "chars": 34,
    "preview": "export * from './lazy.framework';\n"
  },
  {
    "path": "src/frameworks/lazy/lazy.framework.ts",
    "chars": 2951,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { FrameworkContract } from '"
  },
  {
    "path": "src/frameworks/polka/index.ts",
    "chars": 35,
    "preview": "export * from './polka.framework';\n"
  },
  {
    "path": "src/frameworks/polka/polka.framework.ts",
    "chars": 594,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport polka, { type Polka } from 'polka"
  },
  {
    "path": "src/frameworks/trpc/index.ts",
    "chars": 34,
    "preview": "export * from './trpc.framework';\n"
  },
  {
    "path": "src/frameworks/trpc/trpc.framework.ts",
    "chars": 8277,
    "preview": "//#region\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { AnyRouter, DataTransformer } from "
  },
  {
    "path": "src/handlers/aws/aws-stream.handler.ts",
    "chars": 9276,
    "preview": "//#region Imports\n\nimport { Writable } from 'node:stream';\nimport { inspect } from 'node:util';\nimport type { APIGateway"
  },
  {
    "path": "src/handlers/aws/index.ts",
    "chars": 38,
    "preview": "export * from './aws-stream.handler';\n"
  },
  {
    "path": "src/handlers/azure/azure.handler.ts",
    "chars": 2963,
    "preview": "/* eslint-disable @typescript-eslint/unbound-method */\n//#region Imports\n\nimport type { Context } from '@azure/functions"
  },
  {
    "path": "src/handlers/azure/index.ts",
    "chars": 33,
    "preview": "export * from './azure.handler';\n"
  },
  {
    "path": "src/handlers/base/index.ts",
    "chars": 31,
    "preview": "export * from './raw-request';\n"
  },
  {
    "path": "src/handlers/base/raw-request.ts",
    "chars": 2635,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { FrameworkContract } from '"
  },
  {
    "path": "src/handlers/default/default.handler.ts",
    "chars": 8228,
    "preview": "//#region Imports\n\nimport util from 'node:util';\nimport type { BinarySettings, SingleValueHeaders } from '../../@types';"
  },
  {
    "path": "src/handlers/default/index.ts",
    "chars": 35,
    "preview": "export * from './default.handler';\n"
  },
  {
    "path": "src/handlers/digital-ocean/digital-ocean.handler.ts",
    "chars": 1372,
    "preview": "/* eslint-disable @typescript-eslint/unbound-method */\n//#region Imports\n\nimport type { BinarySettings } from '../../@ty"
  },
  {
    "path": "src/handlers/digital-ocean/index.ts",
    "chars": 41,
    "preview": "export * from './digital-ocean.handler';\n"
  },
  {
    "path": "src/handlers/firebase/http-firebase-v2.handler.ts",
    "chars": 1959,
    "preview": "//#region Imports\n\nimport { IncomingMessage, ServerResponse } from 'node:http';\n// eslint-disable-next-line import/no-un"
  },
  {
    "path": "src/handlers/firebase/http-firebase.handler.ts",
    "chars": 911,
    "preview": "//#region Imports\n\n// eslint-disable-next-line import/no-unresolved\nimport { type HttpsFunction, https } from 'firebase-"
  },
  {
    "path": "src/handlers/firebase/index.ts",
    "chars": 85,
    "preview": "export * from './http-firebase.handler';\nexport * from './http-firebase-v2.handler';\n"
  },
  {
    "path": "src/handlers/gcp/gcp.handler.ts",
    "chars": 1238,
    "preview": "//#region Imports\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport { http } from '@google-cloud/func"
  },
  {
    "path": "src/handlers/gcp/index.ts",
    "chars": 31,
    "preview": "export * from './gcp.handler';\n"
  },
  {
    "path": "src/handlers/huawei/http-huawei.handler.ts",
    "chars": 3399,
    "preview": "//#region Imports\n\nimport type { RequestListener } from 'http';\nimport { type Server, createServer } from 'node:http';\ni"
  },
  {
    "path": "src/handlers/huawei/index.ts",
    "chars": 39,
    "preview": "export * from './http-huawei.handler';\n"
  },
  {
    "path": "src/index.doc.ts",
    "chars": 1238,
    "preview": "export * from './@types';\nexport * from './@types/huawei';\nexport * from './adapters/apollo-server';\nexport * from './ad"
  },
  {
    "path": "src/index.ts",
    "chars": 144,
    "preview": "export * from './@types';\nexport * from './contracts';\nexport * from './core';\nexport * from './network';\nexport * from "
  },
  {
    "path": "src/network/index.ts",
    "chars": 115,
    "preview": "export * from './request';\nexport * from './response';\nexport * from './response-stream';\nexport * from './utils';\n"
  },
  {
    "path": "src/network/request.ts",
    "chars": 1935,
    "preview": "// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\nimport { IncomingMessage } from 'node:http';\nimport type "
  },
  {
    "path": "src/network/response-stream.ts",
    "chars": 5062,
    "preview": "import { ServerResponse } from 'node:http';\nimport type { Socket } from 'node:net';\nimport type { Writable } from 'node:"
  },
  {
    "path": "src/network/response.ts",
    "chars": 5395,
    "preview": "// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\nimport { IncomingMessage, ServerResponse } from 'node:htt"
  },
  {
    "path": "src/network/utils.ts",
    "chars": 477,
    "preview": "/**\n * Get the data from a buffer, string, or Uint8Array\n *\n * @breadcrumb Network\n * @param data - The data that was wr"
  },
  {
    "path": "src/resolvers/aws-context/aws-context.resolver.ts",
    "chars": 2383,
    "preview": "//#region Imports\n\nimport type { Context } from 'aws-lambda';\nimport type {\n  DelegatedResolver,\n  Resolver,\n  ResolverC"
  },
  {
    "path": "src/resolvers/aws-context/index.ts",
    "chars": 40,
    "preview": "export * from './aws-context.resolver';\n"
  },
  {
    "path": "src/resolvers/callback/callback.resolver.ts",
    "chars": 1992,
    "preview": "//#region Imports\n\nimport type {\n  DelegatedResolver,\n  Resolver,\n  ResolverContract,\n  ResolverProps,\n} from '../../con"
  },
  {
    "path": "src/resolvers/callback/index.ts",
    "chars": 37,
    "preview": "export * from './callback.resolver';\n"
  },
  {
    "path": "src/resolvers/dummy/dummy.resolver.ts",
    "chars": 584,
    "preview": "//#region Imports\n\nimport type { Resolver, ResolverContract } from '../../contracts';\n\n//#endregion\n\n/**\n * The class th"
  },
  {
    "path": "src/resolvers/dummy/index.ts",
    "chars": 34,
    "preview": "export * from './dummy.resolver';\n"
  },
  {
    "path": "src/resolvers/promise/index.ts",
    "chars": 36,
    "preview": "export * from './promise.resolver';\n"
  },
  {
    "path": "src/resolvers/promise/promise.resolver.ts",
    "chars": 1450,
    "preview": "//#region Imports\n\nimport type {\n  DelegatedResolver,\n  Resolver,\n  ResolverContract,\n  ResolverProps,\n} from '../../con"
  },
  {
    "path": "src/serverless-adapter.ts",
    "chars": 7148,
    "preview": "//#region Imports\n\nimport type { BinarySettings } from './@types';\nimport type {\n  AdapterContract,\n  FrameworkContract,"
  },
  {
    "path": "test/adapters/apollo-server/apollo-mutation.adapter.spec.ts",
    "chars": 9146,
    "preview": "import { ApolloServer } from '@apollo/server';\nimport { describe, expect, it, vitest } from 'vitest';\nimport type { SQSE"
  },
  {
    "path": "test/adapters/aws/alb.adapter.spec.ts",
    "chars": 13388,
    "preview": "import type { ALBEvent, ALBResult } from 'aws-lambda';\nimport { beforeEach, describe, expect, it, vitest } from 'vitest'"
  },
  {
    "path": "test/adapters/aws/api-gateway-v1.adapter.spec.ts",
    "chars": 13319,
    "preview": "import type { APIGatewayProxyResult } from 'aws-lambda';\nimport type { APIGatewayProxyEvent } from 'aws-lambda/trigger/a"
  },
  {
    "path": "test/adapters/aws/api-gateway-v2.adapter.spec.ts",
    "chars": 15377,
    "preview": "import type { APIGatewayProxyEventV2 } from 'aws-lambda';\nimport type { APIGatewayProxyStructuredResultV2 } from 'aws-la"
  },
  {
    "path": "test/adapters/aws/aws-simple-adapter.spec.ts",
    "chars": 8381,
    "preview": "import { describe, expect, it, vitest } from 'vitest';\nimport {\n  type DelegatedResolver,\n  EmptyResponse,\n  type ILogge"
  },
  {
    "path": "test/adapters/aws/dynamodb.adapter.spec.ts",
    "chars": 2461,
    "preview": "import { beforeEach, describe, expect, it } from 'vitest';\nimport { getEventBodyAsBuffer } from '../../../src';\nimport {"
  },
  {
    "path": "test/adapters/aws/event-bridge.adapter.spec.ts",
    "chars": 2505,
    "preview": "import { beforeEach, describe, expect, it } from 'vitest';\nimport { getEventBodyAsBuffer } from '../../../src';\nimport {"
  },
  {
    "path": "test/adapters/aws/lambda-edge.adapter.spec.ts",
    "chars": 15520,
    "preview": "import { join } from 'path';\nimport type {\n  CloudFrontHeaders,\n  CloudFrontRequest,\n} from 'aws-lambda/common/cloudfron"
  },
  {
    "path": "test/adapters/aws/request-lambda-edge.adapter.spec.ts",
    "chars": 14250,
    "preview": "import type { CloudFrontHeaders } from 'aws-lambda/common/cloudfront';\nimport type {\n  CloudFrontRequestEvent,\n  CloudFr"
  },
  {
    "path": "test/adapters/aws/s3.adapter.spec.ts",
    "chars": 2363,
    "preview": "import { beforeEach, describe, expect, it } from 'vitest';\nimport { getEventBodyAsBuffer } from '../../../src';\nimport {"
  },
  {
    "path": "test/adapters/aws/sns.adapter.spec.ts",
    "chars": 2380,
    "preview": "import { beforeEach, describe, expect, it } from 'vitest';\nimport { getEventBodyAsBuffer } from '../../../src';\nimport {"
  },
  {
    "path": "test/adapters/aws/sqs.adapter.spec.ts",
    "chars": 2380,
    "preview": "import { beforeEach, describe, expect, it } from 'vitest';\nimport { getEventBodyAsBuffer } from '../../../src';\nimport {"
  },
  {
    "path": "test/adapters/aws/utils/alb-event.ts",
    "chars": 3084,
    "preview": "import type { ALBEvent } from 'aws-lambda';\n\n/**\n * Sample event from {@link https://docs.aws.amazon.com/lambda/latest/d"
  },
  {
    "path": "test/adapters/aws/utils/api-gateway-v1.ts",
    "chars": 4532,
    "preview": "import type {\n  APIGatewayProxyEvent,\n  APIGatewayProxyEventQueryStringParameters,\n} from 'aws-lambda/trigger/api-gatewa"
  },
  {
    "path": "test/adapters/aws/utils/api-gateway-v2.ts",
    "chars": 2331,
    "preview": "import type { APIGatewayProxyEventV2 } from 'aws-lambda';\nimport type { APIGatewayProxyEventQueryStringParameters } from"
  },
  {
    "path": "test/adapters/aws/utils/dynamodb.ts",
    "chars": 1673,
    "preview": "import type { DynamoDBStreamEvent } from 'aws-lambda';\n\n/**\n * Sample event from {@link https://docs.aws.amazon.com/lamb"
  },
  {
    "path": "test/adapters/aws/utils/event-bridge.ts",
    "chars": 1357,
    "preview": "import type { EventBridgeEvent } from 'aws-lambda';\n\n/**\n * Sample event from {@link https://docs.aws.amazon.com/lambda/"
  },
  {
    "path": "test/adapters/aws/utils/events.ts",
    "chars": 2825,
    "preview": "import {\n  AlbAdapter,\n  ApiGatewayV1Adapter,\n  ApiGatewayV2Adapter,\n  DynamoDBAdapter,\n  EventBridgeAdapter,\n  LambdaEd"
  },
  {
    "path": "test/adapters/aws/utils/lambda-edge.ts",
    "chars": 6167,
    "preview": "import type { CloudFrontHeaders } from 'aws-lambda/common/cloudfront';\nimport type { CloudFrontRequestEvent } from 'aws-"
  },
  {
    "path": "test/adapters/aws/utils/s3.ts",
    "chars": 1369,
    "preview": "import type { S3Event } from 'aws-lambda';\n\n/**\n * Sample event from {@link https://docs.aws.amazon.com/pt_br/lambda/lat"
  },
  {
    "path": "test/adapters/aws/utils/sns.ts",
    "chars": 1459,
    "preview": "import type { SNSEvent } from 'aws-lambda';\n\n/**\n * Sample event from {@link https://docs.aws.amazon.com/lambda/latest/d"
  },
  {
    "path": "test/adapters/aws/utils/sqs.ts",
    "chars": 839,
    "preview": "import type { SQSEvent } from 'aws-lambda';\n\n/**\n * Sample event from {@link https://docs.aws.amazon.com/lambda/latest/d"
  },
  {
    "path": "test/adapters/azure/http-trigger.adapter.spec.ts",
    "chars": 13189,
    "preview": "import type { Cookie, HttpRequest, HttpResponseSimple } from '@azure/functions';\nimport { beforeEach, describe, expect, "
  },
  {
    "path": "test/adapters/azure/utils/events.ts",
    "chars": 354,
    "preview": "import { HttpTriggerV4Adapter } from '../../../../src/adapters/azure';\nimport { createHttpTriggerEvent } from './http-tr"
  },
  {
    "path": "test/adapters/azure/utils/http-trigger.ts",
    "chars": 4231,
    "preview": "import { URL } from 'url';\nimport type { Context, Form, HttpRequest } from '@azure/functions';\nimport { vitest } from 'v"
  },
  {
    "path": "test/adapters/digital-ocean/http-function.adapter.spec.ts",
    "chars": 8647,
    "preview": "import { beforeEach, describe, expect, it, vitest } from 'vitest';\nimport {\n  type DelegatedResolver,\n  type GetResponse"
  },
  {
    "path": "test/adapters/digital-ocean/utils/event.ts",
    "chars": 579,
    "preview": "import { HttpFunctionAdapter } from '../../../../src/adapters/digital-ocean';\nimport { createHttpFunctionEvent } from '."
  },
  {
    "path": "test/adapters/digital-ocean/utils/http-function.ts",
    "chars": 1035,
    "preview": "import { type DigitalOceanHttpEvent } from '../../../../src/@types/digital-ocean';\n\nexport function createHttpFunctionEv"
  },
  {
    "path": "test/adapters/dummy/dummy.adapter.spec.ts",
    "chars": 1687,
    "preview": "import { beforeEach, describe, expect, it, vitest } from 'vitest';\nimport {\n  type DelegatedResolver,\n  EmptyResponse,\n "
  },
  {
    "path": "test/adapters/huawei/huawei-api-gateway.adapter.spec.ts",
    "chars": 9600,
    "preview": "import { beforeEach, describe, expect, it, vitest } from 'vitest';\nimport {\n  type DelegatedResolver,\n  type GetResponse"
  },
  {
    "path": "test/adapters/huawei/utils/events.ts",
    "chars": 473,
    "preview": "import { HuaweiApiGatewayAdapter } from '../../../../src/adapters/huawei';\nimport { createHuaweiApiGateway } from './hua"
  },
  {
    "path": "test/adapters/huawei/utils/huawei-api-gateway.ts",
    "chars": 2282,
    "preview": "import type { BothValueHeaders } from '../../../../src';\nimport type {\n  HuaweiApiGatewayEvent,\n  HuaweiRequestQueryStri"
  },
  {
    "path": "test/adapters/test.example",
    "chars": 1163,
    "preview": "describe(Adapter.name, () => {\r\n  let adapter!: Adapter;\r\n\r\n  beforeEach(() => {\r\n    adapter = new Adapter();\r\n  });\r\n\r"
  },
  {
    "path": "test/adapters/utils/can-handle.ts",
    "chars": 1333,
    "preview": "import { beforeEach, describe, expect, it } from 'vitest';\nimport type { AdapterContract, ILogger } from '../../../src';"
  },
  {
    "path": "test/adapters/utils/events.ts",
    "chars": 449,
    "preview": "import { allAWSEvents } from '../aws/utils/events';\nimport { allAzureEvents } from '../azure/utils/events';\nimport { all"
  },
  {
    "path": "test/core/base-handler.spec.ts",
    "chars": 3891,
    "preview": "import { describe, expect, it, vitest } from 'vitest';\nimport {\n  type AdapterContract,\n  type AdapterRequest,\n  BaseHan"
  },
  {
    "path": "test/core/current-invoke.spec.ts",
    "chars": 795,
    "preview": "import { describe, expect, it } from 'vitest';\nimport { getCurrentInvoke, setCurrentInvoke } from '../../src';\n\ndescribe"
  },
  {
    "path": "test/core/event-body.spec.ts",
    "chars": 816,
    "preview": "import { describe, expect, it } from 'vitest';\nimport { getEventBodyAsBuffer } from '../../src';\n\ndescribe('getEventBody"
  },
  {
    "path": "test/core/headers.spec.ts",
    "chars": 5214,
    "preview": "import { describe, expect, it } from 'vitest';\nimport {\n  type BothValueHeaders,\n  getFlattenedHeadersMap,\n  getFlattene"
  },
  {
    "path": "test/core/is-binary.spec.ts",
    "chars": 5240,
    "preview": "import { describe, expect, it } from 'vitest';\nimport {\n  type BothValueHeaders,\n  DEFAULT_BINARY_CONTENT_TYPES,\n  DEFAU"
  },
  {
    "path": "test/core/logger.spec.ts",
    "chars": 5732,
    "preview": "/* eslint-disable @typescript-eslint/unbound-method */\n\nimport {\n  type MockInstance,\n  afterEach,\n  beforeEach,\n  descr"
  }
]

// ... and 117 more files (download for full content)

About this extraction

This page contains the full source code of the H4ad/serverless-adapter GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 317 files (888.5 KB), approximately 227.5k tokens, and a symbol index with 493 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!