@chevre/domain 25.2.0-alpha.5 → 25.2.0-alpha.50

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 (202) hide show
  1. package/lib/chevre/eventEmitter/task.d.ts +2 -1
  2. package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
  3. package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
  4. package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
  5. package/lib/chevre/repo/action/acceptPay.js +47 -19
  6. package/lib/chevre/repo/action/actionProcess.js +57 -57
  7. package/lib/chevre/repo/action.d.ts +16 -9
  8. package/lib/chevre/repo/action.js +99 -180
  9. package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
  10. package/lib/chevre/repo/aggregateOffer.js +16 -125
  11. package/lib/chevre/repo/asyncAction.d.ts +64 -0
  12. package/lib/chevre/repo/asyncAction.js +178 -0
  13. package/lib/chevre/repo/concurrentLock.d.ts +3 -1
  14. package/lib/chevre/repo/creativeWork.d.ts +2 -3
  15. package/lib/chevre/repo/credentials.d.ts +2 -1
  16. package/lib/chevre/repo/customerType.d.ts +2 -3
  17. package/lib/chevre/repo/event.d.ts +10 -11
  18. package/lib/chevre/repo/eventOffer.d.ts +4 -5
  19. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
  20. package/lib/chevre/repo/eventSeries.d.ts +4 -5
  21. package/lib/chevre/repo/message.d.ts +1 -1
  22. package/lib/chevre/repo/message.js +1 -1
  23. package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
  24. package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +11 -0
  25. package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
  26. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  27. package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
  28. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
  29. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  30. package/lib/chevre/repo/note.d.ts +3 -4
  31. package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
  32. package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
  33. package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
  34. package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
  35. package/lib/chevre/repo/offerCatalog.d.ts +2 -3
  36. package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
  37. package/lib/chevre/repo/order.d.ts +2 -0
  38. package/lib/chevre/repo/order.js +14 -14
  39. package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
  40. package/lib/chevre/repo/orderInTransaction.js +181 -3
  41. package/lib/chevre/repo/passport.d.ts +2 -1
  42. package/lib/chevre/repo/person.d.ts +0 -15
  43. package/lib/chevre/repo/person.js +122 -108
  44. package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
  45. package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
  46. package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
  47. package/lib/chevre/repo/place/seat.d.ts +4 -5
  48. package/lib/chevre/repo/place/section.d.ts +3 -4
  49. package/lib/chevre/repo/priceSpecification.d.ts +4 -4
  50. package/lib/chevre/repo/product.d.ts +3 -4
  51. package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
  52. package/lib/chevre/repo/rateLimit/offer.js +0 -12
  53. package/lib/chevre/repo/reservation.d.ts +2 -3
  54. package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
  55. package/lib/chevre/repo/stockHolder.d.ts +1 -1
  56. package/lib/chevre/repo/stockHolder.js +0 -146
  57. package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
  58. package/lib/chevre/repo/transaction/placeOrder.js +43 -83
  59. package/lib/chevre/repo/transaction.d.ts +2 -2
  60. package/lib/chevre/repo/transactionNumberCounter.js +0 -34
  61. package/lib/chevre/repo/transactionProcess.d.ts +2 -1
  62. package/lib/chevre/repo/transactionProcess.js +0 -13
  63. package/lib/chevre/repository.d.ts +5 -0
  64. package/lib/chevre/repository.js +12 -1
  65. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  66. package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
  67. package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
  68. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  69. package/lib/chevre/service/asyncAction.d.ts +16 -0
  70. package/lib/chevre/service/asyncAction.js +36 -0
  71. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
  72. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
  73. package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
  74. package/lib/chevre/service/asyncActionHandler.js +89 -0
  75. package/lib/chevre/service/notification/factory.d.ts +2 -4
  76. package/lib/chevre/service/notification/factory.js +26 -24
  77. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +11 -5
  78. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +11 -3
  79. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
  80. package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
  81. package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
  82. package/lib/chevre/service/offer/event/authorize.js +2 -2
  83. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
  84. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
  85. package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
  86. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
  87. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
  88. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
  89. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
  90. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
  91. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +22 -9
  92. package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
  93. package/lib/chevre/service/order/deleteOrder.js +8 -1
  94. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
  95. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
  96. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
  97. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
  98. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
  99. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
  100. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
  101. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
  102. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
  103. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +4 -2
  104. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
  105. package/lib/chevre/service/order/payOrder.d.ts +2 -0
  106. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
  107. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
  108. package/lib/chevre/service/order/placeOrder/factory.js +3 -21
  109. package/lib/chevre/service/order/placeOrder.d.ts +4 -5
  110. package/lib/chevre/service/order/placeOrder.js +20 -31
  111. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
  112. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
  113. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
  114. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
  115. package/lib/chevre/service/payment/any/authorize.js +13 -37
  116. package/lib/chevre/service/payment/any/factory.d.ts +7 -7
  117. package/lib/chevre/service/payment/any/factory.js +19 -22
  118. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
  119. package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
  120. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
  121. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
  122. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
  123. package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
  124. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
  125. package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
  126. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  127. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
  128. package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
  129. package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
  130. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
  131. package/lib/chevre/service/reserve/searchByOrder.js +2 -6
  132. package/lib/chevre/service/reserve.d.ts +2 -2
  133. package/lib/chevre/service/reserve.js +3 -3
  134. package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
  135. package/lib/chevre/service/task/aggregateOffers.js +2 -1
  136. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
  137. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
  138. package/lib/chevre/service/task/authorizePayment.js +3 -1
  139. package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
  140. package/lib/chevre/service/task/cancelReservation.js +2 -1
  141. package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
  142. package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
  143. package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
  144. package/lib/chevre/service/task/deleteTransaction.js +2 -1
  145. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
  146. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
  147. package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
  148. package/lib/chevre/service/task/onEventChanged.js +2 -1
  149. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
  150. package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
  151. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +1 -1
  152. package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
  153. package/lib/chevre/service/task/onResourceUpdated.js +2 -1
  154. package/lib/chevre/service/task/placeOrder.d.ts +2 -2
  155. package/lib/chevre/service/task/placeOrder.js +6 -3
  156. package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
  157. package/lib/chevre/service/task/refund.d.ts +2 -2
  158. package/lib/chevre/service/task/refund.js +4 -10
  159. package/lib/chevre/service/task/reserve.d.ts +2 -2
  160. package/lib/chevre/service/task/reserve.js +2 -1
  161. package/lib/chevre/service/task/returnOrder.d.ts +2 -2
  162. package/lib/chevre/service/task/returnOrder.js +2 -1
  163. package/lib/chevre/service/task/sendOrder.d.ts +2 -2
  164. package/lib/chevre/service/task/sendOrder.js +2 -1
  165. package/lib/chevre/service/task/voidPayTransaction.js +3 -7
  166. package/lib/chevre/service/task/voidPayment.d.ts +2 -2
  167. package/lib/chevre/service/task/voidPayment.js +2 -1
  168. package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
  169. package/lib/chevre/service/taskHandler.d.ts +2 -2
  170. package/lib/chevre/service/taskHandler.js +36 -37
  171. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
  172. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
  173. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
  174. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
  175. package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
  176. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
  177. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
  178. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
  179. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
  180. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +35 -2
  181. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +15 -11
  182. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
  183. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
  184. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +53 -32
  185. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
  186. package/lib/chevre/service/transaction/placeOrder/confirm.js +33 -78
  187. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
  188. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
  189. package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
  190. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
  191. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
  192. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
  193. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
  194. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  195. package/lib/chevre/service.d.ts +4 -0
  196. package/lib/chevre/service.js +12 -1
  197. package/lib/chevre/taskSettings.d.ts +1 -3
  198. package/package.json +8 -11
  199. package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
  200. package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
  201. package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
  202. package/lib/chevre/service/reserve/findReservations.js +0 -61
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PersonRepo = void 0;
4
- // import { fromEnv } from '@aws-sdk/credential-providers';
5
- const google_libphonenumber_1 = require("google-libphonenumber");
6
4
  const factory_1 = require("../factory");
7
5
  /**
8
6
  * 会員リポジトリ
@@ -92,73 +90,81 @@ class PersonRepo {
92
90
  }
93
91
  return person;
94
92
  }
95
- static PROFILE2ATTRIBUTE(params) {
96
- let formatedPhoneNumber;
97
- if (typeof params.telephone === 'string' && params.telephone.length > 0) {
98
- try {
99
- const phoneUtil = google_libphonenumber_1.PhoneNumberUtil.getInstance();
100
- const phoneNumber = phoneUtil.parse(params.telephone);
101
- /* istanbul ignore if */
102
- if (!phoneUtil.isValidNumber(phoneNumber)) {
103
- throw new factory_1.factory.errors.Argument('telephone', 'Invalid phone number');
104
- }
105
- formatedPhoneNumber = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.E164);
106
- }
107
- catch (_error) {
108
- throw new factory_1.factory.errors.Argument('telephone', 'Invalid phone number');
109
- }
110
- }
111
- const userAttributes = [];
112
- if (typeof params.givenName === 'string') {
113
- userAttributes.push({
114
- Name: 'given_name',
115
- Value: params.givenName
116
- });
117
- }
118
- if (typeof params.familyName === 'string') {
119
- userAttributes.push({
120
- Name: 'family_name',
121
- Value: params.familyName
122
- });
123
- }
124
- if (typeof params.email === 'string') {
125
- userAttributes.push({
126
- Name: 'email',
127
- Value: params.email
128
- });
129
- }
130
- if (typeof formatedPhoneNumber === 'string') {
131
- userAttributes.push({
132
- Name: 'phone_number',
133
- Value: formatedPhoneNumber
134
- });
135
- }
136
- if (Array.isArray(params.additionalProperty)) {
137
- userAttributes.push(...params.additionalProperty.map((a) => {
138
- let userAttributesValue = a.value;
139
- // custom:telephoneに関してもtelephoneと同様のバリデーションを追加
140
- if (a.name === 'custom:telephone') {
141
- try {
142
- const phoneUtil = google_libphonenumber_1.PhoneNumberUtil.getInstance();
143
- const phoneNumber = phoneUtil.parse(String(a.value));
144
- /* istanbul ignore if */
145
- if (!phoneUtil.isValidNumber(phoneNumber)) {
146
- throw new factory_1.factory.errors.Argument('custom:telephone', 'Invalid phone number');
147
- }
148
- userAttributesValue = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.E164);
149
- }
150
- catch (_error) {
151
- throw new factory_1.factory.errors.Argument('custome:telephone', 'Invalid phone number');
152
- }
153
- }
154
- return {
155
- Name: a.name,
156
- Value: userAttributesValue
157
- };
158
- }));
159
- }
160
- return userAttributes;
161
- }
93
+ // public static PROFILE2ATTRIBUTE(params: factory.person.IProfile): AttributeType[] {
94
+ // let formatedPhoneNumber: string | undefined;
95
+ // if (typeof params.telephone === 'string' && params.telephone.length > 0) {
96
+ // try {
97
+ // // const phoneUtil = PhoneNumberUtil.getInstance();
98
+ // // const phoneNumber = phoneUtil.parse(params.telephone);
99
+ // // /* istanbul ignore if */
100
+ // // if (!phoneUtil.isValidNumber(phoneNumber)) {
101
+ // // throw new factory.errors.Argument('telephone', 'Invalid phone number');
102
+ // // }
103
+ // // formatedPhoneNumber = phoneUtil.format(phoneNumber, PhoneNumberFormat.E164);
104
+ // const phoneNumber = parsePhoneNumberFromString(params.telephone);
105
+ // if (phoneNumber === undefined || !phoneNumber.isValid()) {
106
+ // throw new factory.errors.Argument('telephone', 'Invalid phone number');
107
+ // }
108
+ // formatedPhoneNumber = phoneNumber.format('E.164');
109
+ // } catch (_error) {
110
+ // throw new factory.errors.Argument('telephone', 'Invalid phone number');
111
+ // }
112
+ // }
113
+ // const userAttributes: AttributeType[] = [];
114
+ // if (typeof params.givenName === 'string') {
115
+ // userAttributes.push({
116
+ // Name: 'given_name',
117
+ // Value: params.givenName
118
+ // });
119
+ // }
120
+ // if (typeof params.familyName === 'string') {
121
+ // userAttributes.push({
122
+ // Name: 'family_name',
123
+ // Value: params.familyName
124
+ // });
125
+ // }
126
+ // if (typeof params.email === 'string') {
127
+ // userAttributes.push({
128
+ // Name: 'email',
129
+ // Value: params.email
130
+ // });
131
+ // }
132
+ // if (typeof formatedPhoneNumber === 'string') {
133
+ // userAttributes.push({
134
+ // Name: 'phone_number',
135
+ // Value: formatedPhoneNumber
136
+ // });
137
+ // }
138
+ // if (Array.isArray(params.additionalProperty)) {
139
+ // userAttributes.push(...params.additionalProperty.map((a) => {
140
+ // let userAttributesValue: string = a.value;
141
+ // // custom:telephoneに関してもtelephoneと同様のバリデーションを追加
142
+ // if (a.name === 'custom:telephone') {
143
+ // try {
144
+ // // const phoneUtil = PhoneNumberUtil.getInstance();
145
+ // // const phoneNumber = phoneUtil.parse(String(a.value));
146
+ // // /* istanbul ignore if */
147
+ // // if (!phoneUtil.isValidNumber(phoneNumber)) {
148
+ // // throw new factory.errors.Argument('custom:telephone', 'Invalid phone number');
149
+ // // }
150
+ // // userAttributesValue = phoneUtil.format(phoneNumber, PhoneNumberFormat.E164);
151
+ // const phoneNumber = parsePhoneNumberFromString(String(a.value));
152
+ // if (phoneNumber === undefined || !phoneNumber.isValid()) {
153
+ // throw new factory.errors.Argument('telephone', 'Invalid phone number');
154
+ // }
155
+ // userAttributesValue = phoneNumber.format('E.164');
156
+ // } catch (_error) {
157
+ // throw new factory.errors.Argument('custome:telephone', 'Invalid phone number');
158
+ // }
159
+ // }
160
+ // return {
161
+ // Name: a.name,
162
+ // Value: userAttributesValue
163
+ // };
164
+ // }));
165
+ // }
166
+ // return userAttributes;
167
+ // }
162
168
  /**
163
169
  * 管理者権限でユーザー属性を取得する
164
170
  */
@@ -177,26 +183,30 @@ class PersonRepo {
177
183
  });
178
184
  });
179
185
  }
180
- /**
181
- * 管理者権限でプロフィール更新
182
- */
183
- async updateProfile(params) {
184
- return new Promise((resolve, reject) => {
185
- const userAttributes = PersonRepo.PROFILE2ATTRIBUTE(params.profile);
186
- this.cognitoIdentityServiceProvider.adminUpdateUserAttributes({
187
- UserPoolId: this.userPoolId,
188
- Username: params.username,
189
- UserAttributes: userAttributes
190
- }, (err) => {
191
- if (err instanceof Error) {
192
- reject(new factory_1.factory.errors.Argument('profile', err.message));
193
- }
194
- else {
195
- resolve();
196
- }
197
- });
198
- });
199
- }
186
+ // /**
187
+ // * 管理者権限でプロフィール更新
188
+ // */
189
+ // public async updateProfile(params: {
190
+ // username: string;
191
+ // profile: factory.person.IProfile;
192
+ // }): Promise<void> {
193
+ // return new Promise<void>((resolve, reject) => {
194
+ // const userAttributes = PersonRepo.PROFILE2ATTRIBUTE(params.profile);
195
+ // this.cognitoIdentityServiceProvider.adminUpdateUserAttributes(
196
+ // {
197
+ // UserPoolId: this.userPoolId,
198
+ // Username: params.username,
199
+ // UserAttributes: userAttributes
200
+ // },
201
+ // (err) => {
202
+ // if (err instanceof Error) {
203
+ // reject(new factory.errors.Argument('profile', err.message));
204
+ // } else {
205
+ // resolve();
206
+ // }
207
+ // });
208
+ // });
209
+ // }
200
210
  /**
201
211
  * 管理者権限でsubでユーザーを検索する
202
212
  */
@@ -249,25 +259,29 @@ class PersonRepo {
249
259
  });
250
260
  });
251
261
  }
252
- /**
253
- * 会員プロフィール更新
254
- */
255
- async updateProfileByAccessToken(params) {
256
- return new Promise((resolve, reject) => {
257
- const userAttributes = PersonRepo.PROFILE2ATTRIBUTE(params.profile);
258
- this.cognitoIdentityServiceProvider.updateUserAttributes({
259
- AccessToken: params.accessToken,
260
- UserAttributes: userAttributes
261
- }, (err) => {
262
- if (err instanceof Error) {
263
- reject(new factory_1.factory.errors.Argument('profile', err.message));
264
- }
265
- else {
266
- resolve();
267
- }
268
- });
269
- });
270
- }
262
+ // /**
263
+ // * 会員プロフィール更新
264
+ // */
265
+ // public async updateProfileByAccessToken(params: {
266
+ // accessToken: string;
267
+ // profile: factory.person.IProfile;
268
+ // }): Promise<void> {
269
+ // return new Promise<void>((resolve, reject) => {
270
+ // const userAttributes = PersonRepo.PROFILE2ATTRIBUTE(params.profile);
271
+ // this.cognitoIdentityServiceProvider.updateUserAttributes(
272
+ // {
273
+ // AccessToken: params.accessToken,
274
+ // UserAttributes: userAttributes
275
+ // },
276
+ // (err) => {
277
+ // if (err instanceof Error) {
278
+ // reject(new factory.errors.Argument('profile', err.message));
279
+ // } else {
280
+ // resolve();
281
+ // }
282
+ // });
283
+ // });
284
+ // }
271
285
  /**
272
286
  * 削除
273
287
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection } from 'mongoose';
1
+ import { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  /**
5
4
  * ゲートを操作する組織
@@ -37,12 +36,12 @@ export declare class EntranceGateRepo {
37
36
  addEntranceGatesByIdentifierIfNotExist(params: {
38
37
  $set: ICreatingEntranceGate;
39
38
  }[], options: IUpdateOptions): Promise<{
40
- bulkWriteResult?: BulkWriteResult;
39
+ bulkWriteResult?: mongo.BulkWriteResult;
41
40
  }>;
42
41
  updateEntranceGatesByIdentifier(params: {
43
42
  $set: ICreatingEntranceGate;
44
43
  }[], options: IUpdateOptions): Promise<{
45
- bulkWriteResult?: BulkWriteResult;
44
+ bulkWriteResult?: mongo.BulkWriteResult;
46
45
  }>;
47
46
  deleteEntranceGatesByIdentifier(params: {
48
47
  /**
@@ -50,7 +49,7 @@ export declare class EntranceGateRepo {
50
49
  */
51
50
  identifier: string;
52
51
  }[], options: IUpdateOptions): Promise<{
53
- bulkWriteResult?: BulkWriteResult;
52
+ bulkWriteResult?: mongo.BulkWriteResult;
54
53
  }>;
55
54
  private createMatchStages;
56
55
  }
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  import { IDocType } from '../mongoose/schemas/civicStructure';
5
4
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -49,7 +48,7 @@ export declare class MovieTheaterRepo {
49
48
  [key in keyof IUpsertingMovieTheater]?: 1;
50
49
  };
51
50
  }[], options: IUpsertOptions): Promise<{
52
- bulkWriteResult?: BulkWriteResult;
51
+ bulkWriteResult?: mongo.BulkWriteResult;
53
52
  /**
54
53
  * 追加あるいは編集された施設
55
54
  */
@@ -86,7 +85,7 @@ export declare class MovieTheaterRepo {
86
85
  */
87
86
  id: string;
88
87
  };
89
- }): Promise<import("mongodb").DeleteResult>;
88
+ }): Promise<mongo.DeleteResult>;
90
89
  /**
91
90
  * プロジェクトに属する施設を全削除
92
91
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, PipelineStage } from 'mongoose';
1
+ import type { Connection, FilterQuery, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  import { IDocType } from '../mongoose/schemas/place';
5
4
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -66,7 +65,7 @@ export declare class ScreeningRoomRepo {
66
65
  [key in keyof IUpsertingRoom]?: 1;
67
66
  };
68
67
  }[], options: IUpsertOptions): Promise<{
69
- bulkWriteResult?: BulkWriteResult;
68
+ bulkWriteResult?: mongo.BulkWriteResult;
70
69
  }>;
71
70
  deleteRoomByBranchCode(screeningRoom: {
72
71
  /**
@@ -84,7 +83,7 @@ export declare class ScreeningRoomRepo {
84
83
  */
85
84
  id: string;
86
85
  };
87
- }): Promise<import("mongodb").DeleteResult>;
86
+ }): Promise<mongo.DeleteResult>;
88
87
  searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>[]>;
89
88
  findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
90
89
  /**
@@ -116,7 +115,7 @@ export declare class ScreeningRoomRepo {
116
115
  */
117
116
  id: string;
118
117
  };
119
- }): Promise<import("mongodb").DeleteResult>;
118
+ }): Promise<mongo.DeleteResult>;
120
119
  /**
121
120
  * プロジェクトに属するルームを全削除
122
121
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { AnyExpression, Connection, PipelineStage } from 'mongoose';
1
+ import type { AnyExpression, Connection, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  type IMatchStage = PipelineStage.Match;
5
4
  type ICreatingSeat = Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'name' | 'maximumAttendeeCapacity' | 'seatingType'>;
@@ -45,7 +44,7 @@ export declare class SeatRepo {
45
44
  addSeatsByBranchCodeIfNotExist(params: {
46
45
  $set: ICreatingSeat;
47
46
  }[], options: IUpdateOptions): Promise<{
48
- bulkWriteResult?: BulkWriteResult;
47
+ bulkWriteResult?: mongo.BulkWriteResult;
49
48
  }>;
50
49
  /**
51
50
  * コードをキーにして冪等編集
@@ -56,7 +55,7 @@ export declare class SeatRepo {
56
55
  [key in keyof ICreatingSeat]?: 1;
57
56
  };
58
57
  }[], options: IUpdateOptions): Promise<{
59
- bulkWriteResult?: BulkWriteResult;
58
+ bulkWriteResult?: mongo.BulkWriteResult;
60
59
  }>;
61
60
  updateSeatByBranchCode(seat: ICreatingSeat, $unset: any, // eslint-disable-line @typescript-eslint/no-explicit-any
62
61
  options: IUpdateOptions): Promise<IUpdateSeatResult>;
@@ -166,7 +165,7 @@ export declare class SeatRepo {
166
165
  */
167
166
  branchCode: string;
168
167
  }[], options: IUpdateOptions): Promise<{
169
- bulkWriteResult?: BulkWriteResult;
168
+ bulkWriteResult?: mongo.BulkWriteResult;
170
169
  }>;
171
170
  deleteSeatByBranchCode(seat: {
172
171
  /**
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, PipelineStage } from 'mongoose';
1
+ import type { Connection, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
5
4
  type ICreatingSection = Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>;
@@ -57,7 +56,7 @@ export declare class SectionRepo {
57
56
  addSeatSectionsByBranchCodeIfNotExist(params: {
58
57
  $set: IUpsertingSeatSection;
59
58
  }[], options: IUpsertOptions): Promise<{
60
- bulkWriteResult?: BulkWriteResult;
59
+ bulkWriteResult?: mongo.BulkWriteResult;
61
60
  }>;
62
61
  /**
63
62
  * コードをキーにして冪等編集
@@ -65,7 +64,7 @@ export declare class SectionRepo {
65
64
  updateSeatSectionsByBranchCode(params: {
66
65
  $set: IUpsertingSeatSection;
67
66
  }[], options: IUpsertOptions): Promise<{
68
- bulkWriteResult?: BulkWriteResult;
67
+ bulkWriteResult?: mongo.BulkWriteResult;
69
68
  }>;
70
69
  migrateSectionIdentifier(screeningRoomSection: {
71
70
  project: {
@@ -37,8 +37,8 @@ export declare class PriceSpecificationRepo {
37
37
  };
38
38
  }): Promise<void>;
39
39
  getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
40
- project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
41
40
  name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
41
+ project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
42
42
  price: number;
43
43
  priceCurrency: factory.priceCurrency;
44
44
  typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
@@ -53,8 +53,8 @@ export declare class PriceSpecificationRepo {
53
53
  } & {
54
54
  __v: number;
55
55
  }) | ({
56
- project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
57
56
  name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
57
+ project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
58
58
  price: number;
59
59
  priceCurrency: factory.priceCurrency;
60
60
  typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
@@ -70,8 +70,8 @@ export declare class PriceSpecificationRepo {
70
70
  } & {
71
71
  __v: number;
72
72
  })), import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
73
- project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
74
73
  name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
74
+ project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
75
75
  price: number;
76
76
  priceCurrency: factory.priceCurrency;
77
77
  typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
@@ -86,8 +86,8 @@ export declare class PriceSpecificationRepo {
86
86
  } & {
87
87
  __v: number;
88
88
  }) | ({
89
- project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
90
89
  name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
90
+ project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
91
91
  price: number;
92
92
  priceCurrency: factory.priceCurrency;
93
93
  typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, Types } from 'mongoose';
1
+ import { Connection, FilterQuery, Types, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType, IDocTypeAsProduct } from './mongoose/schemas/product';
5
4
  type IKeyOfProjection = keyof factory.product.IProduct | 'hasOfferCatalog.id';
@@ -65,7 +64,7 @@ export declare class ProductRepo {
65
64
  };
66
65
  $unset?: Partial<Record<IUnsetKey, 1>>;
67
66
  }[]): Promise<{
68
- bulkWriteResult?: BulkWriteResult;
67
+ bulkWriteResult?: mongo.BulkWriteResult;
69
68
  modifiedProducts?: {
70
69
  id: string;
71
70
  }[];
@@ -80,7 +79,7 @@ export declare class ProductRepo {
80
79
  hasOfferCatalog: {
81
80
  id: string;
82
81
  };
83
- }): Promise<import("mongodb").DeleteResult>;
82
+ }): Promise<mongo.DeleteResult>;
84
83
  /**
85
84
  * プロジェクト指定で削除する
86
85
  */
@@ -1,5 +1,6 @@
1
- import { RedisClientType } from 'redis';
1
+ import type { createClient } from 'redis';
2
2
  import { factory } from '../../factory';
3
+ type RedisClientType = ReturnType<typeof createClient>;
3
4
  /**
4
5
  * レート制限キーインターフェース
5
6
  */
@@ -34,3 +35,4 @@ export declare class OfferRateLimitRepo {
34
35
  unlock(params: IRateLimitKey): Promise<void>;
35
36
  getHolder(ratelimitKey: IRateLimitKey): Promise<string | null>;
36
37
  }
38
+ export {};
@@ -28,7 +28,6 @@ class OfferRateLimitRepo {
28
28
  * ロックする
29
29
  * discontinue array params(2025-05-26~)
30
30
  */
31
- // public async lock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
32
31
  async lock(params) {
33
32
  const key = OfferRateLimitRepo.createKey(params);
34
33
  const value = params.reservationNumber;
@@ -50,18 +49,8 @@ class OfferRateLimitRepo {
50
49
  catch (_error) {
51
50
  throw new factory_1.factory.errors.RateLimitExceeded('Offer');
52
51
  }
53
- // const multi = this.redisClient.multi();
54
- // multi.setNX(key, value)
55
- // .expire(key, ttl);
56
- // const results = await multi.exec();
57
- // if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
58
- // return;
59
- // } else {
60
- // throw new factory.errors.RateLimitExceeded('Offer');
61
- // }
62
52
  }
63
53
  // discontinue array params(2025-05-26~)
64
- // public async unlock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
65
54
  async unlock(params) {
66
55
  const key = OfferRateLimitRepo.createKey(params);
67
56
  // reimplement using concurrentLockRepo(2025-05-27~)
@@ -69,7 +58,6 @@ class OfferRateLimitRepo {
69
58
  about: { identifier: key, typeOf: 'Thing' },
70
59
  audience: { identifier: params.reservationNumber, typeOf: 'Audience' }
71
60
  });
72
- // await this.redisClient.del(key);
73
61
  }
74
62
  async getHolder(ratelimitKey) {
75
63
  const key = OfferRateLimitRepo.createKey(ratelimitKey);
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, UpdateWriteOpResult } from 'mongoose';
1
+ import type { Connection, UpdateWriteOpResult, mongo } from 'mongoose';
3
2
  import { IDocType } from './mongoose/schemas/reservation';
4
3
  import { factory } from '../factory';
5
4
  export interface IUpdatePartiallyParams {
@@ -77,7 +76,7 @@ export declare class ReservationRepo {
77
76
  reservationNumber: string;
78
77
  underName?: factory.reservation.IUnderName;
79
78
  broker?: factory.reservation.IBroker;
80
- }): Promise<BulkWriteResult | undefined>;
79
+ }): Promise<mongo.BulkWriteResult | undefined>;
81
80
  /**
82
81
  * 予約取消
83
82
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection } from 'mongoose';
1
+ import { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type IMakesOffer = Pick<factory.seller.IMakesOffer, 'typeOf' | 'availableAtOrFrom' | 'eligibleTransactionDuration'>;
5
4
  type IMakesOfferAsFindResult = IMakesOffer & {
@@ -51,7 +50,7 @@ export declare class SellerMakesOfferRepo {
51
50
  id: string;
52
51
  };
53
52
  }[];
54
- }): Promise<BulkWriteResult | undefined>;
53
+ }): Promise<mongo.BulkWriteResult | undefined>;
55
54
  /**
56
55
  * 販売者とアプリケーションに対してオファーが存在すれば削除する
57
56
  */
@@ -67,6 +66,6 @@ export declare class SellerMakesOfferRepo {
67
66
  id: string;
68
67
  };
69
68
  }[];
70
- }): Promise<BulkWriteResult | undefined>;
69
+ }): Promise<mongo.BulkWriteResult | undefined>;
71
70
  }
72
71
  export {};
@@ -16,7 +16,7 @@ export declare class StockHolderRepo implements AbstractStockHolderRepo {
16
16
  /**
17
17
  * 座席をロックする
18
18
  */
19
- lock(lockKey: ILockKey & {}): Promise<void>;
19
+ lock(lockKey: ILockKey): Promise<void>;
20
20
  /**
21
21
  * 座席ロックを解除する
22
22
  */