@flusys/nestjs-task-manager 7.1.0 → 8.0.0-beta.1

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 (163) hide show
  1. package/config/index.d.ts +3 -3
  2. package/controllers/index.d.ts +5 -5
  3. package/controllers/task-board.controller.d.ts +3 -3
  4. package/controllers/task-comment.controller.d.ts +2 -2
  5. package/controllers/task-label.controller.d.ts +2 -2
  6. package/controllers/task-list.controller.d.ts +3 -3
  7. package/controllers/task.controller.d.ts +4 -4
  8. package/docs/index.d.ts +1 -1
  9. package/docs/task-manager-swagger.config.d.ts +1 -1
  10. package/dtos/index.d.ts +5 -5
  11. package/dtos/task-board.dto.d.ts +1 -1
  12. package/dtos/task.dto.d.ts +2 -2
  13. package/entities/index.d.ts +19 -19
  14. package/entities/task-board-with-company.entity.d.ts +1 -1
  15. package/fesm/234.js +1393 -0
  16. package/fesm/431.js +981 -0
  17. package/fesm/827.js +1054 -0
  18. package/fesm/988.js +881 -0
  19. package/fesm/config/index.js +156 -3
  20. package/fesm/controllers/index.js +21 -5
  21. package/fesm/docs/index.js +58 -1
  22. package/fesm/dtos/index.js +280 -5
  23. package/fesm/entities/index.js +26 -46
  24. package/fesm/gateways/index.js +288 -1
  25. package/fesm/index.js +440 -9
  26. package/fesm/interfaces/index.js +16 -2
  27. package/fesm/modules/index.js +210 -1
  28. package/fesm/runtime.js +85 -0
  29. package/fesm/services/index.js +53 -8
  30. package/gateways/index.d.ts +1 -1
  31. package/gateways/task-board.gateway.d.ts +3 -3
  32. package/index.d.ts +9 -9
  33. package/interfaces/index.d.ts +2 -2
  34. package/interfaces/task-manager-module.interface.d.ts +3 -3
  35. package/interfaces/task.interface.d.ts +2 -2
  36. package/modules/index.d.ts +1 -1
  37. package/modules/task-manager.module.d.ts +2 -2
  38. package/package.json +26 -36
  39. package/services/index.d.ts +8 -8
  40. package/services/task-activity.service.d.ts +1 -1
  41. package/services/task-board.service.d.ts +5 -5
  42. package/services/task-comment.service.d.ts +4 -4
  43. package/services/task-label.service.d.ts +4 -4
  44. package/services/task-list.service.d.ts +4 -4
  45. package/services/task-manager-config.service.d.ts +3 -3
  46. package/services/task-manager-datasource.provider.d.ts +3 -3
  47. package/services/task.service.d.ts +7 -7
  48. package/cjs/config/event-actions.js +0 -37
  49. package/cjs/config/index.js +0 -20
  50. package/cjs/config/message-keys.js +0 -92
  51. package/cjs/config/task-manager.constants.js +0 -11
  52. package/cjs/controllers/index.js +0 -22
  53. package/cjs/controllers/task-board.controller.js +0 -219
  54. package/cjs/controllers/task-board.controller.spec.js +0 -132
  55. package/cjs/controllers/task-comment.controller.js +0 -103
  56. package/cjs/controllers/task-comment.controller.spec.js +0 -86
  57. package/cjs/controllers/task-label.controller.js +0 -112
  58. package/cjs/controllers/task-label.controller.spec.js +0 -88
  59. package/cjs/controllers/task-list.controller.js +0 -158
  60. package/cjs/controllers/task-list.controller.spec.js +0 -112
  61. package/cjs/controllers/task.controller.js +0 -199
  62. package/cjs/controllers/task.controller.spec.js +0 -131
  63. package/cjs/docs/index.js +0 -18
  64. package/cjs/docs/task-manager-swagger.config.js +0 -43
  65. package/cjs/docs/task-manager-swagger.config.spec.js +0 -28
  66. package/cjs/dtos/index.js +0 -22
  67. package/cjs/dtos/task-board.dto.js +0 -310
  68. package/cjs/dtos/task-comment.dto.js +0 -131
  69. package/cjs/dtos/task-label.dto.js +0 -120
  70. package/cjs/dtos/task-list.dto.js +0 -198
  71. package/cjs/dtos/task.dto.js +0 -367
  72. package/cjs/entities/index.js +0 -72
  73. package/cjs/entities/index.spec.js +0 -30
  74. package/cjs/entities/task-activity.entity.js +0 -98
  75. package/cjs/entities/task-assignee.entity.js +0 -67
  76. package/cjs/entities/task-board-member.entity.js +0 -94
  77. package/cjs/entities/task-board-with-company.entity.js +0 -57
  78. package/cjs/entities/task-board.entity.js +0 -88
  79. package/cjs/entities/task-comment.entity.js +0 -80
  80. package/cjs/entities/task-label.entity.js +0 -72
  81. package/cjs/entities/task-list.entity.js +0 -104
  82. package/cjs/entities/task-task-label.entity.js +0 -67
  83. package/cjs/entities/task.entity.js +0 -151
  84. package/cjs/gateways/index.js +0 -18
  85. package/cjs/gateways/task-board.gateway.js +0 -167
  86. package/cjs/gateways/task-board.gateway.spec.js +0 -243
  87. package/cjs/index.js +0 -26
  88. package/cjs/interfaces/index.js +0 -19
  89. package/cjs/interfaces/task-manager-module.interface.js +0 -4
  90. package/cjs/interfaces/task.interface.js +0 -4
  91. package/cjs/modules/index.js +0 -18
  92. package/cjs/modules/task-manager.module.js +0 -135
  93. package/cjs/modules/task-manager.module.spec.js +0 -144
  94. package/cjs/services/index.js +0 -25
  95. package/cjs/services/task-activity.service.js +0 -76
  96. package/cjs/services/task-activity.service.spec.js +0 -125
  97. package/cjs/services/task-board.service.js +0 -247
  98. package/cjs/services/task-board.service.spec.js +0 -465
  99. package/cjs/services/task-comment.service.js +0 -103
  100. package/cjs/services/task-comment.service.spec.js +0 -160
  101. package/cjs/services/task-label.service.js +0 -97
  102. package/cjs/services/task-label.service.spec.js +0 -138
  103. package/cjs/services/task-list.service.js +0 -130
  104. package/cjs/services/task-list.service.spec.js +0 -284
  105. package/cjs/services/task-manager-config.service.js +0 -69
  106. package/cjs/services/task-manager-config.service.spec.js +0 -98
  107. package/cjs/services/task-manager-datasource.provider.js +0 -84
  108. package/cjs/services/task-manager-datasource.provider.spec.js +0 -131
  109. package/cjs/services/task.service.js +0 -398
  110. package/cjs/services/task.service.spec.js +0 -700
  111. package/fesm/config/event-actions.js +0 -16
  112. package/fesm/config/message-keys.js +0 -65
  113. package/fesm/config/task-manager.constants.js +0 -1
  114. package/fesm/controllers/task-board.controller.js +0 -209
  115. package/fesm/controllers/task-board.controller.spec.js +0 -128
  116. package/fesm/controllers/task-comment.controller.js +0 -93
  117. package/fesm/controllers/task-comment.controller.spec.js +0 -82
  118. package/fesm/controllers/task-label.controller.js +0 -102
  119. package/fesm/controllers/task-label.controller.spec.js +0 -84
  120. package/fesm/controllers/task-list.controller.js +0 -148
  121. package/fesm/controllers/task-list.controller.spec.js +0 -108
  122. package/fesm/controllers/task.controller.js +0 -189
  123. package/fesm/controllers/task.controller.spec.js +0 -127
  124. package/fesm/docs/task-manager-swagger.config.js +0 -33
  125. package/fesm/docs/task-manager-swagger.config.spec.js +0 -24
  126. package/fesm/dtos/task-board.dto.js +0 -277
  127. package/fesm/dtos/task-comment.dto.js +0 -110
  128. package/fesm/dtos/task-label.dto.js +0 -99
  129. package/fesm/dtos/task-list.dto.js +0 -174
  130. package/fesm/dtos/task.dto.js +0 -337
  131. package/fesm/entities/index.spec.js +0 -26
  132. package/fesm/entities/task-activity.entity.js +0 -88
  133. package/fesm/entities/task-assignee.entity.js +0 -57
  134. package/fesm/entities/task-board-member.entity.js +0 -76
  135. package/fesm/entities/task-board-with-company.entity.js +0 -47
  136. package/fesm/entities/task-board.entity.js +0 -78
  137. package/fesm/entities/task-comment.entity.js +0 -70
  138. package/fesm/entities/task-label.entity.js +0 -62
  139. package/fesm/entities/task-list.entity.js +0 -94
  140. package/fesm/entities/task-task-label.entity.js +0 -57
  141. package/fesm/entities/task.entity.js +0 -133
  142. package/fesm/gateways/task-board.gateway.js +0 -157
  143. package/fesm/gateways/task-board.gateway.spec.js +0 -239
  144. package/fesm/interfaces/task-manager-module.interface.js +0 -1
  145. package/fesm/interfaces/task.interface.js +0 -1
  146. package/fesm/modules/task-manager.module.js +0 -125
  147. package/fesm/modules/task-manager.module.spec.js +0 -140
  148. package/fesm/services/task-activity.service.js +0 -66
  149. package/fesm/services/task-activity.service.spec.js +0 -121
  150. package/fesm/services/task-board.service.js +0 -237
  151. package/fesm/services/task-board.service.spec.js +0 -461
  152. package/fesm/services/task-comment.service.js +0 -93
  153. package/fesm/services/task-comment.service.spec.js +0 -156
  154. package/fesm/services/task-label.service.js +0 -87
  155. package/fesm/services/task-label.service.spec.js +0 -134
  156. package/fesm/services/task-list.service.js +0 -120
  157. package/fesm/services/task-list.service.spec.js +0 -280
  158. package/fesm/services/task-manager-config.service.js +0 -59
  159. package/fesm/services/task-manager-config.service.spec.js +0 -94
  160. package/fesm/services/task-manager-datasource.provider.js +0 -74
  161. package/fesm/services/task-manager-datasource.provider.spec.js +0 -127
  162. package/fesm/services/task.service.js +0 -388
  163. package/fesm/services/task.service.spec.js +0 -696
@@ -1,388 +0,0 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
14
- function _ts_decorate(decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- 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;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- }
20
- function _ts_metadata(k, v) {
21
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
- }
23
- function _ts_param(paramIndex, decorator) {
24
- return function(target, key) {
25
- decorator(target, key, paramIndex);
26
- };
27
- }
28
- import { ApiService, HybridCache } from '@flusys/nestjs-shared/classes';
29
- import { UtilsService } from '@flusys/nestjs-shared/modules';
30
- import { BadRequestException, Inject, Injectable, NotFoundException, Scope } from '@nestjs/common';
31
- import { In, IsNull } from 'typeorm';
32
- import { TASK_MANAGER_EVENT_ACTIONS, TASK_MANAGER_EVENT_ENTITIES, TASK_MANAGER_EVENT_MODULE, TASK_MESSAGES } from '../config';
33
- import { Task, TaskAssignee, TaskLabel, TaskTaskLabel } from '../entities';
34
- import { TaskActivityService } from './task-activity.service';
35
- import { TaskBoardService } from './task-board.service';
36
- import { TaskManagerDataSourceProvider } from './task-manager-datasource.provider';
37
- export class TaskService extends ApiService {
38
- /** Boards cache denormalized `total_tasks` / `total_lists`, so board caches go stale on any write here. */ async clearCacheForAll() {
39
- await super.clearCacheForAll();
40
- await this.utilsService.clearCache(TASK_MANAGER_EVENT_ENTITIES.TASK_BOARD, this.cacheManager);
41
- }
42
- async convertSingleDtoToEntity(dto, user) {
43
- await this.ensureDataSourceRepository();
44
- let entity = {};
45
- if ('id' in dto && dto.id) {
46
- const existing = await this.repository.findOne({
47
- where: {
48
- id: dto.id
49
- }
50
- });
51
- if (!existing) throw new NotFoundException({
52
- message: 'Task not found',
53
- messageKey: TASK_MESSAGES.NOT_FOUND
54
- });
55
- entity = existing;
56
- }
57
- if (dto.assigneeIds?.length) {
58
- const boardId = dto.boardId ?? entity.boardId;
59
- const memberChecks = await Promise.all(dto.assigneeIds.map((id)=>this.boardService.isBoardMember(boardId, id)));
60
- if (memberChecks.some((isMember)=>!isMember)) {
61
- throw new BadRequestException({
62
- message: 'Assignee is not a board member',
63
- messageKey: TASK_MESSAGES.ASSIGNEE_NOT_BOARD_MEMBER
64
- });
65
- }
66
- }
67
- if ('labelIds' in dto && dto.labelIds !== undefined) {
68
- this.pendingLabelIds.push(dto.labelIds ?? []);
69
- }
70
- if ('assigneeIds' in dto && dto.assigneeIds !== undefined) {
71
- this.pendingAssigneeIds.push(dto.assigneeIds ?? []);
72
- } else {
73
- this.pendingAssigneeIds.push(undefined);
74
- }
75
- return {
76
- ...entity,
77
- boardId: dto.boardId ?? entity.boardId,
78
- listId: dto.listId ?? entity.listId,
79
- title: dto.title ?? entity.title,
80
- description: dto.description !== undefined ? dto.description ?? null : entity.description ?? null,
81
- priority: dto.priority ?? entity.priority ?? 'MEDIUM',
82
- dueDate: dto.dueDate !== undefined ? dto.dueDate ?? null : entity.dueDate ?? null,
83
- position: entity.position ?? 0,
84
- reporterId: entity.reporterId ?? user?.id ?? null,
85
- parentTaskId: dto.parentTaskId !== undefined ? dto.parentTaskId ?? null : entity.parentTaskId ?? null,
86
- estimatedHours: dto.estimatedHours !== undefined ? dto.estimatedHours ?? null : entity.estimatedHours ?? null
87
- };
88
- }
89
- async afterInsertOperation(entities, _dto, user, _qr) {
90
- await Promise.all(entities.map(async (entity, i)=>{
91
- const assigneeIds = this.pendingAssigneeIds[i] ?? [];
92
- const syncOps = [
93
- this.syncLabels(entity.id, this.pendingLabelIds[i] ?? [])
94
- ];
95
- if (assigneeIds.length > 0) {
96
- syncOps.push(this.syncAssignees(entity.id, assigneeIds));
97
- }
98
- await Promise.all(syncOps);
99
- }));
100
- await Promise.all([
101
- this.loadLabelsForTasks(entities),
102
- this.loadAssigneesForTasks(entities)
103
- ]);
104
- await Promise.all(entities.map((entity)=>this.activityService.log(entity.id, entity.boardId, user?.id ?? null, 'task.created', null, {
105
- title: entity.title
106
- })));
107
- this.pendingLabelIds = [];
108
- this.pendingAssigneeIds = [];
109
- }
110
- async afterUpdateOperation(entities, _dto, _user, _qr) {
111
- await Promise.all(entities.map(async (entity, i)=>{
112
- const syncOps = [];
113
- if (this.pendingLabelIds[i] !== undefined) {
114
- syncOps.push(this.syncLabels(entity.id, this.pendingLabelIds[i]));
115
- }
116
- if (this.pendingAssigneeIds[i] !== undefined) {
117
- syncOps.push(this.syncAssignees(entity.id, this.pendingAssigneeIds[i]));
118
- }
119
- if (syncOps.length > 0) await Promise.all(syncOps);
120
- }));
121
- await this.loadLabelsForTasks(entities);
122
- const entitiesWithAssigneeUpdates = entities.filter((_, i)=>this.pendingAssigneeIds[i] !== undefined);
123
- if (entitiesWithAssigneeUpdates.length > 0) {
124
- await this.loadAssigneesForTasks(entitiesWithAssigneeUpdates);
125
- }
126
- this.pendingLabelIds = [];
127
- this.pendingAssigneeIds = [];
128
- }
129
- async getFilterQuery(query, filter, _user) {
130
- for (const [key, value] of Object.entries(filter)){
131
- if (key === 'boardId') {
132
- query.andWhere('task.boardId = :boardId', {
133
- boardId: value
134
- });
135
- } else if (key === 'listId') {
136
- query.andWhere('task.listId = :listId', {
137
- listId: value
138
- });
139
- } else if (key === 'assigneeId') {
140
- query.innerJoin('task_assignee', 'ta', 'ta.task_id = task.id').andWhere('ta.user_id = :assigneeUserId', {
141
- assigneeUserId: value
142
- });
143
- } else if (key === 'priority') {
144
- query.andWhere('task.priority = :priority', {
145
- priority: value
146
- });
147
- }
148
- }
149
- return {
150
- query,
151
- isRaw: false
152
- };
153
- }
154
- async getAll(search, filterAndPaginationDto, user) {
155
- const result = await super.getAll(search, filterAndPaginationDto, user);
156
- await this.loadLabelsForTasks(result.data);
157
- await this.loadAssigneesForTasks(result.data);
158
- return result;
159
- }
160
- async moveTask(dto, user) {
161
- await this.ensureDataSourceRepository();
162
- const task = await this.repository.findOne({
163
- where: {
164
- id: dto.taskId,
165
- deletedAt: IsNull()
166
- }
167
- });
168
- if (!task) throw new NotFoundException({
169
- message: 'Task not found',
170
- messageKey: TASK_MESSAGES.NOT_FOUND
171
- });
172
- const oldListId = task.listId;
173
- task.listId = dto.targetListId;
174
- task.position = dto.position ?? 0;
175
- task.updatedById = user.id;
176
- const saved = await this.repository.save(task);
177
- await this.activityService.log(task.id, task.boardId, user.id, 'task.moved', {
178
- listId: oldListId
179
- }, {
180
- listId: dto.targetListId
181
- });
182
- await Promise.all([
183
- this.clearCacheForAll(),
184
- this.clearCacheForId([
185
- saved
186
- ])
187
- ]);
188
- await this.publishDomainAction(TASK_MANAGER_EVENT_ACTIONS.MOVED, {
189
- ids: [
190
- saved.id
191
- ],
192
- metadata: {
193
- boardId: saved.boardId,
194
- fromListId: oldListId,
195
- toListId: dto.targetListId,
196
- position: saved.position
197
- },
198
- user
199
- });
200
- return saved;
201
- }
202
- async assignTask(dto, user) {
203
- await this.ensureDataSourceRepository();
204
- const task = await this.repository.findOne({
205
- where: {
206
- id: dto.taskId,
207
- deletedAt: IsNull()
208
- }
209
- });
210
- if (!task) throw new NotFoundException({
211
- message: 'Task not found',
212
- messageKey: TASK_MESSAGES.NOT_FOUND
213
- });
214
- const memberChecks = await Promise.all(dto.assigneeIds.map((id)=>this.boardService.isBoardMember(task.boardId, id)));
215
- if (memberChecks.some((isMember)=>!isMember)) {
216
- throw new BadRequestException({
217
- message: 'Assignee is not a board member',
218
- messageKey: TASK_MESSAGES.ASSIGNEE_NOT_BOARD_MEMBER
219
- });
220
- }
221
- const assigneeRepo = await this.ensureAssigneeRepository();
222
- const oldRows = await assigneeRepo.find({
223
- where: {
224
- taskId: dto.taskId
225
- }
226
- });
227
- const oldIds = oldRows.map((r)=>r.userId);
228
- await this.syncAssignees(dto.taskId, dto.assigneeIds);
229
- task.updatedById = user.id;
230
- const saved = await this.repository.save(task);
231
- await this.activityService.log(task.id, task.boardId, user.id, 'task.assigned', {
232
- assigneeIds: oldIds
233
- }, {
234
- assigneeIds: dto.assigneeIds
235
- });
236
- await Promise.all([
237
- this.clearCacheForAll(),
238
- this.clearCacheForId([
239
- saved
240
- ])
241
- ]);
242
- saved.assignees = await this.loadAssigneesForTask(saved.id);
243
- await this.publishDomainAction(TASK_MANAGER_EVENT_ACTIONS.ASSIGNED, {
244
- ids: [
245
- saved.id
246
- ],
247
- metadata: {
248
- boardId: saved.boardId,
249
- previousAssigneeIds: oldIds,
250
- assigneeIds: dto.assigneeIds
251
- },
252
- user
253
- });
254
- return saved;
255
- }
256
- async syncAssignees(taskId, userIds) {
257
- const repo = await this.ensureAssigneeRepository();
258
- await repo.delete({
259
- taskId
260
- });
261
- if (userIds.length > 0) {
262
- await repo.save(userIds.map((userId)=>repo.create({
263
- taskId,
264
- userId
265
- })));
266
- }
267
- }
268
- async syncLabels(taskId, labelIds) {
269
- const labelRepo = await this.ensureLabelRepository();
270
- await labelRepo.delete({
271
- taskId
272
- });
273
- if (labelIds.length > 0) {
274
- const rows = labelIds.map((labelId)=>labelRepo.create({
275
- taskId,
276
- labelId
277
- }));
278
- await labelRepo.save(rows);
279
- }
280
- }
281
- async loadLabelsForTasks(tasks) {
282
- if (tasks.length === 0) return;
283
- const junctionRepo = await this.ensureLabelRepository();
284
- const fullRepo = await this.ensureFullLabelRepository();
285
- const taskIds = tasks.map((t)=>t.id);
286
- const junctionRows = await junctionRepo.find({
287
- where: {
288
- taskId: In(taskIds),
289
- deletedAt: IsNull()
290
- }
291
- });
292
- const uniqueLabelIds = [
293
- ...new Set(junctionRows.map((r)=>r.labelId))
294
- ];
295
- const fullLabels = uniqueLabelIds.length > 0 ? await fullRepo.find({
296
- where: {
297
- id: In(uniqueLabelIds),
298
- deletedAt: IsNull()
299
- }
300
- }) : [];
301
- const labelById = new Map(fullLabels.map((l)=>[
302
- l.id,
303
- l
304
- ]));
305
- const byTask = new Map();
306
- for (const row of junctionRows){
307
- const label = labelById.get(row.labelId);
308
- if (!label) continue;
309
- const list = byTask.get(row.taskId) ?? [];
310
- list.push(label);
311
- byTask.set(row.taskId, list);
312
- }
313
- for (const task of tasks){
314
- const taskLabels = byTask.get(task.id) ?? [];
315
- task.labelIds = taskLabels.map((l)=>l.id);
316
- task.labels = taskLabels;
317
- }
318
- }
319
- async loadAssigneesForTasks(tasks) {
320
- if (tasks.length === 0) return;
321
- const repo = await this.ensureAssigneeRepository();
322
- const taskIds = tasks.map((t)=>t.id);
323
- const rows = await repo.createQueryBuilder('ta').select('ta.task_id', 'taskId').addSelect('ta.user_id', 'userId').addSelect('u.name', 'userName').leftJoin('app_user', 'u', 'u.id = ta.user_id').where('ta.task_id IN (:...taskIds)', {
324
- taskIds
325
- }).getRawMany();
326
- const byTask = new Map();
327
- for (const row of rows){
328
- const list = byTask.get(row.taskId) ?? [];
329
- list.push({
330
- userId: row.userId,
331
- userName: row.userName ?? null
332
- });
333
- byTask.set(row.taskId, list);
334
- }
335
- for (const task of tasks){
336
- task.assignees = byTask.get(task.id) ?? [];
337
- }
338
- }
339
- async loadAssigneesForTask(taskId) {
340
- const repo = await this.ensureAssigneeRepository();
341
- const rows = await repo.createQueryBuilder('ta').select('ta.user_id', 'userId').addSelect('u.name', 'userName').leftJoin('app_user', 'u', 'u.id = ta.user_id').where('ta.task_id = :taskId', {
342
- taskId
343
- }).getRawMany();
344
- return rows.map((r)=>({
345
- userId: r.userId,
346
- userName: r.userName ?? null
347
- }));
348
- }
349
- async ensureLabelRepository() {
350
- if (!this.taskLabelRepository) {
351
- this.taskLabelRepository = await this.dataSourceProvider.getRepository(TaskTaskLabel);
352
- }
353
- return this.taskLabelRepository;
354
- }
355
- async ensureFullLabelRepository() {
356
- if (!this.fullLabelRepository) {
357
- this.fullLabelRepository = await this.dataSourceProvider.getRepository(TaskLabel);
358
- }
359
- return this.fullLabelRepository;
360
- }
361
- async ensureAssigneeRepository() {
362
- if (!this.taskAssigneeRepository) {
363
- this.taskAssigneeRepository = await this.dataSourceProvider.getRepository(TaskAssignee);
364
- }
365
- return this.taskAssigneeRepository;
366
- }
367
- constructor(cacheManager, utilsService, dataSourceProvider, boardService, activityService){
368
- super(TASK_MANAGER_EVENT_ENTITIES.TASK, cacheManager, utilsService, TaskService.name, true, TASK_MANAGER_EVENT_MODULE, dataSourceProvider, Task), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "dataSourceProvider", void 0), _define_property(this, "boardService", void 0), _define_property(this, "activityService", void 0), _define_property(this, "taskLabelRepository", void 0), _define_property(this, "fullLabelRepository", void 0), _define_property(this, "taskAssigneeRepository", void 0), _define_property(this, "pendingLabelIds", void 0), _define_property(this, "pendingAssigneeIds", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.dataSourceProvider = dataSourceProvider, this.boardService = boardService, this.activityService = activityService, this.taskLabelRepository = null, this.fullLabelRepository = null, this.taskAssigneeRepository = null, this.pendingLabelIds = [], this.pendingAssigneeIds = [];
369
- }
370
- }
371
- TaskService = _ts_decorate([
372
- Injectable({
373
- scope: Scope.REQUEST
374
- }),
375
- _ts_param(0, Inject('CACHE_INSTANCE')),
376
- _ts_param(1, Inject(UtilsService)),
377
- _ts_param(2, Inject(TaskManagerDataSourceProvider)),
378
- _ts_param(3, Inject(TaskBoardService)),
379
- _ts_param(4, Inject(TaskActivityService)),
380
- _ts_metadata("design:type", Function),
381
- _ts_metadata("design:paramtypes", [
382
- typeof HybridCache === "undefined" ? Object : HybridCache,
383
- typeof UtilsService === "undefined" ? Object : UtilsService,
384
- typeof TaskManagerDataSourceProvider === "undefined" ? Object : TaskManagerDataSourceProvider,
385
- typeof TaskBoardService === "undefined" ? Object : TaskBoardService,
386
- typeof TaskActivityService === "undefined" ? Object : TaskActivityService
387
- ])
388
- ], TaskService);