UNPKG

cloudmailin

Version:

Official Node.js for the CloudMailin Email API - https://www.cloudmailin.com

170 lines (169 loc) 6.12 kB
/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/messages": { post: operations["sendMessage"]; }; } export interface components { schemas: { MessageCommon: { id?: string; /** * The from addrress of the email message. * This is the address to be used in the SMTP transaction itself. * Although it will be replaced with an address used for bounce handling. * This must match a `from:` header in the email headers. */ from: string; /** * The To addrress of the email message. * This is the address to be used in the SMTP transaction itself. * This must match a `To:` header in the email headers. */ to: string[] | string; /** * A CC addrress used to copy the email message to a recipient. * This is the address to be used in the SMTP transaction itself. * This must match a `CC:` header in the email headers. * A To: Recipient must also be present to use CC. */ cc?: string[] | string; /** * Whether to send this message in test mode. * This will validate the messge but no actually send it if true. * If the server is in test mode then it will always be in test mode * regardless of this value. */ test_mode?: boolean; /** The subject of the email. This will override any subject set in headers or raw messages. */ subject?: string; /** Tags that help filter the messages within the dashboard */ tags?: string[] | string; }; Message: components["schemas"]["MessageCommon"] & { /** * The plain text part of the email message. * Either the plain text or the html parts are required. */ plain?: string; /** * The HTML part of the email message. * Either the plain text or the html parts are required. */ html?: string; headers?: { [key: string]: string; }; priority?: "standard" | "priority" | "digest"; attachments?: components["schemas"]["MessageAttachment"][]; }; MessageAttachment: { /** The file name of the attachment */ file_name: string; /** * The Base64 encoded representation of the content. * This shouldn't contain newlines within JSON. */ content: string; /** The mime content type of the file such as `image/jpeg` */ content_type: string; /** * An optional content identifier. * This is used to mark the attachment as inline and would allow inline display of the * attachment within the html content. * Within the HTML render an image tag for example with cid: * <img src="cid:logo" alt="Logo" /> */ content_id?: string; }; RawMessage: components["schemas"]["MessageCommon"] & { /** * A full raw email. * This should consist of both headers and a message body. * `To` and `From` headers must be present and match those in the request. * Multiple parts, text and html or other mixed content are * acceptable but the message must be valid and RFC822 compliant. * * Any attachments intended to be sent in the Raw format must also be * encoded and included here. */ raw?: string; }; Error: { status?: number; error?: string; }; UnauthorizedError: { status?: 401; error?: string; }; ForbiddenError: { status?: 403; error?: "Forbidden"; }; NotFoundError: { status?: 404; error?: string; }; UnprocessableEntityError: { status?: 422; /** The description of the failed validation */ error?: string; }; /** Identifier, please be aware that the format may change */ accountID: string; /** Identifier, please be aware that the format may change */ id: string; }; responses: { /** The user is not Authorized */ 401: { content: { "application/json": components["schemas"]["UnauthorizedError"]; }; }; /** The user is not Authorized */ 403: { content: { "application/json": components["schemas"]["ForbiddenError"]; }; }; /** Resource be found or does not belong to this account */ 404: { content: { "application/json": components["schemas"]["NotFoundError"]; }; }; /** Unprocessable Entity, most likely your input does not pass validation */ 422: { content: { "application/json": components["schemas"]["UnprocessableEntityError"]; }; }; }; parameters: { accountID: components["schemas"]["accountID"]; }; } export interface operations { sendMessage: { responses: { /** The message has been accepted */ 202: { content: { "application/json": components["schemas"]["MessageCommon"]; }; }; 401: components["responses"]["401"]; 422: components["responses"]["422"]; }; requestBody: { content: { "application/json": components["schemas"]["Message"] | components["schemas"]["RawMessage"]; }; }; }; }