From 542352c670f95892d1b35e2b8f62e60f715a107c Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:48:59 +0300 Subject: [PATCH 01/16] types(notification-rule): respect new notification model --- src/models/project.ts | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/models/project.ts b/src/models/project.ts index 98fb71e9..f3e2f4f8 100644 --- a/src/models/project.ts +++ b/src/models/project.ts @@ -24,7 +24,7 @@ export interface ProjectNotificationsRuleDBScheme { uidAdded: ObjectId; /** - * Receive type: 'ALL' or 'ONLY_NEW' + * Receive type: 'SEEN_MORE' or 'ONLY_NEW' */ whatToReceive: ReceiveTypes; @@ -42,6 +42,16 @@ export interface ProjectNotificationsRuleDBScheme { * Available channels to receive */ channels: NotificationsChannelsDBScheme; + + /** + * If this number of events is reached in the eventThresholdPeriod, the rule will be triggered + */ + threshold?: number; + + /** + * Size of period (in milliseconds) to count events to compare to rule threshold + */ + thresholdPeriod?: number; } /** @@ -51,7 +61,7 @@ export enum ReceiveTypes { /** * All notifications */ - ALL = 'ALL', + SEEN_MORE = 'SEEN_MORE', /** * Only first occurrence @@ -69,7 +79,7 @@ export interface CreateProjectNotificationsRulePayload { isEnabled: true; /** - * Receive type: 'ALL' or 'ONLY_NEW' + * Receive type: 'SEEN_MORE' or 'ONLY_NEW' */ whatToReceive: ReceiveTypes; @@ -92,6 +102,16 @@ export interface CreateProjectNotificationsRulePayload { * Available channels to receive */ channels: NotificationsChannelsDBScheme; + + /** + * If this number of events is reached in the eventThresholdPeriod, the rule will be triggered + */ + threshold?: number; + + /** + * Size of period (in milliseconds) to count events to compare to rule threshold + */ + thresholdPeriod?: number; } /** @@ -127,6 +147,16 @@ interface UpdateProjectNotificationsRulePayload { * Available channels to receive */ channels: NotificationsChannelsDBScheme; + + /** + * If this number of events is reached in the eventThresholdPeriod, the rule will be triggered + */ + threshold?: number; + + /** + * Size of period (in milliseconds) to count events to compare to rule threshold + */ + thresholdPeriod?: number; } /** From 517f057380c11cc0debe51c6f53f31c367188d0c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:54:25 +0000 Subject: [PATCH 02/16] Bump version up to 1.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4966ab91..46cbd9a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.1.1", + "version": "1.1.2", "main": "index.ts", "license": "UNLICENSED", "scripts": { From 626f84832f580d86442b05d511c1fd24b59b64ee Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:21:45 +0300 Subject: [PATCH 03/16] chore(dependencies): update hawk.so/types --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 46cbd9a0..5df3f2ae 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@graphql-tools/schema": "^8.5.1", "@graphql-tools/utils": "^8.9.0", "@hawk.so/nodejs": "^3.1.1", - "@hawk.so/types": "^0.1.21", + "@hawk.so/types": "^0.1.22", "@types/amqp-connection-manager": "^2.0.4", "@types/bson": "^4.0.5", "@types/debug": "^4.1.5", From b60695dfa77677b3b70c4fd00a7915f892f71eea Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:23:05 +0000 Subject: [PATCH 04/16] Bump version up to 1.1.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8de52135..bf317d93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.1.6", + "version": "1.1.7", "main": "index.ts", "license": "UNLICENSED", "scripts": { From 175f109a8799282626567f760c054a7b0284b28a Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:23:42 +0300 Subject: [PATCH 05/16] chore (yarn) update yarn lock file --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 09987427..945f22d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -458,10 +458,10 @@ dependencies: "@types/mongodb" "^3.5.34" -"@hawk.so/types@^0.1.21": - version "0.1.21" - resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.21.tgz#8979b1aff670317e5d092aaefcd879729df88adc" - integrity sha512-Jjy1qznAB7SprVtdgWJS9tdGAaK7rTNWEVWG05m6u3Qd3tTXkgty4D0oAmhTFBnJ/MElPVuundYnDB1r4dHZQQ== +"@hawk.so/types@^0.1.22": + version "0.1.22" + resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.22.tgz#e0fe3a4eb2d0a4c8fe8c67422bc295c67f0bb9e9" + integrity sha512-y6Y46glKYtvQcJTT3+5Lgi2CATgxT9NDkKdSJNy/1wfvouCrD7rehtOSQ82Tw3/5Z2i5tqbqVRlfkyG0b6ESWw== dependencies: "@types/mongodb" "^3.5.34" From 50c0c57db9238c183ea4a5c74d4fd0088e06ed54 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:39:15 +0300 Subject: [PATCH 06/16] types(notifications): update typeDefs --- src/typeDefs/projectNotifications.ts | 14 +++++++++++-- src/typeDefs/projectNotificationsMutations.ts | 20 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/typeDefs/projectNotifications.ts b/src/typeDefs/projectNotifications.ts index 430b3f2a..76909b14 100644 --- a/src/typeDefs/projectNotifications.ts +++ b/src/typeDefs/projectNotifications.ts @@ -11,9 +11,9 @@ export default gql` ONLY_NEW """ - Receive all events + Receive all events that reached threshold in period """ - ALL + SEEN_MORE } """ @@ -49,5 +49,15 @@ export default gql` Notification channels to recieve events """ channels: NotificationsChannels + + """ + Threshold to receive notification + """ + threshold: Int + + """ + Period to receive notification + """ + thresholdPeriod: Int } `; diff --git a/src/typeDefs/projectNotificationsMutations.ts b/src/typeDefs/projectNotificationsMutations.ts index e01b7291..61efca08 100644 --- a/src/typeDefs/projectNotificationsMutations.ts +++ b/src/typeDefs/projectNotificationsMutations.ts @@ -34,6 +34,16 @@ export default gql` Notification channels to recieve events """ channels: NotificationsChannelsInput! + + """ + Threshold to receive notification + """ + threshold: Int + + """ + Period to receive notification + """ + thresholdPeriod: Int } """ @@ -74,6 +84,16 @@ export default gql` Notification channels to recieve events """ channels: NotificationsChannelsInput! + + """ + Threshold to receive notification + """ + threshold: Int + + """ + Period to receive notification + """ + thresholdPeriod: Int } """ From 3824ced182c1b77a270890ea1061463802496ac7 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:39:53 +0300 Subject: [PATCH 07/16] types(resolvers): update projectNotifications types for resolvers --- src/resolvers/projectNotifications.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/resolvers/projectNotifications.ts b/src/resolvers/projectNotifications.ts index dcdcf673..92a33190 100644 --- a/src/resolvers/projectNotifications.ts +++ b/src/resolvers/projectNotifications.ts @@ -39,6 +39,16 @@ interface CreateProjectNotificationsRuleMutationPayload { * Available channels to receive */ channels: NotificationsChannelsDBScheme; + + /** + * Threshold to receive notification + */ + threshold: number; + + /** + * Period to receive notification + */ + thresholdPeriod: number; } /** From a89de19e62d2b6cea54884a9eef66f75b0226444 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:40:39 +0300 Subject: [PATCH 08/16] feat(models): add extra fields for update and create notification rule methods --- src/models/project.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/models/project.ts b/src/models/project.ts index f3e2f4f8..c22bd54c 100644 --- a/src/models/project.ts +++ b/src/models/project.ts @@ -262,6 +262,11 @@ export default class ProjectModel extends AbstractModel impleme excluding: payload.excluding, }; + if (rule.whatToReceive === ReceiveTypes.SEEN_MORE) { + rule.threshold = payload.threshold; + rule.thresholdPeriod = payload.thresholdPeriod; + } + await this.collection.updateOne({ _id: this._id, }, @@ -291,6 +296,11 @@ export default class ProjectModel extends AbstractModel impleme excluding: payload.excluding, }; + if (rule.whatToReceive === ReceiveTypes.SEEN_MORE) { + rule.threshold = payload.threshold; + rule.thresholdPeriod = payload.thresholdPeriod; + } + const result = await this.collection.findOneAndUpdate( { _id: this._id, From 8aaf9c79af709b0c350d74e47f4d17caaf436c9a Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Mon, 27 Jan 2025 03:28:39 +0300 Subject: [PATCH 09/16] types(notifications): improve notifications graphql schemas --- src/typeDefs/projectNotifications.ts | 27 ++++++++++++++++++- src/typeDefs/projectNotificationsMutations.ts | 4 +-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/typeDefs/projectNotifications.ts b/src/typeDefs/projectNotifications.ts index 76909b14..e62b46de 100644 --- a/src/typeDefs/projectNotifications.ts +++ b/src/typeDefs/projectNotifications.ts @@ -16,6 +16,31 @@ export default gql` SEEN_MORE } + """ + Allowed threshold periods in milliseconds + """ + enum ThresholdPeriod { + """ + One minute in milliseconds + """ + MINUTE = 60000 + + """ + One hour in milliseconds + """ + HOUR = 3600000 + + """ + One day in milliseconds + """ + DAY = 86400000 + + """ + One week in milliseconds + """ + WEEK = 604800000 + } + """ Project notify settings """ @@ -58,6 +83,6 @@ export default gql` """ Period to receive notification """ - thresholdPeriod: Int + thresholdPeriod: ThresholdPeriod } `; diff --git a/src/typeDefs/projectNotificationsMutations.ts b/src/typeDefs/projectNotificationsMutations.ts index 61efca08..a0e98df6 100644 --- a/src/typeDefs/projectNotificationsMutations.ts +++ b/src/typeDefs/projectNotificationsMutations.ts @@ -43,7 +43,7 @@ export default gql` """ Period to receive notification """ - thresholdPeriod: Int + thresholdPeriod: ThresholdPeriod } """ @@ -93,7 +93,7 @@ export default gql` """ Period to receive notification """ - thresholdPeriod: Int + thresholdPeriod: ThresholdPeriod } """ From b09de06f6395a9c97ac43a92b5651df66304868e Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Mon, 27 Jan 2025 03:29:02 +0300 Subject: [PATCH 10/16] imp(resolver): improved notification rules resolver --- src/resolvers/projectNotifications.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/resolvers/projectNotifications.ts b/src/resolvers/projectNotifications.ts index 92a33190..22246b2d 100644 --- a/src/resolvers/projectNotifications.ts +++ b/src/resolvers/projectNotifications.ts @@ -144,6 +144,14 @@ export default { throw new UserInputError('At least one channel is required'); } + if ((input.threshold !== undefined) !== (input.thresholdPeriod !== undefined)) { + throw new UserInputError('Both threshold and thresholdPeriod should be set or unset'); + } + + if (input.threshold < 1) { + throw new UserInputError('Threshold should be greater than 0'); + } + return project.updateNotificationsRule(input); }, From a18a19828be741ed18fc5994cdfd3b8c17a1be91 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:59:14 +0300 Subject: [PATCH 11/16] fix(resolvers): improve create rule data validation --- src/resolvers/projectNotifications.ts | 5 ++++ src/typeDefs/projectNotifications.ts | 27 +------------------ src/typeDefs/projectNotificationsMutations.ts | 4 +-- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/resolvers/projectNotifications.ts b/src/resolvers/projectNotifications.ts index 22246b2d..f6955264 100644 --- a/src/resolvers/projectNotifications.ts +++ b/src/resolvers/projectNotifications.ts @@ -107,6 +107,7 @@ export default { { user, factories }: ResolverContextWithUser ): Promise { const project = await factories.projectsFactory.findById(input.projectId); + const validThresholdPeriods = [60_000, 3_600_000, 86_400_000, 604_800_000] if (!project) { throw new ApolloError('No project with such id'); @@ -116,6 +117,10 @@ export default { throw new UserInputError('At least one channel is required'); } + if (!validThresholdPeriods.includes(input.thresholdPeriod)) { + throw new UserInputError('Threshold period should be one of the following: 60000, 3600000, 86400000, 604800000'); + } + return project.createNotificationsRule({ ...input, uidAdded: user.id, diff --git a/src/typeDefs/projectNotifications.ts b/src/typeDefs/projectNotifications.ts index e62b46de..76909b14 100644 --- a/src/typeDefs/projectNotifications.ts +++ b/src/typeDefs/projectNotifications.ts @@ -16,31 +16,6 @@ export default gql` SEEN_MORE } - """ - Allowed threshold periods in milliseconds - """ - enum ThresholdPeriod { - """ - One minute in milliseconds - """ - MINUTE = 60000 - - """ - One hour in milliseconds - """ - HOUR = 3600000 - - """ - One day in milliseconds - """ - DAY = 86400000 - - """ - One week in milliseconds - """ - WEEK = 604800000 - } - """ Project notify settings """ @@ -83,6 +58,6 @@ export default gql` """ Period to receive notification """ - thresholdPeriod: ThresholdPeriod + thresholdPeriod: Int } `; diff --git a/src/typeDefs/projectNotificationsMutations.ts b/src/typeDefs/projectNotificationsMutations.ts index a0e98df6..61efca08 100644 --- a/src/typeDefs/projectNotificationsMutations.ts +++ b/src/typeDefs/projectNotificationsMutations.ts @@ -43,7 +43,7 @@ export default gql` """ Period to receive notification """ - thresholdPeriod: ThresholdPeriod + thresholdPeriod: Int } """ @@ -93,7 +93,7 @@ export default gql` """ Period to receive notification """ - thresholdPeriod: ThresholdPeriod + thresholdPeriod: Int } """ From 71a362c6f877320f63d3bc207d4dc696c67758a7 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:52:53 +0300 Subject: [PATCH 12/16] imp(resolvers): add channels validation for rules in api resolvers --- src/resolvers/projectNotifications.ts | 79 +++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/src/resolvers/projectNotifications.ts b/src/resolvers/projectNotifications.ts index f6955264..e89eea1e 100644 --- a/src/resolvers/projectNotifications.ts +++ b/src/resolvers/projectNotifications.ts @@ -89,6 +89,54 @@ function isChannelsEmpty(channels: NotificationsChannelsDBScheme): boolean { return notEmptyChannels.length === 0; } +/** + * Returns true is threshold and threshold period are valid + * @param threshold - threshold of the notification rule to be checked + * @param thresholdPeriod - threshold period of the notification rule to be checked + */ +function validateNotificationsRuleTresholdAndPeriod( + threshold: ProjectNotificationsRuleDBScheme['threshold'], + thresholdPeriod: ProjectNotificationsRuleDBScheme['thresholdPeriod'] +): string | null { + const validThresholdPeriods = [60_000, 3_600_000, 86_400_000, 604_800_000] + + if (thresholdPeriod === undefined || !validThresholdPeriods.includes(thresholdPeriod)) { + return'Threshold period should be one of the following: 60000, 3600000, 86400000, 604800000'; + } + + if (threshold === undefined || threshold < 1) { + return 'Threshold should be greater than 0'; + } + + return null; +} + + +/** + * Return true if all passed channels are filled with correct endpoints + */ +function validateNotificationsRuleChannels(channels: NotificationsChannelsDBScheme): string | null { + if (channels.email!.isEnabled) { + if (!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(channels.email!.endpoint)) { + return 'Invalid email endpoint passed'; + } + } + + if (channels.slack!.isEnabled) { + if (!/^https:\/\/hooks\.slack\.com\/services\/[A-Za-z0-9]+\/[A-Za-z0-9]+\/[A-Za-z0-9]+$/.test(channels.slack!.endpoint)) { + return 'Invalid slack endpoint passed'; + } + } + + if (channels.telegram!.isEnabled) { + if (!/^https:\/\/notify\.bot\.codex\.so\/u\/[A-Za-z0-9]+$/.test(channels.telegram!.endpoint)) { + return 'Invalid telegram endpoint passed'; + } + } + + return null; +} + /** * See all types and fields here {@see ../typeDefs/notify.graphql} */ @@ -107,18 +155,23 @@ export default { { user, factories }: ResolverContextWithUser ): Promise { const project = await factories.projectsFactory.findById(input.projectId); - const validThresholdPeriods = [60_000, 3_600_000, 86_400_000, 604_800_000] if (!project) { throw new ApolloError('No project with such id'); } - if (isChannelsEmpty(input.channels)) { - throw new UserInputError('At least one channel is required'); + const channelsValidationResult = validateNotificationsRuleChannels(input.channels); + + if (channelsValidationResult !== null) { + throw new UserInputError(channelsValidationResult); } - if (!validThresholdPeriods.includes(input.thresholdPeriod)) { - throw new UserInputError('Threshold period should be one of the following: 60000, 3600000, 86400000, 604800000'); + if (input.whatToReceive === ReceiveTypes.SEEN_MORE) { + const thresholdValidationResult = validateNotificationsRuleTresholdAndPeriod(input.threshold, input.thresholdPeriod); + + if (thresholdValidationResult !== null) { + throw new UserInputError(thresholdValidationResult); + } } return project.createNotificationsRule({ @@ -144,17 +197,19 @@ export default { if (!project) { throw new ApolloError('No project with such id'); } + + const channelsValidationResult = validateNotificationsRuleChannels(input.channels); - if (isChannelsEmpty(input.channels)) { - throw new UserInputError('At least one channel is required'); + if (channelsValidationResult !== null) { + throw new UserInputError(channelsValidationResult); } - if ((input.threshold !== undefined) !== (input.thresholdPeriod !== undefined)) { - throw new UserInputError('Both threshold and thresholdPeriod should be set or unset'); - } + if (input.whatToReceive === ReceiveTypes.SEEN_MORE) { + const thresholdValidationResult = validateNotificationsRuleTresholdAndPeriod(input.threshold, input.thresholdPeriod); - if (input.threshold < 1) { - throw new UserInputError('Threshold should be greater than 0'); + if (thresholdValidationResult !== null) { + throw new UserInputError(thresholdValidationResult); + } } return project.updateNotificationsRule(input); From a35446e8af370dbb2f153e35d1e7e29a366f04ed Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:42:10 +0300 Subject: [PATCH 13/16] clean(resolvers): remove redundant validation --- src/resolvers/projectNotifications.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/resolvers/projectNotifications.ts b/src/resolvers/projectNotifications.ts index e89eea1e..2455f24f 100644 --- a/src/resolvers/projectNotifications.ts +++ b/src/resolvers/projectNotifications.ts @@ -76,19 +76,6 @@ interface ProjectNotificationsRulePointer { ruleId: string; } -/** - * Return true if all passed channels are empty - * @param channels - project notifications channels - */ -function isChannelsEmpty(channels: NotificationsChannelsDBScheme): boolean { - const notEmptyChannels = Object.entries(channels) - .filter(([_, channel]) => { - return (channel as NotificationsChannelSettingsDBScheme).endpoint.replace(/\s+/, '').trim().length !== 0; - }); - - return notEmptyChannels.length === 0; -} - /** * Returns true is threshold and threshold period are valid * @param threshold - threshold of the notification rule to be checked From 257b519a97a8bcb90e87ec43727beb7eef71c1d2 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:58:59 +0300 Subject: [PATCH 14/16] chore(): lint fix --- src/resolvers/projectNotifications.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/resolvers/projectNotifications.ts b/src/resolvers/projectNotifications.ts index 2455f24f..8755b576 100644 --- a/src/resolvers/projectNotifications.ts +++ b/src/resolvers/projectNotifications.ts @@ -79,16 +79,16 @@ interface ProjectNotificationsRulePointer { /** * Returns true is threshold and threshold period are valid * @param threshold - threshold of the notification rule to be checked - * @param thresholdPeriod - threshold period of the notification rule to be checked + * @param thresholdPeriod - threshold period of the notification rule to be checked */ function validateNotificationsRuleTresholdAndPeriod( - threshold: ProjectNotificationsRuleDBScheme['threshold'], + threshold: ProjectNotificationsRuleDBScheme['threshold'], thresholdPeriod: ProjectNotificationsRuleDBScheme['thresholdPeriod'] ): string | null { - const validThresholdPeriods = [60_000, 3_600_000, 86_400_000, 604_800_000] + const validThresholdPeriods = [60_000, 3_600_000, 86_400_000, 604_800_000]; if (thresholdPeriod === undefined || !validThresholdPeriods.includes(thresholdPeriod)) { - return'Threshold period should be one of the following: 60000, 3600000, 86400000, 604800000'; + return 'Threshold period should be one of the following: 60000, 3600000, 86400000, 604800000'; } if (threshold === undefined || threshold < 1) { @@ -98,7 +98,6 @@ function validateNotificationsRuleTresholdAndPeriod( return null; } - /** * Return true if all passed channels are filled with correct endpoints */ @@ -160,7 +159,7 @@ export default { throw new UserInputError(thresholdValidationResult); } } - + return project.createNotificationsRule({ ...input, uidAdded: user.id, @@ -184,7 +183,7 @@ export default { if (!project) { throw new ApolloError('No project with such id'); } - + const channelsValidationResult = validateNotificationsRuleChannels(input.channels); if (channelsValidationResult !== null) { From a295403e1560a7c69e6a88a3036a30e67137955f Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sun, 2 Feb 2025 22:36:10 +0300 Subject: [PATCH 15/16] bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d1c0d385..5428fda1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.1.10", + "version": "1.1.12", "main": "index.ts", "license": "UNLICENSED", "scripts": { From f1ea7484d9063b2357ca6e3bc80f4cd0d349b905 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:09:08 +0300 Subject: [PATCH 16/16] fix(): build fix --- package.json | 2 +- yarn.lock | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 5428fda1..7c782dea 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@graphql-tools/schema": "^8.5.1", "@graphql-tools/utils": "^8.9.0", "@hawk.so/nodejs": "^3.1.1", - "@hawk.so/types": "^0.1.22", + "@hawk.so/types": "^0.1.26", "@types/amqp-connection-manager": "^2.0.4", "@types/bson": "^4.0.5", "@types/debug": "^4.1.5", diff --git a/yarn.lock b/yarn.lock index f6009255..ec798ed3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -451,13 +451,6 @@ axios "^0.21.1" stack-trace "^0.0.10" -"@hawk.so/types@0.1.23": - version "0.1.23" - resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.23.tgz#45dae057fd29d4735a51baa5f00d8e0d245075f4" - integrity sha512-b9W8TZJj6kBh3rVS4tKCmVbM44XJ/Ya8kwXY12QNf5/U4O2iuegIIEcFwr6N10SJI1VbuPLYFrckxt/8ymQScw== - dependencies: - "@types/mongodb" "^3.5.34" - "@hawk.so/types@^0.1.15": version "0.1.18" resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.18.tgz#746537634756825f066182737429d11ea124d5c5" @@ -465,10 +458,10 @@ dependencies: "@types/mongodb" "^3.5.34" -"@hawk.so/types@^0.1.22": - version "0.1.22" - resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.22.tgz#e0fe3a4eb2d0a4c8fe8c67422bc295c67f0bb9e9" - integrity sha512-y6Y46glKYtvQcJTT3+5Lgi2CATgxT9NDkKdSJNy/1wfvouCrD7rehtOSQ82Tw3/5Z2i5tqbqVRlfkyG0b6ESWw== +"@hawk.so/types@^0.1.26": + version "0.1.26" + resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.26.tgz#780d68c317024cd918011f1edfee4ef4001c4ad6" + integrity sha512-7WYhvfGgb3Q9pj3cWjpIFdcoxKNVsK+iqt1LgFdFqfCyLVLZXo9qxujaoTHB6OlC2IJ7WNjeTDUvb6yD4k+oIw== dependencies: "@types/mongodb" "^3.5.34"