ts-mailcow-api 0.12.0 → 1.1.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 +2 -149
- package/dist/client.d.ts +77 -0
- package/dist/client.js +77 -0
- package/dist/client.js.map +1 -1
- package/dist/endpoints/address-rewriting-endpoint.js +14 -6
- package/dist/endpoints/address-rewriting-endpoint.js.map +1 -1
- package/dist/endpoints/alias-endpoints.js +10 -4
- package/dist/endpoints/alias-endpoints.js.map +1 -1
- package/dist/endpoints/antispam-endpoints.js +7 -3
- package/dist/endpoints/antispam-endpoints.js.map +1 -1
- 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/domain-endpoints.js +10 -4
- package/dist/endpoints/domain-endpoints.js.map +1 -1
- package/dist/endpoints/fail2ban-endpoints.js +6 -2
- package/dist/endpoints/fail2ban-endpoints.js.map +1 -1
- package/dist/endpoints/forwarding-endpoints.js +8 -3
- package/dist/endpoints/forwarding-endpoints.js.map +1 -1
- package/dist/endpoints/log-endpoints.js +22 -10
- package/dist/endpoints/log-endpoints.js.map +1 -1
- package/dist/endpoints/mailbox-endpoint.js +20 -9
- package/dist/endpoints/mailbox-endpoint.js.map +1 -1
- 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 +10 -4
- package/dist/endpoints/syncjob-endpoints.js.map +1 -1
- 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/request-factory.js +45 -26
- package/dist/request-factory.js.map +1 -1
- package/dist/types.d.ts +755 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ import MailCowClient from "./index";
|
|
|
19
19
|
|
|
20
20
|
// Create MailCowClient based on BASE_URL and API_KEY
|
|
21
21
|
const mcc = new MailCowClient(
|
|
22
|
-
"https://demo.mailcow.email/",
|
|
22
|
+
"https://demo.mailcow.email/api/v1",
|
|
23
23
|
"390448-22B69F-FA37D9-19701B-6F033F",
|
|
24
24
|
);
|
|
25
25
|
```
|
|
@@ -44,151 +44,4 @@ mcc.mailbox
|
|
|
44
44
|
|
|
45
45
|
The [Mailcow OpenAPI spec](https://github.com/mailcow/mailcow-dockerized/blob/master/data/web/api/openapi.yaml) doesn’t pass validation and isn’t RESTful (e.g. `POST /api/v1/add/domain`).
|
|
46
46
|
If Mailcow ever fixes the naming or structure, a generated client would break.
|
|
47
|
-
This wrapper acts as a middleman, so those changes can be patched internally without ruining the client interface.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## API implementation progress
|
|
51
|
-
|
|
52
|
-
### Domains
|
|
53
|
-
|
|
54
|
-
- [x] Create domain
|
|
55
|
-
- [x] Delete domain
|
|
56
|
-
- [x] Update domain
|
|
57
|
-
- [x] Get domain
|
|
58
|
-
|
|
59
|
-
### Domain antispam policies
|
|
60
|
-
|
|
61
|
-
- [x] Create domain policy
|
|
62
|
-
- [x] Delete domain policy
|
|
63
|
-
- [x] List blacklist/whitelist domain policy
|
|
64
|
-
|
|
65
|
-
### Mailboxes
|
|
66
|
-
|
|
67
|
-
- [x] Create mailbox
|
|
68
|
-
- [x] Delete mailbox
|
|
69
|
-
- [x] Update mailbox
|
|
70
|
-
- [x] Update Pushover settings
|
|
71
|
-
- [x] Quarantine Notifications
|
|
72
|
-
- [x] Update mailbox ACL
|
|
73
|
-
- [x] Get mailboxes
|
|
74
|
-
- [x] Edit mailbox spam filter score
|
|
75
|
-
- [x] Get Active User Sieve
|
|
76
|
-
|
|
77
|
-
### Aliases
|
|
78
|
-
|
|
79
|
-
- [x] Create alias
|
|
80
|
-
- [x] Delete alias
|
|
81
|
-
- [x] Update alias
|
|
82
|
-
- [x] Get aliases
|
|
83
|
-
|
|
84
|
-
### Sync Jobs
|
|
85
|
-
|
|
86
|
-
- [x] Create sync job
|
|
87
|
-
- [x] Delete sync job
|
|
88
|
-
- [x] Update sync job
|
|
89
|
-
- [x] Get sync jobs
|
|
90
|
-
|
|
91
|
-
### Forwarding Hosts
|
|
92
|
-
|
|
93
|
-
- [x] Add Forward Host
|
|
94
|
-
- [x] Delete Forward Host
|
|
95
|
-
- [x] Get Forwarding Hosts
|
|
96
|
-
|
|
97
|
-
### Logs
|
|
98
|
-
|
|
99
|
-
- [x] Get ACME logs
|
|
100
|
-
- [x] Get Api logs
|
|
101
|
-
- [x] Get Autodiscover logs
|
|
102
|
-
- [x] Get Dovecot logs
|
|
103
|
-
- [x] Get Netfilter logs
|
|
104
|
-
- [x] Get Postfix logs
|
|
105
|
-
- [x] Get Ratelimit logs
|
|
106
|
-
- [x] Get Rspamd logs
|
|
107
|
-
- [x] Get SOGo logs
|
|
108
|
-
- [x] Get Watchdog logs
|
|
109
|
-
|
|
110
|
-
### Address Rewriting
|
|
111
|
-
|
|
112
|
-
- [x] Create BCC Map
|
|
113
|
-
- [x] Create Recipient Map
|
|
114
|
-
- [x] Delete BCC Map
|
|
115
|
-
- [x] Delete Recipient Map
|
|
116
|
-
- [x] Get BCC Map
|
|
117
|
-
- [x] Get Recipient Map
|
|
118
|
-
|
|
119
|
-
### Queue Manager
|
|
120
|
-
|
|
121
|
-
- [ ] Delete Queue
|
|
122
|
-
- [ ] Flush Queue
|
|
123
|
-
- [ ] Get Queue
|
|
124
|
-
|
|
125
|
-
### Quarantine
|
|
126
|
-
|
|
127
|
-
- [ ] Delete mails in Quarantaine
|
|
128
|
-
- [ ] Get mails in Quarantaine
|
|
129
|
-
|
|
130
|
-
### Fail2Ban
|
|
131
|
-
|
|
132
|
-
- [x] Edit Fail2Ban
|
|
133
|
-
- [x] Get Fail2Ban Config
|
|
134
|
-
|
|
135
|
-
### DKIM
|
|
136
|
-
|
|
137
|
-
- [ ] Generate DKIM key
|
|
138
|
-
- [ ] Duplicate DKIM key
|
|
139
|
-
- [ ] Delete DKIM key
|
|
140
|
-
- [ ] Get DKIM key
|
|
141
|
-
|
|
142
|
-
### Domain Admin
|
|
143
|
-
|
|
144
|
-
- [ ] Create Domain Admin user
|
|
145
|
-
- [ ] Edit Domain Admin ACL
|
|
146
|
-
- [ ] Edit Domain Admin user
|
|
147
|
-
- [ ] Delete Domain Admin
|
|
148
|
-
- [ ] Get Domain Admins
|
|
149
|
-
|
|
150
|
-
### Outgoing TLS Policy Map Overrides
|
|
151
|
-
|
|
152
|
-
- [ ] Create TLS Policy Map
|
|
153
|
-
- [ ] Delete TLS Policy Map
|
|
154
|
-
- [ ] Get TLS Policy Map
|
|
155
|
-
|
|
156
|
-
### oAuth Clients
|
|
157
|
-
|
|
158
|
-
- [ ] Create oAuth client
|
|
159
|
-
- [ ] Delete oAuth client
|
|
160
|
-
- [ ] Get oAuth Clients
|
|
161
|
-
|
|
162
|
-
### Routing
|
|
163
|
-
|
|
164
|
-
- [ ] Create Sender-Dependent Transports
|
|
165
|
-
- [ ] Create Transport Maps
|
|
166
|
-
- [ ] Delete Sender-Dependent Transports
|
|
167
|
-
- [ ] Delete Transport Maps
|
|
168
|
-
- [ ] Get Sender-Dependent Transports
|
|
169
|
-
- [ ] Get Transport Maps
|
|
170
|
-
|
|
171
|
-
### Resources
|
|
172
|
-
|
|
173
|
-
- [ ] Create Resources
|
|
174
|
-
- [ ] Delete Resources
|
|
175
|
-
- [ ] Get Resources
|
|
176
|
-
|
|
177
|
-
### App Passwords
|
|
178
|
-
|
|
179
|
-
- [ ] Create App Passwords
|
|
180
|
-
- [ ] Delete App Passwords
|
|
181
|
-
- [ ] Get App Passwords
|
|
182
|
-
|
|
183
|
-
### Status
|
|
184
|
-
|
|
185
|
-
- [ ] Get container status
|
|
186
|
-
- [ ] Get solr status
|
|
187
|
-
- [ ] Get vmail status
|
|
188
|
-
|
|
189
|
-
### Ratelimits
|
|
190
|
-
|
|
191
|
-
- [ ] Get mailbox ratelimits
|
|
192
|
-
- [ ] Get domain ratelimits
|
|
193
|
-
- [ ] Edit domain ratelimits
|
|
194
|
-
- [ ] Edit mailbox ratelimits
|
|
47
|
+
This wrapper acts as a middleman, so those changes can be patched internally without ruining the client interface.
|
package/dist/client.d.ts
CHANGED
|
@@ -12,6 +12,17 @@ import { ForwardingEndpoints } from './endpoints/forwarding-endpoints';
|
|
|
12
12
|
import { LogEndpoints } from './endpoints/log-endpoints';
|
|
13
13
|
import { AdressRewritingEndpoints } from './endpoints/address-rewriting-endpoint';
|
|
14
14
|
import { Fail2BanEndpoints } from './endpoints/fail2ban-endpoints';
|
|
15
|
+
import { StatusEndpoints } from './endpoints/status-endpoints';
|
|
16
|
+
import { ResourceEndpoints } from './endpoints/resource-endpoints';
|
|
17
|
+
import { QueueManagerEndpoints } from './endpoints/queue-manager-endpoints';
|
|
18
|
+
import { QuarantineEndpoints } from './endpoints/quarantine-endpoints';
|
|
19
|
+
import { RatelimitsEndpoints } from './endpoints/ratelimit-endpoints';
|
|
20
|
+
import { OAuth2Endpoints } from './endpoints/oauth2-endpoints';
|
|
21
|
+
import { AppPasswordEndpoints } from './endpoints/app-password-endpoints';
|
|
22
|
+
import { TlsPolicyMapEndpoints } from './endpoints/tls-policy-map-endpoints';
|
|
23
|
+
import { DkimEndpoints } from './endpoints/dkim-endpoints';
|
|
24
|
+
import { DomainAdminEndpoints } from './endpoints/domain-admin-endpoints';
|
|
25
|
+
import { RoutingEndpoints } from './endpoints/routing-endpoints';
|
|
15
26
|
/**
|
|
16
27
|
* Class containing all the logic to interface with the Mailcow API in TypeScript.
|
|
17
28
|
* @external
|
|
@@ -97,5 +108,71 @@ declare class MailcowClient {
|
|
|
97
108
|
* @external
|
|
98
109
|
*/
|
|
99
110
|
fail2Ban: Fail2BanEndpoints;
|
|
111
|
+
/**
|
|
112
|
+
* All endpoints related to status.
|
|
113
|
+
* See {@link StatusEndpoints}
|
|
114
|
+
* @external
|
|
115
|
+
*/
|
|
116
|
+
status: StatusEndpoints;
|
|
117
|
+
/**
|
|
118
|
+
* All endpoints related to resources.
|
|
119
|
+
* See {@link ResourceEndpoints}
|
|
120
|
+
* @external
|
|
121
|
+
*/
|
|
122
|
+
resources: ResourceEndpoints;
|
|
123
|
+
/**
|
|
124
|
+
* All endpoints related to the mail queue.
|
|
125
|
+
* See {@link QueueManagerEndpoints}
|
|
126
|
+
* @external
|
|
127
|
+
*/
|
|
128
|
+
queueManager: QueueManagerEndpoints;
|
|
129
|
+
/**
|
|
130
|
+
* All endpoints related to quarantine.
|
|
131
|
+
* See {@link QuarantineEndpoints}
|
|
132
|
+
* @external
|
|
133
|
+
*/
|
|
134
|
+
quarantine: QuarantineEndpoints;
|
|
135
|
+
/**
|
|
136
|
+
* All endpoints related to rate limits.
|
|
137
|
+
* See {@link RatelimitsEndpoints}
|
|
138
|
+
* @external
|
|
139
|
+
*/
|
|
140
|
+
ratelimits: RatelimitsEndpoints;
|
|
141
|
+
/**
|
|
142
|
+
* All endpoints related to OAuth2 clients.
|
|
143
|
+
* See {@link OAuth2Endpoints}
|
|
144
|
+
* @external
|
|
145
|
+
*/
|
|
146
|
+
oauth2: OAuth2Endpoints;
|
|
147
|
+
/**
|
|
148
|
+
* All endpoints related to app passwords.
|
|
149
|
+
* See {@link AppPasswordEndpoints}
|
|
150
|
+
* @external
|
|
151
|
+
*/
|
|
152
|
+
appPasswords: AppPasswordEndpoints;
|
|
153
|
+
/**
|
|
154
|
+
* All endpoints related to TLS Policy Maps.
|
|
155
|
+
* See {@link TlsPolicyMapEndpoints}
|
|
156
|
+
* @external
|
|
157
|
+
*/
|
|
158
|
+
tlsPolicyMaps: TlsPolicyMapEndpoints;
|
|
159
|
+
/**
|
|
160
|
+
* All endpoints related to DKIM.
|
|
161
|
+
* See {@link DkimEndpoints}
|
|
162
|
+
* @external
|
|
163
|
+
*/
|
|
164
|
+
dkim: DkimEndpoints;
|
|
165
|
+
/**
|
|
166
|
+
* All endpoints related to Domain Admins.
|
|
167
|
+
* See {@link DomainAdminEndpoints}
|
|
168
|
+
* @external
|
|
169
|
+
*/
|
|
170
|
+
domainAdmins: DomainAdminEndpoints;
|
|
171
|
+
/**
|
|
172
|
+
* All endpoints related to Routing.
|
|
173
|
+
* See {@link RoutingEndpoints}
|
|
174
|
+
* @external
|
|
175
|
+
*/
|
|
176
|
+
routing: RoutingEndpoints;
|
|
100
177
|
}
|
|
101
178
|
export default MailcowClient;
|
package/dist/client.js
CHANGED
|
@@ -13,6 +13,17 @@ const forwarding_endpoints_1 = require("./endpoints/forwarding-endpoints");
|
|
|
13
13
|
const log_endpoints_1 = require("./endpoints/log-endpoints");
|
|
14
14
|
const address_rewriting_endpoint_1 = require("./endpoints/address-rewriting-endpoint");
|
|
15
15
|
const fail2ban_endpoints_1 = require("./endpoints/fail2ban-endpoints");
|
|
16
|
+
const status_endpoints_1 = require("./endpoints/status-endpoints");
|
|
17
|
+
const resource_endpoints_1 = require("./endpoints/resource-endpoints");
|
|
18
|
+
const queue_manager_endpoints_1 = require("./endpoints/queue-manager-endpoints");
|
|
19
|
+
const quarantine_endpoints_1 = require("./endpoints/quarantine-endpoints");
|
|
20
|
+
const ratelimit_endpoints_1 = require("./endpoints/ratelimit-endpoints");
|
|
21
|
+
const oauth2_endpoints_1 = require("./endpoints/oauth2-endpoints");
|
|
22
|
+
const app_password_endpoints_1 = require("./endpoints/app-password-endpoints");
|
|
23
|
+
const tls_policy_map_endpoints_1 = require("./endpoints/tls-policy-map-endpoints");
|
|
24
|
+
const dkim_endpoints_1 = require("./endpoints/dkim-endpoints");
|
|
25
|
+
const domain_admin_endpoints_1 = require("./endpoints/domain-admin-endpoints");
|
|
26
|
+
const routing_endpoints_1 = require("./endpoints/routing-endpoints");
|
|
16
27
|
/**
|
|
17
28
|
* Class containing all the logic to interface with the Mailcow API in TypeScript.
|
|
18
29
|
* @external
|
|
@@ -83,6 +94,72 @@ class MailcowClient {
|
|
|
83
94
|
* @external
|
|
84
95
|
*/
|
|
85
96
|
this.fail2Ban = (0, fail2ban_endpoints_1.fail2BanEndpoints)(this);
|
|
97
|
+
/**
|
|
98
|
+
* All endpoints related to status.
|
|
99
|
+
* See {@link StatusEndpoints}
|
|
100
|
+
* @external
|
|
101
|
+
*/
|
|
102
|
+
this.status = (0, status_endpoints_1.statusEndpoints)(this);
|
|
103
|
+
/**
|
|
104
|
+
* All endpoints related to resources.
|
|
105
|
+
* See {@link ResourceEndpoints}
|
|
106
|
+
* @external
|
|
107
|
+
*/
|
|
108
|
+
this.resources = (0, resource_endpoints_1.resourceEndpoints)(this);
|
|
109
|
+
/**
|
|
110
|
+
* All endpoints related to the mail queue.
|
|
111
|
+
* See {@link QueueManagerEndpoints}
|
|
112
|
+
* @external
|
|
113
|
+
*/
|
|
114
|
+
this.queueManager = (0, queue_manager_endpoints_1.queueManagerEndpoints)(this);
|
|
115
|
+
/**
|
|
116
|
+
* All endpoints related to quarantine.
|
|
117
|
+
* See {@link QuarantineEndpoints}
|
|
118
|
+
* @external
|
|
119
|
+
*/
|
|
120
|
+
this.quarantine = (0, quarantine_endpoints_1.quarantineEndpoints)(this);
|
|
121
|
+
/**
|
|
122
|
+
* All endpoints related to rate limits.
|
|
123
|
+
* See {@link RatelimitsEndpoints}
|
|
124
|
+
* @external
|
|
125
|
+
*/
|
|
126
|
+
this.ratelimits = (0, ratelimit_endpoints_1.ratelimitsEndpoints)(this);
|
|
127
|
+
/**
|
|
128
|
+
* All endpoints related to OAuth2 clients.
|
|
129
|
+
* See {@link OAuth2Endpoints}
|
|
130
|
+
* @external
|
|
131
|
+
*/
|
|
132
|
+
this.oauth2 = (0, oauth2_endpoints_1.oauth2Endpoints)(this);
|
|
133
|
+
/**
|
|
134
|
+
* All endpoints related to app passwords.
|
|
135
|
+
* See {@link AppPasswordEndpoints}
|
|
136
|
+
* @external
|
|
137
|
+
*/
|
|
138
|
+
this.appPasswords = (0, app_password_endpoints_1.appPasswordEndpoints)(this);
|
|
139
|
+
/**
|
|
140
|
+
* All endpoints related to TLS Policy Maps.
|
|
141
|
+
* See {@link TlsPolicyMapEndpoints}
|
|
142
|
+
* @external
|
|
143
|
+
*/
|
|
144
|
+
this.tlsPolicyMaps = (0, tls_policy_map_endpoints_1.tlsPolicyMapEndpoints)(this);
|
|
145
|
+
/**
|
|
146
|
+
* All endpoints related to DKIM.
|
|
147
|
+
* See {@link DkimEndpoints}
|
|
148
|
+
* @external
|
|
149
|
+
*/
|
|
150
|
+
this.dkim = (0, dkim_endpoints_1.dkimEndpoints)(this);
|
|
151
|
+
/**
|
|
152
|
+
* All endpoints related to Domain Admins.
|
|
153
|
+
* See {@link DomainAdminEndpoints}
|
|
154
|
+
* @external
|
|
155
|
+
*/
|
|
156
|
+
this.domainAdmins = (0, domain_admin_endpoints_1.domainAdminEndpoints)(this);
|
|
157
|
+
/**
|
|
158
|
+
* All endpoints related to Routing.
|
|
159
|
+
* See {@link RoutingEndpoints}
|
|
160
|
+
* @external
|
|
161
|
+
*/
|
|
162
|
+
this.routing = (0, routing_endpoints_1.routingEndpoints)(this);
|
|
86
163
|
this.BASE_URL = BASE_URL.charAt(BASE_URL.length - 1) === '/' ? BASE_URL : BASE_URL.concat('/');
|
|
87
164
|
this.API_KEY = API_KEY;
|
|
88
165
|
// Set the correct Axios request config.
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAGH,mEAAgF;AAChF,uEAAsF;AACtF,mEAAkF;AAClF,uDAA+C;AAC/C,iEAA6E;AAC7E,qEAAmF;AACnF,2EAA4F;AAC5F,6DAAuE;AACvE,uFAA6G;AAC7G,uEAAsF;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addressRewritingEndpoints = addressRewritingEndpoints;
|
|
4
|
+
const ADDRESS_REWRITING_ENDPOINTS = {
|
|
5
|
+
ADD_BCC_MAP: 'add/bcc',
|
|
6
|
+
ADD_RECIPIENT_MAP: 'add/recipient_map',
|
|
7
|
+
DELETE_BCC_MAP: 'delete/bcc',
|
|
8
|
+
DELETE_RECIPIENT_MAP: 'delete/recipient_map',
|
|
9
|
+
GET_BCC_MAP: 'get/bcc',
|
|
10
|
+
GET_RECIPIENT_MAP: 'get/recipient_map',
|
|
11
|
+
};
|
|
4
12
|
function addressRewritingEndpoints(bind) {
|
|
5
13
|
return {
|
|
6
14
|
addBccMap(payload) {
|
|
7
|
-
return bind.requestFactory.post(
|
|
15
|
+
return bind.requestFactory.post(ADDRESS_REWRITING_ENDPOINTS.ADD_BCC_MAP, payload);
|
|
8
16
|
},
|
|
9
17
|
addRecipientMap(payload) {
|
|
10
|
-
return bind.requestFactory.post(
|
|
18
|
+
return bind.requestFactory.post(ADDRESS_REWRITING_ENDPOINTS.ADD_RECIPIENT_MAP, payload);
|
|
11
19
|
},
|
|
12
20
|
deleteBccMap(payload) {
|
|
13
|
-
return bind.requestFactory.post(
|
|
21
|
+
return bind.requestFactory.post(ADDRESS_REWRITING_ENDPOINTS.DELETE_BCC_MAP, payload);
|
|
14
22
|
},
|
|
15
23
|
deleteRecipientMap(payload) {
|
|
16
|
-
return bind.requestFactory.post(
|
|
24
|
+
return bind.requestFactory.post(ADDRESS_REWRITING_ENDPOINTS.DELETE_RECIPIENT_MAP, payload);
|
|
17
25
|
},
|
|
18
26
|
getBccMap(id) {
|
|
19
|
-
return bind.requestFactory.get(
|
|
27
|
+
return bind.requestFactory.get(ADDRESS_REWRITING_ENDPOINTS.GET_BCC_MAP + `/${id}`);
|
|
20
28
|
},
|
|
21
29
|
getRecipientMap(id) {
|
|
22
|
-
return bind.requestFactory.get(
|
|
30
|
+
return bind.requestFactory.get(ADDRESS_REWRITING_ENDPOINTS.GET_RECIPIENT_MAP + `/${id}`);
|
|
23
31
|
},
|
|
24
32
|
};
|
|
25
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-rewriting-endpoint.js","sourceRoot":"","sources":["../../src/endpoints/address-rewriting-endpoint.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"address-rewriting-endpoint.js","sourceRoot":"","sources":["../../src/endpoints/address-rewriting-endpoint.ts"],"names":[],"mappings":";;AAqDA,8DAsCC;AA/CD,MAAM,2BAA2B,GAAG;IAClC,WAAW,EAAE,SAAS;IACtB,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,YAAY;IAC5B,oBAAoB,EAAE,sBAAsB;IAC5C,WAAW,EAAE,SAAS;IACtB,iBAAiB,EAAE,mBAAmB;CACvC,CAAC;AAEF,SAAgB,yBAAyB,CAAC,IAAmB;IAC3D,OAAO;QACL,SAAS,CAAC,OAAyB;YACjC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,2BAA2B,CAAC,WAAW,EACvC,OAAO,CACR,CAAC;QACJ,CAAC;QAED,eAAe,CAAC,OAA+B;YAC7C,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,2BAA2B,CAAC,iBAAiB,EAC7C,OAAO,CACR,CAAC;QACJ,CAAC;QAED,YAAY,CAAC,OAA8B;YACzC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,2BAA2B,CAAC,cAAc,EAC1C,OAAO,CACR,CAAC;QACJ,CAAC;QAED,kBAAkB,CAAC,OAAoC;YACrD,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC7B,2BAA2B,CAAC,oBAAoB,EAChD,OAAO,CACR,CAAC;QACJ,CAAC;QAED,SAAS,CAAC,EAAkB;YAC1B,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAoB,2BAA2B,CAAC,WAAW,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;QACxG,CAAC;QAED,eAAe,CAAC,EAAkB;YAChC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAA0B,2BAA2B,CAAC,iBAAiB,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;QACpH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.aliasEndpoints = aliasEndpoints;
|
|
4
4
|
const request_factory_1 = require("../request-factory");
|
|
5
|
+
const ALIAS_ENDPOINTS = {
|
|
6
|
+
GET: 'get/alias',
|
|
7
|
+
ADD: 'add/alias',
|
|
8
|
+
EDIT: 'edit/alias',
|
|
9
|
+
DELETE: 'delete/alias',
|
|
10
|
+
};
|
|
5
11
|
/**
|
|
6
12
|
* Binder function between the MailcowClient class and the AliasEndpoints.
|
|
7
13
|
* @param bind - The MailcowClient to bind.
|
|
@@ -10,16 +16,16 @@ const request_factory_1 = require("../request-factory");
|
|
|
10
16
|
function aliasEndpoints(bind) {
|
|
11
17
|
return {
|
|
12
18
|
get(id = 'all') {
|
|
13
|
-
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(
|
|
19
|
+
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(ALIAS_ENDPOINTS.GET + `/${id}`));
|
|
14
20
|
},
|
|
15
21
|
create: (payload) => {
|
|
16
|
-
return bind.requestFactory.post(
|
|
22
|
+
return bind.requestFactory.post(ALIAS_ENDPOINTS.ADD, payload);
|
|
17
23
|
},
|
|
18
24
|
edit: (payload) => {
|
|
19
|
-
return bind.requestFactory.post(
|
|
25
|
+
return bind.requestFactory.post(ALIAS_ENDPOINTS.EDIT, payload);
|
|
20
26
|
},
|
|
21
27
|
delete: (payload) => {
|
|
22
|
-
return bind.requestFactory.post(
|
|
28
|
+
return bind.requestFactory.post(ALIAS_ENDPOINTS.DELETE, payload.items);
|
|
23
29
|
},
|
|
24
30
|
};
|
|
25
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/alias-endpoints.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"alias-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/alias-endpoints.ts"],"names":[],"mappings":";;AA6CA,wCAeC;AA1DD,wDAAwD;AA+BxD,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,cAAc;CACvB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAmB;IAChD,OAAO;QACL,GAAG,CAAC,EAAE,GAAG,KAAK;YACZ,OAAO,IAAA,oCAAkB,EAAQ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAkB,eAAe,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7G,CAAC;QACD,MAAM,EAAE,CAAC,OAAyB,EAA4B,EAAE;YAC9D,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAoC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACnG,CAAC;QACD,IAAI,EAAE,CAAC,OAAyB,EAA4B,EAAE;YAC5D,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAoC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpG,CAAC;QACD,MAAM,EAAE,CAAC,OAA2B,EAA4B,EAAE;YAChE,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACpG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.antiSpamEndpoints = antiSpamEndpoints;
|
|
4
|
+
const ANTI_SPAM_ENDPOINTS = {
|
|
5
|
+
CREATE: 'add/domain-policy',
|
|
6
|
+
DELETE: 'delete/domain-policy',
|
|
7
|
+
};
|
|
4
8
|
/**
|
|
5
9
|
* Binder function between the MailcowClient class and the AntiSpamEndpoints
|
|
6
10
|
* @param bind - The MailcowClient to bind.
|
|
@@ -9,13 +13,13 @@ exports.antiSpamEndpoints = antiSpamEndpoints;
|
|
|
9
13
|
function antiSpamEndpoints(bind) {
|
|
10
14
|
return {
|
|
11
15
|
create(payload) {
|
|
12
|
-
return bind.requestFactory.post(
|
|
16
|
+
return bind.requestFactory.post(ANTI_SPAM_ENDPOINTS.CREATE, payload);
|
|
13
17
|
},
|
|
14
18
|
delete(payload) {
|
|
15
|
-
return bind.requestFactory.post(
|
|
19
|
+
return bind.requestFactory.post(ANTI_SPAM_ENDPOINTS.DELETE, payload.prefid);
|
|
16
20
|
},
|
|
17
21
|
get(payload) {
|
|
18
|
-
return bind.requestFactory.get(
|
|
22
|
+
return bind.requestFactory.get(`get/policy_${payload.type}_domain/${payload.domain}`);
|
|
19
23
|
},
|
|
20
24
|
};
|
|
21
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"antispam-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/antispam-endpoints.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"antispam-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/antispam-endpoints.ts"],"names":[],"mappings":";;AA0CA,8CAYC;AAtBD,MAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE,sBAAsB;CAC/B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,IAAmB;IACnD,OAAO;QACL,MAAM,CAAC,OAA8B;YACnC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAyC,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/G,CAAC;QACD,MAAM,CAAC,OAAgC;YACrC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA4B,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzG,CAAC;QACD,GAAG,CAAC,OAA6B;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAe,cAAc,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACtG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AddAppPasswordRequest, AppPassword, DeleteAppPasswordRequest, MailcowResponse } from '../types';
|
|
2
|
+
import MailcowClient from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for all App Password endpoints related to email handling in Mailcow.
|
|
5
|
+
*/
|
|
6
|
+
export interface AppPasswordEndpoints {
|
|
7
|
+
/**
|
|
8
|
+
* Adds a new app password.
|
|
9
|
+
* @param payload - Object containing the app password details.
|
|
10
|
+
*/
|
|
11
|
+
add(payload: AddAppPasswordRequest): Promise<MailcowResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Deletes specified app passwords.
|
|
14
|
+
* @param payload - Object containing a list of app password IDs to delete.
|
|
15
|
+
*/
|
|
16
|
+
delete(payload: DeleteAppPasswordRequest): Promise<MailcowResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves app passwords for a specific mailbox.
|
|
19
|
+
* @param mailbox - The mailbox for which to retrieve app passwords.
|
|
20
|
+
* @returns A promise that resolves to an array of `AppPassword` objects.
|
|
21
|
+
*/
|
|
22
|
+
get(mailbox: string): Promise<AppPassword[]>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Binder function between the MailcowClient class and the AppPasswordEndpoints.
|
|
26
|
+
* @param bind - The MailcowClient instance to bind.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function appPasswordEndpoints(bind: MailcowClient): AppPasswordEndpoints;
|
|
@@ -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;
|