Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mercurius-upload

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mercurius-upload - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

17

dist/index.d.ts
/// <reference types="node" />
import { UploadOptions } from 'graphql-upload';
import type { FastifyPluginCallback } from 'fastify';
import { UploadOptions } from 'graphql-upload'
import type { FastifyPluginCallback } from 'fastify'
declare module 'fastify' {
interface FastifyRequest {
isMultipart?: true;
}
interface FastifyRequest {
isMultipart?: true
}
}
declare const _default: FastifyPluginCallback<UploadOptions, import("http").Server>;
export default _default;
export declare const mercuriusUpload: FastifyPluginCallback<
UploadOptions,
import('http').Server
>
export default mercuriusUpload

@@ -1,24 +0,32 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
const graphql_upload_1 = require("graphql-upload");
'use strict'
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod }
}
Object.defineProperty(exports, '__esModule', { value: true })
exports.mercuriusUpload = void 0
const fastify_plugin_1 = __importDefault(require('fastify-plugin'))
const graphql_upload_1 = require('graphql-upload')
const mercuriusGQLUpload = (fastify, options, done) => {
fastify.addContentTypeParser('multipart', (req, _payload, done) => {
req.isMultipart = true;
done(null);
});
fastify.addHook('preValidation', async function (request, reply) {
if (!request.isMultipart) {
return;
}
request.body = await graphql_upload_1.processRequest(request.raw, reply.raw, options);
});
done();
};
exports.default = fastify_plugin_1.default(mercuriusGQLUpload, {
fastify: '>= 3.x',
name: 'mercurius-upload',
});
fastify.addContentTypeParser('multipart', (req, _payload, done) => {
req.isMultipart = true
done(null)
})
fastify.addHook('preValidation', async function (request, reply) {
if (!request.isMultipart) {
return
}
request.body = await (0, graphql_upload_1.processRequest)(
request.raw,
reply.raw,
options
)
})
done()
}
exports.mercuriusUpload = (0, fastify_plugin_1.default)(mercuriusGQLUpload, {
fastify: '>= 3.x',
name: 'mercurius-upload',
})
exports.default = exports.mercuriusUpload
{
"name": "mercurius-upload",
"version": "2.0.0",
"description": "Fastify plugin to support GraphQL uploads using graphql-upload",
"keywords": [
"fastify",
"mercurius",
"gql",
"graphql",
"upload",
"file",
"files",
"typescript"
],
"homepage": "https://github.com/mercurius-js/mercurius-upload#readme",
"bugs": {
"url": "https://github.com/mercurius-js/mercurius-upload/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mercurius-js/mercurius-upload.git"
},
"license": "ISC",
"author": "PabloSzx",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@types/graphql-upload": "^8.0.4",
"fastify-plugin": "^3.0.0",
"graphql-upload": "^12.0.0"
},
"devDependencies": {
"@types/node": "^15.3.0",
"@types/tap": "^15.0.1",
"cross-env": "^7.0.3",
"fastify": "^3.15.1",
"form-data": "^4.0.0",
"graphql": "^15.5.0",
"mercurius": "^7.6.1",
"tap": "^15.0.9",
"ts-node": "^9.1.1",
"typescript": "^4.2.4"
},
"scripts": {
"test": "tap --ts --100 test/*.test.ts"
}
}
"name": "mercurius-upload",
"version": "3.0.0",
"description": "Fastify plugin to support GraphQL uploads using graphql-upload",
"keywords": [
"fastify",
"mercurius",
"gql",
"graphql",
"upload",
"file",
"files",
"typescript"
],
"homepage": "https://github.com/mercurius-js/mercurius-upload#readme",
"bugs": {
"url": "https://github.com/mercurius-js/mercurius-upload/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mercurius-js/mercurius-upload.git"
},
"license": "ISC",
"author": "PabloSzx",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@types/graphql-upload": "^8.0.7",
"fastify-plugin": "^3.0.0",
"graphql-upload": "^13.0.0"
},
"devDependencies": {
"@types/node": "^16.11.12",
"@types/tap": "^15.0.5",
"cross-env": "^7.0.3",
"fastify": "^3.24.1",
"form-data": "^4.0.0",
"graphql": "^15.8.0",
"mercurius": "^8.11.2",
"prettier": "^2.5.1",
"tap": "^15.1.5",
"ts-node": "^10.4.0",
"typescript": "^4.5.3"
},
"scripts": {
"test": "tap --ts --100 test/*.test.ts"
}
}

@@ -0,0 +0,0 @@ # mercurius-upload

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc