diff --git a/notNeededPackages.json b/notNeededPackages.json index e3483b3c4b..0adc0abb8e 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -576,6 +576,12 @@ "sourceRepoURL": "https://github.com/fastify/fastify-jwt", "asOfVersion": "0.8.1" }, + { + "libraryName": "fastify-multipart", + "typingsPackageName": "fastify-multipart", + "sourceRepoURL": "https://github.com/fastify/fastify-multipart", + "asOfVersion": "0.7.0" + }, { "libraryName": "fastify-static", "typingsPackageName": "fastify-static", diff --git a/types/fastify-multipart/fastify-multipart-tests.ts b/types/fastify-multipart/fastify-multipart-tests.ts deleted file mode 100644 index ef125ecfa6..0000000000 --- a/types/fastify-multipart/fastify-multipart-tests.ts +++ /dev/null @@ -1,24 +0,0 @@ -import fastify = require("fastify"); -import fastifyMultipart = require("fastify-multipart"); - -const app = fastify(); - -app.register(fastifyMultipart, { - limits: { - fieldNameSize: 200, - fieldSize: 200, - fields: 200, - fileSize: 200, - files: 2, - headerPairs: 200, - } -}); - -app.get("/path", (request) => { - const isMultiPart = request.isMultipart(); - request.multipart((field, file, filename, encoding, mimetype) => { - console.log(field, file, filename, encoding, mimetype); - }, (err) => { - throw err; - }); -}); diff --git a/types/fastify-multipart/index.d.ts b/types/fastify-multipart/index.d.ts deleted file mode 100644 index 9d43a15daf..0000000000 --- a/types/fastify-multipart/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for fastify-multipart 0.5 -// Project: https://github.com/fastify/fastify-multipart#readme -// Definitions by: Jannik Keye -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 -/// - -import busboy = require("busboy"); -import fastify = require("fastify"); - -import { IncomingMessage, ServerResponse } from 'http'; - -declare module "fastify" { - interface FastifyRequest { - isMultipart: () => boolean; - multipart: (handler: fastifyMultipart.MultipartHandler, next: (err: Error) => void) => busboy.Busboy; - } -} - -declare function fastifyMultipart(): void; - -declare namespace fastifyMultipart { - type MultipartHandler = ( - field: string, - file: any, - filename: string, - encoding: string, - mimetype: string, - ) => void; - - interface FastifyMultipartOptions { - limits?: { - /** - * Max field name size in bytes - */ - fieldNameSize?: number; - - /** - * Max field value size in bytes - */ - fieldSize?: number; - - /** - * Max number of non-file fields - */ - fields?: number; - - /** - * For multipart forms, the max file size - */ - fileSize?: number; - - /** - * Max number of file fields - */ - files?: number; - - /** - * Max number of header key=>value pairs - */ - headerPairs?: number; - }; - } -} - -export = fastifyMultipart; diff --git a/types/fastify-multipart/package.json b/types/fastify-multipart/package.json deleted file mode 100644 index e8c68ab969..0000000000 --- a/types/fastify-multipart/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "fastify": "^1.11.2" - } -} diff --git a/types/fastify-multipart/tsconfig.json b/types/fastify-multipart/tsconfig.json deleted file mode 100644 index e30babe0c1..0000000000 --- a/types/fastify-multipart/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "fastify-multipart-tests.ts" - ] -} diff --git a/types/fastify-multipart/tslint.json b/types/fastify-multipart/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/fastify-multipart/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }