From 6601e88ed184789d82093ad4ff12b079033e5a26 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti <91712746+dipendraupreti@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:51:50 +0545 Subject: [PATCH 1/9] refactor(multi-tenant): update tenant create error message (#621) --- .../src/lib/validateTenantSchema.ts | 20 +++++++++++++++---- .../multi-tenant/src/model/tenants/service.ts | 16 +++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/multi-tenant/src/lib/validateTenantSchema.ts b/packages/multi-tenant/src/lib/validateTenantSchema.ts index e6ae63b67..656fc68b5 100644 --- a/packages/multi-tenant/src/lib/validateTenantSchema.ts +++ b/packages/multi-tenant/src/lib/validateTenantSchema.ts @@ -33,9 +33,21 @@ const validateTenantInput = ( const validationResult = tenantInputSchema.safeParse(mappedTenantInput); if (!validationResult.success) { + if ( + validationResult.error.issues.some((issue) => { + return issue.path.includes("slug"); + }) + ) { + throw { + name: "ERROR_INVALID_SLUG", + message: "Invalid slug", + statusCode: 422, + }; + } + throw { - message: validationResult.error.issues[0].message, - issues: validationResult.error.issues, + name: "ERROR_INVALID_DOMAIN", + message: "Invalid domain", statusCode: 422, }; } @@ -59,8 +71,8 @@ const validateTenantUpdate = ( if (!validationResult.success) { throw { - message: validationResult.error.issues[0].message, - issues: validationResult.error.issues, + name: "ERROR_INVALID_DOMAIN", + message: "Invalid domain", statusCode: 422, }; } diff --git a/packages/multi-tenant/src/model/tenants/service.ts b/packages/multi-tenant/src/model/tenants/service.ts index 48764c442..8910c2cd4 100644 --- a/packages/multi-tenant/src/model/tenants/service.ts +++ b/packages/multi-tenant/src/model/tenants/service.ts @@ -48,7 +48,7 @@ class TenantService< if (getAllReservedSlugs(this.config).includes(data[slugColumn] as string)) { throw { - name: "CREATE_TENANT_FAILED", + name: "ERROR_RESERVED_SLUG", message: `The requested ${slugColumn} "${data[slugColumn]}" is reserved and cannot be used`, statusCode: 422, }; @@ -58,7 +58,7 @@ class TenantService< getAllReservedDomains(this.config).includes(data[domainColumn] as string) ) { throw { - name: "CREATE_TENANT_FAILED", + name: "ERROR_RESERVED_DOMAIN", message: `The requested ${domainColumn} "${data[domainColumn]}" is reserved and cannot be used`, statusCode: 422, }; @@ -106,9 +106,17 @@ class TenantService< const { slug: slugColumn, domain: domainColumn } = multiTenantConfig.table.columns; + if (tenants.some((tenant) => tenant[slugColumn] === slug)) { + throw { + name: "ERROR_SLUG_ALREADY_EXISTS", + message: `The specified ${slugColumn} "${slug}" already exits`, + statusCode: 422, + }; + } + throw { - name: "FIELD_VALIDATION_FAILED", - message: `The specified ${slugColumn} "${slug}" or ${domainColumn} "${domain}" already exits`, + name: "ERROR_DOMAIN_ALREADY_EXISTS", + message: `The specified ${domainColumn} "${domain}" already exits`, statusCode: 422, }; } From 17f1849c5a83229e41fad914495c832cd0d3dc30 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti <91712746+dipendraupreti@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:29:57 +0545 Subject: [PATCH 2/9] refactor(user): add first admin role 'ADMIN' and 'SUPER_ADMIN' (#618) --- .../user/src/model/invitations/resolver.ts | 4 +- .../src/model/users/handlers/adminSignUp.ts | 30 ++++++++------ .../model/users/handlers/canAdminSignUp.ts | 17 ++++++-- packages/user/src/model/users/resolver.ts | 41 +++++++++++++------ 4 files changed, 61 insertions(+), 31 deletions(-) diff --git a/packages/user/src/model/invitations/resolver.ts b/packages/user/src/model/invitations/resolver.ts index 5816ed7b8..bee5df979 100644 --- a/packages/user/src/model/invitations/resolver.ts +++ b/packages/user/src/model/invitations/resolver.ts @@ -3,7 +3,7 @@ import mercurius from "mercurius"; import { createNewSession } from "supertokens-node/recipe/session"; import { emailPasswordSignUp } from "supertokens-node/recipe/thirdpartyemailpassword"; -import { ROLE_ADMIN } from "../../constants"; +import { ROLE_USER } from "../../constants"; import computeInvitationExpiresAt from "../../lib/computeInvitationExpiresAt"; import getInvitationService from "../../lib/getInvitationService"; import isInvitationValid from "../../lib/isInvitationValid"; @@ -175,7 +175,7 @@ const Mutation = { email, expiresAt: computeInvitationExpiresAt(config, expiresAt), invitedById: user.id, - role: role || config.user.role || ROLE_ADMIN, + role: role || config.user.role || ROLE_USER, }; const app = config.apps?.find((app) => app.id == appId); diff --git a/packages/user/src/model/users/handlers/adminSignUp.ts b/packages/user/src/model/users/handlers/adminSignUp.ts index 10d56c5bd..14dcbef78 100644 --- a/packages/user/src/model/users/handlers/adminSignUp.ts +++ b/packages/user/src/model/users/handlers/adminSignUp.ts @@ -2,7 +2,7 @@ import { createNewSession } from "supertokens-node/recipe/session"; import { emailPasswordSignUp } from "supertokens-node/recipe/thirdpartyemailpassword"; import UserRoles from "supertokens-node/recipe/userroles"; -import { ROLE_ADMIN } from "../../../constants"; +import { ROLE_ADMIN, ROLE_SUPER_ADMIN } from "../../../constants"; import validateEmail from "../../../validator/email"; import validatePassword from "../../../validator/password"; @@ -22,13 +22,22 @@ const adminSignUp = async (request: FastifyRequest, reply: FastifyReply) => { // check if already admin user exists const adminUsers = await UserRoles.getUsersThatHaveRole(ROLE_ADMIN); - - if (adminUsers.status === "UNKNOWN_ROLE_ERROR") { + const superAdminUsers = await UserRoles.getUsersThatHaveRole( + ROLE_SUPER_ADMIN + ); + + if ( + adminUsers.status === "UNKNOWN_ROLE_ERROR" && + superAdminUsers.status === "UNKNOWN_ROLE_ERROR" + ) { return reply.send({ status: "ERROR", message: adminUsers.status, }); - } else if (adminUsers.users.length > 0) { + } else if ( + (adminUsers.status === "OK" && adminUsers.users.length > 0) || + (superAdminUsers.status === "OK" && superAdminUsers.users.length > 0) + ) { return reply.send({ status: "ERROR", message: "First admin user already exists", @@ -58,7 +67,10 @@ const adminSignUp = async (request: FastifyRequest, reply: FastifyReply) => { // signup const signUpResponse = await emailPasswordSignUp(email, password, { autoVerifyEmail: true, - roles: [ROLE_ADMIN], + roles: [ + ROLE_ADMIN, + ...(superAdminUsers.status === "OK" ? [ROLE_SUPER_ADMIN] : []), + ], _default: { request: { request, @@ -73,13 +85,7 @@ const adminSignUp = async (request: FastifyRequest, reply: FastifyReply) => { // create new session so the user be logged in on signup await createNewSession(request, reply, signUpResponse.user.id); - reply.send({ - ...signUpResponse, - user: { - ...signUpResponse.user, - roles: [ROLE_ADMIN], - }, - }); + reply.send(signUpResponse); } catch (error) { log.error(error); reply.status(500); diff --git a/packages/user/src/model/users/handlers/canAdminSignUp.ts b/packages/user/src/model/users/handlers/canAdminSignUp.ts index 285e241ba..e0efbd44e 100644 --- a/packages/user/src/model/users/handlers/canAdminSignUp.ts +++ b/packages/user/src/model/users/handlers/canAdminSignUp.ts @@ -1,6 +1,6 @@ import UserRoles from "supertokens-node/recipe/userroles"; -import { ROLE_ADMIN } from "../../../constants"; +import { ROLE_ADMIN, ROLE_SUPER_ADMIN } from "../../../constants"; import type { FastifyReply, FastifyRequest } from "fastify"; @@ -10,13 +10,22 @@ const canAdminSignUp = async (request: FastifyRequest, reply: FastifyReply) => { try { // check if already admin user exists const adminUsers = await UserRoles.getUsersThatHaveRole(ROLE_ADMIN); - - if (adminUsers.status === "UNKNOWN_ROLE_ERROR") { + const superAdminUsers = await UserRoles.getUsersThatHaveRole( + ROLE_SUPER_ADMIN + ); + + if ( + adminUsers.status === "UNKNOWN_ROLE_ERROR" && + superAdminUsers.status === "UNKNOWN_ROLE_ERROR" + ) { return reply.send({ status: "ERROR", message: adminUsers.status, }); - } else if (adminUsers.users.length > 0) { + } else if ( + (adminUsers.status === "OK" && adminUsers.users.length > 0) || + (superAdminUsers.status === "OK" && superAdminUsers.users.length > 0) + ) { return reply.send({ signUp: false }); } diff --git a/packages/user/src/model/users/resolver.ts b/packages/user/src/model/users/resolver.ts index 84a9bdac5..7213899f5 100644 --- a/packages/user/src/model/users/resolver.ts +++ b/packages/user/src/model/users/resolver.ts @@ -4,7 +4,7 @@ import { emailPasswordSignUp } from "supertokens-node/recipe/thirdpartyemailpass import UserRoles from "supertokens-node/recipe/userroles"; import filterUserUpdateInput from "./filterUserUpdateInput"; -import { ROLE_ADMIN } from "../../constants"; +import { ROLE_ADMIN, ROLE_SUPER_ADMIN } from "../../constants"; import getUserService from "../../lib/getUserService"; import validateEmail from "../../validator/email"; import validatePassword from "../../validator/password"; @@ -31,12 +31,21 @@ const Mutation = { // check if already admin user exists const adminUsers = await UserRoles.getUsersThatHaveRole(ROLE_ADMIN); + const superAdminUsers = await UserRoles.getUsersThatHaveRole( + ROLE_SUPER_ADMIN + ); let errorMessage: string | undefined; - if (adminUsers.status === "UNKNOWN_ROLE_ERROR") { + if ( + adminUsers.status === "UNKNOWN_ROLE_ERROR" && + superAdminUsers.status === "UNKNOWN_ROLE_ERROR" + ) { errorMessage = adminUsers.status; - } else if (adminUsers.users.length > 0) { + } else if ( + (adminUsers.status === "OK" && adminUsers.users.length > 0) || + (superAdminUsers.status === "OK" && superAdminUsers.users.length > 0) + ) { errorMessage = "First admin user already exists"; } @@ -71,7 +80,10 @@ const Mutation = { // signup const signUpResponse = await emailPasswordSignUp(email, password, { autoVerifyEmail: true, - roles: [ROLE_ADMIN], + roles: [ + ROLE_ADMIN, + ...(superAdminUsers.status === "OK" ? [ROLE_SUPER_ADMIN] : []), + ], _default: { request: { request: reply.request, @@ -90,13 +102,7 @@ const Mutation = { // create new session so the user be logged in on signup await createNewSession(reply.request, reply, signUpResponse.user.id); - return { - ...signUpResponse, - user: { - ...signUpResponse.user, - roles: [ROLE_ADMIN], - }, - }; + return signUpResponse; } catch (error) { // FIXME [OP 28 SEP 2022] app.log.error(error); @@ -254,12 +260,21 @@ const Query = { try { // check if already admin user exists const adminUsers = await UserRoles.getUsersThatHaveRole(ROLE_ADMIN); + const superAdminUsers = await UserRoles.getUsersThatHaveRole( + ROLE_SUPER_ADMIN + ); - if (adminUsers.status === "UNKNOWN_ROLE_ERROR") { + if ( + adminUsers.status === "UNKNOWN_ROLE_ERROR" && + superAdminUsers.status === "UNKNOWN_ROLE_ERROR" + ) { const mercuriusError = new mercurius.ErrorWithProps(adminUsers.status); return mercuriusError; - } else if (adminUsers.users.length > 0) { + } else if ( + (adminUsers.status === "OK" && adminUsers.users.length > 0) || + (superAdminUsers.status === "OK" && superAdminUsers.users.length > 0) + ) { return { signUp: false }; } From 96a397b16b26e109de359e8bf64ce79a7e81e0c5 Mon Sep 17 00:00:00 2001 From: Ramesh Date: Wed, 20 Mar 2024 17:12:12 +0545 Subject: [PATCH 3/9] chore: release v0.62.3 (#623) --- CHANGELOG.md | 4 ++ package.json | 2 +- packages/config/package.json | 6 +-- packages/firebase/package.json | 18 +++---- packages/mailer/package.json | 10 ++-- packages/mercurius/package.json | 14 ++--- packages/multi-tenant/package.json | 22 ++++---- packages/s3/package.json | 18 +++---- packages/slonik/package.json | 10 ++-- packages/user/package.json | 22 ++++---- pnpm-lock.yaml | 68 ++++++++++++------------- tools/eslint-config-custom/package.json | 2 +- tools/tsconfig/package.json | 2 +- 13 files changed, 101 insertions(+), 97 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72a1fc4b1..e34665ec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.62.3](https://github.com/dzangolab/fastify/compare/v0.62.2...v0.62.3) (2024-03-20) + + + ## [0.62.2](https://github.com/dzangolab/fastify/compare/v0.62.1...v0.62.2) (2024-03-07) diff --git a/package.json b/package.json index 2bd30ab82..8469c91fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify", - "version": "0.62.2", + "version": "0.62.3", "private": true, "repository": { "type": "git", diff --git a/packages/config/package.json b/packages/config/package.json index f50ebbe95..7bef74dac 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-config", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify config plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/config#readme", "repository": { @@ -36,11 +36,11 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 08d992f9d..0ce95a3b4 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-firebase", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify firebase plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/firebase#readme", "repository": { @@ -35,30 +35,30 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "firebase-admin": "12.0.0", diff --git a/packages/mailer/package.json b/packages/mailer/package.json index 2afd9b81d..d410839cf 100644 --- a/packages/mailer/package.json +++ b/packages/mailer/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mailer", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify mailer plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mailer#readme", "repository": { @@ -39,7 +39,7 @@ "nodemailer-mjml": "1.2.24" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", "@types/mjml": "4.7.4", "@types/node": "18.16.18", "@types/nodemailer": "6.4.14", @@ -48,18 +48,18 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mjml": "4.14.1", "prettier": "2.8.8", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mjml": ">=4.13.0" diff --git a/packages/mercurius/package.json b/packages/mercurius/package.json index 2992e5564..bd152c25c 100644 --- a/packages/mercurius/package.json +++ b/packages/mercurius/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mercurius", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify mercurius plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mercurius#readme", "repository": { @@ -31,28 +31,28 @@ "typecheck": "tsc --noEmit -p tsconfig.json --composite false" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "graphql": "16.6.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "graphql": ">=16.6.0", diff --git a/packages/multi-tenant/package.json b/packages/multi-tenant/package.json index ad22abb9d..51421970a 100644 --- a/packages/multi-tenant/package.json +++ b/packages/multi-tenant/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-multi-tenant", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify multi-tenant plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/multi-tenant#readme", "repository": { @@ -37,10 +37,10 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", - "@dzangolab/fastify-user": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-user": "0.62.3", "@types/humps": "2.0.6", "@types/lodash.merge": "4.6.9", "@types/node": "18.16.18", @@ -49,14 +49,14 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vite-tsconfig-paths": "4.2.3", @@ -64,10 +64,10 @@ "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", - "@dzangolab/fastify-user": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-user": "0.62.3", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mercurius": ">=12.2.0", diff --git a/packages/s3/package.json b/packages/s3/package.json index d7beed03b..c56787f25 100644 --- a/packages/s3/package.json +++ b/packages/s3/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-s3", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify S3 plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/s3#readme", "repository": { @@ -43,28 +43,28 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "slonik": ">=37.2.0", diff --git a/packages/slonik/package.json b/packages/slonik/package.json index c5f01c03b..cccfac38c 100644 --- a/packages/slonik/package.json +++ b/packages/slonik/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-slonik", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify slonik plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/slonik#readme", "repository": { @@ -36,7 +36,7 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", "@types/humps": "2.0.6", "@types/node": "18.16.18", "@types/pg": "8.10.9", @@ -44,19 +44,19 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2", "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "slonik": ">=37.2.0", diff --git a/packages/user/package.json b/packages/user/package.json index beab54148..61444e6fe 100644 --- a/packages/user/package.json +++ b/packages/user/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-user", - "version": "0.62.2", + "version": "0.62.3", "description": "Fastify user plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/user#readme", "repository": { @@ -36,10 +36,10 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mailer": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mailer": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "@fastify/cors": "8.3.0", "@fastify/formbody": "7.4.0", "@types/humps": "2.0.6", @@ -49,7 +49,7 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.2", + "eslint-config-custom": "0.62.3", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", @@ -57,16 +57,16 @@ "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.2", + "tsconfig": "0.62.3", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.2", - "@dzangolab/fastify-mailer": "0.62.2", - "@dzangolab/fastify-mercurius": "0.62.2", - "@dzangolab/fastify-slonik": "0.62.2", + "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-mailer": "0.62.3", + "@dzangolab/fastify-mercurius": "0.62.3", + "@dzangolab/fastify-slonik": "0.62.3", "@fastify/cors": ">=8.2.0", "@fastify/formbody": ">=7.4.0", "fastify": ">=4.10.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5cf10833b..fb0bb0740 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,7 +45,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -57,7 +57,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -79,13 +79,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -103,7 +103,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -124,7 +124,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -158,7 +158,7 @@ importers: version: 1.2.24(nodemailer@6.9.8) devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@types/mjml': specifier: 4.7.4 @@ -185,7 +185,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -200,7 +200,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -215,10 +215,10 @@ importers: packages/mercurius: devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@dzangolab/fastify-slonik': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -236,7 +236,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -257,7 +257,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -285,16 +285,16 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../slonik '@dzangolab/fastify-user': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../user '@types/humps': specifier: 2.0.6 @@ -321,7 +321,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -342,7 +342,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -394,13 +394,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -418,7 +418,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -433,7 +433,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -458,7 +458,7 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@types/humps': specifier: 2.0.6 @@ -482,7 +482,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -497,7 +497,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -525,16 +525,16 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../config '@dzangolab/fastify-mailer': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../mailer '@dzangolab/fastify-mercurius': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.2 + specifier: 0.62.3 version: link:../slonik '@fastify/cors': specifier: 8.3.0 @@ -564,7 +564,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -588,7 +588,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.2 + specifier: 0.62.3 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 diff --git a/tools/eslint-config-custom/package.json b/tools/eslint-config-custom/package.json index 4c92f3498..0a2133027 100644 --- a/tools/eslint-config-custom/package.json +++ b/tools/eslint-config-custom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-custom", - "version": "0.62.2", + "version": "0.62.3", "license": "MIT", "main": "index.js", "scripts": { diff --git a/tools/tsconfig/package.json b/tools/tsconfig/package.json index f4b11e1f8..aee7b4c73 100644 --- a/tools/tsconfig/package.json +++ b/tools/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.62.2", + "version": "0.62.3", "private": true, "files": [ "base.json" From 7a24d4c1a1f308fc9d33d0f387d3866b8dac1e05 Mon Sep 17 00:00:00 2001 From: Suraj Rai <67699019+surajrai-dzango@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:57:00 +0545 Subject: [PATCH 4/9] fix: update db filter input type (#624) --- packages/slonik/src/__test__/helpers/utils.ts | 61 +++++++++++++------ packages/slonik/src/dbFilters.ts | 17 +++--- packages/slonik/src/index.ts | 1 + packages/slonik/src/types/database.ts | 23 +++++-- packages/slonik/src/types/index.ts | 1 + 5 files changed, 70 insertions(+), 33 deletions(-) diff --git a/packages/slonik/src/__test__/helpers/utils.ts b/packages/slonik/src/__test__/helpers/utils.ts index 0cd0295ed..5183e614b 100644 --- a/packages/slonik/src/__test__/helpers/utils.ts +++ b/packages/slonik/src/__test__/helpers/utils.ts @@ -1,24 +1,45 @@ +import { ApiConfig } from "@dzangolab/fastify-config"; + import type { FilterInput, SortInput } from "../../types"; -import type { ApiConfig } from "@dzangolab/fastify-config"; -const getFilterDataset = () => { +const getFilterDataset = (): FilterInput[] => { return [ - { key: "name", operator: "ct", value: "Test" }, - { key: "name", operator: "ew", value: "t1" }, - { key: "name", operator: "sw", value: "Test" }, - { key: "name", operator: "eq", value: "Test" }, - { key: "id", operator: "gt", value: 10 }, - { key: "id", operator: "gte", value: 10 }, - { key: "id", operator: "lt", value: 10 }, - { key: "id", operator: "lte", value: 10 }, - { key: "name", operator: "in", value: "Test1, Test2" }, - { key: "id", operator: "bt", value: "10, 20" }, - { key: "id", not: true, operator: "bt", value: "10, 20" }, - { key: "name", operator: "eq", value: "null" }, - { key: "name", not: true, operator: "eq", value: "NULL" }, - { key: "countryCode", operator: "eq", value: "FR" }, - { key: "country_code", operator: "eq", value: "FR" }, - ] as FilterInput[]; + { key: "name", operator: "sw", value: "s" }, + { + AND: [ + { key: "name", operator: "sw", value: "s" }, + { key: "latitude", operator: "gt", value: "40" }, + ], + }, + { + OR: [ + { key: "name", operator: "sw", value: "Test" }, + { key: "name", operator: "ew", value: "t1" }, + ], + }, + { + AND: [ + { key: "id", operator: "gt", value: "10" }, + { + OR: [ + { key: "name", operator: "sw", value: "Test" }, + { key: "name", operator: "ew", value: "t1" }, + ], + }, + ], + }, + { + OR: [ + { key: "id", operator: "gt", value: "10" }, + { + AND: [ + { key: "name", operator: "sw", value: "Test" }, + { key: "name", operator: "ew", value: "t1" }, + ], + }, + ], + }, + ]; }; const getLimitAndOffsetDataset = async (count: number, config: ApiConfig) => { @@ -84,7 +105,7 @@ const getLimitAndOffsetDataset = async (count: number, config: ApiConfig) => { ]; }; -const getSortDataset = () => { +const getSortDataset = (): SortInput[][] => { return [ [{ key: "name", direction: "ASC" }], [{ key: "id", direction: "DESC" }], @@ -94,7 +115,7 @@ const getSortDataset = () => { { key: "id", direction: "DESC" }, { key: "name", direction: "ASC" }, ], - ] as SortInput[][]; + ]; }; export { getFilterDataset, getLimitAndOffsetDataset, getSortDataset }; diff --git a/packages/slonik/src/dbFilters.ts b/packages/slonik/src/dbFilters.ts index 94a2ff8d3..4455ccb07 100644 --- a/packages/slonik/src/dbFilters.ts +++ b/packages/slonik/src/dbFilters.ts @@ -1,13 +1,12 @@ import humps from "humps"; import { sql } from "slonik"; -import { FilterInput } from "./types"; - +import type { BaseFilterInput, FilterInput } from "./types"; import type { IdentifierSqlToken, FragmentSqlToken } from "slonik"; const applyFilter = ( - filter: FilterInput, - tableIdentifier: IdentifierSqlToken + tableIdentifier: IdentifierSqlToken, + filter: BaseFilterInput ) => { const key = humps.decamelize(filter.key); const operator = filter.operator || "eq"; @@ -87,16 +86,16 @@ const applyFiltersToQuery = ( tableIdentifier: IdentifierSqlToken, not = false ) => { - if (filters.AND) { + if ("AND" in filters) { for (const filterData of filters.AND) { applyFilters(filterData, tableIdentifier); } - } else if (filters.OR) { + } else if ("OR" in filters) { for (const filterData of filters.OR) { applyFilters(filterData, tableIdentifier, true); } } else { - const query = applyFilter(filters, tableIdentifier); + const query = applyFilter(tableIdentifier, filters as BaseFilterInput); if (not) { orFilter.push(query); @@ -114,7 +113,9 @@ const applyFiltersToQuery = ( sql.fragment`(${sql.join(andFilter, sql.fragment` AND `)})`, sql.fragment`(${sql.join(orFilter, sql.fragment` OR `)})`, ], - sql.fragment`${filters.AND ? sql.fragment` AND ` : sql.fragment` OR `}` + sql.fragment`${ + "AND" in filters ? sql.fragment` AND ` : sql.fragment` OR ` + }` ); } else if (andFilter.length > 0) { queryFilter = sql.join(andFilter, sql.fragment` AND `); diff --git a/packages/slonik/src/index.ts b/packages/slonik/src/index.ts index bf5bfdea8..3e501007a 100644 --- a/packages/slonik/src/index.ts +++ b/packages/slonik/src/index.ts @@ -52,6 +52,7 @@ export { default as formatDate } from "./formatDate"; export { default as migrationPlugin } from "./migrationPlugin"; export type { + BaseFilterInput, Database, FilterInput, PaginatedList, diff --git a/packages/slonik/src/types/database.ts b/packages/slonik/src/types/database.ts index a8c95fb69..7a9f1293f 100644 --- a/packages/slonik/src/types/database.ts +++ b/packages/slonik/src/types/database.ts @@ -18,15 +18,22 @@ type operator = | "in" | "bt"; -type FilterInput = { - AND: FilterInput[]; - OR: FilterInput[]; +type BaseFilterInput = { key: string; operator: operator; - not: boolean; + not?: boolean; value: string; }; +type FilterInput = + | BaseFilterInput + | { + AND: FilterInput[]; + } + | { + OR: FilterInput[]; + }; + type SortDirection = "ASC" | "DESC"; type SortInput = { @@ -34,4 +41,10 @@ type SortInput = { direction: SortDirection; }; -export type { Database, FilterInput, SortDirection, SortInput }; +export type { + BaseFilterInput, + Database, + FilterInput, + SortDirection, + SortInput, +}; diff --git a/packages/slonik/src/types/index.ts b/packages/slonik/src/types/index.ts index e08a0a102..ede149f7c 100644 --- a/packages/slonik/src/types/index.ts +++ b/packages/slonik/src/types/index.ts @@ -5,6 +5,7 @@ export type { FilterInput, SortDirection, SortInput, + BaseFilterInput, } from "./database"; export type { PaginatedList, Service } from "./service"; From 632c1faedb6281a5f8c1322fc91fec89ecb7c40d Mon Sep 17 00:00:00 2001 From: Ramesh Date: Thu, 21 Mar 2024 17:01:43 +0545 Subject: [PATCH 5/9] chore: release v0.62.4 (#625) --- CHANGELOG.md | 9 ++++ package.json | 2 +- packages/config/package.json | 12 ++--- packages/firebase/package.json | 24 ++++----- packages/mailer/package.json | 16 +++--- packages/mercurius/package.json | 20 ++++---- packages/multi-tenant/package.json | 28 +++++----- packages/s3/package.json | 24 ++++----- packages/slonik/package.json | 16 +++--- packages/user/package.json | 28 +++++----- pnpm-lock.yaml | 68 ++++++++++++------------- tools/eslint-config-custom/package.json | 2 +- tools/tsconfig/package.json | 2 +- 13 files changed, 122 insertions(+), 129 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e34665ec8..2a3310e57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [0.62.4](https://github.com/dzangolab/fastify/compare/v0.62.3...v0.62.4) (2024-03-21) + + +### Bug Fixes + +* update db filter input type ([#624](https://github.com/dzangolab/fastify/issues/624)) ([7a24d4c](https://github.com/dzangolab/fastify/commit/7a24d4c1a1f308fc9d33d0f387d3866b8dac1e05)) + + + ## [0.62.3](https://github.com/dzangolab/fastify/compare/v0.62.2...v0.62.3) (2024-03-20) diff --git a/package.json b/package.json index 8469c91fd..4a43ac679 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify", - "version": "0.62.3", + "version": "0.62.4", "private": true, "repository": { "type": "git", diff --git a/packages/config/package.json b/packages/config/package.json index 7bef74dac..33d7c5e6f 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-config", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify config plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/config#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-config.umd.cjs", "module": "./dist/dzangolab-fastify-config.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -36,11 +34,11 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" @@ -53,4 +51,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 0ce95a3b4..559a6ca3a 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-firebase", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify firebase plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/firebase#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-firebase.umd.cjs", "module": "./dist/dzangolab-fastify-firebase.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -35,30 +33,30 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "firebase-admin": "12.0.0", @@ -71,4 +69,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/mailer/package.json b/packages/mailer/package.json index d410839cf..8788ec114 100644 --- a/packages/mailer/package.json +++ b/packages/mailer/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mailer", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify mailer plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mailer#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-mailer.umd.cjs", "module": "./dist/dzangolab-fastify-mailer.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -39,7 +37,7 @@ "nodemailer-mjml": "1.2.24" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", "@types/mjml": "4.7.4", "@types/node": "18.16.18", "@types/nodemailer": "6.4.14", @@ -48,18 +46,18 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mjml": "4.14.1", "prettier": "2.8.8", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mjml": ">=4.13.0" @@ -68,4 +66,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/mercurius/package.json b/packages/mercurius/package.json index bd152c25c..a373d6de1 100644 --- a/packages/mercurius/package.json +++ b/packages/mercurius/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mercurius", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify mercurius plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mercurius#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-mercurius.umd.cjs", "module": "./dist/dzangolab-fastify-mercurius.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -31,28 +29,28 @@ "typecheck": "tsc --noEmit -p tsconfig.json --composite false" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "graphql": "16.6.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "graphql": ">=16.6.0", @@ -63,4 +61,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/multi-tenant/package.json b/packages/multi-tenant/package.json index 51421970a..730b5e8dd 100644 --- a/packages/multi-tenant/package.json +++ b/packages/multi-tenant/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-multi-tenant", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify multi-tenant plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/multi-tenant#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-multi-tenant.umd.cjs", "module": "./dist/dzangolab-fastify-multi-tenant.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -37,10 +35,10 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", - "@dzangolab/fastify-user": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-user": "0.62.4", "@types/humps": "2.0.6", "@types/lodash.merge": "4.6.9", "@types/node": "18.16.18", @@ -49,14 +47,14 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vite-tsconfig-paths": "4.2.3", @@ -64,10 +62,10 @@ "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", - "@dzangolab/fastify-user": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-user": "0.62.4", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mercurius": ">=12.2.0", @@ -79,4 +77,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/s3/package.json b/packages/s3/package.json index c56787f25..3c7856e80 100644 --- a/packages/s3/package.json +++ b/packages/s3/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-s3", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify S3 plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/s3#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-s3.umd.cjs", "module": "./dist/dzangolab-fastify-s3.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -43,28 +41,28 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "slonik": ">=37.2.0", @@ -74,4 +72,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/slonik/package.json b/packages/slonik/package.json index cccfac38c..409e5f10c 100644 --- a/packages/slonik/package.json +++ b/packages/slonik/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-slonik", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify slonik plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/slonik#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-slonik.umd.cjs", "module": "./dist/dzangolab-fastify-slonik.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -36,7 +34,7 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", "@types/humps": "2.0.6", "@types/node": "18.16.18", "@types/pg": "8.10.9", @@ -44,19 +42,19 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2", "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "slonik": ">=37.2.0", @@ -66,4 +64,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/packages/user/package.json b/packages/user/package.json index 61444e6fe..e5a2fd09f 100644 --- a/packages/user/package.json +++ b/packages/user/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-user", - "version": "0.62.3", + "version": "0.62.4", "description": "Fastify user plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/user#readme", "repository": { @@ -19,9 +19,7 @@ "main": "./dist/dzangolab-fastify-user.umd.cjs", "module": "./dist/dzangolab-fastify-user.js", "types": "./dist/types/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -36,10 +34,10 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mailer": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mailer": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "@fastify/cors": "8.3.0", "@fastify/formbody": "7.4.0", "@types/humps": "2.0.6", @@ -49,7 +47,7 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.3", + "eslint-config-custom": "0.62.4", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", @@ -57,16 +55,16 @@ "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.3", + "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.3", - "@dzangolab/fastify-mailer": "0.62.3", - "@dzangolab/fastify-mercurius": "0.62.3", - "@dzangolab/fastify-slonik": "0.62.3", + "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-mailer": "0.62.4", + "@dzangolab/fastify-mercurius": "0.62.4", + "@dzangolab/fastify-slonik": "0.62.4", "@fastify/cors": ">=8.2.0", "@fastify/formbody": ">=7.4.0", "fastify": ">=4.10.2", @@ -80,4 +78,4 @@ "node": ">=16", "pnpm": ">=8" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb0bb0740..cb70b274a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,7 +45,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -57,7 +57,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -79,13 +79,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -103,7 +103,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -124,7 +124,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -158,7 +158,7 @@ importers: version: 1.2.24(nodemailer@6.9.8) devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@types/mjml': specifier: 4.7.4 @@ -185,7 +185,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -200,7 +200,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -215,10 +215,10 @@ importers: packages/mercurius: devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@dzangolab/fastify-slonik': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -236,7 +236,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -257,7 +257,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -285,16 +285,16 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../slonik '@dzangolab/fastify-user': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../user '@types/humps': specifier: 2.0.6 @@ -321,7 +321,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -342,7 +342,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -394,13 +394,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -418,7 +418,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -433,7 +433,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -458,7 +458,7 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@types/humps': specifier: 2.0.6 @@ -482,7 +482,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -497,7 +497,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -525,16 +525,16 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../config '@dzangolab/fastify-mailer': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../mailer '@dzangolab/fastify-mercurius': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.3 + specifier: 0.62.4 version: link:../slonik '@fastify/cors': specifier: 8.3.0 @@ -564,7 +564,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -588,7 +588,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.3 + specifier: 0.62.4 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 diff --git a/tools/eslint-config-custom/package.json b/tools/eslint-config-custom/package.json index 0a2133027..688c63971 100644 --- a/tools/eslint-config-custom/package.json +++ b/tools/eslint-config-custom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-custom", - "version": "0.62.3", + "version": "0.62.4", "license": "MIT", "main": "index.js", "scripts": { diff --git a/tools/tsconfig/package.json b/tools/tsconfig/package.json index aee7b4c73..8d0789722 100644 --- a/tools/tsconfig/package.json +++ b/tools/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.62.3", + "version": "0.62.4", "private": true, "files": [ "base.json" From d9ebb2efc4a5785d5e2b6519b4decb1014f6f1af Mon Sep 17 00:00:00 2001 From: Dipendra Upreti <91712746+dipendraupreti@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:26:16 +0545 Subject: [PATCH 6/9] feat(config): add multi-stream support for logger config (#616) * feat(config): add multi-stream support for logger config * feat(config): update logger level type from string from Level * feat: add rotation type * fix: update type of logger * feat: update logger type * fix: update logger type --------- Co-authored-by: Suraj Rai --- packages/config/package.json | 1 + packages/config/src/types.ts | 31 ++++++++++++++++++--- pnpm-lock.yaml | 52 +++++++++++++++++++----------------- 3 files changed, 56 insertions(+), 28 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 33d7c5e6f..658dd864f 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -38,6 +38,7 @@ "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", + "pino": "8.8.0", "tsconfig": "0.62.4", "typescript": "4.9.5", "vite": "4.3.9", diff --git a/packages/config/src/types.ts b/packages/config/src/types.ts index a3049371e..59b0eea14 100644 --- a/packages/config/src/types.ts +++ b/packages/config/src/types.ts @@ -1,3 +1,10 @@ +import type { + DestinationStream, + Level, + LoggerOptions, + StreamEntry, +} from "pino"; + interface AppConfig { id: number; name: string; @@ -5,6 +12,8 @@ interface AppConfig { supportedRoles: string[]; } +type Compressor = (source: string, destination: string) => string; + interface ApiConfig { appName: string; appOrigin: string[]; @@ -12,15 +21,31 @@ interface ApiConfig { baseUrl: string; env: string; logger: { - level: string; - transport?: { - target: string; + base?: LoggerOptions["base"]; + formatters?: LoggerOptions["formatters"]; + level: Level; + prettyPrint?: { options: { colorize: boolean; ignore: string; translateTime: string; }; }; + rotation?: { + enabled: boolean; + options: { + compress?: boolean | string | Compressor; + filenames: string[]; + interval?: string; + maxFiles?: number; + maxSize?: string; + path: string; + size?: string; + }; + }; + streams?: (DestinationStream | StreamEntry)[]; + transport?: LoggerOptions["transport"]; + timestamp?: LoggerOptions["timestamp"]; }; name: string; pagination?: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb70b274a..f986f6b4e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,7 +25,7 @@ importers: version: 0.26.3 turbo: specifier: latest - version: 1.6.3 + version: 1.12.5 packages/config: devDependencies: @@ -53,6 +53,9 @@ importers: fastify-plugin: specifier: 4.4.0 version: 4.4.0 + pino: + specifier: 8.8.0 + version: 8.8.0 prettier: specifier: 2.8.8 version: 2.8.8 @@ -5190,7 +5193,7 @@ packages: content-type: 1.0.5 find-my-way: 7.3.1 light-my-request: 5.7.0 - pino: 8.7.0 + pino: 8.8.0 process-warning: 2.0.0 proxy-addr: 2.0.7 rfdc: 1.3.0 @@ -7693,8 +7696,8 @@ packages: resolution: {integrity: sha512-mMMOwSKrmyl+Y12Ri2xhH1lbzQxwwpuru9VjyJpgFIH4asSj88F2csdMwN6+M5g1Ll4rmsYghHLQJw81tgZ7LQ==} dev: true - /pino@8.7.0: - resolution: {integrity: sha512-l9sA5uPxmZzwydhMWUcm1gI0YxNnYl8MfSr2h8cwLvOAzQLBLewzF247h/vqHe3/tt6fgtXeG9wdjjoetdI/vA==} + /pino@8.8.0: + resolution: {integrity: sha512-cF8iGYeu2ODg2gIwgAHcPrtR63ILJz3f7gkogaHC/TXVVXxZgInmNYiIpDYEwgEkxZti2Se6P2W2DxlBIZe6eQ==} hasBin: true dependencies: atomic-sleep: 1.0.0 @@ -8904,65 +8907,64 @@ packages: tslib: 1.14.1 typescript: 4.9.5 - /turbo-darwin-64@1.6.3: - resolution: {integrity: sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==} + /turbo-darwin-64@1.12.5: + resolution: {integrity: sha512-0GZ8reftwNQgIQLHkHjHEXTc/Z1NJm+YjsrBP+qhM/7yIZ3TEy9gJhuogDt2U0xIWwFgisTyzbtU7xNaQydtoA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.6.3: - resolution: {integrity: sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==} + /turbo-darwin-arm64@1.12.5: + resolution: {integrity: sha512-8WpOLNNzvH6kohQOjihD+gaWL+ZFNfjvBwhOF0rjEzvW+YR3Pa7KjhulrjWyeN2yMFqAPubTbZIGOz1EVXLuQA==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.6.3: - resolution: {integrity: sha512-O9uc6J0yoRPWdPg9THRQi69K6E2iZ98cRHNvus05lZbcPzZTxJYkYGb5iagCmCW/pq6fL4T4oLWAd6evg2LGQA==} + /turbo-linux-64@1.12.5: + resolution: {integrity: sha512-INit73+bNUpwqGZCxgXCR3I+cQsdkQ3/LkfkgSOibkpg+oGqxJRzeXw3sp990d7SCoE8QOcs3iw+PtiFX/LDAA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.6.3: - resolution: {integrity: sha512-dCy667qqEtZIhulsRTe8hhWQNCJO0i20uHXv7KjLHuFZGCeMbWxB8rsneRoY+blf8+QNqGuXQJxak7ayjHLxiA==} + /turbo-linux-arm64@1.12.5: + resolution: {integrity: sha512-6lkRBvxtI/GQdGtaAec9LvVQUoRw6nXFp0kM+Eu+5PbZqq7yn6cMkgDJLI08zdeui36yXhone8XGI8pHg8bpUQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.6.3: - resolution: {integrity: sha512-lKRqwL3mrVF09b9KySSaOwetehmGknV9EcQTF7d2dxngGYYX1WXoQLjFP9YYH8ZV07oPm+RUOAKSCQuDuMNhiA==} + /turbo-windows-64@1.12.5: + resolution: {integrity: sha512-gQYbOhZg5Ww0bQ/bC0w/4W6yQRwBumUUnkB+QPo15VznwxZe2a7bo6JM+9Xy9dKLa/kn+p7zTqme4OEp6M3/Yg==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.6.3: - resolution: {integrity: sha512-BXY1sDPEA1DgPwuENvDCD8B7Hb0toscjus941WpL8CVd10hg9pk/MWn9CNgwDO5Q9ks0mw+liDv2EMnleEjeNA==} + /turbo-windows-arm64@1.12.5: + resolution: {integrity: sha512-auvhZ9FrhnvQ4mgBlY9O68MT4dIfprYGvd2uPICba/mHUZZvVy5SGgbHJ0KbMwaJfnnFoPgLJO6M+3N2gDprKw==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.6.3: - resolution: {integrity: sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==} + /turbo@1.12.5: + resolution: {integrity: sha512-FATU5EnhrYG8RvQJYFJnDd18DpccDjyvd53hggw9T9JEg9BhWtIEoeaKtBjYbpXwOVrJQMDdXcIB4f2nD3QPPg==} hasBin: true - requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.6.3 - turbo-darwin-arm64: 1.6.3 - turbo-linux-64: 1.6.3 - turbo-linux-arm64: 1.6.3 - turbo-windows-64: 1.6.3 - turbo-windows-arm64: 1.6.3 + turbo-darwin-64: 1.12.5 + turbo-darwin-arm64: 1.12.5 + turbo-linux-64: 1.12.5 + turbo-linux-arm64: 1.12.5 + turbo-windows-64: 1.12.5 + turbo-windows-arm64: 1.12.5 dev: true /twilio@4.12.0(debug@4.3.4): From f8d5fb75dabce5ef32812c58d2a56881cd16d2bf Mon Sep 17 00:00:00 2001 From: Ramesh Date: Fri, 22 Mar 2024 17:35:53 +0545 Subject: [PATCH 7/9] chore: release v0.63.0 (#626) --- CHANGELOG.md | 9 ++++ package.json | 2 +- packages/config/package.json | 12 +++-- packages/firebase/package.json | 24 +++++---- packages/mailer/package.json | 16 +++--- packages/mercurius/package.json | 20 ++++---- packages/multi-tenant/package.json | 28 +++++----- packages/s3/package.json | 24 +++++---- packages/slonik/package.json | 16 +++--- packages/user/package.json | 28 +++++----- pnpm-lock.yaml | 68 ++++++++++++------------- tools/eslint-config-custom/package.json | 2 +- tools/tsconfig/package.json | 2 +- 13 files changed, 138 insertions(+), 113 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a3310e57..6b04f1a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [0.63.0](https://github.com/dzangolab/fastify/compare/v0.62.4...v0.63.0) (2024-03-22) + + +### Features + +* **config:** add multi-stream support for logger config ([#616](https://github.com/dzangolab/fastify/issues/616)) ([d9ebb2e](https://github.com/dzangolab/fastify/commit/d9ebb2efc4a5785d5e2b6519b4decb1014f6f1af)) + + + ## [0.62.4](https://github.com/dzangolab/fastify/compare/v0.62.3...v0.62.4) (2024-03-21) diff --git a/package.json b/package.json index 4a43ac679..0d10c6dc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify", - "version": "0.62.4", + "version": "0.63.0", "private": true, "repository": { "type": "git", diff --git a/packages/config/package.json b/packages/config/package.json index 658dd864f..1d4fe3865 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-config", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify config plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/config#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-config.umd.cjs", "module": "./dist/dzangolab-fastify-config.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -34,12 +36,12 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "pino": "8.8.0", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" @@ -52,4 +54,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 559a6ca3a..b1d42b69a 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-firebase", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify firebase plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/firebase#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-firebase.umd.cjs", "module": "./dist/dzangolab-fastify-firebase.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -33,30 +35,30 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "firebase-admin": "12.0.0", @@ -69,4 +71,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/mailer/package.json b/packages/mailer/package.json index 8788ec114..e550cbcd4 100644 --- a/packages/mailer/package.json +++ b/packages/mailer/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mailer", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify mailer plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mailer#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-mailer.umd.cjs", "module": "./dist/dzangolab-fastify-mailer.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -37,7 +39,7 @@ "nodemailer-mjml": "1.2.24" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", "@types/mjml": "4.7.4", "@types/node": "18.16.18", "@types/nodemailer": "6.4.14", @@ -46,18 +48,18 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mjml": "4.14.1", "prettier": "2.8.8", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mjml": ">=4.13.0" @@ -66,4 +68,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/mercurius/package.json b/packages/mercurius/package.json index a373d6de1..fa0b63942 100644 --- a/packages/mercurius/package.json +++ b/packages/mercurius/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mercurius", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify mercurius plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mercurius#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-mercurius.umd.cjs", "module": "./dist/dzangolab-fastify-mercurius.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -29,28 +31,28 @@ "typecheck": "tsc --noEmit -p tsconfig.json --composite false" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "graphql": "16.6.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "graphql": ">=16.6.0", @@ -61,4 +63,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/multi-tenant/package.json b/packages/multi-tenant/package.json index 730b5e8dd..966c61921 100644 --- a/packages/multi-tenant/package.json +++ b/packages/multi-tenant/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-multi-tenant", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify multi-tenant plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/multi-tenant#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-multi-tenant.umd.cjs", "module": "./dist/dzangolab-fastify-multi-tenant.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -35,10 +37,10 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", - "@dzangolab/fastify-user": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-user": "0.63.0", "@types/humps": "2.0.6", "@types/lodash.merge": "4.6.9", "@types/node": "18.16.18", @@ -47,14 +49,14 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vite-tsconfig-paths": "4.2.3", @@ -62,10 +64,10 @@ "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", - "@dzangolab/fastify-user": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-user": "0.63.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mercurius": ">=12.2.0", @@ -77,4 +79,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/s3/package.json b/packages/s3/package.json index 3c7856e80..e92ffacca 100644 --- a/packages/s3/package.json +++ b/packages/s3/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-s3", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify S3 plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/s3#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-s3.umd.cjs", "module": "./dist/dzangolab-fastify-s3.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -41,28 +43,28 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "slonik": ">=37.2.0", @@ -72,4 +74,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/slonik/package.json b/packages/slonik/package.json index 409e5f10c..3501f92fb 100644 --- a/packages/slonik/package.json +++ b/packages/slonik/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-slonik", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify slonik plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/slonik#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-slonik.umd.cjs", "module": "./dist/dzangolab-fastify-slonik.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -34,7 +36,7 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", "@types/humps": "2.0.6", "@types/node": "18.16.18", "@types/pg": "8.10.9", @@ -42,19 +44,19 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2", "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "slonik": ">=37.2.0", @@ -64,4 +66,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/packages/user/package.json b/packages/user/package.json index e5a2fd09f..69d39092d 100644 --- a/packages/user/package.json +++ b/packages/user/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-user", - "version": "0.62.4", + "version": "0.63.0", "description": "Fastify user plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/user#readme", "repository": { @@ -19,7 +19,9 @@ "main": "./dist/dzangolab-fastify-user.umd.cjs", "module": "./dist/dzangolab-fastify-user.js", "types": "./dist/types/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -34,10 +36,10 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mailer": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mailer": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "@fastify/cors": "8.3.0", "@fastify/formbody": "7.4.0", "@types/humps": "2.0.6", @@ -47,7 +49,7 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.62.4", + "eslint-config-custom": "0.63.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", @@ -55,16 +57,16 @@ "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.62.4", + "tsconfig": "0.63.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.62.4", - "@dzangolab/fastify-mailer": "0.62.4", - "@dzangolab/fastify-mercurius": "0.62.4", - "@dzangolab/fastify-slonik": "0.62.4", + "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-mailer": "0.63.0", + "@dzangolab/fastify-mercurius": "0.63.0", + "@dzangolab/fastify-slonik": "0.63.0", "@fastify/cors": ">=8.2.0", "@fastify/formbody": ">=7.4.0", "fastify": ">=4.10.2", @@ -78,4 +80,4 @@ "node": ">=16", "pnpm": ">=8" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f986f6b4e..d984befca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,7 +45,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -60,7 +60,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -82,13 +82,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -106,7 +106,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -127,7 +127,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -161,7 +161,7 @@ importers: version: 1.2.24(nodemailer@6.9.8) devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@types/mjml': specifier: 4.7.4 @@ -188,7 +188,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -203,7 +203,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -218,10 +218,10 @@ importers: packages/mercurius: devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@dzangolab/fastify-slonik': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -239,7 +239,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -260,7 +260,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -288,16 +288,16 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../slonik '@dzangolab/fastify-user': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../user '@types/humps': specifier: 2.0.6 @@ -324,7 +324,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -345,7 +345,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -397,13 +397,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -421,7 +421,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -436,7 +436,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -461,7 +461,7 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@types/humps': specifier: 2.0.6 @@ -485,7 +485,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -500,7 +500,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -528,16 +528,16 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../config '@dzangolab/fastify-mailer': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../mailer '@dzangolab/fastify-mercurius': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.62.4 + specifier: 0.63.0 version: link:../slonik '@fastify/cors': specifier: 8.3.0 @@ -567,7 +567,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -591,7 +591,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.62.4 + specifier: 0.63.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 diff --git a/tools/eslint-config-custom/package.json b/tools/eslint-config-custom/package.json index 688c63971..a3e025a66 100644 --- a/tools/eslint-config-custom/package.json +++ b/tools/eslint-config-custom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-custom", - "version": "0.62.4", + "version": "0.63.0", "license": "MIT", "main": "index.js", "scripts": { diff --git a/tools/tsconfig/package.json b/tools/tsconfig/package.json index 8d0789722..02093f622 100644 --- a/tools/tsconfig/package.json +++ b/tools/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.62.4", + "version": "0.63.0", "private": true, "files": [ "base.json" From 5023a5151a210b4a6d71b83be53e08c16e2a4cd3 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti <91712746+dipendraupreti@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:15:34 +0545 Subject: [PATCH 8/9] feat(user): add permissions while creating role (#622) --- packages/user/src/customApiError.ts | 20 ++++++ packages/user/src/model/roles/controller.ts | 8 +++ .../src/model/roles/handlers/createRole.ts | 8 ++- .../src/model/roles/handlers/deleteRole.ts | 61 ++++++++++++++++ .../model/roles/handlers/getPermissions.ts | 12 +++- .../user/src/model/roles/handlers/index.ts | 2 + .../model/roles/handlers/updatePermissions.ts | 15 +++- packages/user/src/model/roles/resolver.ts | 61 ++++++++++++++-- packages/user/src/model/roles/service.ts | 69 ++++++++++++++++--- 9 files changed, 238 insertions(+), 18 deletions(-) create mode 100644 packages/user/src/customApiError.ts create mode 100644 packages/user/src/model/roles/handlers/deleteRole.ts diff --git a/packages/user/src/customApiError.ts b/packages/user/src/customApiError.ts new file mode 100644 index 000000000..750b32949 --- /dev/null +++ b/packages/user/src/customApiError.ts @@ -0,0 +1,20 @@ +interface CustomApiErrorType { + message: string; + name: string; + statusCode: number; +} + +class CustomApiError extends Error { + public statusCode: number; + + constructor({ message, name, statusCode }: CustomApiErrorType) { + super(message); + this.message = message; + this.name = name; + this.statusCode = statusCode; + } +} + +export default CustomApiError; + +export type { CustomApiErrorType }; diff --git a/packages/user/src/model/roles/controller.ts b/packages/user/src/model/roles/controller.ts index 964ad9fd8..5140ae553 100644 --- a/packages/user/src/model/roles/controller.ts +++ b/packages/user/src/model/roles/controller.ts @@ -8,6 +8,14 @@ const plugin = async ( options: unknown, done: () => void ) => { + fastify.delete( + ROUTE_ROLES, + { + preHandler: [fastify.verifySession()], + }, + handlers.deleteRole + ); + fastify.get( ROUTE_ROLES, { diff --git a/packages/user/src/model/roles/handlers/createRole.ts b/packages/user/src/model/roles/handlers/createRole.ts index 528ac25a0..415558fc5 100644 --- a/packages/user/src/model/roles/handlers/createRole.ts +++ b/packages/user/src/model/roles/handlers/createRole.ts @@ -6,15 +6,17 @@ import type { SessionRequest } from "supertokens-node/framework/fastify"; const createRole = async (request: SessionRequest, reply: FastifyReply) => { const { body, log } = request; - const { role } = body as { + const { role, permissions } = body as { role: string; + permissions: string[]; }; try { const service = new RoleService(); - await service.createRole(role); - return reply.send({ role }); + const createResponse = await service.createRole(role, permissions); + + return reply.send(createResponse); } catch (error) { log.error(error); reply.status(500); diff --git a/packages/user/src/model/roles/handlers/deleteRole.ts b/packages/user/src/model/roles/handlers/deleteRole.ts new file mode 100644 index 000000000..79a137523 --- /dev/null +++ b/packages/user/src/model/roles/handlers/deleteRole.ts @@ -0,0 +1,61 @@ +import CustomApiError from "../../../customApiError"; +import RoleService from "../service"; + +import type { FastifyReply } from "fastify"; +import type { SessionRequest } from "supertokens-node/framework/fastify"; + +const deleteRole = async (request: SessionRequest, reply: FastifyReply) => { + const { log, query } = request; + + try { + let { role } = query as { role?: string }; + + if (role) { + try { + role = JSON.parse(role) as string; + } catch { + /* empty */ + } + + if (typeof role != "string") { + throw new CustomApiError({ + name: "UNKNOWN_ROLE_ERROR", + message: `Invalid role`, + statusCode: 422, + }); + } + + const service = new RoleService(); + + const deleteResponse = await service.deleteRole(role); + + return reply.send(deleteResponse); + } + + throw new CustomApiError({ + name: "UNKNOWN_ROLE_ERROR", + message: `Invalid role`, + statusCode: 422, + }); + } catch (error) { + if (error instanceof CustomApiError) { + reply.status(error.statusCode); + + return reply.send({ + message: error.message, + name: error.name, + statusCode: error.statusCode, + }); + } + + log.error(error); + reply.status(500); + + return reply.send({ + status: "ERROR", + message: "Oops! Something went wrong", + }); + } +}; + +export default deleteRole; diff --git a/packages/user/src/model/roles/handlers/getPermissions.ts b/packages/user/src/model/roles/handlers/getPermissions.ts index e70ccac79..dcda6ae2f 100644 --- a/packages/user/src/model/roles/handlers/getPermissions.ts +++ b/packages/user/src/model/roles/handlers/getPermissions.ts @@ -8,9 +8,19 @@ const getPermissions = async (request: SessionRequest, reply: FastifyReply) => { let permissions: string[] = []; try { - const { role } = query as { role?: string }; + let { role } = query as { role?: string }; if (role) { + try { + role = JSON.parse(role) as string; + } catch { + /* empty */ + } + + if (typeof role != "string") { + return reply.send({ permissions }); + } + const service = new RoleService(); permissions = await service.getPermissionsForRole(role); diff --git a/packages/user/src/model/roles/handlers/index.ts b/packages/user/src/model/roles/handlers/index.ts index 990facb3b..9176aedec 100644 --- a/packages/user/src/model/roles/handlers/index.ts +++ b/packages/user/src/model/roles/handlers/index.ts @@ -1,9 +1,11 @@ import createRole from "./createRole"; +import deleteRole from "./deleteRole"; import getPermissions from "./getPermissions"; import getRoles from "./getRoles"; import updatePermissions from "./updatePermissions"; export default { + deleteRole, createRole, getRoles, getPermissions, diff --git a/packages/user/src/model/roles/handlers/updatePermissions.ts b/packages/user/src/model/roles/handlers/updatePermissions.ts index 97bc2f083..2bb89c5c9 100644 --- a/packages/user/src/model/roles/handlers/updatePermissions.ts +++ b/packages/user/src/model/roles/handlers/updatePermissions.ts @@ -1,3 +1,4 @@ +import CustomApiError from "../../../customApiError"; import RoleService from "../service"; import type { FastifyReply } from "fastify"; @@ -16,13 +17,23 @@ const updatePermissions = async ( }; const service = new RoleService(); - const updatedPermissions = await service.updateRolePermissions( + const updatedPermissionsResponse = await service.updateRolePermissions( role, permissions ); - return reply.send({ permissions: updatedPermissions }); + return reply.send(updatedPermissionsResponse); } catch (error) { + if (error instanceof CustomApiError) { + reply.status(error.statusCode); + + return reply.send({ + message: error.message, + name: error.name, + statusCode: error.statusCode, + }); + } + log.error(error); reply.status(500); diff --git a/packages/user/src/model/roles/resolver.ts b/packages/user/src/model/roles/resolver.ts index 543ee7a5b..ba1b2ab28 100644 --- a/packages/user/src/model/roles/resolver.ts +++ b/packages/user/src/model/roles/resolver.ts @@ -1,11 +1,44 @@ import mercurius from "mercurius"; import RoleService from "./service"; +import CustomApiError from "../../customApiError"; import type { MercuriusContext } from "mercurius"; const Mutation = { createRole: async ( + parent: unknown, + arguments_: { + role: string; + permissions: string[]; + }, + context: MercuriusContext + ) => { + const { app } = context; + + try { + const service = new RoleService(); + + const createResponse = await service.createRole( + arguments_.role, + arguments_.permissions + ); + + return createResponse; + } catch (error) { + app.log.error(error); + + const mercuriusError = new mercurius.ErrorWithProps( + "Oops, Something went wrong" + ); + + mercuriusError.statusCode = 500; + + return mercuriusError; + } + }, + + deleteRole: async ( parent: unknown, arguments_: { role: string; @@ -16,10 +49,21 @@ const Mutation = { try { const service = new RoleService(); - await service.createRole(arguments_.role); - return arguments_.role; + const { role } = arguments_; + + const deleteResponse = await service.deleteRole(role); + + return deleteResponse; } catch (error) { + if (error instanceof CustomApiError) { + const mercuriusError = new mercurius.ErrorWithProps(error.name); + + mercuriusError.statusCode = error.statusCode; + + return mercuriusError; + } + app.log.error(error); const mercuriusError = new mercurius.ErrorWithProps( @@ -31,6 +75,7 @@ const Mutation = { return mercuriusError; } }, + updateRolePermissions: async ( parent: unknown, arguments_: { @@ -44,13 +89,21 @@ const Mutation = { try { const service = new RoleService(); - const updatedPermissions = await service.updateRolePermissions( + const updatedPermissionsResponse = await service.updateRolePermissions( role, permissions ); - return updatedPermissions; + return updatedPermissionsResponse; } catch (error) { + if (error instanceof CustomApiError) { + const mercuriusError = new mercurius.ErrorWithProps(error.name); + + mercuriusError.statusCode = error.statusCode; + + return mercuriusError; + } + app.log.error(error); const mercuriusError = new mercurius.ErrorWithProps( diff --git a/packages/user/src/model/roles/service.ts b/packages/user/src/model/roles/service.ts index a1ba2ed6f..29b2c22bc 100644 --- a/packages/user/src/model/roles/service.ts +++ b/packages/user/src/model/roles/service.ts @@ -1,8 +1,42 @@ import UserRoles from "supertokens-node/recipe/userroles"; +import CustomApiError from "../../customApiError"; + class RoleService { - createRole = async (role: string) => { - await UserRoles.createNewRoleOrAddPermissions(role, []); + createRole = async (role: string, permissions?: string[]) => { + const createRoleResponse = await UserRoles.createNewRoleOrAddPermissions( + role, + permissions || [] + ); + + return createRoleResponse; + }; + + deleteRole = async ( + role: string + ): Promise<{ status: "OK"; didRoleExist: boolean }> => { + const response = await UserRoles.getUsersThatHaveRole(role); + + if (response.status === "UNKNOWN_ROLE_ERROR") { + throw new CustomApiError({ + name: response.status, + message: `Invalid role`, + statusCode: 422, + }); + } + + if (response.users.length > 0) { + throw new CustomApiError({ + name: "ROLE_IN_USE", + message: + "The role is currently assigned to one or more users and cannot be deleted", + statusCode: 422, + }); + } + + const deleteRoleResponse = await UserRoles.deleteRole(role); + + return deleteRoleResponse; }; getPermissionsForRole = async (role: string): Promise => { @@ -17,13 +51,23 @@ class RoleService { return permissions; }; - getRoles = async (): Promise => { - let roles: string[] = []; + getRoles = async (): Promise<{ role: string; permissions: string[] }[]> => { + let roles: { role: string; permissions: string[] }[] = []; const response = await UserRoles.getAllRoles(); if (response.status === "OK") { - roles = response.roles; + // [DU 2024-MAR-20] This is N+1 problem + roles = await Promise.all( + response.roles.map(async (role) => { + const response = await UserRoles.getPermissionsForRole(role); + + return { + role, + permissions: response.status === "OK" ? response.permissions : [], + }; + }) + ); } return roles; @@ -32,11 +76,15 @@ class RoleService { updateRolePermissions = async ( role: string, permissions: string[] - ): Promise => { + ): Promise<{ status: "OK"; permissions: string[] }> => { const response = await UserRoles.getPermissionsForRole(role); if (response.status === "UNKNOWN_ROLE_ERROR") { - throw new Error("UNKNOWN_ROLE_ERROR"); + throw new CustomApiError({ + name: "UNKNOWN_ROLE_ERROR", + message: `Invalid role`, + statusCode: 422, + }); } const rolePermissions = response.permissions; @@ -52,7 +100,12 @@ class RoleService { await UserRoles.removePermissionsFromRole(role, removedPermissions); await UserRoles.createNewRoleOrAddPermissions(role, newPermissions); - return this.getPermissionsForRole(role); + const permissionsResponse = await this.getPermissionsForRole(role); + + return { + status: "OK", + permissions: permissionsResponse, + }; }; } From f33af7bbba30c4df7800bbc3dc53f66822d3416f Mon Sep 17 00:00:00 2001 From: Ramesh Date: Sat, 23 Mar 2024 10:56:17 +0545 Subject: [PATCH 9/9] chore: release v0.64.0 (#627) --- CHANGELOG.md | 9 ++++ package.json | 2 +- packages/config/package.json | 6 +-- packages/firebase/package.json | 18 +++---- packages/mailer/package.json | 10 ++-- packages/mercurius/package.json | 14 ++--- packages/multi-tenant/package.json | 22 ++++---- packages/s3/package.json | 18 +++---- packages/slonik/package.json | 10 ++-- packages/user/package.json | 22 ++++---- pnpm-lock.yaml | 68 ++++++++++++------------- tools/eslint-config-custom/package.json | 2 +- tools/tsconfig/package.json | 2 +- 13 files changed, 106 insertions(+), 97 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b04f1a04..6c435d0c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [0.64.0](https://github.com/dzangolab/fastify/compare/v0.63.0...v0.64.0) (2024-03-23) + + +### Features + +* **user:** add permissions while creating role ([#622](https://github.com/dzangolab/fastify/issues/622)) ([5023a51](https://github.com/dzangolab/fastify/commit/5023a5151a210b4a6d71b83be53e08c16e2a4cd3)) + + + # [0.63.0](https://github.com/dzangolab/fastify/compare/v0.62.4...v0.63.0) (2024-03-22) diff --git a/package.json b/package.json index 0d10c6dc7..7bb10cfa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify", - "version": "0.63.0", + "version": "0.64.0", "private": true, "repository": { "type": "git", diff --git a/packages/config/package.json b/packages/config/package.json index 1d4fe3865..b59c075e8 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-config", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify config plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/config#readme", "repository": { @@ -36,12 +36,12 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "pino": "8.8.0", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" diff --git a/packages/firebase/package.json b/packages/firebase/package.json index b1d42b69a..205d7d6b1 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-firebase", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify firebase plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/firebase#readme", "repository": { @@ -35,30 +35,30 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.0" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "firebase-admin": "12.0.0", diff --git a/packages/mailer/package.json b/packages/mailer/package.json index e550cbcd4..a9cbbc051 100644 --- a/packages/mailer/package.json +++ b/packages/mailer/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mailer", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify mailer plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mailer#readme", "repository": { @@ -39,7 +39,7 @@ "nodemailer-mjml": "1.2.24" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", "@types/mjml": "4.7.4", "@types/node": "18.16.18", "@types/nodemailer": "6.4.14", @@ -48,18 +48,18 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mjml": "4.14.1", "prettier": "2.8.8", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mjml": ">=4.13.0" diff --git a/packages/mercurius/package.json b/packages/mercurius/package.json index fa0b63942..a2af81b19 100644 --- a/packages/mercurius/package.json +++ b/packages/mercurius/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-mercurius", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify mercurius plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/mercurius#readme", "repository": { @@ -31,28 +31,28 @@ "typecheck": "tsc --noEmit -p tsconfig.json --composite false" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "graphql": "16.6.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "graphql": ">=16.6.0", diff --git a/packages/multi-tenant/package.json b/packages/multi-tenant/package.json index 966c61921..e19737f13 100644 --- a/packages/multi-tenant/package.json +++ b/packages/multi-tenant/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-multi-tenant", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify multi-tenant plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/multi-tenant#readme", "repository": { @@ -37,10 +37,10 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", - "@dzangolab/fastify-user": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", + "@dzangolab/fastify-user": "0.64.0", "@types/humps": "2.0.6", "@types/lodash.merge": "4.6.9", "@types/node": "18.16.18", @@ -49,14 +49,14 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vite-tsconfig-paths": "4.2.3", @@ -64,10 +64,10 @@ "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", - "@dzangolab/fastify-user": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", + "@dzangolab/fastify-user": "0.64.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "mercurius": ">=12.2.0", diff --git a/packages/s3/package.json b/packages/s3/package.json index e92ffacca..3658c33da 100644 --- a/packages/s3/package.json +++ b/packages/s3/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-s3", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify S3 plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/s3#readme", "repository": { @@ -43,28 +43,28 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "@types/node": "18.16.18", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "fastify": ">=4.10.2", "fastify-plugin": ">=4.4.0", "slonik": ">=37.2.0", diff --git a/packages/slonik/package.json b/packages/slonik/package.json index 3501f92fb..67b6760f4 100644 --- a/packages/slonik/package.json +++ b/packages/slonik/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-slonik", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify slonik plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/slonik#readme", "repository": { @@ -36,7 +36,7 @@ "pg": "8.11.3" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", "@types/humps": "2.0.6", "@types/node": "18.16.18", "@types/pg": "8.10.9", @@ -44,19 +44,19 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "prettier": "2.8.8", "slonik": "37.2.0", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2", "zod": "3.22.4" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", "fastify": ">=4.9.2", "fastify-plugin": ">=4.3.0", "slonik": ">=37.2.0", diff --git a/packages/user/package.json b/packages/user/package.json index 69d39092d..19c64327a 100644 --- a/packages/user/package.json +++ b/packages/user/package.json @@ -1,6 +1,6 @@ { "name": "@dzangolab/fastify-user", - "version": "0.63.0", + "version": "0.64.0", "description": "Fastify user plugin", "homepage": "https://github.com/dzangolab/fastify/tree/main/packages/user#readme", "repository": { @@ -36,10 +36,10 @@ "zod": "3.22.4" }, "devDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mailer": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mailer": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "@fastify/cors": "8.3.0", "@fastify/formbody": "7.4.0", "@types/humps": "2.0.6", @@ -49,7 +49,7 @@ "@typescript-eslint/parser": "5.62.0", "@vitest/coverage-istanbul": "0.32.2", "eslint": "8.56.0", - "eslint-config-custom": "0.63.0", + "eslint-config-custom": "0.64.0", "fastify": "4.10.2", "fastify-plugin": "4.4.0", "mercurius": "12.2.0", @@ -57,16 +57,16 @@ "prettier": "2.8.8", "slonik": "37.2.0", "supertokens-node": "14.1.3", - "tsconfig": "0.63.0", + "tsconfig": "0.64.0", "typescript": "4.9.5", "vite": "4.3.9", "vitest": "0.32.2" }, "peerDependencies": { - "@dzangolab/fastify-config": "0.63.0", - "@dzangolab/fastify-mailer": "0.63.0", - "@dzangolab/fastify-mercurius": "0.63.0", - "@dzangolab/fastify-slonik": "0.63.0", + "@dzangolab/fastify-config": "0.64.0", + "@dzangolab/fastify-mailer": "0.64.0", + "@dzangolab/fastify-mercurius": "0.64.0", + "@dzangolab/fastify-slonik": "0.64.0", "@fastify/cors": ">=8.2.0", "@fastify/formbody": ">=7.4.0", "fastify": ">=4.10.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d984befca..bb8a27fb0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,7 +45,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -60,7 +60,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -82,13 +82,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -106,7 +106,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -127,7 +127,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -161,7 +161,7 @@ importers: version: 1.2.24(nodemailer@6.9.8) devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@types/mjml': specifier: 4.7.4 @@ -188,7 +188,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -203,7 +203,7 @@ importers: specifier: 2.8.8 version: 2.8.8 tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -218,10 +218,10 @@ importers: packages/mercurius: devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@dzangolab/fastify-slonik': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -239,7 +239,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -260,7 +260,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -288,16 +288,16 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../slonik '@dzangolab/fastify-user': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../user '@types/humps': specifier: 2.0.6 @@ -324,7 +324,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -345,7 +345,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -397,13 +397,13 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@dzangolab/fastify-mercurius': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../slonik '@types/node': specifier: 18.16.18 @@ -421,7 +421,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -436,7 +436,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -461,7 +461,7 @@ importers: version: 8.11.3 devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@types/humps': specifier: 2.0.6 @@ -485,7 +485,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -500,7 +500,7 @@ importers: specifier: 37.2.0 version: 37.2.0(zod@3.22.4) tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 @@ -528,16 +528,16 @@ importers: version: 3.22.4 devDependencies: '@dzangolab/fastify-config': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../config '@dzangolab/fastify-mailer': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../mailer '@dzangolab/fastify-mercurius': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../mercurius '@dzangolab/fastify-slonik': - specifier: 0.63.0 + specifier: 0.64.0 version: link:../slonik '@fastify/cors': specifier: 8.3.0 @@ -567,7 +567,7 @@ importers: specifier: 8.56.0 version: 8.56.0 eslint-config-custom: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/eslint-config-custom fastify: specifier: 4.10.2 @@ -591,7 +591,7 @@ importers: specifier: 14.1.3 version: 14.1.3 tsconfig: - specifier: 0.63.0 + specifier: 0.64.0 version: link:../../tools/tsconfig typescript: specifier: 4.9.5 diff --git a/tools/eslint-config-custom/package.json b/tools/eslint-config-custom/package.json index a3e025a66..9a910b7c6 100644 --- a/tools/eslint-config-custom/package.json +++ b/tools/eslint-config-custom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-custom", - "version": "0.63.0", + "version": "0.64.0", "license": "MIT", "main": "index.js", "scripts": { diff --git a/tools/tsconfig/package.json b/tools/tsconfig/package.json index 02093f622..2b7d691a9 100644 --- a/tools/tsconfig/package.json +++ b/tools/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.63.0", + "version": "0.64.0", "private": true, "files": [ "base.json"