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

/**
 * Auto-generated by 'os i18n extract' for locale 'zh-CN'.
 * 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 zhCNObjects: NonNullable<TranslationData['objects']> = {
  sys_webhook: {
    label: "Webhook",
    pluralLabel: "Webhook",
    description: "外发 HTTP Webhook 订阅。可在代码中通过 defineWebhook() 编写，或在 Studio 编辑器中维护；由 HTTP 连接器插件执行。",
    fields: {
      id: {
        label: "Webhook ID"
      },
      name: {
        label: "名称",
        help: "唯一的 snake_case 名称——用于日志和审计引用"
      },
      label: {
        label: "显示标签"
      },
      object_name: {
        label: "对象",
        help: "触发该 Webhook 的短对象名（留空 = 手动 / API 触发）"
      },
      triggers: {
        label: "触发器",
        help: "以逗号分隔的事件列表：create,update,delete,undelete,api"
      },
      url: {
        label: "目标 URL",
        help: "接收 POST 请求的外部端点"
      },
      method: {
        label: "HTTP 方法",
        help: "GET / POST / PUT / PATCH / DELETE"
      },
      description: {
        label: "描述"
      },
      active: {
        label: "启用",
        help: "停用的 Webhook 会被调度器跳过"
      },
      definition_json: {
        label: "定义",
        help: "序列化的 Webhook JSON（参见 @objectstack/spec/automation/webhook）——包含完整的 headers/auth/retry/payload 配置"
      },
      created_at: {
        label: "创建时间"
      },
      updated_at: {
        label: "更新时间"
      }
    },
    _views: {
      active: {
        label: "启用"
      },
      inactive: {
        label: "停用"
      },
      by_object: {
        label: "按对象"
      },
      all_webhooks: {
        label: "全部"
      }
    }
  },
  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"
      }
    }
  }
};
