{"_id":"@chargetrip/apollo-federation-upload","_rev":"3-d57a246e6f6366961e15b55cf9435c95","name":"@chargetrip/apollo-federation-upload","dist-tags":{"latest":"4.2.2"},"versions":{"4.2.0":{"name":"@chargetrip/apollo-federation-upload","version":"4.2.0","keywords":["apollo","federation","file","gateway","graphQL","upload"],"author":{"name":"Chargetrip","email":"dev@chargetrip.com"},"license":"MIT","_id":"@chargetrip/apollo-federation-upload@4.2.0","maintainers":[{"name":"wouter125","email":"wouter.vandekamp@chargetrip.com"},{"name":"timkuilman","email":"tim.kuilman@gmail.com"},{"name":"laurensvdmaas","email":"laurensvdmaas@gmail.com"}],"homepage":"https://chargetrip.com/","bugs":{"url":"https://github.com/chargetrip/apollo-federation-file-upload/issues"},"dist":{"shasum":"ee2dfadb1bb4dfa68a01b1b5e314735698771b61","tarball":"https://registry.npmjs.org/@chargetrip/apollo-federation-upload/-/apollo-federation-upload-4.2.0.tgz","fileCount":9,"integrity":"sha512-DuWQzDtE4YEnY4IB69keslShXVAmQ+amIDgq/DAhdzmoFkcEVVamv0csh+mx7sXfuEfBU+WZPZaQYF3D7Ht1xw==","signatures":[{"sig":"MEUCIQCIDuZ192Sir99acFVYlcX3bDO9FeVuYZghaBT5z/8D+QIgXEdvtylc39hlHdTCjoAKOJ2FALd9bqN+ZdEDkI73Qv0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16672},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"c9ff768374866e26fa825a80b88f98e673f49475","private":false,"scripts":{"lint":"run-s check-types run-lint","test":"nyc ts-node ./test/index.ts","build":"tsc","watch":"tsc-watch --onSuccess tsc","run-lint":"eslint --max-warnings=0 --ext .ts lib","check-types":"tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"wouter125","email":"wouter.vandekamp@chargetrip.com"},"repository":{"url":"git+https://github.com/chargetrip/apollo-federation-file-upload.git","type":"git"},"_npmVersion":"9.6.7","description":"This library makes it easier to support file uploads to your federated micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution. It works by simply redirecting the file uploaded stream to ","directories":{},"resolutions":{"**/wrap-ansi":"^6.2.0","**/strip-ansi":"^6.0.0","**/string-width":"^4.2.3"},"_nodeVersion":"18.17.1","dependencies":{"form-data":"^4.0.0","lodash.set":"^4.3.2","graphql-upload":"^15.0.1","lodash.clonedeep":"^4.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","husky":"^8.0.1","eslint":"^8.44.0","newman":"^5.3.2","express":"4.18.1","graphql":"^16.5.0","ts-node":"^10.8.1","prettier":"^2.6.2","tsc-watch":"^6.0.4","typescript":"^4.7.3","@types/node":"^17.0.40","npm-run-all":"^4.1.5","@types/newman":"^5.3.0","apollo-graphql":"^0.9.7","@apollo/gateway":"^2.7.1","@commitlint/cli":"^17.0.2","@apollo/subgraph":"^2.7.1","@types/lodash.set":"^4.3.7","apollo-server-env":"^4.2.1","apollo-server-core":"^3.12.0","source-map-support":"^0.5.21","eslint-plugin-import":"^2.27.5","apollo-server-express":"^3.12.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","@types/lodash.clonedeep":"^4.5.7","eslint-plugin-filenames":"^1.3.2","@types/make-fetch-happen":"^9.0.2","@typescript-eslint/parser":"^6.0.0","eslint-config-airbnb-base":"^15.0.0","@commitlint/config-angular":"^17.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@istanbuljs/nyc-config-typescript":"^1.0.2","eslint-import-resolver-typescript":"^3.5.5"},"peerDependencies":{"@apollo/gateway":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/apollo-federation-upload_4.2.0_1710856118110_0.719510284703323","host":"s3://npm-registry-packages"}},"4.2.1":{"name":"@chargetrip/apollo-federation-upload","version":"4.2.1","keywords":["chargetrip","apollo","federation","file","gateway","graphQL","upload"],"author":{"name":"Chargetrip","email":"dev@chargetrip.com"},"license":"MIT","_id":"@chargetrip/apollo-federation-upload@4.2.1","maintainers":[{"name":"wouter125","email":"wouter.vandekamp@chargetrip.com"},{"name":"timkuilman","email":"tim.kuilman@gmail.com"},{"name":"laurensvdmaas","email":"laurensvdmaas@gmail.com"}],"homepage":"https://chargetrip.com/","bugs":{"url":"https://github.com/chargetrip/apollo-federation-file-upload/issues"},"dist":{"shasum":"7526bc88da93033ae336f578998cc82c996a3c1f","tarball":"https://registry.npmjs.org/@chargetrip/apollo-federation-upload/-/apollo-federation-upload-4.2.1.tgz","fileCount":9,"integrity":"sha512-yxlzUV+YPmeIplF3WtQzSwFsUR3r84NX6+zQiHt5dPtUJp1YhCU4T5pcepp4RPPsdiahRTfWywS81gNXrTIhFg==","signatures":[{"sig":"MEQCIFcAOb+ehl94d1N+KTZdCb1ZyZZ+cegWaZvurlJ5pii3AiBOtRlb0kE0ofQJ9v7A4XlQ2yrH2iN5TldEo4XUvyqOAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15740},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"78f5502fc9d8521863288c0157daefe05be56dee","private":false,"scripts":{"lint":"run-s check-types run-lint","test":"nyc ts-node ./test/index.ts","build":"tsc","watch":"tsc-watch --onSuccess tsc","run-lint":"eslint --max-warnings=0 --ext .ts lib","check-types":"tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"wouter125","email":"wouter.vandekamp@chargetrip.com"},"repository":{"url":"git+https://github.com/chargetrip/apollo-federation-file-upload.git","type":"git"},"_npmVersion":"9.6.7","description":"This library makes it easier to support file uploads to your federated micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution. It works by simply redirecting the file uploaded stream to ","directories":{},"_nodeVersion":"18.17.1","dependencies":{"form-data":"^4.0.0","lodash.set":"^4.3.2","graphql-upload":"^15.0.1","lodash.clonedeep":"^4.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","husky":"^8.0.1","eslint":"^8.44.0","newman":"^5.3.2","express":"4.18.1","graphql":"^16.3.0","ts-node":"^10.8.1","prettier":"^2.6.2","tsc-watch":"^6.0.4","typescript":"^4.7.3","@types/node":"^17.0.24","@types/newman":"^5.3.0","apollo-graphql":"^0.9.7","@apollo/gateway":"^2.7.1","@apollo/subgraph":"^2.7.1","@types/lodash.set":"^4.3.7","apollo-server-env":"^4.2.1","apollo-server-core":"^3.12.0","source-map-support":"^0.5.21","eslint-plugin-import":"^2.27.5","apollo-server-express":"^3.12.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","@types/lodash.clonedeep":"^4.5.7","eslint-plugin-filenames":"^1.3.2","@typescript-eslint/parser":"^6.0.0","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@istanbuljs/nyc-config-typescript":"^1.0.2","eslint-import-resolver-typescript":"^3.5.5"},"peerDependencies":{"@apollo/gateway":"^2.7.1"},"_npmOperationalInternal":{"tmp":"tmp/apollo-federation-upload_4.2.1_1710860304044_0.6046792257741724","host":"s3://npm-registry-packages"}},"4.2.2":{"name":"@chargetrip/apollo-federation-upload","version":"4.2.2","keywords":["chargetrip","apollo","federation","file","gateway","graphQL","upload"],"author":{"name":"Chargetrip","email":"dev@chargetrip.com"},"license":"MIT","_id":"@chargetrip/apollo-federation-upload@4.2.2","maintainers":[{"name":"wouter125","email":"wouter.vandekamp@chargetrip.com"},{"name":"timkuilman","email":"tim.kuilman@gmail.com"},{"name":"laurensvdmaas","email":"laurensvdmaas@gmail.com"}],"homepage":"https://chargetrip.com/","bugs":{"url":"https://github.com/chargetrip/apollo-federation-file-upload/issues"},"dist":{"shasum":"c8e530e4cf9cec58210e266fe8010e40235e3393","tarball":"https://registry.npmjs.org/@chargetrip/apollo-federation-upload/-/apollo-federation-upload-4.2.2.tgz","fileCount":9,"integrity":"sha512-iuNezjFXhApGamsX3gKQzNxmvviY4kMVpUFgj2iFPwXJxrcOuNlbkSrvcBogmKtx/BbHCwCXdwMx9JL5X6+39w==","signatures":[{"sig":"MEUCIQDefKY7ZeMySNzrOl/imMg3DT0M70yki89kiJCVNzvQVwIgVHi3NXkETzecyOx+/iwnMBGfBdfk4yUWGP6VVCxycas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15740},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"a6f3f580d827ed4d8d59db7c22d39a3e5269f42b","private":false,"scripts":{"lint":"run-s check-types run-lint","test":"nyc ts-node ./test/index.ts","build":"tsc","watch":"tsc-watch --onSuccess tsc","run-lint":"eslint --max-warnings=0 --ext .ts lib","check-types":"tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"wouter125","email":"wouter.vandekamp@chargetrip.com"},"repository":{"url":"git+https://github.com/chargetrip/apollo-federation-file-upload.git","type":"git"},"_npmVersion":"9.6.7","description":"This library makes it easier to support file uploads to your federated micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution. It works by simply redirecting the file uploaded stream to ","directories":{},"_nodeVersion":"18.17.1","dependencies":{"form-data":"^4.0.0","lodash.set":"^4.3.2","graphql-upload":"^15.0.1","lodash.clonedeep":"^4.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","husky":"^8.0.1","eslint":"^8.44.0","newman":"^5.3.2","express":"4.18.1","graphql":"^16.3.0","ts-node":"^10.8.1","prettier":"^2.6.2","tsc-watch":"^6.0.4","typescript":"^4.7.3","@types/node":"^17.0.24","@types/newman":"^5.3.0","apollo-graphql":"^0.9.7","@apollo/gateway":"^2.7.1","@apollo/subgraph":"^2.7.1","@types/lodash.set":"^4.3.7","apollo-server-core":"^3.12.0","source-map-support":"^0.5.21","eslint-plugin-import":"^2.27.5","apollo-server-express":"^3.12.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","@types/lodash.clonedeep":"^4.5.7","eslint-plugin-filenames":"^1.3.2","@typescript-eslint/parser":"^6.0.0","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@istanbuljs/nyc-config-typescript":"^1.0.2","eslint-import-resolver-typescript":"^3.5.5"},"peerDependencies":{"@apollo/gateway":"^2.7.1","apollo-server-env":"^4.2.1"},"_npmOperationalInternal":{"tmp":"tmp/apollo-federation-upload_4.2.2_1710860718339_0.15051310658030803","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-03-19T13:48:37.996Z","modified":"2024-11-21T13:58:00.000Z","4.2.0":"2024-03-19T13:48:38.283Z","4.2.1":"2024-03-19T14:58:24.185Z","4.2.2":"2024-03-19T15:05:18.538Z"},"bugs":{"url":"https://github.com/chargetrip/apollo-federation-file-upload/issues"},"author":{"name":"Chargetrip","email":"dev@chargetrip.com"},"license":"MIT","homepage":"https://chargetrip.com/","keywords":["chargetrip","apollo","federation","file","gateway","graphQL","upload"],"repository":{"url":"git+https://github.com/chargetrip/apollo-federation-file-upload.git","type":"git"},"description":"This library makes it easier to support file uploads to your federated micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution. It works by simply redirecting the file uploaded stream to ","maintainers":[{"email":"dev@chargetrip.com","name":"chargetrip-dev"},{"email":"wouter.vandekamp@chargetrip.com","name":"wouter125"},{"email":"tim.kuilman@gmail.com","name":"timkuilman"},{"email":"laurensvdmaas@gmail.com","name":"laurensvdmaas"}],"readme":"# Apollo Federation file upload\n\nThis library makes it easier to support file uploads to your federated\nmicro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution.\nIt works by simply redirecting the file uploaded stream to the micro-service.\nThis package does not use third-party services to send the package to your\nmicro-services.\n\n## Apollo Federation V2 Support\n\nPlease, use version 4.0.0+. For Federation V1 use 3.0.0 or earlier.\n\n## Using HTTP Transfer-Encoding: chunked\n\nBy default, the `FileUploadDataSource` uses chunked transfers; we\nadvise that you do not change this setup. However, for some reason\nyou can't support this kind of transfer, one can provide the `useChunkedTransfer`\noption to the `FileUploadDataSource` constructor as `false` to not\nuse chunked transfer (See the example below on setting this property).\nBe advised once again that this can lead to DDOS attacks.\n\n## Preventing CSRF attacks\n\nThis package uses `graphql-upload`, if you want to prevent a CSRF attack you should keep\nthe CSRF prevention feature enabled, and configure your upload clients to send a non-empty\n`Apollo-Require-Preflight` header.\n\nYou can take a look at [Apollo's security guide](https://www.apollographql.com/docs/apollo-server/security/cors/#preventing-cross-site-request-forgery-csrf) for more details.\n\n## How to enable CRSF Prevention\n\n```javascript\nimport { ApolloServer } from 'apollo-server';\n\nconst runServer = async () => {\n  const server = new ApolloServer({\n    /*\n     If activated it will request by default a header with ['x-apollo-operation-name', 'apollo-require-preflight']\n\n     You can also change the allowed headers by passing them to csrfPrevention.requestHeaders\n    */\n    csrfPrevention: true,\n    ...\n  });\n...\n};\n\n...\n```\n\n## Example\n\nOn your Gateway, you must add the `FileUploadDataSource` in order\nto the micro-service be able to receive the uploaded file(s).\n\n\n```javascript\nimport { ApolloServer } from 'apollo-server';\nimport { ApolloGateway } from '@apollo/gateway';\nimport FileUploadDataSource from '@profusion/apollo-federation-upload';\n\nconst runServer = async () => {\n  const server = new ApolloServer({\n    gateway: new ApolloGateway({\n      // Add this line in order to support file uploads.\n      buildService: ({ url }) => new FileUploadDataSource({ url, useChunkedTransfer: true }),\n      serviceList: [\n        /* The services ... */\n      ],\n    })\n  });\n\n  const { url } = await server.listen();\n\n  console.log(`🚀  Server ready at ${url}`);\n};\n\nrunServer().catch(error => {\n  console.error('💥  Failed to start server:', error);\n  process.exit(1);\n});\n```\n","readmeFilename":"README.md"}