@dssp/project 1.0.0-alpha.98 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/package.json +14 -14
  2. package/dist-client/bootstrap.d.ts +0 -0
  3. package/dist-client/bootstrap.js +0 -2
  4. package/dist-client/bootstrap.js.map +0 -1
  5. package/dist-client/index.d.ts +0 -1
  6. package/dist-client/index.js +0 -2
  7. package/dist-client/index.js.map +0 -1
  8. package/dist-client/pages/lib/chatbot-widget.d.ts +0 -53
  9. package/dist-client/pages/lib/chatbot-widget.js +0 -631
  10. package/dist-client/pages/lib/chatbot-widget.js.map +0 -1
  11. package/dist-client/pages/lib/select2-component.d.ts +0 -23
  12. package/dist-client/pages/lib/select2-component.js +0 -181
  13. package/dist-client/pages/lib/select2-component.js.map +0 -1
  14. package/dist-client/pages/lib/waether.d.ts +0 -7
  15. package/dist-client/pages/lib/waether.js +0 -156
  16. package/dist-client/pages/lib/waether.js.map +0 -1
  17. package/dist-client/pages/project/component/pagenation.d.ts +0 -18
  18. package/dist-client/pages/project/component/pagenation.js +0 -142
  19. package/dist-client/pages/project/component/pagenation.js.map +0 -1
  20. package/dist-client/pages/project/component/project-update-header.d.ts +0 -1
  21. package/dist-client/pages/project/component/project-update-header.js +0 -121
  22. package/dist-client/pages/project/component/project-update-header.js.map +0 -1
  23. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.d.ts +0 -1
  24. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js +0 -308
  25. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js.map +0 -1
  26. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.d.ts +0 -1
  27. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js +0 -356
  28. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js.map +0 -1
  29. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.d.ts +0 -1
  30. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js +0 -682
  31. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js.map +0 -1
  32. package/dist-client/pages/project/popup/checklist/task-checklist-view.d.ts +0 -33
  33. package/dist-client/pages/project/popup/checklist/task-checklist-view.js +0 -676
  34. package/dist-client/pages/project/popup/checklist/task-checklist-view.js.map +0 -1
  35. package/dist-client/pages/project/popup/popup-plan-export.d.ts +0 -10
  36. package/dist-client/pages/project/popup/popup-plan-export.js +0 -242
  37. package/dist-client/pages/project/popup/popup-plan-export.js.map +0 -1
  38. package/dist-client/pages/project/popup/popup-plan-upload.d.ts +0 -13
  39. package/dist-client/pages/project/popup/popup-plan-upload.js +0 -265
  40. package/dist-client/pages/project/popup/popup-plan-upload.js.map +0 -1
  41. package/dist-client/pages/project/popup/popup-project-create.d.ts +0 -12
  42. package/dist-client/pages/project/popup/popup-project-create.js +0 -152
  43. package/dist-client/pages/project/popup/popup-project-create.js.map +0 -1
  44. package/dist-client/pages/project/popup/popup-task-upload.d.ts +0 -9
  45. package/dist-client/pages/project/popup/popup-task-upload.js +0 -105
  46. package/dist-client/pages/project/popup/popup-task-upload.js.map +0 -1
  47. package/dist-client/pages/project/project-completed-list.d.ts +0 -23
  48. package/dist-client/pages/project/project-completed-list.js +0 -322
  49. package/dist-client/pages/project/project-completed-list.js.map +0 -1
  50. package/dist-client/pages/project/project-detail.d.ts +0 -47
  51. package/dist-client/pages/project/project-detail.js +0 -1065
  52. package/dist-client/pages/project/project-detail.js.map +0 -1
  53. package/dist-client/pages/project/project-list.d.ts +0 -201
  54. package/dist-client/pages/project/project-list.js +0 -410
  55. package/dist-client/pages/project/project-list.js.map +0 -1
  56. package/dist-client/pages/project/project-plan-management.d.ts +0 -33
  57. package/dist-client/pages/project/project-plan-management.js +0 -492
  58. package/dist-client/pages/project/project-plan-management.js.map +0 -1
  59. package/dist-client/pages/project/project-setting-list.d.ts +0 -31
  60. package/dist-client/pages/project/project-setting-list.js +0 -456
  61. package/dist-client/pages/project/project-setting-list.js.map +0 -1
  62. package/dist-client/pages/project/project-task-list.d.ts +0 -18
  63. package/dist-client/pages/project/project-task-list.js +0 -306
  64. package/dist-client/pages/project/project-task-list.js.map +0 -1
  65. package/dist-client/pages/project/project-task.d.ts +0 -51
  66. package/dist-client/pages/project/project-task.js +0 -692
  67. package/dist-client/pages/project/project-task.js.map +0 -1
  68. package/dist-client/pages/project/project-update.d.ts +0 -81
  69. package/dist-client/pages/project/project-update.js +0 -1477
  70. package/dist-client/pages/project/project-update.js.map +0 -1
  71. package/dist-client/pages/resource/construction-detail-type-popup.d.ts +0 -2
  72. package/dist-client/pages/resource/construction-detail-type-popup.js +0 -197
  73. package/dist-client/pages/resource/construction-detail-type-popup.js.map +0 -1
  74. package/dist-client/pages/resource/construction-type-management.d.ts +0 -34
  75. package/dist-client/pages/resource/construction-type-management.js +0 -214
  76. package/dist-client/pages/resource/construction-type-management.js.map +0 -1
  77. package/dist-client/pages/resource/inspection-drawing-type-management.d.ts +0 -48
  78. package/dist-client/pages/resource/inspection-drawing-type-management.js +0 -234
  79. package/dist-client/pages/resource/inspection-drawing-type-management.js.map +0 -1
  80. package/dist-client/pages/resource/inspection-part-popup.d.ts +0 -2
  81. package/dist-client/pages/resource/inspection-part-popup.js +0 -197
  82. package/dist-client/pages/resource/inspection-part-popup.js.map +0 -1
  83. package/dist-client/pages/resource/resource-importer.d.ts +0 -10
  84. package/dist-client/pages/resource/resource-importer.js +0 -101
  85. package/dist-client/pages/resource/resource-importer.js.map +0 -1
  86. package/dist-client/pages/resource/resource-list-page.d.ts +0 -62
  87. package/dist-client/pages/resource/resource-list-page.js +0 -331
  88. package/dist-client/pages/resource/resource-list-page.js.map +0 -1
  89. package/dist-client/pages/resource/worker-type-management.d.ts +0 -34
  90. package/dist-client/pages/resource/worker-type-management.js +0 -180
  91. package/dist-client/pages/resource/worker-type-management.js.map +0 -1
  92. package/dist-client/pages/task/task-importer.d.ts +0 -10
  93. package/dist-client/pages/task/task-importer.js +0 -101
  94. package/dist-client/pages/task/task-importer.js.map +0 -1
  95. package/dist-client/pages/task/task-list-page.d.ts +0 -62
  96. package/dist-client/pages/task/task-list-page.js +0 -322
  97. package/dist-client/pages/task/task-list-page.js.map +0 -1
  98. package/dist-client/pages/task-resource/task-resource-importer.d.ts +0 -10
  99. package/dist-client/pages/task-resource/task-resource-importer.js +0 -101
  100. package/dist-client/pages/task-resource/task-resource-importer.js.map +0 -1
  101. package/dist-client/pages/task-resource/task-resource-list-page.d.ts +0 -62
  102. package/dist-client/pages/task-resource/task-resource-list-page.js +0 -331
  103. package/dist-client/pages/task-resource/task-resource-list-page.js.map +0 -1
  104. package/dist-client/route.d.ts +0 -1
  105. package/dist-client/route.js +0 -44
  106. package/dist-client/route.js.map +0 -1
  107. package/dist-client/shared/domain-context.d.ts +0 -18
  108. package/dist-client/shared/domain-context.js +0 -28
  109. package/dist-client/shared/domain-context.js.map +0 -1
  110. package/dist-client/tsconfig.tsbuildinfo +0 -1
  111. package/dist-client/viewparts/domain-switch.d.ts +0 -19
  112. package/dist-client/viewparts/domain-switch.js +0 -274
  113. package/dist-client/viewparts/domain-switch.js.map +0 -1
  114. package/dist-server/controllers/export-tasks.d.ts +0 -7
  115. package/dist-server/controllers/export-tasks.js +0 -29
  116. package/dist-server/controllers/export-tasks.js.map +0 -1
  117. package/dist-server/controllers/import-task.d.ts +0 -3
  118. package/dist-server/controllers/import-task.js +0 -113
  119. package/dist-server/controllers/import-task.js.map +0 -1
  120. package/dist-server/controllers/index.d.ts +0 -0
  121. package/dist-server/controllers/index.js +0 -1
  122. package/dist-server/controllers/index.js.map +0 -1
  123. package/dist-server/controllers/parse-excel.d.ts +0 -2
  124. package/dist-server/controllers/parse-excel.js +0 -74
  125. package/dist-server/controllers/parse-excel.js.map +0 -1
  126. package/dist-server/controllers/types.d.ts +0 -18
  127. package/dist-server/controllers/types.js +0 -3
  128. package/dist-server/controllers/types.js.map +0 -1
  129. package/dist-server/index.d.ts +0 -3
  130. package/dist-server/index.js +0 -7
  131. package/dist-server/index.js.map +0 -1
  132. package/dist-server/middlewares/index.d.ts +0 -1
  133. package/dist-server/middlewares/index.js +0 -7
  134. package/dist-server/middlewares/index.js.map +0 -1
  135. package/dist-server/migrations/1723861466413-seed-roles.d.ts +0 -5
  136. package/dist-server/migrations/1723861466413-seed-roles.js +0 -117
  137. package/dist-server/migrations/1723861466413-seed-roles.js.map +0 -1
  138. package/dist-server/migrations/1723861466414-seed-codes.d.ts +0 -5
  139. package/dist-server/migrations/1723861466414-seed-codes.js +0 -150
  140. package/dist-server/migrations/1723861466414-seed-codes.js.map +0 -1
  141. package/dist-server/migrations/1723861476419-seed-resources.d.ts +0 -5
  142. package/dist-server/migrations/1723861476419-seed-resources.js +0 -57
  143. package/dist-server/migrations/1723861476419-seed-resources.js.map +0 -1
  144. package/dist-server/migrations/1723861478420-seed-/bsample-project.d.ts +0 -5
  145. package/dist-server/migrations/1723861478420-seed-/bsample-project.js +0 -68
  146. package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +0 -1
  147. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.d.ts +0 -5
  148. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js +0 -189
  149. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +0 -1
  150. package/dist-server/migrations/index.d.ts +0 -1
  151. package/dist-server/migrations/index.js +0 -12
  152. package/dist-server/migrations/index.js.map +0 -1
  153. package/dist-server/routes.d.ts +0 -1
  154. package/dist-server/routes.js +0 -105
  155. package/dist-server/routes.js.map +0 -1
  156. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.d.ts +0 -6
  157. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +0 -56
  158. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +0 -1
  159. package/dist-server/service/construction-detail-type/construction-detail-type-query.d.ts +0 -9
  160. package/dist-server/service/construction-detail-type/construction-detail-type-query.js +0 -53
  161. package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +0 -1
  162. package/dist-server/service/construction-detail-type/construction-detail-type-type.d.ts +0 -11
  163. package/dist-server/service/construction-detail-type/construction-detail-type-type.js +0 -43
  164. package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +0 -1
  165. package/dist-server/service/construction-detail-type/construction-detail-type.d.ts +0 -15
  166. package/dist-server/service/construction-detail-type/construction-detail-type.js +0 -69
  167. package/dist-server/service/construction-detail-type/construction-detail-type.js.map +0 -1
  168. package/dist-server/service/construction-detail-type/index.d.ts +0 -5
  169. package/dist-server/service/construction-detail-type/index.js +0 -9
  170. package/dist-server/service/construction-detail-type/index.js.map +0 -1
  171. package/dist-server/service/construction-type/construction-type-mutation.d.ts +0 -6
  172. package/dist-server/service/construction-type/construction-type-mutation.js +0 -64
  173. package/dist-server/service/construction-type/construction-type-mutation.js.map +0 -1
  174. package/dist-server/service/construction-type/construction-type-query.d.ts +0 -13
  175. package/dist-server/service/construction-type/construction-type-query.js +0 -87
  176. package/dist-server/service/construction-type/construction-type-query.js.map +0 -1
  177. package/dist-server/service/construction-type/construction-type-type.d.ts +0 -12
  178. package/dist-server/service/construction-type/construction-type-type.js +0 -47
  179. package/dist-server/service/construction-type/construction-type-type.js.map +0 -1
  180. package/dist-server/service/construction-type/construction-type.d.ts +0 -19
  181. package/dist-server/service/construction-type/construction-type.js +0 -88
  182. package/dist-server/service/construction-type/construction-type.js.map +0 -1
  183. package/dist-server/service/construction-type/index.d.ts +0 -5
  184. package/dist-server/service/construction-type/index.js +0 -9
  185. package/dist-server/service/construction-type/index.js.map +0 -1
  186. package/dist-server/service/index.d.ts +0 -15
  187. package/dist-server/service/index.js +0 -59
  188. package/dist-server/service/index.js.map +0 -1
  189. package/dist-server/service/inspection-drawing-type/index.d.ts +0 -5
  190. package/dist-server/service/inspection-drawing-type/index.js +0 -9
  191. package/dist-server/service/inspection-drawing-type/index.js.map +0 -1
  192. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.d.ts +0 -6
  193. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +0 -64
  194. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +0 -1
  195. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +0 -12
  196. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +0 -78
  197. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +0 -1
  198. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.d.ts +0 -10
  199. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +0 -39
  200. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +0 -1
  201. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.d.ts +0 -16
  202. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +0 -72
  203. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +0 -1
  204. package/dist-server/service/inspection-part/index.d.ts +0 -5
  205. package/dist-server/service/inspection-part/index.js +0 -9
  206. package/dist-server/service/inspection-part/index.js.map +0 -1
  207. package/dist-server/service/inspection-part/inspection-part-mutation.d.ts +0 -6
  208. package/dist-server/service/inspection-part/inspection-part-mutation.js +0 -55
  209. package/dist-server/service/inspection-part/inspection-part-mutation.js.map +0 -1
  210. package/dist-server/service/inspection-part/inspection-part-query.d.ts +0 -10
  211. package/dist-server/service/inspection-part/inspection-part-query.js +0 -66
  212. package/dist-server/service/inspection-part/inspection-part-query.js.map +0 -1
  213. package/dist-server/service/inspection-part/inspection-part-type.d.ts +0 -11
  214. package/dist-server/service/inspection-part/inspection-part-type.js +0 -43
  215. package/dist-server/service/inspection-part/inspection-part-type.js.map +0 -1
  216. package/dist-server/service/inspection-part/inspection-part.d.ts +0 -15
  217. package/dist-server/service/inspection-part/inspection-part.js +0 -69
  218. package/dist-server/service/inspection-part/inspection-part.js.map +0 -1
  219. package/dist-server/service/manager/index.d.ts +0 -7
  220. package/dist-server/service/manager/index.js +0 -11
  221. package/dist-server/service/manager/index.js.map +0 -1
  222. package/dist-server/service/manager/manager-mutation.d.ts +0 -5
  223. package/dist-server/service/manager/manager-mutation.js +0 -39
  224. package/dist-server/service/manager/manager-mutation.js.map +0 -1
  225. package/dist-server/service/manager/manager-query.d.ts +0 -4
  226. package/dist-server/service/manager/manager-query.js +0 -35
  227. package/dist-server/service/manager/manager-query.js.map +0 -1
  228. package/dist-server/service/manager/manager-type.d.ts +0 -15
  229. package/dist-server/service/manager/manager-type.js +0 -62
  230. package/dist-server/service/manager/manager-type.js.map +0 -1
  231. package/dist-server/service/manager/manager.d.ts +0 -8
  232. package/dist-server/service/manager/manager.js +0 -41
  233. package/dist-server/service/manager/manager.js.map +0 -1
  234. package/dist-server/service/project/index.d.ts +0 -5
  235. package/dist-server/service/project/index.js +0 -9
  236. package/dist-server/service/project/index.js.map +0 -1
  237. package/dist-server/service/project/issue-project-code.d.ts +0 -7
  238. package/dist-server/service/project/issue-project-code.js +0 -27
  239. package/dist-server/service/project/issue-project-code.js.map +0 -1
  240. package/dist-server/service/project/project-mutation.d.ts +0 -14
  241. package/dist-server/service/project/project-mutation.js +0 -448
  242. package/dist-server/service/project/project-mutation.js.map +0 -1
  243. package/dist-server/service/project/project-query.d.ts +0 -31
  244. package/dist-server/service/project/project-query.js +0 -307
  245. package/dist-server/service/project/project-query.js.map +0 -1
  246. package/dist-server/service/project/project-type.d.ts +0 -42
  247. package/dist-server/service/project/project-type.js +0 -152
  248. package/dist-server/service/project/project-type.js.map +0 -1
  249. package/dist-server/service/project/project.d.ts +0 -66
  250. package/dist-server/service/project/project.js +0 -247
  251. package/dist-server/service/project/project.js.map +0 -1
  252. package/dist-server/service/resource/index.d.ts +0 -6
  253. package/dist-server/service/resource/index.js +0 -10
  254. package/dist-server/service/resource/index.js.map +0 -1
  255. package/dist-server/service/resource/resource-mutation.d.ts +0 -10
  256. package/dist-server/service/resource/resource-mutation.js +0 -131
  257. package/dist-server/service/resource/resource-mutation.js.map +0 -1
  258. package/dist-server/service/resource/resource-query.d.ts +0 -11
  259. package/dist-server/service/resource/resource-query.js +0 -76
  260. package/dist-server/service/resource/resource-query.js.map +0 -1
  261. package/dist-server/service/resource/resource-type.d.ts +0 -17
  262. package/dist-server/service/resource/resource-type.js +0 -65
  263. package/dist-server/service/resource/resource-type.js.map +0 -1
  264. package/dist-server/service/resource/resource.d.ts +0 -24
  265. package/dist-server/service/resource/resource.js +0 -93
  266. package/dist-server/service/resource/resource.js.map +0 -1
  267. package/dist-server/service/task/index.d.ts +0 -5
  268. package/dist-server/service/task/index.js +0 -9
  269. package/dist-server/service/task/index.js.map +0 -1
  270. package/dist-server/service/task/task-mutation.d.ts +0 -10
  271. package/dist-server/service/task/task-mutation.js +0 -135
  272. package/dist-server/service/task/task-mutation.js.map +0 -1
  273. package/dist-server/service/task/task-query.d.ts +0 -21
  274. package/dist-server/service/task/task-query.js +0 -219
  275. package/dist-server/service/task/task-query.js.map +0 -1
  276. package/dist-server/service/task/task-type.d.ts +0 -31
  277. package/dist-server/service/task/task-type.js +0 -114
  278. package/dist-server/service/task/task-type.js.map +0 -1
  279. package/dist-server/service/task/task.d.ts +0 -35
  280. package/dist-server/service/task/task.js +0 -151
  281. package/dist-server/service/task/task.js.map +0 -1
  282. package/dist-server/service/task-checklist-binding/index.d.ts +0 -5
  283. package/dist-server/service/task-checklist-binding/index.js +0 -9
  284. package/dist-server/service/task-checklist-binding/index.js.map +0 -1
  285. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.d.ts +0 -5
  286. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js +0 -188
  287. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js.map +0 -1
  288. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.d.ts +0 -8
  289. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js +0 -61
  290. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js.map +0 -1
  291. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.d.ts +0 -15
  292. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js +0 -57
  293. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js.map +0 -1
  294. package/dist-server/service/task-checklist-binding/task-checklist-binding.d.ts +0 -22
  295. package/dist-server/service/task-checklist-binding/task-checklist-binding.js +0 -106
  296. package/dist-server/service/task-checklist-binding/task-checklist-binding.js.map +0 -1
  297. package/dist-server/service/task-resource/index.d.ts +0 -6
  298. package/dist-server/service/task-resource/index.js +0 -10
  299. package/dist-server/service/task-resource/index.js.map +0 -1
  300. package/dist-server/service/task-resource/task-resource-mutation.d.ts +0 -10
  301. package/dist-server/service/task-resource/task-resource-mutation.js +0 -132
  302. package/dist-server/service/task-resource/task-resource-mutation.js.map +0 -1
  303. package/dist-server/service/task-resource/task-resource-query.d.ts +0 -7
  304. package/dist-server/service/task-resource/task-resource-query.js +0 -45
  305. package/dist-server/service/task-resource/task-resource-query.js.map +0 -1
  306. package/dist-server/service/task-resource/task-resource-type.d.ts +0 -17
  307. package/dist-server/service/task-resource/task-resource-type.js +0 -65
  308. package/dist-server/service/task-resource/task-resource-type.js.map +0 -1
  309. package/dist-server/service/task-resource/task-resource.d.ts +0 -13
  310. package/dist-server/service/task-resource/task-resource.js +0 -59
  311. package/dist-server/service/task-resource/task-resource.js.map +0 -1
  312. package/dist-server/service/worker-type/index.d.ts +0 -5
  313. package/dist-server/service/worker-type/index.js +0 -9
  314. package/dist-server/service/worker-type/index.js.map +0 -1
  315. package/dist-server/service/worker-type/worker-type-mutation.d.ts +0 -6
  316. package/dist-server/service/worker-type/worker-type-mutation.js +0 -64
  317. package/dist-server/service/worker-type/worker-type-mutation.js.map +0 -1
  318. package/dist-server/service/worker-type/worker-type-query.d.ts +0 -11
  319. package/dist-server/service/worker-type/worker-type-query.js +0 -73
  320. package/dist-server/service/worker-type/worker-type-query.js.map +0 -1
  321. package/dist-server/service/worker-type/worker-type-type.d.ts +0 -11
  322. package/dist-server/service/worker-type/worker-type-type.js +0 -43
  323. package/dist-server/service/worker-type/worker-type-type.js.map +0 -1
  324. package/dist-server/service/worker-type/worker-type.d.ts +0 -16
  325. package/dist-server/service/worker-type/worker-type.js +0 -77
  326. package/dist-server/service/worker-type/worker-type.js.map +0 -1
  327. package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1,247 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Project = exports.SectorType = exports.BuildingUsage = exports.ProjectType = exports.InputType = exports.ProjectState = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const type_graphql_1 = require("type-graphql");
7
- const shell_1 = require("@things-factory/shell");
8
- const auth_base_1 = require("@things-factory/auth-base");
9
- const task_1 = require("../task/task");
10
- const building_complex_1 = require("@dssp/building-complex");
11
- const attachment_base_1 = require("@things-factory/attachment-base");
12
- var ProjectState;
13
- (function (ProjectState) {
14
- ProjectState["ONGOING"] = "10";
15
- ProjectState["COMPLETED"] = "20";
16
- })(ProjectState || (exports.ProjectState = ProjectState = {}));
17
- var InputType;
18
- (function (InputType) {
19
- InputType["MANUAL"] = "10";
20
- InputType["AUTO"] = "20";
21
- })(InputType || (exports.InputType = InputType = {}));
22
- var ProjectType;
23
- (function (ProjectType) {
24
- ProjectType["DSSP"] = "DSSP";
25
- ProjectType["DCSP"] = "DCSP";
26
- ProjectType["DKPI"] = "DKPI";
27
- })(ProjectType || (exports.ProjectType = ProjectType = {}));
28
- var BuildingUsage;
29
- (function (BuildingUsage) {
30
- BuildingUsage["RESIDENTIAL"] = "RESIDENTIAL";
31
- BuildingUsage["NON_RESIDENTIAL"] = "NON_RESIDENTIAL";
32
- })(BuildingUsage || (exports.BuildingUsage = BuildingUsage = {}));
33
- var SectorType;
34
- (function (SectorType) {
35
- SectorType["PUBLIC"] = "PUBLIC";
36
- SectorType["PRIVATE"] = "PRIVATE";
37
- })(SectorType || (exports.SectorType = SectorType = {}));
38
- (0, type_graphql_1.registerEnumType)(BuildingUsage, {
39
- name: 'BuildingUsage',
40
- description: '건물 용도 (주거/비주거)'
41
- });
42
- (0, type_graphql_1.registerEnumType)(SectorType, {
43
- name: 'SectorType',
44
- description: '발주 유형 (공공/민간)'
45
- });
46
- (0, type_graphql_1.registerEnumType)(ProjectState, {
47
- name: 'ProjectState',
48
- description: '프로젝트 상태 (ONGOING=10 진행중, COMPLETED=20 완료)'
49
- });
50
- let Project = class Project {
51
- };
52
- exports.Project = Project;
53
- tslib_1.__decorate([
54
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
55
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
56
- tslib_1.__metadata("design:type", String)
57
- ], Project.prototype, "id", void 0);
58
- tslib_1.__decorate([
59
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
60
- (0, type_graphql_1.Field)({ nullable: true }),
61
- tslib_1.__metadata("design:type", shell_1.Domain)
62
- ], Project.prototype, "domain", void 0);
63
- tslib_1.__decorate([
64
- (0, typeorm_1.RelationId)((project) => project.domain),
65
- tslib_1.__metadata("design:type", String)
66
- ], Project.prototype, "domainId", void 0);
67
- tslib_1.__decorate([
68
- (0, typeorm_1.Column)({
69
- nullable: true,
70
- unique: true,
71
- comment: '프로젝트 관리번호 (YYYY-NNNNN, 테넌트 승격 시 자동 발번, 정책상 변경 불가 - promoteProjectToTenant 만이 설정)'
72
- }),
73
- (0, type_graphql_1.Field)({ nullable: true }),
74
- tslib_1.__metadata("design:type", String)
75
- ], Project.prototype, "code", void 0);
76
- tslib_1.__decorate([
77
- (0, typeorm_1.Column)({ nullable: false, comment: '프로젝트 이름' }),
78
- (0, type_graphql_1.Field)({ nullable: false }),
79
- tslib_1.__metadata("design:type", String)
80
- ], Project.prototype, "name", void 0);
81
- tslib_1.__decorate([
82
- (0, typeorm_1.Column)({ nullable: true, comment: '문서 네이밍 ({프로젝트 명} 검측 제00-00001호)' }),
83
- (0, type_graphql_1.Field)({ nullable: true }),
84
- tslib_1.__metadata("design:type", String)
85
- ], Project.prototype, "documentNaming", void 0);
86
- tslib_1.__decorate([
87
- (0, typeorm_1.Column)({ nullable: false, default: ProjectState.ONGOING, comment: '프로젝트 상태 (10: 진행중, 20: 완료)' }),
88
- (0, type_graphql_1.Field)({ nullable: false }),
89
- tslib_1.__metadata("design:type", String)
90
- ], Project.prototype, "state", void 0);
91
- tslib_1.__decorate([
92
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '현장 시방서 PDF URL - 검사기준 매칭 API의 site_spec_pdf_url 로 사용 (https 전체 URL)' }),
93
- (0, type_graphql_1.Field)({ nullable: true }),
94
- tslib_1.__metadata("design:type", String)
95
- ], Project.prototype, "siteSpecPdfUrl", void 0);
96
- tslib_1.__decorate([
97
- (0, typeorm_1.Column)({ type: 'date', nullable: true, comment: '착공일정' }),
98
- (0, type_graphql_1.Field)({ nullable: true }),
99
- tslib_1.__metadata("design:type", String)
100
- ], Project.prototype, "startDate", void 0);
101
- tslib_1.__decorate([
102
- (0, typeorm_1.Column)({ type: 'date', nullable: true, comment: '준공일정' }),
103
- (0, type_graphql_1.Field)({ nullable: true }),
104
- tslib_1.__metadata("design:type", String)
105
- ], Project.prototype, "endDate", void 0);
106
- tslib_1.__decorate([
107
- (0, type_graphql_1.Field)(type => attachment_base_1.Attachment, { nullable: true }),
108
- tslib_1.__metadata("design:type", attachment_base_1.Attachment)
109
- ], Project.prototype, "mainPhoto", void 0);
110
- tslib_1.__decorate([
111
- (0, typeorm_1.Column)({ type: 'float', nullable: true, default: 0, transformer: shell_1.roundTransformer, comment: '전체 진행현황' }),
112
- (0, type_graphql_1.Field)({ nullable: true }),
113
- tslib_1.__metadata("design:type", Number)
114
- ], Project.prototype, "totalProgress", void 0);
115
- tslib_1.__decorate([
116
- (0, typeorm_1.Column)({ type: 'float', nullable: true, default: 0, transformer: shell_1.roundTransformer, comment: '주간 진행현황' }),
117
- (0, type_graphql_1.Field)({ nullable: true }),
118
- tslib_1.__metadata("design:type", Number)
119
- ], Project.prototype, "weeklyProgress", void 0);
120
- tslib_1.__decorate([
121
- (0, typeorm_1.Column)({ type: 'float', nullable: true, default: 0, transformer: shell_1.roundTransformer, comment: 'KPI' }),
122
- (0, type_graphql_1.Field)({ nullable: true }),
123
- tslib_1.__metadata("design:type", Number)
124
- ], Project.prototype, "kpi", void 0);
125
- tslib_1.__decorate([
126
- (0, typeorm_1.Column)({ type: 'float', nullable: true, default: 0, transformer: shell_1.roundTransformer, comment: '검측/통과 비율' }),
127
- (0, type_graphql_1.Field)({ nullable: true }),
128
- tslib_1.__metadata("design:type", Number)
129
- ], Project.prototype, "inspPassRate", void 0);
130
- tslib_1.__decorate([
131
- (0, typeorm_1.Column)({ type: 'float', nullable: true, default: 0, transformer: shell_1.roundTransformer, comment: '로봇 작업 진행율' }),
132
- (0, type_graphql_1.Field)({ nullable: true }),
133
- tslib_1.__metadata("design:type", Number)
134
- ], Project.prototype, "robotProgressRate", void 0);
135
- tslib_1.__decorate([
136
- (0, typeorm_1.Column)({ type: 'float', nullable: true, default: 0, transformer: shell_1.roundTransformer, comment: '구조 안전도' }),
137
- (0, type_graphql_1.Field)({ nullable: true }),
138
- tslib_1.__metadata("design:type", Number)
139
- ], Project.prototype, "structuralSafetyRate", void 0);
140
- tslib_1.__decorate([
141
- (0, typeorm_1.Column)({ type: 'int', nullable: true, default: 0, comment: '로봇 작업 대수' }),
142
- (0, type_graphql_1.Field)({ nullable: true }),
143
- tslib_1.__metadata("design:type", Number)
144
- ], Project.prototype, "robotCount", void 0);
145
- tslib_1.__decorate([
146
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '우편 코드 (5자리)' }),
147
- (0, type_graphql_1.Field)({ nullable: true }),
148
- tslib_1.__metadata("design:type", String)
149
- ], Project.prototype, "postalCode", void 0);
150
- tslib_1.__decorate([
151
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '지역 구분 코드 (우편 코드의 앞 2자리)' }),
152
- (0, type_graphql_1.Field)({ nullable: true }),
153
- tslib_1.__metadata("design:type", String)
154
- ], Project.prototype, "geoGroup", void 0);
155
- tslib_1.__decorate([
156
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '프로젝트 유형' }),
157
- (0, type_graphql_1.Field)({ nullable: true }),
158
- tslib_1.__metadata("design:type", String)
159
- ], Project.prototype, "projectType", void 0);
160
- tslib_1.__decorate([
161
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '입력 유형 (MANUAL: 수동, AUTO: 자동)' }),
162
- (0, type_graphql_1.Field)({ nullable: true }),
163
- tslib_1.__metadata("design:type", String)
164
- ], Project.prototype, "inputType", void 0);
165
- tslib_1.__decorate([
166
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '건물 용도 (RESIDENTIAL: 주거, NON_RESIDENTIAL: 비주거)' }),
167
- (0, type_graphql_1.Field)({ nullable: true }),
168
- tslib_1.__metadata("design:type", String)
169
- ], Project.prototype, "buildingUsage", void 0);
170
- tslib_1.__decorate([
171
- (0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '발주 유형 (PUBLIC: 공공, PRIVATE: 민간)' }),
172
- (0, type_graphql_1.Field)({ nullable: true }),
173
- tslib_1.__metadata("design:type", String)
174
- ], Project.prototype, "sectorType", void 0);
175
- tslib_1.__decorate([
176
- (0, typeorm_1.OneToOne)(type => building_complex_1.BuildingComplex),
177
- (0, typeorm_1.JoinColumn)(),
178
- (0, type_graphql_1.Field)({ nullable: true }),
179
- tslib_1.__metadata("design:type", building_complex_1.BuildingComplex)
180
- ], Project.prototype, "buildingComplex", void 0);
181
- tslib_1.__decorate([
182
- (0, typeorm_1.RelationId)((project) => project.buildingComplex),
183
- tslib_1.__metadata("design:type", String)
184
- ], Project.prototype, "buildingComplexId", void 0);
185
- tslib_1.__decorate([
186
- (0, typeorm_1.OneToMany)(() => task_1.Task, task => task.project),
187
- (0, type_graphql_1.Field)(() => [task_1.Task], { nullable: true }),
188
- tslib_1.__metadata("design:type", Array)
189
- ], Project.prototype, "tasks", void 0);
190
- tslib_1.__decorate([
191
- (0, type_graphql_1.Field)(() => [task_1.Task], { nullable: true }),
192
- tslib_1.__metadata("design:type", Array)
193
- ], Project.prototype, "rootTasks", void 0);
194
- tslib_1.__decorate([
195
- (0, typeorm_1.CreateDateColumn)(),
196
- (0, type_graphql_1.Field)({ nullable: true }),
197
- tslib_1.__metadata("design:type", Date)
198
- ], Project.prototype, "createdAt", void 0);
199
- tslib_1.__decorate([
200
- (0, typeorm_1.UpdateDateColumn)(),
201
- (0, type_graphql_1.Field)({ nullable: true }),
202
- tslib_1.__metadata("design:type", Date)
203
- ], Project.prototype, "updatedAt", void 0);
204
- tslib_1.__decorate([
205
- (0, typeorm_1.DeleteDateColumn)(),
206
- (0, type_graphql_1.Field)({ nullable: true }),
207
- tslib_1.__metadata("design:type", Date)
208
- ], Project.prototype, "deletedAt", void 0);
209
- tslib_1.__decorate([
210
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
211
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
212
- tslib_1.__metadata("design:type", auth_base_1.User)
213
- ], Project.prototype, "creator", void 0);
214
- tslib_1.__decorate([
215
- (0, typeorm_1.RelationId)((project) => project.creator),
216
- tslib_1.__metadata("design:type", String)
217
- ], Project.prototype, "creatorId", void 0);
218
- tslib_1.__decorate([
219
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
220
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
221
- tslib_1.__metadata("design:type", auth_base_1.User)
222
- ], Project.prototype, "updater", void 0);
223
- tslib_1.__decorate([
224
- (0, typeorm_1.RelationId)((project) => project.updater),
225
- tslib_1.__metadata("design:type", String)
226
- ], Project.prototype, "updaterId", void 0);
227
- tslib_1.__decorate([
228
- (0, type_graphql_1.Field)(type => attachment_base_1.Attachment, { nullable: true }),
229
- tslib_1.__metadata("design:type", attachment_base_1.Attachment
230
- // 완공 보고서 파일
231
- )
232
- ], Project.prototype, "scheduleTable", void 0);
233
- tslib_1.__decorate([
234
- (0, typeorm_1.ManyToOne)(type => attachment_base_1.Attachment),
235
- (0, type_graphql_1.Field)(type => attachment_base_1.Attachment, { nullable: true }),
236
- tslib_1.__metadata("design:type", attachment_base_1.Attachment)
237
- ], Project.prototype, "completeReport", void 0);
238
- tslib_1.__decorate([
239
- (0, typeorm_1.RelationId)((project) => project.completeReport),
240
- tslib_1.__metadata("design:type", String)
241
- ], Project.prototype, "completeReportId", void 0);
242
- exports.Project = Project = tslib_1.__decorate([
243
- (0, type_graphql_1.ObjectType)({ description: '프로젝트' }),
244
- (0, typeorm_1.Entity)(),
245
- (0, typeorm_1.Index)('ix_project_building', (project) => [project.buildingComplex], { unique: true, where: '"deleted_at" IS NULL' })
246
- ], Project);
247
- //# sourceMappingURL=project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../server/service/project/project.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAsE;AAEtE,iDAAgE;AAChE,yDAAgD;AAChD,uCAAmC;AACnC,6DAAwD;AACxD,qEAA4D;AAE5D,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAgB,CAAA;IAChB,gCAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AACD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,wBAAW,CAAA;AACb,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AACD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,oDAAmC,CAAA;AACrC,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+BAAiB,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ateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToOne,\n OneToMany,\n JoinColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain, roundTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Task } from '../task/task'\nimport { BuildingComplex } from '@dssp/building-complex'\nimport { Attachment } from '@things-factory/attachment-base'\n\nexport enum ProjectState {\n 'ONGOING' = '10',\n 'COMPLETED' = '20'\n}\nexport enum InputType {\n MANUAL = '10',\n AUTO = '20'\n}\nexport enum ProjectType {\n DSSP = 'DSSP',\n DCSP = 'DCSP',\n DKPI = 'DKPI'\n}\n\nexport enum BuildingUsage {\n RESIDENTIAL = 'RESIDENTIAL',\n NON_RESIDENTIAL = 'NON_RESIDENTIAL'\n}\n\nexport enum SectorType {\n PUBLIC = 'PUBLIC',\n PRIVATE = 'PRIVATE'\n}\n\nregisterEnumType(BuildingUsage, {\n name: 'BuildingUsage',\n description: '건물 용도 (주거/비주거)'\n})\n\nregisterEnumType(SectorType, {\n name: 'SectorType',\n description: '발주 유형 (공공/민간)'\n})\n\nregisterEnumType(ProjectState, {\n name: 'ProjectState',\n description: '프로젝트 상태 (ONGOING=10 진행중, COMPLETED=20 완료)'\n})\n\n@ObjectType({ description: '프로젝트' })\n@Entity()\n@Index('ix_project_building', (project: Project) => [project.buildingComplex], { unique: true, where: '\"deleted_at\" IS NULL' })\nexport class Project {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((project: Project) => project.domain)\n domainId?: string\n\n @Column({\n nullable: true,\n unique: true,\n comment: '프로젝트 관리번호 (YYYY-NNNNN, 테넌트 승격 시 자동 발번, 정책상 변경 불가 - promoteProjectToTenant 만이 설정)'\n })\n @Field({ nullable: true })\n code?: string\n\n @Column({ nullable: false, comment: '프로젝트 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: true, comment: '문서 네이밍 ({프로젝트 명} 검측 제00-00001호)' })\n @Field({ nullable: true })\n documentNaming?: string\n\n @Column({ nullable: false, default: ProjectState.ONGOING, comment: '프로젝트 상태 (10: 진행중, 20: 완료)' })\n @Field({ nullable: false })\n state?: ProjectState\n\n @Column({ type: 'text', nullable: true, comment: '현장 시방서 PDF URL - 검사기준 매칭 API의 site_spec_pdf_url 로 사용 (https 전체 URL)' })\n @Field({ nullable: true })\n siteSpecPdfUrl?: string\n\n @Column({ type: 'date', nullable: true, comment: '착공일정' })\n @Field({ nullable: true })\n startDate?: string\n\n @Column({ type: 'date', nullable: true, comment: '준공일정' })\n @Field({ nullable: true })\n endDate?: string\n\n // 대표 사진\n @Field(type => Attachment, { nullable: true })\n mainPhoto?: Attachment\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '전체 진행현황' })\n @Field({ nullable: true })\n totalProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '주간 진행현황' })\n @Field({ nullable: true })\n weeklyProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: 'KPI' })\n @Field({ nullable: true })\n kpi?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '검측/통과 비율' })\n @Field({ nullable: true })\n inspPassRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '로봇 작업 진행율' })\n @Field({ nullable: true })\n robotProgressRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '구조 안전도' })\n @Field({ nullable: true })\n structuralSafetyRate?: number\n\n @Column({ type: 'int', nullable: true, default: 0, comment: '로봇 작업 대수' })\n @Field({ nullable: true })\n robotCount?: number\n\n @Column({ type: 'text', nullable: true, comment: '우편 코드 (5자리)' })\n @Field({ nullable: true })\n postalCode?: string\n\n @Column({ type: 'text', nullable: true, comment: '지역 구분 코드 (우편 코드의 앞 2자리)' })\n @Field({ nullable: true })\n geoGroup?: string\n\n @Column({ type: 'text', nullable: true, comment: '프로젝트 유형' })\n @Field({ nullable: true })\n projectType?: ProjectType\n\n @Column({ type: 'text', nullable: true, comment: '입력 유형 (MANUAL: 수동, AUTO: 자동)' })\n @Field({ nullable: true })\n inputType?: InputType\n\n @Column({ type: 'text', nullable: true, comment: '건물 용도 (RESIDENTIAL: 주거, NON_RESIDENTIAL: 비주거)' })\n @Field({ nullable: true })\n buildingUsage?: BuildingUsage\n\n @Column({ type: 'text', nullable: true, comment: '발주 유형 (PUBLIC: 공공, PRIVATE: 민간)' })\n @Field({ nullable: true })\n sectorType?: SectorType\n\n // 단지 정보 (1:1 테이블 참조)\n @OneToOne(type => BuildingComplex)\n @JoinColumn()\n @Field({ nullable: true })\n buildingComplex?: BuildingComplex\n\n @RelationId((project: Project) => project.buildingComplex)\n buildingComplexId?: string\n\n // 작업 정보 (하위 테이블 참조)\n @OneToMany(() => Task, task => task.project)\n @Field(() => [Task], { nullable: true })\n tasks?: Task[]\n\n // 루트 작업 정보 (부모가 없는 상위 작업)\n @Field(() => [Task], { nullable: true })\n rootTasks?: Task[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((project: Project) => project.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((project: Project) => project.updater)\n updaterId?: string\n\n // 공정표 파일\n @Field(type => Attachment, { nullable: true })\n scheduleTable?: Attachment\n\n // 완공 보고서 파일\n @ManyToOne(type => Attachment)\n @Field(type => Attachment, { nullable: true })\n completeReport?: Attachment\n\n @RelationId((project: Project) => project.completeReport)\n completeReportId?: string\n}\n"]}
@@ -1,6 +0,0 @@
1
- import { Resource } from './resource';
2
- import { ResourceQuery } from './resource-query';
3
- import { ResourceMutation } from './resource-mutation';
4
- export declare const entities: (typeof Resource)[];
5
- export declare const resolvers: (typeof ResourceQuery | typeof ResourceMutation)[];
6
- export declare const subscribers: any[];
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.subscribers = exports.resolvers = exports.entities = void 0;
4
- const resource_1 = require("./resource");
5
- const resource_query_1 = require("./resource-query");
6
- const resource_mutation_1 = require("./resource-mutation");
7
- exports.entities = [resource_1.Resource];
8
- exports.resolvers = [resource_query_1.ResourceQuery, resource_mutation_1.ResourceMutation];
9
- exports.subscribers = [];
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/resource/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qDAAgD;AAChD,2DAAsD;AAEzC,QAAA,QAAQ,GAAG,CAAC,mBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,8BAAa,EAAE,oCAAgB,CAAC,CAAA;AAC7C,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { Resource } from './resource'\nimport { ResourceQuery } from './resource-query'\nimport { ResourceMutation } from './resource-mutation'\n\nexport const entities = [Resource]\nexport const resolvers = [ResourceQuery, ResourceMutation]\nexport const subscribers = []\n"]}
@@ -1,10 +0,0 @@
1
- import { Resource } from './resource';
2
- import { NewResource, ResourcePatch } from './resource-type';
3
- export declare class ResourceMutation {
4
- createResource(resource: NewResource, context: ResolverContext): Promise<Resource>;
5
- updateResource(id: string, patch: ResourcePatch, context: ResolverContext): Promise<Resource>;
6
- updateMultipleResource(patches: ResourcePatch[], context: ResolverContext): Promise<Resource[]>;
7
- deleteResource(id: string, context: ResolverContext): Promise<boolean>;
8
- deleteResources(ids: string[], context: ResolverContext): Promise<boolean>;
9
- importResources(resources: ResourcePatch[], context: ResolverContext): Promise<boolean>;
10
- }
@@ -1,131 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceMutation = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const typeorm_1 = require("typeorm");
7
- const resource_1 = require("./resource");
8
- const resource_type_1 = require("./resource-type");
9
- let ResourceMutation = class ResourceMutation {
10
- async createResource(resource, context) {
11
- const { domain, user, tx } = context.state;
12
- const result = await tx.getRepository(resource_1.Resource).save(Object.assign(Object.assign({}, resource), { domain, creator: user, updater: user }));
13
- return result;
14
- }
15
- async updateResource(id, patch, context) {
16
- const { user, tx } = context.state;
17
- const repository = tx.getRepository(resource_1.Resource);
18
- const resource = await repository.findOne({
19
- where: { id }
20
- });
21
- const result = await repository.save(Object.assign(Object.assign(Object.assign({}, resource), patch), { updater: user }));
22
- return result;
23
- }
24
- async updateMultipleResource(patches, context) {
25
- const { domain, user, tx } = context.state;
26
- let results = [];
27
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
28
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
29
- const resourceRepo = tx.getRepository(resource_1.Resource);
30
- if (_createRecords.length > 0) {
31
- for (let i = 0; i < _createRecords.length; i++) {
32
- const newRecord = _createRecords[i];
33
- const result = await resourceRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
34
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
35
- }
36
- }
37
- if (_updateRecords.length > 0) {
38
- for (let i = 0; i < _updateRecords.length; i++) {
39
- const updateRecord = _updateRecords[i];
40
- const resource = await resourceRepo.findOneBy({ id: updateRecord.id });
41
- const result = await resourceRepo.save(Object.assign(Object.assign(Object.assign({}, resource), updateRecord), { updater: user }));
42
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
43
- }
44
- }
45
- return results;
46
- }
47
- async deleteResource(id, context) {
48
- const { tx } = context.state;
49
- await tx.getRepository(resource_1.Resource).delete({ id });
50
- return true;
51
- }
52
- async deleteResources(ids, context) {
53
- const { tx } = context.state;
54
- await tx.getRepository(resource_1.Resource).delete({
55
- id: (0, typeorm_1.In)(ids)
56
- });
57
- return true;
58
- }
59
- async importResources(resources, context) {
60
- const { domain, tx } = context.state;
61
- await Promise.all(resources.map(async (resource) => {
62
- const createdResource = await tx.getRepository(resource_1.Resource).save(Object.assign({ domain }, resource));
63
- }));
64
- return true;
65
- }
66
- };
67
- exports.ResourceMutation = ResourceMutation;
68
- tslib_1.__decorate([
69
- (0, type_graphql_1.Directive)('@transaction'),
70
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
71
- (0, type_graphql_1.Mutation)(returns => resource_1.Resource, { description: 'To create new Resource' }),
72
- tslib_1.__param(0, (0, type_graphql_1.Arg)('resource')),
73
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
74
- tslib_1.__metadata("design:type", Function),
75
- tslib_1.__metadata("design:paramtypes", [resource_type_1.NewResource, Object]),
76
- tslib_1.__metadata("design:returntype", Promise)
77
- ], ResourceMutation.prototype, "createResource", null);
78
- tslib_1.__decorate([
79
- (0, type_graphql_1.Directive)('@transaction'),
80
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
81
- (0, type_graphql_1.Mutation)(returns => resource_1.Resource, { description: 'To modify Resource information' }),
82
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
83
- tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
84
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
85
- tslib_1.__metadata("design:type", Function),
86
- tslib_1.__metadata("design:paramtypes", [String, resource_type_1.ResourcePatch, Object]),
87
- tslib_1.__metadata("design:returntype", Promise)
88
- ], ResourceMutation.prototype, "updateResource", null);
89
- tslib_1.__decorate([
90
- (0, type_graphql_1.Directive)('@transaction'),
91
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
92
- (0, type_graphql_1.Mutation)(returns => [resource_1.Resource], { description: "To modify multiple Resources' information" }),
93
- tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [resource_type_1.ResourcePatch])),
94
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
95
- tslib_1.__metadata("design:type", Function),
96
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
97
- tslib_1.__metadata("design:returntype", Promise)
98
- ], ResourceMutation.prototype, "updateMultipleResource", null);
99
- tslib_1.__decorate([
100
- (0, type_graphql_1.Directive)('@transaction'),
101
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
102
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Resource' }),
103
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
104
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
105
- tslib_1.__metadata("design:type", Function),
106
- tslib_1.__metadata("design:paramtypes", [String, Object]),
107
- tslib_1.__metadata("design:returntype", Promise)
108
- ], ResourceMutation.prototype, "deleteResource", null);
109
- tslib_1.__decorate([
110
- (0, type_graphql_1.Directive)('@transaction'),
111
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Resources' }),
112
- tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
113
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
114
- tslib_1.__metadata("design:type", Function),
115
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
116
- tslib_1.__metadata("design:returntype", Promise)
117
- ], ResourceMutation.prototype, "deleteResources", null);
118
- tslib_1.__decorate([
119
- (0, type_graphql_1.Directive)('@transaction'),
120
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
121
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Resources' }),
122
- tslib_1.__param(0, (0, type_graphql_1.Arg)('resources', type => [resource_type_1.ResourcePatch])),
123
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
124
- tslib_1.__metadata("design:type", Function),
125
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
126
- tslib_1.__metadata("design:returntype", Promise)
127
- ], ResourceMutation.prototype, "importResources", null);
128
- exports.ResourceMutation = ResourceMutation = tslib_1.__decorate([
129
- (0, type_graphql_1.Resolver)(resource_1.Resource)
130
- ], ResourceMutation);
131
- //# sourceMappingURL=resource-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-mutation.js","sourceRoot":"","sources":["../../../server/service/resource/resource-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yCAAqC;AACrC,mDAA4D;AAGrD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,IAAI,iCAC/C,QAAQ,KACX,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,cAAc,CACP,EAAU,EACP,KAAoB,EAC3B,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAA;QAC7C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,MAAM,MAAM,GA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A,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAMjD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAQxE;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,6BAAa,CAAC,CAAC,CAAA;IACzC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAWP;2BA/HU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CAgI5B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Resource } from './resource'\nimport { NewResource, ResourcePatch } from './resource-type'\n\n@Resolver(Resource)\nexport class ResourceMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Resource, { description: 'To create new Resource' })\n async createResource(@Arg('resource') resource: NewResource, @Ctx() context: ResolverContext): Promise<Resource> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Resource).save({\n ...resource,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Resource, { description: 'To modify Resource information' })\n async updateResource(\n @Arg('id') id: string,\n @Arg('patch') patch: ResourcePatch,\n @Ctx() context: ResolverContext\n ): Promise<Resource> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(Resource)\n const resource = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...resource,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [Resource], { description: \"To modify multiple Resources' information\" })\n async updateMultipleResource(\n @Arg('patches', type => [ResourcePatch]) patches: ResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Resource[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const resourceRepo = tx.getRepository(Resource)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await resourceRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const resource = await resourceRepo.findOneBy({ id: updateRecord.id })\n\n const result = await resourceRepo.save({\n ...resource,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete Resource' })\n async deleteResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Resource).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Resources' })\n async deleteResources(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Resource).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple Resources' })\n async importResources(\n @Arg('resources', type => [ResourcePatch]) resources: ResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n resources.map(async (resource: ResourcePatch) => {\n const createdResource: Resource = await tx.getRepository(Resource).save({ domain, ...resource })\n })\n )\n\n return true\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- import { Domain, ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { Resource } from './resource';
4
- import { ResourceList } from './resource-type';
5
- export declare class ResourceQuery {
6
- resource(id: string): Promise<Resource>;
7
- resources(params: ListParam): Promise<ResourceList>;
8
- domain(resource: Resource): Promise<Domain>;
9
- updater(resource: Resource): Promise<User>;
10
- creator(resource: Resource): Promise<User>;
11
- }
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceQuery = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const auth_base_1 = require("@things-factory/auth-base");
8
- const resource_1 = require("./resource");
9
- const resource_type_1 = require("./resource-type");
10
- let ResourceQuery = class ResourceQuery {
11
- async resource(id) {
12
- return await (0, shell_1.getRepository)(resource_1.Resource).findOne({
13
- where: { id }
14
- });
15
- }
16
- async resources(params) {
17
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
18
- params,
19
- repository: await (0, shell_1.getRepository)(resource_1.Resource),
20
- searchables: ['name', 'description']
21
- });
22
- const [items, total] = await queryBuilder.getManyAndCount();
23
- return { items, total };
24
- }
25
- async domain(resource) {
26
- return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: resource.domainId });
27
- }
28
- async updater(resource) {
29
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: resource.updaterId });
30
- }
31
- async creator(resource) {
32
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: resource.creatorId });
33
- }
34
- };
35
- exports.ResourceQuery = ResourceQuery;
36
- tslib_1.__decorate([
37
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
38
- (0, type_graphql_1.Query)(returns => resource_1.Resource, { nullable: true, description: 'To fetch a Resource' }),
39
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
40
- tslib_1.__metadata("design:type", Function),
41
- tslib_1.__metadata("design:paramtypes", [String]),
42
- tslib_1.__metadata("design:returntype", Promise)
43
- ], ResourceQuery.prototype, "resource", null);
44
- tslib_1.__decorate([
45
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
46
- (0, type_graphql_1.Query)(returns => resource_type_1.ResourceList, { description: 'To fetch multiple Resources' }),
47
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
48
- tslib_1.__metadata("design:type", Function),
49
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam]),
50
- tslib_1.__metadata("design:returntype", Promise)
51
- ], ResourceQuery.prototype, "resources", null);
52
- tslib_1.__decorate([
53
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
54
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
55
- tslib_1.__metadata("design:type", Function),
56
- tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
57
- tslib_1.__metadata("design:returntype", Promise)
58
- ], ResourceQuery.prototype, "domain", null);
59
- tslib_1.__decorate([
60
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
61
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
62
- tslib_1.__metadata("design:type", Function),
63
- tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
64
- tslib_1.__metadata("design:returntype", Promise)
65
- ], ResourceQuery.prototype, "updater", null);
66
- tslib_1.__decorate([
67
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
68
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
69
- tslib_1.__metadata("design:type", Function),
70
- tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
71
- tslib_1.__metadata("design:returntype", Promise)
72
- ], ResourceQuery.prototype, "creator", null);
73
- exports.ResourceQuery = ResourceQuery = tslib_1.__decorate([
74
- (0, type_graphql_1.Resolver)(resource_1.Resource)
75
- ], ResourceQuery);
76
- //# sourceMappingURL=resource-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-query.js","sourceRoot":"","sources":["../../../server/service/resource/resource-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yCAAqC;AACrC,mDAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU;QAClC,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB;QACvC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC;YACzC,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,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AAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;wBApCU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CAqCzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Resource } from './resource'\nimport { ResourceList } from './resource-type'\n\n@Resolver(Resource)\nexport class ResourceQuery {\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => Resource!, { nullable: true, description: 'To fetch a Resource' })\n async resource(@Arg('id') id: string): Promise<Resource> {\n return await getRepository(Resource).findOne({\n where: { id }\n })\n }\n\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ResourceList, { description: 'To fetch multiple Resources' })\n async resources(@Args() params: ListParam): Promise<ResourceList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(Resource),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() resource: Resource): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: resource.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() resource: Resource): Promise<User> {\n return await getRepository(User).findOneBy({ id: resource.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() resource: Resource): Promise<User> {\n return await getRepository(User).findOneBy({ id: resource.creatorId })\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { Resource, ResourceType } from './resource';
2
- export declare class NewResource {
3
- name: string;
4
- type: ResourceType;
5
- unit: string;
6
- }
7
- export declare class ResourcePatch {
8
- id?: string;
9
- name?: string;
10
- type?: ResourceType;
11
- unit?: string;
12
- cuFlag?: string;
13
- }
14
- export declare class ResourceList {
15
- items: Resource[];
16
- total: number;
17
- }