@chevre/domain 20.4.0-alpha.29 → 20.4.0-alpha.30

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.
@@ -35,13 +35,6 @@ export declare class MongoRepository {
35
35
  }): Promise<IObject>;
36
36
  count(params: factory.authorization.ISearchConditions): Promise<number>;
37
37
  search(params: factory.authorization.ISearchConditions): Promise<factory.authorization.IAuthorization[]>;
38
- deleteByCode(params: {
39
- code: string;
40
- }): Promise<{
41
- n?: number;
42
- ok?: number;
43
- deletedCount?: number;
44
- } | null>;
45
38
  /**
46
39
  * 有効期限を一定期間過ぎた承認を削除する
47
40
  */
@@ -204,23 +204,6 @@ class MongoRepository {
204
204
  .then((docs) => docs.map((doc) => doc.toObject()));
205
205
  });
206
206
  }
207
- deleteByCode(params) {
208
- return __awaiter(this, void 0, void 0, function* () {
209
- return this.authorizationModel.deleteOne({
210
- code: { $exists: true, $eq: params.code }
211
- })
212
- .exec()
213
- .then((result) => {
214
- return {
215
- n: result === null || result === void 0 ? void 0 : result.n,
216
- // opTime: result.opTime,
217
- ok: result === null || result === void 0 ? void 0 : result.ok,
218
- // operationTime,
219
- deletedCount: result === null || result === void 0 ? void 0 : result.deletedCount
220
- };
221
- });
222
- });
223
- }
224
207
  /**
225
208
  * 有効期限を一定期間過ぎた承認を削除する
226
209
  */
@@ -28,10 +28,6 @@ export declare class MongoRepository {
28
28
  };
29
29
  };
30
30
  }): Promise<void>;
31
- findById(params: {
32
- id: string;
33
- }): Promise<factory.offerCatalog.IOfferCatalog>;
34
- count(params: factory.offerCatalog.ISearchConditions): Promise<number>;
35
31
  search(params: factory.offerCatalog.ISearchConditions): Promise<(Omit<factory.offerCatalog.IOfferCatalog, 'itemListElement'> & {
36
32
  numberOfItems?: number;
37
33
  })[]>;
@@ -178,30 +178,33 @@ class MongoRepository {
178
178
  .exec();
179
179
  });
180
180
  }
181
- findById(params) {
182
- return __awaiter(this, void 0, void 0, function* () {
183
- const doc = yield this.offerCatalogModel.findOne({
184
- _id: params.id
185
- }, {
186
- __v: 0,
187
- createdAt: 0,
188
- updatedAt: 0
189
- })
190
- .exec();
191
- if (doc === null) {
192
- throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
193
- }
194
- return doc.toObject();
195
- });
196
- }
197
- count(params) {
198
- return __awaiter(this, void 0, void 0, function* () {
199
- const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
200
- return this.offerCatalogModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
201
- .setOptions({ maxTimeMS: 10000 })
202
- .exec();
203
- });
204
- }
181
+ // public async findById(params: {
182
+ // id: string;
183
+ // }): Promise<factory.offerCatalog.IOfferCatalog> {
184
+ // const doc = await this.offerCatalogModel.findOne(
185
+ // {
186
+ // _id: params.id
187
+ // },
188
+ // {
189
+ // __v: 0,
190
+ // createdAt: 0,
191
+ // updatedAt: 0
192
+ // }
193
+ // )
194
+ // .exec();
195
+ // if (doc === null) {
196
+ // throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
197
+ // }
198
+ // return doc.toObject();
199
+ // }
200
+ // public async count(
201
+ // params: factory.offerCatalog.ISearchConditions
202
+ // ): Promise<number> {
203
+ // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
204
+ // return this.offerCatalogModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
205
+ // .setOptions({ maxTimeMS: 10000 })
206
+ // .exec();
207
+ // }
205
208
  search(params) {
206
209
  return __awaiter(this, void 0, void 0, function* () {
207
210
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
@@ -33,4 +33,4 @@ export declare function exportTasks<T extends factory.assetTransactionType>(para
33
33
  project: ProjectRepo;
34
34
  task: TaskRepo;
35
35
  assetTransaction: AssetTransactionRepo;
36
- }) => Promise<(import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/deleteAssetTransaction").ITask | import("@chevre/factory/lib/task/deleteAuthorization").ITask | import("@chevre/factory/lib/task/deleteOrder").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/deleteMember").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask)[] | undefined>;
36
+ }) => Promise<(import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/deleteAssetTransaction").ITask | import("@chevre/factory/lib/task/deleteOrder").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/deleteMember").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask)[] | undefined>;
@@ -3,14 +3,6 @@ import { MongoRepository as AuthorizationRepo } from '../repo/code';
3
3
  import * as factory from '../factory';
4
4
  export declare type IToken = string;
5
5
  export declare type ICode = string;
6
- /**
7
- * 承認を削除する
8
- * 冪等性を確保すること
9
- */
10
- export declare function deleteAuthorization(params: factory.task.IData<factory.taskName.DeleteAuthorization>): (repos: {
11
- action: ActionRepo;
12
- authorization: AuthorizationRepo;
13
- }) => Promise<void>;
14
6
  /**
15
7
  * コードをトークンに変換する
16
8
  */
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.verifyToken = exports.getToken = exports.deleteAuthorization = void 0;
12
+ exports.verifyToken = exports.getToken = void 0;
13
13
  /**
14
14
  * 承認サービス
15
15
  */
@@ -17,43 +17,6 @@ const jwt = require("jsonwebtoken");
17
17
  const code_1 = require("../repo/code");
18
18
  const factory = require("../factory");
19
19
  const credentials_1 = require("../credentials");
20
- /**
21
- * 承認を削除する
22
- * 冪等性を確保すること
23
- */
24
- function deleteAuthorization(params) {
25
- return (repos) => __awaiter(this, void 0, void 0, function* () {
26
- const authorization = params.object;
27
- // Deleteアクションを作成(logとしての意味合いも含めて)
28
- const actionAttributes = {
29
- typeOf: factory.actionType.DeleteAction,
30
- project: authorization.project,
31
- object: authorization,
32
- agent: authorization.project
33
- };
34
- let deleteAuthorizationResult;
35
- const action = yield repos.action.start(actionAttributes);
36
- try {
37
- // 承認削除
38
- deleteAuthorizationResult = yield repos.authorization.deleteByCode({ code: authorization.code });
39
- }
40
- catch (error) {
41
- // actionにエラー結果を追加
42
- try {
43
- const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
44
- yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
45
- }
46
- catch (__) {
47
- // 失敗したら仕方ない
48
- }
49
- throw error;
50
- }
51
- // アクション完了
52
- const actionResult = { deleteAuthorizationResult };
53
- yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult });
54
- });
55
- }
56
- exports.deleteAuthorization = deleteAuthorization;
57
20
  /**
58
21
  * コードをトークンに変換する
59
22
  */
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.291.0",
13
- "@cinerino/sdk": "3.141.0",
12
+ "@chevre/factory": "4.292.0",
13
+ "@cinerino/sdk": "3.143.0",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.4.0-alpha.29"
123
+ "version": "20.4.0-alpha.30"
124
124
  }
@@ -1,6 +0,0 @@
1
- import { IOperation } from '../task';
2
- import * as factory from '../../factory';
3
- /**
4
- * タスク実行関数
5
- */
6
- export declare function call(data: factory.task.IData<factory.taskName.DeleteAuthorization>): IOperation<void>;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.call = void 0;
13
- const action_1 = require("../../repo/action");
14
- const code_1 = require("../../repo/code");
15
- const CodeService = require("../code");
16
- /**
17
- * タスク実行関数
18
- */
19
- function call(data) {
20
- return (settings) => __awaiter(this, void 0, void 0, function* () {
21
- const actionRepo = new action_1.MongoRepository(settings.connection);
22
- const authorizationRepoRepo = new code_1.MongoRepository(settings.connection);
23
- yield CodeService.deleteAuthorization(data)({
24
- action: actionRepo,
25
- authorization: authorizationRepoRepo
26
- });
27
- });
28
- }
29
- exports.call = call;