@chevre/domain 21.17.0 → 21.18.0-alpha.1
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/example/src/chevre/report2developers.ts +33 -0
- package/example/src/fetch.ts +45 -0
- 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/notification.js +152 -53
- 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 +1 -3
- package/lib/chevre/settings.js +2 -6
- package/package.json +2 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
|
+
|
|
11
|
+
const notificationService = await chevre.service.notification.createService();
|
|
12
|
+
|
|
13
|
+
// await notificationService.report2developers(
|
|
14
|
+
// 'xxx',
|
|
15
|
+
// 'xxx'
|
|
16
|
+
// )({ accessToken: String(process.env.LINE_NOTIFY_ACCESS_TOKEN) });
|
|
17
|
+
|
|
18
|
+
await notificationService.triggerWebhook({
|
|
19
|
+
typeOf: chevre.factory.actionType.InformAction,
|
|
20
|
+
project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
|
|
21
|
+
agent: { id: project.id, typeOf: chevre.factory.organizationType.Project },
|
|
22
|
+
recipient: {
|
|
23
|
+
id: 'xxx',
|
|
24
|
+
url: 'https://example.com',
|
|
25
|
+
typeOf: chevre.factory.creativeWorkType.WebApplication
|
|
26
|
+
},
|
|
27
|
+
object: { sample: 'sample' }
|
|
28
|
+
})({ action: await chevre.repository.Action.createInstance(mongoose.connection) });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
main()
|
|
32
|
+
.then(console.log)
|
|
33
|
+
.catch(console.error);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
const url = String(process.env.LINE_NOTIFY_URL);
|
|
3
|
+
const LINE_NOTIFY_ACCESS_TOKEN = String(process.env.LINE_NOTIFY_ACCESS_TOKEN);
|
|
4
|
+
const TIMEOUT = 5000;
|
|
5
|
+
const MESSAGE = 'sample message';
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
try {
|
|
9
|
+
const form = new FormData();
|
|
10
|
+
form.set('message', `${MESSAGE} ${(new Date()).toString()}`);
|
|
11
|
+
|
|
12
|
+
const res = await fetch(
|
|
13
|
+
url,
|
|
14
|
+
{
|
|
15
|
+
signal: AbortSignal.timeout(TIMEOUT),
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${LINE_NOTIFY_ACCESS_TOKEN}`
|
|
19
|
+
},
|
|
20
|
+
body: form
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
const result = await res.json();
|
|
24
|
+
console.log('result', result);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.error(err);
|
|
27
|
+
if (err.name === 'TimeoutError') {
|
|
28
|
+
console.error('Timeout: It took more than 5 seconds to get the result!');
|
|
29
|
+
} else if (err.name === 'AbortError') {
|
|
30
|
+
console.error('Fetch aborted by user action (browser stop button, closing tab, etc.');
|
|
31
|
+
} else if (err.name === 'TypeError') {
|
|
32
|
+
console.error('AbortSignal.timeout() method is not supported');
|
|
33
|
+
} else {
|
|
34
|
+
// A network error, or some other problem.
|
|
35
|
+
console.error(`Error: type: ${err.name}, message: ${err.message}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
main()
|
|
42
|
+
.then(() => {
|
|
43
|
+
console.log('success!');
|
|
44
|
+
})
|
|
45
|
+
.catch(console.error);
|
|
@@ -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
|
* イベントストックホルダーリポジトリ
|
|
@@ -121,8 +121,10 @@ exports.sendEmailMessage = sendEmailMessage;
|
|
|
121
121
|
* 開発者に報告する
|
|
122
122
|
* https://notify-bot.line.me/doc/ja/
|
|
123
123
|
*/
|
|
124
|
+
// tslint:disable-next-line:max-func-body-length
|
|
124
125
|
function report2developers(subject, content, imageThumbnail, imageFullsize) {
|
|
125
126
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
var _a;
|
|
126
128
|
const LINE_NOTIFY_URL = credentials_1.credentials.lineNotify.url;
|
|
127
129
|
if (LINE_NOTIFY_URL === undefined) {
|
|
128
130
|
throw new Error('Environment variable LINE_NOTIFY_URL not set');
|
|
@@ -131,31 +133,77 @@ function report2developers(subject, content, imageThumbnail, imageFullsize) {
|
|
|
131
133
|
${subject}
|
|
132
134
|
--------
|
|
133
135
|
${content}`;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
if (settings_1.USE_FETCH_API) {
|
|
137
|
+
try {
|
|
138
|
+
const form = new FormData();
|
|
139
|
+
form.set('message', message);
|
|
140
|
+
if (typeof imageThumbnail === 'string') {
|
|
141
|
+
form.set('imageThumbnail', imageThumbnail);
|
|
142
|
+
}
|
|
143
|
+
if (typeof imageFullsize === 'string') {
|
|
144
|
+
form.set('imageFullsize', imageFullsize);
|
|
145
|
+
}
|
|
146
|
+
const res = yield fetch(LINE_NOTIFY_URL, Object.assign({ method: 'POST', headers: {
|
|
147
|
+
Authorization: `Bearer ${repos.accessToken}`
|
|
148
|
+
}, body: form }, (typeof ((_a = settings_1.settings.webhook) === null || _a === void 0 ? void 0 : _a.timeout) === 'number')
|
|
149
|
+
? { signal: AbortSignal.timeout(settings_1.settings.webhook.timeout) }
|
|
150
|
+
: undefined));
|
|
151
|
+
const body = yield res.json();
|
|
152
|
+
switch (res.status) {
|
|
153
|
+
case http_status_1.OK:
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
throw new Error(`${res.status} ${body.message}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
if (err.name === 'TimeoutError') {
|
|
161
|
+
// tslint:disable-next-line:no-console
|
|
162
|
+
console.error('report2developers: Timeout: It took more than 5 seconds to get the result!', err);
|
|
163
|
+
}
|
|
164
|
+
else if (err.name === 'AbortError') {
|
|
165
|
+
// tslint:disable-next-line:no-console
|
|
166
|
+
console.error('report2developers: Fetch aborted by user action (browser stop button, closing tab, etc.', err);
|
|
167
|
+
}
|
|
168
|
+
else if (err.name === 'TypeError') {
|
|
169
|
+
// tslint:disable-next-line:no-console
|
|
170
|
+
console.error('report2developers: AbortSignal.timeout() method is not supported', err);
|
|
147
171
|
}
|
|
148
172
|
else {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
reject(new Error(body.message));
|
|
155
|
-
}
|
|
173
|
+
// A network error, or some other problem.
|
|
174
|
+
// tslint:disable-next-line:no-console
|
|
175
|
+
console.error(`report2developers: Error: type: ${err.name}, message: ${err.message}`, err);
|
|
156
176
|
}
|
|
177
|
+
throw err;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
// LINE通知APIにPOST
|
|
182
|
+
const formData = Object.assign(Object.assign({ message: message }, (typeof imageThumbnail === 'string') ? { imageThumbnail } : undefined), (typeof imageFullsize === 'string') ? { imageFullsize } : undefined);
|
|
183
|
+
return new Promise((resolve, reject) => {
|
|
184
|
+
var _a;
|
|
185
|
+
request.post({
|
|
186
|
+
url: LINE_NOTIFY_URL,
|
|
187
|
+
auth: { bearer: repos.accessToken },
|
|
188
|
+
form: formData,
|
|
189
|
+
json: true,
|
|
190
|
+
timeout: (_a = settings_1.settings.webhook) === null || _a === void 0 ? void 0 : _a.timeout
|
|
191
|
+
}, (error, response, body) => {
|
|
192
|
+
if (error !== null) {
|
|
193
|
+
reject(error);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
switch (response.statusCode) {
|
|
197
|
+
case http_status_1.OK:
|
|
198
|
+
resolve();
|
|
199
|
+
break;
|
|
200
|
+
default:
|
|
201
|
+
reject(new Error(body.message));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
157
205
|
});
|
|
158
|
-
}
|
|
206
|
+
}
|
|
159
207
|
});
|
|
160
208
|
}
|
|
161
209
|
exports.report2developers = report2developers;
|
|
@@ -200,54 +248,105 @@ function sleep(waitTime) {
|
|
|
200
248
|
});
|
|
201
249
|
}
|
|
202
250
|
function processInformAction(params) {
|
|
251
|
+
// tslint:disable-next-line:max-func-body-length
|
|
203
252
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
204
|
-
var _a, _b;
|
|
253
|
+
var _a, _b, _c;
|
|
205
254
|
// アクション開始
|
|
206
255
|
const action = yield repos.action.start(params);
|
|
207
256
|
let result = {};
|
|
208
257
|
try {
|
|
209
258
|
if (typeof ((_a = params.recipient) === null || _a === void 0 ? void 0 : _a.url) === 'string') {
|
|
210
259
|
const url = params.recipient.url;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
260
|
+
if (settings_1.USE_FETCH_API) {
|
|
261
|
+
try {
|
|
262
|
+
const res = yield fetch(url, Object.assign({ method: 'POST', headers: {
|
|
263
|
+
'Content-Type': 'application/json'
|
|
264
|
+
}, body: JSON.stringify({
|
|
265
|
+
data: params.object
|
|
266
|
+
}) }, (typeof ((_b = settings_1.settings.webhook) === null || _b === void 0 ? void 0 : _b.timeout) === 'number')
|
|
267
|
+
? { signal: AbortSignal.timeout(settings_1.settings.webhook.timeout) }
|
|
268
|
+
: undefined));
|
|
269
|
+
let body;
|
|
270
|
+
try {
|
|
271
|
+
body = yield res.text();
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
// no op
|
|
275
|
+
}
|
|
276
|
+
switch (res.status) {
|
|
277
|
+
case http_status_1.OK:
|
|
278
|
+
case http_status_1.CREATED:
|
|
279
|
+
case http_status_1.ACCEPTED:
|
|
280
|
+
case http_status_1.NO_CONTENT:
|
|
281
|
+
result = {
|
|
282
|
+
statusCode: res.status
|
|
283
|
+
};
|
|
284
|
+
break;
|
|
285
|
+
default:
|
|
286
|
+
throw new Error(`statusCode: ${res.status} body: ${body}`);
|
|
287
|
+
}
|
|
288
|
+
// return res.json();
|
|
289
|
+
}
|
|
290
|
+
catch (err) {
|
|
291
|
+
if (err.name === 'TimeoutError') {
|
|
292
|
+
// tslint:disable-next-line:no-console
|
|
293
|
+
console.error('report2developers: Timeout: It took more than 5 seconds to get the result!', err);
|
|
294
|
+
}
|
|
295
|
+
else if (err.name === 'AbortError') {
|
|
296
|
+
// tslint:disable-next-line:no-console
|
|
297
|
+
console.error('report2developers: Fetch aborted by user action (browser stop button, closing tab, etc.', err);
|
|
298
|
+
}
|
|
299
|
+
else if (err.name === 'TypeError') {
|
|
300
|
+
// tslint:disable-next-line:no-console
|
|
301
|
+
console.error('report2developers: AbortSignal.timeout() method is not supported', err);
|
|
223
302
|
}
|
|
224
303
|
else {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
case http_status_1.ACCEPTED:
|
|
229
|
-
case http_status_1.NO_CONTENT:
|
|
230
|
-
result = {
|
|
231
|
-
statusCode: response.statusCode
|
|
232
|
-
// body: body
|
|
233
|
-
};
|
|
234
|
-
resolve();
|
|
235
|
-
break;
|
|
236
|
-
default:
|
|
237
|
-
reject({
|
|
238
|
-
statusCode: response.statusCode,
|
|
239
|
-
body: body
|
|
240
|
-
});
|
|
241
|
-
}
|
|
304
|
+
// A network error, or some other problem.
|
|
305
|
+
// tslint:disable-next-line:no-console
|
|
306
|
+
console.error(`report2developers: Error: type: ${err.name}, message: ${err.message}`, err);
|
|
242
307
|
}
|
|
308
|
+
throw err;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
yield new Promise((resolve, reject) => {
|
|
313
|
+
var _a;
|
|
314
|
+
request.post({
|
|
315
|
+
url: url,
|
|
316
|
+
body: {
|
|
317
|
+
data: params.object
|
|
318
|
+
},
|
|
319
|
+
json: true,
|
|
320
|
+
timeout: (_a = settings_1.settings.webhook) === null || _a === void 0 ? void 0 : _a.timeout
|
|
321
|
+
}, (error, response, body) => {
|
|
322
|
+
if (error instanceof Error) {
|
|
323
|
+
reject(error);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
switch (response.statusCode) {
|
|
327
|
+
case http_status_1.OK:
|
|
328
|
+
case http_status_1.CREATED:
|
|
329
|
+
case http_status_1.ACCEPTED:
|
|
330
|
+
case http_status_1.NO_CONTENT:
|
|
331
|
+
result = {
|
|
332
|
+
statusCode: response.statusCode
|
|
333
|
+
// body: body
|
|
334
|
+
};
|
|
335
|
+
resolve();
|
|
336
|
+
break;
|
|
337
|
+
default:
|
|
338
|
+
reject(new Error(`statusCode: ${response.statusCode} body: ${body}`));
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
});
|
|
243
342
|
});
|
|
244
|
-
}
|
|
343
|
+
}
|
|
245
344
|
}
|
|
246
345
|
}
|
|
247
346
|
catch (error) {
|
|
248
347
|
let throwsError = true;
|
|
249
348
|
// プロジェクト固有の特別対応
|
|
250
|
-
if (error.statusCode === http_status_1.INTERNAL_SERVER_ERROR && ((
|
|
349
|
+
if (error.statusCode === http_status_1.INTERNAL_SERVER_ERROR && ((_c = error.body) === null || _c === void 0 ? void 0 : _c.message) === USERNAME_ARGUMENT_REQUIRED_MESSAGE) {
|
|
251
350
|
throwsError = false;
|
|
252
351
|
}
|
|
253
352
|
if (throwsError) {
|
|
@@ -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,13 +35,12 @@ 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;
|
|
43
|
+
export declare const USE_FETCH_API: boolean;
|
|
46
44
|
export declare const MONGO_MAX_TIME_MS: number;
|
|
47
45
|
export declare const MONGO_READ_PREFERENCE: string;
|
|
48
46
|
export declare const MONGO_AUTO_INDEX: boolean;
|
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.
|
|
4
|
-
const moment = require("moment");
|
|
3
|
+
exports.settings = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_FETCH_API = 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,15 +59,12 @@ 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';
|
|
67
|
+
exports.USE_FETCH_API = process.env.USE_FETCH_API === '1';
|
|
72
68
|
exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
|
|
73
69
|
? Number(process.env.MONGO_MAX_TIME_MS)
|
|
74
70
|
// tslint:disable-next-line:no-magic-numbers
|
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.1"
|
|
121
121
|
}
|