@chevre/domain 23.0.0-alpha.13 → 23.0.0-alpha.15
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/roles/{addAdminProductReadPermissionIfNotExists.ts → addAdminPaymentServiceReadPermissionIfNotExists.ts} +1 -1
- package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +1 -1
- package/example/src/chevre/roles/removePermissionIfExists.ts +1 -6
- package/example/src/objectId.ts +12 -0
- package/lib/chevre/repo/categoryCode.d.ts +44 -4
- package/lib/chevre/repo/categoryCode.js +54 -11
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateOfferToken.d.ts +15 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateOfferToken.js +61 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +68 -3
- package/lib/chevre/service/event.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +3 -3
- package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +1 -1
- package/package.json +3 -3
|
@@ -15,7 +15,7 @@ async function main() {
|
|
|
15
15
|
chevre.factory.role.organizationRole.RoleName.TicketClerk
|
|
16
16
|
];
|
|
17
17
|
const permissions = [
|
|
18
|
-
'admin.
|
|
18
|
+
'admin.paymentServices.read'
|
|
19
19
|
];
|
|
20
20
|
for (const roleName of roleNames) {
|
|
21
21
|
for (const permission of permissions) {
|
|
@@ -9,7 +9,7 @@ async function main() {
|
|
|
9
9
|
const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
|
|
10
10
|
|
|
11
11
|
const permissions = [
|
|
12
|
-
'
|
|
12
|
+
'products.read'
|
|
13
13
|
];
|
|
14
14
|
for (const permission of permissions) {
|
|
15
15
|
const roles = await roleRepo.projectFields(
|
|
@@ -9,12 +9,7 @@ async function main() {
|
|
|
9
9
|
const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
|
|
10
10
|
|
|
11
11
|
const permissions = [
|
|
12
|
-
'
|
|
13
|
-
'authorizations.create',
|
|
14
|
-
'permits.read',
|
|
15
|
-
'tasks.read',
|
|
16
|
-
'transactionNumbers.write',
|
|
17
|
-
'chevre.admin'
|
|
12
|
+
'admin.sellers.productOffers.*'
|
|
18
13
|
];
|
|
19
14
|
for (const permission of permissions) {
|
|
20
15
|
const roles = await roleRepo.projectFields(
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
// tslint:disable:no-console no-magic-numbers no-null-keyword
|
|
3
|
+
import * as mongoose from 'mongoose';
|
|
4
|
+
|
|
5
|
+
// const MONGOLAB_URI = String(process.env.MONGOLAB_URI);
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
console.log(new mongoose.Types.ObjectId());
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
main()
|
|
12
|
+
.catch(console.error);
|
|
@@ -4,13 +4,28 @@ type IKeyOfProjection = keyof factory.categoryCode.ICategoryCode;
|
|
|
4
4
|
type IUnset = {
|
|
5
5
|
[key in keyof Pick<factory.categoryCode.ICategoryCode, 'additionalProperty' | 'color' | 'image' | 'paymentMethod'>]?: 1;
|
|
6
6
|
};
|
|
7
|
+
type CategorySetIdentifierExceptMovieTicketType = Exclude<factory.categoryCode.CategorySetIdentifier, factory.categoryCode.CategorySetIdentifier.MovieTicketType>;
|
|
8
|
+
type ICategoryCodeExceptMovieTicketType = Pick<factory.categoryCode.ICategoryCode, 'additionalProperty' | 'codeValue' | 'color' | 'id' | 'image' | 'name' | 'project' | 'typeOf'> & {
|
|
9
|
+
inCodeSet: {
|
|
10
|
+
typeOf: 'CategoryCodeSet';
|
|
11
|
+
identifier: CategorySetIdentifierExceptMovieTicketType;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type IMovieTicketType = Pick<factory.categoryCode.ICategoryCode, 'additionalProperty' | 'codeValue' | 'color' | 'id' | 'image' | 'name' | 'project' | 'typeOf' | 'paymentMethod'> & {
|
|
15
|
+
inCodeSet: {
|
|
16
|
+
typeOf: 'CategoryCodeSet';
|
|
17
|
+
identifier: factory.categoryCode.CategorySetIdentifier.MovieTicketType;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
7
20
|
/**
|
|
8
21
|
* 区分リポジトリ
|
|
9
22
|
*/
|
|
10
23
|
export declare class CategoryCodeRepo {
|
|
11
24
|
private readonly categoryCodeModel;
|
|
12
25
|
constructor(connection: Connection);
|
|
13
|
-
static CREATE_MONGO_CONDITIONS(params: factory.categoryCode.ISearchConditions
|
|
26
|
+
static CREATE_MONGO_CONDITIONS(params: factory.categoryCode.ISearchConditions, options?: {
|
|
27
|
+
excludeMovieTicketType?: boolean;
|
|
28
|
+
}): FilterQuery<factory.categoryCode.ICategoryCode>[];
|
|
14
29
|
static CREATE_AGGREGATE_PROJECTION(inclusion: IKeyOfProjection[]): {
|
|
15
30
|
[field: string]: AnyExpression;
|
|
16
31
|
};
|
|
@@ -19,13 +34,38 @@ export declare class CategoryCodeRepo {
|
|
|
19
34
|
*/
|
|
20
35
|
searchByAggregate(conditions: factory.categoryCode.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.categoryCode.ICategoryCode[]>;
|
|
21
36
|
/**
|
|
22
|
-
*
|
|
37
|
+
* 区分検索
|
|
23
38
|
*/
|
|
24
|
-
|
|
39
|
+
projectCategoryCodeFields(params: Omit<factory.categoryCode.ISearchConditions, 'inCodeSet' | 'paymentMethod'> & {
|
|
40
|
+
inCodeSet?: {
|
|
41
|
+
identifier?: {
|
|
42
|
+
$eq?: CategorySetIdentifierExceptMovieTicketType;
|
|
43
|
+
$in?: CategorySetIdentifierExceptMovieTicketType[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* 空の場合無効
|
|
49
|
+
*/
|
|
50
|
+
inclusion: IKeyOfProjection[], options?: {
|
|
51
|
+
excludeMovieTicketType?: boolean;
|
|
52
|
+
}): Promise<(ICategoryCodeExceptMovieTicketType & {
|
|
53
|
+
id: string;
|
|
54
|
+
})[]>;
|
|
55
|
+
/**
|
|
56
|
+
* 決済カード区分検索
|
|
57
|
+
*/
|
|
58
|
+
projectMovieTicketTypeFields(params: Omit<factory.categoryCode.ISearchConditions, 'inCodeSet'> & {
|
|
59
|
+
inCodeSet?: {
|
|
60
|
+
identifier?: {
|
|
61
|
+
$eq?: factory.categoryCode.CategorySetIdentifier.MovieTicketType;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
},
|
|
25
65
|
/**
|
|
26
66
|
* 空の場合無効
|
|
27
67
|
*/
|
|
28
|
-
inclusion: IKeyOfProjection[]): Promise<(
|
|
68
|
+
inclusion: IKeyOfProjection[]): Promise<(IMovieTicketType & {
|
|
29
69
|
id: string;
|
|
30
70
|
})[]>;
|
|
31
71
|
save(params: {
|
|
@@ -36,9 +36,29 @@ class CategoryCodeRepo {
|
|
|
36
36
|
this.categoryCodeModel = connection.model(categoryCode_1.modelName, (0, categoryCode_1.createSchema)());
|
|
37
37
|
}
|
|
38
38
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
39
|
-
static CREATE_MONGO_CONDITIONS(params) {
|
|
39
|
+
static CREATE_MONGO_CONDITIONS(params, options) {
|
|
40
40
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
41
|
+
const excludeMovieTicketType = (options === null || options === void 0 ? void 0 : options.excludeMovieTicketType) === true;
|
|
41
42
|
const andConditions = [];
|
|
43
|
+
if (excludeMovieTicketType) {
|
|
44
|
+
andConditions.push({
|
|
45
|
+
'inCodeSet.identifier': {
|
|
46
|
+
$in: [
|
|
47
|
+
factory.categoryCode.CategorySetIdentifier.ContentRatingType,
|
|
48
|
+
factory.categoryCode.CategorySetIdentifier.CurrencyType,
|
|
49
|
+
factory.categoryCode.CategorySetIdentifier.CustomerType,
|
|
50
|
+
factory.categoryCode.CategorySetIdentifier.DistributorType,
|
|
51
|
+
factory.categoryCode.CategorySetIdentifier.MembershipType,
|
|
52
|
+
factory.categoryCode.CategorySetIdentifier.OfferCategoryType,
|
|
53
|
+
factory.categoryCode.CategorySetIdentifier.PaymentMethodType,
|
|
54
|
+
factory.categoryCode.CategorySetIdentifier.SeatingType,
|
|
55
|
+
factory.categoryCode.CategorySetIdentifier.ServiceType,
|
|
56
|
+
factory.categoryCode.CategorySetIdentifier.SoundFormatType,
|
|
57
|
+
factory.categoryCode.CategorySetIdentifier.VideoFormatType
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
42
62
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
43
63
|
/* istanbul ignore else */
|
|
44
64
|
if (params.project !== undefined && params.project !== null) {
|
|
@@ -99,7 +119,6 @@ class CategoryCodeRepo {
|
|
|
99
119
|
if (typeof params.inCodeSet.identifier.$eq === 'string') {
|
|
100
120
|
andConditions.push({
|
|
101
121
|
'inCodeSet.identifier': {
|
|
102
|
-
$exists: true,
|
|
103
122
|
$eq: params.inCodeSet.identifier.$eq
|
|
104
123
|
}
|
|
105
124
|
});
|
|
@@ -110,7 +129,6 @@ class CategoryCodeRepo {
|
|
|
110
129
|
if (Array.isArray(inCodeSetIdentifierIn)) {
|
|
111
130
|
andConditions.push({
|
|
112
131
|
'inCodeSet.identifier': {
|
|
113
|
-
$exists: true,
|
|
114
132
|
$in: inCodeSetIdentifierIn
|
|
115
133
|
}
|
|
116
134
|
});
|
|
@@ -201,9 +219,40 @@ class CategoryCodeRepo {
|
|
|
201
219
|
});
|
|
202
220
|
}
|
|
203
221
|
/**
|
|
204
|
-
*
|
|
222
|
+
* 区分検索
|
|
223
|
+
*/
|
|
224
|
+
projectCategoryCodeFields(params,
|
|
225
|
+
/**
|
|
226
|
+
* 空の場合無効
|
|
227
|
+
*/
|
|
228
|
+
inclusion, options) {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
const conditions = CategoryCodeRepo.CREATE_MONGO_CONDITIONS(params, options);
|
|
231
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
232
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
233
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
234
|
+
}
|
|
235
|
+
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
236
|
+
const query = this.categoryCodeModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
237
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
238
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
239
|
+
query.limit(params.limit)
|
|
240
|
+
.skip(params.limit * (page - 1));
|
|
241
|
+
}
|
|
242
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
243
|
+
/* istanbul ignore else */
|
|
244
|
+
if (params.sort !== undefined) {
|
|
245
|
+
query.sort(params.sort);
|
|
246
|
+
}
|
|
247
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
248
|
+
.lean() // 2024-08-19~
|
|
249
|
+
.exec();
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* 決済カード区分検索
|
|
205
254
|
*/
|
|
206
|
-
|
|
255
|
+
projectMovieTicketTypeFields(params,
|
|
207
256
|
/**
|
|
208
257
|
* 空の場合無効
|
|
209
258
|
*/
|
|
@@ -214,11 +263,6 @@ class CategoryCodeRepo {
|
|
|
214
263
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
215
264
|
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
216
265
|
}
|
|
217
|
-
else {
|
|
218
|
-
// if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
219
|
-
// positiveProjectionFields = positiveProjectionFields.filter((key) => !exclusion.includes(key));
|
|
220
|
-
// }
|
|
221
|
-
}
|
|
222
266
|
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
223
267
|
const query = this.categoryCodeModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
224
268
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
@@ -280,7 +324,6 @@ class CategoryCodeRepo {
|
|
|
280
324
|
'project.id': { $eq: p.attributes.project.id },
|
|
281
325
|
codeValue: { $eq: p.attributes.codeValue },
|
|
282
326
|
'inCodeSet.identifier': {
|
|
283
|
-
$exists: true,
|
|
284
327
|
$eq: p.attributes.inCodeSet.identifier
|
|
285
328
|
}
|
|
286
329
|
},
|
package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateOfferToken.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as moment from 'moment';
|
|
2
|
+
import * as factory from '../../../../factory';
|
|
3
|
+
declare function validateOfferToken(params: {
|
|
4
|
+
acceptedDate: moment.Moment;
|
|
5
|
+
/**
|
|
6
|
+
* トークン検証済の指定オファー
|
|
7
|
+
*/
|
|
8
|
+
verifiedOffer: factory.assetTransaction.reserve.IOfferTokenPayload;
|
|
9
|
+
/**
|
|
10
|
+
* イベントのアプリケーションオファー設定
|
|
11
|
+
*/
|
|
12
|
+
makesOfferOnApplication: factory.event.screeningEvent.ISellerMakesOffer;
|
|
13
|
+
object: factory.assetTransaction.reserve.IObjectWithoutDetail;
|
|
14
|
+
}): () => Promise<void>;
|
|
15
|
+
export { validateOfferToken };
|
package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateOfferToken.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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.validateOfferToken = validateOfferToken;
|
|
13
|
+
const moment = require("moment");
|
|
14
|
+
const factory = require("../../../../factory");
|
|
15
|
+
const OFFER_TOKEN_DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ';
|
|
16
|
+
function validateOfferToken(params) {
|
|
17
|
+
return () => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
const { acceptedDate, verifiedOffer, makesOfferOnApplication } = params;
|
|
20
|
+
const applicationIdentifier = (_a = verifiedOffer.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.identifier;
|
|
21
|
+
if (typeof applicationIdentifier !== 'string' || applicationIdentifier === '') {
|
|
22
|
+
throw new factory.errors.Argument('reservationFor.offers.token', 'availableAtOrFrom.identifier must be string');
|
|
23
|
+
}
|
|
24
|
+
const applicationIdentifierMustBe = (Array.isArray(makesOfferOnApplication.availableAtOrFrom))
|
|
25
|
+
? makesOfferOnApplication.availableAtOrFrom[0].identifier
|
|
26
|
+
: (_b = makesOfferOnApplication.availableAtOrFrom) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
27
|
+
if (typeof applicationIdentifierMustBe !== 'string') {
|
|
28
|
+
throw new factory.errors.NotFound('makesOffer.availableAtOrFrom.identifier');
|
|
29
|
+
}
|
|
30
|
+
if (applicationIdentifier !== applicationIdentifierMustBe) {
|
|
31
|
+
throw new factory.errors.Argument('reservationFor.offers.token', 'availableAtOrFrom.identifier not matched');
|
|
32
|
+
}
|
|
33
|
+
let validThroughMoment;
|
|
34
|
+
let validFromMoment;
|
|
35
|
+
validThroughMoment = moment(verifiedOffer.validThrough, OFFER_TOKEN_DATE_FORMAT, true);
|
|
36
|
+
validFromMoment = moment(verifiedOffer.validFrom, OFFER_TOKEN_DATE_FORMAT, true);
|
|
37
|
+
if (!validThroughMoment.isValid()) {
|
|
38
|
+
throw new factory.errors.Argument('reservationFor.offers.token', 'invalid validThrough');
|
|
39
|
+
}
|
|
40
|
+
if (!validFromMoment.isValid()) {
|
|
41
|
+
throw new factory.errors.Argument('reservationFor.offers.token', 'invalid validFrom');
|
|
42
|
+
}
|
|
43
|
+
if (acceptedDate.isBefore(validFromMoment)) {
|
|
44
|
+
throw new factory.errors.Argument('reservationFor.offers.token', `the offer id valid from ${validFromMoment}`);
|
|
45
|
+
}
|
|
46
|
+
if (acceptedDate.isAfter(validThroughMoment)) {
|
|
47
|
+
throw new factory.errors.Argument('reservationFor.offers.token', `the offer id valid through ${validThroughMoment}`);
|
|
48
|
+
}
|
|
49
|
+
// tslint:disable-next-line:no-suspicious-comment
|
|
50
|
+
// TODO maxValueを検証
|
|
51
|
+
const maxValue = (_c = verifiedOffer === null || verifiedOffer === void 0 ? void 0 : verifiedOffer.eligibleQuantity) === null || _c === void 0 ? void 0 : _c.maxValue;
|
|
52
|
+
if (typeof maxValue === 'number') {
|
|
53
|
+
const numAcceptedOffers = (_d = params.object.acceptedOffer) === null || _d === void 0 ? void 0 : _d.length;
|
|
54
|
+
if (typeof numAcceptedOffers === 'number' && numAcceptedOffers > 0) {
|
|
55
|
+
if (numAcceptedOffers > maxValue) {
|
|
56
|
+
throw new factory.errors.Argument('reservationFor.id', `Maximum number of offers exceeded`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
@@ -13,7 +13,7 @@ exports.validateStartRequest = validateStartRequest;
|
|
|
13
13
|
const jwt = require("jsonwebtoken");
|
|
14
14
|
const moment = require("moment");
|
|
15
15
|
const factory = require("../../../factory");
|
|
16
|
-
function
|
|
16
|
+
function verifyMemberTierToken(params) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
18
|
let result;
|
|
19
19
|
const { issuer, secret, token } = params;
|
|
@@ -46,6 +46,42 @@ function verifyOfferedByToken(params) {
|
|
|
46
46
|
return result;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
// async function verifyOfferToken(params: {
|
|
50
|
+
// token: string;
|
|
51
|
+
// secret: string;
|
|
52
|
+
// issuer?: string;
|
|
53
|
+
// }): Promise<factory.assetTransaction.reserve.IOfferTokenPayload> {
|
|
54
|
+
// let result: factory.assetTransaction.reserve.IOfferTokenPayload;
|
|
55
|
+
// const { issuer, secret, token } = params;
|
|
56
|
+
// try {
|
|
57
|
+
// result = await new Promise<factory.assetTransaction.reserve.IOfferTokenPayload>((resolve, reject) => {
|
|
58
|
+
// jwt.verify(
|
|
59
|
+
// token,
|
|
60
|
+
// secret,
|
|
61
|
+
// {
|
|
62
|
+
// algorithms: ['HS256'],
|
|
63
|
+
// issuer
|
|
64
|
+
// // ...(Array.isArray(params.audience)) ? { audience: params.audience } : undefined
|
|
65
|
+
// },
|
|
66
|
+
// (err, decoded: any) => {
|
|
67
|
+
// if (err instanceof Error) {
|
|
68
|
+
// reject(err);
|
|
69
|
+
// } else {
|
|
70
|
+
// resolve(decoded);
|
|
71
|
+
// }
|
|
72
|
+
// });
|
|
73
|
+
// });
|
|
74
|
+
// } catch (error) {
|
|
75
|
+
// // JWTエラーをハンドリング
|
|
76
|
+
// if (error instanceof jwt.TokenExpiredError) {
|
|
77
|
+
// throw new factory.errors.Argument('memberOfToken', `invalid token. [${error.message} expiredAt:${error.expiredAt}]`);
|
|
78
|
+
// } else if (error instanceof jwt.JsonWebTokenError) {
|
|
79
|
+
// throw new factory.errors.Argument('memberOfToken', `invalid token. [${error.message}]`);
|
|
80
|
+
// }
|
|
81
|
+
// throw error;
|
|
82
|
+
// }
|
|
83
|
+
// return result;
|
|
84
|
+
// }
|
|
49
85
|
function validateStartRequest(params) {
|
|
50
86
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
51
87
|
var _a, _b, _c;
|
|
@@ -57,7 +93,7 @@ function validateStartRequest(params) {
|
|
|
57
93
|
}
|
|
58
94
|
const tokenizedMemberProgramTier = (_c = (_b = params.object.reservationFor) === null || _b === void 0 ? void 0 : _b.offers) === null || _c === void 0 ? void 0 : _c.validForMemberTier;
|
|
59
95
|
yield validateEventOfferPeriod(Object.assign({ event,
|
|
60
|
-
now, availableAt: { id: params.store.id } }, (typeof (tokenizedMemberProgramTier === null || tokenizedMemberProgramTier === void 0 ? void 0 : tokenizedMemberProgramTier.token) === 'string') ? { tokenizedMemberProgramTier } : undefined))(repos);
|
|
96
|
+
now, availableAt: { id: params.store.id }, object: params.object }, (typeof (tokenizedMemberProgramTier === null || tokenizedMemberProgramTier === void 0 ? void 0 : tokenizedMemberProgramTier.token) === 'string') ? { tokenizedMemberProgramTier } : undefined))(repos);
|
|
61
97
|
}
|
|
62
98
|
if (params.validateEvent === true) {
|
|
63
99
|
validateEvent({ event, object: params.object });
|
|
@@ -120,6 +156,7 @@ function validateMemberTier(params) {
|
|
|
120
156
|
* イベントのオファー有効期間を検証する
|
|
121
157
|
*/
|
|
122
158
|
function validateEventOfferPeriod(params) {
|
|
159
|
+
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
123
160
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
124
161
|
var _a, _b;
|
|
125
162
|
const { event, availableAt, tokenizedMemberProgramTier } = params;
|
|
@@ -185,7 +222,7 @@ function validateEventOfferPeriod(params) {
|
|
|
185
222
|
if (typeof issuer.tokenSecret !== 'string' || issuer.tokenSecret === '') {
|
|
186
223
|
throw new factory.errors.NotFound('issuer.tokenSecret');
|
|
187
224
|
}
|
|
188
|
-
const verifiedValidForMemberTier = yield
|
|
225
|
+
const verifiedValidForMemberTier = yield verifyMemberTierToken({
|
|
189
226
|
secret: issuer.tokenSecret,
|
|
190
227
|
issuer: issuer.url,
|
|
191
228
|
token: validForMemberTierToken
|
|
@@ -195,6 +232,34 @@ function validateEventOfferPeriod(params) {
|
|
|
195
232
|
memberProgramIdentifierMustBe, aggregateOfferIdentifier
|
|
196
233
|
})(repos);
|
|
197
234
|
}
|
|
235
|
+
// tslint:disable-next-line:no-suspicious-comment
|
|
236
|
+
// TODO オファートークン検証(2025-10-21~)
|
|
237
|
+
// const offerTokenIssuer = makesOfferOnApplication.issuedBy?.identifier;
|
|
238
|
+
// const offerTokenRequired = typeof offerTokenIssuer === 'string';
|
|
239
|
+
// if (offerTokenRequired) {
|
|
240
|
+
// const offerToken = params.object.reservationFor?.offers?.token;
|
|
241
|
+
// if (typeof offerToken !== 'string' || offerToken === '') {
|
|
242
|
+
// throw new factory.errors.ArgumentNull('object.reservationFor.offers.token');
|
|
243
|
+
// }
|
|
244
|
+
// const issuer = await repos.issuer.findByIdentifier({
|
|
245
|
+
// project: { id: params.event.project.id },
|
|
246
|
+
// identifier: offerTokenIssuer
|
|
247
|
+
// });
|
|
248
|
+
// if (typeof issuer.tokenSecret !== 'string' || issuer.tokenSecret === '') {
|
|
249
|
+
// throw new factory.errors.NotFound('issuer.tokenSecret');
|
|
250
|
+
// }
|
|
251
|
+
// const verifiedOffer = await verifyOfferToken({
|
|
252
|
+
// secret: issuer.tokenSecret,
|
|
253
|
+
// issuer: issuer.url,
|
|
254
|
+
// token: offerToken
|
|
255
|
+
// });
|
|
256
|
+
// await validateOfferToken({
|
|
257
|
+
// acceptedDate,
|
|
258
|
+
// verifiedOffer,
|
|
259
|
+
// makesOfferOnApplication,
|
|
260
|
+
// object: params.object
|
|
261
|
+
// })();
|
|
262
|
+
// }
|
|
198
263
|
});
|
|
199
264
|
}
|
|
200
265
|
/**
|
|
@@ -239,7 +239,7 @@ function saveScreeningEventSeries(params) {
|
|
|
239
239
|
kubunClass: '043'
|
|
240
240
|
});
|
|
241
241
|
debug('kubunNames found.');
|
|
242
|
-
const availablePaymentMethodTypes = yield repos.categoryCode.
|
|
242
|
+
const availablePaymentMethodTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
243
243
|
project: { id: { $eq: params.project.id } },
|
|
244
244
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
|
|
245
245
|
}, ['additionalProperty', 'codeValue']);
|
|
@@ -53,15 +53,15 @@ function authorize(params) {
|
|
|
53
53
|
'superEvent', 'typeOf', 'identifier', 'name'
|
|
54
54
|
] // optimize(2024-07-18~)
|
|
55
55
|
);
|
|
56
|
-
const availablePaymentMethodTypes = yield repos.categoryCode.
|
|
56
|
+
const availablePaymentMethodTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
57
57
|
project: { id: { $eq: transaction.project.id } },
|
|
58
58
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
|
|
59
59
|
}, []);
|
|
60
|
-
const seatingTypes = yield repos.categoryCode.
|
|
60
|
+
const seatingTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
61
61
|
project: { id: { $eq: transaction.project.id } },
|
|
62
62
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.SeatingType } }
|
|
63
63
|
}, []);
|
|
64
|
-
const videoFormatTypes = yield repos.categoryCode.
|
|
64
|
+
const videoFormatTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
65
65
|
project: { id: { $eq: transaction.project.id } },
|
|
66
66
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.VideoFormatType } }
|
|
67
67
|
}, []);
|
|
@@ -79,15 +79,15 @@ function changeOffers(params) {
|
|
|
79
79
|
'superEvent', 'typeOf', 'identifier', 'name'
|
|
80
80
|
] // optimize(2024-07-18~)
|
|
81
81
|
);
|
|
82
|
-
const availablePaymentMethodTypes = yield repos.categoryCode.
|
|
82
|
+
const availablePaymentMethodTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
83
83
|
project: { id: { $eq: transaction.project.id } },
|
|
84
84
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
|
|
85
85
|
}, []);
|
|
86
|
-
const seatingTypes = yield repos.categoryCode.
|
|
86
|
+
const seatingTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
87
87
|
project: { id: { $eq: transaction.project.id } },
|
|
88
88
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.SeatingType } }
|
|
89
89
|
}, []);
|
|
90
|
-
const videoFormatTypes = yield repos.categoryCode.
|
|
90
|
+
const videoFormatTypes = yield repos.categoryCode.projectCategoryCodeFields({
|
|
91
91
|
project: { id: { $eq: transaction.project.id } },
|
|
92
92
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.VideoFormatType } }
|
|
93
93
|
}, []);
|
|
@@ -29,7 +29,7 @@ function syncCategoryCode(params) {
|
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
31
|
for (const categoryCodeId of params.ids) {
|
|
32
|
-
const syncingCategoryCode = (yield repos.categoryCode.
|
|
32
|
+
const syncingCategoryCode = (yield repos.categoryCode.projectCategoryCodeFields({
|
|
33
33
|
limit: 1,
|
|
34
34
|
page: 1,
|
|
35
35
|
project: { id: { $eq: params.project.id } },
|
|
@@ -348,7 +348,7 @@ function createInformCategoryCodeTasks(params, setting) {
|
|
|
348
348
|
// settings: Settings
|
|
349
349
|
) => __awaiter(this, void 0, void 0, function* () {
|
|
350
350
|
var _a;
|
|
351
|
-
const categoryCodes4inform = yield repos.categoryCode.
|
|
351
|
+
const categoryCodes4inform = yield repos.categoryCode.projectCategoryCodeFields({
|
|
352
352
|
id: { $in: params.ids },
|
|
353
353
|
// ひとまずDistributorTypeのみ
|
|
354
354
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.DistributorType } }
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
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.1.0-alpha.
|
|
15
|
-
"@cinerino/sdk": "12.5.0-alpha.
|
|
14
|
+
"@chevre/factory": "5.1.0-alpha.4",
|
|
15
|
+
"@cinerino/sdk": "12.5.0-alpha.17",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -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.0.0-alpha.
|
|
118
|
+
"version": "23.0.0-alpha.15"
|
|
119
119
|
}
|