@easybits.cloud/mailmask 0.4.9 → 0.4.11
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/dist/client.d.ts +22 -3
- package/dist/index.cjs +25 -4
- package/dist/index.js +25 -4
- package/dist/types.d.ts +85 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MailMaskConfig, Domain, DomainCreated, DomainVerification, Alias, AliasCreated, MailboxCreated, CreateAliasInput, UpdateAliasInput, Rule, CreateRuleInput, UpdateRuleInput, EmailLog, SendEmailInput, BulkSendInput, BulkJob, BulkJobCreated, SmtpCredential, SmtpCredentialCreated, ApiKey, SendOptions, UploadAttachmentInput, UploadedAttachment, Suppression, Webhook, WebhookCreated, CreateWebhookInput, UpdateWebhookInput, WebhookDelivery, DnsRecordType, DnsListResponse, DnsZoneCreated, DnsDelegation, DnsImportResult, DnsChangeResult, DnsPreset, DnsPresetPreview, DnsSetup, WebsiteStatus, BillingStatus, AddonsResponse, CheckoutLink, DomainSearchResult, TldPrice, DomainRegistrationCreated, DomainRegistration, TransferCheck, TransferDnsInventory, RenewalLink, DomainMember, DomainInvite, CannedReply, AccountProfile, AccountMe, AccountExport, InboxPage, InboxListOptions, InboxConversation, InboxConversationDetail, InboxComposeInput, InboxReplyInput, InboxUpdateInput, InboxNote, OrdersPage, ReferralStats, UploadedEmailImage } from "./types.js";
|
|
1
|
+
import type { MailMaskConfig, Domain, DomainCreated, DomainVerification, Alias, AliasCreated, MailboxCreated, CreateAliasInput, UpdateAliasInput, Rule, CreateRuleInput, UpdateRuleInput, EmailLog, SendEmailInput, BulkSendInput, BulkJob, BulkJobCreated, SmtpCredential, SmtpCredentialCreated, ApiKey, SendOptions, UploadAttachmentInput, UploadedAttachment, Suppression, Webhook, WebhookCreated, CreateWebhookInput, UpdateWebhookInput, WebhookDelivery, DnsRecordType, DnsListResponse, DnsZoneCreated, DnsDelegation, DnsImportResult, DnsAudit, DnsChangeResult, DnsPreset, DnsPresetPreview, DnsSetup, WebsiteStatus, PublishEasyBitsSiteInput, EasyBitsPublishResult, EasyBitsSiteStatus, EasyBitsUnpublishResult, BillingStatus, AddonsResponse, CheckoutLink, DomainSearchResult, TldPrice, DomainRegistrationCreated, DomainRegistration, TransferCheck, TransferDnsInventory, RenewalLink, DomainMember, DomainInvite, CannedReply, AccountProfile, AccountMe, AccountExport, InboxPage, InboxListOptions, InboxConversation, InboxConversationDetail, InboxComposeInput, InboxReplyInput, InboxUpdateInput, InboxNote, OrdersPage, ReferralStats, UploadedEmailImage } from "./types.js";
|
|
2
2
|
declare class MailMaskError extends Error {
|
|
3
3
|
status: number;
|
|
4
4
|
constructor(status: number, message: string);
|
|
@@ -60,6 +60,16 @@ declare class DomainsResource {
|
|
|
60
60
|
removeLogo(id: string): Promise<{
|
|
61
61
|
ok: boolean;
|
|
62
62
|
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Publica un sitio de EasyBits en el dominio: lo da de alta en EasyBits, escribe sus
|
|
65
|
+
* registros (sin tocar el correo), verifica y, en la raíz, lo asigna. Requiere la cuenta
|
|
66
|
+
* de EasyBits conectada en el navegador; sin ella, 409 con la liga para conectarla.
|
|
67
|
+
*/
|
|
68
|
+
publishEasyBitsSite(id: string, input: PublishEasyBitsSiteInput): Promise<EasyBitsPublishResult>;
|
|
69
|
+
/** Quita el sitio: el DNS vuelve a como estaba (lo que cambiaste después no se toca) y se limpia EasyBits. */
|
|
70
|
+
unpublishEasyBitsSite(id: string): Promise<EasyBitsUnpublishResult>;
|
|
71
|
+
/** Qué sitio de EasyBits está publicado en el dominio, si alguno, y si la cuenta está conectada. */
|
|
72
|
+
easyBitsSiteStatus(id: string): Promise<EasyBitsSiteStatus>;
|
|
63
73
|
/** Imagen para incrustar en un correo saliente (PNG, JPG, GIF o WebP; máx. 2 MB). Efímera: se borra tras enviarse o por el barrido diario. */
|
|
64
74
|
uploadImage(id: string, file: Blob, filename?: string): Promise<UploadedEmailImage>;
|
|
65
75
|
}
|
|
@@ -70,6 +80,8 @@ declare class DnsResource {
|
|
|
70
80
|
createZone(domainId: string): Promise<DnsZoneCreated>;
|
|
71
81
|
delegation(domainId: string): Promise<DnsDelegation>;
|
|
72
82
|
import(domainId: string): Promise<DnsImportResult>;
|
|
83
|
+
/** Mide qué registros siguen vivos y los clasifica para podar (sólo lectura). */
|
|
84
|
+
audit(domainId: string): Promise<DnsAudit>;
|
|
73
85
|
/** Reemplaza el conjunto: `values` sustituye por completo lo que hubiera en ese nombre y tipo. */
|
|
74
86
|
upsert(domainId: string, record: {
|
|
75
87
|
name: string;
|
|
@@ -81,9 +93,16 @@ declare class DnsResource {
|
|
|
81
93
|
ok: boolean;
|
|
82
94
|
changeId: string;
|
|
83
95
|
}>;
|
|
84
|
-
|
|
96
|
+
/** Con 'easybits' publica un sitio de la cuenta conectada (`opts.websiteId`), igual que `domains.publishEasyBitsSite`. */
|
|
97
|
+
preset(domainId: string, preset: DnsPreset, target?: string, subdomain?: string, opts?: {
|
|
98
|
+
websiteId?: string;
|
|
99
|
+
placement?: "apex" | "subdomain";
|
|
100
|
+
}): Promise<DnsChangeResult>;
|
|
85
101
|
/** Vista previa de una plantilla: lo que escribiría y lo que hay hoy, sin tocar nada. */
|
|
86
|
-
presetPreview(domainId: string, preset: DnsPreset, target?: string, subdomain?: string
|
|
102
|
+
presetPreview(domainId: string, preset: DnsPreset, target?: string, subdomain?: string, opts?: {
|
|
103
|
+
websiteId?: string;
|
|
104
|
+
placement?: "apex" | "subdomain";
|
|
105
|
+
}): Promise<DnsPresetPreview>;
|
|
87
106
|
/** A dónde apunta el sitio (raíz, www y subdominios), qué plataforma es, qué está mal y si responde por HTTPS. */
|
|
88
107
|
website(domainId: string): Promise<WebsiteStatus>;
|
|
89
108
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -120,6 +120,22 @@ var DomainsResource = class {
|
|
|
120
120
|
removeLogo(id) {
|
|
121
121
|
return this.req(`/api/domains/${id}/logo`, { method: "DELETE" });
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Publica un sitio de EasyBits en el dominio: lo da de alta en EasyBits, escribe sus
|
|
125
|
+
* registros (sin tocar el correo), verifica y, en la raíz, lo asigna. Requiere la cuenta
|
|
126
|
+
* de EasyBits conectada en el navegador; sin ella, 409 con la liga para conectarla.
|
|
127
|
+
*/
|
|
128
|
+
publishEasyBitsSite(id, input) {
|
|
129
|
+
return this.req(`/api/domains/${id}/website/easybits`, { method: "POST", body: JSON.stringify(input) });
|
|
130
|
+
}
|
|
131
|
+
/** Quita el sitio: el DNS vuelve a como estaba (lo que cambiaste después no se toca) y se limpia EasyBits. */
|
|
132
|
+
unpublishEasyBitsSite(id) {
|
|
133
|
+
return this.req(`/api/domains/${id}/website/easybits`, { method: "DELETE" });
|
|
134
|
+
}
|
|
135
|
+
/** Qué sitio de EasyBits está publicado en el dominio, si alguno, y si la cuenta está conectada. */
|
|
136
|
+
easyBitsSiteStatus(id) {
|
|
137
|
+
return this.req(`/api/domains/${id}/website/easybits`);
|
|
138
|
+
}
|
|
123
139
|
/** Imagen para incrustar en un correo saliente (PNG, JPG, GIF o WebP; máx. 2 MB). Efímera: se borra tras enviarse o por el barrido diario. */
|
|
124
140
|
uploadImage(id, file, filename = "imagen") {
|
|
125
141
|
const form = new FormData();
|
|
@@ -143,6 +159,10 @@ var DnsResource = class {
|
|
|
143
159
|
import(domainId) {
|
|
144
160
|
return this.req(`/api/domains/${domainId}/dns/import`, { method: "POST" });
|
|
145
161
|
}
|
|
162
|
+
/** Mide qué registros siguen vivos y los clasifica para podar (sólo lectura). */
|
|
163
|
+
audit(domainId) {
|
|
164
|
+
return this.req(`/api/domains/${domainId}/dns/audit`);
|
|
165
|
+
}
|
|
146
166
|
/** Reemplaza el conjunto: `values` sustituye por completo lo que hubiera en ese nombre y tipo. */
|
|
147
167
|
upsert(domainId, record) {
|
|
148
168
|
return this.req(`/api/domains/${domainId}/dns/records`, { method: "PUT", body: JSON.stringify(record) });
|
|
@@ -150,12 +170,13 @@ var DnsResource = class {
|
|
|
150
170
|
delete(domainId, name, type) {
|
|
151
171
|
return this.req(`/api/domains/${domainId}/dns/records`, { method: "DELETE", body: JSON.stringify({ name, type }) });
|
|
152
172
|
}
|
|
153
|
-
|
|
154
|
-
|
|
173
|
+
/** Con 'easybits' publica un sitio de la cuenta conectada (`opts.websiteId`), igual que `domains.publishEasyBitsSite`. */
|
|
174
|
+
preset(domainId, preset, target, subdomain, opts) {
|
|
175
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts }) });
|
|
155
176
|
}
|
|
156
177
|
/** Vista previa de una plantilla: lo que escribiría y lo que hay hoy, sin tocar nada. */
|
|
157
|
-
presetPreview(domainId, preset, target, subdomain) {
|
|
158
|
-
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, dryRun: true }) });
|
|
178
|
+
presetPreview(domainId, preset, target, subdomain, opts) {
|
|
179
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts, dryRun: true }) });
|
|
159
180
|
}
|
|
160
181
|
/** A dónde apunta el sitio (raíz, www y subdominios), qué plataforma es, qué está mal y si responde por HTTPS. */
|
|
161
182
|
website(domainId) {
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,22 @@ var DomainsResource = class {
|
|
|
92
92
|
removeLogo(id) {
|
|
93
93
|
return this.req(`/api/domains/${id}/logo`, { method: "DELETE" });
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Publica un sitio de EasyBits en el dominio: lo da de alta en EasyBits, escribe sus
|
|
97
|
+
* registros (sin tocar el correo), verifica y, en la raíz, lo asigna. Requiere la cuenta
|
|
98
|
+
* de EasyBits conectada en el navegador; sin ella, 409 con la liga para conectarla.
|
|
99
|
+
*/
|
|
100
|
+
publishEasyBitsSite(id, input) {
|
|
101
|
+
return this.req(`/api/domains/${id}/website/easybits`, { method: "POST", body: JSON.stringify(input) });
|
|
102
|
+
}
|
|
103
|
+
/** Quita el sitio: el DNS vuelve a como estaba (lo que cambiaste después no se toca) y se limpia EasyBits. */
|
|
104
|
+
unpublishEasyBitsSite(id) {
|
|
105
|
+
return this.req(`/api/domains/${id}/website/easybits`, { method: "DELETE" });
|
|
106
|
+
}
|
|
107
|
+
/** Qué sitio de EasyBits está publicado en el dominio, si alguno, y si la cuenta está conectada. */
|
|
108
|
+
easyBitsSiteStatus(id) {
|
|
109
|
+
return this.req(`/api/domains/${id}/website/easybits`);
|
|
110
|
+
}
|
|
95
111
|
/** Imagen para incrustar en un correo saliente (PNG, JPG, GIF o WebP; máx. 2 MB). Efímera: se borra tras enviarse o por el barrido diario. */
|
|
96
112
|
uploadImage(id, file, filename = "imagen") {
|
|
97
113
|
const form = new FormData();
|
|
@@ -115,6 +131,10 @@ var DnsResource = class {
|
|
|
115
131
|
import(domainId) {
|
|
116
132
|
return this.req(`/api/domains/${domainId}/dns/import`, { method: "POST" });
|
|
117
133
|
}
|
|
134
|
+
/** Mide qué registros siguen vivos y los clasifica para podar (sólo lectura). */
|
|
135
|
+
audit(domainId) {
|
|
136
|
+
return this.req(`/api/domains/${domainId}/dns/audit`);
|
|
137
|
+
}
|
|
118
138
|
/** Reemplaza el conjunto: `values` sustituye por completo lo que hubiera en ese nombre y tipo. */
|
|
119
139
|
upsert(domainId, record) {
|
|
120
140
|
return this.req(`/api/domains/${domainId}/dns/records`, { method: "PUT", body: JSON.stringify(record) });
|
|
@@ -122,12 +142,13 @@ var DnsResource = class {
|
|
|
122
142
|
delete(domainId, name, type) {
|
|
123
143
|
return this.req(`/api/domains/${domainId}/dns/records`, { method: "DELETE", body: JSON.stringify({ name, type }) });
|
|
124
144
|
}
|
|
125
|
-
|
|
126
|
-
|
|
145
|
+
/** Con 'easybits' publica un sitio de la cuenta conectada (`opts.websiteId`), igual que `domains.publishEasyBitsSite`. */
|
|
146
|
+
preset(domainId, preset, target, subdomain, opts) {
|
|
147
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts }) });
|
|
127
148
|
}
|
|
128
149
|
/** Vista previa de una plantilla: lo que escribiría y lo que hay hoy, sin tocar nada. */
|
|
129
|
-
presetPreview(domainId, preset, target, subdomain) {
|
|
130
|
-
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, dryRun: true }) });
|
|
150
|
+
presetPreview(domainId, preset, target, subdomain, opts) {
|
|
151
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts, dryRun: true }) });
|
|
131
152
|
}
|
|
132
153
|
/** A dónde apunta el sitio (raíz, www y subdominios), qué plataforma es, qué está mal y si responde por HTTPS. */
|
|
133
154
|
website(domainId) {
|
package/dist/types.d.ts
CHANGED
|
@@ -350,6 +350,26 @@ export interface DnsListResponse {
|
|
|
350
350
|
/** Presente cuando todavía no hay zona: dice qué hacer. */
|
|
351
351
|
hint?: string;
|
|
352
352
|
}
|
|
353
|
+
export type DnsAuditVerdict = "takeover_risk" | "duplicated_name" | "not_responding" | "previous_provider" | "cert_validation" | "in_use" | "keep";
|
|
354
|
+
export interface DnsAuditFinding {
|
|
355
|
+
name: string;
|
|
356
|
+
type: string;
|
|
357
|
+
values: string[];
|
|
358
|
+
verdict: DnsAuditVerdict;
|
|
359
|
+
/** Lo que se midió, en español. */
|
|
360
|
+
evidence: string;
|
|
361
|
+
/** Qué conviene hacer, en español. */
|
|
362
|
+
action: string;
|
|
363
|
+
}
|
|
364
|
+
/** Respuesta de `dns.audit`: hallazgos ordenados, los urgentes primero. */
|
|
365
|
+
export interface DnsAudit {
|
|
366
|
+
domain: string;
|
|
367
|
+
checkedAt: string;
|
|
368
|
+
summary: Partial<Record<DnsAuditVerdict, number>>;
|
|
369
|
+
findings: DnsAuditFinding[];
|
|
370
|
+
truncated: boolean;
|
|
371
|
+
note: string;
|
|
372
|
+
}
|
|
353
373
|
export interface DnsZoneCreated {
|
|
354
374
|
hostedZoneId: string;
|
|
355
375
|
nameservers: string[];
|
|
@@ -407,6 +427,71 @@ export interface WebsiteStatus {
|
|
|
407
427
|
editable: boolean;
|
|
408
428
|
hosts: WebsiteHost[];
|
|
409
429
|
}
|
|
430
|
+
export interface EasyBitsSite {
|
|
431
|
+
id: string;
|
|
432
|
+
name: string;
|
|
433
|
+
slug: string;
|
|
434
|
+
status: string;
|
|
435
|
+
url: string;
|
|
436
|
+
subdomainUrl?: string | null;
|
|
437
|
+
}
|
|
438
|
+
export interface PublishEasyBitsSiteInput {
|
|
439
|
+
/** El sitio de EasyBits: los de la cuenta salen en `easyBitsSiteStatus().sites`. */
|
|
440
|
+
websiteId: string;
|
|
441
|
+
/** 'apex' = raíz y www; 'subdomain' = `<slug>.<dominio>`. */
|
|
442
|
+
placement: "apex" | "subdomain";
|
|
443
|
+
/** Vista previa: lo que escribiría y lo que hay hoy, sin tocar EasyBits ni el DNS. */
|
|
444
|
+
dryRun?: boolean;
|
|
445
|
+
}
|
|
446
|
+
export interface EasyBitsPublishResult {
|
|
447
|
+
dryRun: boolean;
|
|
448
|
+
url: string;
|
|
449
|
+
site: EasyBitsSite;
|
|
450
|
+
records: DnsRRSet[];
|
|
451
|
+
/** Sólo en vista previa: lo que hay hoy en cada (nombre, tipo), null = nada. */
|
|
452
|
+
current?: (DnsRRSet | null)[];
|
|
453
|
+
/** EasyBits ya vio el TXT; si es false, el DNS ya está y la verificación llega en minutos. */
|
|
454
|
+
verified?: boolean;
|
|
455
|
+
easybitsDomainId?: string;
|
|
456
|
+
}
|
|
457
|
+
export interface EasyBitsSiteStatus {
|
|
458
|
+
/** Si quien pregunta tiene su cuenta de EasyBits conectada (se conecta en el navegador). */
|
|
459
|
+
linked: boolean;
|
|
460
|
+
/** Los sitios de la cuenta de EasyBits conectada (vacío sin conexión o si EasyBits no respondió). */
|
|
461
|
+
sites: EasyBitsSite[];
|
|
462
|
+
published: boolean;
|
|
463
|
+
publication: {
|
|
464
|
+
websiteId: string;
|
|
465
|
+
placement: "apex" | "subdomain";
|
|
466
|
+
url: string;
|
|
467
|
+
publishedBy: string;
|
|
468
|
+
records: DnsRRSet[];
|
|
469
|
+
createdAt: string;
|
|
470
|
+
updatedAt: string;
|
|
471
|
+
} | null;
|
|
472
|
+
}
|
|
473
|
+
export interface EasyBitsUnpublishResult {
|
|
474
|
+
ok: true;
|
|
475
|
+
/** No había nada publicado. */
|
|
476
|
+
nothing?: true;
|
|
477
|
+
/** Registros que volvieron a como estaban antes de publicar (`to: null` = se borró). */
|
|
478
|
+
restored: {
|
|
479
|
+
name: string;
|
|
480
|
+
type: string;
|
|
481
|
+
to: DnsRRSet | null;
|
|
482
|
+
}[];
|
|
483
|
+
/** Registros que el usuario cambió después de publicar: se dejaron como están. */
|
|
484
|
+
skipped: {
|
|
485
|
+
name: string;
|
|
486
|
+
type: string;
|
|
487
|
+
current: DnsRRSet | null;
|
|
488
|
+
}[];
|
|
489
|
+
easybits: {
|
|
490
|
+
apexCleared: boolean;
|
|
491
|
+
domainDeleted: boolean;
|
|
492
|
+
error?: string;
|
|
493
|
+
};
|
|
494
|
+
}
|
|
410
495
|
export interface DnsSetupRecord {
|
|
411
496
|
id: string;
|
|
412
497
|
type: "MX" | "TXT" | "CNAME";
|