@chevre/domain 21.17.0 → 21.18.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/repo/rateLimit/offer.d.ts +0 -1
- package/lib/chevre/repo/rateLimit/offer.js +9 -9
- package/lib/chevre/repo/stockHolder.js +0 -1
- package/lib/chevre/service/offer/factory.js +2 -6
- package/lib/chevre/service/payment/any/factory.js +1 -7
- package/lib/chevre/settings.d.ts +0 -3
- package/lib/chevre/settings.js +1 -6
- package/package.json +2 -2
|
@@ -19,7 +19,6 @@ export interface IRateLimitKey {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare class RedisRepository {
|
|
21
21
|
private static readonly KEY_PREFIX_NEW;
|
|
22
|
-
private static readonly KEY_PREFIX;
|
|
23
22
|
private readonly redisClient;
|
|
24
23
|
constructor(redisClient: RedisClientType);
|
|
25
24
|
private static createKey;
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.RedisRepository = void 0;
|
|
13
13
|
const moment = require("moment");
|
|
14
14
|
const factory = require("../../factory");
|
|
15
|
-
const settings_1 = require("../../settings");
|
|
16
15
|
/**
|
|
17
16
|
* オファーレート制限リポジトリ
|
|
18
17
|
*/
|
|
@@ -24,13 +23,15 @@ class RedisRepository {
|
|
|
24
23
|
const dateNow = moment(ratelimitKey.reservationFor.startDate);
|
|
25
24
|
const unitInSeconds = Number(ratelimitKey.reservedTicket.ticketType.validRateLimit.unitInSeconds.toString());
|
|
26
25
|
const validFrom = dateNow.unix() - (dateNow.unix() % unitInSeconds);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
return `${RedisRepository.KEY_PREFIX_NEW}:${ratelimitKey.reservedTicket.ticketType.validRateLimit.scope}:${validFrom.toString()}`;
|
|
27
|
+
// const useNewKey: boolean = dateNow.isSameOrAfter(USE_NEW_EVENT_AVAILABILITY_KEY_FROM);
|
|
28
|
+
// if (useNewKey) {
|
|
29
|
+
// tslint:disable-next-line:max-line-length
|
|
30
|
+
// return `${RedisRepository.KEY_PREFIX_NEW}:${ratelimitKey.reservedTicket.ticketType.validRateLimit.scope}:${validFrom.toString()}`;
|
|
31
|
+
// } else {
|
|
32
|
+
// tslint:disable-next-line:max-line-length
|
|
33
|
+
// return `${RedisRepository.KEY_PREFIX}:${ratelimitKey.reservedTicket.ticketType.validRateLimit.scope}:${validFrom.toString()}`;
|
|
34
|
+
// }
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* ロックする
|
|
@@ -92,5 +93,4 @@ class RedisRepository {
|
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
RedisRepository.KEY_PREFIX_NEW = 'rateLimit:offer';
|
|
95
|
-
RedisRepository.KEY_PREFIX = 'chevre:rateLimit:offer';
|
|
96
96
|
exports.RedisRepository = RedisRepository;
|
|
@@ -13,7 +13,6 @@ exports.StockHolderRepository = void 0;
|
|
|
13
13
|
const createDebug = require("debug");
|
|
14
14
|
const moment = require("moment");
|
|
15
15
|
const factory = require("../factory");
|
|
16
|
-
// import { USE_NEW_EVENT_AVAILABILITY_KEY_FROM } from '../settings';
|
|
17
16
|
const debug = createDebug('chevre-domain:repo:stockHolder');
|
|
18
17
|
/**
|
|
19
18
|
* イベントストックホルダーリポジトリ
|
|
@@ -76,16 +76,12 @@ function createCompoundPriceSpec4event(params) {
|
|
|
76
76
|
priceComponent
|
|
77
77
|
};
|
|
78
78
|
// 必要な属性のみに限定(2023-02-24~)
|
|
79
|
-
const { acceptedPaymentMethod, name, description, alternateName, color, typeOf, id, availability,
|
|
79
|
+
const { acceptedPaymentMethod, name, description, alternateName, color, typeOf, id, availability, category, eligibleMembershipType, eligibleSeatingType, eligibleMonetaryAmount, eligibleSubReservation, priceCurrency, validFrom, validThrough, validRateLimit, additionalProperty, identifier, itemOffered, offerIndex, parentOffer } = params.offer;
|
|
80
80
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name, description, alternateName, color, typeOf, id,
|
|
81
81
|
category,
|
|
82
82
|
eligibleMembershipType, eligibleSeatingType, eligibleMonetaryAmount, eligibleSubReservation,
|
|
83
83
|
priceCurrency,
|
|
84
84
|
validFrom, validThrough, validRateLimit, additionalProperty,
|
|
85
|
-
identifier, itemOffered, addOn: params.addOn, eligibleQuantity: params.eligibleQuantity, priceSpecification: compoundPriceSpecification }, (!settings_1.USE_OPTIMIZE_TICKET_OFFER)
|
|
86
|
-
? {
|
|
87
|
-
availableAtOrFrom // 最適化(2023-09-10~)
|
|
88
|
-
}
|
|
89
|
-
: undefined), (typeof params.availability === 'string') ? { availability: params.availability } : { availability }), (typeof params.sortIndex === 'number') ? { sortIndex: params.sortIndex } : undefined), (typeof offerIndex === 'number') ? { offerIndex } : undefined), (typeof (parentOffer === null || parentOffer === void 0 ? void 0 : parentOffer.id) === 'string') ? { parentOffer: { id: parentOffer.id } } : undefined), (Array.isArray(acceptedPaymentMethod)) ? { acceptedPaymentMethod } : undefined);
|
|
85
|
+
identifier, itemOffered, addOn: params.addOn, eligibleQuantity: params.eligibleQuantity, priceSpecification: compoundPriceSpecification }, (typeof params.availability === 'string') ? { availability: params.availability } : { availability }), (typeof params.sortIndex === 'number') ? { sortIndex: params.sortIndex } : undefined), (typeof offerIndex === 'number') ? { offerIndex } : undefined), (typeof (parentOffer === null || parentOffer === void 0 ? void 0 : parentOffer.id) === 'string') ? { parentOffer: { id: parentOffer.id } } : undefined), (Array.isArray(acceptedPaymentMethod)) ? { acceptedPaymentMethod } : undefined), (!settings_1.USE_OPTIMIZE_TICKET_OFFER) ? {} : undefined);
|
|
90
86
|
}
|
|
91
87
|
exports.createCompoundPriceSpec4event = createCompoundPriceSpec4event;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.optimizeAction4inform = exports.createAuthorizeResult = exports.creatPayTransactionStartParams = void 0;
|
|
4
4
|
const moment = require("moment");
|
|
5
5
|
const factory = require("../../../factory");
|
|
6
|
-
const settings_1 = require("../../../settings");
|
|
7
6
|
function creatPayTransactionStartParams(params) {
|
|
8
7
|
var _a, _b, _c, _d;
|
|
9
8
|
let expires = moment(params.transaction.expires)
|
|
@@ -138,12 +137,7 @@ function createAuthorizeResult(params) {
|
|
|
138
137
|
additionalProperty: (Array.isArray(params.object.additionalProperty)) ? params.object.additionalProperty : [],
|
|
139
138
|
typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
140
139
|
};
|
|
141
|
-
|
|
142
|
-
return [resultAsInvoice];
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
return resultAsInvoice;
|
|
146
|
-
}
|
|
140
|
+
return [resultAsInvoice]; // Arrayに統一(2023-09-04~)
|
|
147
141
|
}
|
|
148
142
|
exports.createAuthorizeResult = createAuthorizeResult;
|
|
149
143
|
function payActionObject2invoice(params) {
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as moment from 'moment';
|
|
2
1
|
import * as factory from './factory';
|
|
3
2
|
export declare const TRIGGER_WEBHOOK_MAX_RETRY_COUNT: number;
|
|
4
3
|
export declare const TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS: number;
|
|
@@ -36,11 +35,9 @@ export type ISettings = factory.project.ISettings & {
|
|
|
36
35
|
};
|
|
37
36
|
export declare const DEFAULT_TASKS_EXPORT_AGENT_NAME: string;
|
|
38
37
|
export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
|
|
39
|
-
export declare const USE_NEW_EVENT_AVAILABILITY_KEY_FROM: moment.Moment;
|
|
40
38
|
export declare const USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT: boolean;
|
|
41
39
|
export declare const USE_DELETE_EVENT_BY_ORDER: boolean;
|
|
42
40
|
export declare const USE_ORDER_PAYMENT_DUE_ON_PLACED: boolean;
|
|
43
|
-
export declare const USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY: boolean;
|
|
44
41
|
export declare const USE_OPTIMIZE_TICKET_OFFER: boolean;
|
|
45
42
|
export declare const USE_ORDER_PAYMENT_METHOD_TYPE_OF: boolean;
|
|
46
43
|
export declare const MONGO_MAX_TIME_MS: number;
|
package/lib/chevre/settings.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.settings = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = exports.USE_OPTIMIZE_TICKET_OFFER = exports.
|
|
4
|
-
const moment = require("moment");
|
|
3
|
+
exports.settings = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = exports.USE_OPTIMIZE_TICKET_OFFER = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.MAX_NUM_CREDIT_CARD_PAYMENT_METHOD = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
|
|
5
4
|
const factory = require("./factory");
|
|
6
5
|
const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
|
|
7
6
|
? process.env.INFORM_TRANSACTION_URL.split(' ')
|
|
@@ -60,13 +59,9 @@ exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = (typeof process.env.TRANSA
|
|
|
60
59
|
exports.DEFAULT_SENDER_EMAIL = process.env.DEFAULT_SENDER_EMAIL;
|
|
61
60
|
exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = `${process.env.GAE_APPLICATION}:${process.env.GAE_SERVICE}:jobs`;
|
|
62
61
|
exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_ASSET_TRANSACTION_SYNC_PROCESSING === '1';
|
|
63
|
-
exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = (typeof process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM === 'string')
|
|
64
|
-
? moment(process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM)
|
|
65
|
-
: moment('2023-08-31T15:00:00Z');
|
|
66
62
|
exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = process.env.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT === '1';
|
|
67
63
|
exports.USE_DELETE_EVENT_BY_ORDER = process.env.USE_DELETE_EVENT_BY_ORDER === '1';
|
|
68
64
|
exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = process.env.USE_ORDER_PAYMENT_DUE_ON_PLACED === '1';
|
|
69
|
-
exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = process.env.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY === '1';
|
|
70
65
|
exports.USE_OPTIMIZE_TICKET_OFFER = process.env.USE_OPTIMIZE_TICKET_OFFER === '1';
|
|
71
66
|
exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = process.env.USE_ORDER_PAYMENT_METHOD_TYPE_OF === '1';
|
|
72
67
|
exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.
|
|
13
|
+
"@chevre/factory": "4.344.0",
|
|
14
14
|
"@cinerino/sdk": "5.3.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.2.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.
|
|
120
|
+
"version": "21.18.0-alpha.0"
|
|
121
121
|
}
|