@chevre/domain 22.8.0-alpha.1 → 22.8.0-alpha.10

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 (464) hide show
  1. package/example/src/chevre/db/stats.ts +21 -8
  2. package/example/src/chevre/migrateAuthorizeEventServiceOfferChevre.ts +1 -1
  3. package/example/src/chevre/migrateValidMemberTiers.ts +109 -0
  4. package/example/src/chevre/searchActions.ts +31 -0
  5. package/example/src/chevre/searchMembers.ts +55 -0
  6. package/example/src/chevre/searchOffers.ts +12 -13
  7. package/lib/chevre/credentials.js +1 -1
  8. package/lib/chevre/emailMessageBuilder.js +8 -9
  9. package/lib/chevre/errorHandler.js +9 -9
  10. package/lib/chevre/eventEmitter/assetTransaction.d.ts +0 -1
  11. package/lib/chevre/eventEmitter/task.d.ts +0 -1
  12. package/lib/chevre/eventEmitter/transaction.d.ts +0 -1
  13. package/lib/chevre/factory/accountTransactionIdentifier.js +6 -7
  14. package/lib/chevre/factory/event.js +1 -2
  15. package/lib/chevre/factory/taskIdentifier.js +1 -2
  16. package/lib/chevre/index.js +4 -4
  17. package/lib/chevre/repo/acceptedOffer.d.ts +0 -17
  18. package/lib/chevre/repo/acceptedOffer.js +2 -33
  19. package/lib/chevre/repo/account.d.ts +0 -24
  20. package/lib/chevre/repo/account.js +2 -2
  21. package/lib/chevre/repo/accountTitle.d.ts +0 -24
  22. package/lib/chevre/repo/accountTransaction.js +2 -2
  23. package/lib/chevre/repo/accountingReport.d.ts +0 -24
  24. package/lib/chevre/repo/action.d.ts +2 -28
  25. package/lib/chevre/repo/action.js +74 -38
  26. package/lib/chevre/repo/additionalProperty.d.ts +0 -24
  27. package/lib/chevre/repo/aggregateOffer.d.ts +0 -24
  28. package/lib/chevre/repo/aggregateOffer.js +2 -2
  29. package/lib/chevre/repo/aggregateReservation.d.ts +0 -24
  30. package/lib/chevre/repo/aggregateReservation.js +1 -1
  31. package/lib/chevre/repo/aggregation.d.ts +0 -24
  32. package/lib/chevre/repo/aggregation.js +1 -1
  33. package/lib/chevre/repo/assetTransaction.d.ts +0 -24
  34. package/lib/chevre/repo/assetTransaction.js +4 -4
  35. package/lib/chevre/repo/authorization.d.ts +0 -24
  36. package/lib/chevre/repo/authorization.js +1 -1
  37. package/lib/chevre/repo/categoryCode.d.ts +0 -24
  38. package/lib/chevre/repo/categoryCode.js +1 -1
  39. package/lib/chevre/repo/comment.d.ts +0 -24
  40. package/lib/chevre/repo/comment.js +1 -1
  41. package/lib/chevre/repo/confirmationNumber.js +1 -1
  42. package/lib/chevre/repo/creativeWork.d.ts +4 -28
  43. package/lib/chevre/repo/creativeWork.js +1 -1
  44. package/lib/chevre/repo/credentials.js +1 -1
  45. package/lib/chevre/repo/customer.d.ts +0 -24
  46. package/lib/chevre/repo/customer.js +2 -2
  47. package/lib/chevre/repo/event.d.ts +2 -26
  48. package/lib/chevre/repo/event.js +3 -3
  49. package/lib/chevre/repo/eventSellerMakesOffer.js +1 -1
  50. package/lib/chevre/repo/eventSeries.d.ts +0 -24
  51. package/lib/chevre/repo/eventSeries.js +2 -2
  52. package/lib/chevre/repo/interface.js +1 -1
  53. package/lib/chevre/repo/member.d.ts +29 -27
  54. package/lib/chevre/repo/member.js +111 -26
  55. package/lib/chevre/repo/merchantReturnPolicy.d.ts +8 -32
  56. package/lib/chevre/repo/merchantReturnPolicy.js +1 -1
  57. package/lib/chevre/repo/message.d.ts +0 -24
  58. package/lib/chevre/repo/message.js +1 -1
  59. package/lib/chevre/repo/mongoose/onIndexCreated.js +2 -2
  60. package/lib/chevre/repo/mongoose/schemas/account.js +2 -2
  61. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +5 -5
  62. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +2 -2
  63. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +4 -4
  64. package/lib/chevre/repo/mongoose/schemas/action.js +6 -6
  65. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -2
  66. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +4 -4
  67. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +4 -4
  68. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +4 -4
  69. package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -2
  70. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +2 -2
  71. package/lib/chevre/repo/mongoose/schemas/authorization.js +4 -4
  72. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +4 -4
  73. package/lib/chevre/repo/mongoose/schemas/civicStructure.js +2 -2
  74. package/lib/chevre/repo/mongoose/schemas/comments.js +4 -4
  75. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +4 -4
  76. package/lib/chevre/repo/mongoose/schemas/customer.js +4 -4
  77. package/lib/chevre/repo/mongoose/schemas/customerType.js +4 -4
  78. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +4 -4
  79. package/lib/chevre/repo/mongoose/schemas/event.js +4 -4
  80. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +2 -2
  81. package/lib/chevre/repo/mongoose/schemas/interface.js +2 -2
  82. package/lib/chevre/repo/mongoose/schemas/member.js +2 -2
  83. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +4 -4
  84. package/lib/chevre/repo/mongoose/schemas/message.js +2 -2
  85. package/lib/chevre/repo/mongoose/schemas/note.js +2 -2
  86. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +4 -4
  87. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +4 -4
  88. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +4 -4
  89. package/lib/chevre/repo/mongoose/schemas/order.js +3 -3
  90. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +2 -2
  91. package/lib/chevre/repo/mongoose/schemas/paymentService.js +2 -2
  92. package/lib/chevre/repo/mongoose/schemas/place.js +4 -4
  93. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +5 -5
  94. package/lib/chevre/repo/mongoose/schemas/product.js +5 -5
  95. package/lib/chevre/repo/mongoose/schemas/productModel.js +4 -4
  96. package/lib/chevre/repo/mongoose/schemas/project.js +4 -4
  97. package/lib/chevre/repo/mongoose/schemas/reservation.js +4 -4
  98. package/lib/chevre/repo/mongoose/schemas/role.js +2 -2
  99. package/lib/chevre/repo/mongoose/schemas/schedule.js +2 -2
  100. package/lib/chevre/repo/mongoose/schemas/seller.js +4 -4
  101. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +4 -4
  102. package/lib/chevre/repo/mongoose/schemas/setting.js +2 -2
  103. package/lib/chevre/repo/mongoose/schemas/task.js +2 -2
  104. package/lib/chevre/repo/mongoose/schemas/telemetry.js +4 -4
  105. package/lib/chevre/repo/mongoose/schemas/ticket.js +2 -2
  106. package/lib/chevre/repo/mongoose/schemas/transaction.js +4 -4
  107. package/lib/chevre/repo/mongoose/schemas/trip.js +4 -4
  108. package/lib/chevre/repo/note.d.ts +0 -24
  109. package/lib/chevre/repo/note.js +2 -2
  110. package/lib/chevre/repo/offer.d.ts +0 -24
  111. package/lib/chevre/repo/offer.js +6 -6
  112. package/lib/chevre/repo/offerCatalog.d.ts +2 -26
  113. package/lib/chevre/repo/offerCatalog.js +2 -2
  114. package/lib/chevre/repo/offerCatalogItem.d.ts +0 -24
  115. package/lib/chevre/repo/offerCatalogItem.js +1 -1
  116. package/lib/chevre/repo/offerItemCondition.d.ts +0 -24
  117. package/lib/chevre/repo/offerItemCondition.js +1 -1
  118. package/lib/chevre/repo/order.d.ts +4 -28
  119. package/lib/chevre/repo/order.js +8 -8
  120. package/lib/chevre/repo/orderInTransaction.d.ts +0 -24
  121. package/lib/chevre/repo/orderInTransaction.js +3 -3
  122. package/lib/chevre/repo/orderNumber.js +1 -1
  123. package/lib/chevre/repo/ownershipInfo.d.ts +0 -24
  124. package/lib/chevre/repo/ownershipInfo.js +1 -1
  125. package/lib/chevre/repo/passport.js +1 -1
  126. package/lib/chevre/repo/paymentService.d.ts +0 -24
  127. package/lib/chevre/repo/paymentService.js +2 -2
  128. package/lib/chevre/repo/paymentServiceProvider.d.ts +0 -24
  129. package/lib/chevre/repo/paymentServiceProvider.js +2 -2
  130. package/lib/chevre/repo/permit.js +2 -2
  131. package/lib/chevre/repo/place/busStop.js +1 -1
  132. package/lib/chevre/repo/place/hasPOS.js +2 -2
  133. package/lib/chevre/repo/place/movieTheater.d.ts +2 -26
  134. package/lib/chevre/repo/place/movieTheater.js +2 -2
  135. package/lib/chevre/repo/place/screeningRoom.js +5 -5
  136. package/lib/chevre/repo/place/seat.js +7 -7
  137. package/lib/chevre/repo/place/section.js +4 -4
  138. package/lib/chevre/repo/priceSpecification.d.ts +20 -41
  139. package/lib/chevre/repo/priceSpecification.js +8 -5
  140. package/lib/chevre/repo/product.d.ts +0 -24
  141. package/lib/chevre/repo/product.js +2 -2
  142. package/lib/chevre/repo/productModel.d.ts +0 -24
  143. package/lib/chevre/repo/productOffer.d.ts +0 -24
  144. package/lib/chevre/repo/productOffer.js +5 -5
  145. package/lib/chevre/repo/project.d.ts +4 -28
  146. package/lib/chevre/repo/project.js +3 -3
  147. package/lib/chevre/repo/projectMakesOffer.d.ts +2 -1
  148. package/lib/chevre/repo/projectMakesOffer.js +5 -4
  149. package/lib/chevre/repo/rateLimit/offer.js +1 -1
  150. package/lib/chevre/repo/reservation.d.ts +6 -30
  151. package/lib/chevre/repo/reservation.js +5 -5
  152. package/lib/chevre/repo/schedule.js +1 -1
  153. package/lib/chevre/repo/seller.d.ts +4 -28
  154. package/lib/chevre/repo/seller.js +3 -3
  155. package/lib/chevre/repo/sellerPaymentAccepted.js +1 -1
  156. package/lib/chevre/repo/serviceOutput.d.ts +0 -24
  157. package/lib/chevre/repo/serviceOutputIdentifier.js +1 -1
  158. package/lib/chevre/repo/setting.d.ts +0 -24
  159. package/lib/chevre/repo/setting.js +1 -1
  160. package/lib/chevre/repo/stockHolder.js +1 -1
  161. package/lib/chevre/repo/task.d.ts +8 -32
  162. package/lib/chevre/repo/task.js +8 -8
  163. package/lib/chevre/repo/ticket.js +2 -2
  164. package/lib/chevre/repo/transaction.d.ts +0 -24
  165. package/lib/chevre/repo/transaction.js +7 -7
  166. package/lib/chevre/repo/transactionNumber.js +1 -1
  167. package/lib/chevre/repo/trip.d.ts +0 -24
  168. package/lib/chevre/repository.js +67 -67
  169. package/lib/chevre/service/account.js +3 -4
  170. package/lib/chevre/service/accountTransaction/deposit.js +1 -2
  171. package/lib/chevre/service/accountTransaction/factory.js +1 -2
  172. package/lib/chevre/service/accountTransaction/transfer.js +1 -2
  173. package/lib/chevre/service/accountTransaction/withdraw.js +1 -2
  174. package/lib/chevre/service/accountTransaction.js +2 -2
  175. package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
  176. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -2
  177. package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -2
  178. package/lib/chevre/service/aggregation/event/importFromCOA.js +2 -3
  179. package/lib/chevre/service/aggregation/project.js +1 -2
  180. package/lib/chevre/service/aggregation/system.js +15 -16
  181. package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +2 -3
  182. package/lib/chevre/service/assetTransaction/cancelReservation.js +5 -6
  183. package/lib/chevre/service/assetTransaction/cancelReservationCOA/factory.js +1 -2
  184. package/lib/chevre/service/assetTransaction/cancelReservationCOA.js +1 -2
  185. package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.js +1 -2
  186. package/lib/chevre/service/assetTransaction/moneyTransfer.js +4 -5
  187. package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -2
  188. package/lib/chevre/service/assetTransaction/pay/factory.js +1 -2
  189. package/lib/chevre/service/assetTransaction/pay.js +8 -9
  190. package/lib/chevre/service/assetTransaction/refund/factory.js +1 -2
  191. package/lib/chevre/service/assetTransaction/refund/potentialActions.js +1 -2
  192. package/lib/chevre/service/assetTransaction/refund.js +4 -5
  193. package/lib/chevre/service/assetTransaction/registerService/factory.js +2 -3
  194. package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +1 -2
  195. package/lib/chevre/service/assetTransaction/registerService.js +6 -7
  196. package/lib/chevre/service/assetTransaction/reserve/cancel.js +1 -2
  197. package/lib/chevre/service/assetTransaction/reserve/confirm/factory.js +1 -2
  198. package/lib/chevre/service/assetTransaction/reserve/confirm.js +1 -2
  199. package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +2 -3
  200. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +1 -2
  201. package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.js +1 -2
  202. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +5 -6
  203. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +2 -3
  204. package/lib/chevre/service/assetTransaction/reserve/start/factory/price.js +38 -35
  205. package/lib/chevre/service/assetTransaction/reserve/start.js +1 -2
  206. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +1 -2
  207. package/lib/chevre/service/assetTransaction/reserveCOA/factory.js +1 -2
  208. package/lib/chevre/service/assetTransaction/reserveCOA.js +1 -2
  209. package/lib/chevre/service/assetTransaction.js +2 -2
  210. package/lib/chevre/service/code.js +7 -8
  211. package/lib/chevre/service/delivery/factory.js +1 -2
  212. package/lib/chevre/service/delivery/product/factory.js +1 -2
  213. package/lib/chevre/service/delivery/reservation/factory.js +1 -2
  214. package/lib/chevre/service/delivery.js +4 -5
  215. package/lib/chevre/service/event.js +14 -13
  216. package/lib/chevre/service/iam.js +1 -2
  217. package/lib/chevre/service/moneyTransfer.js +3 -4
  218. package/lib/chevre/service/notification/factory.js +3 -3
  219. package/lib/chevre/service/notification.js +3 -4
  220. package/lib/chevre/service/offer/any.d.ts +1 -1
  221. package/lib/chevre/service/offer/any.js +2 -3
  222. package/lib/chevre/service/offer/event/authorize/factory.d.ts +1 -1
  223. package/lib/chevre/service/offer/event/authorize/factory.js +7 -10
  224. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +1 -2
  225. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +1 -2
  226. package/lib/chevre/service/offer/event/authorize.d.ts +1 -1
  227. package/lib/chevre/service/offer/event/authorize.js +1 -2
  228. package/lib/chevre/service/offer/event/checkAvailability.js +1 -2
  229. package/lib/chevre/service/offer/event/importFromCOA/factory.d.ts +1 -4
  230. package/lib/chevre/service/offer/event/importFromCOA/factory.js +67 -35
  231. package/lib/chevre/service/offer/event/importFromCOA.d.ts +1 -3
  232. package/lib/chevre/service/offer/event/importFromCOA.js +26 -20
  233. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -0
  234. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +5 -6
  235. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.d.ts +1 -1
  236. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +1 -2
  237. package/lib/chevre/service/offer/event/searchOfferCatalogItemAvailability.js +1 -2
  238. package/lib/chevre/service/offer/event/searchOfferCatalogItems.js +1 -2
  239. package/lib/chevre/service/offer/event/searchOffersByIds.js +3 -3
  240. package/lib/chevre/service/offer/event/searchPriceSpecs4event.js +1 -2
  241. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -2
  242. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
  243. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +2 -3
  244. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +2 -5
  245. package/lib/chevre/service/offer/event/voidTransaction.js +10 -7
  246. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +5 -6
  247. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +0 -1
  248. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +3 -5
  249. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.js +2 -3
  250. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -3
  251. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +4 -6
  252. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +39 -41
  253. package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +29 -21
  254. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +1 -2
  255. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +4 -6
  256. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +1 -1
  257. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +1 -2
  258. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +0 -2
  259. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -3
  260. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +1 -2
  261. package/lib/chevre/service/offer/factory.d.ts +1 -0
  262. package/lib/chevre/service/offer/factory.js +34 -5
  263. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -2
  264. package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -2
  265. package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +2 -3
  266. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -2
  267. package/lib/chevre/service/offer/onEventChanged.js +1 -2
  268. package/lib/chevre/service/offer/product/factory.js +18 -15
  269. package/lib/chevre/service/offer/product/searchProductOffers.js +2 -3
  270. package/lib/chevre/service/offer/product.d.ts +1 -1
  271. package/lib/chevre/service/offer/product.js +6 -6
  272. package/lib/chevre/service/offer.js +3 -3
  273. package/lib/chevre/service/order/confirmPayTransaction.js +1 -2
  274. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +1 -2
  275. package/lib/chevre/service/order/deleteOrder.js +1 -2
  276. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -2
  277. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +3 -4
  278. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.js +1 -2
  279. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -2
  280. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +1 -2
  281. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -2
  282. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +3 -4
  283. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +2 -3
  284. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -3
  285. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -3
  286. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +2 -3
  287. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +1 -1
  288. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -5
  289. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +2 -9
  290. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -2
  291. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +4 -5
  292. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +6 -5
  293. package/lib/chevre/service/order/onOrderUpdated/factory.js +1 -2
  294. package/lib/chevre/service/order/onOrderUpdated.js +1 -2
  295. package/lib/chevre/service/order/payOrder.js +1 -2
  296. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -2
  297. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +5 -6
  298. package/lib/chevre/service/order/placeOrder/factory.js +5 -6
  299. package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +1 -2
  300. package/lib/chevre/service/order/placeOrder.js +1 -2
  301. package/lib/chevre/service/order/placeOrderWithoutTransaction.js +1 -2
  302. package/lib/chevre/service/order/returnOrder.js +1 -2
  303. package/lib/chevre/service/order/sendOrder.js +1 -2
  304. package/lib/chevre/service/payment/any/factory.js +5 -6
  305. package/lib/chevre/service/payment/any/fixConfirmationNumberAsNeeded.js +1 -2
  306. package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +2 -2
  307. package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.js +1 -2
  308. package/lib/chevre/service/payment/any/onPaid.js +3 -4
  309. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.js +1 -2
  310. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.js +1 -2
  311. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +1 -2
  312. package/lib/chevre/service/payment/any/onRefund.js +3 -4
  313. package/lib/chevre/service/payment/any/person2username.js +2 -3
  314. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -1
  315. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +1 -2
  316. package/lib/chevre/service/payment/any.js +10 -10
  317. package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +1 -2
  318. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -2
  319. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -2
  320. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.js +1 -2
  321. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.js +1 -2
  322. package/lib/chevre/service/payment/creditCard/authorize.js +1 -2
  323. package/lib/chevre/service/payment/creditCard/factory.js +2 -3
  324. package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +1 -2
  325. package/lib/chevre/service/payment/creditCard/gmoError.js +1 -2
  326. package/lib/chevre/service/payment/creditCard/payCreditCard.js +2 -3
  327. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -2
  328. package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +2 -3
  329. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -2
  330. package/lib/chevre/service/payment/faceToFace.js +3 -4
  331. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -2
  332. package/lib/chevre/service/payment/factory.js +1 -2
  333. package/lib/chevre/service/payment/movieTicket/authorize.js +1 -2
  334. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -2
  335. package/lib/chevre/service/payment/movieTicket/factory.js +14 -15
  336. package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -2
  337. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -2
  338. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -2
  339. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +1 -2
  340. package/lib/chevre/service/payment/movieTicket/validation.js +3 -4
  341. package/lib/chevre/service/payment/movieTicket/voidTransaction.js +1 -2
  342. package/lib/chevre/service/payment/paymentCard.js +4 -5
  343. package/lib/chevre/service/payment.d.ts +1 -1
  344. package/lib/chevre/service/payment.js +5 -6
  345. package/lib/chevre/service/permit.js +11 -6
  346. package/lib/chevre/service/product.js +1 -2
  347. package/lib/chevre/service/project.js +2 -3
  348. package/lib/chevre/service/report/ownershipInfo.js +1 -2
  349. package/lib/chevre/service/report/telemetry.js +14 -14
  350. package/lib/chevre/service/reserve/cancelReservation.js +3 -4
  351. package/lib/chevre/service/reserve/checkInReservation.js +2 -3
  352. package/lib/chevre/service/reserve/confirmReservation.js +3 -4
  353. package/lib/chevre/service/reserve/factory.js +4 -4
  354. package/lib/chevre/service/reserve/findByCode.js +1 -2
  355. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -2
  356. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -2
  357. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -2
  358. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +8 -5
  359. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -2
  360. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -2
  361. package/lib/chevre/service/reserve/searchByOrder.js +1 -2
  362. package/lib/chevre/service/reserve/useReservation.js +7 -9
  363. package/lib/chevre/service/reserve/verifyToken4reservation.js +1 -2
  364. package/lib/chevre/service/task/acceptCOAOffer.js +8 -9
  365. package/lib/chevre/service/task/aggregateOffers.js +2 -3
  366. package/lib/chevre/service/task/aggregateOnSystem.js +1 -2
  367. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -3
  368. package/lib/chevre/service/task/authorizePayment.js +2 -3
  369. package/lib/chevre/service/task/cancelMoneyTransfer.js +2 -3
  370. package/lib/chevre/service/task/cancelPendingReservation.js +2 -3
  371. package/lib/chevre/service/task/cancelReservation.js +2 -3
  372. package/lib/chevre/service/task/checkMovieTicket.js +6 -7
  373. package/lib/chevre/service/task/checkResource.js +2 -3
  374. package/lib/chevre/service/task/confirmMoneyTransfer.js +2 -3
  375. package/lib/chevre/service/task/confirmPayTransaction.js +2 -3
  376. package/lib/chevre/service/task/confirmRegisterService.js +2 -3
  377. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +5 -6
  378. package/lib/chevre/service/task/confirmReserveTransaction.js +10 -11
  379. package/lib/chevre/service/task/createAccountingReport.js +2 -3
  380. package/lib/chevre/service/task/createEvent/createEvent.js +1 -2
  381. package/lib/chevre/service/task/createEvent/createEventBySchedule.js +8 -9
  382. package/lib/chevre/service/task/createEvent/createEventSeries.js +1 -2
  383. package/lib/chevre/service/task/createEvent.js +2 -3
  384. package/lib/chevre/service/task/deletePerson.js +2 -3
  385. package/lib/chevre/service/task/deleteTransaction.js +2 -3
  386. package/lib/chevre/service/task/givePointAward.js +2 -3
  387. package/lib/chevre/service/task/handleNotification.js +1 -2
  388. package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +5 -6
  389. package/lib/chevre/service/task/importEventsFromCOA.js +5 -6
  390. package/lib/chevre/service/task/importOffersFromCOA.js +21 -12
  391. package/lib/chevre/service/task/moneyTransfer.js +2 -3
  392. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -3
  393. package/lib/chevre/service/task/onAuthorizationCreated.js +2 -3
  394. package/lib/chevre/service/task/onEventChanged.js +2 -3
  395. package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -3
  396. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +1 -2
  397. package/lib/chevre/service/task/onResourceUpdated/onCategoryCodeUpdated.js +1 -2
  398. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -2
  399. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +2 -3
  400. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +1 -2
  401. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -2
  402. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +1 -2
  403. package/lib/chevre/service/task/onResourceUpdated.js +3 -4
  404. package/lib/chevre/service/task/pay.js +4 -5
  405. package/lib/chevre/service/task/placeOrder.js +2 -3
  406. package/lib/chevre/service/task/publishPaymentUrl.js +2 -3
  407. package/lib/chevre/service/task/refund.js +4 -5
  408. package/lib/chevre/service/task/registerService.js +2 -3
  409. package/lib/chevre/service/task/reserve.js +3 -4
  410. package/lib/chevre/service/task/returnMoneyTransfer.js +2 -3
  411. package/lib/chevre/service/task/returnOrder.js +2 -3
  412. package/lib/chevre/service/task/returnPayTransaction.js +2 -3
  413. package/lib/chevre/service/task/returnPointAward.js +2 -3
  414. package/lib/chevre/service/task/returnReserveTransaction.js +12 -13
  415. package/lib/chevre/service/task/sendEmailMessage.js +2 -3
  416. package/lib/chevre/service/task/sendOrder.js +4 -5
  417. package/lib/chevre/service/task/triggerWebhook.js +2 -3
  418. package/lib/chevre/service/task/useReservation.js +4 -5
  419. package/lib/chevre/service/task/voidMoneyTransferTransaction.js +2 -3
  420. package/lib/chevre/service/task/voidPayTransaction.js +2 -3
  421. package/lib/chevre/service/task/voidPayment.js +2 -3
  422. package/lib/chevre/service/task/voidRegisterServiceTransaction.js +2 -3
  423. package/lib/chevre/service/task/voidReserveTransaction.js +7 -8
  424. package/lib/chevre/service/task.js +5 -6
  425. package/lib/chevre/service/transaction/deleteTransaction.js +1 -2
  426. package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +1 -2
  427. package/lib/chevre/service/transaction/moneyTransfer/factory.js +1 -2
  428. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -2
  429. package/lib/chevre/service/transaction/moneyTransfer.js +3 -4
  430. package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +1 -2
  431. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +2 -3
  432. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +1 -2
  433. package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +1 -2
  434. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.js +2 -3
  435. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +1 -1
  436. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +5 -6
  437. package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -3
  438. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -2
  439. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -2
  440. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +1 -2
  441. package/lib/chevre/service/transaction/placeOrder/publishOrderNumberIfNotExist.js +1 -2
  442. package/lib/chevre/service/transaction/placeOrder/start/factory.js +2 -2
  443. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +1 -1
  444. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +19 -11
  445. package/lib/chevre/service/transaction/placeOrder/start.js +1 -2
  446. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +1 -2
  447. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -3
  448. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +2 -3
  449. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +2 -3
  450. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -2
  451. package/lib/chevre/service/transaction/returnOrder/preStart.js +4 -5
  452. package/lib/chevre/service/transaction/returnOrder.js +4 -4
  453. package/lib/chevre/service/transaction.js +3 -3
  454. package/lib/chevre/service/validation/validateOrder.js +1 -2
  455. package/lib/chevre/service.js +19 -19
  456. package/package.json +6 -6
  457. package/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +0 -129
  458. package/example/src/chevre/migrateAuthorizeEventServiceOfferCOA.ts +0 -84
  459. package/example/src/chevre/migrateAuthorizeEventServiceOfferInstrument.ts +0 -128
  460. package/example/src/chevre/migrateCheckMovieTicketRecipes.ts +0 -127
  461. package/example/src/chevre/migrateOrderAcceptedOfferReservedTicketIdentifier.ts +0 -94
  462. package/example/src/chevre/migratePayCreditCardRecipes.ts +0 -110
  463. package/example/src/chevre/migratePayMovieTicketRecipes.ts +0 -110
  464. package/example/src/chevre/saveRecipe.ts +0 -54
@@ -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()
@@ -37,7 +37,7 @@ async function main() {
37
37
  await cursor.eachAsync(async (doc) => {
38
38
  i += 1;
39
39
  const authorizeAction = <Pick<
40
- chevre.factory.action.authorize.offer.eventService.IAction<chevre.factory.service.webAPI.Identifier>,
40
+ chevre.factory.action.authorize.offer.eventService.IAction,
41
41
  'id' | 'startDate' | 'project' | 'typeOf' | 'actionStatus' | 'instrument' | 'object'
42
42
  >>doc.toObject();
43
43
 
@@ -0,0 +1,109 @@
1
+ // tslint:disable:no-console
2
+ // import * as moment from 'moment';
3
+ import * as mongoose from 'mongoose';
4
+
5
+ import { chevre } from '../../../lib/index';
6
+
7
+ // const project = { id: String(process.env.PROJECT_ID) };
8
+ // const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
9
+
10
+ // tslint:disable-next-line:max-func-body-length
11
+ async function main() {
12
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
+
14
+ const memberRepo = await chevre.repository.Member.createInstance(mongoose.connection);
15
+ const projectMakesOfferRepo = await chevre.repository.ProjectMakesOffer.createInstance(mongoose.connection);
16
+
17
+ const cursor = memberRepo.getCursor(
18
+ {
19
+ // 'project.id': { $eq: project.id },
20
+ // 'member.id': { $eq: 'xxx' },
21
+ 'member.typeOf': { $eq: chevre.factory.creativeWorkType.WebApplication },
22
+ 'member.member': { $exists: true }
23
+ },
24
+ {
25
+ // paymentMethods: 1,
26
+ // project: 1,
27
+ // orderDate: 1
28
+ }
29
+ );
30
+ console.log('docs found');
31
+
32
+ let updated: number = 0;
33
+ let i = 0;
34
+ await cursor.eachAsync(async (doc) => {
35
+ i += 1;
36
+ const iamMember: chevre.factory.iam.IMember = doc.toObject();
37
+ const makesOffer = (await projectMakesOfferRepo.search({
38
+ limit: 1,
39
+ page: 1,
40
+ offeredBy: { id: { $eq: iamMember.project.id } },
41
+ availableAtOrFrom: { id: { $eq: iamMember.member.id } }
42
+ })).shift();
43
+ if (makesOffer === undefined) {
44
+ throw new Error('iamMember not found');
45
+ }
46
+ // tslint:disable-next-line:no-null-keyword
47
+ // console.dir(makesOffer, { depth: null });
48
+
49
+ const issuerExpected = iamMember.member.member?.at(0)?.memberOf?.issuer;
50
+ const secretExpected = iamMember.member.member?.at(0)?.memberOf?.secret;
51
+ if (typeof issuerExpected !== 'string' || typeof secretExpected !== 'string') {
52
+ throw new Error('issuerExpected,secretExpected must be string');
53
+ }
54
+
55
+ console.log(
56
+ 'checking...',
57
+ iamMember.member.id,
58
+ iamMember.member.typeOf,
59
+ iamMember.project.id,
60
+ issuerExpected,
61
+ secretExpected,
62
+ i
63
+ );
64
+
65
+ const migrated = makesOffer.validForMemberTier?.isTierOf.hostingOrganization.identifier === issuerExpected
66
+ && makesOffer.validForMemberTier?.secret === secretExpected;
67
+ if (migrated) {
68
+ console.log(
69
+ 'migrated',
70
+ iamMember.member.id,
71
+ iamMember.member.typeOf,
72
+ iamMember.project.id,
73
+ issuerExpected,
74
+ secretExpected,
75
+ i
76
+ );
77
+ } else {
78
+ await projectMakesOfferRepo.updateOne({
79
+ availableAtOrFrom: {
80
+ id: makesOffer.availableAtOrFrom.id
81
+ },
82
+ offeredBy: {
83
+ id: iamMember.project.id
84
+ },
85
+ validForMemberTier: {
86
+ isTierOf: { hostingOrganization: { identifier: issuerExpected } },
87
+ secret: secretExpected
88
+ },
89
+ ...(Array.isArray(makesOffer.eligibleCustomerType)) ? { eligibleCustomerType: makesOffer.eligibleCustomerType } : undefined
90
+ });
91
+ updated += 1;
92
+ console.log(
93
+ 'updated',
94
+ iamMember.member.id,
95
+ iamMember.member.typeOf,
96
+ iamMember.project.id,
97
+ issuerExpected,
98
+ secretExpected,
99
+ i
100
+ );
101
+ }
102
+ });
103
+ console.log(i, 'docs checked');
104
+ console.log('updated:', updated);
105
+ }
106
+
107
+ main()
108
+ .then()
109
+ .catch(console.error);
@@ -0,0 +1,31 @@
1
+ // tslint:disable:no-implicit-dependencies no-console
2
+ import { chevre } from '../../../lib/index';
3
+
4
+ import * as mongoose from 'mongoose';
5
+
6
+ // const project = { id: String(process.env.PROJECT_ID) };
7
+
8
+ mongoose.Model.on('index', (...args) => {
9
+ console.error('******** index event emitted. ********\n', args);
10
+ });
11
+
12
+ async function main() {
13
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
14
+
15
+ const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
16
+ const actions = await actionRepo.search(
17
+ {
18
+ limit: 3,
19
+ page: 1,
20
+ sort: { startDate: chevre.factory.sortType.Descending }
21
+ },
22
+ ['startDate']
23
+ );
24
+ console.log('actions:', actions);
25
+ }
26
+
27
+ main()
28
+ .then(() => {
29
+ console.log('success!');
30
+ })
31
+ .catch(console.error);
@@ -0,0 +1,55 @@
1
+ // tslint:disable:no-implicit-dependencies no-console
2
+ import { chevre } from '../../../lib/index';
3
+
4
+ import * as mongoose from 'mongoose';
5
+
6
+ const project = { id: String(process.env.PROJECT_ID) };
7
+
8
+ mongoose.Model.on('index', (...args) => {
9
+ console.error('******** index event emitted. ********\n', args);
10
+ });
11
+
12
+ async function main() {
13
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
14
+
15
+ const limit = 100;
16
+ const page = 1;
17
+ const memberRepo = await chevre.repository.Member.createInstance(mongoose.connection);
18
+ const members = await memberRepo.projectFieldsByProjectId(
19
+ { id: project.id },
20
+ {
21
+ limit,
22
+ page,
23
+ member: {
24
+ typeOf: {
25
+ // $eq: chevre.factory.creativeWorkType.WebApplication
26
+ // $eq: chevre.factory.personType.Person
27
+ },
28
+ memberOf: { typeOf: { $eq: chevre.factory.organizationType.Project } }
29
+ }
30
+ },
31
+ []
32
+ );
33
+ console.log('members:', members);
34
+ console.log(members.length, 'members found');
35
+
36
+ const customerMembers = await memberRepo.searchCustomerMembers(
37
+ {
38
+ limit: 10,
39
+ page: 1,
40
+ sort: { 'member.id': chevre.factory.sortType.Ascending },
41
+ project: { id: project.id },
42
+ member: {
43
+ }
44
+ }
45
+ );
46
+ // tslint:disable-next-line:no-null-keyword
47
+ console.dir(customerMembers, { depth: null });
48
+ console.log(customerMembers.length, 'customerMembers found');
49
+ }
50
+
51
+ main()
52
+ .then(() => {
53
+ console.log('success!');
54
+ })
55
+ .catch(console.error);
@@ -19,24 +19,23 @@ async function main() {
19
19
 
20
20
  const offers = await offerRepo.search(
21
21
  {
22
- limit: 100,
22
+ limit: 3,
23
23
  // page: 1,
24
+ sort: { identifier: chevre.factory.sortType.Descending },
24
25
  project: { id: { $eq: String(process.env.PROJECT_ID) } },
25
26
  availability: { $eq: chevre.factory.itemAvailability.InStock },
26
27
  // acceptedPaymentMethod: { identifier: { $in: ['xxx'] } },
27
28
  parentOffer: {
28
- },
29
- priceSpecification: {
30
- appliesToMovieTicket: {
31
- $size: 2,
32
- serviceOutput: {
33
- typeOf: {
34
- // $eq: '',
35
- // $all: []
36
- }
37
- }
38
- }
39
29
  }
30
+ // priceSpecification: {
31
+ // appliesToMovieTicket: {
32
+ // $size: 2,
33
+ // serviceOutput: {
34
+ // typeOf: {
35
+ // }
36
+ // }
37
+ // }
38
+ // }
40
39
  // includedInDataCatalog: { id: { $in: ['0001'] } }
41
40
  // additionalProperty: {
42
41
  // $all: [
@@ -55,7 +54,7 @@ async function main() {
55
54
  // ]
56
55
  // }
57
56
  },
58
- { project: 1, name: 1 }
57
+ { project: 1, name: 1, identifier: 1 }
59
58
  );
60
59
  console.log(offers.map((offer) => {
61
60
  return `${offer.project?.id} ${offer.id} ${offer.parentOffer?.id} ${offer.identifier} ${offer.name?.ja}`;
@@ -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;
@@ -103,22 +103,5 @@ export declare class AcceptedOfferRepo {
103
103
  $in: string[];
104
104
  };
105
105
  }, field: IDistinctField): Promise<string[]>;
106
- /**
107
- * 互換性維持対応専用
108
- */
109
- fixReservedTicketIdentifier(params: {
110
- project: {
111
- id: string;
112
- };
113
- orderNumber: string;
114
- acceptedOffers: {
115
- itemOffered: {
116
- id: string;
117
- reservedTicket: {
118
- identifier: string;
119
- };
120
- };
121
- };
122
- }): Promise<void>;
123
106
  }
124
107
  export {};
@@ -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 } } },
@@ -227,36 +227,5 @@ class AcceptedOfferRepo {
227
227
  .exec();
228
228
  });
229
229
  }
230
- /**
231
- * 互換性維持対応専用
232
- */
233
- fixReservedTicketIdentifier(params) {
234
- return __awaiter(this, void 0, void 0, function* () {
235
- const doc = yield this.orderModel.findOneAndUpdate({
236
- orderNumber: { $eq: params.orderNumber },
237
- 'project.id': { $eq: params.project.id },
238
- typeOf: { $eq: factory.order.OrderType.Order },
239
- 'acceptedOffers.itemOffered.id': { $exists: true, $eq: params.acceptedOffers.itemOffered.id }
240
- }, {
241
- $set: {
242
- 'acceptedOffers.$[offer].itemOffered.reservedTicket.identifier': params.acceptedOffers.itemOffered.reservedTicket.identifier
243
- }
244
- }, {
245
- timestamps: false,
246
- arrayFilters: [{
247
- 'offer.itemOffered.typeOf': { $eq: factory.reservationType.EventReservation },
248
- 'offer.itemOffered.id': { $eq: params.acceptedOffers.itemOffered.id }
249
- }],
250
- new: true,
251
- projection: {
252
- _id: 1
253
- }
254
- })
255
- .exec();
256
- if (doc === null) {
257
- throw new factory.errors.NotFound(this.orderModel.modelName);
258
- }
259
- });
260
- }
261
230
  }
262
231
  exports.AcceptedOfferRepo = AcceptedOfferRepo;
@@ -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
  /**