1.0.0 • Published 4 years ago

1secapi v1.0.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

OneSecAPI


Installation

Using npm

npm install onesec-api

Using yarn

yarn add onesec-api


Example

import {OneSecMailbox} from '../lib';

const oneSec = new OneSecMailbox('test', 'esiix.com');
oneSec.getMail().then(mailbox => {
	for (let mail of mailbox) {
		console.log(`Found an email from ${mail.getSender()}\n` +
			`Subject: ${mail.getSubject()}\n` +
			`Body: ${mail.getTextBody()}\n` +
			`Attachment Count: ${mail.getAttachments().length}`);
	}
});

Documentation

OneSecMailbox


new OneSecMailbox(username: string, domain: string): OneSecMailbox;

Arguments

  • Username - The username of the email
  • Domain - The email domain (Not including the '@')
    • Valid Domains: 1secmail.com 1secmail.org 1setmail.net wwjmp.com esiix.com

Description


OneSecMailbox~getMail(): Promise<OneSecMessage[]>

Description


OneSecMailbox.getDomains(): string[]

Description

  • Returns list of valid domains

OneSecMessage


OneSecMessage~getID(): number

Description

  • Returns the 1secMAIL ID

OneSecMessage~getSender(): string

Description

  • Returns the mail body

OneSecMessage~getSubject(): string

Description

  • Returns the mail plain text body

OneSecMessage~getDate(): Date

Description

  • Returns the Date mail was received

OneSecMessage~getAttachments(): OneSecMessageAttachment[]

Description

  • Returns a list of attachments

OneSecMessage~getBody(): string

Description

  • Returns the mail body

OneSecMessage~getTextBody(): string

Description

  • Returns the mail plain text body

OneSecMessage~getHtmlBody(): string

Description

  • Returns the mail html body

OneSecMessageAttachment

OneSecMessageAttachment~getFileName(): string

Description

  • Returns the attachment file name

OneSecMessageAttachment~getFileURL(): string

Description

  • Returns the attachment download URL

OneSecMessageAttachment~getFileSize(): number

Description

  • Returns the attachment file size

OneSecMessageAttachment~getContentType(): string

Description

  • Returns the attachment content type
1.0.0

4 years ago