forked from stack-auth/stack-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebhooks.ts
More file actions
28 lines (26 loc) · 988 Bytes
/
webhooks.ts
File metadata and controls
28 lines (26 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import * as yup from "yup";
import { teamMembershipCreatedWebhookEvent, teamMembershipDeletedWebhookEvent } from "./crud/team-memberships";
import { teamPermissionCreatedWebhookEvent, teamPermissionDeletedWebhookEvent } from "./crud/team-permissions";
import { teamCreatedWebhookEvent, teamDeletedWebhookEvent, teamUpdatedWebhookEvent } from "./crud/teams";
import { userCreatedWebhookEvent, userDeletedWebhookEvent, userUpdatedWebhookEvent } from "./crud/users";
export type WebhookEvent<S extends yup.Schema> = {
type: string,
schema: S,
metadata: {
summary: string,
description: string,
tags?: string[],
},
};
export const webhookEvents = [
userCreatedWebhookEvent,
userUpdatedWebhookEvent,
userDeletedWebhookEvent,
teamCreatedWebhookEvent,
teamUpdatedWebhookEvent,
teamDeletedWebhookEvent,
teamMembershipCreatedWebhookEvent,
teamMembershipDeletedWebhookEvent,
teamPermissionCreatedWebhookEvent,
teamPermissionDeletedWebhookEvent,
] as const;