diff --git a/apps/api/src/__tests__/helpers/webhooks.ts b/apps/api/src/__tests__/helpers/webhooks.ts new file mode 100644 index 000000000..7f5f574bf --- /dev/null +++ b/apps/api/src/__tests__/helpers/webhooks.ts @@ -0,0 +1,20 @@ +// The paths where the example of a webhook event and a body it was sent differ in keys, nested +// objects and the first item of arrays included. A null or empty array on either side is not +// compared: the example may fill a field the sent body left empty, or the reverse. +export function exampleDrift(example: unknown, sent: unknown, path = ''): string[] { + if (Array.isArray(example) && Array.isArray(sent)) { + if (example.length === 0 || sent.length === 0) return []; + return exampleDrift(example[0], sent[0], `${path}[0]`); + } + if (!isRecord(example) || !isRecord(sent)) return []; + const keys = new Set([...Object.keys(example), ...Object.keys(sent)]); + return [...keys].flatMap((key) => { + const at = path ? `${path}.${key}` : key; + if (!(key in example) || !(key in sent)) return [at]; + return exampleDrift(example[key], sent[key], at); + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} diff --git a/apps/api/src/modules/agents/core/__tests__/integration/run-finished.test.ts b/apps/api/src/modules/agents/core/__tests__/integration/run-finished.test.ts index 96dbcd353..3a0149a44 100644 --- a/apps/api/src/modules/agents/core/__tests__/integration/run-finished.test.ts +++ b/apps/api/src/modules/agents/core/__tests__/integration/run-finished.test.ts @@ -5,6 +5,7 @@ import { apiKeyApi, authedApi, createProject } from '#tests/helpers/app'; import { signUpTestUser } from '#tests/helpers/auth'; import { resetDb } from '#tests/helpers/db'; import { createAgent } from '#tests/helpers/agents'; +import { exampleDrift } from '#tests/helpers/webhooks'; import { onProjectEvent, type ProjectEvent } from '#modules/webhooks/emit'; import { enqueueAgentRun, markRunFailed, markRunSuccess } from '../../run-queue'; @@ -95,6 +96,12 @@ describe('agent_run.finished', () => { }), ]); expect((deliveries[0]!.payload as { data: object }).data).not.toHaveProperty('output'); + + // The example the webhook dialog shows drifts when runPayload gains or loses a field. + const types = (await asOwner.projects({ projectKey: 'MKT' }).webhooks['event-types'].get()) + .data!; + const example = types.find((one) => one.event === 'agent_run.finished')!.example; + expect(exampleDrift(example, deliveries[0]!.payload)).toEqual([]); }); it("sends how an external agent's run ended", async () => { diff --git a/apps/api/src/modules/webhooks/__tests__/integration/extension-events.test.ts b/apps/api/src/modules/webhooks/__tests__/integration/extension-events.test.ts index 0b5fab491..6d8d3417c 100644 --- a/apps/api/src/modules/webhooks/__tests__/integration/extension-events.test.ts +++ b/apps/api/src/modules/webhooks/__tests__/integration/extension-events.test.ts @@ -8,7 +8,21 @@ import { setWebhookEvents } from '../../service'; // An event an extension adds is listed, subscribed to and sent as the core's are, and a // webhook keeps it once it is taken away. -const THING_DONE = { event: 'thing.done', action: 'update', type: 'Thing' } as const; +const THING_DONE = { + event: 'thing.done', + group: 'thing', + action: 'update', + type: 'Thing', + example: { id: 1 }, +} as const; +// One the extension puts in a group of the core's. +const ISSUE_ESCALATED = { + event: 'issue.escalated', + group: 'issue', + action: 'update', + type: 'Issue', + example: { id: 2 }, +} as const; const hooks = (api: Api) => api.projects({ projectKey: 'MKT' }).webhooks; @@ -26,15 +40,29 @@ async function sent(api: Api, webhookId: number) { describe('webhook events an extension adds', () => { beforeEach(async () => { await resetDb(); - setWebhookEvents([THING_DONE]); + setWebhookEvents([THING_DONE, ISSUE_ESCALATED]); }); afterEach(() => setWebhookEvents()); - it('lists them after the core’s and sends them as the core’s', async () => { + it('lists them after the core’s, in their groups, and sends them as the core’s', async () => { const { asOwner, projectId } = await setup(); const types = (await hooks(asOwner)['event-types'].get()).data!; - expect(types.at(-1)).toBe('thing.done'); - expect(types).toContain('agent_run.finished'); + expect(types.map((one) => one.event).slice(-3)).toEqual([ + 'agent_run.finished', + 'thing.done', + 'issue.escalated', + ]); + expect(types.at(-2)).toEqual({ + event: 'thing.done', + group: 'thing', + example: expect.objectContaining({ + action: 'update', + type: 'Thing', + event: 'thing.done', + data: { id: 1 }, + }), + }); + expect(types.at(-1)).toMatchObject({ event: 'issue.escalated', group: 'issue' }); const created = await hooks(asOwner).post({ url: 'https://example.com/hook', diff --git a/apps/api/src/modules/webhooks/__tests__/integration/webhooks.test.ts b/apps/api/src/modules/webhooks/__tests__/integration/webhooks.test.ts index 715d8db6a..2f0a272d7 100644 --- a/apps/api/src/modules/webhooks/__tests__/integration/webhooks.test.ts +++ b/apps/api/src/modules/webhooks/__tests__/integration/webhooks.test.ts @@ -5,6 +5,7 @@ import { resetDb } from '#tests/helpers/db'; import { createAgent } from '#tests/helpers/agents'; import { addProjectMember } from '#tests/helpers/members'; import { createRole } from '#tests/helpers/roles'; +import { exampleDrift } from '#tests/helpers/webhooks'; import type { WebhookEventType } from '../../service'; import { onProjectEvent, type ProjectEvent } from '../../emit'; import { createComment } from '#modules/issues/activity'; @@ -553,6 +554,53 @@ describe('webhooks', () => { }); }); + describe('examples', () => { + it('lists every core event in its group', async () => { + const { asOwner } = await setupOwnerProject(); + const types = (await asOwner.projects({ projectKey: 'MKT' }).webhooks['event-types'].get()) + .data!; + expect(types.map((one) => [one.event, one.group])).toEqual([ + ['issue.created', 'issue'], + ['issue.updated', 'issue'], + ['issue.deleted', 'issue'], + ['issue.assigned', 'issue'], + ['issue.state_changed', 'issue'], + ['issue.label_changed', 'issue'], + ['issue.link_changed', 'issue'], + ['comment.created', 'comment'], + ['comment.updated', 'comment'], + ['comment.deleted', 'comment'], + ['agent_run.finished', 'agent_run'], + ]); + }); + + // An example drifts from the payload when a payload builder gains or loses a field. + it('has the keys of the body an issue, a label and a comment event send', async () => { + const { asOwner, columnId } = await setupOwnerProject(); + const id = await createWebhook(asOwner, [ + 'issue.created', + 'issue.label_changed', + 'comment.created', + ]); + const label = (await asOwner.projects({ projectKey: 'MKT' }).labels.post({ name: 'bug' })) + .data!; + const issue = ( + await asOwner.projects({ projectKey: 'MKT' }).issues.post({ columnId, title: 'Task' }) + ).data!; + await asOwner.issues({ issueId: issue.id }).patch({ labelIds: [label.id] }); + await asOwner.issues({ issueId: issue.id }).comments.post({ body: 'looks good' }); + + const types = (await asOwner.projects({ projectKey: 'MKT' }).webhooks['event-types'].get()) + .data!; + const sentBy = (await asOwner.webhooks({ webhookId: id }).deliveries.get()).data!.items; + for (const event of ['issue.created', 'issue.label_changed', 'comment.created']) { + const example = types.find((one) => one.event === event)!.example; + const payload = sentBy.find((one) => one.eventType === event)!.payload; + expect(exampleDrift(example, payload)).toEqual([]); + } + }); + }); + describe('events without a field edit', () => { it('fires issue.updated on archive and restore', async () => { const { asOwner, columnId } = await setupOwnerProject(); diff --git a/apps/api/src/modules/webhooks/emit.ts b/apps/api/src/modules/webhooks/emit.ts index e7439b310..c950cc943 100644 --- a/apps/api/src/modules/webhooks/emit.ts +++ b/apps/api/src/modules/webhooks/emit.ts @@ -3,40 +3,12 @@ import { aiAgent, db, user, webhook, webhookDelivery } from '@repo/db'; import { and, eq, sql } from 'drizzle-orm'; import type { ActivityActor } from '#modules/issues/activity'; import { - extensionWebhookEvent, - type WebhookEventDefinition, - type WebhookEventType, -} from './service'; - -// Maps our granular event type to the Linear-style envelope's action + resource -// type. action is create | update | remove. type is the PascalCase resource. -// Linear's action/type pair cannot distinguish our assigned, state_changed, and -// label_changed variants, because all of them are an issue update. The payload keeps -// the granular event in its own `event` field. -type EventShape = Pick; - -const EVENT_SHAPE: Record = { - 'issue.created': { action: 'create', type: 'Issue' }, - 'issue.updated': { action: 'update', type: 'Issue' }, - 'issue.deleted': { action: 'remove', type: 'Issue' }, - 'issue.assigned': { action: 'update', type: 'Issue' }, - 'issue.state_changed': { action: 'update', type: 'Issue' }, - 'issue.label_changed': { action: 'update', type: 'Issue' }, - 'issue.link_changed': { action: 'update', type: 'Issue' }, - 'comment.created': { action: 'create', type: 'Comment' }, - 'comment.updated': { action: 'update', type: 'Comment' }, - 'comment.deleted': { action: 'remove', type: 'Comment' }, - 'agent_run.finished': { action: 'update', type: 'AgentRun' }, -}; - -// Who caused the event. An agent acts through its own bot user, so a user id is an -// agent when an ai_agent row points at it. A system write has no user: it carries -// the system's name ('GitHub', 'Auto-archive'), or null for an unnamed one. -interface WebhookActor { - type: 'human' | 'agent' | 'system'; - id: string | null; - name: string | null; -} + CORE_WEBHOOK_EVENTS, + webhookBody, + type WebhookActor, + type WebhookEventShape, +} from './events'; +import { extensionWebhookEvent, type WebhookEventType } from './service'; async function resolveActor(actor: ActivityActor): Promise { if (!actor) return { type: 'system', id: null, name: null }; @@ -104,13 +76,8 @@ function subscribedWebhooks(projectId: number, eventType: string) { // receiver can deduplicate; the deliveries go in as one insert. Call it right after a // domain mutation, next to the activity log. The payloads are built at most once, when a // listener of onProjectEvent or a subscribed webhook needs them, so a project with no -// webhooks and no listener pays one indexed SELECT. -// -// The body follows Linear's webhook envelope: top-level action, type, actor, data, -// plus createdAt and webhookTimestamp (epoch ms). `event` is our extension, and it -// carries the granular event type. We omit organizationId, because there is no -// organization concept. The shared dedup id goes in the X-Itsaplan-Event-Id header, -// not in the body. +// webhooks and no listener pays one indexed SELECT. The body is webhookBody's; the shared +// dedup id goes in the X-Itsaplan-Event-Id header, not in the body. export async function emitWebhookEvents( projectId: number, eventType: WebhookEventType, @@ -127,7 +94,7 @@ export async function emitWebhookEvents( } } - await deliver(projectId, eventType, EVENT_SHAPE[eventType], loadOnce, actor); + await deliver(projectId, eventType, CORE_WEBHOOK_EVENTS[eventType], loadOnce, actor); } // Sends an event an extension adds (setWebhookEvents) to the webhooks of the project that @@ -146,7 +113,7 @@ export async function emitExtensionWebhookEvent( async function deliver( projectId: number, eventType: string, - { action, type }: EventShape, + shape: WebhookEventShape, load: () => Promise, actor: ActivityActor, ): Promise { @@ -158,8 +125,6 @@ async function deliver( const resolvedActor = await resolveActor(actor); const now = new Date(); - const createdAt = now.toISOString(); - const webhookTimestamp = now.getTime(); await db.insert(webhookDelivery).values( payloads.flatMap((data) => { @@ -168,16 +133,7 @@ async function deliver( webhookId: h.id, eventId, eventType, - payload: { - action, - type, - event: eventType, - actor: resolvedActor, - createdAt, - data, - webhookTimestamp, - webhookId: h.id, - }, + payload: webhookBody(shape, eventType, resolvedActor, data, now, h.id), })); }), ); diff --git a/apps/api/src/modules/webhooks/events.ts b/apps/api/src/modules/webhooks/events.ts new file mode 100644 index 000000000..455d56c49 --- /dev/null +++ b/apps/api/src/modules/webhooks/events.ts @@ -0,0 +1,170 @@ +import type { WebhookEventDefinition, WebhookEventType } from './service'; + +export type WebhookEventShape = Pick; + +// Who caused the event. An agent acts through its own bot user, so a user id is an +// agent when an ai_agent row points at it. A system write has no user: it carries +// the system's name ('GitHub', 'Auto-archive'), or null for an unnamed one. +export interface WebhookActor { + type: 'human' | 'agent' | 'system'; + id: string | null; + name: string | null; +} + +// The body a webhook is sent. It follows Linear's webhook envelope: top-level action, type, +// actor, data, plus createdAt and webhookTimestamp (epoch ms). `event` is our extension, and +// it carries the granular event type. organizationId is left out, because there is no +// organization concept. +export function webhookBody( + { action, type }: WebhookEventShape, + event: string, + actor: WebhookActor, + data: unknown, + at: Date, + webhookId: number, +) { + return { + action, + type, + event, + actor, + createdAt: at.toISOString(), + data, + webhookTimestamp: at.getTime(), + webhookId, + }; +} + +export const EXAMPLE_ACTOR: WebhookActor = { + type: 'human', + id: 'Jf8mQ2vX0bN7sLk1', + name: 'Maya Chen', +}; +export const EXAMPLE_AT = new Date('2026-01-15T10:24:07.512Z'); + +// The examples carry every key a real payload has; the payload tests compare the keys. +const issue = { + id: 4821, + projectId: 7, + sequenceNumber: 142, + identifier: 'WEB-142', + typeId: 3, + initiative: null, + cycle: null, + assigneeUserId: 'Jf8mQ2vX0bN7sLk1', + delegateUserId: null, + columnId: 28, + parentId: null, + title: 'Checkout fails on Safari 17', + description: 'The pay button does nothing after the card form loads.', + priority: 'high', + estimatePoints: 3, + estimateMinutes: null, + loggedMinutes: 0, + startDate: null, + dueDate: '2026-01-22', + position: 12000, + createdAt: '2026-01-14T16:02:11.404Z', + updatedAt: '2026-01-15T10:24:07.512Z', + archivedAt: null, + statusSince: '2026-01-14T16:02:11.404Z', + shareToken: null, + shareExtended: false, + shareExpiresAt: null, + labelIds: [9], + fieldValues: [], + source: null, + url: 'https://plan.example.com/acme/issue/WEB-142', + state: { id: 28, name: 'Todo', type: 'unstarted' }, + assignee: { id: 'Jf8mQ2vX0bN7sLk1', name: 'Maya Chen' }, + delegate: null, + issueType: { id: 3, name: 'Bug' }, + labels: [{ id: 9, name: 'frontend', color: '#3b82f6' }], +}; + +const comment = { + id: 90312, + issueId: 4821, + kind: 'comment', + replyToId: null, + actorUserId: 'Jf8mQ2vX0bN7sLk1', + actorName: 'Maya Chen', + actorSource: null, + body: 'Reproduced on 17.2.', + action: null, + payload: null, + createdAt: '2026-01-15T10:24:07.512Z', + editedAt: null, + reactions: [], + repositoryComment: null, + url: 'https://plan.example.com/acme/issue/WEB-142#comment-90312', + issue: { + id: 4821, + identifier: 'WEB-142', + title: 'Checkout fails on Safari 17', + url: 'https://plan.example.com/acme/issue/WEB-142', + }, +}; + +const agentRun = { + id: 5530, + status: 'success', + trigger: 'delegation', + agent: { id: 4, userId: 'aG7tR1pW9cK3mZq5', username: 'reviewer', name: 'Reviewer' }, + projectId: 7, + issueId: 4821, + issueIdentifier: 'WEB-142', + documentId: null, + scheduleId: null, + error: null, + attempts: 1, + inputTokens: 18240, + outputTokens: 1312, + createdAt: '2026-01-15T10:20:02.006Z', + startedAt: '2026-01-15T10:20:03.441Z', + finishedAt: '2026-01-15T10:24:07.512Z', +}; + +// The action/type pair cannot tell the assigned, state_changed and label_changed variants +// apart, because all of them are an issue update; `event` in the body carries the granular one. +export const CORE_WEBHOOK_EVENTS: Record< + WebhookEventType, + Omit +> = { + 'issue.created': { group: 'issue', action: 'create', type: 'Issue', example: issue }, + 'issue.updated': { group: 'issue', action: 'update', type: 'Issue', example: issue }, + 'issue.deleted': { group: 'issue', action: 'remove', type: 'Issue', example: issue }, + 'issue.assigned': { group: 'issue', action: 'update', type: 'Issue', example: issue }, + 'issue.state_changed': { + group: 'issue', + action: 'update', + type: 'Issue', + example: { + ...issue, + columnId: 31, + statusSince: '2026-01-15T10:24:07.512Z', + state: { id: 31, name: 'In review', type: 'started' }, + }, + }, + 'issue.label_changed': { + group: 'issue', + action: 'update', + type: 'Issue', + example: { ...issue, labelChange: { added: [{ id: 9, name: 'frontend' }], removed: [] } }, + }, + 'issue.link_changed': { group: 'issue', action: 'update', type: 'Issue', example: issue }, + 'comment.created': { group: 'comment', action: 'create', type: 'Comment', example: comment }, + 'comment.updated': { + group: 'comment', + action: 'update', + type: 'Comment', + example: { ...comment, editedAt: '2026-01-15T10:31:40.118Z' }, + }, + 'comment.deleted': { group: 'comment', action: 'remove', type: 'Comment', example: comment }, + 'agent_run.finished': { + group: 'agent_run', + action: 'update', + type: 'AgentRun', + example: agentRun, + }, +}; diff --git a/apps/api/src/modules/webhooks/index.ts b/apps/api/src/modules/webhooks/index.ts index 59d3bc742..a834e6bf6 100644 --- a/apps/api/src/modules/webhooks/index.ts +++ b/apps/api/src/modules/webhooks/index.ts @@ -9,6 +9,7 @@ import { mcpTool } from '#mcp/generate'; import { accessErrors, commonErrors } from '#shared/responses'; import { WebhookDeliveryPageResponse, + WebhookEventResponse, WebhookResponse, createWebhookBody, listDeliveriesQuery, @@ -23,7 +24,7 @@ import { rotateWebhookSecret, deleteWebhook, listWebhookDeliveries, - webhookEventTypes, + listWebhookEvents, } from './service'; export const webhookRoutes = new Elysia({ name: 'webhooks', detail: { tags: ['Webhooks'] } }) @@ -60,14 +61,14 @@ export const webhookRoutes = new Elysia({ name: 'webhooks', detail: { tags: ['We }, ) - .get('/projects/:projectKey/webhooks/event-types', () => webhookEventTypes(), { + .get('/projects/:projectKey/webhooks/event-types', () => listWebhookEvents(), { permission: ['webhooks', 'read'], - response: { 200: t.Array(t.String()), ...accessErrors }, + response: { 200: t.Array(WebhookEventResponse), ...accessErrors }, detail: { summary: 'List webhook events', description: - 'List the events a project webhook can subscribe ' + - 'to: core events, then events the instance adds.', + 'List the events a project webhook can subscribe to, each with its group and an ' + + 'example of the body it is sent: core events, then events the instance adds.', ...mcpTool('list_webhook_event_types'), }, }) diff --git a/apps/api/src/modules/webhooks/model.ts b/apps/api/src/modules/webhooks/model.ts index 9417c2d84..583ec6a02 100644 --- a/apps/api/src/modules/webhooks/model.ts +++ b/apps/api/src/modules/webhooks/model.ts @@ -50,3 +50,9 @@ export const WebhookDeliveryPageResponse = t.Object({ items: t.Array(WebhookDeliveryResponse), nextCursor: t.Nullable(t.Number()), }); + +export const WebhookEventResponse = t.Object({ + event: t.String(), + group: t.String({ description: 'The group the webhook dialog lists the event in.' }), + example: t.Any({ description: 'An example of the body a webhook is sent for the event.' }), +}); diff --git a/apps/api/src/modules/webhooks/service.ts b/apps/api/src/modules/webhooks/service.ts index 5d6d0f9c3..7f9eca9f1 100644 --- a/apps/api/src/modules/webhooks/service.ts +++ b/apps/api/src/modules/webhooks/service.ts @@ -2,6 +2,7 @@ import { randomBytes } from 'node:crypto'; import { db, webhook, webhookDelivery } from '@repo/db'; import { and, desc, eq, lt } from 'drizzle-orm'; import { HttpError, iso } from '#shared/lib'; +import { CORE_WEBHOOK_EVENTS, EXAMPLE_ACTOR, EXAMPLE_AT, webhookBody } from './events'; // Outgoing webhook subscriptions on a project. A subscription targets a `url` and // lists the event types it wants. It carries its own `secret`, which signs the @@ -38,12 +39,15 @@ export const WEBHOOK_EVENT_TYPES = [ ] as const; export type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number]; -// An event an extension of the api adds: the name a webhook subscribes to, and the action and -// the resource type of its envelope. The extension sends it with emitExtensionWebhookEvent. +// `group` is the card of the webhook dialog the event is listed in: a core event's group or a +// new one, named in the web texts. `example` is the envelope's `data`. An extension of the api +// adds its own events with setWebhookEvents and sends them with emitExtensionWebhookEvent. export interface WebhookEventDefinition { event: string; + group: string; action: 'create' | 'update' | 'remove'; type: string; + example: Record; } let extensionEvents: WebhookEventDefinition[] = []; @@ -64,14 +68,26 @@ export function extensionWebhookEvent(event: string): WebhookEventDefinition | u } // Every event a webhook may subscribe to: the core's, then the ones an extension adds. -export function webhookEventTypes(): string[] { - return [...WEBHOOK_EVENT_TYPES, ...extensionEvents.map((one) => one.event)]; +function webhookEventDefinitions(): WebhookEventDefinition[] { + return [ + ...WEBHOOK_EVENT_TYPES.map((event) => ({ event, ...CORE_WEBHOOK_EVENTS[event] })), + ...extensionEvents, + ]; +} + +// The events with their group and an example of the body a webhook is sent. +export function listWebhookEvents() { + return webhookEventDefinitions().map((one) => ({ + event: one.event, + group: one.group, + example: webhookBody(one, one.event, EXAMPLE_ACTOR, one.example, EXAMPLE_AT, 1), + })); } // An event no one offers is refused, unless the webhook has it already: one an extension took // away stays on the webhooks that subscribe to it. function checkEvents(events: string[], kept: string[] = []): void { - const known = new Set([...webhookEventTypes(), ...kept]); + const known = new Set([...webhookEventDefinitions().map((one) => one.event), ...kept]); const unknown = events.find((event) => !known.has(event)); if (unknown) throw new HttpError(400, `Unknown webhook event: ${unknown}`); } diff --git a/apps/web/messages/ar/settings.json b/apps/web/messages/ar/settings.json index 2a29c4835..9afb8f191 100644 --- a/apps/web/messages/ar/settings.json +++ b/apps/web/messages/ar/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "خطاف ويب جديد", "emptyTitle": "لا توجد خطافات ويب بعد", - "emptyHint": "حدد رابط الحمولة واختار الأحداث اللي عايز تبعتها.", + "emptyHint": "حدد عنوان URL واختر الأحداث التي تريد إرسالها.", "columns": { - "endpoint": "نقطة النهاية", + "endpoint": "URL", "events": "الأحداث" }, "active": "نشط", - "disabled": "معطّل", + "disabled": "غير نشط", "hideSecret": "إخفاء السر", "revealSecret": "إظهار السر", "copySecret": "نسخ السر", @@ -398,8 +398,8 @@ "deleteMessage": "التسليم لـ {url} هيقف. مش هينفع ترجع في ده.", "dialogNew": "خطاف ويب جديد", "dialogEdit": "تعديل خطاف الويب", - "dialogHint": "حدد رابط الحمولة واختار أحداث المشروع اللي عايز تبعتها.", - "payloadUrl": "رابط الحمولة", + "dialogHint": "يُرسَل كل حدث مختار إلى عنوان URL كطلب POST موقّع.", + "payloadUrl": "URL", "events": "الأحداث", "create": "إنشاء خطاف ويب", "creating": "جارٍ الإنشاء…", @@ -409,14 +409,74 @@ "endOfHistory": "نهاية السجل", "queued": "في الطابور", "attempts": "·{count} محاولة", - "sent": "أُرسل", + "sent": "الطلب", "response": "الاستجابة", "responseWithStatus": "الاستجابة · HTTP {status}", - "noResponse": "(لا استجابة)", + "noResponse": "فارغ", "statuses": { "success": "نجح", "failed": "فشل", "pending": "قيد الانتظار" + }, + "signingSecret": "سر التوقيع", + "showExample": "مثال على {event}", + "exampleSignature": "يحمل كل طلب X-Itsaplan-Signature: t=…,v1=…. t هو وقت Unix بالثواني. v1 هو HMAC-SHA256 بصيغة hex لـ t ونقطة والجسم الخام، ومفتاحه سر التوقيع.", + "eventGroups": { + "issue": "عناصر العمل", + "comment": "التعليقات", + "agent_run": "تشغيلات الوكلاء" + }, + "eventTypes": { + "issue": { + "created": { + "label": "إنشاء", + "hint": "أُنشئ عنصر عمل." + }, + "updated": { + "label": "تحديث", + "hint": "تغيّر أي حقل في عنصر العمل، ويشمل ذلك الأرشفة والاستعادة." + }, + "deleted": { + "label": "حذف", + "hint": "حُذف عنصر عمل. يحمل الطلب العنصر كما كان آخر مرة." + }, + "assigned": { + "label": "إسناد", + "hint": "تغيّر المسؤول. يُرسَل issue.updated أيضًا." + }, + "state_changed": { + "label": "تغيير الحالة", + "hint": "انتقل العنصر إلى عمود آخر. يُرسَل issue.updated أيضًا." + }, + "label_changed": { + "label": "تغيير التسميات", + "hint": "أُضيفت تسميات أو أُزيلت. يسردها labelChange." + }, + "link_changed": { + "label": "تغيير الروابط", + "hint": "أُضيف ربط بين عنصرين أو أُزيل. يُرسَل مرة لكل عنصر. لا يُرسَل issue.updated." + } + }, + "comment": { + "created": { + "label": "إنشاء", + "hint": "نُشر تعليق." + }, + "updated": { + "label": "تحديث", + "hint": "تغيّر نص تعليق." + }, + "deleted": { + "label": "حذف", + "hint": "حُذف تعليق." + } + }, + "agent_run": { + "finished": { + "label": "انتهاء", + "hint": "انتهى تشغيل وكيل: success أو failed أو canceled. لا يتضمن ما أعاده الوكيل." + } + } } }, "git": { diff --git a/apps/web/messages/en/settings.json b/apps/web/messages/en/settings.json index 754dca603..471bcf1b8 100644 --- a/apps/web/messages/en/settings.json +++ b/apps/web/messages/en/settings.json @@ -376,15 +376,15 @@ "webhooks": { "new": "New webhook", "emptyTitle": "No webhooks yet", - "emptyHint": "Set a payload URL and choose which events to send.", + "emptyHint": "Set a URL and choose which events to send.", "columns": { - "endpoint": "Endpoint", + "endpoint": "URL", "events": "Events" }, "active": "Active", - "disabled": "Disabled", + "disabled": "Inactive", "hideSecret": "Hide secret", - "revealSecret": "Reveal secret", + "revealSecret": "Show secret", "copySecret": "Copy secret", "rotateSecret": "Regenerate secret", "rotateSecretTitle": "Regenerate the signing secret?", @@ -398,8 +398,8 @@ "deleteMessage": "Deliveries to {url} will stop. This cannot be undone.", "dialogNew": "New webhook", "dialogEdit": "Edit webhook", - "dialogHint": "Set the payload URL and choose which project events to send.", - "payloadUrl": "Payload URL", + "dialogHint": "Each chosen event is sent to the URL as a signed POST request.", + "payloadUrl": "URL", "events": "Events", "create": "Create webhook", "creating": "Creating…", @@ -409,14 +409,74 @@ "endOfHistory": "End of history", "queued": "Queued", "attempts": "·{count} attempts", - "sent": "Sent", + "sent": "Request", "response": "Response", "responseWithStatus": "Response · HTTP {status}", - "noResponse": "(no response)", + "noResponse": "Empty", "statuses": { "success": "Success", "failed": "Failed", "pending": "Pending" + }, + "signingSecret": "Signing secret", + "showExample": "Example of {event}", + "exampleSignature": "Each request carries X-Itsaplan-Signature: t=…,v1=…. t is the Unix time in seconds. v1 is the hex HMAC-SHA256 of t, a dot and the raw body, keyed with the signing secret.", + "eventGroups": { + "issue": "Issues", + "comment": "Comments", + "agent_run": "Agent runs" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Created", + "hint": "An issue is created." + }, + "updated": { + "label": "Updated", + "hint": "Any field of an issue changes. Archiving and restoring count too." + }, + "deleted": { + "label": "Deleted", + "hint": "An issue is deleted. The body holds the issue as it was before." + }, + "assigned": { + "label": "Assigned", + "hint": "The assignee changes. issue.updated is sent too." + }, + "state_changed": { + "label": "State changed", + "hint": "An issue moves to another column. issue.updated is sent too." + }, + "label_changed": { + "label": "Labels changed", + "hint": "Labels are added or removed. labelChange in the body lists them." + }, + "link_changed": { + "label": "Links changed", + "hint": "A link between two issues is added or removed. Sent once for each issue. issue.updated is not sent." + } + }, + "comment": { + "created": { + "label": "Created", + "hint": "A comment is posted." + }, + "updated": { + "label": "Updated", + "hint": "A comment is edited." + }, + "deleted": { + "label": "Deleted", + "hint": "A comment is deleted." + } + }, + "agent_run": { + "finished": { + "label": "Finished", + "hint": "An agent run ends: success, failed or canceled. The agent's output is left out." + } + } } }, "git": { diff --git a/apps/web/messages/es-ES/settings.json b/apps/web/messages/es-ES/settings.json index a2d2af921..7a0094773 100644 --- a/apps/web/messages/es-ES/settings.json +++ b/apps/web/messages/es-ES/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "Nuevo webhook", "emptyTitle": "Todavía no hay webhooks", - "emptyHint": "Define una URL de carga y elige qué eventos enviar.", + "emptyHint": "Define una URL y elige qué eventos enviar.", "columns": { - "endpoint": "Endpoint", + "endpoint": "URL", "events": "Eventos" }, "active": "Activo", - "disabled": "Desactivado", + "disabled": "Inactivo", "hideSecret": "Ocultar el secreto", "revealSecret": "Mostrar el secreto", "copySecret": "Copiar el secreto", @@ -398,8 +398,8 @@ "deleteMessage": "Las entregas a {url} se pararán. No se puede deshacer.", "dialogNew": "Nuevo webhook", "dialogEdit": "Editar el webhook", - "dialogHint": "Define la URL de carga y elige qué eventos del proyecto enviar.", - "payloadUrl": "URL de la carga", + "dialogHint": "Cada evento elegido se envía a la URL como una solicitud POST firmada.", + "payloadUrl": "URL", "events": "Eventos", "create": "Crear el webhook", "creating": "Creando…", @@ -409,14 +409,74 @@ "endOfHistory": "Fin del historial", "queued": "En cola", "attempts": "·{count} intentos", - "sent": "Enviada", + "sent": "Solicitud", "response": "Respuesta", "responseWithStatus": "Respuesta · HTTP {status}", - "noResponse": "(sin respuesta)", + "noResponse": "Vacía", "statuses": { "success": "Con éxito", "failed": "Fallida", "pending": "Pendiente" + }, + "signingSecret": "Secreto de firma", + "showExample": "Ejemplo de {event}", + "exampleSignature": "Cada solicitud lleva X-Itsaplan-Signature: t=…,v1=…. t es la hora Unix en segundos. v1 es el HMAC-SHA256 en hex de t, un punto y el cuerpo sin procesar, con el secreto de firma como clave.", + "eventGroups": { + "issue": "Elementos de trabajo", + "comment": "Comentarios", + "agent_run": "Ejecuciones de agentes" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Creado", + "hint": "Se crea un elemento de trabajo." + }, + "updated": { + "label": "Actualizado", + "hint": "Cambia cualquier campo de un elemento. Archivar y restaurar también cuentan." + }, + "deleted": { + "label": "Eliminado", + "hint": "Se elimina un elemento. El cuerpo lleva el elemento tal como estaba por última vez." + }, + "assigned": { + "label": "Asignado", + "hint": "Cambia el responsable. También se envía issue.updated." + }, + "state_changed": { + "label": "Cambio de estado", + "hint": "El elemento pasa a otra columna. También se envía issue.updated." + }, + "label_changed": { + "label": "Cambio de etiquetas", + "hint": "Se añaden o quitan etiquetas. labelChange las enumera." + }, + "link_changed": { + "label": "Cambio de vínculos", + "hint": "Se añade o quita un enlace entre dos elementos. Se envía una vez por cada elemento. No se envía issue.updated." + } + }, + "comment": { + "created": { + "label": "Creado", + "hint": "Se publica un comentario." + }, + "updated": { + "label": "Actualizado", + "hint": "Cambia el texto de un comentario." + }, + "deleted": { + "label": "Eliminado", + "hint": "Se elimina un comentario." + } + }, + "agent_run": { + "finished": { + "label": "Terminada", + "hint": "Termina una ejecución de un agente: success, failed o canceled. No incluye lo que devolvió el agente." + } + } } }, "git": { diff --git a/apps/web/messages/fa/settings.json b/apps/web/messages/fa/settings.json index ff1d6e3b2..7cb67ebaf 100644 --- a/apps/web/messages/fa/settings.json +++ b/apps/web/messages/fa/settings.json @@ -376,9 +376,9 @@ "webhooks": { "new": "وب‌هوک جدید", "emptyTitle": "هنوز وب‌هوکی نیست", - "emptyHint": "یک نشانی payload تنظیم کنید و انتخاب کنید کدام رویدادها ارسال شوند.", + "emptyHint": "یک URL تنظیم کنید و انتخاب کنید کدام رویدادها ارسال شوند.", "columns": { - "endpoint": "نقطه پایانی", + "endpoint": "URL", "events": "رویدادها" }, "active": "فعال", @@ -398,8 +398,8 @@ "deleteMessage": "ارسال‌ها به {url} متوقف می‌شود. این کار قابل بازگشت نیست.", "dialogNew": "وب‌هوک جدید", "dialogEdit": "ویرایش وب‌هوک", - "dialogHint": "نشانی payload را تنظیم کنید و انتخاب کنید کدام رویدادهای پروژه ارسال شوند.", - "payloadUrl": "نشانی payload", + "dialogHint": "هر رویداد انتخاب‌شده به‌صورت یک درخواست POST امضاشده به URL فرستاده می‌شود.", + "payloadUrl": "URL", "events": "رویدادها", "create": "ساخت وب‌هوک", "creating": "در حال ساخت…", @@ -409,14 +409,74 @@ "endOfHistory": "پایان تاریخچه", "queued": "در صف", "attempts": "·{count} تلاش", - "sent": "ارسال شد", + "sent": "درخواست", "response": "پاسخ", "responseWithStatus": "پاسخ · HTTP {status}", - "noResponse": "(بدون پاسخ)", + "noResponse": "خالی", "statuses": { "success": "موفق", "failed": "ناموفق", "pending": "در انتظار" + }, + "signingSecret": "رمز امضا", + "showExample": "نمونهٔ {event}", + "exampleSignature": "هر درخواست X-Itsaplan-Signature: t=…,v1=… دارد. t زمان Unix به ثانیه است. v1 مقدار HMAC-SHA256 به‌صورت hex از t، یک نقطه و بدنهٔ خام است، با رمز امضا به‌عنوان کلید.", + "eventGroups": { + "issue": "تسک‌ها", + "comment": "دیدگاه‌ها", + "agent_run": "اجراهای ایجنت" + }, + "eventTypes": { + "issue": { + "created": { + "label": "ایجاد", + "hint": "یک تسک ایجاد می‌شود." + }, + "updated": { + "label": "به‌روزرسانی", + "hint": "هر فیلدی از تسک تغییر می‌کند. بایگانی و بازگردانی هم حساب می‌شوند." + }, + "deleted": { + "label": "حذف", + "hint": "یک تسک حذف می‌شود. بدنه، تسک را همان‌طور که آخرین بار بود دارد." + }, + "assigned": { + "label": "واگذاری", + "hint": "مسئول تغییر می‌کند. issue.updated هم فرستاده می‌شود." + }, + "state_changed": { + "label": "تغییر وضعیت", + "hint": "تسک به ستون دیگری می‌رود. issue.updated هم فرستاده می‌شود." + }, + "label_changed": { + "label": "تغییر برچسب‌ها", + "hint": "برچسب‌هایی افزوده یا برداشته می‌شوند. labelChange آن‌ها را فهرست می‌کند." + }, + "link_changed": { + "label": "تغییر پیوندها", + "hint": "پیوندی بین دو تسک افزوده یا برداشته می‌شود. برای هر تسک یک بار فرستاده می‌شود. issue.updated فرستاده نمی‌شود." + } + }, + "comment": { + "created": { + "label": "ایجاد", + "hint": "دیدگاهی فرستاده می‌شود." + }, + "updated": { + "label": "به‌روزرسانی", + "hint": "متن یک دیدگاه تغییر می‌کند." + }, + "deleted": { + "label": "حذف", + "hint": "دیدگاهی حذف می‌شود." + } + }, + "agent_run": { + "finished": { + "label": "پایان", + "hint": "اجرای یک ایجنت پایان می‌یابد: success، failed یا canceled. آنچه ایجنت برگرداند در آن نیست." + } + } } }, "git": { diff --git a/apps/web/messages/fr/settings.json b/apps/web/messages/fr/settings.json index 34f0c54c4..9d83d43c4 100644 --- a/apps/web/messages/fr/settings.json +++ b/apps/web/messages/fr/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "Nouveau webhook", "emptyTitle": "Aucun webhook pour l'instant", - "emptyHint": "Définissez une URL de destination et choisissez les événements à envoyer.", + "emptyHint": "Définissez une URL et choisissez les événements à envoyer.", "columns": { - "endpoint": "Point d'accès", + "endpoint": "URL", "events": "Événements" }, "active": "Actif", - "disabled": "Désactivé", + "disabled": "Inactif", "hideSecret": "Masquer le secret", "revealSecret": "Afficher le secret", "copySecret": "Copier le secret", @@ -398,8 +398,8 @@ "deleteMessage": "Les livraisons vers {url} s'arrêteront. Cette action est irréversible.", "dialogNew": "Nouveau webhook", "dialogEdit": "Modifier le webhook", - "dialogHint": "Définissez l'URL de destination et choisissez les événements du projet à envoyer.", - "payloadUrl": "URL de destination", + "dialogHint": "Chaque événement choisi est envoyé à l’URL sous forme de requête POST signée.", + "payloadUrl": "URL", "events": "Événements", "create": "Créer le webhook", "creating": "Création…", @@ -409,14 +409,74 @@ "endOfHistory": "Fin de l'historique", "queued": "En file d'attente", "attempts": "·{count} tentatives", - "sent": "Envoyé", + "sent": "Requête", "response": "Réponse", "responseWithStatus": "Réponse · HTTP {status}", - "noResponse": "(aucune réponse)", + "noResponse": "Vide", "statuses": { "success": "Réussi", "failed": "En échec", "pending": "En attente" + }, + "signingSecret": "Secret de signature", + "showExample": "Exemple de {event}", + "exampleSignature": "Chaque requête porte X-Itsaplan-Signature: t=…,v1=…. t est l’heure Unix en secondes. v1 est le HMAC-SHA256 en hex de t, d’un point et du corps brut, avec le secret de signature comme clé.", + "eventGroups": { + "issue": "Tickets", + "comment": "Commentaires", + "agent_run": "Exécutions d'agents" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Créé", + "hint": "Un ticket est créé." + }, + "updated": { + "label": "Modifié", + "hint": "Un champ du ticket change. L'archivage et la restauration comptent aussi." + }, + "deleted": { + "label": "Supprimé", + "hint": "Un ticket est supprimé. Le corps contient le ticket tel qu’il était en dernier." + }, + "assigned": { + "label": "Assigné", + "hint": "L'assigné change. issue.updated est aussi envoyé." + }, + "state_changed": { + "label": "Statut modifié", + "hint": "Le ticket passe dans une autre colonne. issue.updated est aussi envoyé." + }, + "label_changed": { + "label": "Étiquettes modifiées", + "hint": "Des étiquettes sont ajoutées ou retirées. labelChange les liste." + }, + "link_changed": { + "label": "Liens modifiés", + "hint": "Un lien entre deux tickets est ajouté ou retiré. Envoyé une fois pour chaque ticket. issue.updated n’est pas envoyé." + } + }, + "comment": { + "created": { + "label": "Créé", + "hint": "Un commentaire est publié." + }, + "updated": { + "label": "Modifié", + "hint": "Le texte d'un commentaire change." + }, + "deleted": { + "label": "Supprimé", + "hint": "Un commentaire est supprimé." + } + }, + "agent_run": { + "finished": { + "label": "Terminée", + "hint": "Une exécution d'agent se termine : success, failed ou canceled. Ce que l'agent a renvoyé n'est pas inclus." + } + } } }, "git": { diff --git a/apps/web/messages/id/settings.json b/apps/web/messages/id/settings.json index 350f6d762..624f169a4 100644 --- a/apps/web/messages/id/settings.json +++ b/apps/web/messages/id/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "Webhook baru", "emptyTitle": "Belum ada webhook", - "emptyHint": "Tetapkan URL payload dan pilih peristiwa yang akan dikirim.", + "emptyHint": "Tetapkan URL dan pilih peristiwa yang akan dikirim.", "columns": { - "endpoint": "Endpoint", + "endpoint": "URL", "events": "Peristiwa" }, "active": "Aktif", - "disabled": "Dinonaktifkan", + "disabled": "Tidak aktif", "hideSecret": "Sembunyikan rahasia", "revealSecret": "Tampilkan rahasia", "copySecret": "Salin rahasia", @@ -398,8 +398,8 @@ "deleteMessage": "Pengiriman ke {url} akan dihentikan. Tindakan ini tidak dapat dibatalkan.", "dialogNew": "Webhook baru", "dialogEdit": "Ubah webhook", - "dialogHint": "Tetapkan URL payload dan pilih peristiwa proyek mana yang akan dikirim.", - "payloadUrl": "URL payload", + "dialogHint": "Setiap peristiwa yang dipilih dikirim ke URL sebagai permintaan POST yang ditandatangani.", + "payloadUrl": "URL", "events": "Peristiwa", "create": "Buat webhook", "creating": "Membuat…", @@ -409,14 +409,74 @@ "endOfHistory": "Akhir riwayat", "queued": "Dalam antrean", "attempts": "·{count} percobaan", - "sent": "Terkirim", + "sent": "Permintaan", "response": "Respons", "responseWithStatus": "Respons · HTTP {status}", - "noResponse": "(tidak ada respons)", + "noResponse": "Kosong", "statuses": { "success": "Berhasil", "failed": "Gagal", "pending": "Tertunda" + }, + "signingSecret": "Rahasia tanda tangan", + "showExample": "Contoh {event}", + "exampleSignature": "Setiap permintaan membawa X-Itsaplan-Signature: t=…,v1=…. t adalah waktu Unix dalam detik. v1 adalah HMAC-SHA256 dalam hex dari t, titik, dan isi mentah, dengan rahasia tanda tangan sebagai kunci.", + "eventGroups": { + "issue": "Item pekerjaan", + "comment": "Komentar", + "agent_run": "Eksekusi agen" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Dibuat", + "hint": "Sebuah item pekerjaan dibuat." + }, + "updated": { + "label": "Diperbarui", + "hint": "Bidang apa pun pada item berubah. Mengarsipkan dan memulihkan juga terhitung." + }, + "deleted": { + "label": "Dihapus", + "hint": "Sebuah item dihapus. Isi permintaan memuat item seperti terakhir kali." + }, + "assigned": { + "label": "Ditugaskan", + "hint": "Penanggung jawab berubah. issue.updated juga dikirim." + }, + "state_changed": { + "label": "Status berubah", + "hint": "Item pindah ke kolom lain. issue.updated juga dikirim." + }, + "label_changed": { + "label": "Label berubah", + "hint": "Label ditambahkan atau dihapus. labelChange mencantumkannya." + }, + "link_changed": { + "label": "Tautan berubah", + "hint": "Tautan antara dua item ditambahkan atau dihapus. Dikirim sekali untuk setiap item. issue.updated tidak dikirim." + } + }, + "comment": { + "created": { + "label": "Dibuat", + "hint": "Sebuah komentar dikirim." + }, + "updated": { + "label": "Diperbarui", + "hint": "Teks sebuah komentar berubah." + }, + "deleted": { + "label": "Dihapus", + "hint": "Sebuah komentar dihapus." + } + }, + "agent_run": { + "finished": { + "label": "Selesai", + "hint": "Eksekusi agen berakhir: success, failed, atau canceled. Hasil dari agen tidak disertakan." + } + } } }, "git": { diff --git a/apps/web/messages/it/settings.json b/apps/web/messages/it/settings.json index 6f0a58e1a..526df61de 100644 --- a/apps/web/messages/it/settings.json +++ b/apps/web/messages/it/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "Nuovo webhook", "emptyTitle": "Nessun webhook", - "emptyHint": "Imposta un URL payload e scegli quali eventi inviare.", + "emptyHint": "Imposta un URL e scegli quali eventi inviare.", "columns": { - "endpoint": "Endpoint", + "endpoint": "URL", "events": "Eventi" }, "active": "Attivo", - "disabled": "Disattivato", + "disabled": "Inattivo", "hideSecret": "Nascondi secret", "revealSecret": "Mostra secret", "copySecret": "Copia secret", @@ -398,8 +398,8 @@ "deleteMessage": "Le consegne a {url} si fermeranno. Non è possibile annullare.", "dialogNew": "Nuovo webhook", "dialogEdit": "Modifica webhook", - "dialogHint": "Imposta l'URL payload e scegli quali eventi di progetto inviare.", - "payloadUrl": "URL payload", + "dialogHint": "Ogni evento scelto viene inviato all’URL come richiesta POST firmata.", + "payloadUrl": "URL", "events": "Eventi", "create": "Crea webhook", "creating": "Creazione…", @@ -409,14 +409,74 @@ "endOfHistory": "Fine dello storico", "queued": "In coda", "attempts": "·{count} tentativi", - "sent": "Inviato", + "sent": "Richiesta", "response": "Risposta", "responseWithStatus": "Risposta · HTTP {status}", - "noResponse": "(nessuna risposta)", + "noResponse": "Vuota", "statuses": { "success": "Successo", "failed": "Fallita", "pending": "In sospeso" + }, + "signingSecret": "Segreto di firma", + "showExample": "Esempio di {event}", + "exampleSignature": "Ogni richiesta porta X-Itsaplan-Signature: t=…,v1=…. t è l’ora Unix in secondi. v1 è l’HMAC-SHA256 in hex di t, un punto e il corpo grezzo, con il segreto di firma come chiave.", + "eventGroups": { + "issue": "Elementi di lavoro", + "comment": "Commenti", + "agent_run": "Esecuzioni agenti" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Creato", + "hint": "Viene creato un elemento di lavoro." + }, + "updated": { + "label": "Aggiornato", + "hint": "Cambia un campo qualsiasi dell’elemento. Contano anche l’archiviazione e il ripristino." + }, + "deleted": { + "label": "Eliminato", + "hint": "Viene eliminato un elemento. Il corpo contiene l’elemento com’era l’ultima volta." + }, + "assigned": { + "label": "Assegnato", + "hint": "Cambia l’assegnatario. Viene inviato anche issue.updated." + }, + "state_changed": { + "label": "Stato cambiato", + "hint": "L’elemento passa a un’altra colonna. Viene inviato anche issue.updated." + }, + "label_changed": { + "label": "Etichette cambiate", + "hint": "Vengono aggiunte o rimosse etichette. labelChange le elenca." + }, + "link_changed": { + "label": "Collegamenti cambiati", + "hint": "Viene aggiunto o rimosso un collegamento tra due elementi. Inviato una volta per ogni elemento. issue.updated non viene inviato." + } + }, + "comment": { + "created": { + "label": "Creato", + "hint": "Viene pubblicato un commento." + }, + "updated": { + "label": "Aggiornato", + "hint": "Cambia il testo di un commento." + }, + "deleted": { + "label": "Eliminato", + "hint": "Viene eliminato un commento." + } + }, + "agent_run": { + "finished": { + "label": "Terminata", + "hint": "Termina un’esecuzione di un agente: success, failed o canceled. Ciò che l’agente ha restituito non è incluso." + } + } } }, "git": { diff --git a/apps/web/messages/ko/settings.json b/apps/web/messages/ko/settings.json index 64ebbece8..38511f0ec 100644 --- a/apps/web/messages/ko/settings.json +++ b/apps/web/messages/ko/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "새 웹훅", "emptyTitle": "아직 웹훅이 없습니다", - "emptyHint": "페이로드 URL과 전송할 이벤트를 선택하세요.", + "emptyHint": "URL을 입력하고 전송할 이벤트를 선택하세요.", "columns": { - "endpoint": "엔드포인트", + "endpoint": "URL", "events": "이벤트" }, "active": "활성", - "disabled": "비활성화됨", + "disabled": "비활성", "hideSecret": "시크릿 숨기기", "revealSecret": "시크릿 표시", "copySecret": "시크릿 복사", @@ -398,8 +398,8 @@ "deleteMessage": "{url}(으)로의 전송이 중지됩니다. 이 작업은 되돌릴 수 없습니다.", "dialogNew": "새 웹훅", "dialogEdit": "웹훅 편집", - "dialogHint": "페이로드 URL과 전송할 프로젝트 이벤트를 선택하세요.", - "payloadUrl": "페이로드 URL", + "dialogHint": "선택한 각 이벤트가 서명된 POST 요청으로 URL에 전송됩니다.", + "payloadUrl": "URL", "events": "이벤트", "create": "웹훅 생성", "creating": "생성 중…", @@ -409,14 +409,74 @@ "endOfHistory": "기록의 끝", "queued": "대기 중", "attempts": "·{count}회 시도", - "sent": "전송됨", + "sent": "요청", "response": "응답", "responseWithStatus": "응답 · HTTP {status}", - "noResponse": "(응답 없음)", + "noResponse": "비어 있음", "statuses": { "success": "성공", "failed": "실패", "pending": "대기 중" + }, + "signingSecret": "서명 비밀", + "showExample": "{event} 예시", + "exampleSignature": "각 요청에는 X-Itsaplan-Signature: t=…,v1=…가 담깁니다. t는 초 단위 Unix 시간입니다. v1은 서명 비밀을 키로 t, 점, 원본 본문을 이어 계산한 hex HMAC-SHA256입니다.", + "eventGroups": { + "issue": "작업", + "comment": "댓글", + "agent_run": "에이전트 실행" + }, + "eventTypes": { + "issue": { + "created": { + "label": "생성됨", + "hint": "작업이 생성됩니다." + }, + "updated": { + "label": "업데이트됨", + "hint": "작업의 필드가 바뀝니다. 보관과 복원도 포함됩니다." + }, + "deleted": { + "label": "삭제됨", + "hint": "작업이 삭제됩니다. 본문에는 마지막 상태의 작업이 담깁니다." + }, + "assigned": { + "label": "담당자 지정", + "hint": "담당자가 바뀝니다. issue.updated도 전송됩니다." + }, + "state_changed": { + "label": "상태 변경", + "hint": "작업이 다른 열로 이동합니다. issue.updated도 전송됩니다." + }, + "label_changed": { + "label": "레이블 변경", + "hint": "레이블이 추가되거나 제거됩니다. labelChange에 목록이 담깁니다." + }, + "link_changed": { + "label": "링크 변경", + "hint": "두 작업 사이의 연결이 추가되거나 제거됩니다. 작업마다 한 번씩 전송됩니다. issue.updated는 전송되지 않습니다." + } + }, + "comment": { + "created": { + "label": "생성됨", + "hint": "댓글이 작성됩니다." + }, + "updated": { + "label": "업데이트됨", + "hint": "댓글의 내용이 바뀝니다." + }, + "deleted": { + "label": "삭제됨", + "hint": "댓글이 삭제됩니다." + } + }, + "agent_run": { + "finished": { + "label": "완료됨", + "hint": "에이전트 실행이 끝납니다: success, failed 또는 canceled. 에이전트가 반환한 내용은 빠집니다." + } + } } }, "git": { diff --git a/apps/web/messages/pt-BR/settings.json b/apps/web/messages/pt-BR/settings.json index 4c9c9146f..6f9786c60 100644 --- a/apps/web/messages/pt-BR/settings.json +++ b/apps/web/messages/pt-BR/settings.json @@ -376,15 +376,15 @@ "webhooks": { "new": "Novo webhook", "emptyTitle": "Nenhum webhook ainda", - "emptyHint": "Defina uma URL de payload e escolha quais eventos enviar.", + "emptyHint": "Defina uma URL e escolha quais eventos enviar.", "columns": { - "endpoint": "Endpoint", + "endpoint": "URL", "events": "Eventos" }, "active": "Ativo", - "disabled": "Desativado", + "disabled": "Inativo", "hideSecret": "Ocultar segredo", - "revealSecret": "Revelar segredo", + "revealSecret": "Mostrar segredo", "copySecret": "Copiar segredo", "rotateSecret": "Regenerar segredo", "rotateSecretTitle": "Regenerar o segredo de assinatura?", @@ -398,8 +398,8 @@ "deleteMessage": "As entregas para {url} vão parar. Isso não pode ser desfeito.", "dialogNew": "Novo webhook", "dialogEdit": "Editar webhook", - "dialogHint": "Defina a URL de payload e escolha quais eventos do projeto enviar.", - "payloadUrl": "URL de payload", + "dialogHint": "Cada evento escolhido é enviado à URL como uma requisição POST assinada.", + "payloadUrl": "URL", "events": "Eventos", "create": "Criar webhook", "creating": "Criando…", @@ -409,14 +409,74 @@ "endOfHistory": "Fim do histórico", "queued": "Na fila", "attempts": "·{count} tentativas", - "sent": "Enviado", + "sent": "Requisição", "response": "Resposta", "responseWithStatus": "Resposta · HTTP {status}", - "noResponse": "(sem resposta)", + "noResponse": "Vazia", "statuses": { "success": "Sucesso", "failed": "Com falha", "pending": "Pendente" + }, + "signingSecret": "Segredo de assinatura", + "showExample": "Exemplo de {event}", + "exampleSignature": "Cada requisição traz X-Itsaplan-Signature: t=…,v1=…. t é o horário Unix em segundos. v1 é o HMAC-SHA256 em hex de t, um ponto e o corpo bruto, com o segredo de assinatura como chave.", + "eventGroups": { + "issue": "Itens de trabalho", + "comment": "Comentários", + "agent_run": "Execuções de agentes" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Criado", + "hint": "Um item de trabalho é criado." + }, + "updated": { + "label": "Atualizado", + "hint": "Algum campo do item muda. Arquivar e restaurar também contam." + }, + "deleted": { + "label": "Excluído", + "hint": "Um item é excluído. O corpo traz o item como estava pela última vez." + }, + "assigned": { + "label": "Atribuído", + "hint": "O responsável muda. issue.updated também é enviado." + }, + "state_changed": { + "label": "Status alterado", + "hint": "O item passa para outra coluna. issue.updated também é enviado." + }, + "label_changed": { + "label": "Etiquetas alteradas", + "hint": "Etiquetas são adicionadas ou removidas. labelChange as lista." + }, + "link_changed": { + "label": "Vínculos alterados", + "hint": "Um vínculo entre dois itens é adicionado ou removido. Enviado uma vez para cada item. issue.updated não é enviado." + } + }, + "comment": { + "created": { + "label": "Criado", + "hint": "Um comentário é publicado." + }, + "updated": { + "label": "Atualizado", + "hint": "O texto de um comentário muda." + }, + "deleted": { + "label": "Excluído", + "hint": "Um comentário é excluído." + } + }, + "agent_run": { + "finished": { + "label": "Concluída", + "hint": "Uma execução de agente termina: success, failed ou canceled. O que o agente retornou não vem junto." + } + } } }, "git": { diff --git a/apps/web/messages/ru/settings.json b/apps/web/messages/ru/settings.json index 84958efb9..57f5cd8df 100644 --- a/apps/web/messages/ru/settings.json +++ b/apps/web/messages/ru/settings.json @@ -378,11 +378,11 @@ "emptyTitle": "Вебхуков пока нет", "emptyHint": "Укажите URL и выберите, какие события отправлять.", "columns": { - "endpoint": "Эндпоинт", + "endpoint": "URL", "events": "События" }, "active": "Активный", - "disabled": "Выключен", + "disabled": "Неактивный", "hideSecret": "Скрыть секрет", "revealSecret": "Показать секрет", "copySecret": "Скопировать секрет", @@ -398,8 +398,8 @@ "deleteMessage": "Доставки на {url} прекратятся. Это нельзя отменить.", "dialogNew": "Новый вебхук", "dialogEdit": "Редактировать вебхук", - "dialogHint": "Укажите URL и выберите, какие события проекта отправлять.", - "payloadUrl": "URL для запросов", + "dialogHint": "Каждое выбранное событие отправляется на URL подписанным POST-запросом.", + "payloadUrl": "URL", "events": "События", "create": "Создать вебхук", "creating": "Создание…", @@ -409,14 +409,74 @@ "endOfHistory": "Конец истории", "queued": "В очереди", "attempts": "·{count} попыток", - "sent": "Отправлено", + "sent": "Запрос", "response": "Ответ", "responseWithStatus": "Ответ · HTTP {status}", - "noResponse": "(без ответа)", + "noResponse": "Пусто", "statuses": { "success": "Успех", "failed": "Ошибка", "pending": "Ожидает" + }, + "signingSecret": "Секрет подписи", + "showExample": "Пример {event}", + "exampleSignature": "В каждом запросе есть X-Itsaplan-Signature: t=…,v1=…. t — время Unix в секундах. v1 — HMAC-SHA256 в hex от t, точки и исходного тела, ключ — секрет подписи.", + "eventGroups": { + "issue": "Задачи", + "comment": "Комментарии", + "agent_run": "Запуски агентов" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Создана", + "hint": "Создана задача." + }, + "updated": { + "label": "Изменена", + "hint": "Изменилось любое поле задачи. Архивация и восстановление тоже считаются." + }, + "deleted": { + "label": "Удалена", + "hint": "Задача удалена. В теле — задача в последнем виде." + }, + "assigned": { + "label": "Назначена", + "hint": "Сменился исполнитель. issue.updated тоже отправляется." + }, + "state_changed": { + "label": "Сменился статус", + "hint": "Задача перешла в другую колонку. issue.updated тоже отправляется." + }, + "label_changed": { + "label": "Изменились метки", + "hint": "Метки добавлены или сняты. Их список — в labelChange." + }, + "link_changed": { + "label": "Изменились связи", + "hint": "Связь между двумя задачами добавлена или удалена. Отправляется по одному разу для каждой задачи. issue.updated не отправляется." + } + }, + "comment": { + "created": { + "label": "Создан", + "hint": "Опубликован комментарий." + }, + "updated": { + "label": "Изменён", + "hint": "Изменился текст комментария." + }, + "deleted": { + "label": "Удалён", + "hint": "Комментарий удалён." + } + }, + "agent_run": { + "finished": { + "label": "Завершён", + "hint": "Запуск агента завершился: success, failed или canceled. Ответ агента в тело не входит." + } + } } }, "git": { diff --git a/apps/web/messages/tr/settings.json b/apps/web/messages/tr/settings.json index 27c09f242..9e4d01c8c 100644 --- a/apps/web/messages/tr/settings.json +++ b/apps/web/messages/tr/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "Yeni webhook", "emptyTitle": "Henüz webhook yok", - "emptyHint": "Bir istek URL'si (payload URL) belirleyin ve hangi olayların gönderileceğini seçin.", + "emptyHint": "Bir URL belirleyin ve hangi olayların gönderileceğini seçin.", "columns": { - "endpoint": "Uç Nokta", + "endpoint": "URL", "events": "Olaylar" }, "active": "Aktif", - "disabled": "Devre dışı", + "disabled": "Pasif", "hideSecret": "Anahtarı gizle", "revealSecret": "Anahtarı göster", "copySecret": "Anahtarı kopyala", @@ -398,8 +398,8 @@ "deleteMessage": "{url} adresine gönderimler durdurulacaktır. Bu işlem geri alınamaz.", "dialogNew": "Yeni webhook", "dialogEdit": "Webhook'u düzenle", - "dialogHint": "İstek URL'sini belirleyin ve hangi proje olaylarının gönderileceğini seçin.", - "payloadUrl": "İstek URL'si (Payload URL)", + "dialogHint": "Seçilen her olay, imzalı bir POST isteği olarak URL’ye gönderilir.", + "payloadUrl": "URL", "events": "Olaylar", "create": "Webhook oluştur", "creating": "Oluşturuluyor…", @@ -409,14 +409,74 @@ "endOfHistory": "Geçmişin sonu", "queued": "Kuyrukta", "attempts": "· {count} deneme", - "sent": "Gönderildi", + "sent": "İstek", "response": "Yanıt", "responseWithStatus": "Yanıt · HTTP {status}", - "noResponse": "(yanıt yok)", + "noResponse": "Boş", "statuses": { "success": "Başarılı", "failed": "Başarısız", "pending": "Bekliyor" + }, + "signingSecret": "İmza anahtarı", + "showExample": "{event} örneği", + "exampleSignature": "Her istek X-Itsaplan-Signature: t=…,v1=… taşır. t, saniye cinsinden Unix zamanıdır. v1, imza anahtarıyla t, bir nokta ve ham gövde için hesaplanan hex HMAC-SHA256’dır.", + "eventGroups": { + "issue": "İş Maddeleri", + "comment": "Yorumlar", + "agent_run": "Ajan çalıştırmaları" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Oluşturuldu", + "hint": "Bir iş maddesi oluşturulur." + }, + "updated": { + "label": "Güncellendi", + "hint": "İş maddesinin herhangi bir alanı değişir. Arşivleme ve geri yükleme de sayılır." + }, + "deleted": { + "label": "Silindi", + "hint": "Bir iş maddesi silinir. Gövde, maddenin son hâlini taşır." + }, + "assigned": { + "label": "Atandı", + "hint": "Atanan kişi değişir. issue.updated da gönderilir." + }, + "state_changed": { + "label": "Durum değişti", + "hint": "Madde başka bir sütuna geçer. issue.updated da gönderilir." + }, + "label_changed": { + "label": "Etiketler değişti", + "hint": "Etiket eklenir veya kaldırılır. labelChange bunları listeler." + }, + "link_changed": { + "label": "Bağlantılar değişti", + "hint": "İki madde arasındaki bağlantı eklenir veya kaldırılır. Her madde için bir kez gönderilir. issue.updated gönderilmez." + } + }, + "comment": { + "created": { + "label": "Oluşturuldu", + "hint": "Bir yorum yazılır." + }, + "updated": { + "label": "Güncellendi", + "hint": "Bir yorumun metni değişir." + }, + "deleted": { + "label": "Silindi", + "hint": "Bir yorum silinir." + } + }, + "agent_run": { + "finished": { + "label": "Bitti", + "hint": "Bir ajan çalıştırması biter: success, failed veya canceled. Ajanın döndürdüğü şey dahil edilmez." + } + } } }, "git": { diff --git a/apps/web/messages/uk/settings.json b/apps/web/messages/uk/settings.json index c2b84849e..3c87a72f3 100644 --- a/apps/web/messages/uk/settings.json +++ b/apps/web/messages/uk/settings.json @@ -378,11 +378,11 @@ "emptyTitle": "Вебхуків ще немає", "emptyHint": "Вкажіть URL і виберіть, які події надсилати.", "columns": { - "endpoint": "Ендпоїнт", + "endpoint": "URL", "events": "Події" }, "active": "Активний", - "disabled": "Вимкнений", + "disabled": "Неактивний", "hideSecret": "Сховати секрет", "revealSecret": "Показати секрет", "copySecret": "Скопіювати секрет", @@ -398,8 +398,8 @@ "deleteMessage": "Доставки на {url} припиняться. Це не можна скасувати.", "dialogNew": "Новий вебхук", "dialogEdit": "Редагувати вебхук", - "dialogHint": "Вкажіть URL і виберіть, які події проєкту надсилати.", - "payloadUrl": "URL для запитів", + "dialogHint": "Кожна вибрана подія надсилається на URL підписаним POST-запитом.", + "payloadUrl": "URL", "events": "Події", "create": "Створити вебхук", "creating": "Створення…", @@ -409,14 +409,74 @@ "endOfHistory": "Кінець історії", "queued": "У черзі", "attempts": "·{count} спроб", - "sent": "Надіслано", + "sent": "Запит", "response": "Відповідь", "responseWithStatus": "Відповідь · HTTP {status}", - "noResponse": "(без відповіді)", + "noResponse": "Порожньо", "statuses": { "success": "Успіх", "failed": "Помилка", "pending": "Очікує" + }, + "signingSecret": "Секрет підпису", + "showExample": "Приклад {event}", + "exampleSignature": "Кожен запит містить X-Itsaplan-Signature: t=…,v1=…. t — час Unix у секундах. v1 — HMAC-SHA256 у hex від t, крапки й вихідного тіла, ключ — секрет підпису.", + "eventGroups": { + "issue": "Задачі", + "comment": "Коментарі", + "agent_run": "Запуски агентів" + }, + "eventTypes": { + "issue": { + "created": { + "label": "Створено", + "hint": "Створено задачу." + }, + "updated": { + "label": "Змінено", + "hint": "Змінилося будь-яке поле задачі. Архівування й відновлення теж рахуються." + }, + "deleted": { + "label": "Видалено", + "hint": "Задачу видалено. У тілі — задача в останньому вигляді." + }, + "assigned": { + "label": "Призначено", + "hint": "Змінився виконавець. issue.updated теж надсилається." + }, + "state_changed": { + "label": "Змінився статус", + "hint": "Задача перейшла в іншу колонку. issue.updated теж надсилається." + }, + "label_changed": { + "label": "Змінилися мітки", + "hint": "Мітки додано або знято. Їхній список — у labelChange." + }, + "link_changed": { + "label": "Змінилися зв’язки", + "hint": "Зв’язок між двома задачами додано або видалено. Надсилається по одному разу для кожної задачі. issue.updated не надсилається." + } + }, + "comment": { + "created": { + "label": "Створено", + "hint": "Опубліковано коментар." + }, + "updated": { + "label": "Змінено", + "hint": "Змінився текст коментаря." + }, + "deleted": { + "label": "Видалено", + "hint": "Коментар видалено." + } + }, + "agent_run": { + "finished": { + "label": "Завершено", + "hint": "Запуск агента завершився: success, failed або canceled. Відповідь агента до тіла не входить." + } + } } }, "git": { diff --git a/apps/web/messages/zh-CN/settings.json b/apps/web/messages/zh-CN/settings.json index f765c0d3f..cc82c7b06 100644 --- a/apps/web/messages/zh-CN/settings.json +++ b/apps/web/messages/zh-CN/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "新建 Webhook", "emptyTitle": "暂无 Webhook", - "emptyHint": "设置请求地址并选择要发送的事件。", + "emptyHint": "设置 URL 并选择要发送的事件。", "columns": { - "endpoint": "端点", + "endpoint": "URL", "events": "事件" }, "active": "已启用", - "disabled": "已禁用", + "disabled": "未启用", "hideSecret": "隐藏密钥", "revealSecret": "显示密钥", "copySecret": "复制密钥", @@ -398,8 +398,8 @@ "deleteMessage": "向 {url} 的投递将停止。此操作无法撤销。", "dialogNew": "新建 Webhook", "dialogEdit": "编辑 Webhook", - "dialogHint": "设置请求地址并选择要发送的项目事件。", - "payloadUrl": "请求地址", + "dialogHint": "每个选中的事件都会以签名的 POST 请求发送到该 URL。", + "payloadUrl": "URL", "events": "事件", "create": "新建 Webhook", "creating": "正在创建…", @@ -409,14 +409,74 @@ "endOfHistory": "已显示全部记录", "queued": "已排队", "attempts": "· {count} 次尝试", - "sent": "已发送", + "sent": "请求", "response": "响应", "responseWithStatus": "响应 · HTTP {status}", - "noResponse": "(无响应)", + "noResponse": "空", "statuses": { "success": "成功", "failed": "失败", "pending": "待处理" + }, + "signingSecret": "签名密钥", + "showExample": "{event} 示例", + "exampleSignature": "每个请求都带有 X-Itsaplan-Signature: t=…,v1=…。t 是以秒为单位的 Unix 时间。v1 是以签名密钥为键,对 t、一个点和原始请求体计算的十六进制 HMAC-SHA256。", + "eventGroups": { + "issue": "工作项", + "comment": "评论", + "agent_run": "代理运行" + }, + "eventTypes": { + "issue": { + "created": { + "label": "已创建", + "hint": "创建了工作项。" + }, + "updated": { + "label": "已更新", + "hint": "工作项的任一字段发生变化,归档和恢复也算在内。" + }, + "deleted": { + "label": "已删除", + "hint": "删除了工作项。请求体是该工作项最后的样子。" + }, + "assigned": { + "label": "已指派", + "hint": "负责人变更。同时也会发送 issue.updated。" + }, + "state_changed": { + "label": "状态变更", + "hint": "工作项移到了另一列。同时也会发送 issue.updated。" + }, + "label_changed": { + "label": "标签变更", + "hint": "添加或移除了标签,labelChange 中列出它们。" + }, + "link_changed": { + "label": "关联变更", + "hint": "两个工作项之间的关联被添加或移除。每个工作项各发送一次。不发送 issue.updated。" + } + }, + "comment": { + "created": { + "label": "已创建", + "hint": "发布了评论。" + }, + "updated": { + "label": "已更新", + "hint": "评论内容发生变化。" + }, + "deleted": { + "label": "已删除", + "hint": "删除了评论。" + } + }, + "agent_run": { + "finished": { + "label": "已结束", + "hint": "代理运行结束:success、failed 或 canceled。不包含代理返回的内容。" + } + } } }, "git": { diff --git a/apps/web/messages/zh-TW/settings.json b/apps/web/messages/zh-TW/settings.json index 6dc3140cb..8b714f4e0 100644 --- a/apps/web/messages/zh-TW/settings.json +++ b/apps/web/messages/zh-TW/settings.json @@ -376,13 +376,13 @@ "webhooks": { "new": "新建 Webhook", "emptyTitle": "暫無 Webhook", - "emptyHint": "設定請求地址並選擇要傳送的事件。", + "emptyHint": "設定 URL 並選擇要傳送的事件。", "columns": { - "endpoint": "端點", + "endpoint": "URL", "events": "事件" }, "active": "已啟用", - "disabled": "已停用", + "disabled": "未啟用", "hideSecret": "隱藏金鑰", "revealSecret": "顯示金鑰", "copySecret": "複製金鑰", @@ -398,8 +398,8 @@ "deleteMessage": "向 {url} 的投遞將停止。此操作無法復原。", "dialogNew": "新建 Webhook", "dialogEdit": "編輯 Webhook", - "dialogHint": "設定請求地址並選擇要傳送的專案事件。", - "payloadUrl": "請求地址", + "dialogHint": "每個選取的事件都會以簽署的 POST 請求傳送到該 URL。", + "payloadUrl": "URL", "events": "事件", "create": "新建 Webhook", "creating": "正在建立…", @@ -409,14 +409,74 @@ "endOfHistory": "已顯示全部記錄", "queued": "已排隊", "attempts": "· {count} 次嘗試", - "sent": "已傳送", + "sent": "請求", "response": "回應", "responseWithStatus": "回應 · HTTP {status}", - "noResponse": "(無回應)", + "noResponse": "空", "statuses": { "success": "成功", "failed": "失敗", "pending": "待處理" + }, + "signingSecret": "簽署密鑰", + "showExample": "{event} 範例", + "exampleSignature": "每個請求都帶有 X-Itsaplan-Signature: t=…,v1=…。t 是以秒為單位的 Unix 時間。v1 是以簽署密鑰為金鑰,對 t、一個點和原始請求本文計算的十六進位 HMAC-SHA256。", + "eventGroups": { + "issue": "工作項目", + "comment": "留言", + "agent_run": "代理執行" + }, + "eventTypes": { + "issue": { + "created": { + "label": "已建立", + "hint": "建立了工作項目。" + }, + "updated": { + "label": "已更新", + "hint": "工作項目的任一欄位有變動,封存與還原也算在內。" + }, + "deleted": { + "label": "已刪除", + "hint": "刪除了工作項目。請求本文是該項目最後的樣子。" + }, + "assigned": { + "label": "已指派", + "hint": "負責人變更。同時也會傳送 issue.updated。" + }, + "state_changed": { + "label": "狀態變更", + "hint": "工作項目移到另一欄。同時也會傳送 issue.updated。" + }, + "label_changed": { + "label": "標籤變更", + "hint": "新增或移除了標籤,labelChange 會列出它們。" + }, + "link_changed": { + "label": "關聯變更", + "hint": "兩個工作項目之間的關聯被新增或移除。每個工作項目各傳送一次。不傳送 issue.updated。" + } + }, + "comment": { + "created": { + "label": "已建立", + "hint": "發佈了留言。" + }, + "updated": { + "label": "已更新", + "hint": "留言內容有變動。" + }, + "deleted": { + "label": "已刪除", + "hint": "刪除了留言。" + } + }, + "agent_run": { + "finished": { + "label": "已結束", + "hint": "代理執行結束:success、failed 或 canceled。不包含代理傳回的內容。" + } + } } }, "git": { diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhookDialog.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhookDialog.tsx index 845730311..c08208345 100644 --- a/apps/web/src/features/settings/components/webhooks/SettingsWebhookDialog.tsx +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhookDialog.tsx @@ -1,12 +1,14 @@ import { useState } from 'react'; import { useTranslations } from 'next-intl'; import type { Webhook } from '@/lib/api/endpoints/webhooks'; -import { useWebhookEventTypesQuery } from '@/services/webhooks.service'; import Modal from '@/components/common/overlay/Modal'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; -import { Checkbox } from '@/components/ui/checkbox'; +import { Switch } from '@/components/ui/switch'; +import { cn } from '@/lib/utils'; +import { SettingsWebhookEvents } from './SettingsWebhookEvents'; +import { SettingsWebhookSecret } from './SettingsWebhookSecret'; export interface WebhookFormValue { url: string; @@ -14,42 +16,33 @@ export interface WebhookFormValue { isActive: boolean; } -// Add/edit dialog for a webhook: the payload URL, the set of subscribed event -// types, and whether it is active. The secret is generated server-side and shown -// on the row, not here. An event the instance no longer offers stays listed while the -// webhook has it. +// Add/edit dialog for a webhook: the payload URL, the subscribed events and, on an existing +// one, its signing secret and whether it is active. A new webhook starts active, with a +// secret the server generates. export function SettingsWebhookDialog({ projectKey, initial, saving, onSave, + onRotateSecret, onClose, }: { projectKey: string; initial?: Webhook; saving: boolean; onSave: (value: WebhookFormValue) => Promise; + onRotateSecret: () => void; onClose: () => void; }) { const t = useTranslations('settings.webhooks'); const tCommon = useTranslations('common'); const [url, setUrl] = useState(initial?.url ?? ''); const [events, setEvents] = useState>(new Set(initial?.events ?? [])); - const offered = useWebhookEventTypesQuery(projectKey).data ?? []; - const listed = [...offered, ...(initial?.events ?? []).filter((e) => !offered.includes(e))]; const [isActive, setIsActive] = useState(initial?.isActive ?? true); + const secret = initial?.secret; const valid = url.trim().length > 0 && events.size > 0; - function toggleEvent(event: string, on: boolean) { - setEvents((prev) => { - const next = new Set(prev); - if (on) next.add(event); - else next.delete(event); - return next; - }); - } - async function submit() { if (!valid) return; await onSave({ url: url.trim(), events: [...events], isActive }); @@ -64,50 +57,62 @@ export function SettingsWebhookDialog({ description={t('dialogHint')} scope={projectKey} onClose={onClose} - wide + wide="xl" >
{ event.preventDefault(); void submit(); }} > -
- - setUrl(e.target.value)} - placeholder="https://example.com/webhook" - /> -
- -
- {t('events')} -
- {listed.map((event) => ( - - ))} +
+
+ + setUrl(e.target.value)} + placeholder="https://example.com/webhook" + />
+ {secret && ( +
+ {t('signingSecret')} +
+ + +
+
+ )}
-
- +
+ + {t('events')} + +
-
+
+ {initial && ( + + )} + diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhookEventExample.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhookEventExample.tsx new file mode 100644 index 000000000..bfe4b6ed0 --- /dev/null +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhookEventExample.tsx @@ -0,0 +1,55 @@ +import { useTranslations } from 'next-intl'; +import { Braces } from 'lucide-react'; +import { Button } from '@/components/ui/button'; +import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; +import { useWebhookEventText } from '../../hooks/useWebhookEventText'; +import { JsonViewer } from './JsonViewer'; + +export function SettingsWebhookEventExample({ + event, + example, +}: { + event: string; + example: unknown; +}) { + const t = useTranslations('settings.webhooks'); + const text = useWebhookEventText(); + const hint = text.hint(event); + + return ( + + + + + +
+

+ {event} +

+ {hint &&

{hint}

} +
+
+ +
+

+ {t.rich('exampleSignature', { + c: (chunks) => ( + + {chunks} + + ), + })} +

+
+
+ ); +} diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhookEventGroup.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhookEventGroup.tsx new file mode 100644 index 000000000..d194aa4fe --- /dev/null +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhookEventGroup.tsx @@ -0,0 +1,50 @@ +import { MatrixCheckbox } from '@/components/common/permissions/MatrixCheckbox'; +import { useWebhookEventText } from '../../hooks/useWebhookEventText'; +import type { WebhookEventGroup } from '../../utils/webhookEventGroups'; +import { SettingsWebhookEventExample } from './SettingsWebhookEventExample'; + +export function SettingsWebhookEventGroup({ + group, + order, + selected, + onToggle, +}: { + group: WebhookEventGroup; + order: number; + selected: Set; + onToggle: (events: string[], on: boolean) => void; +}) { + const text = useWebhookEventText(); + const names = group.events.map((one) => one.event); + const count = names.filter((event) => selected.has(event)).length; + const all = count === names.length; + + return ( +
+ +
+ {group.events.map(({ event, example }) => ( +
+ + {example != null && } +
+ ))} +
+
+ ); +} diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhookEvents.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhookEvents.tsx new file mode 100644 index 000000000..52cc78acc --- /dev/null +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhookEvents.tsx @@ -0,0 +1,56 @@ +import { useWebhookEventTypesQuery } from '@/services/webhooks.service'; +import { webhookEventColumns, webhookEventGroups } from '../../utils/webhookEventGroups'; +import { SettingsWebhookEventGroup } from './SettingsWebhookEventGroup'; + +// `kept` are the events the webhook has, so one the instance no longer offers stays listed. +export function SettingsWebhookEvents({ + projectKey, + kept, + selected, + onChange, + labelledBy, +}: { + projectKey: string; + kept: string[]; + selected: Set; + onChange: (next: Set) => void; + labelledBy: string; +}) { + const offered = useWebhookEventTypesQuery(projectKey); + // Until the list arrives, `kept` alone would show in cards picked by name and then move. + if (offered.isPending) return null; + const groups = webhookEventGroups(offered.data ?? [], kept); + const columns = webhookEventColumns(groups); + + function toggle(events: string[], on: boolean) { + const next = new Set(selected); + for (const event of events) { + if (on) next.add(event); + else next.delete(event); + } + onChange(next); + } + + // Below sm the columns dissolve into one list, and `order` keeps the cards in the api's order. + return ( +
+ {columns.map((column, index) => ( +
+ {column.map((group) => ( + + ))} +
+ ))} +
+ ); +} diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhookRow.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhookRow.tsx index 9a3c70eff..26c6cf02e 100644 --- a/apps/web/src/features/settings/components/webhooks/SettingsWebhookRow.tsx +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhookRow.tsx @@ -1,16 +1,5 @@ -import { useState } from 'react'; import { useTranslations } from 'next-intl'; -import { - Check, - Copy, - Eye, - EyeOff, - History, - MoreHorizontal, - Pencil, - RefreshCw, - Trash2, -} from 'lucide-react'; +import { History, MoreHorizontal, Pencil, RefreshCw, Trash2 } from 'lucide-react'; import type { Webhook } from '@/lib/api/endpoints/webhooks'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; @@ -26,6 +15,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip import { cn } from '@/lib/utils'; import SettingsIconButton from '../SettingsIconButton'; import { useSettingsCan } from '../../context/settingsPermission'; +import { SettingsWebhookSecret } from './SettingsWebhookSecret'; export function SettingsWebhookRow({ webhook, @@ -43,18 +33,6 @@ export function SettingsWebhookRow({ const secret = webhook.secret; const t = useTranslations('settings.webhooks'); const can = useSettingsCan(); - const [revealed, setRevealed] = useState(false); - const [copied, setCopied] = useState(false); - - async function copySecret(value: string) { - try { - await navigator.clipboard.writeText(value); - setCopied(true); - setTimeout(() => setCopied(false), 1500); - } catch { - // Clipboard unavailable (insecure context / denied); leave the secret visible to copy manually. - } - } return ( @@ -71,29 +49,7 @@ export function SettingsWebhookRow({ {webhook.url} - {secret != null && ( -
- {revealed ? secret : maskSecret(secret)} - - -
- )} + {secret != null && }
@@ -159,9 +115,3 @@ export function SettingsWebhookRow({ ); } - -// Keeps only the leading characters visible; the rest of the secret is replaced by -// a fixed number of dots so its real length is not exposed. -function maskSecret(secret: string): string { - return `${secret.slice(0, 11)}${'•'.repeat(8)}`; -} diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhookSecret.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhookSecret.tsx new file mode 100644 index 000000000..8a68a0a66 --- /dev/null +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhookSecret.tsx @@ -0,0 +1,63 @@ +import { useState } from 'react'; +import { useTranslations } from 'next-intl'; +import { Check, Copy, Eye, EyeOff } from 'lucide-react'; +import { Button } from '@/components/ui/button'; +import { cn } from '@/lib/utils'; + +export function SettingsWebhookSecret({ + secret, + className, +}: { + secret: string; + className?: string; +}) { + const t = useTranslations('settings.webhooks'); + const [revealed, setRevealed] = useState(false); + const [copied, setCopied] = useState(false); + + async function copy() { + try { + await navigator.clipboard.writeText(secret); + setCopied(true); + setTimeout(() => setCopied(false), 1500); + } catch { + // Clipboard unavailable (insecure context / denied); leave the secret visible to copy manually. + } + } + + return ( +
+ + {revealed ? secret : maskSecret(secret)} + + + +
+ ); +} + +// Keeps only the leading characters visible; the rest of the secret is replaced by +// a fixed number of dots so its real length is not exposed. +function maskSecret(secret: string): string { + return `${secret.slice(0, 11)}${'•'.repeat(8)}`; +} diff --git a/apps/web/src/features/settings/components/webhooks/SettingsWebhooks.tsx b/apps/web/src/features/settings/components/webhooks/SettingsWebhooks.tsx index 02e39ea96..40bb74c38 100644 --- a/apps/web/src/features/settings/components/webhooks/SettingsWebhooks.tsx +++ b/apps/web/src/features/settings/components/webhooks/SettingsWebhooks.tsx @@ -88,6 +88,7 @@ export default function SettingsWebhooks({ initial={editingWebhook} saving={saving} onSave={saveWebhook} + onRotateSecret={() => editingWebhook && setRotating(editingWebhook)} onClose={() => setEditing(null)} /> )} diff --git a/apps/web/src/features/settings/hooks/useWebhookEventText.ts b/apps/web/src/features/settings/hooks/useWebhookEventText.ts new file mode 100644 index 000000000..bcf701229 --- /dev/null +++ b/apps/web/src/features/settings/hooks/useWebhookEventText.ts @@ -0,0 +1,23 @@ +import { useTranslations } from 'next-intl'; + +// The words of a webhook event and its group. The hosted build names the ones it adds in its +// messages; one without a name is named from its key ('agent_workflow_run' → 'Agent workflow +// run', 'issue.sla_missed' → 'Sla missed'). +export function useWebhookEventText() { + const t = useTranslations('settings.webhooks'); + const text = (key: string, fallback: string) => { + const path = key as Parameters[0]; + return t.has(path) ? t(path) : fallback; + }; + return { + group: (group: string) => text(`eventGroups.${group}`, words(group)), + label: (event: string) => + text(`eventTypes.${event}.label`, words(event.slice(event.indexOf('.') + 1))), + hint: (event: string) => text(`eventTypes.${event}.hint`, ''), + }; +} + +function words(key: string): string { + const spaced = key.replace(/_/g, ' '); + return spaced.charAt(0).toUpperCase() + spaced.slice(1); +} diff --git a/apps/web/src/features/settings/utils/webhookEventGroups.test.ts b/apps/web/src/features/settings/utils/webhookEventGroups.test.ts new file mode 100644 index 000000000..842c83fdc --- /dev/null +++ b/apps/web/src/features/settings/utils/webhookEventGroups.test.ts @@ -0,0 +1,59 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import { webhookEventColumns, webhookEventGroups } from './webhookEventGroups'; + +const offered = [ + { event: 'issue.created', group: 'issue', example: { id: 1 } }, + { event: 'issue.updated', group: 'issue', example: { id: 2 } }, + { event: 'comment.created', group: 'comment', example: { id: 3 } }, + { event: 'intake_request.created', group: 'intake_request', example: { id: 4 } }, + // An extension's event in a group of the core's. + { event: 'issue.escalated', group: 'issue', example: { id: 5 } }, +]; + +describe('webhookEventGroups', () => { + it('groups the events in the order the api lists the groups', () => { + const groups = webhookEventGroups(offered, []); + assert.deepEqual( + groups.map((g) => [g.key, g.events.map((e) => e.event)]), + [ + ['issue', ['issue.created', 'issue.updated', 'issue.escalated']], + ['comment', ['comment.created']], + ['intake_request', ['intake_request.created']], + ], + ); + }); + + it('keeps an event no longer offered, in the group its name starts with', () => { + const groups = webhookEventGroups(offered, ['issue.created', 'thing.done', 'comment.gone']); + assert.deepEqual(groups.at(-1), { + key: 'thing', + events: [{ event: 'thing.done', example: null }], + }); + assert.deepEqual(groups[1].events.at(-1), { event: 'comment.gone', example: null }); + assert.equal(groups[0].events.length, 3); + }); +}); + +describe('webhookEventColumns', () => { + it('puts each card in the shorter column', () => { + const card = (key: string, size: number) => ({ + key, + events: Array.from({ length: size }, (_, i) => ({ event: `${key}.${i}`, example: null })), + }); + const columns = webhookEventColumns([ + card('issue', 7), + card('comment', 3), + card('agent_run', 1), + card('agent_workflow_run', 1), + card('intake_request', 2), + ]); + assert.deepEqual( + columns.map((column) => column.map((g) => g.key)), + [ + ['issue', 'intake_request'], + ['comment', 'agent_run', 'agent_workflow_run'], + ], + ); + }); +}); diff --git a/apps/web/src/features/settings/utils/webhookEventGroups.ts b/apps/web/src/features/settings/utils/webhookEventGroups.ts new file mode 100644 index 000000000..9eb35207b --- /dev/null +++ b/apps/web/src/features/settings/utils/webhookEventGroups.ts @@ -0,0 +1,39 @@ +import type { WebhookEvent } from '@/lib/api/endpoints/webhooks'; + +export interface WebhookEventGroup { + key: string; + // example is null for an event the instance no longer offers. + events: { event: string; example: unknown }[]; +} + +// The cards of the webhook dialog, one per group in the order the api lists them. An event the +// instance no longer offers stays while the webhook has it, in the group its name starts with. +export function webhookEventGroups(offered: WebhookEvent[], kept: string[]): WebhookEventGroup[] { + const groups: WebhookEventGroup[] = []; + const add = (key: string, event: string, example: unknown) => { + let group = groups.find((one) => one.key === key); + if (!group) { + group = { key, events: [] }; + groups.push(group); + } + group.events.push({ event, example }); + }; + for (const one of offered) add(one.group, one.event, one.example); + for (const event of kept) { + if (!offered.some((one) => one.event === event)) add(event.split('.')[0], event, null); + } + return groups; +} + +// Two columns of about the same height: each card goes to the shorter one, its title counted +// as a row. +export function webhookEventColumns(groups: WebhookEventGroup[]): WebhookEventGroup[][] { + const columns: WebhookEventGroup[][] = [[], []]; + const rows = [0, 0]; + for (const group of groups) { + const at = rows[0] <= rows[1] ? 0 : 1; + columns[at].push(group); + rows[at] += group.events.length + 1; + } + return columns; +} diff --git a/apps/web/src/lib/api/endpoints/webhooks.ts b/apps/web/src/lib/api/endpoints/webhooks.ts index 0dd4e1ac1..f29f4dafb 100644 --- a/apps/web/src/lib/api/endpoints/webhooks.ts +++ b/apps/web/src/lib/api/endpoints/webhooks.ts @@ -1,7 +1,7 @@ import { request } from '@/lib/api/core/client'; // Outgoing webhook subscription (mirrors apps/api modules/webhooks/service.ts). Its events are -// names from listWebhookEventTypes: the core's, then those the instance adds. +// names from listWebhookEventTypes. export interface Webhook { id: number; projectId: number; @@ -47,8 +47,15 @@ export interface WebhookDeliveryPage { nextCursor: number | null; } +// The core's events come first, then those the instance adds. +export interface WebhookEvent { + event: string; + group: string; + example: unknown; +} + export const listWebhookEventTypes = (projectKey: string) => - request(`/projects/${projectKey}/webhooks/event-types`); + request(`/projects/${projectKey}/webhooks/event-types`); export const listWebhooks = (projectKey: string) => request(`/projects/${projectKey}/webhooks`);