@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.
Files changed (155) hide show
  1. package/example/src/chevre/aggregation/aggregateTasks.ts +41 -0
  2. package/example/src/chevre/assetTransaction/processReserve.ts +0 -1
  3. package/example/src/chevre/notifyAbortedTasksByEmail.ts +1 -1
  4. package/example/src/chevre/reIndex.ts +1 -1
  5. package/example/src/chevre/roles/addAdminPermissionIfNotExists.ts +132 -0
  6. package/example/src/chevre/roles/addDefaultPermissionIfNotExists.ts +37 -0
  7. package/example/src/chevre/roles/addEventOfferPermissionIfNotExists.ts +27 -0
  8. package/example/src/chevre/roles/addPermissionIfNotExists.ts +39 -6
  9. package/example/src/chevre/roles/addProjectCreatorRole.ts +48 -0
  10. package/example/src/chevre/roles/assignGlobalRoles.ts +72 -0
  11. package/example/src/chevre/roles/findPermissions.ts +84 -0
  12. package/example/src/chevre/roles/findRoleNames.ts +117 -0
  13. package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +38 -0
  14. package/example/src/chevre/roles/removePermissionFromAPIRoles.ts +46 -0
  15. package/example/src/chevre/roles/removePermissionIfExists.ts +39 -0
  16. package/example/src/chevre/settings/addSettings.ts +31 -17
  17. package/example/src/chevre/stockHolder/checkRedisKeyCount.ts +11 -20
  18. package/example/src/chevre/task/countPotentiallyRunning.ts +41 -0
  19. package/example/src/chevre/task/countTasks.ts +51 -0
  20. package/example/src/chevre/unsetUnnecessaryFields.ts +8 -5
  21. package/example/src/idaas/auth0/adminApplications.ts +183 -0
  22. package/example/src/idaas/auth0/getToken.ts +55 -0
  23. package/example/src/idaas/auth0/getTokenByPrivateKeyJWT.ts +84 -0
  24. package/example/src/regex.ts +31 -0
  25. package/lib/chevre/eventEmitter/task.d.ts +29 -6
  26. package/lib/chevre/index.d.ts +0 -2
  27. package/lib/chevre/index.js +0 -10
  28. package/lib/chevre/repo/confirmationNumber.d.ts +0 -11
  29. package/lib/chevre/repo/confirmationNumber.js +15 -54
  30. package/lib/chevre/repo/identity.d.ts +11 -33
  31. package/lib/chevre/repo/identity.js +10 -15
  32. package/lib/chevre/repo/member.d.ts +22 -4
  33. package/lib/chevre/repo/member.js +81 -27
  34. package/lib/chevre/repo/mongoose/schemas/identity.d.ts +1 -1
  35. package/lib/chevre/repo/mongoose/schemas/member/global.d.ts +14 -0
  36. package/lib/chevre/repo/mongoose/schemas/member/global.js +82 -0
  37. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +15 -0
  38. package/lib/chevre/repo/mongoose/schemas/setting.js +1 -0
  39. package/lib/chevre/repo/mongoose/schemas/task.js +9 -0
  40. package/lib/chevre/repo/orderNumber.d.ts +0 -11
  41. package/lib/chevre/repo/orderNumber.js +13 -51
  42. package/lib/chevre/repo/role.d.ts +16 -4
  43. package/lib/chevre/repo/role.js +71 -32
  44. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +0 -4
  45. package/lib/chevre/repo/serviceOutputIdentifier.js +13 -38
  46. package/lib/chevre/repo/setting.d.ts +5 -10
  47. package/lib/chevre/repo/setting.js +4 -7
  48. package/lib/chevre/repo/stockHolder.js +0 -11
  49. package/lib/chevre/repo/task.d.ts +47 -34
  50. package/lib/chevre/repo/task.js +114 -292
  51. package/lib/chevre/repo/transaction.js +10 -10
  52. package/lib/chevre/repo/transactionNumber.d.ts +0 -11
  53. package/lib/chevre/repo/transactionNumber.js +13 -51
  54. package/lib/chevre/repo/transactionNumberCounter.d.ts +0 -10
  55. package/lib/chevre/repo/transactionNumberCounter.js +34 -29
  56. package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
  57. package/lib/chevre/service/code.d.ts +5 -28
  58. package/lib/chevre/service/code.js +3 -79
  59. package/lib/chevre/service/iam.d.ts +17 -7
  60. package/lib/chevre/service/iam.js +26 -6
  61. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +15 -0
  62. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +38 -0
  63. package/lib/chevre/service/notification.d.ts +2 -1
  64. package/lib/chevre/service/notification.js +3 -1
  65. package/lib/chevre/service/task/acceptCOAOffer.d.ts +1 -1
  66. package/lib/chevre/service/task/acceptCOAOffer.js +6 -5
  67. package/lib/chevre/service/task/aggregateOffers.d.ts +1 -1
  68. package/lib/chevre/service/task/aggregateOnSystem.d.ts +4 -2
  69. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +1 -1
  70. package/lib/chevre/service/task/authorizePayment.d.ts +1 -1
  71. package/lib/chevre/service/task/authorizePayment.js +7 -6
  72. package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +1 -1
  73. package/lib/chevre/service/task/cancelPendingReservation.d.ts +1 -1
  74. package/lib/chevre/service/task/cancelReservation.d.ts +1 -1
  75. package/lib/chevre/service/task/checkMovieTicket.d.ts +1 -1
  76. package/lib/chevre/service/task/checkMovieTicket.js +4 -3
  77. package/lib/chevre/service/task/checkResource.d.ts +1 -1
  78. package/lib/chevre/service/task/confirmMoneyTransfer.d.ts +1 -1
  79. package/lib/chevre/service/task/confirmPayTransaction.d.ts +1 -1
  80. package/lib/chevre/service/task/confirmRegisterService.d.ts +1 -1
  81. package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +1 -1
  82. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
  83. package/lib/chevre/service/task/createAccountingReport.d.ts +1 -1
  84. package/lib/chevre/service/task/createEvent.d.ts +1 -1
  85. package/lib/chevre/service/task/deletePerson.d.ts +1 -1
  86. package/lib/chevre/service/task/deleteTransaction.d.ts +1 -1
  87. package/lib/chevre/service/task/givePointAward.d.ts +1 -1
  88. package/lib/chevre/service/task/givePointAward.js +1 -1
  89. package/lib/chevre/service/task/handleNotification.d.ts +4 -2
  90. package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +1 -1
  91. package/lib/chevre/service/task/importEventsFromCOA.d.ts +1 -1
  92. package/lib/chevre/service/task/importOffersFromCOA.d.ts +1 -1
  93. package/lib/chevre/service/task/invalidatePaymentUrl.d.ts +1 -1
  94. package/lib/chevre/service/task/moneyTransfer.d.ts +1 -1
  95. package/lib/chevre/service/task/moneyTransfer.js +1 -1
  96. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +1 -1
  97. package/lib/chevre/service/task/onAuthorizationCreated.d.ts +1 -1
  98. package/lib/chevre/service/task/onEventChanged.d.ts +1 -1
  99. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +1 -1
  100. package/lib/chevre/service/task/onResourceUpdated.d.ts +1 -1
  101. package/lib/chevre/service/task/pay.d.ts +1 -1
  102. package/lib/chevre/service/task/placeOrder.d.ts +1 -1
  103. package/lib/chevre/service/task/publishPaymentUrl.d.ts +1 -1
  104. package/lib/chevre/service/task/publishPaymentUrl.js +6 -7
  105. package/lib/chevre/service/task/refund.d.ts +1 -1
  106. package/lib/chevre/service/task/refund.js +1 -1
  107. package/lib/chevre/service/task/registerService.d.ts +1 -1
  108. package/lib/chevre/service/task/reserve.d.ts +1 -1
  109. package/lib/chevre/service/task/returnMoneyTransfer.d.ts +1 -1
  110. package/lib/chevre/service/task/returnMoneyTransfer.js +1 -1
  111. package/lib/chevre/service/task/returnOrder.d.ts +1 -1
  112. package/lib/chevre/service/task/returnPayTransaction.d.ts +1 -1
  113. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  114. package/lib/chevre/service/task/returnPointAward.d.ts +1 -1
  115. package/lib/chevre/service/task/returnPointAward.js +1 -1
  116. package/lib/chevre/service/task/returnReserveTransaction.d.ts +1 -1
  117. package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
  118. package/lib/chevre/service/task/sendEmailMessage.d.ts +1 -1
  119. package/lib/chevre/service/task/sendOrder.d.ts +1 -1
  120. package/lib/chevre/service/task/triggerWebhook.d.ts +1 -1
  121. package/lib/chevre/service/task/useReservation.d.ts +1 -1
  122. package/lib/chevre/service/task/voidMoneyTransferTransaction.d.ts +1 -1
  123. package/lib/chevre/service/task/voidPayTransaction.d.ts +1 -1
  124. package/lib/chevre/service/task/voidPayment.d.ts +1 -1
  125. package/lib/chevre/service/task/voidRegisterServiceTransaction.d.ts +1 -1
  126. package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
  127. package/lib/chevre/service/task/voidReserveTransaction.js +4 -3
  128. package/lib/chevre/service/task.d.ts +7 -29
  129. package/lib/chevre/service/task.js +9 -114
  130. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.d.ts +11 -0
  131. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +105 -0
  132. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +17 -0
  133. package/lib/chevre/service/taskHandler/onOperationFailed.js +70 -0
  134. package/lib/chevre/service/taskHandler.d.ts +26 -0
  135. package/lib/chevre/service/taskHandler.js +96 -0
  136. package/lib/chevre/service/validation/validateOrder.js +55 -37
  137. package/lib/chevre/service.d.ts +0 -4
  138. package/lib/chevre/service.js +10 -14
  139. package/lib/chevre/settings/aggregation.d.ts +6 -1
  140. package/lib/chevre/settings/aggregation.js +2 -1
  141. package/package.json +5 -3
  142. package/example/src/chevre/adminAuth/adminIdentity.ts +0 -38
  143. package/example/src/chevre/executeOneTask.ts +0 -41
  144. package/example/src/chevre/executeTaskIfExists.ts +0 -80
  145. package/example/src/chevre/findExecutableTask.ts +0 -50
  146. package/example/src/chevre/findSetting.ts +0 -79
  147. package/example/src/chevre/roles/addRoleMembers.ts +0 -75
  148. package/example/src/chevre/searchPermissions.ts +0 -46
  149. package/example/src/chevre/transactionNumber/publishConfimationNumber.ts +0 -37
  150. package/example/src/chevre/transactionNumber/publishOrderNumber.ts +0 -40
  151. package/example/src/chevre/transactionNumber/setUseMongo4confirmationNumberFrom.ts +0 -45
  152. package/example/src/chevre/transactionNumber/setUseMongo4orderNumberFrom.ts +0 -41
  153. package/example/src/chevre/transactionNumber/setUseMongo4transactionNumberFrom.ts +0 -41
  154. package/lib/chevre/adminAuth.d.ts +0 -2
  155. 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);
@@ -1,2 +0,0 @@
1
- import { auth, chevreAuth, loadChevreAuth } from '@cinerino/sdk';
2
- export { auth, loadChevreAuth, chevreAuth };
@@ -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; } });