MCPcopy
hub / github.com/triggerdotdev/trigger.dev / WebhookEventCatalog

Class WebhookEventCatalog

integrations/shopify/src/triggers.ts:180–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178};
179
180export class WebhookEventCatalog<
181 TEvents extends Record<string, EventSpecification<any, any>>,
182 TSource extends WebhookSource<any>,
183> {
184 constructor(private options: WebhookCatalogOptions<TEvents, TSource>) {}
185
186 get events() {
187 return this.options.events;
188 }
189
190 get source() {
191 return this.options.source;
192 }
193
194 on<TName extends keyof TEvents, TParams extends GetWebhookParams<TSource>>(
195 name: TName,
196 params: TParams
197 ): WebhookTrigger<TEvents[TName], TSource> {
198 return new WebhookTrigger({
199 event: this.events[name],
200 params,
201 source: this.source,
202 config: {},
203 });
204 }
205}
206
207export function createWebhookEventCatalog(source: ReturnType<typeof createWebhookEventSource>) {
208 return new WebhookEventCatalog({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…