@serve.zone/dcrouter-apiclient 32.3.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.
Files changed (200) hide show
  1. package/dist_ts_apiclient/classes.apitoken.d.ts +41 -0
  2. package/dist_ts_apiclient/classes.apitoken.js +115 -0
  3. package/dist_ts_apiclient/classes.certificate.d.ts +57 -0
  4. package/dist_ts_apiclient/classes.certificate.js +69 -0
  5. package/dist_ts_apiclient/classes.config.d.ts +7 -0
  6. package/dist_ts_apiclient/classes.config.js +11 -0
  7. package/dist_ts_apiclient/classes.dcrouterapiclient.d.ts +54 -0
  8. package/dist_ts_apiclient/classes.dcrouterapiclient.js +97 -0
  9. package/dist_ts_apiclient/classes.email.d.ts +30 -0
  10. package/dist_ts_apiclient/classes.email.js +52 -0
  11. package/dist_ts_apiclient/classes.gatewayclient.d.ts +28 -0
  12. package/dist_ts_apiclient/classes.gatewayclient.js +52 -0
  13. package/dist_ts_apiclient/classes.logs.d.ts +28 -0
  14. package/dist_ts_apiclient/classes.logs.js +69 -0
  15. package/dist_ts_apiclient/classes.radius.d.ts +59 -0
  16. package/dist_ts_apiclient/classes.radius.js +95 -0
  17. package/dist_ts_apiclient/classes.remoteingress.d.ts +66 -0
  18. package/dist_ts_apiclient/classes.remoteingress.js +164 -0
  19. package/dist_ts_apiclient/classes.route.d.ts +39 -0
  20. package/dist_ts_apiclient/classes.route.js +125 -0
  21. package/dist_ts_apiclient/classes.stats.d.ts +47 -0
  22. package/dist_ts_apiclient/classes.stats.js +38 -0
  23. package/dist_ts_apiclient/classes.testing.d.ts +65 -0
  24. package/dist_ts_apiclient/classes.testing.js +120 -0
  25. package/dist_ts_apiclient/index.d.ts +12 -0
  26. package/dist_ts_apiclient/index.js +16 -0
  27. package/dist_ts_apiclient/plugins.d.ts +4 -0
  28. package/dist_ts_apiclient/plugins.js +6 -0
  29. package/dist_ts_interfaces/data/acme-config.d.ts +23 -0
  30. package/dist_ts_interfaces/data/acme-config.js +2 -0
  31. package/dist_ts_interfaces/data/auth.d.ts +8 -0
  32. package/dist_ts_interfaces/data/auth.js +2 -0
  33. package/dist_ts_interfaces/data/config-events.d.ts +34 -0
  34. package/dist_ts_interfaces/data/config-events.js +8 -0
  35. package/dist_ts_interfaces/data/dns-authority.d.ts +98 -0
  36. package/dist_ts_interfaces/data/dns-authority.js +26 -0
  37. package/dist_ts_interfaces/data/dns-provider.d.ts +136 -0
  38. package/dist_ts_interfaces/data/dns-provider.js +41 -0
  39. package/dist_ts_interfaces/data/dns-record.d.ts +48 -0
  40. package/dist_ts_interfaces/data/dns-record.js +2 -0
  41. package/dist_ts_interfaces/data/domain.d.ts +35 -0
  42. package/dist_ts_interfaces/data/domain.js +2 -0
  43. package/dist_ts_interfaces/data/email-domain.d.ts +177 -0
  44. package/dist_ts_interfaces/data/email-domain.js +2 -0
  45. package/dist_ts_interfaces/data/email-settings.d.ts +68 -0
  46. package/dist_ts_interfaces/data/email-settings.js +2 -0
  47. package/dist_ts_interfaces/data/index.d.ts +18 -0
  48. package/dist_ts_interfaces/data/index.js +19 -0
  49. package/dist_ts_interfaces/data/remoteingress.d.ts +181 -0
  50. package/dist_ts_interfaces/data/remoteingress.js +15 -0
  51. package/dist_ts_interfaces/data/route-management.d.ts +270 -0
  52. package/dist_ts_interfaces/data/route-management.js +130 -0
  53. package/dist_ts_interfaces/data/security-policy.d.ts +32 -0
  54. package/dist_ts_interfaces/data/security-policy.js +2 -0
  55. package/dist_ts_interfaces/data/smtp-account.d.ts +50 -0
  56. package/dist_ts_interfaces/data/smtp-account.js +9 -0
  57. package/dist_ts_interfaces/data/stats.d.ts +283 -0
  58. package/dist_ts_interfaces/data/stats.js +2 -0
  59. package/dist_ts_interfaces/data/target-profile.d.ts +30 -0
  60. package/dist_ts_interfaces/data/target-profile.js +2 -0
  61. package/dist_ts_interfaces/data/testing.d.ts +191 -0
  62. package/dist_ts_interfaces/data/testing.js +20 -0
  63. package/dist_ts_interfaces/data/vpn.d.ts +65 -0
  64. package/dist_ts_interfaces/data/vpn.js +2 -0
  65. package/dist_ts_interfaces/data/workhoster.d.ts +63 -0
  66. package/dist_ts_interfaces/data/workhoster.js +2 -0
  67. package/dist_ts_interfaces/index.d.ts +5 -0
  68. package/dist_ts_interfaces/index.js +8 -0
  69. package/dist_ts_interfaces/plugins.d.ts +2 -0
  70. package/dist_ts_interfaces/plugins.js +4 -0
  71. package/dist_ts_interfaces/requests/acme-config.d.ts +42 -0
  72. package/dist_ts_interfaces/requests/acme-config.js +2 -0
  73. package/dist_ts_interfaces/requests/admin.d.ts +69 -0
  74. package/dist_ts_interfaces/requests/admin.js +3 -0
  75. package/dist_ts_interfaces/requests/api-tokens.d.ts +85 -0
  76. package/dist_ts_interfaces/requests/api-tokens.js +2 -0
  77. package/dist_ts_interfaces/requests/certificate.d.ts +87 -0
  78. package/dist_ts_interfaces/requests/certificate.js +5 -0
  79. package/dist_ts_interfaces/requests/combined.stats.d.ts +29 -0
  80. package/dist_ts_interfaces/requests/combined.stats.js +2 -0
  81. package/dist_ts_interfaces/requests/config-events.d.ts +35 -0
  82. package/dist_ts_interfaces/requests/config-events.js +4 -0
  83. package/dist_ts_interfaces/requests/config.d.ts +93 -0
  84. package/dist_ts_interfaces/requests/config.js +3 -0
  85. package/dist_ts_interfaces/requests/dns-authority.d.ts +80 -0
  86. package/dist_ts_interfaces/requests/dns-authority.js +3 -0
  87. package/dist_ts_interfaces/requests/dns-providers.d.ts +117 -0
  88. package/dist_ts_interfaces/requests/dns-providers.js +2 -0
  89. package/dist_ts_interfaces/requests/dns-records.d.ts +89 -0
  90. package/dist_ts_interfaces/requests/dns-records.js +2 -0
  91. package/dist_ts_interfaces/requests/domains.d.ts +142 -0
  92. package/dist_ts_interfaces/requests/domains.js +2 -0
  93. package/dist_ts_interfaces/requests/email-domains.d.ts +154 -0
  94. package/dist_ts_interfaces/requests/email-domains.js +2 -0
  95. package/dist_ts_interfaces/requests/email-ops.d.ts +211 -0
  96. package/dist_ts_interfaces/requests/email-ops.js +3 -0
  97. package/dist_ts_interfaces/requests/email-settings.d.ts +26 -0
  98. package/dist_ts_interfaces/requests/email-settings.js +2 -0
  99. package/dist_ts_interfaces/requests/index.d.ts +29 -0
  100. package/dist_ts_interfaces/requests/index.js +30 -0
  101. package/dist_ts_interfaces/requests/logs.d.ts +43 -0
  102. package/dist_ts_interfaces/requests/logs.js +4 -0
  103. package/dist_ts_interfaces/requests/network-targets.d.ts +102 -0
  104. package/dist_ts_interfaces/requests/network-targets.js +2 -0
  105. package/dist_ts_interfaces/requests/radius.d.ts +280 -0
  106. package/dist_ts_interfaces/requests/radius.js +3 -0
  107. package/dist_ts_interfaces/requests/realtime.d.ts +38 -0
  108. package/dist_ts_interfaces/requests/realtime.js +12 -0
  109. package/dist_ts_interfaces/requests/remoteingress.d.ts +162 -0
  110. package/dist_ts_interfaces/requests/remoteingress.js +3 -0
  111. package/dist_ts_interfaces/requests/route-management.d.ts +147 -0
  112. package/dist_ts_interfaces/requests/route-management.js +2 -0
  113. package/dist_ts_interfaces/requests/security-policy.d.ts +105 -0
  114. package/dist_ts_interfaces/requests/security-policy.js +2 -0
  115. package/dist_ts_interfaces/requests/smtp-accounts.d.ts +125 -0
  116. package/dist_ts_interfaces/requests/smtp-accounts.js +2 -0
  117. package/dist_ts_interfaces/requests/source-profiles.d.ts +102 -0
  118. package/dist_ts_interfaces/requests/source-profiles.js +2 -0
  119. package/dist_ts_interfaces/requests/stats.d.ts +196 -0
  120. package/dist_ts_interfaces/requests/stats.js +4 -0
  121. package/dist_ts_interfaces/requests/target-profiles.d.ts +105 -0
  122. package/dist_ts_interfaces/requests/target-profiles.js +2 -0
  123. package/dist_ts_interfaces/requests/testing.d.ts +169 -0
  124. package/dist_ts_interfaces/requests/testing.js +2 -0
  125. package/dist_ts_interfaces/requests/users.d.ts +53 -0
  126. package/dist_ts_interfaces/requests/users.js +3 -0
  127. package/dist_ts_interfaces/requests/vpn.d.ts +188 -0
  128. package/dist_ts_interfaces/requests/vpn.js +3 -0
  129. package/dist_ts_interfaces/requests/workhoster.d.ts +79 -0
  130. package/dist_ts_interfaces/requests/workhoster.js +2 -0
  131. package/license +21 -0
  132. package/package.json +67 -0
  133. package/readme.md +218 -0
  134. package/ts_apiclient/classes.apitoken.ts +157 -0
  135. package/ts_apiclient/classes.certificate.ts +124 -0
  136. package/ts_apiclient/classes.config.ts +17 -0
  137. package/ts_apiclient/classes.dcrouterapiclient.ts +138 -0
  138. package/ts_apiclient/classes.email.ts +77 -0
  139. package/ts_apiclient/classes.gatewayclient.ts +110 -0
  140. package/ts_apiclient/classes.logs.ts +91 -0
  141. package/ts_apiclient/classes.radius.ts +180 -0
  142. package/ts_apiclient/classes.remoteingress.ts +217 -0
  143. package/ts_apiclient/classes.route.ts +166 -0
  144. package/ts_apiclient/classes.stats.ts +111 -0
  145. package/ts_apiclient/classes.testing.ts +152 -0
  146. package/ts_apiclient/index.ts +17 -0
  147. package/ts_apiclient/plugins.ts +10 -0
  148. package/ts_apiclient/readme.md +218 -0
  149. package/ts_interfaces/data/acme-config.ts +23 -0
  150. package/ts_interfaces/data/auth.ts +8 -0
  151. package/ts_interfaces/data/config-events.ts +38 -0
  152. package/ts_interfaces/data/dns-authority.ts +106 -0
  153. package/ts_interfaces/data/dns-provider.ts +174 -0
  154. package/ts_interfaces/data/dns-record.ts +50 -0
  155. package/ts_interfaces/data/domain.ts +36 -0
  156. package/ts_interfaces/data/email-domain.ts +206 -0
  157. package/ts_interfaces/data/email-settings.ts +75 -0
  158. package/ts_interfaces/data/index.ts +18 -0
  159. package/ts_interfaces/data/remoteingress.ts +204 -0
  160. package/ts_interfaces/data/route-management.ts +436 -0
  161. package/ts_interfaces/data/security-policy.ts +37 -0
  162. package/ts_interfaces/data/smtp-account.ts +63 -0
  163. package/ts_interfaces/data/stats.ts +305 -0
  164. package/ts_interfaces/data/target-profile.ts +31 -0
  165. package/ts_interfaces/data/testing.ts +184 -0
  166. package/ts_interfaces/data/vpn.ts +68 -0
  167. package/ts_interfaces/data/workhoster.ts +72 -0
  168. package/ts_interfaces/index.ts +9 -0
  169. package/ts_interfaces/plugins.ts +6 -0
  170. package/ts_interfaces/readme.md +194 -0
  171. package/ts_interfaces/requests/acme-config.ts +54 -0
  172. package/ts_interfaces/requests/admin.ts +96 -0
  173. package/ts_interfaces/requests/api-tokens.ts +109 -0
  174. package/ts_interfaces/requests/certificate.ts +106 -0
  175. package/ts_interfaces/requests/combined.stats.ts +30 -0
  176. package/ts_interfaces/requests/config-events.ts +45 -0
  177. package/ts_interfaces/requests/config.ts +94 -0
  178. package/ts_interfaces/requests/dns-authority.ts +104 -0
  179. package/ts_interfaces/requests/dns-providers.ts +154 -0
  180. package/ts_interfaces/requests/dns-records.ts +113 -0
  181. package/ts_interfaces/requests/domains.ts +178 -0
  182. package/ts_interfaces/requests/email-domains.ts +193 -0
  183. package/ts_interfaces/requests/email-ops.ts +266 -0
  184. package/ts_interfaces/requests/email-settings.ts +34 -0
  185. package/ts_interfaces/requests/index.ts +29 -0
  186. package/ts_interfaces/requests/logs.ts +58 -0
  187. package/ts_interfaces/requests/network-targets.ts +127 -0
  188. package/ts_interfaces/requests/radius.ts +341 -0
  189. package/ts_interfaces/requests/realtime.ts +59 -0
  190. package/ts_interfaces/requests/remoteingress.ts +202 -0
  191. package/ts_interfaces/requests/route-management.ts +194 -0
  192. package/ts_interfaces/requests/security-policy.ts +144 -0
  193. package/ts_interfaces/requests/smtp-accounts.ts +163 -0
  194. package/ts_interfaces/requests/source-profiles.ts +127 -0
  195. package/ts_interfaces/requests/stats.ts +207 -0
  196. package/ts_interfaces/requests/target-profiles.ts +130 -0
  197. package/ts_interfaces/requests/testing.ts +186 -0
  198. package/ts_interfaces/requests/users.ts +66 -0
  199. package/ts_interfaces/requests/vpn.ts +238 -0
  200. package/ts_interfaces/requests/workhoster.ts +100 -0
@@ -0,0 +1,193 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type * as authInterfaces from '../data/auth.js';
3
+ import type { IEmailDomain, IEmailDnsRecord, IEmailDomainRemoteIngress } from '../data/email-domain.js';
4
+
5
+ // ============================================================================
6
+ // Email Domain Endpoints
7
+ // ============================================================================
8
+
9
+ export type TEmailDomainLifecycleStatus = 'active' | 'pending' | 'failed' | 'deleting';
10
+
11
+ export interface IEmailDomainActionError {
12
+ code: string;
13
+ message: string;
14
+ recordKey?: string;
15
+ retryable?: boolean;
16
+ }
17
+
18
+ /**
19
+ * Optional lifecycle metadata shared by email-domain mutations. The fields are
20
+ * additive so older clients can continue to rely on `success` and `message`.
21
+ */
22
+ export interface IEmailDomainActionResult {
23
+ success: boolean;
24
+ message?: string;
25
+ lifecycleStatus?: TEmailDomainLifecycleStatus;
26
+ code?: string;
27
+ errors?: IEmailDomainActionError[];
28
+ retryAt?: string;
29
+ capability?: 'supported' | 'unsupported';
30
+ }
31
+
32
+ /**
33
+ * List all email domains.
34
+ */
35
+ export interface IReq_GetEmailDomains extends plugins.typedrequestInterfaces.implementsTR<
36
+ plugins.typedrequestInterfaces.ITypedRequest,
37
+ IReq_GetEmailDomains
38
+ > {
39
+ method: 'getEmailDomains';
40
+ request: {
41
+ identity?: authInterfaces.IIdentity;
42
+ apiToken?: string;
43
+ };
44
+ response: {
45
+ domains: IEmailDomain[];
46
+ };
47
+ }
48
+
49
+ /**
50
+ * Get a single email domain by id.
51
+ */
52
+ export interface IReq_GetEmailDomain extends plugins.typedrequestInterfaces.implementsTR<
53
+ plugins.typedrequestInterfaces.ITypedRequest,
54
+ IReq_GetEmailDomain
55
+ > {
56
+ method: 'getEmailDomain';
57
+ request: {
58
+ identity?: authInterfaces.IIdentity;
59
+ apiToken?: string;
60
+ id: string;
61
+ };
62
+ response: {
63
+ domain: IEmailDomain | null;
64
+ };
65
+ }
66
+
67
+ /**
68
+ * Create an email domain. Links to an existing dcrouter DNS domain.
69
+ * Generates DKIM keys and computes the required DNS records.
70
+ */
71
+ export interface IReq_CreateEmailDomain extends plugins.typedrequestInterfaces.implementsTR<
72
+ plugins.typedrequestInterfaces.ITypedRequest,
73
+ IReq_CreateEmailDomain
74
+ > {
75
+ method: 'createEmailDomain';
76
+ request: {
77
+ identity?: authInterfaces.IIdentity;
78
+ apiToken?: string;
79
+ /** ID of the existing dcrouter DNS domain to link to. */
80
+ linkedDomainId: string;
81
+ /** Optional subdomain prefix (e.g. 'mail' for mail.example.com). Leave empty for bare domain. */
82
+ subdomain?: string;
83
+ /** DKIM selector (default: 'default'). */
84
+ dkimSelector?: string;
85
+ /** RSA key size (default: 2048). */
86
+ dkimKeySize?: number;
87
+ /** Enable automatic key rotation (default: false). */
88
+ rotateKeys?: boolean;
89
+ /** Days between rotations (default: 90). */
90
+ rotationIntervalDays?: number;
91
+ /** Optional RemoteIngress edge pinning for this domain. */
92
+ remoteIngress?: IEmailDomainRemoteIngress;
93
+ };
94
+ response: IEmailDomainActionResult & {
95
+ domain?: IEmailDomain;
96
+ };
97
+ }
98
+
99
+ /**
100
+ * Update an email domain's configuration.
101
+ */
102
+ export interface IReq_UpdateEmailDomain extends plugins.typedrequestInterfaces.implementsTR<
103
+ plugins.typedrequestInterfaces.ITypedRequest,
104
+ IReq_UpdateEmailDomain
105
+ > {
106
+ method: 'updateEmailDomain';
107
+ request: {
108
+ identity?: authInterfaces.IIdentity;
109
+ apiToken?: string;
110
+ id: string;
111
+ rotateKeys?: boolean;
112
+ rotationIntervalDays?: number;
113
+ rateLimits?: IEmailDomain['rateLimits'];
114
+ /** RemoteIngress edge pinning; null clears the pin. */
115
+ remoteIngress?: IEmailDomainRemoteIngress | null;
116
+ };
117
+ response: IEmailDomainActionResult;
118
+ }
119
+
120
+ /**
121
+ * Delete an email domain.
122
+ */
123
+ export interface IReq_DeleteEmailDomain extends plugins.typedrequestInterfaces.implementsTR<
124
+ plugins.typedrequestInterfaces.ITypedRequest,
125
+ IReq_DeleteEmailDomain
126
+ > {
127
+ method: 'deleteEmailDomain';
128
+ request: {
129
+ identity?: authInterfaces.IIdentity;
130
+ apiToken?: string;
131
+ id: string;
132
+ };
133
+ response: IEmailDomainActionResult;
134
+ }
135
+
136
+ /**
137
+ * Trigger DNS validation for an email domain.
138
+ * Performs live lookups for MX, SPF, DKIM, and DMARC records.
139
+ */
140
+ export interface IReq_ValidateEmailDomain extends plugins.typedrequestInterfaces.implementsTR<
141
+ plugins.typedrequestInterfaces.ITypedRequest,
142
+ IReq_ValidateEmailDomain
143
+ > {
144
+ method: 'validateEmailDomain';
145
+ request: {
146
+ identity?: authInterfaces.IIdentity;
147
+ apiToken?: string;
148
+ id: string;
149
+ };
150
+ response: IEmailDomainActionResult & {
151
+ domain?: IEmailDomain;
152
+ records?: IEmailDnsRecord[];
153
+ };
154
+ }
155
+
156
+ /**
157
+ * Get the required DNS records for an email domain (for display / copy-paste).
158
+ */
159
+ export interface IReq_GetEmailDomainDnsRecords extends plugins.typedrequestInterfaces.implementsTR<
160
+ plugins.typedrequestInterfaces.ITypedRequest,
161
+ IReq_GetEmailDomainDnsRecords
162
+ > {
163
+ method: 'getEmailDomainDnsRecords';
164
+ request: {
165
+ identity?: authInterfaces.IIdentity;
166
+ apiToken?: string;
167
+ id: string;
168
+ };
169
+ response: {
170
+ records: IEmailDnsRecord[];
171
+ };
172
+ }
173
+
174
+ /**
175
+ * Auto-provision DNS records for an email domain.
176
+ * Creates any missing MX, SPF, DKIM, and DMARC records via the linked
177
+ * domain's DNS path (dcrouter zone or provider API).
178
+ */
179
+ export interface IReq_ProvisionEmailDomainDns extends plugins.typedrequestInterfaces.implementsTR<
180
+ plugins.typedrequestInterfaces.ITypedRequest,
181
+ IReq_ProvisionEmailDomainDns
182
+ > {
183
+ method: 'provisionEmailDomainDns';
184
+ request: {
185
+ identity?: authInterfaces.IIdentity;
186
+ apiToken?: string;
187
+ id: string;
188
+ };
189
+ response: IEmailDomainActionResult & {
190
+ /** Number of records created. */
191
+ provisioned?: number;
192
+ };
193
+ }
@@ -0,0 +1,266 @@
1
+ import * as plugins from '../plugins.js';
2
+ import * as authInterfaces from '../data/auth.js';
3
+
4
+ // ============================================================================
5
+ // Catalog-compatible email types (matches @serve.zone/catalog IEmail/IEmailDetail)
6
+ // ============================================================================
7
+ export type TEmailStatus = 'delivered' | 'bounced' | 'rejected' | 'deferred' | 'pending' | 'accepted' | 'flagged';
8
+ export type TEmailDirection = 'inbound' | 'outbound';
9
+
10
+ export interface IEmail {
11
+ id: string;
12
+ direction: TEmailDirection;
13
+ status: TEmailStatus;
14
+ from: string;
15
+ to: string;
16
+ subject: string;
17
+ timestamp: string;
18
+ messageId: string;
19
+ size: string;
20
+ }
21
+
22
+ export type TEmailLogTrafficWindow = '24h' | '7d' | '14d' | '30d';
23
+
24
+ export interface IEmailLogTrafficPoint {
25
+ timestamp: number;
26
+ value: number;
27
+ }
28
+
29
+ export interface IEmailLogTraffic {
30
+ window: TEmailLogTrafficWindow;
31
+ label: string;
32
+ durationMs: number;
33
+ windowStart: number;
34
+ windowEnd: number;
35
+ bucketSizeMs: number;
36
+ sent: IEmailLogTrafficPoint[];
37
+ received: IEmailLogTrafficPoint[];
38
+ failed: IEmailLogTrafficPoint[];
39
+ }
40
+
41
+ export interface IEmailSecurityFinding {
42
+ id: string;
43
+ timestamp: string;
44
+ from: string;
45
+ to: string;
46
+ subject: string;
47
+ disposition: 'flagged' | 'rejected';
48
+ failures: string[];
49
+ failureSummary: string;
50
+ }
51
+
52
+ export interface ISmtpLogEntry {
53
+ timestamp: string;
54
+ direction: 'client' | 'server' | 'system';
55
+ command: string;
56
+ responseCode?: number;
57
+ }
58
+
59
+ export type TSmtpDeliveryPhase =
60
+ | 'connect'
61
+ | 'greeting'
62
+ | 'ehlo'
63
+ | 'starttls'
64
+ | 'tls_handshake'
65
+ | 'post_tls_ehlo'
66
+ | 'auth'
67
+ | 'mail_from'
68
+ | 'rcpt_to'
69
+ | 'data_command'
70
+ | 'message_body'
71
+ | 'final_response'
72
+ | 'rset'
73
+ | 'quit'
74
+ | 'unknown';
75
+
76
+ export interface ISmtpTranscriptEntry {
77
+ timestampMs: number;
78
+ phase: TSmtpDeliveryPhase;
79
+ direction: 'client' | 'server' | 'system';
80
+ text: string;
81
+ responseCode?: number;
82
+ }
83
+
84
+ export interface IOutboundAuthenticationCheck {
85
+ state: 'pending' | 'completed' | 'indeterminate' | 'not-evaluated';
86
+ overall: 'pass' | 'fail' | 'indeterminate';
87
+ checkedAt: string;
88
+ signedMessageSha256?: string;
89
+ error?: string;
90
+ identity?: {
91
+ sourceIp: string;
92
+ addressFamily: 'ipv4' | 'ipv6';
93
+ heloDomain: string;
94
+ receiverHostname: string;
95
+ envelopeFrom: string;
96
+ dkimDomain?: string;
97
+ dkimSelector?: string;
98
+ };
99
+ dkim?: Array<{
100
+ is_valid: boolean;
101
+ domain: string | null;
102
+ selector: string | null;
103
+ status: string;
104
+ details: string | null;
105
+ }>;
106
+ spf?: { result: string; domain: string; ip: string; explanation: string | null } | null;
107
+ dmarc?: {
108
+ passed: boolean;
109
+ policy: string;
110
+ domain: string;
111
+ dkim_result: string;
112
+ spf_result: string;
113
+ action: string;
114
+ details: string | null;
115
+ } | null;
116
+ }
117
+
118
+ export interface ISmtpTransactionAttempt {
119
+ id: string;
120
+ queueItemId: string;
121
+ queueAttempt: number;
122
+ targetHost: string;
123
+ targetPort: number;
124
+ recipientDomain?: string;
125
+ recipients: string[];
126
+ startedAt: string;
127
+ completedAt: string;
128
+ durationMs: number;
129
+ outcome: 'succeeded' | 'failed';
130
+ retryable: boolean;
131
+ errorType?: string;
132
+ smtpCode?: number;
133
+ recipientResults?: Array<{
134
+ recipient: string;
135
+ accepted: boolean;
136
+ responseCode: number;
137
+ }>;
138
+ failurePhase?: TSmtpDeliveryPhase;
139
+ error?: string;
140
+ outboundAuthentication?: IOutboundAuthenticationCheck;
141
+ transcript: ISmtpTranscriptEntry[];
142
+ }
143
+
144
+ export interface IConnectionInfo {
145
+ sourceIp: string;
146
+ sourceHostname: string;
147
+ destinationIp: string;
148
+ destinationPort: number;
149
+ tlsVersion: string;
150
+ tlsCipher: string;
151
+ authenticated: boolean;
152
+ authMethod: string;
153
+ authUser: string;
154
+ }
155
+
156
+ export interface IAuthenticationResults {
157
+ spf: 'pass' | 'fail' | 'softfail' | 'neutral' | 'none';
158
+ spfDomain: string;
159
+ dkim: 'pass' | 'fail' | 'none';
160
+ dkimDomain: string;
161
+ dmarc: 'pass' | 'fail' | 'none';
162
+ dmarcPolicy: string;
163
+ }
164
+
165
+ export interface IEmailDetail extends IEmail {
166
+ smtpTransactions?: ISmtpTransactionAttempt[];
167
+ /** Epoch ms of the next scheduled delivery attempt (pending/deferred only). */
168
+ nextAttemptAt?: number;
169
+ /** 1-based number of the next scheduled delivery attempt. */
170
+ nextAttemptNumber?: number;
171
+ toList: string[];
172
+ cc?: string[];
173
+ smtpLog: ISmtpLogEntry[];
174
+ connectionInfo: IConnectionInfo;
175
+ authenticationResults: IAuthenticationResults;
176
+ outboundAuthentication?: IOutboundAuthenticationCheck;
177
+ rejectionReason?: string;
178
+ bounceMessage?: string;
179
+ headers: Record<string, string>;
180
+ body: string;
181
+ }
182
+
183
+ // ============================================================================
184
+ // Get All Emails Request
185
+ // ============================================================================
186
+ export interface IReq_GetAllEmails extends plugins.typedrequestInterfaces.implementsTR<
187
+ plugins.typedrequestInterfaces.ITypedRequest,
188
+ IReq_GetAllEmails
189
+ > {
190
+ method: 'getAllEmails';
191
+ request: {
192
+ identity?: authInterfaces.IIdentity;
193
+ apiToken?: string;
194
+ /** Restrict the listing to one direction. Absent = both. */
195
+ direction?: TEmailDirection;
196
+ /** Maximum number of entries to return (default 200). */
197
+ limit?: number;
198
+ /** Literal search across sender, recipients, subject, and message ID. */
199
+ search?: string;
200
+ /** Inclusive accepted-at lower bound in epoch milliseconds. Requires `to`. */
201
+ from?: number;
202
+ /** Inclusive accepted-at upper bound in epoch milliseconds. Requires `from`. */
203
+ to?: number;
204
+ };
205
+ response: {
206
+ emails: IEmail[];
207
+ traffic: IEmailLogTraffic;
208
+ };
209
+ }
210
+
211
+ // ============================================================================
212
+ // Get Email Security Findings Request
213
+ // ============================================================================
214
+ export interface IReq_GetEmailSecurityFindings extends plugins.typedrequestInterfaces.implementsTR<
215
+ plugins.typedrequestInterfaces.ITypedRequest,
216
+ IReq_GetEmailSecurityFindings
217
+ > {
218
+ method: 'getEmailSecurityFindings';
219
+ request: {
220
+ identity?: authInterfaces.IIdentity;
221
+ apiToken?: string;
222
+ /** Maximum number of findings to return (default/max 200). */
223
+ limit?: number;
224
+ };
225
+ response: {
226
+ findings: IEmailSecurityFinding[];
227
+ };
228
+ }
229
+
230
+ // ============================================================================
231
+ // Get Email Detail Request
232
+ // ============================================================================
233
+ export interface IReq_GetEmailDetail extends plugins.typedrequestInterfaces.implementsTR<
234
+ plugins.typedrequestInterfaces.ITypedRequest,
235
+ IReq_GetEmailDetail
236
+ > {
237
+ method: 'getEmailDetail';
238
+ request: {
239
+ identity?: authInterfaces.IIdentity;
240
+ apiToken?: string;
241
+ emailId: string;
242
+ };
243
+ response: {
244
+ email: IEmailDetail | null;
245
+ };
246
+ }
247
+
248
+ // ============================================================================
249
+ // Resend Failed Email Request
250
+ // ============================================================================
251
+ export interface IReq_ResendEmail extends plugins.typedrequestInterfaces.implementsTR<
252
+ plugins.typedrequestInterfaces.ITypedRequest,
253
+ IReq_ResendEmail
254
+ > {
255
+ method: 'resendEmail';
256
+ request: {
257
+ identity?: authInterfaces.IIdentity;
258
+ apiToken?: string;
259
+ emailId: string;
260
+ };
261
+ response: {
262
+ success: boolean;
263
+ newQueueId?: string;
264
+ error?: string;
265
+ };
266
+ }
@@ -0,0 +1,34 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type * as authInterfaces from '../data/auth.js';
3
+ import type { IEmailServerSettings, TEmailServerSettingsUpdate } from '../data/email-settings.js';
4
+
5
+ export interface IReq_GetEmailServerSettings extends plugins.typedrequestInterfaces.implementsTR<
6
+ plugins.typedrequestInterfaces.ITypedRequest,
7
+ IReq_GetEmailServerSettings
8
+ > {
9
+ method: 'getEmailServerSettings';
10
+ request: {
11
+ identity?: authInterfaces.IIdentity;
12
+ apiToken?: string;
13
+ };
14
+ response: {
15
+ settings: IEmailServerSettings;
16
+ };
17
+ }
18
+
19
+ export interface IReq_UpdateEmailServerSettings extends plugins.typedrequestInterfaces.implementsTR<
20
+ plugins.typedrequestInterfaces.ITypedRequest,
21
+ IReq_UpdateEmailServerSettings
22
+ > {
23
+ method: 'updateEmailServerSettings';
24
+ request: {
25
+ identity?: authInterfaces.IIdentity;
26
+ apiToken?: string;
27
+ settings: TEmailServerSettingsUpdate;
28
+ };
29
+ response: {
30
+ success: boolean;
31
+ settings?: IEmailServerSettings;
32
+ message?: string;
33
+ };
34
+ }
@@ -0,0 +1,29 @@
1
+ export * from './admin.js';
2
+ export * from './config.js';
3
+ export * from './logs.js';
4
+ export * from './stats.js';
5
+ export * from './combined.stats.js';
6
+ export * from './radius.js';
7
+ export * from './email-ops.js';
8
+ export * from './certificate.js';
9
+ export * from './remoteingress.js';
10
+ export * from './route-management.js';
11
+ export * from './api-tokens.js';
12
+ export * from './vpn.js';
13
+ export * from './source-profiles.js';
14
+ export * from './target-profiles.js';
15
+ export * from './network-targets.js';
16
+ export * from './users.js';
17
+ export * from './dns-providers.js';
18
+ export * from './domains.js';
19
+ export * from './dns-authority.js';
20
+ export * from './dns-records.js';
21
+ export * from './acme-config.js';
22
+ export * from './email-domains.js';
23
+ export * from './email-settings.js';
24
+ export * from './smtp-accounts.js';
25
+ export * from './realtime.js';
26
+ export * from './workhoster.js';
27
+ export * from './security-policy.js';
28
+ export * from './config-events.js';
29
+ export * from './testing.js';
@@ -0,0 +1,58 @@
1
+ import * as plugins from '../plugins.js';
2
+ import * as authInterfaces from '../data/auth.js';
3
+ import * as statsInterfaces from '../data/stats.js';
4
+
5
+ // Get Recent Logs
6
+ export interface IReq_GetRecentLogs extends plugins.typedrequestInterfaces.implementsTR<
7
+ plugins.typedrequestInterfaces.ITypedRequest,
8
+ IReq_GetRecentLogs
9
+ > {
10
+ method: 'getRecentLogs';
11
+ request: {
12
+ identity?: authInterfaces.IIdentity;
13
+ apiToken?: string;
14
+ level?: 'debug' | 'info' | 'warn' | 'error';
15
+ category?: 'smtp' | 'dns' | 'security' | 'system' | 'email';
16
+ limit?: number;
17
+ offset?: number;
18
+ search?: string;
19
+ timeRange?: '1h' | '6h' | '24h' | '7d' | '30d';
20
+ };
21
+ response: {
22
+ logs: statsInterfaces.ILogEntry[];
23
+ total: number;
24
+ hasMore: boolean;
25
+ };
26
+ }
27
+
28
+ // Get Log Stream
29
+ export interface IReq_GetLogStream extends plugins.typedrequestInterfaces.implementsTR<
30
+ plugins.typedrequestInterfaces.ITypedRequest,
31
+ IReq_GetLogStream
32
+ > {
33
+ method: 'getLogStream';
34
+ request: {
35
+ identity?: authInterfaces.IIdentity;
36
+ apiToken?: string;
37
+ follow?: boolean;
38
+ filters?: {
39
+ level?: string[];
40
+ category?: string[];
41
+ };
42
+ };
43
+ response: {
44
+ logStream: plugins.typedrequestInterfaces.TVirtualStream<'receive'>;
45
+ };
46
+ }
47
+
48
+ // Push Log Entry (server → client via TypedSocket)
49
+ export interface IReq_PushLogEntry extends plugins.typedrequestInterfaces.implementsTR<
50
+ plugins.typedrequestInterfaces.ITypedRequest,
51
+ IReq_PushLogEntry
52
+ > {
53
+ method: 'pushLogEntry';
54
+ request: {
55
+ entry: statsInterfaces.ILogEntry;
56
+ };
57
+ response: {};
58
+ }
@@ -0,0 +1,127 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type * as authInterfaces from '../data/auth.js';
3
+ import type { INetworkTarget } from '../data/route-management.js';
4
+
5
+ // ============================================================================
6
+ // Network Target Endpoints
7
+ // ============================================================================
8
+
9
+ /**
10
+ * Get all network targets.
11
+ */
12
+ export interface IReq_GetNetworkTargets extends plugins.typedrequestInterfaces.implementsTR<
13
+ plugins.typedrequestInterfaces.ITypedRequest,
14
+ IReq_GetNetworkTargets
15
+ > {
16
+ method: 'getNetworkTargets';
17
+ request: {
18
+ identity?: authInterfaces.IIdentity;
19
+ apiToken?: string;
20
+ };
21
+ response: {
22
+ targets: INetworkTarget[];
23
+ };
24
+ }
25
+
26
+ /**
27
+ * Get a single network target by ID.
28
+ */
29
+ export interface IReq_GetNetworkTarget extends plugins.typedrequestInterfaces.implementsTR<
30
+ plugins.typedrequestInterfaces.ITypedRequest,
31
+ IReq_GetNetworkTarget
32
+ > {
33
+ method: 'getNetworkTarget';
34
+ request: {
35
+ identity?: authInterfaces.IIdentity;
36
+ apiToken?: string;
37
+ id: string;
38
+ };
39
+ response: {
40
+ target: INetworkTarget | null;
41
+ };
42
+ }
43
+
44
+ /**
45
+ * Create a new network target.
46
+ */
47
+ export interface IReq_CreateNetworkTarget extends plugins.typedrequestInterfaces.implementsTR<
48
+ plugins.typedrequestInterfaces.ITypedRequest,
49
+ IReq_CreateNetworkTarget
50
+ > {
51
+ method: 'createNetworkTarget';
52
+ request: {
53
+ identity?: authInterfaces.IIdentity;
54
+ apiToken?: string;
55
+ name: string;
56
+ description?: string;
57
+ host: string | string[];
58
+ port: number;
59
+ };
60
+ response: {
61
+ success: boolean;
62
+ id?: string;
63
+ message?: string;
64
+ };
65
+ }
66
+
67
+ /**
68
+ * Update a network target.
69
+ */
70
+ export interface IReq_UpdateNetworkTarget extends plugins.typedrequestInterfaces.implementsTR<
71
+ plugins.typedrequestInterfaces.ITypedRequest,
72
+ IReq_UpdateNetworkTarget
73
+ > {
74
+ method: 'updateNetworkTarget';
75
+ request: {
76
+ identity?: authInterfaces.IIdentity;
77
+ apiToken?: string;
78
+ id: string;
79
+ name?: string;
80
+ description?: string;
81
+ host?: string | string[];
82
+ port?: number;
83
+ };
84
+ response: {
85
+ success: boolean;
86
+ affectedRouteCount?: number;
87
+ message?: string;
88
+ };
89
+ }
90
+
91
+ /**
92
+ * Delete a network target.
93
+ */
94
+ export interface IReq_DeleteNetworkTarget extends plugins.typedrequestInterfaces.implementsTR<
95
+ plugins.typedrequestInterfaces.ITypedRequest,
96
+ IReq_DeleteNetworkTarget
97
+ > {
98
+ method: 'deleteNetworkTarget';
99
+ request: {
100
+ identity?: authInterfaces.IIdentity;
101
+ apiToken?: string;
102
+ id: string;
103
+ force?: boolean;
104
+ };
105
+ response: {
106
+ success: boolean;
107
+ message?: string;
108
+ };
109
+ }
110
+
111
+ /**
112
+ * Get which routes reference a network target.
113
+ */
114
+ export interface IReq_GetNetworkTargetUsage extends plugins.typedrequestInterfaces.implementsTR<
115
+ plugins.typedrequestInterfaces.ITypedRequest,
116
+ IReq_GetNetworkTargetUsage
117
+ > {
118
+ method: 'getNetworkTargetUsage';
119
+ request: {
120
+ identity?: authInterfaces.IIdentity;
121
+ apiToken?: string;
122
+ id: string;
123
+ };
124
+ response: {
125
+ routes: Array<{ id: string; name: string }>;
126
+ };
127
+ }