Skip to content

Commit e547ec7

Browse files
authored
Merge pull request #58 from hotsoycandy/feature/update-5.2.3
getBlockNumbers 추가, getBlockGroups 그룹 조건 추가
2 parents 384810f + eaeaa71 commit e547ec7

13 files changed

Lines changed: 231 additions & 32 deletions

changelog/ko/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 5.2.3 (2023년 2월 3일)
2+
3+
- 수신 차단 그룹 별 수신번호 목록을 조회하실 수 있는 기능을 추가했습니다.
4+
- 예제가 추가되었습니다.
5+
- 그룹 수신 차단 목록에 조회할 수 있는 항목 수가 늘어났습니다.
6+
- 각 검색 조건에 대한 예제와 설명이 추가되었습니다.
7+
18
# 5.2.2 (2023년 2월 3일)
29

310
- 그룹 수신 차단 목록을 조회할 수 있는 기능을 추가했습니다.

examples/javascript/common/src/iam/get_block_groups.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ const messageService = new SolapiMessageService(
99

1010
messageService.getBlockGroups({
1111
// 해당 그룹이 켜져있는지 아닌지 확인하고 싶을 경우
12-
// status: 'ACTIVE' // 'ACTIVE' 혹은 'INACTIVE'
12+
// status: 'ACTIVE' // 'ACTIVE' 혹은 'INACTIVE',
13+
14+
// 해당 그룹의 대한 이름을 검색해보고 싶을 경우
15+
// name: '070번호그룹' (부분 검색 가능)
1316
}).then(res => {
1417
// 목록
1518
console.log('#page1', res.blockGroups);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* 080 수신 거부 목록 조회
3+
*/
4+
const {SolapiMessageService} = require('solapi');
5+
const messageService = new SolapiMessageService(
6+
'ENTER_YOUR_API_KEY',
7+
'ENTER_YOUR_API_SECRET',
8+
);
9+
10+
messageService.getBlockNumbers({
11+
// 수신 차단한 수신번호를 검색해보고 싶을 경우
12+
// phoneNumber: '01000000000',
13+
14+
// 차단할 때 남긴 메모를 검색해보고 싶을 경우
15+
// memo: '이벤트 발송' (부분 검색 가능)
16+
}).then(res => {
17+
// 목록
18+
console.log('#page1', res.blockNumbers);
19+
20+
// 응답에 nextKey가 있을 경우 다음 페이지도 조회 가능
21+
messageService.getBlockNumbers({
22+
startKey: res.nextKey
23+
}).then(res => {
24+
console.log('#page2', res.blockNumbers);
25+
});
26+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solapi",
3-
"version": "5.2.2",
3+
"version": "5.2.3",
44
"description": "SOLAPI SDK for Node.js(Server Side Only)",
55
"repository": {
66
"type": "git",

src/requests/getBlockGroupsRequest.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
import {formatWithTransfer} from '../lib/stringDateTrasnfer';
2-
import { DatePayloadType } from './messageRequest';
1+
import {formatWithTransfer} from '../../lib/stringDateTrasnfer';
2+
import { DatePayloadType } from '../messageRequest';
33

44
export interface GetBlacksRequest {
5+
/**
6+
* @description 080 수신거부를 요청한 수신번호
7+
*/
58
senderNumber?: string;
9+
10+
/**
11+
* @description 페이지네이션 조회 키
12+
*/
613
startKey?: string;
14+
15+
/**
16+
* @description 조회 시 제한할 건 수 (기본: 20, 최대: 500)
17+
*/
718
limit?: number;
19+
820
/**
921
* @description 조회할 시작 날짜
1022
*/
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
export interface GetBlockGroupsRequest {
2+
/**
3+
* @description 수신 거부 그룹 핸들키
4+
*/
5+
blockGroupId?: string;
6+
7+
/**
8+
* @description 수신 거부 그룹에 등록된 모든 발신번호 적용 여부.
9+
*/
10+
useAll?: boolean;
11+
12+
/**
13+
* @description 수신 거부 그룹에 등록된 발신번호
14+
*/
15+
senderNumber?: string;
16+
17+
/**
18+
* @description 수신 거부 그룹 이름 (부분 검색 가능)
19+
*/
20+
name?: { like: string } | string;
21+
22+
/**
23+
* @description 수신 거부 그룹 활성화 상태
24+
*/
25+
status?: 'ACTIVE' | 'INACTIVE';
26+
27+
/**
28+
* @description 페이지네이션 조회 키
29+
*/
30+
startKey?: string;
31+
32+
/**
33+
* @description 조회 시 제한할 건 수 (기본: 20, 최대: 500)
34+
*/
35+
limit?: number;
36+
}
37+
38+
export class GetBlockGroupsFinalizeRequest implements GetBlockGroupsRequest {
39+
blockGroupId?: string;
40+
useAll?: boolean;
41+
senderNumber?: string;
42+
name?: { like: string } | string;
43+
status?: 'ACTIVE' | 'INACTIVE';
44+
startKey?: string;
45+
limit?: number;
46+
47+
constructor(parameter: GetBlockGroupsRequest) {
48+
this.blockGroupId = parameter.blockGroupId;
49+
this.useAll = parameter.useAll;
50+
this.senderNumber = parameter.senderNumber;
51+
if (parameter.name != undefined) {
52+
if (typeof parameter.name == 'string') {
53+
this.name = {
54+
like: parameter.name,
55+
};
56+
} else {
57+
this.name = parameter.name;
58+
}
59+
}
60+
this.status = parameter.status;
61+
this.startKey = parameter.startKey;
62+
this.limit = parameter.limit;
63+
}
64+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
export interface GetBlockNumbersRequest {
2+
/**
3+
* @description 수신 차단 그룹 별 수신번호 핸들키
4+
*/
5+
blockNumberId?: string;
6+
7+
/**
8+
* @description 해당 그룹의 발신번호를 차단한 수신번호
9+
*/
10+
phoneNumber?: string;
11+
12+
/**
13+
* @description 수신 차단 그룹 핸들키
14+
*/
15+
blockGroupId?: string;
16+
17+
/**
18+
* @description 수신 차단 그룹 별 수신번호 목록에 대한 메모 (부분 검색 가능)
19+
*/
20+
memo?: { like: string } | string;
21+
22+
/**
23+
* @description 페이지네이션 조회 키
24+
*/
25+
startKey?: string;
26+
27+
/**
28+
* @description 조회 시 제한할 건 수 (기본: 20, 최대: 500)
29+
*/
30+
limit?: number;
31+
}
32+
33+
export class GetBlockNumbersFinalizeRequest implements GetBlockNumbersRequest {
34+
blockNumberId?: string;
35+
phoneNumber?: string;
36+
blockGroupId?: string;
37+
memo?: { like: string } | string;
38+
startKey?: string;
39+
limit?: number;
40+
41+
constructor(parameter: GetBlockNumbersRequest) {
42+
this.blockNumberId = parameter.blockNumberId;
43+
this.phoneNumber = parameter.phoneNumber;
44+
this.blockGroupId = parameter.blockGroupId;
45+
if (parameter.memo != undefined) {
46+
if (typeof parameter.memo == 'string') {
47+
this.memo = {
48+
like: parameter.memo,
49+
};
50+
} else {
51+
this.memo = parameter.memo;
52+
}
53+
}
54+
this.startKey = parameter.startKey;
55+
this.limit = parameter.limit;
56+
}
57+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
HandleKey,
33
Black,
4-
} from '../types/commonTypes';
4+
} from '../../types/commonTypes';
55

66
export type GetBlacksResponse = {
77
startKey: string | null | undefined;
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import {
2-
BlockGroupId,
32
BlockGroup
4-
} from '../types/commonTypes';
3+
} from '../../types/commonTypes';
54

65
export type GetBlockGroupsResponse = {
76
startKey: string | null | undefined;
87
limit: number;
98
nextKey: string | null | undefined;
10-
blockGroups: Record<BlockGroupId, BlockGroup>;
9+
blockGroups: BlockGroup[];
1110
};

0 commit comments

Comments
 (0)