@chevre/domain 21.19.0-alpha.12 → 21.19.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/example/src/chevre/processAction.ts +37 -0
  2. package/lib/chevre/repo/action.d.ts +4 -4
  3. package/lib/chevre/repo/action.js +8 -3
  4. package/lib/chevre/repo/paymentService.js +14 -54
  5. package/lib/chevre/repo/paymentServiceProvider.js +1 -4
  6. package/lib/chevre/repo/product.js +0 -14
  7. package/lib/chevre/service/code.js +1 -3
  8. package/lib/chevre/service/delivery.js +2 -6
  9. package/lib/chevre/service/event/createEvent.js +1 -3
  10. package/lib/chevre/service/event.js +2 -6
  11. package/lib/chevre/service/moneyTransfer.js +1 -3
  12. package/lib/chevre/service/notification.js +2 -6
  13. package/lib/chevre/service/offer/event/authorize.js +1 -2
  14. package/lib/chevre/service/offer/eventServiceByCOA.js +2 -4
  15. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -3
  16. package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -3
  17. package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +1 -3
  18. package/lib/chevre/service/offer/product.js +1 -2
  19. package/lib/chevre/service/order/confirmPayTransaction.js +1 -3
  20. package/lib/chevre/service/order/placeOrder.js +2 -6
  21. package/lib/chevre/service/order/returnOrder.js +1 -3
  22. package/lib/chevre/service/order/sendOrder.js +1 -2
  23. package/lib/chevre/service/payment/any.js +1 -2
  24. package/lib/chevre/service/payment/creditCard.js +2 -5
  25. package/lib/chevre/service/payment/faceToFace.js +2 -5
  26. package/lib/chevre/service/payment/movieTicket.js +2 -6
  27. package/lib/chevre/service/payment/paymentCard.js +2 -4
  28. package/lib/chevre/service/product.js +1 -3
  29. package/lib/chevre/service/reserve/cancelReservation.js +2 -6
  30. package/lib/chevre/service/reserve/confirmReservation.js +1 -3
  31. package/lib/chevre/service/reserve/useReservation.js +1 -3
  32. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -3
  33. package/lib/chevre/service/task/confirmReserveTransaction.js +1 -3
  34. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -14
  35. package/lib/chevre/service/task/returnPayTransaction.js +1 -2
  36. package/lib/chevre/service/task/returnReserveTransaction.js +1 -2
  37. package/lib/chevre/service/transaction/deleteTransaction.js +1 -3
  38. package/lib/chevre/service/transaction/moneyTransfer.js +1 -2
  39. package/lib/chevre/settings.d.ts +0 -2
  40. package/lib/chevre/settings.js +1 -3
  41. package/package.json +1 -1
@@ -0,0 +1,37 @@
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
+ // tslint:disable-next-line:max-func-body-length
9
+ async function main() {
10
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
11
+
12
+ const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
13
+ const action = await actionRepo.start({
14
+ project: { typeOf: chevre.factory.organizationType.Project, id: project.id },
15
+ typeOf: chevre.factory.actionType.CreateAction,
16
+ agent: {
17
+ id: project.id,
18
+ name: 'sample',
19
+ typeOf: chevre.factory.organizationType.Project
20
+ },
21
+ object: { typeOf: chevre.factory.offerType.Offer },
22
+ ...{
23
+ targetCollection: { typeOf: chevre.factory.offerType.Offer }
24
+ }
25
+ });
26
+ const error = new Error('sample error');
27
+ await actionRepo.giveUp({
28
+ typeOf: action.typeOf,
29
+ id: action.id,
30
+ // error: { ...error, message: error.message, name: error.name }
31
+ error
32
+ });
33
+ }
34
+
35
+ main()
36
+ .then()
37
+ .catch(console.error);
@@ -80,11 +80,11 @@ export declare class MongoRepository {
80
80
  /**
81
81
  * アクション失敗
82
82
  */
83
- giveUp<T extends factory.actionType>(params: {
84
- typeOf: T;
83
+ giveUp(params: {
84
+ typeOf: factory.actionType;
85
85
  id: string;
86
- error: any;
87
- }): Promise<IAction<T>>;
86
+ error: Error;
87
+ }): Promise<void>;
88
88
  /**
89
89
  * 一定期間ActiveActionStatusのアクションをFailedActionStatusにする
90
90
  */
@@ -514,20 +514,25 @@ class MongoRepository {
514
514
  */
515
515
  giveUp(params) {
516
516
  return __awaiter(this, void 0, void 0, function* () {
517
+ const actionError = Object.assign(Object.assign({}, params.error), { message: params.error.message, name: params.error.name });
518
+ // const actionError: Object = params.error;
519
+ // if (params.error instanceof Error) {
520
+ // actionError = { ...params.error, message: params.error.message, name: params.error.name };
521
+ // }
517
522
  const doc = yield this.actionModel.findOneAndUpdate({
518
523
  typeOf: params.typeOf,
519
524
  _id: params.id
520
525
  }, {
521
526
  actionStatus: factory.actionStatusType.FailedActionStatus,
522
- error: params.error,
527
+ error: actionError,
523
528
  endDate: new Date()
524
529
  }, { new: true })
525
- .select({ __v: 0, createdAt: 0, updatedAt: 0 })
530
+ .select({ _id: 1 })
526
531
  .exec();
527
532
  if (doc === null) {
528
533
  throw new factory.errors.NotFound(this.actionModel.modelName);
529
534
  }
530
- return doc.toObject();
535
+ // return doc.toObject();
531
536
  });
532
537
  }
533
538
  /**
@@ -165,20 +165,11 @@ class MongoRepository {
165
165
  switch (typeOf) {
166
166
  case factory.service.paymentService.PaymentServiceType.CreditCard:
167
167
  case factory.service.paymentService.PaymentServiceType.MovieTicket:
168
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
169
- doc = yield this.paymentServiceModel.findOneAndUpdate({
170
- _id: { $eq: params.id },
171
- typeOf: { $eq: typeOf }
172
- }, { $set: setFields }, { upsert: false, new: true, projection: { _id: 1 } })
173
- .exec();
174
- }
175
- else {
176
- doc = yield this.productModel.findOneAndUpdate({
177
- _id: { $eq: params.id },
178
- typeOf: { $eq: typeOf }
179
- }, { $set: setFields }, { upsert: false, new: true, projection: { _id: 1 } })
180
- .exec();
181
- }
168
+ doc = yield this.paymentServiceModel.findOneAndUpdate({
169
+ _id: { $eq: params.id },
170
+ typeOf: { $eq: typeOf }
171
+ }, { $set: setFields }, { upsert: false, new: true, projection: { _id: 1 } })
172
+ .exec();
182
173
  break;
183
174
  default:
184
175
  throw new factory.errors.NotImplemented(`${typeOf} not implemented`);
@@ -187,28 +178,14 @@ class MongoRepository {
187
178
  else {
188
179
  const _b = params.$set, { id } = _b, createParams = __rest(_b, ["id"]);
189
180
  if (params.createIfNotExist === true) {
190
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
191
- doc = yield this.paymentServiceModel.findOneAndUpdate({
192
- 'project.id': { $eq: createParams.project.id },
193
- typeOf: { $eq: createParams.typeOf }
194
- }, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
195
- .exec();
196
- }
197
- else {
198
- doc = yield this.productModel.findOneAndUpdate({
199
- 'project.id': { $eq: createParams.project.id },
200
- typeOf: { $eq: createParams.typeOf }
201
- }, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
202
- .exec();
203
- }
181
+ doc = yield this.paymentServiceModel.findOneAndUpdate({
182
+ 'project.id': { $eq: createParams.project.id },
183
+ typeOf: { $eq: createParams.typeOf }
184
+ }, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
185
+ .exec();
204
186
  }
205
187
  else {
206
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
207
- doc = yield this.paymentServiceModel.create(createParams);
208
- }
209
- else {
210
- doc = yield this.productModel.create(createParams);
211
- }
188
+ doc = yield this.paymentServiceModel.create(createParams);
212
189
  }
213
190
  }
214
191
  if (doc === null) {
@@ -224,15 +201,6 @@ class MongoRepository {
224
201
  var _a;
225
202
  return __awaiter(this, void 0, void 0, function* () {
226
203
  const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
227
- // 強制的にtypeOfを絞る
228
- andConditions.push({
229
- typeOf: {
230
- $in: [
231
- factory.service.paymentService.PaymentServiceType.CreditCard,
232
- factory.service.paymentService.PaymentServiceType.MovieTicket
233
- ]
234
- }
235
- });
236
204
  let projection = {};
237
205
  if (Array.isArray(inclusion) && inclusion.length > 0) {
238
206
  inclusion.forEach((field) => {
@@ -253,9 +221,7 @@ class MongoRepository {
253
221
  });
254
222
  }
255
223
  }
256
- const query = (settings_1.USE_PAYMENT_SERVICE_COLLECTION)
257
- ? this.paymentServiceModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection)
258
- : this.productModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
224
+ const query = this.paymentServiceModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
259
225
  if (typeof conditions.limit === 'number' && conditions.limit > 0) {
260
226
  const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
261
227
  query.limit(conditions.limit)
@@ -273,14 +239,8 @@ class MongoRepository {
273
239
  }
274
240
  deletePaymentServiceById(params) {
275
241
  return __awaiter(this, void 0, void 0, function* () {
276
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
277
- yield this.paymentServiceModel.findOneAndDelete({ _id: params.id })
278
- .exec();
279
- }
280
- else {
281
- yield this.productModel.findOneAndDelete({ _id: params.id })
282
- .exec();
283
- }
242
+ yield this.paymentServiceModel.findOneAndDelete({ _id: params.id })
243
+ .exec();
284
244
  });
285
245
  }
286
246
  /**
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const mongoose_1 = require("mongoose");
14
14
  const paymentService_1 = require("./mongoose/schemas/paymentService");
15
- const product_1 = require("./mongoose/schemas/product");
16
15
  const factory = require("../factory");
17
16
  const settings_1 = require("../settings");
18
17
  /**
@@ -20,9 +19,7 @@ const settings_1 = require("../settings");
20
19
  */
21
20
  class MongoRepository {
22
21
  constructor(connection) {
23
- this.paymentServiceModel = (settings_1.USE_PAYMENT_SERVICE_COLLECTION)
24
- ? connection.model(paymentService_1.modelName, (0, paymentService_1.createSchema)())
25
- : connection.model(product_1.modelName, (0, product_1.createSchema)());
22
+ this.paymentServiceModel = connection.model(paymentService_1.modelName, (0, paymentService_1.createSchema)());
26
23
  }
27
24
  /**
28
25
  * 決済サービスプロバイダー検索
@@ -158,20 +158,6 @@ class MongoRepository {
158
158
  var _a;
159
159
  return __awaiter(this, void 0, void 0, function* () {
160
160
  const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
161
- // 強制的にtypeOfを絞る(2023-12-19~)
162
- if (settings_1.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY) {
163
- andConditions.push({
164
- typeOf: {
165
- $in: [
166
- factory.product.ProductType.EventService,
167
- factory.product.ProductType.MembershipService,
168
- factory.product.ProductType.PaymentCard,
169
- factory.product.ProductType.Product,
170
- factory.product.ProductType.Transportation
171
- ]
172
- }
173
- });
174
- }
175
161
  let projection = {};
176
162
  if (Array.isArray(inclusion) && inclusion.length > 0) {
177
163
  inclusion.forEach((field) => {
@@ -89,10 +89,8 @@ function verifyToken(params) {
89
89
  }
90
90
  catch (error) {
91
91
  if (repos.action !== undefined && action !== undefined) {
92
- // actionにエラー結果を追加
93
92
  try {
94
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
95
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
93
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
96
94
  }
97
95
  catch (__) {
98
96
  // 失敗したら仕方ない
@@ -53,10 +53,8 @@ function givePointAward(params) {
53
53
  yield MoneyTransferAssetTransactionService.confirm({ transactionNumber })(repos);
54
54
  }
55
55
  catch (error) {
56
- // actionにエラー結果を追加
57
56
  try {
58
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
59
- yield repos.action.giveUp({ typeOf: params.typeOf, id: action.id, error: actionError });
57
+ yield repos.action.giveUp({ typeOf: params.typeOf, id: action.id, error });
60
58
  }
61
59
  catch (__) {
62
60
  // 失敗したら仕方ない
@@ -130,10 +128,8 @@ function returnPointAward(params) {
130
128
  }
131
129
  }
132
130
  catch (error) {
133
- // actionにエラー結果を追加
134
131
  try {
135
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
136
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
132
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
137
133
  }
138
134
  catch (__) {
139
135
  // 失敗したら仕方ない
@@ -72,10 +72,8 @@ function createEvent(params) {
72
72
  }
73
73
  }
74
74
  catch (error) {
75
- // actionにエラー結果を追加
76
75
  try {
77
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
78
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
76
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
79
77
  }
80
78
  catch (__) {
81
79
  // 失敗したら仕方ない
@@ -183,10 +183,8 @@ function importFromCOA(params) {
183
183
  }
184
184
  }
185
185
  catch (error) {
186
- // actionにエラー結果を追加
187
186
  try {
188
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
189
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
187
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
190
188
  }
191
189
  catch (__) {
192
190
  // 失敗したら仕方ない
@@ -800,10 +798,8 @@ function updateEvent4ttts(params) {
800
798
  });
801
799
  }
802
800
  catch (error) {
803
- // actionにエラー結果を追加
804
801
  try {
805
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
806
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
802
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
807
803
  }
808
804
  catch (__) {
809
805
  // 失敗したら仕方ない
@@ -431,9 +431,7 @@ function moneyTransfer(params) {
431
431
  }
432
432
  catch (error) {
433
433
  try {
434
- // tslint:disable-next-line:max-line-length no-single-line-block-comment
435
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
436
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
434
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
437
435
  }
438
436
  catch (__) {
439
437
  // no op
@@ -101,10 +101,8 @@ function sendEmailMessage(params) {
101
101
  result = { statusCode, statusMessage };
102
102
  }
103
103
  catch (error) {
104
- // actionにエラー結果を追加
105
104
  try {
106
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
107
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
105
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
108
106
  }
109
107
  catch (__) {
110
108
  // 失敗したら仕方ない
@@ -358,10 +356,8 @@ function processInformAction(params) {
358
356
  throwsError = false;
359
357
  }
360
358
  if (throwsError) {
361
- // actionにエラー結果を追加
362
359
  try {
363
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
364
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
360
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
365
361
  }
366
362
  catch (__) {
367
363
  // 失敗したら仕方ない
@@ -80,8 +80,7 @@ function authorize(params) {
80
80
  }
81
81
  catch (error) {
82
82
  try {
83
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
84
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
83
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
85
84
  }
86
85
  catch (__) {
87
86
  // no op
@@ -76,8 +76,7 @@ function authorize(params) {
76
76
  pendingTransaction
77
77
  });
78
78
  const failedAction = yield repos.action.start(failedActionAttributes);
79
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
80
- yield repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error: actionError });
79
+ yield repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
81
80
  throw error;
82
81
  }
83
82
  // 承認アクションを開始
@@ -93,8 +92,7 @@ function authorize(params) {
93
92
  }
94
93
  catch (error) {
95
94
  try {
96
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
97
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
95
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
98
96
  }
99
97
  catch (__) {
100
98
  // no op
@@ -50,10 +50,8 @@ function authorize(params) {
50
50
  }
51
51
  }
52
52
  catch (error) {
53
- // actionにエラー結果を追加
54
53
  try {
55
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
56
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
54
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
57
55
  }
58
56
  catch (__) {
59
57
  // 失敗したら仕方ない
@@ -66,9 +66,7 @@ function returnMoneyTransfer(params) {
66
66
  }
67
67
  catch (error) {
68
68
  try {
69
- // tslint:disable-next-line:max-line-length no-single-line-block-comment
70
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
71
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
69
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
72
70
  }
73
71
  catch (__) {
74
72
  // no op
@@ -19,9 +19,7 @@ function settleTransaction(params) {
19
19
  }
20
20
  catch (error) {
21
21
  try {
22
- // tslint:disable-next-line:max-line-length no-single-line-block-comment
23
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
24
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
22
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
25
23
  }
26
24
  catch (__) {
27
25
  // no op
@@ -155,8 +155,7 @@ function authorize(params) {
155
155
  }
156
156
  catch (error) {
157
157
  try {
158
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
159
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
158
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
160
159
  }
161
160
  catch (__) {
162
161
  // no op
@@ -42,10 +42,8 @@ function confirmPayTransaction(data) {
42
42
  }
43
43
  }
44
44
  catch (error) {
45
- // actionにエラー結果を追加
46
45
  try {
47
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
48
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
46
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
49
47
  }
50
48
  catch (__) {
51
49
  // 失敗したら仕方ない
@@ -151,10 +151,8 @@ function placeOrderWithoutTransaction(params) {
151
151
  yield repos.order.createIfNotExist(Object.assign(Object.assign({}, order), { discounts: [], acceptedOffers: [] }));
152
152
  }
153
153
  catch (error) {
154
- // actionにエラー結果を追加
155
154
  try {
156
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
157
- yield repos.action.giveUp({ typeOf: orderActionAttributes.typeOf, id: action.id, error: actionError });
155
+ yield repos.action.giveUp({ typeOf: orderActionAttributes.typeOf, id: action.id, error });
158
156
  }
159
157
  catch (__) {
160
158
  // 失敗したら仕方ない
@@ -229,10 +227,8 @@ function placeOrder(params) {
229
227
  yield repos.order.createIfNotExist(order);
230
228
  }
231
229
  catch (error) {
232
- // actionにエラー結果を追加
233
230
  try {
234
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
235
- yield repos.action.giveUp({ typeOf: orderActionAttributes.typeOf, id: action.id, error: actionError });
231
+ yield repos.action.giveUp({ typeOf: orderActionAttributes.typeOf, id: action.id, error });
236
232
  }
237
233
  catch (__) {
238
234
  // 失敗したら仕方ない
@@ -89,10 +89,8 @@ function returnOrder(params) {
89
89
  debug('repos.order.returnOrder processed. returnedOrder:', order);
90
90
  }
91
91
  catch (error) {
92
- // actionにエラー結果を追加
93
92
  try {
94
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
95
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
93
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
96
94
  }
97
95
  catch (__) {
98
96
  // 失敗したら仕方ない
@@ -94,8 +94,7 @@ function sendOrder(params) {
94
94
  }
95
95
  catch (error) {
96
96
  try {
97
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
98
- yield repos.action.giveUp({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, error: actionError });
97
+ yield repos.action.giveUp({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, error });
99
98
  }
100
99
  catch (_) {
101
100
  // no op
@@ -328,8 +328,7 @@ function authorize(params) {
328
328
  }
329
329
  catch (error) {
330
330
  try {
331
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
332
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
331
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
333
332
  }
334
333
  catch (__) {
335
334
  // no op
@@ -293,10 +293,8 @@ function payCreditCard(params) {
293
293
  })));
294
294
  }
295
295
  catch (error) {
296
- // actionにエラー結果を追加
297
296
  try {
298
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
299
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
297
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
300
298
  }
301
299
  catch (__) {
302
300
  // 失敗したら仕方ない
@@ -424,8 +422,7 @@ function refundCreditCard(params, requirePayAction) {
424
422
  }
425
423
  catch (error) {
426
424
  try {
427
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
428
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
425
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
429
426
  }
430
427
  catch (__) {
431
428
  // no op
@@ -26,10 +26,8 @@ function payFaceToFace(params) {
26
26
  // no op
27
27
  }
28
28
  catch (error) {
29
- // actionにエラー結果を追加
30
29
  try {
31
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
32
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
30
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
33
31
  }
34
32
  catch (__) {
35
33
  // 失敗したら仕方ない
@@ -52,8 +50,7 @@ function refundFaceToFace(params) {
52
50
  }
53
51
  catch (error) {
54
52
  try {
55
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
56
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
53
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
57
54
  }
58
55
  catch (__) {
59
56
  // no op
@@ -70,10 +70,8 @@ function checkMovieTicket(params) {
70
70
  // }));
71
71
  }
72
72
  catch (error) {
73
- // actionにエラー結果を追加
74
73
  try {
75
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
76
- yield repos.action.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error: actionError });
74
+ yield repos.action.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
77
75
  }
78
76
  catch (__) {
79
77
  // 失敗したら仕方ない
@@ -260,10 +258,8 @@ function payMovieTicket(params) {
260
258
  }
261
259
  }
262
260
  if (throwsError) {
263
- // actionにエラー結果を追加
264
261
  try {
265
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
266
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
262
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
267
263
  }
268
264
  catch (__) {
269
265
  // 失敗したら仕方ない
@@ -255,8 +255,7 @@ function payPaymentCard(params) {
255
255
  }
256
256
  catch (error) {
257
257
  try {
258
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
259
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
258
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
260
259
  }
261
260
  catch (__) {
262
261
  // no op
@@ -369,8 +368,7 @@ function refundPaymentCard(params) {
369
368
  }
370
369
  catch (error) {
371
370
  try {
372
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
373
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
371
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
374
372
  }
375
373
  catch (__) {
376
374
  // no op
@@ -32,10 +32,8 @@ function registerService(params) {
32
32
  : undefined))({ serviceOutput: repos.serviceOutput });
33
33
  }
34
34
  catch (error) {
35
- // actionにエラー結果を追加
36
35
  try {
37
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
38
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
36
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
39
37
  }
40
38
  catch (__) {
41
39
  // 失敗したら仕方ない
@@ -130,10 +130,8 @@ function cancelPengindIfNotYet(params, __) {
130
130
  }
131
131
  }
132
132
  catch (error) {
133
- // actionにエラー結果を追加
134
133
  try {
135
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
136
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
134
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
137
135
  }
138
136
  catch (__) {
139
137
  // 失敗したら仕方ない
@@ -271,10 +269,8 @@ function cancelReservation(actionAttributesList) {
271
269
  }
272
270
  }
273
271
  catch (error) {
274
- // actionにエラー結果を追加
275
272
  try {
276
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
277
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
273
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
278
274
  }
279
275
  catch (__) {
280
276
  // 失敗したら仕方ない
@@ -128,10 +128,8 @@ function reserveIfNotYet(params, options) {
128
128
  }
129
129
  }
130
130
  catch (error) {
131
- // actionにエラー結果を追加
132
131
  try {
133
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
134
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
132
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
135
133
  }
136
134
  catch (__) {
137
135
  // 失敗したら仕方ない
@@ -79,10 +79,8 @@ function useReservation(params) {
79
79
  attendedReservation = (yield repos.reservation.attendIfNotAttended({ id: reservationId, now }));
80
80
  }
81
81
  catch (error) {
82
- // actionにエラー結果を追加
83
82
  try {
84
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
85
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
83
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
86
84
  }
87
85
  catch (__) {
88
86
  // 失敗したら仕方ない
@@ -68,10 +68,8 @@ function confirmRegisterServiceTransaction(params) {
68
68
  }
69
69
  }
70
70
  catch (error) {
71
- // actionにエラー結果を追加
72
71
  try {
73
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
74
- yield repos.action.giveUp({ typeOf: confirmActionAttributes.typeOf, id: action.id, error: actionError });
72
+ yield repos.action.giveUp({ typeOf: confirmActionAttributes.typeOf, id: action.id, error });
75
73
  }
76
74
  catch (__) {
77
75
  // 失敗したら仕方ない
@@ -78,10 +78,8 @@ function confirmReserveTransaction(params) {
78
78
  }
79
79
  }
80
80
  catch (error) {
81
- // actionにエラー結果を追加
82
81
  try {
83
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
84
- yield repos.action.giveUp({ typeOf: confirmActionAttributes.typeOf, id: action.id, error: actionError });
82
+ yield repos.action.giveUp({ typeOf: confirmActionAttributes.typeOf, id: action.id, error });
85
83
  }
86
84
  catch (__) {
87
85
  // 失敗したら仕方ない
@@ -121,8 +121,7 @@ function deleteResourcesByScreeningEventSeries(params) {
121
121
  }
122
122
  catch (error) {
123
123
  try {
124
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
125
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
124
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
126
125
  }
127
126
  catch (_) {
128
127
  // no op
@@ -156,8 +155,7 @@ function deleteResourcesByScreeningRoom(params) {
156
155
  }
157
156
  catch (error) {
158
157
  try {
159
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
160
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
158
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
161
159
  }
162
160
  catch (_) {
163
161
  // no op
@@ -201,8 +199,7 @@ function deleteResourcesByMovieTheater(params) {
201
199
  }
202
200
  catch (error) {
203
201
  try {
204
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
205
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
202
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
206
203
  }
207
204
  catch (_) {
208
205
  // no op
@@ -265,8 +262,7 @@ function deleteResourcesBySeller(params) {
265
262
  }
266
263
  catch (error) {
267
264
  try {
268
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
269
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
265
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
270
266
  }
271
267
  catch (_) {
272
268
  // no op
@@ -306,8 +302,7 @@ function deleteResourcesByAggregateOffer(params) {
306
302
  }
307
303
  catch (error) {
308
304
  try {
309
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
310
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
305
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
311
306
  }
312
307
  catch (_) {
313
308
  // no op
@@ -367,8 +362,7 @@ function deleteResourcesByOfferCatalog(params) {
367
362
  }
368
363
  catch (error) {
369
364
  try {
370
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
371
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
365
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
372
366
  }
373
367
  catch (_) {
374
368
  // no op
@@ -410,8 +404,7 @@ function deleteResourcesByProduct(params) {
410
404
  }
411
405
  catch (error) {
412
406
  try {
413
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
414
- yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error: actionError });
407
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
415
408
  }
416
409
  catch (_) {
417
410
  // no op
@@ -103,8 +103,7 @@ function returnPayTransaction(params) {
103
103
  }
104
104
  catch (error) {
105
105
  try {
106
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
107
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
106
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
108
107
  }
109
108
  catch (__) {
110
109
  // no op
@@ -61,8 +61,7 @@ function cancelReservation(params) {
61
61
  }
62
62
  catch (error) {
63
63
  try {
64
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
65
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
64
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
66
65
  }
67
66
  catch (__) {
68
67
  // no op
@@ -243,10 +243,8 @@ function deleteTransactionById(params) {
243
243
  }
244
244
  }
245
245
  catch (error) {
246
- // actionにエラー結果を追加
247
246
  try {
248
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
249
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
247
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
250
248
  }
251
249
  catch (__) {
252
250
  // 失敗したら仕方ない
@@ -222,8 +222,7 @@ function processAuthorizePaymentCard(params) {
222
222
  }
223
223
  catch (error) {
224
224
  try {
225
- const actionError = Object.assign(Object.assign({}, error), { name: error.name, message: error.message });
226
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
225
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
227
226
  }
228
227
  catch (__) {
229
228
  // no op
@@ -41,8 +41,6 @@ export declare const USE_ORDER_PAYMENT_DUE_ON_PLACED: boolean;
41
41
  export declare const USE_OPTIMIZE_TICKET_OFFER: boolean;
42
42
  export declare const USE_ORDER_PAYMENT_METHOD_TYPE_OF: boolean;
43
43
  export declare const USE_FETCH_API: boolean;
44
- export declare const USE_SEARCH_ONLY_PRODUCTS_FORCIBLY: boolean;
45
- export declare const USE_PAYMENT_SERVICE_COLLECTION: 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;
@@ -1,6 +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_PAYMENT_SERVICE_COLLECTION = exports.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY = 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;
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;
4
4
  const factory = require("./factory");
5
5
  const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
6
6
  ? process.env.INFORM_TRANSACTION_URL.split(' ')
@@ -65,8 +65,6 @@ exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = process.env.USE_ORDER_PAYMENT_DUE_ON_P
65
65
  exports.USE_OPTIMIZE_TICKET_OFFER = process.env.USE_OPTIMIZE_TICKET_OFFER === '1';
66
66
  exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = process.env.USE_ORDER_PAYMENT_METHOD_TYPE_OF === '1';
67
67
  exports.USE_FETCH_API = process.env.USE_FETCH_API === '1';
68
- exports.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY = process.env.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY === '1';
69
- exports.USE_PAYMENT_SERVICE_COLLECTION = process.env.USE_PAYMENT_SERVICE_COLLECTION === '1';
70
68
  exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
71
69
  ? Number(process.env.MONGO_MAX_TIME_MS)
72
70
  // tslint:disable-next-line:no-magic-numbers
package/package.json CHANGED
@@ -115,5 +115,5 @@
115
115
  "postversion": "git push origin --tags",
116
116
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
117
117
  },
118
- "version": "21.19.0-alpha.12"
118
+ "version": "21.19.0-alpha.14"
119
119
  }