@chevre/domain 23.2.0-alpha.3 → 23.2.0-alpha.5

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.
@@ -0,0 +1,49 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../../lib/index';
5
+
6
+ async function main() {
7
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
+
9
+ const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
10
+
11
+ const roleNames = [
12
+ // chevre.factory.role.organizationRole.RoleName.InventoryManager,
13
+ // chevre.factory.role.organizationRole.RoleName.SellersOwner,
14
+ // chevre.factory.role.organizationRole.RoleName.SellersInventoryManager,
15
+ chevre.factory.role.organizationRole.RoleName.TicketClerk
16
+ ];
17
+ const permissions = [
18
+ 'admin.sellers.eventSeries.read'
19
+ ];
20
+ for (const roleName of roleNames) {
21
+ for (const permission of permissions) {
22
+ const result = await roleRepo.addPermissionIfNotExists({
23
+ roleName: { $eq: roleName },
24
+ permission
25
+ });
26
+ console.log('permission added.', result, roleName);
27
+ }
28
+ }
29
+
30
+ // roleNames = [
31
+ // chevre.factory.role.organizationRole.RoleName.TicketClerk
32
+ // ];
33
+ // permissions = [
34
+ // 'admin.sellers.productOffers.read'
35
+ // ];
36
+ // for (const roleName of roleNames) {
37
+ // for (const permission of permissions) {
38
+ // const result = await roleRepo.addPermissionIfNotExists({
39
+ // roleName: { $eq: roleName },
40
+ // permission
41
+ // });
42
+ // console.log('permission added.', result, roleName);
43
+ // }
44
+ // }
45
+ }
46
+
47
+ main()
48
+ .then()
49
+ .catch(console.error);
@@ -95,7 +95,7 @@ class CreativeWorkRepo {
95
95
  // 多言語名称対応(2022-07-11~)
96
96
  andConditions.push({
97
97
  $or: [
98
- { name: { $exists: true, $regex: new RegExp(params.name) } },
98
+ // { name: { $exists: true, $regex: new RegExp(params.name) } }, // string型への互換性維持を廃止(2025-12-20~)
99
99
  { 'name.ja': { $exists: true, $regex: new RegExp(params.name) } },
100
100
  { 'name.en': { $exists: true, $regex: new RegExp(params.name) } }
101
101
  ]
@@ -67,15 +67,16 @@ const indexes = [
67
67
  name: 'searchByProjectId-v20220721'
68
68
  }
69
69
  ],
70
- [
71
- { name: 1, identifier: 1 },
72
- {
73
- name: 'searchByName2',
74
- partialFilterExpression: {
75
- name: { $exists: true }
76
- }
77
- }
78
- ],
70
+ // string型への互換性維持を廃止(2025-12-20~
71
+ // [
72
+ // { name: 1, identifier: 1 },
73
+ // {
74
+ // name: 'searchByName2',
75
+ // partialFilterExpression: {
76
+ // name: { $exists: true }
77
+ // }
78
+ // }
79
+ // ],
79
80
  [
80
81
  { 'name.ja': 1, identifier: 1 },
81
82
  {
@@ -41,6 +41,10 @@ export declare function creatPayTransactionStartParams(params: {
41
41
  * 決済方法チケット
42
42
  */
43
43
  ticketToken?: string;
44
+ /**
45
+ * ツールとしての対応決済方法オファー
46
+ */
47
+ instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
44
48
  }): factory.assetTransaction.pay.IStartParamsWithoutDetail & {
45
49
  instrument: factory.action.trade.pay.IPlaceOrderRelatedInstrument[];
46
50
  };
@@ -79,7 +79,8 @@ function creatPayTransactionStartParams(params) {
79
79
  const instrument = [
80
80
  { id: params.action.id, typeOf: params.action.typeOf },
81
81
  { orderNumber, typeOf: factory.order.OrderType.Order },
82
- ...(ticketAsInstrument !== undefined) ? [ticketAsInstrument] : [] // add ticketAsInstrument(2025-11-25~)
82
+ ...(ticketAsInstrument !== undefined) ? [ticketAsInstrument] : [], // add ticketAsInstrument(2025-11-25~)
83
+ ...(Array.isArray(params.instrument)) ? params.instrument : [] // instrumentを対応決済方法オファーに対応(2025-12-14~)
83
84
  ];
84
85
  return Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
85
86
  typeOf: params.transaction.seller.typeOf,
@@ -177,6 +177,10 @@ declare function authorize(params: {
177
177
  */
178
178
  id: string;
179
179
  };
180
+ /**
181
+ * ツールとしての対応決済方法オファー
182
+ */
183
+ instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
180
184
  }): IAuthorizeOperation<{
181
185
  /**
182
186
  * 承認アクションID
@@ -539,7 +539,8 @@ function authorize(params) {
539
539
  // orderNumber required(2025-02-14~)
540
540
  order: { confirmationNumber, orderNumber },
541
541
  action: { id: action.id, typeOf: action.typeOf },
542
- ticketToken
542
+ ticketToken,
543
+ instrument: params.instrument
543
544
  });
544
545
  payTransaction = yield PayTransactionService.start(startParams, Object.assign({
545
546
  // useCheckByIdentifierIfNotYet: params.options.useCheckByIdentifierIfNotYet,
@@ -53,7 +53,7 @@ function call(params) {
53
53
  const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
54
54
  && typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
55
55
  try {
56
- yield (0, any_1.authorize)(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id } // タスクIDを関連付け(2024-04-20~)
56
+ yield (0, any_1.authorize)(Object.assign(Object.assign({}, params.data), { instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [], sameAs: { id: params.id } // タスクIDを関連付け(2024-04-20~)
57
57
  }))({
58
58
  acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
59
59
  accountingReport: new accountingReport_1.AccountingReportRepo(connection),
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": "5.4.0-alpha.7",
14
+ "@chevre/factory": "5.4.0-alpha.8",
15
15
  "@cinerino/sdk": "12.12.1",
16
16
  "@motionpicture/coa-service": "9.6.0",
17
17
  "@motionpicture/gmo-service": "5.4.0-alpha.1",
@@ -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": "23.2.0-alpha.3"
118
+ "version": "23.2.0-alpha.5"
119
119
  }