• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hicommonwealth / commonwealth / 16226169862

11 Jul 2025 05:37PM UTC coverage: 39.752% (-0.2%) from 39.977%
16226169862

push

github

web-flow
Merge pull request #12611 from hicommonwealth/rotorsoft/12610-clean-self-imports

Clean self imports

1857 of 5042 branches covered (36.83%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

27 existing lines in 12 files now uncovered.

3269 of 7853 relevant lines covered (41.63%)

36.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/model/src/aggregates/webhook/UpdateWebhook.command.ts
1
import { InvalidInput, InvalidState, type Command } from '@hicommonwealth/core';
2
import * as schemas from '@hicommonwealth/schemas';
3
import { WebhookDestinations } from '@hicommonwealth/shared';
4
import { models } from '../../database';
5
import { authRoles } from '../../middleware';
6

UNCOV
7
export const UpdateWebhookErrors = {
×
8
  CannotUpdateElizaWebhooks: 'Cannot update Eliza Webhooks',
9
  UnsupportedUserMentioned:
10
    'UserMentioned not supported for non-Eliza webhooks',
11
};
12

13
export function UpdateWebhook(): Command<typeof schemas.UpdateWebhook> {
14
  return {
×
15
    ...schemas.UpdateWebhook,
16
    auth: [authRoles('admin')],
17
    secure: true,
18
    body: async ({ payload }) => {
19
      const webhook = await models.Webhook.findByPk(payload.id);
×
20
      if (!webhook) throw new InvalidState('Webhook does not exist');
×
21

22
      if (webhook.destination === WebhookDestinations.Eliza) {
×
23
        throw new InvalidInput(UpdateWebhookErrors.CannotUpdateElizaWebhooks);
×
24
      } else if (payload.events.includes('UserMentioned')) {
×
25
        throw new InvalidInput(UpdateWebhookErrors.UnsupportedUserMentioned);
×
26
      }
27

28
      webhook.events = payload.events;
×
29
      await webhook.save();
×
30

31
      return webhook.get({ plain: true });
×
32
    },
33
  };
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc