From 9ead96061a24aa98e43c359d89b5b581c53d30ff Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 4 Nov 2025 18:40:43 +0000
Subject: [PATCH 1/5] Initial plan
From 1f3cd7c132aa6113d779dde642f0891a99d2fc1e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 4 Nov 2025 18:47:56 +0000
Subject: [PATCH 2/5] Add Vercel serverless configuration and dependencies
Co-authored-by: Faizal-Malek <94194196+Faizal-Malek@users.noreply.github.com>
---
PROPOSED_CHANGE.md | 181 +++++++++++++++++++++++++++++++++++++++++++++
api/index.js | 66 +++++++++++++++++
package.json | 3 +-
vercel.json | 14 ++++
4 files changed, 263 insertions(+), 1 deletion(-)
create mode 100644 PROPOSED_CHANGE.md
create mode 100644 api/index.js
create mode 100644 vercel.json
diff --git a/PROPOSED_CHANGE.md b/PROPOSED_CHANGE.md
new file mode 100644
index 0000000..bf32920
--- /dev/null
+++ b/PROPOSED_CHANGE.md
@@ -0,0 +1,181 @@
+# Proposed Changes for Vercel Deployment
+
+## Overview
+This PR adds support for deploying the Express/EJS blog application to Vercel as a serverless function. The changes are **additive and non-destructive** - no existing functionality is removed or modified.
+
+## Files Added
+
+### 1. `api/index.js` - Serverless Wrapper
+This file wraps the Express application with `serverless-http` to make it compatible with Vercel's serverless architecture.
+
+**What it does:**
+- Attempts to load your Express app from common paths: `../app`, `../server`, `../src/app`, `../src/server`, `./app`
+- Wraps the app with `serverless-http` for serverless execution
+- Provides helpful error messages if the app can't be found or is misconfigured
+
+**Important:** If your app is at a different location, modify this file to require from the correct path.
+
+### 2. `vercel.json` - Vercel Configuration
+Configures the Vercel deployment:
+- Specifies Node.js 18.x runtime for the serverless function
+- Rewrites all incoming routes to `/api/index.js` so the Express app handles routing
+
+### 3. This file (`PROPOSED_CHANGE.md`)
+Documents the changes for maintainers.
+
+## Files Modified
+
+### `package.json`
+Added dependency: `"serverless-http": "^3.0.0"`
+
+This package wraps Express apps to work as serverless functions.
+
+## Important: App Export vs Server Instance
+
+For Vercel serverless deployment to work, your main application file must:
+1. **Export the Express app instance** (not a server)
+2. **NOT call `app.listen()`** in the exported module
+
+### Current Structure (app.js)
+Your current `app.js` calls `app.listen(3000)` inside the mongoose connection promise. This works for traditional server deployment but not for serverless.
+
+### Recommended Structure for Vercel
+
+**Option 1: Modify app.js to export the app**
+
+Create a new `server.js` for local development:
+
+```javascript
+// server.js (for local development)
+const app = require('./app');
+const mongoose = require('mongoose');
+
+const dbURI = "mongodb+srv://netninja:test1234@nodeproject.62tovra.mongodb.net/NodeProject?retryWrites=true&w=majority&appName=NodeProject";
+
+mongoose
+ .connect(dbURI)
+ .then((result) => {
+ console.log('Connected to MongoDB');
+ app.listen(3000, () => {
+ console.log('Server running on http://localhost:3000');
+ });
+ })
+ .catch((err) => console.error(err));
+```
+
+And modify `app.js` to just export the app:
+
+```javascript
+// app.js (modified - remove app.listen, just export)
+const express = require("express");
+const morgan = require("morgan");
+const mongoose = require("mongoose");
+const blogRoutes = require("./routes/blogsRoutes");
+
+const app = express();
+
+// Connection string
+const dbURI = "mongodb+srv://netninja:test1234@nodeproject.62tovra.mongodb.net/NodeProject?retryWrites=true&w=majority&appName=NodeProject";
+
+// Connect to MongoDB (but don't start server here)
+mongoose
+ .connect(dbURI)
+ .then(() => console.log('MongoDB connected'))
+ .catch((err) => console.error(err));
+
+// Middleware & static files
+app.use(express.static("public"));
+app.use(express.urlencoded({ extended: true }));
+app.use(morgan("dev"));
+
+// View engine
+app.set("view engine", "ejs");
+
+// Routes
+app.get("/", (req, res) => {
+ res.redirect("/blogs");
+});
+
+app.get("/about", (req, res) => {
+ res.render("about", { title: "about" });
+});
+
+app.use("/blogs", blogRoutes);
+
+app.use((req, res) => {
+ res.status(404).render("404", { title: "404" });
+});
+
+// Export the app for Vercel
+module.exports = app;
+```
+
+**Option 2: Keep app.js as-is and create a new entry point**
+
+If you want to keep `app.js` unchanged for compatibility, you could:
+1. Rename current `app.js` to `server.js`
+2. Create a new `app.js` that only exports the Express app without calling listen()
+3. Update `package.json` start script to use `server.js`
+
+## Local Development
+
+After making changes:
+
+```bash
+# Install dependencies
+npm install
+
+# For local development (if you created server.js)
+npm start
+# or
+node server.js
+
+# For testing Vercel locally (requires Vercel CLI)
+npm install -g vercel
+vercel dev
+```
+
+## Deployment on Vercel
+
+After merging this PR:
+1. Push to your repository
+2. Vercel will automatically install dependencies (including `serverless-http`)
+3. Vercel will build and deploy using the configuration in `vercel.json`
+4. All routes will be handled by the Express app through `/api/index.js`
+
+## Environment Variables
+
+If your app uses environment variables (like the MongoDB connection string), make sure to:
+1. Add them in the Vercel dashboard under Project Settings → Environment Variables
+2. Never commit sensitive credentials to the repository
+
+## Troubleshooting
+
+### 404 Errors
+- Ensure `vercel.json` is in the root directory
+- Check that `api/index.js` successfully loads your app (check Vercel logs)
+
+### 500 Errors
+- Check Vercel runtime logs for error messages
+- Ensure your app exports the Express instance, not a server instance
+- Verify MongoDB connection string is set as an environment variable
+
+### Module Not Found
+- If `api/index.js` can't find your app, modify the `possiblePaths` array to include your app's actual path
+
+## Testing Checklist
+
+- [ ] Install dependencies: `npm install`
+- [ ] Test locally: `node server.js` (if created)
+- [ ] Test with Vercel CLI: `vercel dev`
+- [ ] Deploy to Vercel and check deployment logs
+- [ ] Test routes: home, about, blog pages
+- [ ] Check for any 404 or 500 errors
+
+## Questions or Issues?
+
+If you encounter problems:
+1. Check Vercel build logs for errors
+2. Check Vercel runtime logs for runtime errors
+3. Verify the Express app structure matches the recommended format
+4. Open an issue with specific error messages for further assistance
diff --git a/api/index.js b/api/index.js
new file mode 100644
index 0000000..dfc7b7e
--- /dev/null
+++ b/api/index.js
@@ -0,0 +1,66 @@
+const serverless = require('serverless-http');
+
+/**
+ * Vercel serverless function handler
+ * This wraps the Express app with serverless-http for deployment on Vercel
+ */
+
+// Try to load the Express app from common paths
+const possiblePaths = [
+ '../app',
+ '../server',
+ '../src/app',
+ '../src/server',
+ './app'
+];
+
+let app = null;
+let appPath = null;
+
+for (const path of possiblePaths) {
+ try {
+ const module = require(path);
+ // Check if we got a server instance (has listening property) vs an app
+ if (module && typeof module === 'object') {
+ if (module.listening !== undefined) {
+ // This is a server instance, not an app
+ console.error(`Error: ${path} exports a server instance (called listen()). Please export the app instance instead.`);
+ module.exports = async (req, res) => {
+ res.status(500).json({
+ error: 'Configuration Error',
+ message: `The module at ${path} exports a server instance instead of the Express app. Please ensure your main file exports the app instance (module.exports = app) without calling app.listen().`,
+ fix: 'Remove app.listen() from the exported module and export only the app instance.'
+ });
+ };
+ break;
+ }
+ app = module;
+ appPath = path;
+ console.log(`Successfully loaded Express app from ${path}`);
+ break;
+ }
+ } catch (err) {
+ // Path doesn't exist or can't be loaded, try next one
+ continue;
+ }
+}
+
+if (!app) {
+ // No app found at any of the common paths
+ console.error('Could not find Express app at any common path');
+ module.exports = async (req, res) => {
+ res.status(500).json({
+ error: 'Configuration Error',
+ message: 'Could not find Express app. Tried paths: ' + possiblePaths.join(', '),
+ fix: 'Please ensure your Express app is exported from one of these paths, or modify api/index.js to require your app from the correct location.',
+ instructions: [
+ '1. Your main file should export the Express app instance: module.exports = app;',
+ '2. Do NOT call app.listen() in the file that exports the app',
+ '3. For local development, create a separate server.js that requires and starts the app'
+ ]
+ });
+ };
+} else {
+ // Successfully loaded the app, wrap it with serverless-http
+ module.exports = serverless(app);
+}
diff --git a/package.json b/package.json
index 056cd1e..d6df403 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,7 @@
"method-override": "^3.0.0",
"mongodb": "^6.5.0",
"mongoose": "^8.3.2",
- "morgan": "^1.10.0"
+ "morgan": "^1.10.0",
+ "serverless-http": "^3.0.0"
}
}
diff --git a/vercel.json b/vercel.json
new file mode 100644
index 0000000..74d1094
--- /dev/null
+++ b/vercel.json
@@ -0,0 +1,14 @@
+{
+ "version": 2,
+ "functions": {
+ "api/index.js": {
+ "runtime": "nodejs18.x"
+ }
+ },
+ "rewrites": [
+ {
+ "source": "/(.*)",
+ "destination": "/api/index.js"
+ }
+ ]
+}
From 46d2a712d2ef210deedae704eff33965a37cdd95 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 4 Nov 2025 18:52:26 +0000
Subject: [PATCH 3/5] Improve Express app validation in serverless wrapper
Co-authored-by: Faizal-Malek <94194196+Faizal-Malek@users.noreply.github.com>
---
api/index.js | 14 +-
node_modules/.package-lock.json | 9 ++
node_modules/serverless-http/LICENSE.txt | 33 +++++
node_modules/serverless-http/README.md | 117 +++++++++++++++
node_modules/serverless-http/lib/finish.js | 42 ++++++
.../lib/framework/get-framework.js | 79 ++++++++++
.../lib/provider/aws/clean-up-event.js | 98 +++++++++++++
.../lib/provider/aws/create-request.js | 110 ++++++++++++++
.../lib/provider/aws/format-response.js | 45 ++++++
.../serverless-http/lib/provider/aws/index.js | 15 ++
.../lib/provider/aws/is-binary.js | 42 ++++++
.../lib/provider/aws/sanitize-headers.js | 21 +++
.../lib/provider/azure/clean-up-request.js | 41 ++++++
.../lib/provider/azure/create-request.js | 45 ++++++
.../lib/provider/azure/format-response.js | 18 +++
.../lib/provider/azure/index.js | 13 ++
.../lib/provider/azure/is-binary.js | 42 ++++++
.../lib/provider/azure/sanitize-headers.js | 23 +++
.../lib/provider/azure/set-cookie.json | 1 +
.../lib/provider/get-provider.js | 17 +++
node_modules/serverless-http/lib/request.js | 38 +++++
node_modules/serverless-http/lib/response.js | 135 ++++++++++++++++++
node_modules/serverless-http/package.json | 93 ++++++++++++
.../serverless-http/serverless-http.d.ts | 41 ++++++
.../serverless-http/serverless-http.js | 23 +++
package-lock.json | 12 +-
package.json | 2 +-
27 files changed, 1162 insertions(+), 7 deletions(-)
create mode 100644 node_modules/serverless-http/LICENSE.txt
create mode 100644 node_modules/serverless-http/README.md
create mode 100644 node_modules/serverless-http/lib/finish.js
create mode 100644 node_modules/serverless-http/lib/framework/get-framework.js
create mode 100644 node_modules/serverless-http/lib/provider/aws/clean-up-event.js
create mode 100644 node_modules/serverless-http/lib/provider/aws/create-request.js
create mode 100644 node_modules/serverless-http/lib/provider/aws/format-response.js
create mode 100644 node_modules/serverless-http/lib/provider/aws/index.js
create mode 100644 node_modules/serverless-http/lib/provider/aws/is-binary.js
create mode 100644 node_modules/serverless-http/lib/provider/aws/sanitize-headers.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/clean-up-request.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/create-request.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/format-response.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/index.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/is-binary.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/sanitize-headers.js
create mode 100644 node_modules/serverless-http/lib/provider/azure/set-cookie.json
create mode 100644 node_modules/serverless-http/lib/provider/get-provider.js
create mode 100644 node_modules/serverless-http/lib/request.js
create mode 100644 node_modules/serverless-http/lib/response.js
create mode 100644 node_modules/serverless-http/package.json
create mode 100644 node_modules/serverless-http/serverless-http.d.ts
create mode 100644 node_modules/serverless-http/serverless-http.js
diff --git a/api/index.js b/api/index.js
index dfc7b7e..29c42cc 100644
--- a/api/index.js
+++ b/api/index.js
@@ -20,8 +20,9 @@ let appPath = null;
for (const path of possiblePaths) {
try {
const module = require(path);
- // Check if we got a server instance (has listening property) vs an app
+ // Check if we got a valid module
if (module && typeof module === 'object') {
+ // Check if it's a server instance (has listening property)
if (module.listening !== undefined) {
// This is a server instance, not an app
console.error(`Error: ${path} exports a server instance (called listen()). Please export the app instance instead.`);
@@ -34,10 +35,13 @@ for (const path of possiblePaths) {
};
break;
}
- app = module;
- appPath = path;
- console.log(`Successfully loaded Express app from ${path}`);
- break;
+ // Check if it looks like an Express app (has use, get, post methods)
+ if (typeof module.use === 'function' && typeof module.get === 'function') {
+ app = module;
+ appPath = path;
+ console.log(`Successfully loaded Express app from ${path}`);
+ break;
+ }
}
} catch (err) {
// Path doesn't exist or can't be loaded, try next one
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index ef96946..baf7ad6 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -985,6 +985,15 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/serverless-http": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/serverless-http/-/serverless-http-3.2.0.tgz",
+ "integrity": "sha512-QvSyZXljRLIGqwcJ4xsKJXwkZnAVkse1OajepxfjkBXV0BMvRS5R546Z4kCBI8IygDzkQY0foNPC/rnipaE9pQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0"
+ }
+ },
"node_modules/set-function-length": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
diff --git a/node_modules/serverless-http/LICENSE.txt b/node_modules/serverless-http/LICENSE.txt
new file mode 100644
index 0000000..5b1c365
--- /dev/null
+++ b/node_modules/serverless-http/LICENSE.txt
@@ -0,0 +1,33 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Doug Moscrop
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+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.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
diff --git a/node_modules/serverless-http/README.md b/node_modules/serverless-http/README.md
new file mode 100644
index 0000000..ed3fc2d
--- /dev/null
+++ b/node_modules/serverless-http/README.md
@@ -0,0 +1,117 @@
+# serverless-http
+
+[](https://travis-ci.org/dougmoscrop/serverless-http)
+
+## Description
+
+This module allows you to 'wrap' your API for serverless use. No HTTP server, no ports or sockets. Just your code in the same execution pipeline you are already familiar with.
+
+## Sponsors
+
+Thank you to Upstash for reaching out to sponsor this project!
+
+
+
+
+
+
+
+
+Upstash: Serverless Database for Redis
+
+
+ Serverless Redis with global replication and durable storage
+ Price scales to zero with per request pricing
+ Built-in REST API designed for serverless and edge functions
+
+
+[Start for free in 30 seconds!](https://upstash.com/?utm_source=serverless-http)
+
+
+
+
+## Support
+
+### Supported Frameworks
+(* Experimental)
+
+* Node (http.createServer)
+* Connect
+* Express
+* Koa
+* Restana
+* Sails *
+* Hapi *
+* Fastify *
+* Restify *
+* Polka *
+* Loopback *
+
+### Supported Providers
+
+* AWS
+* Azure (Experimental, untested, probably outdated)
+
+## Examples
+
+Please check the `examples` folder!
+
+### Usage example using the Koa framework
+
+```javascript
+const serverless = require('serverless-http');
+const Koa = require('koa'); // or any supported framework
+
+const app = new Koa();
+
+app.use(/* register your middleware as normal */);
+
+// this is it!
+module.exports.handler = serverless(app);
+
+// or as a promise
+const handler = serverless(app);
+module.exports.handler = async (event, context) => {
+ // you can do other things here
+ const result = await handler(event, context);
+ // and here
+ return result;
+};
+```
+
+### Usage example using the Express framework with Azure
+
+```javascript
+
+const serverless = require('serverless-http');
+const express = require('express');
+
+const app = express();
+
+app.use(/* register your middleware as normal */);
+
+const handler = serverless(app, { provider: 'azure' });
+module.exports.funcName = async (context, req) => {
+ context.res = await handler(context, req);
+}
+
+```
+
+### Other examples
+[json-server-less-λ](https://github.com/pharindoko/json-server-less-lambda) - using serverless-http with json-server and serverless framework in AWS
+
+
+## Limitations
+
+Your code is running in a serverless environment. You cannot rely on your server being 'up' in the sense that you can/should not use in-memory sessions, web sockets, etc. You are also subject to provider specific restrictions on request/response size, duration, etc.
+
+> Think of this as a familiar way of expressing your app logic, *not* trying to make serverless do something it cannot.
+
+## Contributing
+
+Pull requests are welcome! Especially test scenarios for different situations and configurations.
+
+## Further Reading
+
+Here are some [more detailed examples](./docs/EXAMPLES.md) and [advanced configuration options](./docs/ADVANCED.md) as well as [provider-specific documentation](./docs/PROVIDERS.md)
+
diff --git a/node_modules/serverless-http/lib/finish.js b/node_modules/serverless-http/lib/finish.js
new file mode 100644
index 0000000..74efc29
--- /dev/null
+++ b/node_modules/serverless-http/lib/finish.js
@@ -0,0 +1,42 @@
+'use strict';
+
+module.exports = async function finish(item, transform, ...details) {
+ await new Promise((resolve, reject) => {
+ if (item.finished || item.complete) {
+ resolve();
+ return;
+ }
+
+ let finished = false;
+
+ function done(err) {
+ if (finished) {
+ return;
+ }
+
+ finished = true;
+
+ item.removeListener('error', done);
+ item.removeListener('end', done);
+ item.removeListener('finish', done);
+
+ if (err) {
+ reject(err);
+ } else {
+ resolve();
+ }
+ }
+
+ item.once('error', done);
+ item.once('end', done);
+ item.once('finish', done);
+ });
+
+ if (typeof transform === 'function') {
+ await transform(item, ...details);
+ } else if (typeof transform === 'object' && transform !== null) {
+ Object.assign(item, transform);
+ }
+
+ return item;
+};
diff --git a/node_modules/serverless-http/lib/framework/get-framework.js b/node_modules/serverless-http/lib/framework/get-framework.js
new file mode 100644
index 0000000..fa06b7e
--- /dev/null
+++ b/node_modules/serverless-http/lib/framework/get-framework.js
@@ -0,0 +1,79 @@
+'use strict';
+
+const http = require('http')
+const Response = require('../response');
+
+function common(cb) {
+ return request => {
+ const response = new Response(request);
+
+ cb(request, response);
+
+ return response;
+ };
+}
+
+module.exports = function getFramework(app) {
+ if (app instanceof http.Server) {
+ return request => {
+ const response = new Response(request);
+ app.emit('request', request, response)
+ return response
+ }
+ }
+
+ if (typeof app.callback === 'function') {
+ return common(app.callback());
+ }
+
+ if (typeof app.handle === 'function') {
+ return common((request, response) => {
+ app.handle(request, response);
+ });
+ }
+
+ if (typeof app.handler === 'function') {
+ return common((request, response) => {
+ app.handler(request, response);
+ });
+ }
+
+ if (typeof app._onRequest === 'function') {
+ return common((request, response) => {
+ app._onRequest(request, response);
+ });
+ }
+
+ if (typeof app === 'function') {
+ return common(app);
+ }
+
+ if (app.router && typeof app.router.route == 'function') {
+ return common((req, res) => {
+ const { url, method, headers, body } = req;
+ app.router.route({ url, method, headers, body }, res);
+ });
+ }
+
+ if (app._core && typeof app._core._dispatch === 'function') {
+ return common(app._core._dispatch({
+ app
+ }));
+ }
+
+ if (typeof app.inject === 'function') {
+ return async request => {
+ const { method, url, headers, body } = request;
+
+ const res = await app.inject({ method, url, headers, payload: body })
+
+ return Response.from(res);
+ };
+ }
+
+ if (typeof app.main === 'function') {
+ return common(app.main);
+ }
+
+ throw new Error('Unsupported framework');
+};
diff --git a/node_modules/serverless-http/lib/provider/aws/clean-up-event.js b/node_modules/serverless-http/lib/provider/aws/clean-up-event.js
new file mode 100644
index 0000000..23e0811
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/aws/clean-up-event.js
@@ -0,0 +1,98 @@
+'use strict';
+
+function removeBasePath(path = '/', basePath) {
+ if (basePath) {
+ const basePathIndex = path.indexOf(basePath);
+
+ if (basePathIndex > -1) {
+ return path.substr(basePathIndex + basePath.length) || '/';
+ }
+ }
+
+ return path;
+}
+
+function isString(value)
+{
+ return (typeof value === 'string' || value instanceof String);
+}
+
+// ELBs will pass spaces as + symbols, and decodeURIComponent doesn't decode + symbols. So we need to convert them into something it can convert
+function specialDecodeURIComponent(value)
+{
+ if(!isString(value))
+ {
+ return value;
+ }
+
+ let decoded;
+ try {
+ decoded = decodeURIComponent(value.replace(/[+]/g, "%20"));
+ } catch (err) {
+ decoded = value.replace(/[+]/g, "%20");
+ }
+
+ return decoded;
+}
+
+function recursiveURLDecode(value) {
+
+ if (isString(value)) {
+ return specialDecodeURIComponent(value);
+ } else if (Array.isArray(value)) {
+
+ const decodedArray = [];
+
+ for (let index in value) {
+ decodedArray.push(recursiveURLDecode(value[index]));
+ }
+
+ return decodedArray;
+
+ } else if (value instanceof Object) {
+
+ const decodedObject = {};
+
+ for (let key of Object.keys(value)) {
+ decodedObject[specialDecodeURIComponent(key)] = recursiveURLDecode(value[key]);
+ }
+
+ return decodedObject;
+ }
+
+ return value;
+}
+
+module.exports = function cleanupEvent(evt, options) {
+ const event = evt || {};
+
+ event.requestContext = event.requestContext || {};
+ event.body = event.body || '';
+ event.headers = event.headers || {};
+
+ // Events coming from AWS Elastic Load Balancers do not automatically urldecode query parameters (unlike API Gateway). So we need to check for that and automatically decode them
+ // to normalize the request between the two.
+ if ('elb' in event.requestContext) {
+
+ if (event.multiValueQueryStringParameters) {
+ event.multiValueQueryStringParameters = recursiveURLDecode(event.multiValueQueryStringParameters);
+ }
+
+ if (event.queryStringParameters) {
+ event.queryStringParameters = recursiveURLDecode(event.queryStringParameters);
+ }
+
+ }
+
+ if (event.version === '2.0') {
+ event.requestContext.authorizer = event.requestContext.authorizer || {};
+ event.requestContext.http.method = event.requestContext.http.method || 'GET';
+ event.rawPath = removeBasePath(event.requestPath || event.rawPath, options.basePath);
+ } else {
+ event.requestContext.identity = event.requestContext.identity || {};
+ event.httpMethod = event.httpMethod || 'GET';
+ event.path = removeBasePath(event.requestPath || event.path, options.basePath);
+ }
+
+ return event;
+};
diff --git a/node_modules/serverless-http/lib/provider/aws/create-request.js b/node_modules/serverless-http/lib/provider/aws/create-request.js
new file mode 100644
index 0000000..f2f76c5
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/aws/create-request.js
@@ -0,0 +1,110 @@
+'use strict';
+
+const URL = require('url');
+
+const Request = require('../../request');
+
+function requestMethod(event) {
+ if (event.version === '2.0') {
+ return event.requestContext.http.method;
+ }
+ return event.httpMethod;
+}
+
+function requestRemoteAddress(event) {
+ if (event.version === '2.0') {
+ return event.requestContext.http.sourceIp;
+ }
+ return event.requestContext.identity.sourceIp;
+}
+
+function requestHeaders(event) {
+ const initialHeader =
+ event.version === '2.0' && Array.isArray(event.cookies)
+ ? { cookie: event.cookies.join('; ') }
+ : {};
+
+ if (event.multiValueHeaders) {
+ Object.keys(event.multiValueHeaders).reduce((headers, key) => {
+ headers[key.toLowerCase()] = event.multiValueHeaders[key].join(', ');
+ return headers;
+ }, initialHeader);
+ }
+
+ return Object.keys(event.headers).reduce((headers, key) => {
+ headers[key.toLowerCase()] = event.headers[key];
+ return headers;
+ }, initialHeader);
+}
+
+function requestBody(event) {
+ const type = typeof event.body;
+
+ if (Buffer.isBuffer(event.body)) {
+ return event.body;
+ } else if (type === 'string') {
+ return Buffer.from(event.body, event.isBase64Encoded ? 'base64' : 'utf8');
+ } else if (type === 'object') {
+ return Buffer.from(JSON.stringify(event.body));
+ }
+
+ throw new Error(`Unexpected event.body type: ${typeof event.body}`);
+}
+
+function requestUrl(event) {
+ if (event.version === '2.0') {
+ return URL.format({
+ pathname: event.rawPath,
+ search: event.rawQueryString,
+ });
+ }
+ // Normalize all query params into a single query string.
+ const query = event.multiValueQueryStringParameters || {};
+ if (event.queryStringParameters) {
+ Object.keys(event.queryStringParameters).forEach((key) => {
+ if (Array.isArray(query[key])) {
+ if (!query[key].includes(event.queryStringParameters[key])) {
+ query[key].push(event.queryStringParameters[key]);
+ }
+ } else {
+ query[key] = [event.queryStringParameters[key]];
+ }
+ });
+ }
+ return URL.format({
+ pathname: event.path,
+ query: query,
+ });
+}
+
+module.exports = (event, context, options) => {
+ const method = requestMethod(event);
+ const remoteAddress = requestRemoteAddress(event);
+ const headers = requestHeaders(event);
+ const body = requestBody(event);
+ const url = requestUrl(event);
+
+ if (typeof options.requestId === 'string' && options.requestId.length > 0) {
+ const header = options.requestId.toLowerCase();
+ const requestId = headers[header] || event.requestContext.requestId;
+ if (requestId) {
+ headers[header] = requestId;
+ }
+ }
+
+ const req = new Request({
+ method,
+ headers,
+ body,
+ remoteAddress,
+ url,
+ });
+
+ req.requestContext = event.requestContext;
+ req.apiGateway = {
+ event,
+ context,
+ };
+
+ return req;
+};
diff --git a/node_modules/serverless-http/lib/provider/aws/format-response.js b/node_modules/serverless-http/lib/provider/aws/format-response.js
new file mode 100644
index 0000000..90b5351
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/aws/format-response.js
@@ -0,0 +1,45 @@
+'use strict';
+
+const isBinary = require('./is-binary');
+const Response = require('../../response');
+const sanitizeHeaders = require('./sanitize-headers');
+
+module.exports = (event, response, options) => {
+ const { statusCode } = response;
+ const {headers, multiValueHeaders } = sanitizeHeaders(Response.headers(response));
+
+ let cookies = [];
+
+ if (multiValueHeaders['set-cookie']) {
+ cookies = multiValueHeaders['set-cookie'];
+ }
+
+ const isBase64Encoded = isBinary(headers, options);
+ const encoding = isBase64Encoded ? 'base64' : 'utf8';
+ let body = Response.body(response).toString(encoding);
+
+ if (headers['transfer-encoding'] === 'chunked' || response.chunkedEncoding) {
+ const raw = Response.body(response).toString().split('\r\n');
+ const parsed = [];
+ for (let i = 0; i < raw.length; i +=2) {
+ const size = parseInt(raw[i], 16);
+ const value = raw[i + 1];
+ if (value) {
+ parsed.push(value.substring(0, size));
+ }
+ }
+ body = parsed.join('')
+ }
+
+ let formattedResponse = { statusCode, headers, isBase64Encoded, body };
+
+ if (event.version === '2.0' && cookies.length) {
+ formattedResponse['cookies'] = cookies;
+ }
+
+ if ((!event.version || event.version === '1.0') && Object.keys(multiValueHeaders).length) {
+ formattedResponse['multiValueHeaders'] = multiValueHeaders;
+ }
+
+ return formattedResponse;
+};
diff --git a/node_modules/serverless-http/lib/provider/aws/index.js b/node_modules/serverless-http/lib/provider/aws/index.js
new file mode 100644
index 0000000..805e911
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/aws/index.js
@@ -0,0 +1,15 @@
+const cleanUpEvent = require('./clean-up-event');
+
+const createRequest = require('./create-request');
+const formatResponse = require('./format-response');
+
+module.exports = options => {
+ return getResponse => async (event_, context = {}) => {
+ const event = cleanUpEvent(event_, options);
+
+ const request = createRequest(event, context, options);
+ const response = await getResponse(request, event, context);
+
+ return formatResponse(event, response, options);
+ };
+};
diff --git a/node_modules/serverless-http/lib/provider/aws/is-binary.js b/node_modules/serverless-http/lib/provider/aws/is-binary.js
new file mode 100644
index 0000000..59a3cdf
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/aws/is-binary.js
@@ -0,0 +1,42 @@
+'use strict';
+
+const BINARY_ENCODINGS = ['gzip', 'deflate', 'br'];
+const BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || '').split(',');
+
+function isBinaryEncoding(headers) {
+ const contentEncoding = headers['content-encoding'];
+
+ if (typeof contentEncoding === 'string') {
+ return contentEncoding.split(',').some(value =>
+ BINARY_ENCODINGS.some(binaryEncoding => value.indexOf(binaryEncoding) !== -1)
+ );
+ }
+}
+
+function isBinaryContent(headers, options) {
+ const contentTypes = [].concat(options.binary
+ ? options.binary
+ : BINARY_CONTENT_TYPES
+ ).map(candidate =>
+ new RegExp(`^${candidate.replace(/\*/g, '.*')}$`)
+ );
+
+ const contentType = (headers['content-type'] || '').split(';')[0];
+ return !!contentType && contentTypes.some(candidate => candidate.test(contentType));
+}
+
+module.exports = function isBinary(headers, options) {
+ if (options.binary === false) {
+ return false;
+ }
+
+ if (options.binary === true) {
+ return true
+ }
+
+ if (typeof options.binary === 'function') {
+ return options.binary(headers);
+ }
+
+ return isBinaryEncoding(headers) || isBinaryContent(headers, options);
+};
diff --git a/node_modules/serverless-http/lib/provider/aws/sanitize-headers.js b/node_modules/serverless-http/lib/provider/aws/sanitize-headers.js
new file mode 100644
index 0000000..4b81082
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/aws/sanitize-headers.js
@@ -0,0 +1,21 @@
+'use strict';
+
+module.exports = function sanitizeHeaders(headers) {
+ return Object.keys(headers).reduce((memo, key) => {
+ const value = headers[key];
+
+ if (Array.isArray(value)) {
+ memo.multiValueHeaders[key] = value;
+ if (key.toLowerCase() !== 'set-cookie') {
+ memo.headers[key] = value.join(", ");
+ }
+ } else {
+ memo.headers[key] = value == null ? '' : value.toString();
+ }
+
+ return memo;
+ }, {
+ headers: {},
+ multiValueHeaders: {}
+ });
+};
diff --git a/node_modules/serverless-http/lib/provider/azure/clean-up-request.js b/node_modules/serverless-http/lib/provider/azure/clean-up-request.js
new file mode 100644
index 0000000..98f5084
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/clean-up-request.js
@@ -0,0 +1,41 @@
+'use strict';
+
+function getUrl({ requestPath, url }) {
+ if (requestPath) {
+ return requestPath;
+ }
+
+ return typeof url === 'string' ? url : '/';
+}
+
+function getRequestContext(request) {
+ const requestContext = {};
+ requestContext.identity = {};
+ const forwardedIp = request.headers['x-forwarded-for'];
+ const clientIp = request.headers['client-ip'];
+ const ip = forwardedIp ? forwardedIp : (clientIp ? clientIp : '');
+ if (ip) {
+ requestContext.identity.sourceIp = ip.split(':')[0];
+ }
+ return requestContext;
+}
+
+module.exports = function cleanupRequest(req, options) {
+ const request = req || {};
+
+ request.requestContext = getRequestContext(req);
+ request.method = request.method || 'GET';
+ request.url = getUrl(request);
+ request.body = request.body || '';
+ request.headers = request.headers || {};
+
+ if (options.basePath) {
+ const basePathIndex = request.url.indexOf(options.basePath);
+
+ if (basePathIndex > -1) {
+ request.url = request.url.substr(basePathIndex + options.basePath.length);
+ }
+ }
+
+ return request;
+}
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/azure/create-request.js b/node_modules/serverless-http/lib/provider/azure/create-request.js
new file mode 100644
index 0000000..de6f34b
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/create-request.js
@@ -0,0 +1,45 @@
+'use strict';
+
+const url = require('url');
+
+const Request = require('../../request');
+
+function requestHeaders(request) {
+ return Object.keys(request.headers).reduce((headers, key) => {
+ headers[key.toLowerCase()] = request.headers[key];
+ return headers;
+ }, {});
+}
+
+function requestBody(request) {
+ const type = typeof request.rawBody;
+
+ if (Buffer.isBuffer(request.rawBody)) {
+ return request.rawBody;
+ } else if (type === 'string') {
+ return Buffer.from(request.rawBody, 'utf8');
+ } else if (type === 'object') {
+ return Buffer.from(JSON.stringify(request.rawBody));
+ }
+
+ throw new Error(`Unexpected request.body type: ${typeof request.rawBody}`);
+}
+
+module.exports = (request) => {
+ const method = request.method;
+ const query = request.query;
+ const headers = requestHeaders(request);
+ const body = requestBody(request);
+
+ const req = new Request({
+ method,
+ headers,
+ body,
+ url: url.format({
+ pathname: request.url,
+ query
+ })
+ });
+ req.requestContext = request.requestContext;
+ return req;
+}
diff --git a/node_modules/serverless-http/lib/provider/azure/format-response.js b/node_modules/serverless-http/lib/provider/azure/format-response.js
new file mode 100644
index 0000000..0f0e1e6
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/format-response.js
@@ -0,0 +1,18 @@
+const isBinary = require('./is-binary');
+const Response = require('../../response');
+const sanitizeHeaders = require('./sanitize-headers');
+
+module.exports = (response, options) => {
+ const { statusCode } = response;
+ const headers = sanitizeHeaders(Response.headers(response));
+
+ if (headers['transfer-encoding'] === 'chunked' || response.chunkedEncoding) {
+ throw new Error('chunked encoding not supported');
+ }
+
+ const isBase64Encoded = isBinary(headers, options);
+ const encoding = isBase64Encoded ? 'base64' : 'utf8';
+ const body = Response.body(response).toString(encoding);
+
+ return { status: statusCode, headers, isBase64Encoded, body };
+}
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/azure/index.js b/node_modules/serverless-http/lib/provider/azure/index.js
new file mode 100644
index 0000000..2f410f0
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/index.js
@@ -0,0 +1,13 @@
+const cleanupRequest = require('./clean-up-request');
+const createRequest = require('./create-request');
+const formatResponse = require('./format-response');
+
+module.exports = options => {
+ return getResponse => async (context, req) => {
+ const event = cleanupRequest(req, options);
+ const request = createRequest(event, options);
+ const response = await getResponse(request, context, event);
+ context.log(response);
+ return formatResponse(response, options);
+ }
+};
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/azure/is-binary.js b/node_modules/serverless-http/lib/provider/azure/is-binary.js
new file mode 100644
index 0000000..59a3cdf
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/is-binary.js
@@ -0,0 +1,42 @@
+'use strict';
+
+const BINARY_ENCODINGS = ['gzip', 'deflate', 'br'];
+const BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || '').split(',');
+
+function isBinaryEncoding(headers) {
+ const contentEncoding = headers['content-encoding'];
+
+ if (typeof contentEncoding === 'string') {
+ return contentEncoding.split(',').some(value =>
+ BINARY_ENCODINGS.some(binaryEncoding => value.indexOf(binaryEncoding) !== -1)
+ );
+ }
+}
+
+function isBinaryContent(headers, options) {
+ const contentTypes = [].concat(options.binary
+ ? options.binary
+ : BINARY_CONTENT_TYPES
+ ).map(candidate =>
+ new RegExp(`^${candidate.replace(/\*/g, '.*')}$`)
+ );
+
+ const contentType = (headers['content-type'] || '').split(';')[0];
+ return !!contentType && contentTypes.some(candidate => candidate.test(contentType));
+}
+
+module.exports = function isBinary(headers, options) {
+ if (options.binary === false) {
+ return false;
+ }
+
+ if (options.binary === true) {
+ return true
+ }
+
+ if (typeof options.binary === 'function') {
+ return options.binary(headers);
+ }
+
+ return isBinaryEncoding(headers) || isBinaryContent(headers, options);
+};
diff --git a/node_modules/serverless-http/lib/provider/azure/sanitize-headers.js b/node_modules/serverless-http/lib/provider/azure/sanitize-headers.js
new file mode 100644
index 0000000..692baa4
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/sanitize-headers.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const setCookieVariations = require('./set-cookie.json').variations;
+
+module.exports = function sanitizeHeaders(headers) {
+ return Object.keys(headers).reduce((memo, key) => {
+ const value = headers[key];
+
+ if (Array.isArray(value)) {
+ if (key.toLowerCase() === 'set-cookie') {
+ value.forEach((cookie, i) => {
+ memo[setCookieVariations[i]] = cookie;
+ });
+ } else {
+ memo[key] = value.join(', ');
+ }
+ } else {
+ memo[key] = value == null ? '' : value.toString();
+ }
+
+ return memo;
+ }, {});
+};
diff --git a/node_modules/serverless-http/lib/provider/azure/set-cookie.json b/node_modules/serverless-http/lib/provider/azure/set-cookie.json
new file mode 100644
index 0000000..611cfea
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/azure/set-cookie.json
@@ -0,0 +1 @@
+{"variations":["set-cookie","Set-cookie","sEt-cookie","SEt-cookie","seT-cookie","SeT-cookie","sET-cookie","SET-cookie","set-Cookie","Set-Cookie","sEt-Cookie","SEt-Cookie","seT-Cookie","SeT-Cookie","sET-Cookie","SET-Cookie","set-cOokie","Set-cOokie","sEt-cOokie","SEt-cOokie","seT-cOokie","SeT-cOokie","sET-cOokie","SET-cOokie","set-COokie","Set-COokie","sEt-COokie","SEt-COokie","seT-COokie","SeT-COokie","sET-COokie","SET-COokie","set-coOkie","Set-coOkie","sEt-coOkie","SEt-coOkie","seT-coOkie","SeT-coOkie","sET-coOkie","SET-coOkie","set-CoOkie","Set-CoOkie","sEt-CoOkie","SEt-CoOkie","seT-CoOkie","SeT-CoOkie","sET-CoOkie","SET-CoOkie","set-cOOkie","Set-cOOkie","sEt-cOOkie","SEt-cOOkie","seT-cOOkie","SeT-cOOkie","sET-cOOkie","SET-cOOkie","set-COOkie","Set-COOkie","sEt-COOkie","SEt-COOkie","seT-COOkie","SeT-COOkie","sET-COOkie","SET-COOkie","set-cooKie","Set-cooKie","sEt-cooKie","SEt-cooKie","seT-cooKie","SeT-cooKie","sET-cooKie","SET-cooKie","set-CooKie","Set-CooKie","sEt-CooKie","SEt-CooKie","seT-CooKie","SeT-CooKie","sET-CooKie","SET-CooKie","set-cOoKie","Set-cOoKie","sEt-cOoKie","SEt-cOoKie","seT-cOoKie","SeT-cOoKie","sET-cOoKie","SET-cOoKie","set-COoKie","Set-COoKie","sEt-COoKie","SEt-COoKie","seT-COoKie","SeT-COoKie","sET-COoKie","SET-COoKie","set-coOKie","Set-coOKie","sEt-coOKie","SEt-coOKie","seT-coOKie","SeT-coOKie","sET-coOKie","SET-coOKie","set-CoOKie","Set-CoOKie","sEt-CoOKie","SEt-CoOKie","seT-CoOKie","SeT-CoOKie","sET-CoOKie","SET-CoOKie","set-cOOKie","Set-cOOKie","sEt-cOOKie","SEt-cOOKie","seT-cOOKie","SeT-cOOKie","sET-cOOKie","SET-cOOKie","set-COOKie","Set-COOKie","sEt-COOKie","SEt-COOKie","seT-COOKie","SeT-COOKie","sET-COOKie","SET-COOKie","set-cookIe","Set-cookIe","sEt-cookIe","SEt-cookIe","seT-cookIe","SeT-cookIe","sET-cookIe","SET-cookIe","set-CookIe","Set-CookIe","sEt-CookIe","SEt-CookIe","seT-CookIe","SeT-CookIe","sET-CookIe","SET-CookIe","set-cOokIe","Set-cOokIe","sEt-cOokIe","SEt-cOokIe","seT-cOokIe","SeT-cOokIe","sET-cOokIe","SET-cOokIe","set-COokIe","Set-COokIe","sEt-COokIe","SEt-COokIe","seT-COokIe","SeT-COokIe","sET-COokIe","SET-COokIe","set-coOkIe","Set-coOkIe","sEt-coOkIe","SEt-coOkIe","seT-coOkIe","SeT-coOkIe","sET-coOkIe","SET-coOkIe","set-CoOkIe","Set-CoOkIe","sEt-CoOkIe","SEt-CoOkIe","seT-CoOkIe","SeT-CoOkIe","sET-CoOkIe","SET-CoOkIe","set-cOOkIe","Set-cOOkIe","sEt-cOOkIe","SEt-cOOkIe","seT-cOOkIe","SeT-cOOkIe","sET-cOOkIe","SET-cOOkIe","set-COOkIe","Set-COOkIe","sEt-COOkIe","SEt-COOkIe","seT-COOkIe","SeT-COOkIe","sET-COOkIe","SET-COOkIe","set-cooKIe","Set-cooKIe","sEt-cooKIe","SEt-cooKIe","seT-cooKIe","SeT-cooKIe","sET-cooKIe","SET-cooKIe","set-CooKIe","Set-CooKIe","sEt-CooKIe","SEt-CooKIe","seT-CooKIe","SeT-CooKIe","sET-CooKIe","SET-CooKIe","set-cOoKIe","Set-cOoKIe","sEt-cOoKIe","SEt-cOoKIe","seT-cOoKIe","SeT-cOoKIe","sET-cOoKIe","SET-cOoKIe","set-COoKIe","Set-COoKIe","sEt-COoKIe","SEt-COoKIe","seT-COoKIe","SeT-COoKIe","sET-COoKIe","SET-COoKIe","set-coOKIe","Set-coOKIe","sEt-coOKIe","SEt-coOKIe","seT-coOKIe","SeT-coOKIe","sET-coOKIe","SET-coOKIe","set-CoOKIe","Set-CoOKIe","sEt-CoOKIe","SEt-CoOKIe","seT-CoOKIe","SeT-CoOKIe","sET-CoOKIe","SET-CoOKIe","set-cOOKIe","Set-cOOKIe","sEt-cOOKIe","SEt-cOOKIe","seT-cOOKIe","SeT-cOOKIe","sET-cOOKIe","SET-cOOKIe","set-COOKIe","Set-COOKIe","sEt-COOKIe","SEt-COOKIe","seT-COOKIe","SeT-COOKIe","sET-COOKIe","SET-COOKIe","set-cookiE","Set-cookiE","sEt-cookiE","SEt-cookiE","seT-cookiE","SeT-cookiE","sET-cookiE","SET-cookiE","set-CookiE","Set-CookiE","sEt-CookiE","SEt-CookiE","seT-CookiE","SeT-CookiE","sET-CookiE","SET-CookiE","set-cOokiE","Set-cOokiE","sEt-cOokiE","SEt-cOokiE","seT-cOokiE","SeT-cOokiE","sET-cOokiE","SET-cOokiE","set-COokiE","Set-COokiE","sEt-COokiE","SEt-COokiE","seT-COokiE","SeT-COokiE","sET-COokiE","SET-COokiE","set-coOkiE","Set-coOkiE","sEt-coOkiE","SEt-coOkiE","seT-coOkiE","SeT-coOkiE","sET-coOkiE","SET-coOkiE","set-CoOkiE","Set-CoOkiE","sEt-CoOkiE","SEt-CoOkiE","seT-CoOkiE","SeT-CoOkiE","sET-CoOkiE","SET-CoOkiE","set-cOOkiE","Set-cOOkiE","sEt-cOOkiE","SEt-cOOkiE","seT-cOOkiE","SeT-cOOkiE","sET-cOOkiE","SET-cOOkiE","set-COOkiE","Set-COOkiE","sEt-COOkiE","SEt-COOkiE","seT-COOkiE","SeT-COOkiE","sET-COOkiE","SET-COOkiE","set-cooKiE","Set-cooKiE","sEt-cooKiE","SEt-cooKiE","seT-cooKiE","SeT-cooKiE","sET-cooKiE","SET-cooKiE","set-CooKiE","Set-CooKiE","sEt-CooKiE","SEt-CooKiE","seT-CooKiE","SeT-CooKiE","sET-CooKiE","SET-CooKiE","set-cOoKiE","Set-cOoKiE","sEt-cOoKiE","SEt-cOoKiE","seT-cOoKiE","SeT-cOoKiE","sET-cOoKiE","SET-cOoKiE","set-COoKiE","Set-COoKiE","sEt-COoKiE","SEt-COoKiE","seT-COoKiE","SeT-COoKiE","sET-COoKiE","SET-COoKiE","set-coOKiE","Set-coOKiE","sEt-coOKiE","SEt-coOKiE","seT-coOKiE","SeT-coOKiE","sET-coOKiE","SET-coOKiE","set-CoOKiE","Set-CoOKiE","sEt-CoOKiE","SEt-CoOKiE","seT-CoOKiE","SeT-CoOKiE","sET-CoOKiE","SET-CoOKiE","set-cOOKiE","Set-cOOKiE","sEt-cOOKiE","SEt-cOOKiE","seT-cOOKiE","SeT-cOOKiE","sET-cOOKiE","SET-cOOKiE","set-COOKiE","Set-COOKiE","sEt-COOKiE","SEt-COOKiE","seT-COOKiE","SeT-COOKiE","sET-COOKiE","SET-COOKiE","set-cookIE","Set-cookIE","sEt-cookIE","SEt-cookIE","seT-cookIE","SeT-cookIE","sET-cookIE","SET-cookIE","set-CookIE","Set-CookIE","sEt-CookIE","SEt-CookIE","seT-CookIE","SeT-CookIE","sET-CookIE","SET-CookIE","set-cOokIE","Set-cOokIE","sEt-cOokIE","SEt-cOokIE","seT-cOokIE","SeT-cOokIE","sET-cOokIE","SET-cOokIE","set-COokIE","Set-COokIE","sEt-COokIE","SEt-COokIE","seT-COokIE","SeT-COokIE","sET-COokIE","SET-COokIE","set-coOkIE","Set-coOkIE","sEt-coOkIE","SEt-coOkIE","seT-coOkIE","SeT-coOkIE","sET-coOkIE","SET-coOkIE","set-CoOkIE","Set-CoOkIE","sEt-CoOkIE","SEt-CoOkIE","seT-CoOkIE","SeT-CoOkIE","sET-CoOkIE","SET-CoOkIE","set-cOOkIE","Set-cOOkIE","sEt-cOOkIE","SEt-cOOkIE","seT-cOOkIE","SeT-cOOkIE","sET-cOOkIE","SET-cOOkIE","set-COOkIE","Set-COOkIE","sEt-COOkIE","SEt-COOkIE","seT-COOkIE","SeT-COOkIE","sET-COOkIE","SET-COOkIE","set-cooKIE","Set-cooKIE","sEt-cooKIE","SEt-cooKIE","seT-cooKIE","SeT-cooKIE","sET-cooKIE","SET-cooKIE","set-CooKIE","Set-CooKIE","sEt-CooKIE","SEt-CooKIE","seT-CooKIE","SeT-CooKIE","sET-CooKIE","SET-CooKIE","set-cOoKIE","Set-cOoKIE","sEt-cOoKIE","SEt-cOoKIE","seT-cOoKIE","SeT-cOoKIE","sET-cOoKIE","SET-cOoKIE","set-COoKIE","Set-COoKIE","sEt-COoKIE","SEt-COoKIE","seT-COoKIE","SeT-COoKIE","sET-COoKIE","SET-COoKIE","set-coOKIE","Set-coOKIE","sEt-coOKIE","SEt-coOKIE","seT-coOKIE","SeT-coOKIE","sET-coOKIE","SET-coOKIE","set-CoOKIE","Set-CoOKIE","sEt-CoOKIE","SEt-CoOKIE","seT-CoOKIE","SeT-CoOKIE","sET-CoOKIE","SET-CoOKIE","set-cOOKIE","Set-cOOKIE","sEt-cOOKIE","SEt-cOOKIE","seT-cOOKIE","SeT-cOOKIE","sET-cOOKIE","SET-cOOKIE","set-COOKIE","Set-COOKIE","sEt-COOKIE","SEt-COOKIE","seT-COOKIE","SeT-COOKIE","sET-COOKIE","SET-COOKIE"]}
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/get-provider.js b/node_modules/serverless-http/lib/provider/get-provider.js
new file mode 100644
index 0000000..17edc70
--- /dev/null
+++ b/node_modules/serverless-http/lib/provider/get-provider.js
@@ -0,0 +1,17 @@
+const aws = require('./aws');
+const azure = require('./azure');
+
+const providers = {
+ aws,
+ azure
+};
+
+module.exports = function getProvider(options) {
+ const { provider = 'aws' } = options;
+
+ if (provider in providers) {
+ return providers[provider](options);
+ }
+
+ throw new Error(`Unsupported provider ${provider}`);
+};
diff --git a/node_modules/serverless-http/lib/request.js b/node_modules/serverless-http/lib/request.js
new file mode 100644
index 0000000..1472758
--- /dev/null
+++ b/node_modules/serverless-http/lib/request.js
@@ -0,0 +1,38 @@
+'use strict';
+
+const http = require('http');
+
+module.exports = class ServerlessRequest extends http.IncomingMessage {
+ constructor({ method, url, headers, body, remoteAddress }) {
+ super({
+ encrypted: true,
+ readable: false,
+ remoteAddress,
+ address: () => ({ port: 443 }),
+ end: Function.prototype,
+ destroy: Function.prototype
+ });
+
+ if (typeof headers['content-length'] === 'undefined') {
+ headers['content-length'] = Buffer.byteLength(body);
+ }
+
+ Object.assign(this, {
+ ip: remoteAddress,
+ complete: true,
+ httpVersion: '1.1',
+ httpVersionMajor: '1',
+ httpVersionMinor: '1',
+ method,
+ headers,
+ body,
+ url,
+ });
+
+ this._read = () => {
+ this.push(body);
+ this.push(null);
+ };
+ }
+
+}
diff --git a/node_modules/serverless-http/lib/response.js b/node_modules/serverless-http/lib/response.js
new file mode 100644
index 0000000..da745c4
--- /dev/null
+++ b/node_modules/serverless-http/lib/response.js
@@ -0,0 +1,135 @@
+'use strict';
+
+const http = require('http');
+
+const headerEnd = '\r\n\r\n';
+
+const BODY = Symbol();
+const HEADERS = Symbol();
+
+function getString(data) {
+ if (Buffer.isBuffer(data)) {
+ return data.toString('utf8');
+ } else if (typeof data === 'string') {
+ return data;
+ } else {
+ throw new Error(`response.write() of unexpected type: ${typeof data}`);
+ }
+}
+
+function addData(stream, data) {
+ if (Buffer.isBuffer(data) || typeof data === 'string' || data instanceof Uint8Array) {
+ stream[BODY].push(Buffer.from(data));
+ } else {
+ throw new Error(`response.write() of unexpected type: ${typeof data}`);
+ }
+}
+
+module.exports = class ServerlessResponse extends http.ServerResponse {
+
+ static from(res) {
+ const response = new ServerlessResponse(res);
+
+ response.statusCode = res.statusCode
+ response[HEADERS] = res.headers;
+ response[BODY] = [Buffer.from(res.body)];
+ response.end();
+
+ return response;
+ }
+
+ static body(res) {
+ return Buffer.concat(res[BODY]);
+ }
+
+ static headers(res) {
+ const headers = typeof res.getHeaders === 'function'
+ ? res.getHeaders()
+ : res._headers;
+
+ return Object.assign(headers, res[HEADERS]);
+ }
+
+ get headers() {
+ return this[HEADERS];
+ }
+
+ setHeader(key, value) {
+ if (this._wroteHeader) {
+ this[HEADERS][key] = value;
+ } else {
+ super.setHeader(key, value);
+ }
+ }
+
+ writeHead(statusCode, reason, obj) {
+ const headers = typeof reason === 'string'
+ ? obj
+ : reason
+
+ for (const name in headers) {
+ this.setHeader(name, headers[name])
+
+ if (!this._wroteHeader) {
+ // we only need to initiate super.headers once
+ // writeHead will add the other headers itself
+ break
+ }
+ }
+
+ super.writeHead(statusCode, reason, obj);
+ }
+
+ constructor({ method }) {
+ super({ method });
+
+ this[BODY] = [];
+ this[HEADERS] = {};
+
+ this.useChunkedEncodingByDefault = false;
+ this.chunkedEncoding = false;
+ this._header = '';
+
+ this.assignSocket({
+ _writableState: {},
+ writable: true,
+ on: Function.prototype,
+ removeListener: Function.prototype,
+ destroy: Function.prototype,
+ cork: Function.prototype,
+ uncork: Function.prototype,
+ write: (data, encoding, cb) => {
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (this._header === '' || this._wroteHeader) {
+ addData(this, data);
+ } else {
+ const string = getString(data);
+ const index = string.indexOf(headerEnd);
+
+ if (index !== -1) {
+ const remainder = string.slice(index + headerEnd.length);
+
+ if (remainder) {
+ addData(this, remainder);
+ }
+
+ this._wroteHeader = true;
+ }
+ }
+
+ if (typeof cb === 'function') {
+ cb();
+ }
+ },
+ });
+
+ this.once('finish', () => {
+ this.emit('close')
+ });
+ }
+
+};
diff --git a/node_modules/serverless-http/package.json b/node_modules/serverless-http/package.json
new file mode 100644
index 0000000..3417db7
--- /dev/null
+++ b/node_modules/serverless-http/package.json
@@ -0,0 +1,93 @@
+{
+ "name": "serverless-http",
+ "version": "3.2.0",
+ "description": "Use existing web application frameworks in serverless environments",
+ "main": "serverless-http.js",
+ "types": "serverless-http.d.ts",
+ "engines": {
+ "node": ">=12.0"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/dougmoscrop/serverless-http"
+ },
+ "scripts": {
+ "pretest": "tsc --strict --skipLibCheck --noEmit test/typecheck.ts",
+ "test": "nyc mocha",
+ "posttest": "eslint lib test",
+ "test:integration": "mocha test/integration/test.js",
+ "postpublish": "git push origin master --tags"
+ },
+ "keywords": [
+ "serverless",
+ "serverless applications",
+ "koa",
+ "express",
+ "connect",
+ "api gateway",
+ "lambda",
+ "aws",
+ "aws lambda",
+ "amazon",
+ "amazon web services"
+ ],
+ "author": "Doug Moscrop (http://www.github.com/dougmoscrop)",
+ "contributors": [
+ "Doug Moscrop (https://github.com/dougmoscrop)",
+ "Kevin Groat (https://github.com/kgroat)",
+ "Kurt Miller (https://github.com/bsdkurt)",
+ "Roch Devost (https://github.com/rochdev)",
+ "Bryan Gamble (https://github.com/bdgamble)",
+ "Derek MacDonald (https://github.com/demacdonald)",
+ "Filip Skokan (https://github.com/panva)",
+ "Kevin Tonon (https://github.com/ktonon)",
+ "Mark Vayngrib (https://github.com/mvayngrib)",
+ "Tamás Máhr (https://github.com/tamasmahr)",
+ "Daniel Martin (https://github.com/daniel-ac-martin)"
+ ],
+ "homepage": "https://github.com/dougmoscrop/serverless-http",
+ "license": "MIT",
+ "devDependencies": {
+ "@loopback/rest": "^11.1.2",
+ "@types/koa": "^2.11.0",
+ "body-parser": "^1.19.0",
+ "chai": "^4.2.0",
+ "chai-as-promised": "^7.1.1",
+ "cookie-parser": "^1.4.4",
+ "eslint": "^8.12.0",
+ "eslint-plugin-mocha": "^10.0.3",
+ "express": "^4.17.1",
+ "fastify": "^3.27.4",
+ "get-stream": "^5.1.0",
+ "hapi": "^18.1.0",
+ "inversify": "^6.0.1",
+ "inversify-express-utils": "^6.3.2",
+ "koa": "^2.11.0",
+ "koa-bodyparser": "^4.2.1",
+ "koa-compress": "^5.1.0",
+ "koa-route": "^3.2.0",
+ "koa-router": "^10.1.1",
+ "koa-static": "^5.0.0",
+ "lambda-log": "^3.1.0",
+ "mocha": "^9.2.2",
+ "morgan": "^1.9.1",
+ "nyc": "^15.0.0",
+ "on-finished": "^2.3.0",
+ "on-headers": "^1.0.2",
+ "polka": "^0.5.2",
+ "reflect-metadata": "^0.1.13",
+ "restana": "^4.0.7",
+ "sails": "^1.2.3",
+ "serverless": "^3.10.2",
+ "serverless-offline": "^8.5.0",
+ "serverless-plugin-common-excludes": "^4.0.0",
+ "serverless-plugin-custom-binary": "^2.0.0",
+ "serverless-plugin-include-dependencies": "^5.0.0",
+ "sinon": "^13.0.1",
+ "supertest": "^6.2.2",
+ "typescript": "^4.6.3"
+ }
+}
diff --git a/node_modules/serverless-http/serverless-http.d.ts b/node_modules/serverless-http/serverless-http.d.ts
new file mode 100644
index 0000000..974ba09
--- /dev/null
+++ b/node_modules/serverless-http/serverless-http.d.ts
@@ -0,0 +1,41 @@
+declare namespace ServerlessHttp {
+ export interface FrameworkApplication {
+ callback: Function;
+ handle: Function;
+ router: {
+ route: Function;
+ }
+ _core: {
+ _dispatch: Function;
+ }
+ }
+
+ /**
+ * Handler-compatible function or application.
+ */
+ export type Application = Function | Partial;
+ export type Result = Function | Partial;
+
+ export type Options = {
+ provider?: 'aws' | 'azure'
+ requestId?: string,
+ request?: Object | Function,
+ response?: Object | Function,
+ binary?: boolean | Function | string | string[],
+ basePath?: string
+ }
+ /**
+ * AWS Lambda APIGatewayProxyHandler-like handler.
+ */
+ export type Handler = (
+ event: Object,
+ context: Object
+ ) => Promise;
+}
+
+/**
+ * Wraps the application into a Lambda APIGatewayProxyHandler-like handler.
+ */
+declare function ServerlessHttp(application: ServerlessHttp.Application, options?: ServerlessHttp.Options): ServerlessHttp.Handler;
+
+export = ServerlessHttp;
diff --git a/node_modules/serverless-http/serverless-http.js b/node_modules/serverless-http/serverless-http.js
new file mode 100644
index 0000000..432b776
--- /dev/null
+++ b/node_modules/serverless-http/serverless-http.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const finish = require('./lib/finish');
+const getFramework = require('./lib/framework/get-framework');
+const getProvider = require('./lib/provider/get-provider');
+
+const defaultOptions = {
+ requestId: 'x-request-id'
+};
+
+module.exports = function (app, opts) {
+ const options = Object.assign({}, defaultOptions, opts);
+
+ const framework = getFramework(app);
+ const provider = getProvider(options);
+
+ return provider(async (request, ...context) => {
+ await finish(request, options.request, ...context);
+ const response = await framework(request);
+ await finish(response, options.response, ...context);
+ return response;
+ });
+};
diff --git a/package-lock.json b/package-lock.json
index 6948278..02573c6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,7 +15,8 @@
"method-override": "^3.0.0",
"mongodb": "^6.5.0",
"mongoose": "^8.3.2",
- "morgan": "^1.10.0"
+ "morgan": "^1.10.0",
+ "serverless-http": "^3.2.0"
}
},
"node_modules/@mongodb-js/saslprep": {
@@ -999,6 +1000,15 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/serverless-http": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/serverless-http/-/serverless-http-3.2.0.tgz",
+ "integrity": "sha512-QvSyZXljRLIGqwcJ4xsKJXwkZnAVkse1OajepxfjkBXV0BMvRS5R546Z4kCBI8IygDzkQY0foNPC/rnipaE9pQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0"
+ }
+ },
"node_modules/set-function-length": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
diff --git a/package.json b/package.json
index d6df403..8b5ac3e 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,6 @@
"mongodb": "^6.5.0",
"mongoose": "^8.3.2",
"morgan": "^1.10.0",
- "serverless-http": "^3.0.0"
+ "serverless-http": "^3.2.0"
}
}
From 324081052f71ef99796045329424a667a409dbd7 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 4 Nov 2025 18:54:07 +0000
Subject: [PATCH 4/5] Add .gitignore and remove node_modules from git tracking
Co-authored-by: Faizal-Malek <94194196+Faizal-Malek@users.noreply.github.com>
---
.gitignore | 8 +
node_modules/.package-lock.json | 1143 -----------------
node_modules/serverless-http/LICENSE.txt | 33 -
node_modules/serverless-http/README.md | 117 --
node_modules/serverless-http/lib/finish.js | 42 -
.../lib/framework/get-framework.js | 79 --
.../lib/provider/aws/clean-up-event.js | 98 --
.../lib/provider/aws/create-request.js | 110 --
.../lib/provider/aws/format-response.js | 45 -
.../serverless-http/lib/provider/aws/index.js | 15 -
.../lib/provider/aws/is-binary.js | 42 -
.../lib/provider/aws/sanitize-headers.js | 21 -
.../lib/provider/azure/clean-up-request.js | 41 -
.../lib/provider/azure/create-request.js | 45 -
.../lib/provider/azure/format-response.js | 18 -
.../lib/provider/azure/index.js | 13 -
.../lib/provider/azure/is-binary.js | 42 -
.../lib/provider/azure/sanitize-headers.js | 23 -
.../lib/provider/azure/set-cookie.json | 1 -
.../lib/provider/get-provider.js | 17 -
node_modules/serverless-http/lib/request.js | 38 -
node_modules/serverless-http/lib/response.js | 135 --
node_modules/serverless-http/package.json | 93 --
.../serverless-http/serverless-http.d.ts | 41 -
.../serverless-http/serverless-http.js | 23 -
25 files changed, 8 insertions(+), 2275 deletions(-)
create mode 100644 .gitignore
delete mode 100644 node_modules/.package-lock.json
delete mode 100644 node_modules/serverless-http/LICENSE.txt
delete mode 100644 node_modules/serverless-http/README.md
delete mode 100644 node_modules/serverless-http/lib/finish.js
delete mode 100644 node_modules/serverless-http/lib/framework/get-framework.js
delete mode 100644 node_modules/serverless-http/lib/provider/aws/clean-up-event.js
delete mode 100644 node_modules/serverless-http/lib/provider/aws/create-request.js
delete mode 100644 node_modules/serverless-http/lib/provider/aws/format-response.js
delete mode 100644 node_modules/serverless-http/lib/provider/aws/index.js
delete mode 100644 node_modules/serverless-http/lib/provider/aws/is-binary.js
delete mode 100644 node_modules/serverless-http/lib/provider/aws/sanitize-headers.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/clean-up-request.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/create-request.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/format-response.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/index.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/is-binary.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/sanitize-headers.js
delete mode 100644 node_modules/serverless-http/lib/provider/azure/set-cookie.json
delete mode 100644 node_modules/serverless-http/lib/provider/get-provider.js
delete mode 100644 node_modules/serverless-http/lib/request.js
delete mode 100644 node_modules/serverless-http/lib/response.js
delete mode 100644 node_modules/serverless-http/package.json
delete mode 100644 node_modules/serverless-http/serverless-http.d.ts
delete mode 100644 node_modules/serverless-http/serverless-http.js
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0213448
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+node_modules/
+.DS_Store
+.env
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.vercel
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
deleted file mode 100644
index baf7ad6..0000000
--- a/node_modules/.package-lock.json
+++ /dev/null
@@ -1,1143 +0,0 @@
-{
- "name": "crash-course",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "node_modules/@mongodb-js/saslprep": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz",
- "integrity": "sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==",
- "dependencies": {
- "sparse-bitfield": "^3.0.3"
- }
- },
- "node_modules/@types/webidl-conversions": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",
- "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA=="
- },
- "node_modules/@types/whatwg-url": {
- "version": "11.0.4",
- "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.4.tgz",
- "integrity": "sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==",
- "dependencies": {
- "@types/webidl-conversions": "*"
- }
- },
- "node_modules/accepts": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
- "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
- "dependencies": {
- "mime-types": "~2.1.34",
- "negotiator": "0.6.3"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/array-flatten": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
- "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
- },
- "node_modules/async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg=="
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
- },
- "node_modules/basic-auth": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
- "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
- "dependencies": {
- "safe-buffer": "5.1.2"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/basic-auth/node_modules/safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
- },
- "node_modules/body-parser": {
- "version": "1.20.2",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
- "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==",
- "dependencies": {
- "bytes": "3.1.2",
- "content-type": "~1.0.5",
- "debug": "2.6.9",
- "depd": "2.0.0",
- "destroy": "1.2.0",
- "http-errors": "2.0.0",
- "iconv-lite": "0.4.24",
- "on-finished": "2.4.1",
- "qs": "6.11.0",
- "raw-body": "2.5.2",
- "type-is": "~1.6.18",
- "unpipe": "1.0.0"
- },
- "engines": {
- "node": ">= 0.8",
- "npm": "1.2.8000 || >= 1.4.16"
- }
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/bson": {
- "version": "6.6.0",
- "resolved": "https://registry.npmjs.org/bson/-/bson-6.6.0.tgz",
- "integrity": "sha512-BVINv2SgcMjL4oYbBuCQTpE3/VKOSxrOA8Cj/wQP7izSzlBGVomdm+TcUd0Pzy0ytLSSDweCKQ6X3f5veM5LQA==",
- "engines": {
- "node": ">=16.20.1"
- }
- },
- "node_modules/bytes": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
- "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/call-bind": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
- "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
- "dependencies": {
- "es-define-property": "^1.0.0",
- "es-errors": "^1.3.0",
- "function-bind": "^1.1.2",
- "get-intrinsic": "^1.2.4",
- "set-function-length": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
- },
- "node_modules/content-disposition": {
- "version": "0.5.4",
- "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
- "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
- "dependencies": {
- "safe-buffer": "5.2.1"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/content-type": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
- "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/cookie": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
- "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/cookie-signature": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
- "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
- },
- "node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/define-data-property": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
- "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
- "dependencies": {
- "es-define-property": "^1.0.0",
- "es-errors": "^1.3.0",
- "gopd": "^1.0.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/depd": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
- "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/destroy": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
- "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
- "engines": {
- "node": ">= 0.8",
- "npm": "1.2.8000 || >= 1.4.16"
- }
- },
- "node_modules/ee-first": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
- "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
- },
- "node_modules/ejs": {
- "version": "3.1.10",
- "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
- "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
- "dependencies": {
- "jake": "^10.8.5"
- },
- "bin": {
- "ejs": "bin/cli.js"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/encodeurl": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/es-define-property": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
- "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
- "dependencies": {
- "get-intrinsic": "^1.2.4"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/es-errors": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
- "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/escape-html": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
- "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
- },
- "node_modules/etag": {
- "version": "1.8.1",
- "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
- "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/express": {
- "version": "4.19.2",
- "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
- "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
- "dependencies": {
- "accepts": "~1.3.8",
- "array-flatten": "1.1.1",
- "body-parser": "1.20.2",
- "content-disposition": "0.5.4",
- "content-type": "~1.0.4",
- "cookie": "0.6.0",
- "cookie-signature": "1.0.6",
- "debug": "2.6.9",
- "depd": "2.0.0",
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "etag": "~1.8.1",
- "finalhandler": "1.2.0",
- "fresh": "0.5.2",
- "http-errors": "2.0.0",
- "merge-descriptors": "1.0.1",
- "methods": "~1.1.2",
- "on-finished": "2.4.1",
- "parseurl": "~1.3.3",
- "path-to-regexp": "0.1.7",
- "proxy-addr": "~2.0.7",
- "qs": "6.11.0",
- "range-parser": "~1.2.1",
- "safe-buffer": "5.2.1",
- "send": "0.18.0",
- "serve-static": "1.15.0",
- "setprototypeof": "1.2.0",
- "statuses": "2.0.1",
- "type-is": "~1.6.18",
- "utils-merge": "1.0.1",
- "vary": "~1.1.2"
- },
- "engines": {
- "node": ">= 0.10.0"
- }
- },
- "node_modules/filelist": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",
- "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==",
- "dependencies": {
- "minimatch": "^5.0.1"
- }
- },
- "node_modules/filelist/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/filelist/node_modules/minimatch": {
- "version": "5.1.6",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
- "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/finalhandler": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
- "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
- "dependencies": {
- "debug": "2.6.9",
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "on-finished": "2.4.1",
- "parseurl": "~1.3.3",
- "statuses": "2.0.1",
- "unpipe": "~1.0.0"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/forwarded": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
- "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/fresh": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
- "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/get-intrinsic": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
- "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
- "dependencies": {
- "es-errors": "^1.3.0",
- "function-bind": "^1.1.2",
- "has-proto": "^1.0.1",
- "has-symbols": "^1.0.3",
- "hasown": "^2.0.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/gopd": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
- "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
- "dependencies": {
- "get-intrinsic": "^1.1.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/has-property-descriptors": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
- "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
- "dependencies": {
- "es-define-property": "^1.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/has-proto": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
- "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/has-symbols": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
- "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
- "dependencies": {
- "function-bind": "^1.1.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/http-errors": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
- "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
- "dependencies": {
- "depd": "2.0.0",
- "inherits": "2.0.4",
- "setprototypeof": "1.2.0",
- "statuses": "2.0.1",
- "toidentifier": "1.0.1"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/iconv-lite": {
- "version": "0.4.24",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
- "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
- "dependencies": {
- "safer-buffer": ">= 2.1.2 < 3"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "node_modules/ipaddr.js": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
- "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/jake": {
- "version": "10.8.7",
- "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz",
- "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==",
- "dependencies": {
- "async": "^3.2.3",
- "chalk": "^4.0.2",
- "filelist": "^1.0.4",
- "minimatch": "^3.1.2"
- },
- "bin": {
- "jake": "bin/cli.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/kareem": {
- "version": "2.6.3",
- "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz",
- "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==",
- "engines": {
- "node": ">=12.0.0"
- }
- },
- "node_modules/lodash": {
- "version": "4.17.21",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
- },
- "node_modules/media-typer": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
- "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/memory-pager": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
- "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg=="
- },
- "node_modules/merge-descriptors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
- },
- "node_modules/method-override": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/method-override/-/method-override-3.0.0.tgz",
- "integrity": "sha512-IJ2NNN/mSl9w3kzWB92rcdHpz+HjkxhDJWNDBqSlas+zQdP8wBiJzITPg08M/k2uVvMow7Sk41atndNtt/PHSA==",
- "dependencies": {
- "debug": "3.1.0",
- "methods": "~1.1.2",
- "parseurl": "~1.3.2",
- "vary": "~1.1.2"
- },
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/method-override/node_modules/debug": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
- "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/methods": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
- "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/mime": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
- "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
- "bin": {
- "mime": "cli.js"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
- "dependencies": {
- "mime-db": "1.52.0"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/mongodb": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz",
- "integrity": "sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA==",
- "dependencies": {
- "@mongodb-js/saslprep": "^1.1.5",
- "bson": "^6.4.0",
- "mongodb-connection-string-url": "^3.0.0"
- },
- "engines": {
- "node": ">=16.20.1"
- },
- "peerDependencies": {
- "@aws-sdk/credential-providers": "^3.188.0",
- "@mongodb-js/zstd": "^1.1.0",
- "gcp-metadata": "^5.2.0",
- "kerberos": "^2.0.1",
- "mongodb-client-encryption": ">=6.0.0 <7",
- "snappy": "^7.2.2",
- "socks": "^2.7.1"
- },
- "peerDependenciesMeta": {
- "@aws-sdk/credential-providers": {
- "optional": true
- },
- "@mongodb-js/zstd": {
- "optional": true
- },
- "gcp-metadata": {
- "optional": true
- },
- "kerberos": {
- "optional": true
- },
- "mongodb-client-encryption": {
- "optional": true
- },
- "snappy": {
- "optional": true
- },
- "socks": {
- "optional": true
- }
- }
- },
- "node_modules/mongodb-connection-string-url": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz",
- "integrity": "sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==",
- "dependencies": {
- "@types/whatwg-url": "^11.0.2",
- "whatwg-url": "^13.0.0"
- }
- },
- "node_modules/mongoose": {
- "version": "8.3.2",
- "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.2.tgz",
- "integrity": "sha512-3JcpDjFI25cF/3xpu+4+9nM0lURQTNLcP86X83+LvuICdn453QQLmhSrUr2IPM/ffLiDE9KPl9slNb2s0hZPpg==",
- "dependencies": {
- "bson": "^6.5.0",
- "kareem": "2.6.3",
- "mongodb": "6.5.0",
- "mpath": "0.9.0",
- "mquery": "5.0.0",
- "ms": "2.1.3",
- "sift": "16.0.1"
- },
- "engines": {
- "node": ">=16.20.1"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/mongoose"
- }
- },
- "node_modules/mongoose/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
- },
- "node_modules/morgan": {
- "version": "1.10.0",
- "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
- "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==",
- "dependencies": {
- "basic-auth": "~2.0.1",
- "debug": "2.6.9",
- "depd": "~2.0.0",
- "on-finished": "~2.3.0",
- "on-headers": "~1.0.2"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/morgan/node_modules/on-finished": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
- "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==",
- "dependencies": {
- "ee-first": "1.1.1"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/mpath": {
- "version": "0.9.0",
- "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz",
- "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==",
- "engines": {
- "node": ">=4.0.0"
- }
- },
- "node_modules/mquery": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz",
- "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==",
- "dependencies": {
- "debug": "4.x"
- },
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/mquery/node_modules/debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/mquery/node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
- },
- "node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
- },
- "node_modules/negotiator": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
- "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/object-inspect": {
- "version": "1.13.1",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
- "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/on-finished": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
- "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
- "dependencies": {
- "ee-first": "1.1.1"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/on-headers": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
- "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/parseurl": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
- "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/path-to-regexp": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
- },
- "node_modules/proxy-addr": {
- "version": "2.0.7",
- "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
- "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
- "dependencies": {
- "forwarded": "0.2.0",
- "ipaddr.js": "1.9.1"
- },
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/punycode": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
- "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/qs": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
- "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
- "dependencies": {
- "side-channel": "^1.0.4"
- },
- "engines": {
- "node": ">=0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/range-parser": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
- "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/raw-body": {
- "version": "2.5.2",
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
- "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
- "dependencies": {
- "bytes": "3.1.2",
- "http-errors": "2.0.0",
- "iconv-lite": "0.4.24",
- "unpipe": "1.0.0"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/safer-buffer": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
- },
- "node_modules/send": {
- "version": "0.18.0",
- "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
- "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
- "dependencies": {
- "debug": "2.6.9",
- "depd": "2.0.0",
- "destroy": "1.2.0",
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "etag": "~1.8.1",
- "fresh": "0.5.2",
- "http-errors": "2.0.0",
- "mime": "1.6.0",
- "ms": "2.1.3",
- "on-finished": "2.4.1",
- "range-parser": "~1.2.1",
- "statuses": "2.0.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/send/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
- },
- "node_modules/serve-static": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
- "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
- "dependencies": {
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "parseurl": "~1.3.3",
- "send": "0.18.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/serverless-http": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/serverless-http/-/serverless-http-3.2.0.tgz",
- "integrity": "sha512-QvSyZXljRLIGqwcJ4xsKJXwkZnAVkse1OajepxfjkBXV0BMvRS5R546Z4kCBI8IygDzkQY0foNPC/rnipaE9pQ==",
- "license": "MIT",
- "engines": {
- "node": ">=12.0"
- }
- },
- "node_modules/set-function-length": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
- "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
- "dependencies": {
- "define-data-property": "^1.1.4",
- "es-errors": "^1.3.0",
- "function-bind": "^1.1.2",
- "get-intrinsic": "^1.2.4",
- "gopd": "^1.0.1",
- "has-property-descriptors": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/setprototypeof": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
- "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
- },
- "node_modules/side-channel": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
- "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
- "dependencies": {
- "call-bind": "^1.0.7",
- "es-errors": "^1.3.0",
- "get-intrinsic": "^1.2.4",
- "object-inspect": "^1.13.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/sift": {
- "version": "16.0.1",
- "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz",
- "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ=="
- },
- "node_modules/sparse-bitfield": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
- "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
- "dependencies": {
- "memory-pager": "^1.0.2"
- }
- },
- "node_modules/statuses": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
- "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/toidentifier": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
- "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
- "engines": {
- "node": ">=0.6"
- }
- },
- "node_modules/tr46": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz",
- "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==",
- "dependencies": {
- "punycode": "^2.3.0"
- },
- "engines": {
- "node": ">=14"
- }
- },
- "node_modules/type-is": {
- "version": "1.6.18",
- "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
- "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
- "dependencies": {
- "media-typer": "0.3.0",
- "mime-types": "~2.1.24"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/unpipe": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
- "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/utils-merge": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
- "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
- "engines": {
- "node": ">= 0.4.0"
- }
- },
- "node_modules/vary": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
- "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/webidl-conversions": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
- "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/whatwg-url": {
- "version": "13.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz",
- "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==",
- "dependencies": {
- "tr46": "^4.1.1",
- "webidl-conversions": "^7.0.0"
- },
- "engines": {
- "node": ">=16"
- }
- }
- }
-}
diff --git a/node_modules/serverless-http/LICENSE.txt b/node_modules/serverless-http/LICENSE.txt
deleted file mode 100644
index 5b1c365..0000000
--- a/node_modules/serverless-http/LICENSE.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Doug Moscrop
-
-The following license applies to all parts of this software except as
-documented below:
-
-====
-
-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.
-
-====
-
-All files located in the node_modules and external directories are
-externally maintained libraries used by this software which have their
-own licenses; we recommend you read them, as their terms may differ from
-the terms above.
diff --git a/node_modules/serverless-http/README.md b/node_modules/serverless-http/README.md
deleted file mode 100644
index ed3fc2d..0000000
--- a/node_modules/serverless-http/README.md
+++ /dev/null
@@ -1,117 +0,0 @@
-# serverless-http
-
-[](https://travis-ci.org/dougmoscrop/serverless-http)
-
-## Description
-
-This module allows you to 'wrap' your API for serverless use. No HTTP server, no ports or sockets. Just your code in the same execution pipeline you are already familiar with.
-
-## Sponsors
-
-Thank you to Upstash for reaching out to sponsor this project!
-
-
-
-
-
-
-
-
-Upstash: Serverless Database for Redis
-
-
- Serverless Redis with global replication and durable storage
- Price scales to zero with per request pricing
- Built-in REST API designed for serverless and edge functions
-
-
-[Start for free in 30 seconds!](https://upstash.com/?utm_source=serverless-http)
-
-
-
-
-## Support
-
-### Supported Frameworks
-(* Experimental)
-
-* Node (http.createServer)
-* Connect
-* Express
-* Koa
-* Restana
-* Sails *
-* Hapi *
-* Fastify *
-* Restify *
-* Polka *
-* Loopback *
-
-### Supported Providers
-
-* AWS
-* Azure (Experimental, untested, probably outdated)
-
-## Examples
-
-Please check the `examples` folder!
-
-### Usage example using the Koa framework
-
-```javascript
-const serverless = require('serverless-http');
-const Koa = require('koa'); // or any supported framework
-
-const app = new Koa();
-
-app.use(/* register your middleware as normal */);
-
-// this is it!
-module.exports.handler = serverless(app);
-
-// or as a promise
-const handler = serverless(app);
-module.exports.handler = async (event, context) => {
- // you can do other things here
- const result = await handler(event, context);
- // and here
- return result;
-};
-```
-
-### Usage example using the Express framework with Azure
-
-```javascript
-
-const serverless = require('serverless-http');
-const express = require('express');
-
-const app = express();
-
-app.use(/* register your middleware as normal */);
-
-const handler = serverless(app, { provider: 'azure' });
-module.exports.funcName = async (context, req) => {
- context.res = await handler(context, req);
-}
-
-```
-
-### Other examples
-[json-server-less-λ](https://github.com/pharindoko/json-server-less-lambda) - using serverless-http with json-server and serverless framework in AWS
-
-
-## Limitations
-
-Your code is running in a serverless environment. You cannot rely on your server being 'up' in the sense that you can/should not use in-memory sessions, web sockets, etc. You are also subject to provider specific restrictions on request/response size, duration, etc.
-
-> Think of this as a familiar way of expressing your app logic, *not* trying to make serverless do something it cannot.
-
-## Contributing
-
-Pull requests are welcome! Especially test scenarios for different situations and configurations.
-
-## Further Reading
-
-Here are some [more detailed examples](./docs/EXAMPLES.md) and [advanced configuration options](./docs/ADVANCED.md) as well as [provider-specific documentation](./docs/PROVIDERS.md)
-
diff --git a/node_modules/serverless-http/lib/finish.js b/node_modules/serverless-http/lib/finish.js
deleted file mode 100644
index 74efc29..0000000
--- a/node_modules/serverless-http/lib/finish.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-module.exports = async function finish(item, transform, ...details) {
- await new Promise((resolve, reject) => {
- if (item.finished || item.complete) {
- resolve();
- return;
- }
-
- let finished = false;
-
- function done(err) {
- if (finished) {
- return;
- }
-
- finished = true;
-
- item.removeListener('error', done);
- item.removeListener('end', done);
- item.removeListener('finish', done);
-
- if (err) {
- reject(err);
- } else {
- resolve();
- }
- }
-
- item.once('error', done);
- item.once('end', done);
- item.once('finish', done);
- });
-
- if (typeof transform === 'function') {
- await transform(item, ...details);
- } else if (typeof transform === 'object' && transform !== null) {
- Object.assign(item, transform);
- }
-
- return item;
-};
diff --git a/node_modules/serverless-http/lib/framework/get-framework.js b/node_modules/serverless-http/lib/framework/get-framework.js
deleted file mode 100644
index fa06b7e..0000000
--- a/node_modules/serverless-http/lib/framework/get-framework.js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict';
-
-const http = require('http')
-const Response = require('../response');
-
-function common(cb) {
- return request => {
- const response = new Response(request);
-
- cb(request, response);
-
- return response;
- };
-}
-
-module.exports = function getFramework(app) {
- if (app instanceof http.Server) {
- return request => {
- const response = new Response(request);
- app.emit('request', request, response)
- return response
- }
- }
-
- if (typeof app.callback === 'function') {
- return common(app.callback());
- }
-
- if (typeof app.handle === 'function') {
- return common((request, response) => {
- app.handle(request, response);
- });
- }
-
- if (typeof app.handler === 'function') {
- return common((request, response) => {
- app.handler(request, response);
- });
- }
-
- if (typeof app._onRequest === 'function') {
- return common((request, response) => {
- app._onRequest(request, response);
- });
- }
-
- if (typeof app === 'function') {
- return common(app);
- }
-
- if (app.router && typeof app.router.route == 'function') {
- return common((req, res) => {
- const { url, method, headers, body } = req;
- app.router.route({ url, method, headers, body }, res);
- });
- }
-
- if (app._core && typeof app._core._dispatch === 'function') {
- return common(app._core._dispatch({
- app
- }));
- }
-
- if (typeof app.inject === 'function') {
- return async request => {
- const { method, url, headers, body } = request;
-
- const res = await app.inject({ method, url, headers, payload: body })
-
- return Response.from(res);
- };
- }
-
- if (typeof app.main === 'function') {
- return common(app.main);
- }
-
- throw new Error('Unsupported framework');
-};
diff --git a/node_modules/serverless-http/lib/provider/aws/clean-up-event.js b/node_modules/serverless-http/lib/provider/aws/clean-up-event.js
deleted file mode 100644
index 23e0811..0000000
--- a/node_modules/serverless-http/lib/provider/aws/clean-up-event.js
+++ /dev/null
@@ -1,98 +0,0 @@
-'use strict';
-
-function removeBasePath(path = '/', basePath) {
- if (basePath) {
- const basePathIndex = path.indexOf(basePath);
-
- if (basePathIndex > -1) {
- return path.substr(basePathIndex + basePath.length) || '/';
- }
- }
-
- return path;
-}
-
-function isString(value)
-{
- return (typeof value === 'string' || value instanceof String);
-}
-
-// ELBs will pass spaces as + symbols, and decodeURIComponent doesn't decode + symbols. So we need to convert them into something it can convert
-function specialDecodeURIComponent(value)
-{
- if(!isString(value))
- {
- return value;
- }
-
- let decoded;
- try {
- decoded = decodeURIComponent(value.replace(/[+]/g, "%20"));
- } catch (err) {
- decoded = value.replace(/[+]/g, "%20");
- }
-
- return decoded;
-}
-
-function recursiveURLDecode(value) {
-
- if (isString(value)) {
- return specialDecodeURIComponent(value);
- } else if (Array.isArray(value)) {
-
- const decodedArray = [];
-
- for (let index in value) {
- decodedArray.push(recursiveURLDecode(value[index]));
- }
-
- return decodedArray;
-
- } else if (value instanceof Object) {
-
- const decodedObject = {};
-
- for (let key of Object.keys(value)) {
- decodedObject[specialDecodeURIComponent(key)] = recursiveURLDecode(value[key]);
- }
-
- return decodedObject;
- }
-
- return value;
-}
-
-module.exports = function cleanupEvent(evt, options) {
- const event = evt || {};
-
- event.requestContext = event.requestContext || {};
- event.body = event.body || '';
- event.headers = event.headers || {};
-
- // Events coming from AWS Elastic Load Balancers do not automatically urldecode query parameters (unlike API Gateway). So we need to check for that and automatically decode them
- // to normalize the request between the two.
- if ('elb' in event.requestContext) {
-
- if (event.multiValueQueryStringParameters) {
- event.multiValueQueryStringParameters = recursiveURLDecode(event.multiValueQueryStringParameters);
- }
-
- if (event.queryStringParameters) {
- event.queryStringParameters = recursiveURLDecode(event.queryStringParameters);
- }
-
- }
-
- if (event.version === '2.0') {
- event.requestContext.authorizer = event.requestContext.authorizer || {};
- event.requestContext.http.method = event.requestContext.http.method || 'GET';
- event.rawPath = removeBasePath(event.requestPath || event.rawPath, options.basePath);
- } else {
- event.requestContext.identity = event.requestContext.identity || {};
- event.httpMethod = event.httpMethod || 'GET';
- event.path = removeBasePath(event.requestPath || event.path, options.basePath);
- }
-
- return event;
-};
diff --git a/node_modules/serverless-http/lib/provider/aws/create-request.js b/node_modules/serverless-http/lib/provider/aws/create-request.js
deleted file mode 100644
index f2f76c5..0000000
--- a/node_modules/serverless-http/lib/provider/aws/create-request.js
+++ /dev/null
@@ -1,110 +0,0 @@
-'use strict';
-
-const URL = require('url');
-
-const Request = require('../../request');
-
-function requestMethod(event) {
- if (event.version === '2.0') {
- return event.requestContext.http.method;
- }
- return event.httpMethod;
-}
-
-function requestRemoteAddress(event) {
- if (event.version === '2.0') {
- return event.requestContext.http.sourceIp;
- }
- return event.requestContext.identity.sourceIp;
-}
-
-function requestHeaders(event) {
- const initialHeader =
- event.version === '2.0' && Array.isArray(event.cookies)
- ? { cookie: event.cookies.join('; ') }
- : {};
-
- if (event.multiValueHeaders) {
- Object.keys(event.multiValueHeaders).reduce((headers, key) => {
- headers[key.toLowerCase()] = event.multiValueHeaders[key].join(', ');
- return headers;
- }, initialHeader);
- }
-
- return Object.keys(event.headers).reduce((headers, key) => {
- headers[key.toLowerCase()] = event.headers[key];
- return headers;
- }, initialHeader);
-}
-
-function requestBody(event) {
- const type = typeof event.body;
-
- if (Buffer.isBuffer(event.body)) {
- return event.body;
- } else if (type === 'string') {
- return Buffer.from(event.body, event.isBase64Encoded ? 'base64' : 'utf8');
- } else if (type === 'object') {
- return Buffer.from(JSON.stringify(event.body));
- }
-
- throw new Error(`Unexpected event.body type: ${typeof event.body}`);
-}
-
-function requestUrl(event) {
- if (event.version === '2.0') {
- return URL.format({
- pathname: event.rawPath,
- search: event.rawQueryString,
- });
- }
- // Normalize all query params into a single query string.
- const query = event.multiValueQueryStringParameters || {};
- if (event.queryStringParameters) {
- Object.keys(event.queryStringParameters).forEach((key) => {
- if (Array.isArray(query[key])) {
- if (!query[key].includes(event.queryStringParameters[key])) {
- query[key].push(event.queryStringParameters[key]);
- }
- } else {
- query[key] = [event.queryStringParameters[key]];
- }
- });
- }
- return URL.format({
- pathname: event.path,
- query: query,
- });
-}
-
-module.exports = (event, context, options) => {
- const method = requestMethod(event);
- const remoteAddress = requestRemoteAddress(event);
- const headers = requestHeaders(event);
- const body = requestBody(event);
- const url = requestUrl(event);
-
- if (typeof options.requestId === 'string' && options.requestId.length > 0) {
- const header = options.requestId.toLowerCase();
- const requestId = headers[header] || event.requestContext.requestId;
- if (requestId) {
- headers[header] = requestId;
- }
- }
-
- const req = new Request({
- method,
- headers,
- body,
- remoteAddress,
- url,
- });
-
- req.requestContext = event.requestContext;
- req.apiGateway = {
- event,
- context,
- };
-
- return req;
-};
diff --git a/node_modules/serverless-http/lib/provider/aws/format-response.js b/node_modules/serverless-http/lib/provider/aws/format-response.js
deleted file mode 100644
index 90b5351..0000000
--- a/node_modules/serverless-http/lib/provider/aws/format-response.js
+++ /dev/null
@@ -1,45 +0,0 @@
-'use strict';
-
-const isBinary = require('./is-binary');
-const Response = require('../../response');
-const sanitizeHeaders = require('./sanitize-headers');
-
-module.exports = (event, response, options) => {
- const { statusCode } = response;
- const {headers, multiValueHeaders } = sanitizeHeaders(Response.headers(response));
-
- let cookies = [];
-
- if (multiValueHeaders['set-cookie']) {
- cookies = multiValueHeaders['set-cookie'];
- }
-
- const isBase64Encoded = isBinary(headers, options);
- const encoding = isBase64Encoded ? 'base64' : 'utf8';
- let body = Response.body(response).toString(encoding);
-
- if (headers['transfer-encoding'] === 'chunked' || response.chunkedEncoding) {
- const raw = Response.body(response).toString().split('\r\n');
- const parsed = [];
- for (let i = 0; i < raw.length; i +=2) {
- const size = parseInt(raw[i], 16);
- const value = raw[i + 1];
- if (value) {
- parsed.push(value.substring(0, size));
- }
- }
- body = parsed.join('')
- }
-
- let formattedResponse = { statusCode, headers, isBase64Encoded, body };
-
- if (event.version === '2.0' && cookies.length) {
- formattedResponse['cookies'] = cookies;
- }
-
- if ((!event.version || event.version === '1.0') && Object.keys(multiValueHeaders).length) {
- formattedResponse['multiValueHeaders'] = multiValueHeaders;
- }
-
- return formattedResponse;
-};
diff --git a/node_modules/serverless-http/lib/provider/aws/index.js b/node_modules/serverless-http/lib/provider/aws/index.js
deleted file mode 100644
index 805e911..0000000
--- a/node_modules/serverless-http/lib/provider/aws/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const cleanUpEvent = require('./clean-up-event');
-
-const createRequest = require('./create-request');
-const formatResponse = require('./format-response');
-
-module.exports = options => {
- return getResponse => async (event_, context = {}) => {
- const event = cleanUpEvent(event_, options);
-
- const request = createRequest(event, context, options);
- const response = await getResponse(request, event, context);
-
- return formatResponse(event, response, options);
- };
-};
diff --git a/node_modules/serverless-http/lib/provider/aws/is-binary.js b/node_modules/serverless-http/lib/provider/aws/is-binary.js
deleted file mode 100644
index 59a3cdf..0000000
--- a/node_modules/serverless-http/lib/provider/aws/is-binary.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-const BINARY_ENCODINGS = ['gzip', 'deflate', 'br'];
-const BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || '').split(',');
-
-function isBinaryEncoding(headers) {
- const contentEncoding = headers['content-encoding'];
-
- if (typeof contentEncoding === 'string') {
- return contentEncoding.split(',').some(value =>
- BINARY_ENCODINGS.some(binaryEncoding => value.indexOf(binaryEncoding) !== -1)
- );
- }
-}
-
-function isBinaryContent(headers, options) {
- const contentTypes = [].concat(options.binary
- ? options.binary
- : BINARY_CONTENT_TYPES
- ).map(candidate =>
- new RegExp(`^${candidate.replace(/\*/g, '.*')}$`)
- );
-
- const contentType = (headers['content-type'] || '').split(';')[0];
- return !!contentType && contentTypes.some(candidate => candidate.test(contentType));
-}
-
-module.exports = function isBinary(headers, options) {
- if (options.binary === false) {
- return false;
- }
-
- if (options.binary === true) {
- return true
- }
-
- if (typeof options.binary === 'function') {
- return options.binary(headers);
- }
-
- return isBinaryEncoding(headers) || isBinaryContent(headers, options);
-};
diff --git a/node_modules/serverless-http/lib/provider/aws/sanitize-headers.js b/node_modules/serverless-http/lib/provider/aws/sanitize-headers.js
deleted file mode 100644
index 4b81082..0000000
--- a/node_modules/serverless-http/lib/provider/aws/sanitize-headers.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-module.exports = function sanitizeHeaders(headers) {
- return Object.keys(headers).reduce((memo, key) => {
- const value = headers[key];
-
- if (Array.isArray(value)) {
- memo.multiValueHeaders[key] = value;
- if (key.toLowerCase() !== 'set-cookie') {
- memo.headers[key] = value.join(", ");
- }
- } else {
- memo.headers[key] = value == null ? '' : value.toString();
- }
-
- return memo;
- }, {
- headers: {},
- multiValueHeaders: {}
- });
-};
diff --git a/node_modules/serverless-http/lib/provider/azure/clean-up-request.js b/node_modules/serverless-http/lib/provider/azure/clean-up-request.js
deleted file mode 100644
index 98f5084..0000000
--- a/node_modules/serverless-http/lib/provider/azure/clean-up-request.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-
-function getUrl({ requestPath, url }) {
- if (requestPath) {
- return requestPath;
- }
-
- return typeof url === 'string' ? url : '/';
-}
-
-function getRequestContext(request) {
- const requestContext = {};
- requestContext.identity = {};
- const forwardedIp = request.headers['x-forwarded-for'];
- const clientIp = request.headers['client-ip'];
- const ip = forwardedIp ? forwardedIp : (clientIp ? clientIp : '');
- if (ip) {
- requestContext.identity.sourceIp = ip.split(':')[0];
- }
- return requestContext;
-}
-
-module.exports = function cleanupRequest(req, options) {
- const request = req || {};
-
- request.requestContext = getRequestContext(req);
- request.method = request.method || 'GET';
- request.url = getUrl(request);
- request.body = request.body || '';
- request.headers = request.headers || {};
-
- if (options.basePath) {
- const basePathIndex = request.url.indexOf(options.basePath);
-
- if (basePathIndex > -1) {
- request.url = request.url.substr(basePathIndex + options.basePath.length);
- }
- }
-
- return request;
-}
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/azure/create-request.js b/node_modules/serverless-http/lib/provider/azure/create-request.js
deleted file mode 100644
index de6f34b..0000000
--- a/node_modules/serverless-http/lib/provider/azure/create-request.js
+++ /dev/null
@@ -1,45 +0,0 @@
-'use strict';
-
-const url = require('url');
-
-const Request = require('../../request');
-
-function requestHeaders(request) {
- return Object.keys(request.headers).reduce((headers, key) => {
- headers[key.toLowerCase()] = request.headers[key];
- return headers;
- }, {});
-}
-
-function requestBody(request) {
- const type = typeof request.rawBody;
-
- if (Buffer.isBuffer(request.rawBody)) {
- return request.rawBody;
- } else if (type === 'string') {
- return Buffer.from(request.rawBody, 'utf8');
- } else if (type === 'object') {
- return Buffer.from(JSON.stringify(request.rawBody));
- }
-
- throw new Error(`Unexpected request.body type: ${typeof request.rawBody}`);
-}
-
-module.exports = (request) => {
- const method = request.method;
- const query = request.query;
- const headers = requestHeaders(request);
- const body = requestBody(request);
-
- const req = new Request({
- method,
- headers,
- body,
- url: url.format({
- pathname: request.url,
- query
- })
- });
- req.requestContext = request.requestContext;
- return req;
-}
diff --git a/node_modules/serverless-http/lib/provider/azure/format-response.js b/node_modules/serverless-http/lib/provider/azure/format-response.js
deleted file mode 100644
index 0f0e1e6..0000000
--- a/node_modules/serverless-http/lib/provider/azure/format-response.js
+++ /dev/null
@@ -1,18 +0,0 @@
-const isBinary = require('./is-binary');
-const Response = require('../../response');
-const sanitizeHeaders = require('./sanitize-headers');
-
-module.exports = (response, options) => {
- const { statusCode } = response;
- const headers = sanitizeHeaders(Response.headers(response));
-
- if (headers['transfer-encoding'] === 'chunked' || response.chunkedEncoding) {
- throw new Error('chunked encoding not supported');
- }
-
- const isBase64Encoded = isBinary(headers, options);
- const encoding = isBase64Encoded ? 'base64' : 'utf8';
- const body = Response.body(response).toString(encoding);
-
- return { status: statusCode, headers, isBase64Encoded, body };
-}
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/azure/index.js b/node_modules/serverless-http/lib/provider/azure/index.js
deleted file mode 100644
index 2f410f0..0000000
--- a/node_modules/serverless-http/lib/provider/azure/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const cleanupRequest = require('./clean-up-request');
-const createRequest = require('./create-request');
-const formatResponse = require('./format-response');
-
-module.exports = options => {
- return getResponse => async (context, req) => {
- const event = cleanupRequest(req, options);
- const request = createRequest(event, options);
- const response = await getResponse(request, context, event);
- context.log(response);
- return formatResponse(response, options);
- }
-};
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/azure/is-binary.js b/node_modules/serverless-http/lib/provider/azure/is-binary.js
deleted file mode 100644
index 59a3cdf..0000000
--- a/node_modules/serverless-http/lib/provider/azure/is-binary.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-const BINARY_ENCODINGS = ['gzip', 'deflate', 'br'];
-const BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || '').split(',');
-
-function isBinaryEncoding(headers) {
- const contentEncoding = headers['content-encoding'];
-
- if (typeof contentEncoding === 'string') {
- return contentEncoding.split(',').some(value =>
- BINARY_ENCODINGS.some(binaryEncoding => value.indexOf(binaryEncoding) !== -1)
- );
- }
-}
-
-function isBinaryContent(headers, options) {
- const contentTypes = [].concat(options.binary
- ? options.binary
- : BINARY_CONTENT_TYPES
- ).map(candidate =>
- new RegExp(`^${candidate.replace(/\*/g, '.*')}$`)
- );
-
- const contentType = (headers['content-type'] || '').split(';')[0];
- return !!contentType && contentTypes.some(candidate => candidate.test(contentType));
-}
-
-module.exports = function isBinary(headers, options) {
- if (options.binary === false) {
- return false;
- }
-
- if (options.binary === true) {
- return true
- }
-
- if (typeof options.binary === 'function') {
- return options.binary(headers);
- }
-
- return isBinaryEncoding(headers) || isBinaryContent(headers, options);
-};
diff --git a/node_modules/serverless-http/lib/provider/azure/sanitize-headers.js b/node_modules/serverless-http/lib/provider/azure/sanitize-headers.js
deleted file mode 100644
index 692baa4..0000000
--- a/node_modules/serverless-http/lib/provider/azure/sanitize-headers.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-const setCookieVariations = require('./set-cookie.json').variations;
-
-module.exports = function sanitizeHeaders(headers) {
- return Object.keys(headers).reduce((memo, key) => {
- const value = headers[key];
-
- if (Array.isArray(value)) {
- if (key.toLowerCase() === 'set-cookie') {
- value.forEach((cookie, i) => {
- memo[setCookieVariations[i]] = cookie;
- });
- } else {
- memo[key] = value.join(', ');
- }
- } else {
- memo[key] = value == null ? '' : value.toString();
- }
-
- return memo;
- }, {});
-};
diff --git a/node_modules/serverless-http/lib/provider/azure/set-cookie.json b/node_modules/serverless-http/lib/provider/azure/set-cookie.json
deleted file mode 100644
index 611cfea..0000000
--- a/node_modules/serverless-http/lib/provider/azure/set-cookie.json
+++ /dev/null
@@ -1 +0,0 @@
-{"variations":["set-cookie","Set-cookie","sEt-cookie","SEt-cookie","seT-cookie","SeT-cookie","sET-cookie","SET-cookie","set-Cookie","Set-Cookie","sEt-Cookie","SEt-Cookie","seT-Cookie","SeT-Cookie","sET-Cookie","SET-Cookie","set-cOokie","Set-cOokie","sEt-cOokie","SEt-cOokie","seT-cOokie","SeT-cOokie","sET-cOokie","SET-cOokie","set-COokie","Set-COokie","sEt-COokie","SEt-COokie","seT-COokie","SeT-COokie","sET-COokie","SET-COokie","set-coOkie","Set-coOkie","sEt-coOkie","SEt-coOkie","seT-coOkie","SeT-coOkie","sET-coOkie","SET-coOkie","set-CoOkie","Set-CoOkie","sEt-CoOkie","SEt-CoOkie","seT-CoOkie","SeT-CoOkie","sET-CoOkie","SET-CoOkie","set-cOOkie","Set-cOOkie","sEt-cOOkie","SEt-cOOkie","seT-cOOkie","SeT-cOOkie","sET-cOOkie","SET-cOOkie","set-COOkie","Set-COOkie","sEt-COOkie","SEt-COOkie","seT-COOkie","SeT-COOkie","sET-COOkie","SET-COOkie","set-cooKie","Set-cooKie","sEt-cooKie","SEt-cooKie","seT-cooKie","SeT-cooKie","sET-cooKie","SET-cooKie","set-CooKie","Set-CooKie","sEt-CooKie","SEt-CooKie","seT-CooKie","SeT-CooKie","sET-CooKie","SET-CooKie","set-cOoKie","Set-cOoKie","sEt-cOoKie","SEt-cOoKie","seT-cOoKie","SeT-cOoKie","sET-cOoKie","SET-cOoKie","set-COoKie","Set-COoKie","sEt-COoKie","SEt-COoKie","seT-COoKie","SeT-COoKie","sET-COoKie","SET-COoKie","set-coOKie","Set-coOKie","sEt-coOKie","SEt-coOKie","seT-coOKie","SeT-coOKie","sET-coOKie","SET-coOKie","set-CoOKie","Set-CoOKie","sEt-CoOKie","SEt-CoOKie","seT-CoOKie","SeT-CoOKie","sET-CoOKie","SET-CoOKie","set-cOOKie","Set-cOOKie","sEt-cOOKie","SEt-cOOKie","seT-cOOKie","SeT-cOOKie","sET-cOOKie","SET-cOOKie","set-COOKie","Set-COOKie","sEt-COOKie","SEt-COOKie","seT-COOKie","SeT-COOKie","sET-COOKie","SET-COOKie","set-cookIe","Set-cookIe","sEt-cookIe","SEt-cookIe","seT-cookIe","SeT-cookIe","sET-cookIe","SET-cookIe","set-CookIe","Set-CookIe","sEt-CookIe","SEt-CookIe","seT-CookIe","SeT-CookIe","sET-CookIe","SET-CookIe","set-cOokIe","Set-cOokIe","sEt-cOokIe","SEt-cOokIe","seT-cOokIe","SeT-cOokIe","sET-cOokIe","SET-cOokIe","set-COokIe","Set-COokIe","sEt-COokIe","SEt-COokIe","seT-COokIe","SeT-COokIe","sET-COokIe","SET-COokIe","set-coOkIe","Set-coOkIe","sEt-coOkIe","SEt-coOkIe","seT-coOkIe","SeT-coOkIe","sET-coOkIe","SET-coOkIe","set-CoOkIe","Set-CoOkIe","sEt-CoOkIe","SEt-CoOkIe","seT-CoOkIe","SeT-CoOkIe","sET-CoOkIe","SET-CoOkIe","set-cOOkIe","Set-cOOkIe","sEt-cOOkIe","SEt-cOOkIe","seT-cOOkIe","SeT-cOOkIe","sET-cOOkIe","SET-cOOkIe","set-COOkIe","Set-COOkIe","sEt-COOkIe","SEt-COOkIe","seT-COOkIe","SeT-COOkIe","sET-COOkIe","SET-COOkIe","set-cooKIe","Set-cooKIe","sEt-cooKIe","SEt-cooKIe","seT-cooKIe","SeT-cooKIe","sET-cooKIe","SET-cooKIe","set-CooKIe","Set-CooKIe","sEt-CooKIe","SEt-CooKIe","seT-CooKIe","SeT-CooKIe","sET-CooKIe","SET-CooKIe","set-cOoKIe","Set-cOoKIe","sEt-cOoKIe","SEt-cOoKIe","seT-cOoKIe","SeT-cOoKIe","sET-cOoKIe","SET-cOoKIe","set-COoKIe","Set-COoKIe","sEt-COoKIe","SEt-COoKIe","seT-COoKIe","SeT-COoKIe","sET-COoKIe","SET-COoKIe","set-coOKIe","Set-coOKIe","sEt-coOKIe","SEt-coOKIe","seT-coOKIe","SeT-coOKIe","sET-coOKIe","SET-coOKIe","set-CoOKIe","Set-CoOKIe","sEt-CoOKIe","SEt-CoOKIe","seT-CoOKIe","SeT-CoOKIe","sET-CoOKIe","SET-CoOKIe","set-cOOKIe","Set-cOOKIe","sEt-cOOKIe","SEt-cOOKIe","seT-cOOKIe","SeT-cOOKIe","sET-cOOKIe","SET-cOOKIe","set-COOKIe","Set-COOKIe","sEt-COOKIe","SEt-COOKIe","seT-COOKIe","SeT-COOKIe","sET-COOKIe","SET-COOKIe","set-cookiE","Set-cookiE","sEt-cookiE","SEt-cookiE","seT-cookiE","SeT-cookiE","sET-cookiE","SET-cookiE","set-CookiE","Set-CookiE","sEt-CookiE","SEt-CookiE","seT-CookiE","SeT-CookiE","sET-CookiE","SET-CookiE","set-cOokiE","Set-cOokiE","sEt-cOokiE","SEt-cOokiE","seT-cOokiE","SeT-cOokiE","sET-cOokiE","SET-cOokiE","set-COokiE","Set-COokiE","sEt-COokiE","SEt-COokiE","seT-COokiE","SeT-COokiE","sET-COokiE","SET-COokiE","set-coOkiE","Set-coOkiE","sEt-coOkiE","SEt-coOkiE","seT-coOkiE","SeT-coOkiE","sET-coOkiE","SET-coOkiE","set-CoOkiE","Set-CoOkiE","sEt-CoOkiE","SEt-CoOkiE","seT-CoOkiE","SeT-CoOkiE","sET-CoOkiE","SET-CoOkiE","set-cOOkiE","Set-cOOkiE","sEt-cOOkiE","SEt-cOOkiE","seT-cOOkiE","SeT-cOOkiE","sET-cOOkiE","SET-cOOkiE","set-COOkiE","Set-COOkiE","sEt-COOkiE","SEt-COOkiE","seT-COOkiE","SeT-COOkiE","sET-COOkiE","SET-COOkiE","set-cooKiE","Set-cooKiE","sEt-cooKiE","SEt-cooKiE","seT-cooKiE","SeT-cooKiE","sET-cooKiE","SET-cooKiE","set-CooKiE","Set-CooKiE","sEt-CooKiE","SEt-CooKiE","seT-CooKiE","SeT-CooKiE","sET-CooKiE","SET-CooKiE","set-cOoKiE","Set-cOoKiE","sEt-cOoKiE","SEt-cOoKiE","seT-cOoKiE","SeT-cOoKiE","sET-cOoKiE","SET-cOoKiE","set-COoKiE","Set-COoKiE","sEt-COoKiE","SEt-COoKiE","seT-COoKiE","SeT-COoKiE","sET-COoKiE","SET-COoKiE","set-coOKiE","Set-coOKiE","sEt-coOKiE","SEt-coOKiE","seT-coOKiE","SeT-coOKiE","sET-coOKiE","SET-coOKiE","set-CoOKiE","Set-CoOKiE","sEt-CoOKiE","SEt-CoOKiE","seT-CoOKiE","SeT-CoOKiE","sET-CoOKiE","SET-CoOKiE","set-cOOKiE","Set-cOOKiE","sEt-cOOKiE","SEt-cOOKiE","seT-cOOKiE","SeT-cOOKiE","sET-cOOKiE","SET-cOOKiE","set-COOKiE","Set-COOKiE","sEt-COOKiE","SEt-COOKiE","seT-COOKiE","SeT-COOKiE","sET-COOKiE","SET-COOKiE","set-cookIE","Set-cookIE","sEt-cookIE","SEt-cookIE","seT-cookIE","SeT-cookIE","sET-cookIE","SET-cookIE","set-CookIE","Set-CookIE","sEt-CookIE","SEt-CookIE","seT-CookIE","SeT-CookIE","sET-CookIE","SET-CookIE","set-cOokIE","Set-cOokIE","sEt-cOokIE","SEt-cOokIE","seT-cOokIE","SeT-cOokIE","sET-cOokIE","SET-cOokIE","set-COokIE","Set-COokIE","sEt-COokIE","SEt-COokIE","seT-COokIE","SeT-COokIE","sET-COokIE","SET-COokIE","set-coOkIE","Set-coOkIE","sEt-coOkIE","SEt-coOkIE","seT-coOkIE","SeT-coOkIE","sET-coOkIE","SET-coOkIE","set-CoOkIE","Set-CoOkIE","sEt-CoOkIE","SEt-CoOkIE","seT-CoOkIE","SeT-CoOkIE","sET-CoOkIE","SET-CoOkIE","set-cOOkIE","Set-cOOkIE","sEt-cOOkIE","SEt-cOOkIE","seT-cOOkIE","SeT-cOOkIE","sET-cOOkIE","SET-cOOkIE","set-COOkIE","Set-COOkIE","sEt-COOkIE","SEt-COOkIE","seT-COOkIE","SeT-COOkIE","sET-COOkIE","SET-COOkIE","set-cooKIE","Set-cooKIE","sEt-cooKIE","SEt-cooKIE","seT-cooKIE","SeT-cooKIE","sET-cooKIE","SET-cooKIE","set-CooKIE","Set-CooKIE","sEt-CooKIE","SEt-CooKIE","seT-CooKIE","SeT-CooKIE","sET-CooKIE","SET-CooKIE","set-cOoKIE","Set-cOoKIE","sEt-cOoKIE","SEt-cOoKIE","seT-cOoKIE","SeT-cOoKIE","sET-cOoKIE","SET-cOoKIE","set-COoKIE","Set-COoKIE","sEt-COoKIE","SEt-COoKIE","seT-COoKIE","SeT-COoKIE","sET-COoKIE","SET-COoKIE","set-coOKIE","Set-coOKIE","sEt-coOKIE","SEt-coOKIE","seT-coOKIE","SeT-coOKIE","sET-coOKIE","SET-coOKIE","set-CoOKIE","Set-CoOKIE","sEt-CoOKIE","SEt-CoOKIE","seT-CoOKIE","SeT-CoOKIE","sET-CoOKIE","SET-CoOKIE","set-cOOKIE","Set-cOOKIE","sEt-cOOKIE","SEt-cOOKIE","seT-cOOKIE","SeT-cOOKIE","sET-cOOKIE","SET-cOOKIE","set-COOKIE","Set-COOKIE","sEt-COOKIE","SEt-COOKIE","seT-COOKIE","SeT-COOKIE","sET-COOKIE","SET-COOKIE"]}
\ No newline at end of file
diff --git a/node_modules/serverless-http/lib/provider/get-provider.js b/node_modules/serverless-http/lib/provider/get-provider.js
deleted file mode 100644
index 17edc70..0000000
--- a/node_modules/serverless-http/lib/provider/get-provider.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const aws = require('./aws');
-const azure = require('./azure');
-
-const providers = {
- aws,
- azure
-};
-
-module.exports = function getProvider(options) {
- const { provider = 'aws' } = options;
-
- if (provider in providers) {
- return providers[provider](options);
- }
-
- throw new Error(`Unsupported provider ${provider}`);
-};
diff --git a/node_modules/serverless-http/lib/request.js b/node_modules/serverless-http/lib/request.js
deleted file mode 100644
index 1472758..0000000
--- a/node_modules/serverless-http/lib/request.js
+++ /dev/null
@@ -1,38 +0,0 @@
-'use strict';
-
-const http = require('http');
-
-module.exports = class ServerlessRequest extends http.IncomingMessage {
- constructor({ method, url, headers, body, remoteAddress }) {
- super({
- encrypted: true,
- readable: false,
- remoteAddress,
- address: () => ({ port: 443 }),
- end: Function.prototype,
- destroy: Function.prototype
- });
-
- if (typeof headers['content-length'] === 'undefined') {
- headers['content-length'] = Buffer.byteLength(body);
- }
-
- Object.assign(this, {
- ip: remoteAddress,
- complete: true,
- httpVersion: '1.1',
- httpVersionMajor: '1',
- httpVersionMinor: '1',
- method,
- headers,
- body,
- url,
- });
-
- this._read = () => {
- this.push(body);
- this.push(null);
- };
- }
-
-}
diff --git a/node_modules/serverless-http/lib/response.js b/node_modules/serverless-http/lib/response.js
deleted file mode 100644
index da745c4..0000000
--- a/node_modules/serverless-http/lib/response.js
+++ /dev/null
@@ -1,135 +0,0 @@
-'use strict';
-
-const http = require('http');
-
-const headerEnd = '\r\n\r\n';
-
-const BODY = Symbol();
-const HEADERS = Symbol();
-
-function getString(data) {
- if (Buffer.isBuffer(data)) {
- return data.toString('utf8');
- } else if (typeof data === 'string') {
- return data;
- } else {
- throw new Error(`response.write() of unexpected type: ${typeof data}`);
- }
-}
-
-function addData(stream, data) {
- if (Buffer.isBuffer(data) || typeof data === 'string' || data instanceof Uint8Array) {
- stream[BODY].push(Buffer.from(data));
- } else {
- throw new Error(`response.write() of unexpected type: ${typeof data}`);
- }
-}
-
-module.exports = class ServerlessResponse extends http.ServerResponse {
-
- static from(res) {
- const response = new ServerlessResponse(res);
-
- response.statusCode = res.statusCode
- response[HEADERS] = res.headers;
- response[BODY] = [Buffer.from(res.body)];
- response.end();
-
- return response;
- }
-
- static body(res) {
- return Buffer.concat(res[BODY]);
- }
-
- static headers(res) {
- const headers = typeof res.getHeaders === 'function'
- ? res.getHeaders()
- : res._headers;
-
- return Object.assign(headers, res[HEADERS]);
- }
-
- get headers() {
- return this[HEADERS];
- }
-
- setHeader(key, value) {
- if (this._wroteHeader) {
- this[HEADERS][key] = value;
- } else {
- super.setHeader(key, value);
- }
- }
-
- writeHead(statusCode, reason, obj) {
- const headers = typeof reason === 'string'
- ? obj
- : reason
-
- for (const name in headers) {
- this.setHeader(name, headers[name])
-
- if (!this._wroteHeader) {
- // we only need to initiate super.headers once
- // writeHead will add the other headers itself
- break
- }
- }
-
- super.writeHead(statusCode, reason, obj);
- }
-
- constructor({ method }) {
- super({ method });
-
- this[BODY] = [];
- this[HEADERS] = {};
-
- this.useChunkedEncodingByDefault = false;
- this.chunkedEncoding = false;
- this._header = '';
-
- this.assignSocket({
- _writableState: {},
- writable: true,
- on: Function.prototype,
- removeListener: Function.prototype,
- destroy: Function.prototype,
- cork: Function.prototype,
- uncork: Function.prototype,
- write: (data, encoding, cb) => {
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
-
- if (this._header === '' || this._wroteHeader) {
- addData(this, data);
- } else {
- const string = getString(data);
- const index = string.indexOf(headerEnd);
-
- if (index !== -1) {
- const remainder = string.slice(index + headerEnd.length);
-
- if (remainder) {
- addData(this, remainder);
- }
-
- this._wroteHeader = true;
- }
- }
-
- if (typeof cb === 'function') {
- cb();
- }
- },
- });
-
- this.once('finish', () => {
- this.emit('close')
- });
- }
-
-};
diff --git a/node_modules/serverless-http/package.json b/node_modules/serverless-http/package.json
deleted file mode 100644
index 3417db7..0000000
--- a/node_modules/serverless-http/package.json
+++ /dev/null
@@ -1,93 +0,0 @@
-{
- "name": "serverless-http",
- "version": "3.2.0",
- "description": "Use existing web application frameworks in serverless environments",
- "main": "serverless-http.js",
- "types": "serverless-http.d.ts",
- "engines": {
- "node": ">=12.0"
- },
- "directories": {
- "test": "test"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/dougmoscrop/serverless-http"
- },
- "scripts": {
- "pretest": "tsc --strict --skipLibCheck --noEmit test/typecheck.ts",
- "test": "nyc mocha",
- "posttest": "eslint lib test",
- "test:integration": "mocha test/integration/test.js",
- "postpublish": "git push origin master --tags"
- },
- "keywords": [
- "serverless",
- "serverless applications",
- "koa",
- "express",
- "connect",
- "api gateway",
- "lambda",
- "aws",
- "aws lambda",
- "amazon",
- "amazon web services"
- ],
- "author": "Doug Moscrop (http://www.github.com/dougmoscrop)",
- "contributors": [
- "Doug Moscrop (https://github.com/dougmoscrop)",
- "Kevin Groat (https://github.com/kgroat)",
- "Kurt Miller (https://github.com/bsdkurt)",
- "Roch Devost (https://github.com/rochdev)",
- "Bryan Gamble (https://github.com/bdgamble)",
- "Derek MacDonald (https://github.com/demacdonald)",
- "Filip Skokan (https://github.com/panva)",
- "Kevin Tonon (https://github.com/ktonon)",
- "Mark Vayngrib (https://github.com/mvayngrib)",
- "Tamás Máhr (https://github.com/tamasmahr)",
- "Daniel Martin (https://github.com/daniel-ac-martin)"
- ],
- "homepage": "https://github.com/dougmoscrop/serverless-http",
- "license": "MIT",
- "devDependencies": {
- "@loopback/rest": "^11.1.2",
- "@types/koa": "^2.11.0",
- "body-parser": "^1.19.0",
- "chai": "^4.2.0",
- "chai-as-promised": "^7.1.1",
- "cookie-parser": "^1.4.4",
- "eslint": "^8.12.0",
- "eslint-plugin-mocha": "^10.0.3",
- "express": "^4.17.1",
- "fastify": "^3.27.4",
- "get-stream": "^5.1.0",
- "hapi": "^18.1.0",
- "inversify": "^6.0.1",
- "inversify-express-utils": "^6.3.2",
- "koa": "^2.11.0",
- "koa-bodyparser": "^4.2.1",
- "koa-compress": "^5.1.0",
- "koa-route": "^3.2.0",
- "koa-router": "^10.1.1",
- "koa-static": "^5.0.0",
- "lambda-log": "^3.1.0",
- "mocha": "^9.2.2",
- "morgan": "^1.9.1",
- "nyc": "^15.0.0",
- "on-finished": "^2.3.0",
- "on-headers": "^1.0.2",
- "polka": "^0.5.2",
- "reflect-metadata": "^0.1.13",
- "restana": "^4.0.7",
- "sails": "^1.2.3",
- "serverless": "^3.10.2",
- "serverless-offline": "^8.5.0",
- "serverless-plugin-common-excludes": "^4.0.0",
- "serverless-plugin-custom-binary": "^2.0.0",
- "serverless-plugin-include-dependencies": "^5.0.0",
- "sinon": "^13.0.1",
- "supertest": "^6.2.2",
- "typescript": "^4.6.3"
- }
-}
diff --git a/node_modules/serverless-http/serverless-http.d.ts b/node_modules/serverless-http/serverless-http.d.ts
deleted file mode 100644
index 974ba09..0000000
--- a/node_modules/serverless-http/serverless-http.d.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-declare namespace ServerlessHttp {
- export interface FrameworkApplication {
- callback: Function;
- handle: Function;
- router: {
- route: Function;
- }
- _core: {
- _dispatch: Function;
- }
- }
-
- /**
- * Handler-compatible function or application.
- */
- export type Application = Function | Partial;
- export type Result = Function | Partial;
-
- export type Options = {
- provider?: 'aws' | 'azure'
- requestId?: string,
- request?: Object | Function,
- response?: Object | Function,
- binary?: boolean | Function | string | string[],
- basePath?: string
- }
- /**
- * AWS Lambda APIGatewayProxyHandler-like handler.
- */
- export type Handler = (
- event: Object,
- context: Object
- ) => Promise;
-}
-
-/**
- * Wraps the application into a Lambda APIGatewayProxyHandler-like handler.
- */
-declare function ServerlessHttp(application: ServerlessHttp.Application, options?: ServerlessHttp.Options): ServerlessHttp.Handler;
-
-export = ServerlessHttp;
diff --git a/node_modules/serverless-http/serverless-http.js b/node_modules/serverless-http/serverless-http.js
deleted file mode 100644
index 432b776..0000000
--- a/node_modules/serverless-http/serverless-http.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-const finish = require('./lib/finish');
-const getFramework = require('./lib/framework/get-framework');
-const getProvider = require('./lib/provider/get-provider');
-
-const defaultOptions = {
- requestId: 'x-request-id'
-};
-
-module.exports = function (app, opts) {
- const options = Object.assign({}, defaultOptions, opts);
-
- const framework = getFramework(app);
- const provider = getProvider(options);
-
- return provider(async (request, ...context) => {
- await finish(request, options.request, ...context);
- const response = await framework(request);
- await finish(response, options.response, ...context);
- return response;
- });
-};
From 62f80bba595f6de67b6f846f25748f8bb6a89d86 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 4 Nov 2025 18:57:56 +0000
Subject: [PATCH 5/5] Address code review feedback - improve error handling and
update Node.js version
Co-authored-by: Faizal-Malek <94194196+Faizal-Malek@users.noreply.github.com>
---
api/index.js | 46 +++++++++++++++++++++++++++-------------------
vercel.json | 2 +-
2 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/api/index.js b/api/index.js
index 29c42cc..04bc2e8 100644
--- a/api/index.js
+++ b/api/index.js
@@ -5,6 +5,18 @@ const serverless = require('serverless-http');
* This wraps the Express app with serverless-http for deployment on Vercel
*/
+// Helper function to create error handler
+function createErrorHandler(error, message, fix, instructions) {
+ return async (req, res) => {
+ res.status(500).json({
+ error,
+ message,
+ fix,
+ ...(instructions && { instructions })
+ });
+ };
+}
+
// Try to load the Express app from common paths
const possiblePaths = [
'../app',
@@ -26,13 +38,11 @@ for (const path of possiblePaths) {
if (module.listening !== undefined) {
// This is a server instance, not an app
console.error(`Error: ${path} exports a server instance (called listen()). Please export the app instance instead.`);
- module.exports = async (req, res) => {
- res.status(500).json({
- error: 'Configuration Error',
- message: `The module at ${path} exports a server instance instead of the Express app. Please ensure your main file exports the app instance (module.exports = app) without calling app.listen().`,
- fix: 'Remove app.listen() from the exported module and export only the app instance.'
- });
- };
+ module.exports = createErrorHandler(
+ 'Configuration Error',
+ `The module at ${path} exports a server instance instead of the Express app. Please ensure your main file exports the app instance (module.exports = app) without calling app.listen().`,
+ 'Remove app.listen() from the exported module and export only the app instance.'
+ );
break;
}
// Check if it looks like an Express app (has use, get, post methods)
@@ -52,18 +62,16 @@ for (const path of possiblePaths) {
if (!app) {
// No app found at any of the common paths
console.error('Could not find Express app at any common path');
- module.exports = async (req, res) => {
- res.status(500).json({
- error: 'Configuration Error',
- message: 'Could not find Express app. Tried paths: ' + possiblePaths.join(', '),
- fix: 'Please ensure your Express app is exported from one of these paths, or modify api/index.js to require your app from the correct location.',
- instructions: [
- '1. Your main file should export the Express app instance: module.exports = app;',
- '2. Do NOT call app.listen() in the file that exports the app',
- '3. For local development, create a separate server.js that requires and starts the app'
- ]
- });
- };
+ module.exports = createErrorHandler(
+ 'Configuration Error',
+ 'Could not find Express app. Tried paths: ' + possiblePaths.join(', '),
+ 'Please ensure your Express app is exported from one of these paths, or modify api/index.js to require your app from the correct location.',
+ [
+ '1. Your main file should export the Express app instance: module.exports = app;',
+ '2. Do NOT call app.listen() in the file that exports the app',
+ '3. For local development, create a separate server.js that requires and starts the app'
+ ]
+ );
} else {
// Successfully loaded the app, wrap it with serverless-http
module.exports = serverless(app);
diff --git a/vercel.json b/vercel.json
index 74d1094..7eefb22 100644
--- a/vercel.json
+++ b/vercel.json
@@ -2,7 +2,7 @@
"version": 2,
"functions": {
"api/index.js": {
- "runtime": "nodejs18.x"
+ "runtime": "nodejs20.x"
}
},
"rewrites": [