|
1 | 1 | import type { INodeProperties } from 'n8n-workflow'; |
| 2 | + |
2 | 3 | const showOnly = { resource: ['wedoc'], operation: ['modDocShareScope'] }; |
3 | 4 |
|
4 | 5 | const authOptions = [ |
5 | | - { name: '只读', value: 1, description: '只能查看' }, |
6 | | - { name: '可编辑', value: 2, description: '可以编辑内容' }, |
| 6 | + { name: '只读', value: 1, description: '成员仅可查看内容' }, |
| 7 | + { name: '可编辑', value: 2, description: '成员可编辑内容,数据可被接口获取' }, |
7 | 8 | ]; |
8 | 9 |
|
9 | 10 | export const modDocShareScopeDescription: INodeProperties[] = [ |
10 | | - { displayName: '文档ID', name: 'docid', type: 'string', required: true, displayOptions: { show: showOnly }, default: '', description: '文档的docid' }, |
11 | 11 | { |
12 | | - displayName: '协作者权限列表', |
| 12 | + displayName: '文档ID', |
| 13 | + name: 'docid', |
| 14 | + type: 'string', |
| 15 | + required: true, |
| 16 | + displayOptions: { show: showOnly }, |
| 17 | + default: '', |
| 18 | + description: '操作的 docid,可用于文档、表格、智能表格', |
| 19 | + }, |
| 20 | + { |
| 21 | + displayName: '更新企业内成员加入规则', |
| 22 | + name: 'updateInternalJoinRule', |
| 23 | + type: 'boolean', |
| 24 | + displayOptions: { show: showOnly }, |
| 25 | + default: false, |
| 26 | + description: '开启后覆盖企业内成员的加入规则', |
| 27 | + }, |
| 28 | + { |
| 29 | + displayName: '允许企业内成员浏览', |
| 30 | + name: 'enable_corp_internal', |
| 31 | + type: 'boolean', |
| 32 | + displayOptions: { show: { ...showOnly, updateInternalJoinRule: [true] } }, |
| 33 | + default: true, |
| 34 | + description: '企业内成员主动查看文档后是否允许加入', |
| 35 | + }, |
| 36 | + { |
| 37 | + displayName: '企业内成员加入后权限', |
| 38 | + name: 'corp_internal_auth', |
| 39 | + type: 'options', |
| 40 | + displayOptions: { show: { ...showOnly, updateInternalJoinRule: [true] } }, |
| 41 | + default: 2, |
| 42 | + options: authOptions, |
| 43 | + description: '企业内成员主动查看后获得的权限', |
| 44 | + }, |
| 45 | + { |
| 46 | + displayName: '企业内成员仅管理员审批', |
| 47 | + name: 'corp_internal_approve_only_by_admin', |
| 48 | + type: 'boolean', |
| 49 | + displayOptions: { show: { ...showOnly, updateInternalJoinRule: [true] } }, |
| 50 | + default: false, |
| 51 | + description: '是否要求企业内成员加入时必须由管理员审批', |
| 52 | + }, |
| 53 | + { |
| 54 | + displayName: '更新企业外成员加入规则', |
| 55 | + name: 'updateExternalJoinRule', |
| 56 | + type: 'boolean', |
| 57 | + displayOptions: { show: showOnly }, |
| 58 | + default: false, |
| 59 | + description: '开启后覆盖企业外成员的加入规则', |
| 60 | + }, |
| 61 | + { |
| 62 | + displayName: '允许企业外成员浏览', |
| 63 | + name: 'enable_corp_external', |
| 64 | + type: 'boolean', |
| 65 | + displayOptions: { show: { ...showOnly, updateExternalJoinRule: [true] } }, |
| 66 | + default: false, |
| 67 | + description: '企业外成员主动查看文档后是否允许加入', |
| 68 | + }, |
| 69 | + { |
| 70 | + displayName: '企业外成员加入后权限', |
| 71 | + name: 'corp_external_auth', |
| 72 | + type: 'options', |
| 73 | + displayOptions: { show: { ...showOnly, updateExternalJoinRule: [true] } }, |
| 74 | + default: 1, |
| 75 | + options: authOptions, |
| 76 | + description: '企业外成员主动查看后获得的权限', |
| 77 | + }, |
| 78 | + { |
| 79 | + displayName: '企业外成员仅管理员审批', |
| 80 | + name: 'corp_external_approve_only_by_admin', |
| 81 | + type: 'boolean', |
| 82 | + displayOptions: { show: { ...showOnly, updateExternalJoinRule: [true] } }, |
| 83 | + default: true, |
| 84 | + description: '是否要求企业外成员加入时必须由管理员审批', |
| 85 | + }, |
| 86 | + { |
| 87 | + displayName: '更新禁止对外分享设置', |
| 88 | + name: 'updateBanShareExternal', |
| 89 | + type: 'boolean', |
| 90 | + displayOptions: { show: showOnly }, |
| 91 | + default: false, |
| 92 | + description: '开启后覆盖是否允许分享给企业外部人员', |
| 93 | + }, |
| 94 | + { |
| 95 | + displayName: '禁止对外分享', |
| 96 | + name: 'ban_share_external', |
| 97 | + type: 'boolean', |
| 98 | + displayOptions: { show: { ...showOnly, updateBanShareExternal: [true] } }, |
| 99 | + default: false, |
| 100 | + description: '是否禁止文档分享到企业外', |
| 101 | + }, |
| 102 | + { |
| 103 | + displayName: '更新特定部门加入权限', |
| 104 | + name: 'update_co_auth_list', |
| 105 | + type: 'boolean', |
| 106 | + displayOptions: { show: showOnly }, |
| 107 | + default: false, |
| 108 | + description: '开启后覆盖特定部门列表,留空列表时清空', |
| 109 | + }, |
| 110 | + { |
| 111 | + displayName: '特定部门列表', |
13 | 112 | name: 'coAuthCollection', |
14 | 113 | type: 'fixedCollection', |
15 | | - displayOptions: { show: showOnly }, |
| 114 | + displayOptions: { show: { ...showOnly, update_co_auth_list: [true] } }, |
16 | 115 | default: {}, |
17 | | - placeholder: '添加协作者', |
| 116 | + placeholder: '添加部门', |
18 | 117 | typeOptions: { multipleValues: true }, |
19 | | - description: '设置协作者的权限', |
| 118 | + description: '指定文档查看权限的部门列表,留空表示清空', |
20 | 119 | options: [ |
21 | 120 | { |
22 | | - displayName: '协作者', |
23 | | - name: 'members', |
| 121 | + displayName: '部门', |
| 122 | + name: 'departments', |
24 | 123 | values: [ |
25 | | - { |
26 | | - displayName: '类型', |
27 | | - name: 'type', |
28 | | - type: 'options', |
29 | | - default: 1, |
30 | | - options: [ |
31 | | - { name: '成员', value: 1, description: '企业成员' }, |
32 | | - { name: '部门', value: 2, description: '企业部门' }, |
33 | | - ], |
34 | | - description: '协作者类型', |
35 | | - }, |
36 | | - { |
37 | | - displayName: '成员UserID', |
38 | | - name: 'userid', |
39 | | - type: 'string', |
40 | | - default: '', |
41 | | - displayOptions: { show: { type: [1] } }, |
42 | | - description: '企业成员的UserID', |
43 | | - }, |
44 | 124 | { |
45 | 125 | displayName: '部门ID', |
46 | 126 | name: 'departmentid', |
47 | 127 | type: 'number', |
48 | 128 | default: 0, |
49 | | - displayOptions: { show: { type: [2] } }, |
50 | | - |
| 129 | + description: '部门 ID', |
51 | 130 | }, |
52 | 131 | { |
53 | 132 | displayName: '权限', |
54 | 133 | name: 'auth', |
55 | 134 | type: 'options', |
56 | 135 | default: 1, |
57 | 136 | options: authOptions, |
58 | | - description: '协作权限级别', |
| 137 | + description: '部门加入后获得的权限', |
59 | 138 | }, |
60 | 139 | ], |
61 | 140 | }, |
62 | 141 | ], |
63 | 142 | }, |
64 | | - { |
65 | | - displayName: '只读时允许复制', |
66 | | - name: 'enable_readonly_copy', |
67 | | - type: 'boolean', |
68 | | - displayOptions: { show: showOnly }, |
69 | | - default: true, |
70 | | - description: '是否允许在只读情况下复制内容', |
71 | | - }, |
72 | | - { |
73 | | - displayName: '禁止对外分享', |
74 | | - name: 'ban_share_external', |
75 | | - type: 'boolean', |
76 | | - displayOptions: { show: showOnly }, |
77 | | - default: false, |
78 | | - description: '是否禁止将文档分享给企业外部人员', |
79 | | - }, |
80 | | - { |
81 | | - displayName: '链接分享范围', |
82 | | - name: 'share_scope', |
83 | | - type: 'options', |
84 | | - displayOptions: { show: showOnly }, |
85 | | - default: 1, |
86 | | - options: [ |
87 | | - { name: '仅指定成员可访问', value: 1 }, |
88 | | - { name: '企业内获得链接的人可访问', value: 2 }, |
89 | | - { name: '任何人获得链接都可访问', value: 3 }, |
90 | | - ], |
91 | | - description: '通过链接分享时的访问范围', |
92 | | - }, |
93 | 143 | ]; |
0 commit comments