@chevre/domain 25.2.0-alpha.8 → 26.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/task.d.ts +2 -1
- package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/adminTask.d.ts +37 -0
- package/lib/chevre/repo/adminTask.js +163 -0
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/aggregateTask.d.ts +37 -0
- package/lib/chevre/repo/aggregateTask.js +136 -0
- package/lib/chevre/repo/asyncAction.d.ts +69 -0
- package/lib/chevre/repo/asyncAction.js +237 -0
- package/lib/chevre/repo/concurrentLock.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- package/lib/chevre/repo/credentials.d.ts +2 -1
- package/lib/chevre/repo/customerType.d.ts +2 -3
- package/lib/chevre/repo/event.d.ts +10 -11
- package/lib/chevre/repo/eventOffer.d.ts +4 -5
- package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
- package/lib/chevre/repo/eventSeries.d.ts +4 -5
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +57 -57
- package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +13 -0
- package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.d.ts +16 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/note.d.ts +3 -4
- package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
- package/lib/chevre/repo/offerCatalog.d.ts +2 -3
- package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
- package/lib/chevre/repo/order.d.ts +2 -0
- package/lib/chevre/repo/order.js +14 -14
- package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
- package/lib/chevre/repo/orderInTransaction.js +181 -3
- package/lib/chevre/repo/passport.d.ts +2 -1
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
- package/lib/chevre/repo/place/seat.d.ts +4 -5
- package/lib/chevre/repo/place/section.d.ts +3 -4
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- package/lib/chevre/repo/scheduledTask.d.ts +90 -0
- package/lib/chevre/repo/scheduledTask.js +223 -0
- package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +0 -146
- package/lib/chevre/repo/task.d.ts +30 -71
- package/lib/chevre/repo/task.js +59 -345
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transactionNumberCounter.js +0 -34
- package/lib/chevre/repo/transactionProcess.d.ts +2 -1
- package/lib/chevre/repo/transactionProcess.js +0 -13
- package/lib/chevre/repository.d.ts +20 -0
- package/lib/chevre/repository.js +46 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/system.d.ts +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
- package/lib/chevre/service/asyncAction.d.ts +16 -0
- package/lib/chevre/service/asyncAction.js +36 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
- package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
- package/lib/chevre/service/asyncActionHandler.js +89 -0
- package/lib/chevre/service/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +12 -6
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +20 -9
- package/lib/chevre/service/offer/onEventChanged.js +2 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
- package/lib/chevre/service/order/placeOrder/factory.js +3 -21
- package/lib/chevre/service/order/placeOrder.d.ts +4 -5
- package/lib/chevre/service/order/placeOrder.js +20 -31
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
- package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/reserve.d.ts +2 -2
- package/lib/chevre/service/reserve.js +3 -3
- package/lib/chevre/service/scheduledTask.d.ts +11 -0
- package/lib/chevre/service/scheduledTask.js +40 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
- package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
- package/lib/chevre/service/scheduledTaskHandler.js +66 -0
- package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelReservation.js +2 -1
- package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -8
- package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
- package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +10 -9
- package/lib/chevre/service/task/placeOrder.d.ts +2 -2
- package/lib/chevre/service/task/placeOrder.js +6 -3
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/refund.d.ts +2 -2
- package/lib/chevre/service/task/refund.js +4 -10
- package/lib/chevre/service/task/reserve.d.ts +2 -2
- package/lib/chevre/service/task/reserve.js +2 -1
- package/lib/chevre/service/task/returnOrder.d.ts +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/sendOrder.d.ts +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/task/voidPayment.d.ts +2 -2
- package/lib/chevre/service/task/voidPayment.js +2 -1
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
- package/lib/chevre/service/taskHandler.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +36 -37
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +32 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service.d.ts +8 -0
- package/lib/chevre/service.js +23 -1
- package/lib/chevre/taskSettings.d.ts +3 -4
- package/package.json +8 -11
- package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
- package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
- package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
- package/lib/chevre/service/reserve/findReservations.js +0 -61
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
import { IModel, IDocType } from './mongoose/schemas/asyncAction';
|
|
4
|
+
import type { IExecutableTask } from '../taskSettings';
|
|
5
|
+
type ISavingTask = Pick<factory.task.IAttributes<factory.taskName>, 'data' | 'executionResults' | 'name' | 'project' | 'runsAt' | 'status'> & {
|
|
6
|
+
expires: Date;
|
|
7
|
+
};
|
|
8
|
+
export type IExecutableAsyncAction = Pick<IExecutableTask<factory.taskName>, 'data' | 'expires' | 'id' | 'name' | 'project' | 'runsAt' | 'status'>;
|
|
9
|
+
type IKeyOfProjection = keyof factory.task.ITask<factory.taskName> | 'expires';
|
|
10
|
+
type IFindParams = Pick<factory.task.ISearchConditions, 'id' | 'name' | 'project' | 'runsFrom' | 'runsThrough' | 'status' | 'limit' | 'page' | 'sort'>;
|
|
11
|
+
/**
|
|
12
|
+
* 非同期アクションリポジトリ
|
|
13
|
+
*/
|
|
14
|
+
export declare class AsyncActionRepo {
|
|
15
|
+
readonly asyncActionModel: IModel;
|
|
16
|
+
constructor(connection: Connection);
|
|
17
|
+
static CREATE_MONGO_CONDITIONS(params: Pick<IFindParams, 'id' | 'name' | 'project' | 'runsFrom' | 'runsThrough' | 'status'>): FilterQuery<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask>[];
|
|
18
|
+
findAsyncActions(params: IFindParams, inclusion: IKeyOfProjection[]): Promise<(IDocType & {
|
|
19
|
+
id: string;
|
|
20
|
+
})[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Readyタスクをひとつ追加する
|
|
23
|
+
*/
|
|
24
|
+
addReadyAsyncAction(params: Pick<ISavingTask, 'data' | 'expires' | 'name' | 'project' | 'runsAt'> & {
|
|
25
|
+
alternateName?: never;
|
|
26
|
+
identifier?: never;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
id: string;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Ready -> Running
|
|
32
|
+
*/
|
|
33
|
+
executeAsyncActionById(params: {
|
|
34
|
+
id: string;
|
|
35
|
+
executor: {
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
38
|
+
}): Promise<IExecutableAsyncAction | null>;
|
|
39
|
+
/**
|
|
40
|
+
* 非同期アクションの状態を参照する
|
|
41
|
+
*/
|
|
42
|
+
findAsyncActionById(params: {
|
|
43
|
+
id: {
|
|
44
|
+
$eq: string;
|
|
45
|
+
};
|
|
46
|
+
project: {
|
|
47
|
+
id: {
|
|
48
|
+
$eq: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
name: factory.taskName;
|
|
52
|
+
}, inclusion: IKeyOfProjection[]): Promise<(IDocType & {
|
|
53
|
+
id: string;
|
|
54
|
+
} | undefined)>;
|
|
55
|
+
/**
|
|
56
|
+
* タスクIDから実行結果とステータスを保管する
|
|
57
|
+
* Abortedの場合、dateAbortedもセットする
|
|
58
|
+
*/
|
|
59
|
+
setExecutionResultAndStatus(params: {
|
|
60
|
+
/**
|
|
61
|
+
* タスクID
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
}, update: {
|
|
65
|
+
status: factory.taskStatus.Executed | factory.taskStatus.Aborted;
|
|
66
|
+
executionResult: factory.task.IExecutionResult;
|
|
67
|
+
}): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../factory");
|
|
5
|
+
const settings_1 = require("../settings");
|
|
6
|
+
const asyncAction_1 = require("./mongoose/schemas/asyncAction");
|
|
7
|
+
const executableTaskProjection = {
|
|
8
|
+
_id: 0,
|
|
9
|
+
id: { $toString: '$_id' },
|
|
10
|
+
// 必要最低限にprojection(2024-04-23~)
|
|
11
|
+
data: 1,
|
|
12
|
+
name: 1,
|
|
13
|
+
status: 1,
|
|
14
|
+
project: 1,
|
|
15
|
+
runsAt: 1,
|
|
16
|
+
expires: 1
|
|
17
|
+
};
|
|
18
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
19
|
+
'project',
|
|
20
|
+
'name',
|
|
21
|
+
'status',
|
|
22
|
+
'runsAt',
|
|
23
|
+
'lastTriedAt',
|
|
24
|
+
'executionResults',
|
|
25
|
+
'executor',
|
|
26
|
+
'data',
|
|
27
|
+
'dateAborted',
|
|
28
|
+
'expires'
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* 非同期アクションリポジトリ
|
|
32
|
+
*/
|
|
33
|
+
class AsyncActionRepo {
|
|
34
|
+
asyncActionModel;
|
|
35
|
+
constructor(connection) {
|
|
36
|
+
this.asyncActionModel = connection.model(asyncAction_1.modelName, (0, asyncAction_1.createSchema)());
|
|
37
|
+
}
|
|
38
|
+
static CREATE_MONGO_CONDITIONS(params) {
|
|
39
|
+
const andConditions = [];
|
|
40
|
+
const idEq = params.id?.$eq;
|
|
41
|
+
if (typeof idEq === 'string') {
|
|
42
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
43
|
+
}
|
|
44
|
+
const projectIdEq = params.project?.id?.$eq;
|
|
45
|
+
if (typeof projectIdEq === 'string') {
|
|
46
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
47
|
+
}
|
|
48
|
+
if (typeof params.name === 'string') {
|
|
49
|
+
andConditions.push({ name: { $eq: params.name } });
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const nameIn = params.name?.$in;
|
|
53
|
+
if (Array.isArray(nameIn)) {
|
|
54
|
+
andConditions.push({ name: { $in: nameIn } });
|
|
55
|
+
}
|
|
56
|
+
const nameNin = params.name?.$nin;
|
|
57
|
+
if (Array.isArray(nameNin)) {
|
|
58
|
+
andConditions.push({ name: { $nin: nameNin } });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const statusEq = params.status?.$eq;
|
|
62
|
+
if (typeof statusEq === 'string') {
|
|
63
|
+
andConditions.push({ status: { $eq: statusEq } });
|
|
64
|
+
}
|
|
65
|
+
if (params.runsFrom instanceof Date) {
|
|
66
|
+
andConditions.push({ runsAt: { $gte: params.runsFrom } });
|
|
67
|
+
}
|
|
68
|
+
if (params.runsThrough instanceof Date) {
|
|
69
|
+
andConditions.push({ runsAt: { $lte: params.runsThrough } });
|
|
70
|
+
}
|
|
71
|
+
return andConditions;
|
|
72
|
+
}
|
|
73
|
+
async findAsyncActions(params, inclusion) {
|
|
74
|
+
const conditions = AsyncActionRepo.CREATE_MONGO_CONDITIONS(params);
|
|
75
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
76
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
77
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
78
|
+
}
|
|
79
|
+
const projection = {
|
|
80
|
+
_id: 0,
|
|
81
|
+
id: { $toString: '$_id' },
|
|
82
|
+
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
83
|
+
};
|
|
84
|
+
const query = this.asyncActionModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
85
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
86
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
87
|
+
query.limit(params.limit)
|
|
88
|
+
.skip(params.limit * (page - 1));
|
|
89
|
+
}
|
|
90
|
+
if (params.sort?.runsAt !== undefined) {
|
|
91
|
+
query.sort({ runsAt: params.sort.runsAt });
|
|
92
|
+
}
|
|
93
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
94
|
+
.lean()
|
|
95
|
+
.exec();
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Readyタスクをひとつ追加する
|
|
99
|
+
*/
|
|
100
|
+
async addReadyAsyncAction(params) {
|
|
101
|
+
const { expires } = params;
|
|
102
|
+
if (!(expires instanceof Date)) {
|
|
103
|
+
throw new factory_1.factory.errors.Argument('expires', 'must be Date');
|
|
104
|
+
}
|
|
105
|
+
const savingTask = {
|
|
106
|
+
...params,
|
|
107
|
+
status: factory_1.factory.taskStatus.Ready,
|
|
108
|
+
executionResults: []
|
|
109
|
+
};
|
|
110
|
+
const result = await this.asyncActionModel.insertMany(savingTask, { rawResult: true });
|
|
111
|
+
const id = result.insertedIds?.[0]?.toHexString();
|
|
112
|
+
if (typeof id !== 'string') {
|
|
113
|
+
throw new factory_1.factory.errors.Internal('task not saved');
|
|
114
|
+
}
|
|
115
|
+
return { id };
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Ready -> Running
|
|
119
|
+
*/
|
|
120
|
+
async executeAsyncActionById(params) {
|
|
121
|
+
const now = new Date();
|
|
122
|
+
const doc = await this.asyncActionModel.findOneAndUpdate({
|
|
123
|
+
_id: { $eq: params.id },
|
|
124
|
+
status: { $eq: factory_1.factory.taskStatus.Ready }, // Readyのものしか実行しない
|
|
125
|
+
runsAt: { $lt: now },
|
|
126
|
+
expires: { $gt: now }, // ワンタイムタスクなのでexpiresは必ず存在する
|
|
127
|
+
}, {
|
|
128
|
+
$set: {
|
|
129
|
+
status: factory_1.factory.taskStatus.Running, // 実行中に変更
|
|
130
|
+
lastTriedAt: now,
|
|
131
|
+
executor: params.executor
|
|
132
|
+
},
|
|
133
|
+
}, { new: true, projection: executableTaskProjection })
|
|
134
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
135
|
+
.lean() // lean(2024-09-26~)
|
|
136
|
+
.exec();
|
|
137
|
+
if (doc === null) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
return doc;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 非同期アクションの状態を参照する
|
|
144
|
+
*/
|
|
145
|
+
async findAsyncActionById(params, inclusion) {
|
|
146
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
147
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
148
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// no op
|
|
152
|
+
}
|
|
153
|
+
const projection = {
|
|
154
|
+
_id: 0,
|
|
155
|
+
id: { $toString: '$_id' },
|
|
156
|
+
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
157
|
+
};
|
|
158
|
+
const query = this.asyncActionModel.findOne({
|
|
159
|
+
_id: { $eq: params.id.$eq },
|
|
160
|
+
'project.id': { $eq: params.project.id.$eq },
|
|
161
|
+
name: { $eq: params.name }
|
|
162
|
+
}, projection);
|
|
163
|
+
const doc = await query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
164
|
+
.lean()
|
|
165
|
+
.exec();
|
|
166
|
+
if (doc === null) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
return doc;
|
|
170
|
+
}
|
|
171
|
+
// /**
|
|
172
|
+
// * Readyのままで期限切れのタスクをExpiredに変更する
|
|
173
|
+
// */
|
|
174
|
+
// public async makeExpiredMany(params: {
|
|
175
|
+
// expiresLt: Date;
|
|
176
|
+
// }): Promise<UpdateWriteOpResult> {
|
|
177
|
+
// const { expiresLt } = params;
|
|
178
|
+
// if (!(expiresLt instanceof Date)) {
|
|
179
|
+
// throw new factory.errors.Argument('expiresLt', 'must be Date');
|
|
180
|
+
// }
|
|
181
|
+
// return this.asyncActionModel.updateMany(
|
|
182
|
+
// {
|
|
183
|
+
// status: { $eq: factory.taskStatus.Ready },
|
|
184
|
+
// expires: { $lt: expiresLt }
|
|
185
|
+
// },
|
|
186
|
+
// {
|
|
187
|
+
// $set: {
|
|
188
|
+
// status: factory.taskStatus.Expired
|
|
189
|
+
// }
|
|
190
|
+
// }
|
|
191
|
+
// )
|
|
192
|
+
// .exec();
|
|
193
|
+
// }
|
|
194
|
+
// /**
|
|
195
|
+
// * taskNameに関わらず、Runningのまま放置された非同期アクションをAbortedに変更する
|
|
196
|
+
// */
|
|
197
|
+
// public async abortMany(params: {
|
|
198
|
+
// intervalInMinutes: number;
|
|
199
|
+
// }): Promise<UpdateWriteOpResult> {
|
|
200
|
+
// const lastTriedAtShoudBeLessThan = moment()
|
|
201
|
+
// .add(-params.intervalInMinutes, 'minutes')
|
|
202
|
+
// .toDate();
|
|
203
|
+
// return this.asyncActionModel.updateMany(
|
|
204
|
+
// {
|
|
205
|
+
// status: { $eq: factory.taskStatus.Running },
|
|
206
|
+
// lastTriedAt: {
|
|
207
|
+
// $exists: true,
|
|
208
|
+
// $lt: lastTriedAtShoudBeLessThan
|
|
209
|
+
// }
|
|
210
|
+
// },
|
|
211
|
+
// {
|
|
212
|
+
// $set: {
|
|
213
|
+
// status: factory.taskStatus.Aborted,
|
|
214
|
+
// dateAborted: new Date()
|
|
215
|
+
// }
|
|
216
|
+
// }
|
|
217
|
+
// )
|
|
218
|
+
// .exec();
|
|
219
|
+
// }
|
|
220
|
+
/**
|
|
221
|
+
* タスクIDから実行結果とステータスを保管する
|
|
222
|
+
* Abortedの場合、dateAbortedもセットする
|
|
223
|
+
*/
|
|
224
|
+
async setExecutionResultAndStatus(params, update) {
|
|
225
|
+
const { id } = params;
|
|
226
|
+
const { status, executionResult } = update;
|
|
227
|
+
await this.asyncActionModel.updateOne({ _id: { $eq: id } }, {
|
|
228
|
+
$set: {
|
|
229
|
+
status,
|
|
230
|
+
...(status === factory_1.factory.taskStatus.Aborted) ? { dateAborted: executionResult.endDate } : undefined // 2025-08-04~
|
|
231
|
+
},
|
|
232
|
+
$push: { executionResults: executionResult }
|
|
233
|
+
})
|
|
234
|
+
.exec();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.AsyncActionRepo = AsyncActionRepo;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { createClient } from 'redis';
|
|
2
2
|
import { AbstractConcurrentLockRepo, ILockParams, IUnlockParams } from './concurrentLockAbstract';
|
|
3
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
3
4
|
/**
|
|
4
5
|
* 同時実行ロックリポジトリ
|
|
5
6
|
*/
|
|
@@ -12,3 +13,4 @@ export declare class ConcurrentLockRepo implements AbstractConcurrentLockRepo {
|
|
|
12
13
|
lock(params: ILockParams): Promise<void>;
|
|
13
14
|
unlock(params: IUnlockParams): Promise<void>;
|
|
14
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
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 } from './mongoose/schemas/creativeWork';
|
|
5
4
|
type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork;
|
|
@@ -32,7 +31,7 @@ export declare class CreativeWorkRepo {
|
|
|
32
31
|
[key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
|
|
33
32
|
};
|
|
34
33
|
}[]): Promise<{
|
|
35
|
-
bulkWriteResult?: BulkWriteResult;
|
|
34
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
36
35
|
}>;
|
|
37
36
|
/**
|
|
38
37
|
* コンテンツを検索する
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { createClient } from 'redis';
|
|
3
3
|
interface IOptions {
|
|
4
4
|
scope: string;
|
|
5
5
|
expireInSeconds: number;
|
|
6
6
|
}
|
|
7
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
7
8
|
/**
|
|
8
9
|
* 認証情報リポジトリ
|
|
9
10
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { ICustomerType } from './mongoose/schemas/customerType';
|
|
4
3
|
import { factory } from '../factory';
|
|
5
4
|
type IKeyOfProjection = keyof ICustomerType;
|
|
@@ -17,6 +16,6 @@ export declare class CustomerTypeRepo {
|
|
|
17
16
|
saveManyByCodeValue(params: {
|
|
18
17
|
attributes: ICustomerType;
|
|
19
18
|
upsert?: boolean;
|
|
20
|
-
}[]): Promise<BulkWriteResult | undefined>;
|
|
19
|
+
}[]): Promise<mongo.BulkWriteResult | undefined>;
|
|
21
20
|
}
|
|
22
21
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
import * as EventFactory from '../factory/event';
|
|
5
4
|
export interface IAttributes4patchUpdate {
|
|
@@ -83,7 +82,7 @@ export declare class EventRepo {
|
|
|
83
82
|
*/
|
|
84
83
|
update: boolean;
|
|
85
84
|
}): Promise<{
|
|
86
|
-
bulkWriteResult?: BulkWriteResult;
|
|
85
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
87
86
|
modifiedEvents: {
|
|
88
87
|
id: string;
|
|
89
88
|
}[];
|
|
@@ -202,7 +201,7 @@ export declare class EventRepo {
|
|
|
202
201
|
organizer: {
|
|
203
202
|
id: string;
|
|
204
203
|
};
|
|
205
|
-
}): Promise<
|
|
204
|
+
}): Promise<mongo.DeleteResult>;
|
|
206
205
|
deleteManyEventsByScreeningRoom(params: {
|
|
207
206
|
project: {
|
|
208
207
|
id: string;
|
|
@@ -219,7 +218,7 @@ export declare class EventRepo {
|
|
|
219
218
|
id: string;
|
|
220
219
|
};
|
|
221
220
|
};
|
|
222
|
-
}): Promise<
|
|
221
|
+
}): Promise<mongo.DeleteResult>;
|
|
223
222
|
deleteManyBySuperEventId(params: {
|
|
224
223
|
project: {
|
|
225
224
|
id: string;
|
|
@@ -227,7 +226,7 @@ export declare class EventRepo {
|
|
|
227
226
|
superEvent: {
|
|
228
227
|
id: string;
|
|
229
228
|
};
|
|
230
|
-
}): Promise<
|
|
229
|
+
}): Promise<mongo.DeleteResult>;
|
|
231
230
|
deleteManyBySuperEventLocationId(params: {
|
|
232
231
|
project: {
|
|
233
232
|
id: string;
|
|
@@ -237,7 +236,7 @@ export declare class EventRepo {
|
|
|
237
236
|
id: string;
|
|
238
237
|
};
|
|
239
238
|
};
|
|
240
|
-
}): Promise<
|
|
239
|
+
}): Promise<mongo.DeleteResult>;
|
|
241
240
|
/**
|
|
242
241
|
* 興行(プロダクト)から削除する
|
|
243
242
|
*/
|
|
@@ -252,7 +251,7 @@ export declare class EventRepo {
|
|
|
252
251
|
};
|
|
253
252
|
};
|
|
254
253
|
};
|
|
255
|
-
}): Promise<
|
|
254
|
+
}): Promise<mongo.DeleteResult>;
|
|
256
255
|
deleteManyEventsEndedByProject(params: {
|
|
257
256
|
typeOf: {
|
|
258
257
|
$in: factory.eventType.ScreeningEvent[];
|
|
@@ -263,7 +262,7 @@ export declare class EventRepo {
|
|
|
263
262
|
endDate: {
|
|
264
263
|
$lte: Date;
|
|
265
264
|
};
|
|
266
|
-
}): Promise<
|
|
265
|
+
}): Promise<mongo.DeleteResult>;
|
|
267
266
|
deleteManyEventsEnded(params: {
|
|
268
267
|
typeOf: {
|
|
269
268
|
$eq: factory.eventType.ScreeningEvent;
|
|
@@ -271,7 +270,7 @@ export declare class EventRepo {
|
|
|
271
270
|
endDate: {
|
|
272
271
|
$lte: Date;
|
|
273
272
|
};
|
|
274
|
-
}): Promise<
|
|
273
|
+
}): Promise<mongo.DeleteResult>;
|
|
275
274
|
deleteByProject(params: {
|
|
276
275
|
project: {
|
|
277
276
|
id: string;
|
|
@@ -283,7 +282,7 @@ export declare class EventRepo {
|
|
|
283
282
|
updateAggregationById(params: {
|
|
284
283
|
id: string;
|
|
285
284
|
}, update: IUpdateAggregateReservationParams): Promise<void>;
|
|
286
|
-
bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteResult & {
|
|
285
|
+
bulkWrite(bulkWriteOps: any[]): Promise<mongo.BulkWriteResult & {
|
|
287
286
|
mongoose?: {
|
|
288
287
|
validationErrors: import("mongoose").Error[];
|
|
289
288
|
} | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { 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/eventOffer';
|
|
5
4
|
type IUnset = {
|
|
@@ -32,7 +31,7 @@ export declare class EventOfferRepo {
|
|
|
32
31
|
*/
|
|
33
32
|
update: boolean;
|
|
34
33
|
}): Promise<{
|
|
35
|
-
bulkWriteResult?: BulkWriteResult;
|
|
34
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
36
35
|
modifiedProductOffers?: {
|
|
37
36
|
id: string;
|
|
38
37
|
}[];
|
|
@@ -47,7 +46,7 @@ export declare class EventOfferRepo {
|
|
|
47
46
|
seller: {
|
|
48
47
|
id: string;
|
|
49
48
|
};
|
|
50
|
-
}): Promise<DeleteResult>;
|
|
49
|
+
}): Promise<mongo.DeleteResult>;
|
|
51
50
|
/**
|
|
52
51
|
* 有効期間を過ぎたイベントオファーを削除する
|
|
53
52
|
*/
|
|
@@ -55,6 +54,6 @@ export declare class EventOfferRepo {
|
|
|
55
54
|
validThrough: {
|
|
56
55
|
$lte: Date;
|
|
57
56
|
};
|
|
58
|
-
}): Promise<DeleteResult>;
|
|
57
|
+
}): Promise<mongo.DeleteResult>;
|
|
59
58
|
}
|
|
60
59
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection } from 'mongoose';
|
|
1
|
+
import type { Connection, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
/**
|
|
5
4
|
* イベントのアプリケーションオファーリポジトリ
|
|
@@ -31,7 +30,7 @@ export declare class EventSellerMakesOfferRepo {
|
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
}[]): Promise<{
|
|
34
|
-
bulkWriteResult?: BulkWriteResult;
|
|
33
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
35
34
|
modifiedEvents?: {
|
|
36
35
|
id: string;
|
|
37
36
|
}[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
type ISearchConditions = factory.eventSeries.ISearchConditions;
|
|
5
4
|
type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
|
|
@@ -26,7 +25,7 @@ export declare class EventSeriesRepo {
|
|
|
26
25
|
*/
|
|
27
26
|
upsert: boolean;
|
|
28
27
|
}): Promise<{
|
|
29
|
-
bulkWriteResult?: BulkWriteResult;
|
|
28
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
30
29
|
modifiedEvents: {
|
|
31
30
|
id: string;
|
|
32
31
|
}[];
|
|
@@ -55,7 +54,7 @@ export declare class EventSeriesRepo {
|
|
|
55
54
|
organizer: {
|
|
56
55
|
id: string;
|
|
57
56
|
};
|
|
58
|
-
}): Promise<
|
|
57
|
+
}): Promise<mongo.DeleteResult>;
|
|
59
58
|
deleteManyByLocationId(params: {
|
|
60
59
|
project: {
|
|
61
60
|
id: string;
|
|
@@ -63,7 +62,7 @@ export declare class EventSeriesRepo {
|
|
|
63
62
|
location: {
|
|
64
63
|
id: string;
|
|
65
64
|
};
|
|
66
|
-
}): Promise<
|
|
65
|
+
}): Promise<mongo.DeleteResult>;
|
|
67
66
|
/**
|
|
68
67
|
* 既存施設コンテンツの最大バージョンを集計する
|
|
69
68
|
*/
|
|
@@ -43,7 +43,7 @@ export declare class MessageRepo {
|
|
|
43
43
|
/**
|
|
44
44
|
* 検索
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
findMessages(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<(IEmailMessage & {
|
|
47
47
|
id: string;
|
|
48
48
|
})[]>;
|
|
49
49
|
/**
|
|
@@ -53,7 +53,7 @@ class MessageRepo {
|
|
|
53
53
|
/**
|
|
54
54
|
* 検索
|
|
55
55
|
*/
|
|
56
|
-
async
|
|
56
|
+
async findMessages(params, inclusion) {
|
|
57
57
|
const conditions = MessageRepo.CREATE_MONGO_CONDITIONS(params);
|
|
58
58
|
let positiveProjectionFields;
|
|
59
59
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|