Spaces:
Paused
Paused
Download apps/prevision-api/src/webhooks/webhooks.controller.ts from modventures/prevision: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/modventures/prevision/resolve/main/apps/prevision-api/src/webhooks/webhooks.controller.ts
- Command line
-
hf download hf://spaces/modventures/prevision/apps/prevision-api/src/webhooks/webhooks.controller.ts
-
curl -L -o webhooks.controller.ts https://huggingface.co/spaces/modventures/prevision/resolve/main/apps/prevision-api/src/webhooks/webhooks.controller.ts
633 Bytes
| import { Controller, HttpCode, Post, UseGuards } from '@nestjs/common'; | |
| import type Stripe from 'stripe'; | |
| import { StripeEvent } from './stripe-event.decorator.js'; | |
| import { StripeWebhookGuard } from './stripe-webhook.guard.js'; | |
| import { WebhooksService } from './webhooks.service.js'; | |
| ('webhooks') | |
| export class WebhooksController { | |
| constructor(private readonly webhooks: WebhooksService) {} | |
| ('stripe') | |
| (200) | |
| (StripeWebhookGuard) | |
| async stripe(() event: Stripe.Event): Promise<{ received: true }> { | |
| await this.webhooks.handle(event); | |
| return { received: true }; | |
| } | |
| } | |