Files
supabase/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts
T
Danny White 611ad867be chore(studio): webhook name (#43796)
## What kind of change does this PR introduce?

Chore

## What is the current behavior?

Endpoints have no (public) unique identifier, making it hard to
distinguish in UI.

## What is the new behavior?

Endpoints now have a name field. This is optional but strongly
encouraged:
- No _(Optional)_ on label
- Autogenerated name

Removing an endpoint name makes corresponding UI fall back the URL.

| Before | After |
| --- | --- |
| <img width="1234" height="629" alt="Settings Oldie 2 Toolshed
Supabase-CF557DE5-FA03-40E7-938E-2CC87F27C9A5"
src="https://github.com/user-attachments/assets/4b55fcb7-f8bc-4b85-a374-9ee62e452cb0"
/> | <img width="1234" height="629" alt="Settings Oldie 2 Toolshed
Supabase-74BBF142-DEC0-4626-B614-B05EBB2AC0EF"
src="https://github.com/user-attachments/assets/7ff40a91-c71a-4e20-85f8-0837d62202aa"
/> |
| <img width="1234" height="629" alt="Settings Oldie 2 Toolshed
Supabase-32A4B56C-61F5-4C1C-81DD-C455835E075F"
src="https://github.com/user-attachments/assets/f732ca50-2c60-4fbc-99c7-53afb5c34682"
/> | <img width="1234" height="629" alt="Settings Oldie 2 Toolshed
Supabase-29987973-9616-4409-9DF1-B9581112D4C3"
src="https://github.com/user-attachments/assets/0cf1db9a-fe84-4140-a2fc-bf10cf295c3b"
/> |
2026-03-18 03:08:56 +00:00

125 lines
3.9 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: '7f2c9d4a-6e31-4d9d-9a1f-2c4b5e6f7081',
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: '1a4e8c73-5b29-44af-8c62-9f1d2b3c4d5e',
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: '7f2c9d4a-6e31-4d9d-9a1f-2c4b5e6f7081',
eventType: 'project.created',
status: 'success',
responseCode: 200,
attemptAt: '2026-02-27T08:04:00.000Z',
},
{
id: 'org-delivery-2',
endpointId: '7f2c9d4a-6e31-4d9d-9a1f-2c4b5e6f7081',
eventType: 'project.updated',
status: 'failure',
responseCode: 500,
attemptAt: '2026-02-27T07:56:00.000Z',
},
{
id: 'org-delivery-3',
endpointId: '7f2c9d4a-6e31-4d9d-9a1f-2c4b5e6f7081',
eventType: 'project.deleted',
status: 'pending',
attemptAt: '2026-02-27T07:45:00.000Z',
},
{
id: 'org-delivery-4',
endpointId: '1a4e8c73-5b29-44af-8c62-9f1d2b3c4d5e',
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: '3c9b7e21-8d54-4f63-b2a1-6e7d8c9f0a12',
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: '3c9b7e21-8d54-4f63-b2a1-6e7d8c9f0a12',
eventType: 'project.updated',
status: 'success',
responseCode: 200,
attemptAt: '2026-02-27T09:01:00.000Z',
},
{
id: 'project-delivery-2',
endpointId: '3c9b7e21-8d54-4f63-b2a1-6e7d8c9f0a12',
eventType: 'project.resource_exhausted',
status: 'failure',
responseCode: 429,
attemptAt: '2026-02-27T08:47:00.000Z',
},
{
id: 'project-delivery-3',
endpointId: '3c9b7e21-8d54-4f63-b2a1-6e7d8c9f0a12',
eventType: 'project.paused',
status: 'success',
responseCode: 202,
attemptAt: '2026-02-26T21:10:00.000Z',
},
],
},
}