@tager/admin-administrators 0.2.6 → 1.0.1

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 (52) hide show
  1. package/dist/constants/paths.d.ts +6 -6
  2. package/dist/constants/routes.d.ts +5 -5
  3. package/dist/dev/App.vue.d.ts +5 -0
  4. package/dist/dev/config.d.ts +2 -0
  5. package/dist/dev/env.d.ts +1 -0
  6. package/dist/dev/main.d.ts +3 -0
  7. package/dist/index.mjs +940 -0
  8. package/dist/locales/apply.d.ts +1 -0
  9. package/dist/locales/en.d.ts +44 -41
  10. package/dist/locales/ru.d.ts +2 -3
  11. package/dist/main.d.ts +3 -3
  12. package/dist/services/requests.d.ts +36 -32
  13. package/dist/style.css +1 -0
  14. package/dist/typings/model.d.ts +27 -25
  15. package/dist/utils/paths.d.ts +8 -8
  16. package/dist/views/AdminForm/AdminForm.helpers.d.ts +15 -14
  17. package/dist/views/AdminForm/AdminForm.vue.d.ts +2686 -61
  18. package/dist/views/AdminForm/index.d.ts +1 -1
  19. package/dist/views/AdminList/AdminList.vue.d.ts +14 -33
  20. package/dist/views/AdminList/index.d.ts +1 -1
  21. package/dist/views/RoleForm/RoleForm.helpers.d.ts +13 -13
  22. package/dist/views/RoleForm/RoleForm.vue.d.ts +24 -59
  23. package/dist/views/RoleForm/index.d.ts +1 -1
  24. package/dist/views/RoleList/RoleList.vue.d.ts +20 -46
  25. package/dist/views/RoleList/index.d.ts +1 -1
  26. package/package.json +52 -50
  27. package/src/constants/routes.ts +19 -19
  28. package/src/dev/App.vue +57 -0
  29. package/src/dev/config.ts +23 -0
  30. package/src/dev/env.ts +17 -0
  31. package/src/dev/main.ts +50 -0
  32. package/src/locales/apply.ts +9 -0
  33. package/src/locales/en.ts +6 -3
  34. package/src/locales/ru.ts +6 -4
  35. package/src/main.ts +5 -9
  36. package/src/services/requests.ts +13 -0
  37. package/src/typings/model.ts +3 -0
  38. package/src/views/AdminForm/AdminForm.helpers.ts +10 -3
  39. package/src/views/AdminForm/AdminForm.vue +136 -43
  40. package/src/views/AdminList/AdminList.vue +54 -49
  41. package/src/views/RoleForm/RoleForm.vue +86 -81
  42. package/src/views/RoleList/RoleList.vue +78 -64
  43. package/CHANGELOG.md +0 -0
  44. package/dist/dev.d.ts +0 -1
  45. package/dist/index.esm.js +0 -1336
  46. package/dist/index.umd.js +0 -1359
  47. package/src/config/config.json +0 -20
  48. package/src/dev.ts +0 -51
  49. package/src/typings/sfc.d.ts +0 -12
  50. package/src/typings/shims-tsx.d.ts +0 -13
  51. package/src/typings/shims-vue.d.ts +0 -11
  52. package/src/views/App.vue +0 -52
@@ -0,0 +1 @@
1
+ export declare function applyTranslations(): void;
@@ -1,41 +1,44 @@
1
- declare const EN: {
2
- home: string;
3
- administrators: string;
4
- role: string;
5
- roles: string;
6
- admin: string;
7
- admins: string;
8
- createRole: string;
9
- createAdmin: string;
10
- createAdministrator: string;
11
- edit: string;
12
- delete: string;
13
- email: string;
14
- actions: string;
15
- updateRole: string;
16
- updateAdmin: string;
17
- password: string;
18
- newPassword: string;
19
- name: string;
20
- success: string;
21
- adminSuccessfullyCreated: string;
22
- adminSuccessfullyUpdated: string;
23
- error: string;
24
- adminCreationError: string;
25
- adminUpdateError: string;
26
- listOfRoles: string;
27
- addRole: string;
28
- noPrivileges: string;
29
- privileges: string;
30
- all: string;
31
- roleSuccessfullyCreated: string;
32
- roleSuccessfullyUpdate: string;
33
- roleCreationError: string;
34
- roleUpdateError: string;
35
- adminList: string;
36
- adminForm: string;
37
- roleList: string;
38
- roleForm: string;
39
- andMorePrivilege: string;
40
- };
41
- export default EN;
1
+ export declare const EN: {
2
+ home: string;
3
+ administrators: string;
4
+ role: string;
5
+ roles: string;
6
+ admin: string;
7
+ admins: string;
8
+ createRole: string;
9
+ createAdmin: string;
10
+ createAdministrator: string;
11
+ edit: string;
12
+ delete: string;
13
+ email: string;
14
+ actions: string;
15
+ updateRole: string;
16
+ updateAdmin: string;
17
+ password: string;
18
+ newPassword: string;
19
+ name: string;
20
+ success: string;
21
+ adminSuccessfullyCreated: string;
22
+ adminSuccessfullyUpdated: string;
23
+ error: string;
24
+ adminCreationError: string;
25
+ adminUpdateError: string;
26
+ listOfRoles: string;
27
+ addRole: string;
28
+ noPrivileges: string;
29
+ privileges: string;
30
+ all: string;
31
+ roleSuccessfullyCreated: string;
32
+ roleSuccessfullyUpdate: string;
33
+ roleCreationError: string;
34
+ roleUpdateError: string;
35
+ adminList: string;
36
+ adminForm: string;
37
+ roleList: string;
38
+ roleForm: string;
39
+ andMorePrivilege: string;
40
+ tabs: {
41
+ general: string;
42
+ params: string;
43
+ };
44
+ };
@@ -1,3 +1,2 @@
1
- import EN from './en';
2
- declare const RU: typeof EN;
3
- export default RU;
1
+ import { EN } from './en';
2
+ export declare const RU: typeof EN;
package/dist/main.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './constants/routes';
2
- export * from './services/requests';
3
- export * from './utils/paths';
1
+ export * from "./constants/routes";
2
+ export * from "./utils/paths";
3
+ export * from "./services/requests";
@@ -1,32 +1,36 @@
1
- import { ResponseBody } from '@tager/admin-services';
2
- import { AdminType, RoleType, ScopeGroupsData } from '../typings/model';
3
- declare type SuccessData = {
4
- success: boolean;
5
- };
6
- /** Roles */
7
- export declare function getRoleList(): Promise<ResponseBody<Array<RoleType>>>;
8
- export declare function getRole(roleId: string | number): Promise<ResponseBody<RoleType>>;
9
- export declare type RoleCreationPayload = {
10
- name: string;
11
- scopes: Array<string>;
12
- };
13
- export declare function createRole(payload: RoleCreationPayload): Promise<ResponseBody<RoleType>>;
14
- export declare type RoleUpdatePayload = RoleCreationPayload;
15
- export declare function updateRole(roleId: string | number, payload: RoleUpdatePayload): Promise<ResponseBody<RoleType>>;
16
- export declare function deleteRole(roleId: string | number): Promise<SuccessData>;
17
- /** Scopes */
18
- export declare function getScopes(): Promise<ResponseBody<ScopeGroupsData>>;
19
- /** Admin */
20
- export declare function getAdminList(): Promise<ResponseBody<Array<AdminType>>>;
21
- export declare function getAdmin(adminId: string | number): Promise<ResponseBody<AdminType>>;
22
- export declare type AdminUpdatePayload = {
23
- name: string;
24
- email: string;
25
- roles: Array<number>;
26
- password: string;
27
- };
28
- export declare type AdminCreationPayload = AdminUpdatePayload;
29
- export declare function createAdmin(payload: AdminCreationPayload): Promise<ResponseBody<AdminType>>;
30
- export declare function updateAdmin(adminId: string | number, payload: AdminUpdatePayload): Promise<ResponseBody<AdminType>>;
31
- export declare function deleteAdmin(adminId: string | number): Promise<SuccessData>;
32
- export {};
1
+ import { ResponseBody } from '@tager/admin-services';
2
+ import { FieldConfigUnion, FieldShortType, OutgoingValueUnion } from '@tager/admin-dynamic-field';
3
+ import { AdminType, RoleType, ScopeGroupsData } from '../typings/model';
4
+ declare type SuccessData = {
5
+ success: boolean;
6
+ };
7
+ /** Fields */
8
+ export declare function getFieldList(): Promise<ResponseBody<Array<FieldConfigUnion>>>;
9
+ /** Roles */
10
+ export declare function getRoleList(): Promise<ResponseBody<Array<RoleType>>>;
11
+ export declare function getRole(roleId: string | number): Promise<ResponseBody<RoleType>>;
12
+ export declare type RoleCreationPayload = {
13
+ name: string;
14
+ scopes: Array<string>;
15
+ };
16
+ export declare function createRole(payload: RoleCreationPayload): Promise<ResponseBody<RoleType>>;
17
+ export declare type RoleUpdatePayload = RoleCreationPayload;
18
+ export declare function updateRole(roleId: string | number, payload: RoleUpdatePayload): Promise<ResponseBody<RoleType>>;
19
+ export declare function deleteRole(roleId: string | number): Promise<SuccessData>;
20
+ /** Scopes */
21
+ export declare function getScopes(): Promise<ResponseBody<ScopeGroupsData>>;
22
+ /** Admin */
23
+ export declare function getAdminList(): Promise<ResponseBody<Array<AdminType>>>;
24
+ export declare function getAdmin(adminId: string | number): Promise<ResponseBody<AdminType>>;
25
+ export declare type AdminUpdatePayload = {
26
+ name: string;
27
+ email: string;
28
+ roles: Array<number>;
29
+ password: string;
30
+ params: Array<FieldShortType<OutgoingValueUnion>>;
31
+ };
32
+ export declare type AdminCreationPayload = AdminUpdatePayload;
33
+ export declare function createAdmin(payload: AdminCreationPayload): Promise<ResponseBody<AdminType>>;
34
+ export declare function updateAdmin(adminId: string | number, payload: AdminUpdatePayload): Promise<ResponseBody<AdminType>>;
35
+ export declare function deleteAdmin(adminId: string | number): Promise<SuccessData>;
36
+ export {};
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .no-scopes{font-style:italic}.scope-group{margin-bottom:.5rem}.module-name{display:block;font-weight:700;margin-bottom:.3rem}.scope-list{padding-left:1rem}.rest-scopes-text{padding-left:35px}[data-v-501ddc14] [data-multi-select-list]{max-height:500px}
@@ -1,25 +1,27 @@
1
- export declare type ScopeType = {
2
- readonly value: string;
3
- readonly label: string;
4
- readonly module: string;
5
- };
6
- export declare type RoleType = {
7
- readonly id: number;
8
- readonly name: string;
9
- readonly isSuperAdmin: boolean;
10
- readonly scopes: Array<ScopeType>;
11
- };
12
- export declare type ScopeGroupsData = {
13
- readonly groups: Array<{
14
- readonly name: string;
15
- readonly scopes: Array<ScopeType>;
16
- }>;
17
- };
18
- export declare type AdminType = {
19
- readonly id: number;
20
- readonly name: string;
21
- readonly email: string;
22
- readonly roles: Array<RoleType>;
23
- readonly isSelf: boolean;
24
- readonly isSuperAdmin: boolean;
25
- };
1
+ import { FieldShortType, IncomingValueUnion } from '@tager/admin-dynamic-field';
2
+ export declare type ScopeType = {
3
+ readonly value: string;
4
+ readonly label: string;
5
+ readonly module: string;
6
+ };
7
+ export declare type RoleType = {
8
+ readonly id: number;
9
+ readonly name: string;
10
+ readonly isSuperAdmin: boolean;
11
+ readonly scopes: Array<ScopeType>;
12
+ };
13
+ export declare type ScopeGroupsData = {
14
+ readonly groups: Array<{
15
+ readonly name: string;
16
+ readonly scopes: Array<ScopeType>;
17
+ }>;
18
+ };
19
+ export declare type AdminType = {
20
+ readonly id: number;
21
+ readonly name: string;
22
+ readonly email: string;
23
+ readonly roles: Array<RoleType>;
24
+ readonly isSelf: boolean;
25
+ readonly isSuperAdmin: boolean;
26
+ readonly params: Array<FieldShortType<IncomingValueUnion>>;
27
+ };
@@ -1,8 +1,8 @@
1
- export declare function getRoleListUrl(): "/roles";
2
- export declare function getRoleFormUrl(params: {
3
- roleId: string | number;
4
- }): string;
5
- export declare function getAdminListUrl(): "/admins";
6
- export declare function getAdminFormUrl(params: {
7
- adminId: string | number;
8
- }): string;
1
+ export declare function getRoleListUrl(): "/roles";
2
+ export declare function getRoleFormUrl(params: {
3
+ roleId: string | number;
4
+ }): string;
5
+ export declare function getAdminListUrl(): "/admins";
6
+ export declare function getAdminFormUrl(params: {
7
+ adminId: string | number;
8
+ }): string;
@@ -1,14 +1,15 @@
1
- import { Nullable } from '@tager/admin-services';
2
- import { OptionType } from '@tager/admin-ui';
3
- import { AdminType, RoleType } from '../../typings/model';
4
- import { AdminCreationPayload, AdminUpdatePayload } from '../../services/requests';
5
- export declare type FormValues = {
6
- name: string;
7
- email: string;
8
- password: string;
9
- roles: Array<OptionType<number>>;
10
- };
11
- export declare function convertAdminToFormValues(admin: Nullable<AdminType>, roleOptionList: Array<OptionType<number>>): FormValues;
12
- export declare function convertFormValuesToAdminUpdatePayload(values: FormValues): AdminUpdatePayload;
13
- export declare function convertFormValuesToAdminCreationPayload(values: FormValues): AdminCreationPayload;
14
- export declare function convertRoleListToOptions(roleList: Array<RoleType>): Array<OptionType<number>>;
1
+ import { Nullable } from '@tager/admin-services';
2
+ import { OptionType } from '@tager/admin-ui';
3
+ import { FieldUnion } from '@tager/admin-dynamic-field';
4
+ import { AdminType, RoleType } from '../../typings/model';
5
+ import { AdminCreationPayload, AdminUpdatePayload } from '../../services/requests';
6
+ export declare type FormValues = {
7
+ name: string;
8
+ email: string;
9
+ password: string;
10
+ roles: Array<OptionType<number>>;
11
+ };
12
+ export declare function convertAdminToFormValues(admin: Nullable<AdminType>, roleOptionList: Array<OptionType<number>>): FormValues;
13
+ export declare function convertFormValuesToAdminUpdatePayload(values: FormValues, paramsValues?: Array<FieldUnion>): AdminUpdatePayload;
14
+ export declare function convertFormValuesToAdminCreationPayload(values: FormValues, paramsValues?: Array<FieldUnion>): AdminCreationPayload;
15
+ export declare function convertRoleListToOptions(roleList: Array<RoleType>): Array<OptionType<number>>;