mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
## What kind of change does this PR introduce? Impending feature addition. Resolves DEPR-340. ## What is the current behavior? We don’t have any platform webhook support. ## What is the new behavior? This puts the scaffolding for platform webhooks **behind a feature flag**. The content is currently UI-only (with mock data and a [temporary tracking file](https://github.com/supabase/supabase/blob/8adadc61f57c70b686a0f5f05e9f7f05837e0466/apps/studio/components/interfaces/Platform/Webhooks/DEPR-340-backend-integration-tracker.md)). Merging this in lets us work incrementally from here on.
125 lines
3.7 KiB
TypeScript
125 lines
3.7 KiB
TypeScript
import type { PlatformWebhooksMockSeed, WebhookScope } from './PlatformWebhooks.types'
|
|
|
|
export const PLATFORM_WEBHOOKS_MOCK_DATA: Record<WebhookScope, PlatformWebhooksMockSeed> = {
|
|
organization: {
|
|
eventTypes: [
|
|
'organization.member_invited',
|
|
'organization.member_removed',
|
|
'organization.updated',
|
|
'project.created',
|
|
'project.updated',
|
|
'project.deleted',
|
|
'project.paused',
|
|
'project.resumed',
|
|
],
|
|
endpoints: [
|
|
{
|
|
id: 'org-endpoint-1',
|
|
name: 'Lovable production',
|
|
url: 'https://api.lovable.dev/webhooks/supabase',
|
|
description: 'Primary organization webhook endpoint',
|
|
enabled: true,
|
|
eventTypes: ['project.created', 'project.updated', 'project.deleted'],
|
|
customHeaders: [
|
|
{ id: 'org-header-1', key: 'X-Lovable-Version', value: 'v2' },
|
|
{ id: 'org-header-2', key: 'X-Environment', value: 'production' },
|
|
],
|
|
createdBy: 'user@supabase.io',
|
|
createdAt: '2026-02-15T21:30:00.000Z',
|
|
},
|
|
{
|
|
id: 'org-endpoint-2',
|
|
name: 'Slack notifications',
|
|
url: 'https://hooks.slack.com/services/T000/B000/ORG',
|
|
description: 'Operational alerts for organization-level events',
|
|
enabled: false,
|
|
eventTypes: ['organization.updated'],
|
|
customHeaders: [],
|
|
createdBy: 'ops@supabase.io',
|
|
createdAt: '2026-02-12T10:14:00.000Z',
|
|
},
|
|
],
|
|
deliveries: [
|
|
{
|
|
id: 'org-delivery-1',
|
|
endpointId: 'org-endpoint-1',
|
|
eventType: 'project.created',
|
|
status: 'success',
|
|
responseCode: 200,
|
|
attemptAt: '2026-02-27T08:04:00.000Z',
|
|
},
|
|
{
|
|
id: 'org-delivery-2',
|
|
endpointId: 'org-endpoint-1',
|
|
eventType: 'project.updated',
|
|
status: 'failure',
|
|
responseCode: 500,
|
|
attemptAt: '2026-02-27T07:56:00.000Z',
|
|
},
|
|
{
|
|
id: 'org-delivery-3',
|
|
endpointId: 'org-endpoint-1',
|
|
eventType: 'project.deleted',
|
|
status: 'pending',
|
|
attemptAt: '2026-02-27T07:45:00.000Z',
|
|
},
|
|
{
|
|
id: 'org-delivery-4',
|
|
endpointId: 'org-endpoint-2',
|
|
eventType: 'organization.updated',
|
|
status: 'skipped',
|
|
attemptAt: '2026-02-26T14:12:00.000Z',
|
|
},
|
|
],
|
|
},
|
|
project: {
|
|
eventTypes: [
|
|
'project.updated',
|
|
'project.paused',
|
|
'project.resumed',
|
|
'project.branch_created',
|
|
'project.branch_deleted',
|
|
'project.resource_exhausted',
|
|
],
|
|
endpoints: [
|
|
{
|
|
id: 'project-endpoint-1',
|
|
name: 'Project analytics',
|
|
url: 'https://analytics.example.com/hooks/supabase-project',
|
|
description: 'Project-level status updates for analytics pipeline',
|
|
enabled: true,
|
|
eventTypes: ['project.updated', 'project.resource_exhausted'],
|
|
customHeaders: [{ id: 'project-header-1', key: 'X-Project-Type', value: 'platform' }],
|
|
createdBy: 'owner@project.dev',
|
|
createdAt: '2026-02-18T11:23:00.000Z',
|
|
},
|
|
],
|
|
deliveries: [
|
|
{
|
|
id: 'project-delivery-1',
|
|
endpointId: 'project-endpoint-1',
|
|
eventType: 'project.updated',
|
|
status: 'success',
|
|
responseCode: 200,
|
|
attemptAt: '2026-02-27T09:01:00.000Z',
|
|
},
|
|
{
|
|
id: 'project-delivery-2',
|
|
endpointId: 'project-endpoint-1',
|
|
eventType: 'project.resource_exhausted',
|
|
status: 'failure',
|
|
responseCode: 429,
|
|
attemptAt: '2026-02-27T08:47:00.000Z',
|
|
},
|
|
{
|
|
id: 'project-delivery-3',
|
|
endpointId: 'project-endpoint-1',
|
|
eventType: 'project.paused',
|
|
status: 'success',
|
|
responseCode: 202,
|
|
attemptAt: '2026-02-26T21:10:00.000Z',
|
|
},
|
|
],
|
|
},
|
|
}
|