@chevre/domain 21.1.0-alpha.0 → 21.1.0-alpha.2
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/aggregateAllEvents2.ts +10 -7
- package/example/src/chevre/aggregateEventReservation.ts +7 -4
- package/example/src/chevre/processPay.ts +7 -4
- package/example/src/chevre/processRegisterMembership.ts +0 -5
- package/example/src/chevre/processRegisterPaymentCard.ts +0 -5
- package/example/src/chevre/processReserve.ts +7 -4
- package/example/src/chevre/redisConfig.ts +32 -0
- package/example/src/chevre/searchEventTicketOffers.ts +9 -6
- package/example/src/chevre/transaction/callOrderMembershipServiceTask.ts +7 -4
- package/example/src/chevre/transaction/orderMembershipService.ts +7 -4
- package/lib/chevre/repo/action/registerServiceInProgress.d.ts +3 -3
- package/lib/chevre/repo/action/registerServiceInProgress.js +19 -53
- package/lib/chevre/repo/confirmationNumber.d.ts +2 -2
- package/lib/chevre/repo/confirmationNumber.js +40 -53
- package/lib/chevre/repo/itemAvailability/screeningEvent.d.ts +3 -3
- package/lib/chevre/repo/itemAvailability/screeningEvent.js +54 -139
- package/lib/chevre/repo/orderNumber.d.ts +2 -2
- package/lib/chevre/repo/orderNumber.js +44 -55
- package/lib/chevre/repo/rateLimit/offer.d.ts +2 -2
- package/lib/chevre/repo/rateLimit/offer.js +7 -46
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +2 -2
- package/lib/chevre/repo/serviceOutputIdentifier.js +32 -46
- package/lib/chevre/repo/transactionNumber.d.ts +2 -2
- package/lib/chevre/repo/transactionNumber.js +41 -52
- package/lib/chevre/service/task.d.ts +4 -4
- package/package.json +3 -6
- package/example/src/chevre/copyRedisKeys.ts +0 -102
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
1
2
|
/**
|
|
2
3
|
* イベント集計タスク実行
|
|
3
4
|
*/
|
|
@@ -6,14 +7,16 @@ import { chevre } from '../../../lib/index';
|
|
|
6
7
|
import * as mongoose from 'mongoose';
|
|
7
8
|
import * as redis from 'redis';
|
|
8
9
|
|
|
9
|
-
const redisClient = redis.createClient({
|
|
10
|
-
port: Number(<string>process.env.REDIS_PORT),
|
|
11
|
-
host: <string>process.env.REDIS_HOST,
|
|
12
|
-
password: <string>process.env.REDIS_KEY,
|
|
13
|
-
tls: (process.env.REDIS_TLS_SERVERNAME !== undefined) ? { servername: process.env.REDIS_TLS_SERVERNAME } : undefined
|
|
14
|
-
});
|
|
15
|
-
|
|
16
10
|
export async function aggregateScreeningEvent() {
|
|
11
|
+
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
12
|
+
socket: {
|
|
13
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
14
|
+
host: <string>process.env.REDIS_HOST
|
|
15
|
+
},
|
|
16
|
+
password: <string>process.env.REDIS_KEY
|
|
17
|
+
});
|
|
18
|
+
await redisClient.connect();
|
|
19
|
+
|
|
17
20
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
18
21
|
|
|
19
22
|
let count = 0;
|
|
@@ -8,11 +8,14 @@ import { chevre } from '../../../lib/index';
|
|
|
8
8
|
|
|
9
9
|
async function main() {
|
|
10
10
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
11
|
-
const client = redis.createClient({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
12
|
+
socket: {
|
|
13
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
14
|
+
host: <string>process.env.REDIS_HOST
|
|
15
|
+
},
|
|
16
|
+
password: <string>process.env.REDIS_KEY
|
|
15
17
|
});
|
|
18
|
+
await client.connect();
|
|
16
19
|
|
|
17
20
|
// const now = new Date();
|
|
18
21
|
await chevre.service.aggregation.event.aggregateScreeningEvent({
|
|
@@ -9,11 +9,14 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
9
9
|
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
async function main() {
|
|
12
|
-
const client = redis.createClient({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
13
|
+
socket: {
|
|
14
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
15
|
+
host: <string>process.env.REDIS_HOST
|
|
16
|
+
},
|
|
17
|
+
password: <string>process.env.REDIS_KEY
|
|
16
18
|
});
|
|
19
|
+
await client.connect();
|
|
17
20
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
18
21
|
|
|
19
22
|
const accountingReportRepo = new chevre.repository.AccountingReport(mongoose.connection);
|
|
@@ -9,11 +9,6 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
9
9
|
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
async function main() {
|
|
12
|
-
// const client = redis.createClient({
|
|
13
|
-
// host: process.env.REDIS_HOST,
|
|
14
|
-
// port: Number(process.env.REDIS_PORT),
|
|
15
|
-
// password: process.env.REDIS_KEY
|
|
16
|
-
// });
|
|
17
12
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
18
13
|
|
|
19
14
|
const accountRepo = new chevre.repository.Account(mongoose.connection);
|
|
@@ -9,11 +9,6 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
9
9
|
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
async function main() {
|
|
12
|
-
// const client = redis.createClient({
|
|
13
|
-
// host: process.env.REDIS_HOST,
|
|
14
|
-
// port: Number(process.env.REDIS_PORT),
|
|
15
|
-
// password: process.env.REDIS_KEY
|
|
16
|
-
// });
|
|
17
12
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
18
13
|
|
|
19
14
|
const accountRepo = new chevre.repository.Account(mongoose.connection);
|
|
@@ -9,11 +9,14 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
9
9
|
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
async function main() {
|
|
12
|
-
const client = redis.createClient({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
13
|
+
socket: {
|
|
14
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
15
|
+
host: <string>process.env.REDIS_HOST
|
|
16
|
+
},
|
|
17
|
+
password: <string>process.env.REDIS_KEY
|
|
16
18
|
});
|
|
19
|
+
await client.connect();
|
|
17
20
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
18
21
|
|
|
19
22
|
const offerRepo = new chevre.repository.Offer(mongoose.connection);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as redis from 'redis';
|
|
3
|
+
|
|
4
|
+
// const project = { id: String(process.env.PROJECT_ID) };
|
|
5
|
+
|
|
6
|
+
// tslint:disable-next-line:max-func-body-length
|
|
7
|
+
async function main() {
|
|
8
|
+
const client = redis.createClient({
|
|
9
|
+
socket: {
|
|
10
|
+
host: process.env.REDIS_HOST,
|
|
11
|
+
port: Number(process.env.REDIS_PORT)
|
|
12
|
+
},
|
|
13
|
+
password: process.env.REDIS_KEY
|
|
14
|
+
});
|
|
15
|
+
await client.connect();
|
|
16
|
+
|
|
17
|
+
console.log(await client.info());
|
|
18
|
+
|
|
19
|
+
const key = 'sampleTest';
|
|
20
|
+
const ttl = 60;
|
|
21
|
+
const results = await client.multi()
|
|
22
|
+
.setNX(key, '1')
|
|
23
|
+
.expire(key, ttl)
|
|
24
|
+
.exec();
|
|
25
|
+
console.log('results:', results);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
main()
|
|
29
|
+
.then(() => {
|
|
30
|
+
console.log('success!');
|
|
31
|
+
})
|
|
32
|
+
.catch(console.error);
|
|
@@ -6,13 +6,16 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
|
|
7
7
|
// const PROJECT_ID = process.env.PROJECT_ID;
|
|
8
8
|
|
|
9
|
-
const client = redis.createClient({
|
|
10
|
-
host: process.env.REDIS_HOST,
|
|
11
|
-
port: Number(process.env.REDIS_PORT),
|
|
12
|
-
password: process.env.REDIS_KEY
|
|
13
|
-
});
|
|
14
|
-
|
|
15
9
|
async function main() {
|
|
10
|
+
const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
11
|
+
socket: {
|
|
12
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
13
|
+
host: <string>process.env.REDIS_HOST
|
|
14
|
+
},
|
|
15
|
+
password: <string>process.env.REDIS_KEY
|
|
16
|
+
});
|
|
17
|
+
await client.connect();
|
|
18
|
+
|
|
16
19
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
17
20
|
|
|
18
21
|
const eventRepo = new chevre.repository.Event(mongoose.connection);
|
|
@@ -10,11 +10,14 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
10
10
|
async function main() {
|
|
11
11
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
12
12
|
|
|
13
|
-
const redisClient = redis.createClient({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
14
|
+
socket: {
|
|
15
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
16
|
+
host: <string>process.env.REDIS_HOST
|
|
17
|
+
},
|
|
18
|
+
password: <string>process.env.REDIS_KEY
|
|
17
19
|
});
|
|
20
|
+
await redisClient.connect();
|
|
18
21
|
|
|
19
22
|
const result = await call(
|
|
20
23
|
{
|
|
@@ -10,11 +10,14 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
10
10
|
async function main() {
|
|
11
11
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
12
12
|
|
|
13
|
-
const redisClient = redis.createClient({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const redisClient = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
14
|
+
socket: {
|
|
15
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
16
|
+
host: <string>process.env.REDIS_HOST
|
|
17
|
+
},
|
|
18
|
+
password: <string>process.env.REDIS_KEY
|
|
17
19
|
});
|
|
20
|
+
await redisClient.connect();
|
|
18
21
|
|
|
19
22
|
const personRepo = new chevre.repository.Person({ userPoolId: chevre.settings.userPoolIdNew });
|
|
20
23
|
const actionRepo = new chevre.repository.Action(mongoose.connection);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RedisClientType } from 'redis';
|
|
2
2
|
/**
|
|
3
3
|
* 進行アクションキーインターフェース
|
|
4
4
|
*/
|
|
@@ -16,11 +16,11 @@ export interface IProgressKey {
|
|
|
16
16
|
export declare class RedisRepository {
|
|
17
17
|
private static readonly KEY_PREFIX;
|
|
18
18
|
private readonly redisClient;
|
|
19
|
-
constructor(redisClient:
|
|
19
|
+
constructor(redisClient: RedisClientType);
|
|
20
20
|
/**
|
|
21
21
|
* ロックする
|
|
22
22
|
*/
|
|
23
|
-
lock(progressKey: IProgressKey, holder: string): Promise<
|
|
23
|
+
lock(progressKey: IProgressKey, holder: string): Promise<boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* メンバーシップ登録進行ロックを解除する
|
|
26
26
|
*/
|
|
@@ -24,32 +24,21 @@ class RedisRepository {
|
|
|
24
24
|
*/
|
|
25
25
|
lock(progressKey, holder) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
43
|
-
/* istanbul ignore else: please write tests */
|
|
44
|
-
if (results[0] === 1) {
|
|
45
|
-
resolve(results[0]);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
reject(new Error('Already in progress.'));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
});
|
|
27
|
+
const key = `${RedisRepository.KEY_PREFIX}:${progressKey.agent.id}:${progressKey.product.id}`;
|
|
28
|
+
const ttl = 7200;
|
|
29
|
+
debug('locking...', key, ttl);
|
|
30
|
+
const results = yield this.redisClient.multi()
|
|
31
|
+
.setNX(key, holder)
|
|
32
|
+
.expire(key, ttl)
|
|
33
|
+
.exec();
|
|
34
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
35
|
+
/* istanbul ignore else: please write tests */
|
|
36
|
+
if (results[0] === 1 || results[0] === true) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw new Error('Already in progress.');
|
|
41
|
+
}
|
|
53
42
|
});
|
|
54
43
|
}
|
|
55
44
|
/**
|
|
@@ -57,37 +46,14 @@ class RedisRepository {
|
|
|
57
46
|
*/
|
|
58
47
|
unlock(progressKey) {
|
|
59
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.redisClient.del([key], (err, res) => {
|
|
63
|
-
debug(err, res);
|
|
64
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
65
|
-
/* istanbul ignore if: please write tests */
|
|
66
|
-
if (err instanceof Error) {
|
|
67
|
-
reject(err);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
resolve();
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
49
|
+
const key = `${RedisRepository.KEY_PREFIX}:${progressKey.agent.id}:${progressKey.product.id}`;
|
|
50
|
+
yield this.redisClient.del([key]);
|
|
74
51
|
});
|
|
75
52
|
}
|
|
76
53
|
getHolder(progressKey) {
|
|
77
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.redisClient.get(key, (err, res) => {
|
|
81
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
82
|
-
/* istanbul ignore if: please write tests */
|
|
83
|
-
if (err instanceof Error) {
|
|
84
|
-
reject(err);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
resolve(res);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
});
|
|
55
|
+
const key = `${RedisRepository.KEY_PREFIX}:${progressKey.agent.id}:${progressKey.product.id}`;
|
|
56
|
+
return this.redisClient.get(key);
|
|
91
57
|
});
|
|
92
58
|
}
|
|
93
59
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisClientType } from 'redis';
|
|
2
2
|
/**
|
|
3
3
|
* 確認番号リポジトリ
|
|
4
4
|
*/
|
|
5
5
|
export declare class RedisRepository {
|
|
6
6
|
private static readonly REDIS_KEY_PREFIX;
|
|
7
7
|
private readonly redisClient;
|
|
8
|
-
constructor(redisClient:
|
|
8
|
+
constructor(redisClient: RedisClientType);
|
|
9
9
|
static ALIGN_DIGITS(params: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* 発行する
|
|
@@ -11,13 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RedisRepository = void 0;
|
|
13
13
|
const cdigit = require("cdigit");
|
|
14
|
-
const createDebug = require("debug");
|
|
15
14
|
const moment = require("moment-timezone");
|
|
16
15
|
const util = require("util");
|
|
17
16
|
// tslint:disable-next-line:no-require-imports no-var-requires
|
|
18
17
|
const fpe = require('node-fpe');
|
|
19
18
|
const factory = require("../factory");
|
|
20
|
-
const debug = createDebug('chevre-domain:repository');
|
|
21
19
|
const CONFIRMATION_NUMBER_MIN_LENGH = 4;
|
|
22
20
|
/**
|
|
23
21
|
* 確認番号リポジトリ
|
|
@@ -39,57 +37,46 @@ class RedisRepository {
|
|
|
39
37
|
*/
|
|
40
38
|
publish(params) {
|
|
41
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// .decrypt(confirmationNumber.slice(1))
|
|
83
|
-
// );
|
|
84
|
-
resolve(confirmationNumber);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// 基本的にありえないフロー
|
|
88
|
-
reject(new factory.errors.ServiceUnavailable('Confirmation number not published'));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
40
|
+
// データ保管期間はとりあえず一か月
|
|
41
|
+
const TTL = moment(params.orderDate)
|
|
42
|
+
.add(1, 'month')
|
|
43
|
+
.diff(moment(params.orderDate), 'seconds');
|
|
44
|
+
const key = util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX, moment(params.orderDate)
|
|
45
|
+
.tz('Asia/Tokyo')
|
|
46
|
+
.format('YYMM'));
|
|
47
|
+
const results = yield this.redisClient.multi()
|
|
48
|
+
.incr(key)
|
|
49
|
+
.expire(key, TTL)
|
|
50
|
+
.exec();
|
|
51
|
+
if (!Array.isArray(results)) {
|
|
52
|
+
// なぜかresults: nullのことがあるのでハンドリング
|
|
53
|
+
throw new factory.errors.ServiceUnavailable('incr confirmationNumber result not array');
|
|
54
|
+
}
|
|
55
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
56
|
+
/* istanbul ignore else: please write tests */
|
|
57
|
+
if (typeof results[0] === 'number') {
|
|
58
|
+
const no = results[0];
|
|
59
|
+
// debug('no incremented.', no);
|
|
60
|
+
// 桁数調整
|
|
61
|
+
let confirmationNumber = RedisRepository.ALIGN_DIGITS(String(no));
|
|
62
|
+
// debug('encrypting confirmationNumber...', confirmationNumber);
|
|
63
|
+
// checkdigit
|
|
64
|
+
const cd = cdigit.luhn.compute(confirmationNumber);
|
|
65
|
+
// debug('check digit:', cd);
|
|
66
|
+
confirmationNumber = fpe({ password: cd })
|
|
67
|
+
.encrypt(confirmationNumber);
|
|
68
|
+
confirmationNumber = `${cd}${confirmationNumber}`;
|
|
69
|
+
// console.log(
|
|
70
|
+
// 'decrypted confirmationNumber:',
|
|
71
|
+
// fpe({ password: confirmationNumber.slice(0, 1) })
|
|
72
|
+
// .decrypt(confirmationNumber.slice(1))
|
|
73
|
+
// );
|
|
74
|
+
return confirmationNumber;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// 基本的にありえないフロー
|
|
78
|
+
throw new factory.errors.ServiceUnavailable('Confirmation number not published');
|
|
79
|
+
}
|
|
93
80
|
});
|
|
94
81
|
}
|
|
95
82
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RedisClientType } from 'redis';
|
|
2
2
|
import * as factory from '../../factory';
|
|
3
3
|
export interface IOffer {
|
|
4
4
|
itemOffered?: {
|
|
@@ -28,7 +28,7 @@ export interface IUnlockKey {
|
|
|
28
28
|
export declare class RedisRepository {
|
|
29
29
|
static KEY_PREFIX: string;
|
|
30
30
|
private readonly redisClient;
|
|
31
|
-
constructor(redisClient:
|
|
31
|
+
constructor(redisClient: RedisClientType);
|
|
32
32
|
static OFFER2FIELD(params: IOffer): string;
|
|
33
33
|
/**
|
|
34
34
|
* 座席をロックする(maxキャパシティチェック有)
|
|
@@ -59,7 +59,7 @@ export declare class RedisRepository {
|
|
|
59
59
|
/**
|
|
60
60
|
* 保持者を取得する
|
|
61
61
|
*/
|
|
62
|
-
getHolder(params: IUnlockKey): Promise<string | null>;
|
|
62
|
+
getHolder(params: IUnlockKey): Promise<string | null | undefined>;
|
|
63
63
|
/**
|
|
64
64
|
* 在庫状況を検索する
|
|
65
65
|
* offers.lengthが0だと"ERR wrong number of arguments for 'hmget' command"となるので注意
|