@marxlnfcs/wildduck-api
Version:
Provides a client to interact with the wildduck api
60 lines (59 loc) • 4.64 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WildduckClient = void 0;
const create_http_client_1 = require("../internals/create-http-client");
const addresses_service_1 = require("./components/addresses/addresses.service");
const application_passwords_service_1 = require("./components/application-passwords/application-passwords.service");
const authentication_service_1 = require("./components/authentication/authentication.service");
const archive_service_1 = require("./components/archive/archive.service");
const auto_replies_service_1 = require("./components/auto-replies/auto-replies.service");
const certs_service_1 = require("./components/certs/certs.service");
const dkim_service_1 = require("./components/dkim/dkim.service");
const domain_access_service_1 = require("./components/domain-access/domain-access.service");
const domain_aliases_service_1 = require("./components/domain-aliases/domain-aliases.service");
const filters_service_1 = require("./components/filters/filters.service");
const mailboxes_service_1 = require("./components/mailboxes/mailboxes.service");
const messages_service_1 = require("./components/messages/messages.service");
const settings_service_1 = require("./components/settings/settings.service");
const storage_service_1 = require("./components/storage/storage.service");
const submission_service_1 = require("./components/submission/submission.service");
const two_factor_auth_service_1 = require("./components/two-factor-auth/two-factor-auth.service");
const users_service_1 = require("./components/users/users.service");
const webhooks_service_1 = require("./components/webhooks/webhooks.service");
const export_service_1 = require("./components/export/export.service");
const audit_service_1 = require("./components/audit/audit.service");
const create_sse_client_1 = require("../internals/create-sse-client");
const create_event_client_1 = require("../internals/create-event-client");
const rxjs_1 = require("rxjs");
class WildduckClient {
constructor(options) {
this.options = options;
this.http = (0, create_http_client_1.createHttpClient)(this.options);
this.sse = (0, create_sse_client_1.createSSEClient)(this.options);
this.events = (0, create_event_client_1.createEventClient)();
this.addresses = new addresses_service_1.WildduckAddressesService(this.http, this.sse, this.events);
this.applicationPasswords = new application_passwords_service_1.WildduckApplicationPasswordsService(this.http, this.sse, this.events);
this.archive = new archive_service_1.WildduckArchiveService(this.http, this.sse, this.events);
this.audit = new audit_service_1.WildduckAuditService(this.http, this.sse, this.events);
this.authentication = new authentication_service_1.WildduckAuthenticationService(this.http, this.sse, this.events);
this.autoReplies = new auto_replies_service_1.WildduckAutoRepliesService(this.http, this.sse, this.events);
this.certs = new certs_service_1.WildduckCertsService(this.http, this.sse, this.events);
this.dkim = new dkim_service_1.WildduckDKIMService(this.http, this.sse, this.events);
this.domainAccess = new domain_access_service_1.WildduckDomainAccessService(this.http, this.sse, this.events);
this.domainAliases = new domain_aliases_service_1.WildduckDomainAliasesService(this.http, this.sse, this.events);
this.filters = new filters_service_1.WildduckFiltersService(this.http, this.sse, this.events);
this.mailboxes = new mailboxes_service_1.WildduckMailboxesService(this.http, this.sse, this.events);
this.messages = new messages_service_1.WildduckMessagesService(this.http, this.sse, this.events);
this.settings = new settings_service_1.WildduckSettingsService(this.http, this.sse, this.events);
this.storage = new storage_service_1.WildduckStorageService(this.http, this.sse, this.events);
this.submission = new submission_service_1.WildduckSubmissionService(this.http, this.sse, this.events);
this.twoFactorAuth = new two_factor_auth_service_1.WildduckTwoFactorAuthService(this.http, this.sse, this.events);
this.users = new users_service_1.WildduckUsersService(this.http, this.sse, this.events);
this.webhooks = new webhooks_service_1.WildduckWebhooksService(this.http, this.sse, this.events);
this.exports = new export_service_1.WildduckExportService(this.http, this.sse, this.events);
}
on(...ids) {
return (0, rxjs_1.merge)(...ids.map(i => this.events.on(i)));
}
}
exports.WildduckClient = WildduckClient;