Skip to content

Commit b49889f

Browse files
SDK 버전을 5.5.2로 업데이트하고, ESLint 및 Prettier 설정을 Biome으로 전환함. 불필요한 파일을 삭제하고, 예제 코드에서 Promise 체이닝을 개선하여 가독성을 높임. 추가적으로, 여러 패키지의 버전을 최신으로 업데이트함.
1 parent 7db2c43 commit b49889f

35 files changed

Lines changed: 632 additions & 1416 deletions

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

biome.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
3+
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
4+
"files": { "ignoreUnknown": false, "includes": ["**", "!docs/**/*"] },
5+
"formatter": {
6+
"enabled": true,
7+
"formatWithErrors": false,
8+
"indentStyle": "space",
9+
"indentWidth": 2,
10+
"lineEnding": "lf",
11+
"lineWidth": 80,
12+
"attributePosition": "auto",
13+
"bracketSameLine": false,
14+
"bracketSpacing": true,
15+
"expand": "auto",
16+
"useEditorconfig": true
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": false,
22+
"complexity": {
23+
"noArguments": "error",
24+
"noUselessTypeConstraint": "error"
25+
},
26+
"correctness": {
27+
"noConstAssign": "off",
28+
"noGlobalObjectCalls": "off",
29+
"noInvalidBuiltinInstantiation": "off",
30+
"noInvalidConstructorSuper": "off",
31+
"noSetterReturn": "off",
32+
"noUndeclaredVariables": "off",
33+
"noUnreachable": "off",
34+
"noUnreachableSuper": "off",
35+
"noUnusedImports": "warn",
36+
"noUnusedVariables": "error"
37+
},
38+
"style": {
39+
"noCommonJs": "error",
40+
"noInferrableTypes": "warn",
41+
"noNamespace": "error",
42+
"useArrayLiterals": "error",
43+
"useAsConstAssertion": "error",
44+
"useConst": "error"
45+
},
46+
"suspicious": {
47+
"noClassAssign": "off",
48+
"noDuplicateClassMembers": "off",
49+
"noDuplicateObjectKeys": "off",
50+
"noDuplicateParameters": "off",
51+
"noExplicitAny": "error",
52+
"noExtraNonNullAssertion": "error",
53+
"noFunctionAssign": "off",
54+
"noImportAssign": "off",
55+
"noMisleadingInstantiator": "error",
56+
"noRedeclare": "off",
57+
"noUnsafeDeclarationMerging": "error",
58+
"noUnsafeNegation": "off",
59+
"noVar": "error",
60+
"noWith": "off",
61+
"useGetterReturn": "off",
62+
"useNamespaceKeyword": "error"
63+
}
64+
},
65+
"includes": [
66+
"**",
67+
"!dist/**/*",
68+
"!examples/**/*",
69+
"!debug/**/*",
70+
"!docs/**/*"
71+
]
72+
},
73+
"javascript": {
74+
"formatter": {
75+
"jsxQuoteStyle": "double",
76+
"quoteProperties": "asNeeded",
77+
"trailingCommas": "all",
78+
"semicolons": "always",
79+
"arrowParentheses": "asNeeded",
80+
"bracketSameLine": false,
81+
"quoteStyle": "single",
82+
"attributePosition": "auto",
83+
"bracketSpacing": false
84+
},
85+
"globals": ["exports"]
86+
},
87+
"html": { "formatter": { "selfCloseVoidElements": "always" } },
88+
"assist": {
89+
"enabled": true,
90+
"actions": { "source": { "organizeImports": "on" } }
91+
}
92+
}

eslint.config.mjs

Lines changed: 0 additions & 57 deletions
This file was deleted.

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,24 @@ const messageService = new SolapiMessageService(
77
'ENTER_YOUR_API_SECRET',
88
);
99

10-
messageService.getBlacks({
11-
// 차단 당한 발신번호를 검색하는 경우
12-
// senderNumber: '029302266',
10+
messageService
11+
.getBlacks({
12+
// 차단 당한 발신번호를 검색하는 경우
13+
// senderNumber: '029302266',
14+
// 날짜로 검색하는 경우
15+
// startDate: '2022-12-01 00:00:00', // Date 객체로도 요청 가능
16+
// endDate: '2022-12-31 23:59:59' // Date 객체로도 요청 가능
17+
})
18+
.then(res => {
19+
// 목록
20+
console.log('#page1', res.blackList);
1321

14-
// 날짜로 검색하는 경우
15-
// startDate: '2022-12-01 00:00:00', // Date 객체로도 요청 가능
16-
// endDate: '2022-12-31 23:59:59' // Date 객체로도 요청 가능
17-
}).then(res => {
18-
// 목록
19-
console.log('#page1', res.blackList);
20-
21-
// 응답에 nextKey가 있을 경우 다음 페이지도 조회 가능
22-
messageService.getBlacks({
23-
startKey: res.nextKey
24-
}).then(res => {
25-
console.log('#page2', res.blackList);
22+
// 응답에 nextKey가 있을 경우 다음 페이지도 조회 가능
23+
messageService
24+
.getBlacks({
25+
startKey: res.nextKey,
26+
})
27+
.then(res => {
28+
console.log('#page2', res.blackList);
29+
});
2630
});
27-
});

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

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ const messageService = new SolapiMessageService(
77
'ENTER_YOUR_API_SECRET',
88
);
99

10-
messageService.getBlockGroups({
11-
// 해당 그룹이 켜져있는지 아닌지 확인하고 싶을 경우
12-
// status: 'ACTIVE' // 'ACTIVE' 혹은 'INACTIVE',
10+
messageService
11+
.getBlockGroups({
12+
// 해당 그룹이 켜져있는지 아닌지 확인하고 싶을 경우
13+
// status: 'ACTIVE' // 'ACTIVE' 혹은 'INACTIVE',
14+
// 해당 그룹의 대한 이름을 검색해보고 싶을 경우
15+
// name: '070번호그룹' (부분 검색 가능)
16+
})
17+
.then(res => {
18+
// 목록
19+
console.log('#page1', res.blockGroups);
1320

14-
// 해당 그룹의 대한 이름을 검색해보고 싶을 경우
15-
// name: '070번호그룹' (부분 검색 가능)
16-
}).then(res => {
17-
// 목록
18-
console.log('#page1', res.blockGroups);
19-
20-
// 응답에 nextKey가 있을 경우 다음 페이지도 조회 가능
21-
messageService.getBlockGroups({
22-
startKey: res.nextKey
23-
}).then(res => {
24-
console.log('#page2', res.blockGroups);
21+
// 응답에 nextKey가 있을 경우 다음 페이지도 조회 가능
22+
messageService
23+
.getBlockGroups({
24+
startKey: res.nextKey,
25+
})
26+
.then(res => {
27+
console.log('#page2', res.blockGroups);
28+
});
2529
});
26-
});

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

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ const messageService = new SolapiMessageService(
77
'ENTER_YOUR_API_SECRET',
88
);
99

10-
messageService.getBlockNumbers({
11-
// 수신 차단한 수신번호를 검색해보고 싶을 경우
12-
// phoneNumber: '01000000000',
10+
messageService
11+
.getBlockNumbers({
12+
// 수신 차단한 수신번호를 검색해보고 싶을 경우
13+
// phoneNumber: '01000000000',
14+
// 차단할 때 남긴 메모를 검색해보고 싶을 경우
15+
// memo: '이벤트 발송' (부분 검색 가능)
16+
})
17+
.then(res => {
18+
// 목록
19+
console.log('#page1', res.blockNumbers);
1320

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);
21+
// 응답에 nextKey가 있을 경우 다음 페이지도 조회 가능
22+
messageService
23+
.getBlockNumbers({
24+
startKey: res.nextKey,
25+
})
26+
.then(res => {
27+
console.log('#page2', res.blockNumbers);
28+
});
2529
});
26-
});

examples/javascript/common/src/kakao/alimtalk_template/get_templates.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const messageService = new SolapiMessageService(
88
);
99

1010
messageService
11-
.getKakaoAlimtalkTemplates
12-
// 검색 조건이 있을 떄 추가
13-
/*{
11+
.getKakaoAlimtalkTemplates(
12+
// 검색 조건이 있을 떄 추가
13+
/*{
1414
limit: 5, // 한 번 요청당 조회할 건 수 입력, 기본값은 20
1515
startKey: '페이지네이션 조회 키',
1616
name: '템플릿 이름 입력(일부 키워드로 검색 가능)',
@@ -34,5 +34,5 @@ messageService
3434
startDate: '',
3535
endDate: '',
3636
},*/
37-
()
37+
)
3838
.then(res => console.log(res));

examples/javascript/webhooks/index.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
const express = require("express");
2-
const bodyParser = require("body-parser");
3-
const asyncify = require("express-asyncify");
4-
const { SolapiMessageService } = require("solapi");
5-
const messageService = new SolapiMessageService("ENTER_YOUR_API_KEY", "ENTER_YOUR_API_SECRET");
1+
const express = require('express');
2+
const bodyParser = require('body-parser');
3+
const asyncify = require('express-asyncify');
4+
const {SolapiMessageService} = require('solapi');
5+
const messageService = new SolapiMessageService(
6+
'ENTER_YOUR_API_KEY',
7+
'ENTER_YOUR_API_SECRET',
8+
);
69

710
/**
811
* 웹훅 레퍼런스
@@ -11,21 +14,21 @@ const messageService = new SolapiMessageService("ENTER_YOUR_API_KEY", "ENTER_YOU
1114

1215
// 넘어온 그룹 ID로 메시지 목록을 가져오는 API를 사용하므로 API Key, API Secret Key가 준비되어야 합니다.
1316
const app = asyncify(express());
14-
app.use(bodyParser.json({ extended: false }));
15-
app.use(bodyParser.urlencoded({ extended: false }));
17+
app.use(bodyParser.json({extended: false}));
18+
app.use(bodyParser.urlencoded({extended: false}));
1619

1720
// 메시지 리포트
18-
app.post("/single-report", async (req, res) => {
21+
app.post('/single-report', async (req, res) => {
1922
// body에 [] 형식으로 메시지정보 객체 목록이 들어옵니다.
2023
for (const messageInfo of req.body) {
21-
console.log("메시지 정보:", messageInfo);
24+
console.log('메시지 정보:', messageInfo);
2225
}
2326
// 200을 리턴해야 합니다. (200이 리턴되지 않으면 특정 시간 간격을 두고 총 5번이 호출됩니다)
2427
return res.status(200).json({});
2528
});
2629

2730
// 그룹 리포트
28-
app.post("/group-report", async (req, res) => {
31+
app.post('/group-report', async (req, res) => {
2932
// body에 [] 형식으로 그룹정보 객체 목록이 들어옵니다.
3033
for (const groupInfo of req.body) {
3134
// 그룹ID로 메시지 목록을 가져옵니다.
@@ -36,18 +39,18 @@ app.post("/group-report", async (req, res) => {
3639
* 메시지 상태 코드: https://developers.solapi.com/references/message-status-codes
3740
* 알림톡/문자 모두 정상처리는 4000번
3841
*/
39-
console.log("메시지 정보:", result.messageList[messageId]);
42+
console.log('메시지 정보:', result.messageList[messageId]);
4043
}
4144
}
4245
// 200을 리턴해야 합니다. (200이 리턴되지 않으면 특정 시간 간격을 두고 총 5번이 호출됩니다)
4346
return res.status(200).json({});
4447
});
4548

4649
// 팩스 수신
47-
app.post("/fax", async (req, res) => {
50+
app.post('/fax', async (req, res) => {
4851
// body에 [] 형식으로 팩스수신정보 객체 목록이 들어옵니다.
4952
for (const faxInfo of req.body) {
50-
console.log("팩스 수신 정보:", faxInfo);
53+
console.log('팩스 수신 정보:', faxInfo);
5154
}
5255
// 200을 리턴해야 합니다. (200이 리턴되지 않으면 특정 시간 간격을 두고 총 5번이 호출됩니다)
5356
return res.status(200).json({});

examples/nextjs/next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { NextConfig } from "next";
1+
import type {NextConfig} from 'next';
22

33
const nextConfig: NextConfig = {
44
/* config options here */

examples/nextjs/postcss.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const config = {
2-
plugins: ["@tailwindcss/postcss"],
2+
plugins: ['@tailwindcss/postcss'],
33
};
44

55
export default config;

0 commit comments

Comments
 (0)