@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.
- package/config/index.d.ts +3 -3
- package/controllers/index.d.ts +5 -5
- package/controllers/task-board.controller.d.ts +3 -3
- package/controllers/task-comment.controller.d.ts +2 -2
- package/controllers/task-label.controller.d.ts +2 -2
- package/controllers/task-list.controller.d.ts +3 -3
- package/controllers/task.controller.d.ts +4 -4
- package/docs/index.d.ts +1 -1
- package/docs/task-manager-swagger.config.d.ts +1 -1
- package/dtos/index.d.ts +5 -5
- package/dtos/task-board.dto.d.ts +1 -1
- package/dtos/task.dto.d.ts +2 -2
- package/entities/index.d.ts +19 -19
- package/entities/task-board-with-company.entity.d.ts +1 -1
- package/fesm/234.js +1393 -0
- package/fesm/431.js +981 -0
- package/fesm/827.js +1054 -0
- package/fesm/988.js +881 -0
- package/fesm/config/index.js +156 -3
- package/fesm/controllers/index.js +21 -5
- package/fesm/docs/index.js +58 -1
- package/fesm/dtos/index.js +280 -5
- package/fesm/entities/index.js +26 -46
- package/fesm/gateways/index.js +288 -1
- package/fesm/index.js +440 -9
- package/fesm/interfaces/index.js +16 -2
- package/fesm/modules/index.js +210 -1
- package/fesm/runtime.js +85 -0
- package/fesm/services/index.js +53 -8
- package/gateways/index.d.ts +1 -1
- package/gateways/task-board.gateway.d.ts +3 -3
- package/index.d.ts +9 -9
- package/interfaces/index.d.ts +2 -2
- package/interfaces/task-manager-module.interface.d.ts +3 -3
- package/interfaces/task.interface.d.ts +2 -2
- package/modules/index.d.ts +1 -1
- package/modules/task-manager.module.d.ts +2 -2
- package/package.json +26 -36
- package/services/index.d.ts +8 -8
- package/services/task-activity.service.d.ts +1 -1
- package/services/task-board.service.d.ts +5 -5
- package/services/task-comment.service.d.ts +4 -4
- package/services/task-label.service.d.ts +4 -4
- package/services/task-list.service.d.ts +4 -4
- package/services/task-manager-config.service.d.ts +3 -3
- package/services/task-manager-datasource.provider.d.ts +3 -3
- package/services/task.service.d.ts +7 -7
- package/cjs/config/event-actions.js +0 -37
- package/cjs/config/index.js +0 -20
- package/cjs/config/message-keys.js +0 -92
- package/cjs/config/task-manager.constants.js +0 -11
- package/cjs/controllers/index.js +0 -22
- package/cjs/controllers/task-board.controller.js +0 -219
- package/cjs/controllers/task-board.controller.spec.js +0 -132
- package/cjs/controllers/task-comment.controller.js +0 -103
- package/cjs/controllers/task-comment.controller.spec.js +0 -86
- package/cjs/controllers/task-label.controller.js +0 -112
- package/cjs/controllers/task-label.controller.spec.js +0 -88
- package/cjs/controllers/task-list.controller.js +0 -158
- package/cjs/controllers/task-list.controller.spec.js +0 -112
- package/cjs/controllers/task.controller.js +0 -199
- package/cjs/controllers/task.controller.spec.js +0 -131
- package/cjs/docs/index.js +0 -18
- package/cjs/docs/task-manager-swagger.config.js +0 -43
- package/cjs/docs/task-manager-swagger.config.spec.js +0 -28
- package/cjs/dtos/index.js +0 -22
- package/cjs/dtos/task-board.dto.js +0 -310
- package/cjs/dtos/task-comment.dto.js +0 -131
- package/cjs/dtos/task-label.dto.js +0 -120
- package/cjs/dtos/task-list.dto.js +0 -198
- package/cjs/dtos/task.dto.js +0 -367
- package/cjs/entities/index.js +0 -72
- package/cjs/entities/index.spec.js +0 -30
- package/cjs/entities/task-activity.entity.js +0 -98
- package/cjs/entities/task-assignee.entity.js +0 -67
- package/cjs/entities/task-board-member.entity.js +0 -94
- package/cjs/entities/task-board-with-company.entity.js +0 -57
- package/cjs/entities/task-board.entity.js +0 -88
- package/cjs/entities/task-comment.entity.js +0 -80
- package/cjs/entities/task-label.entity.js +0 -72
- package/cjs/entities/task-list.entity.js +0 -104
- package/cjs/entities/task-task-label.entity.js +0 -67
- package/cjs/entities/task.entity.js +0 -151
- package/cjs/gateways/index.js +0 -18
- package/cjs/gateways/task-board.gateway.js +0 -167
- package/cjs/gateways/task-board.gateway.spec.js +0 -243
- package/cjs/index.js +0 -26
- package/cjs/interfaces/index.js +0 -19
- package/cjs/interfaces/task-manager-module.interface.js +0 -4
- package/cjs/interfaces/task.interface.js +0 -4
- package/cjs/modules/index.js +0 -18
- package/cjs/modules/task-manager.module.js +0 -135
- package/cjs/modules/task-manager.module.spec.js +0 -144
- package/cjs/services/index.js +0 -25
- package/cjs/services/task-activity.service.js +0 -76
- package/cjs/services/task-activity.service.spec.js +0 -125
- package/cjs/services/task-board.service.js +0 -247
- package/cjs/services/task-board.service.spec.js +0 -465
- package/cjs/services/task-comment.service.js +0 -103
- package/cjs/services/task-comment.service.spec.js +0 -160
- package/cjs/services/task-label.service.js +0 -97
- package/cjs/services/task-label.service.spec.js +0 -138
- package/cjs/services/task-list.service.js +0 -130
- package/cjs/services/task-list.service.spec.js +0 -284
- package/cjs/services/task-manager-config.service.js +0 -69
- package/cjs/services/task-manager-config.service.spec.js +0 -98
- package/cjs/services/task-manager-datasource.provider.js +0 -84
- package/cjs/services/task-manager-datasource.provider.spec.js +0 -131
- package/cjs/services/task.service.js +0 -398
- package/cjs/services/task.service.spec.js +0 -700
- package/fesm/config/event-actions.js +0 -16
- package/fesm/config/message-keys.js +0 -65
- package/fesm/config/task-manager.constants.js +0 -1
- package/fesm/controllers/task-board.controller.js +0 -209
- package/fesm/controllers/task-board.controller.spec.js +0 -128
- package/fesm/controllers/task-comment.controller.js +0 -93
- package/fesm/controllers/task-comment.controller.spec.js +0 -82
- package/fesm/controllers/task-label.controller.js +0 -102
- package/fesm/controllers/task-label.controller.spec.js +0 -84
- package/fesm/controllers/task-list.controller.js +0 -148
- package/fesm/controllers/task-list.controller.spec.js +0 -108
- package/fesm/controllers/task.controller.js +0 -189
- package/fesm/controllers/task.controller.spec.js +0 -127
- package/fesm/docs/task-manager-swagger.config.js +0 -33
- package/fesm/docs/task-manager-swagger.config.spec.js +0 -24
- package/fesm/dtos/task-board.dto.js +0 -277
- package/fesm/dtos/task-comment.dto.js +0 -110
- package/fesm/dtos/task-label.dto.js +0 -99
- package/fesm/dtos/task-list.dto.js +0 -174
- package/fesm/dtos/task.dto.js +0 -337
- package/fesm/entities/index.spec.js +0 -26
- package/fesm/entities/task-activity.entity.js +0 -88
- package/fesm/entities/task-assignee.entity.js +0 -57
- package/fesm/entities/task-board-member.entity.js +0 -76
- package/fesm/entities/task-board-with-company.entity.js +0 -47
- package/fesm/entities/task-board.entity.js +0 -78
- package/fesm/entities/task-comment.entity.js +0 -70
- package/fesm/entities/task-label.entity.js +0 -62
- package/fesm/entities/task-list.entity.js +0 -94
- package/fesm/entities/task-task-label.entity.js +0 -57
- package/fesm/entities/task.entity.js +0 -133
- package/fesm/gateways/task-board.gateway.js +0 -157
- package/fesm/gateways/task-board.gateway.spec.js +0 -239
- package/fesm/interfaces/task-manager-module.interface.js +0 -1
- package/fesm/interfaces/task.interface.js +0 -1
- package/fesm/modules/task-manager.module.js +0 -125
- package/fesm/modules/task-manager.module.spec.js +0 -140
- package/fesm/services/task-activity.service.js +0 -66
- package/fesm/services/task-activity.service.spec.js +0 -121
- package/fesm/services/task-board.service.js +0 -237
- package/fesm/services/task-board.service.spec.js +0 -461
- package/fesm/services/task-comment.service.js +0 -93
- package/fesm/services/task-comment.service.spec.js +0 -156
- package/fesm/services/task-label.service.js +0 -87
- package/fesm/services/task-label.service.spec.js +0 -134
- package/fesm/services/task-list.service.js +0 -120
- package/fesm/services/task-list.service.spec.js +0 -280
- package/fesm/services/task-manager-config.service.js +0 -59
- package/fesm/services/task-manager-config.service.spec.js +0 -94
- package/fesm/services/task-manager-datasource.provider.js +0 -74
- package/fesm/services/task-manager-datasource.provider.spec.js +0 -127
- package/fesm/services/task.service.js +0 -388
- package/fesm/services/task.service.spec.js +0 -696
package/fesm/234.js
ADDED
|
@@ -0,0 +1,1393 @@
|
|
|
1
|
+
import * as __rspack_external__flusys_nestjs_shared_classes_6076a329 from "@flusys/nestjs-shared/classes";
|
|
2
|
+
import * as __rspack_external__flusys_nestjs_shared_modules_24702bee from "@flusys/nestjs-shared/modules";
|
|
3
|
+
import * as __rspack_external__nestjs_common_a04939da from "@nestjs/common";
|
|
4
|
+
import * as __rspack_external__flusys_nestjs_shared_utils_9125c1f1 from "@flusys/nestjs-shared/utils";
|
|
5
|
+
import * as __rspack_external__nestjs_core_d7b00a1a from "@nestjs/core";
|
|
6
|
+
export const __rspack_esm_id = 234;
|
|
7
|
+
export const __rspack_esm_ids = [234];
|
|
8
|
+
export const __webpack_modules__ = {
|
|
9
|
+
56(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
10
|
+
/**
|
|
11
|
+
* Domain event actions published by the task manager module, alongside the CRUD
|
|
12
|
+
* lifecycle actions every ApiService emits.
|
|
13
|
+
*/ const TASK_MANAGER_EVENT_ACTIONS = {
|
|
14
|
+
MOVED: 'moved',
|
|
15
|
+
ASSIGNED: 'assigned',
|
|
16
|
+
REORDERED: 'reordered'
|
|
17
|
+
};
|
|
18
|
+
/** Every entity the task manager module publishes under */ const TASK_MANAGER_EVENT_ENTITIES = {
|
|
19
|
+
TASK: 'task',
|
|
20
|
+
TASK_BOARD: 'task_board',
|
|
21
|
+
TASK_LIST: 'task_list',
|
|
22
|
+
TASK_LABEL: 'task_label',
|
|
23
|
+
TASK_COMMENT: 'task_comment'
|
|
24
|
+
};
|
|
25
|
+
const TASK_MANAGER_EVENT_MODULE = 'task-manager';
|
|
26
|
+
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
}, {
|
|
29
|
+
kf: TASK_MANAGER_EVENT_MODULE,
|
|
30
|
+
pl: TASK_MANAGER_EVENT_ENTITIES,
|
|
31
|
+
rG: TASK_MANAGER_EVENT_ACTIONS
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
},
|
|
36
|
+
918(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
37
|
+
const TASK_BOARD_MESSAGES = {
|
|
38
|
+
NOT_FOUND: 'task.board.not.found',
|
|
39
|
+
CREATE_SUCCESS: 'task.board.create.success',
|
|
40
|
+
CREATE_MANY_SUCCESS: 'task.board.create.many.success',
|
|
41
|
+
GET_SUCCESS: 'task.board.get.success',
|
|
42
|
+
GET_ALL_SUCCESS: 'task.board.get.all.success',
|
|
43
|
+
UPDATE_SUCCESS: 'task.board.update.success',
|
|
44
|
+
UPDATE_MANY_SUCCESS: 'task.board.update.many.success',
|
|
45
|
+
DELETE_SUCCESS: 'task.board.delete.success',
|
|
46
|
+
RESTORE_SUCCESS: 'task.board.restore.success',
|
|
47
|
+
MEMBER_ADDED: 'task.board.member.added',
|
|
48
|
+
MEMBER_REMOVED: 'task.board.member.removed',
|
|
49
|
+
MEMBER_NOT_FOUND: 'task.board.member.not.found',
|
|
50
|
+
MEMBER_ALREADY_EXISTS: 'task.board.member.already.exists',
|
|
51
|
+
MEMBER_GET_ALL_SUCCESS: 'task.board.member.get.all.success'
|
|
52
|
+
};
|
|
53
|
+
const TASK_LIST_MESSAGES = {
|
|
54
|
+
NOT_FOUND: 'task.list.not.found',
|
|
55
|
+
CREATE_SUCCESS: 'task.list.create.success',
|
|
56
|
+
CREATE_MANY_SUCCESS: 'task.list.create.many.success',
|
|
57
|
+
GET_SUCCESS: 'task.list.get.success',
|
|
58
|
+
GET_ALL_SUCCESS: 'task.list.get.all.success',
|
|
59
|
+
UPDATE_SUCCESS: 'task.list.update.success',
|
|
60
|
+
UPDATE_MANY_SUCCESS: 'task.list.update.many.success',
|
|
61
|
+
DELETE_SUCCESS: 'task.list.delete.success',
|
|
62
|
+
RESTORE_SUCCESS: 'task.list.restore.success',
|
|
63
|
+
REORDER_SUCCESS: 'task.list.reorder.success'
|
|
64
|
+
};
|
|
65
|
+
const TASK_MESSAGES = {
|
|
66
|
+
NOT_FOUND: 'task.not.found',
|
|
67
|
+
CREATE_SUCCESS: 'task.create.success',
|
|
68
|
+
CREATE_MANY_SUCCESS: 'task.create.many.success',
|
|
69
|
+
GET_SUCCESS: 'task.get.success',
|
|
70
|
+
GET_ALL_SUCCESS: 'task.get.all.success',
|
|
71
|
+
UPDATE_SUCCESS: 'task.update.success',
|
|
72
|
+
UPDATE_MANY_SUCCESS: 'task.update.many.success',
|
|
73
|
+
DELETE_SUCCESS: 'task.delete.success',
|
|
74
|
+
RESTORE_SUCCESS: 'task.restore.success',
|
|
75
|
+
MOVE_SUCCESS: 'task.move.success',
|
|
76
|
+
ASSIGN_SUCCESS: 'task.assign.success',
|
|
77
|
+
ASSIGNEE_NOT_BOARD_MEMBER: 'task.assignee.not.board.member'
|
|
78
|
+
};
|
|
79
|
+
const TASK_LABEL_MESSAGES = {
|
|
80
|
+
NOT_FOUND: 'task.label.not.found',
|
|
81
|
+
CREATE_SUCCESS: 'task.label.create.success',
|
|
82
|
+
CREATE_MANY_SUCCESS: 'task.label.create.many.success',
|
|
83
|
+
GET_SUCCESS: 'task.label.get.success',
|
|
84
|
+
GET_ALL_SUCCESS: 'task.label.get.all.success',
|
|
85
|
+
UPDATE_SUCCESS: 'task.label.update.success',
|
|
86
|
+
UPDATE_MANY_SUCCESS: 'task.label.update.many.success',
|
|
87
|
+
DELETE_SUCCESS: 'task.label.delete.success',
|
|
88
|
+
RESTORE_SUCCESS: 'task.label.restore.success'
|
|
89
|
+
};
|
|
90
|
+
const TASK_COMMENT_MESSAGES = {
|
|
91
|
+
NOT_FOUND: 'task.comment.not.found',
|
|
92
|
+
CREATE_SUCCESS: 'task.comment.create.success',
|
|
93
|
+
CREATE_MANY_SUCCESS: 'task.comment.create.many.success',
|
|
94
|
+
GET_SUCCESS: 'task.comment.get.success',
|
|
95
|
+
GET_ALL_SUCCESS: 'task.comment.get.all.success',
|
|
96
|
+
UPDATE_SUCCESS: 'task.comment.update.success',
|
|
97
|
+
UPDATE_MANY_SUCCESS: 'task.comment.update.many.success',
|
|
98
|
+
DELETE_SUCCESS: 'task.comment.delete.success',
|
|
99
|
+
RESTORE_SUCCESS: 'task.comment.restore.success',
|
|
100
|
+
FORBIDDEN: 'task.comment.forbidden'
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
104
|
+
}, {
|
|
105
|
+
A7: TASK_BOARD_MESSAGES,
|
|
106
|
+
Ao: TASK_LIST_MESSAGES,
|
|
107
|
+
BF: TASK_COMMENT_MESSAGES,
|
|
108
|
+
w6: TASK_LABEL_MESSAGES,
|
|
109
|
+
zJ: TASK_MESSAGES
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
},
|
|
114
|
+
924(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
115
|
+
const TASK_MANAGER_MODULE_OPTIONS = 'TASK_MANAGER_MODULE_OPTIONS';
|
|
116
|
+
|
|
117
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
118
|
+
}, {
|
|
119
|
+
K: TASK_MANAGER_MODULE_OPTIONS
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
},
|
|
124
|
+
484(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
125
|
+
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
126
|
+
/* import */ var _entities_index_js__rspack_import_1 = __webpack_require__(119);
|
|
127
|
+
/* import */ var _task_manager_datasource_provider_js__rspack_import_2 = __webpack_require__(447);
|
|
128
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
129
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
130
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
131
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
132
|
+
} else {
|
|
133
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
134
|
+
if (d = decorators[i]) {
|
|
135
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
140
|
+
}
|
|
141
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
142
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
143
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function _ts_param(paramIndex, decorator) {
|
|
147
|
+
return function(target, key) {
|
|
148
|
+
decorator(target, key, paramIndex);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class TaskActivityService {
|
|
155
|
+
dataSourceProvider;
|
|
156
|
+
repository = null;
|
|
157
|
+
constructor(dataSourceProvider){
|
|
158
|
+
this.dataSourceProvider = dataSourceProvider;
|
|
159
|
+
}
|
|
160
|
+
async log(taskId, boardId, userId, action, oldValue, newValue) {
|
|
161
|
+
const repo = await this.ensureRepository();
|
|
162
|
+
const activity = repo.create({
|
|
163
|
+
taskId,
|
|
164
|
+
boardId,
|
|
165
|
+
userId,
|
|
166
|
+
action,
|
|
167
|
+
oldValue,
|
|
168
|
+
newValue
|
|
169
|
+
});
|
|
170
|
+
await repo.save(activity);
|
|
171
|
+
}
|
|
172
|
+
async ensureRepository() {
|
|
173
|
+
if (!this.repository) {
|
|
174
|
+
this.repository = await this.dataSourceProvider.getRepository(_entities_index_js__rspack_import_1/* .TaskActivity */.V2);
|
|
175
|
+
}
|
|
176
|
+
return this.repository;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
TaskActivityService = _ts_decorate([
|
|
180
|
+
(0,_nestjs_common__rspack_import_0.Injectable)({
|
|
181
|
+
scope: _nestjs_common__rspack_import_0.Scope.REQUEST
|
|
182
|
+
}),
|
|
183
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_0.Inject)(_task_manager_datasource_provider_js__rspack_import_2/* .TaskManagerDataSourceProvider */.F)),
|
|
184
|
+
_ts_metadata("design:type", Function),
|
|
185
|
+
_ts_metadata("design:paramtypes", [
|
|
186
|
+
typeof _task_manager_datasource_provider_js__rspack_import_2/* .TaskManagerDataSourceProvider */.F === "undefined" ? Object : _task_manager_datasource_provider_js__rspack_import_2/* .TaskManagerDataSourceProvider */.F
|
|
187
|
+
])
|
|
188
|
+
], TaskActivityService);
|
|
189
|
+
|
|
190
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
191
|
+
U: () => (TaskActivityService)
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
},
|
|
196
|
+
481(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
197
|
+
|
|
198
|
+
// EXPORTS
|
|
199
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
200
|
+
D: () => (/* binding */ TaskBoardService)
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/classes"
|
|
204
|
+
var classes_ = __webpack_require__(937);
|
|
205
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
206
|
+
var modules_ = __webpack_require__(236);
|
|
207
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/utils"
|
|
208
|
+
|
|
209
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
210
|
+
var common_ = __webpack_require__(157);
|
|
211
|
+
// EXTERNAL MODULE: external "typeorm"
|
|
212
|
+
var external_typeorm_ = __webpack_require__(158);
|
|
213
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/config/event-actions.ts
|
|
214
|
+
var event_actions = __webpack_require__(56);
|
|
215
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/config/message-keys.ts
|
|
216
|
+
var message_keys = __webpack_require__(918);
|
|
217
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/entities/index.ts + 8 modules
|
|
218
|
+
var src_entities = __webpack_require__(119);
|
|
219
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/services/task-manager-config.service.ts
|
|
220
|
+
var task_manager_config_service = __webpack_require__(973);
|
|
221
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/services/task-manager-datasource.provider.ts + 1 modules
|
|
222
|
+
var task_manager_datasource_provider = __webpack_require__(447);
|
|
223
|
+
;// CONCATENATED MODULE: ./projects/nestjs-task-manager/src/services/task-board.service.ts
|
|
224
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
225
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
226
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
227
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
228
|
+
} else {
|
|
229
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
230
|
+
if (d = decorators[i]) {
|
|
231
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
236
|
+
}
|
|
237
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
238
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
239
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function _ts_param(paramIndex, decorator) {
|
|
243
|
+
return function(target, key) {
|
|
244
|
+
decorator(target, key, paramIndex);
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class TaskBoardService extends classes_.ApiService {
|
|
257
|
+
cacheManager;
|
|
258
|
+
utilsService;
|
|
259
|
+
config;
|
|
260
|
+
dataSourceProvider;
|
|
261
|
+
memberRepository = null;
|
|
262
|
+
constructor(cacheManager, utilsService, config, dataSourceProvider){
|
|
263
|
+
super(event_actions/* .TASK_MANAGER_EVENT_ENTITIES.TASK_BOARD */.pl.TASK_BOARD, cacheManager, utilsService, TaskBoardService.name, true, event_actions/* .TASK_MANAGER_EVENT_MODULE */.kf, dataSourceProvider, config.isCompanyFeatureEnabled() ? src_entities/* .TaskBoardWithCompany */.Zz : src_entities/* .TaskBoard */.Ow), this.cacheManager = cacheManager, this.utilsService = utilsService, this.config = config, this.dataSourceProvider = dataSourceProvider;
|
|
264
|
+
}
|
|
265
|
+
async convertSingleDtoToEntity(dto, user) {
|
|
266
|
+
await this.ensureDataSourceRepository();
|
|
267
|
+
let entity = {};
|
|
268
|
+
if ('id' in dto && dto.id) {
|
|
269
|
+
const existing = await this.repository.findOne({
|
|
270
|
+
where: {
|
|
271
|
+
id: dto.id
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
if (!existing) throw new common_.NotFoundException({
|
|
275
|
+
message: 'Board not found',
|
|
276
|
+
messageKey: message_keys/* .TASK_BOARD_MESSAGES.NOT_FOUND */.A7.NOT_FOUND
|
|
277
|
+
});
|
|
278
|
+
entity = existing;
|
|
279
|
+
}
|
|
280
|
+
const merged = {
|
|
281
|
+
...entity,
|
|
282
|
+
name: dto.name ?? entity.name,
|
|
283
|
+
description: dto.description !== undefined ? dto.description ?? null : entity.description ?? null,
|
|
284
|
+
color: dto.color ?? entity.color ?? '#3B82F6',
|
|
285
|
+
isActive: ('isActive' in dto ? dto.isActive : undefined) ?? entity.isActive ?? true
|
|
286
|
+
};
|
|
287
|
+
if (this.config.isCompanyFeatureEnabled()) {
|
|
288
|
+
merged.companyId = user?.companyId ?? null;
|
|
289
|
+
}
|
|
290
|
+
return merged;
|
|
291
|
+
}
|
|
292
|
+
async getExtraManipulateQuery(query, filterDto, user) {
|
|
293
|
+
await super.getExtraManipulateQuery(query, filterDto, user);
|
|
294
|
+
(0,__rspack_external__flusys_nestjs_shared_utils_9125c1f1.applyCompanyFilter)(query, {
|
|
295
|
+
isCompanyFeatureEnabled: this.config.isCompanyFeatureEnabled(),
|
|
296
|
+
entityAlias: 'task_board'
|
|
297
|
+
}, user);
|
|
298
|
+
if (user?.id) {
|
|
299
|
+
query.innerJoin('task_board_member', 'tbm_filter', 'tbm_filter.board_id = task_board.id AND tbm_filter.user_id = :currentUserId AND tbm_filter.deleted_at IS NULL', {
|
|
300
|
+
currentUserId: user.id
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
query.addSelect('task_board.createdAt').addSelect('task_board.updatedAt').addSelect(`(SELECT CAST(COUNT(*) AS ${(0,classes_.getCastIntType)()}) FROM task_board_member tbm WHERE tbm.board_id = task_board.id AND tbm.deleted_at IS NULL)`, 'total_members').addSelect(`(SELECT CAST(COUNT(*) AS ${(0,classes_.getCastIntType)()}) FROM task_list tl WHERE tl.board_id = task_board.id AND tl.is_active = true AND tl.deleted_at IS NULL)`, 'total_lists').addSelect(`(SELECT CAST(COUNT(*) AS ${(0,classes_.getCastIntType)()}) FROM task t WHERE t.board_id = task_board.id AND t.deleted_at IS NULL)`, 'total_tasks');
|
|
304
|
+
return {
|
|
305
|
+
query,
|
|
306
|
+
isRaw: true
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
convertEntityToResponseDto(entity, isRaw) {
|
|
310
|
+
if (!isRaw) return super.convertEntityToResponseDto(entity, isRaw);
|
|
311
|
+
const prefix = `${this.entityName}_`;
|
|
312
|
+
const mapped = {};
|
|
313
|
+
for (const [key, value] of Object.entries(entity)){
|
|
314
|
+
const rawKey = key.startsWith(prefix) ? key.slice(prefix.length) : key;
|
|
315
|
+
const camelKey = rawKey.replace(/_([a-z])/g, (_, c)=>c.toUpperCase());
|
|
316
|
+
mapped[camelKey] = typeof value === 'string' && value !== '' && !isNaN(Number(value)) ? Number(value) : value;
|
|
317
|
+
}
|
|
318
|
+
return mapped;
|
|
319
|
+
}
|
|
320
|
+
async addMember(dto, user) {
|
|
321
|
+
await this.ensureDataSourceRepository();
|
|
322
|
+
const memberRepo = await this.ensureMemberRepository();
|
|
323
|
+
const board = await this.repository.findOne({
|
|
324
|
+
where: {
|
|
325
|
+
id: dto.boardId
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
if (!board) throw new common_.NotFoundException({
|
|
329
|
+
message: 'Board not found',
|
|
330
|
+
messageKey: message_keys/* .TASK_BOARD_MESSAGES.NOT_FOUND */.A7.NOT_FOUND
|
|
331
|
+
});
|
|
332
|
+
const existing = await memberRepo.findOne({
|
|
333
|
+
where: {
|
|
334
|
+
boardId: dto.boardId,
|
|
335
|
+
userId: dto.userId,
|
|
336
|
+
deletedAt: (0,external_typeorm_.IsNull)()
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
if (existing) throw new common_.BadRequestException({
|
|
340
|
+
message: 'User is already a board member',
|
|
341
|
+
messageKey: message_keys/* .TASK_BOARD_MESSAGES.MEMBER_ALREADY_EXISTS */.A7.MEMBER_ALREADY_EXISTS
|
|
342
|
+
});
|
|
343
|
+
const softDeleted = await memberRepo.findOne({
|
|
344
|
+
where: {
|
|
345
|
+
boardId: dto.boardId,
|
|
346
|
+
userId: dto.userId
|
|
347
|
+
},
|
|
348
|
+
withDeleted: true
|
|
349
|
+
});
|
|
350
|
+
if (softDeleted) {
|
|
351
|
+
await memberRepo.restore({
|
|
352
|
+
id: softDeleted.id
|
|
353
|
+
});
|
|
354
|
+
await memberRepo.update({
|
|
355
|
+
id: softDeleted.id
|
|
356
|
+
}, {
|
|
357
|
+
role: dto.role ?? src_entities/* .BoardMemberRole.MEMBER */.jH.MEMBER
|
|
358
|
+
});
|
|
359
|
+
const restored = await memberRepo.findOne({
|
|
360
|
+
where: {
|
|
361
|
+
id: softDeleted.id
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
await this.invalidateBoardCache(dto.boardId);
|
|
365
|
+
return restored;
|
|
366
|
+
}
|
|
367
|
+
const member = memberRepo.create({
|
|
368
|
+
boardId: dto.boardId,
|
|
369
|
+
userId: dto.userId,
|
|
370
|
+
role: dto.role ?? src_entities/* .BoardMemberRole.MEMBER */.jH.MEMBER,
|
|
371
|
+
createdById: user.id
|
|
372
|
+
});
|
|
373
|
+
const saved = await memberRepo.save(member);
|
|
374
|
+
await this.invalidateBoardCache(dto.boardId);
|
|
375
|
+
return saved;
|
|
376
|
+
}
|
|
377
|
+
async removeMember(dto) {
|
|
378
|
+
const memberRepo = await this.ensureMemberRepository();
|
|
379
|
+
const member = await memberRepo.findOne({
|
|
380
|
+
where: {
|
|
381
|
+
boardId: dto.boardId,
|
|
382
|
+
userId: dto.userId,
|
|
383
|
+
deletedAt: (0,external_typeorm_.IsNull)()
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
if (!member) throw new common_.NotFoundException({
|
|
387
|
+
message: 'Member not found',
|
|
388
|
+
messageKey: message_keys/* .TASK_BOARD_MESSAGES.MEMBER_NOT_FOUND */.A7.MEMBER_NOT_FOUND
|
|
389
|
+
});
|
|
390
|
+
await memberRepo.update({
|
|
391
|
+
id: member.id
|
|
392
|
+
}, {
|
|
393
|
+
deletedAt: new Date()
|
|
394
|
+
});
|
|
395
|
+
await this.invalidateBoardCache(dto.boardId);
|
|
396
|
+
}
|
|
397
|
+
async getMembers(boardId) {
|
|
398
|
+
const memberRepo = await this.ensureMemberRepository();
|
|
399
|
+
const { entities, raw } = await memberRepo.createQueryBuilder('tbm').leftJoin('app_user', 'u', 'u.id = tbm.user_id').addSelect('u.name', 'userName').addSelect('u.email', 'userEmail').where('tbm.board_id = :boardId', {
|
|
400
|
+
boardId
|
|
401
|
+
}).andWhere('tbm.deleted_at IS NULL').orderBy('tbm.created_at', 'ASC').getRawAndEntities();
|
|
402
|
+
return entities.map((entity, i)=>({
|
|
403
|
+
...entity,
|
|
404
|
+
userName: raw[i]?.userName ?? null,
|
|
405
|
+
userEmail: raw[i]?.userEmail ?? null
|
|
406
|
+
}));
|
|
407
|
+
}
|
|
408
|
+
async isBoardMember(boardId, userId) {
|
|
409
|
+
const memberRepo = await this.ensureMemberRepository();
|
|
410
|
+
const count = await memberRepo.count({
|
|
411
|
+
where: {
|
|
412
|
+
boardId,
|
|
413
|
+
userId,
|
|
414
|
+
deletedAt: (0,external_typeorm_.IsNull)()
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
return count > 0;
|
|
418
|
+
}
|
|
419
|
+
async afterInsertOperation(entities, _dto, user, _qr) {
|
|
420
|
+
if (!user?.id) return;
|
|
421
|
+
const memberRepo = await this.ensureMemberRepository();
|
|
422
|
+
await memberRepo.save(entities.map((board)=>memberRepo.create({
|
|
423
|
+
boardId: board.id,
|
|
424
|
+
userId: user.id,
|
|
425
|
+
role: src_entities/* .BoardMemberRole.OWNER */.jH.OWNER,
|
|
426
|
+
createdById: user.id
|
|
427
|
+
})));
|
|
428
|
+
}
|
|
429
|
+
async invalidateBoardCache(boardId) {
|
|
430
|
+
await Promise.all([
|
|
431
|
+
this.clearCacheForAll(),
|
|
432
|
+
this.clearCacheForId([
|
|
433
|
+
{
|
|
434
|
+
id: boardId
|
|
435
|
+
}
|
|
436
|
+
])
|
|
437
|
+
]);
|
|
438
|
+
}
|
|
439
|
+
async ensureMemberRepository() {
|
|
440
|
+
if (!this.memberRepository) {
|
|
441
|
+
this.memberRepository = await this.dataSourceProvider.getRepository(src_entities/* .TaskBoardMember */.sy);
|
|
442
|
+
}
|
|
443
|
+
return this.memberRepository;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
TaskBoardService = _ts_decorate([
|
|
447
|
+
(0,common_.Injectable)({
|
|
448
|
+
scope: common_.Scope.REQUEST
|
|
449
|
+
}),
|
|
450
|
+
_ts_param(0, (0,common_.Inject)('CACHE_INSTANCE')),
|
|
451
|
+
_ts_param(1, (0,common_.Inject)(modules_.UtilsService)),
|
|
452
|
+
_ts_param(2, (0,common_.Inject)(task_manager_config_service/* .TaskManagerConfigService */.O)),
|
|
453
|
+
_ts_param(3, (0,common_.Inject)(task_manager_datasource_provider/* .TaskManagerDataSourceProvider */.F)),
|
|
454
|
+
_ts_metadata("design:type", Function),
|
|
455
|
+
_ts_metadata("design:paramtypes", [
|
|
456
|
+
typeof classes_.HybridCache === "undefined" ? Object : classes_.HybridCache,
|
|
457
|
+
typeof modules_.UtilsService === "undefined" ? Object : modules_.UtilsService,
|
|
458
|
+
typeof task_manager_config_service/* .TaskManagerConfigService */.O === "undefined" ? Object : task_manager_config_service/* .TaskManagerConfigService */.O,
|
|
459
|
+
typeof task_manager_datasource_provider/* .TaskManagerDataSourceProvider */.F === "undefined" ? Object : task_manager_datasource_provider/* .TaskManagerDataSourceProvider */.F
|
|
460
|
+
])
|
|
461
|
+
], TaskBoardService);
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
},
|
|
465
|
+
858(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
466
|
+
/* import */ var _flusys_nestjs_shared_classes__rspack_import_0 = __webpack_require__(937);
|
|
467
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_1 = __webpack_require__(236);
|
|
468
|
+
/* import */ var _nestjs_common__rspack_import_2 = __webpack_require__(157);
|
|
469
|
+
/* import */ var _config_index_js__rspack_import_5 = __webpack_require__(56);
|
|
470
|
+
/* import */ var _config_index_js__rspack_import_6 = __webpack_require__(918);
|
|
471
|
+
/* import */ var _entities_index_js__rspack_import_3 = __webpack_require__(119);
|
|
472
|
+
/* import */ var _task_manager_datasource_provider_js__rspack_import_4 = __webpack_require__(447);
|
|
473
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
474
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
475
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
476
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
477
|
+
} else {
|
|
478
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
479
|
+
if (d = decorators[i]) {
|
|
480
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
485
|
+
}
|
|
486
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
487
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
488
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function _ts_param(paramIndex, decorator) {
|
|
492
|
+
return function(target, key) {
|
|
493
|
+
decorator(target, key, paramIndex);
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
class TaskCommentService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiService {
|
|
503
|
+
cacheManager;
|
|
504
|
+
utilsService;
|
|
505
|
+
dataSourceProvider;
|
|
506
|
+
constructor(cacheManager, utilsService, dataSourceProvider){
|
|
507
|
+
super(_config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_ENTITIES.TASK_COMMENT */.pl.TASK_COMMENT, cacheManager, utilsService, TaskCommentService.name, false, _config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_MODULE */.kf, dataSourceProvider, _entities_index_js__rspack_import_3/* .TaskComment */.r$), this.cacheManager = cacheManager, this.utilsService = utilsService, this.dataSourceProvider = dataSourceProvider;
|
|
508
|
+
}
|
|
509
|
+
async convertSingleDtoToEntity(dto, user) {
|
|
510
|
+
await this.ensureDataSourceRepository();
|
|
511
|
+
let entity = {};
|
|
512
|
+
if ('id' in dto && dto.id) {
|
|
513
|
+
const existing = await this.repository.findOne({
|
|
514
|
+
where: {
|
|
515
|
+
id: dto.id
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
if (!existing) throw new _nestjs_common__rspack_import_2.NotFoundException({
|
|
519
|
+
message: 'Comment not found',
|
|
520
|
+
messageKey: _config_index_js__rspack_import_6/* .TASK_COMMENT_MESSAGES.NOT_FOUND */.BF.NOT_FOUND
|
|
521
|
+
});
|
|
522
|
+
if (existing.userId !== user?.id) throw new _nestjs_common__rspack_import_2.ForbiddenException({
|
|
523
|
+
message: 'Cannot edit another user comment',
|
|
524
|
+
messageKey: _config_index_js__rspack_import_6/* .TASK_COMMENT_MESSAGES.FORBIDDEN */.BF.FORBIDDEN
|
|
525
|
+
});
|
|
526
|
+
entity = existing;
|
|
527
|
+
}
|
|
528
|
+
const taskId = ('taskId' in dto ? dto.taskId : undefined) ?? entity.taskId;
|
|
529
|
+
return {
|
|
530
|
+
...entity,
|
|
531
|
+
taskId,
|
|
532
|
+
userId: entity.userId !== undefined ? entity.userId : user?.id ?? null,
|
|
533
|
+
content: dto.content,
|
|
534
|
+
parentCommentId: 'parentCommentId' in dto ? dto.parentCommentId ?? null : entity.parentCommentId ?? null
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
async getFilterQuery(query, filter, _user) {
|
|
538
|
+
for (const [key, value] of Object.entries(filter)){
|
|
539
|
+
if (key === 'taskId') {
|
|
540
|
+
query.andWhere('task_comment.taskId = :taskId', {
|
|
541
|
+
taskId: value
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return {
|
|
546
|
+
query,
|
|
547
|
+
isRaw: false
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
TaskCommentService = _ts_decorate([
|
|
552
|
+
(0,_nestjs_common__rspack_import_2.Injectable)({
|
|
553
|
+
scope: _nestjs_common__rspack_import_2.Scope.REQUEST
|
|
554
|
+
}),
|
|
555
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_2.Inject)('CACHE_INSTANCE')),
|
|
556
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_2.Inject)(_flusys_nestjs_shared_modules__rspack_import_1.UtilsService)),
|
|
557
|
+
_ts_param(2, (0,_nestjs_common__rspack_import_2.Inject)(_task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F)),
|
|
558
|
+
_ts_metadata("design:type", Function),
|
|
559
|
+
_ts_metadata("design:paramtypes", [
|
|
560
|
+
typeof _flusys_nestjs_shared_classes__rspack_import_0.HybridCache === "undefined" ? Object : _flusys_nestjs_shared_classes__rspack_import_0.HybridCache,
|
|
561
|
+
typeof _flusys_nestjs_shared_modules__rspack_import_1.UtilsService === "undefined" ? Object : _flusys_nestjs_shared_modules__rspack_import_1.UtilsService,
|
|
562
|
+
typeof _task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F === "undefined" ? Object : _task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F
|
|
563
|
+
])
|
|
564
|
+
], TaskCommentService);
|
|
565
|
+
|
|
566
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
567
|
+
m: () => (TaskCommentService)
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
},
|
|
572
|
+
337(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
573
|
+
/* import */ var _flusys_nestjs_shared_classes__rspack_import_0 = __webpack_require__(937);
|
|
574
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_1 = __webpack_require__(236);
|
|
575
|
+
/* import */ var _nestjs_common__rspack_import_2 = __webpack_require__(157);
|
|
576
|
+
/* import */ var _config_index_js__rspack_import_5 = __webpack_require__(56);
|
|
577
|
+
/* import */ var _config_index_js__rspack_import_6 = __webpack_require__(918);
|
|
578
|
+
/* import */ var _entities_index_js__rspack_import_3 = __webpack_require__(119);
|
|
579
|
+
/* import */ var _task_manager_datasource_provider_js__rspack_import_4 = __webpack_require__(447);
|
|
580
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
581
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
582
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
583
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
584
|
+
} else {
|
|
585
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
586
|
+
if (d = decorators[i]) {
|
|
587
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
592
|
+
}
|
|
593
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
594
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
595
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function _ts_param(paramIndex, decorator) {
|
|
599
|
+
return function(target, key) {
|
|
600
|
+
decorator(target, key, paramIndex);
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
class TaskLabelService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiService {
|
|
610
|
+
cacheManager;
|
|
611
|
+
utilsService;
|
|
612
|
+
dataSourceProvider;
|
|
613
|
+
constructor(cacheManager, utilsService, dataSourceProvider){
|
|
614
|
+
super(_config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_ENTITIES.TASK_LABEL */.pl.TASK_LABEL, cacheManager, utilsService, TaskLabelService.name, true, _config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_MODULE */.kf, dataSourceProvider, _entities_index_js__rspack_import_3/* .TaskLabel */.mR), this.cacheManager = cacheManager, this.utilsService = utilsService, this.dataSourceProvider = dataSourceProvider;
|
|
615
|
+
}
|
|
616
|
+
async convertSingleDtoToEntity(dto, _user) {
|
|
617
|
+
await this.ensureDataSourceRepository();
|
|
618
|
+
let entity = {};
|
|
619
|
+
if ('id' in dto && dto.id) {
|
|
620
|
+
const existing = await this.repository.findOne({
|
|
621
|
+
where: {
|
|
622
|
+
id: dto.id
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
if (!existing) throw new _nestjs_common__rspack_import_2.NotFoundException({
|
|
626
|
+
message: 'Label not found',
|
|
627
|
+
messageKey: _config_index_js__rspack_import_6/* .TASK_LABEL_MESSAGES.NOT_FOUND */.w6.NOT_FOUND
|
|
628
|
+
});
|
|
629
|
+
entity = existing;
|
|
630
|
+
}
|
|
631
|
+
return {
|
|
632
|
+
...entity,
|
|
633
|
+
boardId: dto.boardId ?? entity.boardId,
|
|
634
|
+
name: dto.name ?? entity.name,
|
|
635
|
+
color: dto.color ?? entity.color ?? '#10B981'
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
async getFilterQuery(query, filter, _user) {
|
|
639
|
+
for (const [key, value] of Object.entries(filter)){
|
|
640
|
+
if (key === 'boardId') {
|
|
641
|
+
query.andWhere('task_label.boardId = :boardId', {
|
|
642
|
+
boardId: value
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return {
|
|
647
|
+
query,
|
|
648
|
+
isRaw: false
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
TaskLabelService = _ts_decorate([
|
|
653
|
+
(0,_nestjs_common__rspack_import_2.Injectable)({
|
|
654
|
+
scope: _nestjs_common__rspack_import_2.Scope.REQUEST
|
|
655
|
+
}),
|
|
656
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_2.Inject)('CACHE_INSTANCE')),
|
|
657
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_2.Inject)(_flusys_nestjs_shared_modules__rspack_import_1.UtilsService)),
|
|
658
|
+
_ts_param(2, (0,_nestjs_common__rspack_import_2.Inject)(_task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F)),
|
|
659
|
+
_ts_metadata("design:type", Function),
|
|
660
|
+
_ts_metadata("design:paramtypes", [
|
|
661
|
+
typeof _flusys_nestjs_shared_classes__rspack_import_0.HybridCache === "undefined" ? Object : _flusys_nestjs_shared_classes__rspack_import_0.HybridCache,
|
|
662
|
+
typeof _flusys_nestjs_shared_modules__rspack_import_1.UtilsService === "undefined" ? Object : _flusys_nestjs_shared_modules__rspack_import_1.UtilsService,
|
|
663
|
+
typeof _task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F === "undefined" ? Object : _task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F
|
|
664
|
+
])
|
|
665
|
+
], TaskLabelService);
|
|
666
|
+
|
|
667
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
668
|
+
Z: () => (TaskLabelService)
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
},
|
|
673
|
+
405(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
674
|
+
/* import */ var _flusys_nestjs_shared_classes__rspack_import_0 = __webpack_require__(937);
|
|
675
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_1 = __webpack_require__(236);
|
|
676
|
+
/* import */ var _nestjs_common__rspack_import_2 = __webpack_require__(157);
|
|
677
|
+
/* import */ var _config_index_js__rspack_import_5 = __webpack_require__(56);
|
|
678
|
+
/* import */ var _config_index_js__rspack_import_6 = __webpack_require__(918);
|
|
679
|
+
/* import */ var _entities_index_js__rspack_import_3 = __webpack_require__(119);
|
|
680
|
+
/* import */ var _task_manager_datasource_provider_js__rspack_import_4 = __webpack_require__(447);
|
|
681
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
682
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
683
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
684
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
685
|
+
} else {
|
|
686
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
687
|
+
if (d = decorators[i]) {
|
|
688
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
693
|
+
}
|
|
694
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
695
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
696
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function _ts_param(paramIndex, decorator) {
|
|
700
|
+
return function(target, key) {
|
|
701
|
+
decorator(target, key, paramIndex);
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
class TaskListService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiService {
|
|
711
|
+
cacheManager;
|
|
712
|
+
utilsService;
|
|
713
|
+
dataSourceProvider;
|
|
714
|
+
constructor(cacheManager, utilsService, dataSourceProvider){
|
|
715
|
+
super(_config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_ENTITIES.TASK_LIST */.pl.TASK_LIST, cacheManager, utilsService, TaskListService.name, true, _config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_MODULE */.kf, dataSourceProvider, _entities_index_js__rspack_import_3/* .TaskList */._0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.dataSourceProvider = dataSourceProvider;
|
|
716
|
+
}
|
|
717
|
+
/** Boards cache denormalized `total_tasks` / `total_lists`, so board caches go stale on any write here. */ async clearCacheForAll() {
|
|
718
|
+
await super.clearCacheForAll();
|
|
719
|
+
await this.utilsService.clearCache(_config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_ENTITIES.TASK_BOARD */.pl.TASK_BOARD, this.cacheManager);
|
|
720
|
+
}
|
|
721
|
+
async convertSingleDtoToEntity(dto, _user) {
|
|
722
|
+
await this.ensureDataSourceRepository();
|
|
723
|
+
let entity = {};
|
|
724
|
+
if ('id' in dto && dto.id) {
|
|
725
|
+
const existing = await this.repository.findOne({
|
|
726
|
+
where: {
|
|
727
|
+
id: dto.id
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
if (!existing) throw new _nestjs_common__rspack_import_2.NotFoundException({
|
|
731
|
+
message: 'List not found',
|
|
732
|
+
messageKey: _config_index_js__rspack_import_6/* .TASK_LIST_MESSAGES.NOT_FOUND */.Ao.NOT_FOUND
|
|
733
|
+
});
|
|
734
|
+
entity = existing;
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
...entity,
|
|
738
|
+
boardId: dto.boardId ?? entity.boardId,
|
|
739
|
+
name: dto.name ?? entity.name,
|
|
740
|
+
color: dto.color ?? entity.color ?? '#6B7280',
|
|
741
|
+
position: dto.position ?? entity.position ?? 0,
|
|
742
|
+
isDoneList: ('isDoneList' in dto ? dto.isDoneList : undefined) ?? entity.isDoneList ?? false,
|
|
743
|
+
isActive: ('isActive' in dto ? dto.isActive : undefined) ?? entity.isActive ?? true
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
async getFilterQuery(query, filter, _user) {
|
|
747
|
+
for (const [key, value] of Object.entries(filter)){
|
|
748
|
+
if (key === 'boardId') {
|
|
749
|
+
query.andWhere('task_list.boardId = :boardId', {
|
|
750
|
+
boardId: value
|
|
751
|
+
});
|
|
752
|
+
} else if (key === 'isActive' && typeof value === 'boolean') {
|
|
753
|
+
query.andWhere('task_list.isActive = :isActive', {
|
|
754
|
+
isActive: value
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
query.orderBy('task_list.position', 'ASC');
|
|
759
|
+
return {
|
|
760
|
+
query,
|
|
761
|
+
isRaw: false
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
async reorderLists(dto) {
|
|
765
|
+
await this.ensureDataSourceRepository();
|
|
766
|
+
await Promise.all(dto.orderedIds.map((id, i)=>this.repository.update({
|
|
767
|
+
id,
|
|
768
|
+
boardId: dto.boardId
|
|
769
|
+
}, {
|
|
770
|
+
position: i * 100
|
|
771
|
+
})));
|
|
772
|
+
await Promise.all([
|
|
773
|
+
this.clearCacheForAll(),
|
|
774
|
+
this.clearCacheForId(dto.orderedIds.map((id)=>({
|
|
775
|
+
id
|
|
776
|
+
})))
|
|
777
|
+
]);
|
|
778
|
+
await this.publishDomainAction(_config_index_js__rspack_import_5/* .TASK_MANAGER_EVENT_ACTIONS.REORDERED */.rG.REORDERED, {
|
|
779
|
+
ids: dto.orderedIds,
|
|
780
|
+
metadata: {
|
|
781
|
+
boardId: dto.boardId
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
TaskListService = _ts_decorate([
|
|
787
|
+
(0,_nestjs_common__rspack_import_2.Injectable)({
|
|
788
|
+
scope: _nestjs_common__rspack_import_2.Scope.REQUEST
|
|
789
|
+
}),
|
|
790
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_2.Inject)('CACHE_INSTANCE')),
|
|
791
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_2.Inject)(_flusys_nestjs_shared_modules__rspack_import_1.UtilsService)),
|
|
792
|
+
_ts_param(2, (0,_nestjs_common__rspack_import_2.Inject)(_task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F)),
|
|
793
|
+
_ts_metadata("design:type", Function),
|
|
794
|
+
_ts_metadata("design:paramtypes", [
|
|
795
|
+
typeof _flusys_nestjs_shared_classes__rspack_import_0.HybridCache === "undefined" ? Object : _flusys_nestjs_shared_classes__rspack_import_0.HybridCache,
|
|
796
|
+
typeof _flusys_nestjs_shared_modules__rspack_import_1.UtilsService === "undefined" ? Object : _flusys_nestjs_shared_modules__rspack_import_1.UtilsService,
|
|
797
|
+
typeof _task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F === "undefined" ? Object : _task_manager_datasource_provider_js__rspack_import_4/* .TaskManagerDataSourceProvider */.F
|
|
798
|
+
])
|
|
799
|
+
], TaskListService);
|
|
800
|
+
|
|
801
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
802
|
+
D: () => (TaskListService)
|
|
803
|
+
});
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
},
|
|
807
|
+
973(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
808
|
+
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
809
|
+
/* import */ var _config_task_manager_constants_js__rspack_import_1 = __webpack_require__(924);
|
|
810
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
811
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
812
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
813
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
814
|
+
} else {
|
|
815
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
816
|
+
if (d = decorators[i]) {
|
|
817
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
822
|
+
}
|
|
823
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
824
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
825
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
function _ts_param(paramIndex, decorator) {
|
|
829
|
+
return function(target, key) {
|
|
830
|
+
decorator(target, key, paramIndex);
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
class TaskManagerConfigService {
|
|
836
|
+
options;
|
|
837
|
+
constructor(options){
|
|
838
|
+
this.options = options;
|
|
839
|
+
}
|
|
840
|
+
isCompanyFeatureEnabled() {
|
|
841
|
+
return this.options.bootstrapAppConfig?.enableCompanyFeature ?? false;
|
|
842
|
+
}
|
|
843
|
+
getDatabaseMode() {
|
|
844
|
+
return this.options.bootstrapAppConfig?.databaseMode ?? 'single';
|
|
845
|
+
}
|
|
846
|
+
isMultiTenant() {
|
|
847
|
+
return this.getDatabaseMode() === 'multi-tenant';
|
|
848
|
+
}
|
|
849
|
+
getJwtSecret() {
|
|
850
|
+
return this.options.config?.jwtSecret;
|
|
851
|
+
}
|
|
852
|
+
getOptions() {
|
|
853
|
+
return this.options;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
TaskManagerConfigService = _ts_decorate([
|
|
857
|
+
(0,_nestjs_common__rspack_import_0.Injectable)(),
|
|
858
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_0.Inject)(_config_task_manager_constants_js__rspack_import_1/* .TASK_MANAGER_MODULE_OPTIONS */.K)),
|
|
859
|
+
_ts_metadata("design:type", Function),
|
|
860
|
+
_ts_metadata("design:paramtypes", [
|
|
861
|
+
typeof TaskManagerModuleOptions === "undefined" ? Object : TaskManagerModuleOptions
|
|
862
|
+
])
|
|
863
|
+
], TaskManagerConfigService);
|
|
864
|
+
|
|
865
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
866
|
+
O: () => (TaskManagerConfigService)
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
},
|
|
871
|
+
447(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
872
|
+
|
|
873
|
+
// EXPORTS
|
|
874
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
875
|
+
F: () => (/* binding */ TaskManagerDataSourceProvider)
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
879
|
+
var modules_ = __webpack_require__(236);
|
|
880
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
881
|
+
var common_ = __webpack_require__(157);
|
|
882
|
+
;// CONCATENATED MODULE: external "@nestjs/core"
|
|
883
|
+
|
|
884
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/entities/index.ts + 8 modules
|
|
885
|
+
var src_entities = __webpack_require__(119);
|
|
886
|
+
// EXTERNAL MODULE: ./projects/nestjs-task-manager/src/services/task-manager-config.service.ts
|
|
887
|
+
var task_manager_config_service = __webpack_require__(973);
|
|
888
|
+
;// CONCATENATED MODULE: ./projects/nestjs-task-manager/src/services/task-manager-datasource.provider.ts
|
|
889
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
890
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
891
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
892
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
893
|
+
} else {
|
|
894
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
895
|
+
if (d = decorators[i]) {
|
|
896
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
901
|
+
}
|
|
902
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
903
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
904
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
function _ts_param(paramIndex, decorator) {
|
|
908
|
+
return function(target, key) {
|
|
909
|
+
decorator(target, key, paramIndex);
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
class TaskManagerDataSourceProvider extends modules_.MultiTenantDataSourceService {
|
|
918
|
+
configService;
|
|
919
|
+
static tenantConnections = new Map();
|
|
920
|
+
static singleDataSource = null;
|
|
921
|
+
static tenantsRegistry = new Map();
|
|
922
|
+
static initialized = false;
|
|
923
|
+
static connectionLocks = new Map();
|
|
924
|
+
static singleConnectionLock = null;
|
|
925
|
+
constructor(configService, request){
|
|
926
|
+
super(TaskManagerDataSourceProvider.buildParentOptions(configService.getOptions()), request), this.configService = configService;
|
|
927
|
+
}
|
|
928
|
+
static buildParentOptions(options) {
|
|
929
|
+
return {
|
|
930
|
+
bootstrapAppConfig: options.bootstrapAppConfig,
|
|
931
|
+
defaultDatabaseConfig: options.config?.defaultDatabaseConfig,
|
|
932
|
+
tenantDefaultDatabaseConfig: options.config?.tenantDefaultDatabaseConfig,
|
|
933
|
+
tenants: options.config?.tenants
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
getEnableCompanyFeatureForTenant(tenant) {
|
|
937
|
+
return tenant?.enableCompanyFeature ?? this.configService.isCompanyFeatureEnabled();
|
|
938
|
+
}
|
|
939
|
+
async createDataSourceFromConfig(config) {
|
|
940
|
+
const currentTenant = this.getCurrentTenant();
|
|
941
|
+
const enableCompanyFeature = this.getEnableCompanyFeatureForTenant(currentTenant ?? undefined);
|
|
942
|
+
const entities = (0,src_entities/* .getTaskManagerEntitiesByConfig */.vP)(enableCompanyFeature);
|
|
943
|
+
return super.createDataSourceFromConfig(config, entities);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
TaskManagerDataSourceProvider = _ts_decorate([
|
|
947
|
+
(0,common_.Injectable)({
|
|
948
|
+
scope: common_.Scope.REQUEST
|
|
949
|
+
}),
|
|
950
|
+
_ts_param(0, (0,common_.Inject)(task_manager_config_service/* .TaskManagerConfigService */.O)),
|
|
951
|
+
_ts_param(1, (0,common_.Optional)()),
|
|
952
|
+
_ts_param(1, (0,common_.Inject)(__rspack_external__nestjs_core_d7b00a1a.REQUEST)),
|
|
953
|
+
_ts_metadata("design:type", Function),
|
|
954
|
+
_ts_metadata("design:paramtypes", [
|
|
955
|
+
typeof task_manager_config_service/* .TaskManagerConfigService */.O === "undefined" ? Object : task_manager_config_service/* .TaskManagerConfigService */.O,
|
|
956
|
+
typeof Request === "undefined" ? Object : Request
|
|
957
|
+
])
|
|
958
|
+
], TaskManagerDataSourceProvider);
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
},
|
|
962
|
+
126(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
963
|
+
/* import */ var _flusys_nestjs_shared_classes__rspack_import_0 = __webpack_require__(937);
|
|
964
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_1 = __webpack_require__(236);
|
|
965
|
+
/* import */ var _nestjs_common__rspack_import_2 = __webpack_require__(157);
|
|
966
|
+
/* import */ var typeorm__rspack_import_3 = __webpack_require__(158);
|
|
967
|
+
/* import */ var _config_index_js__rspack_import_8 = __webpack_require__(56);
|
|
968
|
+
/* import */ var _config_index_js__rspack_import_9 = __webpack_require__(918);
|
|
969
|
+
/* import */ var _entities_index_js__rspack_import_4 = __webpack_require__(119);
|
|
970
|
+
/* import */ var _task_activity_service_js__rspack_import_5 = __webpack_require__(484);
|
|
971
|
+
/* import */ var _task_board_service_js__rspack_import_6 = __webpack_require__(481);
|
|
972
|
+
/* import */ var _task_manager_datasource_provider_js__rspack_import_7 = __webpack_require__(447);
|
|
973
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
974
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
975
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
976
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
977
|
+
} else {
|
|
978
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
979
|
+
if (d = decorators[i]) {
|
|
980
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
985
|
+
}
|
|
986
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
987
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
988
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function _ts_param(paramIndex, decorator) {
|
|
992
|
+
return function(target, key) {
|
|
993
|
+
decorator(target, key, paramIndex);
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
class TaskService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiService {
|
|
1006
|
+
cacheManager;
|
|
1007
|
+
utilsService;
|
|
1008
|
+
dataSourceProvider;
|
|
1009
|
+
boardService;
|
|
1010
|
+
activityService;
|
|
1011
|
+
taskLabelRepository = null;
|
|
1012
|
+
fullLabelRepository = null;
|
|
1013
|
+
taskAssigneeRepository = null;
|
|
1014
|
+
pendingLabelIds = [];
|
|
1015
|
+
pendingAssigneeIds = [];
|
|
1016
|
+
constructor(cacheManager, utilsService, dataSourceProvider, boardService, activityService){
|
|
1017
|
+
super(_config_index_js__rspack_import_8/* .TASK_MANAGER_EVENT_ENTITIES.TASK */.pl.TASK, cacheManager, utilsService, TaskService.name, true, _config_index_js__rspack_import_8/* .TASK_MANAGER_EVENT_MODULE */.kf, dataSourceProvider, _entities_index_js__rspack_import_4/* .Task */.YZ), this.cacheManager = cacheManager, this.utilsService = utilsService, this.dataSourceProvider = dataSourceProvider, this.boardService = boardService, this.activityService = activityService;
|
|
1018
|
+
}
|
|
1019
|
+
/** Boards cache denormalized `total_tasks` / `total_lists`, so board caches go stale on any write here. */ async clearCacheForAll() {
|
|
1020
|
+
await super.clearCacheForAll();
|
|
1021
|
+
await this.utilsService.clearCache(_config_index_js__rspack_import_8/* .TASK_MANAGER_EVENT_ENTITIES.TASK_BOARD */.pl.TASK_BOARD, this.cacheManager);
|
|
1022
|
+
}
|
|
1023
|
+
async convertSingleDtoToEntity(dto, user) {
|
|
1024
|
+
await this.ensureDataSourceRepository();
|
|
1025
|
+
let entity = {};
|
|
1026
|
+
if ('id' in dto && dto.id) {
|
|
1027
|
+
const existing = await this.repository.findOne({
|
|
1028
|
+
where: {
|
|
1029
|
+
id: dto.id
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
if (!existing) throw new _nestjs_common__rspack_import_2.NotFoundException({
|
|
1033
|
+
message: 'Task not found',
|
|
1034
|
+
messageKey: _config_index_js__rspack_import_9/* .TASK_MESSAGES.NOT_FOUND */.zJ.NOT_FOUND
|
|
1035
|
+
});
|
|
1036
|
+
entity = existing;
|
|
1037
|
+
}
|
|
1038
|
+
if (dto.assigneeIds?.length) {
|
|
1039
|
+
const boardId = dto.boardId ?? entity.boardId;
|
|
1040
|
+
const memberChecks = await Promise.all(dto.assigneeIds.map((id)=>this.boardService.isBoardMember(boardId, id)));
|
|
1041
|
+
if (memberChecks.some((isMember)=>!isMember)) {
|
|
1042
|
+
throw new _nestjs_common__rspack_import_2.BadRequestException({
|
|
1043
|
+
message: 'Assignee is not a board member',
|
|
1044
|
+
messageKey: _config_index_js__rspack_import_9/* .TASK_MESSAGES.ASSIGNEE_NOT_BOARD_MEMBER */.zJ.ASSIGNEE_NOT_BOARD_MEMBER
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
if ('labelIds' in dto && dto.labelIds !== undefined) {
|
|
1049
|
+
this.pendingLabelIds.push(dto.labelIds ?? []);
|
|
1050
|
+
}
|
|
1051
|
+
if ('assigneeIds' in dto && dto.assigneeIds !== undefined) {
|
|
1052
|
+
this.pendingAssigneeIds.push(dto.assigneeIds ?? []);
|
|
1053
|
+
} else {
|
|
1054
|
+
this.pendingAssigneeIds.push(undefined);
|
|
1055
|
+
}
|
|
1056
|
+
return {
|
|
1057
|
+
...entity,
|
|
1058
|
+
boardId: dto.boardId ?? entity.boardId,
|
|
1059
|
+
listId: dto.listId ?? entity.listId,
|
|
1060
|
+
title: dto.title ?? entity.title,
|
|
1061
|
+
description: dto.description !== undefined ? dto.description ?? null : entity.description ?? null,
|
|
1062
|
+
priority: dto.priority ?? entity.priority ?? 'MEDIUM',
|
|
1063
|
+
dueDate: dto.dueDate !== undefined ? dto.dueDate ?? null : entity.dueDate ?? null,
|
|
1064
|
+
position: entity.position ?? 0,
|
|
1065
|
+
reporterId: entity.reporterId ?? user?.id ?? null,
|
|
1066
|
+
parentTaskId: dto.parentTaskId !== undefined ? dto.parentTaskId ?? null : entity.parentTaskId ?? null,
|
|
1067
|
+
estimatedHours: dto.estimatedHours !== undefined ? dto.estimatedHours ?? null : entity.estimatedHours ?? null
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
async afterInsertOperation(entities, _dto, user, _qr) {
|
|
1071
|
+
await Promise.all(entities.map(async (entity, i)=>{
|
|
1072
|
+
const assigneeIds = this.pendingAssigneeIds[i] ?? [];
|
|
1073
|
+
const syncOps = [
|
|
1074
|
+
this.syncLabels(entity.id, this.pendingLabelIds[i] ?? [])
|
|
1075
|
+
];
|
|
1076
|
+
if (assigneeIds.length > 0) {
|
|
1077
|
+
syncOps.push(this.syncAssignees(entity.id, assigneeIds));
|
|
1078
|
+
}
|
|
1079
|
+
await Promise.all(syncOps);
|
|
1080
|
+
}));
|
|
1081
|
+
await Promise.all([
|
|
1082
|
+
this.loadLabelsForTasks(entities),
|
|
1083
|
+
this.loadAssigneesForTasks(entities)
|
|
1084
|
+
]);
|
|
1085
|
+
await Promise.all(entities.map((entity)=>this.activityService.log(entity.id, entity.boardId, user?.id ?? null, 'task.created', null, {
|
|
1086
|
+
title: entity.title
|
|
1087
|
+
})));
|
|
1088
|
+
this.pendingLabelIds = [];
|
|
1089
|
+
this.pendingAssigneeIds = [];
|
|
1090
|
+
}
|
|
1091
|
+
async afterUpdateOperation(entities, _dto, _user, _qr) {
|
|
1092
|
+
await Promise.all(entities.map(async (entity, i)=>{
|
|
1093
|
+
const syncOps = [];
|
|
1094
|
+
if (this.pendingLabelIds[i] !== undefined) {
|
|
1095
|
+
syncOps.push(this.syncLabels(entity.id, this.pendingLabelIds[i]));
|
|
1096
|
+
}
|
|
1097
|
+
if (this.pendingAssigneeIds[i] !== undefined) {
|
|
1098
|
+
syncOps.push(this.syncAssignees(entity.id, this.pendingAssigneeIds[i]));
|
|
1099
|
+
}
|
|
1100
|
+
if (syncOps.length > 0) await Promise.all(syncOps);
|
|
1101
|
+
}));
|
|
1102
|
+
await this.loadLabelsForTasks(entities);
|
|
1103
|
+
const entitiesWithAssigneeUpdates = entities.filter((_, i)=>this.pendingAssigneeIds[i] !== undefined);
|
|
1104
|
+
if (entitiesWithAssigneeUpdates.length > 0) {
|
|
1105
|
+
await this.loadAssigneesForTasks(entitiesWithAssigneeUpdates);
|
|
1106
|
+
}
|
|
1107
|
+
this.pendingLabelIds = [];
|
|
1108
|
+
this.pendingAssigneeIds = [];
|
|
1109
|
+
}
|
|
1110
|
+
async getFilterQuery(query, filter, _user) {
|
|
1111
|
+
for (const [key, value] of Object.entries(filter)){
|
|
1112
|
+
if (key === 'boardId') {
|
|
1113
|
+
query.andWhere('task.boardId = :boardId', {
|
|
1114
|
+
boardId: value
|
|
1115
|
+
});
|
|
1116
|
+
} else if (key === 'listId') {
|
|
1117
|
+
query.andWhere('task.listId = :listId', {
|
|
1118
|
+
listId: value
|
|
1119
|
+
});
|
|
1120
|
+
} else if (key === 'assigneeId') {
|
|
1121
|
+
query.innerJoin('task_assignee', 'ta', 'ta.task_id = task.id').andWhere('ta.user_id = :assigneeUserId', {
|
|
1122
|
+
assigneeUserId: value
|
|
1123
|
+
});
|
|
1124
|
+
} else if (key === 'priority') {
|
|
1125
|
+
query.andWhere('task.priority = :priority', {
|
|
1126
|
+
priority: value
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
return {
|
|
1131
|
+
query,
|
|
1132
|
+
isRaw: false
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
async getAll(search, filterAndPaginationDto, user) {
|
|
1136
|
+
const result = await super.getAll(search, filterAndPaginationDto, user);
|
|
1137
|
+
await this.loadLabelsForTasks(result.data);
|
|
1138
|
+
await this.loadAssigneesForTasks(result.data);
|
|
1139
|
+
return result;
|
|
1140
|
+
}
|
|
1141
|
+
async moveTask(dto, user) {
|
|
1142
|
+
await this.ensureDataSourceRepository();
|
|
1143
|
+
const task = await this.repository.findOne({
|
|
1144
|
+
where: {
|
|
1145
|
+
id: dto.taskId,
|
|
1146
|
+
deletedAt: (0,typeorm__rspack_import_3.IsNull)()
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
if (!task) throw new _nestjs_common__rspack_import_2.NotFoundException({
|
|
1150
|
+
message: 'Task not found',
|
|
1151
|
+
messageKey: _config_index_js__rspack_import_9/* .TASK_MESSAGES.NOT_FOUND */.zJ.NOT_FOUND
|
|
1152
|
+
});
|
|
1153
|
+
const oldListId = task.listId;
|
|
1154
|
+
task.listId = dto.targetListId;
|
|
1155
|
+
task.position = dto.position ?? 0;
|
|
1156
|
+
task.updatedById = user.id;
|
|
1157
|
+
const saved = await this.repository.save(task);
|
|
1158
|
+
await this.activityService.log(task.id, task.boardId, user.id, 'task.moved', {
|
|
1159
|
+
listId: oldListId
|
|
1160
|
+
}, {
|
|
1161
|
+
listId: dto.targetListId
|
|
1162
|
+
});
|
|
1163
|
+
await Promise.all([
|
|
1164
|
+
this.clearCacheForAll(),
|
|
1165
|
+
this.clearCacheForId([
|
|
1166
|
+
saved
|
|
1167
|
+
])
|
|
1168
|
+
]);
|
|
1169
|
+
await this.publishDomainAction(_config_index_js__rspack_import_8/* .TASK_MANAGER_EVENT_ACTIONS.MOVED */.rG.MOVED, {
|
|
1170
|
+
ids: [
|
|
1171
|
+
saved.id
|
|
1172
|
+
],
|
|
1173
|
+
metadata: {
|
|
1174
|
+
boardId: saved.boardId,
|
|
1175
|
+
fromListId: oldListId,
|
|
1176
|
+
toListId: dto.targetListId,
|
|
1177
|
+
position: saved.position
|
|
1178
|
+
},
|
|
1179
|
+
user
|
|
1180
|
+
});
|
|
1181
|
+
return saved;
|
|
1182
|
+
}
|
|
1183
|
+
async assignTask(dto, user) {
|
|
1184
|
+
await this.ensureDataSourceRepository();
|
|
1185
|
+
const task = await this.repository.findOne({
|
|
1186
|
+
where: {
|
|
1187
|
+
id: dto.taskId,
|
|
1188
|
+
deletedAt: (0,typeorm__rspack_import_3.IsNull)()
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
if (!task) throw new _nestjs_common__rspack_import_2.NotFoundException({
|
|
1192
|
+
message: 'Task not found',
|
|
1193
|
+
messageKey: _config_index_js__rspack_import_9/* .TASK_MESSAGES.NOT_FOUND */.zJ.NOT_FOUND
|
|
1194
|
+
});
|
|
1195
|
+
const memberChecks = await Promise.all(dto.assigneeIds.map((id)=>this.boardService.isBoardMember(task.boardId, id)));
|
|
1196
|
+
if (memberChecks.some((isMember)=>!isMember)) {
|
|
1197
|
+
throw new _nestjs_common__rspack_import_2.BadRequestException({
|
|
1198
|
+
message: 'Assignee is not a board member',
|
|
1199
|
+
messageKey: _config_index_js__rspack_import_9/* .TASK_MESSAGES.ASSIGNEE_NOT_BOARD_MEMBER */.zJ.ASSIGNEE_NOT_BOARD_MEMBER
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
const assigneeRepo = await this.ensureAssigneeRepository();
|
|
1203
|
+
const oldRows = await assigneeRepo.find({
|
|
1204
|
+
where: {
|
|
1205
|
+
taskId: dto.taskId
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
const oldIds = oldRows.map((r)=>r.userId);
|
|
1209
|
+
await this.syncAssignees(dto.taskId, dto.assigneeIds);
|
|
1210
|
+
task.updatedById = user.id;
|
|
1211
|
+
const saved = await this.repository.save(task);
|
|
1212
|
+
await this.activityService.log(task.id, task.boardId, user.id, 'task.assigned', {
|
|
1213
|
+
assigneeIds: oldIds
|
|
1214
|
+
}, {
|
|
1215
|
+
assigneeIds: dto.assigneeIds
|
|
1216
|
+
});
|
|
1217
|
+
await Promise.all([
|
|
1218
|
+
this.clearCacheForAll(),
|
|
1219
|
+
this.clearCacheForId([
|
|
1220
|
+
saved
|
|
1221
|
+
])
|
|
1222
|
+
]);
|
|
1223
|
+
saved.assignees = await this.loadAssigneesForTask(saved.id);
|
|
1224
|
+
await this.publishDomainAction(_config_index_js__rspack_import_8/* .TASK_MANAGER_EVENT_ACTIONS.ASSIGNED */.rG.ASSIGNED, {
|
|
1225
|
+
ids: [
|
|
1226
|
+
saved.id
|
|
1227
|
+
],
|
|
1228
|
+
metadata: {
|
|
1229
|
+
boardId: saved.boardId,
|
|
1230
|
+
previousAssigneeIds: oldIds,
|
|
1231
|
+
assigneeIds: dto.assigneeIds
|
|
1232
|
+
},
|
|
1233
|
+
user
|
|
1234
|
+
});
|
|
1235
|
+
return saved;
|
|
1236
|
+
}
|
|
1237
|
+
async syncAssignees(taskId, userIds) {
|
|
1238
|
+
const repo = await this.ensureAssigneeRepository();
|
|
1239
|
+
await repo.delete({
|
|
1240
|
+
taskId
|
|
1241
|
+
});
|
|
1242
|
+
if (userIds.length > 0) {
|
|
1243
|
+
await repo.save(userIds.map((userId)=>repo.create({
|
|
1244
|
+
taskId,
|
|
1245
|
+
userId
|
|
1246
|
+
})));
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
async syncLabels(taskId, labelIds) {
|
|
1250
|
+
const labelRepo = await this.ensureLabelRepository();
|
|
1251
|
+
await labelRepo.delete({
|
|
1252
|
+
taskId
|
|
1253
|
+
});
|
|
1254
|
+
if (labelIds.length > 0) {
|
|
1255
|
+
const rows = labelIds.map((labelId)=>labelRepo.create({
|
|
1256
|
+
taskId,
|
|
1257
|
+
labelId
|
|
1258
|
+
}));
|
|
1259
|
+
await labelRepo.save(rows);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
async loadLabelsForTasks(tasks) {
|
|
1263
|
+
if (tasks.length === 0) return;
|
|
1264
|
+
const junctionRepo = await this.ensureLabelRepository();
|
|
1265
|
+
const fullRepo = await this.ensureFullLabelRepository();
|
|
1266
|
+
const taskIds = tasks.map((t)=>t.id);
|
|
1267
|
+
const junctionRows = await junctionRepo.find({
|
|
1268
|
+
where: {
|
|
1269
|
+
taskId: (0,typeorm__rspack_import_3.In)(taskIds),
|
|
1270
|
+
deletedAt: (0,typeorm__rspack_import_3.IsNull)()
|
|
1271
|
+
}
|
|
1272
|
+
});
|
|
1273
|
+
const uniqueLabelIds = [
|
|
1274
|
+
...new Set(junctionRows.map((r)=>r.labelId))
|
|
1275
|
+
];
|
|
1276
|
+
const fullLabels = uniqueLabelIds.length > 0 ? await fullRepo.find({
|
|
1277
|
+
where: {
|
|
1278
|
+
id: (0,typeorm__rspack_import_3.In)(uniqueLabelIds),
|
|
1279
|
+
deletedAt: (0,typeorm__rspack_import_3.IsNull)()
|
|
1280
|
+
}
|
|
1281
|
+
}) : [];
|
|
1282
|
+
const labelById = new Map(fullLabels.map((l)=>[
|
|
1283
|
+
l.id,
|
|
1284
|
+
l
|
|
1285
|
+
]));
|
|
1286
|
+
const byTask = new Map();
|
|
1287
|
+
for (const row of junctionRows){
|
|
1288
|
+
const label = labelById.get(row.labelId);
|
|
1289
|
+
if (!label) continue;
|
|
1290
|
+
const list = byTask.get(row.taskId) ?? [];
|
|
1291
|
+
list.push(label);
|
|
1292
|
+
byTask.set(row.taskId, list);
|
|
1293
|
+
}
|
|
1294
|
+
for (const task of tasks){
|
|
1295
|
+
const taskLabels = byTask.get(task.id) ?? [];
|
|
1296
|
+
task.labelIds = taskLabels.map((l)=>l.id);
|
|
1297
|
+
task.labels = taskLabels;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
async loadAssigneesForTasks(tasks) {
|
|
1301
|
+
if (tasks.length === 0) return;
|
|
1302
|
+
const repo = await this.ensureAssigneeRepository();
|
|
1303
|
+
const taskIds = tasks.map((t)=>t.id);
|
|
1304
|
+
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)', {
|
|
1305
|
+
taskIds
|
|
1306
|
+
}).getRawMany();
|
|
1307
|
+
const byTask = new Map();
|
|
1308
|
+
for (const row of rows){
|
|
1309
|
+
const list = byTask.get(row.taskId) ?? [];
|
|
1310
|
+
list.push({
|
|
1311
|
+
userId: row.userId,
|
|
1312
|
+
userName: row.userName ?? null
|
|
1313
|
+
});
|
|
1314
|
+
byTask.set(row.taskId, list);
|
|
1315
|
+
}
|
|
1316
|
+
for (const task of tasks){
|
|
1317
|
+
task.assignees = byTask.get(task.id) ?? [];
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
async loadAssigneesForTask(taskId) {
|
|
1321
|
+
const repo = await this.ensureAssigneeRepository();
|
|
1322
|
+
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', {
|
|
1323
|
+
taskId
|
|
1324
|
+
}).getRawMany();
|
|
1325
|
+
return rows.map((r)=>({
|
|
1326
|
+
userId: r.userId,
|
|
1327
|
+
userName: r.userName ?? null
|
|
1328
|
+
}));
|
|
1329
|
+
}
|
|
1330
|
+
async ensureLabelRepository() {
|
|
1331
|
+
if (!this.taskLabelRepository) {
|
|
1332
|
+
this.taskLabelRepository = await this.dataSourceProvider.getRepository(_entities_index_js__rspack_import_4/* .TaskTaskLabel */.l8);
|
|
1333
|
+
}
|
|
1334
|
+
return this.taskLabelRepository;
|
|
1335
|
+
}
|
|
1336
|
+
async ensureFullLabelRepository() {
|
|
1337
|
+
if (!this.fullLabelRepository) {
|
|
1338
|
+
this.fullLabelRepository = await this.dataSourceProvider.getRepository(_entities_index_js__rspack_import_4/* .TaskLabel */.mR);
|
|
1339
|
+
}
|
|
1340
|
+
return this.fullLabelRepository;
|
|
1341
|
+
}
|
|
1342
|
+
async ensureAssigneeRepository() {
|
|
1343
|
+
if (!this.taskAssigneeRepository) {
|
|
1344
|
+
this.taskAssigneeRepository = await this.dataSourceProvider.getRepository(_entities_index_js__rspack_import_4/* .TaskAssignee */.d7);
|
|
1345
|
+
}
|
|
1346
|
+
return this.taskAssigneeRepository;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
TaskService = _ts_decorate([
|
|
1350
|
+
(0,_nestjs_common__rspack_import_2.Injectable)({
|
|
1351
|
+
scope: _nestjs_common__rspack_import_2.Scope.REQUEST
|
|
1352
|
+
}),
|
|
1353
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_2.Inject)('CACHE_INSTANCE')),
|
|
1354
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_2.Inject)(_flusys_nestjs_shared_modules__rspack_import_1.UtilsService)),
|
|
1355
|
+
_ts_param(2, (0,_nestjs_common__rspack_import_2.Inject)(_task_manager_datasource_provider_js__rspack_import_7/* .TaskManagerDataSourceProvider */.F)),
|
|
1356
|
+
_ts_param(3, (0,_nestjs_common__rspack_import_2.Inject)(_task_board_service_js__rspack_import_6/* .TaskBoardService */.D)),
|
|
1357
|
+
_ts_param(4, (0,_nestjs_common__rspack_import_2.Inject)(_task_activity_service_js__rspack_import_5/* .TaskActivityService */.U)),
|
|
1358
|
+
_ts_metadata("design:type", Function),
|
|
1359
|
+
_ts_metadata("design:paramtypes", [
|
|
1360
|
+
typeof _flusys_nestjs_shared_classes__rspack_import_0.HybridCache === "undefined" ? Object : _flusys_nestjs_shared_classes__rspack_import_0.HybridCache,
|
|
1361
|
+
typeof _flusys_nestjs_shared_modules__rspack_import_1.UtilsService === "undefined" ? Object : _flusys_nestjs_shared_modules__rspack_import_1.UtilsService,
|
|
1362
|
+
typeof _task_manager_datasource_provider_js__rspack_import_7/* .TaskManagerDataSourceProvider */.F === "undefined" ? Object : _task_manager_datasource_provider_js__rspack_import_7/* .TaskManagerDataSourceProvider */.F,
|
|
1363
|
+
typeof _task_board_service_js__rspack_import_6/* .TaskBoardService */.D === "undefined" ? Object : _task_board_service_js__rspack_import_6/* .TaskBoardService */.D,
|
|
1364
|
+
typeof _task_activity_service_js__rspack_import_5/* .TaskActivityService */.U === "undefined" ? Object : _task_activity_service_js__rspack_import_5/* .TaskActivityService */.U
|
|
1365
|
+
])
|
|
1366
|
+
], TaskService);
|
|
1367
|
+
|
|
1368
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1369
|
+
R: () => (TaskService)
|
|
1370
|
+
});
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
},
|
|
1374
|
+
937(module) {
|
|
1375
|
+
|
|
1376
|
+
module.exports = __rspack_external__flusys_nestjs_shared_classes_6076a329;
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
},
|
|
1380
|
+
236(module) {
|
|
1381
|
+
|
|
1382
|
+
module.exports = __rspack_external__flusys_nestjs_shared_modules_24702bee;
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
},
|
|
1386
|
+
157(module) {
|
|
1387
|
+
|
|
1388
|
+
module.exports = __rspack_external__nestjs_common_a04939da;
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
},
|
|
1392
|
+
|
|
1393
|
+
};
|