-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a36471
commit 3dacffc
Showing
1 changed file
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,52 @@ const options: Partial<Options> = { | |
|
||
## OneSecMail | ||
|
||
Soon... | ||
### Create a mailbox | ||
|
||
```ts | ||
const mailbox = await OneSecMail(); | ||
const mailbox = await OneSecMail("[email protected]"); | ||
const mailbox = await OneSecMail(options); | ||
const mailbox = await OneSecMail("[email protected]", options); | ||
``` | ||
|
||
Returns an instance of `OneSecMailbox`. | ||
|
||
### OneSecMailbox.getMessages([options]) | ||
|
||
```ts | ||
const messages = await mailbox.getMessages(); | ||
const messages = await mailbox.getMessages(options); | ||
``` | ||
|
||
Returns an array of `OneSecMailShortMessage` instances. | ||
|
||
### OneSecMailbox.clearMessages([options]) | ||
|
||
```ts | ||
await mailbox.clearMessages(); | ||
await mailbox.clearMessages(options); | ||
``` | ||
|
||
### OneSecMailShortMessage.fetchFullMessage([options]) | ||
|
||
```ts | ||
const fullMessage = await message.fetchFullMessage(); | ||
const fullMessage = await message.fetchFullMessage(options); | ||
``` | ||
|
||
Returns an instance of `OneSecMailMessage` if the message still exists, otherwise throw an error. | ||
|
||
`OneSecMailMessage` has an **attachments** field that contains an array of `OneSecMailAttachment` instances. | ||
|
||
### OneSecMailAttachment.download([options]) | ||
|
||
```ts | ||
const file = await attachment.download(); | ||
const file = await attachment.download(options); | ||
``` | ||
|
||
Returns a Buffer if the file still exists, otherwise throw an error. | ||
|
||
## OneSecMailAPI | ||
|
||
|
@@ -113,7 +158,7 @@ const api = new OneSecMailAPI(options); | |
|
||
### Instance methods | ||
|
||
All methods return a _Promise_. | ||
All methods return a **Promise**. | ||
|
||
#### genRandomMailbox([count[, options]]) | ||
|
||
|