// 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_record_share: {
    label: "记录共享",
    pluralLabel: "记录共享",
    description: "按记录粒度的共享授权——在 OWD 基础上提供显式访问",
    fields: {
      id: {
        label: "共享 ID"
      },
      object_name: {
        label: "对象",
        help: "被共享记录的短对象名"
      },
      record_id: {
        label: "记录",
        help: "object_name 对应对象内该共享记录的主键"
      },
      recipient_type: {
        label: "接收方类型",
        help: "持有该授权的主体类型",
        options: {
          user: "用户",
          group: "组",
          role: "角色",
          role_and_subordinates: "角色及下级",
          guest: "访客"
        }
      },
      recipient_id: {
        label: "接收方",
        help: "获得访问权限的用户 / 组 / 角色 ID"
      },
      access_level: {
        label: "访问级别",
        help: "接收方可以执行的操作——read | edit | full（转移 / 共享 / 删除）",
        options: {
          read: "读取",
          edit: "编辑",
          full: "完全访问"
        }
      },
      source: {
        label: "来源",
        help: "该授权存在的原因——供规则求值器对账使用",
        options: {
          manual: "手动",
          rule: "规则",
          team: "团队",
          inherited: "继承"
        }
      },
      source_id: {
        label: "来源 ID",
        help: "当 source != manual 时，对应规则名 / 团队 ID"
      },
      granted_by: {
        label: "授权人",
        help: "创建该授权的用户（仅手动授权）"
      },
      reason: {
        label: "原因",
        help: "可选的自由文本说明，会展示给接收方"
      },
      created_at: {
        label: "创建时间"
      },
      updated_at: {
        label: "更新时间"
      }
    },
    _views: {
      granted_to_me: {
        label: "授予我的"
      },
      granted_by_me: {
        label: "我授予的"
      },
      by_object: {
        label: "按对象"
      },
      manual_grants: {
        label: "手动授权"
      },
      rule_grants: {
        label: "规则授权"
      },
      all_shares: {
        label: "全部"
      }
    }
  },
  sys_sharing_rule: {
    label: "共享规则",
    pluralLabel: "共享规则",
    description: "声明式共享规则，会自动生成 sys_record_share 授权。可在代码中通过 defineSharingRule() 编写，或在 Studio 条件构建器中维护。",
    fields: {
      id: {
        label: "规则 ID"
      },
      organization_id: {
        label: "组织",
        help: "拥有该规则的租户；null = 全局"
      },
      name: {
        label: "名称",
        help: "唯一的 snake_case 规则名称"
      },
      label: {
        label: "显示标签"
      },
      description: {
        label: "描述"
      },
      object_name: {
        label: "对象",
        help: "短对象名（例如 opportunity、account）"
      },
      criteria_json: {
        label: "条件（FilterCondition JSON）",
        help: "针对 object_name 记录匹配的 JSON FilterCondition。为空表示匹配全部。"
      },
      recipient_type: {
        label: "接收方类型",
        help: "接收访问权限的主体类型——求值时会展开为用户授权。`department` 会沿 parent_department_id 树展开；`team` 为扁平结构（better-auth）。",
        options: {
          user: "用户",
          team: "团队",
          department: "部门",
          role: "角色",
          queue: "队列"
        }
      },
      recipient_id: {
        label: "接收方",
        help: "根据 recipient_type 填写 department id / team id / role name / queue name / user id"
      },
      access_level: {
        label: "访问级别",
        options: {
          read: "读取",
          edit: "编辑",
          full: "完全访问"
        }
      },
      active: {
        label: "启用",
        help: "只有启用的规则才会参与生命周期求值"
      },
      created_at: {
        label: "创建时间"
      },
      updated_at: {
        label: "更新时间"
      }
    },
    _views: {
      active: {
        label: "启用"
      },
      inactive: {
        label: "停用"
      },
      by_object: {
        label: "按对象"
      },
      all_rules: {
        label: "全部"
      }
    }
  },
  sys_share_link: {
    label: "共享链接",
    pluralLabel: "共享链接",
    description: "授予对单条记录访问权限的不透明能力令牌。类似 Notion/Figma 的公开链接共享。",
    fields: {
      id: {
        label: "链接 ID"
      },
      token: {
        label: "令牌",
        help: "URL 安全的不透明随机令牌（≥ 22 个字符）。本记录中唯一的机密信息。"
      },
      object_name: {
        label: "对象",
        help: "所共享记录的对象短名称（例如 ai_conversation、contracts_contract）"
      },
      record_id: {
        label: "记录",
        help: "object_name 内所共享记录的主键"
      },
      permission: {
        label: "权限",
        help: "链接持有者可对该记录执行的操作",
        options: {
          view: "查看",
          comment: "评论",
          edit: "编辑"
        }
      },
      audience: {
        label: "受众",
        help: "在令牌校验之上额外施加的访问限制层",
        options: {
          public: "公开（可被索引）",
          link_only: "任何持有链接的人",
          signed_in: "已登录用户",
          email: "指定邮箱"
        }
      },
      expires_at: {
        label: "过期时间",
        help: "设置后，超过此时间点 resolveToken 将返回 null"
      },
      email_allowlist: {
        label: "邮箱白名单",
        help: "当 audience=email 时校验的小写邮箱地址"
      },
      password_hash: {
        label: "密码哈希",
        help: "Argon2/bcrypt 哈希值。设置后，界面会在呈现内容前提示输入密码。"
      },
      redact_fields: {
        label: "按链接脱敏字段",
        help: "在对象默认脱敏集之上，从响应中额外剔除的字段"
      },
      label: {
        label: "标签",
        help: "在共享对话框中显示的自由文本（例如 \"ACME Q3 合同\"）"
      },
      revoked_at: {
        label: "撤销时间",
        help: "设置后，该链接将被永久停用"
      },
      created_by: {
        label: "创建人",
        help: "链接的签发者"
      },
      created_at: {
        label: "创建时间"
      },
      last_used_at: {
        label: "最近使用时间",
        help: "由 resolveToken 标记；仪表盘据此高亮显示活跃链接"
      },
      use_count: {
        label: "使用次数",
        help: "每次成功解析时由 resolveToken 递增"
      }
    },
    _views: {
      active_links: {
        label: "活跃"
      },
      by_me: {
        label: "我创建的"
      },
      revoked: {
        label: "已撤销"
      },
      all_links: {
        label: "全部"
      }
    }
  }
};
