File tree Expand file tree Collapse file tree 5 files changed +148
-217
lines changed
packages/velog-server/src/services
ExternalIntegrationService Expand file tree Collapse file tree 5 files changed +148
-217
lines changed Original file line number Diff line number Diff line change @@ -2,22 +2,21 @@ import { RedisService } from '@lib/redis/RedisService.js'
2
2
import { injectable , singleton } from 'tsyringe'
3
3
4
4
interface Service {
5
- readBlockUserList ( ) : Promise < string [ ] >
6
5
checkBlockedUser ( username : string ) : Promise < boolean >
7
6
}
8
7
9
8
@injectable ( )
10
9
@singleton ( )
11
10
export class DynamicConfigService implements Service {
12
11
constructor ( private readonly redis : RedisService ) { }
13
- public async readBlockUserList ( ) : Promise < string [ ] > {
14
- const keyname = this . redis . setName . blockList
15
- const list = await this . redis . smembers ( keyname )
16
- return list
17
- }
18
12
public async checkBlockedUser ( username : string = '' ) : Promise < boolean > {
19
13
const list = await this . readBlockUserList ( )
20
14
const isBlocked = list . includes ( username )
21
15
return isBlocked
22
16
}
17
+ private async readBlockUserList ( ) : Promise < string [ ] > {
18
+ const keyname = this . redis . setName . blockList
19
+ const list = await this . redis . smembers ( keyname )
20
+ return list
21
+ }
23
22
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { JwtService } from '@lib/jwt/JwtService.js'
5
5
import { Time } from '@constants/TimeConstants.js'
6
6
import { ENV } from '@env'
7
7
import axios from 'axios'
8
- import { IntegrationTokenData , NotifyParams } from './ExternalIntegrationInterface.js'
9
8
import { UnauthorizedError } from '@errors/UnauthorizedError.js'
9
+ import { SerializePost } from '@services/PostService/index.js'
10
10
11
11
interface Service {
12
12
createIntegrationCode ( userId : string ) : Promise < string >
@@ -114,3 +114,19 @@ export class ExternalIntegrationService implements Service {
114
114
. catch ( console . error )
115
115
}
116
116
}
117
+
118
+ export type IntegrationTokenData = {
119
+ integrated_user_id : string
120
+ type : 'integration'
121
+ app_identifier : 'codenary'
122
+ }
123
+
124
+ export type NotifyParams =
125
+ | {
126
+ type : 'created' | 'updated'
127
+ post : SerializePost
128
+ }
129
+ | {
130
+ type : 'deleted'
131
+ post_id : string
132
+ }
You can’t perform that action at this time.
0 commit comments