Skip to content

Commit

Permalink
feat/patch: add README, CHANGELOG, TAG
Browse files Browse the repository at this point in the history
  • Loading branch information
hubtwork committed May 14, 2021
1 parent bff3cbc commit c44b419
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 24 deletions.
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
## Changes

#### v1.1.2 ( 2021. 5. 1)
#### v1.2.0 ( 2021. 5. 14 )

- Add preprocessed data ([#4](https://github.com/Hubtwork/NCPClient/issues/4))

- preprocessed data will deliver simple, essentials to client

- add SENS sms services
- add PAPAGO services

- Add test with bug fixed

- bug fix with mocked response for test
- test with preprocessed data
- test with latest

- Update readme

- update readme with preprocessed data exmaple
- update usage functions with parameters



#### v1.1.2 ( 2021. 5. 1 )

- can import SMS, PAPAGO class for more typescrypty usage

#### v1.1.1 ( 2021. 4. 26)
#### v1.1.1 ( 2021. 4. 26 )

- Readme typing error fixed

Expand Down
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ const smsService = sens.smsService(ncpAuthKey, smsAuthKey)

async function sendMessage() {
// if you don't pass countryCode, default countryCode is 82.
const {isSuccess, data, errorMessage } = await smsService.sendSMS( sendSMSparam, countryCode )
const {isSuccess, data, preprocessed, errorMessage } = await smsService.sendSMS( sendSMSparam, countryCode )
// write something after async function
if (isSuccess) {
const { result, requestId } = preprocessed
// do something with data
} else {
// handle with errorMessage
Expand All @@ -93,10 +94,12 @@ const smsService = sens.smsService(ncpAuthKey, smsAuthKey)
- **Search message delivery request**

~~~javascript
async function searchMessageDeliveryRequest() {
const {isSuccess, data, errorMessage } = await smsService.searchMessageRequest('requestId')
async function searchMessageDeliveryRequest(requestId: string) {
const {isSuccess, data, preprocessed, errorMessage } = await smsService.searchMessageRequest(requestId)
// write something after async function
if (isSuccess) {
// messageIds: string[]
const { result, requestId, messageIds } = preprocessed
// do something with data
} else {
// handle with errorMessage
Expand All @@ -107,10 +110,12 @@ const smsService = sens.smsService(ncpAuthKey, smsAuthKey)
- **Search message delivery results**

~~~javascript
async function searchMessageDeliveryResults() {
const {isSuccess, data, errorMessage } = await smsService.searchMessageResult('messageId')
async function searchMessageDeliveryResults(messageId: string) {
const {isSuccess, data, preprocessed, errorMessage } = await smsService.searchMessageResult(messageId)
// write something after async function
if (isSuccess) {
// messages: MessageResultType[]
const { result, messages } = preprocessed
// do something with data
} else {
// handle with errorMessage
Expand All @@ -136,29 +141,27 @@ const papagoClient = naverOpenAPI.papagoService(openApiClientAuth)

- **Translation**

~~~javascript
async function translation() {
const src = 'sourceLanguage'
const target = 'targetLanguage'
const text = 'text want to translate'
const { isSuccess, data, errorMessage } = await papagoClient.translation(src, target, text)
~~~typescript
async function translation(source: string, target: string, text: string) {
const { isSuccess, data, preprocessed, errorMessage } = await papagoClient.translation(src, target, text)
// write something after async function
if (isSuccess) {
const { source, target, translated } = preprocessed
// do something with data
} else {
// handle with errorMessage
}
}
~~~

- **Language Detection**

~~~javascript
async function detectLanguage() {
const text = 'text want to detect language'
const { isSuccess, data, errorMessage } = await papagoClient.detectLanguage(text)
async function detectLanguage(text: string) {
const { isSuccess, data, preprocessed, errorMessage } = await papagoClient.detectLanguage(text)
// write something after async function
if (isSuccess) {
const { detected } = preprocessed
// do something with data
} else {
// handle with errorMessage
Expand All @@ -169,21 +172,20 @@ const papagoClient = naverOpenAPI.papagoService(openApiClientAuth)
- **Korean Name Romanizer**

~~~javascript
async function koreanNameRomanizer() {
const name = 'korean name'
const { isSuccess, data, errorMessage } = await papagoClient.koreanNameRominizer(name)
async function koreanNameRomanizer(koreanName: string) {
const { isSuccess, data, preprocessed, errorMessage } = await papagoClient.koreanNameRominizer(name)
// write something after async function
if (isSuccess) {
console.log(data.aResult[0].sFirstName) // firstName
console.log(data.aResult[0].aItems) // aItems
const { firstName, bestMatched } = preprocessed
// do something with data
} else {
// handle with errorMessage
}
}
~~~




## Types

**Note)** Introduced types are what you have to create or handle in use *NCP-Client*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ncp-client",
"version": "1.1.2a",
"version": "1.2.0",
"description": "Naver Cloud Platform Applications' OpenAPI Wrapper built in TS",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit c44b419

Please sign in to comment.