@chevre/domain 21.13.0-alpha.9 → 21.14.0
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/aggregateAllEvents.ts +2 -2
- package/example/src/chevre/aggregateAllEvents2.ts +1 -1
- package/example/src/chevre/aggregateEventReservation.ts +11 -11
- package/example/src/chevre/aggregateSellerPaymentAccepted.ts +1 -1
- package/example/src/chevre/aggregation/aggregateSystem.ts +20 -20
- package/example/src/chevre/attendIfNotAttended.ts +1 -1
- package/example/src/chevre/checkEventDuration.ts +59 -0
- package/example/src/chevre/cleanAccountingReports.ts +1 -1
- package/example/src/chevre/cleanActions.ts +1 -1
- package/example/src/chevre/deleteRunsAtPassedCertainPeriod.ts +1 -1
- package/example/src/chevre/deleteTasksByName.ts +1 -1
- package/example/src/chevre/findItemListElementByCatalogId.ts +1 -1
- package/example/src/chevre/giveUpStartDatePassedCertainPeriod.ts +1 -1
- package/example/src/chevre/importCategoryCodesFromCOA.ts +5 -4
- package/example/src/chevre/importEventsFromCOA.ts +11 -8
- package/example/src/chevre/importOffersFromCOA.ts +7 -6
- package/example/src/chevre/lockStockHolder.ts +1 -1
- package/example/src/chevre/migrateCategoryCodeAdditionalProperties.ts +2 -2
- package/example/src/chevre/migrateCognitoUser.ts +3 -3
- package/example/src/chevre/migrateIAMMemberMemberOf.ts +1 -1
- package/example/src/chevre/migrateMovieAvailabilityStarts.ts +1 -1
- package/example/src/chevre/migrateOrderPaymentMethodIdentifier.ts +3 -3
- package/example/src/chevre/migrateOwnershipInfos2newUserPool.ts +2 -2
- package/example/src/chevre/migratePayTransactionPaymentMethodId.ts +1 -1
- package/example/src/chevre/migratePayTransactionPaymentMethodIdentifier.ts +1 -1
- package/example/src/chevre/optimizeCatalogs.ts +1 -1
- package/example/src/chevre/ownershipInfosCsv2peopleJson.ts +3 -3
- package/example/src/chevre/person/globalSignOutAndDisable.ts +1 -1
- package/example/src/chevre/person/search.ts +3 -11
- package/example/src/chevre/person/updateProfile.ts +2 -2
- package/example/src/chevre/place/adminHasPOS.ts +1 -1
- package/example/src/chevre/pullAddOnsFromOffer.ts +1 -1
- package/example/src/chevre/pushIncludedInDataCatalog.ts +1 -1
- package/example/src/chevre/searchActions.ts +1 -1
- package/example/src/chevre/searchAggregateOffers.ts +1 -1
- package/example/src/chevre/searchAvaialbleAppliesToMovieTicketByOfferCatalogId.ts +5 -5
- package/example/src/chevre/searchEventIds.ts +1 -1
- package/example/src/chevre/searchEventSeats.ts +1 -1
- package/example/src/chevre/searchOfferCatalogItemAvailability.ts +5 -5
- package/example/src/chevre/searchOfferCatalogItems.ts +5 -5
- package/example/src/chevre/searchOffers.ts +2 -2
- package/example/src/chevre/searchPermissions.ts +3 -3
- package/example/src/chevre/searchProductOffers.ts +1 -1
- package/example/src/chevre/searchSellers.ts +2 -2
- package/lib/chevre/repo/creativeWork.js +17 -17
- package/lib/chevre/repo/event.d.ts +24 -7
- package/lib/chevre/repo/person.d.ts +6 -6
- package/lib/chevre/repo/person.js +12 -15
- package/lib/chevre/repo/place/hasPOS.d.ts +2 -2
- package/lib/chevre/repo/place.d.ts +11 -9
- package/lib/chevre/repo/place.js +44 -33
- package/lib/chevre/repo/priceSpecification.d.ts +0 -5
- package/lib/chevre/repo/priceSpecification.js +0 -9
- package/lib/chevre/repo/stockHolder.d.ts +0 -11
- package/lib/chevre/repo/stockHolder.js +11 -284
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +0 -7
- package/lib/chevre/service/assetTransaction/reserve.js +1 -1
- package/lib/chevre/service/event.js +2 -0
- package/lib/chevre/service/offer.d.ts +2 -4
- package/lib/chevre/service/offer.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +8 -3
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -0
- package/lib/chevre/service/task/onResourceUpdated.js +3 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +4 -11
- package/package.json +7 -5
- package/example/src/chevre/csv2json.ts +0 -57
- package/example/src/chevre/deleteMovieTicketCategoryChargePriceSpecs.ts +0 -21
- package/example/src/chevre/person/createInformTask.ts +0 -77
- package/example/src/chevre/place/migrateHasPOS.ts +0 -76
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
// tslint:disable:no-console no-magic-numbers
|
|
2
2
|
import { chevre } from '../../../../lib/index';
|
|
3
3
|
|
|
4
|
-
// const cognitoIdentityServiceProvider = new chevre.AWS.CognitoIdentityServiceProvider({
|
|
5
|
-
// apiVersion: 'latest',
|
|
6
|
-
// region: 'ap-northeast-1',
|
|
7
|
-
// credentials: new chevre.AWS.Credentials({
|
|
8
|
-
// accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
9
|
-
// secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
|
|
10
|
-
// })
|
|
11
|
-
// });
|
|
12
|
-
|
|
13
4
|
async function main() {
|
|
14
5
|
const userPoolId = process.env.COGNITO_USER_POOL_ID;
|
|
15
|
-
const username = '
|
|
6
|
+
const username = 'Google_108017370984644649288';
|
|
16
7
|
|
|
17
|
-
const personRepo =
|
|
8
|
+
const personRepo = await chevre.repository.Person.createInstance({
|
|
18
9
|
userPoolId: String(userPoolId)
|
|
19
10
|
});
|
|
20
11
|
|
|
21
12
|
const people = await personRepo.search({
|
|
22
13
|
username: username
|
|
23
14
|
});
|
|
15
|
+
console.log(people[0]);
|
|
24
16
|
console.log(people.length, 'people found');
|
|
25
17
|
|
|
26
18
|
// await Promise.all(people.map(async (person) => {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { chevre } from '../../../../lib/index';
|
|
3
3
|
|
|
4
4
|
async function main() {
|
|
5
|
-
const personRepo =
|
|
5
|
+
const personRepo = await chevre.repository.Person.createInstance({
|
|
6
6
|
userPoolId: <string>process.env.COGNITO_USER_POOL_ID
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const username = '';
|
|
9
|
+
const username = 'xxx';
|
|
10
10
|
|
|
11
11
|
let profile = await personRepo.getUserAttributes({
|
|
12
12
|
username: username
|
|
@@ -9,7 +9,7 @@ const project = { typeOf: chevre.factory.organizationType.Project, id: String(pr
|
|
|
9
9
|
async function main() {
|
|
10
10
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
11
|
|
|
12
|
-
const posRepo =
|
|
12
|
+
const posRepo = await chevre.repository.place.HasPOS.createInstance(mongoose.connection, { id: '5bfb841d5a78d7948369979a' });
|
|
13
13
|
|
|
14
14
|
const poses = await posRepo.search({
|
|
15
15
|
limit: 10,
|
|
@@ -6,7 +6,7 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
async function main() {
|
|
7
7
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
8
8
|
|
|
9
|
-
const offerRepo =
|
|
9
|
+
const offerRepo = await chevre.repository.Offer.createInstance(mongoose.connection);
|
|
10
10
|
|
|
11
11
|
const result = await offerRepo.pullAddOns({
|
|
12
12
|
project: { id: String(process.env.PROJECT_ID) },
|
|
@@ -9,7 +9,7 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
9
9
|
async function main() {
|
|
10
10
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
11
|
|
|
12
|
-
const aggregateOfferRepo =
|
|
12
|
+
const aggregateOfferRepo = await chevre.repository.AggregateOffer.createInstance(mongoose.connection);
|
|
13
13
|
|
|
14
14
|
await aggregateOfferRepo.pushIncludedInDataCatalog({
|
|
15
15
|
project: {
|
|
@@ -8,7 +8,7 @@ import * as mongoose from 'mongoose';
|
|
|
8
8
|
async function main() {
|
|
9
9
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
10
|
|
|
11
|
-
const actionRepo =
|
|
11
|
+
const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
|
|
12
12
|
const actions = await actionRepo.search(
|
|
13
13
|
{
|
|
14
14
|
typeOf: { $eq: chevre.factory.actionType.CheckAction },
|
|
@@ -6,7 +6,7 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
async function main() {
|
|
7
7
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
8
8
|
|
|
9
|
-
const aggregateOfferRepo =
|
|
9
|
+
const aggregateOfferRepo = await chevre.repository.AggregateOffer.createInstance(mongoose.connection);
|
|
10
10
|
|
|
11
11
|
const offers = await aggregateOfferRepo.search(
|
|
12
12
|
{
|
|
@@ -6,10 +6,10 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
async function main() {
|
|
7
7
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
8
8
|
|
|
9
|
-
const eventRepo =
|
|
10
|
-
const offerRepo =
|
|
11
|
-
const offerCatalogRepo =
|
|
12
|
-
const productRepo =
|
|
9
|
+
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
10
|
+
const offerRepo = await chevre.repository.Offer.createInstance(mongoose.connection);
|
|
11
|
+
const offerCatalogRepo = await chevre.repository.OfferCatalog.createInstance(mongoose.connection);
|
|
12
|
+
const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
|
|
13
13
|
|
|
14
14
|
let result = await offerRepo.searchAvaialbleAppliesToMovieTicketByOfferCatalogId({
|
|
15
15
|
limit: 10,
|
|
@@ -25,7 +25,7 @@ async function main() {
|
|
|
25
25
|
console.log(result);
|
|
26
26
|
console.log(result.length);
|
|
27
27
|
|
|
28
|
-
result = await chevre.service.offer.event.searchOfferAppliesToMovieTicket({
|
|
28
|
+
result = await (await chevre.service.offer.createService()).event.searchOfferAppliesToMovieTicket({
|
|
29
29
|
event: { id: 'cllkq475p' },
|
|
30
30
|
onlyValid: true,
|
|
31
31
|
useIncludeInDataCatalog: true,
|
|
@@ -8,7 +8,7 @@ const PROJECT_ID = process.env.PROJECT_ID;
|
|
|
8
8
|
async function main() {
|
|
9
9
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
10
10
|
|
|
11
|
-
const eventRepo =
|
|
11
|
+
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
12
12
|
|
|
13
13
|
const ids = await eventRepo.searchIds({
|
|
14
14
|
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
@@ -17,7 +17,7 @@ async function main() {
|
|
|
17
17
|
});
|
|
18
18
|
await client.connect();
|
|
19
19
|
|
|
20
|
-
const itemAvailabilityRepo =
|
|
20
|
+
const itemAvailabilityRepo = await chevre.repository.StockHolder.createInstance(client, mongoose.connection);
|
|
21
21
|
|
|
22
22
|
const result = await itemAvailabilityRepo.searchHolders({
|
|
23
23
|
project,
|
|
@@ -11,12 +11,12 @@ mongoose.Model.on('index', (...args) => {
|
|
|
11
11
|
async function main() {
|
|
12
12
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
13
|
|
|
14
|
-
const eventRepo =
|
|
15
|
-
const offerRepo =
|
|
16
|
-
const offerCatalogRepo =
|
|
17
|
-
const productRepo =
|
|
14
|
+
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
15
|
+
const offerRepo = await chevre.repository.Offer.createInstance(mongoose.connection);
|
|
16
|
+
const offerCatalogRepo = await chevre.repository.OfferCatalog.createInstance(mongoose.connection);
|
|
17
|
+
const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
|
|
18
18
|
|
|
19
|
-
const result = await chevre.service.offer.event.searchOfferCatalogItemAvailability({
|
|
19
|
+
const result = await (await chevre.service.offer.createService()).event.searchOfferCatalogItemAvailability({
|
|
20
20
|
event: {
|
|
21
21
|
id: 'cllkq475u'
|
|
22
22
|
},
|
|
@@ -11,12 +11,12 @@ mongoose.Model.on('index', (...args) => {
|
|
|
11
11
|
async function main() {
|
|
12
12
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
13
|
|
|
14
|
-
const eventRepo =
|
|
15
|
-
const offerCatalogRepo =
|
|
16
|
-
const offerCatalogItemRepo =
|
|
17
|
-
const productRepo =
|
|
14
|
+
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
15
|
+
const offerCatalogRepo = await chevre.repository.OfferCatalog.createInstance(mongoose.connection);
|
|
16
|
+
const offerCatalogItemRepo = await chevre.repository.OfferCatalogItem.createInstance(mongoose.connection);
|
|
17
|
+
const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
|
|
18
18
|
|
|
19
|
-
const result = await chevre.service.offer.event.searchOfferCatalogItems({
|
|
19
|
+
const result = await (await chevre.service.offer.createService()).event.searchOfferCatalogItems({
|
|
20
20
|
event: {
|
|
21
21
|
id: 'cllkq475u'
|
|
22
22
|
},
|
|
@@ -8,7 +8,7 @@ mongoose.Model.on('index', (...args) => {
|
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
async function main() {
|
|
11
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI
|
|
11
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
12
12
|
|
|
13
13
|
const indexes = await mongoose.connection.db.collection('aggregateOffers')
|
|
14
14
|
.indexes();
|
|
@@ -18,7 +18,7 @@ async function main() {
|
|
|
18
18
|
// .dropIndexes();
|
|
19
19
|
// console.log('indexes droped');
|
|
20
20
|
|
|
21
|
-
const offerRepo =
|
|
21
|
+
const offerRepo = await chevre.repository.Offer.createInstance(mongoose.connection);
|
|
22
22
|
|
|
23
23
|
const offers = await offerRepo.search({
|
|
24
24
|
limit: 100,
|
|
@@ -10,13 +10,13 @@ const memberId = 'xxx';
|
|
|
10
10
|
async function main() {
|
|
11
11
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
12
12
|
|
|
13
|
-
const memberRepo =
|
|
14
|
-
const roleRepo =
|
|
13
|
+
const memberRepo = await chevre.repository.Member.createInstance(mongoose.connection);
|
|
14
|
+
const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
|
|
15
15
|
|
|
16
16
|
let now: Date;
|
|
17
17
|
|
|
18
18
|
now = new Date();
|
|
19
|
-
const searchPermissionsResult = await chevre.service.iam.searchPermissions({
|
|
19
|
+
const searchPermissionsResult = await (await chevre.service.iam.createService()).searchPermissions({
|
|
20
20
|
project: { id: PROJECT_ID },
|
|
21
21
|
member: {
|
|
22
22
|
id: memberId,
|
|
@@ -8,7 +8,7 @@ const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
|
8
8
|
async function main() {
|
|
9
9
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
10
10
|
|
|
11
|
-
const productOfferRepo =
|
|
11
|
+
const productOfferRepo = await chevre.repository.ProductOffer.createInstance(mongoose.connection);
|
|
12
12
|
|
|
13
13
|
const offers = await productOfferRepo.search({
|
|
14
14
|
project: { id: { $eq: PROJECT_ID } }
|
|
@@ -6,9 +6,9 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
7
|
|
|
8
8
|
async function main() {
|
|
9
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI
|
|
9
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
10
10
|
|
|
11
|
-
const sellerRepo =
|
|
11
|
+
const sellerRepo = await chevre.repository.Seller.createInstance(mongoose.connection);
|
|
12
12
|
|
|
13
13
|
const sellers = await sellerRepo.search(
|
|
14
14
|
{
|
|
@@ -192,23 +192,23 @@ class MongoRepository {
|
|
|
192
192
|
if (typeof identifier !== 'string' || identifier.length === 0) {
|
|
193
193
|
throw new factory.errors.ArgumentNull('identifier');
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
});
|
|
195
|
+
const updateFilter = {
|
|
196
|
+
$setOnInsert: Object.assign(Object.assign({}, setOnInsertFields), { typeOf,
|
|
197
|
+
project,
|
|
198
|
+
identifier }),
|
|
199
|
+
// 変更可能な属性のみ上書き
|
|
200
|
+
$set: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (name !== undefined) ? { name } : undefined), (contentRating !== undefined) ? { contentRating } : undefined), (duration !== undefined) ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined), (datePublished !== undefined) ? { datePublished } : undefined), (distributor !== undefined) ? { distributor } : undefined), (typeof thumbnailUrl === 'string') ? { thumbnailUrl } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty } : [])
|
|
201
|
+
};
|
|
202
|
+
const updateOne = {
|
|
203
|
+
filter: {
|
|
204
|
+
typeOf: typeOf,
|
|
205
|
+
'project.id': { $eq: project.id },
|
|
206
|
+
identifier: { $eq: identifier }
|
|
207
|
+
},
|
|
208
|
+
update: updateFilter,
|
|
209
|
+
upsert: true
|
|
210
|
+
};
|
|
211
|
+
bulkWriteOps.push({ updateOne });
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
if (bulkWriteOps.length > 0) {
|
|
@@ -77,11 +77,28 @@ interface IStatus {
|
|
|
77
77
|
export interface IAggregateEvent {
|
|
78
78
|
statuses: IStatus[];
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> & '_id';
|
|
81
|
+
type IProjection<T extends factory.eventType> = {
|
|
82
|
+
[key in IKeyOfProjection<T>]?: 0 | 1;
|
|
83
|
+
};
|
|
83
84
|
export import IMinimizedIndividualEvent = EventFactory.IMinimizedIndividualEvent;
|
|
84
|
-
export declare const PROJECTION_MINIMIZED_EVENT:
|
|
85
|
+
export declare const PROJECTION_MINIMIZED_EVENT: {
|
|
86
|
+
project: number;
|
|
87
|
+
organizer: number;
|
|
88
|
+
_id: number;
|
|
89
|
+
typeOf: number;
|
|
90
|
+
additionalProperty: number;
|
|
91
|
+
name: number;
|
|
92
|
+
doorTime: number;
|
|
93
|
+
endDate: number;
|
|
94
|
+
eventStatus: number;
|
|
95
|
+
location: number;
|
|
96
|
+
startDate: number;
|
|
97
|
+
superEvent: number;
|
|
98
|
+
offers: number;
|
|
99
|
+
coaInfo: number;
|
|
100
|
+
identifier: number;
|
|
101
|
+
};
|
|
85
102
|
/**
|
|
86
103
|
* イベントリポジトリ
|
|
87
104
|
*/
|
|
@@ -133,13 +150,13 @@ export declare class MongoRepository {
|
|
|
133
150
|
save<T extends factory.eventType>(params: {
|
|
134
151
|
id?: string;
|
|
135
152
|
attributes: factory.event.IAttributes<T>;
|
|
136
|
-
$unset?: IProjection
|
|
153
|
+
$unset?: IProjection<T>;
|
|
137
154
|
upsert?: boolean;
|
|
138
155
|
}): Promise<factory.event.IEvent<T>>;
|
|
139
156
|
saveMany<T extends factory.eventType>(params: {
|
|
140
157
|
id: string;
|
|
141
158
|
attributes: factory.event.IAttributes<T>;
|
|
142
|
-
$unset?: IProjection
|
|
159
|
+
$unset?: IProjection<T>;
|
|
143
160
|
upsert: boolean;
|
|
144
161
|
}[]): Promise<void>;
|
|
145
162
|
save4ttts(params: {
|
|
@@ -149,7 +166,7 @@ export declare class MongoRepository {
|
|
|
149
166
|
/**
|
|
150
167
|
* イベントを検索する
|
|
151
168
|
*/
|
|
152
|
-
search<T extends factory.eventType>(params: ISearchConditions<T>, projection?: IProjection): Promise<factory.event.IEvent<T>[]>;
|
|
169
|
+
search<T extends factory.eventType>(params: ISearchConditions<T>, projection?: IProjection<T>): Promise<factory.event.IEvent<T>[]>;
|
|
153
170
|
searchIds<T extends factory.eventType>(params: ISearchConditions<T>): Promise<string[]>;
|
|
154
171
|
findMinimizedIndividualEventById<T extends factory.eventType.ScreeningEvent | factory.eventType.Event>(params: {
|
|
155
172
|
id: string;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CognitoIdentityProvider } from '@aws-sdk/client-cognito-identity-provider';
|
|
2
|
+
import type { AttributeType } from '@aws-sdk/client-cognito-identity-provider/dist-types/models/models_0';
|
|
2
3
|
import * as factory from '../factory';
|
|
3
|
-
export type AttributeListType = AWS.CognitoIdentityServiceProvider.AttributeListType;
|
|
4
4
|
export type IPerson = factory.person.IPerson;
|
|
5
5
|
/**
|
|
6
6
|
* 会員リポジトリ
|
|
7
7
|
*/
|
|
8
8
|
export declare class CognitoRepository {
|
|
9
|
-
readonly cognitoIdentityServiceProvider:
|
|
9
|
+
readonly cognitoIdentityServiceProvider: CognitoIdentityProvider;
|
|
10
10
|
private readonly userPoolId;
|
|
11
11
|
constructor(params: {
|
|
12
12
|
userPoolId: string;
|
|
13
13
|
});
|
|
14
14
|
static ATTRIBUTE2PROFILE(params: {
|
|
15
|
-
attributes?:
|
|
15
|
+
attributes?: AttributeType[];
|
|
16
16
|
}): factory.person.IProfile;
|
|
17
17
|
static ATTRIBUTE2PERSON(params: {
|
|
18
18
|
username?: string;
|
|
19
19
|
userPoolId?: string;
|
|
20
|
-
attributes?:
|
|
20
|
+
attributes?: AttributeType[];
|
|
21
21
|
}): factory.person.IPerson;
|
|
22
|
-
static PROFILE2ATTRIBUTE(params: factory.person.IProfile):
|
|
22
|
+
static PROFILE2ATTRIBUTE(params: factory.person.IProfile): AttributeType[];
|
|
23
23
|
/**
|
|
24
24
|
* 管理者権限でユーザー属性を取得する
|
|
25
25
|
*/
|
|
@@ -10,14 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CognitoRepository = void 0;
|
|
13
|
-
const
|
|
13
|
+
const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
|
|
14
|
+
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
14
15
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
15
|
-
const credentials_1 = require("../credentials");
|
|
16
16
|
const factory = require("../factory");
|
|
17
|
-
const awsCredentials =
|
|
18
|
-
accessKeyId: credentials_1.credentials.aws.accessKeyId,
|
|
19
|
-
secretAccessKey: credentials_1.credentials.aws.secretAccessKey
|
|
20
|
-
});
|
|
17
|
+
const awsCredentials = (0, credential_providers_1.fromEnv)();
|
|
21
18
|
const TOKEN_ISSUER_ENDPOINT = 'https://cognito-idp.ap-northeast-1.amazonaws.com';
|
|
22
19
|
/**
|
|
23
20
|
* 会員リポジトリ
|
|
@@ -25,7 +22,7 @@ const TOKEN_ISSUER_ENDPOINT = 'https://cognito-idp.ap-northeast-1.amazonaws.com'
|
|
|
25
22
|
class CognitoRepository {
|
|
26
23
|
constructor(params) {
|
|
27
24
|
this.userPoolId = params.userPoolId;
|
|
28
|
-
this.cognitoIdentityServiceProvider = new
|
|
25
|
+
this.cognitoIdentityServiceProvider = new client_cognito_identity_provider_1.CognitoIdentityProvider({
|
|
29
26
|
apiVersion: 'latest',
|
|
30
27
|
region: 'ap-northeast-1',
|
|
31
28
|
credentials: awsCredentials
|
|
@@ -35,7 +32,7 @@ class CognitoRepository {
|
|
|
35
32
|
let additionalProperty = [];
|
|
36
33
|
if (Array.isArray(params.attributes)) {
|
|
37
34
|
additionalProperty = params.attributes.map((a) => {
|
|
38
|
-
return { name: a.Name, value: String(a.Value) };
|
|
35
|
+
return { name: String(a.Name), value: String(a.Value) };
|
|
39
36
|
});
|
|
40
37
|
}
|
|
41
38
|
const profile = {
|
|
@@ -188,7 +185,7 @@ class CognitoRepository {
|
|
|
188
185
|
reject(err);
|
|
189
186
|
}
|
|
190
187
|
else {
|
|
191
|
-
resolve(CognitoRepository.ATTRIBUTE2PROFILE({ attributes: data.UserAttributes }));
|
|
188
|
+
resolve(CognitoRepository.ATTRIBUTE2PROFILE({ attributes: data === null || data === void 0 ? void 0 : data.UserAttributes }));
|
|
192
189
|
}
|
|
193
190
|
});
|
|
194
191
|
});
|
|
@@ -232,7 +229,7 @@ class CognitoRepository {
|
|
|
232
229
|
else {
|
|
233
230
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
234
231
|
/* istanbul ignore if: please write tests */
|
|
235
|
-
if (data.Users === undefined) {
|
|
232
|
+
if ((data === null || data === void 0 ? void 0 : data.Users) === undefined) {
|
|
236
233
|
reject(new factory.errors.NotFound('User'));
|
|
237
234
|
}
|
|
238
235
|
else {
|
|
@@ -267,7 +264,7 @@ class CognitoRepository {
|
|
|
267
264
|
reject(err);
|
|
268
265
|
}
|
|
269
266
|
else {
|
|
270
|
-
resolve(CognitoRepository.ATTRIBUTE2PROFILE({ attributes: data.UserAttributes }));
|
|
267
|
+
resolve(CognitoRepository.ATTRIBUTE2PROFILE({ attributes: data === null || data === void 0 ? void 0 : data.UserAttributes }));
|
|
271
268
|
}
|
|
272
269
|
});
|
|
273
270
|
});
|
|
@@ -310,7 +307,7 @@ class CognitoRepository {
|
|
|
310
307
|
else {
|
|
311
308
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
312
309
|
/* istanbul ignore if: please write tests */
|
|
313
|
-
if (data.Users === undefined) {
|
|
310
|
+
if ((data === null || data === void 0 ? void 0 : data.Users) === undefined) {
|
|
314
311
|
reject(new factory.errors.NotFound('User'));
|
|
315
312
|
}
|
|
316
313
|
else {
|
|
@@ -353,7 +350,7 @@ class CognitoRepository {
|
|
|
353
350
|
else {
|
|
354
351
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
355
352
|
/* istanbul ignore if: please write tests */
|
|
356
|
-
if (data.Users === undefined) {
|
|
353
|
+
if ((data === null || data === void 0 ? void 0 : data.Users) === undefined) {
|
|
357
354
|
reject(new factory.errors.NotFound('User'));
|
|
358
355
|
}
|
|
359
356
|
else {
|
|
@@ -395,7 +392,7 @@ class CognitoRepository {
|
|
|
395
392
|
reject(listUsersErr);
|
|
396
393
|
}
|
|
397
394
|
else {
|
|
398
|
-
const username = (_b = (_a = data.Users) === null || _a === void 0 ? void 0 : _a.shift()) === null || _b === void 0 ? void 0 : _b.Username;
|
|
395
|
+
const username = (_b = (_a = data === null || data === void 0 ? void 0 : data.Users) === null || _a === void 0 ? void 0 : _a.shift()) === null || _b === void 0 ? void 0 : _b.Username;
|
|
399
396
|
if (typeof username !== 'string') {
|
|
400
397
|
reject(new factory.errors.NotFound('User'));
|
|
401
398
|
}
|
|
@@ -474,7 +471,7 @@ class CognitoRepository {
|
|
|
474
471
|
else {
|
|
475
472
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
476
473
|
/* istanbul ignore if: please write tests */
|
|
477
|
-
if (data.Users === undefined) {
|
|
474
|
+
if ((data === null || data === void 0 ? void 0 : data.Users) === undefined) {
|
|
478
475
|
reject(new factory.errors.NotFound('User'));
|
|
479
476
|
}
|
|
480
477
|
else {
|
|
@@ -13,8 +13,8 @@ interface IOperator {
|
|
|
13
13
|
* 施設のPOSリポジトリ
|
|
14
14
|
*/
|
|
15
15
|
export declare class MongoRepository {
|
|
16
|
+
readonly operator: IOperator;
|
|
16
17
|
private readonly placeModel;
|
|
17
|
-
private readonly operator;
|
|
18
18
|
constructor(connection: Connection, operater: IOperator);
|
|
19
19
|
search(params: {
|
|
20
20
|
limit?: number;
|
|
@@ -28,7 +28,7 @@ export declare class MongoRepository {
|
|
|
28
28
|
$eq?: string;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
}): Promise<Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name'>[]>;
|
|
31
|
+
}): Promise<Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name' | 'id'>[]>;
|
|
32
32
|
createByBranchCode(params: Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name'> & {
|
|
33
33
|
project: {
|
|
34
34
|
id: string;
|
|
@@ -22,10 +22,13 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import type { Connection } from 'mongoose';
|
|
25
|
+
import type { AnyExpression, Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
27
|
type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
|
|
28
28
|
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
|
|
29
|
+
export type IMovieTheaterIncludingScreeningRooms = factory.place.movieTheater.IPlace & {
|
|
30
|
+
containsPlace: factory.place.screeningRoom.IPlace[];
|
|
31
|
+
};
|
|
29
32
|
/**
|
|
30
33
|
* 施設リポジトリ
|
|
31
34
|
*/
|
|
@@ -34,15 +37,18 @@ export declare class MongoRepository {
|
|
|
34
37
|
constructor(connection: Connection);
|
|
35
38
|
static CREATE_BUS_STOP_MONGO_CONDITIONS(params: factory.place.busStop.ISearchConditions): any[];
|
|
36
39
|
static CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params: factory.place.movieTheater.ISearchConditions): any[];
|
|
40
|
+
static CREATE_SEARCH_SEATS_PROJECTION(params: factory.place.seat.IProjection): {
|
|
41
|
+
[field: string]: AnyExpression;
|
|
42
|
+
};
|
|
37
43
|
/**
|
|
38
44
|
* 施設を保管する
|
|
39
45
|
*/
|
|
40
|
-
saveMovieTheater(params: factory.place.movieTheater.
|
|
41
|
-
saveMovieTheaterByBranchCode4coa(params:
|
|
46
|
+
saveMovieTheater(params: factory.place.movieTheater.IPlace): Promise<factory.place.movieTheater.IPlace>;
|
|
47
|
+
saveMovieTheaterByBranchCode4coa(params: IMovieTheaterIncludingScreeningRooms): Promise<void>;
|
|
42
48
|
/**
|
|
43
49
|
* 施設検索
|
|
44
50
|
*/
|
|
45
|
-
searchMovieTheaters(params: factory.place.movieTheater.ISearchConditions
|
|
51
|
+
searchMovieTheaters(params: factory.place.movieTheater.ISearchConditions, inclusion: (keyof factory.place.movieTheater.IPlace | '_id' | 'url')[], exclusion: string[]): Promise<factory.place.movieTheater.IPlace[]>;
|
|
46
52
|
deleteMovieTheaterById(params: {
|
|
47
53
|
project: {
|
|
48
54
|
id: string;
|
|
@@ -156,11 +162,7 @@ export declare class MongoRepository {
|
|
|
156
162
|
};
|
|
157
163
|
typeOf: factory.placeType.ScreeningRoom;
|
|
158
164
|
}>;
|
|
159
|
-
searchScreeningRoomSections(searchConditions: factory.place.screeningRoomSection.ISearchConditions
|
|
160
|
-
$projection?: {
|
|
161
|
-
[key: string]: number;
|
|
162
|
-
};
|
|
163
|
-
}): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
|
|
165
|
+
searchScreeningRoomSections(searchConditions: factory.place.screeningRoomSection.ISearchConditions): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
|
|
164
166
|
deleteScreeningRoomSection(screeningRoomSection: {
|
|
165
167
|
project: {
|
|
166
168
|
id: string;
|