@forklaunch/implementation-iam-base 0.5.7 → 0.6.0
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/domain/types/index.d.mts +195 -0
- package/lib/domain/types/index.d.ts +195 -0
- package/lib/domain/types/index.js +22 -0
- package/lib/domain/types/index.mjs +0 -0
- package/lib/eject/domain/types/index.ts +6 -0
- package/lib/eject/domain/types/organization.mapper.types.ts +29 -0
- package/lib/eject/domain/types/permission.mapper.types.ts +35 -0
- package/lib/eject/domain/types/role.mapper.types.ts +28 -0
- package/lib/eject/domain/types/user.mapper.types.ts +28 -0
- package/lib/eject/services/organization.service.ts +40 -80
- package/lib/eject/services/permission.service.ts +69 -116
- package/lib/eject/services/role.service.ts +40 -97
- package/lib/eject/services/user.service.ts +47 -95
- package/lib/services/index.d.mts +108 -356
- package/lib/services/index.d.ts +108 -356
- package/lib/services/index.js +106 -112
- package/lib/services/index.mjs +106 -100
- package/package.json +10 -10
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OrganizationDto,
|
|
3
|
+
CreateOrganizationDto,
|
|
4
|
+
UpdateOrganizationDto,
|
|
5
|
+
PermissionDto,
|
|
6
|
+
CreatePermissionDto,
|
|
7
|
+
UpdatePermissionDto,
|
|
8
|
+
UpdateRoleDto,
|
|
9
|
+
RoleDto,
|
|
10
|
+
CreateRoleDto,
|
|
11
|
+
UserDto,
|
|
12
|
+
CreateUserDto,
|
|
13
|
+
UpdateUserDto
|
|
14
|
+
} from '@forklaunch/interfaces-iam/types';
|
|
15
|
+
import { MapNestedDtoArraysToCollections } from '@forklaunch/core/services';
|
|
16
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
17
|
+
|
|
18
|
+
type OrganizationDtos<OrganizationStatus> = {
|
|
19
|
+
OrganizationMapper: OrganizationDto<OrganizationStatus>;
|
|
20
|
+
CreateOrganizationMapper: CreateOrganizationDto;
|
|
21
|
+
UpdateOrganizationMapper: UpdateOrganizationDto;
|
|
22
|
+
};
|
|
23
|
+
type PermissionDtos = {
|
|
24
|
+
PermissionMapper: PermissionDto;
|
|
25
|
+
CreatePermissionMapper: CreatePermissionDto;
|
|
26
|
+
UpdatePermissionMapper: UpdatePermissionDto;
|
|
27
|
+
RoleEntityMapper: UpdateRoleDto;
|
|
28
|
+
};
|
|
29
|
+
type RoleDtos = {
|
|
30
|
+
RoleMapper: RoleDto;
|
|
31
|
+
CreateRoleMapper: CreateRoleDto;
|
|
32
|
+
UpdateRoleMapper: UpdateRoleDto;
|
|
33
|
+
};
|
|
34
|
+
type UserDtos = {
|
|
35
|
+
UserMapper: UserDto;
|
|
36
|
+
CreateUserMapper: CreateUserDto;
|
|
37
|
+
UpdateUserMapper: UpdateUserDto;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type OrganizationEntities<OrganizationStatus> = {
|
|
41
|
+
OrganizationMapper: MapNestedDtoArraysToCollections<
|
|
42
|
+
OrganizationDto<OrganizationStatus>,
|
|
43
|
+
'users'
|
|
44
|
+
>;
|
|
45
|
+
CreateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
46
|
+
OrganizationDto<OrganizationStatus>,
|
|
47
|
+
'users'
|
|
48
|
+
>;
|
|
49
|
+
UpdateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
50
|
+
OrganizationDto<OrganizationStatus>,
|
|
51
|
+
'users'
|
|
52
|
+
>;
|
|
53
|
+
};
|
|
54
|
+
type PermissionEntities = {
|
|
55
|
+
PermissionMapper: PermissionDto;
|
|
56
|
+
CreatePermissionMapper: PermissionDto;
|
|
57
|
+
UpdatePermissionMapper: PermissionDto;
|
|
58
|
+
RoleEntityMapper: MapNestedDtoArraysToCollections<
|
|
59
|
+
UpdateRoleDto,
|
|
60
|
+
'permissions'
|
|
61
|
+
>;
|
|
62
|
+
};
|
|
63
|
+
type RoleEntities = {
|
|
64
|
+
RoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
65
|
+
CreateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
66
|
+
UpdateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
67
|
+
};
|
|
68
|
+
type UserEntities = {
|
|
69
|
+
UserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
70
|
+
CreateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
71
|
+
UpdateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type OrganizationMappers<
|
|
75
|
+
OrganizationStatus,
|
|
76
|
+
MapperEntities extends OrganizationEntities<OrganizationStatus>,
|
|
77
|
+
MapperDomains extends OrganizationDtos<OrganizationStatus>
|
|
78
|
+
> = {
|
|
79
|
+
OrganizationMapper: {
|
|
80
|
+
toDto: (
|
|
81
|
+
entity: MapperEntities['OrganizationMapper']
|
|
82
|
+
) => Promise<MapperDomains['OrganizationMapper']>;
|
|
83
|
+
};
|
|
84
|
+
CreateOrganizationMapper: {
|
|
85
|
+
toEntity: (
|
|
86
|
+
dto: MapperDomains['CreateOrganizationMapper'],
|
|
87
|
+
em: EntityManager,
|
|
88
|
+
...args: unknown[]
|
|
89
|
+
) => Promise<MapperEntities['CreateOrganizationMapper']>;
|
|
90
|
+
};
|
|
91
|
+
UpdateOrganizationMapper: {
|
|
92
|
+
toEntity: (
|
|
93
|
+
dto: MapperDomains['UpdateOrganizationMapper'],
|
|
94
|
+
em: EntityManager,
|
|
95
|
+
...args: unknown[]
|
|
96
|
+
) => Promise<MapperEntities['UpdateOrganizationMapper']>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
type PermissionMappers<
|
|
101
|
+
MapperEntities extends PermissionEntities,
|
|
102
|
+
MapperDomains extends PermissionDtos
|
|
103
|
+
> = {
|
|
104
|
+
PermissionMapper: {
|
|
105
|
+
toDto: (
|
|
106
|
+
entity: MapperEntities['PermissionMapper']
|
|
107
|
+
) => Promise<MapperDomains['PermissionMapper']>;
|
|
108
|
+
};
|
|
109
|
+
CreatePermissionMapper: {
|
|
110
|
+
toEntity: (
|
|
111
|
+
dto: MapperDomains['CreatePermissionMapper'],
|
|
112
|
+
em: EntityManager,
|
|
113
|
+
...args: unknown[]
|
|
114
|
+
) => Promise<MapperEntities['CreatePermissionMapper']>;
|
|
115
|
+
};
|
|
116
|
+
UpdatePermissionMapper: {
|
|
117
|
+
toEntity: (
|
|
118
|
+
dto: MapperDomains['UpdatePermissionMapper'],
|
|
119
|
+
em: EntityManager,
|
|
120
|
+
...args: unknown[]
|
|
121
|
+
) => Promise<MapperEntities['UpdatePermissionMapper']>;
|
|
122
|
+
};
|
|
123
|
+
RoleEntityMapper: {
|
|
124
|
+
toEntity: (
|
|
125
|
+
dto: MapperDomains['RoleEntityMapper'],
|
|
126
|
+
em: EntityManager,
|
|
127
|
+
...args: unknown[]
|
|
128
|
+
) => Promise<MapperEntities['RoleEntityMapper']>;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type RoleMappers<
|
|
133
|
+
MapperEntities extends RoleEntities,
|
|
134
|
+
MapperDomains extends RoleDtos
|
|
135
|
+
> = {
|
|
136
|
+
RoleMapper: {
|
|
137
|
+
toDto: (
|
|
138
|
+
entity: MapperEntities['RoleMapper']
|
|
139
|
+
) => Promise<MapperDomains['RoleMapper']>;
|
|
140
|
+
};
|
|
141
|
+
CreateRoleMapper: {
|
|
142
|
+
toEntity: (
|
|
143
|
+
dto: MapperDomains['CreateRoleMapper'],
|
|
144
|
+
em: EntityManager,
|
|
145
|
+
...args: unknown[]
|
|
146
|
+
) => Promise<MapperEntities['CreateRoleMapper']>;
|
|
147
|
+
};
|
|
148
|
+
UpdateRoleMapper: {
|
|
149
|
+
toEntity: (
|
|
150
|
+
dto: MapperDomains['UpdateRoleMapper'],
|
|
151
|
+
em: EntityManager,
|
|
152
|
+
...args: unknown[]
|
|
153
|
+
) => Promise<MapperEntities['UpdateRoleMapper']>;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type UserMappers<
|
|
158
|
+
MapperEntities extends UserEntities,
|
|
159
|
+
MapperDomains extends UserDtos
|
|
160
|
+
> = {
|
|
161
|
+
UserMapper: {
|
|
162
|
+
toDto: (
|
|
163
|
+
entity: MapperEntities['UserMapper']
|
|
164
|
+
) => Promise<MapperDomains['UserMapper']>;
|
|
165
|
+
};
|
|
166
|
+
CreateUserMapper: {
|
|
167
|
+
toEntity: (
|
|
168
|
+
dto: MapperDomains['CreateUserMapper'],
|
|
169
|
+
em: EntityManager,
|
|
170
|
+
...args: unknown[]
|
|
171
|
+
) => Promise<MapperEntities['CreateUserMapper']>;
|
|
172
|
+
};
|
|
173
|
+
UpdateUserMapper: {
|
|
174
|
+
toEntity: (
|
|
175
|
+
dto: MapperDomains['UpdateUserMapper'],
|
|
176
|
+
em: EntityManager,
|
|
177
|
+
...args: unknown[]
|
|
178
|
+
) => Promise<MapperEntities['UpdateUserMapper']>;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export type {
|
|
183
|
+
OrganizationDtos,
|
|
184
|
+
OrganizationEntities,
|
|
185
|
+
OrganizationMappers,
|
|
186
|
+
PermissionDtos,
|
|
187
|
+
PermissionEntities,
|
|
188
|
+
PermissionMappers,
|
|
189
|
+
RoleDtos,
|
|
190
|
+
RoleEntities,
|
|
191
|
+
RoleMappers,
|
|
192
|
+
UserDtos,
|
|
193
|
+
UserEntities,
|
|
194
|
+
UserMappers
|
|
195
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OrganizationDto,
|
|
3
|
+
CreateOrganizationDto,
|
|
4
|
+
UpdateOrganizationDto,
|
|
5
|
+
PermissionDto,
|
|
6
|
+
CreatePermissionDto,
|
|
7
|
+
UpdatePermissionDto,
|
|
8
|
+
UpdateRoleDto,
|
|
9
|
+
RoleDto,
|
|
10
|
+
CreateRoleDto,
|
|
11
|
+
UserDto,
|
|
12
|
+
CreateUserDto,
|
|
13
|
+
UpdateUserDto
|
|
14
|
+
} from '@forklaunch/interfaces-iam/types';
|
|
15
|
+
import { MapNestedDtoArraysToCollections } from '@forklaunch/core/services';
|
|
16
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
17
|
+
|
|
18
|
+
type OrganizationDtos<OrganizationStatus> = {
|
|
19
|
+
OrganizationMapper: OrganizationDto<OrganizationStatus>;
|
|
20
|
+
CreateOrganizationMapper: CreateOrganizationDto;
|
|
21
|
+
UpdateOrganizationMapper: UpdateOrganizationDto;
|
|
22
|
+
};
|
|
23
|
+
type PermissionDtos = {
|
|
24
|
+
PermissionMapper: PermissionDto;
|
|
25
|
+
CreatePermissionMapper: CreatePermissionDto;
|
|
26
|
+
UpdatePermissionMapper: UpdatePermissionDto;
|
|
27
|
+
RoleEntityMapper: UpdateRoleDto;
|
|
28
|
+
};
|
|
29
|
+
type RoleDtos = {
|
|
30
|
+
RoleMapper: RoleDto;
|
|
31
|
+
CreateRoleMapper: CreateRoleDto;
|
|
32
|
+
UpdateRoleMapper: UpdateRoleDto;
|
|
33
|
+
};
|
|
34
|
+
type UserDtos = {
|
|
35
|
+
UserMapper: UserDto;
|
|
36
|
+
CreateUserMapper: CreateUserDto;
|
|
37
|
+
UpdateUserMapper: UpdateUserDto;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type OrganizationEntities<OrganizationStatus> = {
|
|
41
|
+
OrganizationMapper: MapNestedDtoArraysToCollections<
|
|
42
|
+
OrganizationDto<OrganizationStatus>,
|
|
43
|
+
'users'
|
|
44
|
+
>;
|
|
45
|
+
CreateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
46
|
+
OrganizationDto<OrganizationStatus>,
|
|
47
|
+
'users'
|
|
48
|
+
>;
|
|
49
|
+
UpdateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
50
|
+
OrganizationDto<OrganizationStatus>,
|
|
51
|
+
'users'
|
|
52
|
+
>;
|
|
53
|
+
};
|
|
54
|
+
type PermissionEntities = {
|
|
55
|
+
PermissionMapper: PermissionDto;
|
|
56
|
+
CreatePermissionMapper: PermissionDto;
|
|
57
|
+
UpdatePermissionMapper: PermissionDto;
|
|
58
|
+
RoleEntityMapper: MapNestedDtoArraysToCollections<
|
|
59
|
+
UpdateRoleDto,
|
|
60
|
+
'permissions'
|
|
61
|
+
>;
|
|
62
|
+
};
|
|
63
|
+
type RoleEntities = {
|
|
64
|
+
RoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
65
|
+
CreateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
66
|
+
UpdateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
67
|
+
};
|
|
68
|
+
type UserEntities = {
|
|
69
|
+
UserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
70
|
+
CreateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
71
|
+
UpdateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type OrganizationMappers<
|
|
75
|
+
OrganizationStatus,
|
|
76
|
+
MapperEntities extends OrganizationEntities<OrganizationStatus>,
|
|
77
|
+
MapperDomains extends OrganizationDtos<OrganizationStatus>
|
|
78
|
+
> = {
|
|
79
|
+
OrganizationMapper: {
|
|
80
|
+
toDto: (
|
|
81
|
+
entity: MapperEntities['OrganizationMapper']
|
|
82
|
+
) => Promise<MapperDomains['OrganizationMapper']>;
|
|
83
|
+
};
|
|
84
|
+
CreateOrganizationMapper: {
|
|
85
|
+
toEntity: (
|
|
86
|
+
dto: MapperDomains['CreateOrganizationMapper'],
|
|
87
|
+
em: EntityManager,
|
|
88
|
+
...args: unknown[]
|
|
89
|
+
) => Promise<MapperEntities['CreateOrganizationMapper']>;
|
|
90
|
+
};
|
|
91
|
+
UpdateOrganizationMapper: {
|
|
92
|
+
toEntity: (
|
|
93
|
+
dto: MapperDomains['UpdateOrganizationMapper'],
|
|
94
|
+
em: EntityManager,
|
|
95
|
+
...args: unknown[]
|
|
96
|
+
) => Promise<MapperEntities['UpdateOrganizationMapper']>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
type PermissionMappers<
|
|
101
|
+
MapperEntities extends PermissionEntities,
|
|
102
|
+
MapperDomains extends PermissionDtos
|
|
103
|
+
> = {
|
|
104
|
+
PermissionMapper: {
|
|
105
|
+
toDto: (
|
|
106
|
+
entity: MapperEntities['PermissionMapper']
|
|
107
|
+
) => Promise<MapperDomains['PermissionMapper']>;
|
|
108
|
+
};
|
|
109
|
+
CreatePermissionMapper: {
|
|
110
|
+
toEntity: (
|
|
111
|
+
dto: MapperDomains['CreatePermissionMapper'],
|
|
112
|
+
em: EntityManager,
|
|
113
|
+
...args: unknown[]
|
|
114
|
+
) => Promise<MapperEntities['CreatePermissionMapper']>;
|
|
115
|
+
};
|
|
116
|
+
UpdatePermissionMapper: {
|
|
117
|
+
toEntity: (
|
|
118
|
+
dto: MapperDomains['UpdatePermissionMapper'],
|
|
119
|
+
em: EntityManager,
|
|
120
|
+
...args: unknown[]
|
|
121
|
+
) => Promise<MapperEntities['UpdatePermissionMapper']>;
|
|
122
|
+
};
|
|
123
|
+
RoleEntityMapper: {
|
|
124
|
+
toEntity: (
|
|
125
|
+
dto: MapperDomains['RoleEntityMapper'],
|
|
126
|
+
em: EntityManager,
|
|
127
|
+
...args: unknown[]
|
|
128
|
+
) => Promise<MapperEntities['RoleEntityMapper']>;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type RoleMappers<
|
|
133
|
+
MapperEntities extends RoleEntities,
|
|
134
|
+
MapperDomains extends RoleDtos
|
|
135
|
+
> = {
|
|
136
|
+
RoleMapper: {
|
|
137
|
+
toDto: (
|
|
138
|
+
entity: MapperEntities['RoleMapper']
|
|
139
|
+
) => Promise<MapperDomains['RoleMapper']>;
|
|
140
|
+
};
|
|
141
|
+
CreateRoleMapper: {
|
|
142
|
+
toEntity: (
|
|
143
|
+
dto: MapperDomains['CreateRoleMapper'],
|
|
144
|
+
em: EntityManager,
|
|
145
|
+
...args: unknown[]
|
|
146
|
+
) => Promise<MapperEntities['CreateRoleMapper']>;
|
|
147
|
+
};
|
|
148
|
+
UpdateRoleMapper: {
|
|
149
|
+
toEntity: (
|
|
150
|
+
dto: MapperDomains['UpdateRoleMapper'],
|
|
151
|
+
em: EntityManager,
|
|
152
|
+
...args: unknown[]
|
|
153
|
+
) => Promise<MapperEntities['UpdateRoleMapper']>;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type UserMappers<
|
|
158
|
+
MapperEntities extends UserEntities,
|
|
159
|
+
MapperDomains extends UserDtos
|
|
160
|
+
> = {
|
|
161
|
+
UserMapper: {
|
|
162
|
+
toDto: (
|
|
163
|
+
entity: MapperEntities['UserMapper']
|
|
164
|
+
) => Promise<MapperDomains['UserMapper']>;
|
|
165
|
+
};
|
|
166
|
+
CreateUserMapper: {
|
|
167
|
+
toEntity: (
|
|
168
|
+
dto: MapperDomains['CreateUserMapper'],
|
|
169
|
+
em: EntityManager,
|
|
170
|
+
...args: unknown[]
|
|
171
|
+
) => Promise<MapperEntities['CreateUserMapper']>;
|
|
172
|
+
};
|
|
173
|
+
UpdateUserMapper: {
|
|
174
|
+
toEntity: (
|
|
175
|
+
dto: MapperDomains['UpdateUserMapper'],
|
|
176
|
+
em: EntityManager,
|
|
177
|
+
...args: unknown[]
|
|
178
|
+
) => Promise<MapperEntities['UpdateUserMapper']>;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export type {
|
|
183
|
+
OrganizationDtos,
|
|
184
|
+
OrganizationEntities,
|
|
185
|
+
OrganizationMappers,
|
|
186
|
+
PermissionDtos,
|
|
187
|
+
PermissionEntities,
|
|
188
|
+
PermissionMappers,
|
|
189
|
+
RoleDtos,
|
|
190
|
+
RoleEntities,
|
|
191
|
+
RoleMappers,
|
|
192
|
+
UserDtos,
|
|
193
|
+
UserEntities,
|
|
194
|
+
UserMappers
|
|
195
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if ((from && typeof from === 'object') || typeof from === 'function') {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) =>
|
|
18
|
+
__copyProps(__defProp({}, '__esModule', { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// domain/types/index.ts
|
|
21
|
+
var types_exports = {};
|
|
22
|
+
module.exports = __toCommonJS(types_exports);
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { OrganizationDtos } from './iamDto.types';
|
|
3
|
+
import { OrganizationEntities } from './iamEntities.types';
|
|
4
|
+
|
|
5
|
+
export type OrganizationMappers<
|
|
6
|
+
OrganizationStatus,
|
|
7
|
+
MapperEntities extends OrganizationEntities<OrganizationStatus>,
|
|
8
|
+
MapperDomains extends OrganizationDtos<OrganizationStatus>
|
|
9
|
+
> = {
|
|
10
|
+
OrganizationMapper: {
|
|
11
|
+
toDto: (
|
|
12
|
+
entity: MapperEntities['OrganizationMapper']
|
|
13
|
+
) => Promise<MapperDomains['OrganizationMapper']>;
|
|
14
|
+
};
|
|
15
|
+
CreateOrganizationMapper: {
|
|
16
|
+
toEntity: (
|
|
17
|
+
dto: MapperDomains['CreateOrganizationMapper'],
|
|
18
|
+
em: EntityManager,
|
|
19
|
+
...args: unknown[]
|
|
20
|
+
) => Promise<MapperEntities['CreateOrganizationMapper']>;
|
|
21
|
+
};
|
|
22
|
+
UpdateOrganizationMapper: {
|
|
23
|
+
toEntity: (
|
|
24
|
+
dto: MapperDomains['UpdateOrganizationMapper'],
|
|
25
|
+
em: EntityManager,
|
|
26
|
+
...args: unknown[]
|
|
27
|
+
) => Promise<MapperEntities['UpdateOrganizationMapper']>;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { PermissionDtos } from './iamDto.types';
|
|
3
|
+
import { PermissionEntities } from './iamEntities.types';
|
|
4
|
+
|
|
5
|
+
export type PermissionMappers<
|
|
6
|
+
MapperEntities extends PermissionEntities,
|
|
7
|
+
MapperDomains extends PermissionDtos
|
|
8
|
+
> = {
|
|
9
|
+
PermissionMapper: {
|
|
10
|
+
toDto: (
|
|
11
|
+
entity: MapperEntities['PermissionMapper']
|
|
12
|
+
) => Promise<MapperDomains['PermissionMapper']>;
|
|
13
|
+
};
|
|
14
|
+
CreatePermissionMapper: {
|
|
15
|
+
toEntity: (
|
|
16
|
+
dto: MapperDomains['CreatePermissionMapper'],
|
|
17
|
+
em: EntityManager,
|
|
18
|
+
...args: unknown[]
|
|
19
|
+
) => Promise<MapperEntities['CreatePermissionMapper']>;
|
|
20
|
+
};
|
|
21
|
+
UpdatePermissionMapper: {
|
|
22
|
+
toEntity: (
|
|
23
|
+
dto: MapperDomains['UpdatePermissionMapper'],
|
|
24
|
+
em: EntityManager,
|
|
25
|
+
...args: unknown[]
|
|
26
|
+
) => Promise<MapperEntities['UpdatePermissionMapper']>;
|
|
27
|
+
};
|
|
28
|
+
RoleEntityMapper: {
|
|
29
|
+
toEntity: (
|
|
30
|
+
dto: MapperDomains['RoleEntityMapper'],
|
|
31
|
+
em: EntityManager,
|
|
32
|
+
...args: unknown[]
|
|
33
|
+
) => Promise<MapperEntities['RoleEntityMapper']>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { RoleDtos } from './iamDto.types';
|
|
3
|
+
import { RoleEntities } from './iamEntities.types';
|
|
4
|
+
|
|
5
|
+
export type RoleMappers<
|
|
6
|
+
MapperEntities extends RoleEntities,
|
|
7
|
+
MapperDomains extends RoleDtos
|
|
8
|
+
> = {
|
|
9
|
+
RoleMapper: {
|
|
10
|
+
toDto: (
|
|
11
|
+
entity: MapperEntities['RoleMapper']
|
|
12
|
+
) => Promise<MapperDomains['RoleMapper']>;
|
|
13
|
+
};
|
|
14
|
+
CreateRoleMapper: {
|
|
15
|
+
toEntity: (
|
|
16
|
+
dto: MapperDomains['CreateRoleMapper'],
|
|
17
|
+
em: EntityManager,
|
|
18
|
+
...args: unknown[]
|
|
19
|
+
) => Promise<MapperEntities['CreateRoleMapper']>;
|
|
20
|
+
};
|
|
21
|
+
UpdateRoleMapper: {
|
|
22
|
+
toEntity: (
|
|
23
|
+
dto: MapperDomains['UpdateRoleMapper'],
|
|
24
|
+
em: EntityManager,
|
|
25
|
+
...args: unknown[]
|
|
26
|
+
) => Promise<MapperEntities['UpdateRoleMapper']>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
+
import { UserDtos } from './iamDto.types';
|
|
3
|
+
import { UserEntities } from './iamEntities.types';
|
|
4
|
+
|
|
5
|
+
export type UserMappers<
|
|
6
|
+
MapperEntities extends UserEntities,
|
|
7
|
+
MapperDomains extends UserDtos
|
|
8
|
+
> = {
|
|
9
|
+
UserMapper: {
|
|
10
|
+
toDto: (
|
|
11
|
+
entity: MapperEntities['UserMapper']
|
|
12
|
+
) => Promise<MapperDomains['UserMapper']>;
|
|
13
|
+
};
|
|
14
|
+
CreateUserMapper: {
|
|
15
|
+
toEntity: (
|
|
16
|
+
dto: MapperDomains['CreateUserMapper'],
|
|
17
|
+
em: EntityManager,
|
|
18
|
+
...args: unknown[]
|
|
19
|
+
) => Promise<MapperEntities['CreateUserMapper']>;
|
|
20
|
+
};
|
|
21
|
+
UpdateUserMapper: {
|
|
22
|
+
toEntity: (
|
|
23
|
+
dto: MapperDomains['UpdateUserMapper'],
|
|
24
|
+
em: EntityManager,
|
|
25
|
+
...args: unknown[]
|
|
26
|
+
) => Promise<MapperEntities['UpdateUserMapper']>;
|
|
27
|
+
};
|
|
28
|
+
};
|