@forklaunch/implementation-iam-base 0.5.3 → 0.5.5
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/schemas/index.d.mts +733 -334
- package/lib/domain/schemas/index.d.ts +733 -334
- package/lib/domain/schemas/index.js +90 -58
- package/lib/domain/schemas/index.mjs +40 -36
- package/lib/services/index.d.mts +475 -147
- package/lib/services/index.d.ts +475 -147
- package/lib/services/index.js +226 -181
- package/lib/services/index.mjs +195 -183
- package/package.json +8 -8
package/lib/services/index.d.ts
CHANGED
|
@@ -1,179 +1,507 @@
|
|
|
1
1
|
import { InstanceTypeRecord, IdDto, IdsDto } from '@forklaunch/common';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
OpenTelemetryCollector,
|
|
4
|
+
MetricsDefinition,
|
|
5
|
+
TelemetryOptions
|
|
6
|
+
} from '@forklaunch/core/http';
|
|
7
|
+
import {
|
|
8
|
+
OrganizationService,
|
|
9
|
+
PermissionService,
|
|
10
|
+
RoleService,
|
|
11
|
+
UserService
|
|
12
|
+
} from '@forklaunch/interfaces-iam/interfaces';
|
|
13
|
+
import {
|
|
14
|
+
InternalMapper,
|
|
15
|
+
ResponseMapperConstructor,
|
|
16
|
+
RequestMapperConstructor
|
|
17
|
+
} from '@forklaunch/internal';
|
|
5
18
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
6
19
|
import { EntityManager } from '@mikro-orm/core';
|
|
7
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
OrganizationDto,
|
|
22
|
+
CreateOrganizationDto,
|
|
23
|
+
UpdateOrganizationDto,
|
|
24
|
+
PermissionDto,
|
|
25
|
+
CreatePermissionDto,
|
|
26
|
+
UpdatePermissionDto,
|
|
27
|
+
UpdateRoleDto,
|
|
28
|
+
RoleDto,
|
|
29
|
+
CreateRoleDto,
|
|
30
|
+
UserDto,
|
|
31
|
+
CreateUserDto,
|
|
32
|
+
UpdateUserDto
|
|
33
|
+
} from '@forklaunch/interfaces-iam/types';
|
|
8
34
|
import { MapNestedDtoArraysToCollections } from '@forklaunch/core/services';
|
|
9
35
|
|
|
10
36
|
type OrganizationDtos<OrganizationStatus> = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
37
|
+
OrganizationMapper: OrganizationDto<OrganizationStatus>;
|
|
38
|
+
CreateOrganizationMapper: CreateOrganizationDto;
|
|
39
|
+
UpdateOrganizationMapper: UpdateOrganizationDto;
|
|
14
40
|
};
|
|
15
41
|
type PermissionDtos = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
PermissionMapper: PermissionDto;
|
|
43
|
+
CreatePermissionMapper: CreatePermissionDto;
|
|
44
|
+
UpdatePermissionMapper: UpdatePermissionDto;
|
|
45
|
+
RoleEntityMapper: UpdateRoleDto;
|
|
20
46
|
};
|
|
21
47
|
type RoleDtos = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
48
|
+
RoleMapper: RoleDto;
|
|
49
|
+
CreateRoleMapper: CreateRoleDto;
|
|
50
|
+
UpdateRoleMapper: UpdateRoleDto;
|
|
25
51
|
};
|
|
26
52
|
type UserDtos = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
53
|
+
UserMapper: UserDto;
|
|
54
|
+
CreateUserMapper: CreateUserDto;
|
|
55
|
+
UpdateUserMapper: UpdateUserDto;
|
|
30
56
|
};
|
|
31
57
|
|
|
32
58
|
type OrganizationEntities<OrganizationStatus> = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
59
|
+
OrganizationMapper: MapNestedDtoArraysToCollections<
|
|
60
|
+
OrganizationDto<OrganizationStatus>,
|
|
61
|
+
'users'
|
|
62
|
+
>;
|
|
63
|
+
CreateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
64
|
+
OrganizationDto<OrganizationStatus>,
|
|
65
|
+
'users'
|
|
66
|
+
>;
|
|
67
|
+
UpdateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
68
|
+
OrganizationDto<OrganizationStatus>,
|
|
69
|
+
'users'
|
|
70
|
+
>;
|
|
36
71
|
};
|
|
37
72
|
type PermissionEntities = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
PermissionMapper: PermissionDto;
|
|
74
|
+
CreatePermissionMapper: PermissionDto;
|
|
75
|
+
UpdatePermissionMapper: PermissionDto;
|
|
76
|
+
RoleEntityMapper: MapNestedDtoArraysToCollections<
|
|
77
|
+
UpdateRoleDto,
|
|
78
|
+
'permissions'
|
|
79
|
+
>;
|
|
42
80
|
};
|
|
43
81
|
type RoleEntities = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
82
|
+
RoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
83
|
+
CreateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
84
|
+
UpdateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
47
85
|
};
|
|
48
86
|
type UserEntities = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
87
|
+
UserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
88
|
+
CreateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
89
|
+
UpdateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
52
90
|
};
|
|
53
91
|
|
|
54
|
-
declare class BaseOrganizationService<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
declare class BaseOrganizationService<
|
|
93
|
+
SchemaValidator extends AnySchemaValidator,
|
|
94
|
+
OrganizationStatus,
|
|
95
|
+
MapperEntities extends OrganizationEntities<OrganizationStatus>,
|
|
96
|
+
MapperDtos extends
|
|
97
|
+
OrganizationDtos<OrganizationStatus> = OrganizationDtos<OrganizationStatus>
|
|
98
|
+
> implements OrganizationService<OrganizationStatus>
|
|
99
|
+
{
|
|
100
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
101
|
+
private evaluatedTelemetryOptions;
|
|
102
|
+
em: EntityManager;
|
|
103
|
+
protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
104
|
+
protected schemaValidator: SchemaValidator;
|
|
105
|
+
protected mappers: {
|
|
106
|
+
OrganizationMapper: ResponseMapperConstructor<
|
|
107
|
+
SchemaValidator,
|
|
108
|
+
MapperDtos['OrganizationMapper'],
|
|
109
|
+
MapperEntities['OrganizationMapper']
|
|
110
|
+
>;
|
|
111
|
+
CreateOrganizationMapper: RequestMapperConstructor<
|
|
112
|
+
SchemaValidator,
|
|
113
|
+
MapperDtos['CreateOrganizationMapper'],
|
|
114
|
+
MapperEntities['CreateOrganizationMapper'],
|
|
115
|
+
(
|
|
116
|
+
dto: MapperDtos['CreateOrganizationMapper'],
|
|
117
|
+
em: EntityManager
|
|
118
|
+
) => Promise<MapperEntities['CreateOrganizationMapper']>
|
|
119
|
+
>;
|
|
120
|
+
UpdateOrganizationMapper: RequestMapperConstructor<
|
|
121
|
+
SchemaValidator,
|
|
122
|
+
MapperDtos['UpdateOrganizationMapper'],
|
|
123
|
+
MapperEntities['UpdateOrganizationMapper'],
|
|
124
|
+
(
|
|
125
|
+
dto: MapperDtos['UpdateOrganizationMapper'],
|
|
126
|
+
em: EntityManager
|
|
127
|
+
) => Promise<MapperEntities['UpdateOrganizationMapper']>
|
|
128
|
+
>;
|
|
129
|
+
};
|
|
130
|
+
constructor(
|
|
131
|
+
em: EntityManager,
|
|
132
|
+
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
133
|
+
schemaValidator: SchemaValidator,
|
|
134
|
+
mappers: {
|
|
135
|
+
OrganizationMapper: ResponseMapperConstructor<
|
|
136
|
+
SchemaValidator,
|
|
137
|
+
MapperDtos['OrganizationMapper'],
|
|
138
|
+
MapperEntities['OrganizationMapper']
|
|
139
|
+
>;
|
|
140
|
+
CreateOrganizationMapper: RequestMapperConstructor<
|
|
141
|
+
SchemaValidator,
|
|
142
|
+
MapperDtos['CreateOrganizationMapper'],
|
|
143
|
+
MapperEntities['CreateOrganizationMapper'],
|
|
144
|
+
(
|
|
145
|
+
dto: MapperDtos['CreateOrganizationMapper'],
|
|
146
|
+
em: EntityManager
|
|
147
|
+
) => Promise<MapperEntities['CreateOrganizationMapper']>
|
|
148
|
+
>;
|
|
149
|
+
UpdateOrganizationMapper: RequestMapperConstructor<
|
|
150
|
+
SchemaValidator,
|
|
151
|
+
MapperDtos['UpdateOrganizationMapper'],
|
|
152
|
+
MapperEntities['UpdateOrganizationMapper'],
|
|
153
|
+
(
|
|
154
|
+
dto: MapperDtos['UpdateOrganizationMapper'],
|
|
155
|
+
em: EntityManager
|
|
156
|
+
) => Promise<MapperEntities['UpdateOrganizationMapper']>
|
|
157
|
+
>;
|
|
158
|
+
},
|
|
159
|
+
options?: {
|
|
160
|
+
telemetry?: TelemetryOptions;
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
createOrganization(
|
|
164
|
+
organizationDto: MapperDtos['CreateOrganizationMapper'],
|
|
165
|
+
em?: EntityManager
|
|
166
|
+
): Promise<MapperDtos['OrganizationMapper']>;
|
|
167
|
+
getOrganization(
|
|
168
|
+
idDto: IdDto,
|
|
169
|
+
em?: EntityManager
|
|
170
|
+
): Promise<MapperDtos['OrganizationMapper']>;
|
|
171
|
+
updateOrganization(
|
|
172
|
+
organizationDto: MapperDtos['UpdateOrganizationMapper'],
|
|
173
|
+
em?: EntityManager
|
|
174
|
+
): Promise<MapperDtos['OrganizationMapper']>;
|
|
175
|
+
deleteOrganization(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
76
176
|
}
|
|
77
177
|
|
|
78
|
-
declare class BasePermissionService<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
178
|
+
declare class BasePermissionService<
|
|
179
|
+
SchemaValidator extends AnySchemaValidator,
|
|
180
|
+
MapperEntities extends PermissionEntities,
|
|
181
|
+
MapperDto extends PermissionDtos = PermissionDtos
|
|
182
|
+
> implements PermissionService
|
|
183
|
+
{
|
|
184
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
185
|
+
private evaluatedTelemetryOptions;
|
|
186
|
+
em: EntityManager;
|
|
187
|
+
protected roleServiceFactory: () => RoleService;
|
|
188
|
+
protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
189
|
+
protected schemaValidator: SchemaValidator;
|
|
190
|
+
protected mappers: {
|
|
191
|
+
PermissionMapper: ResponseMapperConstructor<
|
|
192
|
+
SchemaValidator,
|
|
193
|
+
MapperDto['PermissionMapper'],
|
|
194
|
+
MapperEntities['PermissionMapper']
|
|
195
|
+
>;
|
|
196
|
+
CreatePermissionMapper: RequestMapperConstructor<
|
|
197
|
+
SchemaValidator,
|
|
198
|
+
MapperDto['CreatePermissionMapper'],
|
|
199
|
+
MapperEntities['CreatePermissionMapper'],
|
|
200
|
+
(
|
|
201
|
+
dto: MapperDto['CreatePermissionMapper'],
|
|
202
|
+
em: EntityManager
|
|
203
|
+
) => Promise<MapperEntities['CreatePermissionMapper']>
|
|
204
|
+
>;
|
|
205
|
+
UpdatePermissionMapper: RequestMapperConstructor<
|
|
206
|
+
SchemaValidator,
|
|
207
|
+
MapperDto['UpdatePermissionMapper'],
|
|
208
|
+
MapperEntities['UpdatePermissionMapper'],
|
|
209
|
+
(
|
|
210
|
+
dto: MapperDto['UpdatePermissionMapper'],
|
|
211
|
+
em: EntityManager
|
|
212
|
+
) => Promise<MapperEntities['UpdatePermissionMapper']>
|
|
213
|
+
>;
|
|
214
|
+
RoleEntityMapper: RequestMapperConstructor<
|
|
215
|
+
SchemaValidator,
|
|
216
|
+
MapperDto['RoleEntityMapper'],
|
|
217
|
+
MapperEntities['RoleEntityMapper'],
|
|
218
|
+
(
|
|
219
|
+
dto: MapperDto['RoleEntityMapper'],
|
|
220
|
+
em: EntityManager
|
|
221
|
+
) => Promise<MapperEntities['RoleEntityMapper']>
|
|
222
|
+
>;
|
|
223
|
+
};
|
|
224
|
+
constructor(
|
|
225
|
+
em: EntityManager,
|
|
226
|
+
roleServiceFactory: () => RoleService,
|
|
227
|
+
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
228
|
+
schemaValidator: SchemaValidator,
|
|
229
|
+
mappers: {
|
|
230
|
+
PermissionMapper: ResponseMapperConstructor<
|
|
231
|
+
SchemaValidator,
|
|
232
|
+
MapperDto['PermissionMapper'],
|
|
233
|
+
MapperEntities['PermissionMapper']
|
|
234
|
+
>;
|
|
235
|
+
CreatePermissionMapper: RequestMapperConstructor<
|
|
236
|
+
SchemaValidator,
|
|
237
|
+
MapperDto['CreatePermissionMapper'],
|
|
238
|
+
MapperEntities['CreatePermissionMapper'],
|
|
239
|
+
(
|
|
240
|
+
dto: MapperDto['CreatePermissionMapper'],
|
|
241
|
+
em: EntityManager
|
|
242
|
+
) => Promise<MapperEntities['CreatePermissionMapper']>
|
|
243
|
+
>;
|
|
244
|
+
UpdatePermissionMapper: RequestMapperConstructor<
|
|
245
|
+
SchemaValidator,
|
|
246
|
+
MapperDto['UpdatePermissionMapper'],
|
|
247
|
+
MapperEntities['UpdatePermissionMapper'],
|
|
248
|
+
(
|
|
249
|
+
dto: MapperDto['UpdatePermissionMapper'],
|
|
250
|
+
em: EntityManager
|
|
251
|
+
) => Promise<MapperEntities['UpdatePermissionMapper']>
|
|
252
|
+
>;
|
|
253
|
+
RoleEntityMapper: RequestMapperConstructor<
|
|
254
|
+
SchemaValidator,
|
|
255
|
+
MapperDto['RoleEntityMapper'],
|
|
256
|
+
MapperEntities['RoleEntityMapper'],
|
|
257
|
+
(
|
|
258
|
+
dto: MapperDto['RoleEntityMapper'],
|
|
259
|
+
em: EntityManager
|
|
260
|
+
) => Promise<MapperEntities['RoleEntityMapper']>
|
|
261
|
+
>;
|
|
262
|
+
},
|
|
263
|
+
options?: {
|
|
264
|
+
telemetry?: TelemetryOptions;
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
private updateRolesWithPermissions;
|
|
268
|
+
private removePermissionsFromRoles;
|
|
269
|
+
private getBatchRoles;
|
|
270
|
+
private createPermissionDto;
|
|
271
|
+
private extractCreatePermissionDtoToEntityData;
|
|
272
|
+
createPermission(
|
|
273
|
+
createPermissionDto: MapperDto['CreatePermissionMapper'],
|
|
274
|
+
em?: EntityManager
|
|
275
|
+
): Promise<MapperDto['PermissionMapper']>;
|
|
276
|
+
createBatchPermissions(
|
|
277
|
+
permissionDtos: MapperDto['CreatePermissionMapper'][],
|
|
278
|
+
em?: EntityManager
|
|
279
|
+
): Promise<MapperDto['PermissionMapper'][]>;
|
|
280
|
+
getPermission(
|
|
281
|
+
idDto: IdDto,
|
|
282
|
+
em?: EntityManager
|
|
283
|
+
): Promise<MapperDto['PermissionMapper']>;
|
|
284
|
+
getBatchPermissions(
|
|
285
|
+
idsDto: IdsDto,
|
|
286
|
+
em?: EntityManager
|
|
287
|
+
): Promise<MapperDto['PermissionMapper'][]>;
|
|
288
|
+
private updatePermissionDto;
|
|
289
|
+
updatePermission(
|
|
290
|
+
permissionDto: MapperDto['UpdatePermissionMapper'],
|
|
291
|
+
em?: EntityManager
|
|
292
|
+
): Promise<MapperDto['PermissionMapper']>;
|
|
293
|
+
updateBatchPermissions(
|
|
294
|
+
permissionDtos: MapperDto['UpdatePermissionMapper'][],
|
|
295
|
+
em?: EntityManager
|
|
296
|
+
): Promise<MapperDto['PermissionMapper'][]>;
|
|
297
|
+
deletePermission(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
298
|
+
deleteBatchPermissions(idsDto: IdsDto, em?: EntityManager): Promise<void>;
|
|
113
299
|
}
|
|
114
300
|
|
|
115
|
-
declare class BaseRoleService<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
301
|
+
declare class BaseRoleService<
|
|
302
|
+
SchemaValidator extends AnySchemaValidator,
|
|
303
|
+
MapperEntities extends RoleEntities,
|
|
304
|
+
MapperDto extends RoleDtos = RoleDtos
|
|
305
|
+
> implements RoleService
|
|
306
|
+
{
|
|
307
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
308
|
+
private evaluatedTelemetryOptions;
|
|
309
|
+
em: EntityManager;
|
|
310
|
+
protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
311
|
+
protected schemaValidator: SchemaValidator;
|
|
312
|
+
protected mappers: {
|
|
313
|
+
RoleMapper: ResponseMapperConstructor<
|
|
314
|
+
SchemaValidator,
|
|
315
|
+
MapperDto['RoleMapper'],
|
|
316
|
+
MapperEntities['RoleMapper']
|
|
317
|
+
>;
|
|
318
|
+
CreateRoleMapper: RequestMapperConstructor<
|
|
319
|
+
SchemaValidator,
|
|
320
|
+
MapperDto['CreateRoleMapper'],
|
|
321
|
+
MapperEntities['CreateRoleMapper'],
|
|
322
|
+
(
|
|
323
|
+
dto: MapperDto['CreateRoleMapper'],
|
|
324
|
+
em: EntityManager
|
|
325
|
+
) => Promise<MapperEntities['CreateRoleMapper']>
|
|
326
|
+
>;
|
|
327
|
+
UpdateRoleMapper: RequestMapperConstructor<
|
|
328
|
+
SchemaValidator,
|
|
329
|
+
MapperDto['UpdateRoleMapper'],
|
|
330
|
+
MapperEntities['UpdateRoleMapper'],
|
|
331
|
+
(
|
|
332
|
+
dto: MapperDto['UpdateRoleMapper'],
|
|
333
|
+
em: EntityManager
|
|
334
|
+
) => Promise<MapperEntities['UpdateRoleMapper']>
|
|
335
|
+
>;
|
|
336
|
+
};
|
|
337
|
+
constructor(
|
|
338
|
+
em: EntityManager,
|
|
339
|
+
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
340
|
+
schemaValidator: SchemaValidator,
|
|
341
|
+
mappers: {
|
|
342
|
+
RoleMapper: ResponseMapperConstructor<
|
|
343
|
+
SchemaValidator,
|
|
344
|
+
MapperDto['RoleMapper'],
|
|
345
|
+
MapperEntities['RoleMapper']
|
|
346
|
+
>;
|
|
347
|
+
CreateRoleMapper: RequestMapperConstructor<
|
|
348
|
+
SchemaValidator,
|
|
349
|
+
MapperDto['CreateRoleMapper'],
|
|
350
|
+
MapperEntities['CreateRoleMapper'],
|
|
351
|
+
(
|
|
352
|
+
dto: MapperDto['CreateRoleMapper'],
|
|
353
|
+
em: EntityManager
|
|
354
|
+
) => Promise<MapperEntities['CreateRoleMapper']>
|
|
355
|
+
>;
|
|
356
|
+
UpdateRoleMapper: RequestMapperConstructor<
|
|
357
|
+
SchemaValidator,
|
|
358
|
+
MapperDto['UpdateRoleMapper'],
|
|
359
|
+
MapperEntities['UpdateRoleMapper'],
|
|
360
|
+
(
|
|
361
|
+
dto: MapperDto['UpdateRoleMapper'],
|
|
362
|
+
em: EntityManager
|
|
363
|
+
) => Promise<MapperEntities['UpdateRoleMapper']>
|
|
364
|
+
>;
|
|
365
|
+
},
|
|
366
|
+
options?: {
|
|
367
|
+
telemetry?: TelemetryOptions;
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
createRole(
|
|
371
|
+
roleDto: MapperDto['CreateRoleMapper'],
|
|
372
|
+
em?: EntityManager
|
|
373
|
+
): Promise<MapperDto['RoleMapper']>;
|
|
374
|
+
createBatchRoles(
|
|
375
|
+
roleDtos: MapperDto['CreateRoleMapper'][],
|
|
376
|
+
em?: EntityManager
|
|
377
|
+
): Promise<MapperDto['RoleMapper'][]>;
|
|
378
|
+
getRole({ id }: IdDto, em?: EntityManager): Promise<RoleDto>;
|
|
379
|
+
getBatchRoles({ ids }: IdsDto, em?: EntityManager): Promise<RoleDto[]>;
|
|
380
|
+
updateRole(
|
|
381
|
+
roleDto: MapperDto['UpdateRoleMapper'],
|
|
382
|
+
em?: EntityManager
|
|
383
|
+
): Promise<MapperDto['RoleMapper']>;
|
|
384
|
+
updateBatchRoles(
|
|
385
|
+
roleDtos: MapperDto['UpdateRoleMapper'][],
|
|
386
|
+
em?: EntityManager
|
|
387
|
+
): Promise<MapperDto['RoleMapper'][]>;
|
|
388
|
+
deleteRole(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
389
|
+
deleteBatchRoles(idsDto: IdsDto, em?: EntityManager): Promise<void>;
|
|
141
390
|
}
|
|
142
391
|
|
|
143
|
-
declare class BaseUserService<
|
|
144
|
-
|
|
392
|
+
declare class BaseUserService<
|
|
393
|
+
SchemaValidator extends AnySchemaValidator,
|
|
394
|
+
OrganizationStatus,
|
|
395
|
+
Entities extends UserEntities,
|
|
396
|
+
Dto extends UserDtos = UserDtos
|
|
397
|
+
> implements UserService
|
|
398
|
+
{
|
|
399
|
+
readonly options?:
|
|
400
|
+
| {
|
|
145
401
|
telemetry?: TelemetryOptions;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
402
|
+
}
|
|
403
|
+
| undefined;
|
|
404
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
405
|
+
private evaluatedTelemetryOptions;
|
|
406
|
+
em: EntityManager;
|
|
407
|
+
protected passwordEncryptionPublicKeyPath: string;
|
|
408
|
+
protected roleServiceFactory: () => RoleService;
|
|
409
|
+
protected organizationServiceFactory: () => OrganizationService<OrganizationStatus>;
|
|
410
|
+
protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
411
|
+
protected schemaValidator: SchemaValidator;
|
|
412
|
+
protected mappers: {
|
|
413
|
+
UserMapper: ResponseMapperConstructor<
|
|
414
|
+
SchemaValidator,
|
|
415
|
+
Dto['UserMapper'],
|
|
416
|
+
Entities['UserMapper']
|
|
417
|
+
>;
|
|
418
|
+
CreateUserMapper: RequestMapperConstructor<
|
|
419
|
+
SchemaValidator,
|
|
420
|
+
Dto['CreateUserMapper'],
|
|
421
|
+
Entities['CreateUserMapper'],
|
|
422
|
+
(
|
|
423
|
+
dto: Dto['CreateUserMapper'],
|
|
424
|
+
em: EntityManager
|
|
425
|
+
) => Promise<Entities['CreateUserMapper']>
|
|
426
|
+
>;
|
|
427
|
+
UpdateUserMapper: RequestMapperConstructor<
|
|
428
|
+
SchemaValidator,
|
|
429
|
+
Dto['UpdateUserMapper'],
|
|
430
|
+
Entities['UpdateUserMapper'],
|
|
431
|
+
(
|
|
432
|
+
dto: Dto['UpdateUserMapper'],
|
|
433
|
+
em: EntityManager
|
|
434
|
+
) => Promise<Entities['UpdateUserMapper']>
|
|
435
|
+
>;
|
|
436
|
+
};
|
|
437
|
+
constructor(
|
|
438
|
+
em: EntityManager,
|
|
439
|
+
passwordEncryptionPublicKeyPath: string,
|
|
440
|
+
roleServiceFactory: () => RoleService,
|
|
441
|
+
organizationServiceFactory: () => OrganizationService<OrganizationStatus>,
|
|
442
|
+
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
443
|
+
schemaValidator: SchemaValidator,
|
|
444
|
+
mappers: {
|
|
445
|
+
UserMapper: ResponseMapperConstructor<
|
|
446
|
+
SchemaValidator,
|
|
447
|
+
Dto['UserMapper'],
|
|
448
|
+
Entities['UserMapper']
|
|
449
|
+
>;
|
|
450
|
+
CreateUserMapper: RequestMapperConstructor<
|
|
451
|
+
SchemaValidator,
|
|
452
|
+
Dto['CreateUserMapper'],
|
|
453
|
+
Entities['CreateUserMapper'],
|
|
454
|
+
(
|
|
455
|
+
dto: Dto['CreateUserMapper'],
|
|
456
|
+
em: EntityManager
|
|
457
|
+
) => Promise<Entities['CreateUserMapper']>
|
|
458
|
+
>;
|
|
459
|
+
UpdateUserMapper: RequestMapperConstructor<
|
|
460
|
+
SchemaValidator,
|
|
461
|
+
Dto['UpdateUserMapper'],
|
|
462
|
+
Entities['UpdateUserMapper'],
|
|
463
|
+
(
|
|
464
|
+
dto: Dto['UpdateUserMapper'],
|
|
465
|
+
em: EntityManager
|
|
466
|
+
) => Promise<Entities['UpdateUserMapper']>
|
|
467
|
+
>;
|
|
468
|
+
},
|
|
469
|
+
options?:
|
|
470
|
+
| {
|
|
471
|
+
telemetry?: TelemetryOptions;
|
|
472
|
+
}
|
|
473
|
+
| undefined
|
|
474
|
+
);
|
|
475
|
+
createUser(
|
|
476
|
+
userDto: Dto['CreateUserMapper'],
|
|
477
|
+
em?: EntityManager
|
|
478
|
+
): Promise<Dto['UserMapper']>;
|
|
479
|
+
createBatchUsers(
|
|
480
|
+
userDtos: Dto['CreateUserMapper'][],
|
|
481
|
+
em?: EntityManager
|
|
482
|
+
): Promise<Dto['UserMapper'][]>;
|
|
483
|
+
getUser(idDto: IdDto, em?: EntityManager): Promise<Dto['UserMapper']>;
|
|
484
|
+
getBatchUsers(
|
|
485
|
+
idsDto: IdsDto,
|
|
486
|
+
em?: EntityManager
|
|
487
|
+
): Promise<Dto['UserMapper'][]>;
|
|
488
|
+
updateUser(
|
|
489
|
+
userDto: Dto['UpdateUserMapper'],
|
|
490
|
+
em?: EntityManager
|
|
491
|
+
): Promise<Dto['UserMapper']>;
|
|
492
|
+
updateBatchUsers(
|
|
493
|
+
userDtos: UpdateUserDto[],
|
|
494
|
+
em?: EntityManager
|
|
495
|
+
): Promise<Dto['UserMapper'][]>;
|
|
496
|
+
deleteUser(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
497
|
+
deleteBatchUsers(idsDto: IdsDto, em?: EntityManager): Promise<void>;
|
|
498
|
+
verifyHasRole(idDto: IdDto, roleId: string): Promise<void>;
|
|
499
|
+
verifyHasPermission(idDto: IdDto, permissionId: string): Promise<void>;
|
|
177
500
|
}
|
|
178
501
|
|
|
179
|
-
export {
|
|
502
|
+
export {
|
|
503
|
+
BaseOrganizationService,
|
|
504
|
+
BasePermissionService,
|
|
505
|
+
BaseRoleService,
|
|
506
|
+
BaseUserService
|
|
507
|
+
};
|