From 2ca550d0c9890c928502f432d2b279d977669ba9 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:25:49 +0200 Subject: [PATCH] move devDependencies to dependencies because bundle installs api/gateway/cdn as npm dep. and the dev packages don't get automatically installed --- api/package-lock.json | Bin 719311 -> 719859 bytes api/package.json | 10 +- api/src/util/Config.ts | 372 ------------------------------------- cdn/package.json | 5 +- gateway/package.json | 4 +- gateway/src/util/Config.ts | 41 ---- util/package-lock.json | Bin 50202 -> 55103 bytes util/package.json | 12 +- 8 files changed, 11 insertions(+), 433 deletions(-) delete mode 100644 api/src/util/Config.ts delete mode 100644 gateway/src/util/Config.ts diff --git a/api/package-lock.json b/api/package-lock.json index 3308a6be653448a0ab4a883a05862e2367d7b00a..6305b089df25f78252718c297eb581f4785af335 100644 GIT binary patch delta 445 zcmX^AS^M*M?G2w9o4J{`b2Bjt=TEMV5tx3bpUH@&AT_mU@DyG;L#N+5$tXWP zp_5sD`_n?kna$JB&1dABo-fD2KRxe1CmUGt^o1QvD$@;QSy-pPo5?QGzTqq5_6=W| zcI}-WQ_LoSu6W}wris%9wlT9!?~vf+o&Jo2QEa+{FO%W)1fbYEG_NXn@?h-DVyOJLB}Og)HLJZ630`oxFDey1OPfnkl#2K4Jl4*6p^B z*wUQ9ofDQs4heP%Ow?p;hDUK & { - definitions: { - rateLimitOptions: JSONSchemaType; - }; -} = { - type: "object", - definitions: { - rateLimitOptions: { - type: "object", - properties: { - count: { type: "number" }, - timespan: { type: "number" } - }, - required: ["count", "timespan"] - } - }, - properties: { - gateway: { - type: "string" - }, - general: { - type: "object", - properties: { - instance_id: { - type: "string" - } - }, - required: ["instance_id"], - additionalProperties: false - }, - permissions: { - type: "object", - properties: { - user: { - type: "object", - properties: { - createGuilds: { - type: "boolean" - } - }, - required: ["createGuilds"], - additionalProperties: false - } - }, - required: ["user"], - additionalProperties: false - }, - limits: { - type: "object", - properties: { - user: { - type: "object", - properties: { - maxFriends: { - type: "number" - }, - maxGuilds: { - type: "number" - }, - maxUsername: { - type: "number" - } - }, - required: ["maxFriends", "maxGuilds", "maxUsername"], - additionalProperties: false - }, - guild: { - type: "object", - properties: { - maxRoles: { - type: "number" - }, - maxMembers: { - type: "number" - }, - maxChannels: { - type: "number" - }, - maxChannelsInCategory: { - type: "number" - }, - hideOfflineMember: { - type: "number" - } - }, - required: ["maxRoles", "maxMembers", "maxChannels", "maxChannelsInCategory", "hideOfflineMember"], - additionalProperties: false - }, - message: { - type: "object", - properties: { - characters: { - type: "number" - }, - ttsCharacters: { - type: "number" - }, - maxReactions: { - type: "number" - }, - maxAttachmentSize: { - type: "number" - }, - maxBulkDelete: { - type: "number" - } - }, - required: ["characters", "ttsCharacters", "maxReactions", "maxAttachmentSize", "maxBulkDelete"], - additionalProperties: false - }, - channel: { - type: "object", - properties: { - maxPins: { - type: "number" - }, - maxTopic: { - type: "number" - } - }, - required: ["maxPins", "maxTopic"], - additionalProperties: false - }, - rate: { - type: "object", - properties: { - ip: { - type: "object", - properties: { - enabled: { type: "boolean" }, - count: { type: "number" }, - timespan: { type: "number" } - }, - required: ["enabled", "count", "timespan"], - additionalProperties: false - }, - routes: { - type: "object", - properties: { - auth: { - type: "object", - properties: { - login: { $ref: "#/definitions/rateLimitOptions" }, - register: { $ref: "#/definitions/rateLimitOptions" } - }, - nullable: true, - required: [], - additionalProperties: false - }, - channel: { - type: "string", - nullable: true - } - }, - required: [], - additionalProperties: false - } - }, - required: ["ip", "routes"] - } - }, - required: ["channel", "guild", "message", "rate", "user"], - additionalProperties: false - }, - security: { - type: "object", - properties: { - jwtSecret: { - type: "string" - }, - forwadedFor: { - type: "string", - nullable: true - }, - captcha: { - type: "object", - properties: { - enabled: { type: "boolean" }, - service: { - type: "string", - enum: ["hcaptcha", "recaptcha", null], - nullable: true - }, - sitekey: { - type: "string", - nullable: true - }, - secret: { - type: "string", - nullable: true - } - }, - required: ["enabled", "secret", "service", "sitekey"], - additionalProperties: false - } - }, - required: ["captcha", "forwadedFor", "jwtSecret"], - additionalProperties: false - }, - login: { - type: "object", - properties: { - requireCaptcha: { type: "boolean" } - }, - required: ["requireCaptcha"], - additionalProperties: false - }, - register: { - type: "object", - properties: { - email: { - type: "object", - properties: { - necessary: { type: "boolean" }, - allowlist: { type: "boolean" }, - blocklist: { type: "boolean" }, - domains: { - type: "array", - items: { - type: "string" - } - } - }, - required: ["allowlist", "blocklist", "domains", "necessary"], - additionalProperties: false - }, - dateOfBirth: { - type: "object", - properties: { - necessary: { type: "boolean" }, - minimum: { type: "number" } - }, - required: ["minimum", "necessary"], - additionalProperties: false - }, - requireCaptcha: { type: "boolean" }, - requireInvite: { type: "boolean" }, - allowNewRegistration: { type: "boolean" }, - allowMultipleAccounts: { type: "boolean" }, - password: { - type: "object", - properties: { - minLength: { type: "number" }, - minNumbers: { type: "number" }, - minUpperCase: { type: "number" }, - minSymbols: { type: "number" }, - blockInsecureCommonPasswords: { type: "boolean" } - }, - required: ["minLength", "minNumbers", "minUpperCase", "minSymbols", "blockInsecureCommonPasswords"], - additionalProperties: false - } - }, - required: [ - "allowMultipleAccounts", - "allowNewRegistration", - "dateOfBirth", - "email", - "password", - "requireCaptcha", - "requireInvite" - ], - additionalProperties: false - } - }, - required: ["gateway", "general", "limits", "login", "permissions", "register", "security"], - additionalProperties: false -}; - -const ajv = new Ajv(); -const validator = ajv.compile(schema); - -const configPath = getConfigPathForFile("fosscord", "api", ".json"); - -export const apiConfig = new Config({ path: configPath, schemaValidator: validator, schema: schema }); diff --git a/cdn/package.json b/cdn/package.json index 0a34f85f..7aa188a9 100644 --- a/cdn/package.json +++ b/cdn/package.json @@ -37,9 +37,8 @@ "missing-native-js-functions": "^1.0.8", "multer": "^1.4.2", "node-fetch": "^2.6.1", - "uuid": "^8.3.2" - }, - "devDependencies": { + "uuid": "^8.3.2", + "typescript": "^4.1.2", "@types/body-parser": "^1.19.0", "@types/btoa": "^1.2.3", "@types/dotenv": "^8.2.0", diff --git a/gateway/package.json b/gateway/package.json index 5a401e9f..6d340351 100644 --- a/gateway/package.json +++ b/gateway/package.json @@ -24,9 +24,7 @@ "node-fetch": "^2.6.1", "typescript": "^4.2.3", "uuid": "^8.3.2", - "ws": "^7.4.2" - }, - "devDependencies": { + "ws": "^7.4.2", "@types/amqplib": "^0.8.1", "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", diff --git a/gateway/src/util/Config.ts b/gateway/src/util/Config.ts deleted file mode 100644 index e99c89f7..00000000 --- a/gateway/src/util/Config.ts +++ /dev/null @@ -1,41 +0,0 @@ -// @ts-nocheck -import { Config } from "@fosscord/util"; -import { getConfigPathForFile } from "@fosscord/util/dist/util/Config"; -import Ajv, { JSONSchemaType } from "ajv"; - -export interface DefaultOptions { - endpoint?: string; - security: { - jwtSecret: string; - }; -} - -const schema: JSONSchemaType = { - type: "object", - properties: { - endpoint: { - type: "string", - nullable: true, - }, - security: { - type: "object", - properties: { - jwtSecret: { - type: "string", - }, - }, - required: ["jwtSecret"], - }, - }, - required: ["security"], -}; - -const ajv = new Ajv(); -const validator = ajv.compile(schema); - -const configPath = getConfigPathForFile("fosscord", "gateway", ".json"); -export const gatewayConfig = new Config({ - path: configPath, - schemaValidator: validator, - schema: schema, -}); diff --git a/util/package-lock.json b/util/package-lock.json index 4c6785104a5df3c008e2dfa7c9c4734fd590f675..f58019b6a9aca0a1103d8121ce393ff47f3c45f3 100644 GIT binary patch delta 2702 zcmd6p+i%-c9LJTl>z1x;%2u*=U6;#-hL*;$W9NocMx4gE)k$O5xk-Q$+ew_n@g*T~ zq75`Ou^};O+7S{0Av*ESHX`vlCjJA&+g?BuPrR(JJRs~eZPy_r9+=d(<8yvT=llEq ze&^%!Y-h++ErM|^1#70# zWsg`?`*Nx}%#ygTfbzVL@mFbCZKmW+30H8jfVGLzdWg;Y8ZCb(-*#y-l?)8zeBC=3 zD2f_nm`JBf1IrKdVC&*}0GW@0t(n=gD@HPAXH`-~H&^bK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4znAS-~qG9mT?8Mqn&#ZvqrI85R(H*6O$cM6SKF%h!oye BDH;F( diff --git a/util/package.json b/util/package.json index a33df2ba..8f32c1e3 100644 --- a/util/package.json +++ b/util/package.json @@ -25,22 +25,24 @@ "url": "https://github.com/fosscord/fosscord-server-util/issues" }, "homepage": "https://docs.fosscord.com/", - "devDependencies": { + "dependencies": { "@types/amqplib": "^0.8.1", "@types/jsonwebtoken": "^8.5.0", "@types/mongodb": "^3.6.9", "@types/mongoose-autopopulate": "^0.10.1", "@types/mongoose-lean-virtuals": "^0.5.1", "@types/node": "^14.17.9", + "@types/node-fetch": "^2.5.12", "ajv": "^8.5.0", - "amqplib": "^0.8.0", "dot-prop": "^6.0.1", "env-paths": "^2.2.1", + "typescript": "^4.1.3", + "amqplib": "^0.8.0", "jsonwebtoken": "^8.5.1", + "mongoose-autopopulate": "^0.12.3", + "mongoose": "^5.13.7", "missing-native-js-functions": "^1.2.2", "mongodb": "^3.6.9", - "mongoose": "^5.13.7", - "mongoose-autopopulate": "^0.12.3", - "typescript": "^4.1.3" + "node-fetch": "^2.6.1" } }