@cinerino/sdk 14.0.0-alpha.8 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/README.md +0 -3
  2. package/lib/abstract/auth/authClient.js +10 -60
  3. package/lib/abstract/chevre/categoryCode.d.ts +1 -1
  4. package/lib/abstract/chevre/categoryCode.js +16 -84
  5. package/lib/abstract/chevre/creativeWork.d.ts +1 -1
  6. package/lib/abstract/chevre/creativeWork.js +16 -84
  7. package/lib/abstract/chevre/emailMessage.d.ts +1 -1
  8. package/lib/abstract/chevre/emailMessage.js +16 -84
  9. package/lib/abstract/chevre/event/factory.d.ts +1 -1
  10. package/lib/abstract/chevre/event.d.ts +1 -1
  11. package/lib/abstract/chevre/event.js +102 -270
  12. package/lib/abstract/chevre/eventOffer.d.ts +1 -1
  13. package/lib/abstract/chevre/eventOffer.js +13 -76
  14. package/lib/abstract/chevre/eventSeries.d.ts +1 -1
  15. package/lib/abstract/chevre/eventSeries.js +12 -75
  16. package/lib/abstract/chevre/note.d.ts +1 -1
  17. package/lib/abstract/chevre/note.js +14 -77
  18. package/lib/abstract/chevre/paymentService.d.ts +1 -1
  19. package/lib/abstract/chevre/paymentService.js +14 -78
  20. package/lib/abstract/chevre/place/hasPOS.d.ts +1 -1
  21. package/lib/abstract/chevre/place/hasPOS.js +13 -99
  22. package/lib/abstract/chevre/place.d.ts +1 -1
  23. package/lib/abstract/chevre/place.js +82 -232
  24. package/lib/abstract/chevre/product.d.ts +1 -1
  25. package/lib/abstract/chevre/product.js +34 -124
  26. package/lib/abstract/chevre/productOffer.d.ts +1 -1
  27. package/lib/abstract/chevre/productOffer.js +13 -76
  28. package/lib/abstract/chevre/seatOffer.d.ts +1 -1
  29. package/lib/abstract/chevre/seatOffer.js +15 -79
  30. package/lib/abstract/chevre/seller/factory.d.ts +1 -1
  31. package/lib/abstract/chevre/seller.d.ts +1 -1
  32. package/lib/abstract/chevre/seller.js +42 -128
  33. package/lib/abstract/chevre/trip.d.ts +1 -1
  34. package/lib/abstract/chevre/trip.js +16 -84
  35. package/lib/abstract/chevre.js +127 -329
  36. package/lib/abstract/chevreAdmic/sync.js +24 -94
  37. package/lib/abstract/chevreAdmic.js +28 -76
  38. package/lib/abstract/chevreAdmin/assetTransaction/cancelReservation.d.ts +1 -1
  39. package/lib/abstract/chevreAdmin/assetTransaction/cancelReservation.js +11 -76
  40. package/lib/abstract/chevreAdmin/authorization.d.ts +1 -1
  41. package/lib/abstract/chevreAdmin/authorization.js +13 -76
  42. package/lib/abstract/chevreAdmin/customer.d.ts +1 -1
  43. package/lib/abstract/chevreAdmin/customer.js +13 -76
  44. package/lib/abstract/chevreAdmin/event.d.ts +1 -1
  45. package/lib/abstract/chevreAdmin/event.js +56 -162
  46. package/lib/abstract/chevreAdmin/eventOffer.d.ts +1 -1
  47. package/lib/abstract/chevreAdmin/eventOffer.js +41 -134
  48. package/lib/abstract/chevreAdmin/eventSeries.d.ts +1 -1
  49. package/lib/abstract/chevreAdmin/eventSeries.js +30 -104
  50. package/lib/abstract/chevreAdmin/me.d.ts +1 -1
  51. package/lib/abstract/chevreAdmin/me.js +25 -104
  52. package/lib/abstract/chevreAdmin/member.d.ts +1 -1
  53. package/lib/abstract/chevreAdmin/member.js +14 -100
  54. package/lib/abstract/chevreAdmin/movie.d.ts +1 -1
  55. package/lib/abstract/chevreAdmin/movie.js +21 -93
  56. package/lib/abstract/chevreAdmin/movieTheater.d.ts +1 -1
  57. package/lib/abstract/chevreAdmin/movieTheater.js +56 -162
  58. package/lib/abstract/chevreAdmin/note.d.ts +1 -1
  59. package/lib/abstract/chevreAdmin/note.js +32 -117
  60. package/lib/abstract/chevreAdmin/noteAboutOrder.d.ts +1 -1
  61. package/lib/abstract/chevreAdmin/noteAboutOrder.js +29 -112
  62. package/lib/abstract/chevreAdmin/offer.d.ts +1 -1
  63. package/lib/abstract/chevreAdmin/offer.js +24 -98
  64. package/lib/abstract/chevreAdmin/offerCatalog.d.ts +1 -1
  65. package/lib/abstract/chevreAdmin/offerCatalog.js +18 -85
  66. package/lib/abstract/chevreAdmin/offerCatalogItem.d.ts +1 -1
  67. package/lib/abstract/chevreAdmin/offerCatalogItem.js +25 -99
  68. package/lib/abstract/chevreAdmin/order.d.ts +1 -1
  69. package/lib/abstract/chevreAdmin/order.js +50 -161
  70. package/lib/abstract/chevreAdmin/paymentMethod.d.ts +1 -1
  71. package/lib/abstract/chevreAdmin/paymentMethod.js +15 -78
  72. package/lib/abstract/chevreAdmin/product.d.ts +1 -1
  73. package/lib/abstract/chevreAdmin/product.js +31 -110
  74. package/lib/abstract/chevreAdmin/productOffer.d.ts +1 -1
  75. package/lib/abstract/chevreAdmin/productOffer.js +41 -134
  76. package/lib/abstract/chevreAdmin/reservation.d.ts +1 -1
  77. package/lib/abstract/chevreAdmin/reservation.js +31 -125
  78. package/lib/abstract/chevreAdmin/room.d.ts +1 -1
  79. package/lib/abstract/chevreAdmin/room.js +25 -99
  80. package/lib/abstract/chevreAdmin/seat.d.ts +1 -1
  81. package/lib/abstract/chevreAdmin/seat.js +38 -129
  82. package/lib/abstract/chevreAdmin/seatSection.d.ts +1 -1
  83. package/lib/abstract/chevreAdmin/seatSection.js +25 -99
  84. package/lib/abstract/chevreAdmin/seller.d.ts +1 -1
  85. package/lib/abstract/chevreAdmin/seller.js +13 -76
  86. package/lib/abstract/chevreAdmin.js +191 -492
  87. package/lib/abstract/chevreAsset/order/factory.d.ts +1 -1
  88. package/lib/abstract/chevreAsset/order.js +77 -231
  89. package/lib/abstract/chevreAsset/permit.d.ts +1 -1
  90. package/lib/abstract/chevreAsset/permit.js +22 -92
  91. package/lib/abstract/chevreAsset/reservation/factory.d.ts +1 -1
  92. package/lib/abstract/chevreAsset/reservation.d.ts +1 -1
  93. package/lib/abstract/chevreAsset/reservation.js +23 -93
  94. package/lib/abstract/chevreAsset/token.js +4 -24
  95. package/lib/abstract/chevreAsset.js +65 -135
  96. package/lib/abstract/chevreConsole/account.d.ts +1 -1
  97. package/lib/abstract/chevreConsole/account.js +32 -116
  98. package/lib/abstract/chevreConsole/accountTitle.d.ts +1 -1
  99. package/lib/abstract/chevreConsole/accountTitle.js +113 -303
  100. package/lib/abstract/chevreConsole/accountTransaction.d.ts +3 -3
  101. package/lib/abstract/chevreConsole/accountTransaction.js +16 -84
  102. package/lib/abstract/chevreConsole/accountingReport.d.ts +1 -1
  103. package/lib/abstract/chevreConsole/accountingReport.js +16 -84
  104. package/lib/abstract/chevreConsole/action.d.ts +1 -1
  105. package/lib/abstract/chevreConsole/action.js +33 -115
  106. package/lib/abstract/chevreConsole/additionalProperty.d.ts +1 -1
  107. package/lib/abstract/chevreConsole/additionalProperty.js +46 -146
  108. package/lib/abstract/chevreConsole/advanceBookingRequirement.d.ts +1 -1
  109. package/lib/abstract/chevreConsole/advanceBookingRequirement.js +36 -139
  110. package/lib/abstract/chevreConsole/aggregateOffer.d.ts +1 -1
  111. package/lib/abstract/chevreConsole/aggregateOffer.js +22 -99
  112. package/lib/abstract/chevreConsole/aggregateReservation.d.ts +1 -1
  113. package/lib/abstract/chevreConsole/aggregateReservation.js +12 -75
  114. package/lib/abstract/chevreConsole/aggregation.d.ts +1 -1
  115. package/lib/abstract/chevreConsole/aggregation.js +15 -86
  116. package/lib/abstract/chevreConsole/assetTransaction/moneyTransfer.d.ts +1 -1
  117. package/lib/abstract/chevreConsole/assetTransaction/moneyTransfer.js +33 -139
  118. package/lib/abstract/chevreConsole/assetTransaction/pay.d.ts +1 -1
  119. package/lib/abstract/chevreConsole/assetTransaction/pay.js +44 -168
  120. package/lib/abstract/chevreConsole/assetTransaction/registerService.d.ts +1 -1
  121. package/lib/abstract/chevreConsole/assetTransaction/registerService.js +33 -150
  122. package/lib/abstract/chevreConsole/assetTransaction/reserve.d.ts +1 -1
  123. package/lib/abstract/chevreConsole/assetTransaction/reserve.js +40 -143
  124. package/lib/abstract/chevreConsole/assetTransaction.d.ts +1 -1
  125. package/lib/abstract/chevreConsole/assetTransaction.js +16 -84
  126. package/lib/abstract/chevreConsole/authorization.d.ts +1 -1
  127. package/lib/abstract/chevreConsole/authorization.js +13 -76
  128. package/lib/abstract/chevreConsole/categoryCode.d.ts +1 -1
  129. package/lib/abstract/chevreConsole/categoryCode.js +40 -137
  130. package/lib/abstract/chevreConsole/comment.d.ts +1 -1
  131. package/lib/abstract/chevreConsole/comment.js +25 -100
  132. package/lib/abstract/chevreConsole/creativeWork.js +15 -80
  133. package/lib/abstract/chevreConsole/customer.d.ts +1 -1
  134. package/lib/abstract/chevreConsole/customer.js +26 -107
  135. package/lib/abstract/chevreConsole/customerType.d.ts +1 -1
  136. package/lib/abstract/chevreConsole/customerType.js +13 -76
  137. package/lib/abstract/chevreConsole/emailMessage.d.ts +1 -1
  138. package/lib/abstract/chevreConsole/emailMessage.js +47 -147
  139. package/lib/abstract/chevreConsole/event/factory.d.ts +1 -1
  140. package/lib/abstract/chevreConsole/event.d.ts +1 -1
  141. package/lib/abstract/chevreConsole/event.js +60 -184
  142. package/lib/abstract/chevreConsole/eventSeries.js +23 -118
  143. package/lib/abstract/chevreConsole/hasMerchantReturnPolicy.d.ts +1 -1
  144. package/lib/abstract/chevreConsole/hasMerchantReturnPolicy.js +11 -74
  145. package/lib/abstract/chevreConsole/iam.d.ts +1 -1
  146. package/lib/abstract/chevreConsole/iam.js +116 -301
  147. package/lib/abstract/chevreConsole/identity.d.ts +1 -1
  148. package/lib/abstract/chevreConsole/identity.js +36 -139
  149. package/lib/abstract/chevreConsole/identityProvider.d.ts +1 -1
  150. package/lib/abstract/chevreConsole/identityProvider.js +36 -139
  151. package/lib/abstract/chevreConsole/issuer.d.ts +1 -1
  152. package/lib/abstract/chevreConsole/issuer.js +44 -152
  153. package/lib/abstract/chevreConsole/me.d.ts +1 -1
  154. package/lib/abstract/chevreConsole/me.js +26 -109
  155. package/lib/abstract/chevreConsole/member.d.ts +1 -1
  156. package/lib/abstract/chevreConsole/member.js +63 -210
  157. package/lib/abstract/chevreConsole/memberProgram.js +47 -156
  158. package/lib/abstract/chevreConsole/merchantReturnPolicy.d.ts +1 -1
  159. package/lib/abstract/chevreConsole/merchantReturnPolicy.js +45 -145
  160. package/lib/abstract/chevreConsole/message.d.ts +1 -1
  161. package/lib/abstract/chevreConsole/message.js +12 -75
  162. package/lib/abstract/chevreConsole/movieTicketType.d.ts +1 -1
  163. package/lib/abstract/chevreConsole/movieTicketType.js +36 -124
  164. package/lib/abstract/chevreConsole/offer.d.ts +1 -1
  165. package/lib/abstract/chevreConsole/offer.js +29 -108
  166. package/lib/abstract/chevreConsole/offerCatalog.d.ts +1 -1
  167. package/lib/abstract/chevreConsole/offerCatalog.js +38 -138
  168. package/lib/abstract/chevreConsole/offerCatalogItem.d.ts +1 -1
  169. package/lib/abstract/chevreConsole/offerCatalogItem.js +51 -167
  170. package/lib/abstract/chevreConsole/offerItemCondition.d.ts +1 -1
  171. package/lib/abstract/chevreConsole/offerItemCondition.js +38 -131
  172. package/lib/abstract/chevreConsole/order/factory.d.ts +1 -1
  173. package/lib/abstract/chevreConsole/order.d.ts +1 -1
  174. package/lib/abstract/chevreConsole/order.js +45 -144
  175. package/lib/abstract/chevreConsole/ownershipInfo.d.ts +1 -1
  176. package/lib/abstract/chevreConsole/ownershipInfo.js +16 -84
  177. package/lib/abstract/chevreConsole/paymentService.d.ts +1 -1
  178. package/lib/abstract/chevreConsole/paymentService.js +55 -169
  179. package/lib/abstract/chevreConsole/paymentServiceChannel.d.ts +1 -1
  180. package/lib/abstract/chevreConsole/paymentServiceChannel.js +36 -139
  181. package/lib/abstract/chevreConsole/pendingReservation.d.ts +1 -1
  182. package/lib/abstract/chevreConsole/pendingReservation.js +23 -94
  183. package/lib/abstract/chevreConsole/permission.js +22 -93
  184. package/lib/abstract/chevreConsole/permit.d.ts +1 -1
  185. package/lib/abstract/chevreConsole/permit.js +34 -116
  186. package/lib/abstract/chevreConsole/person.d.ts +1 -1
  187. package/lib/abstract/chevreConsole/person.js +67 -186
  188. package/lib/abstract/chevreConsole/place/hasPOS.d.ts +1 -1
  189. package/lib/abstract/chevreConsole/place/hasPOS.js +33 -146
  190. package/lib/abstract/chevreConsole/place.d.ts +1 -1
  191. package/lib/abstract/chevreConsole/place.js +97 -260
  192. package/lib/abstract/chevreConsole/priceSpecification.d.ts +1 -1
  193. package/lib/abstract/chevreConsole/priceSpecification.js +37 -130
  194. package/lib/abstract/chevreConsole/product.d.ts +1 -1
  195. package/lib/abstract/chevreConsole/product.js +48 -155
  196. package/lib/abstract/chevreConsole/productModel.d.ts +1 -1
  197. package/lib/abstract/chevreConsole/productModel.js +34 -122
  198. package/lib/abstract/chevreConsole/project.d.ts +1 -1
  199. package/lib/abstract/chevreConsole/project.js +38 -147
  200. package/lib/abstract/chevreConsole/projectMakesOffer.d.ts +1 -1
  201. package/lib/abstract/chevreConsole/projectMakesOffer.js +32 -122
  202. package/lib/abstract/chevreConsole/reservation/factory.d.ts +1 -1
  203. package/lib/abstract/chevreConsole/reservation.js +11 -76
  204. package/lib/abstract/chevreConsole/seller/factory.d.ts +1 -1
  205. package/lib/abstract/chevreConsole/seller.d.ts +1 -1
  206. package/lib/abstract/chevreConsole/seller.js +139 -362
  207. package/lib/abstract/chevreConsole/sellerMakesOffer.d.ts +1 -1
  208. package/lib/abstract/chevreConsole/sellerMakesOffer.js +26 -107
  209. package/lib/abstract/chevreConsole/sellerReturnPolicy.d.ts +1 -1
  210. package/lib/abstract/chevreConsole/sellerReturnPolicy.js +45 -156
  211. package/lib/abstract/chevreConsole/task.d.ts +1 -1
  212. package/lib/abstract/chevreConsole/task.js +29 -108
  213. package/lib/abstract/chevreConsole/ticket.d.ts +1 -1
  214. package/lib/abstract/chevreConsole/ticket.js +12 -75
  215. package/lib/abstract/chevreConsole/token.js +4 -24
  216. package/lib/abstract/chevreConsole/transaction/placeOrder.d.ts +2 -3
  217. package/lib/abstract/chevreConsole/transaction/placeOrder.js +28 -139
  218. package/lib/abstract/chevreConsole/transaction/returnOrder.d.ts +2 -3
  219. package/lib/abstract/chevreConsole/transaction/returnOrder.js +18 -110
  220. package/lib/abstract/chevreConsole/transactionNumber.js +13 -76
  221. package/lib/abstract/chevreConsole/trip.d.ts +1 -1
  222. package/lib/abstract/chevreConsole/trip.js +46 -146
  223. package/lib/abstract/chevreConsole/userPool.d.ts +1 -1
  224. package/lib/abstract/chevreConsole/userPool.js +32 -114
  225. package/lib/abstract/chevreConsole/webSite.d.ts +1 -1
  226. package/lib/abstract/chevreConsole/webSite.js +36 -128
  227. package/lib/abstract/chevreConsole.js +496 -1270
  228. package/lib/abstract/chevrePay/payment/factory.d.ts +1 -1
  229. package/lib/abstract/chevrePay/payment.d.ts +1 -1
  230. package/lib/abstract/chevrePay/payment.js +300 -498
  231. package/lib/abstract/chevrePay.js +33 -84
  232. package/lib/abstract/chevreTxc/offer/factory.d.ts +1 -1
  233. package/lib/abstract/chevreTxc/offer.d.ts +1 -1
  234. package/lib/abstract/chevreTxc/offer.js +69 -195
  235. package/lib/abstract/chevreTxc.js +33 -84
  236. package/lib/abstract/chevreTxn/offer.d.ts +1 -1
  237. package/lib/abstract/chevreTxn/offer.js +57 -183
  238. package/lib/abstract/chevreTxn/transaction/placeOrder/factory.d.ts +1 -1
  239. package/lib/abstract/chevreTxn/transaction/placeOrder.d.ts +3 -3
  240. package/lib/abstract/chevreTxn/transaction/placeOrder.js +53 -197
  241. package/lib/abstract/chevreTxn/transaction/returnOrder/factory.d.ts +1 -1
  242. package/lib/abstract/chevreTxn/transaction/returnOrder.d.ts +3 -3
  243. package/lib/abstract/chevreTxn/transaction/returnOrder.js +38 -165
  244. package/lib/abstract/chevreTxn/transaction.d.ts +1 -11
  245. package/lib/abstract/chevreTxn/transaction.js +0 -10
  246. package/lib/abstract/chevreTxn.js +58 -119
  247. package/lib/abstract/cinerino/default.d.ts +0 -12
  248. package/lib/abstract/cinerino/default.js +19 -103
  249. package/lib/abstract/cinerino/service/categoryCode.d.ts +1 -1
  250. package/lib/abstract/cinerino/service/categoryCode.js +18 -94
  251. package/lib/abstract/cinerino/service/emailMessage.d.ts +1 -1
  252. package/lib/abstract/cinerino/service/emailMessage.js +18 -94
  253. package/lib/abstract/cinerino/service/event.d.ts +1 -1
  254. package/lib/abstract/cinerino/service/event.js +165 -351
  255. package/lib/abstract/cinerino/service/place/hasPOS.d.ts +1 -1
  256. package/lib/abstract/cinerino/service/place/hasPOS.js +16 -110
  257. package/lib/abstract/cinerino/service/place.d.ts +1 -1
  258. package/lib/abstract/cinerino/service/place.js +31 -142
  259. package/lib/abstract/cinerino/service/seller.d.ts +1 -1
  260. package/lib/abstract/cinerino/service/seller.js +54 -165
  261. package/lib/abstract/cloud/admin/creativeWork.d.ts +1 -1
  262. package/lib/abstract/cloud/admin/creativeWork.js +12 -83
  263. package/lib/abstract/cloud/admin/customer.d.ts +1 -1
  264. package/lib/abstract/cloud/admin/customer.js +20 -81
  265. package/lib/abstract/cloud/admin/event.d.ts +1 -1
  266. package/lib/abstract/cloud/admin/event.js +66 -210
  267. package/lib/abstract/cloud/admin/eventOffer.js +24 -119
  268. package/lib/abstract/cloud/admin/eventSeries.d.ts +1 -1
  269. package/lib/abstract/cloud/admin/eventSeries.js +12 -94
  270. package/lib/abstract/cloud/admin/me.js +18 -106
  271. package/lib/abstract/cloud/admin/noteAboutOrder.d.ts +1 -1
  272. package/lib/abstract/cloud/admin/noteAboutOrder.js +33 -138
  273. package/lib/abstract/cloud/admin/offer.d.ts +1 -1
  274. package/lib/abstract/cloud/admin/offer.js +88 -186
  275. package/lib/abstract/cloud/admin/offerCatalog.d.ts +1 -1
  276. package/lib/abstract/cloud/admin/offerCatalog.js +20 -126
  277. package/lib/abstract/cloud/admin/offerCatalogItem.d.ts +1 -1
  278. package/lib/abstract/cloud/admin/offerCatalogItem.js +25 -117
  279. package/lib/abstract/cloud/admin/order.d.ts +1 -1
  280. package/lib/abstract/cloud/admin/order.js +108 -219
  281. package/lib/abstract/cloud/admin/paymentMethod.js +12 -80
  282. package/lib/abstract/cloud/admin/product.d.ts +1 -1
  283. package/lib/abstract/cloud/admin/product.js +25 -114
  284. package/lib/abstract/cloud/admin/productOffer.d.ts +1 -1
  285. package/lib/abstract/cloud/admin/productOffer.js +28 -126
  286. package/lib/abstract/cloud/admin/reservation.d.ts +41 -8
  287. package/lib/abstract/cloud/admin/reservation.js +89 -226
  288. package/lib/abstract/cloud/admin/seller.d.ts +1 -1
  289. package/lib/abstract/cloud/admin/seller.js +12 -79
  290. package/lib/abstract/cloud/admin.js +135 -348
  291. package/lib/abstract/cloud/asset/delivery.js +23 -94
  292. package/lib/abstract/cloud/asset/order.js +180 -251
  293. package/lib/abstract/cloud/asset/reservation.d.ts +1 -1
  294. package/lib/abstract/cloud/asset/reservation.js +28 -113
  295. package/lib/abstract/cloud/asset/token.js +3 -23
  296. package/lib/abstract/cloud/asset.d.ts +0 -4
  297. package/lib/abstract/cloud/asset.js +60 -134
  298. package/lib/abstract/cloud/pay/payment.d.ts +1 -1
  299. package/lib/abstract/cloud/pay/payment.js +387 -689
  300. package/lib/abstract/cloud/pay.d.ts +0 -4
  301. package/lib/abstract/cloud/pay.js +33 -83
  302. package/lib/abstract/cloud/search/creativeWork.js +13 -76
  303. package/lib/abstract/cloud/search/eventOffer.js +15 -79
  304. package/lib/abstract/cloud/search/paymentService.js +14 -78
  305. package/lib/abstract/cloud/search/place.d.ts +1 -1
  306. package/lib/abstract/cloud/search/place.js +24 -96
  307. package/lib/abstract/cloud/search/product.d.ts +1 -1
  308. package/lib/abstract/cloud/search/product.js +34 -114
  309. package/lib/abstract/cloud/search/productOffer.js +15 -79
  310. package/lib/abstract/cloud/search/seatOffer.js +15 -79
  311. package/lib/abstract/cloud/search.js +86 -179
  312. package/lib/abstract/cloud/txc/transaction/forceAsync.d.ts +1 -1
  313. package/lib/abstract/cloud/txc/transaction/forceAsync.js +113 -206
  314. package/lib/abstract/cloud/txc/transaction/placeOrder.d.ts +1 -1
  315. package/lib/abstract/cloud/txc/transaction/placeOrder.js +146 -242
  316. package/lib/abstract/cloud/txc.js +34 -79
  317. package/lib/abstract/cloud/txn/offer.d.ts +1 -1
  318. package/lib/abstract/cloud/txn/offer.js +72 -172
  319. package/lib/abstract/cloud/txn/transaction/placeOrder.d.ts +1 -1
  320. package/lib/abstract/cloud/txn/transaction/placeOrder.js +145 -234
  321. package/lib/abstract/cloud/txn/transaction/returnOrder.d.ts +1 -1
  322. package/lib/abstract/cloud/txn/transaction/returnOrder.js +60 -141
  323. package/lib/abstract/cloud/txn.d.ts +0 -4
  324. package/lib/abstract/cloud/txn.js +52 -118
  325. package/lib/abstract/factory.d.ts +1 -1
  326. package/lib/abstract/factory.js +3 -15
  327. package/lib/abstract/index.d.ts +1 -1
  328. package/lib/abstract/index.js +107 -355
  329. package/lib/abstract/pecorino/accountTransaction.d.ts +3 -3
  330. package/lib/abstract/pecorino/accountTransaction.js +45 -146
  331. package/lib/abstract/pecorino/permit.d.ts +1 -1
  332. package/lib/abstract/pecorino/permit.js +24 -102
  333. package/lib/abstract/pecorino.d.ts +1 -1
  334. package/lib/abstract/pecorino.js +8 -56
  335. package/lib/abstract/service.d.ts +0 -1
  336. package/lib/abstract/service.js +65 -137
  337. package/lib/abstract/transporters.d.ts +2 -2
  338. package/lib/abstract/transporters.js +67 -143
  339. package/lib/abstract/waiterAdmin/rule.d.ts +1 -1
  340. package/lib/abstract/waiterAdmin/rule.js +13 -76
  341. package/lib/abstract/waiterAdmin/ruleSet.d.ts +1 -1
  342. package/lib/abstract/waiterAdmin/ruleSet.js +20 -92
  343. package/lib/abstract/waiterAdmin.js +35 -94
  344. package/lib/auth/clientCredentialsClient.d.ts +2 -4
  345. package/lib/auth/clientCredentialsClient.js +77 -158
  346. package/lib/auth/implicitGrantClient/credentials.d.ts +1 -2
  347. package/lib/auth/implicitGrantClient/error.d.ts +3 -3
  348. package/lib/auth/implicitGrantClient/error.js +5 -22
  349. package/lib/auth/implicitGrantClient/iframeHandler.d.ts +1 -1
  350. package/lib/auth/implicitGrantClient/iframeHandler.js +37 -27
  351. package/lib/auth/implicitGrantClient/popupAuthenticationHandler.d.ts +1 -1
  352. package/lib/auth/implicitGrantClient/popupAuthenticationHandler.js +35 -99
  353. package/lib/auth/implicitGrantClient/popupHandler.d.ts +1 -1
  354. package/lib/auth/implicitGrantClient/popupHandler.js +37 -27
  355. package/lib/auth/implicitGrantClient/silentAuthenticationHandler.d.ts +1 -1
  356. package/lib/auth/implicitGrantClient/silentAuthenticationHandler.js +35 -99
  357. package/lib/auth/implicitGrantClient/silentLogoutHandler.d.ts +1 -1
  358. package/lib/auth/implicitGrantClient/silentLogoutHandler.js +35 -99
  359. package/lib/auth/implicitGrantClient.d.ts +2 -2
  360. package/lib/auth/implicitGrantClient.js +153 -304
  361. package/lib/auth/loginTicket.js +7 -6
  362. package/lib/auth/oAuth2client.d.ts +2 -2
  363. package/lib/auth/oAuth2client.js +314 -390
  364. package/lib/browser.js +2 -2
  365. package/lib/bundle.js +6 -41699
  366. package/lib/bundle.js.map +7 -0
  367. package/lib/index.d.ts +2 -2
  368. package/lib/index.js +36 -106
  369. package/package.json +18 -21
  370. package/lib/abstract/chevreConsole/transaction.d.ts +0 -7
  371. package/lib/abstract/chevreConsole/transaction.js +0 -12
@@ -1,756 +1,454 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
- if (k2 === undefined) k2 = k;
30
- var desc = Object.getOwnPropertyDescriptor(m, k);
31
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32
- desc = { enumerable: true, get: function() { return m[k]; } };
33
- }
34
- Object.defineProperty(o, k2, desc);
35
- }) : (function(o, m, k, k2) {
36
- if (k2 === undefined) k2 = k;
37
- o[k2] = m[k];
38
- }));
39
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
40
- Object.defineProperty(o, "default", { enumerable: true, value: v });
41
- }) : function(o, v) {
42
- o["default"] = v;
43
- });
44
- var __importStar = (this && this.__importStar) || function (mod) {
45
- if (mod && mod.__esModule) return mod;
46
- var result = {};
47
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
48
- __setModuleDefault(result, mod);
49
- return result;
50
- };
51
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
52
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
53
- return new (P || (P = Promise))(function (resolve, reject) {
54
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
55
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
56
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
57
- step((generator = generator.apply(thisArg, _arguments || [])).next());
58
- });
59
- };
60
- var __generator = (this && this.__generator) || function (thisArg, body) {
61
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
62
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
63
- function verb(n) { return function (v) { return step([n, v]); }; }
64
- function step(op) {
65
- if (f) throw new TypeError("Generator is already executing.");
66
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
67
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
68
- if (y = 0, t) op = [op[0] & 2, t.value];
69
- switch (op[0]) {
70
- case 0: case 1: t = op; break;
71
- case 4: _.label++; return { value: op[1], done: false };
72
- case 5: _.label++; y = op[1]; op = [0]; continue;
73
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
74
- default:
75
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
76
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
77
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
78
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
79
- if (t[2]) _.ops.pop();
80
- _.trys.pop(); continue;
81
- }
82
- op = body.call(thisArg, _);
83
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
84
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
85
- }
86
- };
87
- var __rest = (this && this.__rest) || function (s, e) {
88
- var t = {};
89
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
90
- t[p] = s[p];
91
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
92
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
93
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
94
- t[p[i]] = s[p[i]];
95
- }
96
- return t;
97
- };
98
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
99
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
100
- if (ar || !(i in from)) {
101
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
102
- ar[i] = from[i];
103
- }
104
- }
105
- return to.concat(ar || Array.prototype.slice.call(from));
106
- };
107
2
  Object.defineProperty(exports, "__esModule", { value: true });
108
3
  exports.PaymentService = void 0;
109
- var http_status_1 = require("http-status");
110
- var factory = __importStar(require("../../factory"));
111
- var index_1 = require("../../index");
112
- var service_1 = require("../../service");
113
- var MIN_INTERVAL_AFTER_ISSUE_TICKET_MS = 1000;
114
- var RETRY_ISSUE_TICKET_INTERVAL_MS = 5000;
115
- function wait(waitInMilliseconds) {
116
- return __awaiter(this, void 0, void 0, function () {
117
- return __generator(this, function (_a) {
118
- return [2 /*return*/, new Promise(function (resolve) {
119
- setTimeout(function () { resolve(); }, waitInMilliseconds);
120
- })];
121
- });
4
+ const http_status_1 = require("http-status");
5
+ const factory_1 = require("../../factory");
6
+ const index_1 = require("../../index");
7
+ const service_1 = require("../../service");
8
+ const MIN_INTERVAL_AFTER_ISSUE_TICKET_MS = 1000;
9
+ const RETRY_ISSUE_TICKET_INTERVAL_MS = 5000;
10
+ async function wait(waitInMilliseconds) {
11
+ return new Promise((resolve) => {
12
+ setTimeout(() => { resolve(); }, waitInMilliseconds);
122
13
  });
123
14
  }
124
15
  /**
125
16
  * 決済サービス
126
17
  */
127
- var PaymentService = /** @class */ (function (_super) {
128
- __extends(PaymentService, _super);
129
- function PaymentService() {
130
- return _super !== null && _super.apply(this, arguments) || this;
131
- }
18
+ class PaymentService extends service_1.Service {
132
19
  /**
133
20
  * 対面決済承認
134
21
  */
135
- PaymentService.prototype.authorizeAnyPayment = function (params) {
136
- return __awaiter(this, void 0, void 0, function () {
137
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
138
- return __generator(this, function (_b) {
139
- switch (_b.label) {
140
- case 0:
141
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
142
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
143
- case 1:
144
- chevrePay = _b.sent();
145
- return [4 /*yield*/, chevrePay.createPaymentInstance({
146
- project: project,
147
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
148
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
149
- http_status_1.CONFLICT,
150
- http_status_1.TOO_MANY_REQUESTS
151
- ], false)
152
- })];
153
- case 2:
154
- paymentService = _b.sent();
155
- return [2 /*return*/, paymentService.authorizeAnyPayment(params)];
156
- }
157
- });
22
+ async authorizeAnyPayment(params) {
23
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
24
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
25
+ const paymentService = await chevrePay.createPaymentInstance({
26
+ project,
27
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
28
+ retryableStatusCodes: [
29
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
30
+ http_status_1.status.CONFLICT,
31
+ http_status_1.status.TOO_MANY_REQUESTS
32
+ ]
158
33
  });
159
- };
34
+ return paymentService.authorizeAnyPayment(params);
35
+ }
160
36
  /**
161
37
  * クレジットカード決済承認(非同期)
162
38
  */
163
- PaymentService.prototype.authorizeCreditCardAsync = function (params, options) {
164
- return __awaiter(this, void 0, void 0, function () {
165
- var object, purpose, acceptedPaymentMethodOfferIds, intervalAfterIssueTicketInMS, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
166
- var _b;
167
- return __generator(this, function (_c) {
168
- switch (_c.label) {
169
- case 0:
170
- object = params.object, purpose = params.purpose;
171
- acceptedPaymentMethodOfferIds = (_b = params.instrumentOptions) === null || _b === void 0 ? void 0 : _b.acceptedPaymentMethodOfferIds;
172
- intervalAfterIssueTicketInMS = options === null || options === void 0 ? void 0 : options.intervalAfterIssueTicketInMS;
173
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
174
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
175
- case 1:
176
- chevrePay = _c.sent();
177
- return [4 /*yield*/, chevrePay.createPaymentInstance({
178
- project: project,
179
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
180
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
181
- http_status_1.CONFLICT,
182
- http_status_1.TOO_MANY_REQUESTS
183
- ], false)
184
- })];
185
- case 2:
186
- paymentService = _c.sent();
187
- return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
188
- checkPaymentMethodId: true,
189
- intervalAfterIssueTicketInMS: intervalAfterIssueTicketInMS
190
- })];
191
- case 3:
192
- ticketToken = (_c.sent()).ticketToken;
193
- return [2 /*return*/, paymentService.authorizeCreditCard({
194
- object: __assign(__assign({}, object), { ticketToken: ticketToken }),
195
- purpose: purpose,
196
- instrumentOptions: {
197
- acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
198
- }
199
- }
200
- // { async: true }
201
- )];
202
- }
203
- });
39
+ async authorizeCreditCardAsync(params, options) {
40
+ const { object, purpose } = params;
41
+ const acceptedPaymentMethodOfferIds = params.instrumentOptions?.acceptedPaymentMethodOfferIds;
42
+ const intervalAfterIssueTicketInMS = options?.intervalAfterIssueTicketInMS;
43
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
44
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
45
+ const paymentService = await chevrePay.createPaymentInstance({
46
+ project,
47
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
48
+ retryableStatusCodes: [
49
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
50
+ http_status_1.status.CONFLICT,
51
+ http_status_1.status.TOO_MANY_REQUESTS
52
+ ]
53
+ });
54
+ // issue ticket if not exists(2025-11-09~)
55
+ const { ticketToken } = await this.issueTicketThroughCreditCardIfNotExists({ object, purpose }, {
56
+ checkPaymentMethodId: true,
57
+ intervalAfterIssueTicketInMS
204
58
  });
205
- };
59
+ return paymentService.authorizeCreditCard({
60
+ object: {
61
+ ...object,
62
+ ticketToken
63
+ },
64
+ purpose,
65
+ instrumentOptions: {
66
+ acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
67
+ }
68
+ }
69
+ // { async: true }
70
+ );
71
+ }
206
72
  /**
207
73
  * 決済カード決済承認
208
74
  */
209
- PaymentService.prototype.authorizeMovieTicketAsync = function (params, options) {
210
- return __awaiter(this, void 0, void 0, function () {
211
- var object, purpose, acceptedPaymentMethodOfferIds, checkedActionId, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, ticketToken, paymentService;
212
- var _b;
213
- return __generator(this, function (_c) {
214
- switch (_c.label) {
215
- case 0:
216
- object = params.object, purpose = params.purpose;
217
- acceptedPaymentMethodOfferIds = (_b = params.instrumentOptions) === null || _b === void 0 ? void 0 : _b.acceptedPaymentMethodOfferIds;
218
- checkedActionId = options.checkedActionId;
219
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
220
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
221
- case 1:
222
- chevrePay = _c.sent();
223
- return [4 /*yield*/, this.issueTicketThroughMovieTicketUntilSuccess(params, options)];
224
- case 2:
225
- ticketToken = (_c.sent()).ticketToken;
226
- return [4 /*yield*/, chevrePay.createPaymentInstance({
227
- project: project,
228
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
229
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
230
- http_status_1.CONFLICT,
231
- http_status_1.TOO_MANY_REQUESTS
232
- ], false)
233
- })];
234
- case 3:
235
- paymentService = _c.sent();
236
- return [2 /*return*/, paymentService.authorizeMovieTicket({
237
- object: __assign(__assign({}, object), { ticketToken: ticketToken }),
238
- purpose: purpose,
239
- instrumentOptions: {
240
- acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
241
- }
242
- }, { checkedActionId: checkedActionId })];
243
- }
244
- });
75
+ async authorizeMovieTicketAsync(params, options) {
76
+ const { object, purpose } = params;
77
+ const acceptedPaymentMethodOfferIds = params.instrumentOptions?.acceptedPaymentMethodOfferIds;
78
+ const { checkedActionId } = options;
79
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
80
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
81
+ // issue ticket(2024-11-25~)
82
+ const { ticketToken } = await this.issueTicketThroughMovieTicketUntilSuccess(params, options);
83
+ const paymentService = await chevrePay.createPaymentInstance({
84
+ project,
85
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
86
+ retryableStatusCodes: [
87
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
88
+ http_status_1.status.CONFLICT,
89
+ http_status_1.status.TOO_MANY_REQUESTS
90
+ ]
245
91
  });
246
- };
92
+ return paymentService.authorizeMovieTicket({
93
+ object: {
94
+ ...object,
95
+ ticketToken
96
+ },
97
+ purpose,
98
+ instrumentOptions: {
99
+ acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
100
+ }
101
+ }, { checkedActionId });
102
+ }
247
103
  /**
248
104
  * 決済採用(決済ロケーション発行)(非同期)
249
105
  */
250
- PaymentService.prototype.publishCreditCardPaymentUrlAsync = function (params, options) {
251
- return __awaiter(this, void 0, void 0, function () {
252
- var object, purpose, acceptedPaymentMethodOfferIds, intervalAfterIssueTicketInMS, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
253
- var _b;
254
- return __generator(this, function (_c) {
255
- switch (_c.label) {
256
- case 0:
257
- object = params.object, purpose = params.purpose;
258
- acceptedPaymentMethodOfferIds = (_b = params.instrumentOptions) === null || _b === void 0 ? void 0 : _b.acceptedPaymentMethodOfferIds;
259
- intervalAfterIssueTicketInMS = options === null || options === void 0 ? void 0 : options.intervalAfterIssueTicketInMS;
260
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
261
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
262
- case 1:
263
- chevrePay = _c.sent();
264
- return [4 /*yield*/, chevrePay.createPaymentInstance({
265
- project: project,
266
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
267
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
268
- http_status_1.CONFLICT,
269
- http_status_1.GATEWAY_TIMEOUT,
270
- http_status_1.TOO_MANY_REQUESTS
271
- ], false)
272
- })];
273
- case 2:
274
- paymentService = _c.sent();
275
- return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
276
- checkPaymentMethodId: false,
277
- intervalAfterIssueTicketInMS: intervalAfterIssueTicketInMS
278
- })];
279
- case 3:
280
- ticketToken = (_c.sent()).ticketToken;
281
- if (typeof ticketToken !== 'string' || ticketToken === '') {
282
- throw new factory.errors.ArgumentNull('object.ticketToken'); // required(2025-12-06~)
283
- }
284
- return [2 /*return*/, paymentService.publishCreditCardPaymentUrl({
285
- object: __assign(__assign({}, object), { ticketToken: ticketToken }),
286
- purpose: purpose,
287
- instrumentOptions: {
288
- acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
289
- }
290
- })];
291
- }
292
- });
106
+ async publishCreditCardPaymentUrlAsync(params, options) {
107
+ const { object, purpose } = params;
108
+ const acceptedPaymentMethodOfferIds = params.instrumentOptions?.acceptedPaymentMethodOfferIds;
109
+ const intervalAfterIssueTicketInMS = options?.intervalAfterIssueTicketInMS;
110
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
111
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
112
+ const paymentService = await chevrePay.createPaymentInstance({
113
+ project,
114
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
115
+ retryableStatusCodes: [
116
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
117
+ http_status_1.status.CONFLICT,
118
+ http_status_1.status.GATEWAY_TIMEOUT,
119
+ http_status_1.status.TOO_MANY_REQUESTS
120
+ ]
121
+ });
122
+ // issue ticket if not exists(2025-11-09~)
123
+ const { ticketToken } = await this.issueTicketThroughCreditCardIfNotExists({ object, purpose }, {
124
+ checkPaymentMethodId: false,
125
+ intervalAfterIssueTicketInMS
126
+ });
127
+ if (typeof ticketToken !== 'string' || ticketToken === '') {
128
+ throw new factory_1.factory.errors.ArgumentNull('object.ticketToken'); // required(2025-12-06~)
129
+ }
130
+ return paymentService.publishCreditCardPaymentUrl({
131
+ object: {
132
+ ...object,
133
+ ticketToken
134
+ },
135
+ purpose,
136
+ instrumentOptions: {
137
+ acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
138
+ }
293
139
  });
294
- };
140
+ }
295
141
  /**
296
142
  * 決済カード認証(非同期)
297
143
  */
298
- PaymentService.prototype.checkMovieTicketAsync = function (params) {
299
- return __awaiter(this, void 0, void 0, function () {
300
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, paymentServiceId, paymentMethodType, purpose, movieTickets;
301
- var _b, _c, _d, _e, _f, _g, _h;
302
- return __generator(this, function (_j) {
303
- switch (_j.label) {
304
- case 0:
305
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
306
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
307
- case 1:
308
- chevrePay = _j.sent();
309
- return [4 /*yield*/, chevrePay.createPaymentInstance({
310
- project: project,
311
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
312
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
313
- http_status_1.CONFLICT,
314
- http_status_1.GATEWAY_TIMEOUT,
315
- http_status_1.TOO_MANY_REQUESTS
316
- ], false)
317
- })];
318
- case 2:
319
- paymentService = _j.sent();
320
- paymentServiceId = String((_b = params.object) === null || _b === void 0 ? void 0 : _b.id);
321
- paymentMethodType = String((_d = (_c = params.object) === null || _c === void 0 ? void 0 : _c.paymentMethod) === null || _d === void 0 ? void 0 : _d.typeOf);
322
- purpose = (typeof ((_e = params.purpose) === null || _e === void 0 ? void 0 : _e.id) === 'string')
323
- ? { id: params.purpose.id, typeOf: params.purpose.typeOf }
324
- : { id: '', typeOf: factory.transactionType.PlaceOrder };
325
- movieTickets = (Array.isArray((_f = params.object) === null || _f === void 0 ? void 0 : _f.movieTickets))
326
- ? params.object.movieTickets.map(function (m) {
327
- return __assign(__assign({}, m), { typeOf: paymentMethodType });
328
- })
329
- : [];
330
- if (movieTickets.length !== 1) {
331
- throw new factory.errors.Argument('object.movieTickets', 'movieTickets length must be 1');
332
- }
333
- return [2 /*return*/, paymentService.checkMovieTicketAsync({
334
- object: [{
335
- typeOf: factory.service.paymentService.PaymentServiceType.MovieTicket,
336
- id: paymentServiceId,
337
- paymentMethod: { typeOf: paymentMethodType },
338
- movieTickets: movieTickets,
339
- seller: {
340
- id: String((_h = (_g = params.object) === null || _g === void 0 ? void 0 : _g.seller) === null || _h === void 0 ? void 0 : _h.id),
341
- typeOf: factory.organizationType.Corporation
342
- }
343
- }],
344
- purpose: purpose
345
- })];
346
- }
347
- });
144
+ async checkMovieTicketAsync(params) {
145
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
146
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
147
+ const paymentService = await chevrePay.createPaymentInstance({
148
+ project,
149
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
150
+ retryableStatusCodes: [
151
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
152
+ http_status_1.status.CONFLICT,
153
+ http_status_1.status.GATEWAY_TIMEOUT,
154
+ http_status_1.status.TOO_MANY_REQUESTS
155
+ ]
156
+ });
157
+ const paymentServiceId = String(params.object?.id);
158
+ const paymentMethodType = String(params.object?.paymentMethod?.typeOf);
159
+ const purpose = (typeof params.purpose?.id === 'string')
160
+ ? { id: params.purpose.id, typeOf: params.purpose.typeOf }
161
+ : { id: '', typeOf: factory_1.factory.transactionType.PlaceOrder };
162
+ const movieTickets = (Array.isArray(params.object?.movieTickets))
163
+ ? params.object.movieTickets.map((m) => {
164
+ return { ...m, typeOf: paymentMethodType };
165
+ })
166
+ : [];
167
+ if (movieTickets.length !== 1) {
168
+ throw new factory_1.factory.errors.Argument('object.movieTickets', 'movieTickets length must be 1');
169
+ }
170
+ return paymentService.checkMovieTicketAsync({
171
+ object: [{
172
+ typeOf: factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket,
173
+ id: paymentServiceId,
174
+ paymentMethod: { typeOf: paymentMethodType },
175
+ movieTickets,
176
+ seller: {
177
+ id: String(params.object?.seller?.id),
178
+ typeOf: factory_1.factory.organizationType.Corporation
179
+ }
180
+ }],
181
+ purpose
348
182
  });
349
- };
183
+ }
350
184
  /**
351
185
  * 対面決済承認取消
352
186
  */
353
- PaymentService.prototype.voidAnyPayment = function (params) {
354
- return __awaiter(this, void 0, void 0, function () {
355
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
356
- return __generator(this, function (_b) {
357
- switch (_b.label) {
358
- case 0:
359
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
360
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
361
- case 1:
362
- chevrePay = _b.sent();
363
- return [4 /*yield*/, chevrePay.createPaymentInstance({
364
- project: project,
365
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
366
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
367
- http_status_1.CONFLICT,
368
- http_status_1.TOO_MANY_REQUESTS
369
- ], false)
370
- })];
371
- case 2:
372
- paymentService = _b.sent();
373
- return [4 /*yield*/, paymentService.voidAnyPayment({
374
- id: String(params.id),
375
- purpose: params.purpose
376
- })];
377
- case 3:
378
- _b.sent();
379
- return [2 /*return*/];
380
- }
381
- });
187
+ async voidAnyPayment(params) {
188
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
189
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
190
+ const paymentService = await chevrePay.createPaymentInstance({
191
+ project,
192
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
193
+ retryableStatusCodes: [
194
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
195
+ http_status_1.status.CONFLICT,
196
+ http_status_1.status.TOO_MANY_REQUESTS
197
+ ]
198
+ });
199
+ await paymentService.voidAnyPayment({
200
+ id: String(params.id),
201
+ purpose: params.purpose
382
202
  });
383
- };
203
+ }
384
204
  /**
385
205
  * 決済承認取消
386
206
  */
387
- PaymentService.prototype.voidTransaction = function (params) {
388
- return __awaiter(this, void 0, void 0, function () {
389
- var id, object, body, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
390
- return __generator(this, function (_b) {
391
- switch (_b.label) {
392
- case 0:
393
- id = params.id, object = params.object, body = __rest(params, ["id", "object"]);
394
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
395
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
396
- case 1:
397
- chevrePay = _b.sent();
398
- return [4 /*yield*/, chevrePay.createPaymentInstance({
399
- project: project,
400
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
401
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
402
- http_status_1.CONFLICT,
403
- http_status_1.GATEWAY_TIMEOUT,
404
- http_status_1.TOO_MANY_REQUESTS
405
- ], false)
406
- })];
407
- case 2:
408
- paymentService = _b.sent();
409
- return [4 /*yield*/, paymentService.voidTransaction({
410
- id: String(id),
411
- object: { typeOf: object.typeOf },
412
- purpose: body.purpose
413
- })];
414
- case 3:
415
- _b.sent();
416
- return [2 /*return*/];
417
- }
418
- });
207
+ async voidTransaction(params) {
208
+ const { id, object, ...body } = params;
209
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
210
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
211
+ const paymentService = await chevrePay.createPaymentInstance({
212
+ project,
213
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
214
+ retryableStatusCodes: [
215
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
216
+ http_status_1.status.CONFLICT,
217
+ http_status_1.status.GATEWAY_TIMEOUT,
218
+ http_status_1.status.TOO_MANY_REQUESTS
219
+ ]
220
+ });
221
+ await paymentService.voidTransaction({
222
+ id: String(id),
223
+ object: { typeOf: object.typeOf },
224
+ purpose: body.purpose
419
225
  });
420
- };
226
+ }
421
227
  /**
422
228
  * 決済承認アクション状態検索
423
229
  */
424
- PaymentService.prototype.findAuthorizeAction = function (params) {
425
- return __awaiter(this, void 0, void 0, function () {
426
- var sameAs, object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
427
- return __generator(this, function (_b) {
428
- switch (_b.label) {
429
- case 0:
430
- sameAs = params.sameAs, object = params.object, purpose = params.purpose;
431
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
432
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
433
- case 1:
434
- chevrePay = _b.sent();
435
- return [4 /*yield*/, chevrePay.createPaymentInstance({
436
- project: project,
437
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
438
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true)
439
- })];
440
- case 2:
441
- paymentService = _b.sent();
442
- return [2 /*return*/, paymentService.findAuthorizeAction({
443
- sameAs: { id: String(sameAs.id) },
444
- object: { typeOf: object.typeOf },
445
- purpose: purpose
446
- })];
447
- }
448
- });
230
+ async findAuthorizeAction(params) {
231
+ const { sameAs, object, purpose } = params;
232
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
233
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
234
+ const paymentService = await chevrePay.createPaymentInstance({
235
+ project,
236
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
237
+ retryableStatusCodes: [
238
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []
239
+ ]
240
+ });
241
+ return paymentService.findAuthorizeAction({
242
+ sameAs: { id: String(sameAs.id) },
243
+ object: { typeOf: object.typeOf },
244
+ purpose
449
245
  });
450
- };
246
+ }
451
247
  /**
452
248
  * 決済採用アクション検索
453
249
  */
454
- PaymentService.prototype.findAcceptPayAction = function (params) {
455
- return __awaiter(this, void 0, void 0, function () {
456
- var sameAs, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
457
- return __generator(this, function (_b) {
458
- switch (_b.label) {
459
- case 0:
460
- sameAs = params.sameAs, purpose = params.purpose;
461
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
462
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
463
- case 1:
464
- chevrePay = _b.sent();
465
- return [4 /*yield*/, chevrePay.createPaymentInstance({
466
- project: project,
467
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
468
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true)
469
- })];
470
- case 2:
471
- paymentService = _b.sent();
472
- return [2 /*return*/, paymentService.findAcceptPayAction({
473
- sameAs: { id: String(sameAs.id) },
474
- purpose: purpose
475
- })];
476
- }
477
- });
250
+ async findAcceptPayAction(params) {
251
+ const { sameAs, purpose } = params;
252
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
253
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
254
+ const paymentService = await chevrePay.createPaymentInstance({
255
+ project,
256
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
257
+ retryableStatusCodes: [
258
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []
259
+ ]
478
260
  });
479
- };
261
+ return paymentService.findAcceptPayAction({
262
+ sameAs: { id: String(sameAs.id) },
263
+ purpose
264
+ });
265
+ }
480
266
  /**
481
267
  * 決済カード認証アクション検索
482
268
  */
483
- PaymentService.prototype.findCheckMovieTicketAction = function (params) {
484
- return __awaiter(this, void 0, void 0, function () {
485
- var sameAs, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
486
- return __generator(this, function (_b) {
487
- switch (_b.label) {
488
- case 0:
489
- sameAs = params.sameAs, purpose = params.purpose;
490
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
491
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
492
- case 1:
493
- chevrePay = _b.sent();
494
- return [4 /*yield*/, chevrePay.createPaymentInstance({
495
- project: project,
496
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
497
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true)
498
- })];
499
- case 2:
500
- paymentService = _b.sent();
501
- return [2 /*return*/, paymentService.findCheckMovieTicketAction({
502
- sameAs: { id: String(sameAs.id) },
503
- purpose: purpose,
504
- minimize: true
505
- })];
506
- }
507
- });
269
+ async findCheckMovieTicketAction(params) {
270
+ const { sameAs, purpose } = params;
271
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
272
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
273
+ const paymentService = await chevrePay.createPaymentInstance({
274
+ project,
275
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
276
+ retryableStatusCodes: [
277
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []
278
+ ]
508
279
  });
509
- };
280
+ return paymentService.findCheckMovieTicketAction({
281
+ sameAs: { id: String(sameAs.id) },
282
+ purpose,
283
+ minimize: true
284
+ });
285
+ }
510
286
  /**
511
287
  * 決済カード認証結果の無効券検索
512
288
  */
513
- PaymentService.prototype.searchMkknInfoByCheckMovieTicketAction = function (params) {
514
- return __awaiter(this, void 0, void 0, function () {
515
- var limit, page, id, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
516
- return __generator(this, function (_b) {
517
- switch (_b.label) {
518
- case 0:
519
- limit = params.limit, page = params.page, id = params.id, purpose = params.purpose;
520
- if (typeof limit !== 'number') {
521
- throw new factory.errors.Argument('limit', 'limit must be number');
522
- }
523
- if (typeof page !== 'number') {
524
- throw new factory.errors.Argument('page', 'page must be number');
525
- }
526
- if (limit < 1 || limit > 20) {
527
- throw new factory.errors.Argument('limit', 'limit must be >=1 and <=20');
528
- }
529
- if (page < 1) {
530
- throw new factory.errors.Argument('page', 'page must be >=1');
531
- }
532
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
533
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
534
- case 1:
535
- chevrePay = _b.sent();
536
- return [4 /*yield*/, chevrePay.createPaymentInstance({
537
- project: project,
538
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
539
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true)
540
- })];
541
- case 2:
542
- paymentService = _b.sent();
543
- return [2 /*return*/, paymentService.searchMkknInfoByCheckMovieTicketAction({ limit: limit, page: page, id: id, purpose: purpose })];
544
- }
545
- });
289
+ async searchMkknInfoByCheckMovieTicketAction(params) {
290
+ const { limit, page, id, purpose } = params;
291
+ if (typeof limit !== 'number') {
292
+ throw new factory_1.factory.errors.Argument('limit', 'limit must be number');
293
+ }
294
+ if (typeof page !== 'number') {
295
+ throw new factory_1.factory.errors.Argument('page', 'page must be number');
296
+ }
297
+ if (limit < 1 || limit > 20) {
298
+ throw new factory_1.factory.errors.Argument('limit', 'limit must be >=1 and <=20');
299
+ }
300
+ if (page < 1) {
301
+ throw new factory_1.factory.errors.Argument('page', 'page must be >=1');
302
+ }
303
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
304
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
305
+ const paymentService = await chevrePay.createPaymentInstance({
306
+ project,
307
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
308
+ retryableStatusCodes: [
309
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []
310
+ ]
546
311
  });
547
- };
312
+ return paymentService.searchMkknInfoByCheckMovieTicketAction({ limit, page, id, purpose });
313
+ }
548
314
  /**
549
315
  * 決済カード認証結果の有効券検索
550
316
  */
551
- PaymentService.prototype.searchYkknInfoByCheckMovieTicketAction = function (params) {
552
- return __awaiter(this, void 0, void 0, function () {
553
- var limit, page, id, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
554
- return __generator(this, function (_b) {
555
- switch (_b.label) {
556
- case 0:
557
- limit = params.limit, page = params.page, id = params.id, purpose = params.purpose;
558
- if (typeof limit !== 'number') {
559
- throw new factory.errors.Argument('limit', 'limit must be number');
560
- }
561
- if (typeof page !== 'number') {
562
- throw new factory.errors.Argument('page', 'page must be number');
563
- }
564
- if (limit < 1 || limit > 20) {
565
- throw new factory.errors.Argument('limit', 'limit must be >=1 and <=20');
566
- }
567
- if (page < 1) {
568
- throw new factory.errors.Argument('page', 'page must be >=1');
569
- }
570
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
571
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
572
- case 1:
573
- chevrePay = _b.sent();
574
- return [4 /*yield*/, chevrePay.createPaymentInstance({
575
- project: project,
576
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
577
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true)
578
- })];
579
- case 2:
580
- paymentService = _b.sent();
581
- return [2 /*return*/, paymentService.searchYkknInfoByCheckMovieTicketAction({ limit: limit, page: page, id: id, purpose: purpose })];
582
- }
583
- });
317
+ async searchYkknInfoByCheckMovieTicketAction(params) {
318
+ const { limit, page, id, purpose } = params;
319
+ if (typeof limit !== 'number') {
320
+ throw new factory_1.factory.errors.Argument('limit', 'limit must be number');
321
+ }
322
+ if (typeof page !== 'number') {
323
+ throw new factory_1.factory.errors.Argument('page', 'page must be number');
324
+ }
325
+ if (limit < 1 || limit > 20) {
326
+ throw new factory_1.factory.errors.Argument('limit', 'limit must be >=1 and <=20');
327
+ }
328
+ if (page < 1) {
329
+ throw new factory_1.factory.errors.Argument('page', 'page must be >=1');
330
+ }
331
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
332
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
333
+ const paymentService = await chevrePay.createPaymentInstance({
334
+ project,
335
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
336
+ retryableStatusCodes: [
337
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []
338
+ ]
584
339
  });
585
- };
340
+ return paymentService.searchYkknInfoByCheckMovieTicketAction({ limit, page, id, purpose });
341
+ }
586
342
  /**
587
343
  * 対面決済によるチケット発行
588
344
  */
589
- PaymentService.prototype.issueTicketThroughFaceToFace = function (params) {
590
- return __awaiter(this, void 0, void 0, function () {
591
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
592
- return __generator(this, function (_b) {
593
- switch (_b.label) {
594
- case 0:
595
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
596
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
597
- case 1:
598
- chevrePay = _b.sent();
599
- return [4 /*yield*/, chevrePay.createPaymentInstance({
600
- project: project,
601
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
602
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
603
- http_status_1.CONFLICT,
604
- http_status_1.TOO_MANY_REQUESTS
605
- ], false)
606
- })];
607
- case 2:
608
- paymentService = _b.sent();
609
- return [2 /*return*/, paymentService.issueTicketThroughFaceToFace(params)];
610
- }
611
- });
345
+ async issueTicketThroughFaceToFace(params) {
346
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
347
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
348
+ const paymentService = await chevrePay.createPaymentInstance({
349
+ project,
350
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
351
+ retryableStatusCodes: [
352
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
353
+ http_status_1.status.CONFLICT,
354
+ http_status_1.status.TOO_MANY_REQUESTS
355
+ ]
612
356
  });
613
- };
357
+ return paymentService.issueTicketThroughFaceToFace(params);
358
+ }
614
359
  /**
615
360
  * CreditCardIF決済によるチケット発行
616
361
  */
617
- PaymentService.prototype.issueTicketThroughCreditCard = function (params) {
618
- return __awaiter(this, void 0, void 0, function () {
619
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
620
- return __generator(this, function (_b) {
621
- switch (_b.label) {
622
- case 0:
623
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
624
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
625
- case 1:
626
- chevrePay = _b.sent();
627
- return [4 /*yield*/, chevrePay.createPaymentInstance({
628
- project: project,
629
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
630
- retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [], true), [
631
- http_status_1.CONFLICT,
632
- http_status_1.TOO_MANY_REQUESTS
633
- ], false)
634
- })];
635
- case 2:
636
- paymentService = _b.sent();
637
- return [2 /*return*/, paymentService.issueTicketThroughCreditCard(params)];
638
- }
639
- });
362
+ async issueTicketThroughCreditCard(params) {
363
+ const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
364
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
365
+ const paymentService = await chevrePay.createPaymentInstance({
366
+ project,
367
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
368
+ retryableStatusCodes: [
369
+ ...(Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [],
370
+ http_status_1.status.CONFLICT,
371
+ http_status_1.status.TOO_MANY_REQUESTS
372
+ ]
640
373
  });
641
- };
642
- PaymentService.prototype.issueTicketThroughMovieTicketUntilSuccess = function (params, options) {
643
- return __awaiter(this, void 0, void 0, function () {
644
- var object, purpose, giveUpInMS, _a, auth, endpoint, project, seller, disableAutoRetry, chevrePay, paymentService4issueTicket, alreadyGivenUp, giveUpTimeout, result, issueTicketThroughMovieTicketError, error_1;
645
- var _b;
646
- return __generator(this, function (_c) {
647
- switch (_c.label) {
648
- case 0:
649
- object = params.object, purpose = params.purpose;
650
- giveUpInMS = options.giveUpInMS;
651
- if (typeof giveUpInMS !== 'number' || giveUpInMS <= 0) {
652
- throw new factory.errors.Argument('giveUpInMS', 'must be number > 0');
653
- }
654
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
655
- return [4 /*yield*/, (0, index_1.loadChevrePay)({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
656
- case 1:
657
- chevrePay = _c.sent();
658
- return [4 /*yield*/, chevrePay.createPaymentInstance({
659
- project: project,
660
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
661
- retryableStatusCodes: []
662
- })];
663
- case 2:
664
- paymentService4issueTicket = _c.sent();
665
- alreadyGivenUp = false;
666
- giveUpTimeout = setTimeout(function () { alreadyGivenUp = true; }, giveUpInMS);
667
- issueTicketThroughMovieTicketError = new factory.errors.GatewayTimeout('given up');
668
- _c.label = 3;
669
- case 3:
670
- if (!(result === undefined)) return [3 /*break*/, 9];
671
- // 一定時間経過すればあきらめる
672
- if (alreadyGivenUp) {
673
- return [3 /*break*/, 9];
674
- }
675
- _c.label = 4;
676
- case 4:
677
- _c.trys.push([4, 6, , 7]);
678
- return [4 /*yield*/, paymentService4issueTicket.issueTicketThroughMovieTicket({
679
- ticketedInvoice: { issuedThrough: { id: (_b = object.issuedThrough) === null || _b === void 0 ? void 0 : _b.id } },
680
- purpose: purpose
681
- })];
682
- case 5:
683
- result = _c.sent();
684
- clearTimeout(giveUpTimeout);
685
- return [3 /*break*/, 9];
686
- case 6:
687
- error_1 = _c.sent();
688
- issueTicketThroughMovieTicketError = error_1;
689
- return [3 /*break*/, 7];
690
- case 7:
691
- // n秒待機
692
- return [4 /*yield*/, wait(RETRY_ISSUE_TICKET_INTERVAL_MS)];
693
- case 8:
694
- // n秒待機
695
- _c.sent();
696
- console.log('retrying issueTicketThroughMovieTicket...', issueTicketThroughMovieTicketError === null || issueTicketThroughMovieTicketError === void 0 ? void 0 : issueTicketThroughMovieTicketError.name, alreadyGivenUp);
697
- return [3 /*break*/, 3];
698
- case 9:
699
- if (typeof (result === null || result === void 0 ? void 0 : result.ticketToken) === 'string') {
700
- return [2 /*return*/, result];
701
- }
702
- throw issueTicketThroughMovieTicketError;
703
- }
704
- });
374
+ return paymentService.issueTicketThroughCreditCard(params);
375
+ }
376
+ async issueTicketThroughMovieTicketUntilSuccess(params, options) {
377
+ const { object, purpose } = params;
378
+ const { giveUpInMS } = options;
379
+ if (typeof giveUpInMS !== 'number' || giveUpInMS <= 0) {
380
+ throw new factory_1.factory.errors.Argument('giveUpInMS', 'must be number > 0');
381
+ }
382
+ const { auth, endpoint, project, seller, disableAutoRetry } = this.options;
383
+ const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
384
+ const paymentService4issueTicket = await chevrePay.createPaymentInstance({
385
+ project,
386
+ seller: { id: (typeof seller?.id === 'string') ? seller.id : '' },
387
+ retryableStatusCodes: []
705
388
  });
706
- };
707
- PaymentService.prototype.issueTicketThroughCreditCardIfNotExists = function (params, options) {
708
- return __awaiter(this, void 0, void 0, function () {
709
- var object, purpose, checkPaymentMethodId, ticketToken, intervalAfterIssueTicketInMS, issueForcibly, paymentMethodId, automaticallyIssuedTicket;
710
- return __generator(this, function (_a) {
711
- switch (_a.label) {
712
- case 0:
713
- object = params.object, purpose = params.purpose;
714
- checkPaymentMethodId = options.checkPaymentMethodId;
715
- ticketToken = object.ticketToken;
716
- intervalAfterIssueTicketInMS = (typeof options.intervalAfterIssueTicketInMS === 'number'
717
- && options.intervalAfterIssueTicketInMS > MIN_INTERVAL_AFTER_ISSUE_TICKET_MS)
718
- ? options.intervalAfterIssueTicketInMS
719
- : MIN_INTERVAL_AFTER_ISSUE_TICKET_MS;
720
- issueForcibly = false;
721
- paymentMethodId = object.paymentMethodId;
722
- if (checkPaymentMethodId) {
723
- // 承認時は、ticketTokenもpaymentMethodIdも指定がない場合に、自動発行
724
- if ((typeof ticketToken !== 'string' || ticketToken === '')
725
- && (typeof paymentMethodId !== 'string' || paymentMethodId === '')) {
726
- issueForcibly = true;
727
- }
728
- }
729
- else {
730
- // 決済URL発行時は、ticketTokenの指定がない場合に、自動発行
731
- if (typeof ticketToken !== 'string' || ticketToken === '') {
732
- issueForcibly = true;
733
- }
734
- }
735
- if (!issueForcibly) {
736
- return [2 /*return*/, { ticketToken: ticketToken }];
737
- }
738
- return [4 /*yield*/, this.issueTicketThroughCreditCard({
739
- ticketedInvoice: { issuedThrough: { id: object.issuedThrough.id } },
740
- purpose: purpose
741
- })];
742
- case 1:
743
- automaticallyIssuedTicket = _a.sent();
744
- // n秒待機
745
- return [4 /*yield*/, wait(intervalAfterIssueTicketInMS)];
746
- case 2:
747
- // n秒待機
748
- _a.sent();
749
- return [2 /*return*/, automaticallyIssuedTicket];
750
- }
751
- });
389
+ let alreadyGivenUp = false;
390
+ const giveUpTimeout = setTimeout(() => { alreadyGivenUp = true; }, giveUpInMS);
391
+ let result;
392
+ let issueTicketThroughMovieTicketError = new factory_1.factory.errors.GatewayTimeout('given up');
393
+ // n秒おきに状態確認
394
+ while (result === undefined) {
395
+ // 一定時間経過すればあきらめる
396
+ if (alreadyGivenUp) {
397
+ break;
398
+ }
399
+ try {
400
+ result = await paymentService4issueTicket.issueTicketThroughMovieTicket({
401
+ ticketedInvoice: { issuedThrough: { id: object.issuedThrough?.id } },
402
+ purpose
403
+ });
404
+ clearTimeout(giveUpTimeout);
405
+ break;
406
+ }
407
+ catch (error) {
408
+ issueTicketThroughMovieTicketError = error;
409
+ }
410
+ // n秒待機
411
+ await wait(RETRY_ISSUE_TICKET_INTERVAL_MS);
412
+ console.log('retrying issueTicketThroughMovieTicket...', issueTicketThroughMovieTicketError?.name, alreadyGivenUp);
413
+ }
414
+ if (typeof result?.ticketToken === 'string') {
415
+ return result;
416
+ }
417
+ throw issueTicketThroughMovieTicketError;
418
+ }
419
+ async issueTicketThroughCreditCardIfNotExists(params, options) {
420
+ const { object, purpose } = params;
421
+ const { checkPaymentMethodId } = options;
422
+ const ticketToken = object.ticketToken;
423
+ const intervalAfterIssueTicketInMS = (typeof options.intervalAfterIssueTicketInMS === 'number'
424
+ && options.intervalAfterIssueTicketInMS > MIN_INTERVAL_AFTER_ISSUE_TICKET_MS)
425
+ ? options.intervalAfterIssueTicketInMS
426
+ : MIN_INTERVAL_AFTER_ISSUE_TICKET_MS;
427
+ let issueForcibly = false;
428
+ const paymentMethodId = object.paymentMethodId;
429
+ if (checkPaymentMethodId) {
430
+ // 承認時は、ticketTokenもpaymentMethodIdも指定がない場合に、自動発行
431
+ if ((typeof ticketToken !== 'string' || ticketToken === '')
432
+ && (typeof paymentMethodId !== 'string' || paymentMethodId === '')) {
433
+ issueForcibly = true;
434
+ }
435
+ }
436
+ else {
437
+ // 決済URL発行時は、ticketTokenの指定がない場合に、自動発行
438
+ if (typeof ticketToken !== 'string' || ticketToken === '') {
439
+ issueForcibly = true;
440
+ }
441
+ }
442
+ if (!issueForcibly) {
443
+ return { ticketToken };
444
+ }
445
+ const automaticallyIssuedTicket = await this.issueTicketThroughCreditCard({
446
+ ticketedInvoice: { issuedThrough: { id: object.issuedThrough.id } },
447
+ purpose
752
448
  });
753
- };
754
- return PaymentService;
755
- }(service_1.Service));
449
+ // n秒待機
450
+ await wait(intervalAfterIssueTicketInMS);
451
+ return automaticallyIssuedTicket;
452
+ }
453
+ }
756
454
  exports.PaymentService = PaymentService;