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

hicommonwealth / commonwealth / 22331928937

24 Feb 2026 01:00AM UTC coverage: 38.204% (+0.03%) from 38.173%
22331928937

Pull #13194

github

web-flow
Merge 37238f8f5 into 6658c85df
Pull Request #13194: AI Completion Fixes

2110 of 6026 branches covered (35.01%)

Branch coverage included in aggregate %.

9 of 81 new or added lines in 4 files covered. (11.11%)

30 existing lines in 14 files now uncovered.

3752 of 9318 relevant lines covered (40.27%)

52.52 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