@chevre/domain 22.11.0-alpha.3 → 22.11.0-alpha.31
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/aggregation/aggregateTasks.ts +41 -0
- package/example/src/chevre/assetTransaction/processReserve.ts +0 -1
- package/example/src/chevre/notifyAbortedTasksByEmail.ts +1 -1
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addAdminPermissionIfNotExists.ts +132 -0
- package/example/src/chevre/roles/addDefaultPermissionIfNotExists.ts +37 -0
- package/example/src/chevre/roles/addEventOfferPermissionIfNotExists.ts +27 -0
- package/example/src/chevre/roles/addPermissionIfNotExists.ts +39 -6
- package/example/src/chevre/roles/addProjectCreatorRole.ts +48 -0
- package/example/src/chevre/roles/assignGlobalRoles.ts +72 -0
- package/example/src/chevre/roles/findPermissions.ts +84 -0
- package/example/src/chevre/roles/findRoleNames.ts +117 -0
- package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +38 -0
- package/example/src/chevre/roles/removePermissionFromAPIRoles.ts +46 -0
- package/example/src/chevre/roles/removePermissionIfExists.ts +39 -0
- package/example/src/chevre/settings/addSettings.ts +31 -17
- package/example/src/chevre/stockHolder/checkRedisKeyCount.ts +11 -20
- package/example/src/chevre/task/countPotentiallyRunning.ts +41 -0
- package/example/src/chevre/task/countTasks.ts +51 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +8 -5
- package/example/src/idaas/auth0/adminApplications.ts +183 -0
- package/example/src/idaas/auth0/getToken.ts +55 -0
- package/example/src/idaas/auth0/getTokenByPrivateKeyJWT.ts +84 -0
- package/example/src/regex.ts +31 -0
- package/lib/chevre/eventEmitter/task.d.ts +29 -6
- package/lib/chevre/index.d.ts +0 -2
- package/lib/chevre/index.js +0 -10
- package/lib/chevre/repo/confirmationNumber.d.ts +0 -11
- package/lib/chevre/repo/confirmationNumber.js +15 -54
- package/lib/chevre/repo/identity.d.ts +11 -33
- package/lib/chevre/repo/identity.js +10 -15
- package/lib/chevre/repo/member.d.ts +22 -4
- package/lib/chevre/repo/member.js +81 -27
- package/lib/chevre/repo/mongoose/schemas/identity.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/member/global.d.ts +14 -0
- package/lib/chevre/repo/mongoose/schemas/member/global.js +82 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +15 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +1 -0
- package/lib/chevre/repo/mongoose/schemas/task.js +9 -0
- package/lib/chevre/repo/orderNumber.d.ts +0 -11
- package/lib/chevre/repo/orderNumber.js +13 -51
- package/lib/chevre/repo/role.d.ts +16 -4
- package/lib/chevre/repo/role.js +71 -32
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +0 -4
- package/lib/chevre/repo/serviceOutputIdentifier.js +13 -38
- package/lib/chevre/repo/setting.d.ts +5 -10
- package/lib/chevre/repo/setting.js +4 -7
- package/lib/chevre/repo/stockHolder.js +0 -11
- package/lib/chevre/repo/task.d.ts +47 -34
- package/lib/chevre/repo/task.js +114 -292
- package/lib/chevre/repo/transaction.js +10 -10
- package/lib/chevre/repo/transactionNumber.d.ts +0 -11
- package/lib/chevre/repo/transactionNumber.js +13 -51
- package/lib/chevre/repo/transactionNumberCounter.d.ts +0 -10
- package/lib/chevre/repo/transactionNumberCounter.js +34 -29
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/code.d.ts +5 -28
- package/lib/chevre/service/code.js +3 -79
- package/lib/chevre/service/iam.d.ts +17 -7
- package/lib/chevre/service/iam.js +26 -6
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +15 -0
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +38 -0
- package/lib/chevre/service/notification.d.ts +2 -1
- package/lib/chevre/service/notification.js +3 -1
- package/lib/chevre/service/task/acceptCOAOffer.d.ts +1 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -5
- package/lib/chevre/service/task/aggregateOffers.d.ts +1 -1
- package/lib/chevre/service/task/aggregateOnSystem.d.ts +4 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +1 -1
- package/lib/chevre/service/task/authorizePayment.d.ts +1 -1
- package/lib/chevre/service/task/authorizePayment.js +7 -6
- package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.d.ts +1 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/task/checkMovieTicket.d.ts +1 -1
- package/lib/chevre/service/task/checkMovieTicket.js +4 -3
- package/lib/chevre/service/task/checkResource.d.ts +1 -1
- package/lib/chevre/service/task/confirmMoneyTransfer.d.ts +1 -1
- package/lib/chevre/service/task/confirmPayTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmRegisterService.d.ts +1 -1
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/createAccountingReport.d.ts +1 -1
- package/lib/chevre/service/task/createEvent.d.ts +1 -1
- package/lib/chevre/service/task/deletePerson.d.ts +1 -1
- package/lib/chevre/service/task/deleteTransaction.d.ts +1 -1
- package/lib/chevre/service/task/givePointAward.d.ts +1 -1
- package/lib/chevre/service/task/givePointAward.js +1 -1
- package/lib/chevre/service/task/handleNotification.d.ts +4 -2
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.d.ts +1 -1
- package/lib/chevre/service/task/importOffersFromCOA.d.ts +1 -1
- package/lib/chevre/service/task/invalidatePaymentUrl.d.ts +1 -1
- package/lib/chevre/service/task/moneyTransfer.d.ts +1 -1
- package/lib/chevre/service/task/moneyTransfer.js +1 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +1 -1
- package/lib/chevre/service/task/onAuthorizationCreated.d.ts +1 -1
- package/lib/chevre/service/task/onEventChanged.d.ts +1 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +1 -1
- package/lib/chevre/service/task/pay.d.ts +1 -1
- package/lib/chevre/service/task/placeOrder.d.ts +1 -1
- package/lib/chevre/service/task/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +6 -7
- package/lib/chevre/service/task/refund.d.ts +1 -1
- package/lib/chevre/service/task/refund.js +1 -1
- package/lib/chevre/service/task/registerService.d.ts +1 -1
- package/lib/chevre/service/task/reserve.d.ts +1 -1
- package/lib/chevre/service/task/returnMoneyTransfer.d.ts +1 -1
- package/lib/chevre/service/task/returnMoneyTransfer.js +1 -1
- package/lib/chevre/service/task/returnOrder.d.ts +1 -1
- package/lib/chevre/service/task/returnPayTransaction.d.ts +1 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/returnPointAward.d.ts +1 -1
- package/lib/chevre/service/task/returnPointAward.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- package/lib/chevre/service/task/sendEmailMessage.d.ts +1 -1
- package/lib/chevre/service/task/sendOrder.d.ts +1 -1
- package/lib/chevre/service/task/triggerWebhook.d.ts +1 -1
- package/lib/chevre/service/task/useReservation.d.ts +1 -1
- package/lib/chevre/service/task/voidMoneyTransferTransaction.d.ts +1 -1
- package/lib/chevre/service/task/voidPayTransaction.d.ts +1 -1
- package/lib/chevre/service/task/voidPayment.d.ts +1 -1
- package/lib/chevre/service/task/voidRegisterServiceTransaction.d.ts +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -3
- package/lib/chevre/service/task.d.ts +7 -29
- package/lib/chevre/service/task.js +9 -114
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.d.ts +11 -0
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +105 -0
- package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +17 -0
- package/lib/chevre/service/taskHandler/onOperationFailed.js +70 -0
- package/lib/chevre/service/taskHandler.d.ts +26 -0
- package/lib/chevre/service/taskHandler.js +96 -0
- package/lib/chevre/service/validation/validateOrder.js +55 -37
- package/lib/chevre/service.d.ts +0 -4
- package/lib/chevre/service.js +10 -14
- package/lib/chevre/settings/aggregation.d.ts +6 -1
- package/lib/chevre/settings/aggregation.js +2 -1
- package/package.json +5 -3
- package/example/src/chevre/adminAuth/adminIdentity.ts +0 -38
- package/example/src/chevre/executeOneTask.ts +0 -41
- package/example/src/chevre/executeTaskIfExists.ts +0 -80
- package/example/src/chevre/findExecutableTask.ts +0 -50
- package/example/src/chevre/findSetting.ts +0 -79
- package/example/src/chevre/roles/addRoleMembers.ts +0 -75
- package/example/src/chevre/searchPermissions.ts +0 -46
- package/example/src/chevre/transactionNumber/publishConfimationNumber.ts +0 -37
- package/example/src/chevre/transactionNumber/publishOrderNumber.ts +0 -40
- package/example/src/chevre/transactionNumber/setUseMongo4confirmationNumberFrom.ts +0 -45
- package/example/src/chevre/transactionNumber/setUseMongo4orderNumberFrom.ts +0 -41
- package/example/src/chevre/transactionNumber/setUseMongo4transactionNumberFrom.ts +0 -41
- package/lib/chevre/adminAuth.d.ts +0 -2
- package/lib/chevre/adminAuth.js +0 -6
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
import * as redis from 'redis';
|
|
4
|
-
import { chevre } from '../../../../lib/index';
|
|
5
|
-
|
|
6
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
-
|
|
8
|
-
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
9
|
-
socket: {
|
|
10
|
-
port: Number(<string>process.env.REDIS_PORT),
|
|
11
|
-
host: <string>process.env.REDIS_HOST
|
|
12
|
-
},
|
|
13
|
-
password: <string>process.env.REDIS_KEY,
|
|
14
|
-
name: 'checkRedisKeyCount'
|
|
15
|
-
})
|
|
16
|
-
.on('error', (err) => {
|
|
17
|
-
// eslint-disable-next-line no-console
|
|
18
|
-
console.error('createDefaultRedisClient: client onError:', err);
|
|
19
|
-
// reject(err);
|
|
20
|
-
});
|
|
21
|
-
redisClient.connect();
|
|
22
|
-
mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
23
|
-
|
|
24
|
-
async function main() {
|
|
25
|
-
const confirmationNumberRepo = await chevre.repository.ConfirmationNumber.createInstance({
|
|
26
|
-
redisClient,
|
|
27
|
-
connection: mongoose.connection
|
|
28
|
-
});
|
|
29
|
-
const result = await confirmationNumberRepo.publish({ orderDate: new Date() });
|
|
30
|
-
console.log(result);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
main()
|
|
34
|
-
.then(() => {
|
|
35
|
-
console.log('success!');
|
|
36
|
-
})
|
|
37
|
-
.catch(console.error);
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
import * as redis from 'redis';
|
|
4
|
-
import { chevre } from '../../../../lib/index';
|
|
5
|
-
|
|
6
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
-
|
|
8
|
-
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
9
|
-
socket: {
|
|
10
|
-
port: Number(<string>process.env.REDIS_PORT),
|
|
11
|
-
host: <string>process.env.REDIS_HOST
|
|
12
|
-
},
|
|
13
|
-
password: <string>process.env.REDIS_KEY,
|
|
14
|
-
name: 'checkRedisKeyCount'
|
|
15
|
-
})
|
|
16
|
-
.on('error', (err) => {
|
|
17
|
-
// eslint-disable-next-line no-console
|
|
18
|
-
console.error('createDefaultRedisClient: client onError:', err);
|
|
19
|
-
// reject(err);
|
|
20
|
-
});
|
|
21
|
-
redisClient.connect();
|
|
22
|
-
mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
23
|
-
|
|
24
|
-
async function main() {
|
|
25
|
-
const orderNumberRepo = await chevre.repository.OrderNumber.createInstance({
|
|
26
|
-
redisClient,
|
|
27
|
-
connection: mongoose.connection
|
|
28
|
-
});
|
|
29
|
-
const result = await orderNumberRepo.publishByTimestamp({
|
|
30
|
-
project: { alternateName: 'CIN' },
|
|
31
|
-
orderDate: new Date()
|
|
32
|
-
});
|
|
33
|
-
console.log(result);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
main()
|
|
37
|
-
.then(() => {
|
|
38
|
-
console.log('success!');
|
|
39
|
-
})
|
|
40
|
-
.catch(console.error);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
import * as redis from 'redis';
|
|
5
|
-
import { chevre } from '../../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
-
|
|
9
|
-
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
10
|
-
socket: {
|
|
11
|
-
port: Number(<string>process.env.REDIS_PORT),
|
|
12
|
-
host: <string>process.env.REDIS_HOST
|
|
13
|
-
},
|
|
14
|
-
password: <string>process.env.REDIS_KEY,
|
|
15
|
-
name: 'checkRedisKeyCount'
|
|
16
|
-
})
|
|
17
|
-
.on('error', (err) => {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.error('createDefaultRedisClient: client onError:', err);
|
|
20
|
-
// reject(err);
|
|
21
|
-
});
|
|
22
|
-
redisClient.connect();
|
|
23
|
-
mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
24
|
-
|
|
25
|
-
async function main() {
|
|
26
|
-
const confirmationNumberRepo = await chevre.repository.ConfirmationNumber.createInstance({
|
|
27
|
-
redisClient,
|
|
28
|
-
connection: mongoose.connection
|
|
29
|
-
});
|
|
30
|
-
const result = await confirmationNumberRepo.setUseMongo4confirmationNumberFrom({
|
|
31
|
-
// useMongo4confirmationNumberFrom: moment('2025-05-22T23:50:00Z')
|
|
32
|
-
// .toDate(),
|
|
33
|
-
// useMongo4confirmationNumberFrom: moment('2025-05-25T15:00:00Z')
|
|
34
|
-
// .toDate()
|
|
35
|
-
useMongo4confirmationNumberFrom: moment('2025-05-31T15:00:00Z')
|
|
36
|
-
.toDate()
|
|
37
|
-
});
|
|
38
|
-
console.log(result);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
main()
|
|
42
|
-
.then(() => {
|
|
43
|
-
console.log('success!');
|
|
44
|
-
})
|
|
45
|
-
.catch(console.error);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
import * as redis from 'redis';
|
|
5
|
-
import { chevre } from '../../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
-
|
|
9
|
-
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
10
|
-
socket: {
|
|
11
|
-
port: Number(<string>process.env.REDIS_PORT),
|
|
12
|
-
host: <string>process.env.REDIS_HOST
|
|
13
|
-
},
|
|
14
|
-
password: <string>process.env.REDIS_KEY,
|
|
15
|
-
name: 'checkRedisKeyCount'
|
|
16
|
-
})
|
|
17
|
-
.on('error', (err) => {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.error('createDefaultRedisClient: client onError:', err);
|
|
20
|
-
// reject(err);
|
|
21
|
-
});
|
|
22
|
-
redisClient.connect();
|
|
23
|
-
mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
24
|
-
|
|
25
|
-
async function main() {
|
|
26
|
-
const orderNumberRepo = await chevre.repository.OrderNumber.createInstance({
|
|
27
|
-
redisClient,
|
|
28
|
-
connection: mongoose.connection
|
|
29
|
-
});
|
|
30
|
-
const result = await orderNumberRepo.setUseMongo4orderNumberFrom({
|
|
31
|
-
useMongo4orderNumberFrom: moment('2025-06-03T05:00:00Z')
|
|
32
|
-
.toDate()
|
|
33
|
-
});
|
|
34
|
-
console.log(result);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
main()
|
|
38
|
-
.then(() => {
|
|
39
|
-
console.log('success!');
|
|
40
|
-
})
|
|
41
|
-
.catch(console.error);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
import * as redis from 'redis';
|
|
5
|
-
import { chevre } from '../../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
-
|
|
9
|
-
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
10
|
-
socket: {
|
|
11
|
-
port: Number(<string>process.env.REDIS_PORT),
|
|
12
|
-
host: <string>process.env.REDIS_HOST
|
|
13
|
-
},
|
|
14
|
-
password: <string>process.env.REDIS_KEY,
|
|
15
|
-
name: 'checkRedisKeyCount'
|
|
16
|
-
})
|
|
17
|
-
.on('error', (err) => {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.error('createDefaultRedisClient: client onError:', err);
|
|
20
|
-
// reject(err);
|
|
21
|
-
});
|
|
22
|
-
redisClient.connect();
|
|
23
|
-
mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
24
|
-
|
|
25
|
-
async function main() {
|
|
26
|
-
const transactionNumberRepo = await chevre.repository.TransactionNumber.createInstance({
|
|
27
|
-
redisClient,
|
|
28
|
-
connection: mongoose.connection
|
|
29
|
-
});
|
|
30
|
-
const result = await transactionNumberRepo.setUseMongo4transactionNumberFrom({
|
|
31
|
-
useMongo4transactionNumberFrom: moment('2025-06-05T22:45:00Z')
|
|
32
|
-
.toDate()
|
|
33
|
-
});
|
|
34
|
-
console.log(result);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
main()
|
|
38
|
-
.then(() => {
|
|
39
|
-
console.log('success!');
|
|
40
|
-
})
|
|
41
|
-
.catch(console.error);
|
package/lib/chevre/adminAuth.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadChevreAuth = exports.auth = void 0;
|
|
4
|
-
const sdk_1 = require("@cinerino/sdk");
|
|
5
|
-
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return sdk_1.auth; } });
|
|
6
|
-
Object.defineProperty(exports, "loadChevreAuth", { enumerable: true, get: function () { return sdk_1.loadChevreAuth; } });
|