@tager/admin-administrators 1.0.0 → 1.0.2

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.
@@ -37,4 +37,8 @@ export declare const EN: {
37
37
  roleList: string;
38
38
  roleForm: string;
39
39
  andMorePrivilege: string;
40
+ tabs: {
41
+ general: string;
42
+ params: string;
43
+ };
40
44
  };
@@ -1,17 +1,20 @@
1
- import { ResponseBody } from '@tager/admin-services';
2
- import { AdminType, RoleType, ScopeGroupsData } from '../typings/model';
3
- declare type SuccessData = {
1
+ import { type ResponseBody } from '@tager/admin-services';
2
+ import { type FieldConfigUnion, type FieldShortType, type OutgoingValueUnion } from '@tager/admin-dynamic-field';
3
+ import { type AdminType, type RoleType, type ScopeGroupsData } from '../typings/model';
4
+ type SuccessData = {
4
5
  success: boolean;
5
6
  };
7
+ /** Fields */
8
+ export declare function getFieldList(): Promise<ResponseBody<Array<FieldConfigUnion>>>;
6
9
  /** Roles */
7
10
  export declare function getRoleList(): Promise<ResponseBody<Array<RoleType>>>;
8
11
  export declare function getRole(roleId: string | number): Promise<ResponseBody<RoleType>>;
9
- export declare type RoleCreationPayload = {
12
+ export type RoleCreationPayload = {
10
13
  name: string;
11
14
  scopes: Array<string>;
12
15
  };
13
16
  export declare function createRole(payload: RoleCreationPayload): Promise<ResponseBody<RoleType>>;
14
- export declare type RoleUpdatePayload = RoleCreationPayload;
17
+ export type RoleUpdatePayload = RoleCreationPayload;
15
18
  export declare function updateRole(roleId: string | number, payload: RoleUpdatePayload): Promise<ResponseBody<RoleType>>;
16
19
  export declare function deleteRole(roleId: string | number): Promise<SuccessData>;
17
20
  /** Scopes */
@@ -19,13 +22,14 @@ export declare function getScopes(): Promise<ResponseBody<ScopeGroupsData>>;
19
22
  /** Admin */
20
23
  export declare function getAdminList(): Promise<ResponseBody<Array<AdminType>>>;
21
24
  export declare function getAdmin(adminId: string | number): Promise<ResponseBody<AdminType>>;
22
- export declare type AdminUpdatePayload = {
25
+ export type AdminUpdatePayload = {
23
26
  name: string;
24
27
  email: string;
25
28
  roles: Array<number>;
26
29
  password: string;
30
+ params: Array<FieldShortType<OutgoingValueUnion>>;
27
31
  };
28
- export declare type AdminCreationPayload = AdminUpdatePayload;
32
+ export type AdminCreationPayload = AdminUpdatePayload;
29
33
  export declare function createAdmin(payload: AdminCreationPayload): Promise<ResponseBody<AdminType>>;
30
34
  export declare function updateAdmin(adminId: string | number, payload: AdminUpdatePayload): Promise<ResponseBody<AdminType>>;
31
35
  export declare function deleteAdmin(adminId: string | number): Promise<SuccessData>;
package/dist/style.css CHANGED
@@ -1 +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
+ .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-2e498e82] [data-multi-select-list]{max-height:500px}
@@ -1,25 +1,27 @@
1
- export declare type ScopeType = {
1
+ import { type FieldShortType, type IncomingValueUnion } from '@tager/admin-dynamic-field';
2
+ export type ScopeType = {
2
3
  readonly value: string;
3
4
  readonly label: string;
4
5
  readonly module: string;
5
6
  };
6
- export declare type RoleType = {
7
+ export type RoleType = {
7
8
  readonly id: number;
8
9
  readonly name: string;
9
10
  readonly isSuperAdmin: boolean;
10
11
  readonly scopes: Array<ScopeType>;
11
12
  };
12
- export declare type ScopeGroupsData = {
13
+ export type ScopeGroupsData = {
13
14
  readonly groups: Array<{
14
15
  readonly name: string;
15
16
  readonly scopes: Array<ScopeType>;
16
17
  }>;
17
18
  };
18
- export declare type AdminType = {
19
+ export type AdminType = {
19
20
  readonly id: number;
20
21
  readonly name: string;
21
22
  readonly email: string;
22
23
  readonly roles: Array<RoleType>;
23
24
  readonly isSelf: boolean;
24
25
  readonly isSuperAdmin: boolean;
26
+ readonly params: Array<FieldShortType<IncomingValueUnion>>;
25
27
  };
@@ -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 = {
1
+ import { type Nullable } from '@tager/admin-services';
2
+ import { type OptionType } from '@tager/admin-ui';
3
+ import { type FieldUnion } from '@tager/admin-dynamic-field';
4
+ import { type AdminType, type RoleType } from '../../typings/model';
5
+ import { type AdminCreationPayload, type AdminUpdatePayload } from '../../services/requests';
6
+ export type FormValues = {
6
7
  name: string;
7
8
  email: string;
8
9
  password: string;
9
10
  roles: Array<OptionType<number>>;
10
11
  };
11
12
  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;
13
+ export declare function convertFormValuesToAdminUpdatePayload(values: FormValues, paramsValues?: Array<FieldUnion>): AdminUpdatePayload;
14
+ export declare function convertFormValuesToAdminCreationPayload(values: FormValues, paramsValues?: Array<FieldUnion>): AdminCreationPayload;
14
15
  export declare function convertRoleListToOptions(roleList: Array<RoleType>): Array<OptionType<number>>;