MCPcopy
hub / github.com/aspen-cloud/triplit / handleWebhooksJSONPush

Method handleWebhooksJSONPush

packages/server-core/src/session.ts:289–304  ·  view source on GitHub ↗
({
    webhooks,
  }: {
    webhooks: WebhookJSONDefinition;
  })

Source from the content-addressed store, hash-verified

287 return ServerResponse(generalError.status, generalError.toJSON());
288 }
289 async handleWebhooksJSONPush({
290 webhooks,
291 }: {
292 webhooks: WebhookJSONDefinition;
293 }) {
294 if (!hasAdminAccess(this.token)) return NotAdminResponse();
295 try {
296 // TODO: add back webhooks
297 // this.server.webhooksManager.addAndStoreWebhooks(webhooks);
298 return ServerResponse(200, {});
299 } catch (e) {
300 return this.errorResponse(e, {
301 fallbackMessage: 'Could not add webhooks.',
302 });
303 }
304 }
305 async handleWebhooksClear() {
306 if (!hasAdminAccess(this.token)) return NotAdminResponse();
307 try {

Callers 1

handleRequestMethod · 0.80

Calls 4

errorResponseMethod · 0.95
hasAdminAccessFunction · 0.85
NotAdminResponseFunction · 0.85
ServerResponseFunction · 0.85

Tested by

no test coverage detected