Giter Club home page Giter Club logo

ts-mailcow-api's Introduction

TypeScript wrapper for the mailcow API.

Provides typing and a easy to use interface for the Mailcow API.

Usage

Create a new wrapper using the base url and API_KEY.

import MailCowClient from "./index";

// Create MailCowClient based on BASE_URL and API_KEY
const mcc = new MailCowClient("https://demo.mailcow.email/", "390448-22B69F-FA37D9-19701B-6F033F");

Then you can use the created wrapper for promised-based API calls according to the Mailcow API specification.

// Get all the mailboxes available.
mcc.mailbox.get().then((e) => {
    // Print all mailboxes.
    console.log(JSON.stringify(e, null, 4));
}).catch(e => {
    // Error handling.
    console.log(e)
})

API implementation progress

Domains

  • Create domain
  • Delete domain
  • Update domain
  • Get domain

Domain antispam policies

  • Create domain policy
  • Delete domain policy
  • List blacklist/whitelist domain policy

Mailboxes

  • Create mailbox
  • Delete mailbox
  • Update mailbox
  • Update Pushover settings
  • Quarantine Notifications
  • Update mailbox ACL
  • Get mailboxes
  • Edit mailbox spam filter score
  • Get Active User Sieve

Aliases

  • Create alias
  • Delete alias
  • Update alias
  • Get aliases

Sync Jobs

  • Create sync job
  • Delete sync job
  • Update sync job
  • Get sync jobs

Forwarding Hosts

  • Add Forward Host
  • Delete Forward Host
  • Get Forwarding Hosts

Logs

  • Get ACME logs
  • Get Api logs
  • Get Autodiscover logs
  • Get Dovecot logs
  • Get Netfilter logs
  • Get Postfix logs
  • Get Ratelimit logs
  • Get Rspamd logs
  • Get SOGo logs
  • Get Watchdog logs

Queue Manager

  • Delete Queue
  • Flush Queue
  • Get Queue

Quarantine

  • Delete mails in Quarantaine
  • Get mails in Quarantaine

Fail2Ban

  • Edit Fail2Ban
  • Get Fail2Ban Config

DKIM

  • Generate DKIM key
  • Duplicate DKIM key
  • Delete DKIM key
  • Get DKIM key

Domain Admin

  • Create Domain Admin user
  • Edit Domain Admin ACL
  • Edit Domain Admin user
  • Delete Domain Admin
  • Get Domain Admins

Address Rewriting

  • Create BCC Map
  • Create Recipient Map
  • Delete BCC Map
  • Delete Recipient Map
  • Get BCC Map
  • Get Recipient Map

Outgoing TLS Policy Map Overrides

  • Create TLS Policy Map
  • Delete TLS Policy Map
  • Get TLS Policy Map

oAuth Clients

  • Create oAuth client
  • Delete oAuth client
  • Get oAuth Clients

Routing

  • Create Sender-Dependent Transports
  • Create Transport Maps
  • Delete Sender-Dependent Transports
  • Delete Transport Maps
  • Get Sender-Dependent Transports
  • Get Transport Maps

Resources

  • Create Resources
  • Delete Resources
  • Get Resources

App Passwords

  • Create App Passwords
  • Delete App Passwords
  • Get App Passwords

Status

  • Get container status
  • Get solr status
  • Get vmail status

Ratelimits

  • Get mailbox ratelimits
  • Get domain ratelimits
  • Edit domain ratelimits
  • Edit mailbox ratelimits

ts-mailcow-api's People

Contributors

gijsdeman avatar justsamuel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ts-mailcow-api's Issues

Bug: Type error in MailcowException

Hey,
I tried to use your wrapper for my Next JS project and found out that there is a type error in the MailcowExpection class in src/types.ts
It throws an error message when building the project:

./node_modules/ts-mailcow-api/src/types.ts:1369:3
Type error: Property 'message' has no initializer and is not definitely assigned in the constructor.

  1367 |    * The error message provided by Mailcow.
  1368 |    */
> 1369 |   message: string;
       |   ^
  1370 | }
  1371 | 
  1372 | /**
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Also, when I open the file in WebStorm, it marks the line as an error.
Don't know really where the problem is, but it looks like that it has to be changed in the wrapper itself. So, maybe you can give it a look?

Appreciate your work,
Best regards

Hey!

Do you have Discord please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.