@chevre/domain 26.0.0-alpha.9 → 26.1.0-alpha.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 (328) hide show
  1. package/lib/chevre/eventEmitter/task.d.ts +8 -23
  2. package/lib/chevre/eventEmitter/task.js +2 -2
  3. package/lib/chevre/repo/acceptedOffer.d.ts +0 -7
  4. package/lib/chevre/repo/acceptedOffer.js +27 -27
  5. package/lib/chevre/repo/action/acceptCOAOffer.d.ts +11 -1
  6. package/lib/chevre/repo/action/acceptCOAOffer.js +25 -2
  7. package/lib/chevre/repo/action/acceptPay.d.ts +11 -1
  8. package/lib/chevre/repo/action/acceptPay.js +27 -6
  9. package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +111 -0
  10. package/lib/chevre/repo/action/anyAction/actionProcess.js +290 -0
  11. package/lib/chevre/repo/action/anyAction/actionRecipe.d.ts +37 -0
  12. package/lib/chevre/repo/action/anyAction/actionRecipe.js +53 -0
  13. package/lib/chevre/repo/action/authorizeInvoice.d.ts +5 -8
  14. package/lib/chevre/repo/action/authorizeInvoice.js +8 -5
  15. package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
  16. package/lib/chevre/repo/action/authorizeOffer.js +8 -7
  17. package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +11 -1
  18. package/lib/chevre/repo/action/authorizePaymentMethod.js +25 -5
  19. package/lib/chevre/repo/action/authorizeTicketedObject.d.ts +3 -1
  20. package/lib/chevre/repo/action/authorizeTicketedObject.js +7 -2
  21. package/lib/chevre/repo/action/cancel.d.ts +25 -0
  22. package/lib/chevre/repo/action/cancel.js +47 -0
  23. package/lib/chevre/repo/action/checkMovieTicket.d.ts +11 -1
  24. package/lib/chevre/repo/action/checkMovieTicket.js +25 -1
  25. package/lib/chevre/repo/action/confirm.d.ts +11 -0
  26. package/lib/chevre/repo/action/confirm.js +16 -0
  27. package/lib/chevre/repo/action/create.d.ts +10 -0
  28. package/lib/chevre/repo/action/create.js +17 -0
  29. package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.d.ts +46 -0
  30. package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.js +92 -0
  31. package/lib/chevre/repo/action/inform.d.ts +39 -0
  32. package/lib/chevre/repo/action/inform.js +115 -0
  33. package/lib/chevre/repo/action/order.d.ts +21 -0
  34. package/lib/chevre/repo/action/order.js +35 -0
  35. package/lib/chevre/repo/action/pay.d.ts +3 -1
  36. package/lib/chevre/repo/action/pay.js +8 -5
  37. package/lib/chevre/repo/action/refund.d.ts +3 -1
  38. package/lib/chevre/repo/action/refund.js +7 -4
  39. package/lib/chevre/repo/action/reserve.d.ts +21 -0
  40. package/lib/chevre/repo/action/reserve.js +37 -0
  41. package/lib/chevre/repo/action/returnAction.d.ts +11 -0
  42. package/lib/chevre/repo/action/returnAction.js +16 -0
  43. package/lib/chevre/repo/action/sendEmailMessage.d.ts +10 -0
  44. package/lib/chevre/repo/action/sendEmailMessage.js +17 -0
  45. package/lib/chevre/repo/action/sendOrder.d.ts +10 -0
  46. package/lib/chevre/repo/action/sendOrder.js +16 -0
  47. package/lib/chevre/repo/action/unknown2actionError.d.ts +6 -0
  48. package/lib/chevre/repo/action/unknown2actionError.js +15 -0
  49. package/lib/chevre/repo/action/update.d.ts +50 -0
  50. package/lib/chevre/repo/action/update.js +129 -0
  51. package/lib/chevre/repo/action/use.d.ts +40 -0
  52. package/lib/chevre/repo/action/use.js +122 -0
  53. package/lib/chevre/repo/{action.d.ts → adminAction.d.ts} +11 -37
  54. package/lib/chevre/repo/adminAction.js +202 -0
  55. package/lib/chevre/repo/adminAssetTransaction.d.ts +126 -0
  56. package/lib/chevre/repo/adminAssetTransaction.js +491 -0
  57. package/lib/chevre/repo/adminScheduledTask.d.ts +1 -1
  58. package/lib/chevre/repo/adminTask.d.ts +25 -8
  59. package/lib/chevre/repo/adminTask.js +31 -32
  60. package/lib/chevre/repo/adminTransaction.d.ts +131 -0
  61. package/lib/chevre/repo/adminTransaction.js +237 -0
  62. package/lib/chevre/repo/aggregateAction.d.ts +8 -11
  63. package/lib/chevre/repo/aggregateAction.js +0 -61
  64. package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
  65. package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
  66. package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
  67. package/lib/chevre/repo/aggregateTransaction.js +166 -0
  68. package/lib/chevre/repo/aggregateUseAction.d.ts +35 -0
  69. package/lib/chevre/repo/aggregateUseAction.js +164 -0
  70. package/lib/chevre/repo/aggregation.d.ts +0 -8
  71. package/lib/chevre/repo/aggregation.js +0 -10
  72. package/lib/chevre/repo/assetTransaction.d.ts +10 -235
  73. package/lib/chevre/repo/assetTransaction.js +48 -636
  74. package/lib/chevre/repo/authorization.d.ts +0 -6
  75. package/lib/chevre/repo/authorization.js +15 -27
  76. package/lib/chevre/repo/factory/action/createMongoConditions.d.ts +4 -0
  77. package/lib/chevre/repo/factory/action/createMongoConditions.js +335 -0
  78. package/lib/chevre/repo/message.d.ts +0 -7
  79. package/lib/chevre/repo/message.js +0 -38
  80. package/lib/chevre/repo/migrateAction.d.ts +48 -0
  81. package/lib/chevre/repo/migrateAction.js +32 -0
  82. package/lib/chevre/repo/mongoose/schemas/action/abstractAction.d.ts +5 -0
  83. package/lib/chevre/repo/mongoose/schemas/action/abstractAction.js +2 -0
  84. package/lib/chevre/repo/mongoose/schemas/action/inform.d.ts +11 -0
  85. package/lib/chevre/repo/mongoose/schemas/action/inform.js +82 -0
  86. package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
  87. package/lib/chevre/repo/mongoose/schemas/action/update.js +112 -0
  88. package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/use.d.ts} +4 -6
  89. package/lib/chevre/repo/mongoose/schemas/action/use.js +92 -0
  90. package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
  91. package/lib/chevre/repo/mongoose/schemas/action.js +22 -7
  92. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +1 -0
  93. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +19 -1
  94. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
  95. package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
  96. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
  97. package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
  98. package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
  99. package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
  100. package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
  101. package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
  102. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +5 -16
  103. package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
  104. package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
  105. package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
  106. package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
  107. package/lib/chevre/repo/orderInTransaction.js +30 -22
  108. package/lib/chevre/repo/scheduledTask.d.ts +4 -1
  109. package/lib/chevre/repo/scheduledTask.js +3 -25
  110. package/lib/chevre/repo/task.d.ts +44 -155
  111. package/lib/chevre/repo/task.js +13 -555
  112. package/lib/chevre/repo/taskDelayed.d.ts +74 -0
  113. package/lib/chevre/repo/taskDelayed.js +195 -0
  114. package/lib/chevre/repo/taskRunning.d.ts +35 -0
  115. package/lib/chevre/repo/taskRunning.js +89 -0
  116. package/lib/chevre/repo/ticket.d.ts +0 -6
  117. package/lib/chevre/repo/ticket.js +0 -11
  118. package/lib/chevre/repo/transaction.d.ts +1 -187
  119. package/lib/chevre/repo/transaction.js +2 -383
  120. package/lib/chevre/repository.d.ts +65 -25
  121. package/lib/chevre/repository.js +144 -56
  122. package/lib/chevre/service/aggregation/system.d.ts +9 -8
  123. package/lib/chevre/service/aggregation/system.js +5 -5
  124. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
  125. package/lib/chevre/service/assetTransaction/pay/check.d.ts +3 -1
  126. package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
  127. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -2
  128. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -2
  129. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -2
  130. package/lib/chevre/service/assetTransaction/refund.d.ts +0 -1
  131. package/lib/chevre/service/assetTransaction/refund.js +2 -2
  132. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +4 -2
  133. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +4 -2
  134. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +8 -4
  135. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -1
  136. package/lib/chevre/service/asyncAction.d.ts +2 -2
  137. package/lib/chevre/service/asyncAction.js +1 -4
  138. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
  139. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
  140. package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
  141. package/lib/chevre/service/asyncActionHandler.js +11 -13
  142. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
  143. package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
  144. package/lib/chevre/service/event.d.ts +4 -2
  145. package/lib/chevre/service/event.js +3 -3
  146. package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
  147. package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
  148. package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
  149. package/lib/chevre/service/notification/triggerWebhook.js +5 -16
  150. package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
  151. package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +0 -1
  152. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +4 -2
  153. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
  154. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +9 -5
  155. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +1 -1
  156. package/lib/chevre/service/offer/event/voidTransaction.d.ts +6 -4
  157. package/lib/chevre/service/offer/event/voidTransaction.js +7 -9
  158. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +6 -4
  159. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +3 -15
  160. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
  161. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  162. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
  163. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +23 -24
  164. package/lib/chevre/service/offer/onEventChanged.js +0 -2
  165. package/lib/chevre/service/order/confirmPayTransaction.d.ts +4 -10
  166. package/lib/chevre/service/order/confirmPayTransaction.js +7 -11
  167. package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
  168. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +2 -56
  169. package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
  170. package/lib/chevre/service/order/deleteOrder.js +1 -2
  171. package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
  172. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
  173. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
  174. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
  175. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
  176. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
  177. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -9
  178. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
  179. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -8
  180. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
  181. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -11
  182. package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
  183. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +4 -2
  184. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
  185. package/lib/chevre/service/order/placeOrder.d.ts +6 -4
  186. package/lib/chevre/service/order/placeOrder.js +9 -17
  187. package/lib/chevre/service/order/returnOrder.d.ts +4 -4
  188. package/lib/chevre/service/order/returnOrder.js +11 -43
  189. package/lib/chevre/service/order/sendOrder.d.ts +4 -6
  190. package/lib/chevre/service/order/sendOrder.js +30 -72
  191. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +0 -1
  192. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +0 -1
  193. package/lib/chevre/service/payment/any/authorize.d.ts +1 -2
  194. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
  195. package/lib/chevre/service/payment/any/findAcceptAction.js +23 -24
  196. package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
  197. package/lib/chevre/service/payment/any/findAuthorizeAction.js +23 -24
  198. package/lib/chevre/service/payment/any/findCheckAction.d.ts +3 -5
  199. package/lib/chevre/service/payment/any/findCheckAction.js +24 -25
  200. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +0 -1
  201. package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +0 -1
  202. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
  203. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +0 -1
  204. package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +0 -1
  205. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  206. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
  207. package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
  208. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +0 -1
  209. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +0 -1
  210. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +0 -1
  211. package/lib/chevre/service/payment/creditCard/authorize.d.ts +0 -1
  212. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +0 -1
  213. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +0 -1
  214. package/lib/chevre/service/payment/faceToFace.d.ts +0 -2
  215. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -2
  216. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -1
  217. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
  218. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +0 -1
  219. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +0 -1
  220. package/lib/chevre/service/payment/movieTicket/validation.d.ts +3 -1
  221. package/lib/chevre/service/payment/movieTicket/validation.js +2 -2
  222. package/lib/chevre/service/project.d.ts +0 -6
  223. package/lib/chevre/service/project.js +0 -2
  224. package/lib/chevre/service/reserve/cancelReservation.d.ts +7 -3
  225. package/lib/chevre/service/reserve/cancelReservation.js +15 -25
  226. package/lib/chevre/service/reserve/checkInReservation.d.ts +4 -2
  227. package/lib/chevre/service/reserve/checkInReservation.js +2 -2
  228. package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -2
  229. package/lib/chevre/service/reserve/confirmReservation.js +10 -36
  230. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
  231. package/lib/chevre/service/reserve/useReservation.d.ts +6 -2
  232. package/lib/chevre/service/reserve/useReservation.js +6 -24
  233. package/lib/chevre/service/reserveCOA/cancelReservation.d.ts +4 -2
  234. package/lib/chevre/service/reserveCOA/cancelReservation.js +3 -3
  235. package/lib/chevre/service/scheduledTask.d.ts +1 -4
  236. package/lib/chevre/service/scheduledTask.js +3 -10
  237. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
  238. package/lib/chevre/service/scheduledTaskHandler.js +0 -13
  239. package/lib/chevre/service/task/acceptCOAOffer.js +5 -19
  240. package/lib/chevre/service/task/authorizePayment.js +6 -13
  241. package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
  242. package/lib/chevre/service/task/cancelReservation.js +3 -5
  243. package/lib/chevre/service/task/checkMovieTicket.js +8 -13
  244. package/lib/chevre/service/task/checkResource.js +14 -57
  245. package/lib/chevre/service/task/confirmPayTransaction.js +11 -12
  246. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
  247. package/lib/chevre/service/task/confirmReserveTransaction.js +12 -7
  248. package/lib/chevre/service/task/createAccountingReport.js +8 -15
  249. package/lib/chevre/service/task/deleteTransaction.js +10 -41
  250. package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
  251. package/lib/chevre/service/task/invalidatePaymentUrl.js +0 -1
  252. package/lib/chevre/service/task/onAuthorizationCreated.js +4 -13
  253. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
  254. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
  255. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
  256. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
  257. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
  258. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
  259. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
  260. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
  261. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
  262. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
  263. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
  264. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
  265. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
  266. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
  267. package/lib/chevre/service/task/onResourceDeleted.js +4 -3
  268. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
  269. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
  270. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
  271. package/lib/chevre/service/task/onResourceUpdated.js +0 -10
  272. package/lib/chevre/service/task/pay.js +3 -3
  273. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
  274. package/lib/chevre/service/task/payment/payByTask.d.ts +3 -2
  275. package/lib/chevre/service/task/payment/payByTask.js +1 -1
  276. package/lib/chevre/service/task/payment/refundByTask.d.ts +0 -1
  277. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +0 -2
  278. package/lib/chevre/service/task/placeOrder.js +8 -6
  279. package/lib/chevre/service/task/publishPaymentUrl.js +6 -18
  280. package/lib/chevre/service/task/refund.js +0 -1
  281. package/lib/chevre/service/task/reserve.js +3 -6
  282. package/lib/chevre/service/task/returnOrder.js +3 -7
  283. package/lib/chevre/service/task/returnPayTransaction.js +9 -19
  284. package/lib/chevre/service/task/returnReserveTransaction.js +5 -6
  285. package/lib/chevre/service/task/sendEmailMessage.js +2 -2
  286. package/lib/chevre/service/task/sendOrder.js +4 -8
  287. package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
  288. package/lib/chevre/service/task/triggerWebhook.js +4 -2
  289. package/lib/chevre/service/task/useReservation.js +6 -2
  290. package/lib/chevre/service/task/voidPayment.js +0 -2
  291. package/lib/chevre/service/task/voidReserveTransaction.js +11 -13
  292. package/lib/chevre/service/task.d.ts +4 -4
  293. package/lib/chevre/service/task.js +8 -12
  294. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
  295. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
  296. package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
  297. package/lib/chevre/service/taskHandler.d.ts +1 -2
  298. package/lib/chevre/service/taskHandler.js +7 -19
  299. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
  300. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
  301. package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -4
  302. package/lib/chevre/service/transaction/deleteTransaction.js +7 -7
  303. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
  304. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  305. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +11 -17
  306. package/lib/chevre/service/transaction/returnOrder.js +11 -17
  307. package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
  308. package/lib/chevre/service/validation/validateOrder.js +3 -3
  309. package/lib/chevre/taskSettings.d.ts +4 -4
  310. package/package.json +2 -2
  311. package/lib/chevre/repo/action/actionProcess.d.ts +0 -147
  312. package/lib/chevre/repo/action/actionProcess.js +0 -775
  313. package/lib/chevre/repo/action/checkThing.d.ts +0 -8
  314. package/lib/chevre/repo/action/checkThing.js +0 -13
  315. package/lib/chevre/repo/action.js +0 -468
  316. package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
  317. package/lib/chevre/repo/asyncActionLegacy.js +0 -59
  318. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
  319. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
  320. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
  321. package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
  322. package/lib/chevre/repo/ownershipInfo.js +0 -466
  323. package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -39
  324. package/lib/chevre/repo/scheduledTaskLegacy.js +0 -96
  325. package/lib/chevre/repo/scheduledTaskMigration.d.ts +0 -21
  326. package/lib/chevre/repo/scheduledTaskMigration.js +0 -70
  327. package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
  328. package/lib/chevre/service/validation/validateEvent.js +0 -21
@@ -41,12 +41,6 @@ export declare class AuthorizationRepo {
41
41
  projectFields(params: factory.authorization.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<(factory.authorization.IAuthorization & {
42
42
  id: string;
43
43
  })[]>;
44
- /**
45
- * 有効期限を一定期間過ぎた承認を削除する
46
- */
47
- deleteValidUntilPassedCertainPeriod(params: {
48
- $lt: Date;
49
- }): Promise<void>;
50
44
  unsetUnnecessaryFields(params: {
51
45
  filter: FilterQuery<factory.authorization.IAuthorization>;
52
46
  $unset: any;
@@ -69,21 +69,21 @@ class AuthorizationRepo {
69
69
  'object.typeOf': { $exists: true, $in: object.typeOfs }
70
70
  });
71
71
  }
72
- /* istanbul ignore else */
73
- if (object.typeOfGood !== undefined) {
74
- /* istanbul ignore else */
75
- if (Array.isArray(object.typeOfGood.ids)) {
76
- andConditions.push({
77
- 'object.typeOfGood.id': { $exists: true, $in: object.typeOfGood.ids }
78
- });
79
- }
80
- /* istanbul ignore else */
81
- if (Array.isArray(object.typeOfGood.typeOfs)) {
82
- andConditions.push({
83
- 'object.typeOfGood.typeOf': { $exists: true, $in: object.typeOfGood.typeOfs }
84
- });
85
- }
86
- }
72
+ // /* istanbul ignore else */
73
+ // if (object.typeOfGood !== undefined) {
74
+ // /* istanbul ignore else */
75
+ // if (Array.isArray(object.typeOfGood.ids)) {
76
+ // andConditions.push({
77
+ // 'object.typeOfGood.id': { $exists: true, $in: object.typeOfGood.ids }
78
+ // });
79
+ // }
80
+ // /* istanbul ignore else */
81
+ // if (Array.isArray(object.typeOfGood.typeOfs)) {
82
+ // andConditions.push({
83
+ // 'object.typeOfGood.typeOf': { $exists: true, $in: object.typeOfGood.typeOfs }
84
+ // });
85
+ // }
86
+ // }
87
87
  }
88
88
  if (params.validFrom instanceof Date) {
89
89
  andConditions.push({ validUntil: { $gte: params.validFrom } });
@@ -177,18 +177,6 @@ class AuthorizationRepo {
177
177
  .lean()
178
178
  .exec();
179
179
  }
180
- /**
181
- * 有効期限を一定期間過ぎた承認を削除する
182
- */
183
- async deleteValidUntilPassedCertainPeriod(params) {
184
- await this.authorizationModel.deleteMany({
185
- validUntil: {
186
- $exists: true,
187
- $lt: params.$lt
188
- }
189
- })
190
- .exec();
191
- }
192
180
  async unsetUnnecessaryFields(params) {
193
181
  return this.authorizationModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
194
182
  .exec();
@@ -0,0 +1,4 @@
1
+ import { FilterQuery } from 'mongoose';
2
+ import { factory } from '../../../factory';
3
+ import { IDocType } from '../../mongoose/schemas/action';
4
+ export declare function createMongoConditions(params: factory.action.ISearchConditions): FilterQuery<IDocType>[];
@@ -0,0 +1,335 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMongoConditions = createMongoConditions;
4
+ function createMongoConditions(params) {
5
+ const andConditions = [];
6
+ const idIn = params.id?.$in;
7
+ if (Array.isArray(idIn)) {
8
+ andConditions.push({ _id: { $in: idIn } });
9
+ }
10
+ const idNin = params.id?.$nin;
11
+ if (Array.isArray(idNin)) {
12
+ andConditions.push({ _id: { $nin: idNin } });
13
+ }
14
+ const projectIdEq = params.project?.id?.$eq;
15
+ if (typeof projectIdEq === 'string') {
16
+ andConditions.push({
17
+ 'project.id': {
18
+ $eq: projectIdEq
19
+ }
20
+ });
21
+ }
22
+ const agentTypeOfIn = params.agent?.typeOf?.$in;
23
+ if (Array.isArray(agentTypeOfIn)) {
24
+ andConditions.push({
25
+ 'agent.typeOf': {
26
+ $exists: true,
27
+ $in: agentTypeOfIn
28
+ }
29
+ });
30
+ }
31
+ const agentIdIn = params.agent?.id?.$in;
32
+ if (Array.isArray(agentIdIn)) {
33
+ andConditions.push({
34
+ 'agent.id': {
35
+ $exists: true,
36
+ $in: agentIdIn
37
+ }
38
+ });
39
+ }
40
+ const instrumentTransactionNumberEq = params.instrument?.transactionNumber?.$eq;
41
+ if (typeof instrumentTransactionNumberEq === 'string') {
42
+ andConditions.push({ 'instrument.transactionNumber': { $exists: true, $eq: instrumentTransactionNumberEq } });
43
+ }
44
+ const instrumentTypeOfEq = params.instrument?.typeOf?.$eq;
45
+ if (typeof instrumentTypeOfEq === 'string') {
46
+ andConditions.push({ 'instrument.typeOf': { $exists: true, $eq: instrumentTypeOfEq } });
47
+ }
48
+ const instrumentIdentifierEq = params.instrument?.identifier?.$eq;
49
+ if (typeof instrumentIdentifierEq === 'string') {
50
+ andConditions.push({ 'instrument.identifier': { $exists: true, $eq: instrumentIdentifierEq } });
51
+ }
52
+ const instrumentIdEq = params.instrument?.id?.$eq;
53
+ if (typeof instrumentIdEq === 'string') {
54
+ andConditions.push({ 'instrument.id': { $exists: true, $eq: instrumentIdEq } });
55
+ }
56
+ const instrumentOrderNumberEq = params.instrument?.orderNumber?.$eq;
57
+ if (typeof instrumentOrderNumberEq === 'string') {
58
+ andConditions.push({ 'instrument.orderNumber': { $exists: true, $eq: instrumentOrderNumberEq } });
59
+ }
60
+ const locationIdEq = params.location?.id?.$eq;
61
+ if (typeof locationIdEq === 'string') {
62
+ andConditions.push({
63
+ 'location.id': {
64
+ $exists: true,
65
+ $eq: locationIdEq
66
+ }
67
+ });
68
+ }
69
+ const locationIdentifierEq = params.location?.identifier?.$eq;
70
+ if (typeof locationIdentifierEq === 'string') {
71
+ andConditions.push({
72
+ 'location.identifier': {
73
+ $exists: true,
74
+ $eq: locationIdentifierEq
75
+ }
76
+ });
77
+ }
78
+ const objectMovieTicketsIdentifierEq = params.object?.movieTickets?.identifier?.$eq;
79
+ if (typeof objectMovieTicketsIdentifierEq === 'string') {
80
+ andConditions.push({
81
+ 'object.movieTickets.identifier': {
82
+ $exists: true,
83
+ $eq: objectMovieTicketsIdentifierEq
84
+ }
85
+ });
86
+ }
87
+ const objectMovieTicketsServiceOutputReservationForIdEq = params.object?.movieTickets?.serviceOutput?.reservationFor?.id?.$eq;
88
+ if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
89
+ andConditions.push({
90
+ 'object.movieTickets.serviceOutput.reservationFor.id': {
91
+ $exists: true,
92
+ $eq: objectMovieTicketsServiceOutputReservationForIdEq
93
+ }
94
+ });
95
+ }
96
+ const objectPaymentMethodIdEq = params.object?.paymentMethodId?.$eq;
97
+ if (typeof objectPaymentMethodIdEq === 'string') {
98
+ andConditions.push({
99
+ 'object.paymentMethodId': {
100
+ $exists: true,
101
+ $eq: objectPaymentMethodIdEq
102
+ }
103
+ });
104
+ }
105
+ const objectObjectPaymentMethodIdEq = params.object?.object?.paymentMethodId?.$eq;
106
+ if (typeof objectObjectPaymentMethodIdEq === 'string') {
107
+ andConditions.push({
108
+ 'object.object.paymentMethodId': {
109
+ $exists: true,
110
+ $eq: objectObjectPaymentMethodIdEq
111
+ }
112
+ });
113
+ }
114
+ const objectReservationForIdEq = params.object?.reservationFor?.id?.$eq;
115
+ if (typeof objectReservationForIdEq === 'string') {
116
+ andConditions.push({
117
+ 'object.reservationFor.id': {
118
+ $exists: true,
119
+ $eq: objectReservationForIdEq
120
+ }
121
+ });
122
+ }
123
+ const objectReservationNumberEq = params.object?.reservationNumber?.$eq;
124
+ if (typeof objectReservationNumberEq === 'string') {
125
+ andConditions.push({
126
+ 'object.reservationNumber': {
127
+ $exists: true,
128
+ $eq: objectReservationNumberEq
129
+ }
130
+ });
131
+ }
132
+ const objectReservationNumberIn = params.object?.reservationNumber?.$in;
133
+ if (Array.isArray(objectReservationNumberIn)) {
134
+ andConditions.push({
135
+ 'object.reservationNumber': {
136
+ $exists: true,
137
+ $in: objectReservationNumberIn
138
+ }
139
+ });
140
+ }
141
+ const objectPaymentMethodAccountIdEq = params.object?.paymentMethod?.accountId?.$eq;
142
+ if (typeof objectPaymentMethodAccountIdEq === 'string') {
143
+ andConditions.push({
144
+ 'object.paymentMethod.accountId': {
145
+ $exists: true,
146
+ $eq: objectPaymentMethodAccountIdEq
147
+ }
148
+ });
149
+ }
150
+ const objectPaymentMethodPaymentMethodIdEq = params.object?.paymentMethod?.paymentMethodId?.$eq;
151
+ if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
152
+ andConditions.push({
153
+ 'object.paymentMethod.paymentMethodId': {
154
+ $exists: true,
155
+ $eq: objectPaymentMethodPaymentMethodIdEq
156
+ }
157
+ });
158
+ }
159
+ const objectPaymentMethodPaymentMethodIdIn = params.object?.paymentMethod?.paymentMethodId?.$in;
160
+ if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
161
+ andConditions.push({
162
+ 'object.paymentMethod.paymentMethodId': {
163
+ $exists: true,
164
+ $in: objectPaymentMethodPaymentMethodIdIn
165
+ }
166
+ });
167
+ }
168
+ const objectPaymentMethodTypeOfEq = params.object?.paymentMethod?.typeOf?.$eq;
169
+ if (typeof objectPaymentMethodTypeOfEq === 'string') {
170
+ andConditions.push({
171
+ 'object.paymentMethod.typeOf': {
172
+ $exists: true,
173
+ $eq: objectPaymentMethodTypeOfEq
174
+ }
175
+ });
176
+ }
177
+ const objectTypeOfEq = params.object?.typeOf?.$eq;
178
+ if (typeof objectTypeOfEq === 'string') {
179
+ andConditions.push({
180
+ 'object.typeOf': {
181
+ $exists: true,
182
+ $eq: objectTypeOfEq
183
+ }
184
+ });
185
+ }
186
+ const objectTypeOfIn = params.object?.typeOf?.$in;
187
+ if (Array.isArray(objectTypeOfIn)) {
188
+ andConditions.push({
189
+ 'object.typeOf': {
190
+ $exists: true,
191
+ $in: objectTypeOfIn
192
+ }
193
+ });
194
+ }
195
+ const objectIdEq = params.object?.id?.$eq;
196
+ if (typeof objectIdEq === 'string') {
197
+ andConditions.push({
198
+ 'object.id': {
199
+ $exists: true,
200
+ $eq: objectIdEq
201
+ }
202
+ });
203
+ }
204
+ const objectIdIn = params.object?.id?.$in;
205
+ if (Array.isArray(objectIdIn)) {
206
+ andConditions.push({
207
+ 'object.id': {
208
+ $exists: true,
209
+ $in: objectIdIn
210
+ }
211
+ });
212
+ }
213
+ const objectOrderNumberIn = params.object?.orderNumber?.$in;
214
+ if (Array.isArray(objectOrderNumberIn)) {
215
+ andConditions.push({
216
+ 'object.orderNumber': {
217
+ $exists: true,
218
+ $in: objectOrderNumberIn
219
+ }
220
+ });
221
+ }
222
+ const objectTransactionNumberEq = params.object?.transactionNumber?.$eq;
223
+ if (typeof objectTransactionNumberEq === 'string') {
224
+ andConditions.push({ 'object.transactionNumber': { $exists: true, $eq: objectTransactionNumberEq } });
225
+ }
226
+ if (typeof params.typeOf === 'string') {
227
+ andConditions.push({
228
+ typeOf: params.typeOf
229
+ });
230
+ }
231
+ else {
232
+ const typeOfEq = params.typeOf?.$eq;
233
+ if (typeof typeOfEq === 'string') {
234
+ andConditions.push({
235
+ typeOf: { $eq: typeOfEq }
236
+ });
237
+ }
238
+ }
239
+ const actionStatusIn = params.actionStatus?.$in;
240
+ if (Array.isArray(actionStatusIn)) {
241
+ andConditions.push({
242
+ actionStatus: { $in: actionStatusIn }
243
+ });
244
+ }
245
+ if (Array.isArray(params.actionStatusTypes)) {
246
+ andConditions.push({
247
+ actionStatus: { $in: params.actionStatusTypes }
248
+ });
249
+ }
250
+ const startDateGte = params.startFrom;
251
+ if (startDateGte instanceof Date) {
252
+ andConditions.push({
253
+ startDate: { $gte: startDateGte }
254
+ });
255
+ }
256
+ const startDateLte = params.startThrough;
257
+ if (startDateLte instanceof Date) {
258
+ andConditions.push({
259
+ startDate: { $lte: startDateLte }
260
+ });
261
+ }
262
+ const purposeTypeOfIn = params.purpose?.typeOf?.$in;
263
+ if (Array.isArray(purposeTypeOfIn)) {
264
+ andConditions.push({
265
+ 'purpose.typeOf': {
266
+ $exists: true,
267
+ $in: purposeTypeOfIn
268
+ }
269
+ });
270
+ }
271
+ const purposeIdIn = params.purpose?.id?.$in;
272
+ if (Array.isArray(purposeIdIn)) {
273
+ andConditions.push({
274
+ 'purpose.id': {
275
+ $exists: true,
276
+ $in: purposeIdIn
277
+ }
278
+ });
279
+ }
280
+ const purposeOrderNumberIn = params.purpose?.orderNumber?.$in;
281
+ if (Array.isArray(purposeOrderNumberIn)) {
282
+ andConditions.push({
283
+ 'purpose.orderNumber': {
284
+ $exists: true,
285
+ $in: purposeOrderNumberIn
286
+ }
287
+ });
288
+ }
289
+ const resultTypeOfIn = params.result?.typeOf?.$in;
290
+ if (Array.isArray(resultTypeOfIn)) {
291
+ andConditions.push({
292
+ 'result.typeOf': {
293
+ $exists: true,
294
+ $in: resultTypeOfIn
295
+ }
296
+ });
297
+ }
298
+ const resultIdIn = params.result?.id?.$in;
299
+ if (Array.isArray(resultIdIn)) {
300
+ andConditions.push({
301
+ 'result.id': {
302
+ $exists: true,
303
+ $in: resultIdIn
304
+ }
305
+ });
306
+ }
307
+ const resultOrderNumberIn = params.result?.orderNumber?.$in;
308
+ if (Array.isArray(resultOrderNumberIn)) {
309
+ andConditions.push({
310
+ 'result.orderNumber': {
311
+ $exists: true,
312
+ $in: resultOrderNumberIn
313
+ }
314
+ });
315
+ }
316
+ const resultCodeIn = params.result?.code?.$in;
317
+ if (Array.isArray(resultCodeIn)) {
318
+ andConditions.push({
319
+ 'result.code': {
320
+ $exists: true,
321
+ $in: resultCodeIn
322
+ }
323
+ });
324
+ }
325
+ // sameAs(2024-04-23~)
326
+ const sameAsIdEq = params.sameAs?.id?.$eq;
327
+ if (typeof sameAsIdEq === 'string') {
328
+ andConditions.push({ 'sameAs.id': { $exists: true, $eq: sameAsIdEq } });
329
+ }
330
+ const aboutOrderNumberEq = params.about?.orderNumber?.$eq;
331
+ if (typeof aboutOrderNumberEq === 'string') {
332
+ andConditions.push({ 'about.orderNumber': { $exists: true, $eq: aboutOrderNumberEq } });
333
+ }
334
+ return andConditions;
335
+ }
@@ -59,13 +59,6 @@ export declare class MessageRepo {
59
59
  id: string;
60
60
  };
61
61
  }): Promise<IFindByIdentifierResult>;
62
- /**
63
- * 発行日時を基準に複数削除
64
- * 2026-06-28~
65
- */
66
- deleteDatePublishedPassedCertainPeriod(params: {
67
- $lt: Date;
68
- }): Promise<void>;
69
62
  unsetUnnecessaryFields(params: {
70
63
  filter: any;
71
64
  $unset: any;
@@ -160,44 +160,6 @@ class MessageRepo {
160
160
  }
161
161
  return doc;
162
162
  }
163
- /**
164
- * 発行日時を基準に複数削除
165
- * 2026-06-28~
166
- */
167
- async deleteDatePublishedPassedCertainPeriod(params) {
168
- const { $lt } = params;
169
- if ($lt instanceof Date) {
170
- await this.messageModel.deleteMany({
171
- datePublished: { $lt }
172
- })
173
- .exec();
174
- }
175
- }
176
- // public async deleteByMainEntityOrderNumber(params: {
177
- // project: { id: string };
178
- // mainEntity: { orderNumber: string };
179
- // }): Promise<{
180
- // n?: number;
181
- // // opTime: result.opTime,
182
- // ok?: number;
183
- // // operationTime,
184
- // deletedCount?: number;
185
- // } | null> {
186
- // return this.messageModel.deleteMany({
187
- // 'project.id': { $eq: params.project.id },
188
- // 'mainEntity.orderNumber': { $exists: true, $eq: params.mainEntity.orderNumber }
189
- // })
190
- // .exec()
191
- // .then((result) => {
192
- // return {
193
- // // n: result?.n,
194
- // // opTime: result.opTime,
195
- // // ok: result?.ok,
196
- // // operationTime,
197
- // deletedCount: result?.deletedCount
198
- // };
199
- // });
200
- // }
201
163
  async unsetUnnecessaryFields(params) {
202
164
  return this.messageModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
203
165
  .exec();
@@ -0,0 +1,48 @@
1
+ import type { Connection } from 'mongoose';
2
+ import { factory } from '../factory';
3
+ import { IModel as IActionModel, IDocType } from './mongoose/schemas/action';
4
+ import { IDocType as IRecipeDocType, IModel as IActionRecipeModel } from './mongoose/schemas/actionRecipe';
5
+ /**
6
+ * アクション移行リポジトリ
7
+ */
8
+ export declare class MigrateActionRepo {
9
+ protected readonly actionModel: IActionModel;
10
+ protected readonly actionRecipeModel: IActionRecipeModel;
11
+ constructor(connection: Connection);
12
+ getActionCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & {
13
+ _id: import("mongoose").Types.ObjectId;
14
+ } & {
15
+ __v: number;
16
+ }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & {
17
+ _id: import("mongoose").Types.ObjectId;
18
+ } & {
19
+ __v: number;
20
+ }) | null>;
21
+ getActionRecipeCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IRecipeDocType, import("./mongoose/virtuals").IVirtuals, {}> & factory.recipe.IRecipe & {
22
+ recipeFor: {
23
+ id: string;
24
+ };
25
+ dateCreated?: Date;
26
+ dateModified?: Date;
27
+ expires?: Date;
28
+ } & {
29
+ _id: import("mongoose").Types.ObjectId;
30
+ } & {
31
+ __v: number;
32
+ }, import("mongoose").QueryOptions<IRecipeDocType>, (import("mongoose").Document<unknown, Record<string, never>, IRecipeDocType, import("./mongoose/virtuals").IVirtuals, {}> & factory.recipe.IRecipe & {
33
+ recipeFor: {
34
+ id: string;
35
+ };
36
+ dateCreated?: Date;
37
+ dateModified?: Date;
38
+ expires?: Date;
39
+ } & {
40
+ _id: import("mongoose").Types.ObjectId;
41
+ } & {
42
+ __v: number;
43
+ }) | null>;
44
+ migrateActionExpires(params: {
45
+ id: string;
46
+ expires: Date;
47
+ }): Promise<void>;
48
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MigrateActionRepo = void 0;
4
+ const factory_1 = require("../factory");
5
+ const action_1 = require("./mongoose/schemas/action");
6
+ const actionRecipe_1 = require("./mongoose/schemas/actionRecipe");
7
+ /**
8
+ * アクション移行リポジトリ
9
+ */
10
+ class MigrateActionRepo {
11
+ actionModel;
12
+ actionRecipeModel;
13
+ constructor(connection) {
14
+ this.actionModel = connection.model(action_1.modelName, (0, action_1.createSchema)());
15
+ this.actionRecipeModel = connection.model(actionRecipe_1.modelName, (0, actionRecipe_1.createSchema)());
16
+ }
17
+ getActionCursor(conditions, projection) {
18
+ return this.actionModel.find(conditions, projection)
19
+ .sort({ startDate: factory_1.factory.sortType.Ascending })
20
+ .cursor();
21
+ }
22
+ getActionRecipeCursor(conditions, projection) {
23
+ return this.actionRecipeModel.find(conditions, projection)
24
+ .sort({ dateCreated: factory_1.factory.sortType.Ascending })
25
+ .cursor();
26
+ }
27
+ async migrateActionExpires(params) {
28
+ await this.actionModel.updateOne({ _id: { $eq: params.id } }, { $set: { expires: params.expires } })
29
+ .exec();
30
+ }
31
+ }
32
+ exports.MigrateActionRepo = MigrateActionRepo;
@@ -0,0 +1,5 @@
1
+ import type { Model } from 'mongoose';
2
+ import type { IVirtuals } from '../../virtuals';
3
+ type IAbstractActionDocType = any;
4
+ type IAbstractActionModel = Model<IAbstractActionDocType, Record<string, never>, Record<string, never>, IVirtuals>;
5
+ export { IAbstractActionDocType, IAbstractActionModel };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import { IVirtuals } from '../../virtuals';
3
+ import { factory } from '../../../../factory';
4
+ type IDocType = Pick<factory.action.interact.inform.IAction, 'about' | 'actionStatus' | 'agent' | 'endDate' | 'object' | 'project' | 'recipient' | 'result' | 'startDate' | 'target' | 'typeOf' | 'purpose' | 'error' | 'expires'>;
5
+ type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
7
+ type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
8
+ declare const modelName = "Action.Inform";
9
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
10
+ declare function createSchema(): ISchema;
11
+ export { createSchema, IDocType, IModel, indexes, modelName };
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modelName = exports.indexes = void 0;
4
+ exports.createSchema = createSchema;
5
+ const mongoose_1 = require("mongoose");
6
+ const writeConcern_1 = require("../../writeConcern");
7
+ const settings_1 = require("../../../../settings");
8
+ const modelName = 'Action.Inform';
9
+ exports.modelName = modelName;
10
+ const schemaDefinition = {
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
+ actionStatus: { type: String, required: true },
13
+ typeOf: { type: String, required: true },
14
+ agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
15
+ object: { type: mongoose_1.SchemaTypes.Mixed, required: true },
16
+ startDate: { type: Date, required: true },
17
+ expires: { type: Date, required: true },
18
+ target: { type: mongoose_1.SchemaTypes.Mixed, required: true },
19
+ recipient: { type: mongoose_1.SchemaTypes.Mixed, required: true },
20
+ result: mongoose_1.SchemaTypes.Mixed,
21
+ error: mongoose_1.SchemaTypes.Mixed,
22
+ endDate: Date,
23
+ about: mongoose_1.SchemaTypes.Mixed,
24
+ purpose: mongoose_1.SchemaTypes.Mixed,
25
+ };
26
+ const schemaOptions = {
27
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
28
+ autoCreate: false,
29
+ collection: 'actions.inform',
30
+ id: true,
31
+ read: 'primary',
32
+ writeConcern: writeConcern_1.writeConcern,
33
+ strict: true,
34
+ strictQuery: false,
35
+ timestamps: false,
36
+ versionKey: false,
37
+ toJSON: {
38
+ getters: false,
39
+ virtuals: false,
40
+ minimize: false,
41
+ versionKey: false
42
+ },
43
+ toObject: {
44
+ getters: false,
45
+ virtuals: true,
46
+ minimize: false,
47
+ versionKey: false
48
+ }
49
+ };
50
+ const indexes = [
51
+ [
52
+ { expires: 1 },
53
+ {
54
+ name: 'expires',
55
+ expireAfterSeconds: 0
56
+ }
57
+ ],
58
+ [
59
+ { startDate: -1 },
60
+ { name: 'startDate' }
61
+ ],
62
+ [
63
+ { 'project.id': 1, startDate: -1 },
64
+ { name: 'projectId' }
65
+ ],
66
+ ];
67
+ exports.indexes = indexes;
68
+ /**
69
+ * 通知アクションスキーマ
70
+ */
71
+ let schema;
72
+ function createSchema() {
73
+ if (schema === undefined) {
74
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
75
+ }
76
+ if (settings_1.MONGO_AUTO_INDEX) {
77
+ indexes.forEach((indexParams) => {
78
+ schema?.index(...indexParams);
79
+ });
80
+ }
81
+ return schema;
82
+ }
@@ -0,0 +1,12 @@
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import { IVirtuals } from '../../virtuals';
3
+ import { factory } from '../../../../factory';
4
+ type Keys = 'actionStatus' | 'agent' | 'endDate' | 'error' | 'instrument' | 'object' | 'project' | 'result' | 'sameAs' | 'startDate' | 'targetCollection' | 'typeOf' | 'expires';
5
+ type IDocType = Pick<factory.action.update.add.IAction, Keys> | Pick<factory.action.update.replace.IAction, Keys> | Pick<factory.action.update.update.IAction, Keys> | Pick<factory.action.update.deleteAction.IAction, Keys>;
6
+ type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
7
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
8
+ type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
9
+ declare const modelName = "Action.Update";
10
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
11
+ declare function createSchema(): ISchema;
12
+ export { createSchema, IDocType, IModel, indexes, modelName };