ts-mailcow-api 0.11.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -150
- package/dist/client.d.ts +178 -0
- package/dist/client.js +173 -0
- package/dist/client.js.map +1 -0
- package/dist/endpoints/address-rewriting-endpoint.js +34 -0
- package/dist/endpoints/address-rewriting-endpoint.js.map +1 -0
- package/dist/{Endpoints → endpoints}/alias-endpoints.js +10 -4
- package/dist/endpoints/alias-endpoints.js.map +1 -0
- package/dist/{Endpoints → endpoints}/antispam-endpoints.js +7 -3
- package/dist/endpoints/antispam-endpoints.js.map +1 -0
- package/dist/endpoints/app-password-endpoints.d.ts +29 -0
- package/dist/endpoints/app-password-endpoints.js +27 -0
- package/dist/endpoints/app-password-endpoints.js.map +1 -0
- package/dist/endpoints/dkim-endpoints.d.ts +37 -0
- package/dist/endpoints/dkim-endpoints.js +31 -0
- package/dist/endpoints/dkim-endpoints.js.map +1 -0
- package/dist/endpoints/domain-admin-endpoints.d.ts +42 -0
- package/dist/endpoints/domain-admin-endpoints.js +35 -0
- package/dist/endpoints/domain-admin-endpoints.js.map +1 -0
- package/dist/{Endpoints → endpoints}/domain-endpoints.js +10 -4
- package/dist/endpoints/domain-endpoints.js.map +1 -0
- package/dist/endpoints/fail2ban-endpoints.d.ts +22 -0
- package/dist/endpoints/fail2ban-endpoints.js +23 -0
- package/dist/endpoints/fail2ban-endpoints.js.map +1 -0
- package/dist/{Endpoints → endpoints}/forwarding-endpoints.js +8 -3
- package/dist/endpoints/forwarding-endpoints.js.map +1 -0
- package/dist/endpoints/log-endpoints.js +50 -0
- package/dist/endpoints/log-endpoints.js.map +1 -0
- package/dist/endpoints/mailbox-endpoint.js +52 -0
- package/dist/endpoints/mailbox-endpoint.js.map +1 -0
- package/dist/endpoints/oauth2-endpoints.d.ts +31 -0
- package/dist/endpoints/oauth2-endpoints.js +27 -0
- package/dist/endpoints/oauth2-endpoints.js.map +1 -0
- package/dist/endpoints/quarantine-endpoints.d.ts +24 -0
- package/dist/endpoints/quarantine-endpoints.js +23 -0
- package/dist/endpoints/quarantine-endpoints.js.map +1 -0
- package/dist/endpoints/queue-manager-endpoints.d.ts +27 -0
- package/dist/endpoints/queue-manager-endpoints.js +29 -0
- package/dist/endpoints/queue-manager-endpoints.js.map +1 -0
- package/dist/endpoints/ratelimit-endpoints.d.ts +35 -0
- package/dist/endpoints/ratelimit-endpoints.js +32 -0
- package/dist/endpoints/ratelimit-endpoints.js.map +1 -0
- package/dist/endpoints/resource-endpoints.d.ts +19 -0
- package/dist/endpoints/resource-endpoints.js +22 -0
- package/dist/endpoints/resource-endpoints.js.map +1 -0
- package/dist/endpoints/routing-endpoints.d.ts +49 -0
- package/dist/endpoints/routing-endpoints.js +39 -0
- package/dist/endpoints/routing-endpoints.js.map +1 -0
- package/dist/endpoints/status-endpoints.d.ts +17 -0
- package/dist/endpoints/status-endpoints.js +22 -0
- package/dist/endpoints/status-endpoints.js.map +1 -0
- package/dist/endpoints/syncjob-endpoints.js +26 -0
- package/dist/endpoints/syncjob-endpoints.js.map +1 -0
- package/dist/endpoints/tls-policy-map-endpoints.d.ts +32 -0
- package/dist/endpoints/tls-policy-map-endpoints.js +27 -0
- package/dist/endpoints/tls-policy-map-endpoints.js.map +1 -0
- package/dist/index.d.ts +2 -92
- package/dist/index.js +2 -87
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +851 -0
- package/package.json +5 -5
- package/dist/Endpoints/address-rewriting-endpoint.js +0 -26
- package/dist/Endpoints/address-rewriting-endpoint.js.map +0 -1
- package/dist/Endpoints/alias-endpoints.js.map +0 -1
- package/dist/Endpoints/antispam-endpoints.js.map +0 -1
- package/dist/Endpoints/domain-endpoints.js.map +0 -1
- package/dist/Endpoints/forwarding-endpoints.js.map +0 -1
- package/dist/Endpoints/log-endpoints.js +0 -38
- package/dist/Endpoints/log-endpoints.js.map +0 -1
- package/dist/Endpoints/mailbox-endpoint.js +0 -41
- package/dist/Endpoints/mailbox-endpoint.js.map +0 -1
- package/dist/Endpoints/syncjob-endpoints.js +0 -20
- package/dist/Endpoints/syncjob-endpoints.js.map +0 -1
- package/index.js +0 -2
- package/src/Endpoints/address-rewriting-endpoint.ts +0 -74
- package/src/Endpoints/alias-endpoints.ts +0 -54
- package/src/Endpoints/antispam-endpoints.ts +0 -50
- package/src/Endpoints/domain-endpoints.ts +0 -54
- package/src/Endpoints/forwarding-endpoints.ts +0 -43
- package/src/Endpoints/log-endpoints.ts +0 -99
- package/src/Endpoints/mailbox-endpoint.ts +0 -123
- package/src/Endpoints/syncjob-endpoints.ts +0 -44
- package/src/index.ts +0 -120
- package/src/request-factory.ts +0 -78
- package/src/types.ts +0 -1489
- /package/dist/{Endpoints → endpoints}/address-rewriting-endpoint.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/alias-endpoints.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/antispam-endpoints.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/domain-endpoints.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/forwarding-endpoints.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/log-endpoints.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/mailbox-endpoint.d.ts +0 -0
- /package/dist/{Endpoints → endpoints}/syncjob-endpoints.d.ts +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appPasswordEndpoints = appPasswordEndpoints;
|
|
4
|
+
const APP_PASSWORD_ENDPOINTS = {
|
|
5
|
+
ADD: 'add/app-passwd',
|
|
6
|
+
DELETE: 'delete/app-passwd',
|
|
7
|
+
GET: 'get/app-passwd/all/',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Binder function between the MailcowClient class and the AppPasswordEndpoints.
|
|
11
|
+
* @param bind - The MailcowClient instance to bind.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
function appPasswordEndpoints(bind) {
|
|
15
|
+
return {
|
|
16
|
+
add(payload) {
|
|
17
|
+
return bind.requestFactory.post(APP_PASSWORD_ENDPOINTS.ADD, payload);
|
|
18
|
+
},
|
|
19
|
+
delete(payload) {
|
|
20
|
+
return bind.requestFactory.post(APP_PASSWORD_ENDPOINTS.DELETE, payload);
|
|
21
|
+
},
|
|
22
|
+
get(mailbox) {
|
|
23
|
+
return bind.requestFactory.get(`${APP_PASSWORD_ENDPOINTS.GET}${mailbox}`);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=app-password-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-password-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/app-password-endpoints.ts"],"names":[],"mappings":";;AAsCA,oDAeC;AA1BD,MAAM,sBAAsB,GAAG;IAC7B,GAAG,EAAE,gBAAgB;IACrB,MAAM,EAAE,mBAAmB;IAC3B,GAAG,EAAE,qBAAqB;CAC3B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,IAAmB;IACtD,OAAO;QACL,GAAG,CAAC,OAA8B;YAChC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAyC,sBAAsB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC/G,CAAC;QACD,MAAM,CAAC,OAAiC;YACtC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,sBAAsB,CAAC,MAAM,EAC7B,OAAO,CACR,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,OAAe;YACjB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAgB,GAAG,sBAAsB,CAAC,GAAG,GAAG,OAAO,EAAE,CAAC,CAAC;QAC3F,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CreateDkimRequest, DeleteDkimRequest, DkimEntry, DuplicateDkimRequest, MailcowResponse } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all DKIM endpoints related to Mailcow.
|
|
5
|
+
*/
|
|
6
|
+
export interface DkimEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Generates new DKIM keys for specified domains.
|
|
9
|
+
* @param payload - Object containing details for the DKIM key generation.
|
|
10
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
11
|
+
*/
|
|
12
|
+
create(payload: CreateDkimRequest): Promise<MailcowResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Duplicates a DKIM key from one domain to another.
|
|
15
|
+
* @param payload - Object containing source and destination domains for the DKIM key.
|
|
16
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
17
|
+
*/
|
|
18
|
+
duplicate(payload: DuplicateDkimRequest): Promise<MailcowResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Deletes DKIM keys for specified domains.
|
|
21
|
+
* @param payload - Object containing a list of domains to delete DKIM keys for.
|
|
22
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
23
|
+
*/
|
|
24
|
+
delete(payload: DeleteDkimRequest): Promise<MailcowResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the DKIM public key for a specific domain.
|
|
27
|
+
* @param domain - The domain to retrieve the DKIM key for.
|
|
28
|
+
* @returns A promise that resolves to a `DkimEntry` object.
|
|
29
|
+
*/
|
|
30
|
+
get(domain: string): Promise<DkimEntry>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Binder function between the MailcowClient class and the DkimEndpoints.
|
|
34
|
+
* @param bind - The MailcowClient instance to bind.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare function dkimEndpoints(bind: MailcowClient): DkimEndpoints;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dkimEndpoints = dkimEndpoints;
|
|
4
|
+
const DKIM_ENDPOINTS = {
|
|
5
|
+
CREATE: 'add/dkim',
|
|
6
|
+
DUPLICATE: 'add/dkim_duplicate',
|
|
7
|
+
DELETE: 'delete/dkim',
|
|
8
|
+
GET: 'get/dkim/',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Binder function between the MailcowClient class and the DkimEndpoints.
|
|
12
|
+
* @param bind - The MailcowClient instance to bind.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
function dkimEndpoints(bind) {
|
|
16
|
+
return {
|
|
17
|
+
create(payload) {
|
|
18
|
+
return bind.requestFactory.post(DKIM_ENDPOINTS.CREATE, payload);
|
|
19
|
+
},
|
|
20
|
+
duplicate(payload) {
|
|
21
|
+
return bind.requestFactory.post(DKIM_ENDPOINTS.DUPLICATE, payload);
|
|
22
|
+
},
|
|
23
|
+
delete(payload) {
|
|
24
|
+
return bind.requestFactory.post(DKIM_ENDPOINTS.DELETE, payload.items);
|
|
25
|
+
},
|
|
26
|
+
get(domain) {
|
|
27
|
+
return bind.requestFactory.get(`${DKIM_ENDPOINTS.GET}${domain}`);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=dkim-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dkim-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/dkim-endpoints.ts"],"names":[],"mappings":";;AAgDA,sCAeC;AA3BD,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,oBAAoB;IAC/B,MAAM,EAAE,aAAa;IACrB,GAAG,EAAE,WAAW;CACjB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAmB;IAC/C,OAAO;QACL,MAAM,CAAC,OAA0B;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAqC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACtG,CAAC;QACD,SAAS,CAAC,OAA6B;YACrC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAwC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5G,CAAC;QACD,MAAM,CAAC,OAA0B;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACnG,CAAC;QACD,GAAG,CAAC,MAAc;YAChB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAY,GAAG,cAAc,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC,CAAC;QAC9E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CreateDomainAdminRequest, DeleteDomainAdminRequest, DomainAdmin, EditDomainAdminRequest, IssueDomainAdminSsoTokenRequest, MailcowResponse } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all Domain Admin endpoints related to Mailcow.
|
|
5
|
+
*/
|
|
6
|
+
export interface DomainAdminEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new Domain Admin user.
|
|
9
|
+
* @param payload - Object containing details to create a new Domain Admin.
|
|
10
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
11
|
+
*/
|
|
12
|
+
create(payload: CreateDomainAdminRequest): Promise<MailcowResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Issues a Single Sign-On token for a Domain Admin user.
|
|
15
|
+
* @param payload - Object containing the username for which to issue the SSO token.
|
|
16
|
+
* @returns A promise that resolves to a response containing the issued SSO token.
|
|
17
|
+
*/
|
|
18
|
+
issueSsoToken(payload: IssueDomainAdminSsoTokenRequest): Promise<MailcowResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Edits an existing Domain Admin user.
|
|
21
|
+
* @param payload - Object containing the username and attributes to edit.
|
|
22
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
23
|
+
*/
|
|
24
|
+
edit(payload: EditDomainAdminRequest): Promise<MailcowResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Deletes specified Domain Admin users.
|
|
27
|
+
* @param payload - Object containing list of usernames to delete.
|
|
28
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
29
|
+
*/
|
|
30
|
+
delete(payload: DeleteDomainAdminRequest): Promise<MailcowResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves all Domain Admin users.
|
|
33
|
+
* @returns A promise that resolves to an array of `DomainAdmin` objects.
|
|
34
|
+
*/
|
|
35
|
+
get(id: 'all'): Promise<DomainAdmin[]>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Binder function between the MailcowClient class and the DomainAdminEndpoints.
|
|
39
|
+
* @param bind - The MailcowClient instance to bind.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare function domainAdminEndpoints(bind: MailcowClient): DomainAdminEndpoints;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.domainAdminEndpoints = domainAdminEndpoints;
|
|
4
|
+
const DOMAIN_ADMIN_ENDPOINTS = {
|
|
5
|
+
CREATE: 'add/domain-admin',
|
|
6
|
+
ISSUE_SSO_TOKEN: 'add/sso/domain-admin',
|
|
7
|
+
EDIT: 'edit/domain-admin',
|
|
8
|
+
DELETE: 'delete/domain-admin',
|
|
9
|
+
GET_ALL: 'get/domain-admin/all',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Binder function between the MailcowClient class and the DomainAdminEndpoints.
|
|
13
|
+
* @param bind - The MailcowClient instance to bind.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
function domainAdminEndpoints(bind) {
|
|
17
|
+
return {
|
|
18
|
+
create(payload) {
|
|
19
|
+
return bind.requestFactory.post(DOMAIN_ADMIN_ENDPOINTS.CREATE, payload);
|
|
20
|
+
},
|
|
21
|
+
issueSsoToken(payload) {
|
|
22
|
+
return bind.requestFactory.post(DOMAIN_ADMIN_ENDPOINTS.ISSUE_SSO_TOKEN, payload);
|
|
23
|
+
},
|
|
24
|
+
edit(payload) {
|
|
25
|
+
return bind.requestFactory.post(DOMAIN_ADMIN_ENDPOINTS.EDIT, payload);
|
|
26
|
+
},
|
|
27
|
+
delete(payload) {
|
|
28
|
+
return bind.requestFactory.post(DOMAIN_ADMIN_ENDPOINTS.DELETE, payload.items);
|
|
29
|
+
},
|
|
30
|
+
get() {
|
|
31
|
+
return bind.requestFactory.get(DOMAIN_ADMIN_ENDPOINTS.GET_ALL);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=domain-admin-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-admin-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/domain-admin-endpoints.ts"],"names":[],"mappings":";;AA8DA,oDAwBC;AArCD,MAAM,sBAAsB,GAAG;IAC7B,MAAM,EAAE,kBAAkB;IAC1B,eAAe,EAAE,sBAAsB;IACvC,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,qBAAqB;IAC7B,OAAO,EAAE,sBAAsB;CAChC,CAAC;AAEF;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,IAAmB;IACtD,OAAO;QACL,MAAM,CAAC,OAAiC;YACtC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,sBAAsB,CAAC,MAAM,EAC7B,OAAO,CACR,CAAC;QACJ,CAAC;QACD,aAAa,CAAC,OAAwC;YACpD,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,sBAAsB,CAAC,eAAe,EACtC,OAAO,CACR,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAA+B;YAClC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA0C,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjH,CAAC;QACD,MAAM,CAAC,OAAiC;YACtC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3G,CAAC;QACD,GAAG;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAgB,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAChF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.domainEndpoints = domainEndpoints;
|
|
4
4
|
const request_factory_1 = require("../request-factory");
|
|
5
|
+
const DOMAIN_ENDPOINTS = {
|
|
6
|
+
GET: 'get/domain',
|
|
7
|
+
ADD: 'add/domain',
|
|
8
|
+
DELETE: 'delete/domain',
|
|
9
|
+
EDIT: 'edit/domain',
|
|
10
|
+
};
|
|
5
11
|
/**
|
|
6
12
|
* Binder function between the MailcowClient class and the DomainEndpoints.
|
|
7
13
|
* @param bind - The MailcowClient to bind.
|
|
@@ -10,16 +16,16 @@ const request_factory_1 = require("../request-factory");
|
|
|
10
16
|
function domainEndpoints(bind) {
|
|
11
17
|
return {
|
|
12
18
|
get(domain = 'all') {
|
|
13
|
-
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(
|
|
19
|
+
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(DOMAIN_ENDPOINTS.GET + `/${domain}`));
|
|
14
20
|
},
|
|
15
21
|
create(payload) {
|
|
16
|
-
return bind.requestFactory.post(
|
|
22
|
+
return bind.requestFactory.post(DOMAIN_ENDPOINTS.ADD, payload);
|
|
17
23
|
},
|
|
18
24
|
delete(payload) {
|
|
19
|
-
return bind.requestFactory.post(
|
|
25
|
+
return bind.requestFactory.post(DOMAIN_ENDPOINTS.DELETE, payload.domains);
|
|
20
26
|
},
|
|
21
27
|
edit(payload) {
|
|
22
|
-
return bind.requestFactory.post(
|
|
28
|
+
return bind.requestFactory.post(DOMAIN_ENDPOINTS.EDIT, payload);
|
|
23
29
|
},
|
|
24
30
|
};
|
|
25
31
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/domain-endpoints.ts"],"names":[],"mappings":";;AA6CA,0CAiBC;AA5DD,wDAAwD;AA+BxD,MAAM,gBAAgB,GAAG;IACvB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,YAAY;IACjB,MAAM,EAAE,eAAe;IACvB,IAAI,EAAE,aAAa;CACpB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,eAAe,CAAC,IAAmB;IACjD,OAAO;QACL,GAAG,CAAC,SAAiB,KAAK;YACxB,OAAO,IAAA,oCAAkB,EACvB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAoB,gBAAgB,CAAC,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC,CAChF,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,OAA0B;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAqC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACrG,CAAC;QACD,MAAM,CAAC,OAA4B;YACjC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACvG,CAAC;QACD,IAAI,CAAC,OAA0B;YAC7B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAqC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MailcowResponse, Fail2BanEditRequest, Fail2BanResponse } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all Fail2Ban endpoints.
|
|
5
|
+
*/
|
|
6
|
+
export interface Fail2BanEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Endpoint for editing Fail2Ban settings.
|
|
9
|
+
* @param payload - The edit payload.
|
|
10
|
+
*/
|
|
11
|
+
edit(payload: Fail2BanEditRequest): Promise<MailcowResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Endpoint for getting Fail2Ban settings.
|
|
14
|
+
*/
|
|
15
|
+
get(): Promise<Fail2BanResponse>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Binder function between the MailcowClient class and the Fail2BanEndpoints.
|
|
19
|
+
* @param bind - The MailcowClient to bind.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function fail2BanEndpoints(bind: MailcowClient): Fail2BanEndpoints;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fail2BanEndpoints = fail2BanEndpoints;
|
|
4
|
+
const FAIL2BAN_ENDPOINTS = {
|
|
5
|
+
EDIT: 'edit/fail2ban',
|
|
6
|
+
GET: 'get/fail2ban',
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Binder function between the MailcowClient class and the Fail2BanEndpoints.
|
|
10
|
+
* @param bind - The MailcowClient to bind.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
function fail2BanEndpoints(bind) {
|
|
14
|
+
return {
|
|
15
|
+
edit(payload) {
|
|
16
|
+
return bind.requestFactory.post(FAIL2BAN_ENDPOINTS.EDIT, payload);
|
|
17
|
+
},
|
|
18
|
+
get() {
|
|
19
|
+
return bind.requestFactory.get(FAIL2BAN_ENDPOINTS.GET);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=fail2ban-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fail2ban-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/fail2ban-endpoints.ts"],"names":[],"mappings":";;AA6BA,8CASC;AAnBD,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,cAAc;CACpB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,IAAmB;IACnD,OAAO;QACL,IAAI,CAAC,OAA4B;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAuC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1G,CAAC;QACD,GAAG;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAmB,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.forwardingEndpoints = forwardingEndpoints;
|
|
4
|
+
const FORWARDING_ENDPOINTS = {
|
|
5
|
+
DELETE: 'delete/fwdhost',
|
|
6
|
+
CREATE: 'add/fwdhost',
|
|
7
|
+
GET_ALL: 'get/fwdhost/all',
|
|
8
|
+
};
|
|
4
9
|
/**
|
|
5
10
|
* Binder function between the MailcowClient class and the ForwardingEndpoints.
|
|
6
11
|
* @param bind - The MailcowClient to bind.
|
|
@@ -9,13 +14,13 @@ exports.forwardingEndpoints = forwardingEndpoints;
|
|
|
9
14
|
function forwardingEndpoints(bind) {
|
|
10
15
|
return {
|
|
11
16
|
delete(payload) {
|
|
12
|
-
return bind.requestFactory.post(
|
|
17
|
+
return bind.requestFactory.post(FORWARDING_ENDPOINTS.DELETE, payload.items);
|
|
13
18
|
},
|
|
14
19
|
create(payload) {
|
|
15
|
-
return bind.requestFactory.post(
|
|
20
|
+
return bind.requestFactory.post(FORWARDING_ENDPOINTS.CREATE, payload);
|
|
16
21
|
},
|
|
17
22
|
getAll() {
|
|
18
|
-
return bind.requestFactory.get(
|
|
23
|
+
return bind.requestFactory.get(FORWARDING_ENDPOINTS.GET_ALL);
|
|
19
24
|
},
|
|
20
25
|
};
|
|
21
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwarding-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/forwarding-endpoints.ts"],"names":[],"mappings":";;AAoCA,kDAYC;AAvBD,MAAM,oBAAoB,GAAG;IAC3B,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,IAAmB;IACrD,OAAO;QACL,MAAM,CAAC,OAAgC;YACrC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACzG,CAAC;QACD,MAAM,CAAC,OAAgC;YACrC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA2C,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClH,CAAC;QACD,MAAM;YACJ,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAmB,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACjF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logEndpoints = logEndpoints;
|
|
4
|
+
const LOG_ENDPOINTS = {
|
|
5
|
+
ACME: 'get/logs/acme',
|
|
6
|
+
API: 'get/logs/api',
|
|
7
|
+
AUTODISCOVER: 'get/logs/autodiscover',
|
|
8
|
+
DOVECOT: 'get/logs/dovecot',
|
|
9
|
+
NETFILTER: 'get/logs/netfilter',
|
|
10
|
+
POSTFIX: 'get/logs/postfix',
|
|
11
|
+
RATELIMITED: 'get/logs/ratelimited',
|
|
12
|
+
RSPAMD: 'get/logs/rspamd-history',
|
|
13
|
+
SOGO: 'get/logs/sogo',
|
|
14
|
+
WATCHDOG: 'get/logs/watchdog',
|
|
15
|
+
};
|
|
16
|
+
function logEndpoints(bind) {
|
|
17
|
+
return {
|
|
18
|
+
acme(count) {
|
|
19
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.ACME + `/${count}`);
|
|
20
|
+
},
|
|
21
|
+
api(count) {
|
|
22
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.API + `/${count}`);
|
|
23
|
+
},
|
|
24
|
+
autodiscover(count) {
|
|
25
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.AUTODISCOVER + `/${count}`);
|
|
26
|
+
},
|
|
27
|
+
dovecot(count) {
|
|
28
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.DOVECOT + `/${count}`);
|
|
29
|
+
},
|
|
30
|
+
netfilter(count) {
|
|
31
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.NETFILTER + `/${count}`);
|
|
32
|
+
},
|
|
33
|
+
postfix(count) {
|
|
34
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.POSTFIX + `/${count}`);
|
|
35
|
+
},
|
|
36
|
+
ratelimited(count) {
|
|
37
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.RATELIMITED + `/${count}`);
|
|
38
|
+
},
|
|
39
|
+
rspamd(count) {
|
|
40
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.RSPAMD + `/${count}`);
|
|
41
|
+
},
|
|
42
|
+
sogo(count) {
|
|
43
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.SOGO + `/${count}`);
|
|
44
|
+
},
|
|
45
|
+
watchdog(count) {
|
|
46
|
+
return bind.requestFactory.get(LOG_ENDPOINTS.WATCHDOG + `/${count}`);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=log-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/log-endpoints.ts"],"names":[],"mappings":";;AA8EA,oCAiCC;AA9CD,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,cAAc;IACnB,YAAY,EAAE,uBAAuB;IACrC,OAAO,EAAE,kBAAkB;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EAAE,sBAAsB;IACnC,MAAM,EAAE,yBAAyB;IACjC,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,mBAAmB;CAC9B,CAAC;AAEF,SAAgB,YAAY,CAAC,IAAmB;IAC9C,OAAO;QACL,IAAI,CAAC,KAAa;YAChB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAY,aAAa,CAAC,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,GAAG,CAAC,KAAa;YACf,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAW,aAAa,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,YAAY,CAAC,KAAa;YACxB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,CAAC,KAAa;YACnB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,OAAO,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,SAAS,CAAC,KAAa;YACrB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,CAAC,KAAa;YACnB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,OAAO,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,WAAW,CAAC,KAAa;YACvB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,WAAW,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,CAAC,KAAa;YAClB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,KAAa;YAChB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,QAAQ,CAAC,KAAa;YACpB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAU,aAAa,CAAC,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAChF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mailboxEndpoints = mailboxEndpoints;
|
|
4
|
+
const request_factory_1 = require("../request-factory");
|
|
5
|
+
const MAILBOX_ENDPOINTS = {
|
|
6
|
+
CREATE: 'add/mailbox',
|
|
7
|
+
DELETE: 'delete/mailbox',
|
|
8
|
+
EDIT: 'edit/mailbox',
|
|
9
|
+
GET: 'get/mailbox',
|
|
10
|
+
EDIT_PUSHOVER: 'edit/pushover',
|
|
11
|
+
EDIT_QUARANTAINE: 'edit/quarantine_notification',
|
|
12
|
+
EDIT_SPAM_SCORE: 'edit/spam-score',
|
|
13
|
+
EDIT_USER_ACL: 'edit/user-acl',
|
|
14
|
+
GET_ACTIVE_USER_SIEVE: 'get/active-user-sieve',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Binder function between the MailcowClient class and the MailboxEndpoints
|
|
18
|
+
* @param bind - The MailcowClient to bind.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
function mailboxEndpoints(bind) {
|
|
22
|
+
return {
|
|
23
|
+
create(payload) {
|
|
24
|
+
return bind.requestFactory.post(MAILBOX_ENDPOINTS.CREATE, payload);
|
|
25
|
+
},
|
|
26
|
+
delete(payload) {
|
|
27
|
+
return bind.requestFactory.post(MAILBOX_ENDPOINTS.DELETE, payload.mailboxes);
|
|
28
|
+
},
|
|
29
|
+
edit(payload) {
|
|
30
|
+
return bind.requestFactory.post(MAILBOX_ENDPOINTS.EDIT, payload);
|
|
31
|
+
},
|
|
32
|
+
get(mailbox = 'all') {
|
|
33
|
+
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(MAILBOX_ENDPOINTS.GET + `/${mailbox}`));
|
|
34
|
+
},
|
|
35
|
+
editPushover(payload) {
|
|
36
|
+
return bind.requestFactory.post(MAILBOX_ENDPOINTS.EDIT_PUSHOVER, payload);
|
|
37
|
+
},
|
|
38
|
+
editQuarantine(payload) {
|
|
39
|
+
return bind.requestFactory.post('edit/quarantine_notification', payload);
|
|
40
|
+
},
|
|
41
|
+
editSpamScore(payload) {
|
|
42
|
+
return bind.requestFactory.post(MAILBOX_ENDPOINTS.EDIT_SPAM_SCORE, payload);
|
|
43
|
+
},
|
|
44
|
+
editUserACL(payload) {
|
|
45
|
+
return bind.requestFactory.post(MAILBOX_ENDPOINTS.EDIT_USER_ACL, payload);
|
|
46
|
+
},
|
|
47
|
+
getActiveUserSieve(mailbox) {
|
|
48
|
+
return bind.requestFactory.get(MAILBOX_ENDPOINTS.GET_ACTIVE_USER_SIEVE + `/${mailbox}`);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=mailbox-endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox-endpoint.js","sourceRoot":"","sources":["../../src/endpoints/mailbox-endpoint.ts"],"names":[],"mappings":";;AA2FA,4CA2CC;AA1HD,wDAAwD;AA8DxD,MAAM,iBAAiB,GAAG;IACxB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,gBAAgB;IACxB,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,aAAa;IAClB,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,8BAA8B;IAChD,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,qBAAqB,EAAE,uBAAuB;CAC/C,CAAC;AAEF;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAmB;IAClD,OAAO;QACL,MAAM,CAAC,OAA2B;YAChC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAsC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1G,CAAC;QAED,MAAM,CAAC,OAA6B;YAClC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1G,CAAC;QAED,IAAI,CAAC,OAA2B;YAC9B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAsC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxG,CAAC;QAED,GAAG,CAAC,UAAkB,KAAK;YACzB,OAAO,IAAA,oCAAkB,EACvB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAsB,iBAAiB,CAAC,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC,CACpF,CAAC;QACJ,CAAC;QAED,YAAY,CAAC,OAA4B;YACvC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAuC,iBAAiB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAClH,CAAC;QAED,cAAc,CAAC,OAA+B;YAC5C,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA0C,8BAA8B,EAAE,OAAO,CAAC,CAAC;QACpH,CAAC;QAED,aAAa,CAAC,OAA6B;YACzC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,iBAAiB,CAAC,eAAe,EACjC,OAAO,CACR,CAAC;QACJ,CAAC;QAED,WAAW,CAAC,OAAuB;YACjC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAkC,iBAAiB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC7G,CAAC;QAED,kBAAkB,CAAC,OAAe;YAChC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAW,iBAAiB,CAAC,qBAAqB,GAAG,IAAI,OAAO,EAAE,CAAC,CAAC;QACpG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AddOAuthClientRequest, DeleteOAuthClientRequest, GetOAuthClientRequest, MailcowResponse, OAuthClient } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all OAuth2 Client endpoints related to email handling in Mailcow.
|
|
5
|
+
*/
|
|
6
|
+
export interface OAuth2Endpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Adds a new OAuth client.
|
|
9
|
+
* @param payload - Object containing the redirect URI for the OAuth client.
|
|
10
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
11
|
+
*/
|
|
12
|
+
add(payload: AddOAuthClientRequest): Promise<MailcowResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Deletes specified OAuth clients.
|
|
15
|
+
* @param payload - Object containing a list of OAuth client IDs to delete.
|
|
16
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
17
|
+
*/
|
|
18
|
+
delete(payload: DeleteOAuthClientRequest): Promise<MailcowResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves an OAuth client by ID or all clients.
|
|
21
|
+
* @param payload - Object containing the OAuth client ID or 'all' to retrieve all clients.
|
|
22
|
+
* @returns A promise that resolves to an array of `OAuthClient` objects.
|
|
23
|
+
*/
|
|
24
|
+
get(payload: GetOAuthClientRequest): Promise<OAuthClient[]>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Binder function between the MailcowClient class and the OAuth2Endpoints.
|
|
28
|
+
* @param bind - The MailcowClient instance to bind.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function oauth2Endpoints(bind: MailcowClient): OAuth2Endpoints;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.oauth2Endpoints = oauth2Endpoints;
|
|
4
|
+
const OAUTH2_ENDPOINTS = {
|
|
5
|
+
ADD: 'add/oauth2-client',
|
|
6
|
+
DELETE: 'delete/oauth2-client',
|
|
7
|
+
GET: 'get/oauth2-client/',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Binder function between the MailcowClient class and the OAuth2Endpoints.
|
|
11
|
+
* @param bind - The MailcowClient instance to bind.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
function oauth2Endpoints(bind) {
|
|
15
|
+
return {
|
|
16
|
+
add(payload) {
|
|
17
|
+
return bind.requestFactory.post(OAUTH2_ENDPOINTS.ADD, payload);
|
|
18
|
+
},
|
|
19
|
+
delete(payload) {
|
|
20
|
+
return bind.requestFactory.post(OAUTH2_ENDPOINTS.DELETE, payload.items);
|
|
21
|
+
},
|
|
22
|
+
get(payload) {
|
|
23
|
+
return bind.requestFactory.get(`${OAUTH2_ENDPOINTS.GET}${payload.id}`);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=oauth2-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/oauth2-endpoints.ts"],"names":[],"mappings":";;AA8CA,0CAYC;AAvBD,MAAM,gBAAgB,GAAG;IACvB,GAAG,EAAE,mBAAmB;IACxB,MAAM,EAAE,sBAAsB;IAC9B,GAAG,EAAE,oBAAoB;CAC1B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,eAAe,CAAC,IAAmB;IACjD,OAAO;QACL,GAAG,CAAC,OAA8B;YAChC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAyC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACzG,CAAC;QACD,MAAM,CAAC,OAAiC;YACtC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACrG,CAAC;QACD,GAAG,CAAC,OAA8B;YAChC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAgB,GAAG,gBAAgB,CAAC,GAAG,GAAG,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACxF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DeleteQuarantineRequest, MailcowResponse, QuarantineItem } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all Quarantine endpoints related to email handling in Mailcow.
|
|
5
|
+
*/
|
|
6
|
+
export interface QuarantineEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Deletes emails from the quarantine.
|
|
9
|
+
* @param payload - An array of email IDs to delete from quarantine.
|
|
10
|
+
* @returns A promise that resolves to the Mailcow API response indicating success or failure.
|
|
11
|
+
*/
|
|
12
|
+
delete(payload: DeleteQuarantineRequest): Promise<MailcowResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves all emails currently held in quarantine.
|
|
15
|
+
* @returns A promise that resolves to an array of `QuarantineItem` representing each quarantined email.
|
|
16
|
+
*/
|
|
17
|
+
get(): Promise<QuarantineItem[]>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Binder function between the MailcowClient class and the QuarantineEndpoints.
|
|
21
|
+
* @param bind - The MailcowClient instance to bind.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare function quarantineEndpoints(bind: MailcowClient): QuarantineEndpoints;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.quarantineEndpoints = quarantineEndpoints;
|
|
4
|
+
const QUARANTINE_ENDPOINTS = {
|
|
5
|
+
DELETE: 'delete/qitem',
|
|
6
|
+
GET: 'get/quarantine/all',
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Binder function between the MailcowClient class and the QuarantineEndpoints.
|
|
10
|
+
* @param bind - The MailcowClient instance to bind.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
function quarantineEndpoints(bind) {
|
|
14
|
+
return {
|
|
15
|
+
delete(payload) {
|
|
16
|
+
return bind.requestFactory.post(QUARANTINE_ENDPOINTS.DELETE, payload.items);
|
|
17
|
+
},
|
|
18
|
+
get() {
|
|
19
|
+
return bind.requestFactory.get(QUARANTINE_ENDPOINTS.GET);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=quarantine-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quarantine-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/quarantine-endpoints.ts"],"names":[],"mappings":";;AA+BA,kDASC;AAnBD,MAAM,oBAAoB,GAAG;IAC3B,MAAM,EAAE,cAAc;IACtB,GAAG,EAAE,oBAAoB;CAC1B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,IAAmB;IACrD,OAAO;QACL,MAAM,CAAC,OAAgC;YACrC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACzG,CAAC;QACD,GAAG;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAmB,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MailcowResponse, QueueItem } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all Queue Manager endpoints.
|
|
5
|
+
*/
|
|
6
|
+
export interface QueueManagerEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Endpoint for deleting the mail queue.
|
|
9
|
+
* @param action - The action to perform, should be "super_delete" to delete the mail queue.
|
|
10
|
+
*/
|
|
11
|
+
delete(action: 'super_delete'): Promise<MailcowResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Endpoint for getting the current mail queue.
|
|
14
|
+
*/
|
|
15
|
+
get(): Promise<QueueItem[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Endpoint for flushing the mail queue.
|
|
18
|
+
* @param action - The action to perform, should be "flush" to flush the mail queue.
|
|
19
|
+
*/
|
|
20
|
+
flush(action: 'flush'): Promise<MailcowResponse>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Binder function between the MailcowClient class and the QueueManagerEndpoints.
|
|
24
|
+
* @param bind - The MailcowClient to bind.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare function queueManagerEndpoints(bind: MailcowClient): QueueManagerEndpoints;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.queueManagerEndpoints = queueManagerEndpoints;
|
|
4
|
+
const QUEUE_MANAGER_ENDPOINTS = {
|
|
5
|
+
DELETE: 'delete/mailq',
|
|
6
|
+
GET: 'get/mailq/all',
|
|
7
|
+
FLUSH: 'edit/mailq',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Binder function between the MailcowClient class and the QueueManagerEndpoints.
|
|
11
|
+
* @param bind - The MailcowClient to bind.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
function queueManagerEndpoints(bind) {
|
|
15
|
+
return {
|
|
16
|
+
delete(action) {
|
|
17
|
+
return bind.requestFactory.post(QUEUE_MANAGER_ENDPOINTS.DELETE, {
|
|
18
|
+
action,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
get() {
|
|
22
|
+
return bind.requestFactory.get(QUEUE_MANAGER_ENDPOINTS.GET);
|
|
23
|
+
},
|
|
24
|
+
flush(action) {
|
|
25
|
+
return bind.requestFactory.post(QUEUE_MANAGER_ENDPOINTS.FLUSH, { action });
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=queue-manager-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-manager-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/queue-manager-endpoints.ts"],"names":[],"mappings":";;AAoCA,sDAcC;AAzBD,MAAM,uBAAuB,GAAG;IAC9B,MAAM,EAAE,cAAc;IACtB,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,IAAmB;IACvD,OAAO;QACL,MAAM,CAAC,MAAsB;YAC3B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA8C,uBAAuB,CAAC,MAAM,EAAE;gBAC3G,MAAM;aACP,CAAC,CAAC;QACL,CAAC;QACD,GAAG;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAc,uBAAuB,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC;QACD,KAAK,CAAC,MAAe;YACnB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAuC,uBAAuB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACnH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DomainRatelimit, EditDomainRequest, EditMailboxRequest, MailboxRatelimit, MailcowResponse } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all Rate Limit endpoints related to email handling in Mailcow.
|
|
5
|
+
*/
|
|
6
|
+
export interface RatelimitsEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Edits the rate limits for specified domains.
|
|
9
|
+
* @param payload - Object containing rate limit attributes and list of domain names.
|
|
10
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
11
|
+
*/
|
|
12
|
+
editDomain(payload: EditDomainRequest): Promise<MailcowResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Edits the rate limits for specified mailboxes.
|
|
15
|
+
* @param payload - Object containing rate limit attributes and list of mailbox names.
|
|
16
|
+
* @returns A promise that resolves to a response indicating success or failure.
|
|
17
|
+
*/
|
|
18
|
+
editMailbox(payload: EditMailboxRequest): Promise<MailcowResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the rate limits for a specified domain or all domains.
|
|
21
|
+
*/
|
|
22
|
+
getDomain(domain: string): Promise<DomainRatelimit[]>;
|
|
23
|
+
getDomain(domain: 'all'): Promise<DomainRatelimit[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the rate limits for a specified mailbox or all mailboxes.
|
|
26
|
+
*/
|
|
27
|
+
getMailbox(mailbox: string): Promise<MailboxRatelimit[]>;
|
|
28
|
+
getMailbox(mailbox: 'all'): Promise<MailboxRatelimit[]>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Binder function between the MailcowClient class and the RatelimitsEndpoints.
|
|
32
|
+
* @param bind - The MailcowClient instance to bind.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function ratelimitsEndpoints(bind: MailcowClient): RatelimitsEndpoints;
|