Version 1.0.2 mit node_modules Verzeichnis

This commit is contained in:
ISA
2024-10-02 07:58:24 +02:00
parent f353a06b1b
commit 62b6e55a0a
68228 changed files with 4548477 additions and 651 deletions

21
node_modules/nextjs-cors/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020-present Yony Calsin
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.

72
node_modules/nextjs-cors/README.md generated vendored Normal file
View File

@@ -0,0 +1,72 @@
# Nextjs Cors
`Nextjs-Cors` is a node.js package to provide a middleware that can be used to enable CORS with various options in nextjs applications.
[![CI](https://github.com/yonycalsin/nextjs-cors/actions/workflows/ci.yml/badge.svg)](https://github.com/yonycalsin/nextjs-cors/actions/workflows/ci.yml)
<a href="https://github.com/yonycalsin/nextjs-cors"><img src="https://img.shields.io/spiget/stars/1000?color=brightgreen&label=Star&logo=github" /></a>
<a href="https://www.npmjs.com/nextjs-cors" target="_blank">
<img src="https://img.shields.io/npm/v/nextjs-cors" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/nextjs-cors" target="_blank">
<img src="https://img.shields.io/npm/l/nextjs-cors" alt="Package License" /></a>
<a href="https://www.npmjs.com/nextjs-cors" target="_blank">
<img src="https://img.shields.io/npm/dm/nextjs-cors" alt="NPM Downloads" /></a>
<a href="https://github.com/yonycalsin/nextjs-cors"><img src="https://img.shields.io/badge/Github%20Page-nextjs.cors-yellow?style=flat-square&logo=github" /></a>
<a href="https://github.com/yonycalsin"><img src="https://img.shields.io/badge/Author-Yony%20Calsin-blueviolet?style=flat-square&logo=appveyor" /></a>
<a href="https://twitter.com/yonycalsin" target="_blank">
<img src="https://img.shields.io/twitter/follow/yonycalsin.svg?style=social&label=Follow"></a>
## Installation
> First we will have to install, in order to use this wonderful package.
```bash
# Using npm
npm install nextjs-cors@latest
# Using yarn
yarn add nextjs-cors@latest
# Using pnpm
pnpm add nextjs-cors@latest
```
## Usage
nextjs-cors uses the cors package, so we invite you to check the documentation https://github.com/expressjs/cors
> pages/api/whoami.{ts,js}
```ts
import NextCors from 'nextjs-cors';
async function handler(req, res) {
// Run the cors middleware
// nextjs-cors uses the cors package, so we invite you to check the documentation https://github.com/expressjs/cors
await NextCors(req, res, {
// Options
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
origin: '*',
optionsSuccessStatus: 200, // some legacy browsers (IE11, various SmartTVs) choke on 204
});
// Rest of the API logic
res.json({ message: 'Hello NextJs Cors!' });
}
```
## Support for
`nextjs-cors` is an open source project licensed by [MIT](LICENSE). You can grow thanks to the sponsors and the support of the amazing sponsors. If you want to join them, [contact me here](https://twitter.com/yonycalsin).
## Stay in touch
- Github [@yonycalsin](https://github.com/yonycalsin)
- Twitter [@yonycalsin](https://twitter.com/yonycalsin)
## Contributors
Thanks to the wonderful people who collaborate with me !
## License
`nextjs-cors` under [License.](LICENSE)

4
node_modules/nextjs-cors/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import cors from 'cors';
import { NextApiRequest, NextApiResponse } from 'next';
declare const NextCors: (req: NextApiRequest, res: NextApiResponse, options?: cors.CorsOptions | cors.CorsOptionsDelegate<cors.CorsRequest> | undefined) => Promise<unknown>;
export default NextCors;

8
node_modules/nextjs-cors/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./nextjs-cors.cjs.production.min.js')
} else {
module.exports = require('./nextjs-cors.cjs.development.js')
}

View File

@@ -0,0 +1,29 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var cors = _interopDefault(require('cors'));
// And to throw an error when an error happens in a middleware
function initMiddleware(middleware) {
return function (req, res, options) {
return new Promise(function (resolve, reject) {
middleware(options)(req, res, function (result) {
if (result instanceof Error) {
return reject(result);
}
return resolve(result);
});
});
};
} // You can read more about the available options here: https://github.com/expressjs/cors#configuration-options
var NextCors = /*#__PURE__*/initMiddleware(cors);
exports.default = NextCors;
//# sourceMappingURL=nextjs-cors.cjs.development.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"nextjs-cors.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["import cors, { CorsOptions, CorsOptionsDelegate } from 'cors'\nimport { NextApiRequest, NextApiResponse } from 'next'\n\n// Helper method to wait for a middleware to execute before continuing\n// And to throw an error when an error happens in a middleware\nfunction initMiddleware(middleware: typeof cors) {\n return (req: NextApiRequest, res: NextApiResponse, options?: CorsOptions | CorsOptionsDelegate) =>\n new Promise((resolve, reject) => {\n middleware(options)(req, res, (result: Error | unknown) => {\n if (result instanceof Error) {\n return reject(result)\n }\n\n return resolve(result)\n })\n })\n}\n\n// You can read more about the available options here: https://github.com/expressjs/cors#configuration-options\nconst NextCors = initMiddleware(cors)\n\nexport default NextCors\n"],"names":["initMiddleware","middleware","req","res","options","Promise","resolve","reject","result","Error","NextCors","cors"],"mappings":";;;;;;;;AAIA;;AACA,SAASA,cAAT,CAAwBC,UAAxB;AACE,SAAO,UAACC,GAAD,EAAsBC,GAAtB,EAA4CC,OAA5C;AAAA,WACL,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV;AACVN,MAAAA,UAAU,CAACG,OAAD,CAAV,CAAoBF,GAApB,EAAyBC,GAAzB,EAA8B,UAACK,MAAD;AAC5B,YAAIA,MAAM,YAAYC,KAAtB,EAA6B;AAC3B,iBAAOF,MAAM,CAACC,MAAD,CAAb;AACD;;AAED,eAAOF,OAAO,CAACE,MAAD,CAAd;AACD,OAND;AAOD,KARD,CADK;AAAA,GAAP;AAUD;;;AAGD,IAAME,QAAQ,gBAAGV,cAAc,CAACW,IAAD,CAA/B;;;;"}

View File

@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=(e=require("cors"))&&"object"==typeof e&&"default"in e?e.default:e;function t(e){return function(r,t,n){return new Promise((function(o,u){e(n)(r,t,(function(e){return e instanceof Error?u(e):o(e)}))}))}}exports.default=t(r);
//# sourceMappingURL=nextjs-cors.cjs.production.min.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"nextjs-cors.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["import cors, { CorsOptions, CorsOptionsDelegate } from 'cors'\nimport { NextApiRequest, NextApiResponse } from 'next'\n\n// Helper method to wait for a middleware to execute before continuing\n// And to throw an error when an error happens in a middleware\nfunction initMiddleware(middleware: typeof cors) {\n return (req: NextApiRequest, res: NextApiResponse, options?: CorsOptions | CorsOptionsDelegate) =>\n new Promise((resolve, reject) => {\n middleware(options)(req, res, (result: Error | unknown) => {\n if (result instanceof Error) {\n return reject(result)\n }\n\n return resolve(result)\n })\n })\n}\n\n// You can read more about the available options here: https://github.com/expressjs/cors#configuration-options\nconst NextCors = initMiddleware(cors)\n\nexport default NextCors\n"],"names":["initMiddleware","middleware","req","res","options","Promise","resolve","reject","result","Error","cors"],"mappings":"+IAKA,SAASA,EAAeC,UACf,SAACC,EAAqBC,EAAsBC,UACjD,IAAIC,SAAQ,SAACC,EAASC,GACpBN,EAAWG,EAAXH,CAAoBC,EAAKC,GAAK,SAACK,UACzBA,aAAkBC,MACbF,EAAOC,GAGTF,EAAQE,0BAMNR,EAAeU"}

23
node_modules/nextjs-cors/dist/nextjs-cors.esm.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import cors from 'cors';
// And to throw an error when an error happens in a middleware
function initMiddleware(middleware) {
return function (req, res, options) {
return new Promise(function (resolve, reject) {
middleware(options)(req, res, function (result) {
if (result instanceof Error) {
return reject(result);
}
return resolve(result);
});
});
};
} // You can read more about the available options here: https://github.com/expressjs/cors#configuration-options
var NextCors = /*#__PURE__*/initMiddleware(cors);
export default NextCors;
//# sourceMappingURL=nextjs-cors.esm.js.map

1
node_modules/nextjs-cors/dist/nextjs-cors.esm.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"nextjs-cors.esm.js","sources":["../src/index.ts"],"sourcesContent":["import cors, { CorsOptions, CorsOptionsDelegate } from 'cors'\nimport { NextApiRequest, NextApiResponse } from 'next'\n\n// Helper method to wait for a middleware to execute before continuing\n// And to throw an error when an error happens in a middleware\nfunction initMiddleware(middleware: typeof cors) {\n return (req: NextApiRequest, res: NextApiResponse, options?: CorsOptions | CorsOptionsDelegate) =>\n new Promise((resolve, reject) => {\n middleware(options)(req, res, (result: Error | unknown) => {\n if (result instanceof Error) {\n return reject(result)\n }\n\n return resolve(result)\n })\n })\n}\n\n// You can read more about the available options here: https://github.com/expressjs/cors#configuration-options\nconst NextCors = initMiddleware(cors)\n\nexport default NextCors\n"],"names":["initMiddleware","middleware","req","res","options","Promise","resolve","reject","result","Error","NextCors","cors"],"mappings":";;AAIA;;AACA,SAASA,cAAT,CAAwBC,UAAxB;AACE,SAAO,UAACC,GAAD,EAAsBC,GAAtB,EAA4CC,OAA5C;AAAA,WACL,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV;AACVN,MAAAA,UAAU,CAACG,OAAD,CAAV,CAAoBF,GAApB,EAAyBC,GAAzB,EAA8B,UAACK,MAAD;AAC5B,YAAIA,MAAM,YAAYC,KAAtB,EAA6B;AAC3B,iBAAOF,MAAM,CAACC,MAAD,CAAb;AACD;;AAED,eAAOF,OAAO,CAACE,MAAD,CAAd;AACD,OAND;AAOD,KARD,CADK;AAAA,GAAP;AAUD;;;AAGD,IAAME,QAAQ,gBAAGV,cAAc,CAACW,IAAD,CAA/B;;;;"}

103
node_modules/nextjs-cors/package.json generated vendored Normal file
View File

@@ -0,0 +1,103 @@
{
"name": "nextjs-cors",
"version": "2.2.0",
"private": false,
"description": "Nextjs-Cors is a node.js package to provide a middleware that can be used to enable CORS with various options in nextjs applications.",
"keywords": [
"nextjs-cors",
"express-cors",
"nextjs-express-cors",
"next-cors",
"cors-server",
"cors"
],
"homepage": "https://github.com/yonycalsin/nextjs-cors#readme",
"bugs": {
"url": "https://github.com/yonycalsin/nextjs-cors/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/yonycalsin/nextjs-cors.git"
},
"license": "MIT",
"author": "Yony Calsin",
"main": "dist/index.js",
"module": "dist/nextjs-cors.esm.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"package.json",
"README.md"
],
"scripts": {
"clean": "rimraf dist",
"boot": "npm run clean && npm run build",
"typecheck": "tsc --noEmit",
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build",
"prettier": "prettier --ignore-path .gitignore \"**/*.{ts,tsx,json,md}\"",
"format": "npm run prettier -- --write",
"check-format": "npm run prettier -- --list-different",
"semantic-release": "semantic-release"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint",
"pre-push": "npm run typecheck"
}
},
"lint-staged": {
"*.{ts,js}": [
"eslint --fix"
]
},
"dependencies": {
"cors": "^2.8.5"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/cors": "^2.8.12",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"next": "^11.1.0",
"prettier": "^2.0.5",
"prettier-plugin-organize-imports": "^2.0.0",
"prettier-plugin-packagejson": "^2.2.5",
"rimraf": "^3.0.2",
"semantic-release": "^19.0.5",
"tsdx": "^0.14.1",
"typescript": "^4.4.2"
},
"peerDependencies": {
"next": "^8.1.1-canary.54 || ^9.0.0 || ^10.0.0-0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0"
},
"publishConfig": {
"access": "public"
},
"release": {
"branches": [
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/github",
{
"assets": [
"dist"
]
}
],
"@semantic-release/changelog"
]
},
"volta": {
"node": "14.17.0"
}
}