{"_id":"@abrevior/apollo-federation-upload","name":"@abrevior/apollo-federation-upload","dist-tags":{"latest":"4.2.0"},"versions":{"4.2.0":{"name":"@abrevior/apollo-federation-upload","version":"4.2.0","main":"./build/index.js","types":"./build/index.d.ts","type":"module","author":{"name":"Guilherme Iscaro","url":"iscaro@profusion.mobi"},"repository":{"type":"git","url":"git+https://github.com/abrevior/apollo-federation-file-upload.git"},"license":"MIT","private":false,"keywords":["apollo","federation","file","gateway","graphQL","upload"],"scripts":{"prepare":"husky install","check-types":"tsc --noEmit","run-lint":"eslint --max-warnings=0 --ext .ts lib","lint":"run-s check-types run-lint","build":"tsc","prepublishOnly":"tsc","test":"NODE_OPTIONS=\"--experimental-specifier-resolution=node --loader ts-node/esm\" c8 --config ./.nycrc ts-node  ./test/index.ts"},"dependencies":{"c8":"^8.0.0","form-data":"^4.0.0","graphql-upload":"^16.0.2","lodash.clonedeep":"^4.5.0","lodash.set":"^4.3.2"},"peerDependencies":{"@apollo/gateway":"^2.0.4"},"devDependencies":{"@apollo/gateway":"^2.4.8","@apollo/subgraph":"^2.4.8","@commitlint/cli":"^17.6.6","@commitlint/config-angular":"^17.6.6","@istanbuljs/nyc-config-typescript":"^1.0.2","@types/lodash.clonedeep":"^4.5.7","@types/lodash.set":"^4.3.7","@types/make-fetch-happen":"^9.0.2","@types/newman":"^5.3.0","@types/node":"^17.0.40","@typescript-eslint/eslint-plugin":"^5.27.1","@typescript-eslint/parser":"^5.27.1","apollo-graphql":"^0.9.7","apollo-server-core":"^3.8.2","apollo-server-env":"^4.2.1","apollo-server-express":"^3.8.2","eslint":"^8.17.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.5.0","eslint-import-resolver-typescript":"^2.7.1","eslint-plugin-filenames":"^1.3.2","eslint-plugin-import":"^2.26.0","eslint-plugin-prettier":"^4.0.0","express":"4.18.1","graphql":"^16.5.0","husky":"^8.0.1","newman":"^5.3.2","npm-run-all":"^4.1.5","nyc":"^15.1.0","prettier":"^2.6.2","source-map-support":"^0.5.21","ts-node":"^10.8.1","typescript":"^4.7.3"},"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 ","bugs":{"url":"https://github.com/abrevior/apollo-federation-file-upload/issues"},"homepage":"https://github.com/abrevior/apollo-federation-file-upload#readme","directories":{"lib":"lib","test":"test"},"gitHead":"e9fc7d79290276d646602f81a56b4f039fbe3ba7","_id":"@abrevior/apollo-federation-upload@4.2.0","_nodeVersion":"16.15.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-StMnRG8Qf+YV1ZTglK8dz9LxH6fysKnbZZbYNFM16PsE9AETk0f8QlUbZ4XX8tpA5xHmWJUQc1pVK7coBdKasQ==","shasum":"6abee3eb1bac15319d90fa85010fc22e6e43f655","tarball":"https://registry.npmjs.org/@abrevior/apollo-federation-upload/-/apollo-federation-upload-4.2.0.tgz","fileCount":13,"unpackedSize":13707,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6290UzJy88BcgbDt3mcLBWLvzfeLS93M8EO2Egi1HqAiBI8k8/8H7AZl3XbkMTce4L8ZpKKPwwd6SD9MCNXInRJw=="}]},"_npmUser":{"name":"abrevior","email":"kolesnk.s@gmail.com"},"maintainers":[{"name":"abrevior","email":"kolesnk.s@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-federation-upload_4.2.0_1687795537389_0.8629002498166618"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-26T16:05:37.328Z","4.2.0":"2023-06-26T16:05:37.581Z","modified":"2023-06-26T16:05:37.766Z"},"maintainers":[{"name":"abrevior","email":"kolesnk.s@gmail.com"}],"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 ","homepage":"https://github.com/abrevior/apollo-federation-file-upload#readme","keywords":["apollo","federation","file","gateway","graphQL","upload"],"repository":{"type":"git","url":"git+https://github.com/abrevior/apollo-federation-file-upload.git"},"author":{"name":"Guilherme Iscaro","url":"iscaro@profusion.mobi"},"bugs":{"url":"https://github.com/abrevior/apollo-federation-file-upload/issues"},"license":"MIT","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## 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 '@abrevior/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"}