@chevre/domain 22.8.0-alpha.5 → 22.8.0-alpha.6

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 (433) hide show
  1. package/example/src/chevre/db/stats.ts +21 -8
  2. package/lib/chevre/credentials.js +1 -1
  3. package/lib/chevre/emailMessageBuilder.js +8 -9
  4. package/lib/chevre/errorHandler.js +9 -9
  5. package/lib/chevre/eventEmitter/assetTransaction.d.ts +0 -1
  6. package/lib/chevre/eventEmitter/task.d.ts +0 -1
  7. package/lib/chevre/eventEmitter/transaction.d.ts +0 -1
  8. package/lib/chevre/factory/accountTransactionIdentifier.js +6 -7
  9. package/lib/chevre/factory/event.js +1 -2
  10. package/lib/chevre/factory/taskIdentifier.js +1 -2
  11. package/lib/chevre/index.js +4 -4
  12. package/lib/chevre/repo/acceptedOffer.js +2 -2
  13. package/lib/chevre/repo/account.d.ts +0 -24
  14. package/lib/chevre/repo/account.js +2 -2
  15. package/lib/chevre/repo/accountTitle.d.ts +0 -24
  16. package/lib/chevre/repo/accountTransaction.js +2 -2
  17. package/lib/chevre/repo/accountingReport.d.ts +0 -24
  18. package/lib/chevre/repo/action.d.ts +0 -24
  19. package/lib/chevre/repo/action.js +33 -11
  20. package/lib/chevre/repo/additionalProperty.d.ts +0 -24
  21. package/lib/chevre/repo/aggregateOffer.d.ts +0 -24
  22. package/lib/chevre/repo/aggregateOffer.js +2 -2
  23. package/lib/chevre/repo/aggregateReservation.d.ts +0 -24
  24. package/lib/chevre/repo/aggregateReservation.js +1 -1
  25. package/lib/chevre/repo/aggregation.d.ts +0 -24
  26. package/lib/chevre/repo/aggregation.js +1 -1
  27. package/lib/chevre/repo/assetTransaction.d.ts +0 -24
  28. package/lib/chevre/repo/assetTransaction.js +4 -4
  29. package/lib/chevre/repo/authorization.d.ts +0 -24
  30. package/lib/chevre/repo/authorization.js +1 -1
  31. package/lib/chevre/repo/categoryCode.d.ts +0 -24
  32. package/lib/chevre/repo/categoryCode.js +1 -1
  33. package/lib/chevre/repo/comment.d.ts +0 -24
  34. package/lib/chevre/repo/comment.js +1 -1
  35. package/lib/chevre/repo/confirmationNumber.js +1 -1
  36. package/lib/chevre/repo/creativeWork.d.ts +4 -28
  37. package/lib/chevre/repo/creativeWork.js +1 -1
  38. package/lib/chevre/repo/credentials.js +1 -1
  39. package/lib/chevre/repo/customer.d.ts +0 -24
  40. package/lib/chevre/repo/customer.js +2 -2
  41. package/lib/chevre/repo/event.d.ts +2 -26
  42. package/lib/chevre/repo/event.js +3 -3
  43. package/lib/chevre/repo/eventSellerMakesOffer.js +1 -1
  44. package/lib/chevre/repo/eventSeries.d.ts +0 -24
  45. package/lib/chevre/repo/eventSeries.js +2 -2
  46. package/lib/chevre/repo/interface.js +1 -1
  47. package/lib/chevre/repo/member.d.ts +0 -24
  48. package/lib/chevre/repo/member.js +1 -1
  49. package/lib/chevre/repo/merchantReturnPolicy.d.ts +8 -32
  50. package/lib/chevre/repo/merchantReturnPolicy.js +1 -1
  51. package/lib/chevre/repo/message.d.ts +0 -24
  52. package/lib/chevre/repo/message.js +1 -1
  53. package/lib/chevre/repo/mongoose/onIndexCreated.js +2 -2
  54. package/lib/chevre/repo/mongoose/schemas/account.js +2 -2
  55. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +5 -5
  56. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +2 -2
  57. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +4 -4
  58. package/lib/chevre/repo/mongoose/schemas/action.js +6 -6
  59. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -2
  60. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +4 -4
  61. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +4 -4
  62. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +4 -4
  63. package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -2
  64. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +2 -2
  65. package/lib/chevre/repo/mongoose/schemas/authorization.js +4 -4
  66. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +4 -4
  67. package/lib/chevre/repo/mongoose/schemas/civicStructure.js +2 -2
  68. package/lib/chevre/repo/mongoose/schemas/comments.js +4 -4
  69. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +4 -4
  70. package/lib/chevre/repo/mongoose/schemas/customer.js +4 -4
  71. package/lib/chevre/repo/mongoose/schemas/customerType.js +4 -4
  72. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +4 -4
  73. package/lib/chevre/repo/mongoose/schemas/event.js +4 -4
  74. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +2 -2
  75. package/lib/chevre/repo/mongoose/schemas/interface.js +2 -2
  76. package/lib/chevre/repo/mongoose/schemas/member.js +2 -2
  77. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +4 -4
  78. package/lib/chevre/repo/mongoose/schemas/message.js +2 -2
  79. package/lib/chevre/repo/mongoose/schemas/note.js +2 -2
  80. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +4 -4
  81. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +4 -4
  82. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +4 -4
  83. package/lib/chevre/repo/mongoose/schemas/order.js +3 -3
  84. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +2 -2
  85. package/lib/chevre/repo/mongoose/schemas/paymentService.js +2 -2
  86. package/lib/chevre/repo/mongoose/schemas/place.js +4 -4
  87. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +5 -5
  88. package/lib/chevre/repo/mongoose/schemas/product.js +5 -5
  89. package/lib/chevre/repo/mongoose/schemas/productModel.js +4 -4
  90. package/lib/chevre/repo/mongoose/schemas/project.js +4 -4
  91. package/lib/chevre/repo/mongoose/schemas/reservation.js +4 -4
  92. package/lib/chevre/repo/mongoose/schemas/role.js +2 -2
  93. package/lib/chevre/repo/mongoose/schemas/schedule.js +2 -2
  94. package/lib/chevre/repo/mongoose/schemas/seller.js +4 -4
  95. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +4 -4
  96. package/lib/chevre/repo/mongoose/schemas/setting.js +2 -2
  97. package/lib/chevre/repo/mongoose/schemas/task.js +2 -2
  98. package/lib/chevre/repo/mongoose/schemas/telemetry.js +4 -4
  99. package/lib/chevre/repo/mongoose/schemas/ticket.js +2 -2
  100. package/lib/chevre/repo/mongoose/schemas/transaction.js +4 -4
  101. package/lib/chevre/repo/mongoose/schemas/trip.js +4 -4
  102. package/lib/chevre/repo/note.d.ts +0 -24
  103. package/lib/chevre/repo/note.js +2 -2
  104. package/lib/chevre/repo/offer.d.ts +0 -24
  105. package/lib/chevre/repo/offer.js +6 -6
  106. package/lib/chevre/repo/offerCatalog.d.ts +2 -26
  107. package/lib/chevre/repo/offerCatalog.js +2 -2
  108. package/lib/chevre/repo/offerCatalogItem.d.ts +0 -24
  109. package/lib/chevre/repo/offerCatalogItem.js +1 -1
  110. package/lib/chevre/repo/offerItemCondition.d.ts +0 -24
  111. package/lib/chevre/repo/offerItemCondition.js +1 -1
  112. package/lib/chevre/repo/order.d.ts +4 -28
  113. package/lib/chevre/repo/order.js +8 -8
  114. package/lib/chevre/repo/orderInTransaction.d.ts +0 -24
  115. package/lib/chevre/repo/orderInTransaction.js +3 -3
  116. package/lib/chevre/repo/orderNumber.js +1 -1
  117. package/lib/chevre/repo/ownershipInfo.d.ts +0 -24
  118. package/lib/chevre/repo/ownershipInfo.js +1 -1
  119. package/lib/chevre/repo/passport.js +1 -1
  120. package/lib/chevre/repo/paymentService.d.ts +0 -24
  121. package/lib/chevre/repo/paymentService.js +2 -2
  122. package/lib/chevre/repo/paymentServiceProvider.d.ts +0 -24
  123. package/lib/chevre/repo/paymentServiceProvider.js +2 -2
  124. package/lib/chevre/repo/permit.js +2 -2
  125. package/lib/chevre/repo/place/busStop.js +1 -1
  126. package/lib/chevre/repo/place/hasPOS.js +2 -2
  127. package/lib/chevre/repo/place/movieTheater.d.ts +2 -26
  128. package/lib/chevre/repo/place/movieTheater.js +2 -2
  129. package/lib/chevre/repo/place/screeningRoom.js +5 -5
  130. package/lib/chevre/repo/place/seat.js +7 -7
  131. package/lib/chevre/repo/place/section.js +4 -4
  132. package/lib/chevre/repo/priceSpecification.d.ts +16 -40
  133. package/lib/chevre/repo/priceSpecification.js +2 -2
  134. package/lib/chevre/repo/product.d.ts +0 -24
  135. package/lib/chevre/repo/product.js +2 -2
  136. package/lib/chevre/repo/productModel.d.ts +0 -24
  137. package/lib/chevre/repo/productOffer.d.ts +0 -24
  138. package/lib/chevre/repo/productOffer.js +5 -5
  139. package/lib/chevre/repo/project.d.ts +4 -28
  140. package/lib/chevre/repo/project.js +3 -3
  141. package/lib/chevre/repo/projectMakesOffer.js +1 -1
  142. package/lib/chevre/repo/rateLimit/offer.js +1 -1
  143. package/lib/chevre/repo/reservation.d.ts +6 -30
  144. package/lib/chevre/repo/reservation.js +5 -5
  145. package/lib/chevre/repo/schedule.js +1 -1
  146. package/lib/chevre/repo/seller.d.ts +4 -28
  147. package/lib/chevre/repo/seller.js +3 -3
  148. package/lib/chevre/repo/sellerPaymentAccepted.js +1 -1
  149. package/lib/chevre/repo/serviceOutput.d.ts +0 -24
  150. package/lib/chevre/repo/serviceOutputIdentifier.js +1 -1
  151. package/lib/chevre/repo/setting.d.ts +0 -24
  152. package/lib/chevre/repo/setting.js +1 -1
  153. package/lib/chevre/repo/stockHolder.js +1 -1
  154. package/lib/chevre/repo/task.d.ts +8 -32
  155. package/lib/chevre/repo/task.js +8 -8
  156. package/lib/chevre/repo/ticket.js +2 -2
  157. package/lib/chevre/repo/transaction.d.ts +0 -24
  158. package/lib/chevre/repo/transaction.js +7 -7
  159. package/lib/chevre/repo/transactionNumber.js +1 -1
  160. package/lib/chevre/repo/trip.d.ts +0 -24
  161. package/lib/chevre/repository.js +67 -67
  162. package/lib/chevre/service/account.js +3 -4
  163. package/lib/chevre/service/accountTransaction/deposit.js +1 -2
  164. package/lib/chevre/service/accountTransaction/factory.js +1 -2
  165. package/lib/chevre/service/accountTransaction/transfer.js +1 -2
  166. package/lib/chevre/service/accountTransaction/withdraw.js +1 -2
  167. package/lib/chevre/service/accountTransaction.js +2 -2
  168. package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
  169. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -2
  170. package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -2
  171. package/lib/chevre/service/aggregation/event/importFromCOA.js +2 -3
  172. package/lib/chevre/service/aggregation/project.js +1 -2
  173. package/lib/chevre/service/aggregation/system.js +15 -16
  174. package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +2 -3
  175. package/lib/chevre/service/assetTransaction/cancelReservation.js +5 -6
  176. package/lib/chevre/service/assetTransaction/cancelReservationCOA/factory.js +1 -2
  177. package/lib/chevre/service/assetTransaction/cancelReservationCOA.js +1 -2
  178. package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.js +1 -2
  179. package/lib/chevre/service/assetTransaction/moneyTransfer.js +4 -5
  180. package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -2
  181. package/lib/chevre/service/assetTransaction/pay/factory.js +1 -2
  182. package/lib/chevre/service/assetTransaction/pay.js +8 -9
  183. package/lib/chevre/service/assetTransaction/refund/factory.js +1 -2
  184. package/lib/chevre/service/assetTransaction/refund/potentialActions.js +1 -2
  185. package/lib/chevre/service/assetTransaction/refund.js +4 -5
  186. package/lib/chevre/service/assetTransaction/registerService/factory.js +2 -3
  187. package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +1 -2
  188. package/lib/chevre/service/assetTransaction/registerService.js +6 -7
  189. package/lib/chevre/service/assetTransaction/reserve/cancel.js +1 -2
  190. package/lib/chevre/service/assetTransaction/reserve/confirm/factory.js +1 -2
  191. package/lib/chevre/service/assetTransaction/reserve/confirm.js +1 -2
  192. package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +2 -3
  193. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +1 -2
  194. package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.js +1 -2
  195. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +5 -6
  196. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +2 -3
  197. package/lib/chevre/service/assetTransaction/reserve/start/factory/price.js +1 -2
  198. package/lib/chevre/service/assetTransaction/reserve/start.js +1 -2
  199. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +1 -2
  200. package/lib/chevre/service/assetTransaction/reserveCOA/factory.js +1 -2
  201. package/lib/chevre/service/assetTransaction/reserveCOA.js +1 -2
  202. package/lib/chevre/service/assetTransaction.js +2 -2
  203. package/lib/chevre/service/code.js +7 -8
  204. package/lib/chevre/service/delivery/factory.js +1 -2
  205. package/lib/chevre/service/delivery/product/factory.js +1 -2
  206. package/lib/chevre/service/delivery/reservation/factory.js +1 -2
  207. package/lib/chevre/service/delivery.js +4 -5
  208. package/lib/chevre/service/event.js +11 -12
  209. package/lib/chevre/service/iam.js +1 -2
  210. package/lib/chevre/service/moneyTransfer.js +3 -4
  211. package/lib/chevre/service/notification/factory.js +3 -3
  212. package/lib/chevre/service/notification.js +3 -4
  213. package/lib/chevre/service/offer/any.js +2 -3
  214. package/lib/chevre/service/offer/event/authorize/factory.js +6 -7
  215. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +1 -2
  216. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +1 -2
  217. package/lib/chevre/service/offer/event/authorize.js +1 -2
  218. package/lib/chevre/service/offer/event/checkAvailability.js +1 -2
  219. package/lib/chevre/service/offer/event/importFromCOA/factory.js +2 -3
  220. package/lib/chevre/service/offer/event/importFromCOA.js +2 -3
  221. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +1 -2
  222. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.d.ts +1 -1
  223. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +1 -2
  224. package/lib/chevre/service/offer/event/searchOfferCatalogItemAvailability.js +1 -2
  225. package/lib/chevre/service/offer/event/searchOfferCatalogItems.js +1 -2
  226. package/lib/chevre/service/offer/event/searchOffersByIds.js +1 -2
  227. package/lib/chevre/service/offer/event/searchPriceSpecs4event.js +1 -2
  228. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -2
  229. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +2 -3
  230. package/lib/chevre/service/offer/event/voidTransaction.js +1 -2
  231. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -2
  232. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +3 -4
  233. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.js +2 -3
  234. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -3
  235. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +6 -7
  236. package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -3
  237. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +2 -3
  238. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +1 -2
  239. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -2
  240. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +1 -2
  241. package/lib/chevre/service/offer/factory.js +2 -3
  242. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -2
  243. package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -2
  244. package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +2 -3
  245. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -2
  246. package/lib/chevre/service/offer/onEventChanged.js +1 -2
  247. package/lib/chevre/service/offer/product/factory.js +5 -6
  248. package/lib/chevre/service/offer/product/searchProductOffers.js +2 -3
  249. package/lib/chevre/service/offer/product.d.ts +1 -1
  250. package/lib/chevre/service/offer/product.js +6 -6
  251. package/lib/chevre/service/offer.js +3 -3
  252. package/lib/chevre/service/order/confirmPayTransaction.js +1 -2
  253. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +1 -2
  254. package/lib/chevre/service/order/deleteOrder.js +1 -2
  255. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -2
  256. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +3 -4
  257. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.js +1 -2
  258. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -2
  259. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +1 -2
  260. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -2
  261. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +3 -4
  262. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +2 -3
  263. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -3
  264. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -3
  265. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +2 -3
  266. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -5
  267. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +2 -3
  268. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -2
  269. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +4 -5
  270. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -3
  271. package/lib/chevre/service/order/onOrderUpdated/factory.js +1 -2
  272. package/lib/chevre/service/order/onOrderUpdated.js +1 -2
  273. package/lib/chevre/service/order/payOrder.js +1 -2
  274. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -2
  275. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +1 -2
  276. package/lib/chevre/service/order/placeOrder/factory.js +5 -6
  277. package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +1 -2
  278. package/lib/chevre/service/order/placeOrder.js +1 -2
  279. package/lib/chevre/service/order/placeOrderWithoutTransaction.js +1 -2
  280. package/lib/chevre/service/order/returnOrder.js +1 -2
  281. package/lib/chevre/service/order/sendOrder.js +1 -2
  282. package/lib/chevre/service/payment/any/factory.js +5 -6
  283. package/lib/chevre/service/payment/any/fixConfirmationNumberAsNeeded.js +1 -2
  284. package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +2 -2
  285. package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.js +1 -2
  286. package/lib/chevre/service/payment/any/onPaid.js +3 -4
  287. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.js +1 -2
  288. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.js +1 -2
  289. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +1 -2
  290. package/lib/chevre/service/payment/any/onRefund.js +3 -4
  291. package/lib/chevre/service/payment/any/person2username.js +2 -3
  292. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -1
  293. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +1 -2
  294. package/lib/chevre/service/payment/any.js +10 -10
  295. package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +1 -2
  296. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -2
  297. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -2
  298. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.js +1 -2
  299. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.js +1 -2
  300. package/lib/chevre/service/payment/creditCard/authorize.js +1 -2
  301. package/lib/chevre/service/payment/creditCard/factory.js +2 -3
  302. package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +1 -2
  303. package/lib/chevre/service/payment/creditCard/gmoError.js +1 -2
  304. package/lib/chevre/service/payment/creditCard/payCreditCard.js +2 -3
  305. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -2
  306. package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +2 -3
  307. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -2
  308. package/lib/chevre/service/payment/faceToFace.js +3 -4
  309. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -2
  310. package/lib/chevre/service/payment/factory.js +1 -2
  311. package/lib/chevre/service/payment/movieTicket/authorize.js +1 -2
  312. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -2
  313. package/lib/chevre/service/payment/movieTicket/factory.js +14 -15
  314. package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -2
  315. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -2
  316. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -2
  317. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +1 -2
  318. package/lib/chevre/service/payment/movieTicket/validation.js +3 -4
  319. package/lib/chevre/service/payment/movieTicket/voidTransaction.js +1 -2
  320. package/lib/chevre/service/payment/paymentCard.js +4 -5
  321. package/lib/chevre/service/payment.d.ts +1 -1
  322. package/lib/chevre/service/payment.js +5 -6
  323. package/lib/chevre/service/permit.js +11 -6
  324. package/lib/chevre/service/product.js +1 -2
  325. package/lib/chevre/service/project.js +2 -3
  326. package/lib/chevre/service/report/ownershipInfo.js +1 -2
  327. package/lib/chevre/service/report/telemetry.js +14 -14
  328. package/lib/chevre/service/reserve/cancelReservation.js +3 -4
  329. package/lib/chevre/service/reserve/checkInReservation.js +2 -3
  330. package/lib/chevre/service/reserve/confirmReservation.js +3 -4
  331. package/lib/chevre/service/reserve/factory.js +4 -4
  332. package/lib/chevre/service/reserve/findByCode.js +1 -2
  333. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -2
  334. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -2
  335. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -2
  336. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +4 -5
  337. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -2
  338. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -2
  339. package/lib/chevre/service/reserve/searchByOrder.js +1 -2
  340. package/lib/chevre/service/reserve/useReservation.js +2 -3
  341. package/lib/chevre/service/reserve/verifyToken4reservation.js +1 -2
  342. package/lib/chevre/service/task/acceptCOAOffer.js +8 -9
  343. package/lib/chevre/service/task/aggregateOffers.js +2 -3
  344. package/lib/chevre/service/task/aggregateOnSystem.js +1 -2
  345. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -3
  346. package/lib/chevre/service/task/authorizePayment.js +2 -3
  347. package/lib/chevre/service/task/cancelMoneyTransfer.js +2 -3
  348. package/lib/chevre/service/task/cancelPendingReservation.js +2 -3
  349. package/lib/chevre/service/task/cancelReservation.js +2 -3
  350. package/lib/chevre/service/task/checkMovieTicket.js +6 -7
  351. package/lib/chevre/service/task/checkResource.js +2 -3
  352. package/lib/chevre/service/task/confirmMoneyTransfer.js +2 -3
  353. package/lib/chevre/service/task/confirmPayTransaction.js +2 -3
  354. package/lib/chevre/service/task/confirmRegisterService.js +2 -3
  355. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +5 -6
  356. package/lib/chevre/service/task/confirmReserveTransaction.js +10 -11
  357. package/lib/chevre/service/task/createAccountingReport.js +2 -3
  358. package/lib/chevre/service/task/createEvent/createEvent.js +1 -2
  359. package/lib/chevre/service/task/createEvent/createEventBySchedule.js +2 -3
  360. package/lib/chevre/service/task/createEvent/createEventSeries.js +1 -2
  361. package/lib/chevre/service/task/createEvent.js +2 -3
  362. package/lib/chevre/service/task/deletePerson.js +2 -3
  363. package/lib/chevre/service/task/deleteTransaction.js +2 -3
  364. package/lib/chevre/service/task/givePointAward.js +2 -3
  365. package/lib/chevre/service/task/handleNotification.js +1 -2
  366. package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +5 -6
  367. package/lib/chevre/service/task/importEventsFromCOA.js +5 -6
  368. package/lib/chevre/service/task/importOffersFromCOA.js +6 -7
  369. package/lib/chevre/service/task/moneyTransfer.js +2 -3
  370. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -3
  371. package/lib/chevre/service/task/onAuthorizationCreated.js +2 -3
  372. package/lib/chevre/service/task/onEventChanged.js +2 -3
  373. package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -3
  374. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +1 -2
  375. package/lib/chevre/service/task/onResourceUpdated/onCategoryCodeUpdated.js +1 -2
  376. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -2
  377. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +2 -3
  378. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +1 -2
  379. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -2
  380. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +1 -2
  381. package/lib/chevre/service/task/onResourceUpdated.js +3 -4
  382. package/lib/chevre/service/task/pay.js +4 -5
  383. package/lib/chevre/service/task/placeOrder.js +2 -3
  384. package/lib/chevre/service/task/publishPaymentUrl.js +2 -3
  385. package/lib/chevre/service/task/refund.js +4 -5
  386. package/lib/chevre/service/task/registerService.js +2 -3
  387. package/lib/chevre/service/task/reserve.js +3 -4
  388. package/lib/chevre/service/task/returnMoneyTransfer.js +2 -3
  389. package/lib/chevre/service/task/returnOrder.js +2 -3
  390. package/lib/chevre/service/task/returnPayTransaction.js +2 -3
  391. package/lib/chevre/service/task/returnPointAward.js +2 -3
  392. package/lib/chevre/service/task/returnReserveTransaction.js +7 -8
  393. package/lib/chevre/service/task/sendEmailMessage.js +2 -3
  394. package/lib/chevre/service/task/sendOrder.js +4 -5
  395. package/lib/chevre/service/task/triggerWebhook.js +2 -3
  396. package/lib/chevre/service/task/useReservation.js +4 -5
  397. package/lib/chevre/service/task/voidMoneyTransferTransaction.js +2 -3
  398. package/lib/chevre/service/task/voidPayTransaction.js +2 -3
  399. package/lib/chevre/service/task/voidPayment.js +2 -3
  400. package/lib/chevre/service/task/voidRegisterServiceTransaction.js +2 -3
  401. package/lib/chevre/service/task/voidReserveTransaction.js +7 -8
  402. package/lib/chevre/service/task.js +5 -6
  403. package/lib/chevre/service/transaction/deleteTransaction.js +1 -2
  404. package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +1 -2
  405. package/lib/chevre/service/transaction/moneyTransfer/factory.js +1 -2
  406. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -2
  407. package/lib/chevre/service/transaction/moneyTransfer.js +3 -4
  408. package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +1 -2
  409. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +2 -3
  410. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +1 -2
  411. package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +1 -2
  412. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.js +2 -3
  413. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +5 -6
  414. package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -3
  415. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -2
  416. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -2
  417. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +1 -2
  418. package/lib/chevre/service/transaction/placeOrder/publishOrderNumberIfNotExist.js +1 -2
  419. package/lib/chevre/service/transaction/placeOrder/start/factory.js +2 -2
  420. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +1 -1
  421. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -2
  422. package/lib/chevre/service/transaction/placeOrder/start.js +1 -2
  423. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +1 -2
  424. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -3
  425. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +2 -3
  426. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +2 -3
  427. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -2
  428. package/lib/chevre/service/transaction/returnOrder/preStart.js +4 -5
  429. package/lib/chevre/service/transaction/returnOrder.js +4 -4
  430. package/lib/chevre/service/transaction.js +3 -3
  431. package/lib/chevre/service/validation/validateOrder.js +1 -2
  432. package/lib/chevre/service.js +19 -19
  433. package/package.json +4 -4
@@ -5,14 +5,27 @@ const KILO_BYTES = 1024;
5
5
  async function main() {
6
6
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
7
7
 
8
- const stats = await mongoose.connection.db.collection('tasks')
9
- .stats({
10
- scale: KILO_BYTES * KILO_BYTES
11
- });
12
- console.log('scaleFactor:', stats.scaleFactor);
13
- console.log('avgObjSize:', stats.avgObjSize);
14
- console.log('count:', stats.count);
15
- console.log('size:', stats.size);
8
+ let storageStats;
9
+ // const stats = await mongoose.connection.db.collection('tasks')
10
+ // .stats({
11
+ // scale: KILO_BYTES * KILO_BYTES
12
+ // });
13
+ storageStats = (await mongoose.connection.db.collection('tasks')
14
+ .aggregate([{
15
+ $collStats: {
16
+ storageStats: {
17
+ scale: KILO_BYTES * KILO_BYTES
18
+ }
19
+ }
20
+ }])
21
+ .limit(1)
22
+ .toArray())
23
+ .at(0)?.storageStats;
24
+
25
+ console.log('scaleFactor:', storageStats.scaleFactor);
26
+ console.log('avgObjSize:', storageStats.avgObjSize);
27
+ console.log('count:', storageStats.count);
28
+ console.log('size:', storageStats.size);
16
29
  }
17
30
 
18
31
  main()
@@ -54,4 +54,4 @@ var credentials;
54
54
  }
55
55
  SendGrid.createInstance = createInstance;
56
56
  })(SendGrid = credentials.SendGrid || (credentials.SendGrid = {}));
57
- })(credentials = exports.credentials || (exports.credentials = {}));
57
+ })(credentials || (exports.credentials = credentials = {}));
@@ -9,15 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createRefundMessage = exports.createReturnOrderMessage = exports.createSendOrderMessage = void 0;
12
+ exports.createSendOrderMessage = createSendOrderMessage;
13
+ exports.createReturnOrderMessage = createReturnOrderMessage;
14
+ exports.createRefundMessage = createRefundMessage;
13
15
  /**
14
16
  * Eメールメッセージビルダー
15
17
  */
16
18
  const pug = require("pug");
17
19
  const factory = require("./factory");
18
20
  function createEmailMessageText(params) {
19
- var _a, _b, _c;
20
21
  return __awaiter(this, void 0, void 0, function* () {
22
+ var _a, _b, _c;
21
23
  const emailTemplate = (_a = params.email) === null || _a === void 0 ? void 0 : _a.template;
22
24
  const emailText = (_b = params.email) === null || _b === void 0 ? void 0 : _b.text;
23
25
  const emailMessageTextByDB = (_c = params.emailMessage) === null || _c === void 0 ? void 0 : _c.text;
@@ -55,8 +57,8 @@ function createEmailMessageText(params) {
55
57
  });
56
58
  }
57
59
  function createEmailMessageAbout(params) {
58
- var _a, _b, _c, _d, _e;
59
60
  return __awaiter(this, void 0, void 0, function* () {
61
+ var _a, _b, _c, _d, _e;
60
62
  const abouyIdentifierByDB = (_a = params.emailMessage) === null || _a === void 0 ? void 0 : _a.about.identifier;
61
63
  const abouyNameByDB = (_b = params.emailMessage) === null || _b === void 0 ? void 0 : _b.about.name;
62
64
  let about;
@@ -129,8 +131,8 @@ setting) {
129
131
  function createSendOrderMessage(params,
130
132
  // settings: Settings
131
133
  setting) {
132
- var _a;
133
134
  return __awaiter(this, void 0, void 0, function* () {
135
+ var _a;
134
136
  const emailMessageText = yield createEmailMessageText({
135
137
  order: params.order,
136
138
  email: params.email,
@@ -182,15 +184,14 @@ setting) {
182
184
  };
183
185
  });
184
186
  }
185
- exports.createSendOrderMessage = createSendOrderMessage;
186
187
  /**
187
188
  * 注文返品メッセージを作成する
188
189
  */
189
190
  function createReturnOrderMessage(params,
190
191
  // settings: Settings
191
192
  setting) {
192
- var _a;
193
193
  return __awaiter(this, void 0, void 0, function* () {
194
+ var _a;
194
195
  const emailMessageText = yield createEmailMessageText({
195
196
  order: params.order,
196
197
  email: params.email,
@@ -242,15 +243,14 @@ setting) {
242
243
  };
243
244
  });
244
245
  }
245
- exports.createReturnOrderMessage = createReturnOrderMessage;
246
246
  /**
247
247
  * 返金メッセージを作成する
248
248
  */
249
249
  function createRefundMessage(params,
250
250
  // settings: Settings
251
251
  setting) {
252
- var _a;
253
252
  return __awaiter(this, void 0, void 0, function* () {
253
+ var _a;
254
254
  const emailMessageText = yield createEmailMessageText({
255
255
  order: params.order,
256
256
  email: params.email
@@ -300,4 +300,3 @@ setting) {
300
300
  };
301
301
  });
302
302
  }
303
- exports.createRefundMessage = createRefundMessage;
@@ -9,7 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.handleAWSError = exports.handleMvtkReserveError = exports.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME = exports.handlePecorinoError = exports.handleCOAReserveTemporarilyError = exports.handleCOAError = exports.handleMongoError = exports.isMongoError = exports.MongoErrorCode = void 0;
12
+ exports.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME = exports.MongoErrorCode = void 0;
13
+ exports.isMongoError = isMongoError;
14
+ exports.handleMongoError = handleMongoError;
15
+ exports.handleCOAError = handleCOAError;
16
+ exports.handleCOAReserveTemporarilyError = handleCOAReserveTemporarilyError;
17
+ exports.handlePecorinoError = handlePecorinoError;
18
+ exports.handleMvtkReserveError = handleMvtkReserveError;
19
+ exports.handleAWSError = handleAWSError;
13
20
  /**
14
21
  * エラーハンドラー
15
22
  * 外部サービスと連携している場合に、サービス(API)のエラーを本ドメインのエラーに変換する責任を担います。
@@ -22,7 +29,7 @@ var MongoErrorCode;
22
29
  MongoErrorCode[MongoErrorCode["DuplicateKey"] = 11000] = "DuplicateKey";
23
30
  MongoErrorCode[MongoErrorCode["MaxTimeMSExpired"] = 50] = "MaxTimeMSExpired";
24
31
  MongoErrorCode[MongoErrorCode["ExceededTimeLimit"] = 262] = "ExceededTimeLimit";
25
- })(MongoErrorCode = exports.MongoErrorCode || (exports.MongoErrorCode = {}));
32
+ })(MongoErrorCode || (exports.MongoErrorCode = MongoErrorCode = {}));
26
33
  function isMongoError(error) {
27
34
  return __awaiter(this, void 0, void 0, function* () {
28
35
  if (mongo === undefined) {
@@ -31,7 +38,6 @@ function isMongoError(error) {
31
38
  return (error instanceof mongo.MongoError || error instanceof mongo.MongoServerError);
32
39
  });
33
40
  }
34
- exports.isMongoError = isMongoError;
35
41
  function handleMongoError(error) {
36
42
  return __awaiter(this, void 0, void 0, function* () {
37
43
  if (mongo === undefined) {
@@ -57,7 +63,6 @@ function handleMongoError(error) {
57
63
  return handledError;
58
64
  });
59
65
  }
60
- exports.handleMongoError = handleMongoError;
61
66
  /**
62
67
  * 汎用的なCOAエラーハンドリング
63
68
  */
@@ -80,7 +85,6 @@ function handleCOAError(error) {
80
85
  }
81
86
  return handledError;
82
87
  }
83
- exports.handleCOAError = handleCOAError;
84
88
  /**
85
89
  * COA仮予約エラーハンドリング
86
90
  */
@@ -112,7 +116,6 @@ function handleCOAReserveTemporarilyError(error) {
112
116
  }
113
117
  return handledError;
114
118
  }
115
- exports.handleCOAReserveTemporarilyError = handleCOAReserveTemporarilyError;
116
119
  /**
117
120
  * Pecorinoサービスエラーをハンドリングする
118
121
  * 可能であればChevreエラーへ変換します
@@ -146,7 +149,6 @@ function handlePecorinoError(error) {
146
149
  }
147
150
  return handledError;
148
151
  }
149
- exports.handlePecorinoError = handlePecorinoError;
150
152
  exports.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME = 'MovieticketReserveRequestError';
151
153
  /**
152
154
  * ムビチケ着券サービスエラーをハンドリングする
@@ -186,7 +188,6 @@ function handleMvtkReserveError(error) {
186
188
  }
187
189
  return handledError;
188
190
  }
189
- exports.handleMvtkReserveError = handleMvtkReserveError;
190
191
  /**
191
192
  * AWSエラーハンドリング
192
193
  */
@@ -220,4 +221,3 @@ function handleAWSError(error) {
220
221
  }
221
222
  return handledError;
222
223
  }
223
- exports.handleAWSError = handleAWSError;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from 'events';
3
2
  import * as factory from '../factory';
4
3
  interface IListenArgsOnAssetTransactionStatusChanged {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from 'events';
3
2
  import * as factory from '../factory';
4
3
  interface IListenArgsOnTaskStatusChanged {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from 'events';
3
2
  import * as factory from '../factory';
4
3
  interface IListenArgsOnTransactionStatusChanged {
@@ -1,28 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createReturnMoneyTransferIdentifier = exports.createRefundIdentifier = exports.createPayIdentifier = exports.createReturnPointAwardIdentifier = exports.createPointAwardPurposeIdentifier4reservation = exports.createPointAwardIdentifier = void 0;
3
+ exports.createPointAwardIdentifier = createPointAwardIdentifier;
4
+ exports.createPointAwardPurposeIdentifier4reservation = createPointAwardPurposeIdentifier4reservation;
5
+ exports.createReturnPointAwardIdentifier = createReturnPointAwardIdentifier;
6
+ exports.createPayIdentifier = createPayIdentifier;
7
+ exports.createRefundIdentifier = createRefundIdentifier;
8
+ exports.createReturnMoneyTransferIdentifier = createReturnMoneyTransferIdentifier;
4
9
  const util = require("util");
5
10
  function createPointAwardIdentifier(params) {
6
11
  return util.format('%s:%s:%s:%s', params.project.id, 'givePointAward', params.purpose.orderNumber, params.toLocation.identifier);
7
12
  }
8
- exports.createPointAwardIdentifier = createPointAwardIdentifier;
9
13
  function createPointAwardPurposeIdentifier4reservation(params) {
10
14
  return util.format('%s:%s:%s:%s:%s', params.project.id, 'givePointAward', params.assetTransaction.typeOf, params.reservation.id, params.toLocation.identifier);
11
15
  }
12
- exports.createPointAwardPurposeIdentifier4reservation = createPointAwardPurposeIdentifier4reservation;
13
16
  function createReturnPointAwardIdentifier(params) {
14
17
  return util.format('%s:%s:%s', params.project.id, 'returnPointAward', params.accountTransaction4givePointAward.transactionNumber);
15
18
  }
16
- exports.createReturnPointAwardIdentifier = createReturnPointAwardIdentifier;
17
19
  function createPayIdentifier(params) {
18
20
  return util.format('%s:%s:%s', params.project.id, 'pay', params.paymentMethodId);
19
21
  }
20
- exports.createPayIdentifier = createPayIdentifier;
21
22
  function createRefundIdentifier(params) {
22
23
  return util.format('%s:%s:%s', params.project.id, 'refund', params.paymentMethodId);
23
24
  }
24
- exports.createRefundIdentifier = createRefundIdentifier;
25
25
  function createReturnMoneyTransferIdentifier(params) {
26
26
  return util.format('%s:%s:%s', params.project.id, 'returnMoneyTransfer', params.depositTransaction.transactionNumber);
27
27
  }
28
- exports.createReturnMoneyTransferIdentifier = createReturnMoneyTransferIdentifier;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.minimizeSuperEvent = void 0;
3
+ exports.minimizeSuperEvent = minimizeSuperEvent;
4
4
  const factory = require("../factory");
5
5
  /**
6
6
  * 興行イベントのsuperEventを作成する
@@ -43,4 +43,3 @@ function minimizeSuperEvent(params) {
43
43
  ? { subtitleLanguage: params.superEventFromDB.subtitleLanguage }
44
44
  : undefined);
45
45
  }
46
- exports.minimizeSuperEvent = minimizeSuperEvent;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCheckMovieTicketTaskIdentifier = void 0;
3
+ exports.createCheckMovieTicketTaskIdentifier = createCheckMovieTicketTaskIdentifier;
4
4
  const util = require("util");
5
5
  const factory = require("../factory");
6
6
  function createCheckMovieTicketTaskIdentifier(params) {
7
7
  const { project, purpose, object } = params;
8
8
  return util.format(`%s:%s:%s:%s:%s:%s:%s`, project.id, factory.taskName.CheckMovieTicket, factory.transactionType.PlaceOrder, purpose.id, object.id, object.movieTicket.identifier, object.movieTicket.serviceOutput.reservationFor.id);
9
9
  }
10
- exports.createCheckMovieTicketTaskIdentifier = createCheckMovieTicketTaskIdentifier;
@@ -9,7 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.loadGMO = exports.loadCOA = exports.loadPecorinoapi = exports.settings = exports.service = exports.repository = exports.factory = exports.eventEmitter = exports.errorHandler = exports.credentials = void 0;
12
+ exports.settings = exports.service = exports.repository = exports.factory = exports.eventEmitter = exports.errorHandler = exports.credentials = void 0;
13
+ exports.loadPecorinoapi = loadPecorinoapi;
14
+ exports.loadCOA = loadCOA;
15
+ exports.loadGMO = loadGMO;
13
16
  const credentials_1 = require("./credentials");
14
17
  Object.defineProperty(exports, "credentials", { enumerable: true, get: function () { return credentials_1.credentials; } });
15
18
  const errorHandler = require("./errorHandler");
@@ -33,7 +36,6 @@ function loadPecorinoapi() {
33
36
  return pecorinoapi;
34
37
  });
35
38
  }
36
- exports.loadPecorinoapi = loadPecorinoapi;
37
39
  let COA;
38
40
  function loadCOA() {
39
41
  return __awaiter(this, void 0, void 0, function* () {
@@ -43,7 +45,6 @@ function loadCOA() {
43
45
  return COA;
44
46
  });
45
47
  }
46
- exports.loadCOA = loadCOA;
47
48
  let GMO;
48
49
  function loadGMO() {
49
50
  return __awaiter(this, void 0, void 0, function* () {
@@ -53,4 +54,3 @@ function loadGMO() {
53
54
  return GMO;
54
55
  });
55
56
  }
56
- exports.loadGMO = loadGMO;
@@ -25,8 +25,8 @@ class AcceptedOfferRepo {
25
25
  * オファー展開の注文検索
26
26
  */
27
27
  searchWithUnwoundAcceptedOffers(params, projection) {
28
- var _a;
29
28
  return __awaiter(this, void 0, void 0, function* () {
29
+ var _a;
30
30
  const conditions = order_2.OrderRepo.CREATE_MONGO_CONDITIONS(params);
31
31
  const aggregate = this.orderModel.aggregate();
32
32
  // pipelineの順序に注意
@@ -85,8 +85,8 @@ class AcceptedOfferRepo {
85
85
  * 注文オファーを展開して検索する
86
86
  */
87
87
  searchAcceptedOffersByOrderNumber(filter, inclusion) {
88
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
89
88
  return __awaiter(this, void 0, void 0, function* () {
89
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
90
90
  const matchStages = [
91
91
  { $match: { orderNumber: { $eq: filter.orderNumber.$eq } } },
92
92
  { $match: { 'project.id': { $eq: filter.project.id.$eq } } },
@@ -1,27 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
1
  import type { Connection } from 'mongoose';
26
2
  import * as factory from '../factory';
27
3
  /**
@@ -239,7 +239,7 @@ class AccountRepo {
239
239
  return __awaiter(this, void 0, void 0, function* () {
240
240
  const doc = yield this.accountModel.findOneAndUpdate(Object.assign({ accountNumber: params.accountNumber }, (params.force === true) ? undefined : { availableBalance: { $gte: params.amount } } // 利用可能金額確認
241
241
  ), {
242
- $inc: { availableBalance: -params.amount },
242
+ $inc: { availableBalance: -params.amount }, // 残高を減らす
243
243
  $push: { pendingTransactions: params.transaction } // 進行中取引追加
244
244
  }, { new: true })
245
245
  .exec();
@@ -399,8 +399,8 @@ class AccountRepo {
399
399
  * 口座を検索する
400
400
  */
401
401
  search(params) {
402
- var _a;
403
402
  return __awaiter(this, void 0, void 0, function* () {
403
+ var _a;
404
404
  const conditions = AccountRepo.CREATE_MONGO_CONDITIONS(params);
405
405
  const query = this.accountModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
406
406
  __v: 0,
@@ -1,27 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
1
  import type { Connection } from 'mongoose';
26
2
  import * as factory from '../factory';
27
3
  import { IModel } from './mongoose/schemas/accountTitle';
@@ -242,8 +242,8 @@ class AccountTransactionRepo {
242
242
  * 取引を検索する
243
243
  */
244
244
  search(params) {
245
- var _a;
246
245
  return __awaiter(this, void 0, void 0, function* () {
246
+ var _a;
247
247
  const conditions = AccountTransactionRepo.CREATE_MONGO_CONDITIONS(params);
248
248
  const query = this.transactionModel.find((conditions.length > 0) ? { $and: conditions } : {})
249
249
  .select({
@@ -267,8 +267,8 @@ class AccountTransactionRepo {
267
267
  });
268
268
  }
269
269
  clean(params) {
270
- var _a;
271
270
  return __awaiter(this, void 0, void 0, function* () {
271
+ var _a;
272
272
  yield this.transactionModel.deleteMany(Object.assign({
273
273
  // 終了日時を一定期間過ぎたもの
274
274
  endDate: {
@@ -1,27 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
1
  import type { Connection, PipelineStage } from 'mongoose';
26
2
  import { IAccountingReport, IChildReport, IOrder4report } from './mongoose/schemas/accountingReport';
27
3
  import * as factory from '../factory';
@@ -1,27 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
1
  import { factory as surfrockFactory } from '@surfrock/sdk';
26
2
  import { Connection, FilterQuery, UpdateQuery } from 'mongoose';
27
3
  import * as factory from '../factory';
@@ -453,8 +453,8 @@ class ActionRepo {
453
453
  * アクション検索
454
454
  */
455
455
  search(params, inclusion) {
456
- var _a;
457
456
  return __awaiter(this, void 0, void 0, function* () {
457
+ var _a;
458
458
  const conditions = ActionRepo.CREATE_MONGO_CONDITIONS(params);
459
459
  let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
460
460
  if (Array.isArray(inclusion) && inclusion.length > 0) {
@@ -488,8 +488,8 @@ class ActionRepo {
488
488
  * アクション開始
489
489
  */
490
490
  start(attributes, options) {
491
- var _a, _b;
492
491
  return __awaiter(this, void 0, void 0, function* () {
492
+ var _a, _b;
493
493
  const startDate = new Date();
494
494
  const creatingAction = Object.assign(Object.assign({}, attributes), { actionStatus: factory.actionStatusType.ActiveActionStatus, startDate });
495
495
  // reimplemnt with insertMany(2024-08-29~)
@@ -507,8 +507,8 @@ class ActionRepo {
507
507
  });
508
508
  }
509
509
  completeWithVoid(params) {
510
- var _a;
511
510
  return __awaiter(this, void 0, void 0, function* () {
511
+ var _a;
512
512
  if (((_a = params.recipe) === null || _a === void 0 ? void 0 : _a.typeOf) === 'Recipe') {
513
513
  yield this.upsertRecipe(Object.assign(Object.assign({}, params.recipe), { recipeFor: { id: params.id, typeOf: params.typeOf } }));
514
514
  }
@@ -566,8 +566,8 @@ class ActionRepo {
566
566
  * アクション失敗
567
567
  */
568
568
  giveUp(params) {
569
- var _a;
570
569
  return __awaiter(this, void 0, void 0, function* () {
570
+ var _a;
571
571
  const actionError = (Array.isArray(params.error))
572
572
  ? params.error.map((e) => (Object.assign(Object.assign({}, e), { message: e.message, name: e.name })))
573
573
  : Object.assign(Object.assign({}, params.error), { message: params.error.message, name: params.error.name });
@@ -595,8 +595,8 @@ class ActionRepo {
595
595
  * アクション再開
596
596
  */
597
597
  reStart(params) {
598
- var _a;
599
598
  return __awaiter(this, void 0, void 0, function* () {
599
+ var _a;
600
600
  const doc = yield this.actionModel.findOneAndUpdate({
601
601
  _id: { $eq: params.id },
602
602
  typeOf: { $eq: params.typeOf },
@@ -623,8 +623,8 @@ class ActionRepo {
623
623
  * 一定期間ActiveActionStatusのアクションをFailedActionStatusにする
624
624
  */
625
625
  giveUpStartDatePassedCertainPeriod(params) {
626
- var _a;
627
626
  return __awaiter(this, void 0, void 0, function* () {
627
+ var _a;
628
628
  return this.actionModel.updateMany(Object.assign({ actionStatus: { $eq: factory.actionStatusType.ActiveActionStatus },
629
629
  // 一定期間過ぎたもの
630
630
  startDate: { $lt: params.startDate.$lt } }, (typeof ((_a = params.id) === null || _a === void 0 ? void 0 : _a.$eq) === 'string') ? { _id: { $eq: params.id.$eq } } : undefined), {
@@ -660,8 +660,8 @@ class ActionRepo {
660
660
  });
661
661
  }
662
662
  findPayAction(params) {
663
- var _a, _b;
664
663
  return __awaiter(this, void 0, void 0, function* () {
664
+ var _a, _b;
665
665
  const payActions = yield this.search({
666
666
  limit: 1,
667
667
  page: 1,
@@ -680,8 +680,8 @@ class ActionRepo {
680
680
  */
681
681
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
682
682
  searchByPurpose(params) {
683
- var _a, _b, _c, _d, _e, _f;
684
683
  return __awaiter(this, void 0, void 0, function* () {
684
+ var _a, _b, _c, _d, _e, _f;
685
685
  const andConditions = [
686
686
  { 'purpose.typeOf': { $exists: true, $eq: params.purpose.typeOf } },
687
687
  { 'purpose.id': { $exists: true, $eq: params.purpose.id } }
@@ -732,14 +732,36 @@ class ActionRepo {
732
732
  return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
733
733
  .lean()
734
734
  .exec();
735
+ // return <Promise<IAction4transaction<T>[]>><Promise<unknown[]>>this.search<T>(
736
+ // {
737
+ // purpose: {
738
+ // id: { $in: [params.purpose.id] },
739
+ // typeOf: { $in: [params.purpose.typeOf] }
740
+ // },
741
+ // object: {
742
+ // ...(typeof params.object?.typeOf?.$eq === 'string')
743
+ // ? { typeOf: { $eq: params.object.typeOf.$eq } }
744
+ // : undefined,
745
+ // ...(typeof params.object?.paymentMethodId?.$eq === 'string')
746
+ // ? { paymentMethodId: { $eq: params.object.paymentMethodId.$eq } }
747
+ // : undefined
748
+ // },
749
+ // ...(typeof params.actionStatus?.$eq === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined,
750
+ // ...(typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined,
751
+ // ...(Array.isArray(params.id?.$nin)) ? { id: { $nin: params.id?.$nin } } : undefined,
752
+ // ...(typeof params.sort?.startDate === 'number') ? { sort: params.sort } : undefined
753
+ // },
754
+ // [],
755
+ // []
756
+ // );
735
757
  });
736
758
  }
737
759
  /**
738
760
  * 注文番号から、注文に対するアクションを検索する
739
761
  */
740
762
  searchByOrderNumber(params) {
741
- var _a;
742
763
  return __awaiter(this, void 0, void 0, function* () {
764
+ var _a;
743
765
  const filter = {
744
766
  $or: [
745
767
  { 'object.orderNumber': { $eq: params.orderNumber } },
@@ -760,8 +782,8 @@ class ActionRepo {
760
782
  });
761
783
  }
762
784
  searchBySameAs(params) {
763
- var _a;
764
785
  return __awaiter(this, void 0, void 0, function* () {
786
+ var _a;
765
787
  const projection = {
766
788
  _id: 0,
767
789
  id: { $toString: '$_id' },
@@ -1095,8 +1117,8 @@ class ActionRepo {
1095
1117
  });
1096
1118
  }
1097
1119
  findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe(params) {
1098
- var _a, _b, _c;
1099
1120
  return __awaiter(this, void 0, void 0, function* () {
1121
+ var _a, _b, _c;
1100
1122
  const recipe = yield this.actionRecipeModel.findOne({
1101
1123
  'project.id': { $eq: params.project.id },
1102
1124
  'recipeFor.id': { $eq: params.recipeFor.id }
@@ -1,27 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
1
  import type { Connection, FilterQuery } from 'mongoose';
26
2
  import * as factory from '../factory';
27
3
  type IKeyOfProjection = keyof factory.additionalProperty.IAdditionalProperty;