ncp-service
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

NCP-Service

An easy-to-use typescript wrapper for Naver Cloud Platform API. With VersionUps, API wrappers will be added and updates.

Notice )

  • This project is created in TheAngeBridge, Inc.
  • Always welcome contributions for user's Productivity

Table of Contents

Dependency

  • axios

Installation

with npm

$ npm install ncp-service

Types

Note) Introduced types are what you have to create or handle in use NCP-Client

Based on Typescript's type alias, several types for api are declared. At this step, you can only show what you will use at each usage.

Common & Authentification

// `Authentication` for Naver Cloud Platform API
type AuthKey = {
  accessKey: string
  secretKey: string
}

// `Authentication` for SMS Service
type AuthKey = {
  phone: string
  serviceId: string
}

// Common return value for all NCP api request
type ApiClientResponse<T> = {
    // not null, you can check is request successful
    isSuccess: boolean
    // if error occured, provide error references
    errorCode?: string
    errorMessage?: string
    // if request is success, provide api response as data
    data?: T
}

Client Error Types

Client Response types preprocessed by NCP Client

HTTP Status Desc
API000 Invalid URL
API001 Client's axios config error
API100 HTTP errors from NCP API
API101 Unexpected Response
API102 No Response From Server
API200 Yet Unhandled error

Current Support

(SENS) SMS API v2 Cover All Services

  • Send SMS / LMS / MMS
  • Support Advertise, Reserve, Schedule
  • Lookup Message Request's status
  • Lookup Each Message's Result
  • Lookup Reserved Message
  • Cancel Reserved Message
  • Cancel Scheduled Message

Credits

License

ISC License

Package Sidebar

Install

npm i ncp-service

Weekly Downloads

0

Version

0.0.6

License

ISC

Unpacked Size

44.9 kB

Total Files

38

Last publish

Collaborators

  • theangelbridge