@ubs-platform/users-webservice 6.9.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.
Files changed (108) hide show
  1. package/_monaembed/@ubs-platform/users-consts/eo-channel-consts.d.ts +13 -0
  2. package/_monaembed/@ubs-platform/users-consts/eo-channel-consts.js +18 -0
  3. package/_monaembed/@ubs-platform/users-consts/eo-channel-consts.js.map +1 -0
  4. package/_monaembed/@ubs-platform/users-consts/eo-group-event.consts.d.ts +11 -0
  5. package/_monaembed/@ubs-platform/users-consts/eo-group-event.consts.js +16 -0
  6. package/_monaembed/@ubs-platform/users-consts/eo-group-event.consts.js.map +1 -0
  7. package/_monaembed/@ubs-platform/users-consts/index.d.ts +4 -0
  8. package/_monaembed/@ubs-platform/users-consts/index.js +21 -0
  9. package/_monaembed/@ubs-platform/users-consts/index.js.map +1 -0
  10. package/_monaembed/@ubs-platform/users-consts/jwt-consts.d.ts +4 -0
  11. package/_monaembed/@ubs-platform/users-consts/jwt-consts.js +9 -0
  12. package/_monaembed/@ubs-platform/users-consts/jwt-consts.js.map +1 -0
  13. package/_monaembed/@ubs-platform/users-consts/package.json +1 -0
  14. package/_monaembed/@ubs-platform/users-consts/tsconfig.lib-publish.tsbuildinfo +1 -0
  15. package/_monaembed/@ubs-platform/users-consts/user-events.d.ts +4 -0
  16. package/_monaembed/@ubs-platform/users-consts/user-events.js +9 -0
  17. package/_monaembed/@ubs-platform/users-consts/user-events.js.map +1 -0
  18. package/dto/email.dto.d.ts +7 -0
  19. package/dto/email.dto.js +3 -0
  20. package/dto/email.dto.js.map +1 -0
  21. package/guard/jwt-local.guard.d.ts +4 -0
  22. package/guard/jwt-local.guard.js +8 -0
  23. package/guard/jwt-local.guard.js.map +1 -0
  24. package/guard/user-intercept.d.ts +5 -0
  25. package/guard/user-intercept.js +23 -0
  26. package/guard/user-intercept.js.map +1 -0
  27. package/index.d.ts +25 -0
  28. package/index.js +42 -0
  29. package/index.js.map +1 -0
  30. package/local-current-user-decorator.d.ts +1 -0
  31. package/local-current-user-decorator.js +6 -0
  32. package/local-current-user-decorator.js.map +1 -0
  33. package/mapper/entity-ownership-group.mapper.d.ts +16 -0
  34. package/mapper/entity-ownership-group.mapper.js +61 -0
  35. package/mapper/entity-ownership-group.mapper.js.map +1 -0
  36. package/mapper/entity-ownership.mapper.d.ts +15 -0
  37. package/mapper/entity-ownership.mapper.js +79 -0
  38. package/mapper/entity-ownership.mapper.js.map +1 -0
  39. package/mapper/user.mapper.d.ts +17 -0
  40. package/mapper/user.mapper.js +163 -0
  41. package/mapper/user.mapper.js.map +1 -0
  42. package/package.json +1 -0
  43. package/services/auth.service.d.ts +12 -0
  44. package/services/auth.service.js +60 -0
  45. package/services/auth.service.js.map +1 -0
  46. package/services/email-change-request.service.d.ts +16 -0
  47. package/services/email-change-request.service.js +97 -0
  48. package/services/email-change-request.service.js.map +1 -0
  49. package/services/email.service.d.ts +8 -0
  50. package/services/email.service.js +43 -0
  51. package/services/email.service.js.map +1 -0
  52. package/services/entity-ownership-group.service.d.ts +48 -0
  53. package/services/entity-ownership-group.service.js +345 -0
  54. package/services/entity-ownership-group.service.js.map +1 -0
  55. package/services/entity-ownership.service.d.ts +36 -0
  56. package/services/entity-ownership.service.js +322 -0
  57. package/services/entity-ownership.service.js.map +1 -0
  58. package/services/password-reset.service.d.ts +15 -0
  59. package/services/password-reset.service.js +113 -0
  60. package/services/password-reset.service.js.map +1 -0
  61. package/services/user-common.service.d.ts +9 -0
  62. package/services/user-common.service.js +53 -0
  63. package/services/user-common.service.js.map +1 -0
  64. package/services/user-register.service.d.ts +20 -0
  65. package/services/user-register.service.js +137 -0
  66. package/services/user-register.service.js.map +1 -0
  67. package/services/user.service.d.ts +45 -0
  68. package/services/user.service.js +279 -0
  69. package/services/user.service.js.map +1 -0
  70. package/strategies/jwt-local-strategy.d.ts +11 -0
  71. package/strategies/jwt-local-strategy.js +37 -0
  72. package/strategies/jwt-local-strategy.js.map +1 -0
  73. package/users-webservice.module.d.ts +2 -0
  74. package/users-webservice.module.js +79 -0
  75. package/users-webservice.module.js.map +1 -0
  76. package/util/crypto-op.d.ts +4 -0
  77. package/util/crypto-op.js +15 -0
  78. package/util/crypto-op.js.map +1 -0
  79. package/web/auth.controller.d.ts +11 -0
  80. package/web/auth.controller.js +83 -0
  81. package/web/auth.controller.js.map +1 -0
  82. package/web/entity-ownership-group-member.controller.d.ts +17 -0
  83. package/web/entity-ownership-group-member.controller.js +161 -0
  84. package/web/entity-ownership-group-member.controller.js.map +1 -0
  85. package/web/entity-ownership-group-microservice.controller.d.ts +28 -0
  86. package/web/entity-ownership-group-microservice.controller.js +117 -0
  87. package/web/entity-ownership-group-microservice.controller.js.map +1 -0
  88. package/web/entity-ownership-group.controller.d.ts +16 -0
  89. package/web/entity-ownership-group.controller.js +148 -0
  90. package/web/entity-ownership-group.controller.js.map +1 -0
  91. package/web/entity-ownership.controller.d.ts +20 -0
  92. package/web/entity-ownership.controller.js +140 -0
  93. package/web/entity-ownership.controller.js.map +1 -0
  94. package/web/password-reset.controller.d.ts +16 -0
  95. package/web/password-reset.controller.js +61 -0
  96. package/web/password-reset.controller.js.map +1 -0
  97. package/web/user-admin.controller.d.ts +21 -0
  98. package/web/user-admin.controller.js +107 -0
  99. package/web/user-admin.controller.js.map +1 -0
  100. package/web/user-microservice.controller.d.ts +27 -0
  101. package/web/user-microservice.controller.js +81 -0
  102. package/web/user-microservice.controller.js.map +1 -0
  103. package/web/user-registration.controller.d.ts +11 -0
  104. package/web/user-registration.controller.js +67 -0
  105. package/web/user-registration.controller.js.map +1 -0
  106. package/web/user.controller.d.ts +24 -0
  107. package/web/user.controller.js +110 -0
  108. package/web/user.controller.js.map +1 -0
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var EntityOwnershipGroupService_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.EntityOwnershipGroupService = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const mongoose_1 = require("@nestjs/mongoose");
19
+ const mongoose_2 = require("mongoose");
20
+ const users_entity_mongo_1 = require("@ubs-platform/users-entity-mongo");
21
+ const entity_ownership_group_mapper_1 = require("../mapper/entity-ownership-group.mapper");
22
+ const user_service_1 = require("./user.service");
23
+ const users_entity_mongo_2 = require("@ubs-platform/users-entity-mongo");
24
+ const email_service_1 = require("./email.service");
25
+ const crud_base_1 = require("@ubs-platform/crud-base");
26
+ const users_entity_mongo_3 = require("@ubs-platform/users-entity-mongo");
27
+ let EntityOwnershipGroupService = EntityOwnershipGroupService_1 = class EntityOwnershipGroupService {
28
+ constructor(eogModel, eogInvitationModel, mapper, userServiceLocal, emailService, eoModel) {
29
+ this.eogModel = eogModel;
30
+ this.eogInvitationModel = eogInvitationModel;
31
+ this.mapper = mapper;
32
+ this.userServiceLocal = userServiceLocal;
33
+ this.emailService = emailService;
34
+ this.eoModel = eoModel;
35
+ this.logger = new common_1.Logger(EntityOwnershipGroupService_1.name, {
36
+ timestamp: true,
37
+ });
38
+ }
39
+ async deleteGroup(id) {
40
+ await this.eogModel.findByIdAndDelete(id).exec();
41
+ }
42
+ async createGroup(eogDto, userId) {
43
+ this.logger.debug('EOG CREATE', eogDto.name);
44
+ const entity = await this.mapper.toEntityCreate(eogDto, userId);
45
+ await entity.save();
46
+ return this.mapper.toDto(entity);
47
+ }
48
+ async editMeta(data) {
49
+ const a = await this.eogModel.findById(data.id).exec();
50
+ if (!a) {
51
+ throw new Error('EntityOwnershipGroup not found');
52
+ }
53
+ a.name = data.name;
54
+ a.description = data.description;
55
+ await a.save();
56
+ return this.mapper.toDto(a);
57
+ }
58
+ async fetchUsersInGroup(id) {
59
+ const found = await this.eogModel.findById(id).exec();
60
+ if (!found) {
61
+ throw new Error('EntityOwnershipGroup not found');
62
+ }
63
+ return found.userCapabilities.map((a) => {
64
+ return this.capabilityToDto(a);
65
+ });
66
+ }
67
+ capabilityToDto(a) {
68
+ return {
69
+ userId: a.userId,
70
+ entityCapabilities: a.entityCapabilities?.map((ec) => ({
71
+ entityGroup: ec.entityGroup,
72
+ entityName: ec.entityName,
73
+ capability: ec.capability,
74
+ })),
75
+ groupCapability: a.groupCapability,
76
+ userFullName: a.userFullName,
77
+ };
78
+ }
79
+ async hasUserGroupCapability(eogCheckCap) {
80
+ const group = await this.getById(eogCheckCap.entityOwnershipGroupId);
81
+ if (!group) {
82
+ throw new Error('EntityOwnershipGroup not found');
83
+ }
84
+ return (group.userCapabilities?.some((uc) => uc.userId === eogCheckCap.userId &&
85
+ eogCheckCap.groupCapabilitiesAtLeastOne.includes(uc.groupCapability)) || false);
86
+ }
87
+ async findGroupsUserIn(userIds) {
88
+ return this.eogModel
89
+ .find({ 'userCapabilities.userId': { $in: userIds } })
90
+ .exec()
91
+ .then((entities) => entities.map((e) => this.mapper.toDto(e)));
92
+ }
93
+ async getByIdPublic(id) {
94
+ const entity = await this.eogModel.findById(id).exec();
95
+ if (!entity) {
96
+ throw new common_1.NotFoundException('EntityOwnershipGroup');
97
+ }
98
+ return await this.mapper.toDto(entity);
99
+ }
100
+ async getById(id) {
101
+ return this.eogModel.findById(id).exec();
102
+ }
103
+ async searchAll(searchAndPagination, user) {
104
+ let s = await this.searchParams(searchAndPagination);
105
+ let sort;
106
+ if (searchAndPagination?.sortBy && searchAndPagination.sortRotation) {
107
+ sort = {};
108
+ sort[searchAndPagination.sortBy] = searchAndPagination.sortRotation;
109
+ }
110
+ return (await this.eogModel.find(s).sort(sort).exec()).map((a) => this.mapper.toDto(a));
111
+ }
112
+ async searchPagination(searchAndPagination, user) {
113
+ const page = searchAndPagination?.page || 0, size = searchAndPagination?.size || 10;
114
+ let s = await this.searchParams(searchAndPagination);
115
+ let sort;
116
+ if (searchAndPagination?.sortBy && searchAndPagination.sortRotation) {
117
+ sort = {};
118
+ sort[searchAndPagination.sortBy] = searchAndPagination.sortRotation;
119
+ }
120
+ return (await crud_base_1.MongooseSearchUtil.modelSearch(this.eogModel, size, page, sort, {
121
+ $match: s,
122
+ })).mapAsync((a) => this.mapper.toDto(a));
123
+ }
124
+ searchParams(searchAndPagination) {
125
+ const s = {};
126
+ if (searchAndPagination?.description) {
127
+ s.description = {
128
+ $regex: new RegExp(searchAndPagination.description, 'i'),
129
+ };
130
+ }
131
+ if (searchAndPagination?.name) {
132
+ s.name = {
133
+ $regex: new RegExp(searchAndPagination.name, 'i'),
134
+ };
135
+ }
136
+ if (searchAndPagination?.memberUserId) {
137
+ s['userCapabilities.userId'] = searchAndPagination.memberUserId;
138
+ }
139
+ return s;
140
+ }
141
+ searchByUserId(userId, capacity) {
142
+ return this.eogModel
143
+ .find({
144
+ 'userCapabilities.userId': userId,
145
+ 'userCapabilities.capability': capacity,
146
+ })
147
+ .exec()
148
+ .then((entities) => entities.map((e) => this.mapper.toDto(e)));
149
+ }
150
+ async addUserCapability(groupId, userCapability) {
151
+ const group = await this.getById(groupId);
152
+ if (!group) {
153
+ throw new Error('EntityOwnershipGroup not found');
154
+ }
155
+ const user = await this.userServiceLocal.findById(userCapability.userId);
156
+ userCapability.userFullName = user?.name + ' ' + user?.surname;
157
+ if (group.userCapabilities?.some((uc) => uc.userId === userCapability.userId)) {
158
+ this.logger.debug('UserCapability already exists in group', groupId, userCapability);
159
+ return this.mapper.toDto(group);
160
+ }
161
+ group.userCapabilities = group.userCapabilities || [];
162
+ group.userCapabilities.push(userCapability);
163
+ await group.save();
164
+ return this.mapper.toDto(group);
165
+ }
166
+ async removeUserCapability(groupId, userId) {
167
+ const group = await this.getById(groupId);
168
+ if (!group) {
169
+ throw new Error('EntityOwnershipGroup not found');
170
+ }
171
+ group.userCapabilities = group.userCapabilities?.filter((uc) => !(uc.userId === userId));
172
+ await group.save();
173
+ }
174
+ async updateUserCapability(groupId, userCapability) {
175
+ const group = await this.eogModel.findById(groupId);
176
+ if (!group) {
177
+ throw new Error('EntityOwnershipGroup not found');
178
+ }
179
+ const index = group.userCapabilities?.findIndex((uc) => uc.userId === userCapability.userId);
180
+ if (index === undefined || index < 0) {
181
+ throw new Error('UserCapability not found in group');
182
+ }
183
+ group.userCapabilities[index].entityCapabilities =
184
+ userCapability.entityCapabilities;
185
+ group.userCapabilities[index].groupCapability =
186
+ userCapability.groupCapability;
187
+ group.markModified('userCapabilities');
188
+ group.markModified('groupCapability');
189
+ await group.save();
190
+ return this.mapper.toDto(group);
191
+ }
192
+ async addUserCapabilityInvite(groupId, userCapability, currentUser) {
193
+ const group = await this.getById(groupId);
194
+ if (!group) {
195
+ throw new Error('EntityOwnershipGroup not found');
196
+ }
197
+ const userInvited = await this.userServiceLocal.findUserByLogin({
198
+ login: userCapability.userLogin,
199
+ password: '',
200
+ });
201
+ if (!userInvited) {
202
+ throw new Error('Invited user not found');
203
+ }
204
+ const invitedByName = `${currentUser.name} ${currentUser.surname}`;
205
+ const name = group.name;
206
+ const emailTemplate = 'lotus-publisher-team-invitation';
207
+ const emailSubject = 'ubs-user-email-change-title';
208
+ if (group.userCapabilities?.some((uc) => uc.userId === userInvited.id)) {
209
+ this.logger.debug('UserCapability already exists in group', groupId, userCapability);
210
+ return;
211
+ }
212
+ let existingInvite = await this.eogInvitationModel
213
+ .findOne({
214
+ entityOwnershipGroupId: groupId,
215
+ invitedUserName: userCapability.userLogin,
216
+ })
217
+ .exec();
218
+ const eogCapabilities = userCapability.entityCapabilities;
219
+ if (!existingInvite) {
220
+ existingInvite = new this.eogInvitationModel({
221
+ invitedUserName: `${userInvited.name} ${userInvited.surname}`,
222
+ invitedUserId: userInvited.id,
223
+ invitedByUserId: currentUser.id,
224
+ invitedByUserName: invitedByName,
225
+ entityOwnershipGroupId: groupId,
226
+ groupCapability: userCapability.groupCapability,
227
+ entityCapabilities: this.eogCapabilitiesToEntity(eogCapabilities),
228
+ eogName: group.name,
229
+ eogId: group._id,
230
+ eogDescription: group.description,
231
+ });
232
+ }
233
+ await existingInvite.save();
234
+ await this.emailService.sendEmail(userInvited, emailSubject, emailTemplate, {
235
+ name,
236
+ invitedBy: invitedByName,
237
+ });
238
+ }
239
+ eogCapabilitiesToEntity(eogCapabilities) {
240
+ return eogCapabilities.map((ec) => ({
241
+ entityGroup: ec.entityGroup,
242
+ entityName: ec.entityName,
243
+ capability: ec.capability,
244
+ }));
245
+ }
246
+ async addUserCapabilityAcceptInvite(inviteId, currentUser) {
247
+ const invite = await this.eogInvitationModel.findOne({
248
+ _id: inviteId,
249
+ });
250
+ if (!invite) {
251
+ throw new Error('Invitation not found');
252
+ }
253
+ if (invite.invitedUserId !== currentUser.id) {
254
+ throw new Error('Invitation does not belong to the current user');
255
+ }
256
+ const group = await this.getById(invite.entityOwnershipGroupId);
257
+ if (!group) {
258
+ throw new Error('EntityOwnershipGroup not found');
259
+ }
260
+ const userCapability = {
261
+ userId: invite.invitedUserId,
262
+ entityCapabilities: invite.entityCapabilities?.map((ec) => ({
263
+ entityGroup: ec.entityGroup,
264
+ entityName: ec.entityName,
265
+ capability: ec.capability,
266
+ })),
267
+ userFullName: invite.invitedUserName,
268
+ groupCapability: invite.groupCapability,
269
+ };
270
+ await this.addUserCapability(group._id, userCapability);
271
+ await this.eogInvitationModel.deleteOne({ _id: invite._id }).exec();
272
+ await this.removeUserInEntityCapability(group, invite);
273
+ }
274
+ async removeUserInEntityCapability(group, invite) {
275
+ await this.eoModel
276
+ .updateMany({
277
+ entityOwnershipGroupId: group._id,
278
+ userCapabilities: {
279
+ $elemMatch: { userId: invite.invitedUserId },
280
+ },
281
+ }, {
282
+ $pull: {
283
+ userCapabilities: { userId: invite.invitedUserId },
284
+ },
285
+ })
286
+ .exec();
287
+ }
288
+ async removeInvitationAdmin(invitationId) {
289
+ await this.eogInvitationModel.findByIdAndDelete(invitationId);
290
+ }
291
+ async refuseUserCapabilityInvite(inviteId, currentUser) {
292
+ await this.eogInvitationModel.findOneAndDelete({
293
+ _id: inviteId,
294
+ invitedUserId: currentUser.id,
295
+ });
296
+ }
297
+ async fetchCurrentUserInvitations(currentUserId) {
298
+ return this.eogInvitationModel
299
+ .find({ invitedUserId: currentUserId })
300
+ .exec()
301
+ .then((invitations) => invitations.map((invite) => this.invitationToDto(invite)));
302
+ }
303
+ invitationToDto(invite) {
304
+ return {
305
+ entityCapabilities: this.eogEntityCapabilitiesToDto(invite),
306
+ userId: invite.invitedUserId,
307
+ groupCapability: invite.groupCapability,
308
+ userName: invite.invitedUserName,
309
+ invitedByUserId: invite.invitedByUserId,
310
+ invitedByUserName: invite.invitedByUserName,
311
+ invitationId: invite._id,
312
+ eogName: invite.eogName,
313
+ eogId: invite.eogId,
314
+ eogDescription: invite.eogDescription,
315
+ inivitationId: invite._id,
316
+ };
317
+ }
318
+ eogEntityCapabilitiesToDto(invite) {
319
+ return invite.entityCapabilities.map((ec) => ({
320
+ entityGroup: ec.entityGroup,
321
+ entityName: ec.entityName,
322
+ capability: ec.capability,
323
+ }));
324
+ }
325
+ async fetchUserCapabilityInvitations(id) {
326
+ return this.eogInvitationModel
327
+ .find({ entityOwnershipGroupId: id })
328
+ .exec()
329
+ .then((invitations) => invitations.map((invite) => this.invitationToDto(invite)));
330
+ }
331
+ };
332
+ exports.EntityOwnershipGroupService = EntityOwnershipGroupService;
333
+ exports.EntityOwnershipGroupService = EntityOwnershipGroupService = EntityOwnershipGroupService_1 = __decorate([
334
+ (0, common_1.Injectable)(),
335
+ __param(0, (0, mongoose_1.InjectModel)(users_entity_mongo_1.EntityOwnershipGroup.name)),
336
+ __param(1, (0, mongoose_1.InjectModel)(users_entity_mongo_2.EntityOwnershipGroupInvitation.name)),
337
+ __param(5, (0, mongoose_1.InjectModel)(users_entity_mongo_3.EntityOwnership.name)),
338
+ __metadata("design:paramtypes", [mongoose_2.Model,
339
+ mongoose_2.Model,
340
+ entity_ownership_group_mapper_1.EntityOwnershipGroupMapper,
341
+ user_service_1.UserService,
342
+ email_service_1.EmailService,
343
+ mongoose_2.Model])
344
+ ], EntityOwnershipGroupService);
345
+ //# sourceMappingURL=entity-ownership-group.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-ownership-group.service.js","sourceRoot":"","sources":["../../../../../../libs/users-webservice/src/services/entity-ownership-group.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,+CAA+C;AAE/C,uCAAkD;AAClD,yEAG0C;AAC1C,2FAAqF;AAarF,iDAA6C;AAC7C,yEAAkF;AAKlF,mDAA+C;AAG/C,uDAA6D;AAG7D,yEAAmE;AAG5D,IAAM,2BAA2B,mCAAjC,MAAM,2BAA2B;IAKpC,YAEI,QAA6C,EAE7C,kBAAiE,EACzD,MAAkC,EAClC,gBAA6B,EAC7B,YAA0B,EAElC,OAAuC;QAP/B,aAAQ,GAAR,QAAQ,CAA6B;QAErC,uBAAkB,GAAlB,kBAAkB,CAAuC;QACzD,WAAM,GAAN,MAAM,CAA4B;QAClC,qBAAgB,GAAhB,gBAAgB,CAAa;QAC7B,iBAAY,GAAZ,YAAY,CAAc;QAE1B,YAAO,GAAP,OAAO,CAAwB;QAb1B,WAAM,GAAG,IAAI,eAAM,CAAC,6BAA2B,CAAC,IAAI,EAAE;YACnE,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;IAYA,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,EAAU;QACxB,MAAM,IAAI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AAM,CAAC,GAAG;SACM,CAAC;IACxC,CAAC;IAEO,0BAA0B,CAC9B,MAAsC;QAEtC,OAAO,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC1C,WAAW,EAAE,EAAE,CAAC,WAAW;YAC3B,UAAU,EAAE,EAAE,CAAC,UAAU;YACzB,UAAU,EAAE,EAAE,CAAC,UAAU;SAC5B,CAAC,CAAC,CAAC;IACR,CAAC;IAED,KAAK,CAAC,8BAA8B,CAChC,EAAU;QAEV,OAAO,IAAI,CAAC,kBAAkB;aACzB,IAAI,CAAC,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAC;aACpC,IAAI,EAAE;aACN,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAClB,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAC5D,CAAC;IACV,CAAC;CACJ,CAAA;AAncY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;IAOJ,WAAA,IAAA,sBAAW,EAAC,yCAAoB,CAAC,IAAI,CAAC,CAAA;IAEtC,WAAA,IAAA,sBAAW,EAAC,mDAA8B,CAAC,IAAI,CAAC,CAAA;IAKhD,WAAA,IAAA,sBAAW,EAAC,oCAAe,CAAC,IAAI,CAAC,CAAA;qCANhB,gBAAK;QAEK,gBAAK;QACjB,0DAA0B;QAChB,0BAAW;QACf,4BAAY;QAEjB,gBAAK;GAdjB,2BAA2B,CAmcvC"}
@@ -0,0 +1,36 @@
1
+ import { Model } from 'mongoose';
2
+ import { EntityOwnership } from '@ubs-platform/users-entity-mongo';
3
+ import { EntityOwnershipMapper } from '../mapper/entity-ownership.mapper';
4
+ import { EntityOwnershipDTO, EntityOwnershipInsertCapabiltyDTO, EntityOwnershipSearch, EntityOwnershipUserCheck, EntityOwnershipUserSearch, UserCapabilityDTO } from '@ubs-platform/users-common';
5
+ import { UserService } from './user.service';
6
+ import { EntityOwnershipGroup } from '@ubs-platform/users-entity-mongo';
7
+ import { Optional } from '@ubs-platform/crud-base-common/utils';
8
+ export declare class EntityOwnershipService {
9
+ private eoModel;
10
+ private eogModel;
11
+ private userService;
12
+ private mapper;
13
+ private readonly logger;
14
+ constructor(eoModel: Model<EntityOwnership>, eogModel: Model<EntityOwnershipGroup>, userService: UserService, mapper: EntityOwnershipMapper);
15
+ removeUserCapability(eo: EntityOwnershipUserCheck): Promise<import("mongoose").UpdateWriteOpResult>;
16
+ private findEntitiesBySearchKeys;
17
+ private findUserCapabilityInEntity;
18
+ private findUserCapabilityInGroup;
19
+ private checkRoleOverride;
20
+ private findEntityOwnershipGroupsByUser;
21
+ edit(eoDto: EntityOwnershipDTO): Promise<void>;
22
+ insert(eoDto: EntityOwnershipDTO): Promise<void>;
23
+ insertUserCapability(oe: EntityOwnershipInsertCapabiltyDTO): Promise<void>;
24
+ private updateExistingUserCapability;
25
+ private addNewUserCapability;
26
+ hasInsertedUserCapability(eouc: EntityOwnershipUserCheck, checkRoleOverride: boolean): Promise<boolean>;
27
+ findInsertedUserCapability(entityOwnershipUserCheck: EntityOwnershipUserCheck, checkRoleOverride: boolean): Promise<Optional<UserCapabilityDTO>>;
28
+ private searchByUserRaw;
29
+ searchByUser(eo: EntityOwnershipUserSearch): Promise<EntityOwnershipDTO[]>;
30
+ searchByEntityIdsByEogroup(eo: EntityOwnershipUserSearch): Promise<string[]>;
31
+ hasOwnershipsByEogId(eogId: string): Promise<boolean>;
32
+ searchEntityIdsByUser(eo: EntityOwnershipUserSearch): Promise<string[]>;
33
+ search(sk: EntityOwnershipSearch): Promise<EntityOwnershipDTO[]>;
34
+ deleteOwnership(sk: EntityOwnershipSearch): Promise<void>;
35
+ private findRaw;
36
+ }