mailbox 모듈
앱 사용자가 받은 우편과 보낸 우편을 다루는 모듈입니다. 우편 발송과 회수, 발신·수신 우편 조회, 읽음 처리, 삭제를 제공합니다.
모듈 정보
- 패키지:
@com2usplatform/hiveaxyl - 가져오는 경로:
@com2usplatform/hiveaxyl/mailbox - 기본 연결 서버:
https://app-api.hiveaxyl.com
제공 API
| 클라이언트 속성 | 등록 함수 | 설명 |
|---|---|---|
| axyl.mailbox | mailbox() | 우편 발송과 회수, 발신 우편과 수신 우편 조회, 읽음 처리, 삭제 |
기능의 구성과 우편 발송 주체, 첨부 아이템 처리 방식은 우편함을 참조하세요.
등록과 획득
createAxyl()의 modules에 mailbox()를 등록합니다. 모든 메서드에 로그인 세션이 필요하므로 auth, token과 함께 등록하세요.
import { createAxyl } from '@com2usplatform/hiveaxyl'
import { auth } from '@com2usplatform/hiveaxyl/auth'
import { token } from '@com2usplatform/hiveaxyl/token'
import { mailbox } from '@com2usplatform/hiveaxyl/mailbox'
const created = createAxyl({
appId: '{appId}',
clientId: '{clientId}',
modules: { auth: auth(), token: token(), mailbox: mailbox() },
})
if (created.kind === 'failure') throw new Error(created.error.message)
const axyl = created.client
const r = await axyl.mailbox.getReceivedMails({ searchRequest: { size: 20 } })
설치 절차, 초기화와 로그인 순서는 모듈 설치, 초기화, 로그인을 참조하세요.