Files
NianToB/tests/fixtures/yinian-server-contract.ts

148 lines
3.5 KiB
TypeScript

export const yinianContractFixtures = {
login: {
accessToken: 'access_demo',
refreshToken: 'refresh_demo',
accessTokenExpiresAt: 1777188600000,
user: {
id: 'user_ops_001',
name: '王管理员',
phone: '13800000000',
email: 'ops@example.com',
avatar: 'https://cdn.example.com/avatar.png',
},
hotels: [
{
id: 'workspace_hangzhou_ops',
name: '智念企业组织空间',
brand: '智念',
},
{
hotel_id: 'workspace_shanghai_growth',
name: '智念增长组织空间',
},
],
current_hotel_id: 'workspace_hangzhou_ops',
},
refresh: {
access_token: 'access_refreshed',
refresh_token: 'refresh_rotated',
access_token_expires_at: 1777189500000,
user: {
id: 'user_ops_001',
name: '王管理员',
},
hotels: [
{
id: 'workspace_hangzhou_ops',
name: '智念企业组织空间',
},
],
current_hotel_id: 'workspace_hangzhou_ops',
},
me: {
user: {
id: 'user_ops_001',
name: '王管理员',
phone: '13800000000',
email: 'ops@example.com',
avatar: 'https://cdn.example.com/avatar.png',
ignored: 'server-can-add-fields',
},
hotels: [
{
id: 'workspace_hangzhou_ops',
name: '智念企业组织空间',
brand: '智念',
},
{
hotel_id: 'workspace_shanghai_growth',
name: '智念增长组织空间',
},
],
current_hotel_id: 'workspace_hangzhou_ops',
access_token_expires_at: 1777188600000,
},
config: {
server_time: 1777188000000,
hotel: {
hotel_id: 'workspace_hangzhou_ops',
name: '智念企业组织空间',
brand: '智念',
},
entitlements: [
{
skill_id: 'daily-report',
name: '日报生成助手',
version: '1.0.0',
enabled: true,
category: 'reporting',
triggers: ['scheduled', 'manual', 'unknown-trigger'],
last_run_at: 1777184400000,
},
{
skillId: 'unknown-category-skill',
name: '未知分类技能',
version: '0.1.0',
enabled: true,
category: 'future-category',
triggers: ['webhook'],
},
],
notification_channels: [
{
id: 'wechat_ops',
kind: 'wecom',
label: '业务通知群',
recipient: 'room_001',
enabled: true,
source: 'nianxx',
},
{
id: 'kernel_email',
kind: 'email',
label: '财务邮箱',
recipient: 'finance@example.com',
enabled: false,
source: 'kernel',
},
],
feature_flags: {
skillsSync: true,
advancedSettings: false,
ignoredString: 'yes',
},
ui_policy: {
default_page: 'today',
show_advanced_settings: true,
},
},
manifest: {
serverTime: 1777188000000,
hotelId: 'workspace_hangzhou_ops',
manifestVersion: '2026.04.26.1',
skills: [
{
skill_id: 'data-check',
name: '数据检查助手',
version: '1.2.0',
enabled: true,
bundle_sha256: 'sha256-demo',
bundleUrl: 'https://cdn.example.com/skills/data-check-1.2.0.tgz',
},
{
skillId: 'customer-reply-helper',
name: '客户回复助手',
version: '0.9.0',
enabled: false,
bundleSha256: 'sha256-disabled',
},
],
},
error: {
error: {
code: 'SESSION_EXPIRED',
message: 'Session expired',
},
},
} as const;