@nocobase/plugin-departments 1.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/LICENSE.txt +161 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/ResourcesProvider.d.ts +20 -0
  6. package/dist/client/collections/departments.d.ts +144 -0
  7. package/dist/client/collections/users.d.ts +205 -0
  8. package/dist/client/components/DepartmentOwnersField.d.ts +18 -0
  9. package/dist/client/components/ReadOnlyAssociationField.d.ts +18 -0
  10. package/dist/client/components/UserDepartmentsField.d.ts +18 -0
  11. package/dist/client/components/UserMainDepartmentField.d.ts +18 -0
  12. package/dist/client/components/fieldSettings.d.ts +22 -0
  13. package/dist/client/components/index.d.ts +20 -0
  14. package/dist/client/departments/AggregateSearch.d.ts +18 -0
  15. package/dist/client/departments/Department.d.ts +45 -0
  16. package/dist/client/departments/DepartmentBlock.d.ts +18 -0
  17. package/dist/client/departments/DepartmentField.d.ts +18 -0
  18. package/dist/client/departments/DepartmentManagement.d.ts +18 -0
  19. package/dist/client/departments/DepartmentOwnersField.d.ts +10 -0
  20. package/dist/client/departments/DepartmentTable.d.ts +18 -0
  21. package/dist/client/departments/DepartmentTree.d.ts +30 -0
  22. package/dist/client/departments/DepartmentTreeSelect.d.ts +24 -0
  23. package/dist/client/departments/IsOwnerField.d.ts +18 -0
  24. package/dist/client/departments/Member.d.ts +19 -0
  25. package/dist/client/departments/NewDepartment.d.ts +10 -0
  26. package/dist/client/departments/UserDepartmentsField.d.ts +10 -0
  27. package/dist/client/departments/schemas/departments.d.ts +257 -0
  28. package/dist/client/departments/schemas/users.d.ts +443 -0
  29. package/dist/client/hooks/departments-manager.d.ts +37 -0
  30. package/dist/client/hooks/index.d.ts +18 -0
  31. package/dist/client/hooks/tree-manager.d.ts +38 -0
  32. package/dist/client/hooks/useTableBlockProps.d.ts +28 -0
  33. package/dist/client/index.d.ts +23 -0
  34. package/dist/client/index.js +10 -0
  35. package/dist/client/locale.d.ts +9 -0
  36. package/dist/client/roles/RoleDepartmentsManager.d.ts +18 -0
  37. package/dist/client/roles/schemas/departments.d.ts +235 -0
  38. package/dist/client/utils.d.ts +17 -0
  39. package/dist/externalVersion.js +29 -0
  40. package/dist/index.d.ts +18 -0
  41. package/dist/index.js +48 -0
  42. package/dist/locale/en-US.json +35 -0
  43. package/dist/locale/zh-CN.json +35 -0
  44. package/dist/server/actions/departments.d.ts +21 -0
  45. package/dist/server/actions/departments.js +114 -0
  46. package/dist/server/actions/users.d.ts +20 -0
  47. package/dist/server/actions/users.js +151 -0
  48. package/dist/server/collections/departmentRoles.d.ts +10 -0
  49. package/dist/server/collections/departmentRoles.js +37 -0
  50. package/dist/server/collections/departments.d.ts +37 -0
  51. package/dist/server/collections/departments.js +172 -0
  52. package/dist/server/collections/departmentsUsers.d.ts +10 -0
  53. package/dist/server/collections/departmentsUsers.js +53 -0
  54. package/dist/server/collections/roles.d.ts +14 -0
  55. package/dist/server/collections/roles.js +48 -0
  56. package/dist/server/collections/users.d.ts +67 -0
  57. package/dist/server/collections/users.js +96 -0
  58. package/dist/server/department-data-sync-resource.d.ts +27 -0
  59. package/dist/server/department-data-sync-resource.js +339 -0
  60. package/dist/server/index.d.ts +17 -0
  61. package/dist/server/index.js +42 -0
  62. package/dist/server/middlewares/destroy-department-check.d.ts +18 -0
  63. package/dist/server/middlewares/destroy-department-check.js +62 -0
  64. package/dist/server/middlewares/index.d.ts +22 -0
  65. package/dist/server/middlewares/index.js +40 -0
  66. package/dist/server/middlewares/reset-user-departments-cache.d.ts +18 -0
  67. package/dist/server/middlewares/reset-user-departments-cache.js +48 -0
  68. package/dist/server/middlewares/set-department-owners.d.ts +18 -0
  69. package/dist/server/middlewares/set-department-owners.js +83 -0
  70. package/dist/server/middlewares/set-departments-roles.d.ts +18 -0
  71. package/dist/server/middlewares/set-departments-roles.js +71 -0
  72. package/dist/server/middlewares/set-main-department.d.ts +18 -0
  73. package/dist/server/middlewares/set-main-department.js +114 -0
  74. package/dist/server/middlewares/update-department-isleaf.d.ts +18 -0
  75. package/dist/server/middlewares/update-department-isleaf.js +93 -0
  76. package/dist/server/migrations/update-field-uischemas-20240307124823.d.ts +20 -0
  77. package/dist/server/migrations/update-field-uischemas-20240307124823.js +106 -0
  78. package/dist/server/models/department.d.ts +20 -0
  79. package/dist/server/models/department.js +47 -0
  80. package/dist/server/plugin.d.ts +19 -0
  81. package/dist/server/plugin.js +154 -0
  82. package/package.json +22 -0
  83. package/server.d.ts +2 -0
  84. package/server.js +1 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const DepartmentTreeContext: React.Context<{
19
+ loadData: ({ key, children }: {
20
+ key: any;
21
+ children: any;
22
+ }) => Promise<void>;
23
+ getByKeyword: (keyword: string) => Promise<void>;
24
+ initData: (data: any[]) => void;
25
+ treeData: any[];
26
+ setTreeData: React.Dispatch<React.SetStateAction<any[]>>;
27
+ nodeMap: {};
28
+ updateTreeData: (key: any, children: any[]) => any;
29
+ constructTreeData: (nodeMap: {
30
+ [parentId: string]: any;
31
+ [parentId: number]: any;
32
+ }) => any;
33
+ getChildrenIds: (id: any) => any[];
34
+ loadedKeys: any[];
35
+ setLoadedKeys: React.Dispatch<React.SetStateAction<any[]>>;
36
+ expandedKeys: any[];
37
+ setExpandedKeys: React.Dispatch<React.SetStateAction<any[]>>;
38
+ }>;
39
+ export declare const useCreateDepartment: () => {
40
+ run(): Promise<void>;
41
+ };
42
+ export declare const useUpdateDepartment: () => {
43
+ run(): Promise<void>;
44
+ };
45
+ export declare const Department: React.FC;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const DepartmentBlock: React.FC;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const DepartmentField: React.FC;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const DepartmentManagement: React.FC;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const DepartmentOwnersField: React.FC;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const useFilterActionProps: () => {
11
+ options: any[];
12
+ onSubmit: (values: any) => Promise<void>;
13
+ onReset(): void;
14
+ };
15
+ export declare const DepartmentTable: React.FC<{
16
+ useDataSource: any;
17
+ useDisabled?: (record: any) => boolean;
18
+ }>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ type DepartmentTreeProps = {
19
+ node: {
20
+ id: number;
21
+ title: string;
22
+ parent?: any;
23
+ };
24
+ setVisible: (visible: boolean) => void;
25
+ setDrawer: (schema: any) => void;
26
+ };
27
+ export declare const DepartmentTree: React.FC & {
28
+ Item: React.FC<DepartmentTreeProps>;
29
+ };
30
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const DepartmentTreeSelect: React.FC<{
19
+ originData: any;
20
+ treeData: any[];
21
+ [key: string]: any;
22
+ }>;
23
+ export declare const DepartmentSelect: React.FC;
24
+ export declare const SuperiorDepartmentSelect: React.FC;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const IsOwnerField: React.FC;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import React from 'react';
18
+ export declare const AddMembers: React.FC;
19
+ export declare const Member: React.FC;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const NewDepartment: React.FC;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const UserDepartmentsField: React.FC;
@@ -0,0 +1,257 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const newSubDepartmentSchema: {
10
+ type: string;
11
+ properties: {
12
+ [x: string]: {
13
+ type: string;
14
+ 'x-component': string;
15
+ 'x-decorator': string;
16
+ 'x-decorator-props': {
17
+ useValues(options: any): import("@nocobase/client").UseRequestResult<unknown>;
18
+ };
19
+ title: string;
20
+ properties: {
21
+ title: {
22
+ 'x-component': string;
23
+ 'x-decorator': string;
24
+ };
25
+ parent: {
26
+ 'x-component': string;
27
+ 'x-decorator': string;
28
+ 'x-collection-field': string;
29
+ 'x-component-props': {
30
+ component: string;
31
+ };
32
+ };
33
+ roles: {
34
+ 'x-component': string;
35
+ 'x-decorator': string;
36
+ 'x-collection-field': string;
37
+ };
38
+ footer: {
39
+ type: string;
40
+ 'x-component': string;
41
+ properties: {
42
+ cancel: {
43
+ title: string;
44
+ 'x-component': string;
45
+ 'x-component-props': {
46
+ useAction: string;
47
+ };
48
+ };
49
+ submit: {
50
+ title: string;
51
+ 'x-component': string;
52
+ 'x-component-props': {
53
+ type: string;
54
+ useAction: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ };
60
+ };
61
+ };
62
+ };
63
+ export declare const editDepartmentSchema: {
64
+ type: string;
65
+ properties: {
66
+ [x: string]: {
67
+ type: string;
68
+ 'x-component': string;
69
+ 'x-decorator': string;
70
+ 'x-decorator-props': {
71
+ useValues(options: any): import("@nocobase/client").UseRequestResult<unknown>;
72
+ };
73
+ title: string;
74
+ properties: {
75
+ title: {
76
+ 'x-component': string;
77
+ 'x-decorator': string;
78
+ };
79
+ parent: {
80
+ 'x-component': string;
81
+ 'x-decorator': string;
82
+ 'x-collection-field': string;
83
+ 'x-component-props': {
84
+ component: string;
85
+ };
86
+ };
87
+ roles: {
88
+ 'x-component': string;
89
+ 'x-decorator': string;
90
+ 'x-collection-field': string;
91
+ };
92
+ owners: {
93
+ title: string;
94
+ 'x-component': string;
95
+ 'x-decorator': string;
96
+ };
97
+ footer: {
98
+ type: string;
99
+ 'x-component': string;
100
+ properties: {
101
+ cancel: {
102
+ title: string;
103
+ 'x-component': string;
104
+ 'x-component-props': {
105
+ useAction: string;
106
+ };
107
+ };
108
+ submit: {
109
+ title: string;
110
+ 'x-component': string;
111
+ 'x-component-props': {
112
+ type: string;
113
+ useAction: string;
114
+ };
115
+ };
116
+ };
117
+ };
118
+ };
119
+ };
120
+ };
121
+ };
122
+ export declare const departmentOwnersSchema: {
123
+ type: string;
124
+ properties: {
125
+ drawer: {
126
+ title: string;
127
+ 'x-component': string;
128
+ properties: {
129
+ resource: {
130
+ type: string;
131
+ 'x-decorator': string;
132
+ 'x-component': string;
133
+ properties: {
134
+ actions: {
135
+ type: string;
136
+ 'x-component': string;
137
+ 'x-component-props': {
138
+ style: {
139
+ marginBottom: number;
140
+ };
141
+ };
142
+ properties: {
143
+ filter: {
144
+ type: string;
145
+ title: string;
146
+ default: {
147
+ $and: ({
148
+ username: {
149
+ $includes: string;
150
+ };
151
+ nickname?: undefined;
152
+ } | {
153
+ nickname: {
154
+ $includes: string;
155
+ };
156
+ username?: undefined;
157
+ })[];
158
+ };
159
+ 'x-action': string;
160
+ 'x-component': string;
161
+ 'x-use-component-props': string;
162
+ 'x-component-props': {
163
+ icon: string;
164
+ };
165
+ 'x-align': string;
166
+ };
167
+ };
168
+ };
169
+ table: {
170
+ type: string;
171
+ 'x-component': string;
172
+ 'x-component-props': {
173
+ rowKey: string;
174
+ rowSelection: {
175
+ type: string;
176
+ onChange: string;
177
+ };
178
+ useDataSource: string;
179
+ };
180
+ properties: {
181
+ username: {
182
+ type: string;
183
+ 'x-decorator': string;
184
+ 'x-component': string;
185
+ properties: {
186
+ username: {
187
+ type: string;
188
+ 'x-component': string;
189
+ 'x-read-pretty': boolean;
190
+ };
191
+ };
192
+ };
193
+ nickname: {
194
+ type: string;
195
+ 'x-decorator': string;
196
+ 'x-component': string;
197
+ properties: {
198
+ nickname: {
199
+ type: string;
200
+ 'x-component': string;
201
+ 'x-read-pretty': boolean;
202
+ };
203
+ };
204
+ };
205
+ phone: {
206
+ type: string;
207
+ 'x-decorator': string;
208
+ 'x-component': string;
209
+ properties: {
210
+ phone: {
211
+ type: string;
212
+ 'x-component': string;
213
+ 'x-read-pretty': boolean;
214
+ };
215
+ };
216
+ };
217
+ email: {
218
+ type: string;
219
+ 'x-decorator': string;
220
+ 'x-component': string;
221
+ properties: {
222
+ email: {
223
+ type: string;
224
+ 'x-component': string;
225
+ 'x-read-pretty': boolean;
226
+ };
227
+ };
228
+ };
229
+ };
230
+ };
231
+ };
232
+ };
233
+ footer: {
234
+ type: string;
235
+ 'x-component': string;
236
+ properties: {
237
+ cancel: {
238
+ title: string;
239
+ 'x-component': string;
240
+ 'x-component-props': {
241
+ useAction: string;
242
+ };
243
+ };
244
+ confirm: {
245
+ title: string;
246
+ 'x-component': string;
247
+ 'x-component-props': {
248
+ type: string;
249
+ useAction: string;
250
+ };
251
+ };
252
+ };
253
+ };
254
+ };
255
+ };
256
+ };
257
+ };