// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.

/**
 * Auto-generated by 'os i18n extract' for locale 'en'.
 * Edit translations in place; re-run extract (with --merge) to fill new gaps.
 * Do not hand-edit the structure — only the leaf string values.
 */

import type { TranslationData } from '@objectstack/spec/system';

export const enObjects: NonNullable<TranslationData['objects']> = {
  sys_webhook: {
    label: "Webhook",
    pluralLabel: "Webhooks",
    description: "Outbound HTTP webhook subscription. Authored via defineWebhook() in code or the Studio editor; executed by the HTTP connector plugin.",
    fields: {
      id: {
        label: "Webhook ID"
      },
      name: {
        label: "Name",
        help: "Unique snake_case name — referenced in logs and audit"
      },
      label: {
        label: "Display Label"
      },
      object_name: {
        label: "Object",
        help: "Short object name whose events fire this webhook (blank = manual / API-triggered)"
      },
      triggers: {
        label: "Triggers",
        help: "Comma-separated event list: create,update,delete,undelete,api"
      },
      url: {
        label: "Target URL",
        help: "External endpoint that receives the POST"
      },
      method: {
        label: "HTTP Method",
        help: "GET / POST / PUT / PATCH / DELETE"
      },
      description: {
        label: "Description"
      },
      active: {
        label: "Active",
        help: "Inactive webhooks are skipped by the dispatcher"
      },
      definition_json: {
        label: "Definition",
        help: "Serialised Webhook JSON (see @objectstack/spec/automation/webhook) — full headers/auth/retry/payload config"
      },
      created_at: {
        label: "Created At"
      },
      updated_at: {
        label: "Updated At"
      }
    },
    _views: {
      active: {
        label: "Active"
      },
      inactive: {
        label: "Inactive"
      },
      by_object: {
        label: "By Object"
      },
      all_webhooks: {
        label: "All"
      }
    }
  },
  sys_webhook_delivery: {
    label: "Webhook Delivery",
    pluralLabel: "Webhook Deliveries",
    description: "Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.",
    fields: {
      id: {
        label: "Delivery ID",
        help: "UUID — also doubles as the receiver-side idempotency key"
      },
      webhook_id: {
        label: "Webhook ID",
        help: "FK to sys_webhook.id (loosely coupled — denormalised URL/secret on row)"
      },
      event_id: {
        label: "Event ID",
        help: "Source event id; UNIQUE(event_id, webhook_id) for dedup"
      },
      event_type: {
        label: "Event Type",
        help: "e.g. data.record.created"
      },
      url: {
        label: "Target URL",
        help: "Snapshotted at enqueue so config edits do not rewrite live rows"
      },
      method: {
        label: "Method"
      },
      headers_json: {
        label: "Headers JSON"
      },
      secret: {
        label: "HMAC Secret"
      },
      timeout_ms: {
        label: "Timeout (ms)"
      },
      payload_json: {
        label: "Payload JSON"
      },
      partition_key: {
        label: "Partition",
        help: "hash(webhook_id) mod partitionCount — precomputed for cheap WHERE"
      },
      status: {
        label: "Status",
        help: "pending | in_flight | success | failed | dead"
      },
      attempts: {
        label: "Attempts",
        help: "Number of POST attempts made so far"
      },
      claimed_by: {
        label: "Claimed By"
      },
      claimed_at: {
        label: "Claimed At (ms)"
      },
      next_retry_at: {
        label: "Next Retry At (ms)"
      },
      last_attempted_at: {
        label: "Last Attempted At (ms)"
      },
      response_code: {
        label: "HTTP Status"
      },
      response_body: {
        label: "Response Body (capped)"
      },
      error: {
        label: "Error"
      },
      created_at: {
        label: "Created At (ms)"
      },
      updated_at: {
        label: "Updated At (ms)"
      }
    },
    _views: {
      recent: {
        label: "Recent"
      },
      failures: {
        label: "Failures"
      },
      in_flight: {
        label: "In Flight"
      },
      pending: {
        label: "Pending"
      },
      by_status: {
        label: "By Status"
      },
      by_webhook: {
        label: "By Webhook"
      },
      all_deliveries: {
        label: "All"
      }
    },
    _actions: {
      redeliver: {
        label: "Redeliver",
        confirmText: "Replay this delivery? The receiver will get the original payload again — they must be idempotent on the X-Objectstack-Delivery header.",
        successMessage: "Queued for redelivery"
      }
    }
  }
};
