profilepicture stored in cloud

master
bhaskar 2 years ago
parent e9a90ca227
commit 3de4ca38b5

1
.gitignore vendored

@ -1,2 +1,3 @@
src/api-docs/api.html
src/config/swagger.js
node_modules/

326
node_modules/.package-lock.json generated vendored

@ -2553,6 +2553,25 @@
"semver": "bin/semver.js"
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
@ -4397,6 +4416,50 @@
"node": ">=6"
}
},
"node_modules/cloudinary": {
"version": "1.37.1",
"resolved": "https://registry.npmjs.org/cloudinary/-/cloudinary-1.37.1.tgz",
"integrity": "sha512-zik0wsNm+4A3lDrS7SDPskKsKceM8MG+DBK7DWEhoQsHkLm/BdJbNWR6JtJCTGImnANi5Md4t3P+G6DZ+92gVg==",
"dependencies": {
"cloudinary-core": "2.13.0",
"core-js": "3.30.2",
"lodash": "4.17.21",
"q": "1.5.1"
},
"engines": {
"node": ">=0.6"
},
"optionalDependencies": {
"proxy-agent": "^5.0.0"
}
},
"node_modules/cloudinary-core": {
"version": "2.13.0",
"resolved": "https://registry.npmjs.org/cloudinary-core/-/cloudinary-core-2.13.0.tgz",
"integrity": "sha512-Nt0Q5I2FtenmJghtC4YZ3MZZbGg1wLm84SsxcuVwZ83OyJqG9CNIGp86CiI6iDv3QobaqBUpOT7vg+HqY5HxEA==",
"peerDependencies": {
"lodash": ">=4.0"
}
},
"node_modules/cloudinary/node_modules/core-js": {
"version": "3.30.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.2.tgz",
"integrity": "sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg==",
"hasInstallScript": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/cloudinary/node_modules/q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==",
"engines": {
"node": ">=0.6.0",
"teleport": ">=0.2.0"
}
},
"node_modules/codepage": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
@ -4874,6 +4937,15 @@
"node": ">=8"
}
},
"node_modules/dezalgo": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz",
"integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==",
"dependencies": {
"asap": "^2.0.0",
"wrappy": "1"
}
},
"node_modules/digest-header": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/digest-header/-/digest-header-1.0.0.tgz",
@ -5178,6 +5250,17 @@
"node": ">=8.3.0"
}
},
"node_modules/express-fileupload": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.4.0.tgz",
"integrity": "sha512-RjzLCHxkv3umDeZKeFeMg8w7qe0V09w3B7oGZprr/oO2H/ISCgNzuqzn7gV3HRWb37GjRk429CCpSLS2KNTqMQ==",
"dependencies": {
"busboy": "^1.6.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -5441,6 +5524,27 @@
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
"integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
},
"node_modules/fastify-file-upload": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fastify-file-upload/-/fastify-file-upload-4.0.0.tgz",
"integrity": "sha512-t0loP7vUY3YI3PMlxpgALBaAuiynd7Tpqcp9VkzYlfGu0CZYWm6mtSj0rSVep5P4udbjH9FY/4lwAPwV8mZZOw==",
"dependencies": {
"@types/node": "^16.11.0",
"express-fileupload": "^1.3.1",
"fastify-plugin": "^3.0.1",
"middie": "^6.0.0"
}
},
"node_modules/fastify-file-upload/node_modules/@types/node": {
"version": "16.18.35",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.35.tgz",
"integrity": "sha512-yqU2Rf94HFZqgHf6Tuyc/IqVD0l3U91KjvypSr1GtJKyrnl6L/kfnxVqN4QOwcF5Zx9tO/HKK+fozGr5AtqA+g=="
},
"node_modules/fastify-file-upload/node_modules/fastify-plugin": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
},
"node_modules/fastify-formbody": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/fastify-formbody/-/fastify-formbody-5.3.0.tgz",
@ -5716,6 +5820,28 @@
"xtend": "^4.0.0"
}
},
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/file-type": {
"version": "18.5.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz",
@ -5850,6 +5976,31 @@
"node": ">= 0.12"
}
},
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"dependencies": {
"fetch-blob": "^3.1.2"
},
"engines": {
"node": ">=12.20.0"
}
},
"node_modules/formidable": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.1.tgz",
"integrity": "sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==",
"dependencies": {
"dezalgo": "^1.0.4",
"hexoid": "^1.0.0",
"once": "^1.4.0",
"qs": "^6.11.0"
},
"funding": {
"url": "https://ko-fi.com/tunnckoCore/commissions"
}
},
"node_modules/formstream": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/formstream/-/formstream-1.1.1.tgz",
@ -6057,6 +6208,25 @@
"node": ">=12"
}
},
"node_modules/gaxios/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/gcp-metadata": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.2.0.tgz",
@ -7361,6 +7531,24 @@
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
},
"node_modules/middie": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/middie/-/middie-6.1.0.tgz",
"integrity": "sha512-akpWXv9QFJ3mXq26kiej7nI4EiID1zEVLq5dxRbrkESMUNNOdTFJjt7Uk9mkcR7D9oR+6km3l3Oah9uQof+Uig==",
"dependencies": {
"fastify-plugin": "^3.0.0",
"path-to-regexp": "^6.1.0",
"reusify": "^1.0.4"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/middie/node_modules/fastify-plugin": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
},
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
@ -7790,6 +7978,56 @@
"safe-buffer": "~5.1.0"
}
},
"node_modules/mv": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz",
"integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==",
"dependencies": {
"mkdirp": "~0.5.1",
"ncp": "~2.0.0",
"rimraf": "~2.4.0"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/mv/node_modules/glob": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
"integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==",
"dependencies": {
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "2 || 3",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
}
},
"node_modules/mv/node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/mv/node_modules/rimraf": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz",
"integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==",
"dependencies": {
"glob": "^6.0.1"
},
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/mz": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
@ -7800,6 +8038,14 @@
"thenify-all": "^1.0.0"
}
},
"node_modules/ncp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
"integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==",
"bin": {
"ncp": "bin/ncp"
}
},
"node_modules/netmask": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
@ -7824,23 +8070,47 @@
"node": ">=6.0.0"
}
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
}
],
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz",
"integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==",
"dependencies": {
"whatwg-url": "^5.0.0"
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/node-fetch/node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
"engines": {
"node": ">= 12"
}
},
"node_modules/node-forge": {
@ -8301,6 +8571,11 @@
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
},
"node_modules/path-to-regexp": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
"integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw=="
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
@ -10159,6 +10434,25 @@
"node": ">= 6"
}
},
"node_modules/teeny-request/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/teeny-request/node_modules/uuid": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
@ -11012,6 +11306,14 @@
"defaults": "^1.0.3"
}
},
"node_modules/web-streams-polyfill": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
"engines": {
"node": ">= 8"
}
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 David Frank
Copyright (c) 2016 - 2020 Node Fetch Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

823
node_modules/node-fetch/README.md generated vendored

File diff suppressed because it is too large Load Diff

@ -1,25 +0,0 @@
"use strict";
// ref: https://github.com/tc39/proposal-global
var getGlobal = function () {
// the only reliable means to get the global object is
// `Function('return this')()`
// However, this causes CSP violations in Chrome apps.
if (typeof self !== 'undefined') { return self; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
throw new Error('unable to locate global object');
}
var global = getGlobal();
module.exports = exports = global.fetch;
// Needed for TypeScript and Webpack.
if (global.fetch) {
exports.default = global.fetch.bind(global);
}
exports.Headers = global.Headers;
exports.Request = global.Request;
exports.Response = global.Response;

File diff suppressed because it is too large Load Diff

1697
node_modules/node-fetch/lib/index.js generated vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,76 +1,131 @@
{
"name": "node-fetch",
"version": "2.6.7",
"description": "A light-weight module that brings window.fetch to node.js",
"main": "lib/index.js",
"browser": "./browser.js",
"module": "lib/index.mjs",
"files": [
"lib/index.js",
"lib/index.mjs",
"lib/index.es.js",
"browser.js"
"name": "node-fetch",
"version": "3.3.1",
"description": "A light-weight module that brings Fetch API to node.js",
"main": "./src/index.js",
"sideEffects": false,
"type": "module",
"files": [
"src",
"@types/index.d.ts"
],
"types": "./@types/index.d.ts",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "mocha",
"coverage": "c8 report --reporter=text-lcov | coveralls",
"test-types": "tsd",
"lint": "xo"
},
"repository": {
"type": "git",
"url": "https://github.com/node-fetch/node-fetch.git"
},
"keywords": [
"fetch",
"http",
"promise",
"request",
"curl",
"wget",
"xhr",
"whatwg"
],
"author": "David Frank",
"license": "MIT",
"bugs": {
"url": "https://github.com/node-fetch/node-fetch/issues"
},
"homepage": "https://github.com/node-fetch/node-fetch",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
},
"devDependencies": {
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "^1.7.1",
"busboy": "^1.4.0",
"c8": "^7.7.2",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-iterator": "^3.0.2",
"chai-string": "^1.5.0",
"coveralls": "^3.1.0",
"form-data": "^4.0.0",
"formdata-node": "^4.2.4",
"mocha": "^9.1.3",
"p-timeout": "^5.0.0",
"stream-consumers": "^1.0.1",
"tsd": "^0.14.0",
"xo": "^0.39.1"
},
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"tsd": {
"cwd": "@types",
"compilerOptions": {
"esModuleInterop": true
}
},
"xo": {
"envs": [
"node",
"browser"
],
"engines": {
"node": "4.x || >=6.0.0"
},
"scripts": {
"build": "cross-env BABEL_ENV=rollup rollup -c",
"prepare": "npm run build",
"test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js",
"report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
"coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json"
},
"repository": {
"type": "git",
"url": "https://github.com/bitinn/node-fetch.git"
},
"keywords": [
"fetch",
"http",
"promise"
"ignores": [
"example.js"
],
"author": "David Frank",
"license": "MIT",
"bugs": {
"url": "https://github.com/bitinn/node-fetch/issues"
"rules": {
"complexity": 0,
"import/extensions": 0,
"import/no-useless-path-segments": 0,
"import/no-anonymous-default-export": 0,
"import/no-named-as-default": 0,
"unicorn/import-index": 0,
"unicorn/no-array-reduce": 0,
"unicorn/prefer-node-protocol": 0,
"unicorn/numeric-separators-style": 0,
"unicorn/explicit-length-check": 0,
"capitalized-comments": 0,
"node/no-unsupported-features/es-syntax": 0,
"@typescript-eslint/member-ordering": 0
},
"homepage": "https://github.com/bitinn/node-fetch",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
"overrides": [
{
"files": "test/**/*.js",
"envs": [
"node",
"mocha"
],
"rules": {
"max-nested-callbacks": 0,
"no-unused-expressions": 0,
"no-warning-comments": 0,
"new-cap": 0,
"guard-for-in": 0,
"unicorn/no-array-for-each": 0,
"unicorn/prevent-abbreviations": 0,
"promise/prefer-await-to-then": 0,
"ava/no-import-test-files": 0
}
},
"devDependencies": {
"@ungap/url-search-params": "^0.1.2",
"abort-controller": "^1.1.0",
"abortcontroller-polyfill": "^1.3.0",
"babel-core": "^6.26.3",
"babel-plugin-istanbul": "^4.1.6",
"babel-preset-env": "^1.6.1",
"babel-register": "^6.16.3",
"chai": "^3.5.0",
"chai-as-promised": "^7.1.1",
"chai-iterator": "^1.1.1",
"chai-string": "~1.3.0",
"codecov": "3.3.0",
"cross-env": "^5.2.0",
"form-data": "^2.3.3",
"is-builtin-module": "^1.0.0",
"mocha": "^5.0.0",
"nyc": "11.9.0",
"parted": "^0.1.1",
"promise": "^8.0.3",
"resumer": "0.0.0",
"rollup": "^0.63.4",
"rollup-plugin-babel": "^3.0.7",
"string-to-arraybuffer": "^1.0.2",
"teeny-request": "3.7.0"
}
}
]
},
"runkitExampleFilename": "example.js",
"release": {
"branches": [
"+([0-9]).x",
"main",
"next",
{
"name": "beta",
"prerelease": true
}
]
}
}

549
package-lock.json generated

@ -21,6 +21,7 @@
"body-parser": "^1.19.0",
"boom": "^7.3.0",
"chalk": "^4.1.0",
"cloudinary": "^1.37.1",
"cors": "^2.8.5",
"csvjson": "^5.1.0",
"csvtojson": "^2.0.10",
@ -30,6 +31,7 @@
"fastify-auth": "^1.0.1",
"fastify-cors": "^5.2.0",
"fastify-env": "^2.2.0",
"fastify-file-upload": "^4.0.0",
"fastify-formbody": "^5.3.0",
"fastify-jwt": "^4.2.0",
"fastify-multer": "^2.0.2",
@ -38,6 +40,7 @@
"fastify-swagger": "^5.2.0",
"file-type": "^18.5.0",
"form-data": "^2.3.3",
"formidable": "^2.1.1",
"fs": "^0.0.1-security",
"generate-password": "^1.6.0",
"gridfile": "^1.1.3",
@ -48,7 +51,9 @@
"mongodb": "^5.0.1",
"mongoose": "^5.11.8",
"multer": "^1.4.5-lts.1",
"mv": "^2.1.1",
"node-cron": "^3.0.2",
"node-fetch": "^3.3.1",
"node-schedule": "^2.1.1",
"nodemon": "^2.0.20",
"nunjucks": "^3.2.3",
@ -2611,6 +2616,25 @@
"semver": "bin/semver.js"
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
@ -4455,6 +4479,50 @@
"node": ">=6"
}
},
"node_modules/cloudinary": {
"version": "1.37.1",
"resolved": "https://registry.npmjs.org/cloudinary/-/cloudinary-1.37.1.tgz",
"integrity": "sha512-zik0wsNm+4A3lDrS7SDPskKsKceM8MG+DBK7DWEhoQsHkLm/BdJbNWR6JtJCTGImnANi5Md4t3P+G6DZ+92gVg==",
"dependencies": {
"cloudinary-core": "2.13.0",
"core-js": "3.30.2",
"lodash": "4.17.21",
"q": "1.5.1"
},
"engines": {
"node": ">=0.6"
},
"optionalDependencies": {
"proxy-agent": "^5.0.0"
}
},
"node_modules/cloudinary-core": {
"version": "2.13.0",
"resolved": "https://registry.npmjs.org/cloudinary-core/-/cloudinary-core-2.13.0.tgz",
"integrity": "sha512-Nt0Q5I2FtenmJghtC4YZ3MZZbGg1wLm84SsxcuVwZ83OyJqG9CNIGp86CiI6iDv3QobaqBUpOT7vg+HqY5HxEA==",
"peerDependencies": {
"lodash": ">=4.0"
}
},
"node_modules/cloudinary/node_modules/core-js": {
"version": "3.30.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.2.tgz",
"integrity": "sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg==",
"hasInstallScript": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/cloudinary/node_modules/q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==",
"engines": {
"node": ">=0.6.0",
"teleport": ">=0.2.0"
}
},
"node_modules/codepage": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
@ -4932,6 +5000,15 @@
"node": ">=8"
}
},
"node_modules/dezalgo": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz",
"integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==",
"dependencies": {
"asap": "^2.0.0",
"wrappy": "1"
}
},
"node_modules/digest-header": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/digest-header/-/digest-header-1.0.0.tgz",
@ -5236,6 +5313,17 @@
"node": ">=8.3.0"
}
},
"node_modules/express-fileupload": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.4.0.tgz",
"integrity": "sha512-RjzLCHxkv3umDeZKeFeMg8w7qe0V09w3B7oGZprr/oO2H/ISCgNzuqzn7gV3HRWb37GjRk429CCpSLS2KNTqMQ==",
"dependencies": {
"busboy": "^1.6.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -5499,6 +5587,27 @@
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
"integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
},
"node_modules/fastify-file-upload": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fastify-file-upload/-/fastify-file-upload-4.0.0.tgz",
"integrity": "sha512-t0loP7vUY3YI3PMlxpgALBaAuiynd7Tpqcp9VkzYlfGu0CZYWm6mtSj0rSVep5P4udbjH9FY/4lwAPwV8mZZOw==",
"dependencies": {
"@types/node": "^16.11.0",
"express-fileupload": "^1.3.1",
"fastify-plugin": "^3.0.1",
"middie": "^6.0.0"
}
},
"node_modules/fastify-file-upload/node_modules/@types/node": {
"version": "16.18.35",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.35.tgz",
"integrity": "sha512-yqU2Rf94HFZqgHf6Tuyc/IqVD0l3U91KjvypSr1GtJKyrnl6L/kfnxVqN4QOwcF5Zx9tO/HKK+fozGr5AtqA+g=="
},
"node_modules/fastify-file-upload/node_modules/fastify-plugin": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
},
"node_modules/fastify-formbody": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/fastify-formbody/-/fastify-formbody-5.3.0.tgz",
@ -5774,6 +5883,28 @@
"xtend": "^4.0.0"
}
},
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/file-type": {
"version": "18.5.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz",
@ -5908,6 +6039,31 @@
"node": ">= 0.12"
}
},
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"dependencies": {
"fetch-blob": "^3.1.2"
},
"engines": {
"node": ">=12.20.0"
}
},
"node_modules/formidable": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.1.tgz",
"integrity": "sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==",
"dependencies": {
"dezalgo": "^1.0.4",
"hexoid": "^1.0.0",
"once": "^1.4.0",
"qs": "^6.11.0"
},
"funding": {
"url": "https://ko-fi.com/tunnckoCore/commissions"
}
},
"node_modules/formstream": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/formstream/-/formstream-1.1.1.tgz",
@ -6128,6 +6284,25 @@
"node": ">=12"
}
},
"node_modules/gaxios/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/gcp-metadata": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.2.0.tgz",
@ -7432,6 +7607,24 @@
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
},
"node_modules/middie": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/middie/-/middie-6.1.0.tgz",
"integrity": "sha512-akpWXv9QFJ3mXq26kiej7nI4EiID1zEVLq5dxRbrkESMUNNOdTFJjt7Uk9mkcR7D9oR+6km3l3Oah9uQof+Uig==",
"dependencies": {
"fastify-plugin": "^3.0.0",
"path-to-regexp": "^6.1.0",
"reusify": "^1.0.4"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/middie/node_modules/fastify-plugin": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
},
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
@ -7861,6 +8054,56 @@
"safe-buffer": "~5.1.0"
}
},
"node_modules/mv": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz",
"integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==",
"dependencies": {
"mkdirp": "~0.5.1",
"ncp": "~2.0.0",
"rimraf": "~2.4.0"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/mv/node_modules/glob": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
"integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==",
"dependencies": {
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "2 || 3",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
}
},
"node_modules/mv/node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/mv/node_modules/rimraf": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz",
"integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==",
"dependencies": {
"glob": "^6.0.1"
},
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/mz": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
@ -7871,6 +8114,14 @@
"thenify-all": "^1.0.0"
}
},
"node_modules/ncp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
"integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==",
"bin": {
"ncp": "bin/ncp"
}
},
"node_modules/netmask": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
@ -7895,23 +8146,47 @@
"node": ">=6.0.0"
}
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
}
],
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz",
"integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==",
"dependencies": {
"whatwg-url": "^5.0.0"
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
"node": "4.x || >=6.0.0"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/node-fetch/node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
"engines": {
"node": ">= 12"
}
},
"node_modules/node-forge": {
@ -8372,6 +8647,11 @@
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
},
"node_modules/path-to-regexp": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
"integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw=="
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
@ -10230,6 +10510,25 @@
"node": ">= 6"
}
},
"node_modules/teeny-request/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/teeny-request/node_modules/uuid": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
@ -11083,6 +11382,14 @@
"defaults": "^1.0.3"
}
},
"node_modules/web-streams-polyfill": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
"engines": {
"node": ">= 8"
}
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
@ -13157,6 +13464,14 @@
}
}
},
"node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"requires": {
"whatwg-url": "^5.0.0"
}
},
"semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
@ -14496,6 +14811,36 @@
"shallow-clone": "^3.0.0"
}
},
"cloudinary": {
"version": "1.37.1",
"resolved": "https://registry.npmjs.org/cloudinary/-/cloudinary-1.37.1.tgz",
"integrity": "sha512-zik0wsNm+4A3lDrS7SDPskKsKceM8MG+DBK7DWEhoQsHkLm/BdJbNWR6JtJCTGImnANi5Md4t3P+G6DZ+92gVg==",
"requires": {
"cloudinary-core": "2.13.0",
"core-js": "3.30.2",
"lodash": "4.17.21",
"proxy-agent": "^5.0.0",
"q": "1.5.1"
},
"dependencies": {
"core-js": {
"version": "3.30.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.2.tgz",
"integrity": "sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg=="
},
"q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw=="
}
}
},
"cloudinary-core": {
"version": "2.13.0",
"resolved": "https://registry.npmjs.org/cloudinary-core/-/cloudinary-core-2.13.0.tgz",
"integrity": "sha512-Nt0Q5I2FtenmJghtC4YZ3MZZbGg1wLm84SsxcuVwZ83OyJqG9CNIGp86CiI6iDv3QobaqBUpOT7vg+HqY5HxEA==",
"requires": {}
},
"codepage": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
@ -14845,6 +15190,15 @@
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
"integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w=="
},
"dezalgo": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz",
"integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==",
"requires": {
"asap": "^2.0.0",
"wrappy": "1"
}
},
"digest-header": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/digest-header/-/digest-header-1.0.0.tgz",
@ -15089,6 +15443,14 @@
"uuid": "^8.3.0"
}
},
"express-fileupload": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.4.0.tgz",
"integrity": "sha512-RjzLCHxkv3umDeZKeFeMg8w7qe0V09w3B7oGZprr/oO2H/ISCgNzuqzn7gV3HRWb37GjRk429CCpSLS2KNTqMQ==",
"requires": {
"busboy": "^1.6.0"
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -15358,6 +15720,29 @@
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
"integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
},
"fastify-file-upload": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fastify-file-upload/-/fastify-file-upload-4.0.0.tgz",
"integrity": "sha512-t0loP7vUY3YI3PMlxpgALBaAuiynd7Tpqcp9VkzYlfGu0CZYWm6mtSj0rSVep5P4udbjH9FY/4lwAPwV8mZZOw==",
"requires": {
"@types/node": "^16.11.0",
"express-fileupload": "^1.3.1",
"fastify-plugin": "^3.0.1",
"middie": "^6.0.0"
},
"dependencies": {
"@types/node": {
"version": "16.18.35",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.35.tgz",
"integrity": "sha512-yqU2Rf94HFZqgHf6Tuyc/IqVD0l3U91KjvypSr1GtJKyrnl6L/kfnxVqN4QOwcF5Zx9tO/HKK+fozGr5AtqA+g=="
},
"fastify-plugin": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
}
}
},
"fastify-formbody": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/fastify-formbody/-/fastify-formbody-5.3.0.tgz",
@ -15587,6 +15972,15 @@
"xtend": "^4.0.0"
}
},
"fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"requires": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
}
},
"file-type": {
"version": "18.5.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz",
@ -15677,6 +16071,25 @@
"mime-types": "^2.1.12"
}
},
"formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"requires": {
"fetch-blob": "^3.1.2"
}
},
"formidable": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.1.tgz",
"integrity": "sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==",
"requires": {
"dezalgo": "^1.0.4",
"hexoid": "^1.0.0",
"once": "^1.4.0",
"qs": "^6.11.0"
}
},
"formstream": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/formstream/-/formstream-1.1.1.tgz",
@ -15854,6 +16267,16 @@
"https-proxy-agent": "^5.0.0",
"is-stream": "^2.0.0",
"node-fetch": "^2.6.7"
},
"dependencies": {
"node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"requires": {
"whatwg-url": "^5.0.0"
}
}
}
},
"gcp-metadata": {
@ -16907,6 +17330,23 @@
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
},
"middie": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/middie/-/middie-6.1.0.tgz",
"integrity": "sha512-akpWXv9QFJ3mXq26kiej7nI4EiID1zEVLq5dxRbrkESMUNNOdTFJjt7Uk9mkcR7D9oR+6km3l3Oah9uQof+Uig==",
"requires": {
"fastify-plugin": "^3.0.0",
"path-to-regexp": "^6.1.0",
"reusify": "^1.0.4"
},
"dependencies": {
"fastify-plugin": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
}
}
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
@ -17225,6 +17665,46 @@
}
}
},
"mv": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz",
"integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==",
"requires": {
"mkdirp": "~0.5.1",
"ncp": "~2.0.0",
"rimraf": "~2.4.0"
},
"dependencies": {
"glob": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
"integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==",
"requires": {
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "2 || 3",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"requires": {
"minimist": "^1.2.6"
}
},
"rimraf": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz",
"integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==",
"requires": {
"glob": "^6.0.1"
}
}
}
},
"mz": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
@ -17235,6 +17715,11 @@
"thenify-all": "^1.0.0"
}
},
"ncp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
"integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA=="
},
"netmask": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
@ -17253,12 +17738,26 @@
"uuid": "8.3.2"
}
},
"node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
},
"node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz",
"integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==",
"requires": {
"whatwg-url": "^5.0.0"
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"dependencies": {
"data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="
}
}
},
"node-forge": {
@ -17592,6 +18091,11 @@
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
},
"path-to-regexp": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
"integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw=="
},
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
@ -19027,6 +19531,14 @@
"debug": "4"
}
},
"node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
"requires": {
"whatwg-url": "^5.0.0"
}
},
"uuid": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
@ -19700,6 +20212,11 @@
"defaults": "^1.0.3"
}
},
"web-streams-polyfill": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q=="
},
"webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",

@ -22,6 +22,7 @@
"body-parser": "^1.19.0",
"boom": "^7.3.0",
"chalk": "^4.1.0",
"cloudinary": "^1.37.1",
"cors": "^2.8.5",
"csvjson": "^5.1.0",
"csvtojson": "^2.0.10",
@ -31,6 +32,7 @@
"fastify-auth": "^1.0.1",
"fastify-cors": "^5.2.0",
"fastify-env": "^2.2.0",
"fastify-file-upload": "^4.0.0",
"fastify-formbody": "^5.3.0",
"fastify-jwt": "^4.2.0",
"fastify-multer": "^2.0.2",
@ -39,6 +41,7 @@
"fastify-swagger": "^5.2.0",
"file-type": "^18.5.0",
"form-data": "^2.3.3",
"formidable": "^2.1.1",
"fs": "^0.0.1-security",
"generate-password": "^1.6.0",
"gridfile": "^1.1.3",
@ -49,7 +52,9 @@
"mongodb": "^5.0.1",
"mongoose": "^5.11.8",
"multer": "^1.4.5-lts.1",
"mv": "^2.1.1",
"node-cron": "^3.0.2",
"node-fetch": "^3.3.1",
"node-schedule": "^2.1.1",
"nodemon": "^2.0.20",
"nunjucks": "^3.2.3",

@ -1,13 +1,13 @@
{
"type": "service_account",
"project_id": "arminta-tank",
"private_key_id": "b97cfb067a68e88197dd4b578de8baefe739ef82",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCvtJCiabxU2rI+\nhEkjVEu/0nHv+vyU3O2x/3K2sJXMVHvwmRpncOfLXsveyIOi69wUkdTMQ2ghCQBA\nwYzcX0eQ7Txq8AuuksHTanGP4ZZgHuS2YjlQe67BYbMsA/B7DwcSKypYXmw2C8aF\nraXYO8xq1lltB2x6d8CEBttBFay3mHH2M2H+a+0emFuOp0IgurNZ69sWblx9GKpM\nx4D+gxGPT400PO/TDt799Z2hXRa5262bA4MV8v6jzq4Q8KN8+Systbhv+1a83AWd\n+M21ffMC4HmvNG4JqAefoBAl4uQpvHKVo4QNZvV+bP99nZ4Zj95fED0vTC+GptZ5\no8wG5p4BAgMBAAECggEACqU8Ud3JhYPcUqu3xXBkGES5JuDAXMnTrDIZnnpdkhQg\nj/3Ltu6VGaoWPKrOCHEFPBkPkTpoiL9bjMDZTqkGbFBGVcWSVJ7zR8KSS7UPlAZt\nJaR2++KJfpGTfihFMcSB4Xq8aZ8ba+0b16GzK5IobwTqhT/C1ZrzruAeOL/WH4eu\nxmp5PeXdUVaP6eF+5fzaBFxAo2uNSyhe8ckFXiYO/tmmUBriEc/NDs8/mbpkqMM8\nCcIaVt20eelue6pYXh/3PEPcYFGSISbY1gzQXinvH8keT0YckG+VcKYl+LKaLcz0\nYVw6oJf/0b4UUOH/tpdVDxzSslYap8DRPBhwEkjTUQKBgQD3kZolBkipD7fimEOg\neq/U6CQ5NhBGAMyMztlGZpOHVPYXrf5IVSEuhJpb/vfwaz2PzJuJvlf7Zh8B89dL\nKCLbHKSRA6pDfcNCMmco7FjV+pDqWgZN6emf7QoSdwcjLzU7lcFz3EhCRSji8q7O\nc/eMuXlk1o+ci/QUnFrWP7xGcQKBgQC1sG4tL5PEu2mzuH9YO03kSzMpD14mjtKS\n8U9wgG6jW6DGdxnp8kkSRIJ1GNPQ2dQe9Y1PMX3K6ab9zl1yK7C4UzX8o1n0oLrN\nt97WsWAej8WdazoOJjSlwvK6EL0tet49skulUOaVGXandYkxOmomp8K9LWVQst6h\nrqDH7Ho4kQKBgQDhFq7xrs7td28XRJ1oEWRAzXfx1GfjXeKcu4zs52KHDwZY7Ude\n+Jectc+qiR1gqABm9/8Ks9dGqcjTe6JpoOpgEaDGgHCTwIqBa1ZD7O+wTYroqEVH\nHb/eOiSIOVRx9wANVtF2x/ei2UKdZUzuRJ30gsYOms4j5VNcUfR9C6Hg4QKBgAu0\naASlMgHUiQS4+As5FtWEOrGEee5F+S7aOOHohDgl6P+gIJ0/rJFutHDSvqKPxeiQ\nrR/S8mWmE8n6B28ZfXMCeVHjPCJUUHR8SfDO0IBnhrWTeNP8hhu/qV9vQKCzb6nN\n2K23voMQduJm4gW326rN1+/UAtjmDQ2hcF4wz9bhAoGBAJVeHGgDg+JV0nGBIbTG\nEYxNR4FsJlOZWpMvZAbtQDMiysBJeQpYjsMfDKJE55q2BbXosd4QG5sGGO2g+DTb\nQNy/OuY7hBjbq5kQDxCTQoaQGQQHBr5Ya3H/NbnUUA4vyCHsyKtUU3H2Yy/8JW5F\nTNwSI7WOrXbCFCtpbqKwQT3U\n-----END PRIVATE KEY-----\n",
"client_email": "515216557013-compute@developer.gserviceaccount.com",
"client_id": "101537158222215816036",
"private_key_id": "2b839b943cace0e3c08a798c5dafc02de8bbbb0f",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC56npGq7vK1oq0\nim6L60xB7BmwTdVivxw3LhUFbMd6yCPbRkIXLWQp5BFM5sbJ7OYZW4dBaMwQDVvo\nDB13qjvB7z4H1Vnl3vc1s5vCXWST6jBxh4lFG0i7P2G030QGpgzbFO7eVqFPqTiT\n5CQRftlZY14eqlibu2zfiac7ZZeXm8kg2etPEtdX0S8dtDcfMujm0ReyZpiEPnS5\n4GTF8I33ta36aYx5LDXFeQL0dvNvL+Y8i9rMe8jhaHVQAFTTFlPEw7jHucbg6tQY\nXT5kn3aZj6wF7qcv3ns3At14Ldrv/8rsUjBNkQLvLRONl9fPBWvbqsXCtqAlU/M0\nrCsoBW3fAgMBAAECggEANGyZ7jOe0KOOmTov0eSXrD8XP0+zTBT3r9eetdjmpwio\nk7xMBp0WEXnuJvEsPORAPgZBLYCPijc6I0THSmcGUrlTlIHkx50HuGzdDwGmys7O\nujSt0H7RE3vb4VTTqcxI874DXU6wTfY5rfo28XgDceFDOQJv2foPyTjXnzgWdvlL\nX+7mGCcNqJarjB6WfQSh2CyaQLWJNpJCBhS4X6r/01k7f2xbU+FmqFn/REBHAaEG\nwR/Np5dNiCcKwqxuSZ0ARNU2jtSnlA/dezNsa6U/HlnLTzITNO/Sg8ElBuq8lGLI\nF//K6bRD231GaAfk+u0Tw7/EL3jytDrfuWifDJuxgQKBgQDsUBhebNzRKSYxwzC2\nHj538c4YXvxrE+mkq0nJRB8wkBfXqwmb5yq7KLK7O1OFs9i5toJPL1r2x0LVxD87\njvgm42w5gesjRsdDwYpMd/a0o+MLUFbB0S4pE8W8RoH/chdCGdvMhhwDJKkj5qFC\nipAUi8mq6pGkn/GJV9uklnd2JQKBgQDJZ43S02Z74Xm6KA9TZ92gp63aIHB3vmm/\n+6eyDdnLXRLhtzesTOXZV2P8Y1468ty1sSrPHPLehZTZQrvEEhdjmeVp8FGK4PZT\nrUDGfrM/XGTnEWP/bUZ+MgnO2h/zcQ/QfFrdjWW9TQxxdnJNalTHAnnuFSL1IeY8\nzy24loDqswKBgQCPAI0unvwlipw1YuQYYUb2OJq6PsjLV3p9DraRGCszrQ7wkO04\nrfQ63A8EpIsPjtzozVwf5Q1L5xs31xFYzlS228sDJe6QI2W0R+uUCMh/WemsUAqg\nMSCY9QEkxRon5ffTJWjQZJuQ/19nfUo6xTUZado5FsfZ8nws28Dr4a4bDQKBgB5y\n3WomM7Q+3lxaehat+T+0mgAEL3yq+OnhbfTpSygHpjchr/UImydEowUhMLnQxbVi\nV4qAYedqYpqGEEUQRyDzv09I2csZP6Re6RAZT5ggq9CTPH79Uk752anAKFxxl2Z5\npnMgUWVRJLRyp800aiS8JxrrbyGIQnqnB86EUnEpAoGBAMLc4ENX3E++ziVXKvz6\neKajOwTe9+WKHOwkrwJwiozsBRHyVGvv3R7xLmZnVstEvMeE5FTEgvkdMBTJr0tT\noBwucjRQDWbJmGGTA+VNoo4e4Zsw/LqglSMIN1TdZY6aXbE0amWBsIdeuXec6/0r\nbGOzmjvOBYjhS8gGVOn3Iuz2\n-----END PRIVATE KEY-----\n",
"client_email": "arminta-tank@appspot.gserviceaccount.com",
"client_id": "116790800153942027533",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/515216557013-compute%40developer.gserviceaccount.com",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/arminta-tank%40appspot.gserviceaccount.com",
"universe_domain": "googleapis.com"
}

@ -100,7 +100,7 @@ fastify.register(customJwtAuth);
// support login using application/x-www-form-urlencoded so users can login via a web form in addition to api
fastify.register(require("fastify-formbody"));
// fastify.register(require("fastify-formbody"));
// fastify.register(require('fastify-multipart'))
// fastify.register(require("fastify-cors"), {
// // put your options here
@ -325,9 +325,9 @@ fastify.get('/testtemp', (req, reply) => {
reply.view('layouts/main', {});
});
const multipart = require('fastify-multipart');
// const multipart = require('fastify-multipart');
fastify.register(multipart);
// fastify.register(multipart);
//fastify-auth plugin is required so we can define routes in seperate files and verify jwt supplied in preHandlers for each request.
//const multer = require("fastify-multer");
fastify.register(require("fastify-auth"));
@ -357,201 +357,185 @@ fastify.register(require("./routes/forTestingRoute"));
const {Storage} = require('@google-cloud/storage');
const { Supplier, profilePictureSupplier } = require("./models/supplier");
const multer = require('fastify-multer');
fastify.register(require('fastify-formbody'));
// fastify.register(multer.contentParser);
// const multipart = require('fastify-multipart');
// fastify.register(multipart);
const gc = new Storage({
keyFilename : path.join(__dirname, "../src/arminta-tank-keyFile.json"),
projectId : 'arminta-tank'
})
const storage = new Storage({
keyFilename : path.join(__dirname, "../src/arminta-tank-keyFile.json"),
projectId : 'arminta-tank'
});
// console.log(storage)
// const cloudinary = require('cloudinary').v2;
// const FormData = require('form-data');
// const mv = require('mv');
// cloudinary.config({
// cloud_name: 'dalqpseol',
// api_key: '121595628244491',
// api_secret: 'jnuny_0fMYovQS0eyvIVXQTl4RY'
// });
const bucketName = 'arminta_profile_pictures';
// Register fastify-file-upload plugin
fastify.register(require('fastify-multipart'));
// Function to upload an image to the bucket
// async function uploadImageToBucket(imagePath) {
// const bucket = gc.bucket(bucketName);
// const imageFile = bucket.file(path.basename(imagePath));
// fastify.post('/upload', async (request, reply) => {
// try {
// await imageFile.save(imagePath);
// console.log('Image uploaded successfully.');
// } catch (error) {
// console.error('Failed to upload image:', error);
// const data = await request.file();
// // Generate a unique file name
// const fileName = `${data.filename}`;
// const filePath = `${fileName}`;
// // Move the file to a temporary location
// const writeStream = fs.createWriteStream(filePath);
// data.file.pipe(writeStream);
// writeStream.on('close', () => {
// // Upload the image to Cloudinary
// cloudinary.uploader.upload(filePath, (error, result) => {
// if (error) {
// reply.code(500).send({ error: 'Failed to upload file to Cloudinary' });
// } else {
// // Get the public URL of the uploaded image
// const publicUrl = result.secure_url;
// // Remove the temporary file
// fs.unlinkSync(filePath);
// // Return the public URL
// reply.send({ url: publicUrl });
// }
// });
// });
// writeStream.on('error', (err) => {
// reply.code(500).send({ error: 'Failed to move file' });
// });
// } catch (err) {
// reply.code(500).send({ error: 'An error occurred' });
// }
// }
// });
// async function uploadImageToBucket(imagePath, supplierId) {
// const bucket = gc.bucket(bucketName);
// const imageFile = bucket.file(path.basename(imagePath));
// fastify.post('/upload/:supplierId', async (request, reply) => {
// try {
// await imageFile.save(imagePath);
// console.log('Image uploaded successfully.');
// // Assuming you have a Supplier model/schema defined
// const supplier = await Supplier.findOne({ supplierId });
// if (!supplier) {
// console.error('Supplier not found.');
// return;
// }
// // Update the supplier document with the image URL
// supplier.imageUrl = `https://storage.googleapis.com/${bucketName}/${imageFile.name}`;
// await supplier.save();
// console.log('Image URL saved in the supplier document.');
// } catch (error) {
// console.error('Failed to upload image or save the URL:', error);
// const supplierId = request.params.supplierId;
// const data = await request.file();
// // Generate a unique file name
// const fileName = `${data.filename}`;
// const filePath = `${fileName}`;
// // Move the file to a temporary location
// const writeStream = fs.createWriteStream(filePath);
// data.file.pipe(writeStream);
// writeStream.on('close', () => {
// // Upload the image to Cloudinary
// cloudinary.uploader.upload(filePath, (error, result) => {
// if (error) {
// reply.code(500).send({ error: 'Failed to upload file to Cloudinary' });
// } else {
// // Get the public URL of the uploaded image
// const publicUrl = result.secure_url;
// // Remove the temporary file
// fs.unlinkSync(filePath);
// // Store the URL in the database
// // Assuming you have a database connection and a ProfilePictureSupplier model
// profilePictureSupplier.findOneAndUpdate(
// { supplierId },
// { picture: publicUrl },
// { new: true, upsert: true },
// (error, picture) => {
// if (error) {
// reply.code(500).send({ error: 'Failed to update database' });
// } else {
// // Return the public URL
// reply.send({ picture: publicUrl });
// }
// }
// );
// }
// });
// });
// writeStream.on('error', (err) => {
// reply.code(500).send({ error: 'Failed to move file' });
// });
// } catch (err) {
// reply.code(500).send({ error: 'An error occurred' });
// }
// }
// const imagePath = '/home/bhaskar/Desktop/download.jpeg';
// const supplierId = 'AWSSSUR67'; // Replace with the actual supplier ID
// uploadImageToBucket(imagePath, supplierId)
// .then(() => {
// console.log('Image upload and update completed.');
// })
// .catch((error) => {
// console.error('Error occurred during image upload and update:', error);
// });
// const imagePath = '/home/bhaskar/Desktop/download.jpeg';
// uploadImageToBucket(imagePath);
// const imagePath = '/home/bhaskar/Desktop/download.jpeg';
// uploadImageToBucket(imagePath);
const acceptedFormats = ['image/jpeg', 'image/png'];
function truncateString(str, maxLength) {
if (str.length <= maxLength) {
return str;
}
return str.slice(0, maxLength);
}
fastify.post('/api/upload-image/:supplierId', {
schema: {
tags: ['Supplier'],
description: 'Upload Supplier profile picture',
params: {
type: 'object',
properties: {
supplierId: { type: 'string', description: 'ID of the supplier' },
},
},
body: {
type: 'object',
properties: {
imagePath: { type: 'string', description: 'Path of the image to upload' },
},
},
response: {
200: {
type: 'object',
properties: {
message: { type: 'string', description: 'Upload and update completed message' },
profilePicture: {
type: 'object',
properties: {
supplierId: { type: 'string', description: 'ID of the supplier' },
picture: { type: 'string', description: 'URL of the profile picture' },
},
},
},
},
404: {
type: 'object',
properties: {
error: { type: 'string', description: 'Supplier not found error message' },
},
},
500: {
type: 'object',
properties: {
error: { type: 'string', description: 'Failed to upload image error message' },
},
},
},
},
handler: async (request, reply) => {
const { supplierId } = request.params;
const imagePath = request.body.imagePath;
const bucket = gc.bucket(bucketName);
const imageFile = bucket.file(path.basename(imagePath));
// });
try {
// Generate a unique filename
const uniqueFilename = `${Date.now()}_${path.basename(imagePath)}`;
// Truncate the unique filename to a specified length
const maxFilenameLength = 50; // Specify the maximum length for the filename
const truncatedFilename = truncateString(uniqueFilename, maxFilenameLength);
const uploadPath = path.join(path.dirname(imagePath), truncatedFilename);
fastify.post('/api/uploads/:supplierId', async (request, reply) => {
try {
const supplierId = request.params.supplierId;
const data = await request.file();
await imageFile.save(uploadPath);
console.log('Image uploaded successfully.');
// Generate a unique file name
const fileName = `${data.filename}`;
// await imageFile.save(imagePath);
// console.log('Image uploaded successfully.');
// Define the destination bucket and file path
const bucketName = 'arminta_profile_pictures';
const filePath = `${fileName}`;
const imageUrl = `https://storage.googleapis.com/${bucketName}/${imageFile.name}`;
console.log("image---", imageUrl)
// Create a write stream to the destination file in the bucket
const writeStream = storage.bucket(bucketName).file(filePath).createWriteStream();
// Find the supplier document
const supplier = await Supplier.findOne({ supplierId });
if (!supplier) {
console.error('Supplier not found.');
reply.code(404).send({ error: 'Supplier not found' });
return;
}
// Pipe the file data to the write stream
data.file.pipe(writeStream);
// Create or update the profile picture for the supplier
let profilePicture = await profilePictureSupplier.findOne({ supplierId: supplierId });
console.log("profilePicture", profilePicture)
if (!profilePicture) {
profilePicture = new profilePictureSupplier({
supplierId: supplierId,
picture: imageUrl,
});
} else {
profilePicture.picture = imageUrl;
writeStream.on('finish', async () => {
try {
// Make the uploaded file publicly accessible
await storage.bucket(bucketName).file(filePath).makePublic();
const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`;
profilePictureSupplier.findOneAndUpdate(
{ supplierId },
{ picture: publicUrl },
{ new: true, upsert: true },
(error, picture) => {
if (error) {
reply.code(500).send({ error: 'Failed to update database' });
} else {
// Return the public URL
reply.send({ picture: publicUrl });
}
}
);
} catch (error) {
reply.code(500).send({ error: 'Failed to make file public' });
}
});
await profilePicture.save();
console.log("profilePicture", profilePicture.picture)
console.log('Image URL saved in the profile picture document.');
reply.send({
message: 'Image upload and update completed.',
profilePicture: {
supplierId: profilePicture.supplierId,
picture: profilePicture.picture,
},
});
} catch (error) {
console.error('Failed to upload image or save the URL:', error);
reply.code(500).send({ error: 'Failed to upload image' });
}
},
writeStream.on('error', (err) => {
reply.code(500).send({ error: 'Failed to move file' });
});
} catch (err) {
reply.code(500).send({ error: 'An error occurred' });
}
});
// fastify.get("/", (req, reply) => {
// reply.view("/templates/index.ejs", { text: "text" });
// });
// Run the server!
const start = async () => {

Loading…
Cancel
Save