@easybits.cloud/mailmask 0.4.9 → 0.4.10
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 +20 -3
- package/dist/index.cjs +21 -4
- package/dist/index.js +21 -4
- package/dist/types.d.ts +65 -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, 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
|
}
|
|
@@ -81,9 +91,16 @@ declare class DnsResource {
|
|
|
81
91
|
ok: boolean;
|
|
82
92
|
changeId: string;
|
|
83
93
|
}>;
|
|
84
|
-
|
|
94
|
+
/** Con 'easybits' publica un sitio de la cuenta conectada (`opts.websiteId`), igual que `domains.publishEasyBitsSite`. */
|
|
95
|
+
preset(domainId: string, preset: DnsPreset, target?: string, subdomain?: string, opts?: {
|
|
96
|
+
websiteId?: string;
|
|
97
|
+
placement?: "apex" | "subdomain";
|
|
98
|
+
}): Promise<DnsChangeResult>;
|
|
85
99
|
/** 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
|
|
100
|
+
presetPreview(domainId: string, preset: DnsPreset, target?: string, subdomain?: string, opts?: {
|
|
101
|
+
websiteId?: string;
|
|
102
|
+
placement?: "apex" | "subdomain";
|
|
103
|
+
}): Promise<DnsPresetPreview>;
|
|
87
104
|
/** A dónde apunta el sitio (raíz, www y subdominios), qué plataforma es, qué está mal y si responde por HTTPS. */
|
|
88
105
|
website(domainId: string): Promise<WebsiteStatus>;
|
|
89
106
|
}
|
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();
|
|
@@ -150,12 +166,13 @@ var DnsResource = class {
|
|
|
150
166
|
delete(domainId, name, type) {
|
|
151
167
|
return this.req(`/api/domains/${domainId}/dns/records`, { method: "DELETE", body: JSON.stringify({ name, type }) });
|
|
152
168
|
}
|
|
153
|
-
|
|
154
|
-
|
|
169
|
+
/** Con 'easybits' publica un sitio de la cuenta conectada (`opts.websiteId`), igual que `domains.publishEasyBitsSite`. */
|
|
170
|
+
preset(domainId, preset, target, subdomain, opts) {
|
|
171
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts }) });
|
|
155
172
|
}
|
|
156
173
|
/** 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 }) });
|
|
174
|
+
presetPreview(domainId, preset, target, subdomain, opts) {
|
|
175
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts, dryRun: true }) });
|
|
159
176
|
}
|
|
160
177
|
/** A dónde apunta el sitio (raíz, www y subdominios), qué plataforma es, qué está mal y si responde por HTTPS. */
|
|
161
178
|
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();
|
|
@@ -122,12 +138,13 @@ var DnsResource = class {
|
|
|
122
138
|
delete(domainId, name, type) {
|
|
123
139
|
return this.req(`/api/domains/${domainId}/dns/records`, { method: "DELETE", body: JSON.stringify({ name, type }) });
|
|
124
140
|
}
|
|
125
|
-
|
|
126
|
-
|
|
141
|
+
/** Con 'easybits' publica un sitio de la cuenta conectada (`opts.websiteId`), igual que `domains.publishEasyBitsSite`. */
|
|
142
|
+
preset(domainId, preset, target, subdomain, opts) {
|
|
143
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts }) });
|
|
127
144
|
}
|
|
128
145
|
/** 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 }) });
|
|
146
|
+
presetPreview(domainId, preset, target, subdomain, opts) {
|
|
147
|
+
return this.req(`/api/domains/${domainId}/dns/preset`, { method: "POST", body: JSON.stringify({ preset, target, subdomain, ...opts, dryRun: true }) });
|
|
131
148
|
}
|
|
132
149
|
/** A dónde apunta el sitio (raíz, www y subdominios), qué plataforma es, qué está mal y si responde por HTTPS. */
|
|
133
150
|
website(domainId) {
|
package/dist/types.d.ts
CHANGED
|
@@ -407,6 +407,71 @@ export interface WebsiteStatus {
|
|
|
407
407
|
editable: boolean;
|
|
408
408
|
hosts: WebsiteHost[];
|
|
409
409
|
}
|
|
410
|
+
export interface EasyBitsSite {
|
|
411
|
+
id: string;
|
|
412
|
+
name: string;
|
|
413
|
+
slug: string;
|
|
414
|
+
status: string;
|
|
415
|
+
url: string;
|
|
416
|
+
subdomainUrl?: string | null;
|
|
417
|
+
}
|
|
418
|
+
export interface PublishEasyBitsSiteInput {
|
|
419
|
+
/** El sitio de EasyBits: los de la cuenta salen en `easyBitsSiteStatus().sites`. */
|
|
420
|
+
websiteId: string;
|
|
421
|
+
/** 'apex' = raíz y www; 'subdomain' = `<slug>.<dominio>`. */
|
|
422
|
+
placement: "apex" | "subdomain";
|
|
423
|
+
/** Vista previa: lo que escribiría y lo que hay hoy, sin tocar EasyBits ni el DNS. */
|
|
424
|
+
dryRun?: boolean;
|
|
425
|
+
}
|
|
426
|
+
export interface EasyBitsPublishResult {
|
|
427
|
+
dryRun: boolean;
|
|
428
|
+
url: string;
|
|
429
|
+
site: EasyBitsSite;
|
|
430
|
+
records: DnsRRSet[];
|
|
431
|
+
/** Sólo en vista previa: lo que hay hoy en cada (nombre, tipo), null = nada. */
|
|
432
|
+
current?: (DnsRRSet | null)[];
|
|
433
|
+
/** EasyBits ya vio el TXT; si es false, el DNS ya está y la verificación llega en minutos. */
|
|
434
|
+
verified?: boolean;
|
|
435
|
+
easybitsDomainId?: string;
|
|
436
|
+
}
|
|
437
|
+
export interface EasyBitsSiteStatus {
|
|
438
|
+
/** Si quien pregunta tiene su cuenta de EasyBits conectada (se conecta en el navegador). */
|
|
439
|
+
linked: boolean;
|
|
440
|
+
/** Los sitios de la cuenta de EasyBits conectada (vacío sin conexión o si EasyBits no respondió). */
|
|
441
|
+
sites: EasyBitsSite[];
|
|
442
|
+
published: boolean;
|
|
443
|
+
publication: {
|
|
444
|
+
websiteId: string;
|
|
445
|
+
placement: "apex" | "subdomain";
|
|
446
|
+
url: string;
|
|
447
|
+
publishedBy: string;
|
|
448
|
+
records: DnsRRSet[];
|
|
449
|
+
createdAt: string;
|
|
450
|
+
updatedAt: string;
|
|
451
|
+
} | null;
|
|
452
|
+
}
|
|
453
|
+
export interface EasyBitsUnpublishResult {
|
|
454
|
+
ok: true;
|
|
455
|
+
/** No había nada publicado. */
|
|
456
|
+
nothing?: true;
|
|
457
|
+
/** Registros que volvieron a como estaban antes de publicar (`to: null` = se borró). */
|
|
458
|
+
restored: {
|
|
459
|
+
name: string;
|
|
460
|
+
type: string;
|
|
461
|
+
to: DnsRRSet | null;
|
|
462
|
+
}[];
|
|
463
|
+
/** Registros que el usuario cambió después de publicar: se dejaron como están. */
|
|
464
|
+
skipped: {
|
|
465
|
+
name: string;
|
|
466
|
+
type: string;
|
|
467
|
+
current: DnsRRSet | null;
|
|
468
|
+
}[];
|
|
469
|
+
easybits: {
|
|
470
|
+
apexCleared: boolean;
|
|
471
|
+
domainDeleted: boolean;
|
|
472
|
+
error?: string;
|
|
473
|
+
};
|
|
474
|
+
}
|
|
410
475
|
export interface DnsSetupRecord {
|
|
411
476
|
id: string;
|
|
412
477
|
type: "MX" | "TXT" | "CNAME";
|