a tool for shared writing and social publishing
1import { Inngest } from "inngest";
2
3import { EventSchemas } from "inngest";
4
5export type Events = {
6 "feeds/index-follows": {
7 data: {
8 did: string;
9 };
10 };
11 "appview/profile-update": {
12 data: {
13 record: any;
14 did: string;
15 };
16 };
17 "appview/index-bsky-post-mention": {
18 data: {
19 post_uri: string;
20 document_link: string;
21 };
22 };
23 "appview/come-online": { data: {} };
24 "user/migrate-to-standard": {
25 data: {
26 did: string;
27 };
28 };
29 "user/cleanup-expired-oauth-sessions": {
30 data: {};
31 };
32 "user/check-oauth-session": {
33 data: {
34 identityId: string;
35 did: string;
36 tokenCount: number;
37 };
38 };
39 "documents/fix-publication-references": {
40 data: {
41 documentUris: string[];
42 };
43 };
44 "documents/fix-incorrect-site-values": {
45 data: {
46 did: string;
47 };
48 };
49 "documents/fix-postref": {
50 data: {
51 documentUris?: string[];
52 };
53 };
54 "appview/sync-document-metadata": {
55 data: {
56 document_uri: string;
57 bsky_post_uri?: string;
58 };
59 };
60 "user/write-records-to-pds": {
61 data: {
62 did: string;
63 records: Array<{
64 collection: string;
65 rkey: string;
66 record: unknown;
67 }>;
68 };
69 };
70 "stripe/checkout.session.completed": {
71 data: {
72 sessionId: string;
73 };
74 };
75 "stripe/customer.subscription.updated": {
76 data: {
77 subscriptionId: string;
78 };
79 };
80 "stripe/customer.subscription.deleted": {
81 data: {
82 subscriptionId: string;
83 };
84 };
85 "stripe/invoice.payment.failed": {
86 data: {
87 invoiceId: string;
88 subscriptionId: string;
89 customerId: string;
90 };
91 };
92};
93
94// Create a client to send and receive events
95export const inngest = new Inngest({
96 id: "leaflet",
97 schemas: new EventSchemas().fromRecord<Events>(),
98});