@chevre/domain 22.11.0-alpha.1 → 22.11.0-alpha.10
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/assetTransaction/processReserve.ts +0 -1
- package/example/src/chevre/checkProjectMembers.ts +55 -0
- package/example/src/chevre/orders/searchWithUnwoundAcceptedOffers.ts +73 -0
- package/example/src/chevre/roles/addAdminInventoryManagerRole.ts +50 -0
- 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/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 +32 -0
- package/example/src/chevre/stockHolder/checkRedisKeyCount.ts +11 -20
- package/example/src/chevre/unsetUnnecessaryFields.ts +8 -5
- package/lib/chevre/index.d.ts +0 -2
- package/lib/chevre/index.js +0 -10
- package/lib/chevre/repo/acceptedOffer.d.ts +3 -1
- package/lib/chevre/repo/acceptedOffer.js +11 -3
- 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/mongoose/schemas/identity.d.ts +1 -1
- package/lib/chevre/repo/orderNumber.d.ts +0 -11
- package/lib/chevre/repo/orderNumber.js +13 -51
- package/lib/chevre/repo/role.d.ts +11 -0
- package/lib/chevre/repo/role.js +36 -0
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +0 -4
- package/lib/chevre/repo/serviceOutputIdentifier.js +13 -38
- package/lib/chevre/repo/setting.d.ts +14 -1
- package/lib/chevre/repo/setting.js +15 -0
- package/lib/chevre/repo/stockHolder.js +0 -11
- 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/code.d.ts +5 -28
- package/lib/chevre/service/code.js +3 -79
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +22 -14
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -5
- package/lib/chevre/service/task/authorizePayment.js +7 -6
- package/lib/chevre/service/task/checkMovieTicket.js +4 -3
- package/lib/chevre/service/task/givePointAward.js +1 -1
- package/lib/chevre/service/task/moneyTransfer.js +1 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +6 -7
- package/lib/chevre/service/task/refund.js +1 -1
- package/lib/chevre/service/task/returnMoneyTransfer.js +1 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/returnPointAward.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -3
- 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/package.json +3 -3
- package/example/src/chevre/adminAuth/adminIdentity.ts +0 -38
- package/example/src/chevre/checkActions.ts +0 -65
- package/example/src/chevre/roles/addRoleMembers.ts +0 -75
- 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,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; } });
|