MCPcopy
hub / github.com/directus/directus / runWebhookFlow

Method runWebhookFlow

api/src/flows.ts:133–150  ·  view source on GitHub ↗
(
		id: string,
		data: unknown,
		context: { schema: SchemaOverview; accountability: Accountability | undefined } & Record<string, unknown>,
	)

Source from the content-addressed store, hash-verified

131 }
132
133 public async runWebhookFlow(
134 id: string,
135 data: unknown,
136 context: { schema: SchemaOverview; accountability: Accountability | undefined } & Record<string, unknown>,
137 ): Promise<{ result: unknown; cacheEnabled?: boolean }> {
138 if (this.reloadQueue.pending > 0) await this.reloadQueue.onIdle();
139
140 const logger = useLogger();
141
142 if (!(id in this.webhookFlowHandlers)) {
143 logger.warn(`Couldn't find webhook or manual triggered flow with id "${id}"`);
144 throw new ForbiddenError();
145 }
146
147 const handler = this.webhookFlowHandlers[id];
148
149 return handler(data, context);
150 }
151
152 public getFlow(id: string): Flow | undefined {
153 return this.flows[id];

Callers 2

flows.tsFile · 0.80
handlerFunction · 0.80

Calls 2

useLoggerFunction · 0.85
handlerFunction · 0.50

Tested by

no test coverage detected