@chevre/domain 24.1.0-alpha.5 → 24.1.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.
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +15 -26
- package/lib/chevre/repo/acceptedOffer.js +106 -67
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +30 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +86 -0
- package/lib/chevre/repo/accountingReport.js +2 -30
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
- package/lib/chevre/repo/event.js +12 -8
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +7 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +74 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -362
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +108 -108
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +84 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
- package/lib/chevre/repo/order.d.ts +2 -83
- package/lib/chevre/repo/order.js +10 -373
- package/lib/chevre/repo/orderInTransaction.d.ts +56 -6
- package/lib/chevre/repo/orderInTransaction.js +58 -4
- package/lib/chevre/repo/place/hasPOS.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -7
- package/lib/chevre/repo/reservation.js +16 -12
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/setting/integration.d.ts +27 -0
- package/lib/chevre/repo/setting/integration.js +102 -0
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +11 -0
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +0 -12
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
- package/lib/chevre/service/delivery/factory.d.ts +6 -1
- package/lib/chevre/service/delivery/factory.js +1 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
- package/lib/chevre/service/delivery/reservation/factory.js +0 -17
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
- package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
- package/lib/chevre/service/notification/notifyByEmail.js +7 -12
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
- package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
- package/lib/chevre/service/offer/any.d.ts +7 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +13 -15
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +16 -2
- package/lib/chevre/service/offer/event/authorize.js +62 -11
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
- 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 +1 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +15 -15
- package/lib/chevre/service/order/deleteOrder.js +19 -43
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
- package/lib/chevre/service/order/onOrderUpdated.js +0 -1
- package/lib/chevre/service/order/payOrder.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +4 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder.d.ts +1 -1
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +0 -4
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/any/person2username.js +0 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +1 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +14 -6
- package/lib/chevre/service/reserve/findReservations.js +26 -36
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
- package/lib/chevre/service/reserve/searchByOrder.js +7 -3
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -3
- package/lib/chevre/service/task/authorizePayment.js +4 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +4 -2
- package/lib/chevre/service/task/checkMovieTicket.js +4 -2
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -3
- package/lib/chevre/service/task/createAccountingReport.js +4 -8
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/importOffersFromCOA.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +3 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +4 -2
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +6 -7
- package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
- package/lib/chevre/service/task/placeOrder.js +3 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
- package/lib/chevre/service/task/refund.js +4 -2
- package/lib/chevre/service/task/returnReserveTransaction.js +4 -2
- package/lib/chevre/service/task/sendEmailMessage.js +5 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/task/voidPayment.js +4 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
- package/lib/chevre/service/task.d.ts +0 -7
- package/lib/chevre/service/taskHandler.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +0 -3
- package/lib/chevre/service/validation/validateOrder.js +3 -78
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +0 -22
- package/lib/chevre/taskSettings.js +1 -7
- package/package.json +2 -2
- package/lib/chevre/credentials/customSearch.d.ts +0 -13
- package/lib/chevre/credentials/customSearch.js +0 -16
- package/lib/chevre/credentials/lineNotify.d.ts +0 -17
- package/lib/chevre/credentials/lineNotify.js +0 -20
- package/lib/chevre/credentials/sendGrid.d.ts +0 -24
- package/lib/chevre/credentials/sendGrid.js +0 -18
- package/lib/chevre/credentials.d.ts +0 -20
- package/lib/chevre/credentials.js +0 -42
|
@@ -10,47 +10,6 @@ const factory_1 = require("../../factory");
|
|
|
10
10
|
const factory_2 = require("../offer/event/authorize/factory");
|
|
11
11
|
// import { acceptedOffers2amount as acceptedOffers2amount4product } from '../offer/product/factory';
|
|
12
12
|
const validateMovieTicket_1 = require("../transaction/placeOrder/confirm/validation/validateMovieTicket");
|
|
13
|
-
// const debug = createDebug('chevre-domain:service:validation');
|
|
14
|
-
// type ICreatingCheckEventTask = Pick<
|
|
15
|
-
// factory.task.checkResource.IAttributes,
|
|
16
|
-
// 'data' | 'executionResults' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status' | 'description'
|
|
17
|
-
// > & {
|
|
18
|
-
// description: string;
|
|
19
|
-
// };
|
|
20
|
-
// function createCheckEventTasks(params: {
|
|
21
|
-
// order: Pick<factory.order.IOrder, 'orderNumber' | 'typeOf'>;
|
|
22
|
-
// project: { id: string };
|
|
23
|
-
// reservationForIds: string[];
|
|
24
|
-
// }): ICreatingCheckEventTask[] {
|
|
25
|
-
// const { order, project, reservationForIds } = params;
|
|
26
|
-
// const runsAt = new Date();
|
|
27
|
-
// return reservationForIds.map((reservationForId) => {
|
|
28
|
-
// const object: factory.task.checkResource.IResourceAsEvent = { id: reservationForId, typeOf: factory.eventType.ScreeningEvent };
|
|
29
|
-
// const data: factory.task.checkResource.IData = {
|
|
30
|
-
// object,
|
|
31
|
-
// project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
32
|
-
// typeOf: factory.actionType.CheckAction
|
|
33
|
-
// };
|
|
34
|
-
// const description: string = util.format(
|
|
35
|
-
// '%s:%s:%s:%s',
|
|
36
|
-
// order.typeOf,
|
|
37
|
-
// order.orderNumber,
|
|
38
|
-
// factory.eventType.ScreeningEvent,
|
|
39
|
-
// reservationForId
|
|
40
|
-
// );
|
|
41
|
-
// return {
|
|
42
|
-
// description,
|
|
43
|
-
// project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
44
|
-
// name: factory.taskName.CheckResource,
|
|
45
|
-
// status: factory.taskStatus.Ready,
|
|
46
|
-
// runsAt,
|
|
47
|
-
// remainingNumberOfTries: 3,
|
|
48
|
-
// numberOfTried: 0,
|
|
49
|
-
// executionResults: [],
|
|
50
|
-
// data
|
|
51
|
-
// };
|
|
52
|
-
// });
|
|
53
|
-
// }
|
|
54
13
|
function validateOrder(params) {
|
|
55
14
|
return async (repos) => {
|
|
56
15
|
const order = await repos.order.projectFieldsByOrderNumber({
|
|
@@ -101,14 +60,8 @@ function validateOrder(params) {
|
|
|
101
60
|
throw new Error(`invalid acceptedOffer.priceSpecification.priceComponent [${typeof priceSpecification.priceComponent}]`);
|
|
102
61
|
}
|
|
103
62
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.isAfter((0, moment_1.default)('2023-09-30T15:00:00Z'))
|
|
107
|
-
// || typeOf !== factory.permit.PermitType.Permit
|
|
108
|
-
) {
|
|
109
|
-
if (typeof serialNumber !== 'string' || serialNumber.length === 0) {
|
|
110
|
-
throw new Error(`invalid acceptedOffer.serialNumber [${typeof serialNumber}]`);
|
|
111
|
-
}
|
|
63
|
+
if (typeof serialNumber !== 'string' || serialNumber.length === 0) {
|
|
64
|
+
throw new Error(`invalid acceptedOffer.serialNumber [${typeof serialNumber}]`);
|
|
112
65
|
}
|
|
113
66
|
});
|
|
114
67
|
let reservationForIds = [];
|
|
@@ -176,21 +129,8 @@ function validateOrder(params) {
|
|
|
176
129
|
}
|
|
177
130
|
break;
|
|
178
131
|
}
|
|
179
|
-
// case factory.permit.PermitType.Permit: {
|
|
180
|
-
// numOrderedItemExpected = acceptedOffers.length;
|
|
181
|
-
// const permitAcceptedOffers = acceptedOffers as factory.order.IAcceptedOffer<factory.order.IPermit>[];
|
|
182
|
-
// priceExpected = acceptedOffers2amount4product({
|
|
183
|
-
// acceptedOffers: permitAcceptedOffers
|
|
184
|
-
// });
|
|
185
|
-
// break;
|
|
186
|
-
// }
|
|
187
|
-
// case factory.actionType.MoneyTransfer:
|
|
188
|
-
// break;
|
|
189
132
|
default:
|
|
190
|
-
|
|
191
|
-
.isAfter((0, moment_1.default)('2024-02-01T15:00:00Z'))) {
|
|
192
|
-
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
193
|
-
}
|
|
133
|
+
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
194
134
|
}
|
|
195
135
|
// orderedItem検証
|
|
196
136
|
if (order.orderedItem.length !== numOrderedItemExpected) {
|
|
@@ -225,20 +165,5 @@ function validateOrder(params) {
|
|
|
225
165
|
throw new Error(`invalid ticketIdentifiers.length:${reservationReservedTicketIdentifiers.length} [expected:${acceptedOffers.length}]`);
|
|
226
166
|
}
|
|
227
167
|
}
|
|
228
|
-
// useMongoAsStockHolderProjectsの場合のイベント検証タスク作成を廃止(もう十分検証したので)(2025-07-11~)
|
|
229
|
-
// add check event task(2025-05-01~)
|
|
230
|
-
// const setting = <Pick<ISetting, 'useMongoAsStockHolderProjects'> | null>
|
|
231
|
-
// await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['useMongoAsStockHolderProjects']);
|
|
232
|
-
// const useMongoAsStockHolderProjects = setting?.useMongoAsStockHolderProjects;
|
|
233
|
-
// if (Array.isArray(useMongoAsStockHolderProjects) && useMongoAsStockHolderProjects.includes(params.project.id)) {
|
|
234
|
-
// const creatingCheckResourceTask = createCheckEventTasks({
|
|
235
|
-
// order: { orderNumber: order.orderNumber, typeOf: factory.order.OrderType.Order },
|
|
236
|
-
// project: { id: params.project.id },
|
|
237
|
-
// reservationForIds
|
|
238
|
-
// });
|
|
239
|
-
// if (creatingCheckResourceTask.length > 0) {
|
|
240
|
-
// await repos.task.saveMany(creatingCheckResourceTask, { emitImmediately: true });
|
|
241
|
-
// }
|
|
242
|
-
// }
|
|
243
168
|
};
|
|
244
169
|
}
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
interface ISurfrockSettings {
|
|
2
|
-
/**
|
|
3
|
-
* 着券時タイムアウト
|
|
4
|
-
*/
|
|
5
|
-
timeout: number;
|
|
6
|
-
/**
|
|
7
|
-
* 認証時タイムアウト
|
|
8
|
-
*/
|
|
9
|
-
timeoutCheck: number;
|
|
10
|
-
/**
|
|
11
|
-
* 決済と返金の最小間隔(ms)
|
|
12
|
-
*/
|
|
13
|
-
minIntervalBetweenPayAndRefund: number;
|
|
14
|
-
/**
|
|
15
|
-
* surfrockクライアント認証情報保管期限
|
|
16
|
-
* 0の場合、保管しない
|
|
17
|
-
*/
|
|
18
|
-
credentialsExpireInSeconds?: number;
|
|
19
|
-
}
|
|
20
|
-
interface IOptions {
|
|
21
|
-
abortedTasksWithoutReport: string[];
|
|
22
|
-
numTryConfirmReserveTransaction: number;
|
|
23
|
-
deliverOrderLimit: number;
|
|
24
|
-
coa: {
|
|
25
|
-
timeout: number;
|
|
26
|
-
};
|
|
27
|
-
gmo: {
|
|
28
|
-
timeout: number;
|
|
29
|
-
timeoutBackground: number;
|
|
30
|
-
};
|
|
31
|
-
movieticketReserve: ISurfrockSettings;
|
|
32
|
-
useExperimentalFeature: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* domain settings
|
|
36
|
-
*/
|
|
37
|
-
declare class Settings {
|
|
38
|
-
readonly abortedTasksWithoutReport: string[];
|
|
39
|
-
readonly numTryConfirmReserveTransaction: number;
|
|
40
|
-
readonly deliverOrderLimit: number;
|
|
41
|
-
readonly coa: {
|
|
42
|
-
timeout: number;
|
|
43
|
-
};
|
|
44
|
-
readonly gmo: {
|
|
45
|
-
timeout: number;
|
|
46
|
-
timeoutBackground: number;
|
|
47
|
-
};
|
|
48
|
-
readonly movieticketReserve: ISurfrockSettings;
|
|
49
|
-
readonly useExperimentalFeature: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* 通知設定
|
|
52
|
-
*/
|
|
53
|
-
constructor(options: IOptions);
|
|
54
|
-
}
|
|
55
1
|
export declare const MONGO_MAX_TIME_MS: number;
|
|
56
2
|
export declare const MONGO_READ_PREFERENCE: string;
|
|
57
3
|
export declare const MONGO_AUTO_INDEX: boolean;
|
|
58
|
-
export { Settings };
|
package/lib/chevre/settings.js
CHANGED
|
@@ -1,34 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
/**
|
|
5
|
-
* domain settings
|
|
6
|
-
*/
|
|
7
|
-
class Settings {
|
|
8
|
-
abortedTasksWithoutReport;
|
|
9
|
-
numTryConfirmReserveTransaction;
|
|
10
|
-
deliverOrderLimit;
|
|
11
|
-
coa;
|
|
12
|
-
gmo;
|
|
13
|
-
movieticketReserve;
|
|
14
|
-
useExperimentalFeature;
|
|
15
|
-
/**
|
|
16
|
-
* 通知設定
|
|
17
|
-
*/
|
|
18
|
-
// public readonly notification: IWebhookSettings; // migrate to SettingRepo(2024-12-11~)
|
|
19
|
-
constructor(options) {
|
|
20
|
-
const { abortedTasksWithoutReport, numTryConfirmReserveTransaction, deliverOrderLimit, coa, gmo, movieticketReserve, useExperimentalFeature } = options;
|
|
21
|
-
this.abortedTasksWithoutReport = abortedTasksWithoutReport;
|
|
22
|
-
this.numTryConfirmReserveTransaction = numTryConfirmReserveTransaction;
|
|
23
|
-
this.deliverOrderLimit = deliverOrderLimit;
|
|
24
|
-
this.coa = coa;
|
|
25
|
-
this.gmo = gmo;
|
|
26
|
-
this.movieticketReserve = movieticketReserve;
|
|
27
|
-
this.useExperimentalFeature = useExperimentalFeature;
|
|
28
|
-
// this.notification = notification;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.Settings = Settings;
|
|
3
|
+
exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = void 0;
|
|
32
4
|
exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
|
|
33
5
|
? Number(process.env.MONGO_MAX_TIME_MS)
|
|
34
6
|
: 10000;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import type { SendGridCredentials } from './credentials/sendGrid';
|
|
2
1
|
import type { IExecuteSettings as IMinimumExecuteSettings } from './eventEmitter/task';
|
|
3
2
|
import { factory } from './factory';
|
|
4
|
-
import type { Settings } from './settings';
|
|
5
|
-
interface IOnOrderStatusChanged {
|
|
6
|
-
informOrder2hub?: factory.project.IInformParams[];
|
|
7
|
-
}
|
|
8
|
-
interface IOnReservationStatusChanged {
|
|
9
|
-
informReservation2hub?: factory.project.IInformParams[];
|
|
10
|
-
}
|
|
11
|
-
interface IOnTaskStatusChanged {
|
|
12
|
-
informTask2hub?: factory.project.IInformParams[];
|
|
13
|
-
}
|
|
14
3
|
interface ICallableTask {
|
|
15
4
|
aggregateOnSystem?: ICallableTaskOperation;
|
|
16
5
|
handleNotification?: ICallableTaskOperation;
|
|
@@ -20,26 +9,15 @@ interface IOptions {
|
|
|
20
9
|
* タスク実行処理の実装
|
|
21
10
|
*/
|
|
22
11
|
callableTask?: ICallableTask;
|
|
23
|
-
onOrderStatusChanged: IOnOrderStatusChanged;
|
|
24
|
-
onReservationStatusChanged: IOnReservationStatusChanged;
|
|
25
|
-
onTaskStatusChanged: IOnTaskStatusChanged;
|
|
26
12
|
}
|
|
27
13
|
/**
|
|
28
14
|
* aggregation domain settings
|
|
29
15
|
*/
|
|
30
16
|
declare class AggregationSettings {
|
|
31
17
|
readonly callableTask?: ICallableTask;
|
|
32
|
-
readonly onOrderStatusChanged: IOnOrderStatusChanged;
|
|
33
|
-
readonly onReservationStatusChanged: IOnReservationStatusChanged;
|
|
34
|
-
readonly onTaskStatusChanged: IOnTaskStatusChanged;
|
|
35
18
|
constructor(options: IOptions);
|
|
36
19
|
}
|
|
37
|
-
interface ICredentialSettings {
|
|
38
|
-
sendGrid: SendGridCredentials;
|
|
39
|
-
}
|
|
40
20
|
interface IExecuteSettings extends IMinimumExecuteSettings {
|
|
41
|
-
credentials: ICredentialSettings;
|
|
42
|
-
settings: Settings;
|
|
43
21
|
aggregationSettings?: AggregationSettings;
|
|
44
22
|
}
|
|
45
23
|
interface IExecuteOptions {
|
|
@@ -6,14 +6,8 @@ exports.AggregationSettings = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
class AggregationSettings {
|
|
8
8
|
callableTask;
|
|
9
|
-
onOrderStatusChanged;
|
|
10
|
-
onReservationStatusChanged;
|
|
11
|
-
onTaskStatusChanged;
|
|
12
9
|
constructor(options) {
|
|
13
|
-
const { callableTask,
|
|
14
|
-
this.onOrderStatusChanged = onOrderStatusChanged;
|
|
15
|
-
this.onReservationStatusChanged = onReservationStatusChanged;
|
|
16
|
-
this.onTaskStatusChanged = onTaskStatusChanged;
|
|
10
|
+
const { callableTask, } = options;
|
|
17
11
|
if (callableTask !== undefined) {
|
|
18
12
|
this.callableTask = callableTask;
|
|
19
13
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "8.
|
|
14
|
+
"@chevre/factory": "8.2.0-alpha.5",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "24.1.0-alpha.
|
|
94
|
+
"version": "24.1.0-alpha.50"
|
|
95
95
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface IOptions {
|
|
2
|
-
engineId: string;
|
|
3
|
-
apiKey: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* GoogleCustomSearch認証情報
|
|
7
|
-
*/
|
|
8
|
-
declare class CustomSearchCredentials {
|
|
9
|
-
readonly engineId: string;
|
|
10
|
-
readonly apiKey: string;
|
|
11
|
-
constructor(options: IOptions);
|
|
12
|
-
}
|
|
13
|
-
export { CustomSearchCredentials };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomSearchCredentials = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* GoogleCustomSearch認証情報
|
|
6
|
-
*/
|
|
7
|
-
class CustomSearchCredentials {
|
|
8
|
-
engineId;
|
|
9
|
-
apiKey;
|
|
10
|
-
constructor(options) {
|
|
11
|
-
const { engineId, apiKey } = options;
|
|
12
|
-
this.engineId = engineId;
|
|
13
|
-
this.apiKey = apiKey;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.CustomSearchCredentials = CustomSearchCredentials;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface IOptions {
|
|
2
|
-
url: string;
|
|
3
|
-
accessToken: string;
|
|
4
|
-
accessTokenAlert: string;
|
|
5
|
-
accessTokenInfo: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* 通知認証情報
|
|
9
|
-
*/
|
|
10
|
-
declare class LINENotifyCredentials {
|
|
11
|
-
readonly url: string;
|
|
12
|
-
readonly accessToken: string;
|
|
13
|
-
readonly accessTokenAlert: string;
|
|
14
|
-
readonly accessTokenInfo: string;
|
|
15
|
-
constructor(options: IOptions);
|
|
16
|
-
}
|
|
17
|
-
export { LINENotifyCredentials };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LINENotifyCredentials = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* 通知認証情報
|
|
6
|
-
*/
|
|
7
|
-
class LINENotifyCredentials {
|
|
8
|
-
url;
|
|
9
|
-
accessToken;
|
|
10
|
-
accessTokenAlert;
|
|
11
|
-
accessTokenInfo;
|
|
12
|
-
constructor(options) {
|
|
13
|
-
const { url, accessToken, accessTokenAlert, accessTokenInfo } = options;
|
|
14
|
-
this.url = url;
|
|
15
|
-
this.accessToken = accessToken;
|
|
16
|
-
this.accessTokenAlert = accessTokenAlert;
|
|
17
|
-
this.accessTokenInfo = accessTokenInfo;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.LINENotifyCredentials = LINENotifyCredentials;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
interface IAlert {
|
|
2
|
-
sender?: {
|
|
3
|
-
name: string;
|
|
4
|
-
email: string;
|
|
5
|
-
};
|
|
6
|
-
toRecipient?: [
|
|
7
|
-
{
|
|
8
|
-
email: string;
|
|
9
|
-
}
|
|
10
|
-
];
|
|
11
|
-
}
|
|
12
|
-
interface IOptions {
|
|
13
|
-
apiKey: string;
|
|
14
|
-
alert?: IAlert;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* SendGrid認証情報
|
|
18
|
-
*/
|
|
19
|
-
declare class SendGridCredentials {
|
|
20
|
-
readonly apiKey: string;
|
|
21
|
-
readonly alert?: IAlert;
|
|
22
|
-
constructor(options: IOptions);
|
|
23
|
-
}
|
|
24
|
-
export { SendGridCredentials };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendGridCredentials = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* SendGrid認証情報
|
|
6
|
-
*/
|
|
7
|
-
class SendGridCredentials {
|
|
8
|
-
apiKey;
|
|
9
|
-
alert;
|
|
10
|
-
constructor(options) {
|
|
11
|
-
const { apiKey, alert } = options;
|
|
12
|
-
this.apiKey = apiKey;
|
|
13
|
-
if (alert !== undefined) {
|
|
14
|
-
this.alert = alert;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.SendGridCredentials = SendGridCredentials;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CustomSearchCredentials } from './credentials/customSearch';
|
|
2
|
-
import type { LINENotifyCredentials } from './credentials/lineNotify';
|
|
3
|
-
import type { SendGridCredentials } from './credentials/sendGrid';
|
|
4
|
-
/**
|
|
5
|
-
* 外部サービス認証情報
|
|
6
|
-
*/
|
|
7
|
-
export declare namespace credentials {
|
|
8
|
-
type CustomSearch = CustomSearchCredentials;
|
|
9
|
-
namespace CustomSearch {
|
|
10
|
-
function createInstance(...params: ConstructorParameters<typeof CustomSearchCredentials>): Promise<CustomSearchCredentials>;
|
|
11
|
-
}
|
|
12
|
-
type LINENotify = LINENotifyCredentials;
|
|
13
|
-
namespace LINENotify {
|
|
14
|
-
function createInstance(...params: ConstructorParameters<typeof LINENotifyCredentials>): Promise<LINENotifyCredentials>;
|
|
15
|
-
}
|
|
16
|
-
type SendGrid = SendGridCredentials;
|
|
17
|
-
namespace SendGrid {
|
|
18
|
-
function createInstance(...params: ConstructorParameters<typeof SendGridCredentials>): Promise<SendGridCredentials>;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.credentials = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* 外部サービス認証情報
|
|
6
|
-
*/
|
|
7
|
-
var credentials;
|
|
8
|
-
(function (credentials) {
|
|
9
|
-
let CustomSearch;
|
|
10
|
-
(function (CustomSearch) {
|
|
11
|
-
let cred;
|
|
12
|
-
async function createInstance(...params) {
|
|
13
|
-
if (cred === undefined) {
|
|
14
|
-
cred = (await import('./credentials/customSearch.js')).CustomSearchCredentials;
|
|
15
|
-
}
|
|
16
|
-
return new cred(...params);
|
|
17
|
-
}
|
|
18
|
-
CustomSearch.createInstance = createInstance;
|
|
19
|
-
})(CustomSearch = credentials.CustomSearch || (credentials.CustomSearch = {}));
|
|
20
|
-
let LINENotify;
|
|
21
|
-
(function (LINENotify) {
|
|
22
|
-
let cred;
|
|
23
|
-
async function createInstance(...params) {
|
|
24
|
-
if (cred === undefined) {
|
|
25
|
-
cred = (await import('./credentials/lineNotify.js')).LINENotifyCredentials;
|
|
26
|
-
}
|
|
27
|
-
return new cred(...params);
|
|
28
|
-
}
|
|
29
|
-
LINENotify.createInstance = createInstance;
|
|
30
|
-
})(LINENotify = credentials.LINENotify || (credentials.LINENotify = {}));
|
|
31
|
-
let SendGrid;
|
|
32
|
-
(function (SendGrid) {
|
|
33
|
-
let cred;
|
|
34
|
-
async function createInstance(...params) {
|
|
35
|
-
if (cred === undefined) {
|
|
36
|
-
cred = (await import('./credentials/sendGrid.js')).SendGridCredentials;
|
|
37
|
-
}
|
|
38
|
-
return new cred(...params);
|
|
39
|
-
}
|
|
40
|
-
SendGrid.createInstance = createInstance;
|
|
41
|
-
})(SendGrid = credentials.SendGrid || (credentials.SendGrid = {}));
|
|
42
|
-
})(credentials || (exports.credentials = credentials = {}));
|