@forklaunch/interfaces-iam 0.1.9 → 0.1.11
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/interfaces/index.d.ts +1 -1
- package/lib/interfaces/organization.service.interface.d.ts +19 -6
- package/lib/interfaces/permission.service.interface.d.ts +33 -10
- package/lib/interfaces/role.service.interface.d.ts +30 -10
- package/lib/interfaces/user.service.interface.d.ts +40 -12
- package/lib/jest.config.d.ts +1 -1
- package/lib/jest.config.js +16 -16
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/organization.service.types.d.ts +14 -12
- package/lib/types/permission.service.types.d.ts +15 -13
- package/lib/types/role.service.types.d.ts +13 -11
- package/lib/types/user.service.types.d.ts +21 -18
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +9 -9
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { EntityManager } from '@mikro-orm/core';
|
|
2
2
|
import { OrganizationServiceParameters } from '../types/organization.service.types';
|
|
3
|
-
export interface OrganizationService<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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>;
|
|
8
21
|
}
|
|
9
|
-
//# sourceMappingURL=organization.service.interface.d.ts.map
|
|
22
|
+
//# sourceMappingURL=organization.service.interface.d.ts.map
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
import { EntityManager } from '@mikro-orm/core';
|
|
2
2
|
import { PermissionServiceParameters } from '../types/permission.service.types';
|
|
3
|
-
export interface PermissionService<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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>;
|
|
12
35
|
}
|
|
13
|
-
//# sourceMappingURL=permission.service.interface.d.ts.map
|
|
36
|
+
//# sourceMappingURL=permission.service.interface.d.ts.map
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { EntityManager } from '@mikro-orm/core';
|
|
2
2
|
import { RoleServiceParameters } from '../types/role.service.types';
|
|
3
|
-
export interface RoleService<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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>;
|
|
12
32
|
}
|
|
13
|
-
//# sourceMappingURL=role.service.interface.d.ts.map
|
|
33
|
+
//# sourceMappingURL=role.service.interface.d.ts.map
|
|
@@ -1,15 +1,43 @@
|
|
|
1
1
|
import { EntityManager } from '@mikro-orm/core';
|
|
2
2
|
import { UserServiceParameters } from '../types/user.service.types';
|
|
3
|
-
export interface UserService<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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>;
|
|
14
42
|
}
|
|
15
|
-
//# sourceMappingURL=user.service.interface.d.ts.map
|
|
43
|
+
//# sourceMappingURL=user.service.interface.d.ts.map
|
package/lib/jest.config.d.ts
CHANGED
package/lib/jest.config.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
const jestConfig = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
18
|
};
|
|
19
19
|
export default jestConfig;
|