@forklaunch/interfaces-iam 0.1.12 → 0.1.14
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.
- package/lib/eject/domain/interfaces/index.ts +4 -0
- package/lib/eject/domain/interfaces/organization.service.interface.ts +22 -0
- package/lib/eject/domain/interfaces/permission.service.interface.ts +36 -0
- package/lib/eject/domain/interfaces/role.service.interface.ts +33 -0
- package/lib/eject/domain/interfaces/user.service.interface.ts +44 -0
- package/lib/eject/domain/types/index.ts +4 -0
- package/lib/eject/domain/types/organization.service.types.ts +24 -0
- package/lib/eject/domain/types/permission.service.types.ts +23 -0
- package/lib/eject/domain/types/role.service.types.ts +22 -0
- package/lib/eject/domain/types/user.service.types.ts +30 -0
- package/lib/interfaces/index.d.ts +5 -0
- package/lib/interfaces/index.d.ts.map +1 -0
- package/lib/interfaces/index.js +4 -0
- package/lib/interfaces/organization.service.interface.d.ts +22 -0
- package/lib/interfaces/organization.service.interface.d.ts.map +1 -0
- package/lib/interfaces/organization.service.interface.js +1 -0
- package/lib/interfaces/permission.service.interface.d.ts +36 -0
- package/lib/interfaces/permission.service.interface.d.ts.map +1 -0
- package/lib/interfaces/permission.service.interface.js +1 -0
- package/lib/interfaces/role.service.interface.d.ts +33 -0
- package/lib/interfaces/role.service.interface.d.ts.map +1 -0
- package/lib/interfaces/role.service.interface.js +1 -0
- package/lib/interfaces/user.service.interface.d.ts +43 -0
- package/lib/interfaces/user.service.interface.d.ts.map +1 -0
- package/lib/interfaces/user.service.interface.js +1 -0
- package/lib/jest.config.d.ts +4 -0
- package/lib/jest.config.d.ts.map +1 -0
- package/lib/jest.config.js +19 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +4 -0
- package/lib/types/organization.service.types.d.ts +23 -0
- package/lib/types/organization.service.types.d.ts.map +1 -0
- package/lib/types/organization.service.types.js +1 -0
- package/lib/types/permission.service.types.d.ts +22 -0
- package/lib/types/permission.service.types.d.ts.map +1 -0
- package/lib/types/permission.service.types.js +1 -0
- package/lib/types/role.service.types.d.ts +21 -0
- package/lib/types/role.service.types.d.ts.map +1 -0
- package/lib/types/role.service.types.js +1 -0
- package/lib/types/user.service.types.d.ts +28 -0
- package/lib/types/user.service.types.d.ts.map +1 -0
- package/lib/types/user.service.types.js +1 -0
- package/lib/vitest.config.d.ts +3 -0
- package/lib/vitest.config.d.ts.map +1 -0
- package/lib/vitest.config.js +7 -0
- package/package.json +4 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { OrganizationServiceParameters } from '../types/organization.service.types';
|
|
3
|
+
|
|
4
|
+
export interface OrganizationService<
|
|
5
|
+
OrganizationStatus,
|
|
6
|
+
Params extends
|
|
7
|
+
OrganizationServiceParameters<OrganizationStatus> = OrganizationServiceParameters<OrganizationStatus>
|
|
8
|
+
> {
|
|
9
|
+
createOrganization(
|
|
10
|
+
organizationDto: Params['CreateOrganizationDto'],
|
|
11
|
+
em?: EntityManager
|
|
12
|
+
): Promise<Params['OrganizationDto']>;
|
|
13
|
+
getOrganization(
|
|
14
|
+
idDto: Params['IdDto'],
|
|
15
|
+
em?: EntityManager
|
|
16
|
+
): Promise<Params['OrganizationDto']>;
|
|
17
|
+
updateOrganization(
|
|
18
|
+
organizationDto: Params['UpdateOrganizationDto'],
|
|
19
|
+
em?: EntityManager
|
|
20
|
+
): Promise<Params['OrganizationDto']>;
|
|
21
|
+
deleteOrganization(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { PermissionServiceParameters } from '../types/permission.service.types';
|
|
3
|
+
|
|
4
|
+
export interface PermissionService<
|
|
5
|
+
Params extends PermissionServiceParameters = PermissionServiceParameters
|
|
6
|
+
> {
|
|
7
|
+
createPermission(
|
|
8
|
+
permissionDto: Params['CreatePermissionDto'],
|
|
9
|
+
em?: EntityManager
|
|
10
|
+
): Promise<Params['PermissionDto']>;
|
|
11
|
+
createBatchPermissions(
|
|
12
|
+
permissionDtos: Params['CreatePermissionDto'][],
|
|
13
|
+
em?: EntityManager
|
|
14
|
+
): Promise<Params['PermissionDto'][]>;
|
|
15
|
+
getPermission(
|
|
16
|
+
idDto: Params['IdDto'],
|
|
17
|
+
em?: EntityManager
|
|
18
|
+
): Promise<Params['PermissionDto']>;
|
|
19
|
+
getBatchPermissions(
|
|
20
|
+
idsDto: Params['IdsDto'],
|
|
21
|
+
em?: EntityManager
|
|
22
|
+
): Promise<Params['PermissionDto'][]>;
|
|
23
|
+
updatePermission(
|
|
24
|
+
permissionDto: Params['UpdatePermissionDto'],
|
|
25
|
+
em?: EntityManager
|
|
26
|
+
): Promise<Params['PermissionDto']>;
|
|
27
|
+
updateBatchPermissions(
|
|
28
|
+
permissionDtos: Params['UpdatePermissionDto'][],
|
|
29
|
+
em?: EntityManager
|
|
30
|
+
): Promise<Params['PermissionDto'][]>;
|
|
31
|
+
deletePermission(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
32
|
+
deleteBatchPermissions(
|
|
33
|
+
idsDto: Params['IdsDto'],
|
|
34
|
+
em?: EntityManager
|
|
35
|
+
): Promise<void>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { RoleServiceParameters } from '../types/role.service.types';
|
|
3
|
+
|
|
4
|
+
export interface RoleService<
|
|
5
|
+
Params extends RoleServiceParameters = RoleServiceParameters
|
|
6
|
+
> {
|
|
7
|
+
createRole(
|
|
8
|
+
roleDto: Params['CreateRoleDto'],
|
|
9
|
+
em?: EntityManager
|
|
10
|
+
): Promise<Params['RoleDto']>;
|
|
11
|
+
createBatchRoles(
|
|
12
|
+
roleDtos: Params['CreateRoleDto'][],
|
|
13
|
+
em?: EntityManager
|
|
14
|
+
): Promise<Params['RoleDto'][]>;
|
|
15
|
+
getRole(
|
|
16
|
+
idDto: Params['IdDto'],
|
|
17
|
+
em?: EntityManager
|
|
18
|
+
): Promise<Params['RoleDto']>;
|
|
19
|
+
getBatchRoles(
|
|
20
|
+
idsDto: Params['IdsDto'],
|
|
21
|
+
em?: EntityManager
|
|
22
|
+
): Promise<Params['RoleDto'][]>;
|
|
23
|
+
updateRole(
|
|
24
|
+
roleDto: Params['UpdateRoleDto'],
|
|
25
|
+
em?: EntityManager
|
|
26
|
+
): Promise<Params['RoleDto']>;
|
|
27
|
+
updateBatchRoles(
|
|
28
|
+
roleDtos: Params['UpdateRoleDto'][],
|
|
29
|
+
em?: EntityManager
|
|
30
|
+
): Promise<Params['RoleDto'][]>;
|
|
31
|
+
deleteRole(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
32
|
+
deleteBatchRoles(idsDto: Params['IdsDto'], em?: EntityManager): Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { UserServiceParameters } from '../types/user.service.types';
|
|
3
|
+
|
|
4
|
+
export interface UserService<
|
|
5
|
+
Params extends UserServiceParameters = UserServiceParameters
|
|
6
|
+
> {
|
|
7
|
+
createUser(
|
|
8
|
+
userDto: Params['CreateUserDto'],
|
|
9
|
+
em?: EntityManager
|
|
10
|
+
): Promise<Params['UserDto']>;
|
|
11
|
+
createBatchUsers(
|
|
12
|
+
userDtos: Params['CreateUserDto'][],
|
|
13
|
+
em?: EntityManager
|
|
14
|
+
): Promise<Params['UserDto'][]>;
|
|
15
|
+
getUser(
|
|
16
|
+
idDto: Params['IdDto'],
|
|
17
|
+
em?: EntityManager
|
|
18
|
+
): Promise<Params['UserDto']>;
|
|
19
|
+
getBatchUsers(
|
|
20
|
+
idsDto: Params['IdsDto'],
|
|
21
|
+
em?: EntityManager
|
|
22
|
+
): Promise<Params['UserDto'][]>;
|
|
23
|
+
updateUser(
|
|
24
|
+
userDto: Params['UpdateUserDto'],
|
|
25
|
+
em?: EntityManager
|
|
26
|
+
): Promise<Params['UserDto']>;
|
|
27
|
+
updateBatchUsers(
|
|
28
|
+
userDtos: Params['UpdateUserDto'][],
|
|
29
|
+
em?: EntityManager
|
|
30
|
+
): Promise<Params['UserDto'][]>;
|
|
31
|
+
deleteUser(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
32
|
+
deleteBatchUsers(idsDto: Params['IdsDto'], em?: EntityManager): Promise<void>;
|
|
33
|
+
|
|
34
|
+
verifyHasRole(
|
|
35
|
+
idDto: Params['IdDto'],
|
|
36
|
+
roleId: string,
|
|
37
|
+
em?: EntityManager
|
|
38
|
+
): Promise<void>;
|
|
39
|
+
verifyHasPermission(
|
|
40
|
+
idDto: Params['IdDto'],
|
|
41
|
+
permissionId: string,
|
|
42
|
+
em?: EntityManager
|
|
43
|
+
): Promise<void>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IdDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
+
import { UserDto } from './user.service.types';
|
|
3
|
+
|
|
4
|
+
export type CreateOrganizationDto = {
|
|
5
|
+
name: string;
|
|
6
|
+
domain: string;
|
|
7
|
+
subscription: string;
|
|
8
|
+
logoUrl?: string;
|
|
9
|
+
extraFields?: unknown;
|
|
10
|
+
};
|
|
11
|
+
export type UpdateOrganizationDto = IdDto & Partial<CreateOrganizationDto>;
|
|
12
|
+
export type OrganizationDto<OrganizationStatus> = IdDto &
|
|
13
|
+
CreateOrganizationDto &
|
|
14
|
+
Partial<RecordTimingDto> & {
|
|
15
|
+
users: UserDto[];
|
|
16
|
+
status: OrganizationStatus[keyof OrganizationStatus];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type OrganizationServiceParameters<OrganizationStatus> = {
|
|
20
|
+
CreateOrganizationDto: CreateOrganizationDto;
|
|
21
|
+
OrganizationDto: OrganizationDto<OrganizationStatus>;
|
|
22
|
+
UpdateOrganizationDto: UpdateOrganizationDto;
|
|
23
|
+
IdDto: IdDto;
|
|
24
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
+
|
|
3
|
+
export type CreatePermissionDto = {
|
|
4
|
+
slug: string;
|
|
5
|
+
addToRolesIds?: string[];
|
|
6
|
+
extraFields?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type UpdatePermissionDto = IdDto &
|
|
9
|
+
Partial<CreatePermissionDto> & {
|
|
10
|
+
removeFromRolesIds?: string[];
|
|
11
|
+
};
|
|
12
|
+
export type PermissionDto = IdDto &
|
|
13
|
+
Partial<RecordTimingDto> & {
|
|
14
|
+
slug: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type PermissionServiceParameters = {
|
|
18
|
+
CreatePermissionDto: CreatePermissionDto;
|
|
19
|
+
PermissionDto: PermissionDto;
|
|
20
|
+
UpdatePermissionDto: UpdatePermissionDto;
|
|
21
|
+
IdDto: IdDto;
|
|
22
|
+
IdsDto: IdsDto;
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
+
import { PermissionDto } from './permission.service.types';
|
|
3
|
+
|
|
4
|
+
export type CreateRoleDto = {
|
|
5
|
+
name: string;
|
|
6
|
+
permissionsIds?: PermissionDto[];
|
|
7
|
+
extraFields?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export type UpdateRoleDto = IdDto & Partial<CreateRoleDto>;
|
|
10
|
+
export type RoleDto = IdDto &
|
|
11
|
+
Omit<CreateRoleDto, 'permissionsIds'> &
|
|
12
|
+
Partial<RecordTimingDto> & {
|
|
13
|
+
permissions: PermissionDto[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type RoleServiceParameters = {
|
|
17
|
+
CreateRoleDto: CreateRoleDto;
|
|
18
|
+
RoleDto: RoleDto;
|
|
19
|
+
UpdateRoleDto: UpdateRoleDto;
|
|
20
|
+
IdDto: IdDto;
|
|
21
|
+
IdsDto: IdsDto;
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
+
import { RoleDto } from './role.service.types';
|
|
3
|
+
|
|
4
|
+
export type CreateUserDto = {
|
|
5
|
+
email: string;
|
|
6
|
+
password: string;
|
|
7
|
+
firstName: string;
|
|
8
|
+
lastName: string;
|
|
9
|
+
organizationId: string;
|
|
10
|
+
roleIds: string[];
|
|
11
|
+
phoneNumber?: string;
|
|
12
|
+
subscription?: string;
|
|
13
|
+
extraFields?: unknown;
|
|
14
|
+
};
|
|
15
|
+
export type UpdateUserDto = IdDto &
|
|
16
|
+
Partial<Omit<CreateUserDto, 'organizationId'>>;
|
|
17
|
+
|
|
18
|
+
export type UserDto = IdDto &
|
|
19
|
+
Omit<CreateUserDto, 'roleIds' | 'password' | 'organizationId'> &
|
|
20
|
+
Partial<RecordTimingDto> & {
|
|
21
|
+
roles: RoleDto[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type UserServiceParameters = {
|
|
25
|
+
CreateUserDto: CreateUserDto;
|
|
26
|
+
UserDto: UserDto;
|
|
27
|
+
UpdateUserDto: UpdateUserDto;
|
|
28
|
+
IdDto: IdDto;
|
|
29
|
+
IdsDto: IdsDto;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { OrganizationServiceParameters } from '../types/organization.service.types';
|
|
3
|
+
export interface OrganizationService<
|
|
4
|
+
OrganizationStatus,
|
|
5
|
+
Params extends
|
|
6
|
+
OrganizationServiceParameters<OrganizationStatus> = OrganizationServiceParameters<OrganizationStatus>
|
|
7
|
+
> {
|
|
8
|
+
createOrganization(
|
|
9
|
+
organizationDto: Params['CreateOrganizationDto'],
|
|
10
|
+
em?: EntityManager
|
|
11
|
+
): Promise<Params['OrganizationDto']>;
|
|
12
|
+
getOrganization(
|
|
13
|
+
idDto: Params['IdDto'],
|
|
14
|
+
em?: EntityManager
|
|
15
|
+
): Promise<Params['OrganizationDto']>;
|
|
16
|
+
updateOrganization(
|
|
17
|
+
organizationDto: Params['UpdateOrganizationDto'],
|
|
18
|
+
em?: EntityManager
|
|
19
|
+
): Promise<Params['OrganizationDto']>;
|
|
20
|
+
deleteOrganization(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=organization.service.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/organization.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEpF,MAAM,WAAW,mBAAmB,CAClC,kBAAkB,EAClB,MAAM,SACJ,6BAA6B,CAAC,kBAAkB,CAAC,GAAG,6BAA6B,CAAC,kBAAkB,CAAC;IAEvG,kBAAkB,CAChB,eAAe,EAAE,MAAM,CAAC,uBAAuB,CAAC,EAChD,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACtC,eAAe,CACb,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACtC,kBAAkB,CAChB,eAAe,EAAE,MAAM,CAAC,uBAAuB,CAAC,EAChD,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACtC,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { PermissionServiceParameters } from '../types/permission.service.types';
|
|
3
|
+
export interface PermissionService<
|
|
4
|
+
Params extends PermissionServiceParameters = PermissionServiceParameters
|
|
5
|
+
> {
|
|
6
|
+
createPermission(
|
|
7
|
+
permissionDto: Params['CreatePermissionDto'],
|
|
8
|
+
em?: EntityManager
|
|
9
|
+
): Promise<Params['PermissionDto']>;
|
|
10
|
+
createBatchPermissions(
|
|
11
|
+
permissionDtos: Params['CreatePermissionDto'][],
|
|
12
|
+
em?: EntityManager
|
|
13
|
+
): Promise<Params['PermissionDto'][]>;
|
|
14
|
+
getPermission(
|
|
15
|
+
idDto: Params['IdDto'],
|
|
16
|
+
em?: EntityManager
|
|
17
|
+
): Promise<Params['PermissionDto']>;
|
|
18
|
+
getBatchPermissions(
|
|
19
|
+
idsDto: Params['IdsDto'],
|
|
20
|
+
em?: EntityManager
|
|
21
|
+
): Promise<Params['PermissionDto'][]>;
|
|
22
|
+
updatePermission(
|
|
23
|
+
permissionDto: Params['UpdatePermissionDto'],
|
|
24
|
+
em?: EntityManager
|
|
25
|
+
): Promise<Params['PermissionDto']>;
|
|
26
|
+
updateBatchPermissions(
|
|
27
|
+
permissionDtos: Params['UpdatePermissionDto'][],
|
|
28
|
+
em?: EntityManager
|
|
29
|
+
): Promise<Params['PermissionDto'][]>;
|
|
30
|
+
deletePermission(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
31
|
+
deleteBatchPermissions(
|
|
32
|
+
idsDto: Params['IdsDto'],
|
|
33
|
+
em?: EntityManager
|
|
34
|
+
): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=permission.service.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/permission.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,WAAW,iBAAiB,CAChC,MAAM,SAAS,2BAA2B,GAAG,2BAA2B;IAExE,gBAAgB,CACd,aAAa,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAC5C,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;IACpC,sBAAsB,CACpB,cAAc,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,EAC/C,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACtC,aAAa,CACX,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;IACpC,mBAAmB,CACjB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EACxB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACtC,gBAAgB,CACd,aAAa,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAC5C,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;IACpC,sBAAsB,CACpB,cAAc,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,EAC/C,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACtC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,sBAAsB,CACpB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EACxB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { RoleServiceParameters } from '../types/role.service.types';
|
|
3
|
+
export interface RoleService<
|
|
4
|
+
Params extends RoleServiceParameters = RoleServiceParameters
|
|
5
|
+
> {
|
|
6
|
+
createRole(
|
|
7
|
+
roleDto: Params['CreateRoleDto'],
|
|
8
|
+
em?: EntityManager
|
|
9
|
+
): Promise<Params['RoleDto']>;
|
|
10
|
+
createBatchRoles(
|
|
11
|
+
roleDtos: Params['CreateRoleDto'][],
|
|
12
|
+
em?: EntityManager
|
|
13
|
+
): Promise<Params['RoleDto'][]>;
|
|
14
|
+
getRole(
|
|
15
|
+
idDto: Params['IdDto'],
|
|
16
|
+
em?: EntityManager
|
|
17
|
+
): Promise<Params['RoleDto']>;
|
|
18
|
+
getBatchRoles(
|
|
19
|
+
idsDto: Params['IdsDto'],
|
|
20
|
+
em?: EntityManager
|
|
21
|
+
): Promise<Params['RoleDto'][]>;
|
|
22
|
+
updateRole(
|
|
23
|
+
roleDto: Params['UpdateRoleDto'],
|
|
24
|
+
em?: EntityManager
|
|
25
|
+
): Promise<Params['RoleDto']>;
|
|
26
|
+
updateBatchRoles(
|
|
27
|
+
roleDtos: Params['UpdateRoleDto'][],
|
|
28
|
+
em?: EntityManager
|
|
29
|
+
): Promise<Params['RoleDto'][]>;
|
|
30
|
+
deleteRole(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
31
|
+
deleteBatchRoles(idsDto: Params['IdsDto'], em?: EntityManager): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=role.service.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/role.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,WAAW,WAAW,CAC1B,MAAM,SAAS,qBAAqB,GAAG,qBAAqB;IAE5D,UAAU,CACR,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,gBAAgB,CACd,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EACnC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChC,OAAO,CACL,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,aAAa,CACX,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EACxB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChC,UAAU,CACR,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,gBAAgB,CACd,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EACnC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { UserServiceParameters } from '../types/user.service.types';
|
|
3
|
+
export interface UserService<
|
|
4
|
+
Params extends UserServiceParameters = UserServiceParameters
|
|
5
|
+
> {
|
|
6
|
+
createUser(
|
|
7
|
+
userDto: Params['CreateUserDto'],
|
|
8
|
+
em?: EntityManager
|
|
9
|
+
): Promise<Params['UserDto']>;
|
|
10
|
+
createBatchUsers(
|
|
11
|
+
userDtos: Params['CreateUserDto'][],
|
|
12
|
+
em?: EntityManager
|
|
13
|
+
): Promise<Params['UserDto'][]>;
|
|
14
|
+
getUser(
|
|
15
|
+
idDto: Params['IdDto'],
|
|
16
|
+
em?: EntityManager
|
|
17
|
+
): Promise<Params['UserDto']>;
|
|
18
|
+
getBatchUsers(
|
|
19
|
+
idsDto: Params['IdsDto'],
|
|
20
|
+
em?: EntityManager
|
|
21
|
+
): Promise<Params['UserDto'][]>;
|
|
22
|
+
updateUser(
|
|
23
|
+
userDto: Params['UpdateUserDto'],
|
|
24
|
+
em?: EntityManager
|
|
25
|
+
): Promise<Params['UserDto']>;
|
|
26
|
+
updateBatchUsers(
|
|
27
|
+
userDtos: Params['UpdateUserDto'][],
|
|
28
|
+
em?: EntityManager
|
|
29
|
+
): Promise<Params['UserDto'][]>;
|
|
30
|
+
deleteUser(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
31
|
+
deleteBatchUsers(idsDto: Params['IdsDto'], em?: EntityManager): Promise<void>;
|
|
32
|
+
verifyHasRole(
|
|
33
|
+
idDto: Params['IdDto'],
|
|
34
|
+
roleId: string,
|
|
35
|
+
em?: EntityManager
|
|
36
|
+
): Promise<void>;
|
|
37
|
+
verifyHasPermission(
|
|
38
|
+
idDto: Params['IdDto'],
|
|
39
|
+
permissionId: string,
|
|
40
|
+
em?: EntityManager
|
|
41
|
+
): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=user.service.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/user.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,WAAW,WAAW,CAC1B,MAAM,SAAS,qBAAqB,GAAG,qBAAqB;IAE5D,UAAU,CACR,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,gBAAgB,CACd,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EACnC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChC,OAAO,CACL,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,aAAa,CACX,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EACxB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChC,UAAU,CACR,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,gBAAgB,CACd,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EACnC,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E,aAAa,CACX,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,mBAAmB,CACjB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,YAAY,EAAE,MAAM,EACpB,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,oBAiBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const jestConfig = {
|
|
2
|
+
preset: 'ts-jest/presets/default-esm', // or other ESM presets
|
|
3
|
+
moduleNameMapper: {
|
|
4
|
+
'^(\\.{1,2}/.*)\\.js$': '$1'
|
|
5
|
+
},
|
|
6
|
+
transform: {
|
|
7
|
+
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
|
|
8
|
+
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
|
|
9
|
+
'^.+\\.[tj]sx?$': [
|
|
10
|
+
'ts-jest',
|
|
11
|
+
{
|
|
12
|
+
useESM: true
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
'^.+\\.js$': 'babel-jest'
|
|
16
|
+
},
|
|
17
|
+
testPathIgnorePatterns: ['.*dist/', '.*node_modules/']
|
|
18
|
+
};
|
|
19
|
+
export default jestConfig;
|